Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a71a3617
Commit
a71a3617
authored
Oct 27, 2022
by
wujiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
85c69978
885cb432
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
2804 additions
and
556 deletions
+2804
-556
ReginParams.java
...java/com/yeejoin/amos/boot/biz/common/bo/ReginParams.java
+7
-7
CompanyTypeEnum.java
...eejoin/amos/boot/module/ugp/api/Enum/CompanyTypeEnum.java
+36
-0
NoticeStatusEnum.java
...ejoin/amos/boot/module/ugp/api/Enum/NoticeStatusEnum.java
+2
-2
OrgEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
+3
-3
ProblemProcessEnum.java
...oin/amos/boot/module/ugp/api/Enum/ProblemProcessEnum.java
+2
-1
ProjectInitiationEnum.java
.../amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
+21
-35
SMSEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/SMSEnum.java
+2
-1
StageEnum.java
.../com/yeejoin/amos/boot/module/ugp/api/Enum/StageEnum.java
+15
-12
VerifyEnum.java
...com/yeejoin/amos/boot/module/ugp/api/Enum/VerifyEnum.java
+8
-4
VerifyTypeEnum.java
...yeejoin/amos/boot/module/ugp/api/Enum/VerifyTypeEnum.java
+26
-0
XJConstant.java
...eejoin/amos/boot/module/ugp/api/constants/XJConstant.java
+10
-0
AcceptDto.java
...a/com/yeejoin/amos/boot/module/ugp/api/dto/AcceptDto.java
+59
-0
InstallNoticeDto.java
...eejoin/amos/boot/module/ugp/api/dto/InstallNoticeDto.java
+3
-0
InstallNoticePageDto.java
...in/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
+4
-0
ProjectDto.java
.../com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
+17
-0
ProjectMaterialDto.java
...join/amos/boot/module/ugp/api/dto/ProjectMaterialDto.java
+75
-0
SmartListDto.java
...om/yeejoin/amos/boot/module/ugp/api/dto/SmartListDto.java
+117
-0
SuperviseRuleDto.java
...eejoin/amos/boot/module/ugp/api/dto/SuperviseRuleDto.java
+1
-1
Company.java
.../com/yeejoin/amos/boot/module/ugp/api/entity/Company.java
+23
-22
Project.java
.../com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
+0
-1
SuperviseRule.java
...eejoin/amos/boot/module/ugp/api/entity/SuperviseRule.java
+1
-1
CompanyMapper.java
...eejoin/amos/boot/module/ugp/api/mapper/CompanyMapper.java
+8
-0
ProjectMapper.java
...eejoin/amos/boot/module/ugp/api/mapper/ProjectMapper.java
+5
-0
ProjectResourceMapper.java
...mos/boot/module/ugp/api/mapper/ProjectResourceMapper.java
+7
-2
VerifyMapper.java
...yeejoin/amos/boot/module/ugp/api/mapper/VerifyMapper.java
+2
-1
WeldMapper.java
...m/yeejoin/amos/boot/module/ugp/api/mapper/WeldMapper.java
+3
-0
ICompanyService.java
...oin/amos/boot/module/ugp/api/service/ICompanyService.java
+4
-0
IMaterialService.java
...in/amos/boot/module/ugp/api/service/IMaterialService.java
+5
-0
IProjectResourceService.java
.../boot/module/ugp/api/service/IProjectResourceService.java
+2
-2
IVerifyService.java
...join/amos/boot/module/ugp/api/service/IVerifyService.java
+2
-8
CompanyMapper.xml
...odule-ugp-api/src/main/resources/mapper/CompanyMapper.xml
+13
-0
InstallNoticeMapper.xml
...ugp-api/src/main/resources/mapper/InstallNoticeMapper.xml
+29
-15
InstallNoticeMsgMapper.xml
...-api/src/main/resources/mapper/InstallNoticeMsgMapper.xml
+1
-1
ProjectMapper.xml
...odule-ugp-api/src/main/resources/mapper/ProjectMapper.xml
+8
-0
ProjectResourceMapper.xml
...p-api/src/main/resources/mapper/ProjectResourceMapper.xml
+50
-38
VerifyMapper.xml
...module-ugp-api/src/main/resources/mapper/VerifyMapper.xml
+11
-0
WorkHistoryMapper.xml
...e-ugp-api/src/main/resources/mapper/WorkHistoryMapper.xml
+3
-0
pom.xml
amos-boot-system-ugp/amos-boot-module-ugp-biz/pom.xml
+27
-0
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+330
-58
InstallNoticeController.java
...ot/module/ugp/biz/controller/InstallNoticeController.java
+56
-33
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+76
-8
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+83
-5
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+53
-3
SuperviseRuleController.java
...ot/module/ugp/biz/controller/SuperviseRuleController.java
+10
-10
VerifyController.java
...amos/boot/module/ugp/biz/controller/VerifyController.java
+116
-27
WelderController.java
...amos/boot/module/ugp/biz/controller/WelderController.java
+64
-9
AttachmentServiceImpl.java
...ot/module/ugp/biz/service/impl/AttachmentServiceImpl.java
+29
-0
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+136
-13
InstallNoticeServiceImpl.java
...module/ugp/biz/service/impl/InstallNoticeServiceImpl.java
+74
-1
MaterialServiceImpl.java
...boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
+97
-2
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+84
-6
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+89
-26
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+13
-49
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+2
-2
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+101
-3
SuperviseRuleServiceImpl.java
...module/ugp/biz/service/impl/SuperviseRuleServiceImpl.java
+2
-2
VerifyServiceImpl.java
...s/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
+705
-136
WelderServiceImpl.java
...s/boot/module/ugp/biz/service/impl/WelderServiceImpl.java
+66
-3
application.properties
...-module-ugp-biz/src/main/resources/application.properties
+6
-3
weldingRules.db
src/weldingRules.db
+0
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/bo/ReginParams.java
View file @
a71a3617
...
...
@@ -32,14 +32,14 @@ public class ReginParams implements Serializable {
@Data
public
static
class
BusinessInfo
implements
Serializable
{
private
Long
amosBizCode
;
private
String
companyName
;
private
Long
companySequenceNbr
;
private
String
companyType
;
private
Long
amosBizCode
;
//平台企业code
private
String
companyName
;
//公司名称
private
Long
companySequenceNbr
;
//公司SequenceNbr(业务)
private
String
companyType
;
//公司类型
private
Long
amosUserCode
;
private
String
userName
;
private
Long
userSequenceNbr
;
private
String
userType
;
private
String
userName
;
//用户名称
private
Long
userSequenceNbr
;
//用户sequenceNbr(业务)
private
String
userType
;
//用户类型
}
public
BusinessInfo
getBusinessInfo
()
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/CompanyTypeEnum.java
0 → 100644
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
org.apache.xmlbeans.impl.xb.xsdschema.Public
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
CompanyTypeEnum
{
建设单位
(
"CONSTRUCTION"
,
"建设单位"
),
安装单位
(
"INSTALL"
,
"安装单位"
),
设计单位
(
"DESIGN"
,
"设计单位"
),
监检机构
(
"MONITORING"
,
"监检机构"
);
String
key
;
String
type
;
public
static
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
static
{
for
(
CompanyTypeEnum
companyTypeEnum:
CompanyTypeEnum
.
values
()){
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"name"
,
companyTypeEnum
.
getType
());
map
.
put
(
"id"
,
companyTypeEnum
.
getKey
());
mapList
.
add
(
map
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/NoticeStatusEnum.java
View file @
a71a3617
...
...
@@ -8,8 +8,8 @@ import lombok.Getter;
public
enum
NoticeStatusEnum
{
已提交
(
"已提交"
,
"0"
),
已接收
(
"已接收"
,
"1"
),
已退回
(
"已退回"
,
"
2
"
),
已通过
(
"已通过"
,
"
3
"
);
已退回
(
"已退回"
,
"
0
"
),
已通过
(
"已通过"
,
"
1
"
);
String
name
;
String
statusId
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
View file @
a71a3617
...
...
@@ -11,14 +11,14 @@ import java.util.HashMap;
public
enum
OrgEnum
{
公司
(
"COMPANY"
,
"244"
,
"公司"
,
1
),
部门
(
"DEPARTMENT"
,
"245"
,
"部门"
,
2
),
人员
(
"PERSON"
,
"246"
,
"
人员"
,
3
),
普通人员
(
"PERSON"
,
"246"
,
"普通
人员"
,
3
),
焊工
(
"WELDER"
,
"247"
,
"焊工"
,
3
),
建设单位负责人
(
"CHARGE"
,
"254"
,
"建设单位负责人"
,
3
),
企业管理员
(
"ADMIN"
,
"248"
,
"企业管理员"
,
3
),
建设单位
(
"CONSTRUCTION"
,
"249"
,
"建设单位"
,
1
),
安装单位
(
"INSTALL"
,
"250"
,
"安装单位"
,
1
),
设计单位
(
"DESIGN"
,
"251"
,
"设计单位"
,
1
),
监察
单位
(
"SUPERVISION"
,
"252"
,
"监察单位
"
,
1
),
监察
部门
(
"SUPERVISION"
,
"252"
,
"监察部门
"
,
1
),
监检机构
(
"MONITORING"
,
"253"
,
"监检机构"
,
1
);
private
String
key
;
...
...
@@ -33,7 +33,7 @@ public enum OrgEnum {
static
{
for
(
OrgPersonEnum
orgPersonEnum:
OrgPersonEnum
.
values
()){
map
.
put
(
orgPersonEnum
.
get
Name
(),
orgPersonEnum
.
getKey
());
map
.
put
(
orgPersonEnum
.
get
Key
(),
orgPersonEnum
.
getName
());
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProblemProcessEnum.java
View file @
a71a3617
...
...
@@ -19,7 +19,8 @@ public enum ProblemProcessEnum {
超期整改发送短信
(
"超期整改发送短信"
,
"8"
,
"CQZGFSDX"
),
问题分类
(
"问题分类"
,
"9"
,
"WTFL"
),
转人工
(
"转人工"
,
"10"
,
"ZRG"
),
结束
(
"结束"
,
"11"
,
"JS"
);
结束
(
"结束"
,
"11"
,
"JS"
),
重大问题整改完成发送短信
(
"重大问题整改完成发送短信"
,
"12"
,
"ZDWTZGWCFSDX"
);
private
String
Name
;
private
String
key
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
ProjectInitiationEnum
{
项目立项
(
"1"
,
"项目立项"
),
平台审核
(
"2"
,
"平台审核"
),
告知申请
(
"3"
,
"告知申请"
),
接受告知
(
"4"
,
"接受告知"
),
审查项目
(
"5"
,
"审查项目"
),
提交资料
(
"6"
,
"提交资料"
),
审批人审批
(
"7"
,
"审批人审批"
),
审核人审核
(
"8"
,
"审核人审核"
),
监检科室分配
(
"9"
,
"监检科室分配"
),
监检员分配
(
"10"
,
"监检员分配"
),
监检员审核
(
"11"
,
"监检员审核"
),
项目关闭
(
"12"
,
"项目关闭"
),
接受审查意见
(
"13"
,
"接受审查意见"
);
项目立项
(
"1"
,
"项目立项"
,
"XMLX"
),
平台审核
(
"2"
,
"平台审核"
,
"PTSH"
),
告知申请
(
"3"
,
"告知申请"
,
"GZSQ"
),
接受告知
(
"4"
,
"接受告知"
,
"JSGZ"
),
审查项目
(
"5"
,
"审查项目"
,
"SCXM"
),
提交资料
(
"6"
,
"提交资料"
,
"TJZL"
),
审批人审批
(
"7"
,
"审批人审批"
,
"SPRSP"
),
审核人审核
(
"8"
,
"审核人审核"
,
"SHRSH"
),
监检科室分配
(
"9"
,
"监检科室分配"
,
"JJKSFP"
),
监检员分配
(
"10"
,
"监检员分配"
,
"JJYFP"
),
监检员审核
(
"11"
,
"监检员审核"
,
"JJYSH"
),
项目关闭
(
"12"
,
"项目关闭"
,
"XMGB"
),
接受审查意见
(
"13"
,
"接受审查意见"
,
"JSSCYJ"
);
private
String
status
;
private
String
name
;
private
String
code
;
public
static
Map
<
String
,
String
>
getNameByStatusMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getStatusByNameMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getCodeByNameMap
=
new
HashMap
<
String
,
String
>();
static
{
for
(
ProjectInitiationEnum
projectInitiationEnum:
ProjectInitiationEnum
.
values
()){
getNameByStatusMap
.
put
(
projectInitiationEnum
.
status
,
projectInitiationEnum
.
name
);
getStatusByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
status
);
getCodeByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
code
);
}
}
ProjectInitiationEnum
(
String
status
,
String
name
)
{
this
.
status
=
status
;
this
.
name
=
name
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/SMSEnum.java
View file @
a71a3617
...
...
@@ -10,7 +10,8 @@ public enum SMSEnum {
项目立项驳回短信
(
"项目立项驳回短信"
,
"SMS_UGP_0002"
),
质量问题短信
(
"质量问题短信"
,
"SMS_UGP_0003"
),
重大质量问题短信
(
"重大质量问题短信"
,
"SMS_UGP_0004"
),
超期整改短信
(
"超期整改短信"
,
"SMS_UGP_0005"
);
超期整改短信
(
"超期整改短信"
,
"SMS_UGP_0005"
),
重大问题整改完成短信
(
"重大问题整改完成短信"
,
"SMS_UGP_0006"
);
private
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/StageEnum.java
View file @
a71a3617
...
...
@@ -15,31 +15,33 @@ import java.util.Map;
@AllArgsConstructor
public
enum
StageEnum
{
焊前人员
(
"人员确定"
,
"STAFF"
),
焊前设备
(
"设备确定"
,
"EQUIPMENT"
),
焊前管材质量
(
"管材确定"
,
"BEFORE-WELDING"
),
焊接工艺
(
"工艺确定"
,
"CRAFT"
),
管道耐压
(
"耐压确定"
,
"VOLTAGE"
),
敷设质量
(
"敷设确定"
,
"LAY"
),
定位
(
"定位确定"
,
"LOTCATION"
);
焊前人员
(
"人员确定"
,
"STAFF"
,
"人员"
),
焊前设备
(
"设备确定"
,
"EQUIPMENT"
,
"设备"
),
焊前管材质量
(
"管材确定"
,
"BEFORE-WELDING"
,
"管材"
),
焊接工艺
(
"工艺确定"
,
"CRAFT"
,
"工艺"
),
管道耐压
(
"耐压确定"
,
"VOLTAGE"
,
"耐压"
),
敷设质量
(
"敷设确定"
,
"LAY"
,
"敷设"
),
定位
(
"定位确定"
,
"LOTCATION"
,
"定位"
);
private
String
name
;
private
String
stage
;
private
String
verifyName
;
public
static
Map
<
String
,
String
>
getNameByStatusMap
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getStatusByNameMap
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getNameByNameMap
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getStatusByVerifyNameMap
=
new
HashMap
<>();
static
{
for
(
StageEnum
enums:
StageEnum
.
values
()){
getNameBy
Status
Map
.
put
(
enums
.
stage
,
enums
.
name
);
getStatusBy
NameMap
.
put
(
enums
.
name
,
enums
.
stag
e
);
getNameBy
Name
Map
.
put
(
enums
.
stage
,
enums
.
name
);
getStatusBy
VerifyNameMap
.
put
(
enums
.
stage
,
enums
.
verifyNam
e
);
}
}
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/VerifyEnum.java
View file @
a71a3617
...
...
@@ -10,16 +10,20 @@ import java.util.Map;
@AllArgsConstructor
public
enum
VerifyEnum
{
未通过
(
"0"
,
"未通过"
),
已通过
(
"1"
,
"已通过"
);
未通过
(
"0"
,
"未通过"
,
"智能检验"
),
已通过
(
"1"
,
"已通过"
,
"人工检验"
);
private
String
status
;
private
String
name
;
public
static
Map
<
String
,
String
>
getTaskStatus
=
new
HashMap
<>();
private
String
type
;
public
static
Map
<
String
,
String
>
getTaskName
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getTaskType
=
new
HashMap
<>();
static
{
for
(
VerifyEnum
verifyEnum
:
VerifyEnum
.
values
()){
getTaskStatus
.
put
(
verifyEnum
.
status
,
verifyEnum
.
name
);
getTaskName
.
put
(
verifyEnum
.
status
,
verifyEnum
.
name
);
getTaskType
.
put
(
verifyEnum
.
status
,
verifyEnum
.
type
);
}
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/VerifyTypeEnum.java
0 → 100644
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
VerifyTypeEnum
{
智能检验
(
"0"
,
"智能检验"
),
人工检验
(
"1"
,
"人工检验"
);
private
String
status
;
private
String
name
;
public
static
Map
<
String
,
String
>
getVerifyname
=
new
HashMap
<>();
static
{
for
(
VerifyTypeEnum
verifyTypeEnum:
VerifyTypeEnum
.
values
()
){
getVerifyname
.
put
(
verifyTypeEnum
.
status
,
verifyTypeEnum
.
name
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/constants/XJConstant.java
View file @
a71a3617
...
...
@@ -21,6 +21,16 @@ public class XJConstant {
public
static
final
String
CHECK_TYPE
=
"CHECK_TYPE"
;
public
static
final
String
DEPT_WF_MAP_DIC_CODE
=
"DEPT_WF_MAP"
;
/** 企业用户注册前缀 */
public
static
final
String
UGP_USER_TEL
=
"ugp_tel_"
;
//审核/审批状态
public
static
final
String
PROCESS_PROJECT_STATE
=
"processProjectState"
;
//监管科室
public
static
final
String
INS_DEP
=
"insDep"
;
public
static
final
String
INS_PRESON
=
"insPerson"
;
/**
* 构造方法
*/
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/AcceptDto.java
View file @
a71a3617
...
...
@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* @Author cpp
* @Description
...
...
@@ -17,7 +19,64 @@ import lombok.EqualsAndHashCode;
public
class
AcceptDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
//人员信息
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
projectId
;
@ApiModelProperty
(
value
=
"焊口编号"
)
private
String
code
;
@ApiModelProperty
(
value
=
"焊接定位信息"
)
private
String
peopleLocation
;
@ApiModelProperty
(
value
=
"人脸识别图片信息"
)
private
String
peoplePhoto
;
@ApiModelProperty
(
value
=
"人员id"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"阶段检验"
)
private
String
stage
;
//设备
@ApiModelProperty
(
value
=
"设备id"
)
private
String
facilityId
;
@ApiModelProperty
(
value
=
"检定状态"
)
private
String
calibrationStatus
;
@ApiModelProperty
(
value
=
"设备图片"
)
private
String
facilityPhoto
;
//管材
@ApiModelProperty
(
value
=
"管材id"
)
private
String
materialId
;
@ApiModelProperty
(
value
=
"管材图片信息"
)
private
String
materialPhoto
;
//工艺
@ApiModelProperty
(
value
=
"焊接工艺"
)
private
String
craft
;
@ApiModelProperty
(
value
=
"焊机设备id"
)
private
String
weldingId
;
@ApiModelProperty
(
value
=
"工艺图片"
)
private
String
craftPhoto
;
//埋深
@ApiModelProperty
(
value
=
"埋深检测方式"
)
private
String
depthType
;
@ApiModelProperty
(
value
=
"埋深"
)
private
String
depth
;
@ApiModelProperty
(
value
=
"埋深定位信息"
)
private
String
depthLocation
;
@ApiModelProperty
(
value
=
"埋深图片信息"
)
private
String
depthPhoto
;
//耐压
@ApiModelProperty
(
value
=
"耐压设备id"
)
private
String
pressureId
;
@ApiModelProperty
(
value
=
"压力测试"
)
private
String
pressureTest
;
@ApiModelProperty
(
value
=
"耐压测试定位信息"
)
private
String
pressureLocation
;
@ApiModelProperty
(
value
=
"耐压图片信息"
)
private
String
pressurePhoto
;
//定位
@ApiModelProperty
(
value
=
"焊口精确定位方式"
)
private
String
locationType
;
@ApiModelProperty
(
value
=
"图片信息"
)
private
String
locationPhoto
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/InstallNoticeDto.java
View file @
a71a3617
...
...
@@ -54,4 +54,7 @@ public class InstallNoticeDto extends BaseDto {
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"安装负责人"
)
private
String
installPri
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
View file @
a71a3617
...
...
@@ -68,4 +68,8 @@ public class InstallNoticePageDto extends BaseDto {
@ApiModelProperty
(
value
=
"告知申请提交日期"
)
private
String
noticeDate
;
private
Boolean
approved
;
public
String
approvedName
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -85,5 +86,21 @@ public class ProjectDto extends BaseDto {
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
/**
* 监检部门
*/
private
String
inspectionUnit
;
/**
* 监察部门
*/
private
String
superviseDept
;
private
JSONArray
subForm
;
private
String
examineProjectState
;
private
String
processProjectState
;
private
String
insDep
;
private
String
insPerson
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectMaterialDto.java
0 → 100644
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 材料信息表
*
* @author system_generator
* @date 2022-09-22
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"MaterialDto"
,
description
=
"材料信息表"
)
public
class
ProjectMaterialDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"管材编号"
)
private
String
code
;
@ApiModelProperty
(
value
=
"管材类别"
)
private
String
type
;
@ApiModelProperty
(
value
=
"管材规格"
)
private
String
spec
;
@ApiModelProperty
(
value
=
"管材壁厚"
)
private
Integer
wallThickness
;
@ApiModelProperty
(
value
=
"生产厂家"
)
private
String
manufacturer
;
@ApiModelProperty
(
value
=
"生产日期"
)
private
Date
manufactureDate
;
@ApiModelProperty
(
value
=
"生产编号"
)
private
String
batchNum
;
@ApiModelProperty
(
value
=
"管道直径"
)
private
Double
diameter
;
@ApiModelProperty
(
value
=
"管道材料"
)
private
String
material
;
@ApiModelProperty
(
value
=
"管道长度"
)
private
Double
length
;
@ApiModelProperty
(
value
=
"厂家所在地"
)
private
String
manufactureAddr
;
@ApiModelProperty
(
value
=
"是否审批通过(1通过,0未通过)"
)
private
Boolean
approved
;
@ApiModelProperty
(
value
=
"单位机构代码"
)
private
String
orgCode
;
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
projectName
;
@ApiModelProperty
(
value
=
"项目资源id"
)
private
Long
projectResourceId
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/SmartListDto.java
0 → 100644
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* @Author cpp
* @Description 智能监检列表
* @Date 2022/10/19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"SmartListDto"
,
description
=
"智能监检列表"
)
public
class
SmartListDto
extends
BaseDto
{
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
projectId
;
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"项目编号"
)
private
String
projectCode
;
@ApiModelProperty
(
value
=
"检验检测单位"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"检验负责人"
)
private
String
usrName
;
@ApiModelProperty
(
value
=
"检验员"
)
private
String
inspector
;
@ApiModelProperty
(
value
=
"检验状态"
)
private
String
status
;
@ApiModelProperty
(
value
=
"检验方式"
)
private
String
type
;
@ApiModelProperty
(
value
=
"交检日期"
)
private
Date
submitTime
;
@ApiModelProperty
(
value
=
"检验时间"
)
private
Date
verifyTime
;
//管材
@ApiModelProperty
(
value
=
"焊口编号"
)
private
String
code
;
@ApiModelProperty
(
value
=
"管材厂家"
)
private
String
manufacturer
;
@ApiModelProperty
(
value
=
"管材批号"
)
private
String
batchNumber
;
@ApiModelProperty
(
value
=
"质量许可"
)
private
String
permission
;
@ApiModelProperty
(
value
=
"焊工编号"
)
private
String
personWeld
;
@ApiModelProperty
(
value
=
"管材定位信息"
)
private
String
tubularlocatingInformation
;
//设备
@ApiModelProperty
(
value
=
"焊机编号"
)
private
String
facilityNumber
;
@ApiModelProperty
(
value
=
"焊机名称"
)
private
String
facilityName
;
@ApiModelProperty
(
value
=
"焊机定位信息"
)
private
String
facilityLocation
;
@ApiModelProperty
(
value
=
"检定状态"
)
private
String
facilityStatus
;
//人员
@ApiModelProperty
(
value
=
"焊工姓名"
)
private
String
peopleName
;
@ApiModelProperty
(
value
=
"持证状态"
)
private
String
peopleStatus
;
@ApiModelProperty
(
value
=
"焊接定位信息"
)
private
String
peopleLocation
;
// 工艺
@ApiModelProperty
(
value
=
"焊接工艺"
)
private
String
craft
;
@ApiModelProperty
(
value
=
"焊接时长"
)
private
String
duration
;
//耐压
@ApiModelProperty
(
value
=
"耐压测试编号"
)
private
String
pressureNumber
;
@ApiModelProperty
(
value
=
"耐压设备名称"
)
private
String
pressureName
;
@ApiModelProperty
(
value
=
"耐压设备编码"
)
private
String
pressureCode
;
@ApiModelProperty
(
value
=
"测试压力Mpa"
)
private
String
mpa
;
@ApiModelProperty
(
value
=
"耐压测试定位"
)
private
String
pressureLocation
;
//敷设位置标定检验
@ApiModelProperty
(
value
=
"焊口精确定位方式"
)
private
String
preciseWeldingPosition
;
@ApiModelProperty
(
value
=
"位置标定检验结果"
)
private
String
resuts
;
@ApiModelProperty
(
value
=
"检验检测阶段"
)
private
String
stage
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/SuperviseRuleDto.java
View file @
a71a3617
...
...
@@ -26,7 +26,7 @@ public class SuperviseRuleDto extends BaseDto {
private
String
adminRegion
;
@ApiModelProperty
(
value
=
"行政区域代码"
)
private
String
adminRegionCode
;
private
Integer
adminRegionCode
;
@ApiModelProperty
(
value
=
"监察部门id"
)
private
Long
superviseDeptId
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Company.java
View file @
a71a3617
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
...
...
@@ -24,68 +25,68 @@ public class Company extends BaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
@
ApiModelProperty
(
value
=
"企业名称
"
)
@
TableField
(
"name
"
)
private
String
name
;
@
ApiModelProperty
(
value
=
"企业类型
"
)
@
TableField
(
"type
"
)
private
String
type
;
@
ApiModelProperty
(
value
=
"统一信用代码
"
)
@
TableField
(
"credit_code
"
)
private
String
creditCode
;
@
ApiModelProperty
(
value
=
"许可证号
"
)
@
TableField
(
"license_number
"
)
private
String
licenseNumber
;
@
ApiModelProperty
(
value
=
"有效期至
"
)
@
TableField
(
"expiration_date
"
)
private
Date
expirationDate
;
@
ApiModelProperty
(
value
=
"企业地址
"
)
@
TableField
(
"address
"
)
private
String
address
;
@
ApiModelProperty
(
value
=
"联系方式
"
)
@
TableField
(
"contact_phone
"
)
private
String
contactPhone
;
@
ApiModelProperty
(
value
=
"联系人
"
)
@
TableField
(
"contact
"
)
private
String
contact
;
@TableField
(
"remark"
)
private
String
remark
;
@
ApiModelProperty
(
value
=
"统一信用代码证书附件
"
)
@
TableField
(
"credit_attch
"
)
private
String
creditAttch
;
@
ApiModelProperty
(
value
=
"许可证附件
"
)
@
TableField
(
"license_attch
"
)
private
String
licenseAttch
;
@
ApiModelProperty
(
value
=
"是否已审核(1已审核,0未审核)
"
)
@
TableField
(
"approved
"
)
private
String
approved
;
@
ApiModelProperty
(
value
=
"单位机构代码
"
)
@
TableField
(
"org_code
"
)
private
String
orgCode
;
@
ApiModelProperty
(
value
=
"企业管理员
"
)
@
TableField
(
"admin_name
"
)
private
String
adminName
;
@
ApiModelProperty
(
value
=
"企业管理员电话
"
)
@
TableField
(
"admin_tel
"
)
private
String
adminTel
;
@
ApiModelProperty
(
value
=
"法人
"
)
@
TableField
(
"legal_person
"
)
private
String
legalPerson
;
@
ApiModelProperty
(
value
=
"法人电话
"
)
@
TableField
(
"legal_person_tel
"
)
private
String
legalPersonTel
;
@
ApiModelProperty
(
value
=
"单位电话
"
)
@
TableField
(
"unit_tel
"
)
private
String
unitTel
;
@
ApiModelProperty
(
value
=
"成立日期
"
)
@
TableField
(
"create_time
"
)
private
Date
createTime
;
@
ApiModelProperty
(
value
=
"管理员身份证附件
"
)
@
TableField
(
"admin_lincense_pic
"
)
private
String
adminLincensePic
;
@
ApiModelProperty
(
value
=
"用户名
"
)
@
TableField
(
"admin_login_name
"
)
private
String
adminLoginName
;
@
ApiModelProperty
(
value
=
"用户密码
"
)
@
TableField
(
"admin_login_pwd
"
)
private
String
adminLoginPwd
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
View file @
a71a3617
...
...
@@ -148,5 +148,4 @@ public class Project extends BaseEntity {
*/
@TableField
(
"remark"
)
private
String
remark
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/SuperviseRule.java
View file @
a71a3617
...
...
@@ -32,7 +32,7 @@ public class SuperviseRule extends BaseEntity {
* 行政区域代码
*/
@TableField
(
"admin_region_code"
)
private
String
adminRegionCode
;
private
Integer
adminRegionCode
;
/**
* 监察部门id
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/CompanyMapper.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 企业信息表 Mapper 接口
...
...
@@ -9,5 +15,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public
interface
CompanyMapper
extends
BaseMapper
<
Company
>
{
List
<
CompanyDto
>
queryCompanyPage
(
Company
companyParam
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/ProjectMapper.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Map
;
/**
* 项目信息表 Mapper 接口
*
...
...
@@ -18,4 +21,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
//通过name查询一条数据
ProjectDto
selectOneByName
(
@RequestParam
String
name
);
ProjectDto
getDetail
(
Long
sequenceNbr
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/ProjectResourceMapper.java
View file @
a71a3617
...
...
@@ -2,8 +2,8 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.
InstallNoticeMsgPageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.
dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.
*
;
import
com.yeejoin.amos.boot.module.ugp.api.
entity.Material
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -28,4 +28,9 @@ public interface ProjectResourceMapper extends BaseMapper<ProjectResource> {
WelderEquipmentDto
customSelectById
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
//管材页面分页,根据名称、编号筛选
Page
<
ProjectMaterialDto
>
MaterialPage
(
IPage
<
ProjectMaterialDto
>
page
,
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
);
//根据resource_id删除项目焊工人员信息
Boolean
deleteByResourceId
(
Long
resourceId
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/VerifyMapper.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Verify
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -21,6 +22,6 @@ public interface VerifyMapper extends BaseMapper<Verify> {
* @return
*/
List
<
Verify
>
commonality
(
String
stage
);
List
<
Verify
>
commonality
(
String
stage
,
SmartListDto
smartListDto
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/WeldMapper.java
View file @
a71a3617
...
...
@@ -19,4 +19,7 @@ public interface WeldMapper extends BaseMapper<Weld> {
@Select
(
"select project_id,super_inspec_status from tz_ugp_weld where project_id =#{projectId}"
)
List
<
WeldDto
>
select
(
Long
projectId
);
@Select
(
"SELECT * from tz_ugp_weld where code = #{code} and project_id =#{projectId}"
)
Weld
getWeldByCodeAndProjectId
(
String
code
,
Long
projectId
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/ICompanyService.java
View file @
a71a3617
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
/**
...
...
@@ -12,6 +14,8 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
*/
public
interface
ICompanyService
{
Page
<
CompanyDto
>
queryCompanyPage
(
int
current
,
int
size
,
Company
company
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IMaterialService.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
/**
* 材料信息表接口类
*
...
...
@@ -8,5 +11,7 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public
interface
IMaterialService
{
//增加材料
MaterialDto
saveMaterial
(
JSONObject
jsonObject
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProjectResourceService.java
View file @
a71a3617
...
...
@@ -9,14 +9,14 @@ import org.aspectj.weaver.ast.Test;
* 项目资源表(包括焊工、管材、设备)接口类
*
* @author system_generator
* @date 2022-
09-22
* @date 2022-
10-21
*/
public
interface
IProjectResourceService
{
//焊机设备表
Page
<
WelderEquipmentDto
>
installNoticeMsgList
(
Page
<
WelderEquipmentDto
>
page
,
String
name
,
String
type
);
//焊机设备页面分页查询
Page
<
WelderEquipmentDto
>
selectByName
(
Page
<
WelderEquipmentDto
>
page
,
String
name
,
String
unit
);
WelderEquipmentDto
selectByName
(
Long
sequenceNbr
);
Page
<
WelderEquipmentDto
>
selectByInfo
(
Page
<
WelderEquipmentDto
>
page
,
Test
info
,
String
unit
);
//根据sequenceNbr查询列表数据
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IVerifyService.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.FacilityDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.IntelligentInspectionDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.TubingDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto
;
/**
* 智能监检管理表接口类
...
...
@@ -13,9 +10,6 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto;
* @date 2022-09-22
*/
public
interface
IVerifyService
{
Page
<
TubingDto
>
selectInspection
(
Page
<
TubingDto
>
page
,
TubingDto
dto
);
Page
<
WorkerDto
>
selectWorker
(
Page
<
WorkerDto
>
page
,
WorkerDto
dto
);
Page
<
FacilityDto
>
selectFacility
(
Page
<
FacilityDto
>
page
,
FacilityDto
dto
);
Page
<
SmartListDto
>
commonality
(
String
stage
,
Page
<
SmartListDto
>
page
,
SmartListDto
smartListDto
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/CompanyMapper.xml
View file @
a71a3617
...
...
@@ -2,4 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper"
>
<select
id=
"queryCompanyPage"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.entity.Company"
>
select * from tz_ugp_company
<where>
<if
test=
"name != '' and name != null"
>
and `name` like concat('%',#{name},'%')
</if>
<if
test=
"type != '' and type != null"
>
and `type` like concat('%',#{type},'%')
</if>
</where>
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/InstallNoticeMapper.xml
View file @
a71a3617
...
...
@@ -4,21 +4,35 @@
<!-- 查询安装告知申请页面-->
<select
id=
"installNoticePage"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"
>
SELECT a.* ,u1.biz_org_name AS superviseDept,u2.biz_org_name AS chargerPerson,u3.biz_org_name AS inspectionUnit
FROM
(SELECT tz_ugp_install_notice.sequence_nbr,tz_ugp_project.name,install_region,start_date,construction_unit,charge_person,installation_unit,install_pri
,supervise_dept_id
,charger_person_id
,inspection_unit_id
,notice_status,notice_date
FROM tz_ugp_install_notice, tz_ugp_project ,tz_ugp_supervise_rule ,tz_ugp_verify
WHERE tz_ugp_install_notice.project_id=tz_ugp_project.sequence_nbr
AND tz_ugp_install_notice.project_id=tz_ugp_verify.project_id
AND tz_ugp_supervise_rule.admin_region_code=tz_ugp_project.install_region_code
AND tz_ugp_project.name LIKE '%${name}%' AND construction_unit LIKE '%${constructionUnit}%') AS a
LEFT JOIN cb_org_usr AS u1 ON a.supervise_dept_id=u1.sequence_nbr
LEFT JOIN cb_org_usr AS u2 ON a.charger_person_id=u2.sequence_nbr
LEFT JOIN cb_org_usr AS u3 ON a.inspection_unit_id=u3.sequence_nbr
SELECT a.* ,u2.biz_org_name AS inspectionUnit,u1.biz_org_name AS superviseDept
FROM (SELECT
tz_ugp_install_notice.sequence_nbr,
tz_ugp_project.`NAME`,
install_region,
start_date,
construction_unit,
charge_person,
installation_unit,
install_pri,
supervise_dept_id,
inspection_unit_id,
notice_status,
notice_date,
approved
FROM
tz_ugp_install_notice
LEFT JOIN tz_ugp_project ON tz_ugp_install_notice.project_id = tz_ugp_project.sequence_nbr
LEFT JOIN tz_ugp_supervise_rule ON tz_ugp_supervise_rule.admin_region_code = tz_ugp_project.install_region_code ) AS a
LEFT JOIN cb_org_usr AS u2 ON a.inspection_unit_id = u2.sequence_nbr
LEFT JOIN cb_org_usr AS u1 ON a.supervise_dept_id=u1.sequence_nbr
<where>
<if
test=
"name != '' and name != null"
>
and a.`NAME` LIKE concat("%",#{name},"%")
</if>
<if
test=
"constructionUnit != '' and constructionUnit != null"
>
and a.construction_unit LIKE concat("%",#{constructionUnit},"%")
</if>
</where>
</select>
<!-- //根据project_id查询一条数据-->
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/InstallNoticeMsgMapper.xml
View file @
a71a3617
...
...
@@ -22,7 +22,7 @@
and tz_ugp_project.name like '%${name}%'
</if>
<if
test=
"installationUnit != null and installationUnit != ''"
>
and tz_ugp_project.installation
Unit like '%${installationUnit}%'
and tz_ugp_project.installation
_unit like concat("%",#{installationUnit},"%")
</if>
</select>
<select
id=
"selectByName"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto"
>
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/ProjectMapper.xml
View file @
a71a3617
...
...
@@ -9,4 +9,12 @@
where name = #{name}
</select>
<select
id=
"getDetail"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto"
>
SELECT p.*,ou1.biz_org_name AS inspection_unit,ou2.biz_org_name AS supervise_dept
FROM tz_ugp_project AS p
LEFT JOIN tz_ugp_supervise_rule AS r ON r.admin_region_code = p.install_region_code
LEFT JOIN cb_org_usr AS ou1 ON ou1.sequence_nbr = r.inspection_unit_id
LEFT JOIN cb_org_usr AS ou2 ON ou2.sequence_nbr = r.supervise_dept_id
WHERE p.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/ProjectResourceMapper.xml
View file @
a71a3617
...
...
@@ -3,7 +3,9 @@
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper"
>
<select
id=
"WelderEquipment"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"
>
SELECT tz_ugp_equipment.name,
SELECT
tz_ugp_project_resource.sequence_nbr,
tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS projectName,
...
...
@@ -14,89 +16,99 @@
tz_ugp_equipment.verify_status,
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
FROM tz_ugp_project_resource
LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
WHERE tz_ugp_project_resource.type = 'equipment'
<if
test=
"name != null and name != ''"
>
and tz_ugp_equipment.name like '%${name}%'
</if>
<if
test=
"type != null and type != ''"
>
and tz_ugp_equipment.type like '%${type}%'
</if>
</where>
</select>
<select
id=
"selectByName"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"
>
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name as project_Name,
tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project_resource
LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
WHERE tz_ugp_project_resource.type = 'equipment'
<if
test=
"name != null and name != ''"
>
and tz_ugp_project.name = #{name}
</if>
<if
test=
"unit != null and unit != ''"
>
and tz_ugp_project.construction_unit_id = #{unit}
</if>
</where>
</select>
<select
id=
"selectByInfo"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"
>
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project_resource
LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
WHERE tz_ugp_project_resource.type = 'equipment'
<if
test=
"info != null and info != ''"
>
and tz_ugp_attachment.info = #{info}
</if>
<if
test=
"unit != null and unit != ''"
>
and tz_ugp_attachment.company_id = #{unit}
</if>
</where>
</select>
<select
id=
"customSelectById"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"
>
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
where tz_ugp_equipment.sequence_nbr = #{sequenceNbr}
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project_resource
LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
WHERE tz_ugp_project_resource.type = 'equipment' and tz_ugp_project_resource.sequence_nbr = #{sequenceNbr}
</select>
<!-- //管材页面分页,根据名称、编号筛选-->
<select
id=
"MaterialPage"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto"
>
SELECT tz_ugp_material.*,tz_ugp_project.name AS projectName ,tz_ugp_project_resource.sequence_nbr as projectResourceId
FROM tz_ugp_project_resource
LEFT JOIN tz_ugp_material ON tz_ugp_project_resource.resource_id=tz_ugp_material.sequence_nbr
LEFT JOIN tz_ugp_project ON tz_ugp_project_resource.project_id=tz_ugp_project.sequence_nbr
WHERE tz_ugp_project_resource.type="material"
AND tz_ugp_material.name LIKE '%${name}%' AND tz_ugp_material.code LIKE '%${code}%'
</select>
<!-- //根据resource_id删除项目焊工人员信息-->
<delete
id=
"deleteByResourceId"
>
delete FROM tz_ugp_project_resource where resource_id=#{resourceId}
</delete>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/VerifyMapper.xml
View file @
a71a3617
...
...
@@ -48,8 +48,19 @@
vf.project_id =pt.sequence_nbr
and
pt.is_delete='0'
<if
test=
"stage != '' and stage != null"
>
and
vf.stage =#{stage}
</if>
<if
test=
"smartListDto.name !='' and smartListDto.name != null"
>
and
pt.name like '%${smartListDto.name}%'
</if>
<if
test=
"smartListDto.projectCode !='' and smartListDto.projectCode != null"
>
and
pt.code like '%${smartListDto.projectCode}%'
</if>
</select>
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/WorkHistoryMapper.xml
View file @
a71a3617
...
...
@@ -23,6 +23,9 @@
<if
test=
"tzUgpWorkHistory.endDate!='' and tzUgpWorkHistory.endDate!=null"
>
and wh.end_date like concat("%",#{tzUgpWorkHistory.endDate},"%")
</if>
<if
test=
"tzUgpWorkHistory.sequenceNbr!='' and tzUgpWorkHistory.sequenceNbr!=null"
>
and wh.sequence_nbr = #{tzUgpWorkHistory.sequenceNbr}
</if>
</where>
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-biz/pom.xml
View file @
a71a3617
...
...
@@ -21,6 +21,33 @@
<artifactId>
amos-boot-module-common-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.24
</version>
</dependency>
<dependency>
<groupId>
fakepath
</groupId>
<artifactId>
ugp-welding-evaluation-inspection-sdk
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<groupId>
org.xerial
</groupId>
<artifactId>
sqlite-jdbc
</artifactId>
<version>
3.36.0.3
</version>
</dependency>
<dependency>
<groupId>
org.drools
</groupId>
<artifactId>
drools-compiler
</artifactId>
<version>
7.10.0.Final
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.sun.org.apache.xpath.internal.objects.XObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.*
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.*
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -63,6 +84,25 @@ public class CompanyController extends BaseController {
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Value
(
"${ugp.sms.tempCode}"
)
private
String
smsTempCode
;
// @Value("${ugp.user.name}")
// private String ugpUserName;
//
// @Value("${ugp.user.pwd}")
// private String ugpUserPwd;
/**
* saveUserRedis设置过期时间
*/
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
@Autowired
RedisUtils
redisUtils
;
/**
* 新增企业信息表
*
...
...
@@ -127,9 +167,9 @@ public class CompanyController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"企业信息表分页查询"
,
notes
=
"企业信息表分页查询"
)
public
ResponseModel
<
Page
<
CompanyDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
Company
Dto
companyDto
)
{
(
value
=
"size"
)
int
size
,
Company
company
)
{
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
queryCompanyPage
(
current
,
size
,
company
Dto
));
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
queryCompanyPage
(
current
,
size
,
company
));
}
/**
...
...
@@ -179,60 +219,292 @@ public class CompanyController extends BaseController {
@PostMapping
(
value
=
"check"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据sequenceNbr更新,并创建单位及管理员"
,
notes
=
"根据sequenceNbr更新,并创建单位及管理员"
)
public
ResponseModel
<
Boolean
>
companyCheck
(
@RequestBody
CompanyDto
model
,
Long
sequenceNbr
,
String
bizOrgType
)
throws
Exception
{
Company
company
=
companyServiceImpl
.
getById
(
sequenceNbr
);
company
.
setApproved
(
model
.
getApproved
());
if
(
company
.
getApproved
().
equals
(
"已审核"
)){
final
CompanyModel
companyModel
=
new
CompanyModel
();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
//创建平台企业
companyModel
.
setCompanyName
(
company
.
getName
());
companyModel
.
setCompanyCode
(
company
.
getCreditCode
());
companyModel
.
setAddress
(
company
.
getAddress
());
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"headquarter"
);
companyModel
.
setAgencyCode
(
"ugp"
);
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
//创建平台用户
String
adminName
=
company
.
getAdminName
();
String
adminLoginName
=
company
.
getAdminLoginName
();
String
adminPhone
=
company
.
getAdminTel
();
String
adminPassword
=
company
.
getAdminLoginPwd
();
agencyUserModel
.
setRealName
(
adminName
);
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setMobile
(
adminPhone
);
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setUserName
(
adminLoginName
);
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
adminPassword
,
secretKey
));
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
adminPassword
,
secretKey
));
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
//企业动态表单存储
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
company
));
jsonObject
.
put
(
"amosOrgId"
,
companyModelFeignClient
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
companyModelFeignClient
.
getOrgCode
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
,
null
);
//企业管理员人员 动态表单存储
jsonObject
=
null
;
jsonObject
.
put
(
"name"
,
adminName
);
jsonObject
.
put
(
"phone"
,
adminPhone
);
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
agencyUserModel
.
getUserId
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
OrgEnum
.
企业管理员
.
getKey
(),
null
);
}
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
updateById
(
company
));
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
companyCheck
(
model
,
sequenceNbr
,
bizOrgType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"test"
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"
根据sequenceNbr更新,并创建单位及管理员"
,
notes
=
"根据sequenceNbr更新,并创建单位及管理员
"
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"
(测试)存储动态表单"
,
notes
=
"(测试)存储动态表单
"
)
public
ResponseModel
<
OrgUsrDto
>
getInfo
(
@RequestBody
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
));
}
/***
* 部門新增或更新
* @param jsonObject 表单数据
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"department"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"部門新增或更新"
,
notes
=
"部門新增或更新"
)
public
ResponseModel
<
Boolean
>
getInfo
(
@RequestBody
JSONObject
jsonObject
,
@RequestParam
(
required
=
false
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
saveDepartment
(
jsonObject
,
sequenceNbr
));
}
/***
* 获取当前登录人所在单位下的所有部门
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/deptList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"部門新增"
,
notes
=
"部門新增"
)
public
ResponseModel
<
IPage
>
getDept
(
String
size
,
String
current
)
{
Page
<
OrgUsr
>
page
=
new
Page
<>();
page
.
setSize
(
Long
.
parseLong
(
size
));
page
.
setCurrent
(
Long
.
parseLong
(
current
));
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
getCompanyDept
(
page
));
}
/**
* 企业注册:获取单位类型
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/getType"
)
@ApiOperation
(
httpMethod
=
"Get"
,
value
=
""
,
notes
=
""
)
public
ResponseModel
<
List
>
getType
(){
return
ResponseHelper
.
buildResponse
(
CompanyTypeEnum
.
mapList
);
}
/**
* 获取组织机构树
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/region/tree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取组织机构树"
,
notes
=
"获取组织机构树"
)
public
ResponseModel
<
Collection
<
RegionModel
>>
getRegionTree
()
{
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
RequestContext
.
setToken
(
requestContext
.
getToken
());
return
ResponseHelper
.
buildResponse
(
Systemctl
.
regionClient
.
queryForTree
(
null
).
getResult
());
}
/**
* 判断用户是否存在
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/hasExistUser/{adminLoginName}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断用户是否存在"
,
notes
=
"判断用户是否存在"
)
public
ResponseModel
<
Boolean
>
hasExistUser
(
@PathVariable
(
value
=
"adminLoginName"
)
String
adminLoginName
)
{
Boolean
flag
=
false
;
Company
company
=
companyServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
Company
>().
eq
(
Company:
:
getAdminLoginName
,
adminLoginName
));
if
(!
ValidationUtil
.
isEmpty
(
company
))
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
/**
* 管理员身份证图片上传 无token
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/uploadFile"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"管理员身份证图片上传 无token"
,
notes
=
"管理员身份证图片上传 无token"
)
public
ResponseModel
<
String
>
uploadFile
(
@ApiParam
(
value
=
"文件"
,
required
=
true
)
@RequestParam
MultipartFile
adminLicensePic
)
{
if
(
ValidationUtil
.
isEmpty
(
adminLicensePic
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
RequestContext
.
setToken
(
requestContext
.
getToken
());
FeignClientResult
<
Map
<
String
,
String
>>
date
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
adminLicensePic
);
String
urlString
=
""
;
if
(
date
!=
null
)
{
Map
<
String
,
String
>
map
=
date
.
getResult
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
urlString
=
it
.
next
();
}
}
return
ResponseHelper
.
buildResponse
(
urlString
);
}
@Autowired
AmosRequestContext
requestContext
;
// public void setRequestContext() {
// RequestContext.setAppKey("AMOS_STUDIO");
// RequestContext.setProduct("AMOS_STUDIO_WEB");
// RequestContext.setToken(requestContext.getToken());
// // 需要登录后台账号
// RequestContext.setAppKey("AMOS_STUDIO");
// RequestContext.setProduct("AMOS_STUDIO_WEB");
// if(redisUtils.hasKey(RedisKey.CTI_USER_TOKEN)) {
// // 验证token
// boolean validToken = TokenOperation.refresh(redisUtils.get(RedisKey.CTI_USER_TOKEN).toString());
// // 登陆
// if(!validToken) {
// this.loginCtiUser();
// }
// } else { // 登陆
// this.loginCtiUser();
// }
// String ctiToken = redisUtils.get(RedisKey.CTI_USER_TOKEN).toString();
// RequestContext.setToken(ctiToken);
// try {
// FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.queryByUserName(ugpUserName);
// AgencyUserModel userModel = agencyUserModel.getResult();
// RequestContext.setExeUserId(userModel.getUserId());
// saveUserRedis(userModel, ctiToken);
// } catch (Exception e) {
// //删除失效token缓存
// throw new RuntimeException(e.getMessage());
// }
// }
//
// private void loginCtiUser() {
// String passwd = DesUtil.encode(ugpUserPwd, "qaz");
// IdPasswordAuthModel loninData = new IdPasswordAuthModel();
// loninData.setLoginId(ugpUserName);
// loninData.setPassword(passwd);
// FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
// if(loginResult.getStatus() == 200) {
// HashMap resultMap = (HashMap) loginResult.getResult();
// redisUtils.set(RedisKey.CTI_USER_TOKEN, resultMap.get("token").toString(), redisRegionTimeSecond);
// }
// }
//
// private void saveUserRedis(AgencyUserModel user, String token) {
// String authToken = RedisKey.buildReginKey(user.getUserId(), token);
// if (redisUtils.hasKey(authToken)) {
// return;
// }
// CompanyBo company = new CompanyBo();
// DepartmentBo department = new DepartmentBo();
// RoleBo role = new RoleBo();
// CompanyModel companyM = user.getCompanys() != null ? user.getCompanys().get(0) : null ;
// Bean.copyExistPropertis(companyM, company);
// Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
// DepartmentModel departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null ;
// Bean.copyExistPropertis(departmentM, department);
// Map<Long, List<RoleModel>> roles = user.getOrgRoles();
// Long sequenceNbr;
// if (departmentM == null) {
// sequenceNbr = null;
// } else {
// sequenceNbr = departmentM.getSequenceNbr();
// }
// RoleModel roleM = null;
// if (sequenceNbr == null) {
// roleM = companyM != null ?roles.get(companyM.getSequenceNbr()).get(0) : null;
// } else {
// roleM = roles.get(sequenceNbr).get(0);
// }
// Bean.copyExistPropertis(roleM, role);
// ReginParams reginParams = new ReginParams();
// reginParams.setCompany(company);
// reginParams.setRole(role);
// reginParams.setDepartment(department);
// reginParams.setUserModel(user);
// redisUtils.set(authToken, JSONObject.toJSONString(reginParams), redisRegionTimeSecond);
// }
/**
* 判断手机号是否已经注册
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/hasExistPhone/{adminTel}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断手机号是否已经注册"
,
notes
=
"判断手机号是否已经注册"
)
public
ResponseModel
<
Boolean
>
hasExistPhone
(
@PathVariable
(
value
=
"adminTel"
)
String
adminTel
)
{
Boolean
flag
=
false
;
Company
company
=
companyServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
Company
>().
eq
(
Company:
:
getAdminTel
,
adminTel
));
if
(!
ValidationUtil
.
isEmpty
(
company
))
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
/**
* 判断组织机构是否存在
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/hasExistUnit/{creditCode}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断组织机构是否存在"
,
notes
=
"判断组织机构是否存在"
)
public
ResponseModel
<
Boolean
>
hasExistUnit
(
@PathVariable
(
value
=
"creditCode"
)
String
creditCode
)
{
Boolean
flag
=
false
;
Company
company
=
companyServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
Company
>().
eq
(
Company:
:
getCreditCode
,
creditCode
));
if
(!
ValidationUtil
.
isEmpty
(
company
))
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
/**
* 发送手机号验证码
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/sendTelCode/{tel}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"发送手机号验证码"
,
notes
=
"发送手机号验证码"
)
public
ResponseModel
<
Boolean
>
sendTelCode
(
@PathVariable
(
value
=
"tel"
)
String
adminTel
)
{
if
(
ValidationUtil
.
isEmpty
(
adminTel
))
{
throw
new
BadRequest
(
"参数校验失败."
);
}
Boolean
flag
=
false
;
HashMap
<
String
,
String
>
params
=
new
HashMap
<>();
String
code
=
this
.
getRandomCode
();
params
.
put
(
"code"
,
code
);
params
.
put
(
"mobile"
,
adminTel
);
params
.
put
(
"smsCode"
,
smsTempCode
);
try
{
Systemctl
.
smsClient
.
sendCommonSms
(
params
).
getResult
();
flag
=
true
;
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"发送短信失败:"
+
e
.
getMessage
());
}
// code 保存到缓存中
redisUtils
.
set
(
XJConstant
.
UGP_USER_TEL
+
adminTel
,
code
);
return
ResponseHelper
.
buildResponse
(
flag
);
}
private
String
getRandomCode
(){
String
code
=
""
;
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
int
r
=
random
.
nextInt
(
10
);
//每次随机出一个数字(0-9)
code
=
code
+
r
;
//把每次随机出的数字拼在一起
}
return
code
;
}
/**
* 验证手机号验证码是否成功
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/verifyTelCode/{tel}/{code}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"验证手机号验证码是否成功"
,
notes
=
"验证手机号验证码是否成功"
)
public
ResponseModel
<
Boolean
>
verifyTelCode
(
@PathVariable
(
value
=
"tel"
)
String
adminTel
,
@PathVariable
(
value
=
"code"
)
String
code
)
{
Boolean
flag
=
false
;
if
(
ValidationUtil
.
isEmpty
(
adminTel
)
||
ValidationUtil
.
isEmpty
(
code
))
{
throw
new
BadRequest
(
"参数校验失败."
);
}
if
(
redisUtils
.
hasKey
(
XJConstant
.
UGP_USER_TEL
+
adminTel
))
{
String
redisCode
=
redisUtils
.
get
(
XJConstant
.
UGP_USER_TEL
+
adminTel
).
toString
();
if
(
code
.
equals
(
redisCode
))
{
flag
=
true
;
}
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
View file @
a71a3617
...
...
@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
...
...
@@ -20,12 +22,10 @@ import io.swagger.annotations.Api;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.InstallNoticeServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -195,23 +195,7 @@ public class InstallNoticeController extends BaseController {
@PostMapping
(
value
=
"/saveInstallNotice"
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"新增安装告知申请"
,
notes
=
"新增安装告知申请"
)
public
ResponseModel
<
InstallNoticeDto
>
saveInstallNotice
(
@RequestBody
JSONObject
object
,
@RequestParam
(
required
=
false
)
String
noticeStatus
)
{
InstallNoticeDto
installNoticeDto
=
new
InstallNoticeDto
();
// final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto
.
setProjectId
(
object
.
getLong
(
"name"
));
installNoticeDto
.
setNoticeStatus
(
noticeStatus
);
installNoticeDto
.
setNoticeDate
(
new
Date
());
installNoticeDto
.
setApproved
(
false
);
// installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto
.
setLicenseNum
(
object
.
getString
(
"licenseNum"
));
installNoticeDto
.
setLicenseCompany
(
object
.
getString
(
"licenseCompany"
));
final
JSONArray
licenseAttch
=
object
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
object
.
getJSONArray
(
"contractAttch"
);
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
saveInstallNotice
(
object
,
noticeStatus
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
createWithModel
(
installNoticeDto
));
}
...
...
@@ -226,15 +210,7 @@ public class InstallNoticeController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr安装告知信息"
,
notes
=
"根据sequenceNbr安装告知信息"
)
public
ResponseModel
<
JSONObject
>
selectOneBySeq
(
@PathVariable
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
final
ProjectDto
projectDto
=
projectServiceImpl
.
queryBySeq
(
installNoticeDto
.
getProjectId
());
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
projectDto
.
getSequenceNbr
());
jsonObject
.
put
(
"installRegion"
,
projectDto
.
getInstallRegion
());
jsonObject
.
put
(
"licenseNum"
,
installNoticeDto
.
getLicenseNum
());
jsonObject
.
put
(
"licenseCompany"
,
installNoticeDto
.
getLicenseCompany
());
jsonObject
.
put
(
"licenseAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getLicenseAttch
()));
jsonObject
.
put
(
"contractAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getContractAttch
()));
JSONObject
jsonObject
=
installNoticeServiceImpl
.
selectOneBySeq
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jsonObject
);
}
...
...
@@ -259,6 +235,7 @@ public class InstallNoticeController extends BaseController {
installNoticeDto
.
setLicenseCompany
(
object
.
getString
(
"licenseCompany"
));
final
JSONArray
licenseAttch
=
object
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
object
.
getJSONArray
(
"contractAttch"
);
installNoticeDto
.
setInstallPri
(
object
.
getString
(
"installPri"
));
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
...
...
@@ -278,15 +255,42 @@ public class InstallNoticeController extends BaseController {
public
ResponseModel
<
Boolean
>
deleteBySeq
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
final
String
noticeStatus
=
installNoticeDto
.
getNoticeStatus
();
if
(
noticeStatus
.
equals
(
"已提交"
)||
noticeStatus
.
equals
(
"已保存
"
)){
if
(
!
noticeStatus
.
equals
(
"已接收
"
)){
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
return
null
;
return
ResponseHelper
.
buildResponse
(
false
)
;
}
/**
* 查询当前登陆人所在单位下的可选告知申请的所有项目列表
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登陆人所在单位下的所以项目列表"
,
notes
=
"查询当前登陆人所在单位下的所以项目列表"
)
@GetMapping
(
value
=
"/getProjects"
)
public
ResponseModel
<
List
<
Project
>>
getCompanyProjects
(){
Long
companyId
=
null
;
//获取当前登陆人所在单位id
companyId
=
orgServiceImpl
.
getCompanyId
();
if
(
ValidationUtil
.
isEmpty
(
companyId
)){
return
ResponseHelper
.
buildResponse
(
new
ArrayList
<>());
}
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<
Project
>();
if
(!
ValidationUtil
.
isEmpty
(
companyId
))
{
wrapper
.
eq
(
Project:
:
getInstallationUnitId
,
companyId
).
eq
(
Project:
:
getStatus
,
ProjectInitiationEnum
.
告知申请
.
getName
());
}
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
list
(
wrapper
));
}
/**
* 监察部门接受安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/acceptNotification"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"
接受告知"
,
notes
=
"接受
告知"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"
监察部门接受安装告知"
,
notes
=
"监察部门接受安装
告知"
)
public
ResponseModel
<
Boolean
>
acceptNotification
(
Long
sequenceNbr
){
InstallNotice
installNotice
=
installNoticeServiceImpl
.
getById
(
sequenceNbr
);
installNotice
.
setNoticeStatus
(
NoticeStatusEnum
.
已接收
.
getName
());
...
...
@@ -294,4 +298,23 @@ public class InstallNoticeController extends BaseController {
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
installNotice
,
NoticeStatusEnum
.
已接收
.
getStatusId
());
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateById
(
installNotice
));
}
/**
* 监检部门审查(通过/退回)安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/inspectNotification"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"监检部门审查(通过/退回)安装告知"
,
notes
=
"监检部门审查(通过/退回)安装告知"
)
public
ResponseModel
<
Boolean
>
inspectNotification
(
Long
sequenceNbr
,
String
option
){
InstallNotice
installNotice
=
installNoticeServiceImpl
.
getById
(
sequenceNbr
);
installNotice
.
setApproved
(
true
);
if
(
NoticeStatusEnum
.
已退回
.
equals
(
option
)){
installNotice
.
setApproved
(
false
);
}
Project
project
=
projectServiceImpl
.
getById
(
installNotice
.
getProjectId
());
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
installNotice
,
option
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateById
(
installNotice
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.AttachmentServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -31,13 +35,18 @@ public class MaterialController extends BaseController {
@Autowired
MaterialServiceImpl
materialServiceImpl
;
@Autowired
AttachmentServiceImpl
attachmentServiceImpl
;
@Autowired
AttachmentMapper
attachmentMapper
;
/**
* 新增材料信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增材料信息表"
,
notes
=
"新增材料信息表"
)
public
ResponseModel
<
MaterialDto
>
save
(
@RequestBody
MaterialDto
model
)
{
...
...
@@ -51,7 +60,7 @@ public class MaterialController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新材料信息表"
,
notes
=
"根据sequenceNbr更新材料信息表"
)
public
ResponseModel
<
MaterialDto
>
updateBySequenceNbrMaterial
(
@RequestBody
MaterialDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
...
...
@@ -65,7 +74,7 @@ public class MaterialController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除材料信息表"
,
notes
=
"根据sequenceNbr删除材料信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
...
...
@@ -78,7 +87,7 @@ public class MaterialController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个材料信息表"
,
notes
=
"根据sequenceNbr查询单个材料信息表"
)
public
ResponseModel
<
MaterialDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
...
...
@@ -92,15 +101,17 @@ public class MaterialController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表分页查询"
,
notes
=
"材料信息表分页查询"
)
public
ResponseModel
<
Page
<
MaterialDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
{
Page
<
MaterialDto
>
page
=
new
Page
<
MaterialDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
queryForMaterialPage
(
page
));
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
queryForMaterialPage
(
page
,
name
,
code
));
}
/**
...
...
@@ -108,7 +119,7 @@ public class MaterialController extends BaseController {
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表列表全部数据查询"
,
notes
=
"材料信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
MaterialDto
>>
selectForList
()
{
...
...
@@ -139,4 +150,61 @@ public class MaterialController extends BaseController {
public
ResponseModel
<
List
<
JSONObject
>>
selectName
(
@RequestParam
(
value
=
"unitId"
)
String
installationUnitId
)
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
selectName
(
installationUnitId
));
}
/**
* 新增材料+附件
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/saveIM"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增材料+附件"
,
notes
=
"新增材料+附件"
)
public
ResponseModel
<
MaterialDto
>
saveMaterial
(
@RequestBody
JSONObject
object
)
{
MaterialDto
model
=
materialServiceImpl
.
saveMaterial
(
object
);
Long
mSequenceNbr
=
model
.
getSequenceNbr
();
if
(
object
.
containsKey
(
"subForm"
)){
JSONArray
subForm
=
object
.
getJSONArray
(
"subForm"
);
attachmentServiceImpl
.
saveAttachment
(
subForm
,
mSequenceNbr
);
}
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr查询材料的附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"IM/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询材料和附件"
,
notes
=
"根据sequenceNbr查询材料和附件"
)
public
ResponseModel
<
JSONObject
>
selectIMOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
groupBySeq
(
sequenceNbr
));
}
/**
* 根据sequenceNbr更新材料及附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"IM/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据sequenceNbr更新设备和附件"
,
notes
=
"根据sequenceNbr更新设备和附件"
)
public
ResponseModel
<
String
>
updataIMOne
(
@PathVariable
Long
sequenceNbr
,
@RequestBody
JSONObject
object
)
{
materialServiceImpl
.
updateMI
(
sequenceNbr
,
object
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
*根据sequenceNbr删除材料和附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"IM/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除材料和附件"
,
notes
=
"根据sequenceNbr删除材料和附件"
)
public
ResponseModel
<
Boolean
>
deleteIMBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
attachmentMapper
.
deleteBySourceId
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
removeById
(
sequenceNbr
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.*
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -21,7 +26,6 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -50,6 +54,11 @@ public class ProjectController extends BaseController {
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
@Autowired
EquipmentServiceImpl
equipmentService
;
@Autowired
AttachmentServiceImpl
attachmentServiceImpl
;
/**
* 新增项目信息表
...
...
@@ -103,7 +112,7 @@ public class ProjectController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个项目信息表"
,
notes
=
"根据sequenceNbr查询单个项目信息表"
)
public
ResponseModel
<
ProjectDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
...
...
@@ -117,7 +126,7 @@ public class ProjectController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"项目信息表分页查询"
,
notes
=
"项目信息表分页查询"
)
public
ResponseModel
<
Page
<
ProjectDto
>>
queryForPage
(
...
...
@@ -199,6 +208,75 @@ public class ProjectController extends BaseController {
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
list
(
wrapper
));
}
/**
* 项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"项目审核"
,
notes
=
"项目审核"
)
@PostMapping
(
value
=
"/processProject"
)
public
ResponseModel
<
String
>
processProject
(
String
sequenceNbr
,
@RequestBody
JSONObject
json
){
String
option
=
json
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
Project
project
=
projectServiceImpl
.
getById
(
sequenceNbr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
project
));
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"审核不通过"
);
if
(
"1"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"审核通过"
);
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 审核员项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"审核员项目审核"
,
notes
=
"审核员项目审核"
)
@PostMapping
(
value
=
"/insProcess"
)
public
ResponseModel
<
String
>
insProcess
(
String
sequenceNbr
,
@RequestBody
JSONObject
json
){
String
option
=
json
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
Project
project
=
projectServiceImpl
.
getById
(
sequenceNbr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
project
));
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"符合"
);
if
(
"0"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"不符合且不需要整改"
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
}
else
if
(
"2"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"不符合且需要重新提交资料"
);
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加附件"
,
notes
=
"添加附件"
)
@PostMapping
(
value
=
"/saveOrUpdateFile"
)
public
ResponseModel
<
String
>
saveOrUpdateFile
(
@RequestBody
JSONObject
jsonObject
){
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
saveOrUpdateFile
(
jsonObject
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过sequenceNbr查询项目详情"
,
notes
=
"通过sequenceNbr查询项目详情"
)
@GetMapping
(
value
=
"/getDetail"
)
public
ResponseModel
<
ProjectDto
>
getDetail
(
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
getDetail
(
sequenceNbr
));
}
/**
* 查询当前登陆的建设单位和组织机构代码
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登陆的建设单位和组织机构代码"
,
notes
=
"查询当前登陆的建设单位和组织机构代码"
)
@GetMapping
(
value
=
"/getConstructionInfo"
)
public
ResponseModel
<
Map
>
getConstructionInfo
(){
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
getConstructionInfo
());
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectResourceController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.netflix.ribbon.proxy.annotation.Http
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.MaterialServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -38,6 +44,11 @@ public class ProjectResourceController extends BaseController {
@Autowired
ProjectResourceServiceImpl
projectResourceServiceImpl
;
@Autowired
ProjectResourceMapper
projectResourceMapper
;
@Autowired
MaterialServiceImpl
materialServiceImpl
;
/**
* 新增项目资源表(包括焊工、管材、设备)
*
...
...
@@ -86,9 +97,9 @@ public class ProjectResourceController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询
单个项目资源表(包括焊工、管材、设备)"
,
notes
=
"根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)
"
)
public
ResponseModel
<
ProjectResource
Dto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
queryBySeq
(
sequenceNbr
));
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询
焊机设备)"
,
notes
=
"根据sequenceNbr查询焊机设备
"
)
public
ResponseModel
<
WelderEquipment
Dto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
customSelectById
(
sequenceNbr
));
}
/**
...
...
@@ -143,6 +154,13 @@ public class ProjectResourceController extends BaseController {
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
installNoticeMsgList
(
page
,
name
,
type
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectByName"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊机设备分页查询"
,
notes
=
"焊机设备分页查询"
)
public
ResponseModel
<
WelderEquipmentDto
>
selectByName
(
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
selectByName
(
sequenceNbr
));
}
/**
* 项目设备新增
*/
...
...
@@ -178,4 +196,36 @@ public class ProjectResourceController extends BaseController {
public
ResponseModel
<
ProjectResource
>
saveId
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
saveIds
(
jsonObject
));
}
/**
* 项目管材分页列表,根据名称、编号查询
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/materialPage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊机设备分页查询"
,
notes
=
"焊机设备分页查询"
)
public
ResponseModel
<
Page
<
ProjectMaterialDto
>>
queryForMaterialPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
{
Page
<
ProjectMaterialDto
>
page
=
new
Page
<
ProjectMaterialDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
projectResourceMapper
.
MaterialPage
(
page
,
name
,
code
));
}
/**
* 根据sequenceNbr查询项目材料
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"IM/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询材料和附件"
,
notes
=
"根据sequenceNbr查询材料和附件"
)
public
ResponseModel
<
JSONObject
>
selectIMOne
(
@PathVariable
Long
sequenceNbr
)
{
JSONObject
jsonObject
=
materialServiceImpl
.
groupBySeq
(
sequenceNbr
);
jsonObject
.
getLong
(
"sequenceNbr"
);
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
groupBySeq
(
sequenceNbr
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/SuperviseRuleController.java
View file @
a71a3617
...
...
@@ -58,15 +58,15 @@ public class SuperviseRuleController extends BaseController {
public
ResponseModel
<
SuperviseRuleDto
>
save
(
@RequestBody
SuperviseRuleDto
model
)
{
model
.
setCreateDate
(
new
Date
());
//外网调不到内网,所以报错,暂时预留
//
Collection<RegionModel> result = Systemctl.regionClient.queryForTree(null).getResult();
//
//result是一个树结构的集合,需要递归
//
Map<String,String> map = new HashMap<>();
//
getMap(map,result);
//
//获取的Map中key是code,value是name
//
model.setAdminRegion(map.get(model.getAdminRegionCode()));
Collection
<
RegionModel
>
result
=
Systemctl
.
regionClient
.
queryForTree
(
null
).
getResult
();
//result是一个树结构的集合,需要递归
Map
<
String
,
String
>
map
=
new
HashMap
<>();
getMap
(
map
,
result
);
//获取的Map中key是code,value是name
model
.
setAdminRegion
(
map
.
get
(
model
.
getAdminRegionCode
()));
//外网调不到内网 暂时预留
//
OrgUsr orgUsr = orgServiceImpl.getOrgUsr();
//
model.setSequenceNbr(orgUsr.getSequenceNbr());
OrgUsr
orgUsr
=
orgServiceImpl
.
getOrgUsr
();
model
.
setSequenceNbr
(
orgUsr
.
getSequenceNbr
());
model
=
superviseRuleServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -139,7 +139,7 @@ public class SuperviseRuleController extends BaseController {
public
ResponseModel
<
Page
<
SuperviseRuleDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"adminRegionCode"
,
required
=
false
)
String
adminRegionCode
,
@RequestParam
(
value
=
"adminRegionCode"
,
required
=
false
)
Integer
adminRegionCode
,
@RequestParam
(
value
=
"superviseDeptId"
,
required
=
false
)
Long
superviseDeptId
,
@RequestParam
(
value
=
"inspectionUnitId"
,
required
=
false
)
Long
inspectionUnitId
)
{
...
...
@@ -147,7 +147,7 @@ public class SuperviseRuleController extends BaseController {
Page
<
SuperviseRuleDto
>
page
=
new
Page
<
SuperviseRuleDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
superviseRuleServiceImpl
.
queryForSuperviseRulePage
(
page
,
superviseDeptId
,
inspectionUnitId
));
return
ResponseHelper
.
buildResponse
(
superviseRuleServiceImpl
.
queryForSuperviseRulePage
(
page
,
superviseDeptId
,
inspectionUnitId
,
adminRegionCode
));
}
/**
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/VerifyController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -111,7 +112,7 @@ public class VerifyController extends BaseController {
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"智能监检管理表列表全部数据查询"
,
notes
=
"智能监检管理表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
VerifyDto
>>
selectForList
()
{
...
...
@@ -126,46 +127,42 @@ public class VerifyController extends BaseController {
/** cpp
*
*焊接管材检验信息列表
* @param current
* @param size
* @param dto
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/select
Inspection
"
)
@GetMapping
(
value
=
"/select
Tubular
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊接管材检验信息列表"
,
notes
=
"焊接管材检验信息列表"
)
public
ResponseModel
<
Page
<
TubingDto
>>
selectInspection
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
TubingDto
d
to
)
{
Page
<
Tubing
Dto
>
page
=
new
Page
<>();
public
ResponseModel
<
Page
<
SmartListDto
>>
selectTubular
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListD
to
)
{
Page
<
SmartList
Dto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
selectInspection
(
page
,
d
to
));
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
焊前管材质量
.
getStage
(),
page
,
smartListD
to
));
}
/** cpp
*
*查询焊接人员检验信息列表
* @param current
* @param size
* @param
dto
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectWorker"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询焊接人员检验信息列表"
,
notes
=
"查询焊接人员检验信息列表"
)
public
ResponseModel
<
Page
<
Worker
Dto
>>
selectWorker
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
WorkerDto
d
to
)
{
Page
<
Worker
Dto
>
page
=
new
Page
<>();
public
ResponseModel
<
Page
<
SmartList
Dto
>>
selectWorker
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListD
to
)
{
Page
<
SmartList
Dto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
selectWorker
(
page
,
d
to
));
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
焊前人员
.
getStage
(),
page
,
smartListD
to
));
}
/** cpp
...
...
@@ -173,51 +170,143 @@ public class VerifyController extends BaseController {
*查询焊接设备检验信息列表
* @param current
* @param size
* @param dto
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectFacility"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询焊接设备检验信息列表"
,
notes
=
"查询焊接设备检验信息列表"
)
public
ResponseModel
<
Page
<
Facility
Dto
>>
selectFacility
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
FacilityDto
d
to
)
{
Page
<
Facility
Dto
>
page
=
new
Page
<>();
public
ResponseModel
<
Page
<
SmartList
Dto
>>
selectFacility
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListD
to
)
{
Page
<
SmartList
Dto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
selectFacility
(
page
,
d
to
));
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
焊前设备
.
getStage
(),
page
,
smartListD
to
));
}
/** cpp
*
*查询焊接工艺检验信息列表
* @param current
* @param size
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectCraft"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询焊接工艺检验信息列表"
,
notes
=
"查询焊接工艺检验信息列表"
)
public
ResponseModel
<
Page
<
SmartListDto
>>
selectCraft
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListDto
)
{
Page
<
SmartListDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
焊接工艺
.
getStage
(),
page
,
smartListDto
));
}
/** cpp
*
*查询管道耐压检验信息列表
* @param current
* @param size
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectVoltage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询管道耐压检验信息列表"
,
notes
=
"查询管道耐压检验信息列表"
)
public
ResponseModel
<
Page
<
SmartListDto
>>
selectVoltage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListDto
)
{
Page
<
SmartListDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
管道耐压
.
getStage
(),
page
,
smartListDto
));
}
/** cpp
*
*敷设位置标定检验列表
* @param current
* @param size
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectLocation"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"敷设位置标定检验列表"
,
notes
=
"敷设位置标定检验列表"
)
public
ResponseModel
<
Page
<
SmartListDto
>>
selectLocation
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
SmartListDto
smartListDto
)
{
Page
<
SmartListDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
service
.
commonality
(
StageEnum
.
定位
.
getStage
(),
page
,
smartListDto
));
}
/**
* cpp
*
* 校验
* 校验
* @param dto
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/checks"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"校验app上传数据"
,
notes
=
"校验app上传数据"
)
public
ResponseModel
<
String
>
checks
(
@RequestBody
AcceptDto
dto
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
checks
(
dto
));
}
/**
* 焊接工艺效验
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"焊接工艺效验"
,
notes
=
"焊接工艺效验"
)
@PostMapping
(
value
=
"/weldeffect"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"焊接工艺效验"
,
notes
=
"焊接工艺效验"
)
@PostMapping
(
value
=
"/welde
E
ffect"
)
public
ResponseModel
<
String
>
weldEffect
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
weldEffect
(
jsonObject
));
}
/**
* 管材耐压效验
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"管材耐压效验"
,
notes
=
"管材耐压效验"
)
@PostMapping
(
value
=
"/materialEffect"
)
public
ResponseModel
<
String
>
materialEffect
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
materialEffect
(
jsonObject
));
}
/**
* 敷设质量检验
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"敷设质量检验"
,
notes
=
"敷设质量检验"
)
@PostMapping
(
value
=
"/layEffect"
)
public
ResponseModel
<
String
>
layEffect
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
layEffect
(
jsonObject
));
}
/**
*焊口敷设位置标定检验
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"焊口敷设位置标定检验"
,
notes
=
"焊口敷设位置标定检验"
)
@PostMapping
(
value
=
"/positionEffect"
)
public
ResponseModel
<
String
>
positionEffect
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
positionEffect
(
jsonObject
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WelderController.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WelderServiceImpl
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.poi.ss.formula.functions.T
;
...
...
@@ -22,6 +31,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -44,6 +54,12 @@ public class WelderController extends BaseController {
@Autowired
OrgServiceImpl
orgServiceImpl
;
@Autowired
ProjectResourceMapper
projectResourceMapper
;
@Autowired
ProjectResourceServiceImpl
projectResourceServiceImpl
;
/**
* 新增/修改焊工信息
*
...
...
@@ -51,10 +67,10 @@ public class WelderController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveWelder"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增
焊工信息"
,
notes
=
"新增焊工
信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增
人员信息"
,
notes
=
"新增人员
信息"
)
public
ResponseModel
<
OrgUsrDto
>
saveWelder
(
@RequestBody
JSONObject
jsonObject
,
@RequestParam
String
bizOrgType
,
@RequestParam
(
required
=
false
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
welderServiceImpl
.
savePerson
(
jsonObject
,
bizOrgType
,
sequenceNbr
));
}
/**
...
...
@@ -64,7 +80,7 @@ public class WelderController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectWelder"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
新增焊工信息"
,
notes
=
"新增
焊工信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
获取焊工信息"
,
notes
=
"获取
焊工信息"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectWelder
(
@RequestParam
(
"code"
)
String
code
)
{
List
<
JSONObject
>
jsonObjectList
=
new
ArrayList
<>();
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -93,6 +109,16 @@ public class WelderController extends BaseController {
}
/**
* 项目焊工人员删除
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/delWelder/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"Delete"
,
value
=
"项目焊工人员删除"
,
notes
=
"项目焊工人员删除"
)
public
ResponseModel
<
Boolean
>
deleteByResourceId
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
projectResourceMapper
.
deleteByResourceId
(
sequenceNbr
));
}
/**
* 当前登陆人所在公司/单位/企业 下的 所有焊工人员分页查询
* @param current 当前页
* @param current 每页大小
...
...
@@ -112,28 +138,57 @@ public class WelderController extends BaseController {
}
/**
* 根据sequenceNbr查询
焊工
信息
* 根据sequenceNbr查询
人员
信息
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询
项目焊工信息表"
,
notes
=
"根据sequenceNbr查询项目焊工信息表
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询
人员信息"
,
notes
=
"根据sequenceNbr查询人员信息
"
)
public
ResponseModel
<
Map
>
selectOneById
(
@PathVariable
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
getdetialInfo
(
sequenceNbr
));
}
/**
* 根据sequenceNbr删除
焊工信息
* 根据sequenceNbr删除
人员信息表
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr删除项目焊工信息表"
,
notes
=
"根据sequenceNbr删除项目焊工信息表"
)
public
void
deleteOneById
(
@PathVariable
String
sequenceNbr
)
throws
Exception
{
@DeleteMapping
(
value
=
"/deleteOneById/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr删除人员信息表"
,
notes
=
"根据sequenceNbr删除人员信息表"
)
public
ResponseModel
<
String
>
deleteOneById
(
@PathVariable
String
sequenceNbr
)
throws
Exception
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
orgServiceImpl
.
getOrgUsrById
(
sequenceNbr
).
getAmosOrgId
());
orgServiceImpl
.
delectInfo
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
""
,
notes
=
""
)
@GetMapping
(
value
=
"/getUserInfo"
)
@BusinessIdentify
public
ResponseModel
<
IPage
>
getUserInfo
(
int
current
,
int
size
){
IPage
page
=
new
Page
();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
=
orgServiceImpl
.
getPersonInfo
(
String
.
valueOf
(
orgServiceImpl
.
getReginParams
().
getCompany
().
getSequenceNbr
()),
page
);
List
<
Map
>
mapList
=
page
.
getRecords
();
for
(
Map
map
:
mapList
){
if
(
OrgEnum
.
焊工
.
getKey
().
equals
((
String
)
map
.
get
(
"type"
))){
map
.
put
(
"typeName"
,
OrgEnum
.
焊工
.
getName
());
}
else
{
map
.
put
(
"typeName"
,
OrgEnum
.
普通人员
.
getName
());
}
}
return
ResponseHelper
.
buildResponse
(
page
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/AttachmentServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IAttachmentService
;
...
...
@@ -30,4 +33,29 @@ public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,
public
List
<
AttachmentDto
>
queryForAttachmentList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 根据sourceId添加附件
* @param subForm
* @param sequenceNbr
*
*/
public
void
saveAttachment
(
JSONArray
subForm
,
Long
sequenceNbr
){
Attachment
attachment
=
new
Attachment
();
for
(
Object
o:
subForm
){
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
o
));
jsonObject
.
getString
(
"Symbol_key"
);
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"info"
);
for
(
Object
j:
jsonArray
){
JSONObject
info
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
j
));
String
name
=
info
.
getString
(
"name"
);
attachment
.
setSourceId
(
sequenceNbr
);
attachment
.
setName
(
info
.
getString
(
"name"
));
attachment
.
setInfo
(
JSON
.
toJSONString
(
subForm
));
attachment
.
setType
(
name
.
substring
(
name
.
lastIndexOf
(
"."
)+
1
));
this
.
save
(
attachment
);
break
;
}
}
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.AbstractWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
org.apache.lucene.queryparser.flexible.messages.Message
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.
text.SimpleDateForma
t
;
import
java.
util.ArrayLis
t
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.
Locale
;
import
java.util.
*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -29,9 +36,20 @@ import java.util.stream.Collectors;
* @date 2022-09-22
*/
@Service
public
class
CompanyServiceImpl
extends
BaseService
<
CompanyDto
,
Company
,
CompanyMapper
>
implements
ICompanyService
{
@Autowired
CompanyMapper
companyMapper
;
@Autowired
OrgServiceImpl
orgService
;
ICompanyService
iCompanyService
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
/**
* 列表查询 示例
...
...
@@ -44,18 +62,122 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
/**
* 分页查询+筛选
*/
public
Page
<
CompanyDto
>
queryCompanyPage
(
int
current
,
int
size
,
Company
Dto
companyDto
)
{
public
Page
<
CompanyDto
>
queryCompanyPage
(
int
current
,
int
size
,
Company
company
)
{
Page
<
CompanyDto
>
page
=
new
Page
<>();
page
.
setSize
(
size
);
page
.
setCurrent
(
current
);
Page
<
CompanyDto
>
page1
=
queryForPage
(
page
,
null
,
false
);
if
(
companyDto
.
getName
()
!=
null
)
{
List
<
CompanyDto
>
collect
=
page1
.
getRecords
().
stream
().
filter
(
a
->
a
.
getName
().
equals
(
companyDto
.
getName
())).
collect
(
Collectors
.
toList
());
page1
.
setRecords
(
collect
);
this
.
list
();
List
<
CompanyDto
>
companies
=
companyMapper
.
queryCompanyPage
(
company
);
// List<CompanyDto> companyDtos = new ArrayList<>();
// BeanUtils.copyProperties(companies,companyDtos);
page
.
setRecords
(
companies
);
// if (companyDto.getName() != null) {
// List<CompanyDto> collect = page1.getRecords().stream().filter(a -> a.getName().equals(companyDto.getName())).collect(Collectors.toList());
// page1.setRecords(collect);
// }
return
page
;
}
/**
* 新增部门和负责人
* @return
*/
@BusinessIdentify
public
Boolean
saveDepartment
(
JSONObject
jsonObject
,
String
sequenceNbr
){
if
(
ValidationUtil
.
isEmpty
(
jsonObject
))
{
return
false
;
}
if
(
ValidationUtil
.
isEmpty
(
sequenceNbr
))
{
//平台添加
DepartmentModel
departmentModel
=
new
DepartmentModel
(
);
ReginParams
reginParams
=
orgService
.
getReginParams
();
departmentModel
.
setCompanySeq
(
reginParams
.
getCompany
().
getSequenceNbr
());
departmentModel
.
setDepartmentName
(
jsonObject
.
getString
(
"name"
));
departmentModel
.
setLevel
(
"dept"
);
departmentModel
.
setParentId
(
1L
);
departmentModel
=
Privilege
.
departmentClient
.
create
(
departmentModel
).
getResult
();
//业务添加
jsonObject
.
put
(
"amosOrgId"
,
departmentModel
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
departmentModel
.
getOrgCode
());
}
orgService
.
dataHandling
(
jsonObject
,
OrgEnum
.
部门
.
getKey
(),
sequenceNbr
);
return
true
;
}
public
Boolean
companyCheck
(
CompanyDto
model
,
Long
sequenceNbr
,
String
bizOrgType
)
throws
Exception
{
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
Company
company
=
this
.
getById
(
sequenceNbr
);
company
.
setApproved
(
model
.
getApproved
());
return
page1
;
if
(
company
.
getApproved
().
equals
(
"已审核"
)){
final
CompanyModel
companyModel
=
new
CompanyModel
();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
//创建平台企业
companyModel
.
setCompanyName
(
company
.
getName
());
companyModel
.
setCompanyCode
(
company
.
getCreditCode
());
companyModel
.
setAddress
(
company
.
getAddress
());
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"headquarter"
);
companyModel
.
setAgencyCode
(
"ugp"
);
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
//创建平台用户
//设置用户角色
List
<
RoleModel
>
allRoleList
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
).
getResult
();
String
[]
unitTypeCodes
=
company
.
getType
().
split
(
","
);
for
(
String
code
:
unitTypeCodes
)
{
roleNameSet
.
add
(
OrgEnum
.
map
.
get
(
code
));
}
userRoleList
=
allRoleList
.
stream
().
filter
(
r
->
r
.
getRoleName
().
equals
(
roleNameSet
)).
collect
(
Collectors
.
toList
());
userRoleList
.
stream
().
forEach
(
r
->
{
roleIds
.
add
(
r
.
getSequenceNbr
());
});
roleSeqsMap
.
put
(
companyModelFeignClient
.
getSequenceNbr
(),
roleIds
);
orgRoles
.
put
(
companyModelFeignClient
.
getSequenceNbr
(),
userRoleList
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
//设置用户信息
String
adminName
=
company
.
getAdminName
();
String
adminLoginName
=
company
.
getAdminLoginName
();
String
adminPhone
=
company
.
getAdminTel
();
String
adminPassword
=
company
.
getAdminLoginPwd
();
agencyUserModel
.
setRealName
(
adminName
);
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setMobile
(
adminPhone
);
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setUserName
(
adminLoginName
);
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
adminPassword
,
secretKey
));
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
adminPassword
,
secretKey
));
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
//企业动态表单存储
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
company
));
jsonObject
.
put
(
"amosOrgId"
,
companyModelFeignClient
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
companyModelFeignClient
.
getOrgCode
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
,
null
);
//企业管理员人员 动态表单存储
jsonObject
=
null
;
jsonObject
.
put
(
"name"
,
adminName
);
jsonObject
.
put
(
"phone"
,
adminPhone
);
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
OrgEnum
.
企业管理员
.
getKey
(),
null
);
}
return
this
.
updateById
(
company
);
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/InstallNoticeServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.sql.Wrapper
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -27,6 +37,12 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
@Autowired
InstallNoticeMapper
installNoticeMapper
;
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
ProjectInitiationServiceImpl
projectInitiationServiceImpl
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
/**
* 分页查询
*/
...
...
@@ -45,7 +61,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
* 安装告知申请分页查询
*/
public
Page
<
InstallNoticePageDto
>
installNoticePage
(
Page
<
InstallNoticePageDto
>
page
,
String
name
,
String
constructionUnit
)
{
return
installNoticeMapper
.
installNoticePage
(
page
,
name
,
constructionUnit
);
Page
<
InstallNoticePageDto
>
installNoticePage
=
installNoticeMapper
.
installNoticePage
(
page
,
name
,
constructionUnit
);
List
<
InstallNoticePageDto
>
installNoticePageDtos
=
installNoticePage
.
getRecords
();
for
(
InstallNoticePageDto
installNoticePageDto:
installNoticePageDtos
){
if
(!
ValidationUtil
.
isEmpty
(
installNoticePageDto
.
getApproved
())){
if
(
installNoticePageDto
.
getApproved
()){
installNoticePageDto
.
setApprovedName
(
"通过"
);
}
else
{
installNoticePageDto
.
setApprovedName
(
"不通过"
);
}
}
}
return
installNoticePage
;
}
/**
...
...
@@ -56,4 +83,49 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public
InstallNoticeDto
selectOneById
(
Long
sequenceNbr
){
return
installNoticeMapper
.
selectoneById
(
sequenceNbr
);
}
/**
* 新增安装告知申请,保存/提交
*
* @return
*/
public
InstallNoticeDto
saveInstallNotice
(
JSONObject
object
,
String
noticeStatus
)
{
InstallNoticeDto
installNoticeDto
=
new
InstallNoticeDto
();
final
ProjectDto
projectDto
=
projectServiceImpl
.
queryBySeq
(
object
.
getLong
(
"name"
));
installNoticeDto
.
setProjectId
(
object
.
getLong
(
"name"
));
installNoticeDto
.
setNoticeStatus
(
noticeStatus
);
installNoticeDto
.
setNoticeDate
(
new
Date
());
installNoticeDto
.
setApproved
(
false
);
installNoticeDto
.
setInstallPri
(
object
.
getString
(
"installPri"
));
installNoticeDto
.
setOrganizationCode
(
orgServiceImpl
.
getOrgUsr
().
getBizOrgCode
());
installNoticeDto
.
setLicenseNum
(
object
.
getString
(
"licenseNum"
));
installNoticeDto
.
setLicenseCompany
(
object
.
getString
(
"licenseCompany"
));
final
JSONArray
licenseAttch
=
object
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
object
.
getJSONArray
(
"contractAttch"
);
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
projectInitiationServiceImpl
.
execute
(
projectDto
.
getInstanceId
(),
installNoticeDto
,
"1"
);
return
installNoticeDto
;
}
/**
* 根据sequenceNbr查询安装告知信息及附件
*
* @param sequenceNbr 主键
* @return
*/
public
JSONObject
selectOneBySeq
(
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
selectOneById
(
sequenceNbr
);
final
ProjectDto
projectDto
=
projectServiceImpl
.
queryBySeq
(
installNoticeDto
.
getProjectId
());
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
projectDto
.
getSequenceNbr
());
jsonObject
.
put
(
"installRegion"
,
projectDto
.
getInstallRegion
());
jsonObject
.
put
(
"licenseNum"
,
installNoticeDto
.
getLicenseNum
());
jsonObject
.
put
(
"licenseCompany"
,
installNoticeDto
.
getLicenseCompany
());
jsonObject
.
put
(
"licenseAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getLicenseAttch
()));
jsonObject
.
put
(
"contractAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getContractAttch
()));
jsonObject
.
put
(
"installPri"
,
installNoticeDto
.
getInstallPri
());
return
jsonObject
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Material
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IMaterialService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -22,11 +31,16 @@ import java.util.List;
*/
@Service
public
class
MaterialServiceImpl
extends
BaseService
<
MaterialDto
,
Material
,
MaterialMapper
>
implements
IMaterialService
{
@Autowired
AttachmentServiceImpl
attachmentServiceImpl
;
@Autowired
AttachmentMapper
attachmentMapper
;
/**
* 分页查询
*/
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
,
String
name
,
String
code
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
name
,
code
);
}
/**
...
...
@@ -57,4 +71,84 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
return
names
;
}
/**
* 新增材料
*/
@Override
public
MaterialDto
saveMaterial
(
JSONObject
jsonObject
){
MaterialDto
materialDto
=
new
MaterialDto
();
materialDto
.
setRecDate
(
new
Date
());
materialDto
.
setName
(
jsonObject
.
getString
(
"name"
));
materialDto
.
setCode
(
jsonObject
.
getString
(
"code"
));
materialDto
.
setMaterial
(
jsonObject
.
getString
(
"material"
));
materialDto
.
setSpec
(
jsonObject
.
getString
(
"spec"
));
materialDto
.
setLength
(
jsonObject
.
getDouble
(
"length"
));
materialDto
.
setDiameter
(
jsonObject
.
getDouble
(
"diameter"
));
materialDto
.
setWallThickness
(
jsonObject
.
getInteger
(
"wallThickness"
));
materialDto
.
setManufacturer
(
jsonObject
.
getString
(
"manufacturer"
));
materialDto
.
setManufactureAddr
(
jsonObject
.
getString
(
"manufactureAddr"
));
materialDto
.
setManufactureDate
(
jsonObject
.
getDate
(
"manufactureDate"
));
materialDto
.
setBatchNum
(
jsonObject
.
getString
(
"batchNum"
));
MaterialDto
result
=
this
.
createWithModel
(
materialDto
);
return
result
;
}
/**
* 修改设备+附件信息
* @param sequenceNbr
* @param jsonObject
*/
public
void
updateMI
(
Long
sequenceNbr
,
JSONObject
jsonObject
){
MaterialDto
materialDto
=
this
.
queryBySeq
(
sequenceNbr
);
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
Attachment
attachment
=
attachmentServiceImpl
.
getOne
(
wrapper
);
materialDto
.
setName
(
jsonObject
.
getString
(
"name"
));
materialDto
.
setCode
(
jsonObject
.
getString
(
"code"
));
materialDto
.
setMaterial
(
jsonObject
.
getString
(
"material"
));
materialDto
.
setSpec
(
jsonObject
.
getString
(
"spec"
));
materialDto
.
setLength
(
jsonObject
.
getDouble
(
"length"
));
materialDto
.
setDiameter
(
jsonObject
.
getDouble
(
"diameter"
));
materialDto
.
setWallThickness
(
jsonObject
.
getInteger
(
"wallThickness"
));
materialDto
.
setManufacturer
(
jsonObject
.
getString
(
"manufacturer"
));
materialDto
.
setManufactureAddr
(
jsonObject
.
getString
(
"manufactureAddr"
));
materialDto
.
setManufactureDate
(
jsonObject
.
getDate
(
"manufactureDate"
));
materialDto
.
setBatchNum
(
jsonObject
.
getString
(
"batchNum"
));
this
.
updateWithModel
(
materialDto
);
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
if
(
ValidationUtil
.
isEmpty
(
attachment
)){
attachmentServiceImpl
.
saveAttachment
(
subForm
,
sequenceNbr
);
}
else
{
attachment
.
setInfo
(
JSON
.
toJSONString
(
subForm
));
attachmentServiceImpl
.
updateById
(
attachment
);
}
}
/**
* 根据sequenceNbr查询材料的附件
*
* @param sequenceNbr 主键
* @return
*/
public
JSONObject
groupBySeq
(
Long
sequenceNbr
){
MaterialDto
materialDto
=
queryBySeq
(
sequenceNbr
);
AttachmentDto
attachmentDto
=
attachmentMapper
.
selectAttBySeq
(
sequenceNbr
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
materialDto
.
getName
());
jsonObject
.
put
(
"code"
,
materialDto
.
getCode
());
jsonObject
.
put
(
"material"
,
materialDto
.
getMaterial
());
jsonObject
.
put
(
"spec"
,
materialDto
.
getSpec
());
jsonObject
.
put
(
"length"
,
materialDto
.
getLength
());
jsonObject
.
put
(
"diameter"
,
materialDto
.
getDiameter
());
jsonObject
.
put
(
"wallThickness"
,
materialDto
.
getWallThickness
());
jsonObject
.
put
(
"manufacturer"
,
materialDto
.
getManufacturer
());
jsonObject
.
put
(
"manufactureAddr"
,
materialDto
.
getManufactureAddr
());
jsonObject
.
put
(
"manufactureDate"
,
materialDto
.
getManufactureDate
());
jsonObject
.
put
(
"batchNum"
,
materialDto
.
getBatchNum
());
if
(
attachmentDto
!=
null
){
JSONArray
jsonArray
=
JSON
.
parseArray
(
attachmentDto
.
getInfo
());
jsonObject
.
put
(
"subForm"
,
jsonArray
);
}
return
jsonObject
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
View file @
a71a3617
...
...
@@ -18,8 +18,13 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnSer
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -27,6 +32,7 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.*
;
...
...
@@ -129,16 +135,19 @@ public class OrgServiceImpl {
orgUsr
.
setOrgExpandAttr1
(
jsonObject
.
getString
(
"type"
));
orgUsr
.
setBizOrgCode
(
jsonObject
.
getString
(
"creditCode"
));
}
if
(
OrgEnum
.
人员
.
getKey
().
equals
(
bizOrgType
)){
if
(
OrgEnum
.
普通
人员
.
getKey
().
equals
(
bizOrgType
)){
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
))
{
orgUsr
.
setOrgExpandAttr1
(
OrgEnum
.
焊工
.
getKey
());
orgUsr
.
setCode
(
getCode
());
}
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
reginParams
.
getCompany
().
getSequenceNbr
()));
orgUsr
.
setParentId
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()));
}
if
(
OrgEnum
.
部门
.
getKey
().
equals
(
bizOrgType
))
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
reginParams
.
getCompany
().
getSequenceNbr
()));
orgUsr
.
setParentId
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()));
}
//设置bizOrgCode
if
(
orgUsr
.
getParentId
()
!=
null
)
{
...
...
@@ -154,6 +163,21 @@ public class OrgServiceImpl {
return
orgUsr
;
}
public
String
getCode
(){
int
c
;
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
orderByDesc
(
OrgUsr:
:
getCode
).
eq
(
OrgUsr:
:
getOrgExpandAttr1
,
OrgEnum
.
焊工
.
getKey
());
String
code
=
orgUsrServiceImpl
.
list
(
wrapper
).
iterator
().
next
().
getCode
();
if
(
ValidationUtil
.
isEmpty
(
code
)){
c
=
0001
;
}
else
{
c
=
Integer
.
parseInt
(
code
)+
1
;
}
String
welderCode
=
OrgEnum
.
焊工
.
getKey
()
+
"-"
+
c
;
return
welderCode
;
}
/**
* 用户单位信息redis获取
**/
...
...
@@ -197,15 +221,30 @@ public class OrgServiceImpl {
*/
public
Map
getdetialInfo
(
String
sequenceNbr
){
Map
map
=
new
HashMap
();
OrgUsr
orgUsr
=
getOrgUsrById
(
sequenceNbr
);
String
type
=
orgUsr
.
getOrgExpandAttr1
();
LambdaQueryWrapper
<
DynamicFormInstance
>
instanceWrapper
=
new
LambdaQueryWrapper
<>();
instanceWrapper
.
eq
(
DynamicFormInstance
::
getInstanceId
,
sequenceNbr
);
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
alertFormValueServiceImpl
.
list
(
instanceWrapper
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"sequenceNbr"
,
sequenceNbr
);
for
(
DynamicFormInstance
dynamicFormInstance
:
dynamicFormInstanceList
)
{
map
.
put
(
dynamicFormInstance
.
getFieldCode
(),
dynamicFormInstance
.
getFieldValue
());
}
return
map
;
}
/**
* 获取当前登陆人的建设单位和建设单位的组织机构代码
* @return
*/
@BusinessIdentify
public
Map
getConstructionInfo
(){
ReginParams
reginParams
=
getReginParams
();
ReginParams
.
BusinessInfo
businessInfo
=
reginParams
.
getBusinessInfo
();
Long
companySequenceNbr
=
businessInfo
.
getCompanySequenceNbr
();
return
getdetialInfo
(
String
.
valueOf
(
companySequenceNbr
));
}
/**
* 获取当前登陆人所在公司/单位/企业 下的 所有焊工人员
...
...
@@ -213,7 +252,19 @@ public class OrgServiceImpl {
*/
public
IPage
getCompanyWelder
(
IPage
page
){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
getReginParams
().
getCompany
().
getSequenceNbr
()));
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
getReginParams
().
getCompany
().
getSequenceNbr
()))
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgEnum
.
焊工
.
getKey
());
return
getInfo
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()),
page
);
}
/**
* 获取当前登陆人所在公司/单位/企业 下的 所有部门
* @return
*/
public
IPage
getCompanyDept
(
IPage
page
){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
getReginParams
().
getCompany
().
getSequenceNbr
()))
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgEnum
.
部门
.
getKey
());
return
getInfo
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()),
page
);
}
...
...
@@ -240,7 +291,7 @@ public class OrgServiceImpl {
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
getReginParams
().
getCompany
().
getSequenceNbr
()));
LambdaQueryWrapper
<
OrgUsr
>
personWrapper
=
new
LambdaQueryWrapper
<>();
personWrapper
.
eq
(
OrgUsr:
:
getParentId
,
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
())
.
eq
(
OrgUsr
::
getBizOrgType
,
OrgEnum
.
人员
.
getKey
());
.
eq
(
OrgUsr
::
getBizOrgType
,
OrgEnum
.
普通
人员
.
getKey
());
return
orgUsrServiceImpl
.
list
(
personWrapper
);
}
...
...
@@ -286,7 +337,7 @@ public class OrgServiceImpl {
OrgUsr
orgUsr
=
getOrgUsrById
(
sequenceNbr
);
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
like
(
OrgUsr
::
getBizOrgCode
,
orgUsr
.
getBizOrgCode
())
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgEnum
.
人员
.
getKey
())
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgEnum
.
普通
人员
.
getKey
())
.
ne
(
OrgUsr:
:
getOrgExpandAttr1
,
OrgEnum
.
焊工
.
getKey
());
List
<
OrgUsr
>
orgUsrList
=
orgUsrServiceImpl
.
list
(
wrapper
);
return
orgUsrList
;
...
...
@@ -300,7 +351,7 @@ public class OrgServiceImpl {
public
void
delectInfo
(
String
sequencenNbr
)
throws
Exception
{
OrgUsr
orgUsr
=
getOrgUsrById
(
sequencenNbr
);
LambdaQueryWrapper
<
DynamicFormInstance
>
dynamicWrapper
=
new
LambdaQueryWrapper
<>();
if
(
OrgEnum
.
人员
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
())){
if
(
OrgEnum
.
普通
人员
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
())){
dynamicWrapper
.
eq
(
DynamicFormInstance:
:
getInstanceId
,
sequencenNbr
);
alertFormValueServiceImpl
.
remove
(
dynamicWrapper
);
}
else
{
...
...
@@ -314,7 +365,34 @@ public class OrgServiceImpl {
throw
new
Exception
(
"该企业/部门下还有人员,不可删除!"
);
}
}
}
/**
* 获取企业下的人员信息列表
* @param companyId 单位/企业id
* @return
*/
public
IPage
getPersonInfo
(
String
companyId
,
IPage
page
){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getSequenceNbr
,
companyId
);
OrgUsr
orgUsrCompany
=
orgUsrServiceImpl
.
getOne
(
wrapper
);
LambdaQueryWrapper
<
OrgUsr
>
welderWrapper
=
new
LambdaQueryWrapper
<>();
welderWrapper
.
likeRight
(
OrgUsr
::
getBizOrgCode
,
orgUsrCompany
.
getBizOrgCode
()).
eq
(
OrgUsr
::
getBizOrgType
,
OrgEnum
.
普通人员
.
getKey
());
List
<
OrgUsr
>
orgUsrList
=
new
ArrayList
<>();
if
(
ValidationUtil
.
isEmpty
(
page
)){
orgUsrList
=
orgUsrServiceImpl
.
list
(
welderWrapper
);
page
=
new
Page
();
}
else
{
orgUsrList
=
orgUsrServiceImpl
.
page
(
page
,
welderWrapper
).
getRecords
();
}
List
<
Map
>
mapList
=
new
ArrayList
<>();
for
(
OrgUsr
orgUsr
:
orgUsrList
)
{
Map
map
=
getdetialInfo
(
String
.
valueOf
(
orgUsr
.
getSequenceNbr
()));
mapList
.
add
(
map
);
}
page
.
setRecords
(
mapList
);
return
page
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
View file @
a71a3617
...
...
@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
...
...
@@ -54,11 +57,15 @@ public class ProblemInitiationServiceImpl {
@Autowired
QualityProblemServiceImpl
qualityProblemService
;
private
static
String
SMSCODE
=
"SMS_UGP_0003"
;
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
private
String
problemDefinitionKey
;
@Value
(
"supervisionRoleId"
)
private
String
supervisionRoleId
;
@Value
(
"installationRoleId"
)
private
String
installationRoleId
;
public
String
start
(
QualityProblem
qualityProblem
)
{
String
instanceId
=
null
;
...
...
@@ -80,6 +87,7 @@ public class ProblemInitiationServiceImpl {
qualityProblem
.
setInstanceId
(
instanceId
);
qualityProblem
.
setStatus
(
projectInitiationService
.
getFlowTaskName
(
instanceId
));
qualityProblemService
.
updateById
(
qualityProblem
);
sendSms
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
qualityProblem
)),
SMSEnum
.
质量问题短信
.
getCode
());
return
instanceId
;
}
...
...
@@ -96,7 +104,19 @@ public class ProblemInitiationServiceImpl {
if
(
ProblemProcessEnum
.
重大问题发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
// sendSms(object);
sendSms
(
object
,
SMSEnum
.
重大质量问题短信
.
getCode
());
}
}
if
(
ProblemProcessEnum
.
超期整改发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
超期整改短信
.
getCode
());
}
}
if
(
ProblemProcessEnum
.
重大问题整改完成发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
重大质量问题短信
.
getCode
());
}
}
...
...
@@ -126,33 +146,75 @@ public class ProblemInitiationServiceImpl {
}
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"companyName"
,
object
.
getString
(
"installationUnit"
));
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"name"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper
<
SuperviseRule
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"admin_region_code"
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
noticeUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
noticeUnitId
),
null
,
null
,
null
).
getResult
();
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
Long
sequenceNbr
=
object
.
getLong
(
"sequenceNbr"
);
if
(
SMSEnum
.
项目安装告知申请
.
getCode
().
equals
(
smsCode
)){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"projectName"
));
smsParams
.
put
(
"problemDesc"
,
object
.
getString
(
"problemDesc"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id拿到平台的监察部门id
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule:
:
getAdminRegionCode
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
noticeUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
noticeUnitId
,
smsParams
,
smsCode
,
supervisionRoleId
);
}
else
if
(
SMSEnum
.
项目立项驳回短信
.
getCode
().
equals
(
smsCode
))
{
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"projectName"
));
smsParams
.
put
(
"reviewInfo"
,
object
.
getString
(
"reviewInfo"
));
//给监察发短信
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule:
:
getAdminRegionCode
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
supervisionUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
supervisionUnitId
,
smsParams
,
smsCode
,
supervisionRoleId
);
//给安装发短信
String
installationUnitId
=
orgUsrServiceImpl
.
getById
(
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallationUnitId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
installationUnitId
,
smsParams
,
smsCode
,
installationRoleId
);
}
}
/**
* 发送短信
* @param sequenceNbr 任务id(项目/问题)
* @param noticeUnitId 平台目标企业id
* @param smsParams 短信参数
* @param smsCode 短信模板
* @param roleId 角色id
*/
public
void
sendMessage
(
Long
sequenceNbr
,
String
noticeUnitId
,
HashMap
<
String
,
String
>
smsParams
,
String
smsCode
,
String
roleId
){
//向noticeUnitId的部门发送短信
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
roleId
,
null
).
getResult
();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapperQueryWrapper
=
new
LambdaQueryWrapper
<>();
wrapperQueryWrapper
.
eq
(
OrgUsr:
:
getAmosOrgCode
,
agencyUserModel
.
getUserId
());
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
SMSCODE
,
agencyUserModel
.
getMobile
(),
smsParams
);
RectifyMsg
rectifyMsg
=
new
RectifyMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
boolean
bool
=
false
;
List
<
CompanyModel
>
companyModelList
=
agencyUserModel
.
getCompanys
();
for
(
CompanyModel
companyModel
:
companyModelList
)
{
bool
=
companyModel
.
getSequenceNbr
().
equals
(
noticeUnitId
);
if
(
bool
){
break
;
}
}
if
(
bool
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapperQueryWrapper
=
new
LambdaQueryWrapper
<>();
wrapperQueryWrapper
.
eq
(
OrgUsr:
:
getAmosOrgId
,
agencyUserModel
.
getSequenceNbr
());
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
smsCode
,
agencyUserModel
.
getMobile
(),
smsParams
);
RectifyMsg
rectifyMsg
=
new
RectifyMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
rectifyMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
rectifyMsg
.
setProblemId
(
sequenceNbr
);
rectifyMsg
.
setNoticeUnitId
(
Long
.
valueOf
(
noticeUnitId
));
rectifyMsg
.
setMsgReceiver
(
orgUsrServiceImpl
.
getOne
(
wrapperQueryWrapper
).
getSequenceNbr
());
rectifyMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
rectifyMsgServiceImpl
.
save
(
rectifyMsg
);
}
rectifyMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
rectifyMsg
.
setProblemId
(
object
.
getLong
(
"sequenceNbr"
));
rectifyMsg
.
setNoticeUnitId
(
Long
.
valueOf
(
noticeUnitId
));
rectifyMsg
.
setMsgReceiver
(
orgUsrServiceImpl
.
getOne
(
wrapperQueryWrapper
).
getSequenceNbr
());
rectifyMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
rectifyMsgServiceImpl
.
save
(
rectifyMsg
);
}
}
...
...
@@ -167,6 +229,7 @@ public class ProblemInitiationServiceImpl {
return
smsRecordModel
;
}
public
void
updateProBlemFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
QualityProblem
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
QualityProblem:
:
getInstanceId
,
instanceId
);
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
View file @
a71a3617
...
...
@@ -80,6 +80,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
RectifyMsgServiceImpl
rectifyMsgServiceImpl
;
@Autowired
ProblemInitiationServiceImpl
problemInitiationService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
...
...
@@ -140,22 +143,23 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
if
(
ProjectInitiationEnum
.
接受审查意见
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
"监检科室分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
if
(
"监检员分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
ProjectInitiationEnum
.
项目关闭
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
}
}
if
(
"监检员审核"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
try
{
//组装信息
...
...
@@ -179,18 +183,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
SmsRecordModel
sendSmsMassage
(
String
smsCode
,
String
mobile
,
HashMap
<
String
,
String
>
smsParams
){
SmsRecordModel
smsRecordModel
=
new
SmsRecordModel
();
if
(!
ValidationUtil
.
isEmpty
(
mobile
)){
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"mobile"
,
mobile
);
smsRecordModel
=
Systemctl
.
smsClient
.
sendCommonSms
(
smsParams
).
getResult
();
}
return
smsRecordModel
;
}
/**
* 获取流程当前任务名称
* @param instanceId
...
...
@@ -209,37 +201,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
Project
project
=
projectService
.
getOne
(
wrapper
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
project
.
setStatus
(
ProjectInitiationEnum
.
getCodeByNameMap
.
get
(
getFlowTaskName
(
instanceId
)
));
projectService
.
updateById
(
project
);
}
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"companyName"
,
object
.
getString
(
"installationUnit"
));
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"name"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper
<
SuperviseRule
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"admin_region_code"
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
noticeUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
noticeUnitId
),
null
,
null
,
null
).
getResult
();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapperQueryWrapper
=
new
LambdaQueryWrapper
<>();
wrapperQueryWrapper
.
eq
(
OrgUsr:
:
getAmosOrgCode
,
agencyUserModel
.
getUserId
());
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
smsCode
,
agencyUserModel
.
getMobile
(),
smsParams
);
RectifyMsg
rectifyMsg
=
new
RectifyMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
rectifyMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
rectifyMsg
.
setProblemId
(
object
.
getLong
(
"sequenceNbr"
));
rectifyMsg
.
setNoticeUnitId
(
Long
.
valueOf
(
noticeUnitId
));
rectifyMsg
.
setMsgReceiver
(
orgUsrServiceImpl
.
getOne
(
wrapperQueryWrapper
).
getSequenceNbr
());
rectifyMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
rectifyMsgServiceImpl
.
save
(
rectifyMsg
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectResourceServiceImpl.java
View file @
a71a3617
...
...
@@ -62,8 +62,8 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
}
@Override
public
Page
<
WelderEquipmentDto
>
selectByName
(
Page
<
WelderEquipmentDto
>
page
,
String
name
,
String
unit
)
{
return
null
;
public
WelderEquipmentDto
selectByName
(
Long
sequenceNbr
)
{
return
this
.
projectResourceMapper
.
customSelectById
(
sequenceNbr
)
;
}
@Override
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -25,11 +35,45 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@Autowired
ProjectMapper
projectMapper
;
@Autowired
AttachmentServiceImpl
attachmentService
;
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
EquipmentServiceImpl
equipmentService
;
/**
* 分页查询
*/
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
,
String
name
,
String
constructionUnit
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
name
,
constructionUnit
);
Page
<
ProjectDto
>
projectDtoPage
=
this
.
queryForPage
(
page
,
null
,
false
,
name
,
constructionUnit
);
List
<
ProjectDto
>
projects
=
projectDtoPage
.
getRecords
();
for
(
ProjectDto
project:
projects
){
getProjectState
(
project
);
}
return
projectDtoPage
;
}
private
void
getProjectState
(
ProjectDto
project
)
{
String
state
=
""
,
insDep
=
""
,
insPerson
=
""
;
LambdaQueryWrapper
<
ProjectInitiation
>
lambdaQueryWrap
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrap
.
eq
(
ProjectInitiation:
:
getInstanceId
,
project
.
getInstanceId
())
.
orderByDesc
(
ProjectInitiation:
:
getSequenceNbr
);
List
<
ProjectInitiation
>
projectInitiationList
=
projectInitiationService
.
list
(
lambdaQueryWrap
);
if
(!
ValidationUtil
.
isEmpty
(
projectInitiationList
)){
ProjectInitiation
projectInitiation
=
projectInitiationList
.
iterator
().
next
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
projectInitiation
.
getContext
());
state
=
jsonObject
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
insDep
=
jsonObject
.
getString
(
XJConstant
.
INS_DEP
);
insPerson
=
jsonObject
.
getString
(
XJConstant
.
INS_PRESON
);
}
project
.
setExamineProjectState
(
state
);
project
.
setInsDep
(
insDep
);
project
.
setInsPerson
(
insPerson
);
}
...
...
@@ -64,8 +108,61 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
* @return
*/
public
List
<
Project
>
selectByidList
(
List
<
Long
>
ids
){
return
projectMapper
.
selectBatchIds
(
ids
);
}
public
ProjectDto
getDetail
(
Long
sequenceNbr
){
ProjectDto
project
=
projectMapper
.
getDetail
(
sequenceNbr
);
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
try
{
JSONArray
jsonArray
=
JSON
.
parseArray
(
attachmentService
.
getOne
(
wrapper
).
getInfo
());
project
.
setSubForm
(
jsonArray
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"该项目暂无附件"
);
}
project
.
getInstanceId
();
getProjectState
(
project
);
return
project
;
}
public
String
saveOrUpdateFile
(
JSONObject
jsonObject
){
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
Long
sequenceNbr
=
jsonObject
.
getLong
(
"sequenceNbr"
);
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
if
(
ValidationUtil
.
isEmpty
(
attachment
)){
equipmentService
.
saveAttachment
(
subForm
,
sequenceNbr
);
}
else
{
attachment
.
setInfo
(
JSON
.
toJSONString
(
subForm
));
attachmentService
.
updateById
(
attachment
);
}
Project
project
=
this
.
getById
(
sequenceNbr
);
ProjectDto
projectDto
=
new
ProjectDto
();
BeanUtils
.
copyProperties
(
project
,
projectDto
);
projectDto
.
setInsDep
(
jsonObject
.
getString
(
"insDep"
));
projectDto
.
setInsDep
(
jsonObject
.
getString
(
"insPerson"
));
projectDto
.
setProcessProjectState
(
jsonObject
.
getString
(
"processProjectState"
));
boolean
design
=
false
,
install
=
false
;
for
(
Object
object:
subForm
){
JSONObject
jo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
String
type
=
jo
.
getString
(
"type"
);
if
(
OrgEnum
.
设计单位
.
getKey
().
equals
(
type
)){
design
=
true
;
}
if
(
OrgEnum
.
安装单位
.
getKey
().
equals
(
type
)){
design
=
true
;
}
}
if
(
design
&&
install
){
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
projectDto
,
"1"
);
}
this
.
updateById
(
project
);
return
"ok"
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/SuperviseRuleServiceImpl.java
View file @
a71a3617
...
...
@@ -20,8 +20,8 @@ public class SuperviseRuleServiceImpl extends BaseService<SuperviseRuleDto,Super
/**
* 分页查询
*/
public
Page
<
SuperviseRuleDto
>
queryForSuperviseRulePage
(
Page
<
SuperviseRuleDto
>
page
,
Long
superviseDeptId
,
Long
inspectionUnitId
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
superviseDeptId
,
inspectionUnitId
);
public
Page
<
SuperviseRuleDto
>
queryForSuperviseRulePage
(
Page
<
SuperviseRuleDto
>
page
,
Long
superviseDeptId
,
Long
inspectionUnitId
,
Integer
adminRegionCode
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
superviseDeptId
,
inspectionUnitId
,
adminRegionCode
);
}
/**
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.mao.demo1.TestWeldingRules
;
import
com.mao.demo1.material.MyPqr
;
import
com.mao.demo1.material.MyWps
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.QualityProblem
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Verify
;
...
...
@@ -17,9 +25,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* 智能监检管理表服务实现类
...
...
@@ -35,6 +41,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
WeldServiceImpl
weldService
;
@Autowired
WeldMapper
weldMapper
;
@Autowired
OrgServiceImpl
orgService
;
@Autowired
VerifyMapper
verifyMapper
;
...
...
@@ -47,7 +55,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public
Page
<
VerifyDto
>
queryForVerifyPage
(
Page
<
VerifyDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
...
...
@@ -61,184 +68,745 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
/**
/** cpp
* 智能监检共用查询方法
*
* stage 阶段
* page 分页
*/
public
List
<
IntelligentInspectionDto
>
commonality
(
String
stage
){
List
<
Verify
>
commonality
=
verifyMapper
.
commonality
(
stage
);
List
<
IntelligentInspectionDto
>
dtoList
=
new
ArrayList
<>();
//进入焊前
if
(
commonality
!=
null
&&
commonality
.
size
()
!=
0
){
for
(
Verify
verify
:
commonality
)
{
IntelligentInspectionDto
beforeDto
=
new
IntelligentInspectionDto
(
);
beforeDto
.
setSequenceNbr
(
verify
.
getSequenceNbr
());
//智能监检表id
beforeDto
.
setProjectId
(
verify
.
getProjectId
());
//项目id
beforeDto
.
setName
(
verify
.
getProject
().
getName
());
//项目名称
beforeDto
.
setProjectCode
(
verify
.
getProject
().
getCode
());
//项目编号
beforeDto
.
setStatus
(
verify
.
getStatus
());
//检验状态
beforeDto
.
setType
(
verify
.
getType
());
//检验方式
beforeDto
.
setSubmitTime
(
verify
.
getVerifyTime
());
//交检日期
beforeDto
.
setVerifyTime
(
verify
.
getVerifyTime
());
//检验时间
beforeDto
.
setStage
(
verify
.
getStage
());
String
targetInfo
=
verify
.
getTargetInfo
();
//app上传数据
beforeDto
.
setTargetInfo
(
targetInfo
);
dtoList
.
add
(
beforeDto
);
public
Page
<
SmartListDto
>
commonality
(
String
stage
,
Page
<
SmartListDto
>
page
,
SmartListDto
smartListDto
){
List
<
Verify
>
verifyList
=
verifyMapper
.
commonality
(
stage
,
smartListDto
);
List
<
SmartListDto
>
dtoList
=
new
ArrayList
<>();
//进入焊前
if
(
verifyList
!=
null
&&
verifyList
.
size
()
!=
0
){
for
(
Verify
verify
:
verifyList
)
{
SmartListDto
dto
=
new
SmartListDto
(
);
dto
.
setSequenceNbr
(
verify
.
getSequenceNbr
());
//智能监检表id
dto
.
setProjectId
(
verify
.
getProjectId
());
//项目id
dto
.
setName
(
verify
.
getProject
().
getName
());
//项目名称
dto
.
setProjectCode
(
verify
.
getProject
().
getCode
());
//项目编号
String
status
=
verify
.
getStatus
(
);
if
(
status
.
equals
(
"1"
))
{
dto
.
setStatus
(
VerifyEnum
.
已通过
.
getName
());
//检验状态
dto
.
setPeopleStatus
(
"合格期内"
);
//持证状态
}
if
(
status
.
equals
(
"0"
))
{
dto
.
setStatus
(
VerifyEnum
.
未通过
.
getName
());
//检验状态
dto
.
setPeopleStatus
(
"超期未检"
);
//持证状态
}
dto
.
setType
(
verify
.
getType
());
//检验方式
dto
.
setSubmitTime
(
verify
.
getSubmitTime
());
//交检日期
dto
.
setVerifyTime
(
verify
.
getVerifyTime
());
//检验时间
String
stage1
=
verify
.
getStage
(
);
//检验检测阶段
Map
<
String
,
String
>
map
=
StageEnum
.
getStatusByVerifyNameMap
;
for
(
String
key:
map
.
keySet
()){
if
(
key
.
equals
(
stage1
))
{
dto
.
setStage
(
map
.
get
(
key
).
toString
());
//将阶段赋值
}
}
return
dtoList
;
}
String
targetInfo
=
verify
.
getTargetInfo
();
//app上传数据
Map
mapInfo
=
JSON
.
parseObject
(
targetInfo
,
Map
.
class
);
for
(
Object
o:
mapInfo
.
keySet
()){
if
(
o
.
toString
().
equals
(
"code"
))
{
//获取焊口编号
String
code
=
(
String
)
mapInfo
.
get
(
o
.
toString
(
));
dto
.
setCode
(
code
);
}
if
(
o
.
toString
().
equals
(
"peopleLocation"
))
{
//获取焊接定位信息
String
peopleLocation
=
(
String
)
mapInfo
.
get
(
o
.
toString
(
));
dto
.
setPeopleLocation
(
peopleLocation
);
}
if
(
o
.
toString
().
equals
(
"userId"
))
{
//获取焊工信息
String
userId
=
(
String
)
mapInfo
.
get
(
o
.
toString
(
));
OrgUsr
orgUsr
=
orgService
.
getOrgUsrById
(
userId
);
dto
.
setPeopleName
(
orgUsr
.
getBizOrgName
());
//焊工姓名
dto
.
setPeopleName
(
orgUsr
.
getCode
());
//焊工编号
/**
* 查询焊接管材检验信息列表
* @param page
}
}
dtoList
.
add
(
dto
);
}
}
page
.
setRecords
(
dtoList
);
page
.
setTotal
(
dtoList
.
size
());
return
page
;
}
/** cpp
* 智能监检校验数据 人员 设备 管材
* @param dto
* @return
*/
@Override
public
Page
<
TubingDto
>
selectInspection
(
Page
<
TubingDto
>
page
,
TubingDto
dto
)
{
List
<
IntelligentInspectionDto
>
commonality
=
this
.
commonality
(
StageEnum
.
焊前管材质量
.
getName
());
ArrayList
<
TubingDto
>
list
=
new
ArrayList
<>(
);
for
(
IntelligentInspectionDto
intelligentInspectionDto
:
commonality
)
{
TubingDto
tubingDto
=
new
TubingDto
(
);
BeanUtils
.
copyProperties
(
intelligentInspectionDto
,
tubingDto
);
list
.
add
(
tubingDto
);
private
static
final
String
TYPE
=
"智能检验"
;
public
String
checks
(
AcceptDto
dto
)
{
if
(
dto
==
null
)
{
return
"未上传数据,请上传"
;
}
page
.
setRecords
(
list
);
page
.
setTotal
(
list
.
size
());
return
page
;
}
Verify
verify
=
new
Verify
(
);
//获取公共属性信息
Long
projectId
=
dto
.
getProjectId
(
);
//项目id
String
code
=
dto
.
getCode
(
);
//焊口编号
String
peopleLocation
=
dto
.
getPeopleLocation
(
);
//焊接定位信息
String
stage
=
dto
.
getStage
(
);
//阶段检验
//获取当前校验时间
Date
time
=
new
Date
();
//人员
if
(
stage
.
equals
(
StageEnum
.
焊前人员
.
getVerifyName
())&&
dto
.
getPeoplePhoto
()
!=
null
&&
!
dto
.
getPeoplePhoto
().
equals
(
""
))
{
//获取焊接人员校验信息
String
peoplePhoto
=
dto
.
getPeoplePhoto
(
);
//人脸识别图片信息
String
userId
=
dto
.
getUserId
(
);
//人员id
HashMap
<
String
,
String
>
map
=
new
HashMap
<>(
);
map
.
put
(
"peoplePhoto"
,
peoplePhoto
);
map
.
put
(
"code"
,
code
);
map
.
put
(
"peopleLocation"
,
peopleLocation
);
map
.
put
(
"userId"
,
userId
);
String
targetInfo
=
JSON
.
toJSONString
(
map
,
SerializerFeature
.
WriteMapNullValue
);
//焊口编号 人脸识别图片信息 焊接定位信息 人员id
verify
.
setSequenceNbr
(
new
Date
().
getTime
());
verify
.
setProjectId
(
projectId
);
verify
.
setStage
(
StageEnum
.
焊前人员
.
getStage
());
//阶段
verify
.
setType
(
TYPE
);
verify
.
setTargetInfo
(
targetInfo
);
verify
.
setVerifyTime
(
time
);
//数据校验
Boolean
falg
=
false
;
/**假设*/
if
(!
falg
)
{
/* //校验不通过,存入校验信息,
verify.setStatus(VerifyEnum.未通过.getStatus());
try {
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace();
}
//将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
QualityProblem qualityProblem = new QualityProblem();
qualityProblem.setSequenceNbr(new Date().getTime());
qualityProblem.setProjectId(projectId);
//随机生成四位数
String s = String.valueOf((int) ((Math.random( ) * 9 + 1) * 1000));
qualityProblem.setCode(code+"-WT"+s);
qualityProblem.setGenerateStage(stage);
qualityProblem.setProblemDescribe(stage+"不通过");
qualityProblem.setStageVerifyId(verify.getSequenceNbr());
qualityProblemService.save(qualityProblem);
return VerifyEnum.未通过.getName();*/
this
.
addFailData
(
verify
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
}
//校验通过
/*//这个是判断过后需要存的状态
verify.setStatus(VerifyEnum.已通过.getStatus());
try {
//智能监检管理表添加数据
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace( );
}
//焊口表存更改状态
Weld weld = weldMapper.getWeldByCodeAndProjectId(code, projectId);
weld.setSuperInspecStatus(stage);
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>( );
wrapper.eq(Weld::getCode ,weld.getCode());
weldMapper.update(weld,wrapper);*/
this
.
addSuccessData
(
verify
);
/**
* 查询焊接人员检验信息列表
* @param page
* @param dto
* @return
*/
@Override
public
Page
<
WorkerDto
>
selectWorker
(
Page
<
WorkerDto
>
page
,
WorkerDto
dto
)
{
List
<
IntelligentInspectionDto
>
commonality
=
this
.
commonality
(
StageEnum
.
焊前人员
.
getName
());
ArrayList
<
WorkerDto
>
workerList
=
new
ArrayList
<>(
);
for
(
IntelligentInspectionDto
intelligentInspectionDto
:
commonality
)
{
WorkerDto
workerDto
=
new
WorkerDto
(
);
BeanUtils
.
copyProperties
(
intelligentInspectionDto
,
workerDto
);
workerList
.
add
(
workerDto
);
}
page
.
setRecords
(
workerList
);
page
.
setTotal
(
workerList
.
size
());
return
page
;
}
//设备
if
(
stage
.
equals
(
StageEnum
.
焊前设备
.
getVerifyName
())&&
dto
.
getFacilityPhoto
()
!=
null
&&
!
dto
.
getFacilityPhoto
().
equals
(
""
)){
//获取校验设备信息
String
facilityId
=
dto
.
getFacilityId
(
);
//设备id
String
calibrationStatus
=
dto
.
getCalibrationStatus
(
);
//检定状态
String
facilityPhoto
=
dto
.
getFacilityPhoto
(
);
//设备图片
HashMap
<
String
,
String
>
mapfacilty
=
new
HashMap
<>(
);
mapfacilty
.
put
(
"code"
,
code
);
//焊口编号
mapfacilty
.
put
(
"peopleLocation"
,
peopleLocation
);
//焊接定位信息
mapfacilty
.
put
(
"calibrationStatus"
,
calibrationStatus
);
mapfacilty
.
put
(
"facilityPhoto"
,
facilityPhoto
);
mapfacilty
.
put
(
"facilityId"
,
facilityId
);
String
targetInfo
=
JSON
.
toJSONString
(
mapfacilty
,
SerializerFeature
.
WriteMapNullValue
);
verify
.
setSequenceNbr
(
new
Date
().
getTime
());
//主键
verify
.
setProjectId
(
projectId
);
verify
.
setStage
(
StageEnum
.
焊前设备
.
getStage
());
verify
.
setTargetInfo
(
targetInfo
);
verify
.
setType
(
TYPE
);
verify
.
setVerifyTime
(
time
);
//数据校验
Boolean
flag
=
false
;
/**
* 查询焊接设备检验信息列表
* @param page
* @param dto
* @return
if
(!
flag
)
{
//校验不通过
this
.
addFailData
(
verify
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
}
//效验通过
this
.
addSuccessData
(
verify
);
}
//管材
if
(
stage
.
equals
(
StageEnum
.
焊前管材质量
.
getVerifyName
())&&
dto
.
getMaterialPhoto
()
!=
null
&&
!
dto
.
getMaterialPhoto
().
equals
(
""
)){
String
materialId
=
dto
.
getMaterialId
(
);
//管材id
String
materialPhoto
=
dto
.
getMaterialPhoto
(
);
//管材图片信息
HashMap
<
String
,
String
>
mapMaterial
=
new
HashMap
<>(
);
mapMaterial
.
put
(
"code"
,
code
);
mapMaterial
.
put
(
"materialId"
,
materialId
);
mapMaterial
.
put
(
"materialPhoto"
,
materialPhoto
);
mapMaterial
.
put
(
"peopleLocation"
,
peopleLocation
);
String
targetInfo
=
JSON
.
toJSONString
(
mapMaterial
,
SerializerFeature
.
WriteMapNullValue
);
verify
.
setTargetInfo
(
targetInfo
);
verify
.
setSequenceNbr
(
new
Date
().
getTime
());
verify
.
setStage
(
StageEnum
.
焊前管材质量
.
getStage
());
verify
.
setType
(
TYPE
);
verify
.
setVerifyTime
(
time
);
verify
.
setProjectId
(
projectId
);
//数据校验
MyPqr
pqr
=
new
MyPqr
(
);
pqr
.
setCombox_type
(
"高于上转变温度进行焊后热处理(如正火)"
);
pqr
.
setMaterial_a_thickness
(
"1.4"
);
pqr
.
setMaterial_b_thickness
(
"5"
);
pqr
.
setIf_bend
(
"lateral_bending"
);
MyWps
wps
=
new
MyWps
(
);
wps
.
setMaterial_a_thickness
(
"1.5"
);
wps
.
setMaterial_b_thickness
(
"1.4"
);
HashMap
<
String
,
String
>
stringStringHashMap
=
new
TestWeldingRules
(
).
droolsTest
(
pqr
,
wps
);
Boolean
flag
=
false
;
if
(!
flag
)
{
//不通过, 添加数据并返回未通过结果
this
.
addFailData
(
verify
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
}
//校验通过
this
.
addSuccessData
(
verify
);
}
return
VerifyEnum
.
已通过
.
getName
();
}
/** cpp
* 校验失败需要添加的数据
* @param verify
* @param qualityProblem
*/
@Override
public
Page
<
FacilityDto
>
selectFacility
(
Page
<
FacilityDto
>
page
,
FacilityDto
dto
)
{
List
<
IntelligentInspectionDto
>
commonality
=
this
.
commonality
(
StageEnum
.
焊前设备
.
getName
());
ArrayList
<
FacilityDto
>
facilityList
=
new
ArrayList
<>(
);
for
(
IntelligentInspectionDto
intelligentInspectionDto
:
commonality
)
{
FacilityDto
facilityDto
=
new
FacilityDto
(
);
BeanUtils
.
copyProperties
(
intelligentInspectionDto
,
facilityDto
);
facilityList
.
add
(
facilityDto
);
public
void
addFailData
(
Verify
verify
,
QualityProblem
qualityProblem
){
//校验不通过,存入校验信息,
verify
.
setStatus
(
VerifyEnum
.
未通过
.
getStatus
());
try
{
//智能监检管理表添加数据
int
insert
=
verifyMapper
.
insert
(
verify
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//
//质量问题表添加数据
qualityProblem
.
setSequenceNbr
(
new
Date
().
getTime
());
qualityProblem
.
setProjectId
(
verify
.
getProjectId
());
//随机生成四位数
String
s
=
String
.
valueOf
((
int
)
((
Math
.
random
(
)
*
9
+
1
)
*
1000
));
String
targetInfo
=
verify
.
getTargetInfo
(
);
Map
map
=
JSON
.
parseObject
(
targetInfo
,
Map
.
class
);
for
(
Object
o:
map
.
keySet
()){
if
(
o
.
toString
().
equals
(
"code"
))
{
String
code
=
(
String
)
map
.
get
(
o
.
toString
(
));
qualityProblem
.
setCode
(
code
+
"-WT"
+
s
);
//获取焊口编码
}
}
page
.
setRecords
(
facilityList
);
page
.
setTotal
(
facilityList
.
size
());
return
page
;
qualityProblem
.
setGenerateStage
(
verify
.
getStage
());
qualityProblem
.
setProblemDescribe
(
verify
.
getStage
()+
"不通过"
);
qualityProblem
.
setStageVerifyId
(
verify
.
getSequenceNbr
());
qualityProblemService
.
save
(
qualityProblem
);
}
/**
*
智能监检校验
数据
* @param
dto
* @
return
/**
cpp
*
校验成功需要添加的
数据
* @param
verify
* @
param
*/
public
String
checks
(
AcceptDto
dto
)
{
if
(
dto
!=
null
)
{
// 校验数据
//调用方法判断
public
void
addSuccessData
(
Verify
verify
){
//效验通过状态
verify
.
setStatus
(
VerifyEnum
.
已通过
.
getStatus
());
try
{
//智能监检管理表添加数据
int
insert
=
verifyMapper
.
insert
(
verify
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
}
//焊口表存更改状态
String
targetInfo
=
verify
.
getTargetInfo
(
);
String
code
=
null
;
Map
map
=
JSON
.
parseObject
(
targetInfo
,
Map
.
class
);
for
(
Object
o:
map
.
keySet
()){
if
(
o
.
toString
().
equals
(
"code"
))
{
code
=(
String
)
map
.
get
(
o
.
toString
(
));
//通过,将数据添加到verity表中,并返回ok
}
}
Weld
weld
=
weldMapper
.
getWeldByCodeAndProjectId
(
code
,
verify
.
getProjectId
());
if
(
weld
!=
null
)
{
//判断是哪一个阶段
String
stage
=
verify
.
getStage
(
);
Map
<
String
,
String
>
mapEnum
=
StageEnum
.
getNameByNameMap
;
for
(
String
s:
mapEnum
.
keySet
()){
if
(
stage
.
equals
(
s
))
{
String
name
=
mapEnum
.
get
(
s
);
//获取监检状态
weld
.
setSuperInspecStatus
(
name
);
}
}
//如果不通过,将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
LambdaQueryWrapper
<
Weld
>
wrapper
=
new
LambdaQueryWrapper
<>(
);
wrapper
.
eq
(
Weld:
:
getCode
,
weld
.
getCode
()).
eq
(
Weld:
:
getProjectId
,
weld
.
getProjectId
());
weldMapper
.
update
(
weld
,
wrapper
);
}
return
"ok"
;
}
private
String
效验状态
=
"已存在"
;
private
final
String
问题编码
=
"-WT"
;
/**
* 公共效验接口
*/
public
String
effect
(
JSONObject
jsonObject
,
Integer
效验数量
,
Boolean
i
)
{
// String 效验状态 = "已存在";
Verify
verify
=
new
Verify
();
//添加筛选条件
LambdaQueryWrapper
<
Verify
>
wrapper
=
new
LambdaQueryWrapper
<>();
//获取target_info
JSONObject
targetInfo
=
jsonObject
.
getJSONObject
(
"target_info"
);
String
code
=
targetInfo
.
getString
(
"code"
);
//筛选出本焊口监检数
wrapper
.
eq
(
Verify:
:
getCode
,
code
);
//改焊口焊前数据
Integer
verifyCount
=
verifyMapper
.
selectCount
(
wrapper
);
if
(
verifyCount
==
效验数量
)
{
wrapper
.
eq
(
Verify:
:
getStatus
,
VerifyEnum
.
已通过
.
getStatus
());
//该焊口焊前效验通过数据
Integer
integer
=
verifyMapper
.
selectCount
(
wrapper
);
//判断入库数量
if
(
integer
==
效验数量
)
{
verify
.
setProjectId
(
jsonObject
.
getLong
(
"projectId"
));
verify
.
setCode
(
jsonObject
.
getString
(
"code"
));
verify
.
setTargetInfo
(
jsonObject
.
getString
(
"target_info"
));
verify
.
setSubmitTime
(
new
Date
());
verify
.
setVerifyTime
(
new
Date
());
verify
.
setType
(
VerifyTypeEnum
.
智能检验
.
getStatus
());
//获取操作阶段
String
stage
=
targetInfo
.
getString
(
"stage"
);
verify
.
setStage
(
stage
);
//获取效验接口
if
(
i
)
{
verify
.
setStatus
(
VerifyEnum
.
已通过
.
getStatus
());
//添加筛选条件
LambdaQueryWrapper
<
Weld
>
wrapperWeld
=
new
LambdaQueryWrapper
<>();
wrapperWeld
.
eq
(
Weld:
:
getCode
,
jsonObject
.
getString
(
"code"
));
Weld
weld
=
weldMapper
.
selectOne
(
wrapperWeld
);
weld
.
setSuperInspecStatus
(
stage
);
weldService
.
updateById
(
weld
);
效验状态
=
"已通过"
;
this
.
save
(
verify
);
}
else
{
int
math
=
(
int
)
((
Math
.
random
()
*
9
+
1
)*
1000
);
verify
.
setStatus
(
VerifyEnum
.
未通过
.
getStatus
());
this
.
save
(
verify
);
LambdaQueryWrapper
<
Verify
>
wrapperVerify
=
new
LambdaQueryWrapper
<>();
wrapperVerify
.
eq
(
Verify:
:
getCode
,
jsonObject
.
getString
(
"code"
));
wrapperVerify
.
eq
(
Verify:
:
getStage
,
stage
);
Verify
verifyId
=
verifyMapper
.
selectOne
(
wrapperVerify
);
QualityProblem
qualityProblem
=
new
QualityProblem
();
//生成问题编码
qualityProblem
.
setStageVerifyId
(
verifyId
.
getSequenceNbr
());
qualityProblem
.
setCode
(
jsonObject
.
getString
(
"code"
)+
问题编码
+
math
);
qualityProblem
.
setProjectId
(
jsonObject
.
getLong
(
"projectId"
));
qualityProblem
.
setGenerateStage
(
stage
);
qualityProblem
.
setSubmitDate
(
new
Date
());
qualityProblemService
.
save
(
qualityProblem
);
效验状态
=
"未通过"
;
}
}
}
return
效验状态
;
}
/**
* 焊接工艺效验
*/
private
String
效验状态
=
"null"
;
private
final
Integer
焊前效验数量
=
3
;
public
String
weldEffect
(
JSONObject
jsonObject
)
{
Verify
verify
=
new
Verify
();
LambdaQueryWrapper
<
Verify
>
wrapper
=
new
LambdaQueryWrapper
<>();
//筛选出本次任务
wrapper
.
eq
(
Verify:
:
getCode
,
jsonObject
.
getString
(
"code"
));
wrapper
.
eq
(
Verify:
:
getStatus
,
VerifyEnum
.
已通过
.
getStatus
());
List
<
Verify
>
verifies
=
verifyMapper
.
selectList
(
wrapper
);
//判断前三次已经入库
if
(
verifies
.
stream
().
count
()
==
3
)
{
//获取效验接口
Boolean
i
=
true
;
verify
.
setProjectId
(
jsonObject
.
getLong
(
"projectId"
));
verify
.
setCode
(
jsonObject
.
getString
(
"code"
));
verify
.
setTargetInfo
(
jsonObject
.
getString
(
"target_info"
));
verify
.
setStage
(
StageEnum
.
焊接工艺
.
getStage
());
if
(
i
)
{
verify
.
setStatus
(
VerifyEnum
.
已通过
.
getStatus
());
LambdaQueryWrapper
<
Weld
>
wrapperWeld
=
new
LambdaQueryWrapper
<>();
wrapperWeld
.
eq
(
Weld:
:
getCode
,
jsonObject
.
getString
(
"code"
));
Weld
weld
=
weldMapper
.
selectOne
(
wrapperWeld
);
weld
.
setSuperInspecStatus
(
StageEnum
.
焊接工艺
.
getStage
());
weldService
.
updateById
(
weld
);
效验状态
=
"已通过"
;
}
else
{
verify
.
setStatus
(
VerifyEnum
.
未通过
.
getStatus
());
QualityProblem
qualityProblem
=
new
QualityProblem
();
qualityProblem
.
setCode
(
"WT"
+
jsonObject
.
getString
(
"code"
));
qualityProblem
.
setProjectId
(
jsonObject
.
getLong
(
"projectId"
));
qualityProblem
.
setGenerateStage
(
StageEnum
.
焊接工艺
.
getName
());
qualityProblem
.
setSubmitDate
(
new
Date
());
qualityProblemService
.
save
(
qualityProblem
);
效验状态
=
"未通过"
;
}
}
save
(
verify
);
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// JSONObject targetInfo = jsonObject.getJSONObject("target_info");
// String code = targetInfo.getString("code");
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, code);
// //改焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 焊前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前三次已经入库
// if (integer == 焊前效验数量) {
// //获取效验接口
// Boolean i = false;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.焊接工艺.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.焊接工艺.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// this.save(verify);
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.焊接工艺.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.焊接工艺.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
//
//
// }
//
return
effect
(
jsonObject
,
焊前效验数量
,
true
);
}
/**
* 管道耐压效验
*/
private
final
Integer
管道耐压前效验数量
=
4
;
public
String
materialEffect
(
JSONObject
jsonObject
){
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.焊前管材质量.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.焊前管材质量.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.焊前管材质量.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.焊前管材质量.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
//
return
effect
(
jsonObject
,
管道耐压前效验数量
,
true
);
}
/**
* 敷设效验
*/
private
final
Integer
敷设效验数量
=
5
;
public
String
layEffect
(
JSONObject
jsonObject
){
//
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.敷设质量.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.敷设质量.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.敷设质量.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.敷设质量.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
return
effect
(
jsonObject
,
敷设效验数量
,
false
);
}
/**
* 定位效验
*/
private
final
Integer
定位效验数量
=
6
;
public
String
positionEffect
(
JSONObject
jsonObject
){
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.定位.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
//
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.定位.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.定位.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.定位.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
return
effect
(
jsonObject
,
定位效验数量
,
true
);
}
return
效验状态
;
/**
* 测试
* @param args
*/
public
static
void
main
(
String
[]
args
)
{
MyPqr
pqr
=
new
MyPqr
(
);
pqr
.
setCombox_type
(
"高于上转变温度进行焊后热处理(如正火)"
);
pqr
.
setMaterial_a_thickness
(
"1.4"
);
//厚度
pqr
.
setMaterial_b_thickness
(
"5"
);
//厚度
pqr
.
setIf_bend
(
"lateral_bending"
);
//弯度
MyWps
wps
=
new
MyWps
(
);
wps
.
setMaterial_a_thickness
(
"1.5"
);
wps
.
setMaterial_b_thickness
(
"1.4"
);
HashMap
<
String
,
String
>
stringStringHashMap
=
new
TestWeldingRules
(
).
droolsTest
(
pqr
,
wps
);
System
.
out
.
println
(
stringStringHashMap
);
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WelderServiceImpl.java
View file @
a71a3617
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
public
class
WelderServiceImpl
{
...
...
@@ -27,6 +35,10 @@ public class WelderServiceImpl {
@Autowired
ProjectResourceServiceImpl
projectResourceService
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@BusinessIdentify
public
List
<
Map
>
getInfo
(){
...
...
@@ -66,4 +78,55 @@ public class WelderServiceImpl {
page
.
setTotal
(
getInfo
().
size
());
return
page
;
}
/**
* 存人员信息至业务表及平台表
* @param jsonObject
* @param bizOrgType
* @param sequenceNbr
* @return
*/
@BusinessIdentify
public
OrgUsrDto
savePerson
(
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
if
(
ValidationUtil
.
isEmpty
(
sequenceNbr
)){
Long
companyId
=
orgService
.
getReginParams
().
getCompany
().
getSequenceNbr
();
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
//用户基本信息
agencyUserModel
.
setRealName
(
jsonObject
.
getString
(
"name"
));
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setMobile
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setUserName
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
//用户角色信息
List
<
RoleModel
>
allRoleList
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
).
getResult
();
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
)){
roleNameSet
.
add
(
OrgEnum
.
焊工
.
getName
());
}
else
{
roleNameSet
.
add
(
OrgEnum
.
普通人员
.
getName
());
}
userRoleList
=
allRoleList
.
stream
().
filter
(
r
->
r
.
getRoleName
().
equals
(
roleNameSet
)).
collect
(
Collectors
.
toList
());
userRoleList
.
stream
().
forEach
(
r
->
{
if
(!
roleIds
.
contains
(
r
.
getSequenceNbr
()))
{
roleIds
.
add
(
r
.
getSequenceNbr
());
}
});
roleSeqsMap
.
put
(
companyId
,
roleIds
);
orgRoles
.
put
(
companyId
,
userRoleList
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
//创建用户
agencyUserModel
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
).
getResult
();
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
}
return
orgService
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/resources/application.properties
View file @
a71a3617
...
...
@@ -33,7 +33,10 @@ params.work.flow.processDefinitionKey=xiangmulixiangliucheng
params.work.flow.problemDefinitionKey
=
zhiliangwentiliucheng
amos.secret.key
=
ugp
ugp.sms.tempCode
=
SMS_UGP_0007
#logging.level.com.yeejoin.amos=error
#spring.security.user.name=admin
#
spring.security.user.password
=
a1234560
\ No newline at end of file
amos.system.user.user-name
=
ugp_cti
amos.system.user.password
=
a1234567
\ No newline at end of file
src/weldingRules.db
0 → 100644
View file @
a71a3617
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment