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
9332a7a1
Commit
9332a7a1
authored
Jan 11, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改单位变更登记
parent
a7911fd0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
161 additions
and
108 deletions
+161
-108
TaskModelDto.java
...com/yeejoin/amos/boot/module/jg/api/dto/TaskModelDto.java
+3
-3
JgChangeRegistrationUnit.java
...s/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
+3
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+1
-2
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+154
-103
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/TaskModelDto.java
View file @
9332a7a1
...
...
@@ -30,15 +30,15 @@ public class TaskModelDto {
private
String
taskCode
;
/**
* 流程任务ID
*
*
/
*/
private
String
flowCode
;
/**
* 统一定义的枚举code 例如 6612 待受理
*
*
/
*/
private
Integer
flowStatus
;
/**
* 统一定义的枚举code 例如 6612 待受理
*
*
/
*/
private
String
flowStatusLabel
;
/**
* 摘要-来源
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
View file @
9332a7a1
...
...
@@ -215,4 +215,7 @@ public class JgChangeRegistrationUnit extends BaseEntity {
@TableField
(
"equ_address"
)
private
String
equAddress
;
@TableField
(
exist
=
false
)
private
String
supervisoryCode
;
}
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/CommonServiceImpl.java
View file @
9332a7a1
...
...
@@ -629,8 +629,6 @@ public class CommonServiceImpl implements ICommonService {
break
;
}
}
model
.
setFlowStatus
(
obj
.
getTaskStatus
());
model
.
setFlowCode
(
obj
.
getTaskStatusLabel
());
model
.
setTaskStatus
(
0
);
model
.
setFlowInstanceId
(
model
.
getRelationId
());
model
.
setTaskTitle
(
obj
.
getStartUser
()
+
"发起了"
+
obj
.
getTaskName
());
...
...
@@ -654,6 +652,7 @@ public class CommonServiceImpl implements ICommonService {
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public
TaskV2Model
updateTaskModel
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
...
...
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/JgChangeRegistrationUnitServiceImpl.java
View file @
9332a7a1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -9,9 +10,14 @@ import com.aspose.words.SaveFormat;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
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.*
;
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.*
;
...
...
@@ -25,12 +31,10 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
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.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -64,20 +68,23 @@ import java.util.stream.Collectors;
* @date 2023-12-22
*/
@Service
public
class
JgChangeRegistrationUnitServiceImpl
extends
BaseService
<
JgChangeRegistrationUnitDto
,
JgChangeRegistrationUnit
,
JgChangeRegistrationUnitMapper
>
implements
IJgChangeRegistrationUnitService
{
public
class
JgChangeRegistrationUnitServiceImpl
extends
BaseService
<
JgChangeRegistrationUnitDto
,
JgChangeRegistrationUnit
,
JgChangeRegistrationUnitMapper
>
implements
IJgChangeRegistrationUnitService
{
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
JgChangeRegistrationUnitEqMapper
JgChangeRegistrationUnitEqMapper
;
@Autowired
CmWorkflowServiceImpl
cmWorkflowService
;
@Autowired
private
JgChangeRegistrationUnitMapper
JgChangeRegistrationUnitMapper
;
// @Autowired
// private EquipmentCategoryServiceImpl equipmentCategoryService;
...
...
@@ -91,6 +98,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
SupervisoryCodeInfoMapper
supervisoryCodeInfoMapper
;
@Autowired
CommonServiceImpl
commonServiceImpl
;
@Autowired
WorkFlowFeignService
workFlowFeginService
;
...
...
@@ -124,10 +133,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
ICommonService
commonService
;
@Autowired
ICommonService
commonService
;
public
static
byte
[]
file2byte
(
File
file
)
{
...
...
@@ -159,13 +165,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
Map
<
String
,
Object
>
changeInfo
=
BeanUtil
.
beanToMap
(
notice
);
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgName
()))
{
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgName
()))
{
changeInfo
.
put
(
"receiveOrgCode"
,
notice
.
getReceiveOrgCode
()
+
"_"
+
notice
.
getReceiveOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitName
()))
{
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitName
()))
{
changeInfo
.
put
(
"useUnitCreditCode"
,
notice
.
getUseUnitCreditCode
()
+
"_"
+
notice
.
getUseUnitName
());
}
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitName
()))
{
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitName
()))
{
changeInfo
.
put
(
"newUseUnitCreditCode"
,
notice
.
getNewUseUnitCreditCode
()
+
"_"
+
notice
.
getNewUseUnitName
());
}
changeInfo
.
put
(
"changeCertificateList"
,
notice
.
getChangeCertificate
());
...
...
@@ -177,11 +183,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 设备信息
List
<
Map
<
String
,
Object
>>
equipmentInfos
=
JgChangeRegistrationUnitMapper
.
queryEquipInformation
(
sequenceNbr
);
for
(
String
s
:
fields
)
{
if
(
changeInfo
.
containsKey
(
s
))
{
for
(
String
s
:
fields
)
{
if
(
changeInfo
.
containsKey
(
s
))
{
changeInfo
.
put
(
s
,
JSON
.
parseArray
(
changeInfo
.
get
(
s
).
toString
()));
}
if
(
equipmentInfos
.
get
(
0
).
containsKey
(
s
))
{
if
(
equipmentInfos
.
get
(
0
).
containsKey
(
s
))
{
equipmentInfos
.
get
(
0
).
put
(
s
,
JSON
.
parseArray
(
equipmentInfos
.
get
(
0
).
get
(
s
).
toString
()));
}
}
...
...
@@ -222,7 +228,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
noticeDto
.
setInstanceId
(
instanceId
);
// 查询下节点任务
getNext
(
roleListFirst
,
instanceId
,
taskName
);
getNext
(
roleListFirst
,
instanceId
,
taskName
);
noticeDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
...
...
@@ -231,13 +237,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
JgChangeRegistrationUnit
notice
=
new
JgChangeRegistrationUnit
();
JgChangeRegistrationUnit
noticeOld
=
JgChangeRegistrationUnitMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
BeanUtils
.
copyProperties
(
noticeOld
,
notice
);
BeanUtils
.
copyProperties
(
noticeOld
,
notice
);
boolean
submit
=
submit
(
notice
,
op
);
notice
.
setChangeCertificate
(
noticeDto
.
getChangeCertificate
());
notice
.
setRemark
(
noticeDto
.
getRemark
());
if
(
submit
)
{
if
(
submit
)
{
// 查询下节点任务
getNext
(
roleListSecond
,
notice
.
getInstanceId
(),
taskName
);
getNext
(
roleListSecond
,
notice
.
getInstanceId
(),
taskName
);
notice
.
setStatus
(
taskName
[
0
]);
if
(!
ObjectUtils
.
isEmpty
(
notice
.
getInstanceStatus
()))
{
notice
.
setInstanceStatus
(
notice
.
getInstanceStatus
()
+
","
+
roleListSecond
);
...
...
@@ -258,7 +264,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
/**
* 分页查询
*
...
...
@@ -268,7 +273,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
* @return 单位变更列表
*/
@Override
public
Page
<
JgChangeRegistrationUnitDto
>
queryForJgChangeRegistrationUnitPage
(
Page
<
JgChangeRegistrationUnit
>
page
,
JgChangeRegistrationUnitDto
model
,
String
type
,
ReginParams
reginParams
)
{
public
Page
<
JgChangeRegistrationUnitDto
>
queryForJgChangeRegistrationUnitPage
(
Page
<
JgChangeRegistrationUnit
>
page
,
JgChangeRegistrationUnitDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
;
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
...
...
@@ -317,7 +322,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
public
void
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
String
[]
taskName
=
new
String
[]{
"流程结束"
};
...
...
@@ -340,63 +345,80 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
WorkflowResultDto
>
workflowResultDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deviceList
.
size
()
;
i
++
for
(
int
i
=
0
;
i
<
deviceList
.
size
()
;
i
++
)
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
i
));
//
dto.setCompleteFirstTask(true);
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
}
actWorkflowBatchDTO
.
setProcess
(
list
);
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
for
(
Object
obj
:
returnList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
instanceId
=
jsonObject
.
getString
(
"id"
);
instanceIdList
.
add
(
instanceId
);
// 查询下节点任务
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
getNext
(
roleListFirst
,
instanceId
,
taskName
);
}
// 推动下一个节点
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
""
);
HashMap
<
String
,
Object
>
stringObjectHashMap
=
new
HashMap
<>();
stringObjectHashMap
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariable
(
stringObjectHashMap
);
//执行流程
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
getNext
(
roleListSecond
,
instanceId
,
taskName
);
}
else
{
log
.
error
(
"提交失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
// if (CollectionUtil.isNotEmpty(processTaskDTOS)){
// for (ProcessTaskDTO processTaskDTO : processTaskDTOS) {
// instanceIdList.add(processTaskDTO.getProcessInstance().getId());
// }
// roleListFirst.addAll(processTaskDTOS.get(0).getCandidateGroups());
// Map<String, List<String>> nextCandidateGroups = processTaskDTOS.get(0).getNextCandidateGroups();
// for (String s : nextCandidateGroups.keySet()) {
// roleListSecond.addAll(nextCandidateGroups.get(s));
// }
// String id = processTaskDTOS.get(0).getNextTask().get(0).getId();
// List<AgencyUserModel> agencyUserModels = processTaskDTOS.get(0).getNextTaskExecutor().get(id);
// if ()
// }
// try {
// FeignClientResult result = Workflow.taskV2Client.startByVariableBatch(actWorkflowBatchDTO);
// List<Object> returnList = (List<Object>) result.getResult();
// for (Object obj : returnList
// ) {
// JSONObject jsonObject = JSON.parseObject(JSONObject.toJSONString(obj));
// String instanceId = jsonObject.getString("id");
// instanceIdList.add(instanceId);
// // 查询下节点任务
// if (returnList.get(0).equals(obj)) {
// getNext(roleListFirst, instanceId, taskName);
// }
// // 推动下一个节点
// AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
// JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
// String taskId = dataObject.getString("id");
// //组装信息
// TaskResultDTO dto = new TaskResultDTO();
// dto.setResultCode("approvalStatus");
// dto.setTaskId(taskId);
// dto.setComment("");
// HashMap<String, Object> stringObjectHashMap = new HashMap<>();
// stringObjectHashMap.put("approvalStatus", "0");
// dto.setVariable(stringObjectHashMap);
// //执行流程
// AjaxResult ajaxResult1 = null;
// try {
// ajaxResult1 = Workflow.taskClient.completeByTask(taskId, dto);
// if (ajaxResult1.get("code").equals(200)) {
// getNext(roleListSecond, instanceId, taskName);
// } else {
// log.error("提交失败");
// }
// } catch (Exception e) {
// log.error("提交失败:{}", e);
// }
// }
// } catch (Exception e) {
// log.error("提交失败:{}", e);
// }
}
List
<
JgChangeRegistrationUnit
>
list
=
new
ArrayList
<>();
...
...
@@ -409,7 +431,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
applyNo
=
applyNoList
.
get
(
i
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
...
...
@@ -420,9 +442,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
dto
.
setEquType
((
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY"
))));
dto
.
setProductNameB
((
String
.
valueOf
(
obj
.
get
(
"PRODUCT_NAME"
))));
dto
.
setEquCodeB
((
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
))));
dto
.
setUseInnerCode
(
ValidationUtil
.
isEmpty
(
obj
.
get
(
"USE_INNER_CODE"
))
?
""
:
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)));
dto
.
setUseInnerCode
(
ValidationUtil
.
isEmpty
(
obj
.
get
(
"USE_INNER_CODE"
))
?
""
:
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)));
dto
.
setEquAddress
((
String
.
valueOf
(
obj
.
get
(
"ADDRESS"
))));
dto
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"SUPERVISORY_CODE"
)));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setUnitChangeRegistrationId
(
applyNo
);
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
...
...
@@ -435,8 +457,36 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
equipList
.
add
(
jgRelationEquip
);
});
WorkflowResultDto
workDto
=
new
WorkflowResultDto
();
JgChangeRegistrationUnitMapper
.
insertBatchSomeColumn
(
list
);
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
for
(
JgChangeRegistrationUnit
obj
:
list
)
{
TaskModelDto
dto
=
new
TaskModelDto
();
dto
.
setModel
(
obj
);
dto
.
setFlowCreateDate
(
new
Date
());
dto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
dto
.
setFlowCode
(
""
);
dto
.
setTaskContent
(
"来自"
+
obj
.
getEquType
()+
"【"
+
obj
.
getSupervisoryCode
()+
"】的业务办理,【申请单号:"
+
obj
.
getApplyNo
()+
"】"
);
//dto.setTaskDesc();
dto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
dto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
dto
.
setRelationId
(
obj
.
getInstanceId
());
dto
.
setExecuteUserIds
(
workDto
.
getNextExecutorUserIds
());
dto
.
setTaskStatusLabel
(
"未处理"
);
dto
.
setFlowStatus
(
commonServiceImpl
.
getDictionaryCodeByName
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
()));
dto
.
setFlowStatusLabel
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
dto
.
setStartUserId
(
RequestContext
.
getExeUserId
());
dto
.
setStartUser
(
workflowResultDtos
.
get
(
0
).
getStartUserName
());
dto
.
setStartUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setStartDate
(
new
Date
());
dto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
dto
);
}
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgChangeRegistrationUnit
>
collect
=
list
.
stream
().
filter
(
JgChangeRegistrationUnit
->
jgRelationEquip
.
getUnitChangeRegistrationId
().
equals
(
JgChangeRegistrationUnit
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
...
...
@@ -469,7 +519,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private
void
convertField
(
JgChangeRegistrationUnitDto
model
)
{
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
model
.
setChangeCertificate
(
JSON
.
toJSONString
(
model
.
getChangeCertificateList
()));
}
...
...
@@ -524,7 +574,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
map
));
//设备监管码
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
equipId
);
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
equipId
);
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
jgRegistrationHistory
.
setSupervisoryCode
(
tzsJgOtherInfo
.
getSupervisoryCode
());
if
(
map
.
containsKey
(
"type"
)
&&
"edit"
.
equals
(
String
.
valueOf
(
map
.
get
(
"type"
))))
{
...
...
@@ -532,12 +582,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
jgRegistrationHistoryMapper
.
updateById
(
jgRegistrationHistory
);
}
else
{
//当前单据id
jgRegistrationHistory
.
setCurrentDocumentId
(
map
.
get
(
"applyNo"
).
toString
());
jgRegistrationHistory
.
setCurrentDocumentId
(
map
.
get
(
"applyNo"
).
toString
());
jgRegistrationHistoryMapper
.
insert
(
jgRegistrationHistory
);
}
}
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
notice
.
getInstanceId
());
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
...
...
@@ -546,11 +596,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getProcessAdvice
()))
{
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getProcessAdvice
()))
{
dto
.
setComment
(
notice
.
getProcessAdvice
());
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
notice
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
notice
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())
)
{
if
(
notice
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
notice
.
getStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())
)
{
map
.
put
(
"approvalStatus"
,
"提交"
);
}
else
{
map
.
put
(
"approvalStatus"
,
op
);
...
...
@@ -576,8 +626,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
FeignClientResult
ajaxResult
=
Workflow
.
taskV2Client
.
rollBack
(
noticeDto
.
getInstanceId
());
JgChangeRegistrationUnit
JgChangeRegistrationUnit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
if
(
ajaxResult
.
getStatus
()
==
200
)
{
getNext
(
roleList
,
noticeDto
.
getInstanceId
(),
taskName
);
if
(
ajaxResult
.
getStatus
()
==
200
)
{
getNext
(
roleList
,
noticeDto
.
getInstanceId
(),
taskName
);
JgChangeRegistrationUnit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskName
[
0
]).
getRollBack
());
JgChangeRegistrationUnit
.
setPromoter
(
""
);
JgChangeRegistrationUnit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
));
...
...
@@ -586,7 +636,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
@Transactional
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
)
{
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
)
{
String
[]
taskName
=
new
String
[]{
"已完成"
};
String
userId
=
RequestContext
.
getExeUserId
();
JgChangeRegistrationUnit
jgChangeRegistrationUnit
=
this
.
JgChangeRegistrationUnitMapper
.
selectById
(
dto
.
getSequenceNbr
());
...
...
@@ -594,32 +644,32 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
boolean
submit
=
submit
(
jgChangeRegistrationUnit
,
op
);
if
(
submit
)
{
getNext
(
roleList
,
dto
.
getInstanceId
(),
taskName
);
if
(
submit
)
{
getNext
(
roleList
,
dto
.
getInstanceId
(),
taskName
);
jgChangeRegistrationUnit
.
setStatus
(
taskName
[
0
]);
if
(
"0"
.
equals
(
op
))
{
if
(
roleList
.
size
()
==
0
)
{
if
(
"0"
.
equals
(
op
))
{
if
(
roleList
.
size
()
==
0
)
{
jgChangeRegistrationUnit
.
setStatus
(
taskName
[
0
]);
jgChangeRegistrationUnit
.
setAuditPassDate
(
new
Date
());
// 生成新的使用登记编号,使用登记证 修改设备的使用登记信息表,使用单位名称,使用单位统一信用代码,使用登记证编号,更新ES
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
dto
.
getSequenceNbr
());
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
dto
.
getSequenceNbr
());
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
=
JgChangeRegistrationUnitEqMapper
.
selectOne
(
queryWrapper
);
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
useInfo
.
setUseUnitName
(
jgChangeRegistrationUnit
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
jgChangeRegistrationUnit
.
getNewUseUnitCreditCode
());
String
code
=
getCode
(
tzsJgOtherInfo
.
getSupervisoryCode
());
if
(
ValidationUtil
.
isEmpty
(
code
))
{
if
(
ValidationUtil
.
isEmpty
(
code
))
{
log
.
error
(
"生成新的使用登记证编号失败"
);
return
;
}
...
...
@@ -632,8 +682,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"USE_ORG_CODE"
,
code
);
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
jgChangeRegistrationUnit
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
jgChangeRegistrationUnit
.
getNewUseUnitName
());
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
jgChangeRegistrationUnit
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
jgChangeRegistrationUnit
.
getNewUseUnitName
());
resultMap
.
put
(
equipId
,
map1
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
//修改各类告知列表,置为废弃
...
...
@@ -701,18 +751,18 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
*
* @param sequenceNbr
*/
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
,
HttpServletResponse
response
)
{
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
//查询移装变更详情
JgChangeRegistrationUnit
transfer
=
this
.
getById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
transfer
.
getSequenceNbr
());
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
transfer
.
getSequenceNbr
());
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
=
JgChangeRegistrationUnitEqMapper
.
selectOne
(
queryWrapper
);
if
(
ValidationUtil
.
isEmpty
(
transfer
)
||
ValidationUtil
.
isEmpty
(
jgChangeRegistrationUnitEq
))
{
throw
new
BadRequest
(
"使用登记证导出失败,请稍后重试!"
);
}
//是否废弃
exportParamsMap
.
put
(
"isInvalid"
,
ValidationUtil
.
isEmpty
(
jgChangeRegistrationUnitEq
.
getIsInvalid
())
?
"0"
:
jgChangeRegistrationUnitEq
.
getIsInvalid
());
exportParamsMap
.
put
(
"isInvalid"
,
ValidationUtil
.
isEmpty
(
jgChangeRegistrationUnitEq
.
getIsInvalid
())
?
"0"
:
jgChangeRegistrationUnitEq
.
getIsInvalid
());
//登记机关
exportParamsMap
.
put
(
"receiveOrgName"
,
transfer
.
getReceiveOrgName
());
//使用登记证编号
...
...
@@ -721,7 +771,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
exportParamsMap
.
put
(
"useUnitName"
,
transfer
.
getUseUnitName
());
//监管码
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
exportParamsMap
.
put
(
"supervisoryCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
//发证日期(当前时间)
...
...
@@ -734,7 +784,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
jgChangeRegistrationUnitEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
//设备种类、类别、品种
String
equList
=
registerInfo
.
getEquList
();
//设备种类
String
equCategory
=
registerInfo
.
getEquCategory
();
//设备类别
...
...
@@ -747,7 +797,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
exportParamsMap
.
put
(
"equCategory"
,
categoryList1
.
get
(
0
).
getName
());
}
if
(!
ValidationUtil
.
isEmpty
(
equDefine
))
{
if
(!
ValidationUtil
.
isEmpty
(
equDefine
))
{
List
<
EquipmentCategory
>
categoryList2
=
commonService
.
getEquipmentCategoryList
(
equDefine
,
null
);
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
categoryList2
))
{
exportParamsMap
.
put
(
"equDefine"
,
categoryList2
.
get
(
0
).
getName
());
...
...
@@ -759,25 +809,25 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
//单位内部编码
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
jgChangeRegistrationUnitEq
.
getEquId
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
useInfo
))
{
exportParamsMap
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
());
String
fullAddress
=
""
;
String
province
=
ValidationUtil
.
isEmpty
(
useInfo
.
getProvinceName
())
?
""
:
useInfo
.
getProvinceName
();
String
city
=
ValidationUtil
.
isEmpty
(
useInfo
.
getCityName
())
?
""
:
useInfo
.
getCityName
();
String
county
=
ValidationUtil
.
isEmpty
(
useInfo
.
getCountyName
())
?
""
:
useInfo
.
getCountyName
();
String
street
=
ValidationUtil
.
isEmpty
(
useInfo
.
getStreetName
())
?
""
:
useInfo
.
getStreetName
();
String
address
=
ValidationUtil
.
isEmpty
(
useInfo
.
getAddress
())
?
""
:
useInfo
.
getAddress
();
String
fullAddress
=
""
;
String
province
=
ValidationUtil
.
isEmpty
(
useInfo
.
getProvinceName
())
?
""
:
useInfo
.
getProvinceName
();
String
city
=
ValidationUtil
.
isEmpty
(
useInfo
.
getCityName
())
?
""
:
useInfo
.
getCityName
();
String
county
=
ValidationUtil
.
isEmpty
(
useInfo
.
getCountyName
())
?
""
:
useInfo
.
getCountyName
();
String
street
=
ValidationUtil
.
isEmpty
(
useInfo
.
getStreetName
())
?
""
:
useInfo
.
getStreetName
();
String
address
=
ValidationUtil
.
isEmpty
(
useInfo
.
getAddress
())
?
""
:
useInfo
.
getAddress
();
fullAddress
=
province
+
city
+
county
+
street
+
address
;
exportParamsMap
.
put
(
"fullAddress"
,
fullAddress
);
}
IdxBizJgFactoryInfo
factoryInfo
=
idxBizJgFactoryInfoService
.
getOneData
(
jgChangeRegistrationUnitEq
.
getEquId
());
//产品编号(出厂编号)
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
))
{
exportParamsMap
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
());
}
//调用生成使用登记证
commonService
.
generateCertificateReport
(
exportParamsMap
,
response
);
commonService
.
generateCertificateReport
(
exportParamsMap
,
response
);
}
}
\ No newline at end of file
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