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
355f0e83
Commit
355f0e83
authored
Nov 05, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:(jg):气瓶单位变更功能开发
parent
6401acff
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
602 additions
and
207 deletions
+602
-207
JgChangeRegistrationUnitDto.java
...s/boot/module/jg/api/dto/JgChangeRegistrationUnitDto.java
+15
-0
JgChangeRegistrationUnit.java
...s/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
+30
-0
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+1
-0
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+3
-0
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+2
-2
IdxBizJqEquipmentRegisterController.java
...g/biz/controller/IdxBizJqEquipmentRegisterController.java
+1
-1
JgChangeRegistrationUnitController.java
...jg/biz/controller/JgChangeRegistrationUnitController.java
+1
-5
JgChangeVehicleRegistrationUnitController.java
...controller/JgChangeVehicleRegistrationUnitController.java
+6
-4
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+15
-6
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+528
-189
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/JgChangeRegistrationUnitDto.java
View file @
355f0e83
...
...
@@ -219,4 +219,19 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
@ApiModelProperty
(
value
=
"属地监管部门"
)
private
String
orgBranchName
;
@ApiModelProperty
(
value
=
"设备类别代码"
)
private
String
equCategoryCode
;
@ApiModelProperty
(
value
=
"安全管理员"
)
private
String
safetyManager
;
@ApiModelProperty
(
value
=
"安全管理员电话"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"产权单位seq"
)
private
String
estateUnitSeq
;
@ApiModelProperty
(
value
=
"投用日期"
)
private
String
useDate
;
}
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 @
355f0e83
...
...
@@ -331,4 +331,34 @@ public class JgChangeRegistrationUnit extends BaseEntity {
*/
@TableField
(
value
=
"org_branch_name"
)
private
String
orgBranchName
;
/**
* 设备类别编码
*/
@TableField
(
"equ_category_code"
)
private
String
equCategoryCode
;
/**
* 安全管理员
*/
@TableField
(
"safety_manager"
)
private
String
safetyManager
;
/**
* 安全管理员电话
*/
@TableField
(
"phone"
)
private
String
phone
;
/**
* 产权单位seq
*/
@TableField
(
"estate_unit_seq"
)
private
String
estateUnitSeq
;
/**
* 投用日期
*/
@TableField
(
"use_date"
)
private
String
useDate
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
View file @
355f0e83
...
...
@@ -147,6 +147,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page
<
JgNoticeToBeSubmitDto
>
queryRegistrationToBeSubmitPage
(
@Param
(
"page"
)
Page
<
JgNoticeToBeSubmitDto
>
page
,
@Param
(
"companyCode"
)
String
companyCode
);
List
<
XianElevatorVo
>
queryXianElevatorData
(
@Param
(
"beginDate"
)
String
beginDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
JgUseRegistrationEq
>
selectListForInstallNoticeDiscard
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
JgUseRegistrationEq
>
selectListForSelfDiscard
(
@Param
(
"records"
)
List
<
String
>
records
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
355f0e83
...
...
@@ -662,6 +662,9 @@
<if
test=
"dto.whetherVehicleCylinder != null and dto.whetherVehicleCylinder == 1 "
>
AND tjurm.reg_type = '车用气瓶登记'
</if>
<if
test=
"dto.whetherVehicleCylinder != null and dto.whetherVehicleCylinder == 0 "
>
AND tjurm.reg_type != '车用气瓶登记'
</if>
<if
test=
"dto.isScrap != null and dto.isScrap != ''"
>
and tjurm.is_scrap = #{dto.isScrap}
</if>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
355f0e83
...
...
@@ -1982,8 +1982,8 @@
tjur.SUPERVISION_ORG_CODE as supervisionOrgCode,
ibjui.DATA_SOURCE as dataSource
FROM
tzs_jg_use_registration_
eq tjure
LEFT JOIN
tzs_jg_use_registration tjur ON tjur.sequence_nbr = tjure.equip_transfer
_id
tzs_jg_use_registration_
manage tjurm
LEFT JOIN
idx_biz_jg_register_info ibjri on ibjri."RECORD" = tjurm.equ
_id
LEFT JOIN idx_biz_jg_use_info ibjui ON tjure.equ_id = ibjui."RECORD"
LEFT JOIN idx_biz_jg_register_info ibjri on ibjri."RECORD" = tjure.equ_id
LEFT JOIN idx_biz_jg_factory_info ibjfi on ibjfi."RECORD" = tjure.equ_id
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/IdxBizJqEquipmentRegisterController.java
View file @
355f0e83
...
...
@@ -246,12 +246,12 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/equip/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位办理设备列表查询"
,
notes
=
"单位办理设备列表查询"
)
@FieldMapping
({
@FieldMapping
.
FieldMap
(
sourceField
=
"useUnitSeq"
,
targetField
=
"useUnitCreditCode"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitCreditInfoBySeq"
),})
public
ResponseModel
<
Page
<
JSONObject
>>
queryEquipPage
(
@RequestParam
Map
<
String
,
Object
>
queryMap
)
{
JSONObject
jsonObject
=
new
JSONObject
(
queryMap
);
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
queryForUnitEquipmentPage
(
jsonObject
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/equipCanUsedByVessel/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询车用气瓶可进行选择的设备列表"
,
notes
=
"查询车用气瓶可进行选择的设备列表"
)
...
...
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 @
355f0e83
...
...
@@ -20,7 +20,6 @@ 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.List
;
...
...
@@ -53,7 +52,6 @@ public class JgChangeRegistrationUnitController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位变更"
,
notes
=
"新增单位变更"
)
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
JSONObject
model
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
saveNotice
(
submitType
,
model
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
""
);
}
...
...
@@ -115,12 +113,10 @@ public class JgChangeRegistrationUnitController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/details"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个单位变更"
,
notes
=
"根据sequenceNbr查询单个单位变更"
)
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryBySequenceNbr
(
sequenceNbr
,
getSelectedOrgInfo
()));
}
/**
* 根据sequenceNbr查询详情
*
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeVehicleRegistrationUnitController.java
View file @
355f0e83
...
...
@@ -23,7 +23,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -132,11 +131,11 @@ public class JgChangeVehicleRegistrationUnitController extends BaseController {
@RequestParam
(
value
=
"useUnitCreditCode"
,
required
=
false
)
String
useUnitCreditCode
,
@RequestParam
(
value
=
"whetherVehicleCylinder"
)
String
whetherVehicleCylinder
,
@RequestParam
(
value
=
"certificateStatus"
,
required
=
false
)
String
certificateStatus
,
@RequestParam
(
value
=
"equCategoryCode"
,
required
=
false
)
String
equCategoryCode
,
@RequestParam
(
value
=
"useRegistrationCode"
,
required
=
false
)
String
useRegistrationCode
)
{
if
(
ValidationUtil
.
isEmpty
(
useUnitCreditCode
))
throw
new
BadRequest
(
"请先选择原使用单位"
);
if
(
ValidationUtil
.
isEmpty
(
useUnitCreditCode
))
throw
new
BadRequest
(
"请先选择原使用单位"
);
JgUseRegistrationManageDto
dto
=
new
JgUseRegistrationManageDto
();
Page
<
JgUseRegistrationManageDto
>
page
=
new
Page
<
JgUseRegistrationManageDto
>();
Page
<
JgUseRegistrationManageDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
if
(!
ValidationUtil
.
isEmpty
(
useUnitCreditCode
)){
...
...
@@ -149,6 +148,9 @@ public class JgChangeVehicleRegistrationUnitController extends BaseController {
if
(!
ValidationUtil
.
isEmpty
(
certificateStatus
)){
dto
.
setCertificateStatus
(
certificateStatus
);
}
if
(!
ValidationUtil
.
isEmpty
(
equCategoryCode
)){
dto
.
setEquCategoryCode
(
equCategoryCode
);
}
if
(!
ObjectUtils
.
isEmpty
(
useRegistrationCode
)){
dto
.
setUseRegistrationCode
(
useRegistrationCode
);
}
...
...
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
355f0e83
...
...
@@ -163,6 +163,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
public
static
final
String
PROJECT_CONTRAPTION
=
"PROJECT_CONTRAPTION"
;
// 工程装置名称
public
static
final
String
CREATE_DATE_RANGE
=
"CREATE_DATE_RANGE"
;
// 创建时间范围查询
public
static
final
String
CREATE_DATE
=
"CREATE_DATE"
;
// 创建时间范围查询
public
static
final
String
USE_UNIT_CREDIT_CODE
=
"useUnitCreditCode"
;
// 创建时间范围查询
/**
* 业务类型 0:单个新增 1:批量导入
*/
...
...
@@ -4063,13 +4064,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Override
public
Page
<
JSONObject
>
queryForUnitEquipmentPage
(
JSONObject
jsonObject
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
useUnitCreditCode
=
reginParams
.
getCompany
().
getCompanyCode
();
// 使用单位为个人时候 特殊处理
if
(
useUnitCreditCode
.
split
(
"_"
).
length
>
1
)
{
useUnitCreditCode
=
useUnitCreditCode
.
split
(
"_"
)[
1
];
String
useUnitCreditCode
=
Objects
.
toString
(
jsonObject
.
get
(
USE_UNIT_CREDIT_CODE
),
""
);
if
(
ValidationUtil
.
isEmpty
(
useUnitCreditCode
))
{
String
redisVal
=
String
.
valueOf
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())));
if
(
StringUtils
.
isNotEmpty
(
redisVal
))
{
ReginParams
params
=
JSON
.
parseObject
(
redisVal
,
ReginParams
.
class
);
useUnitCreditCode
=
Optional
.
ofNullable
(
params
)
.
map
(
ReginParams:
:
getCompany
)
.
map
(
CompanyBo:
:
getCompanyCode
)
.
orElse
(
""
);
useUnitCreditCode
=
useUnitCreditCode
.
contains
(
"_"
)
?
useUnitCreditCode
.
split
(
"_"
)[
1
]
:
useUnitCreditCode
;
}
}
else
{
useUnitCreditCode
=
useUnitCreditCode
.
contains
(
"_"
)
?
useUnitCreditCode
.
split
(
"_"
)[
0
]
:
useUnitCreditCode
;
}
jsonObject
.
put
(
"useUnitCreditCode"
,
useUnitCreditCode
);
jsonObject
.
put
(
USE_UNIT_CREDIT_CODE
,
useUnitCreditCode
);
Page
<
JSONObject
>
page
=
new
Page
<>(
jsonObject
.
getLong
(
"number"
),
jsonObject
.
getLong
(
"size"
));
Set
<
String
>
records
=
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegistration"
).
getEquipInFlow
(
useUnitCreditCode
);
String
[]
recordList
=
ValidationUtil
.
isEmpty
(
records
)
?
null
:
records
.
toArray
(
new
String
[
records
.
size
()]);
...
...
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 @
355f0e83
...
...
@@ -8,8 +8,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.olym.shaded.org.apache.commons.collections4.MapUtils
;
import
com.yeejoin.amos.boot.biz.common.annotation.ResultFieldMapping
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
...
...
@@ -18,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
...
...
@@ -41,6 +44,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.*
;
...
...
@@ -67,6 +71,7 @@ import java.time.ZoneId;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -83,6 +88,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
private
static
final
String
RECORD
=
"record"
;
private
static
final
String
EQU_CODE_CC
=
"5000"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
...
...
@@ -207,9 +213,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
* @return 单位变更
*/
@Override
@ResultFieldMapping
({
@ResultFieldMapping
.
ResultFieldMap
(
sourceField
=
"changeRegisInfo.useUnitCreditCode"
,
targetField
=
"changeRegisInfo.useUnitSeq"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitInfoByCreditCode"
)
})
@ResultFieldMapping
({
@ResultFieldMapping
.
ResultFieldMap
(
sourceField
=
"changeRegisInfo.useUnitCreditCode"
,
targetField
=
"changeRegisInfo.useUnitSeq"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitInfoByCreditCode"
)})
public
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
,
ReginParams
selectedOrgInfo
)
{
// 单位变更信息
JgChangeRegistrationUnit
notice
=
JgChangeRegistrationUnitMapper
.
selectById
(
sequenceNbr
);
...
...
@@ -256,6 +260,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
changeInfo
.
put
(
"projectContraptionList"
,
jsonArray
);
}
}
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
notice
.
getEquCategoryCode
()))
{
changeInfo
.
put
(
"deviceList"
,
JSON
.
parse
(
historyServiceOne
.
getChangeData
()));
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getSafetyManager
()))
{
changeInfo
.
put
(
"safetyManagerName"
,
notice
.
getSafetyManager
().
split
(
"_"
)[
1
]);
}
}
else
{
changeInfo
.
put
(
"registrationList"
,
JSON
.
parse
(
historyServiceOne
.
getChangeData
()));
}
...
...
@@ -335,6 +345,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
if
(
PipelineEnum
.
PRESSURE_PIPELINE
.
getCode
().
equals
(
noticeDto
.
getEquListCode
()))
{
dealProjectContraptionToUpdate
(
submitType
,
noticeDto
,
op
,
reginParams
);
}
else
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
noticeDto
.
getEquCategoryCode
()))
{
return
this
.
dealCylinderToUpdate
(
submitType
,
noticeDto
,
""
,
reginParams
);
}
else
{
// 字段转换
this
.
convertField
(
noticeDto
);
...
...
@@ -513,6 +525,178 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
/**
* 气瓶单位变更业务
* @param submitType
* @param changeRegistrationUnitDto
* @param op
* @param reginParams
*/
private
JgChangeRegistrationUnitDto
dealCylinderToUpdate
(
String
submitType
,
JgChangeRegistrationUnitDto
changeRegistrationUnitDto
,
String
op
,
ReginParams
reginParams
)
{
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
this
.
convertField
(
changeRegistrationUnitDto
);
// 获取单位变更设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
changeRegistrationUnitDto
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备后提交"
);
}
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
log
.
error
(
"生成申请变更单位编码失败"
);
throw
new
BadRequest
(
"生成申请变更单位编码失败"
);
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
RECORD
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
List
<
WorkflowResultDto
>
workflowResultDtos
=
new
ArrayList
<>();
String
nextExecutorRoleIds
=
""
;
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//发起流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setNextExecuteUserCompanyCode
(
changeRegistrationUnitDto
.
getReceiveCompanyCode
());
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
nextExecutorRoleIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
();
nextExecutorUserIds
.
add
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
for
(
WorkflowResultDto
processTaskDTO
:
workflowResultDtos
)
{
instanceIdList
.
add
(
processTaskDTO
.
getInstanceId
());
taskIds
.
add
(
processTaskDTO
.
getNextTaskId
());
}
}
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
changeRegistrationUnitDto
.
getReceiveCompanyCode
());
changeRegistrationUnitDto
.
setApplyNo
(
applyNoList
.
get
(
0
));
changeRegistrationUnitDto
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
changeRegistrationUnitDto
.
setReceiveOrgCode
(
companyBo
.
getCompanyCode
());
changeRegistrationUnitDto
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
changeRegistrationUnitDto
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
changeRegistrationUnitDto
.
setNextExecutorIds
(
finalNextExecutorRoleIds
);
changeRegistrationUnitDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
changeRegistrationUnitDto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
changeRegistrationUnitDto
.
setStatus
(
taskName
[
0
]);
}
if
(!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
changeRegistrationUnitDto
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
}
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
changeRegistrationUnitDto
.
setInstanceId
(
instanceIdList
.
get
(
0
));
changeRegistrationUnitDto
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
}
else
{
changeRegistrationUnitDto
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_SUBMIT
.
getPass
());
}
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
changeRegistrationUnitDto
.
setNextTaskId
(
taskIds
.
get
(
0
));
}
changeRegistrationUnitDto
.
setSequenceNbr
(
sequence
.
nextId
());
changeRegistrationUnitDto
.
setCreateDate
(
new
Date
());
changeRegistrationUnitDto
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
changeRegistrationUnitDto
.
setUseRegistCode
(
changeRegistrationUnitDto
.
getUseRegistCode
());
Optional
.
of
(
deviceList
)
.
filter
(
list
->
!
list
.
isEmpty
())
.
map
(
list
->
list
.
get
(
0
).
get
(
"equListName"
))
.
map
(
Object:
:
toString
)
.
ifPresent
(
changeRegistrationUnitDto:
:
setEquList
);
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
changeRegistrationUnitDto
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
JgChangeRegistrationUnitMapper
.
insert
(
registrationUnit
);
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
ta
.
setPromoter
(
registrationUnit
.
getPromoter
());
ta
.
setNextExecuteUserIds
(
registrationUnit
.
getNextExecuteUserIds
());
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setModel
(
ta
);
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
taskModelDto
.
setRelationId
(
registrationUnit
.
getInstanceId
());
taskModelDto
.
setExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
taskModelDto
.
setTaskStatusLabel
(
"未处理"
);
taskModelDto
.
setFlowStatus
(
commonServiceImpl
.
getDictionaryCodeByName
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
()));
taskModelDto
.
setFlowStatusLabel
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
taskModelDto
.
setStartUserId
(
RequestContext
.
getExeUserId
());
taskModelDto
.
setStartUser
(
workflowResultDtos
.
get
(
0
).
getStartUserName
());
taskModelDto
.
setStartUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
taskModelDto
);
}
else
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
//行数据
taskModelDto
.
setModel
(
registrationUnit
);
//摘要 按原有规则组装
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
//申请单号
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
//业务类型枚举code值
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
////业务主键
taskModelDto
.
setRelationId
(
registrationUnit
.
getSequenceNbr
()
+
""
);
modelDtos
.
add
(
taskModelDto
);
// }
}
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
device
->
{
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
unitEq
.
setRegistrationCertificate
(
changeRegistrationUnitDto
.
getUseRegistrationCertificate
());
unitEq
.
setEquId
(
Objects
.
toString
(
device
.
get
(
RECORD
)));
unitEq
.
setUnitChangeRegistrationId
(
registrationUnit
.
getSequenceNbr
().
toString
());
//单位变更业务主键
unitEq
.
setDeviceInfo
(
JSONObject
.
toJSONString
(
device
));
//设备信息json
jgRelationEquipList
.
add
(
unitEq
);
});
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
"单位变更登记"
);
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
//使用登记证历史数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
deviceList
));
//先删除之前设备关系数据,在插入最新设备关系数据
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
registrationUnitEqService
.
saveBatch
(
jgRelationEquipList
);
//先删除之前未提交的历史使用登记证信息,在插入最新的使用登记证信息
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
return
changeRegistrationUnitDto
;
}
/**
* 更新装置的单位变更
*
* @param submitType
...
...
@@ -547,11 +731,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"record"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListNext
=
new
ArrayList
<>();
...
...
@@ -822,194 +1002,196 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
convertField
(
model
);
// 获取单位变更使用登记证列表
List
<
Map
<
String
,
Object
>>
registrationList
=
model
.
getRegistrationList
();
if
(
CollectionUtils
.
isEmpty
(
registrationList
))
{
throw
new
BadRequest
(
"使用登记证不能为空"
);
}
//根据使用登记证查询设备
List
<
Long
>
registrationIdList
=
new
ArrayList
<>();
//使用登记证id
List
<
String
>
registrationNoList
=
new
ArrayList
<>();
//使用登记证编号
for
(
Map
<
String
,
Object
>
objectMap
:
registrationList
)
{
if
(
objectMap
.
containsKey
(
"sequenceNbr"
)
&&
ObjectUtils
.
isNotEmpty
(
objectMap
.
get
(
"sequenceNbr"
))
&&
canConvertToLong
(
objectMap
.
get
(
"sequenceNbr"
).
toString
()))
{
registrationIdList
.
add
(
Long
.
parseLong
(
objectMap
.
get
(
"sequenceNbr"
).
toString
()));
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
model
.
getEquCategoryCode
()))
{
return
Collections
.
singletonList
(
this
.
dealCylinderToUpdate
(
submitType
,
model
,
""
,
reginParams
));
}
else
{
// 获取单位变更使用登记证列表
List
<
Map
<
String
,
Object
>>
registrationList
=
model
.
getRegistrationList
();
if
(
CollectionUtils
.
isEmpty
(
registrationList
))
{
throw
new
BadRequest
(
"使用登记证不能为空"
);
}
if
(
objectMap
.
containsKey
(
"useRegistrationCode"
)
&&
ObjectUtils
.
isNotEmpty
(
objectMap
.
get
(
"useRegistrationCode"
)))
{
registrationNoList
.
add
(
objectMap
.
get
(
"useRegistrationCode"
).
toString
());
//根据使用登记证查询设备
List
<
Long
>
registrationIdList
=
new
ArrayList
<>();
//使用登记证id
List
<
String
>
registrationNoList
=
new
ArrayList
<>();
//使用登记证编号
for
(
Map
<
String
,
Object
>
objectMap
:
registrationList
)
{
if
(
objectMap
.
containsKey
(
"sequenceNbr"
)
&&
ObjectUtils
.
isNotEmpty
(
objectMap
.
get
(
"sequenceNbr"
))
&&
canConvertToLong
(
objectMap
.
get
(
"sequenceNbr"
).
toString
()))
{
registrationIdList
.
add
(
Long
.
parseLong
(
objectMap
.
get
(
"sequenceNbr"
).
toString
()));
}
if
(
objectMap
.
containsKey
(
"useRegistrationCode"
)
&&
ObjectUtils
.
isNotEmpty
(
objectMap
.
get
(
"useRegistrationCode"
)))
{
registrationNoList
.
add
(
objectMap
.
get
(
"useRegistrationCode"
).
toString
());
}
}
if
(
CollectionUtils
.
isEmpty
(
registrationIdList
))
{
throw
new
BadRequest
(
"使用登记证不能为空"
);
}
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
//场车区分区外还是区内
if
(
EQU_CODE_CC
.
equals
(
model
.
getEquListCode
()))
{
String
city
=
Objects
.
toString
(
tableData
.
get
(
"city"
),
""
);
String
userCity
=
Optional
.
ofNullable
(
city
).
map
(
c
->
c
.
split
(
"_"
)[
0
]).
orElseThrow
(()
->
new
BadRequest
(
"请选择地市后暂存!"
));
this
.
validateDeviceCity
(
deviceList
,
userCity
,
"0"
.
equals
(
model
.
getChangeType
()));
this
.
setEquAddress
(
model
);
}
}
if
(
CollectionUtils
.
isEmpty
(
registrationIdList
))
{
throw
new
BadRequest
(
"使用登记证不能为空"
);
}
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
//场车区分区外还是区内
if
(
EQU_CODE_CC
.
equals
(
model
.
getEquListCode
()))
{
String
city
=
Objects
.
toString
(
tableData
.
get
(
"city"
),
""
);
String
userCity
=
Optional
.
ofNullable
(
city
).
map
(
c
->
c
.
split
(
"_"
)[
0
]).
orElseThrow
(()
->
new
BadRequest
(
"请选择地市后暂存!"
));
this
.
validateDeviceCity
(
deviceList
,
userCity
,
"0"
.
equals
(
model
.
getChangeType
()));
this
.
setEquAddress
(
model
);
}
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
log
.
error
(
"生成申请变更单位编码失败"
);
return
new
ArrayList
<>();
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
List
<
WorkflowResultDto
>
workflowResultDtos
=
new
ArrayList
<>();
String
nextExecutorRoleIds
=
""
;
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//发起流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setNextExecuteUserCompanyCode
(
model
.
getReceiveCompanyCode
());
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
nextExecutorRoleIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
();
nextExecutorUserIds
.
add
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
for
(
WorkflowResultDto
processTaskDTO
:
workflowResultDtos
)
{
instanceIdList
.
add
(
processTaskDTO
.
getInstanceId
());
taskIds
.
add
(
processTaskDTO
.
getNextTaskId
());
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
log
.
error
(
"生成申请变更单位编码失败"
);
return
new
ArrayList
<>();
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
List
<
WorkflowResultDto
>
workflowResultDtos
=
new
ArrayList
<>();
String
nextExecutorRoleIds
=
""
;
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//发起流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setNextExecuteUserCompanyCode
(
model
.
getReceiveCompanyCode
());
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
nextExecutorRoleIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
();
nextExecutorUserIds
.
add
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
for
(
WorkflowResultDto
processTaskDTO
:
workflowResultDtos
)
{
instanceIdList
.
add
(
processTaskDTO
.
getInstanceId
());
taskIds
.
add
(
processTaskDTO
.
getNextTaskId
());
}
}
}
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
model
.
setApplyNo
(
applyNoList
.
get
(
0
));
model
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
model
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
model
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
model
.
setNextExecutorIds
(
finalNextExecutorRoleIds
);
model
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
model
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setStatus
(
taskName
[
0
]);
}
if
(!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
model
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
}
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
model
.
setInstanceId
(
instanceIdList
.
get
(
0
));
model
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
}
else
{
model
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_SUBMIT
.
getPass
());
}
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
model
.
setNextTaskId
(
taskIds
.
get
(
0
));
}
model
.
setSequenceNbr
(
sequence
.
nextId
());
model
.
setCreateDate
(
new
Date
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
JgChangeRegistrationUnitMapper
.
insert
(
registrationUnit
);
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
ta
.
setPromoter
(
registrationUnit
.
getPromoter
());
ta
.
setNextExecuteUserIds
(
registrationUnit
.
getNextExecuteUserIds
());
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setModel
(
ta
);
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
taskModelDto
.
setRelationId
(
registrationUnit
.
getInstanceId
());
taskModelDto
.
setExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
taskModelDto
.
setTaskStatusLabel
(
"未处理"
);
taskModelDto
.
setFlowStatus
(
commonServiceImpl
.
getDictionaryCodeByName
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
()));
taskModelDto
.
setFlowStatusLabel
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
taskModelDto
.
setStartUserId
(
RequestContext
.
getExeUserId
());
taskModelDto
.
setStartUser
(
workflowResultDtos
.
get
(
0
).
getStartUserName
());
taskModelDto
.
setStartUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
taskModelDto
);
}
else
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
//行数据
taskModelDto
.
setModel
(
registrationUnit
);
//摘要 按原有规则组装
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
//申请单号
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
//业务类型枚举code值
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
////业务主键
taskModelDto
.
setRelationId
(
registrationUnit
.
getSequenceNbr
()
+
""
);
modelDtos
.
add
(
taskModelDto
);
// }
}
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
device
->
{
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
if
(
device
.
containsKey
(
"USE_ORG_CODE"
))
{
unitEq
.
setRegistrationCertificate
(
device
.
getString
(
"USE_ORG_CODE"
));
//使用登记证主键
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
model
.
setApplyNo
(
applyNoList
.
get
(
0
));
model
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
model
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
model
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
model
.
setNextExecutorIds
(
finalNextExecutorRoleIds
);
model
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
model
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setStatus
(
taskName
[
0
]);
}
if
(
device
.
containsKey
(
"SEQUENCE_NBR"
))
{
unitEq
.
setEquId
(
device
.
getString
(
"SEQUENCE_NBR"
));
//设备主键
if
(
!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
model
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
}
unitEq
.
setUnitChangeRegistrationId
(
registrationUnit
.
getSequenceNbr
().
toString
());
//单位变更业务主键
unitEq
.
setDeviceInfo
(
JSONObject
.
toJSONString
(
device
));
//设备信息json
jgRelationEquipList
.
add
(
unitEq
);
});
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
"单位变更登记"
);
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
//使用登记证历史数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
registrationList
));
//先删除之前设备关系数据,在插入最新设备关系数据
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
registrationUnitEqService
.
saveBatch
(
jgRelationEquipList
);
//先删除之前未提交的历史使用登记证信息,在插入最新的使用登记证信息
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
return
Collections
.
singletonList
(
model
);
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
model
.
setInstanceId
(
instanceIdList
.
get
(
0
));
model
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
}
else
{
model
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_SUBMIT
.
getPass
());
}
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
model
.
setNextTaskId
(
taskIds
.
get
(
0
));
}
model
.
setSequenceNbr
(
sequence
.
nextId
());
model
.
setCreateDate
(
new
Date
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
JgChangeRegistrationUnitMapper
.
insert
(
registrationUnit
);
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
ta
.
setPromoter
(
registrationUnit
.
getPromoter
());
ta
.
setNextExecuteUserIds
(
registrationUnit
.
getNextExecuteUserIds
());
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setModel
(
ta
);
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
taskModelDto
.
setRelationId
(
registrationUnit
.
getInstanceId
());
taskModelDto
.
setExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
taskModelDto
.
setTaskStatusLabel
(
"未处理"
);
taskModelDto
.
setFlowStatus
(
commonServiceImpl
.
getDictionaryCodeByName
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
()));
taskModelDto
.
setFlowStatusLabel
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
taskModelDto
.
setStartUserId
(
RequestContext
.
getExeUserId
());
taskModelDto
.
setStartUser
(
workflowResultDtos
.
get
(
0
).
getStartUserName
());
taskModelDto
.
setStartUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
taskModelDto
);
}
else
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
//行数据
taskModelDto
.
setModel
(
registrationUnit
);
//摘要 按原有规则组装
taskModelDto
.
setTaskContent
(
this
.
buildTaskContent
(
registrationUnit
));
//申请单号
taskModelDto
.
setTaskCode
(
registrationUnit
.
getApplyNo
());
//业务类型枚举code值
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
////业务主键
taskModelDto
.
setRelationId
(
registrationUnit
.
getSequenceNbr
()
+
""
);
modelDtos
.
add
(
taskModelDto
);
// }
}
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
device
->
{
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
if
(
device
.
containsKey
(
"USE_ORG_CODE"
))
{
unitEq
.
setRegistrationCertificate
(
device
.
getString
(
"USE_ORG_CODE"
));
//使用登记证主键
}
if
(
device
.
containsKey
(
"SEQUENCE_NBR"
))
{
unitEq
.
setEquId
(
device
.
getString
(
"SEQUENCE_NBR"
));
//设备主键
}
unitEq
.
setUnitChangeRegistrationId
(
registrationUnit
.
getSequenceNbr
().
toString
());
//单位变更业务主键
unitEq
.
setDeviceInfo
(
JSONObject
.
toJSONString
(
device
));
//设备信息json
jgRelationEquipList
.
add
(
unitEq
);
});
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
"单位变更登记"
);
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
//使用登记证历史数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
deviceList
));
//先删除之前设备关系数据,在插入最新设备关系数据
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
registrationUnitEqService
.
saveBatch
(
jgRelationEquipList
);
//先删除之前未提交的历史使用登记证信息,在插入最新的使用登记证信息
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
return
Collections
.
singletonList
(
model
);
}
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
...
...
@@ -1322,6 +1504,10 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
//如果是工业管道 如果工程装置对应一个证就直接变更给新单位;如果工程装置对应证下还有其他装置就变更后直接给新单位再重新生成一个登记证号;如果两个工程装置对应同一个使用登记证变更后生成两个新的登记证
if
(
PipelineEnum
.
PRESSURE_PIPELINE
.
getCode
().
equals
(
dto
.
getEquListCode
()))
{
this
.
dealProjectContraption
(
dto
,
nextTaskId
,
registration
,
op
);
}
//气瓶单位变更,如果新单位没有证,则生成新的使用登记证,如果新单位有证且是系统生成的证,则选择增补到已有的证下面同时,更新设备其他信息
else
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
dto
.
getEquCategoryCode
()))
{
this
.
dealCylinderAuditPassData
(
dto
,
nextTaskId
,
registration
,
op
);
}
else
{
// 生成新的使用登记编号,使用登记证 修改设备的使用登记信息表,使用单位名称,使用单位统一信用代码,使用登记证编号,更新ES
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -1548,6 +1734,159 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
/**
* 处理气瓶单位变更三级审核完成后数据
* @param dto 变更数据
* @param nextTaskId taskId
* @param registration 单位变更主表数据
* @param op 通过
*/
private
void
dealCylinderAuditPassData
(
JgChangeRegistrationUnitDto
dto
,
String
nextTaskId
,
JgChangeRegistrationUnit
registration
,
String
op
)
{
List
<
Map
<
String
,
Object
>>
deviceList
=
dto
.
getDeviceList
();
if
(
CollUtil
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"设备列表不能为空!"
);
}
registration
.
setNextTaskId
(
nextTaskId
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
registration
,
op
);
AtomicReference
<
Boolean
>
flag
=
new
AtomicReference
<>(
Boolean
.
FALSE
);
String
useRegistrationCode
=
null
;
JgUseRegistrationManageDto
manageDto
=
new
JgUseRegistrationManageDto
();
manageDto
.
setCertificateStatus
(
CertificateStatusEnum
.
YIDENGJI
.
getName
());
manageDto
.
setUseUnitCreditCode
(
dto
.
getNewUseUnitCreditCode
());
manageDto
.
setRegType
(
"0"
);
useRegistrationCode
=
Optional
.
ofNullable
(
jgUseRegistrationManageMapper
.
queryByUseUnitCreditCode
(
manageDto
))
.
filter
(
list
->
!
list
.
isEmpty
())
.
flatMap
(
list
->
list
.
stream
()
.
map
(
JgUseRegistrationManageDto:
:
getUseRegistrationCode
)
.
filter
(
code
->
code
.
startsWith
(
"瓶30"
))
.
findFirst
())
.
map
(
code
->
{
flag
.
set
(
Boolean
.
TRUE
);
return
code
;
}).
orElse
(
commonServiceImpl
.
generateRegistrationCode
(
Objects
.
toString
(
deviceList
.
get
(
0
).
get
(
RECORD
)),
dto
.
getReceiveCompanyCode
(),
true
));
List
<
String
>
equIds
=
new
ArrayList
<>();
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
map
:
deviceList
)
{
String
equId
=
MapUtils
.
getString
(
map
,
"equId"
);
equIds
.
add
(
equId
);
//更新产权单位信息
String
estateUnitSeq
=
Objects
.
toString
(
map
.
get
(
"estateUnitSeq"
),
""
);
String
safetyManager
=
Objects
.
toString
(
map
.
get
(
"safetyManagerName"
),
""
);
String
phone
=
Objects
.
toString
(
map
.
get
(
"phone"
),
""
);
String
useDate
=
Objects
.
toString
(
map
.
get
(
"useDate"
),
""
);
TzBaseEnterpriseInfo
enterpriseInfo
=
(
estateUnitSeq
!=
null
&&
!
estateUnitSeq
.
isEmpty
())
?
tzBaseEnterpriseInfoMapper
.
selectById
(
estateUnitSeq
)
:
null
;
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
useInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
useInfoLambdaQueryWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
equId
);
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
useInfoLambdaQueryWrapper
);
//更新产权信息
if
(
enterpriseInfo
!=
null
)
{
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfoMapper
.
updateById
(
useInfo
.
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
.
setEstateUnitName
(
enterpriseInfo
.
getUseUnit
())
.
setPhone
(
phone
)
.
setUseUnitCreditCode
(
dto
.
getNewUseUnitCreditCode
())
.
setUseUnitName
(
dto
.
getNewUseUnitName
())
.
setSafetyManager
(
safetyManager
)
.
setProvince
(
dto
.
getProvince
())
.
setCity
(
dto
.
getCity
())
.
setCounty
(
dto
.
getCounty
())
.
setAddress
(
dto
.
getEquAddress
())
.
setFactoryUseSiteStreet
(
dto
.
getStreet
())
.
setUseDate
(
useDate
));
}
}
//更新属地信息
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfo
=
new
IdxBizJgSupervisionInfo
();
if
(
map
.
containsKey
(
"orgBranchCode"
)
&&
!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
map
.
get
(
"orgBranchCode"
)))
{
String
[]
data
=
String
.
valueOf
(
map
.
get
(
"orgBranchCode"
)).
split
(
"_"
);
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
data
[
0
]).
getResult
();
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
idxBizJgSupervisionInfo
.
setOrgBranchCode
(
data
[
0
]);
idxBizJgSupervisionInfo
.
setOrgBranchName
(
data
[
1
]);
idxBizJgSupervisionInfo
.
setCompanyOrgBranchCode
(
parentModel
.
getCompanyCode
());
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>
eq
=
new
QueryWrapper
<
IdxBizJgSupervisionInfo
>().
lambda
()
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
map
.
get
(
"equipId"
));
idxBizJgSupervisionInfoMapper
.
update
(
idxBizJgSupervisionInfo
,
eq
);
}
//更新注册信息
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equId
);
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useRegistrationCode
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
Map
<
String
,
Object
>
esUpdateParams
=
new
HashMap
<>();
esUpdateParams
.
put
(
"USE_UNIT_CREDIT_CODE"
,
registration
.
getNewUseUnitCreditCode
());
esUpdateParams
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
esUpdateParams
.
put
(
"REC_DATE"
,
new
Date
());
esUpdateParams
.
put
(
"USE_PLACE"
,
joinWithSeparator
(
"/"
,
useInfo
.
getProvinceName
(),
useInfo
.
getCityName
(),
useInfo
.
getCountyName
(),
useInfo
.
getStreetName
()));
esUpdateParams
.
put
(
"USE_PLACE_CODE"
,
joinWithSeparator
(
"#"
,
useInfo
.
getProvince
(),
useInfo
.
getCity
(),
useInfo
.
getCounty
(),
useInfo
.
getFactoryUseSiteStreet
()));
esUpdateParams
.
put
(
"ORG_BRANCH_CODE"
,
registration
.
getOrgBranchCode
());
esUpdateParams
.
put
(
"ORG_BRANCH_NAME"
,
registration
.
getOrgBranchName
());
esUpdateParams
.
put
(
"USE_ORG_CODE"
,
useRegistrationCode
);
resultMap
.
put
(
equId
,
esUpdateParams
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
}
JgUseRegistrationManage
registrationManage
;
if
(
flag
.
get
()){
//获取使用登记证
LambdaQueryWrapper
<
JgUseRegistrationManage
>
useRegistrationManageWrapper
=
new
LambdaQueryWrapper
<>();
useRegistrationManageWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
useRegistrationCode
)
.
isNotNull
(
JgUseRegistrationManage:
:
getUseRegistrationCode
)
.
eq
(
JgUseRegistrationManage:
:
getCertificateStatus
,
"已登记"
)
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
registrationManage
=
useRegistrationManageService
.
getBaseMapper
().
selectOne
(
useRegistrationManageWrapper
);
//修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setVersion
(
registrationManage
.
getVersion
()
+
1
);
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
//回填新单位地址
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
()));
if
(
useCodeResult
!=
null
)
{
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
registrationManage
.
setRecUserId
(
registration
.
getCreateUserId
());
useRegistrationManageService
.
updateById
(
registrationManage
);
}
else
{
registrationManage
=
new
JgUseRegistrationManage
();
registrationManage
.
setSequenceNbr
(
sequence
.
nextId
());
registrationManage
.
setUseRegistrationCode
(
useRegistrationCode
);
//修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setVersion
(
1
);
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
()));
if
(
useCodeResult
!=
null
)
{
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
registrationManage
.
setRecUserId
(
registration
.
getCreateUserId
());
useRegistrationManageService
.
save
(
registrationManage
);
}
// 发送数据变更消息
this
.
sendDataRefreshMsg
(
registration
);
//新增使用登记证和设备变更记录
this
.
saveRecord
(
registration
);
//创建设备履历
this
.
createResume
(
equIds
,
registration
,
taskV2Model
.
getRoutePath
());
JgChangeRegistrationUnitMapper
.
updateById
(
registration
);
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
dto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
registration
));
this
.
delRepeatUseEquipData
(
registration
.
getApplyNo
(),
registration
.
getStatus
(),
registration
.
getNewUseUnitCreditCode
());
}
private
void
updateUseInfoAddress
(
IdxBizJgUseInfo
useInfo
,
JgChangeRegistrationUnit
registration
)
{
useInfo
.
setProvince
(
registration
.
getProvince
());
useInfo
.
setCity
(
registration
.
getCity
());
...
...
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