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
40f305da
Commit
40f305da
authored
Jul 18, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21052 单位变更限制设备不能多次出现在执行的流程中
parent
257813b0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
206 deletions
+102
-206
IJgChangeRegistrationUnitService.java
...dule/jg/api/service/IJgChangeRegistrationUnitService.java
+1
-1
JgChangeRegistrationUnitController.java
...jg/biz/controller/JgChangeRegistrationUnitController.java
+26
-26
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+75
-179
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/service/IJgChangeRegistrationUnitService.java
View file @
40f305da
...
@@ -33,7 +33,7 @@ public interface IJgChangeRegistrationUnitService {
...
@@ -33,7 +33,7 @@ public interface IJgChangeRegistrationUnitService {
* @param noticeDto 安装告知
* @param noticeDto 安装告知
* @param op 操作类型
* @param op 操作类型
*/
*/
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
);
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
,
ReginParams
reginParams
);
/**
/**
* 分页查询
* 分页查询
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationUnitController.java
View file @
40f305da
...
@@ -3,34 +3,30 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
...
@@ -3,34 +3,30 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
io.swagger.annotations.ApiParam
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.swagger.annotations.ApiOperation
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
/**
* 单位变更登记
* 单位变更登记
*
*
...
@@ -77,7 +73,9 @@ public class JgChangeRegistrationUnitController extends BaseController {
...
@@ -77,7 +73,9 @@ public class JgChangeRegistrationUnitController extends BaseController {
}
}
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"changeRegisInfo"
)).
get
(
"changeCertificateList"
);
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"changeRegisInfo"
)).
get
(
"changeCertificateList"
);
jgChangeRegistrationUnitDto
.
setChangeCertificateList
((
List
<
Map
<
String
,
Object
>>)
o
);
jgChangeRegistrationUnitDto
.
setChangeCertificateList
((
List
<
Map
<
String
,
Object
>>)
o
);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
updateInstallationNotice
(
submitType
,
jgChangeRegistrationUnitDto
,
op
));
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
updateInstallationNotice
(
submitType
,
jgChangeRegistrationUnitDto
,
op
,
reginParams
));
}
}
/**
/**
...
@@ -137,18 +135,17 @@ public class JgChangeRegistrationUnitController extends BaseController {
...
@@ -137,18 +135,17 @@ public class JgChangeRegistrationUnitController extends BaseController {
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
(
required
=
false
)
JgChangeRegistrationUnitDto
model
@RequestBody
(
required
=
false
)
JgChangeRegistrationUnitDto
model
)
{
)
{
Page
<
JgChangeRegistrationUnit
>
page
=
new
Page
<>(
current
,
size
);
Page
<
JgChangeRegistrationUnit
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
info
=
getSelectedOrgInfo
();
if
(
reginParams
.
getCompany
().
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
))
{
if
(
info
.
getCompany
().
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
)){
type
=
"enterprise"
;
type
=
"enterprise"
;
}
else
{
}
else
{
type
=
"supervision"
;
type
=
"supervision"
;
}
}
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryForJgChangeRegistrationUnitPage
(
page
,
sort
,
model
,
type
,
reginParams
));
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryForJgChangeRegistrationUnitPage
(
page
,
sort
,
model
,
type
,
reginParams
));
}
}
/**
/**
...
@@ -164,6 +161,7 @@ public class JgChangeRegistrationUnitController extends BaseController {
...
@@ -164,6 +161,7 @@ public class JgChangeRegistrationUnitController extends BaseController {
if
(
Objects
.
isNull
(
installationInfo
))
{
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
cancel
(
installationInfo
);
jgChangeRegistrationUnitServiceImpl
.
cancel
(
installationInfo
);
return
ResponseHelper
.
buildResponse
(
installationInfo
);
return
ResponseHelper
.
buildResponse
(
installationInfo
);
}
}
...
@@ -178,18 +176,20 @@ public class JgChangeRegistrationUnitController extends BaseController {
...
@@ -178,18 +176,20 @@ public class JgChangeRegistrationUnitController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更受理"
,
notes
=
"单位变更受理"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更受理"
,
notes
=
"单位变更受理"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
accept
(
@RequestBody
Map
<
String
,
Object
>
model
,
String
op
)
{
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
accept
(
@RequestBody
Map
<
String
,
Object
>
model
,
String
op
)
{
// TODO 受理单位变更流程
// TODO 受理单位变更流程
LinkedHashMap
model1
=
(
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
);
LinkedHashMap
model1
=
(
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
);
String
opinion
=
(
String
)
model
.
get
(
"opinion"
);
String
opinion
=
(
String
)
model
.
get
(
"opinion"
);
LinkedHashMap
installationInfo
=
(
LinkedHashMap
)
model1
.
get
(
"changeRegisInfo"
);
LinkedHashMap
installationInfo
=
(
LinkedHashMap
)
model1
.
get
(
"changeRegisInfo"
);
JgChangeRegistrationUnitDto
jgInstallationNoticeDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installationInfo
),
JgChangeRegistrationUnitDto
.
class
);
JgChangeRegistrationUnitDto
jgInstallationNoticeDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installationInfo
),
JgChangeRegistrationUnitDto
.
class
);
jgInstallationNoticeDto
.
setProcessAdvice
(
opinion
);
jgInstallationNoticeDto
.
setProcessAdvice
(
opinion
);
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
/**
/**
* 导出使用登记证
* 导出使用登记证
*
* @param response 返回
* @param response 返回
* @param sequenceNbr 主键
* @param sequenceNbr 主键
* @param printType 打印类型,0-正常打印,1-套打(默认0)
* @param printType 打印类型,0-正常打印,1-套打(默认0)
...
...
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 @
40f305da
...
@@ -29,7 +29,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
...
@@ -29,7 +29,6 @@ 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.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
com.yeejoin.amos.feign.workflow.model.*
;
...
@@ -68,6 +67,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -68,6 +67,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
@Autowired
@Autowired
...
@@ -246,7 +246,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -246,7 +246,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
* @param noticeDto 单位变更
* @param noticeDto 单位变更
*/
*/
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
)
{
public
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
,
ReginParams
reginParams
)
{
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
}
...
@@ -273,7 +273,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -273,7 +273,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ArrayList
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListNext
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListNext
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
// 发起流程
// 发起流程
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
List
<
ProcessTaskDTO
>
processTasks
=
new
ArrayList
<>();
List
<
ProcessTaskDTO
>
processTasks
=
new
ArrayList
<>();
...
@@ -295,12 +294,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -295,12 +294,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
JgChangeRegistrationUnit
notice
=
new
JgChangeRegistrationUnit
();
JgChangeRegistrationUnit
notice
=
new
JgChangeRegistrationUnit
();
// JgChangeRegistrationUnit noticeOld = JgChangeRegistrationUnitMapper.selectById(noticeDto.getSequenceNbr());
BeanUtils
.
copyProperties
(
noticeDto
,
notice
);
BeanUtils
.
copyProperties
(
noticeDto
,
notice
);
// boolean submit = submit(notice, op);
notice
.
setChangeCertificate
(
noticeDto
.
getChangeCertificate
());
notice
.
setChangeCertificate
(
noticeDto
.
getChangeCertificate
());
notice
.
setRemark
(
noticeDto
.
getRemark
());
notice
.
setRemark
(
noticeDto
.
getRemark
());
// notice.setStatus(taskName[0]);
if
(!
ObjectUtils
.
isEmpty
(
notice
.
getInstanceStatus
()))
{
if
(!
ObjectUtils
.
isEmpty
(
notice
.
getInstanceStatus
()))
{
notice
.
setInstanceStatus
(
notice
.
getInstanceStatus
()
+
","
+
roleListAll
);
notice
.
setInstanceStatus
(
notice
.
getInstanceStatus
()
+
","
+
roleListAll
);
}
else
{
}
else
{
...
@@ -368,7 +364,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -368,7 +364,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
JgChangeRegistrationUnitMapper
.
updateById
(
bean
);
JgChangeRegistrationUnitMapper
.
updateById
(
bean
);
}
}
// updateHistorySingle(noticeDto.getSequenceNbr());
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
device
->
{
deviceList
.
forEach
(
device
->
{
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
...
@@ -396,14 +391,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -396,14 +391,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
noticeDto
.
getApplyNo
()));
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
noticeDto
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
registrationHistoryService
.
save
(
jgRegistrationHistory
);
return
noticeDto
;
}
private
void
updateHistorySingle
(
Long
seq
)
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
QueryWrapper
<
JgChangeRegistrationUnitEq
>
wrapper
=
new
QueryWrapper
<>();
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
wrapper
.
lambda
().
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
seq
);
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
List
<
JgChangeRegistrationUnitEq
>
eqs
=
jgChangeRegistrationUnitEqMapper
.
selectList
(
wrapper
);
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
()));
this
.
updateHistoryAsync
(
eqs
);
}
return
noticeDto
;
}
}
...
@@ -421,7 +415,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -421,7 +415,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
JgChangeRegistrationUnitDto
model
,
JgChangeRegistrationUnitDto
model
,
String
type
,
String
type
,
ReginParams
reginParams
)
{
ReginParams
reginParams
)
{
String
orgCode
;
String
orgCode
;
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
...
@@ -529,7 +522,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -529,7 +522,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
@Override
@Override
// @Transactional(rollbackFor = Exception.class)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
...
@@ -563,11 +555,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -563,11 +555,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw
new
BadRequest
(
"使用登记证下无设备"
);
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
}
for
(
JSONObject
jsonObject
:
deviceList
)
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取单位变更单号
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
...
@@ -576,7 +563,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -576,7 +563,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
// ArrayList<String> roleListSecond = new ArrayList<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
...
@@ -585,18 +571,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -585,18 +571,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 判断当前是否为提交
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//发起流程
//发起流程
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
// for (int i = 0; i < deviceList.size(); i++
// ) {
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setNextExecuteUserCompanyCode
(
model
.
getReceiveCompanyCode
());
dto
.
setNextExecuteUserCompanyCode
(
model
.
getReceiveCompanyCode
());
dto
.
setCompleteFirstTask
(
true
);
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
list
.
add
(
dto
);
// }
actWorkflowBatchDTO
.
setProcess
(
list
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
...
@@ -608,14 +590,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -608,14 +590,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
}
}
// List<JgChangeRegistrationUnit> list = new ArrayList<>();
// List<JgChangeRegistrationUnitEq> equipList = new ArrayList<>();
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
// deviceList.forEach(obj -> {
// JgChangeRegistrationUnitEq jgRelationEquip = new JgChangeRegistrationUnitEq();
// int i = deviceList.indexOf(obj);
// String applyNo = applyNoList.get(i);
model
.
setApplyNo
(
applyNoList
.
get
(
0
));
model
.
setApplyNo
(
applyNoList
.
get
(
0
));
model
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
model
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
model
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
model
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
...
@@ -628,15 +604,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -628,15 +604,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
model
.
setNewUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
model
.
setNewUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
model
.
setNewUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
model
.
setNewUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
// 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.setEquAddress((String.valueOf(obj.get("ADDRESS"))));
// dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
// dto.setEquList(String.valueOf(obj.get("EQU_LIST")));
// jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
// jgRelationEquip.setUnitChangeRegistrationId(applyNo);
if
(!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
model
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
model
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
}
}
...
@@ -649,11 +616,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -649,11 +616,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
model
.
setNextTaskId
(
taskIds
.
get
(
0
));
model
.
setNextTaskId
(
taskIds
.
get
(
0
));
}
}
// list.add(dto);
// equipList.add(jgRelationEquip);
// });
// WorkflowResultDto workDto = new WorkflowResultDto();
model
.
setSequenceNbr
(
sequence
.
nextId
());
model
.
setSequenceNbr
(
sequence
.
nextId
());
model
.
setCreateDate
(
new
Date
());
model
.
setCreateDate
(
new
Date
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
...
@@ -665,9 +627,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -665,9 +627,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// for (JgChangeRegistrationUnit obj : list) {
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
...
@@ -676,7 +636,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -676,7 +636,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setModel
(
ta
);
taskModelDto
.
setModel
(
ta
);
// dto.setModel(obj);
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
...
@@ -695,9 +654,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -695,9 +654,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
taskModelDto
);
modelDtos
.
add
(
taskModelDto
);
// }
}
else
{
}
else
{
// for (JgChangeRegistrationUnit obj : list) {
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
//行数据
//行数据
taskModelDto
.
setModel
(
registrationUnit
);
taskModelDto
.
setModel
(
registrationUnit
);
...
@@ -712,11 +669,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -712,11 +669,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
modelDtos
.
add
(
taskModelDto
);
modelDtos
.
add
(
taskModelDto
);
// }
// }
}
}
// for(JgChangeRegistrationUnit obj : list) {
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
// }
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
...
@@ -738,12 +691,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -738,12 +691,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
//使用登记证历史数据
//使用登记证历史数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
registrationList
));
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
registrationList
));
// 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();
// insertOrUpdateHis(JSON.parseObject(JSONObject.toJSONString(collect.get(0))), jgRelationEquip.getEquId());
// return jgRelationEquip.setUnitChangeRegistrationId(String.valueOf(sequenceNbr));
// }).collect(Collectors.toList());
//先删除之前设备关系数据,在插入最新设备关系数据
//先删除之前设备关系数据,在插入最新设备关系数据
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
...
@@ -752,6 +699,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -752,6 +699,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
registrationHistoryService
.
save
(
jgRegistrationHistory
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
Collections
.
singletonList
(
model
);
return
Collections
.
singletonList
(
model
);
}
}
...
@@ -776,25 +729,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -776,25 +729,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
void
getNext
(
ArrayList
<
String
>
roleListFirst
,
String
instanceId
,
String
[]
taskName
)
{
AjaxResult
aj
=
Workflow
.
taskClient
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskNoAuth
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
aj
.
get
(
"data"
)));
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
))
{
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeginService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskName
[
0
]
=
String
.
valueOf
(
taskInfo
.
get
(
"taskDefinitionKey"
));
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
private
void
convertField
(
JgChangeRegistrationUnitDto
model
)
{
private
void
convertField
(
JgChangeRegistrationUnitDto
model
)
{
// 处理图片
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
...
@@ -834,38 +768,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -834,38 +768,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
}
}
// private String convertImageUrl(List<Map<String, String>> urlList) {
// String urls = "";
// if (!CollectionUtils.isEmpty(urlList)) {
// urls = urlList.stream().map(map -> map.get("url")).collect(Collectors.joining(","));
// }
// return urls;
// }
//
// public void insertOrUpdateHis(JSONObject map, String equipId) {
// JgRegistrationHistory jgRegistrationHistory = new JgRegistrationHistory();
// //使用登记编号
// jgRegistrationHistory.setUseRegistrationCode(idxBizJgRegisterInfoMapper.getUseOrgCodeByEquip(equipId));
// //登记类别
// jgRegistrationHistory.setRegistrationClass("单位变更登记");
// //设备id
// jgRegistrationHistory.setEquId(equipId);
// //修改数据
// jgRegistrationHistory.setChangeData(JSONObject.toJSONString(map));
// //设备监管码
// LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
// 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")))) {
// jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(equipId, String.valueOf(map.get("sequenceNbr"))));
// jgRegistrationHistoryMapper.updateById(jgRegistrationHistory);
// } else {
// //当前单据id
// jgRegistrationHistory.setCurrentDocumentId(map.get("applyNo").toString());
// jgRegistrationHistoryMapper.insert(jgRegistrationHistory);
// }
// }
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
...
@@ -925,24 +827,25 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -925,24 +827,25 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 待调整
// 待调整
taskCode
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
();
taskCode
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
();
JgChangeRegistrationUnit
jgChangeRegistration
Unit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
JgChangeRegistrationUnit
change
Unit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
jgChangeRegistration
Unit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
change
Unit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
jgChangeRegistration
Unit
.
setPromoter
(
""
);
change
Unit
.
setPromoter
(
""
);
jgChangeRegistration
Unit
.
setNextTaskId
(
nextTaskId
);
change
Unit
.
setNextTaskId
(
nextTaskId
);
jgChangeRegistration
Unit
.
setNextExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
change
Unit
.
setNextExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
jgChangeRegistration
Unit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
change
Unit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
JgChangeRegistrationUnitMapper
.
updateById
(
jgChangeRegistration
Unit
);
JgChangeRegistrationUnitMapper
.
updateById
(
change
Unit
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
jgChangeRegistration
Unit
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
change
Unit
));
jsonObject
.
put
(
"nextTaskId"
,
jgChangeRegistration
Unit
.
getNextTaskId
());
jsonObject
.
put
(
"nextTaskId"
,
change
Unit
.
getNextTaskId
());
jsonObject
.
put
(
"nextExecuteUser"
,
jgChangeRegistration
Unit
.
getNextExecutorIds
());
jsonObject
.
put
(
"nextExecuteUser"
,
change
Unit
.
getNextExecutorIds
());
jsonObject
.
put
(
"taskType"
,
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
jsonObject
.
put
(
"taskType"
,
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
jsonObject
.
put
(
"flowStatus"
,
this
.
getTaskCodeByName
(
jgChangeRegistration
Unit
.
getStatus
()));
jsonObject
.
put
(
"flowStatus"
,
this
.
getTaskCodeByName
(
change
Unit
.
getStatus
()));
jsonObject
.
put
(
"flowStatusLabel"
,
jgChangeRegistration
Unit
.
getStatus
());
jsonObject
.
put
(
"flowStatusLabel"
,
change
Unit
.
getStatus
());
commonServiceImpl
.
rollbackTask
(
noticeDto
.
getInstanceId
(),
jsonObject
);
commonServiceImpl
.
rollbackTask
(
noticeDto
.
getInstanceId
(),
jsonObject
);
// redis流程实时数据更新
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
noticeDto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationUnit
));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
noticeDto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
changeUnit
));
this
.
delRepeatUseEquipData
(
changeUnit
.
getApplyNo
(),
changeUnit
.
getStatus
(),
changeUnit
.
getNewUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
...
@@ -960,9 +863,16 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -960,9 +863,16 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
build
();
.
build
();
}
}
// @Transactional(rollbackFor = Exception.class)
/**
* @param dto
* @param op void
* @param reginParams
* @description 执行流程
* @author wangguo
* @date 2024/7/18 11:00
**/
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
)
{
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
,
ReginParams
reginParams
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
dto
.
getInstanceId
());
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
dto
.
getInstanceId
());
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
try
{
try
{
...
@@ -979,12 +889,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -979,12 +889,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
taskId
=
dto
.
getNextTaskId
();
String
taskId
=
dto
.
getNextTaskId
();
JgChangeRegistrationUnit
registration
=
this
.
JgChangeRegistrationUnitMapper
.
selectById
(
dto
.
getSequenceNbr
());
JgChangeRegistrationUnit
registration
=
this
.
JgChangeRegistrationUnitMapper
.
selectById
(
dto
.
getSequenceNbr
());
registration
.
setProcessAdvice
(
dto
.
getProcessAdvice
());
registration
.
setProcessAdvice
(
dto
.
getProcessAdvice
());
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
// boolean submit = submit(jgChangeRegistrationUnit, op);
// if (submit) {
// getNext(roleList, dto.getInstanceId(), taskName);
//组装信息
//组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
TaskResultDTO
task
=
new
TaskResultDTO
();
...
@@ -1033,23 +939,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1033,23 +939,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
// String code = commonServiceImpl.generateRegistrationCode(equipId, tzsJgOtherInfo.getSupervisoryCode(), dto.getReceiveCompanyCode());
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
// if (ValidationUtil.isEmpty(code)) {
// log.error("生成新的使用登记证编号失败");
// return;
// }
useInfoMapper
.
updateById
(
useInfo
);
useInfoMapper
.
updateById
(
useInfo
);
// jgChangeRegistrationUnit.setUseRegistCode(code);
}
}
//更新使用注册登记证编号
// idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(equipId, code);
//es中的编号信息
//es中的编号信息
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
// map1.put("USE_ORG_CODE", code);
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
registration
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
registration
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
resultMap
.
put
(
equipId
,
map1
);
resultMap
.
put
(
equipId
,
map1
);
...
@@ -1106,6 +1003,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1106,6 +1003,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// redis流程实时数据更新
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
dto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
registration
));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
dto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
registration
));
this
.
delRepeatUseEquipData
(
registration
.
getApplyNo
(),
registration
.
getStatus
(),
registration
.
getNewUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
...
@@ -1116,6 +1014,43 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1116,6 +1014,43 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
}
}
/**
* 删除 redis校验重复引用设备的数据
*/
private
void
delRepeatUseEquipData
(
String
applyNo
,
String
status
,
String
companyCode
)
{
JgRegistrationHistory
history
=
registrationHistoryService
.
lambdaQuery
().
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
applyNo
).
one
();
// 获取使用登记证列表
JSONArray
registrationList
=
JSON
.
parseArray
(
history
.
getChangeData
());
if
(
CollectionUtils
.
isEmpty
(
registrationList
))
{
return
;
}
List
<
Long
>
registrationIdList
=
new
ArrayList
<>();
//根据使用登记证查询设备
for
(
Object
o
:
registrationList
)
{
JSONObject
parseObject
=
JSON
.
parseObject
(
o
.
toString
());
if
(
parseObject
.
containsKey
(
"sequenceNbr"
)
&&
ObjectUtils
.
isNotEmpty
(
parseObject
.
get
(
"sequenceNbr"
))
&&
canConvertToLong
(
parseObject
.
get
(
"sequenceNbr"
).
toString
()))
{
registrationIdList
.
add
(
Long
.
parseLong
(
parseObject
.
get
(
"sequenceNbr"
).
toString
()));
}
}
if
(
CollectionUtils
.
isEmpty
(
registrationIdList
))
{
return
;
}
List
<
JSONObject
>
equList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
equList
))
{
return
;
}
List
<
String
>
records
=
new
ArrayList
<>();
for
(
JSONObject
jsonObject
:
equList
)
{
records
.
add
(
jsonObject
.
getString
(
"SEQUENCE_NBR"
));
}
if
(
NOT_FLOWING_STATE
.
contains
(
status
))
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
companyCode
);
}
}
private
Integer
getTaskCodeByName
(
String
auditStatus
)
{
private
Integer
getTaskCodeByName
(
String
auditStatus
)
{
return
commonServiceImpl
.
getDictionaryCodeByName
(
auditStatus
);
return
commonServiceImpl
.
getDictionaryCodeByName
(
auditStatus
);
}
}
...
@@ -1181,12 +1116,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1181,12 +1116,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
exportParamsMap
.
put
(
"supervisoryCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
exportParamsMap
.
put
(
"supervisoryCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
getAuditPassedDate
(
transfer
.
getAuditPassDate
(),
exportParamsMap
);
getAuditPassedDate
(
transfer
.
getAuditPassDate
(),
exportParamsMap
);
//设备使用地址
//查询设备注册信息
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
jgChangeRegistrationUnitEq
.
getEquId
()));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
jgChangeRegistrationUnitEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
...
@@ -1300,34 +1230,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1300,34 +1230,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
});
});
}
}
// private void executeOneStep(JgChangeRegistrationUnit jgChangeRegistrationName, String taskName, String nextUserIds, String operate) {
// // 先更新之前的待办
// TaskV2Model taskV2Model = updateTaskModel(jgChangeRegistrationName, operate);
// TaskModelDto taskModelDto = new TaskModelDto();
// taskModelDto.setTaskDesc("");
// taskModelDto.setTaskContent(this.buildTaskContent(jgChangeRegistrationName));
// taskV2Model.setTaskName(taskName);
// taskModelDto.setTaskDesc("");
// taskModelDto.setTaskCode(jgChangeRegistrationName.getApplyNo());
// taskV2Model.setExecuteUserIds(nextUserIds);
// taskV2Model.setRelationId(jgChangeRegistrationName.getInstanceId());
// taskV2Model.setTaskStatus(this.getTaskStatusByName(jgChangeRegistrationName.getAuditStatus()));
// taskV2Model.setTaskStatusLabel(jgChangeRegistrationName.getAuditStatus());
// taskV2Model.setTaskType(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getCode());
// taskModelDto.setStartUser(jgChangeRegistrationName.getCreateUserName());
// taskV2Model.setTaskTypeLabel(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getName());
// taskModelDto.setStartDate(jgChangeRegistrationName.getCreateDate());
// taskModelDto.setStartUserId(jgChangeRegistrationName.getCreateUserId());
// taskModelDto.setStartUserCompanyName(jgChangeRegistrationName.getUseUnitName());
// taskModelDto.setExecuteUserIds(nextUserIds);
// TaskModelDto modelDto = new TaskModelDto();
// BeanUtil.copyProperties(taskV2Model,modelDto);
// modelDto.setNextExecuteUser(jgChangeRegistrationName.getNextExecutorIds());
// modelDto.setModel(jgChangeRegistrationName);
// // 再插入新代办、数据待定
// commonServiceImpl.buildTaskModel(Collections.singletonList(modelDto));
// }
private
void
executeOneStep
(
JgChangeRegistrationUnit
jgChangeRegistrationName
,
String
taskName
,
String
nextUserIds
,
String
operate
)
{
private
void
executeOneStep
(
JgChangeRegistrationUnit
jgChangeRegistrationName
,
String
taskName
,
String
nextUserIds
,
String
operate
)
{
// 先更新之前的待办
// 先更新之前的待办
TaskV2Model
taskV2Model
=
updateTaskModel
(
jgChangeRegistrationName
,
operate
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
jgChangeRegistrationName
,
operate
);
...
@@ -1342,12 +1244,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1342,12 +1244,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
taskV2Model
.
setTaskStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
taskV2Model
.
setTaskStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
taskV2Model
.
setFlowStatus
(
this
.
getTaskStatusByName
(
jgChangeRegistrationName
.
getStatus
()));
taskV2Model
.
setFlowStatus
(
this
.
getTaskStatusByName
(
jgChangeRegistrationName
.
getStatus
()));
taskV2Model
.
setFlowStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
taskV2Model
.
setFlowStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
// taskV2Model.setTaskType(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getCode());
// taskV2Model.setStartUser(jgChangeRegistrationName.getCreateUserName());
// taskV2Model.setTaskTypeLabel(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getName());
// taskV2Model.setStartDate(jgChangeRegistrationName.getCreateDate());
// taskV2Model.setStartUserId(jgChangeRegistrationName.getCreateUserId());
// taskV2Model.setStartUserCompanyName(jgChangeRegistrationName.getUseUnitName());
taskV2Model
.
setExecuteUserIds
(
nextUserIds
);
taskV2Model
.
setExecuteUserIds
(
nextUserIds
);
TaskModelDto
modelDto
=
new
TaskModelDto
();
TaskModelDto
modelDto
=
new
TaskModelDto
();
BeanUtil
.
copyProperties
(
taskV2Model
,
modelDto
);
BeanUtil
.
copyProperties
(
taskV2Model
,
modelDto
);
...
...
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