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
1989cf33
Commit
1989cf33
authored
Mar 09, 2023
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目立项流程,项目新增接口及相关接口调整
parent
e39b8d01
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
494 additions
and
209 deletions
+494
-209
ProjectInitiationEnum.java
.../amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
+15
-13
PipeDto.java
...ava/com/yeejoin/amos/boot/module/ugp/api/dto/PipeDto.java
+3
-0
ProjectDto.java
.../com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
+58
-0
Project.java
.../com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
+66
-0
IProcessRelationService.java
.../boot/module/ugp/api/service/IProcessRelationService.java
+2
-2
IProjectInitiationService.java
...oot/module/ugp/api/service/IProjectInitiationService.java
+1
-1
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+12
-0
InstallNoticeController.java
...ot/module/ugp/biz/controller/InstallNoticeController.java
+3
-3
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+7
-85
ProjectInitiationController.java
...odule/ugp/biz/controller/ProjectInitiationController.java
+11
-5
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+21
-2
IPipeServiceImpl.java
...os/boot/module/ugp/biz/service/impl/IPipeServiceImpl.java
+2
-1
InstallNoticeServiceImpl.java
...module/ugp/biz/service/impl/InstallNoticeServiceImpl.java
+1
-1
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+13
-5
ProcessRelationServiceImpl.java
...dule/ugp/biz/service/impl/ProcessRelationServiceImpl.java
+10
-3
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+142
-60
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+126
-28
QualityProblemServiceImpl.java
...odule/ugp/biz/service/impl/QualityProblemServiceImpl.java
+1
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
View file @
1989cf33
...
...
@@ -10,19 +10,21 @@ import java.util.Map;
@AllArgsConstructor
public
enum
ProjectInitiationEnum
{
项目立项
(
"1"
,
"项目立项"
,
"XMLX"
,
"被驳回,请重新申请"
,
""
,
""
),
平台审核
(
"2"
,
"平台审核"
,
"PTSH"
,
"项目待平台审核"
,
"审核项目"
,
"待审核"
),
告知申请
(
"3"
,
"告知申请"
,
"GZSQ"
,
"告知待申请"
,
"告知申请"
,
"待申请"
),
接受告知
(
"4"
,
"接受告知"
,
"JSGZ"
,
"告知待接收"
,
"告知接收"
,
"待接收"
),
审查项目
(
"5"
,
"审查项目"
,
"SCXM"
,
"告知待审查"
,
"项目告知审查"
,
"待审查"
),
提交资料
(
"6"
,
"提交资料"
,
"TJZL"
,
"项目资料待提交"
,
"项目资料提交"
,
"待提交"
),
审批人审批
(
"7"
,
"审批人审批"
,
"SPRSP"
,
"项目资料待审批"
,
"项目资料审批"
,
"待审批"
),
审核人审核
(
"8"
,
"审核人审核"
,
"SHRSH"
,
"项目资料待审核"
,
"项目资料审核"
,
"待审核"
),
监检科室分配
(
"9"
,
"监检科室分配"
,
"JJKSFP"
,
"监检科室待分配"
,
"监检科室分配"
,
"待分配"
),
监检员分配
(
"10"
,
"监检员分配"
,
"JJYFP"
,
"监检员待分配"
,
"监检员分配"
,
"待分配"
),
监检员审核
(
"11"
,
"监检员审核"
,
"JJYSH"
,
"监检员待审核"
,
"监检员审核"
,
"待审核"
),
项目关闭
(
"12"
,
"项目关闭"
,
"XMGB"
,
""
,
""
,
""
),
接受审查意见
(
"13"
,
"接受审查意见"
,
"JSSCYJ"
,
"审查意见待接受"
,
"接受审查意见"
,
"待接受"
),
流程结束
(
"14"
,
"流程结束!"
,
"LCJS"
,
""
,
""
,
""
);
设计开工资料提交
(
"2"
,
"开工资料提交(设计)"
,
"SJZLTJ"
,
"设计资料待提交"
,
"提交资料"
,
"待提交"
),
安装开工资料提交
(
"3"
,
"开工资料提交(安装)"
,
"AZZLTJ"
,
"安装资料待提交"
,
"提交资料"
,
"待提交"
),
告知申请
(
"4"
,
"告知申请"
,
"GZSQ"
,
"告知待申请"
,
"告知申请"
,
"待申请"
),
接受告知
(
"5"
,
"接受告知"
,
"JSGZ"
,
"告知待接收"
,
"告知接收"
,
"待接收"
),
//设计和安装合并使用。
提交资料
(
"6"
,
"提交资料"
,
"TJZL"
,
"项目资料待提交"
,
"提交资料"
,
"待提交"
),
监检科室分配
(
"6"
,
"监检科室分配"
,
"JJKSFP"
,
"监检科室待分配"
,
"监检科室分配"
,
"待分配"
),
监检员分配
(
"7"
,
"监检员分配"
,
"JJYFP"
,
"监检员待分配"
,
"监检员分配"
,
"待分配"
),
监检员审核
(
"8"
,
"监检员审核"
,
"JJYSH"
,
"监检员待审核"
,
"监检员审核"
,
"待审核"
),
设计开工资料修改
(
"9"
,
"开工资料修改(设计)"
,
"SJZLXG"
,
"设计资料待修改"
,
"设计修改资料"
,
"待修改"
),
安装开工资料修改
(
"10"
,
"开工资料修改(安装)"
,
"AZZLXG"
,
"安装资料待修改"
,
"安装修改资料"
,
"待修改"
),
// 设计和安装都需要修改时合并使用
修改资料
(
""
,
"资料修改"
,
""
,
"资料待修改"
,
"修改资料"
,
"待修改"
),
流程结束
(
"11"
,
"流程结束!"
,
"LCJS"
,
""
,
""
,
""
);
private
String
status
;
private
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/PipeDto.java
View file @
1989cf33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -59,4 +60,6 @@ public class PipeDto extends BaseDto {
@ApiModelProperty
(
value
=
"终点名称"
)
private
String
endName
;
private
JSONObject
startPositionObject
;
private
JSONObject
endPositionObject
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
View file @
1989cf33
...
...
@@ -93,6 +93,64 @@ public class ProjectDto extends BaseDto {
private
String
remark
;
/**
* 安装单位联系人id
*/
private
Long
installUnitChargerId
;
/**
* 安装单位联系人
*/
private
String
installUnitCharger
;
/**
* 无损检测单位id
*/
private
Long
testingUnitId
;
/**
* 无损检测单位
*/
private
String
testingUnit
;
/**
* 监理单位id
*/
private
Long
supervisionUnitId
;
/**
* 监理单位
*/
private
String
supervisionUnit
;
/**
* 设计压力
*/
private
String
designPressure
;
/**
* 输送介质
*/
private
String
conveyingMedium
;
/**
* 工程规模
*/
private
String
projectScale
;
/**
* 竣工预计日期
*/
private
Date
completionEstimate
;
/**
* 压力管道级别
*/
private
String
pressureLevel
;
private
List
<
PipeDto
>
pipeSubForm
;
/**
* 监检部门
*/
private
String
inspectionUnit
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Project.java
View file @
1989cf33
...
...
@@ -160,4 +160,70 @@ public class Project extends BaseEntity {
*/
@TableField
(
"credit_code"
)
private
String
creditCode
;
/**
* 安装单位联系人id
*/
@TableField
(
"install_unit_charger_id"
)
private
Long
installUnitChargerId
;
/**
* 安装单位联系人
*/
@TableField
(
"install_unit_charger"
)
private
String
installUnitCharger
;
/**
* 无损检测单位id
*/
@TableField
(
"testing_unit_id"
)
private
Long
testingUnitId
;
/**
* 无损检测单位
*/
@TableField
(
"testing_unit"
)
private
String
testingUnit
;
/**
* 监理单位id
*/
@TableField
(
"supervision_unit_id"
)
private
Long
supervisionUnitId
;
/**
* 监理单位
*/
@TableField
(
"supervision_unit"
)
private
String
supervisionUnit
;
/**
* 设计压力
*/
@TableField
(
"design_pressure"
)
private
String
designPressure
;
/**
* 输送介质
*/
@TableField
(
"conveying_medium"
)
private
String
conveyingMedium
;
/**
* 工程规模
*/
@TableField
(
"project_scale"
)
private
String
projectScale
;
/**
* 竣工预计日期
*/
@TableField
(
"completion_estimate"
)
private
Date
completionEstimate
;
/**
* 压力管道级别
*/
@TableField
(
"pressure_level"
)
private
String
pressureLevel
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProcessRelationService.java
View file @
1989cf33
...
...
@@ -7,7 +7,7 @@ public interface IProcessRelationService {
*
* @param instanceId 流程实例id
* @param sourceId 资源id
* @param processName 流程名称(文字)
* @param processName 流程名称(文字)
eg:ProcessTypeEnum.项目立项.getName()
*/
void
savePR
(
String
instanceId
,
Long
sourceId
,
String
processName
);
...
...
@@ -16,5 +16,5 @@ public interface IProcessRelationService {
*
* @param instanceId 流程实例id
*/
void
updateState
(
String
instanceId
);
void
updateState
(
String
instanceId
,
String
taskName
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProjectInitiationService.java
View file @
1989cf33
...
...
@@ -16,7 +16,7 @@ public interface IProjectInitiationService {
/**
* 执行流程节点,并记录日志
*/
void
execute
(
String
instanceId
,
Object
object
,
String
option
);
void
execute
(
String
instanceId
,
Object
object
,
String
condition
,
String
option
);
/**
* 竣工结项流程启动
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
1989cf33
...
...
@@ -594,5 +594,17 @@ public class CompanyController extends BaseController {
ReginParams
reginParams
=
orgServiceImpl
.
getReginParams
();
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
getById
(
reginParams
.
getBusinessInfo
().
getCompanySequenceNbr
()));
}
/**
* 根据unitId获取单位的许可信息
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/unitLicenseCode/resource"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据unitId获取单位的许可信息"
,
notes
=
"根据unitId获取单位的许可信息"
)
@BusinessIdentify
public
ResponseModel
<
JSONObject
>
getUnitLicenseCode
(
Long
unitId
){
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
getUnitLicenseCode
(
unitId
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
View file @
1989cf33
...
...
@@ -184,7 +184,7 @@ public class InstallNoticeController extends BaseController {
if
(
model
.
getNoticeStatus
().
equals
(
"已保存"
)){
model
.
setNoticeStatus
(
"已提交"
);
installNoticeServiceImpl
.
updateWithModel
(
model
);
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
model
,
"1"
);
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
model
,
"1"
,
null
);
}
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -299,7 +299,7 @@ public class InstallNoticeController extends BaseController {
Project
project
=
projectServiceImpl
.
getById
(
installNotice
.
getProjectId
());
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installNotice
));
json
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"告知待审核"
);
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
json
,
NoticeStatusEnum
.
已接收
.
getStatusId
());
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
json
,
NoticeStatusEnum
.
已接收
.
getStatusId
()
,
null
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateById
(
installNotice
));
}
...
...
@@ -320,7 +320,7 @@ public class InstallNoticeController extends BaseController {
installNotice
.
setNoticeStatus
(
NoticeStatusEnum
.
已退回
.
getName
());
}
Project
project
=
projectServiceImpl
.
getById
(
installNotice
.
getProjectId
());
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
installNotice
,
option
);
projectInitiationServiceImpl
.
execute
(
project
.
getInstanceId
(),
installNotice
,
option
,
null
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateById
(
installNotice
));
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
1989cf33
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
...
...
@@ -91,87 +92,8 @@ public class ProjectController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增项目信息表"
,
notes
=
"新增项目信息表"
)
@BusinessIdentify
public
ResponseModel
<
ProjectDto
>
save
(
@RequestBody
ProjectDto
model
)
{
System
.
out
.
println
(
"项目立项开始:"
+
DateUtils
.
date2LongStr
(
new
Date
()));
String
regionName
=
""
,
regionCode
=
""
;
Map
<
String
,
String
>
map
=
getInfo
(
regionName
,
regionCode
,
Long
.
valueOf
(
model
.
getInstallRegionCode
()));
model
.
setSubmitDate
(
new
Date
());
model
.
setInstallationUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getInstallationUnitId
())).
getBizOrgName
());
model
.
setDesignUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getDesignUnitId
())).
getBizOrgName
());
model
.
setConstructionUnitId
(
orgServiceImpl
.
getReginParams
().
getBusinessInfo
().
getCompanySequenceNbr
());
model
.
setChargePerson
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getChargePersonId
())).
getBizOrgName
());
model
.
setInstallRegion
(
map
.
get
(
"regionName"
));
model
.
setInstallRegionCode
(
map
.
get
(
"regionCode"
));
model
.
setCode
(
getCode
());
model
=
projectServiceImpl
.
createWithModel
(
model
);
Project
project
=
new
Project
();
BeanUtils
.
copyProperties
(
model
,
project
);
System
.
out
.
println
(
"项目立项保存信息结束:"
+
DateUtils
.
date2LongStr
(
new
Date
()));
String
token
=
RequestContext
.
getToken
();
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
//分支线程执行流程
Thread
t1
=
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
RequestContext
.
setToken
(
token
);
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
projectInitiationService
.
start
(
project
);
}
});
t1
.
start
();
return
ResponseHelper
.
buildResponse
(
model
);
}
// 静态变量存储最大值
private
static
final
AtomicInteger
atomicNum
=
new
AtomicInteger
();
private
static
final
Integer
INIT_CODE_NUM
=
0
;
public
String
getCode
(){
String
date
=
new
SimpleDateFormat
(
"yyyy"
).
format
(
new
Date
());
String
code
=
"XM"
+
date
+
"-"
;
String
format
=
""
;
String
projectCode
=
""
;
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
orderByDesc
(
Project:
:
getCode
);
List
<
Project
>
list
=
projectServiceImpl
.
list
(
wrapper
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
projectCode
=
list
.
iterator
().
next
().
getCode
();
if
(!
ValidationUtil
.
isEmpty
(
projectCode
)){
String
proDate
=
projectCode
.
substring
(
projectCode
.
indexOf
(
"M"
)+
1
,
projectCode
.
length
()
-
5
);
if
(
proDate
.
equals
(
date
)){
String
substring
=
projectCode
.
substring
(
projectCode
.
length
()
-
4
);
atomicNum
.
set
(
Integer
.
parseInt
(
substring
));
}
else
{
atomicNum
.
set
(
INIT_CODE_NUM
);
}
format
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
}
}
else
{
format
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
}
return
code
+
format
;
}
public
Map
<
String
,
String
>
getInfo
(
String
regionName
,
String
regionCode
,
Long
sequenceNbr
){
RegionModel
region
=
Systemctl
.
regionClient
.
getRegion
(
sequenceNbr
).
getResult
();
regionName
=
region
.
getRegionName
()
+
regionName
;
if
(
ValidationUtil
.
isEmpty
(
regionCode
)){
regionCode
=
String
.
valueOf
(
region
.
getRegionCode
());
}
else
{
regionCode
=
region
.
getRegionCode
()
+
"#"
+
regionCode
;
}
Map
<
String
,
String
>
map
=
new
HashMap
();
if
(
region
.
getParentId
()
!=
0L
){
map
=
getInfo
(
regionName
,
regionCode
,
region
.
getParentId
());
}
else
{
map
.
put
(
"regionName"
,
regionName
);
}
map
.
put
(
"regionCode"
,
regionCode
);
return
map
;
public
ResponseModel
<
ProjectDto
>
save
(
@RequestBody
ProjectDto
model
,
String
submitType
)
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
saveProjectInfo
(
model
,
submitType
));
}
/**
...
...
@@ -374,7 +296,7 @@ public class ProjectController extends BaseController {
if
(
ValidationUtil
.
isEmpty
(
option
)){
option
=
"1"
;
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
...
...
@@ -394,12 +316,12 @@ public class ProjectController extends BaseController {
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"立项成功"
);
if
(
"0"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"项目退回"
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
}
else
if
(
"2"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"项目需重新提交资料"
);
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectInitiationController.java
View file @
1989cf33
...
...
@@ -25,15 +25,21 @@ public class ProjectInitiationController {
@GetMapping
(
value
=
"/start"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程启动"
,
notes
=
"流程启动"
)
public
ResponseModel
<
String
>
start
()
throws
Exception
{
projectInitiationServiceImpl
.
start
(
new
Project
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
projectInitiationServiceImpl
.
startTest
(
new
Project
()));
}
@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"
);
public
ResponseModel
<
String
>
execute
(
@PathVariable
(
"instanceId"
)
String
instanceId
,
String
condition
,
String
option
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
projectInitiationServiceImpl
.
executeTest
(
instanceId
,
condition
,
option
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/getTaskList/{instanceId}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程启动"
,
notes
=
"流程启动"
)
public
ResponseModel
<
String
>
getTaskList
(
@PathVariable
(
"instanceId"
)
String
instanceId
)
throws
Exception
{
projectInitiationServiceImpl
.
getTaskList
(
instanceId
);
return
ResponseHelper
.
buildResponse
(
""
);
}
}
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 @
1989cf33
...
...
@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -380,8 +381,26 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
return
model
;
}
public
void
getRegionTree
(
Collection
col
){
public
JSONObject
getUnitLicenseCode
(
Long
unitId
)
{
UnitLicence
unitLicence
=
new
UnitLicence
();
Company
company
=
companyServiceImpl
.
getById
(
unitId
);
String
creditCode
=
company
.
getCreditCode
();
LambdaQueryWrapper
<
UnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
UnitLicence:
:
getUnitCode
,
creditCode
);
List
<
UnitLicence
>
list
=
unitLicenceService
.
list
(
wrapper
);
Iterator
<
UnitLicence
>
iterator
=
list
.
iterator
();
String
licenseCode
=
""
;
while
(
iterator
.
hasNext
())
{
unitLicence
=
iterator
.
next
();
if
(
ValidationUtil
.
isEmpty
(
licenseCode
)){
licenseCode
=
unitLicence
.
getCertNo
();
}
else
{
licenseCode
=
licenseCode
+
","
+
unitLicence
.
getCertNo
();
}
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"licenseCode"
,
licenseCode
);
return
jsonObject
;
}
public
void
syncCompany
(
Object
object
)
throws
Exception
{
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/IPipeServiceImpl.java
View file @
1989cf33
...
...
@@ -34,11 +34,12 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp
lambda
.
eq
(
Pipe:
:
getProjectId
,
projectId
);
pipeMapper
.
delete
(
lambda
);
userList
.
forEach
(
item
->
{
item
.
setStartPosition
(
item
.
getStartPositionObject
().
getString
(
"latitude"
)+
","
+
item
.
getStartPositionObject
().
getString
(
"longitude"
));
item
.
setEndPosition
(
item
.
getEndPositionObject
().
getString
(
"latitude"
)+
","
+
item
.
getEndPositionObject
().
getString
(
"longitude"
));
item
.
setProjectId
(
projectId
);
this
.
createWithModel
(
item
);
});
}
}
@Override
...
...
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 @
1989cf33
...
...
@@ -159,7 +159,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
this
.
saveOrUpdate
(
installNotice
);
if
(
NoticeStatusEnum
.
已提交
.
getName
().
equals
(
noticeStatus
)){
projectInitiationServiceImpl
.
execute
(
projectDto
.
getInstanceId
(),
installNoticeDto
,
"1"
);
projectInitiationServiceImpl
.
execute
(
projectDto
.
getInstanceId
(),
installNoticeDto
,
"1"
,
null
);
}
return
installNoticeDto
;
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
View file @
1989cf33
...
...
@@ -97,7 +97,11 @@ public class ProblemInitiationServiceImpl {
System
.
out
.
println
(
"流程启动失败:"
+
e
.
getMessage
());
}
qualityProblem
.
setInstanceId
(
instanceId
);
try
{
qualityProblem
.
setStatus
(
projectInitiationService
.
getFlowTaskName
(
instanceId
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
qualityProblem
.
setProcessProgress
(
ProblemProcessEnum
.
statusMap
.
get
(
qualityProblem
.
getStatus
()));
qualityProblemService
.
updateById
(
qualityProblem
);
sendSms
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
qualityProblem
)),
SMSEnum
.
质量问题短信
.
getCode
());
...
...
@@ -150,10 +154,7 @@ public class ProblemInitiationServiceImpl {
Workflow
.
taskClient
.
completeByTask
(
projectInitiation
.
getTaskId
(),
dto
);
//保存日志
projectInitiationService
.
save
(
projectInitiation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新任务表的状态 已办
taskType
=
getUnitId
(
unitIds
,
objectd
);
taskService
.
saveOrUpdateTask
(
objectd
.
getStatus
(),
true
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
质量问题
.
getKey
(),
unitIds
,
null
);
...
...
@@ -167,6 +168,9 @@ public class ProblemInitiationServiceImpl {
unitIds
=
new
ArrayList
<>();
taskType
=
getUnitId
(
unitIds
,
objectd
);
taskService
.
saveOrUpdateTask
(
objectd
.
getStatus
(),
false
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
质量问题
.
getKey
(),
unitIds
,
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
}
...
...
@@ -432,7 +436,11 @@ public class ProblemInitiationServiceImpl {
LambdaQueryWrapper
<
QualityProblem
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
QualityProblem:
:
getInstanceId
,
instanceId
);
QualityProblem
qualityProblem
=
qualityProblemService
.
getOne
(
wrapper
);
try
{
qualityProblem
.
setStatus
(
projectInitiationService
.
getFlowTaskName
(
instanceId
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
qualityProblem
.
setProcessProgress
(
ProblemProcessEnum
.
statusMap
.
get
(
qualityProblem
.
getStatus
()));
qualityProblemService
.
updateById
(
qualityProblem
);
}
...
...
@@ -530,7 +538,7 @@ public class ProblemInitiationServiceImpl {
projectInitiation
.
setType
(
ProcessTypeEnum
.
人工处理
.
getType
());
projectInitiationService
.
save
(
projectInitiation
);
// 更新关联表数据
iProcessRelationService
.
updateState
(
qualityProblem
.
getInstanceId
());
iProcessRelationService
.
updateState
(
qualityProblem
.
getInstanceId
()
,
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProcessRelationServiceImpl.java
View file @
1989cf33
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
@Service
...
...
@@ -39,16 +40,22 @@ public class ProcessRelationServiceImpl extends BaseService<ProcessRelationDto,
* 更新资源流程关系信息 state字段
*
* @param instanceId 流程实例id
* @Param taskName 任务节点名称,可为null
*/
@Override
public
void
updateState
(
String
instanceId
){
public
void
updateState
(
String
instanceId
,
String
taskName
){
LambdaQueryWrapper
<
ProcessRelation
>
wrapper
=
new
LambdaQueryWrapper
();
wrapper
.
eq
(
ProcessRelation:
:
getInstanceId
,
instanceId
);
// .eq(ProcessRelation::getSourceId,sourceId).eq(ProcessRelation::getDefName,processName);
ProcessRelation
processRelation
=
this
.
getOne
(
wrapper
);
String
taskName
=
projectInitiationService
.
getFlowTaskName
(
instanceId
);
try
{
if
(
ValidationUtil
.
isEmpty
(
taskName
))
{
taskName
=
projectInitiationService
.
getFlowTaskName
(
instanceId
);
}
processRelation
.
setStatus
(
taskName
);
this
.
updateById
(
processRelation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
View file @
1989cf33
...
...
@@ -93,17 +93,74 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Resource
private
IProcessRelationService
processRelationService
;
/**
* 测试流程使用
* @param project
* @return
*/
public
String
startTest
(
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
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"流程启动失败:"
+
e
.
getMessage
());
}
return
instanceId
;
}
public
void
getTaskList
(
String
instanceId
){
Workflow
.
taskClient
.
getTaskList
(
instanceId
).
getResult
();
Workflow
.
taskClient
.
getTasksNoAuth
(
processDefinitionKey
,
null
).
getResult
();
Workflow
.
taskClient
.
getTasks
(
processDefinitionKey
).
getResult
();
Workflow
.
taskClient
.
getTask
(
instanceId
);
}
/**
* 测试流程使用
* @param instanceId
* @param condition
* @param option
* @return
*/
public
String
executeTest
(
String
instanceId
,
String
condition
,
String
option
){
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskName
=
dataObject
.
getString
(
"name"
);
String
taskId
=
dataObject
.
getString
(
"id"
);
String
str
=
"当前任务节点:"
+
taskName
+
",任务id:"
+
taskId
;
try
{
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResult
(
condition
);
dto
.
setResultCode
(
"condition"
);
dto
.
setTaskId
(
taskId
);
HashMap
<
String
,
Object
>
var
=
new
HashMap
<>();
var
.
put
(
"condition"
,
condition
);
var
.
put
(
"option"
,
option
);
dto
.
setVariable
(
var
);
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
str
=
str
+
" 执行成功!"
;
}
catch
(
Exception
e
)
{
str
=
str
+
" 执行失败"
;
}
return
str
;
}
@Override
public
void
start
(
Project
project
)
{
System
.
out
.
println
(
"流程启动:"
+
DateUtils
.
date2LongStr
(
new
Date
()));
String
instanceId
=
null
;
//启动流程
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
processDefinitionKey
);
dto
.
setBusinessKey
(
"1"
);
// System.out.println("执行前"+ DateUtils.date2LongStr(new Date()));
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
// System.out.println("执行后"+DateUtils.date2LongStr(new Date()));
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
...
...
@@ -113,80 +170,76 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
e
.
printStackTrace
();
System
.
out
.
println
(
"流程启动失败:"
+
e
.
getMessage
());
}
//新增project表的流程id和流程状态
String
taskName
=
null
;
try
{
taskName
=
getFlowTaskName
(
instanceId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
project
.
setInstanceId
(
instanceId
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
)
);
project
.
setStatus
(
taskName
);
projectService
.
updateById
(
project
);
//审核条件
String
option
=
"0"
;
if
(
true
)
{
option
=
"1"
;
}
//新增流程关系表的流程id和流程状态及资源id
processRelationService
.
savePR
(
instanceId
,
project
.
getSequenceNbr
(),
ProcessTypeEnum
.
项目立项
.
getName
());
//执行项目立项流程
execute
(
instanceId
,
project
,
option
);
execute
(
instanceId
,
project
,
null
,
null
);
}
@Override
public
void
execute
(
String
instanceId
,
Object
objectd
,
String
option
){
public
void
execute
(
String
instanceId
,
Object
objectd
,
String
condition
,
String
option
){
String
taskType
=
""
;
List
<
Long
>
unitIds
=
new
ArrayList
<>();
Long
extendId
=
-
1L
;
String
taskName
=
""
;
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
));
Project
project
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
),
Project
.
class
);
if
(
ValidationUtil
.
isEmpty
(
project
.
getName
())){
project
=
projectService
.
getById
(
object
.
getLong
(
"projectId"
));
}
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
AjaxResult
ajaxResult
=
new
AjaxResult
();
JSONObject
dataObject
=
new
JSONObject
();
try
{
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
}
catch
(
Exception
e
)
{
//当存在多个用户任务时 主要是安装/设计提交资料修改
logger
.
error
(
"当前用户存在多个任务"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
Workflow
.
taskClient
.
getTaskList
(
instanceId
).
getResult
()));
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"data"
);
for
(
Object
o:
jsonArray
){
String
name
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
o
)).
getString
(
"name"
);
if
(
name
==
ProjectInitiationEnum
.
安装开工资料修改
.
getName
()){
dataObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
o
));
}
}
}
taskName
=
dataObject
.
getString
(
"name"
);
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
//将所要的数据存为context格式
projectInitiation
.
setContext
(
JSON
.
toJSONString
(
objectd
));
projectInitiation
.
setTaskId
(
dataObject
.
getString
(
"id"
));
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
));
projectInitiation
.
setTaskName
(
taskName
);
projectInitiation
.
setType
(
ProcessTypeEnum
.
项目立项
.
getType
());
//项目的管辖区域
String
regionCode
=
project
.
getInstallRegionCode
();
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule
::
getAdminRegionCode
,
regionCode
);
SuperviseRule
superviseRule
=
superviseRuleService
.
getOne
(
wrapper
);
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
taskName
))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))
||
ProjectInitiationEnum
.
接受告知
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))
)
{
extendId
=
object
.
getLong
(
"sequenceNbr"
);
}
if
(
ProjectInitiationEnum
.
审查项目
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
if
(
"1"
.
equals
(
option
)){
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
taskName
)
||
ProjectInitiationEnum
.
接受告知
.
getName
().
equals
(
taskName
)
)
{
extendId
=
object
.
getLong
(
"sequenceNbr"
);
}
}
if
(
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
if
(
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
taskName
)){
if
(
"1"
.
equals
(
option
)){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
}
}
if
(
ProjectInitiationEnum
.
接受审查意见
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
项目关闭
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
projectInitiation
.
setTaskName
(
taskName
+
"(流程结束!)"
);
}
}
...
...
@@ -203,25 +256,27 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
Workflow
.
taskClient
.
completeByTask
(
projectInitiation
.
getTaskId
(),
dto
);
//保存日志
this
.
save
(
projectInitiation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新任务表的状态 已办
taskType
=
getUnitId
(
unitIds
,
project
,
superviseRule
);
taskService
.
saveOrUpdateTask
(
project
.
getStatus
(),
true
,
taskType
,
new
Date
(),
project
.
getSequenceNbr
(),
TaskTypeEnum
.
项目立项
.
getKey
(),
unitIds
,
extendId
);
//更新project种的status字段,表示当前流程下一个执行的任务
updateProject
FlowStatus
(
instanceId
);
//更新project种的status字段
,更新关系表中的state字段
,表示当前流程下一个执行的任务
boolean
bool
=
update
FlowStatus
(
instanceId
);
//新增任务表的状态 待办
//如果更新了status状态 新增任务表的状态 待办
if
(
bool
)
{
project
=
projectService
.
getById
(
object
.
getLong
(
"sequenceNbr"
));
if
(
ValidationUtil
.
isEmpty
(
project
))
{
if
(
ValidationUtil
.
isEmpty
(
project
))
{
project
=
projectService
.
getById
(
object
.
getLong
(
"projectId"
));
}
unitIds
=
new
ArrayList
<>();
taskType
=
getUnitId
(
unitIds
,
project
,
superviseRule
);
taskService
.
saveOrUpdateTask
(
project
.
getStatus
(),
false
,
taskType
,
new
Date
(),
project
.
getSequenceNbr
(),
TaskTypeEnum
.
项目立项
.
getKey
(),
unitIds
,
extendId
);
taskService
.
saveOrUpdateTask
(
project
.
getStatus
(),
false
,
taskType
,
new
Date
(),
project
.
getSequenceNbr
(),
TaskTypeEnum
.
项目立项
.
getKey
(),
unitIds
,
extendId
);
System
.
out
.
println
(
"流程更新任务表结束:"
+
DateUtils
.
date2LongStr
(
new
Date
()));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
@@ -239,11 +294,11 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
unitIds
.
add
(
project
.
getInstallationUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
接受告知
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
平台审核
.
getName
().
equals
(
project
.
getStatus
())
)
{
if
(
ProjectInitiationEnum
.
接受告知
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
superviseRule
.
getSuperviseDeptId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
}
if
(
ProjectInitiationEnum
.
审查项目
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检科室分配
.
getName
().
equals
(
project
.
getStatus
()))
{
if
(
ProjectInitiationEnum
.
监检员分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检科室分配
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
superviseRule
.
getInspectionUnitId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
}
...
...
@@ -252,10 +307,18 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
unitIds
.
add
(
project
.
getDesignUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
审批人审批
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
审核人审核
.
getName
().
equals
(
project
.
getStatus
())){
if
(
ProjectInitiationEnum
.
安装开工资料修改
.
getName
().
equals
(
project
.
getStatus
())){
unitIds
.
add
(
project
.
getInstallationUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
设计开工资料修改
.
getName
().
equals
(
project
.
getStatus
())){
unitIds
.
add
(
project
.
getDesignUnitId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
修改资料
.
getName
().
equals
(
project
.
getStatus
())
)
{
unitIds
.
add
(
project
.
getInstallationUnitId
());
unitIds
.
add
(
project
.
getDesignUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
return
taskType
;
}
...
...
@@ -347,12 +410,12 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
AuditEnum
.
符合
.
getName
());
if
(
AuditEnum
.
不符合且不需要整改
.
getStatus
().
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
AuditEnum
.
不符合且不需要整改
.
getName
());
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
}
else
if
(
AuditEnum
.
不符合且需要重新提交资料
.
getStatus
().
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
AuditEnum
.
不符合且需要重新提交资料
.
getName
());
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
,
null
);
return
stringStringHashMap
.
toString
();
}
...
...
@@ -373,6 +436,25 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
return
taskName
;
}
public
boolean
updateFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
Project
project
=
projectService
.
getOne
(
wrapper
);
String
taskName
=
getFlowTaskName
(
instanceId
);
boolean
bool
=
true
;
if
(
project
.
getStatus
().
equals
(
ProjectInitiationEnum
.
提交资料
.
getName
())){
if
(
"流程结束!"
.
equals
(
taskName
)){
bool
=
false
;
}
}
if
(
bool
)
{
project
.
setStatus
(
taskName
);
projectService
.
updateById
(
project
);
processRelationService
.
updateState
(
instanceId
,
taskName
);
}
return
bool
;
}
public
void
updateProjectFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
...
...
@@ -449,7 +531,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
dto
.
setTaskId
(
taskId
);
//执行流程
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
processRelationService
.
updateState
(
overProjectDto
.
getInstanceId
());
processRelationService
.
updateState
(
overProjectDto
.
getInstanceId
()
,
null
);
//更新project种的status字段,表示当前流程下一个执行的任务
updateProjectFlowStatus
(
overProjectDto
.
getInstanceId
());
}
...
...
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 @
1989cf33
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectProcessDto
;
...
...
@@ -23,14 +24,19 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
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.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
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
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* 项目信息表服务实现类
...
...
@@ -72,6 +78,123 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
WeldServiceImpl
weldServiceImpl
;
@Autowired
SuperviseRuleMapper
superviseRuleMapper
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
@Autowired
IPipeServiceImpl
pipeService
;
public
ProjectDto
saveProjectInfo
(
ProjectDto
model
,
String
submitType
){
String
regionName
=
""
,
regionCode
=
""
;
Map
<
String
,
String
>
map
=
getInfo
(
regionName
,
regionCode
,
Long
.
valueOf
(
model
.
getInstallRegionCode
()));
model
.
setSubmitDate
(
new
Date
());
getUnitName
(
model
);
model
.
setInstallRegion
(
map
.
get
(
"regionName"
));
model
.
setInstallRegionCode
(
map
.
get
(
"regionCode"
));
Project
project
=
new
Project
();
BeanUtils
.
copyProperties
(
model
,
project
);
// model.setCode(getCode());
if
(
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
model
=
this
.
createWithModel
(
model
);
}
else
{
this
.
updateById
(
project
);
}
pipeService
.
addPipeMessage
(
JSON
.
toJSONString
(
model
.
getPipeSubForm
()),
model
.
getSequenceNbr
());
//提交触发流程
if
(
WhetherItPassEnum
.
PASS
.
getCode
().
equals
(
submitType
))
{
String
token
=
RequestContext
.
getToken
();
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
//分支线程执行流程
Thread
t1
=
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
RequestContext
.
setToken
(
token
);
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
projectInitiationService
.
start
(
project
);
}
});
t1
.
start
();
}
return
model
;
}
/**
* 根据单位id获取单位名称
* @param model
*/
public
void
getUnitName
(
ProjectDto
model
){
if
(!
ValidationUtil
.
isEmpty
(
model
.
getInstallationUnitId
()))
{
model
.
setInstallationUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getInstallationUnitId
())).
getBizOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
model
.
getDesignUnitId
()))
{
model
.
setDesignUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getDesignUnitId
())).
getBizOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
model
.
getConstructionUnitId
()))
{
model
.
setConstructionUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getConstructionUnitId
())).
getBizOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
model
.
getTestingUnitId
()))
{
model
.
setTestingUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getTestingUnitId
())).
getBizOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
model
.
getSupervisionUnitId
()))
{
model
.
setSupervisionUnit
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getSupervisionUnitId
())).
getBizOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChargePersonId
()))
{
model
.
setChargePerson
(
orgServiceImpl
.
getOrgUsrById
(
String
.
valueOf
(
model
.
getChargePersonId
())).
getBizOrgName
());
}
}
// 静态变量存储最大值
private
static
final
AtomicInteger
atomicNum
=
new
AtomicInteger
();
private
static
final
Integer
INIT_CODE_NUM
=
0
;
public
String
getCode
(){
String
date
=
new
SimpleDateFormat
(
"yyyy"
).
format
(
new
Date
());
String
code
=
"XM"
+
date
+
"-"
;
String
format
=
""
;
String
projectCode
=
""
;
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
orderByDesc
(
Project:
:
getCode
);
List
<
Project
>
list
=
this
.
list
(
wrapper
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
projectCode
=
list
.
iterator
().
next
().
getCode
();
if
(!
ValidationUtil
.
isEmpty
(
projectCode
)){
String
proDate
=
projectCode
.
substring
(
projectCode
.
indexOf
(
"M"
)+
1
,
projectCode
.
length
()
-
5
);
if
(
proDate
.
equals
(
date
)){
String
substring
=
projectCode
.
substring
(
projectCode
.
length
()
-
4
);
atomicNum
.
set
(
Integer
.
parseInt
(
substring
));
}
else
{
atomicNum
.
set
(
INIT_CODE_NUM
);
}
format
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
}
}
else
{
format
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
}
return
code
+
format
;
}
public
Map
<
String
,
String
>
getInfo
(
String
regionName
,
String
regionCode
,
Long
sequenceNbr
){
RegionModel
region
=
Systemctl
.
regionClient
.
getRegion
(
sequenceNbr
).
getResult
();
regionName
=
region
.
getRegionName
()
+
regionName
;
if
(
ValidationUtil
.
isEmpty
(
regionCode
)){
regionCode
=
String
.
valueOf
(
region
.
getRegionCode
());
}
else
{
regionCode
=
region
.
getRegionCode
()
+
"#"
+
regionCode
;
}
Map
<
String
,
String
>
map
=
new
HashMap
();
if
(
region
.
getParentId
()
!=
0L
){
map
=
getInfo
(
regionName
,
regionCode
,
region
.
getParentId
());
}
else
{
map
.
put
(
"regionName"
,
regionName
);
}
map
.
put
(
"regionCode"
,
regionCode
);
return
map
;
}
/**
* 分页查询
*/
...
...
@@ -88,7 +211,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
String
state
=
""
,
insDep
=
""
,
insPerson
=
""
,
insDepId
=
""
;
//新立项的项目 分支流程原因还没有instanceId 默认给值
if
(
ValidationUtil
.
isEmpty
(
project
.
getInstanceId
())){
state
=
ProjectInitiationEnum
.
平台审核
.
getTaskDetailStatus
();
state
=
ProjectInitiationEnum
.
提交资料
.
getTaskDetailStatus
();
}
LambdaQueryWrapper
<
ProjectInitiation
>
lambdaQueryWrap
=
new
LambdaQueryWrapper
<>();
...
...
@@ -100,7 +223,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
if
(!
ValidationUtil
.
isEmpty
(
projectInitiationList
)){
ProjectInitiation
projectInitiation
=
projectInitiationList
.
iterator
().
next
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
projectInitiation
.
getContext
());
if
(
ProjectInitiationEnum
.
审批人审批
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
审核人审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检科室分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
流程结束
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
项目关闭
.
getName
().
equals
(
project
.
getStatus
())){
if
(
ProjectInitiationEnum
.
监检科室分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
流程结束
.
getName
().
equals
(
project
.
getStatus
())){
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
)){
insDepId
=
jsonObject
.
getString
(
XJConstant
.
INS_DEPID
);
state
=
jsonObject
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
...
...
@@ -111,31 +234,6 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
state
=
ProjectInitiationEnum
.
getTaskDetailStatusMap
.
get
(
project
.
getStatus
());
}
}
// if(ProjectInitiationEnum.平台审核.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "项目待审核";
// }
// } else if (ProjectInitiationEnum.告知申请.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "告知待申请";
// }
// } else if (ProjectInitiationEnum.接受告知.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "告知待接收";
// }
// } else if (ProjectInitiationEnum.审查项目.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "告知待接收";
// }
// } else if (ProjectInitiationEnum.提交资料.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "资料待上传";
// }
// } else if(ProjectInitiationEnum.项目立项.getName().equals(project.getStatus())){
// if(ValidationUtil.isEmpty(state)){
// state = "项目被驳回";
// }
// }
project
.
setExamineProjectState
(
state
);
project
.
setInsDep
(
insDep
);
...
...
@@ -272,7 +370,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
String
type
=
jsonObject
.
getString
(
"type"
);
if
(!
ValidationUtil
.
isEmpty
(
type
))
{
if
(
design
&&
install
)
{
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
projectDto
,
"1"
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
projectDto
,
"1"
,
null
);
return
"over"
;
}
else
{
return
"fail"
;
...
...
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 @
1989cf33
...
...
@@ -175,6 +175,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
//拿到qualityProblem更新到数据库
quality
.
setReformLimitDate
(
qualityProblem
.
getDateTime
());
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"0"
);
}
else
{
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
...
...
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