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
1785eb56
Commit
1785eb56
authored
Jan 11, 2024
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改使用登记流程逻辑
parent
9a9585d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
176 additions
and
130 deletions
+176
-130
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+171
-125
urlInfo.json
...s-boot-module-jg-biz/src/main/resources/json/urlInfo.json
+2
-2
UseInfo.java
.../com/yeejoin/amos/boot/module/ymt/api/entity/UseInfo.java
+3
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
1785eb56
...
...
@@ -11,9 +11,12 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper
;
...
...
@@ -36,15 +39,15 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper
import
com.yeejoin.amos.boot.module.ymt.api.mapper.OtherInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
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
com.yeejoin.amos.feign.workflow.model.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -90,6 +93,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
ICommonService
commonService
;
@Autowired
CommonServiceImpl
commonServiceImpl
;
@Autowired
CmWorkflowServiceImpl
cmWorkflowService
;
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgUseRegistrationDto
dto
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
Page
<
Map
<
String
,
Object
>>
listPage
=
this
.
baseMapper
.
getListPage
(
page
,
dto
,
roleIds
);
...
...
@@ -100,7 +107,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
this
.
baseMapper
.
getEquipListPage
(
page
,
factoryNum
,
equList
,
equCategory
);
}
public
void
updateEquipMessage
(
String
currentDocumentId
,
String
useOrgCode
){
public
void
updateEquipMessage
(
String
currentDocumentId
,
String
useOrgCode
)
{
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambdaSelect
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambdaSelect
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
currentDocumentId
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambdaSelect
);
...
...
@@ -122,17 +129,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
idxBizJgRegisterInfoMapper
.
updateUseOrgCodeByEquip
(
String
.
valueOf
(
map
.
get
(
"equipId"
)),
useOrgCode
);
}
public
void
updateHistory
(
JSONObject
map
,
String
equipId
,
String
currentDocumentId
,
String
supervisoryCode
){
public
void
updateHistory
(
JSONObject
map
,
String
equipId
,
String
currentDocumentId
,
String
supervisoryCode
)
{
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getEquId
,
equipId
);
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
currentDocumentId
);
lambda
.
eq
(
JgRegistrationHistory:
:
getRegistrationClass
,
"使用登记"
);
Integer
integer
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectCount
(
lambda
);
if
(
integer
>
0
){
if
(
integer
>
0
)
{
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
map
));
jgRegistrationHistoryService
.
update
(
jgRegistrationHistory
,
lambda
);
}
else
{
}
else
{
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
map
));
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setRegistrationClass
(
"使用登记"
);
...
...
@@ -189,7 +196,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// List<String> applicationFormCode = iCreateCodeServicevice.createApplicationFormCode(ApplicationFormTypeEnum.SYDJ.getCode(), 1);
// jgUseRegistration.setApplyNo(applicationFormCode.get(0));
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
}
jgUseRegistration
.
setAuditStatus
(
"待提交"
);
...
...
@@ -206,19 +213,132 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
instanceId
=
map
.
get
(
"instanceId"
).
toString
();
}
else
{
// 启动并执行流程
instanceId
=
startByVariable
();
// jgUseRegistration.setInstanceStatus("1460532889249755137");
// jgUseRegistration.setReceiveCompanyCode("610000");
updateExecuteIds
(
instanceId
,
jgUseRegistration
.
getSequenceNbr
(),
"0"
);
// instanceId = startByVariable();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ArrayList
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
dto
.
setProcessDefinitionKey
(
"useRegistration"
);
dto
.
setBusinessKey
(
"test"
);
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
resultDto
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
if
(!
ObjectUtils
.
isEmpty
(
resultDto
)
&&
!
ObjectUtils
.
isEmpty
(
resultDto
.
get
(
0
)))
{
WorkflowResultDto
workflowResultDto
=
resultDto
.
get
(
0
);
JgUseRegistration
useRegistration
=
updateData
(
jgUseRegistration
.
getSequenceNbr
(),
"0"
,
workflowResultDto
,
Boolean
.
TRUE
);
buildTask
(
useRegistration
,
workflowResultDto
);
}
// updateExecuteIds(instanceId, jgUseRegistration.getSequenceNbr(), "0");
}
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
// 执行流程
flowExecute
(
jgUseRegistration
.
getSequenceNbr
(),
instanceId
,
"0"
,
""
);
// 更新数据信息
updateExecuteIds
(
instanceId
,
jgUseRegistration
.
getSequenceNbr
(),
"0"
);
// updateExecuteIds(instanceId, jgUseRegistration.getSequenceNbr(), "0");
}
}
}
public
JgUseRegistration
updateData
(
Long
sequenceNbr
,
String
operate
,
WorkflowResultDto
workflowResultDto
,
Boolean
isFirst
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
role
=
workflowResultDto
.
getNextExecutorRoleIds
();
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
if
(!
ObjectUtils
.
isEmpty
(
workflowResultDto
.
getNextTaskCode
()))
{
taskCode
=
workflowResultDto
.
getNextTaskCode
();
}
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
jgUseRegistration
.
setNextTaskId
(
workflowResultDto
.
getNextTaskId
());
if
(
isFirst
)
{
jgUseRegistration
.
setInstanceStatus
(
workflowResultDto
.
getExecutorRoleIds
());
jgUseRegistration
.
setInstanceId
(
workflowResultDto
.
getInstanceId
());
}
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
jgUseRegistration
.
setNextExecuteIds
(
role
);
jgUseRegistration
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getInstanceStatus
()))
{
jgUseRegistration
.
setInstanceStatus
(
jgUseRegistration
.
getInstanceStatus
()
+
","
+
role
);
}
else
{
jgUseRegistration
.
setInstanceStatus
(
role
);
}
if
(
"0"
.
equals
(
operate
))
{
// 通过操作
jgUseRegistration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
}
else
{
// 驳回操作
jgUseRegistration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getReject
());
jgUseRegistration
.
setPromoter
(
null
);
}
}
else
{
// 流程结束
jgUseRegistration
.
setStatus
(
taskCode
);
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
// 生成使用登记证编号
jgUseRegistration
.
setUseRegistrationCode
(
getCode
(
jgUseRegistration
.
getSupervisoryCode
()));
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
}
// 更新设备信息
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
.
getUseRegistrationCode
());
}
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
return
jgUseRegistration
;
}
public
void
test
()
{
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ArrayList
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
dto
.
setProcessDefinitionKey
(
"useRegistration"
);
dto
.
setBusinessKey
(
"test"
);
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
stopWatch
.
stop
();
System
.
out
.
println
(
"请求耗时:"
+
stopWatch
.
getTotalTimeSeconds
());
if
(!
ObjectUtils
.
isEmpty
(
processTaskDTOS
))
{
List
<
WorkflowResultDto
>
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
if
(!
ObjectUtils
.
isEmpty
(
workflowResultDtos
))
{
}
}
}
public
void
buildTask
(
JgUseRegistration
jgUseRegistration
,
WorkflowResultDto
workflowResultDto
)
{
// 代办消息
ArrayList
<
TaskModelDto
>
list
=
new
ArrayList
<>();
TaskModelDto
dto
=
new
TaskModelDto
();
dto
.
setTaskType
(
String
.
valueOf
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getCode
()));
dto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
());
dto
.
setFlowCreateDate
(
jgUseRegistration
.
getCreateDate
());
dto
.
setTaskName
(
workflowResultDto
.
getNextTaskName
());
dto
.
setTaskCode
(
workflowResultDto
.
getNextTaskCode
());
dto
.
setTaskDesc
(
"来自"
+
"电梯"
+
"【"
+
jgUseRegistration
.
getSupervisoryCode
()
+
"】,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
dto
.
setTaskContent
(
"来自"
+
"电梯"
+
"【"
+
jgUseRegistration
.
getSupervisoryCode
()
+
"】,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
dto
.
setRelationId
(
workflowResultDto
.
getInstanceId
());
dto
.
setExecuteUserIds
(
workflowResultDto
.
getNextExecutorUserIds
());
dto
.
setTaskStatus
(
commonServiceImpl
.
getDictionaryCodeByName
(
WorkFlowStatusEnum
.
getMessage
(
workflowResultDto
.
getNextTaskCode
()).
getPass
()));
dto
.
setTaskStatusLabel
(
workflowResultDto
.
getNextTaskName
());
dto
.
setStartUser
(
jgUseRegistration
.
getCreateUserId
());
dto
.
setStartUser
(
jgUseRegistration
.
getRecUserName
());
dto
.
setStartUserCompanyName
(
jgUseRegistration
.
getUseUnitName
());
dto
.
setStartDate
(
new
Date
());
jgUseRegistration
.
setInstanceId
(
workflowResultDto
.
getInstanceId
());
jgUseRegistration
.
setNextExecuteIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
dto
.
setModel
(
jgUseRegistration
);
dto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorRoleIds
());
list
.
add
(
dto
);
commonServiceImpl
.
buildTaskModel
(
list
);
}
public
void
updateTask
()
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
TaskV2Model
taskV2Model
=
commonServiceImpl
.
updateTaskModel
(
map
);
}
public
String
startByVariable
()
{
...
...
@@ -236,49 +356,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
instanceId
;
}
// public String flowExecute(Long id,String instanceId, String operate, String comment, Boolean update) {
// String role = "";
// String taskName = "流程结束";
// ArrayList<String> roleList = new ArrayList<>();
// try {
// JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
// JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
// String taskId = taskMessage.getString("id");
// //组装信息
// TaskResultDTO dto = new TaskResultDTO();
// dto.setResultCode("approvalStatus");
// dto.setTaskId(taskId);
// dto.setComment(comment);
// HashMap<String, Object> map = new HashMap<>();
// map.put("approvalStatus", operate);
// dto.setVariable(map);
// //执行流程
// Workflow.taskClient.completeByTask(taskId, dto);
// // 查询下节点任务
// JSONObject taskNoAuth = workFlowFeginService.getTaskNoAuth(instanceId);
// if (!ObjectUtils.isEmpty(taskNoAuth.get("data"))) {
// JSONObject nextTask = JSON.parseObject(JSON.toJSONString(taskNoAuth.get("data")));
// String nextTaskId = nextTask.getString("id");
// taskName = nextTask.getString("name");
// AjaxResult taskGroupName = Workflow.taskClient.getTaskGroupName(nextTaskId);
// JSONArray data = JSON.parseArray(JSON.toJSONString(taskGroupName.get("data")));
// for (Object datum : data) {
// if (((Map) datum).containsKey("groupId")) {
// roleList.add(((Map) datum).get("groupId").toString());
// }
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// role= String.join(",", roleList);
// if (update) {
// Boolean rollBack = "1".equals(operate) ? true : false;
// updateStatus(id,instanceId, taskName, role, rollBack);
// }
// return role;
// }
public
void
updateExecuteIds
(
String
instanceId
,
Long
sequenceNbr
,
String
operate
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
role
=
""
;
...
...
@@ -342,60 +419,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
try
{
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
id
);
JSONObject
task
=
workFlowFeginService
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskMessage
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
task
.
get
(
"data"
)));
String
taskId
=
taskMessage
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
comment
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
operate
);
if
(
jgUseRegistration
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getReject
())
||
jgUseRegistration
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getRollBack
()))
{
map
.
put
(
"approvalStatus"
,
"提交"
);
}
dto
.
setVariable
(
map
);
//执行流程
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
id
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
jgUseRegistration
.
getNextTaskId
());
dto
.
setComment
(
comment
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
operate
);
if
(
jgUseRegistration
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getReject
())
||
jgUseRegistration
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getRollBack
()))
{
map
.
put
(
"approvalStatus"
,
"提交"
);
}
dto
.
setVariable
(
map
);
ProcessTaskDTO
complete
=
cmWorkflowService
.
complete
(
jgUseRegistration
.
getNextTaskId
(),
dto
);
ArrayList
<
ProcessTaskDTO
>
processTaskDTOS
=
new
ArrayList
<>();
processTaskDTOS
.
add
(
complete
);
List
<
WorkflowResultDto
>
resultDto
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
if
(!
ObjectUtils
.
isEmpty
(
resultDto
)
&&
!
ObjectUtils
.
isEmpty
(
resultDto
.
get
(
0
)))
{
WorkflowResultDto
workflowResultDto
=
resultDto
.
get
(
0
);
updateData
(
jgUseRegistration
.
getSequenceNbr
(),
"0"
,
workflowResultDto
,
Boolean
.
FALSE
);
}
// 更新下一步执行人
updateExecuteIds
(
instanceId
,
id
,
operate
);
}
// public void updateStatus(Long id , String instanceId, String taskName, String role, Boolean rollBack) {
// ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// LambdaQueryWrapper<JgUseRegistration> lambda = new QueryWrapper<JgUseRegistration>().lambda();
// lambda.eq(JgUseRegistration::getSequenceNbr, id);
// JgUseRegistration jgUseRegistration = this.getBaseMapper().selectOne(lambda);
// if ("流程结束".equals(taskName)) {
// jgUseRegistration.setStatus(taskName);
// jgUseRegistration.setAuditStatus("已完成");
// } else {
// jgUseRegistration.setNextExecuteIds(role);
// jgUseRegistration.setPromoter(reginParams.getUserModel().getUserId());
// if (!ObjectUtils.isEmpty(jgUseRegistration.getInstanceStatus())) {
// jgUseRegistration.setInstanceStatus(jgUseRegistration.getInstanceStatus() + "," + role);
// } else {
// jgUseRegistration.setInstanceStatus(role);
// }
// UseStatusEnum message = UseStatusEnum.getMessage(taskName);
// jgUseRegistration.setStatus(message.getPass());
// }
// if (rollBack){
// this.getBaseMapper().update(jgUseRegistration, lambda);
// this.getBaseMapper().updatePromoter(jgUseRegistration.getSequenceNbr());
// }else {
// this.getBaseMapper().update(jgUseRegistration, lambda);
// }
// }
public
void
withdraw
(
String
instanceId
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
taskCode
=
""
;
...
...
@@ -444,23 +490,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
public
Map
<
String
,
Object
>
getDetail
(
String
id
,
Long
sequenceNbr
)
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
)){
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
lambda
.
eq
(
JgRegistrationHistory:
:
getEquId
,
id
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
return
jsonObject
;
}
Map
<
String
,
Object
>
detail
=
this
.
baseMapper
.
getDetail
(
id
);
Map
<
String
,
Object
>
inspectDetail
=
this
.
baseMapper
.
getInspectDetail
(
id
);
Map
<
String
,
Object
>
useDetail
=
this
.
baseMapper
.
getUseDetail
(
id
);
if
(!
ObjectUtils
.
isEmpty
(
inspectDetail
)){
if
(!
ObjectUtils
.
isEmpty
(
inspectDetail
))
{
detail
.
putAll
(
inspectDetail
);
}
if
(!
ObjectUtils
.
isEmpty
(
useDetail
)){
if
(!
ObjectUtils
.
isEmpty
(
useDetail
))
{
detail
.
putAll
(
useDetail
);
}
detail
.
put
(
"proDuctPhoto"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"proDuctPhoto"
))));
...
...
@@ -500,22 +546,22 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
throw
new
BadRequest
(
"使用登记证导出失败,请稍后重试!"
);
}
//登记机关
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getReceiveOrgName
()))
{
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getReceiveOrgName
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,登记机关为空!"
);
}
exportParamsMap
.
put
(
"receiveOrgName"
,
useRegistration
.
getReceiveOrgName
());
//使用登记证编号
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getUseRegistrationCode
()))
{
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getUseRegistrationCode
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,使用登记证编号为空!"
);
}
exportParamsMap
.
put
(
"useRegistrationCode"
,
useRegistration
.
getUseRegistrationCode
());
//使用单位名称
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getUseUnitName
()))
{
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getUseUnitName
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,使用单位名称为空!"
);
}
exportParamsMap
.
put
(
"useUnitName"
,
useRegistration
.
getUseUnitName
());
//监管码
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getSupervisoryCode
()))
{
if
(
ValidationUtil
.
isEmpty
(
useRegistration
.
getSupervisoryCode
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,监管码为空!"
);
}
exportParamsMap
.
put
(
"supervisoryCode"
,
useRegistration
.
getSupervisoryCode
());
...
...
@@ -527,7 +573,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
useRegistrationEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
//设备种类、类别、品种
String
equList
=
registerInfo
.
getEquList
();
//设备种类
String
equCategory
=
registerInfo
.
getEquCategory
();
//设备类别
...
...
@@ -536,39 +582,39 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List
<
EquipmentCategory
>
categoryList1
=
commonService
.
getEquipmentCategoryList
(
equCategory
,
null
);
List
<
EquipmentCategory
>
categoryList2
=
commonService
.
getEquipmentCategoryList
(
equDefine
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
categoryList0
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList0
.
get
(
0
).
getName
()))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList0
.
get
(
0
).
getName
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备种类为空!"
);
}
exportParamsMap
.
put
(
"equList"
,
categoryList0
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList1
.
get
(
0
).
getName
()))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList1
.
get
(
0
).
getName
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备类别为空!"
);
}
exportParamsMap
.
put
(
"equCategory"
,
categoryList1
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList2
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList2
.
get
(
0
).
getName
()))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList2
.
get
(
0
).
getName
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备品种为空!"
);
}
exportParamsMap
.
put
(
"equDefine"
,
categoryList2
.
get
(
0
).
getName
());
}
//设备代码
if
(
ValidationUtil
.
isEmpty
(
registerInfo
.
getEquCode
()))
{
if
(
ValidationUtil
.
isEmpty
(
registerInfo
.
getEquCode
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备代码为空!"
);
}
exportParamsMap
.
put
(
"equCode"
,
registerInfo
.
getEquCode
());
}
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
useRegistrationEq
.
getEquId
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
))
{
if
(
ValidationUtil
.
isEmpty
(
useInfo
.
getUseInnerCode
()))
{
if
(!
ValidationUtil
.
isEmpty
(
useInfo
))
{
if
(
ValidationUtil
.
isEmpty
(
useInfo
.
getUseInnerCode
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备单位内部编码为空!"
);
}
//单位内部编码
exportParamsMap
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
());
//设备使用地址
String
fullAddress
=
""
;
String
fullAddress
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
useInfo
.
getProvinceName
()))
{
fullAddress
+=
useInfo
.
getProvinceName
();
}
...
...
@@ -584,7 +630,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
useInfo
.
getAddress
()))
{
fullAddress
+=
useInfo
.
getAddress
();
}
if
(
ValidationUtil
.
isEmpty
(
fullAddress
))
{
if
(
ValidationUtil
.
isEmpty
(
fullAddress
))
{
throw
new
BadRequest
(
"使用登记证导出失败,设备使用地址为空!"
);
}
exportParamsMap
.
put
(
"fullAddress"
,
fullAddress
);
...
...
@@ -592,8 +638,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgFactoryInfo
factoryInfo
=
idxBizJgFactoryInfoService
.
getOneData
(
useRegistrationEq
.
getEquId
());
//产品编号(出厂编号)
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
))
{
if
(
ValidationUtil
.
isEmpty
(
factoryInfo
.
getFactoryNum
()))
{
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
))
{
if
(
ValidationUtil
.
isEmpty
(
factoryInfo
.
getFactoryNum
()))
{
throw
new
BadRequest
(
"使用登记证导出失败,产品编号为空!"
);
}
exportParamsMap
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/json/urlInfo.json
View file @
1785eb56
...
...
@@ -75,13 +75,13 @@
"type"
:
"107"
,
"pageType"
:
"look"
,
"name"
:
"使用登记"
,
"url"
:
"
url:/mixuap?appId=1742358052905971713&id=1735202405437435906
&roleIds={roleIds}&userId={userId}&pageType=look"
"url"
:
"
/mixuap?appId=1742358052905971713&id=1734864899516952578
&roleIds={roleIds}&userId={userId}&pageType=look"
},
{
"type"
:
"107"
,
"pageType"
:
"edit"
,
"name"
:
"使用登记"
,
"url"
:
"
url:/mixuap?appId=1742358052905971713&id=1735202405437435906
&roleIds={roleIds}&userId={userId}&pageType=edit"
"url"
:
"
/mixuap?appId=1742358052905971713&id=1734864899516952578
&roleIds={roleIds}&userId={userId}&pageType=edit"
},
{
"type"
:
"108"
,
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/UseInfo.java
View file @
1785eb56
...
...
@@ -186,12 +186,12 @@ public class UseInfo extends AbstractEquipBaseEntity {
@TableField
(
value
=
"\"IS_NOT_ES\""
)
private
Integer
isNotEs
;
@TableField
(
value
=
"
NEXT_INSPECT_DATE
"
)
@TableField
(
value
=
"
\"NEXT_INSPECT_DATE\"
"
)
private
Date
nextInspectDate
;
@TableField
(
value
=
"
LAST_INSPECT_REPORT_NO
"
)
@TableField
(
value
=
"
\"LAST_INSPECT_REPORT_NO\"
"
)
private
String
lastInspectReportNo
;
@TableField
(
value
=
"
LAST_INSPECT_TYPE
"
)
@TableField
(
value
=
"
\"LAST_INSPECT_TYPE\"
"
)
private
String
lastInspectType
;
}
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