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
cd79b2d2
Commit
cd79b2d2
authored
Dec 12, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugp任务逻辑添加
parent
de3ad050
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
251 additions
and
37 deletions
+251
-37
CompanyTypeEnum.java
...eejoin/amos/boot/module/ugp/api/Enum/CompanyTypeEnum.java
+1
-1
TaskTypeEnum.java
...m/yeejoin/amos/boot/module/ugp/api/Enum/TaskTypeEnum.java
+3
-1
WeldStatusEnum.java
...yeejoin/amos/boot/module/ugp/api/Enum/WeldStatusEnum.java
+14
-0
Task.java
...ava/com/yeejoin/amos/boot/module/ugp/api/entity/Task.java
+5
-3
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+21
-1
TaskController.java
...n/amos/boot/module/ugp/biz/controller/TaskController.java
+30
-21
CompanyServiceImpl.java
.../boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
+15
-0
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+47
-3
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+68
-7
VerifyServiceImpl.java
...s/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
+47
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/CompanyTypeEnum.java
View file @
cd79b2d2
...
...
@@ -17,7 +17,7 @@ public enum CompanyTypeEnum {
建设单位
(
"CONSTRUCTION"
,
"建设单位"
),
安装单位
(
"INSTALL"
,
"安装单位"
),
设计单位
(
"DESIGN"
,
"设计单位"
),
监检机构
(
"MONITORING"
,
"
监检机构
"
),
监检机构
(
"MONITORING"
,
"
检验检测单位
"
),
监理单位
(
"SUPERVISOR"
,
"监理单位"
);
String
key
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/TaskTypeEnum.java
View file @
cd79b2d2
...
...
@@ -10,7 +10,9 @@ public enum TaskTypeEnum {
流程
(
"flow"
,
"流程"
),
企业审核
(
"examine"
,
"企业审核"
),
待办
(
"false"
,
"待办"
),
已办
(
"true"
,
"已办"
);
已办
(
"true"
,
"已办"
),
项目立项
(
"project"
,
"项目立项"
),
质量问题
(
"problem"
,
"质量问题"
);
String
key
;
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/WeldStatusEnum.java
0 → 100644
View file @
cd79b2d2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
jdk.nashorn.internal.objects.annotations.Constructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
WeldStatusEnum
{
进行中
(
0
),
已完成
(
1
);
Integer
status
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/entity/Task.java
View file @
cd79b2d2
...
...
@@ -33,7 +33,7 @@ public class Task extends BaseEntity {
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
project
Id
;
private
Long
source
Id
;
@ApiModelProperty
(
value
=
"任务状态(0:未开始 1:进行中 2:已结束)"
)
private
Boolean
status
;
...
...
@@ -41,13 +41,15 @@ public class Task extends BaseEntity {
@ApiModelProperty
(
value
=
"任务开始时间"
)
private
String
statusLabel
;
@ApiModelProperty
(
value
=
"任务结束时间"
)
private
String
taskType
;
private
String
taskTypeLabel
;
private
String
content
;
private
String
agencyCode
;
private
Integer
companyId
;
private
Date
sendTime
;
private
String
type
;
private
Long
unitId
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
cd79b2d2
...
...
@@ -16,11 +16,15 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.CompanyExamineEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule
;
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.boot.module.ugp.biz.service.impl.SuperviseRuleServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.TaskServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
...
...
@@ -94,6 +98,12 @@ public class CompanyController extends BaseController {
@Autowired
RedisUtils
redisUtils
;
@Autowired
TaskServiceImpl
taskService
;
@Autowired
SuperviseRuleServiceImpl
superviseRuleService
;
/**
* 新增企业信息表
...
...
@@ -114,7 +124,17 @@ public class CompanyController extends BaseController {
model
.
setApproved
(
CompanyExamineEnum
.
企业审核
.
getNo
());
model
.
setAdminLincensePic
(
JSON
.
toJSONString
(
adminLincensePic
));
model
.
setRecDate
(
new
Date
());
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
createWithModel
(
model
));
model
=
companyServiceImpl
.
createWithModel
(
model
);
//获取当前注册企业的区域规则
SuperviseRule
superviseRule
=
superviseRuleService
.
getOne
(
new
LambdaQueryWrapper
<
SuperviseRule
>().
eq
(
SuperviseRule:
:
getAdminRegionCode
,
model
.
getRegionCode
()));
List
<
Long
>
unitIds
=
new
ArrayList
<>();
unitIds
.
add
(
superviseRule
.
getSuperviseDeptId
());
unitIds
.
add
(
superviseRule
.
getInspectionUnitId
());
//新增企业审核任务信息
taskService
.
setTask
(
null
,
false
,
TaskTypeEnum
.
企业审核
.
getKey
(),
new
Date
(),
model
.
getSequenceNbr
(),
TaskTypeEnum
.
企业审核
.
getKey
(),
unitIds
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/TaskController.java
View file @
cd79b2d2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -7,6 +8,8 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.TaskDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Task
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.TaskServiceImpl
;
import
io.swagger.annotations.Api
;
...
...
@@ -40,6 +43,9 @@ public class TaskController {
@Autowired
TaskServiceImpl
iTzUgpTaskService
;
@Autowired
OrgServiceImpl
orgService
;
/**
* 新增监检任务表
...
...
@@ -148,26 +154,16 @@ public class TaskController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getTaskList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取当前登录人的所有任务列表"
,
notes
=
"获取当前登录人的所有任务列表"
)
public
ResponseModel
<
Page
<
TaskDto
>>
getTaskList
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
String
type
,
Long
current
,
Long
size
){
Page
page
=
new
Page
(
current
,
size
);
List
<
TaskDto
>
taskDtoList
=
new
ArrayList
<>();
boolean
status
=
false
;
if
(
ValidationUtil
.
isEmpty
(
type
)){
type
=
TaskTypeEnum
.
待办
.
getKey
();
status
=
true
;
}
if
(
TaskTypeEnum
.
待办
.
getKey
().
equals
(
type
)){
taskDtoList
.
addAll
(
iTzUgpTaskService
.
unDoneTask
());
if
(
status
){
type
=
TaskTypeEnum
.
已办
.
getKey
();
}
@BusinessIdentify
public
ResponseModel
<
IPage
<
Task
>>
getTaskList
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
String
type
,
Long
current
,
Long
size
){
Long
unitId
=
orgService
.
getReginParams
().
getBusinessInfo
().
getCompanySequenceNbr
();
IPage
<
Task
>
page
=
new
Page
(
current
,
size
);
LambdaQueryWrapper
<
Task
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Task:
:
getUnitId
,
unitId
);
if
(!
ValidationUtil
.
isEmpty
(
type
)){
wrapper
.
eq
(
Task:
:
getTaskType
,
type
);
}
if
(
TaskTypeEnum
.
已办
.
getKey
().
equals
(
type
)){
taskDtoList
.
addAll
(
iTzUgpTaskService
.
doneTask
());
}
taskDtoList
=
taskDtoList
.
stream
().
sorted
(
Comparator
.
comparing
(
TaskDto:
:
getSendTime
).
reversed
()).
collect
(
Collectors
.
toList
());
page
.
setRecords
(
taskDtoList
);
page
.
setTotal
(
taskDtoList
.
size
());
iTzUgpTaskService
.
page
(
page
,
wrapper
);
return
ResponseHelper
.
buildResponse
(
page
);
}
...
...
@@ -179,9 +175,22 @@ public class TaskController {
@RequestMapping
(
value
=
"/getTaskCount"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取当前登录人的所有任务统计"
,
notes
=
"获取当前登录人的所有任务统计"
)
public
ResponseModel
<
Map
>
getCount
(){
List
myTask
=
new
ArrayList
();
List
todyCompletedTask
=
new
ArrayList
();
Long
unitId
=
orgService
.
getReginParams
().
getBusinessInfo
().
getCompanySequenceNbr
();
LambdaQueryWrapper
<
Task
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Task:
:
getUnitId
,
unitId
);
if
(
true
){
wrapper
.
eq
(
Task:
:
getTaskType
,
false
);
myTask
=
iTzUgpTaskService
.
list
(
wrapper
);
}
else
{
wrapper
.
eq
(
Task:
:
getTaskType
,
true
);
todyCompletedTask
=
iTzUgpTaskService
.
list
(
wrapper
);
}
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"myTask"
,
String
.
valueOf
(
iTzUgpTaskService
.
unDoneTask
()
.
size
()));
map
.
put
(
"todyCompletedTask"
,
String
.
valueOf
(
iTzUgpTaskService
.
doneTask
()
.
size
()));
map
.
put
(
"myTask"
,
String
.
valueOf
(
myTask
.
size
()));
map
.
put
(
"todyCompletedTask"
,
String
.
valueOf
(
todyCompletedTask
.
size
()));
return
ResponseHelper
.
buildResponse
(
map
);
}
...
...
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 @
cd79b2d2
...
...
@@ -7,6 +7,7 @@ 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.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
...
...
@@ -58,6 +59,12 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
@Autowired
private
SuperviseRuleMapper
superviseRuleMapper
;
@Autowired
SuperviseRuleServiceImpl
superviseRuleService
;
@Autowired
TaskServiceImpl
taskService
;
/**
* 列表查询 示例
*/
...
...
@@ -252,6 +259,14 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
}
}
//获取当前注册企业的区域规则
SuperviseRule
superviseRule
=
superviseRuleService
.
getOne
(
new
LambdaQueryWrapper
<
SuperviseRule
>().
eq
(
SuperviseRule:
:
getAdminRegionCode
,
model
.
getRegionCode
()));
List
<
Long
>
unitIds
=
new
ArrayList
<>();
unitIds
.
add
(
superviseRule
.
getSuperviseDeptId
());
unitIds
.
add
(
superviseRule
.
getInspectionUnitId
());
//新增企业审核任务信息
taskService
.
setTask
(
null
,
true
,
TaskTypeEnum
.
企业审核
.
getKey
(),
new
Date
(),
model
.
getSequenceNbr
(),
TaskTypeEnum
.
企业审核
.
getKey
(),
unitIds
);
return
this
.
updateById
(
company
);
}
...
...
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 @
cd79b2d2
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -19,12 +20,11 @@ import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.parsing.Problem
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @author Dell
...
...
@@ -33,6 +33,9 @@ import java.util.Map;
public
class
ProblemInitiationServiceImpl
{
@Autowired
TaskServiceImpl
taskService
;
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
...
...
@@ -96,6 +99,9 @@ public class ProblemInitiationServiceImpl {
public
void
execute
(
String
instanceId
,
QualityProblem
objectd
,
String
option
){
List
<
Long
>
unitIds
=
new
ArrayList
<>();
String
taskType
=
new
String
();
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
));
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
...
...
@@ -141,15 +147,53 @@ public class ProblemInitiationServiceImpl {
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新任务表的状态 已办
if
(!
ValidationUtil
.
isEmpty
(
unitIds
))
{
taskType
=
getUnitId
(
unitIds
,
objectd
);
taskService
.
setTask
(
objectd
.
getStatus
(),
true
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
质量问题
.
getKey
(),
unitIds
);
}
//更新problem中的status字段,表示当前流程下一个执行的任务
qualityProblemService
.
updateById
(
objectd
);
updateProBlemFlowStatus
(
instanceId
);
QualityProblem
quality
=
qualityProblemService
.
getById
(
objectd
.
getSequenceNbr
());
objectd
.
setStatus
(
quality
.
getStatus
());
if
(!
ValidationUtil
.
isEmpty
(
unitIds
))
{
taskType
=
getUnitId
(
unitIds
,
objectd
);
taskService
.
setTask
(
objectd
.
getStatus
(),
false
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
质量问题
.
getKey
(),
unitIds
);
}
}
}
/**
* 获取任务的执行单位id 和 TaskType
* @param unitIds
*/
public
String
getUnitId
(
List
<
Long
>
unitIds
,
QualityProblem
qualityProblem
){
Project
project
=
projectServiceImpl
.
getById
(
qualityProblem
.
getProjectId
());
//获取问题所在的区域规则信息
SuperviseRule
superviseRule
=
superviseRuleServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
SuperviseRule
>().
eq
(
SuperviseRule:
:
getAdminRegionCode
,
project
.
getInstallRegionCode
()));
String
taskType
=
""
;
if
(
ProblemProcessEnum
.
确定问题
.
getName
().
equals
(
qualityProblem
.
getStatus
())
||
ProblemProcessEnum
.
审查整改过程
.
getName
().
equals
(
qualityProblem
.
getStatus
())
||
ProblemProcessEnum
.
问题分类
.
getName
().
equals
(
qualityProblem
.
getStatus
()))
{
unitIds
.
add
(
superviseRule
.
getInspectionUnitId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
}
if
(
ProblemProcessEnum
.
编制处理方案
.
getName
().
equals
(
qualityProblem
.
getStatus
())
||
ProblemProcessEnum
.
提交整改书
.
getName
().
equals
(
qualityProblem
.
getStatus
()))
{
unitIds
.
add
(
project
.
getInstallationUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProblemProcessEnum
.
审查处理方案
.
getName
().
equals
(
qualityProblem
.
getStatus
()))
{
unitIds
.
add
(
project
.
getConstructionUnitId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
}
return
taskType
;
}
/**
* 项目立项及质量问题闭环处理 发送短信具体模板
* @param object
* @param smsCode
...
...
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 @
cd79b2d2
...
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.AuditEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
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
;
...
...
@@ -36,6 +37,8 @@ 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.bouncycastle.pqc.crypto.newhope.NHOtherInfoGenerator
;
import
org.drools.core.factmodel.traits.TraitTypeEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -54,7 +57,8 @@ import java.util.*;
@Service
public
class
ProjectInitiationServiceImpl
extends
BaseService
<
ProjectInitiationDto
,
ProjectInitiation
,
ProjectInitiationMapper
>
implements
IProjectInitiationService
{
@Autowired
SuperviseRuleServiceImpl
superviseRuleService
;
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
...
...
@@ -83,6 +87,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
ProblemInitiationServiceImpl
problemInitiationService
;
@Autowired
private
TaskServiceImpl
taskService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
...
...
@@ -121,7 +128,11 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Override
public
void
execute
(
String
instanceId
,
Object
objectd
,
String
option
){
String
taskType
=
""
;
List
<
Long
>
unitIds
=
new
ArrayList
<>();
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
));
Project
project
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
),
Project
.
class
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
...
...
@@ -131,7 +142,16 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
projectInitiation
.
setTaskId
(
dataObject
.
getString
(
"id"
));
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
));
if
(
ProjectInitiationEnum
.
平台审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
//项目的管辖区域
String
regionCode
=
object
.
getString
(
"region"
);
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule
::
getAdminRegionCode
,
regionCode
);
SuperviseRule
superviseRule
=
superviseRuleService
.
getOne
(
wrapper
);
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
...
...
@@ -146,11 +166,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
项目关闭
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
...
...
@@ -175,11 +191,56 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新任务表的状态 已办
if
(!
ValidationUtil
.
isEmpty
(
unitIds
))
{
taskType
=
getUnitId
(
unitIds
,
project
,
superviseRule
);
taskService
.
setTask
(
project
.
getStatus
(),
true
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
项目立项
.
getKey
(),
unitIds
);
}
//更新project种的status字段,表示当前流程下一个执行的任务
updateProjectFlowStatus
(
instanceId
);
//新增任务表的状态 待办
if
(!
ValidationUtil
.
isEmpty
(
unitIds
))
{
project
=
projectService
.
getById
(
object
.
getLong
(
"sequenceNbr"
));
taskType
=
getUnitId
(
unitIds
,
project
,
superviseRule
);
taskService
.
setTask
(
project
.
getStatus
(),
false
,
taskType
,
new
Date
(),
object
.
getLong
(
"sequenceNbr"
),
TaskTypeEnum
.
项目立项
.
getKey
(),
unitIds
);
}
}
}
/**
* 获取任务的执行单位id 和 TaskType
* @param unitIds
*/
public
String
getUnitId
(
List
<
Long
>
unitIds
,
Project
project
,
SuperviseRule
superviseRule
){
String
taskType
=
""
;
if
(
ProjectInitiationEnum
.
项目立项
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
project
.
getConstructionUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
project
.
getInstallationUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
接受告知
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
superviseRule
.
getSuperviseDeptId
());
}
if
(
ProjectInitiationEnum
.
审查项目
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员分配
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检员审核
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
监检科室分配
.
getName
().
equals
(
project
.
getStatus
()))
{
unitIds
.
add
(
superviseRule
.
getInspectionUnitId
());
}
if
(
ProjectInitiationEnum
.
提交资料
.
getName
().
equals
(
project
.
getStatus
())
)
{
unitIds
.
add
(
project
.
getInstallationUnitId
());
unitIds
.
add
(
project
.
getDesignUnitId
());
taskType
=
TaskTypeEnum
.
填报
.
getKey
();
}
if
(
ProjectInitiationEnum
.
审批人审批
.
getName
().
equals
(
project
.
getStatus
())
||
ProjectInitiationEnum
.
审核人审核
.
getName
().
equals
(
project
.
getStatus
())){
unitIds
.
add
(
project
.
getInstallationUnitId
());
unitIds
.
add
(
project
.
getDesignUnitId
());
taskType
=
TaskTypeEnum
.
流程
.
getKey
();
}
return
taskType
;
}
/*焊评审核(后期优化)
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
View file @
cd79b2d2
...
...
@@ -13,7 +13,10 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import
com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -33,6 +36,9 @@ import java.util.stream.Collectors;
@Service
public
class
VerifyServiceImpl
extends
BaseService
<
VerifyDto
,
Verify
,
VerifyMapper
>
implements
IVerifyService
{
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
InstallNoticeServiceImpl
installNoticeService
;
@Autowired
...
...
@@ -59,6 +65,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
private
ProblemInitiationServiceImpl
problemInitiationService
;
@Autowired
private
CompanyServiceImpl
companyService
;
@Value
(
"${mqtt.topic.weldUpdate}"
)
private
String
weldUpdate
;
/**
* 分页查询
...
...
@@ -224,6 +233,28 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
page
;
}
public
void
weldUpdate
(
JSONObject
jsonObject
,
Integer
status
){
Weld
weld
=
weldService
.
getOne
(
new
LambdaQueryWrapper
<
Weld
>().
eq
(
Weld:
:
getCode
,
jsonObject
.
getString
(
"code"
)));
String
location
=
jsonObject
.
getString
(
"location"
);
if
(!
ValidationUtil
.
isEmpty
(
status
)){
weld
.
setStatus
(
status
);
}
if
(!
"4.9E-3244.9E-324"
.
equals
(
location
)){
String
longitude
=
location
.
substring
(
0
,
location
.
indexOf
(
","
));
String
latitude
=
location
.
substring
(
longitude
.
length
()+
1
);
weld
.
setLongitude
(
longitude
);
weld
.
setLatitude
(
latitude
);
weldService
.
updateById
(
weld
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
weldUpdate
,
weld
.
toString
().
getBytes
(),
1
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
/** cpp
* 智能监检校验数据
...
...
@@ -237,6 +268,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
jsonObject
==
null
||
jsonObject
.
size
()
==
0
)
{
return
VerifyEnum
.
未通过
.
getName
();
}
//通过userid和projectId来对应
Long
welderId
=
orgService
.
getReginParams
(
).
getBusinessInfo
(
).
getUserSequenceNbr
(
);
Long
random
=
jsonObject
.
getLong
(
"random"
);
//随机值
...
...
@@ -252,6 +284,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
verify
.
setType
(
TYPE
);
//检验方式
verify
.
setVerifyTime
(
time
);
//获取当前时间
List
<
Verify
>
verifyList
=
verifyMapper
.
selectByWelder
(
projectId
,
welderId
,
null
,
null
,
random
);
//人员
if
(
stage
.
equals
(
StageEnum
.
焊前人员
.
getVerifyName
()))
{
verify
.
setStage
(
StageEnum
.
焊前人员
.
getStage
());
//阶段
...
...
@@ -299,6 +332,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
//成功
this
.
addSuccessData
(
verify
,
null
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
//管材
if
(
stage
.
equals
(
StageEnum
.
焊前管材质量
.
getVerifyName
())){
...
...
@@ -337,6 +372,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
VerifyEnum
.
未通过
.
getName
();
}
this
.
addSuccessData
(
verify
,
null
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
//设备
if
(
stage
.
equals
(
StageEnum
.
焊前设备
.
getVerifyName
())){
...
...
@@ -374,6 +411,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
//效验通过
this
.
addSuccessData
(
verify
,
null
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
//工艺
if
(
stage
.
equals
(
StageEnum
.
焊接工艺
.
getVerifyName
())){
...
...
@@ -453,6 +492,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
v1
.
setStage
(
StageEnum
.
管道耐压
.
getStage
());
v1
.
setSubmitTime
(
time
);
this
.
addSuccessData
(
v1
,
null
,
object
);
//更新weld焊口信息表中的经纬度信息,更新焊口状态 已完成
weldUpdate
(
jsonObject
,
WeldStatusEnum
.
已完成
.
getStatus
());
}
//耐压
if
(
stage
.
equals
(
StageEnum
.
管道耐压
.
getVerifyName
())){
...
...
@@ -501,6 +542,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
//效验通过
this
.
addSuccessData
(
verify
,
codeArray
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
//埋深
if
(
stage
.
equals
(
StageEnum
.
敷设质量
.
getVerifyName
())){
...
...
@@ -573,6 +616,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//效验通过
String
[]
codeArray
=
manyCode
.
split
(
","
);
this
.
addSuccessData
(
verify
,
codeArray
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
//回填
if
(
stage
.
equals
(
StageEnum
.
回填
.
getVerifyName
()))
{
...
...
@@ -607,6 +652,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//效验通过
String
[]
codeArray
=
manyCode
.
split
(
","
);
this
.
addSuccessData
(
verify
,
codeArray
,
jsonObject
);
//更新weld焊口信息表中的经纬度信息
weldUpdate
(
jsonObject
,
null
);
}
...
...
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