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
a25eb268
Commit
a25eb268
authored
Oct 13, 2022
by
sxwnfpwx@163.com
Browse files
Options
Browse Files
Download
Plain Diff
.
parents
8ed81e85
4872be8f
Hide whitespace changes
Inline
Side-by-side
Showing
77 changed files
with
4117 additions
and
467 deletions
+4117
-467
TaBusinessServiceImpl.java
.../amos/api/openapi/face/service/TaBusinessServiceImpl.java
+8
-1
OrgPersonEnum.java
...join/amos/boot/module/common/api/enums/OrgPersonEnum.java
+4
-0
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+1
-9
SpeUseUnit.java
...m/yeejoin/amos/boot/module/tzs/api/entity/SpeUseUnit.java
+5
-0
IRegUnitInfoService.java
.../boot/module/tzs/flc/api/service/IRegUnitInfoService.java
+1
-1
InspectionController.java
.../boot/module/tzs/biz/controller/InspectionController.java
+1
-1
TzsAuthController.java
...mos/boot/module/tzs/biz/controller/TzsAuthController.java
+47
-17
PrivilegeCompanyUpdateAddListener.java
...e/tzs/biz/listener/PrivilegeCompanyUpdateAddListener.java
+56
-29
TzBaseEnterpriseInfoServiceImpl.java
...tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+106
-101
TzsAuthServiceImpl.java
.../boot/module/tzs/biz/service/impl/TzsAuthServiceImpl.java
+7
-3
RegUnitInfoController.java
.../module/tzs/flc/biz/controller/RegUnitInfoController.java
+50
-19
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+28
-7
OrgEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
+39
-0
ProjectInitiationEnum.java
.../amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
+56
-0
ProjectResourceEnum.java
...in/amos/boot/module/ugp/api/Enum/ProjectResourceEnum.java
+48
-0
WeldCodeEnum.java
...m/yeejoin/amos/boot/module/ugp/api/Enum/WeldCodeEnum.java
+59
-0
WeldMethodEnum.java
...yeejoin/amos/boot/module/ugp/api/Enum/WeldMethodEnum.java
+55
-0
noticeStatusEnum.java
...ejoin/amos/boot/module/ugp/api/Enum/noticeStatusEnum.java
+15
-0
CommonResponse.java
...yeejoin/amos/boot/module/ugp/api/Util/CommonResponse.java
+133
-0
CommonResponseUtil.java
...oin/amos/boot/module/ugp/api/Util/CommonResponseUtil.java
+61
-0
Constants.java
.../com/yeejoin/amos/boot/module/ugp/api/Util/Constants.java
+64
-0
HttpUtil.java
...a/com/yeejoin/amos/boot/module/ugp/api/Util/HttpUtil.java
+578
-0
XJConstant.java
...eejoin/amos/boot/module/ugp/api/constants/XJConstant.java
+402
-0
CompanyDto.java
.../com/yeejoin/amos/boot/module/ugp/api/dto/CompanyDto.java
+3
-0
InstallNoticePageDto.java
...in/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
+62
-0
PercentOfPassDto.java
...eejoin/amos/boot/module/ugp/api/dto/PercentOfPassDto.java
+45
-0
ProjectDto.java
.../com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
+7
-0
ProjectInitiationDto.java
...in/amos/boot/module/ugp/api/dto/ProjectInitiationDto.java
+30
-0
QualityProblemDto.java
...ejoin/amos/boot/module/ugp/api/dto/QualityProblemDto.java
+37
-16
WeldDto.java
...ava/com/yeejoin/amos/boot/module/ugp/api/dto/WeldDto.java
+8
-0
WelderDto.java
...a/com/yeejoin/amos/boot/module/ugp/api/dto/WelderDto.java
+66
-0
Company.java
.../com/yeejoin/amos/boot/module/ugp/api/entity/Company.java
+12
-0
InstallNotice.java
...eejoin/amos/boot/module/ugp/api/entity/InstallNotice.java
+6
-0
Project.java
.../com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
+12
-0
ProjectInitiation.java
...in/amos/boot/module/ugp/api/entity/ProjectInitiation.java
+30
-0
QualityInfo.java
.../yeejoin/amos/boot/module/ugp/api/entity/QualityInfo.java
+5
-1
QualityProblem.java
...ejoin/amos/boot/module/ugp/api/entity/QualityProblem.java
+62
-20
CompanyMapper.java
...eejoin/amos/boot/module/ugp/api/mapper/CompanyMapper.java
+1
-2
IInstallationQualityMapper.java
...oot/module/ugp/api/mapper/IInstallationQualityMapper.java
+16
-0
InstallNoticeMapper.java
.../amos/boot/module/ugp/api/mapper/InstallNoticeMapper.java
+22
-0
ProjectInitiationMapper.java
...s/boot/module/ugp/api/mapper/ProjectInitiationMapper.java
+8
-0
QualityProblemMapper.java
...amos/boot/module/ugp/api/mapper/QualityProblemMapper.java
+1
-1
WeldMapper.java
...m/yeejoin/amos/boot/module/ugp/api/mapper/WeldMapper.java
+8
-0
ICompanyService.java
...oin/amos/boot/module/ugp/api/service/ICompanyService.java
+5
-0
IInstallNoticeService.java
...os/boot/module/ugp/api/service/IInstallNoticeService.java
+11
-0
IInstallationQualityService.java
...t/module/ugp/api/service/IInstallationQualityService.java
+14
-0
IProjectInitiationService.java
...oot/module/ugp/api/service/IProjectInitiationService.java
+20
-0
IQualityProblemService.java
...s/boot/module/ugp/api/service/IQualityProblemService.java
+1
-1
IWeldService.java
...eejoin/amos/boot/module/ugp/api/service/IWeldService.java
+5
-1
InstallNoticeMapper.xml
...ugp-api/src/main/resources/mapper/InstallNoticeMapper.xml
+48
-0
InstallationQualityMapper.xml
...i/src/main/resources/mapper/InstallationQualityMapper.xml
+62
-0
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+137
-6
EquipmentController.java
...s/boot/module/ugp/biz/controller/EquipmentController.java
+61
-44
InstallNoticeController.java
...ot/module/ugp/biz/controller/InstallNoticeController.java
+127
-59
InstallationQualityController.java
...ule/ugp/biz/controller/InstallationQualityController.java
+76
-0
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+26
-0
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+51
-1
ProjectInitiationController.java
...odule/ugp/biz/controller/ProjectInitiationController.java
+39
-0
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+14
-0
QualityProblemController.java
...t/module/ugp/biz/controller/QualityProblemController.java
+1
-1
WeldController.java
...n/amos/boot/module/ugp/biz/controller/WeldController.java
+67
-49
WelderController.java
...amos/boot/module/ugp/biz/controller/WelderController.java
+56
-0
WorkHistoryController.java
...boot/module/ugp/biz/controller/WorkHistoryController.java
+49
-14
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+25
-4
EquipmentServiceImpl.java
...oot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
+37
-4
InstallNoticeServiceImpl.java
...module/ugp/biz/service/impl/InstallNoticeServiceImpl.java
+52
-1
InstallationQualityImpl.java
.../module/ugp/biz/service/impl/InstallationQualityImpl.java
+142
-0
MaterialServiceImpl.java
...boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
+35
-7
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+234
-0
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+234
-0
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+47
-3
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+32
-7
QualityProblemServiceImpl.java
...odule/ugp/biz/service/impl/QualityProblemServiceImpl.java
+1
-1
WeldServiceImpl.java
...mos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
+115
-8
application-dev.properties
...ule-ugp-biz/src/main/resources/application-dev.properties
+17
-4
application.properties
...-module-ugp-biz/src/main/resources/application.properties
+6
-24
pom.xml
amos-boot-system-ugp/pom.xml
+5
-0
No files found.
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TaBusinessServiceImpl.java
View file @
a25eb268
...
...
@@ -68,7 +68,14 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
String
street
=
address
.
substring
(
area
.
length
()).
substring
(
0
,
address
.
substring
(
area
.
length
()).
indexOf
(
"号"
)+
1
);
String
community
=
address
.
substring
(
area
.
length
()+
street
.
length
());
String
industry
=
getIndustry
(
data
.
getString
(
"hydm"
));
String
industry
=
""
;
if
(!
ValidationUtil
.
isEmpty
(
data
.
get
(
"hydm"
))){
if
(
data
.
getString
(
"hydm"
).
length
()
>
2
){
industry
=
getIndustry
(
data
.
getString
(
"hydm"
));
}
}
//所属行业
result
.
put
(
"industry"
,
industry
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/OrgPersonEnum.java
View file @
a25eb268
...
...
@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.enums;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
OrgPersonEnum
{
...
...
@@ -15,4 +18,5 @@ public enum OrgPersonEnum {
private
String
code
;
private
String
name
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
a25eb268
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -43,15 +44,6 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/SpeUseUnit.java
View file @
a25eb268
...
...
@@ -27,6 +27,8 @@ public class SpeUseUnit implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
name
;
...
...
@@ -145,5 +147,8 @@ public class SpeUseUnit implements Serializable {
@ApiModelProperty
(
value
=
"同步id"
)
private
String
syncId
;
@ApiModelProperty
(
value
=
"同步状态"
)
private
Integer
syncState
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IRegUnitInfoService.java
View file @
a25eb268
...
...
@@ -30,7 +30,7 @@ public interface IRegUnitInfoService {
* @param unitType 单位类型
* @return RegUnitInfoDto
*/
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
);
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
,
String
companyName
);
/**
* 单位类型列表字典
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/InspectionController.java
View file @
a25eb268
...
...
@@ -135,7 +135,7 @@ public class InspectionController {
FeignClientResult
<
CompanyModel
>
company
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
selectValue
));
FeignClientResult
<
Page
<
AgencyUserModel
>>
result
=
new
FeignClientResult
<
Page
<
AgencyUserModel
>>();
if
(
company
.
getResult
()
!=
null
)
{
result
=
Privilege
.
agencyUserClient
.
queryForPageByCompany
(
company
.
getResult
().
getOrgCode
(),
"county"
,
result
=
Privilege
.
agencyUserClient
.
queryForPageByCompany
(
company
.
getResult
().
getOrgCode
(),
"
headquarter,prefecture-level,
county"
,
mobile
,
realName
,
current
,
size
);
}
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzsAuthController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -17,14 +14,16 @@ 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
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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.model.RegionModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* 特种设备权限controller
...
...
@@ -79,5 +78,36 @@ public class TzsAuthController extends BaseController {
}
/**
* 获取用户监管机构
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getUserRegulator"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取用户组织机构树"
,
notes
=
"获取用户组织机构树"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getUserRegulator
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
getme
();
if
(
result
.
getResult
()!=
null
)
{
List
<
CompanyModel
>
list
=
result
.
getResult
().
getCompanys
();
if
(
list
!=
null
&&!
list
.
isEmpty
())
{
CompanyModel
company
=
list
.
get
(
0
);
if
(
"company"
.
equals
(
company
.
getLevel
()))
{
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
company
.
getParentId
());
if
(
cResult
.
getResult
()!=
null
)
{
map
.
put
(
"regulator"
,
cResult
.
getResult
().
getCompanyName
());
}
}
else
{
map
.
put
(
"regulator"
,
company
.
getCompanyName
());
}
map
.
put
(
"company"
,
company
.
getCompanyName
());
}
map
.
put
(
"userName"
,
result
.
getResult
().
getRealName
());
}
return
ResponseHelper
.
buildResponse
(
map
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/listener/PrivilegeCompanyUpdateAddListener.java
View file @
a25eb268
...
...
@@ -70,10 +70,10 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
RequestContext
.
setToken
(
String
.
valueOf
(
redisUtil
.
get
(
"platform_token"
)));
//判断库中company是否重复
CompanyModel
companyPrivilegeModel
=
Privilege
.
companyClient
.
queryByCompany
Name
(
object
.
getString
(
"unit_nam
e"
)).
getResult
();
CompanyModel
companyPrivilegeModel
=
Privilege
.
companyClient
.
queryByCompany
Code
(
object
.
getString
(
"unit_cod
e"
)).
getResult
();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_
unit"
,
object
.
getString
(
"unit_nam
e"
));
queryWrapper
.
eq
(
"use_
code"
,
object
.
getString
(
"unit_cod
e"
));
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
tzBaseEnterpriseInfoService
.
getOne
(
queryWrapper
);
CompanyModel
companyModel
=
new
CompanyModel
();
...
...
@@ -82,9 +82,12 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
Date
syncDate
=
sdf
.
parse
(
object
.
getString
(
"sync_date"
));
Date
recDate
=
sdf
.
parse
(
object
.
getString
(
"issue_date"
));
String
unitType
=
object
.
getString
(
"cert_type"
);
tzBaseEnterpriseInfo
.
setSequenceNbr
(
object
.
getLong
(
"sequence_nbr"
));
tzBaseEnterpriseInfo
.
setAddress
(
object
.
getString
(
"reg_address"
));
tzBaseEnterpriseInfo
.
setUnitType
(
object
.
getString
(
"cert_type"
)
);
tzBaseEnterpriseInfo
.
setUnitType
(
unitType
);
tzBaseEnterpriseInfo
.
setUseCode
(
object
.
getString
(
"unit_code"
));
tzBaseEnterpriseInfo
.
setUseUnit
(
object
.
getString
(
"unit_name"
));
tzBaseEnterpriseInfo
.
setProvince
(
object
.
getString
(
"province"
));
...
...
@@ -99,20 +102,26 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
companyModel
.
setCompanyCode
(
object
.
getString
(
"unit_code"
));
companyModel
.
setLevel
(
"company"
);
companyModel
.
setAgencyCode
(
"tzs"
);
companyModel
.
setCompanyType
(
object
.
getString
(
"cert_type"
)
);
companyModel
.
setCompanyType
(
unitType
);
companyModel
.
setAddress
(
object
.
getString
(
"reg_address"
));
//业务表更新条件构造器
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"Use_
unit"
,
object
.
getString
(
"unit_nam
e"
));
updateWrapper
.
eq
(
"Use_
code"
,
object
.
getString
(
"unit_cod
e"
));
String
regCode
=
object
.
getString
(
"reg_code"
)
+
"000"
;
String
regCode
=
object
.
getString
(
"reg_code"
);
CompanyModel
privilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
regCode
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
privilegeCompanyModel
)){
privilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000000"
).
getResult
();
privilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
"610000"
).
getResult
();
}
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterpriseInfo
.
setUnitType
(
""
);
}
if
(
ValidationUtil
.
isEmpty
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
""
);
}
try
{
...
...
@@ -131,49 +140,67 @@ public class PrivilegeCompanyUpdateAddListener extends EmqxListener {
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
}
else
if
(
tzBaseEnterprisePrivilegeInfo
==
null
){
//企业表没有,平台表有
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
}
else
{
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
());
if
(!
ValidationUtil
.
isEmpty
(
companyPrivilegeModel
.
getCompanyType
())){
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
}
else
{
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
());
}
}
tzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
Privilege
.
companyClient
.
update
(
companyModel
,
companyPrivilegeModel
.
getSequenceNbr
());
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
}
else
if
(
companyPrivilegeModel
==
null
){
//平台表没有,企业表有
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
}
else
{
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
());
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
())){
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
}
else
{
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
());
}
}
Privilege
.
companyClient
.
create
(
companyModel
);
tzBaseEnterpriseInfoService
.
update
(
tzBaseEnterpriseInfo
,
updateWrapper
);
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
}
else
{
//当企业表、平台表 中有时
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
.
getRecDate
())){
//如果库中没有存时间,则默认为1990-01-01
SimpleDateFormat
sdft
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
tzBaseEnterprisePrivilegeInfo
.
setRecDate
(
sdft
.
parse
(
"1990-01-01"
));
}
if
(
tzBaseEnterprisePrivilegeInfo
.
getRecDate
().
compareTo
(
object
.
getDate
(
"issue_date"
))
<
1
)
{
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
}
else
{
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
());
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
())){
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
}
else
{
tzBaseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
());
}
}
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
}
else
{
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
());
if
(!
ValidationUtil
.
isEmpty
(
companyPrivilegeModel
.
getCompanyType
())){
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
}
else
{
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
());
}
}
tzBaseEnterpriseInfoService
.
update
(
tzBaseEnterpriseInfo
,
updateWrapper
);
Privilege
.
companyClient
.
update
(
companyModel
,
companyPrivilegeModel
.
getSequenceNbr
());
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
}
else
{
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterprisePrivilegeInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
tzBaseEnterpriseInfoService
.
update
(
tzBaseEnterprisePrivilegeInfo
,
updateWrapper
);
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
())){
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
tzBaseEnterpriseInfo
.
getUnitType
())){
tzBaseEnterprisePrivilegeInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
tzBaseEnterpriseInfo
.
getUnitType
());
tzBaseEnterpriseInfoService
.
update
(
tzBaseEnterprisePrivilegeInfo
,
updateWrapper
);
}
}
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyPrivilegeModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyPrivilegeModel
,
companyPrivilegeModel
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
companyPrivilegeModel
.
getCompanyType
())){
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyPrivilegeModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyPrivilegeModel
,
companyPrivilegeModel
.
getSequenceNbr
());
}
}
System
.
out
.
println
(
"该数据不是最新的数据 不用更新"
);
accessFeignService
.
updateSyncCompanyState
(
object
.
getString
(
"sequence_nbr"
));
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
a25eb268
...
...
@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.feign.AccessFeignService;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.RegUnitIcServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
java.util.*
;
...
...
@@ -72,7 +73,7 @@ public class TzBaseEnterpriseInfoServiceImpl
private
IBaseUnitLicenceService
iBaseUnitLicenceService
;
@Autowired
private
ISpeUseUnitService
speUseUnitService
;
private
SpeUseUnitServiceImpl
speUseUnitService
;
@Autowired
private
AccessFeignService
accessFeignService
;
...
...
@@ -185,117 +186,121 @@ public class TzBaseEnterpriseInfoServiceImpl
List
<
SpeUseUnit
>
speUseUnitList
=
speUseUnitService
.
page
(
page
).
getRecords
();
for
(
SpeUseUnit
speUseUnit
:
speUseUnitList
)
{
CompanyModel
companyPrivilegeModel
=
Privilege
.
companyClient
.
queryByCompanyName
(
speUseUnit
.
getName
()).
getResult
();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_unit"
,
speUseUnit
.
getName
());
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
this
.
getOne
(
queryWrapper
);
Map
<
String
,
Object
>
resultMap
=
accessFeignService
.
getData
(
speUseUnit
.
getCerCode
()).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
resultMap
)){
if
(!
ValidationUtil
.
isEmpty
(
companyPrivilegeModel
)){
Privilege
.
companyClient
.
deleteCompany
(
String
.
valueOf
(
companyPrivilegeModel
.
getSequenceNbr
()));
}
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
this
.
deleteBySeq
(
tzBaseEnterprisePrivilegeInfo
.
getSequenceNbr
());
}
}
else
{
CompanyModel
privilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyName
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
))).
getResult
();
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
speUseUnit
.
getName
());
companyModel
.
setCompanyCode
(
speUseUnit
.
getCerCode
());
companyModel
.
setLevel
(
"company"
);
companyModel
.
setAgencyCode
(
"tzs"
);
companyModel
.
setCompanyType
(
"使用单位"
);
companyModel
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
companyModel
.
setParentId
(
privilegeCompanyModel
.
getSequenceNbr
());
String
area
=
String
.
valueOf
(
resultMap
.
get
(
"area"
));
String
province
=
""
;
if
(
area
.
contains
(
"省"
)){
province
=
area
.
substring
(
0
,
area
.
indexOf
(
"省"
)+
1
);
}
String
city
=
""
;
if
(
area
.
contains
(
"市"
)){
city
=
area
.
substring
(
province
.
length
(),
area
.
indexOf
(
"市"
)+
1
);
}
String
district
=
area
.
substring
(
city
.
length
()+
province
.
length
());
TzBaseEnterpriseInfo
baseEnterpriseInfo
=
new
TzBaseEnterpriseInfo
();
baseEnterpriseInfo
.
setUseUnit
(
speUseUnit
.
getName
());
baseEnterpriseInfo
.
setUseCode
(
speUseUnit
.
getCerCode
());
baseEnterpriseInfo
.
setUnitType
(
"使用单位"
);
baseEnterpriseInfo
.
setRegistrationAuthority
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
baseEnterpriseInfo
.
setProvince
(
province
);
baseEnterpriseInfo
.
setCity
(
city
);
baseEnterpriseInfo
.
setDistrict
(
district
);
baseEnterpriseInfo
.
setStreet
(
String
.
valueOf
(
resultMap
.
get
(
"district"
)));
baseEnterpriseInfo
.
setCommunity
(
String
.
valueOf
(
resultMap
.
get
(
"community"
)));
baseEnterpriseInfo
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
baseEnterpriseInfo
.
setLegalPerson
(
String
.
valueOf
(
resultMap
.
get
(
"legalPeople"
)));
baseEnterpriseInfo
.
setIndustry
(
String
.
valueOf
(
resultMap
.
get
(
"industry"
)));
baseEnterpriseInfo
.
setSuperviseOrgName
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
baseEnterpriseInfo
.
setSuperviseOrgCode
(
privilegeCompanyModel
.
getOrgCode
());
baseEnterpriseInfo
.
setOperatingStatus
(
String
.
valueOf
(
resultMap
.
get
(
"operating_status"
)));
baseEnterpriseInfo
.
setUnitType
(
"使用单位"
);
baseEnterpriseInfoList
.
add
(
baseEnterpriseInfo
);
//保存平台和业务的企业信息
try
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
&&
companyPrivilegeModel
==
null
)
{
//当企业表、平台表 中没有时
this
.
save
(
baseEnterpriseInfo
);
Privilege
.
companyClient
.
create
(
companyModel
);
}
else
if
(
tzBaseEnterprisePrivilegeInfo
==
null
){
//企业表没有,平台表有
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyModel
,
companyPrivilegeModel
.
getSequenceNbr
());
if
(
speUseUnit
.
getSyncState
()
!=
3
){
CompanyModel
companyPrivilegeModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
speUseUnit
.
getCerCode
()).
getResult
();
QueryWrapper
<
TzBaseEnterpriseInfo
>
queryWrapper
=
new
QueryWrapper
<
TzBaseEnterpriseInfo
>();
queryWrapper
.
eq
(
"use_code"
,
speUseUnit
.
getCerCode
());
TzBaseEnterpriseInfo
tzBaseEnterprisePrivilegeInfo
=
this
.
getOne
(
queryWrapper
);
Map
<
String
,
Object
>
resultMap
=
accessFeignService
.
getData
(
speUseUnit
.
getCerCode
()).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
resultMap
)){
if
(!
ValidationUtil
.
isEmpty
(
companyPrivilegeModel
)){
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyPrivilegeModel
.
getSequenceNbr
(),
null
,
null
,
null
).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
agencyUserModelList
)){
//spe表中的数据在工商查不到,且平台无用户,将删除企业数据
Privilege
.
companyClient
.
deleteCompany
(
String
.
valueOf
(
companyPrivilegeModel
.
getSequenceNbr
()));
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterprisePrivilegeInfo
))
{
this
.
deleteBySeq
(
tzBaseEnterprisePrivilegeInfo
.
getSequenceNbr
());
}
}
this
.
save
(
baseEnterpriseInfo
);
}
else
if
(
companyPrivilegeModel
==
null
){
//平台表没有,企业表有
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
baseEnterpriseInfo
.
getUnitType
())){
baseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
baseEnterpriseInfo
.
getUnitType
());
this
.
updateById
(
baseEnterpriseInfo
);
}
Privilege
.
companyClient
.
create
(
companyModel
);
}
else
{
//企业表有 平台表有
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
())){
companyModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyModel
,
companyPrivilegeModel
.
getSequenceNbr
());
}
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
baseEnterpriseInfo
.
getUnitType
())){
baseEnterpriseInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()+
","
+
baseEnterpriseInfo
.
getUnitType
());
this
.
updateById
(
baseEnterpriseInfo
);
//spe表中的数据在工商查不到,设置spe表状态为1
speUseUnit
.
setSyncState
(
1
);
speUseUnitService
.
updateById
(
speUseUnit
);
}
else
{
CompanyModel
privilegeCompanyModel
=
Privilege
.
companyClient
.
queryByCompanyName
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
))).
getResult
();
CompanyModel
companyModel
=
new
CompanyModel
();
companyModel
.
setCompanyName
(
speUseUnit
.
getName
());
companyModel
.
setCompanyCode
(
speUseUnit
.
getCerCode
());
companyModel
.
setLevel
(
"company"
);
companyModel
.
setAgencyCode
(
"tzs"
);
companyModel
.
setCompanyType
(
"使用单位"
);
companyModel
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
companyModel
.
setParentId
(
privilegeCompanyModel
.
getSequenceNbr
());
String
area
=
String
.
valueOf
(
resultMap
.
get
(
"area"
));
String
province
=
""
;
if
(
area
.
contains
(
"省"
))
{
province
=
area
.
substring
(
0
,
area
.
indexOf
(
"省"
)
+
1
);
}
String
city
=
""
;
if
(
area
.
contains
(
"市"
))
{
city
=
area
.
substring
(
province
.
length
(),
area
.
indexOf
(
"市"
)
+
1
);
}
String
district
=
area
.
substring
(
city
.
length
()
+
province
.
length
());
TzBaseEnterpriseInfo
baseEnterpriseInfo
=
new
TzBaseEnterpriseInfo
();
baseEnterpriseInfo
.
setUseUnit
(
speUseUnit
.
getName
());
baseEnterpriseInfo
.
setUseCode
(
speUseUnit
.
getCerCode
());
baseEnterpriseInfo
.
setUnitType
(
"使用单位"
);
baseEnterpriseInfo
.
setRegistrationAuthority
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
baseEnterpriseInfo
.
setProvince
(
province
);
baseEnterpriseInfo
.
setCity
(
city
);
baseEnterpriseInfo
.
setDistrict
(
district
);
baseEnterpriseInfo
.
setStreet
(
String
.
valueOf
(
resultMap
.
get
(
"street"
)));
baseEnterpriseInfo
.
setCommunity
(
String
.
valueOf
(
resultMap
.
get
(
"community"
)));
baseEnterpriseInfo
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
baseEnterpriseInfo
.
setLegalPerson
(
String
.
valueOf
(
resultMap
.
get
(
"legalPeople"
)));
baseEnterpriseInfo
.
setIndustry
(
String
.
valueOf
(
resultMap
.
get
(
"industry"
)));
baseEnterpriseInfo
.
setSuperviseOrgName
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
baseEnterpriseInfo
.
setSuperviseOrgCode
(
privilegeCompanyModel
.
getOrgCode
());
baseEnterpriseInfo
.
setOperatingStatus
(
String
.
valueOf
(
resultMap
.
get
(
"operating_status"
)));
baseEnterpriseInfo
.
setUnitType
(
"使用单位"
);
baseEnterpriseInfoList
.
add
(
baseEnterpriseInfo
);
//保存平台和业务的企业信息
try
{
if
(
tzBaseEnterprisePrivilegeInfo
==
null
&&
companyPrivilegeModel
==
null
)
{
//当企业表、平台表 中没有时
this
.
save
(
baseEnterpriseInfo
);
Privilege
.
companyClient
.
create
(
companyModel
);
}
else
if
(
tzBaseEnterprisePrivilegeInfo
==
null
)
{
//企业表没有,平台表有
this
.
save
(
baseEnterpriseInfo
);
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
()))
{
companyPrivilegeModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()
+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyPrivilegeModel
,
companyPrivilegeModel
.
getSequenceNbr
());
}
}
else
if
(
companyPrivilegeModel
==
null
)
{
//平台表没有,企业表有
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
baseEnterpriseInfo
.
getUnitType
()))
{
tzBaseEnterprisePrivilegeInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()
+
","
+
baseEnterpriseInfo
.
getUnitType
());
this
.
updateById
(
tzBaseEnterprisePrivilegeInfo
);
}
Privilege
.
companyClient
.
create
(
companyModel
);
}
else
{
//企业表有 平台表有
if
(!
companyPrivilegeModel
.
getCompanyType
().
contains
(
companyModel
.
getCompanyType
()))
{
companyPrivilegeModel
.
setCompanyType
(
companyPrivilegeModel
.
getCompanyType
()
+
","
+
companyModel
.
getCompanyType
());
Privilege
.
companyClient
.
update
(
companyPrivilegeModel
,
companyPrivilegeModel
.
getSequenceNbr
());
}
if
(!
tzBaseEnterprisePrivilegeInfo
.
getUnitType
().
contains
(
baseEnterpriseInfo
.
getUnitType
()))
{
tzBaseEnterprisePrivilegeInfo
.
setUnitType
(
tzBaseEnterprisePrivilegeInfo
.
getUnitType
()
+
","
+
baseEnterpriseInfo
.
getUnitType
());
this
.
updateById
(
tzBaseEnterprisePrivilegeInfo
);
}
}
setSpeUseUnitState
(
3
,
speUseUnit
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
//当报错时 设置状态为 2
speUseUnit
.
setSyncState
(
2
);
speUseUnitService
.
updateById
(
speUseUnit
);
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
}
// if(ValidationUtil.isEmpty(companyMap.get(speUseUnit.getAuditOrgName()))){
// continue;
// }
}
}
return
"ok"
;
}
public
void
setSpeUseUnitState
(
int
state
,
SpeUseUnit
speUseUnit
){
speUseUnit
.
setSyncState
(
state
);
speUseUnitService
.
updateById
(
speUseUnit
);
}
public
Map
<
String
,
CompanyModel
>
getCompanyInfoMap
(
Collection
companyModels
,
Map
<
String
,
CompanyModel
>
map
){
if
(
companyModels
==
null
){
return
map
;
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsAuthServiceImpl.java
View file @
a25eb268
...
...
@@ -54,6 +54,9 @@ public class TzsAuthServiceImpl implements TzsAuthService {
*/
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
@Autowired
private
StartPlatformTokenService
startPlatformTokenService
;
@Override
...
...
@@ -75,7 +78,8 @@ public class TzsAuthServiceImpl implements TzsAuthService {
@Override
public
List
<
RegionModel
>
getUserReginTree
()
{
List
<
String
>
regionList
=
this
.
getUserRegionCode
();
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
//AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
startPlatformTokenService
.
getToken
();
List
<
RegionModel
>
tree
=
(
List
<
RegionModel
>)
Systemctl
.
regionClient
.
queryForTree
(
null
).
getResult
();
// 循环list 将List 封装为 省市区 SET
Set
<
String
>
city
=
new
HashSet
<>();
...
...
@@ -128,8 +132,8 @@ public class TzsAuthServiceImpl implements TzsAuthService {
for
(
Map
.
Entry
<
String
,
RegionModel
>
entries
:
tempCityMap
.
entrySet
())
{
newCity
.
add
(
entries
.
getValue
());
}
start
.
setChildren
(
newCity
);
newTree
.
add
(
start
);
//
start.setChildren(newCity);
newTree
.
add
All
(
newCity
);
return
newTree
;
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitInfoController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
controller
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Random
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
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
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
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
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Random
;
/**
* 单位注册信息表
...
...
@@ -54,19 +72,32 @@ public class RegUnitInfoController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位注册"
,
notes
=
"单位注册"
)
public
ResponseModel
<
RegUnitInfoDto
>
save
(
@RequestBody
RegUnitInfoDto
model
)
{
model
=
iRegUnitInfoService
.
registerUnit
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
try
{
model
=
iRegUnitInfoService
.
registerUnit
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
catch
(
Exception
e
)
{
ResponseModel
<
RegUnitInfoDto
>
response
=
new
ResponseModel
<>();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
response
.
setResult
(
null
);
response
.
setDevMessage
(
e
.
getMessage
());
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
response
.
setTraceId
(
RequestContext
.
getTraceId
());
response
.
setPath
(
request
.
getServletPath
());
return
response
;
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{unitCode}/check"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位注册校验"
,
notes
=
"单位注册校验"
)
public
ResponseModel
<
RegUnitInfoDto
>
unitCheck
(
@PathVariable
String
unitCode
,
@RequestParam
String
unitType
)
{
@RequestParam
String
unitType
,
@RequestParam
String
companyName
)
{
if
(
ValidationUtil
.
isEmpty
(
unitCode
))
{
throw
new
BadRequest
(
"单位编码不能为空"
);
}
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
);
}
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
,
companyName
);
return
ResponseHelper
.
buildResponse
(
regUnitInfoDto
);
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
a25eb268
...
...
@@ -40,6 +40,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto;
import
com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto
;
...
...
@@ -87,7 +88,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired
AccessFeignService
accessFeignService
;
@Autowired
StartPlatformTokenService
startPlatformTokenService
;
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/
...
...
@@ -218,13 +221,31 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
@Override
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
)
{
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
,
String
companyName
)
{
if
(!
ValidationUtil
.
isEmpty
(
companyName
))
{
startPlatformTokenService
.
getToken
();
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyName
(
companyName
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
BadRequest
(
"重复的公司名称"
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
unitCode
))
{
startPlatformTokenService
.
getToken
();
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
RuntimeException
(
"重复的公司编码"
);
}
}
// 1.校验重复性
RegUnitInfo
regUnitInfo
=
this
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
if
(
regUnitInfo
!=
null
)
{
throw
new
RuntimeException
(
"该单位已注册,请联系企业管理员!"
);
}
//
RegUnitInfo regUnitInfo = this
//
.getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
//
if (regUnitInfo != null) {
//
throw new RuntimeException("该单位已注册,请联系企业管理员!");
//
}
// 2.组织返回数据
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
if
(
USE_UNIT_TYPE_CODE
.
equals
(
unitType
)
||
PRODUCT_UNIT_TYPE_CODE
.
equals
(
unitType
)
||
FILLING_UNIT_TYPE_CODE
.
equals
(
unitType
))
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
@Getter
@AllArgsConstructor
public
enum
OrgEnum
{
公司
(
"COMPANY"
,
"244"
,
"公司"
,
1
),
部门
(
"DEPARTMENT"
,
"245"
,
"部门"
,
2
),
人员
(
"PERSON"
,
"246"
,
"人员"
,
3
),
焊工
(
"WELDER"
,
"247"
,
"焊工"
,
3
),
建设单位负责人
(
"CHARGE"
,
"254"
,
"建设单位负责人"
,
3
),
企业管理员
(
"ADMIN"
,
"248"
,
"企业管理员"
,
3
),
建设单位
(
"CONSTRUCTION"
,
"249"
,
"建设单位"
,
1
),
安装单位
(
"INSTALL"
,
"250"
,
"安装单位"
,
1
),
设计单位
(
"DESIGN"
,
"251"
,
"设计单位"
,
1
),
监察单位
(
"SUPERVISION"
,
"252"
,
"监察单位"
,
1
),
监检机构
(
"MONITORING"
,
"253"
,
"监检机构"
,
1
);
private
String
key
;
private
String
code
;
private
String
name
;
/**
* 1 公司 2 部门 3 人员
*/
private
Integer
type
;
public
static
HashMap
<
String
,
String
>
map
=
new
HashMap
();
static
{
for
(
OrgPersonEnum
orgPersonEnum:
OrgPersonEnum
.
values
()){
map
.
put
(
orgPersonEnum
.
getName
(),
orgPersonEnum
.
getKey
());
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
java.util.HashMap
;
import
java.util.Map
;
public
enum
ProjectInitiationEnum
{
项目立项
(
"1"
,
"项目立项"
),
平台审核
(
"2"
,
"平台审核"
),
告知申请
(
"3"
,
"告知申请"
),
接受告知
(
"4"
,
"接受告知"
),
审查项目
(
"5"
,
"审查项目"
),
提交资料
(
"6"
,
"提交资料"
),
审批人审批
(
"7"
,
"审批人审批"
),
审核人审核
(
"8"
,
"审核人审核"
),
监检科室分配
(
"9"
,
"监检科室分配"
),
监检员分配
(
"10"
,
"监检员分配"
),
监检员审核
(
"11"
,
"监检员审核"
),
项目关闭
(
"12"
,
"项目关闭"
),
接受审查意见
(
"13"
,
"接受审查意见"
);
private
String
status
;
private
String
name
;
public
static
Map
<
String
,
String
>
getNameByStatusMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getStatusByNameMap
=
new
HashMap
<
String
,
String
>();
static
{
for
(
ProjectInitiationEnum
projectInitiationEnum:
ProjectInitiationEnum
.
values
()){
getNameByStatusMap
.
put
(
projectInitiationEnum
.
status
,
projectInitiationEnum
.
name
);
getStatusByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
status
);
}
}
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/ProjectResourceEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
java.util.HashMap
;
import
java.util.Map
;
public
enum
ProjectResourceEnum
{
焊工资源
(
"焊工"
,
"welder"
),
设备资源
(
"设备"
,
"equipment"
),
管材资源
(
"管材"
,
"material"
);
private
String
status
;
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
ProjectResourceEnum
(
String
status
,
String
state
)
{
this
.
status
=
status
;
this
.
state
=
state
;
}
private
String
state
;
public
static
final
Map
<
String
,
String
>
map
=
new
HashMap
<>();
static
{
for
(
ProjectResourceEnum
projectResourceEnum:
ProjectResourceEnum
.
values
()){
map
.
put
(
projectResourceEnum
.
status
,
projectResourceEnum
.
state
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/WeldCodeEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
java.security.PublicKey
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 焊口编码赋码状态
*/
public
enum
WeldCodeEnum
{
赋值状态
1
(
"未赋值"
,
"0"
,
"codingStatus"
),
赋值状态
2
(
"已赋值"
,
"1"
,
"codingStatus"
);
private
String
status
;
private
String
state
;
private
String
IState
;
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
String
getIState
()
{
return
IState
;
}
public
void
setIState
(
String
IState
)
{
this
.
IState
=
IState
;
}
WeldCodeEnum
(
String
status
,
String
state
,
String
IState
)
{
this
.
status
=
status
;
this
.
state
=
state
;
this
.
IState
=
IState
;
}
public
static
final
Map
<
String
,
String
>
map
=
new
HashMap
<>();
static
{
for
(
WeldCodeEnum
weldCodeEnum:
WeldCodeEnum
.
values
()){
map
.
put
(
weldCodeEnum
.
getState
(),
weldCodeEnum
.
getStatus
());
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/WeldMethodEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 焊口编码赋码方式
*/
public
enum
WeldMethodEnum
{
赋码方式
1
(
"自动赋码"
,
"0"
,
"codingMethod"
),
赋码方式
2
(
"手动赋码"
,
"1"
,
"codingMethod"
);
private
String
status
;
private
String
state
;
private
String
IState
;
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
String
getIState
()
{
return
IState
;
}
public
void
setIState
(
String
IState
)
{
this
.
IState
=
IState
;
}
WeldMethodEnum
(
String
status
,
String
state
,
String
IState
)
{
this
.
status
=
status
;
this
.
state
=
state
;
this
.
IState
=
IState
;
}
public
static
final
Map
<
String
,
String
>
map
=
new
HashMap
<>();
static
{
for
(
WeldMethodEnum
weldMethodEnum
:
WeldMethodEnum
.
values
())
{
map
.
put
(
weldMethodEnum
.
getState
(),
weldMethodEnum
.
getStatus
());
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/noticeStatusEnum.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
public
enum
noticeStatusEnum
{
已提交
(
"已提交"
,
"0"
),
已接收
(
"已接收"
,
"1"
),
已退回
(
"已退回"
,
"2"
);
String
name
;
String
statusId
;
noticeStatusEnum
(
String
name
,
String
statusId
)
{
this
.
name
=
name
;
this
.
statusId
=
statusId
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Util/CommonResponse.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* <pre>
* 返回封装对象
* </pre>
*
* @author mincx
* @version CommonReponse.java v0.1
* @time 2017-9-19 15:43:32
*/
public
class
CommonResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8737351878134480646L
;
/**
* 操作状态
*/
@ApiModelProperty
(
required
=
true
,
value
=
"操作状态"
)
private
String
result
;
/**
* 操作状态
*/
@ApiModelProperty
(
required
=
true
,
value
=
"状态码"
)
private
int
status
;
/**
* 数据
*/
@ApiModelProperty
(
required
=
false
,
value
=
"数据"
)
private
Object
dataList
;
/**
* 操作详细信息
*/
@ApiModelProperty
(
required
=
false
,
value
=
"操作详细信息"
)
private
String
message
;
public
CommonResponse
(){
}
public
CommonResponse
(
String
result
)
{
this
.
result
=
result
;
}
public
CommonResponse
(
Object
dataList
)
{
this
.
dataList
=
dataList
;
this
.
result
=
""
;
}
public
CommonResponse
(
String
result
,
Object
dataList
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
}
public
CommonResponse
(
String
result
,
String
message
)
{
this
.
result
=
result
;
this
.
message
=
message
;
}
public
CommonResponse
(
String
result
,
Object
dataList
,
String
message
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
this
.
message
=
message
;
}
public
CommonResponse
(
String
result
,
Object
dataList
,
int
status
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
this
.
status
=
status
;
}
public
CommonResponse
(
String
result
,
String
message
,
int
status
)
{
this
.
result
=
result
;
this
.
message
=
message
;
this
.
status
=
status
;
}
public
CommonResponse
(
String
result
,
Object
dataList
,
String
message
,
int
status
)
{
this
.
dataList
=
dataList
;
this
.
result
=
result
;
this
.
message
=
message
;
this
.
status
=
status
;
}
public
Boolean
isSuccess
(){
return
"SUCCESS"
.
equals
(
getResult
());
}
public
String
getResult
()
{
return
result
;
}
public
void
setResult
(
String
result
)
{
this
.
result
=
result
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Object
getDataList
()
{
return
dataList
;
}
public
void
setDataList
(
Object
dataList
)
{
this
.
dataList
=
dataList
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
int
getStatus
()
{
return
status
;
}
public
String
toJsonStr
()
throws
Exception
{
return
JSON
.
toJSONString
(
this
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
SkipTransientField
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Util/CommonResponseUtil.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Util
;
import
org.springframework.http.HttpStatus
;
public
class
CommonResponseUtil
{
public
static
CommonResponse
success
()
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
response
;
}
public
static
CommonResponse
success
(
Object
obj
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
response
.
setDataList
(
obj
);
return
response
;
}
public
static
CommonResponse
success
(
Object
obj
,
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_SUCCESS
);
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
response
.
setDataList
(
obj
);
response
.
setMessage
(
message
);
return
response
;
}
public
static
CommonResponse
failure
()
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
response
;
}
public
static
CommonResponse
failure
(
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
response
.
setMessage
(
message
);
return
response
;
}
public
static
CommonResponse
failure
(
Object
obj
,
String
message
)
{
CommonResponse
response
=
new
CommonResponse
();
response
.
setResult
(
Constants
.
RESULT_FAILURE
);
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
response
.
setDataList
(
obj
);
response
.
setMessage
(
message
);
return
response
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Util/Constants.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Util
;
/**
* <pre>
* 系统常量
* </pre>
*
* @author mincx
* @version Constants.java v0.1
* @time 2017-9-19 15:43:32
*/
public
class
Constants
{
public
static
final
String
ERROR_MESSAGE
=
"系统异常"
;
public
static
final
String
RESULT_SUCCESS
=
"SUCCESS"
;
public
static
final
String
RESULT_FAILURE
=
"FAILURE"
;
public
static
final
String
RULE_FACT_PREFIX
=
"rule_"
;
public
static
final
String
RULE_COMPILATION_ERROR
=
"规则编译异常"
;
public
static
final
String
NEW_LINE
=
"\r\n"
;
public
static
final
String
POSITION_LATITUDE
=
"latitude"
;
public
static
final
String
POSITION_LONGITUDE
=
"longitude"
;
public
static
final
double
PI
=
3.1415
;
public
static
final
double
EARTH_RADIUS
=
6370.996
;
public
static
final
String
RULE_CONDITION_AND
=
"&&"
;
public
static
final
String
RULE_CONDITION_OR
=
"||"
;
/**
* DES加密解密默认key
*/
public
static
final
String
XSS_KEY
=
"qaz"
;
/**
* 灾情状态
*/
public
static
final
String
FireHappenStateID
=
"90db70b7-49a4-4a72-b54b-0fabbed9bec7"
;
//发生
public
static
final
String
FireDevelopStateID
=
"1f7fe7d7-b30c-4518-8c95-6e3bc506ca86"
;
//猛烈
/**
* 车辆状态
*/
public
static
final
String
CarArrivedStateID
=
"ad55748a-1206-4507-8831-95b7f2ad804f"
;
//到达
public
static
final
String
CarDispatchingStateID
=
"43a23576-3d0f-4c3d-a46b-555391a4d870"
;
//待出动
public
static
final
String
CarOnDutyStateID
=
"21cc717f-60b4-46ae-942e-9efd63d13415"
;
//执勤
public
static
final
String
CarOnSiteStateID
=
"d7eddc16-4c55-4de0-b726-3547c7b0b980"
;
//在位
public
static
final
String
CarOnTheWayStateID
=
"5e1b6e98-d1dc-4c49-a7ad-b959d2278dba"
;
//在途
public
static
final
String
CarRepairStateID
=
"e86d455b-e9fd-4938-9826-38ca46623287"
;
//维修
/**
* 战斗力量编队状态
*/
public
static
final
String
RescuePowerArrivedStateID
=
"0951f770-7f75-43d8-bcec-47d7559be727"
;
//到达
public
static
final
String
RescuePowerDispatchedStateID
=
"ec4afc56-6cec-41a3-95f5-20c735f052d4"
;
//已调派
public
static
final
String
RescuePowerEnhanceStateID
=
"3d6cf113-b69d-47c3-a3a8-ded448cc4636"
;
//增援
public
static
final
String
RescuePowerFightingStateID
=
"4bacd4b4-b07d-454e-b737-431e7c997cde"
;
//战斗
public
static
final
String
RescuePowerStandByStateID
=
"4fc6e4d6-c6a8-453c-b554-ce7de0b828b2"
;
//待命
/**
* sql注入关键字
*/
public
static
String
badStr
=
"'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|"
+
"char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|"
+
"table|from|grant|use|group_concat|column_name|"
+
"information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|"
+
"chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#"
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Util/HttpUtil.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Util
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.methods.*
;
import
org.apache.http.config.Registry
;
import
org.apache.http.config.RegistryBuilder
;
import
org.apache.http.conn.socket.ConnectionSocketFactory
;
import
org.apache.http.conn.socket.PlainConnectionSocketFactory
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.conn.ssl.TrustSelfSignedStrategy
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.DefaultHttpRequestRetryHandler
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.apache.http.ssl.SSLContextBuilder
;
import
org.apache.http.util.EntityUtils
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.Iterator
;
import
java.util.Map
;
public
class
HttpUtil
{
// utf-8字符编码
private
static
final
String
CHARSET_UTF_8
=
"utf-8"
;
// HTTP内容类型。
private
static
final
String
CONTENT_TYPE_TEXT_HTML
=
"text/xml"
;
// HTTP内容类型。相当于form表单的形式,提交数据
private
static
final
String
CONTENT_TYPE_FORM_URL
=
"application/x-www-form-urlencoded"
;
// HTTP内容类型。相当于form表单的形式,提交数据
private
static
final
String
CONTENT_TYPE_JSON_URL
=
"application/json;charset=utf-8"
;
// 连接管理器
private
static
PoolingHttpClientConnectionManager
pool
;
// 请求配置
private
static
RequestConfig
requestConfig
;
static
{
try
{
//System.out.println("初始化HttpClientTest~~~开始");
SSLContextBuilder
builder
=
new
SSLContextBuilder
();
builder
.
loadTrustMaterial
(
null
,
new
TrustSelfSignedStrategy
());
SSLConnectionSocketFactory
sslsf
=
new
SSLConnectionSocketFactory
(
builder
.
build
());
// 配置同时支持 HTTP 和 HTPPS
Registry
<
ConnectionSocketFactory
>
socketFactoryRegistry
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
().
register
(
"http"
,
PlainConnectionSocketFactory
.
getSocketFactory
()).
register
(
"https"
,
sslsf
).
build
();
// 初始化连接管理器
pool
=
new
PoolingHttpClientConnectionManager
(
socketFactoryRegistry
);
// 将最大连接数增加到200,实际项目最好从配置文件中读取这个值
pool
.
setMaxTotal
(
200
);
// 设置最大路由
pool
.
setDefaultMaxPerRoute
(
2
);
// 根据默认超时限制初始化requestConfig
int
socketTimeout
=
10000
;
int
connectTimeout
=
10000
;
int
connectionRequestTimeout
=
10000
;
requestConfig
=
RequestConfig
.
custom
().
setConnectionRequestTimeout
(
connectionRequestTimeout
).
setSocketTimeout
(
socketTimeout
).
setConnectTimeout
(
connectTimeout
).
build
();
//System.out.println("初始化HttpClientTest~~~结束");
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// 设置请求超时时间
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
50000
).
setConnectTimeout
(
50000
)
.
setConnectionRequestTimeout
(
50000
).
build
();
}
private
static
CloseableHttpClient
getHttpClient
()
{
return
HttpClients
.
custom
()
// 设置连接池管理
.
setConnectionManager
(
pool
)
// 设置请求配置
.
setDefaultRequestConfig
(
requestConfig
)
// 设置重试次数
.
setRetryHandler
(
new
DefaultHttpRequestRetryHandler
(
0
,
false
))
.
build
();
}
/**
* 发送Post请求
*/
private
static
String
sendHttpPost
(
HttpPost
httpPost
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpPost
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpPost
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Post请求
*
* @param httpPut
* @return
*/
private
static
String
sendHttpPut
(
HttpPut
httpPut
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpPut
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpPut
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Post请求
*
* @param httpDelete
* @return
*/
private
static
String
sendHttpDelete
(
HttpDelete
httpDelete
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpDelete
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpDelete
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Get请求
*
* @param httpGet
* @return
*/
private
static
String
sendHttpGet
(
HttpGet
httpGet
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpGet
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpGet
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpPost
(
String
httpUrl
)
{
// 创建httpPost
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 delete请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpDelete
(
String
httpUrl
)
{
// 创建httpPost
HttpDelete
httpDelete
=
new
HttpDelete
(
httpUrl
);
return
sendHttpDelete
(
httpDelete
);
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpPostWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建httpPost
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 get请求
*
* @param httpUrl
*/
public
static
String
sendHttpGet
(
String
httpUrl
)
{
// 创建get请求
HttpGet
httpGet
=
new
HttpGet
(
httpUrl
);
return
sendHttpGet
(
httpGet
);
}
/**
* 发送 delete请求带请求头
*/
public
static
String
sendHttpDeleteWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建get请求
HttpDelete
httpDelete
=
new
HttpDelete
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpDelete
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpDelete
(
httpDelete
);
}
/**
* 发送 get请求带请求头
*/
public
static
String
sendHttpGetWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建get请求
HttpGet
httpGet
=
new
HttpGet
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpGet
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpGet
(
httpGet
);
}
/**
* 发送 delete请求带请求头
*/
public
static
String
sendHttpDeleteJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
StringBuffer
content
=
new
StringBuffer
();
try
{
URL
url
=
new
URL
(
httpUrl
);
HttpURLConnection
connection
=
(
HttpURLConnection
)
url
.
openConnection
();
connection
.
setRequestMethod
(
"DELETE"
);
connection
.
setDoInput
(
true
);
connection
.
setDoOutput
(
true
);
connection
.
setRequestProperty
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
connection
.
setRequestProperty
(
entry
.
getKey
(),
entry
.
getValue
());
}
PrintWriter
printWriter
=
new
PrintWriter
(
connection
.
getOutputStream
());
printWriter
.
write
(
paramsJson
);
printWriter
.
flush
();
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
()));
String
line
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
content
.
append
(
line
);
}
br
.
close
();
connection
.
disconnect
();
}
catch
(
Exception
e
)
{
}
return
content
.
toString
();
}
/**
* 发送 post请求
*
* @param httpUrl 地址
* @param params 参数(格式:key1=value1&key2=value2)
*/
public
static
String
sendHttpPost
(
String
httpUrl
,
String
params
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
params
!=
null
&&
params
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
params
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_FORM_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 post请求
*
* @param maps 参数
*/
public
static
String
sendHttpPost
(
String
httpUrl
,
Map
<
String
,
String
>
maps
)
{
String
parem
=
convertStringParamter
(
maps
);
return
sendHttpPost
(
httpUrl
,
parem
);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPostJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 put请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPutJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
HttpPut
httpPost
=
new
HttpPut
(
httpUrl
);
// 创建HttpPut
try
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPut
(
httpPost
);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPostJson
(
String
httpUrl
,
String
paramsJson
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 post请求 发送xml数据
*
* @param httpUrl 地址
* @param paramsXml 参数(格式 Xml)
*/
public
static
String
sendHttpPostXml
(
String
httpUrl
,
String
paramsXml
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
paramsXml
!=
null
&&
paramsXml
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsXml
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_TEXT_HTML
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 将map集合的键值对转化成:key1=value1&key2=value2 的形式
*
* @param parameterMap 需要转化的键值对集合
* @return 字符串
*/
private
static
String
convertStringParamter
(
Map
parameterMap
)
{
StringBuffer
parameterBuffer
=
new
StringBuffer
();
if
(
parameterMap
!=
null
)
{
Iterator
iterator
=
parameterMap
.
keySet
().
iterator
();
String
key
=
null
;
String
value
=
null
;
while
(
iterator
.
hasNext
())
{
key
=
(
String
)
iterator
.
next
();
if
(
parameterMap
.
get
(
key
)
!=
null
)
{
value
=
(
String
)
parameterMap
.
get
(
key
);
}
else
{
value
=
""
;
}
parameterBuffer
.
append
(
key
).
append
(
"="
).
append
(
value
);
if
(
iterator
.
hasNext
())
{
parameterBuffer
.
append
(
"&"
);
}
}
}
return
parameterBuffer
.
toString
();
}
}
\ 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/constants/XJConstant.java
0 → 100644
View file @
a25eb268
/**
*
*/
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
constants
;
import
org.slf4j.LoggerFactory
;
import
java.text.SimpleDateFormat
;
/**
* 常量
*/
public
class
XJConstant
{
public
static
final
String
ROOT_PATH
=
"F:/software/nginx-1.14.2/html/"
;
public
static
final
String
NGINX_ADDRESS
=
"172.16.3.77:8081/"
;
public
static
final
String
DEFAULT_RISKDESC
=
"默认"
;
public
static
final
String
JPUSH_USER_KEY
=
"BANK88"
;
public
static
final
String
CHECK_TYPE
=
"CHECK_TYPE"
;
public
static
final
String
DEPT_WF_MAP_DIC_CODE
=
"DEPT_WF_MAP"
;
/**
* 构造方法
*/
private
XJConstant
()
{
LoggerFactory
.
getLogger
(
this
.
getClass
()).
debug
(
XJConstant
.
CONSTRUCTOR
);
}
/**
* 网络服务ip
*/
public
static
final
String
NET_SERVER_HOST
=
"0.0.0.0"
;
/**
* 请求头key
*/
public
static
final
String
TOKEN_KEY
=
"token"
;
/**
* 请求头key
*/
public
static
final
String
PRODUCT
=
"product"
;
/**
* 请求头key
*/
public
static
final
String
APPKEY
=
"appKey"
;
/**
* 时间格式(yyyy-MM-dd HH:mm:ss)
*/
public
static
final
SimpleDateFormat
SIMPLEDATAFORMAT_YMDHMS
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
/**
* 构造方法字符串
*/
public
static
final
String
CONSTRUCTOR
=
"constructor..."
;
/**
* 轮询job最大线程数
*/
public
static
final
int
POLLING_JOB_THREAD_MAX_NUM
=
20
;
/**
* amos线程池数量
*/
public
static
final
int
AMOS_THREAD_NUM
=
20
;
/**
* 设备测试最大线程数
*/
public
static
final
int
TEST_EQUIPMENT_THREAD_MAX_NUM
=
5
;
/**
* 时间格式字符串:yyyy-MM-dd HH:mm:ss
*/
public
static
final
String
DATE_TIME_STR_YMDHMS
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* bar
*/
public
static
final
String
BAR
=
"-"
;
/**
* Underline
*/
public
static
final
String
UNDERLINE
=
"_"
;
/**
* user
*/
public
static
final
String
USER
=
"user"
;
/**
* token
*/
public
static
final
String
TOKEN
=
"token"
;
/**
* loginType
*/
public
static
final
String
LOGIN_TYPE
=
"loginType"
;
/**
* subGraphId
*/
public
static
final
String
SUB_GRAPH_ID
=
"subGraphId"
;
public
static
final
String
ADMIN_ID
=
"1"
;
/**
* 帧报文异常
*/
public
static
final
String
FRAME_EXECPTION
=
"FRAME"
;
/**
* 性能指标
*/
public
static
final
String
METRIC
=
"METRIC"
;
/**
* 报文通道
*/
public
static
final
String
CHANNEL
=
"CHANNEL"
;
/**
* 设备状态(掉线)告警
*/
public
static
final
String
EQUIPMENT_STATUS
=
"EQUIPMENT_STATUS"
;
/**
* 设备连通性告警告警
*/
public
static
final
String
EQUIPMENT_CONNECTION
=
"EQUIPMENT_CONNECTION"
;
/**
* 通道注册
*/
public
static
final
String
REGISTER
=
"REGISTER"
;
/**
* 通道注销
*/
public
static
final
String
UNREGISTER
=
"UNREGISTER"
;
/**
* 报文正常
*/
public
static
final
String
NORMAL
=
"NORMAL"
;
/**
* 报文异常
*/
public
static
final
String
UNNORMAL
=
"UNNORMAL"
;
/**
* 告警socket类型
*/
public
static
final
String
ALARM_SOCKET
=
"ALARM_SOCKET"
;
/**
* 数据socket类型
*/
public
static
final
String
METRIC_SOCKET
=
"METRIC_SOCKET"
;
/**
* 数据socket类型
*/
public
static
final
String
MORPHIC_SOCKET
=
"MORPHIC_SOCKET"
;
/**
* false
*/
public
static
final
Boolean
FAIL_BOOLEAN_VALUE
=
Boolean
.
FALSE
;
/**
* 0
*/
public
static
final
Integer
ZERO_INT_VALUE
=
Integer
.
parseInt
(
"0"
);
/**
* -1
*/
public
static
final
Integer
FAIL_INT_VALUE
=
Integer
.
parseInt
(
"-1"
);
/**
* -1
*/
public
static
final
Long
FAIL_LONG_VALUE
=
Long
.
parseLong
(
"-1"
);
/**
* -1
*/
public
static
final
Short
FAIL_SHORT_VALUE
=
Short
.
parseShort
(
"-1"
);
/**
*
*/
public
static
final
Float
FAIL_FLOAT_VALUE
=
Float
.
parseFloat
(
"-1"
);
/**
* -1
*/
public
static
final
Double
FAIL_DOUBLE_VALUE
=
Double
.
parseDouble
(
"-1"
);
/**
* 空格
*/
public
static
final
Character
FAIL_CHARACTER_VALUE
=
Character
.
valueOf
(
' '
);
/**
* 失败
*/
public
static
final
int
FAILURE
=
0
;
/**
* 成功
*/
public
static
final
int
SUCCESS
=
1
;
/**
* 在线
*/
public
static
final
String
ONLINE
=
"在线"
;
/**
* 掉线
*/
public
static
final
String
OFFLINE
=
"掉线"
;
/**
* 通
*/
public
static
final
String
OPEN
=
"通"
;
/**
* 不通
*/
public
static
final
String
OFF
=
"不通"
;
/**
* ip
*/
public
static
final
String
IP
=
"ip"
;
/**
* #
*/
public
static
final
String
SHARP
=
"#"
;
/**
* TCP
*/
public
static
final
String
TCP
=
"TCP"
;
public
static
final
String
PIE_CHAR
=
"pieChar"
;
public
static
final
String
BAR_CHAR
=
"barChar"
;
public
static
final
String
HBAR_CHAR
=
"hbarChar"
;
public
static
final
String
LINE_CHAR
=
"lineChar"
;
public
static
final
String
DOUGHUNT_CHAR
=
"doughuntChar"
;
public
static
final
String
ROSE_CHAR
=
"roseChar"
;
public
static
final
String
AREA_CHAR
=
"areaChar"
;
public
static
final
String
DIMENSION
=
"dimension"
;
public
static
final
String
MEASURE
=
"measure"
;
/**
* xunjian
*/
public
static
final
String
TABLE_USERS
=
"Users"
;
public
static
final
String
EDIT_PWD
=
"editPassword"
;
public
static
final
String
EDIT_NOT_PWD
=
"editUsersInfo"
;
public
static
final
String
SAVE_USERS
=
"saveTableById"
;
public
static
final
String
SAVE_COM_USER
=
"saveComUserInfo"
;
public
static
final
String
EDIT_COM_USER
=
"editComUserInfo"
;
public
static
final
String
TABLE_CHECK
=
"Check"
;
public
static
final
String
TABLE_COM_USER
=
"companyUser"
;
public
static
final
int
FINISH_YES
=
2
;
public
static
final
int
FINISH_ING
=
1
;
public
static
final
int
FINISH_NO
=
0
;
public
static
final
String
SAVE_DEPART
=
"saveDepartMent"
;
public
static
final
String
EDIT_DEPART
=
"editsDepartMent"
;
public
static
final
String
TABLE_DEPART
=
"Group"
;
public
static
final
String
TABLE_ERROR
=
"Error"
;
//隐患表
public
static
final
String
SAVE_ERROR
=
"saveErrorByID"
;
//更新隐患表
public
static
final
int
XJ_ADMIN_ROLE
=
9
;
//巡检管理员角色ID
public
static
final
int
XJ_USER_ROLE
=
0
;
//巡检普通用户角色ID
public
static
final
int
TASK_STATUS_TIMEOUT
=
3
;
//已超时
public
static
final
int
TASK_STATUS_FINISH
=
2
;
//已结束
public
static
final
int
TASK_STATUS_DEAL
=
1
;
//进行中
public
static
final
int
TASK_STATUS_NO_START
=
0
;
//未开始
public
static
final
String
PLAN_TASK_DET_FINISH_NO
=
"0"
;
//任务明细状态:未完成
public
static
final
String
PLAN_TASK_DET_FINISH_YES
=
"1"
;
//任务明细状态:完成
public
static
final
String
PLAN_TASK_DET_FINISH_OUT
=
"2"
;
//任务明细状态:超时漏检
public
static
final
String
USER_DATA_ADMIN
=
"全部可见"
;
//用户数据可见范围
public
static
final
String
USER_DATA_DEPART
=
"部门可见"
;
//用户数据可见范围
public
static
final
String
USER_DATA_PERSON
=
"个人可见"
;
//用户数据可见范围
public
static
final
String
USER_ROLE_SUPERADMIN
=
"1"
;
//权限id-超级管理员
public
static
final
String
USER_ROLE_ADMIN
=
"2"
;
//权限id-管理员
public
static
final
String
USER_ROLE_DEPART
=
"3"
;
//权限id-部门管理
public
static
final
String
USER_ROLE_PERSON
=
"4"
;
//权限id-普通用户
public
static
final
String
ROLE_NAME_SUPERADMIN
=
"SUPERADMIN"
;
//数据权限-超级管理员
public
static
final
String
ROLE_NAME_ADMIN
=
"ADMIN"
;
//数据权限-超级管理员
public
static
final
String
ROLE_NAME_DEPTADMIN
=
"DEPTADMIN"
;
//数据权限-部门
public
static
final
String
ROLE_NAME_PERSON
=
"PERSONAL"
;
//数据权限-个人
public
static
final
String
ADMIN_FLAG
=
"2"
;
//权限标记
public
static
final
String
DEPART_FLAG
=
"1"
;
//权限标记
public
static
final
String
PERSON_FLAG
=
"0"
;
//权限标记
public
static
final
String
ADMIN_FLAG_NO
=
"0"
;
//标记 0-无关
public
static
final
String
ADMIN_FLAG_UP
=
"1"
;
//1-上级admin
public
static
final
String
ADMIN_FLAG_THIS
=
"2"
;
//2-本级admin
public
static
final
String
UNCLASSIFIED
=
"Unclassifed"
;
//巡检点未分类
public
static
final
String
ADMIN_ORG_CODE
=
"2"
;
public
static
final
String
CHECK_CHANGE_NO
=
"0"
;
//是否记为合格:否
public
static
final
String
CHECK_CHANGE_YES
=
"1"
;
//是否记为合格:是
public
static
final
String
SCHED_FLAG
=
"99"
;
//自动任务标记
public
static
final
String
REGEN_FLAG
=
"98"
;
//重做任务标记
public
static
final
String
FIX_DATE_NO
=
"0"
;
//不固定日期(区间)
public
static
final
String
FIX_DATE_YES
=
"1"
;
//固定日期
//计划类型
public
static
final
String
PLAN_TYPE_DAY
=
"1"
;
//日计划
public
static
final
String
PLAN_TYPE_WEEK
=
"2"
;
//周计划
public
static
final
String
PLAN_TYPE_MONTH
=
"3"
;
//月计划
public
static
final
String
PLAN_TYPE_YEAR
=
"4"
;
//年计划
//月类型
public
static
final
String
MONTH_TYPE_DAY
=
"1"
;
//第几天
public
static
final
String
MONTH_TYPE_AT
=
"2"
;
//在第几周的第几天
public
static
final
String
INTERVAL_UNIT_HOUR
=
"1"
;
//执行间隔小时
public
static
final
String
INTERVAL_UNIT_MINUTE
=
"2"
;
//执行间隔分钟
public
static
final
String
INTERVAL_UNIT_SECOND
=
"3"
;
//执行间隔秒
public
static
final
String
ZERO_TIME
=
"00:00:00"
;
//time
public
static
final
String
PLAN_STATUS_START
=
"0"
;
//计划状态:正常
public
static
final
String
PLAN_STATUS_STOP
=
"1"
;
//计划状态:已停用
public
static
final
int
PLAN_FIRST_STATUS_YES
=
0
;
//计划:初始状态
public
static
final
int
PLAN_FIRST_STATUS_NO
=
1
;
//计划:非初始状态
public
static
final
String
UPD_PLAN_GEN_DATE
=
"1"
;
//更新plan表日期
public
static
final
String
UPD_PLAN_STATUS
=
"2"
;
//更新plan表next_gen_status
public
static
final
int
DAY_RATE_ONE
=
0
;
//0-1次
public
static
final
int
DAY_RATE_MANY
=
1
;
//1-多次
public
static
final
int
IS_DETETE_NO
=
0
;
//未删除
public
static
final
int
IS_DETETE_YES
=
1
;
//删除
public
static
final
String
UPLOAD_ROOT_PATH
=
"upload"
;
public
static
final
String
INPUT_ITEM_TEXT
=
"文本"
;
public
static
final
String
INPUT_ITEM_NUMBER
=
"数字"
;
public
static
final
String
INPUT_ITEM_SELECT
=
"选择"
;
public
static
final
String
CHECK_TYPE_ALWAYS_OK
=
"始终合格"
;
public
static
final
String
CHECK_TYPE_ALWAYS_NO
=
"始终不合格"
;
public
static
final
String
CHECK_TYPE_NO_CONTEXT_OK
=
"无内容合格"
;
public
static
final
String
CHECK_TYPE_CONTEXT_OK
=
"有内容合格"
;
public
static
final
String
OK
=
"合格"
;
public
static
final
String
NO
=
"不合格"
;
public
static
final
String
YES
=
"是"
;
public
static
final
String
NOT
=
"否"
;
public
static
final
String
INPUT_ITEM_OK_SCORE
=
"OkScore"
;
public
static
final
String
INPUT_ITEM_NOT_SCORE
=
"NoScore"
;
public
static
final
String
POINT_OK_SCORE
=
"1"
;
public
static
final
String
POINT_NOT_SCORE
=
"0"
;
/**
* 任务是否发送消息状态
*/
public
static
final
String
TASK_WARN
=
"是"
;
public
static
final
String
TASK_NOT_WARN
=
"否"
;
/**
* 系统定时任务类型
*/
public
static
final
String
STATUS_MONITOR_START
=
"statusMonitorStart"
;
//状态监控是否开始
public
static
final
String
STATUS_MONITOR_END
=
"statusMonitorEnd"
;
//状态监控是否结束
public
static
final
String
PLAN_TASK_WARN_MSG_PUSH
=
"planTaskWarnMsgPush"
;
//计划即将开始消息提醒推送
public
static
final
String
PLAN_TASK_BEGIN_MSG_PUSH
=
"planTaskBeginMsgPush"
;
//计划已经开始消息提醒推送
public
static
final
String
PLAN_TASK_END_MSG_PUSH
=
"planTaskEndMsgPush"
;
//计划已经开始消息提醒推送
public
static
final
String
MESSAGE_PUSH
=
"messagePush"
;
//消息推送
public
static
final
int
IS_SENT
=
1
;
//已发送
public
static
final
int
NOT_SENT
=
0
;
//未发送
public
static
final
String
IS_FIXED_YES
=
"1"
;
//固定点
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/CompanyDto.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
...
...
@@ -20,6 +21,8 @@ public class CompanyDto extends BaseDto {
private
static
final
long
serialVersionUID
=
1L
;
Company
company
;
@ApiModelProperty
(
value
=
"企业名称"
)
private
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
0 → 100644
View file @
a25eb268
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
javax.xml.soap.Text
;
/**
* 安装告知表
*
* @author system_generator
* @date 2022-09-22
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"InstallNoticePageDto"
,
description
=
"安装告知表"
)
public
class
InstallNoticePageDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"项目安装区域"
)
private
String
installRegion
;
@ApiModelProperty
(
value
=
"建设单位"
)
private
String
constructionUnit
;
@ApiModelProperty
(
value
=
"建设单位负责人"
)
private
String
chargePerson
;
@ApiModelProperty
(
value
=
"安装单位"
)
private
String
installationUnit
;
@ApiModelProperty
(
value
=
"安装负责人"
)
private
String
installPri
;
@ApiModelProperty
(
value
=
"监察部门"
)
private
String
superviseDeptId
;
@ApiModelProperty
(
value
=
"监察负责人"
)
private
String
chargerPersonId
;
@ApiModelProperty
(
value
=
"监检机构"
)
private
String
inspectionOrgId
;
@ApiModelProperty
(
value
=
"附件查看"
)
private
Text
info
;
@ApiModelProperty
(
value
=
"告知申请状态"
)
private
String
noticeStatus
;
@ApiModelProperty
(
value
=
"告知申请提交日期"
)
private
String
noticeDate
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/PercentOfPassDto.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @Author cpp
* @Description
* @Date 2022/10/10
*/
@Data
public
class
PercentOfPassDto
extends
BaseDto
{
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
projectId
;
@ApiModelProperty
(
value
=
"合格率"
)
private
String
percentOfPass
;
@ApiModelProperty
(
value
=
"监理单位"
)
private
String
currentUnit
;
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"项目地点"
)
private
String
address
;
@ApiModelProperty
(
value
=
"项目进度"
)
private
String
progressStatus
;
@ApiModelProperty
(
value
=
"建设单位名称"
)
private
String
constructionUnit
;
@ApiModelProperty
(
value
=
"建设单位负责人名称"
)
private
String
chargePerson
;
@ApiModelProperty
(
value
=
"项目开工日期"
)
private
Date
startDate
;
@ApiModelProperty
(
value
=
"项目提交日期"
)
private
Date
submitDate
;
@ApiModelProperty
(
value
=
"刷新"
)
private
String
refresh
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
View file @
a25eb268
...
...
@@ -75,7 +75,14 @@ public class ProjectDto extends BaseDto {
@ApiModelProperty
(
value
=
"项目提交日期"
)
private
Date
submitDate
;
@ApiModelProperty
(
value
=
"流程id"
)
private
String
instanceId
;
@ApiModelProperty
(
value
=
"流程状态"
)
private
String
status
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectInitiationDto.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
@Data
@ApiModel
(
value
=
"ProjectInitiationDto"
,
description
=
"项目立项流程日志表"
)
public
class
ProjectInitiationDto
extends
BaseDto
{
@TableField
(
"instance_id"
)
private
String
instanceId
;
@TableField
(
"task_id"
)
private
String
taskId
;
@TableField
(
"task_name"
)
private
String
taskName
;
@TableField
(
"executor"
)
private
String
executor
;
@TableField
(
"context"
)
private
String
context
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/QualityProblemDto.java
View file @
a25eb268
...
...
@@ -11,7 +11,7 @@ import java.util.Date;
* 质量问题表
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
...
...
@@ -21,7 +21,7 @@ public class QualityProblemDto extends BaseDto {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"
企业
id"
)
@ApiModelProperty
(
value
=
"
项目
id"
)
private
Long
projectId
;
@ApiModelProperty
(
value
=
"质量问题编号"
)
...
...
@@ -30,31 +30,52 @@ public class QualityProblemDto extends BaseDto {
@ApiModelProperty
(
value
=
"问题产生阶段"
)
private
String
generateStage
;
@ApiModelProperty
(
value
=
"问题描述"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"问题等级"
)
private
String
level
;
@ApiModelProperty
(
value
=
"产生问题的阶段对应检验信息id"
)
private
Long
stageVerifyId
;
@ApiModelProperty
(
value
=
"处理进度"
)
private
String
processProgress
;
@ApiModelProperty
(
value
=
"整改书提交状态"
)
private
String
submitStatus
;
@ApiModelProperty
(
value
=
"整改书提交状态
(1已提交/0未提交)
"
)
private
Boolean
submitStatus
;
@ApiModelProperty
(
value
=
"提交日期"
)
@ApiModelProperty
(
value
=
"
问题
提交日期"
)
private
Date
submitDate
;
@ApiModelProperty
(
value
=
"复核日期"
)
private
Date
reviewDate
;
@ApiModelProperty
(
value
=
"问题分类(1继续整改/2转问题处理单)"
)
private
Boolean
problemType
;
@ApiModelProperty
(
value
=
"审查项目是否存在问题(1是/0否)"
)
private
Boolean
reviewStatus
;
@ApiModelProperty
(
value
=
"
复核状态
"
)
private
String
reviewStatus
;
@ApiModelProperty
(
value
=
"
处理方案(附件上传)
"
)
private
String
solution
;
@ApiModelProperty
(
value
=
"
复核方式
"
)
private
String
reviewType
;
@ApiModelProperty
(
value
=
"
处理方案说明
"
)
private
String
solutionDesc
;
@ApiModelProperty
(
value
=
"
监检意见
"
)
private
String
inspect
Opinion
;
@ApiModelProperty
(
value
=
"
处理意见(附件上传)
"
)
private
String
handing
Opinion
;
@ApiModelProperty
(
value
=
"整改书"
)
@ApiModelProperty
(
value
=
"处理意见说明"
)
private
String
handingOpinionDesc
;
@ApiModelProperty
(
value
=
"整改书(附件上传)"
)
private
String
reformDoc
;
@ApiModelProperty
(
value
=
"质量问题描述"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"整改书说明"
)
private
String
reformDesc
;
@ApiModelProperty
(
value
=
"整改期限"
)
private
Date
reformLimitDate
;
@ApiModelProperty
(
value
=
"是否限期内整改(1是/0否)"
)
private
Boolean
rectifyWithinTime
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/WeldDto.java
View file @
a25eb268
...
...
@@ -27,9 +27,13 @@ public class WeldDto extends BaseDto {
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
projectId
;
private
String
name
;
@ApiModelProperty
(
value
=
"安装单位id"
)
private
Long
installCompany
;
private
String
installationUnit
;
@ApiModelProperty
(
value
=
"所在地"
)
private
String
region
;
...
...
@@ -45,4 +49,8 @@ public class WeldDto extends BaseDto {
@ApiModelProperty
(
value
=
"赋码日期"
)
private
Date
codingDate
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/WelderDto.java
0 → 100644
View file @
a25eb268
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.awt.*
;
import
java.util.Date
;
/**
* 焊口信息表
*
* @author system_generator
* @date 2022-09-22
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"WelderDto"
,
description
=
"焊工表"
)
public
class
WelderDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"焊工姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"身份证号码"
)
private
String
idNumber
;
@ApiModelProperty
(
value
=
"联系电话"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"持证项目"
)
private
String
licensedProject
;
@ApiModelProperty
(
value
=
"证书编号"
)
private
String
certNumber
;
@ApiModelProperty
(
value
=
"发证部门"
)
private
String
licenseDept
;
@ApiModelProperty
(
value
=
"证书有效期"
)
private
Date
certValidDate
;
@ApiModelProperty
(
value
=
"常用地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"证书类型"
)
private
String
certType
;
@ApiModelProperty
(
value
=
"考试机构"
)
private
String
examOrg
;
@ApiModelProperty
(
value
=
"持证批次"
)
private
String
licensedNum
;
@ApiModelProperty
(
value
=
"档案编号"
)
private
String
fileNumber
;
@ApiModelProperty
(
value
=
"图片"
)
private
Image
image
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Company.java
View file @
a25eb268
...
...
@@ -100,4 +100,16 @@ public class Company extends BaseEntity {
@TableField
(
"org_code"
)
private
String
orgCode
;
/**
* 企业管理员
*/
@TableField
(
"admin"
)
private
String
admin
;
/**
* 企业管理员电话
*/
@TableField
(
"admin_phone"
)
private
String
adminPhone
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/InstallNotice.java
View file @
a25eb268
...
...
@@ -71,6 +71,12 @@ public class InstallNotice extends BaseEntity {
private
String
contractAttch
;
/**
* 安装负责人
*/
@TableField
(
"install_pri"
)
private
String
installPri
;
/**
* 许可证文件
*/
@TableField
(
"license_attch"
)
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
View file @
a25eb268
...
...
@@ -132,6 +132,18 @@ public class Project extends BaseEntity {
private
Date
submitDate
;
/**
* 流程id
*/
@TableField
(
"instance_id"
)
private
String
instanceId
;
/**
* 流程状态
*/
@TableField
(
"status"
)
private
String
status
;
/**
* 备注
*/
@TableField
(
"remark"
)
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/ProjectInitiation.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz_ugp_project_initiation_log"
)
public
class
ProjectInitiation
extends
BaseEntity
{
@TableField
(
"instance_id"
)
private
String
instanceId
;
@TableField
(
"task_id"
)
private
String
taskId
;
@TableField
(
"task_name"
)
private
String
taskName
;
@TableField
(
"executor"
)
private
String
executor
;
@TableField
(
"context"
)
private
String
context
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/QualityInfo.java
View file @
a25eb268
...
...
@@ -23,7 +23,7 @@ public class QualityInfo extends BaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
/**
*
企业
id
*
项目
id
*/
@TableField
(
"project_id"
)
private
Long
projectId
;
...
...
@@ -40,4 +40,8 @@ public class QualityInfo extends BaseEntity {
@TableField
(
"supervisory_unit_id"
)
private
Long
supervisoryUnitId
;
//项目表
private
Project
project
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/QualityProblem.java
View file @
a25eb268
...
...
@@ -12,7 +12,7 @@ import java.util.Date;
* 质量问题表
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
...
...
@@ -23,7 +23,7 @@ public class QualityProblem extends BaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
/**
*
企业
id
*
项目
id
*/
@TableField
(
"project_id"
)
private
Long
projectId
;
...
...
@@ -41,57 +41,99 @@ public class QualityProblem extends BaseEntity {
private
String
generateStage
;
/**
* 问题描述
*/
@TableField
(
"desc"
)
private
String
desc
;
/**
* 问题等级
*/
@TableField
(
"level"
)
private
String
level
;
/**
* 产生问题的阶段对应检验信息id
*/
@TableField
(
"stage_verify_id"
)
private
Long
stageVerifyId
;
/**
* 处理进度
*/
@TableField
(
"process_progress"
)
private
String
processProgress
;
/**
* 整改书提交状态
* 整改书提交状态
(1已提交/0未提交)
*/
@TableField
(
"submit_status"
)
private
String
submitStatus
;
private
Boolean
submitStatus
;
/**
* 提交日期
*
问题
提交日期
*/
@TableField
(
"submit_date"
)
private
Date
submitDate
;
/**
*
复核日期
*
问题分类(1继续整改/2转问题处理单)
*/
@TableField
(
"
review_dat
e"
)
private
Date
reviewDat
e
;
@TableField
(
"
problem_typ
e"
)
private
Boolean
problemTyp
e
;
/**
*
复核状态
*
审查项目是否存在问题(1是/0否)
*/
@TableField
(
"review_status"
)
private
String
reviewStatus
;
private
Boolean
reviewStatus
;
/**
*
复核方式
*
处理方案(附件上传)
*/
@TableField
(
"
review_type
"
)
private
String
reviewType
;
@TableField
(
"
solution
"
)
private
String
solution
;
/**
*
监检意见
*
处理方案说明
*/
@TableField
(
"
inspect_opinion
"
)
private
String
inspectOpinion
;
@TableField
(
"
solution_desc
"
)
private
String
solutionDesc
;
/**
* 整改书
* 处理意见(附件上传)
*/
@TableField
(
"handing_opinion"
)
private
String
handingOpinion
;
/**
* 处理意见说明
*/
@TableField
(
"handing_opinion_desc"
)
private
String
handingOpinionDesc
;
/**
* 整改书(附件上传)
*/
@TableField
(
"reform_doc"
)
private
String
reformDoc
;
/**
*
质量问题描述
*
整改书说明
*/
@TableField
(
"desc"
)
private
String
desc
;
@TableField
(
"reform_desc"
)
private
String
reformDesc
;
/**
* 整改期限
*/
@TableField
(
"reform_limit_date"
)
private
Date
reformLimitDate
;
/**
* 是否限期内整改(1是/0否)
*/
@TableField
(
"rectify_within_time"
)
private
Boolean
rectifyWithinTime
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/CompanyMapper.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
/**
* 企业信息表 Mapper 接口
...
...
@@ -10,5 +10,4 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2022-09-22
*/
public
interface
CompanyMapper
extends
BaseMapper
<
Company
>
{
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/IInstallationQualityMapper.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo
;
import
java.util.List
;
public
interface
IInstallationQualityMapper
extends
BaseMapper
<
QualityInfo
>
{
List
<
QualityInfo
>
findss
();
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/InstallNoticeMapper.java
View file @
a25eb268
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.InstallNoticeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
/**
* 安装告知表 Mapper 接口
...
...
@@ -10,5 +20,17 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2022-09-22
*/
public
interface
InstallNoticeMapper
extends
BaseMapper
<
InstallNotice
>
{
//安装告知申请页面列表
List
<
InstallNoticePageDto
>
installNoticeList
();
//筛选sequenceNbr查询安装告知申请页面数据
List
<
InstallNoticePageDto
>
selectByName
(
@Param
(
"name"
)
String
name
,
@Param
(
"unit"
)
String
unit
);
//根据
InstallNoticePageDto
selectById
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
//安装告知申请页面分页列表
Page
<
InstallNoticePageDto
>
installNoticePage
(
IPage
<
InstallNoticePageDto
>
page
);
//根据sequenceNbr查询告知申请详情
InstallNoticeDto
selectoneById
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/ProjectInitiationMapper.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation
;
public
interface
ProjectInitiationMapper
extends
BaseMapper
<
ProjectInitiation
>
{
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/QualityProblemMapper.java
View file @
a25eb268
...
...
@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* 质量问题表 Mapper 接口
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
public
interface
QualityProblemMapper
extends
BaseMapper
<
QualityProblem
>
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/WeldMapper.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* 焊口信息表 Mapper 接口
...
...
@@ -9,6 +14,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
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
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/ICompanyService.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
/**
* 企业信息表接口类
*
...
...
@@ -9,4 +12,6 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/
public
interface
ICompanyService
{
void
modifyCompanyInfo
(
Company
company
)
throws
Exception
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IInstallNoticeService.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 安装告知表接口类
*
...
...
@@ -8,5 +12,12 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public
interface
IInstallNoticeService
{
//安装告知页面列表
List
<
InstallNoticePageDto
>
installNoticeList
();
//安装告知页面分页查询
List
<
InstallNoticePageDto
>
selectByName
(
@Param
(
"name"
)
String
name
,
@Param
(
"unit"
)
String
unit
);
//根据sequenceNbr查询列表数据
InstallNoticePageDto
selectById
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IInstallationQualityService.java
0 → 100644
View file @
a25eb268
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.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
java.util.List
;
public
interface
IInstallationQualityService
{
Page
<
PercentOfPassDto
>
find
(
Page
<
PercentOfPassDto
>
page
,
PercentOfPassDto
percentOfPassDto
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProjectInitiationService.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
public
interface
IProjectInitiationService
{
/**
* 流程启动
* @return 返回instanceId ,加入项目信息表中
* @throws Exception
*/
void
start
(
Project
project
);
/**
* 执行流程节点,并记录日志
*/
void
execute
(
String
instanceId
,
Object
object
,
String
option
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IQualityProblemService.java
View file @
a25eb268
...
...
@@ -5,7 +5,7 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* 质量问题表接口类
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
public
interface
IQualityProblemService
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IWeldService.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
java.util.List
;
/**
* 焊口信息表接口类
*
...
...
@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public
interface
IWeldService
{
List
<
Weld
>
getCode
(
Long
projectCode
,
int
number
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/InstallNoticeMapper.xml
View file @
a25eb268
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper"
>
<!-- 查询安装告知申请列表-->
<select
id=
"installNoticeList"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"
>
SELECT tz_ugp_project.name,install_region,start_date,construction_unit,install_pri,charge_person,installation_unit,charge_person_id,
notice_status,notice_date ,supervise_dept_id,info
FROM tz_ugp_install_notice, tz_ugp_project ,tz_ugp_supervise_rule ,tz_ugp_attachment
WHERE tz_ugp_install_notice.project_id=tz_ugp_project.sequence_nbr AND tz_ugp_supervise_rule.admin_region_code= tz_ugp_project.install_region_code
AND tz_ugp_attachment.source_id=tz_ugp_project.sequence_nbr
</select>
<!-- 安装告知申请列表按name,unit筛选-->
<select
id=
"selectByName"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"
>
SELECT tz_ugp_project.name,install_region,start_date,construction_unit,install_pri,charge_person,installation_unit,charge_person_id,
notice_status,notice_date ,supervise_dept_id,info
FROM tz_ugp_install_notice, tz_ugp_project ,tz_ugp_supervise_rule ,tz_ugp_attachment
WHERE tz_ugp_project.name = #{name} and construction_unit = #{unit}
and tz_ugp_install_notice.project_id=tz_ugp_project.sequence_nbr AND tz_ugp_supervise_rule.admin_region_code= tz_ugp_project.install_region_code
AND tz_ugp_attachment.source_id=tz_ugp_project.sequence_nbr
</select>
<!-- 通过id查询页面数据-->
<select
id=
"selectById"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"
>
SELECT tz_ugp_project.name,install_region,start_date,construction_unit,install_pri,charge_person,installation_unit,charge_person_id,
notice_status,notice_date ,supervise_dept_id,info
FROM tz_ugp_install_notice, tz_ugp_project ,tz_ugp_supervise_rule ,tz_ugp_attachment
WHERE tz_ugp_install_notice.project_id=tz_ugp_project.sequence_nbr AND tz_ugp_supervise_rule.admin_region_code= tz_ugp_project.install_region_code
AND tz_ugp_attachment.source_id=tz_ugp_project.sequence_nbr
AND tz_ugp_project.sequence_nbr=#{sequenceNbr}
</select>
<!-- 查询安装告知申请页面-->
<select
id=
"installNoticePage"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"
>
SELECT tz_ugp_project.sequence_nbr,tz_ugp_project.name,install_region,start_date,construction_unit,install_pri,charge_person,installation_unit,charge_person_id,
notice_status,notice_date ,supervise_dept_id,info
FROM tz_ugp_install_notice, tz_ugp_project ,tz_ugp_supervise_rule ,tz_ugp_attachment
WHERE tz_ugp_install_notice.project_id=tz_ugp_project.sequence_nbr AND tz_ugp_supervise_rule.admin_region_code= tz_ugp_project.install_region_code
AND tz_ugp_attachment.source_id=tz_ugp_project.sequence_nbr
</select>
<!-- selectoneById-->
<select
id=
"selectoneById"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto"
>
SELECT*
FROM tz_ugp_install_notice
WHERE sequence_nbr=#{sequenceNbr};
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/InstallationQualityMapper.xml
0 → 100644
View file @
a25eb268
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.IInstallationQualityMapper"
>
<resultMap
id=
"result"
type=
"com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo"
>
<result
property=
"projectId"
column=
"project_id"
jdbcType=
"INTEGER"
/>
<result
property=
"supervisoryUnitId"
column=
"supervisory_unit_id"
jdbcType=
"INTEGER"
/>
<association
property=
"project"
javaType=
"com.yeejoin.amos.boot.module.ugp.api.entity.Project"
>
<!--@Table tz_ugp_project-->
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"progressStatus"
column=
"progress_status"
jdbcType=
"VARCHAR"
/>
<result
property=
"address"
column=
"address"
jdbcType=
"VARCHAR"
/>
<result
property=
"startDate"
column=
"start_date"
jdbcType=
"OTHER"
/>
<result
property=
"constructionUnit"
column=
"construction_unit"
jdbcType=
"VARCHAR"
/>
<result
property=
"chargePerson"
column=
"charge_person"
jdbcType=
"VARCHAR"
/>
<result
property=
"submitDate"
column=
"submit_date"
jdbcType=
"OTHER"
/>
</association>
</resultMap>
<select
id=
"findss"
resultMap=
"result"
>
select
pt.name ,
pt.address ,
pt.progress_status ,
qy.supervisory_unit_id ,
qy.project_id,
pt.construction_unit ,
pt.charge_person ,
pt.start_date ,
pt.submit_date
from
tz_ugp_quality_info qy ,
tz_ugp_project pt
where
qy.project_id=pt.sequence_nbr
and
qy.is_delete =0
and
pt.is_delete=0
</select>
</mapper>
\ 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/controller/CompanyController.java
View file @
a25eb268
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.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
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.biz.service.impl.OrgUsrServiceImpl
;
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.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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.util.DesUtil
;
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.List
;
import
java.util.*
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -30,13 +52,22 @@ public class CompanyController extends BaseController {
@Autowired
CompanyServiceImpl
companyServiceImpl
;
@Autowired
(
required
=
false
)
CompanyMapper
companyMapper
;
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
/**
* 新增企业信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增企业信息表"
,
notes
=
"新增企业信息表"
)
public
ResponseModel
<
CompanyDto
>
save
(
@RequestBody
CompanyDto
model
)
{
...
...
@@ -50,7 +81,7 @@ public class CompanyController 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
<
CompanyDto
>
updateBySequenceNbrCompany
(
@RequestBody
CompanyDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
...
...
@@ -64,7 +95,7 @@ public class CompanyController 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
){
...
...
@@ -77,7 +108,7 @@ public class CompanyController 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
<
CompanyDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
...
...
@@ -91,7 +122,7 @@ public class CompanyController 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
<
CompanyDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
...
...
@@ -113,4 +144,104 @@ public class CompanyController extends BaseController {
public
ResponseModel
<
List
<
CompanyDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
queryForCompanyList
());
}
/**
* 修改企业信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
@PostMapping
(
value
=
"/modifyCompanyInfo"
)
public
ResponseModel
<
String
>
modifyCompanyInfo
(
@RequestBody
CompanyDto
company
)
throws
Exception
{
companyServiceImpl
.
updateById
(
company
.
getCompany
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 查看企业信息详情
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查看企业信息详情"
,
notes
=
"查看企业信息详情"
)
@GetMapping
(
value
=
"/getCompanyInfo"
)
public
ResponseModel
<
Company
>
getCompanyInfo
(
Company
companyList
)
{
// Company company;
// QueryWrapper<Company> lambdaQueryWrapper=new QueryWrapper<>();
// lambdaQueryWrapper.eq("name",companyList.getName());
// company= companyMapper.selectOne(lambdaQueryWrapper);
return
ResponseHelper
.
buildResponse
(
companyMapper
.
selectById
(
companyList
));
}
/**
* 企业审核
* 根据sequenceNbr更新,审核通过后的企业调用平台接口创建单位及管理员,并存业务的cb_org_usr表
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@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
();
final
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"
);
final
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
//创建平台用户
String
admin
=
company
.
getAdmin
();
String
adminPhone
=
company
.
getAdminPhone
();
agencyUserModel
.
setRealName
(
admin
);
agencyUserModel
.
setMobile
(
company
.
getContactPhone
());
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setMobile
(
adminPhone
);
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setUserName
(
admin
);
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
adminPhone
,
secretKey
));
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
adminPhone
,
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"
,
admin
);
jsonObject
.
put
(
"phone"
,
adminPhone
);
orgServiceImpl
.
dataHandling
(
jsonObject
,
OrgEnum
.
企业管理员
.
getKey
(),
null
);
}
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
updateById
(
company
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"test"
)
@ApiOperation
(
httpMethod
=
"Post"
,
value
=
"根据sequenceNbr更新,并创建单位及管理员"
,
notes
=
"根据sequenceNbr更新,并创建单位及管理员"
)
public
ResponseModel
<
OrgUsrDto
>
getInfo
(
@RequestBody
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/EquipmentController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
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.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
...
...
@@ -37,28 +42,28 @@ public class EquipmentController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增设备信息表"
,
notes
=
"新增设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
save
(
@RequestBody
EquipmentDto
model
)
{
model
=
equipmentServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增设备信息表"
,
notes
=
"新增设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
save
(
@RequestBody
EquipmentDto
model
)
{
model
=
equipmentServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备信息表"
,
notes
=
"根据sequenceNbr更新设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
updateBySequenceNbrEquipment
(
@RequestBody
EquipmentDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
updateWithModel
(
model
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备信息表"
,
notes
=
"根据sequenceNbr更新设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
updateBySequenceNbrEquipment
(
@RequestBody
EquipmentDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
updateWithModel
(
model
));
}
/**
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
...
...
@@ -67,50 +72,62 @@ public class EquipmentController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除设备信息表"
,
notes
=
"根据sequenceNbr删除设备信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备信息表"
,
notes
=
"根据sequenceNbr查询单个设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备信息表"
,
notes
=
"根据sequenceNbr查询单个设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<
EquipmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentPage
(
page
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<
EquipmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentPage
(
page
));
}
/**
* 列表全部数据查询
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表列表全部数据查询"
,
notes
=
"设备信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
EquipmentDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentList
());
}
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表列表全部数据查询"
,
notes
=
"设备信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
EquipmentDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentList
());
}
/**
* 设备数据名称查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备数据名称查询"
,
notes
=
"设备数据名称查询"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
(
@RequestParam
(
value
=
"unitId"
)
String
installationUnitId
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
selectName
(
installationUnitId
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice
;
import
org.apache.poi.ss.formula.functions.T
;
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.Date
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.InstallNoticeServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -28,89 +35,150 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
@RequestMapping
(
value
=
"/install-notice"
)
public
class
InstallNoticeController
extends
BaseController
{
@Autowired
InstallNoticeServiceImpl
installNoticeServiceImpl
;
@Autowired
InstallNoticeServiceImpl
installNoticeServiceImpl
;
/**
* 新增安装告知表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
/**
* 新增安装告知表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增安装告知表"
,
notes
=
"新增安装告知表"
)
public
ResponseModel
<
InstallNoticeDto
>
save
(
@RequestBody
InstallNoticeDto
model
)
{
model
=
installNoticeServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
model
=
installNoticeServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
* 根据sequenceNbr更新提交申请
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新安装告知表"
,
notes
=
"根据sequenceNbr更新安装告知表"
)
public
ResponseModel
<
InstallNoticeDto
>
updateBySequenceNbrInstallNotice
(
@RequestBody
InstallNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateWithModel
(
model
));
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新提交申请"
,
notes
=
"根据sequenceNbr更新提交申请"
)
public
ResponseModel
<
InstallNoticeDto
>
updateBySequenceNbrInstallNotice
(
@RequestBody
InstallNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setNoticeStatus
(
"已提交"
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除安装告知表"
,
notes
=
"根据sequenceNbr删除安装告知表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@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
)
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
/**
* 根据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
<
InstallNoticeDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryBySeq
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表分页查询"
,
notes
=
"安装告知表分页查询"
)
public
ResponseModel
<
Page
<
InstallNoticeDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
InstallNoticeDto
>
page
=
new
Page
<
InstallNoticeDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryForInstallNoticePage
(
page
));
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表分页查询"
,
notes
=
"安装告知表分页查询"
)
public
ResponseModel
<
Page
<
InstallNoticeDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
InstallNoticeDto
>
page
=
new
Page
<
InstallNoticeDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryForInstallNoticePage
(
page
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/installNoticePage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表分页查询"
,
notes
=
"安装告知表分页查询"
)
public
ResponseModel
<
Page
<
InstallNoticePageDto
>>
queryForPage1
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
InstallNoticePageDto
>
page
=
new
Page
<
InstallNoticePageDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
installNoticePage
(
page
));
}
/**
* 列表全部数据查询
*
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表列表全部数据查询"
,
notes
=
"安装告知表列表全部数据查询"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表列表全部数据查询"
,
notes
=
"安装告知表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
InstallNoticeDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryForInstallNoticeList
());
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
queryForInstallNoticeList
());
}
/**
* 查询安装告知申请列表
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/installApplyList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知表分页查询"
,
notes
=
"安装告知表分页查询"
)
public
ResponseModel
<
List
<
InstallNoticePageDto
>>
queryForPage1
()
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
installNoticeList
());
}
/**
* 根据项目名称和建设单位查询安装告知申请列表
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/installApplyListByNameUnit"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知申请表筛选"
,
notes
=
"安装告知申请表筛选"
)
public
ResponseModel
<
List
<
InstallNoticePageDto
>>
queryForPageByName
(
@RequestParam
(
value
=
"name"
)
String
name
,
@RequestParam
(
value
=
"unit"
)
String
unit
)
{
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
selectByName
(
name
,
unit
));
}
/**
* 根据主键sequenceNbr查询安装告知申请详情
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
""
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询安装告知申请详情"
,
notes
=
"查询安装告知申请详情"
)
public
ResponseModel
<
InstallNoticeDto
>
installNoticeinfoById
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PutMapping
(
value
=
"/change/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
InstallNoticeDto
>
updateInstallNotice
(
@RequestBody
InstallNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateWithModel
(
model
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallationQualityController.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.InstallationQualityImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WeldServiceImpl
;
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
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 质量问题闭环管理-安装质量监检信息-质量监检信息
*
* @author system_generator
* @date 2022-10-09
*/
@RestController
@Api
(
tags
=
"质量问题闭环管理-安装质量监检信息-质量监检信息Api"
)
@RequestMapping
(
value
=
"/install-quality"
)
public
class
InstallationQualityController
extends
BaseController
{
@Resource
private
InstallationQualityImpl
services
;
@Resource
private
WeldServiceImpl
weld
;
//查看质量监检信息
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/find"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"质量问题闭环管理-安装质量监检信息-质量监检信息"
,
notes
=
"质量问题闭环管理-安装质量监检信息-质量监检信息"
)
public
ResponseModel
<
Page
<
PercentOfPassDto
>>
find
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
PercentOfPassDto
percentOfPassDto
)
{
Page
<
PercentOfPassDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
services
.
find
(
page
,
percentOfPassDto
));
}
//通过projectId查询焊口信息
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectByProjectId/{projectId}"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"焊口信息"
,
notes
=
"焊口信息"
)
public
ResponseModel
<
List
<
WeldDto
>>
selectByProjectId
(
@PathVariable
(
"projectId"
)
Long
projectId
)
{
if
(
projectId
==
null
)
{
return
null
;
}
return
ResponseHelper
.
buildResponse
(
weld
.
getProjectId
(
projectId
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -113,4 +114,29 @@ public class MaterialController extends BaseController {
public
ResponseModel
<
List
<
MaterialDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
queryForMaterialList
());
}
// /**
// * 根据项目id查询材料信息
// *
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @ApiOperation(httpMethod = "GET",value = "根据项目id查询材料信息", notes = "根据项目id查询材料信息")
// @GetMapping(value = "/selectMess")
// public ResponseModel<MaterialDto> selectMess(@RequestParam String companyId ) {
// return ResponseHelper.buildResponse(materialServiceImpl.selectMess(companyId));
// }
/**
* 材料信息表列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表列表全部数据查询"
,
notes
=
"材料信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
(
@RequestParam
(
value
=
"unitId"
)
String
installationUnitId
)
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
selectName
(
installationUnitId
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
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
org.springframework.beans.BeanUtils
;
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.Date
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -30,6 +38,10 @@ public class ProjectController extends BaseController {
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
/**
* 新增项目信息表
...
...
@@ -40,7 +52,12 @@ public class ProjectController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增项目信息表"
,
notes
=
"新增项目信息表"
)
public
ResponseModel
<
ProjectDto
>
save
(
@RequestBody
ProjectDto
model
)
{
model
.
setStartDate
(
new
Date
());
model
.
setSubmitDate
(
new
Date
());
model
=
projectServiceImpl
.
createWithModel
(
model
);
Project
project
=
new
Project
();
BeanUtils
.
copyProperties
(
model
,
project
);
projectInitiationService
.
start
(
project
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -54,7 +71,8 @@ public class ProjectController extends BaseController {
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新项目信息表"
,
notes
=
"根据sequenceNbr更新项目信息表"
)
public
ResponseModel
<
ProjectDto
>
updateBySequenceNbrProject
(
@RequestBody
ProjectDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setRecDate
(
new
Date
());
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
updateWithModel
(
model
));
}
...
...
@@ -113,4 +131,36 @@ public class ProjectController extends BaseController {
public
ResponseModel
<
List
<
ProjectDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
queryForProjectList
());
}
/**
* 查询项目名称
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询项目名称"
,
notes
=
"查询项目名称"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
selectName
());
}
/**
* 获取下拉选择值
* @param type INSTALL("安装单位")、DESIGN("设计单位")、SUPERVISION(”监察单位“)、MONITORING(”监检机构“)
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询下拉选择框的值"
,
notes
=
"查询下拉选择框的值"
)
@GetMapping
(
value
=
"/getSelectInfo"
)
public
ResponseModel
<
List
<
OrgUsr
>>
getSelectInfo
(
String
type
){
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
getSelectInfo
(
type
));
}
/**
* 查询当前登录单位下的人员列表
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询下拉选择框的值"
,
notes
=
"查询下拉选择框的值"
)
@GetMapping
(
value
=
"/getCharge"
)
public
ResponseModel
<
List
<
OrgUsr
>>
getCharge
(){
return
ResponseHelper
.
buildResponse
(
orgServiceImpl
.
getCharge
());
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectInitiationController.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ResponseHeader
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@RestController
@Api
(
tags
=
"流程相关"
)
@RequestMapping
(
value
=
"/projectInitiation"
)
public
class
ProjectInitiationController
{
@Autowired
ProjectInitiationServiceImpl
projectInitiationServiceImpl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/start"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程启动"
,
notes
=
"流程启动"
)
public
ResponseModel
<
String
>
start
()
throws
Exception
{
projectInitiationServiceImpl
.
start
(
new
Project
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/execute/{instanceId}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程启动"
,
notes
=
"流程启动"
)
public
ResponseModel
<
String
>
execute
(
@PathVariable
(
"instanceId"
)
String
instanceId
,
Object
object
,
String
option
)
throws
Exception
{
projectInitiationServiceImpl
.
execute
(
instanceId
,
object
,
option
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectResourceController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
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
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -164,4 +166,16 @@ public class ProjectResourceController extends BaseController {
this
.
projectResourceServiceImpl
.
welderDelete
(
ids
);
return
ResponseHelper
.
buildResponse
(
true
);
}
/**
* 绑定设备跟项目
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"绑定设备跟项目"
,
notes
=
"绑定设备跟项目"
)
@PostMapping
(
value
=
"/saveId"
)
public
ResponseModel
<
ProjectResource
>
saveId
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
saveIds
(
jsonObject
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/QualityProblemController.java
View file @
a25eb268
...
...
@@ -21,7 +21,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
* 质量问题表
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
@RestController
@Api
(
tags
=
"质量问题表Api"
)
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WeldController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
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.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WeldServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
...
...
@@ -37,28 +43,28 @@ public class WeldController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增焊口信息表"
,
notes
=
"新增焊口信息表"
)
public
ResponseModel
<
WeldDto
>
save
(
@RequestBody
WeldDto
model
)
{
model
=
weldServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增焊口信息表"
,
notes
=
"新增焊口信息表"
)
public
ResponseModel
<
WeldDto
>
save
(
@RequestBody
WeldDto
model
)
{
model
=
weldServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新焊口信息表"
,
notes
=
"根据sequenceNbr更新焊口信息表"
)
public
ResponseModel
<
WeldDto
>
updateBySequenceNbrWeld
(
@RequestBody
WeldDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
updateWithModel
(
model
));
}
/**
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新焊口信息表"
,
notes
=
"根据sequenceNbr更新焊口信息表"
)
public
ResponseModel
<
WeldDto
>
updateBySequenceNbrWeld
(
@RequestBody
WeldDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
...
...
@@ -67,50 +73,62 @@ public class WeldController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除焊口信息表"
,
notes
=
"根据sequenceNbr删除焊口信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个焊口信息表"
,
notes
=
"根据sequenceNbr查询单个焊口信息表"
)
public
ResponseModel
<
WeldDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个焊口信息表"
,
notes
=
"根据sequenceNbr查询单个焊口信息表"
)
public
ResponseModel
<
WeldDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
+条件查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
WeldDto
>
page
=
new
Page
<
WeldDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
page
));
}
/**
* 列表全部数据查询
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
projectId
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
current
,
size
,
projectId
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表列表全部数据查询"
,
notes
=
"焊口信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
WeldDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldList
());
}
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表列表全部数据查询"
,
notes
=
"焊口信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
WeldDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldList
());
}
/**
* 生成焊口编码
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成焊口编码"
,
notes
=
"生成焊口编码"
)
@GetMapping
(
value
=
"/getCode"
)
public
ResponseModel
<
List
<
Weld
>>
getCode
(
Long
sequenceNbr
,
int
number
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
getCode
(
sequenceNbr
,
number
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WelderController.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
@Api
(
tags
=
"焊工信息"
)
@RequestMapping
(
value
=
"/welder"
)
public
class
WelderController
extends
BaseController
{
@Autowired
OrgServiceImpl
orgService
;
/**
* 新增焊工信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveWelder"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增焊工信息"
,
notes
=
"新增焊工信息"
)
public
ResponseModel
<
Object
>
saveWelder
(
@RequestParam
String
isWelder
,
@RequestBody
WelderDto
welderDto
)
{
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 获取焊工信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectWelder"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新增焊工信息"
,
notes
=
"新增焊工信息"
)
public
ResponseModel
<
List
<
Map
>>
selectWelder
(
@RequestParam
(
"unitId"
)
String
companyId
)
{
List
<
Map
>
info
=
orgService
.
getInfo
(
companyId
);
return
ResponseHelper
.
buildResponse
(
info
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WorkHistoryController.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.WorkHistory
;
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
org.apache.commons.lang3.StringUtils
;
import
java.util.Arrays
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WorkHistoryServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -85,21 +91,50 @@ public class WorkHistoryController extends BaseController {
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
* 列表分页查询
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊工工作履历表分页查询"
,
notes
=
"焊工工作履历表分页查询"
)
public
ResponseModel
<
Page
<
WorkHistoryDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
WorkHistoryDto
>
page
=
new
Page
<
WorkHistoryDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
workHistoryServiceImpl
.
queryForWorkHistoryPage
(
page
));
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
IPage
<
WorkHistory
>>
listPage
(
String
pageNum
,
String
pageSize
,
WorkHistory
tzUgpWorkHistory
){
Page
<
WorkHistory
>
pageBean
;
QueryWrapper
<
WorkHistory
>
tzUgpWorkHistoryQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
WorkHistory
>
aClass
=
tzUgpWorkHistory
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
tzUgpWorkHistory
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
tzUgpWorkHistory
);
tzUgpWorkHistoryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
tzUgpWorkHistory
);
tzUgpWorkHistoryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
tzUgpWorkHistory
);
tzUgpWorkHistoryQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
tzUgpWorkHistory
);
tzUgpWorkHistoryQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
WorkHistory
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
workHistoryServiceImpl
.
page
(
pageBean
,
tzUgpWorkHistoryQueryWrapper
);
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/CompanyServiceImpl.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
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.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
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
/**
* 企业信息表服务实现类
...
...
@@ -16,18 +26,28 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
CompanyServiceImpl
extends
BaseService
<
CompanyDto
,
Company
,
CompanyMapper
>
implements
ICompanyService
{
public
class
CompanyServiceImpl
extends
BaseService
<
CompanyDto
,
Company
,
CompanyMapper
>
implements
ICompanyService
{
@Autowired
CompanyMapper
companyMapper
;
/**
* 分页查询
*/
public
Page
<
CompanyDto
>
queryForCompanyPage
(
Page
<
CompanyDto
>
page
)
{
public
Page
<
CompanyDto
>
queryForCompanyPage
(
Page
<
CompanyDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
CompanyDto
>
queryForCompanyList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
CompanyDto
>
queryForCompanyList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Override
public
void
modifyCompanyInfo
(
Company
companyList
)
throws
Exception
{
}
}
\ 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/EquipmentServiceImpl.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.List
;
import
java.util.stream.Collectors
;
/**
* 设备信息表服务实现类
...
...
@@ -16,18 +22,44 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
EquipmentServiceImpl
extends
BaseService
<
EquipmentDto
,
Equipment
,
EquipmentMapper
>
implements
IEquipmentService
{
public
class
EquipmentServiceImpl
extends
BaseService
<
EquipmentDto
,
Equipment
,
EquipmentMapper
>
implements
IEquipmentService
{
@Autowired
EquipmentMapper
equipmentMapper
;
/**
* 分页查询
*/
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
)
{
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 设备数据名称查询
*
* @return
*/
public
List
<
JSONObject
>
selectName
(
String
installationUnitId
)
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//添加查询条件
QueryWrapper
<
Equipment
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"company_id"
,
installationUnitId
);
List
<
Equipment
>
equipment
=
equipmentMapper
.
selectList
(
wrapper
);
for
(
Equipment
i
:
equipment
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"SequenceNbr"
,
i
.
getSequenceNbr
());
names
.
add
(
name
);
}
return
names
;
}
}
\ 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 @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
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.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.RequestParam
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.sql.Wrapper
;
import
java.util.List
;
/**
...
...
@@ -16,7 +23,10 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
InstallNoticeServiceImpl
extends
BaseService
<
InstallNoticeDto
,
InstallNotice
,
InstallNoticeMapper
>
implements
IInstallNoticeService
{
public
class
InstallNoticeServiceImpl
extends
BaseService
<
InstallNoticeDto
,
InstallNotice
,
InstallNoticeMapper
>
implements
IInstallNoticeService
{
@Autowired
InstallNoticeMapper
installNoticeMapper
;
/**
* 分页查询
*/
...
...
@@ -30,4 +40,44 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public
List
<
InstallNoticeDto
>
queryForInstallNoticeList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 安装告知申请分页查询
*/
public
Page
<
InstallNoticePageDto
>
installNoticePage
(
Page
<
InstallNoticePageDto
>
page
)
{
return
installNoticeMapper
.
installNoticePage
(
page
);
}
/**
* 安装告知申请列表查询
*/
@Override
public
List
<
InstallNoticePageDto
>
installNoticeList
()
{
return
installNoticeMapper
.
installNoticeList
();
}
/**
* 安装告知申请列表按name,unit筛选
*/
@Override
public
List
<
InstallNoticePageDto
>
selectByName
(
String
name
,
String
unit
)
{
return
installNoticeMapper
.
selectByName
(
name
,
unit
);
}
/**
*通过sequenceNbr查列表数据
*/
@Override
public
InstallNoticePageDto
selectById
(
Long
sequenceNbr
)
{
return
installNoticeMapper
.
selectById
(
sequenceNbr
);
}
/**
* 根据sequenceNbr查询告知申请详情
* @param sequenceNbr
* @return
*/
public
InstallNoticeDto
selectOneById
(
Long
sequenceNbr
){
return
installNoticeMapper
.
selectoneById
(
sequenceNbr
);
}
}
\ 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/InstallationQualityImpl.java
0 → 100644
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.IInstallationQualityMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService
;
import
jdk.nashorn.internal.runtime.logging.Logger
;
import
lombok.extern.log4j.Log4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author cpp
* @Description
* @Date 2022/10/10
*/
@Service
public
class
InstallationQualityImpl
extends
BaseService
<
PercentOfPassDto
,
QualityInfo
,
IInstallationQualityMapper
>
implements
IInstallationQualityService
{
@Resource
private
IInstallationQualityMapper
mapper
;
@Resource
private
WeldServiceImpl
weldService
;
@Resource
private
OrgUsrServiceImpl
orgUsrService
;
//分页查询项目质量监检信息
@Override
public
Page
<
PercentOfPassDto
>
find
(
Page
<
PercentOfPassDto
>
page
,
PercentOfPassDto
pd
)
{
String
name
=
pd
.
getName
(
);
List
<
QualityInfo
>
qfList
=
mapper
.
findss
(
);
List
<
PercentOfPassDto
>
list
=
new
ArrayList
<>
(
);
for
(
QualityInfo
qualityInfo
:
qfList
)
{
PercentOfPassDto
percentOfPassDto
=
new
PercentOfPassDto
(
);
percentOfPassDto
.
setName
(
qualityInfo
.
getProject
(
).
getName
(
));
percentOfPassDto
.
setAddress
(
qualityInfo
.
getProject
(
).
getAddress
(
));
percentOfPassDto
.
setProgressStatus
(
qualityInfo
.
getProject
(
).
getProgressStatus
(
));
percentOfPassDto
.
setProjectId
(
qualityInfo
.
getProjectId
(
));
percentOfPassDto
.
setChargePerson
(
qualityInfo
.
getProject
(
).
getChargePerson
(
));
//获取监理单位的id
Long
supervisoryUnitId
=
qualityInfo
.
getSupervisoryUnitId
(
);
//调用接口
try
{
OrgUsrFormDto
orgUsrFormDto
=
orgUsrService
.
selectCompanyById
(
supervisoryUnitId
);
String
currentUnit
=
orgUsrFormDto
.
getCurrentUnit
(
);
percentOfPassDto
.
setCurrentUnit
(
currentUnit
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
}
percentOfPassDto
.
setStartDate
(
qualityInfo
.
getProject
(
).
getStartDate
(
));
percentOfPassDto
.
setConstructionUnit
(
qualityInfo
.
getProject
(
).
getConstructionUnit
(
));
percentOfPassDto
.
setSubmitDate
(
qualityInfo
.
getProject
(
).
getSubmitDate
(
));
list
.
add
(
percentOfPassDto
);
}
//创建新的集合来存放数据
List
<
PercentOfPassDto
>
newsData
=
new
ArrayList
<>
(
);
if
(
list
!=
null
&&
list
.
size
(
)
>
0
)
{
//遍历数据
for
(
PercentOfPassDto
pr
:
list
)
{
//获取项目id
Long
projectId
=
pr
.
getProjectId
(
);
//通过项目id查询焊口数据
List
<
WeldDto
>
weldDtoList
=
weldService
.
getProjectId
(
projectId
);
if
(
weldDtoList
!=
null
&&
weldDtoList
.
size
(
)
>
0
)
{
//获取焊口信息总条数
int
sum
=
weldDtoList
.
size
(
);
//焊口合格数
int
qualifiedData
=
0
;
for
(
WeldDto
weldDto
:
weldDtoList
)
{
String
superInspecStatus
=
weldDto
.
getSuperInspecStatus
(
);
if
(
superInspecStatus
.
equals
(
"合格"
))
{
qualifiedData
++;
}
}
//合格率
BigDecimal
sums
=
new
BigDecimal
(
sum
);
BigDecimal
qualifiedDatas
=
new
BigDecimal
(
qualifiedData
);
Double
pass
=
qualifiedDatas
.
divide
(
sums
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100
)).
doubleValue
(
);
//转换成百分比,生成合格率
String
fpy
=
pass
.
toString
(
)
+
"%"
;
//将合格率赋值给数据集合
pr
.
setPercentOfPass
(
fpy
);
//将数据添加到新集合里面
newsData
.
add
(
pr
);
}
}
//name不为空走条件筛选
if
(!
StringUtils
.
isEmpty
(
name
))
{
//进行数据筛选
List
<
PercentOfPassDto
>
collect
=
newsData
.
stream
(
).
filter
(
b
->
b
.
getName
(
).
equals
(
name
)).
collect
(
Collectors
.
toList
(
));
page
.
setRecords
(
collect
);
page
.
setTotal
(
collect
.
size
());
return
page
;
}
else
{
//如果条件name为空的,直接查询全部
page
.
setRecords
(
newsData
);
page
.
setTotal
(
newsData
.
size
());
return
page
;
}
}
return
null
;
}
}
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 @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
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.MaterialDto
;
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.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IMaterialService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
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.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -16,18 +21,40 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
MaterialServiceImpl
extends
BaseService
<
MaterialDto
,
Material
,
MaterialMapper
>
implements
IMaterialService
{
public
class
MaterialServiceImpl
extends
BaseService
<
MaterialDto
,
Material
,
MaterialMapper
>
implements
IMaterialService
{
/**
* 分页查询
*/
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
)
{
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
MaterialDto
>
queryForMaterialList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
MaterialDto
>
queryForMaterialList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 获取材料名称跟企业id
*/
public
List
<
JSONObject
>
selectName
(
String
installationUnitId
)
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//添加查询条件
QueryWrapper
<
Material
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"company_id"
,
installationUnitId
);
List
<
Material
>
materials
=
baseMapper
.
selectList
(
wrapper
);
for
(
Material
i
:
materials
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"SequenceNbr"
,
i
.
getSequenceNbr
());
names
.
add
(
name
);
}
return
names
;
}
}
\ 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
0 → 100644
View file @
a25eb268
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.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
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.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl
;
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.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
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
java.util.*
;
import
static
org
.
typroject
.
tyboot
.
component
.
cache
.
Redis
.
redisTemplate
;
@Service
public
class
OrgServiceImpl
{
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
@Autowired
DynamicFormColumnServiceImpl
dynamicFormColumnServiceImpl
;
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
@Autowired
private
RedisUtils
redisUtils
;
/**
* 保存或更新orgUsr信息和FormInstance实体信息
* sequenceNbr表示 若是更新动态表单,则传orgUsr表的sequenceNbr,
* 若是新增信息,传null
* @param jsonObject 表单数据
* @param bizOrgType 数据类型(企业、人员、部门)
* @param sequenceNbr 有值更新 ,没值保存
* @return
*/
public
OrgUsrDto
dataHandling
(
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
OrgUsr
orgUsr
=
saveOrgUsr
(
jsonObject
,
bizOrgType
,
sequenceNbr
);
//条件构造器 找出column表种 类型为(COMPANY 或 DEPARTMENT 或 PERSON)的列
LambdaQueryWrapper
<
DynamicFormColumn
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
DynamicFormColumn:
:
getGroupCode
,
bizOrgType
);
List
<
DynamicFormColumn
>
dynamicFormColumnList
=
dynamicFormColumnServiceImpl
.
list
(
wrapper
);
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
new
ArrayList
<>();
Map
<
String
,
Long
>
map
=
new
HashMap
<>();
for
(
DynamicFormColumn
dynamicFormColumn
:
dynamicFormColumnList
)
{
//将column表的基本字段信息给instance表
DynamicFormInstance
dynamicFormInstance
=
new
DynamicFormInstance
();
BeanUtils
.
copyProperties
(
dynamicFormColumn
,
dynamicFormInstance
);
dynamicFormInstance
.
setFormColumnId
(
dynamicFormColumn
.
getSequenceNbr
());
//通过字段名去拿到表单传来的值
dynamicFormInstance
.
setFieldValue
(
jsonObject
.
getString
(
dynamicFormInstance
.
getFieldCode
()));
dynamicFormInstance
.
setInstanceId
(
orgUsr
.
getSequenceNbr
());
dynamicFormInstance
.
setSequenceNbr
(
null
);
dynamicFormInstanceList
.
add
(
dynamicFormInstance
);
}
//如果sequenceNbr有值(更新)
if
(!
ValidationUtil
.
isEmpty
(
sequenceNbr
)){
LambdaQueryWrapper
<
DynamicFormInstance
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
DynamicFormInstance
::
getInstanceId
,
orgUsr
.
getSequenceNbr
());
List
<
DynamicFormInstance
>
instanceList
=
alertFormValueServiceImpl
.
list
(
lambdaQueryWrapper
);
//如果instance表中有值
if
(!
ValidationUtil
.
isEmpty
(
instanceList
)){
//将查到的instance信息装到map中
for
(
DynamicFormInstance
dynamicFormInstance:
instanceList
){
map
.
put
(
dynamicFormInstance
.
getFieldCode
(),
dynamicFormInstance
.
getSequenceNbr
());
}
//将查到的instance信息中的sequenceNbr装到更新之后的表中。
for
(
DynamicFormInstance
dynamicFormInstance:
dynamicFormInstanceList
){
dynamicFormInstance
.
setSequenceNbr
(
map
.
get
(
dynamicFormInstance
.
getFieldCode
()));
}
}
}
//保存或更新 根据sequenceNbr
alertFormValueServiceImpl
.
saveOrUpdateBatch
(
dynamicFormInstanceList
);
OrgUsrDto
orgUsrDto
=
new
OrgUsrDto
();
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrDto
);
orgUsrDto
.
setDynamicFormValue
(
dynamicFormInstanceList
);
return
orgUsrDto
;
}
/**
* 更新或保存orgUsr表信息
* @param jsonObject
* @param bizOrgType
* @return
*/
public
OrgUsr
saveOrgUsr
(
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
ReginParams
reginParams
=
getReginParams
();
OrgUsr
orgUsr
=
new
OrgUsr
();
if
(!
ValidationUtil
.
isEmpty
(
sequenceNbr
))
{
if
(!
ValidationUtil
.
isEmpty
(
orgUsrServiceImpl
.
getById
(
sequenceNbr
)))
{
orgUsr
=
orgUsrServiceImpl
.
getById
(
sequenceNbr
);
}
}
orgUsr
.
setRecDate
(
new
Date
());
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserId
(
user
.
getUserId
());
orgUsr
.
setBizOrgName
(
jsonObject
.
getString
(
"name"
));
orgUsr
.
setSequenceNbr
(
jsonObject
.
getLong
(
"sequenceNbr"
));
orgUsr
.
setBizOrgType
(
bizOrgType
);
if
(
OrgEnum
.
公司
.
getKey
().
equals
(
bizOrgType
)){
orgUsr
.
setOrgExpandAttr1
(
jsonObject
.
getString
(
"type"
));
orgUsr
.
setBizOrgCode
(
jsonObject
.
getString
(
"creditCode"
));
orgUsr
.
setAmosOrgId
(
jsonObject
.
getString
(
"amosOrgId"
));
orgUsr
.
setAmosOrgCode
(
jsonObject
.
getString
(
"amosOrgCode"
));
}
if
(
OrgEnum
.
人员
.
getKey
().
equals
(
bizOrgType
)){
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
))
{
orgUsr
.
setOrgExpandAttr1
(
OrgEnum
.
焊工
.
getKey
());
}
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
))
{
}
//设置bizOrgCode
if
(
orgUsr
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
orgUsrServiceImpl
.
getById
(
orgUsr
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
orgUsr
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
OrgUsrServiceImpl
.
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
OrgUsrServiceImpl
.
getOrgCodeStr
());
}
orgUsrServiceImpl
.
saveOrUpdate
(
orgUsr
);
return
orgUsr
;
}
/**
* 用户单位信息redis获取
**/
public
ReginParams
getReginParams
()
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
}
/**
* 获取企业下的焊工信息列表
* @param companyId 单位/企业id
* @return
*/
public
List
<
Map
>
getInfo
(
String
companyId
){
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
::
getOrgExpandAttr1
,
OrgEnum
.
焊工
.
getKey
());
List
<
OrgUsr
>
orgUsrList
=
orgUsrServiceImpl
.
list
(
welderWrapper
);
List
<
Map
>
mapList
=
new
ArrayList
<>();
for
(
OrgUsr
orgUsr
:
orgUsrList
)
{
Map
map
=
getdetialInfo
(
String
.
valueOf
(
orgUsr
.
getSequenceNbr
()));
mapList
.
add
(
map
);
}
return
mapList
;
}
/**
* 根据id查询详细信息
* @param sequenceNbr
* @return
*/
public
Map
getdetialInfo
(
String
sequenceNbr
){
Map
map
=
new
HashMap
();
LambdaQueryWrapper
<
DynamicFormInstance
>
instanceWrapper
=
new
LambdaQueryWrapper
<>();
instanceWrapper
.
eq
(
DynamicFormInstance
::
getInstanceId
,
sequenceNbr
);
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
alertFormValueServiceImpl
.
list
(
instanceWrapper
);
map
.
put
(
"sequenceNbr"
,
sequenceNbr
);
for
(
DynamicFormInstance
dynamicFormInstance
:
dynamicFormInstanceList
)
{
map
.
put
(
dynamicFormInstance
.
getFieldCode
(),
dynamicFormInstance
.
getFieldValue
());
}
return
map
;
}
/**
* 获取当前登陆人所在公司/单位/企业 下的 所有焊工人员
* @return
*/
public
List
<
Map
>
getCompanyWelder
(){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
getReginParams
().
getCompany
().
getSequenceNbr
()));
return
getInfo
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()));
}
/**
* 获取下拉选择值
* @param type INSTALL("安装单位")、DESIGN("设计单位")
* @return
*/
public
List
<
OrgUsr
>
getSelectInfo
(
String
type
){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getOrgExpandAttr1
,
type
);
return
orgUsrServiceImpl
.
list
(
wrapper
);
}
/**
* 查询当前登录单位下的人员列表
* @return
*/
public
List
<
OrgUsr
>
getCharge
(){
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
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
());
return
orgUsrServiceImpl
.
list
(
personWrapper
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
0 → 100644
View file @
a25eb268
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.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Util.CommonResponse
;
import
com.yeejoin.amos.boot.module.ugp.api.Util.HttpUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectInitiationDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg
;
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.entity.SuperviseRule
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectInitiationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.client.AgencyUserClient
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.rule.model.IdxProjectModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.client.TaskClient
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
@Service
public
class
ProjectInitiationServiceImpl
extends
BaseService
<
ProjectInitiationDto
,
ProjectInitiation
,
ProjectInitiationMapper
>
implements
IProjectInitiationService
{
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
WorkflowExcuteServiceImpl
workflowExcuteService
;
@Autowired
WorkflowFeignService
workflowFeignService
;
@Autowired
InstallNoticeMsgServiceImpl
installNoticeMsgService
;
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
SuperviseRuleServiceImpl
superviseRuleServiceImpl
;
@Autowired
ProjectServiceImpl
projectService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
private
static
String
SMSCODE
=
"SMS_UGP_0001"
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
start
(
Project
project
)
{
String
instanceId
=
null
;
//启动流程
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
processDefinitionKey
);
dto
.
setBusinessKey
(
"1"
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
projectInitiation
.
setTaskName
(
"流程启动!"
);
this
.
save
(
projectInitiation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"流程启动失败:"
+
e
.
getMessage
());
}
//新增project表的流程id和流程状态
project
.
setInstanceId
(
instanceId
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
projectService
.
updateById
(
project
);
//审核条件
String
option
=
"0"
;
if
(
true
)
{
option
=
"1"
;
}
//执行项目立项流程
execute
(
instanceId
,
project
,
option
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
execute
(
String
instanceId
,
Object
objectd
,
String
option
){
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
));
JSONObject
jsonObject
=
workflowFeignService
.
getTask
(
instanceId
);
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
projectInitiation
.
setContext
(
JSON
.
toJSONString
(
objectd
));
JSONObject
dataObject
=
jsonObject
.
getJSONObject
(
"data"
);
projectInitiation
.
setTaskId
(
dataObject
.
getString
(
"id"
));
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
));
if
(
ProjectInitiationEnum
.
平台审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
true
)
{
option
=
"1"
;
}
}
if
(
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
if
(
"1"
.
equals
(
option
)){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
}
}
if
(
ProjectInitiationEnum
.
接受审查意见
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
//设置短信发送的基本参数
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
());
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
(),
null
,
null
,
null
).
getResult
();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
SMSCODE
,
agencyUserModel
.
getMobile
(),
smsParams
);
InstallNoticeMsg
installNoticeMsg
=
new
InstallNoticeMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
installNoticeMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
installNoticeMsg
.
setInstallNoticeId
(
smsRecordModel
.
getSequenceNbr
());
installNoticeMsg
.
setTargetUnitId
(
Long
.
valueOf
(
smsRecordModel
.
getAgencyCode
()));
installNoticeMsg
.
setTargetPersonId
(
Long
.
valueOf
(
agencyUserModel
.
getUserId
()));
installNoticeMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
installNoticeMsgService
.
save
(
installNoticeMsg
);
}
}
}
if
(
"监检科室分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
if
(
"监检员分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
if
(
"监检员审核"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
try
{
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResult
(
option
);
dto
.
setResultCode
(
"condition"
);
dto
.
setTaskId
(
projectInitiation
.
getTaskId
());
HashMap
<
String
,
Object
>
var
=
new
HashMap
<>();
var
.
put
(
"condition"
,
option
);
dto
.
setVariable
(
var
);
//执行流程
Workflow
.
taskClient
.
completeByTask
(
projectInitiation
.
getTaskId
(),
dto
);
//保存日志
this
.
save
(
projectInitiation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新project种的status字段,表示当前流程下一个执行的任务
updateProjectFlowStatus
(
instanceId
);
}
}
@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
* @return
*/
public
String
getFlowTaskName
(
String
instanceId
){
JSONObject
jsonObject
=
workflowFeignService
.
getTask
(
instanceId
);
if
(
ValidationUtil
.
isEmpty
(
jsonObject
))
{
return
""
;
}
return
jsonObject
.
getJSONObject
(
"data"
).
getString
(
"name"
);
}
public
void
updateProjectFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
Project
project
=
projectService
.
getOne
(
wrapper
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
projectService
.
updateById
(
project
);
}
}
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 @
a25eb268
...
...
@@ -3,6 +3,10 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
...
...
@@ -13,14 +17,20 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.Map
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
.
ProjectResourceEnum
.*;
/**
* 项目资源表(包括焊工、管材、设备)服务实现类
...
...
@@ -40,15 +50,15 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
/**
* 分页查询
*/
public
Page
<
ProjectResourceDto
>
queryForProjectResourcePage
(
Page
<
ProjectResourceDto
>
page
)
{
public
Page
<
ProjectResourceDto
>
queryForProjectResourcePage
(
Page
<
ProjectResourceDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ProjectResourceDto
>
queryForProjectResourceList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
ProjectResourceDto
>
queryForProjectResourceList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Override
...
...
@@ -107,4 +117,37 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
this
.
projectResourceMapper
.
deleteById
(
item
.
getSequenceNbr
());
});
}
/**
* 存储项目设备关系
*/
public
ProjectResource
saveIds
(
JSONObject
jsonObject
)
{
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
ProjectResource
projectResource
=
new
ProjectResource
();
for
(
Object
json2
:
subForm
)
{
String
select
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"select"
);
// if (!jsonObject.getString("sequenceNbr").isEmpty()){
// jsonObject.getString("sequenceNbr");
// }
String
SequenceNbr
=
jsonObject
.
getString
(
"SequenceNbr"
);
String
type
=
jsonObject
.
getString
(
"type"
);
if
(
type
.
equals
(
设备资源
.
getStatus
()))
{
projectResource
.
setType
(
设备资源
.
getState
());
}
if
(
type
.
equals
(
焊工资源
.
getStatus
()))
{
projectResource
.
setType
(
焊工资源
.
getState
());
}
if
(
type
.
equals
(
管材资源
.
getStatus
()))
{
projectResource
.
setType
(
管材资源
.
getState
());
}
projectResource
.
setProjectId
(
Long
.
valueOf
(
SequenceNbr
));
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
this
.
save
(
projectResource
);
}
return
projectResource
;
}
}
\ 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/ProjectServiceImpl.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
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.service.IProjectService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -16,18 +20,38 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
ProjectServiceImpl
extends
BaseService
<
ProjectDto
,
Project
,
ProjectMapper
>
implements
IProjectService
{
public
class
ProjectServiceImpl
extends
BaseService
<
ProjectDto
,
Project
,
ProjectMapper
>
implements
IProjectService
{
@Autowired
ProjectMapper
projectMapper
;
/**
* 分页查询
*/
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
)
{
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ProjectDto
>
queryForProjectList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
ProjectDto
>
queryForProjectList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 查询项目名称
*/
public
List
<
JSONObject
>
selectName
()
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//查询所有项目
List
<
Project
>
projects
=
projectMapper
.
selectList
(
null
);
for
(
Project
i
:
projects
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"sequenceNbr"
,
i
.
getSequenceNbr
());
names
.
add
(
name
);
}
return
names
;
}
}
\ 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/QualityProblemServiceImpl.java
View file @
a25eb268
...
...
@@ -13,7 +13,7 @@ import java.util.List;
* 质量问题表服务实现类
*
* @author system_generator
* @date 2022-09-2
2
* @date 2022-09-2
9
*/
@Service
public
class
QualityProblemServiceImpl
extends
BaseService
<
QualityProblemDto
,
QualityProblem
,
QualityProblemMapper
>
implements
IQualityProblemService
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
View file @
a25eb268
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IWeldService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
/**
* 焊口信息表服务实现类
...
...
@@ -16,18 +27,113 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
WeldServiceImpl
extends
BaseService
<
WeldDto
,
Weld
,
WeldMapper
>
implements
IWeldService
{
public
class
WeldServiceImpl
extends
BaseService
<
WeldDto
,
Weld
,
WeldMapper
>
implements
IWeldService
{
@Autowired
WeldMapper
weldMapper
;
@Autowired
ProjectMapper
projectMapper
;
// Logger logger = LoggerFactory.getLogger(WeldServiceImpl.class);
/**
* 分页查询
*/
public
Page
<
WeldDto
>
queryForWeldPage
(
Page
<
WeldDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
Page
<
WeldDto
>
queryForWeldPage
(
int
current
,
int
size
,
String
projectId
)
{
Page
<
WeldDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
Page
<
WeldDto
>
weldDtoPage
=
this
.
queryForPage
(
page
,
null
,
false
);
for
(
WeldDto
weldDto
:
weldDtoPage
.
getRecords
())
{
QueryWrapper
<
Project
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"sequence_nbr"
,
weldDto
.
getProjectId
());
Project
project
=
projectMapper
.
selectOne
(
wrapper
);
weldDto
.
setName
(
project
.
getName
());
QueryWrapper
<
Project
>
wrapperUnit
=
new
QueryWrapper
<>();
wrapperUnit
.
eq
(
"installation_unit_id"
,
weldDto
.
getInstallCompany
());
List
<
Project
>
projects
=
projectMapper
.
selectList
(
wrapperUnit
);
for
(
Project
project1
:
projects
)
{
weldDto
.
setInstallationUnit
(
project1
.
getInstallationUnit
());
weldDto
.
setCodingStatus
(
WeldCodeEnum
.
map
.
get
(
weldDto
.
getCodingStatus
()));
weldDto
.
setCodingMethod
(
WeldMethodEnum
.
map
.
get
(
weldDto
.
getCodingMethod
()));
}
}
//如果不为空则过滤
if
(
projectId
!=
null
)
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getProjectId
().
equals
(
projectId
)).
collect
(
Collectors
.
toList
());
weldDtoPage
.
setRecords
(
L
);
}
return
weldDtoPage
;
}
/**
* 列表查询 示例
*/
public
List
<
WeldDto
>
queryForWeldList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
WeldDto
>
queryForWeldList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 生成焊口编号保存并查询
*/
// 静态变量存储最大值
private
static
final
AtomicInteger
atomicNum
=
new
AtomicInteger
();
// 初始化编号
private
final
int
INIT_CODE_NUM
=
0
;
private
final
String
FIRST_CHARACTER
=
"-HK"
;
public
synchronized
List
<
Weld
>
getCode
(
Long
sequenceNbr
,
int
number
)
{
List
<
Weld
>
welds
=
new
ArrayList
<>();
Project
project
=
projectMapper
.
selectById
(
sequenceNbr
);
QueryWrapper
<
Weld
>
wrapper
=
new
QueryWrapper
<>();
//根据seq查询条件判断是否已经存在该项目的该焊口编码
wrapper
.
eq
(
"project_id"
,
sequenceNbr
).
orderByDesc
(
"code"
).
last
(
"limit 1"
);
Weld
weld1
=
weldMapper
.
selectOne
(
wrapper
);
if
(
weld1
!=
null
)
{
//存在时取后四位
String
substring
=
weld1
.
getCode
().
substring
(
weld1
.
getCode
().
length
()
-
4
,
weld1
.
getCode
().
length
());
atomicNum
.
set
(
Integer
.
parseInt
(
substring
));
}
else
{
//不存在时将atomicNum初始化
atomicNum
.
set
(
INIT_CODE_NUM
);
}
for
(
int
i
=
0
;
i
<
number
;
i
++)
{
Weld
weld
=
new
Weld
();
//生成四位数
String
i1
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
//生成编码
String
code
=
(
project
.
getCode
())
+
FIRST_CHARACTER
+
i1
;
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setProjectId
(
Long
.
valueOf
(
project
.
getSequenceNbr
()));
weld
.
setInstallCompany
(
project
.
getInstallationUnitId
());
weld
.
setCode
(
code
);
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setCodingMethod
(
WeldMethodEnum
.
赋码方式
1
.
getState
());
weld
.
setCodingStatus
(
WeldCodeEnum
.
赋值状态
2
.
getState
());
weld
.
setCodingDate
(
new
Date
());
welds
.
add
(
weld
);
}
saveBatch
(
welds
);
return
welds
;
}
/**
* 通过项目多个id获取数据
* @param projectId
* @return
*/
public
List
<
WeldDto
>
getProjectId
(
Long
projectId
){
return
weldMapper
.
select
(
projectId
);
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/resources/application-dev.properties
View file @
a25eb268
...
...
@@ -4,19 +4,32 @@ spring.datasource.url=jdbc:mysql://39.98.45.134:3306/tzs_amos_ugp_biz?allowMulti
&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle
=
5
spring.datasource.hikari.maximum-pool-size
=
15
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
30000
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
##eureka properties:
eureka.client.registry-fetch-interval-seconds
=
5
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.lease-renewal-interval-in-seconds
=
5
eureka.client.service-url.defaultZone
=
http://39.98.45.134:10001/eureka/
eureka.instance.health-check-url
=
http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url
=
http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://172.16.3.89:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
eureka.instance.health-check-url
=
http://39.98.45.134:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url
=
http://39.98.45.134:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://39.98.45.134:${server.port}${server.servlet.context-path}/swagger-ui.html
#redis properties:
spring.redis.database
=
1
#spring.redis.host=39.98.45.134
spring.redis.host
=
39.98.45.134
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/resources/application.properties
View file @
a25eb268
...
...
@@ -7,40 +7,18 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
logging.config
=
classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.stdout.StdOutImpl
redis.cache.failure.time
=
10800
##liquibase
spring.liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled
=
true
## DB properties:
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle
=
10
spring.datasource.hikari.maximum-pool-size
=
25
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
30000
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
120000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
## eureka properties:
eureka.client.registry-fetch-interval-seconds
=
5
eureka.instance.prefer-ip-address
=
true
management.endpoint.health.show-details
=
always
management.endpoints.web.exposure.include
=
*
eureka.instance.health-check-url-path
=
/actuator/health
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.lease-renewal-interval-in-seconds
=
5
eureka.instance.metadata-map.management.context-path
=
${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path
=
/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/doc.html
## redis properties:
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
redis.cache.failure.time
=
10800
## emqx properties:
emqx.clean-session
=
true
...
...
@@ -51,4 +29,7 @@ emqx.password=123456
fire-rescue
=
123
params.work.flow.processDefinitionKey
=
xiangmulixiangliucheng
amos.secret.key
=
ugp
#
logging.level.com.yeejoin.amos
=
error
\ No newline at end of file
amos-boot-system-ugp/pom.xml
View file @
a25eb268
...
...
@@ -19,6 +19,11 @@
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-workflow
</artifactId>
<version>
1.7.9-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
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