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
1b68637d
Commit
1b68637d
authored
Apr 02, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(JG):使用登记按单位办理代码提交
parent
bb4dc1de
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
489 additions
and
134 deletions
+489
-134
JgUseRegistrationDto.java
...oin/amos/boot/module/jg/api/dto/JgUseRegistrationDto.java
+5
-1
JgUseRegistration.java
...oin/amos/boot/module/jg/api/entity/JgUseRegistration.java
+6
-1
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+3
-1
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+44
-24
JgTransferNoticeController.java
.../module/jg/biz/controller/JgTransferNoticeController.java
+3
-2
JgUseRegistrationController.java
...module/jg/biz/controller/JgUseRegistrationController.java
+8
-4
IIdxBizJgInspectionDetectionInfoService.java
.../biz/service/IIdxBizJgInspectionDetectionInfoService.java
+3
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+4
-2
IdxBizJgInspectionDetectionInfoServiceImpl.java
...vice/impl/IdxBizJgInspectionDetectionInfoServiceImpl.java
+8
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+405
-98
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/JgUseRegistrationDto.java
View file @
1b68637d
...
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
...
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -112,4 +111,9 @@ public class JgUseRegistrationDto extends BaseDto {
...
@@ -112,4 +111,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty
(
value
=
"其他附件"
)
@ApiModelProperty
(
value
=
"其他附件"
)
private
String
otherAccessories
;
private
String
otherAccessories
;
/**
* 办理类型,unit(单位) set(台套)
*/
@ApiModelProperty
(
value
=
"办理类型"
)
private
String
manageType
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgUseRegistration.java
View file @
1b68637d
...
@@ -193,10 +193,15 @@ public class JgUseRegistration extends BaseEntity {
...
@@ -193,10 +193,15 @@ public class JgUseRegistration extends BaseEntity {
@TableField
(
value
=
"transfer_to_user_ids"
)
@TableField
(
value
=
"transfer_to_user_ids"
)
private
String
transferToUserIds
;
private
String
transferToUserIds
;
/**
/**
* 其他附件
* 其他附件
*/
*/
@TableField
(
value
=
"other_accessories"
)
@TableField
(
value
=
"other_accessories"
)
private
String
otherAccessories
;
private
String
otherAccessories
;
/**
* 办理类型,unit(单位) set(台套)
*/
@TableField
(
value
=
"manage_type"
)
private
String
manageType
;
}
}
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 @
1b68637d
...
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -46,4 +46,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
...
@@ -46,4 +46,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page
<
JSONObject
>
queryForUnitPipelineEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
Page
<
JSONObject
>
queryForUnitPipelineEquipmentPage
(
@Param
(
"page"
)
Page
<
JSONObject
>
page
,
@Param
(
"jsonObject"
)
JSONObject
jsonObject
);
@MapKey
(
"id"
)
List
<
Map
<
String
,
Object
>>
selectEquipList
(
@Param
(
"id"
)
Long
id
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
1b68637d
...
@@ -11,18 +11,9 @@
...
@@ -11,18 +11,9 @@
date_format(reg_date,'%Y-%m-%d') as regDate,
date_format(reg_date,'%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.use_unit_name as useUnitName,
ur.status,
ur.status,
other.CODE96333 code96333,
ur.receive_org_name as receiveOrgName,
ur.receive_org_name as receiveOrgName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.EQU_CATEGORY as equCategoryCode,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
jri.EQU_LIST as equList,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equListName,
use.USE_INNER_CODE as innerCode,
ur.use_address as place,
ur.use_address as place,
ur.instance_id as instanceId,
ur.instance_id as instanceId,
re.equ_id as equipId,
ur.apply_no as applyNo,
ur.apply_no as applyNo,
ur.next_execute_ids as nextExecuteIds,
ur.next_execute_ids as nextExecuteIds,
ur.promoter,
ur.promoter,
...
@@ -33,7 +24,17 @@
...
@@ -33,7 +24,17 @@
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId,
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId,
ur.create_user_id as createUserId,
ur.rec_date as recDate
ur.rec_date as recDate,
GROUP_CONCAT(DISTINCT other.CODE96333) AS code96333,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY)) as equCategory,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME) AS productName,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
GROUP_CONCAT(DISTINCT jri.EQU_CODE) AS equCode,
GROUP_CONCAT(DISTINCT jri.EQU_LIST) AS equList,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_LIST)) AS equListName,
GROUP_CONCAT(DISTINCT use.USE_INNER_CODE) AS innerCode,
GROUP_CONCAT(DISTINCT re.equ_id) AS equipId
from tzs_jg_use_registration ur
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
...
@@ -41,7 +42,6 @@
...
@@ -41,7 +42,6 @@
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
</sql>
</sql>
<select
id=
"getListPage"
resultType=
"java.util.Map"
>
<select
id=
"getListPage"
resultType=
"java.util.Map"
>
select
select
*
*
...
@@ -76,6 +76,7 @@
...
@@ -76,6 +76,7 @@
<if
test=
"dto.dataType == 'company' "
>
<if
test=
"dto.dataType == 'company' "
>
and ur.use_unit_credit_code = #{dto.unitCode}
and ur.use_unit_credit_code = #{dto.unitCode}
</if>
</if>
GROUP BY re.equip_transfer_id
</where>
</where>
union
union
<include
refid=
"page-list"
/>
<include
refid=
"page-list"
/>
...
@@ -97,8 +98,9 @@
...
@@ -97,8 +98,9 @@
<if
test=
"dto.useUnitName != null and dto.useUnitName != ''"
>
<if
test=
"dto.useUnitName != null and dto.useUnitName != ''"
>
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
</if>
GROUP BY re.equip_transfer_id
</where>
)
</where>
)
order by regDate desc, recDate desc
order by regDate desc, recDate desc
</select>
</select>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
SELECT
SELECT
...
@@ -223,33 +225,32 @@
...
@@ -223,33 +225,32 @@
ur.audit_status as auditStatus,
ur.audit_status as auditStatus,
date_format(reg_date, '%Y-%m-%d') as regDate,
date_format(reg_date, '%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.use_unit_name as useUnitName,
ur.status,
ur.status
as status
,
other.CODE96333
code96333,
GROUP_CONCAT(DISTINCT other.CODE96333) as
code96333,
ur.receive_org_name as receiveOrgName,
ur.receive_org_name as receiveOrgName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
GROUP_CONCAT(DISTINCT(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY)) as equCategory,
jri.PRODUCT_NAME as productName,
GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME) as productName,
jri.EQU_CODE as equCode,
GROUP_CONCAT(DISTINCT jri.EQU_CODE) as equCode,
use.USE_INNER_CODE as innerCode,
GROUP_CONCAT(DISTINCT use.USE_INNER_CODE) as innerCode,
-- concat(use.PROVINCE_NAME, use.CITY_NAME, use.COUNTY_NAME) as place,
ur.use_address as place,
ur.use_address as place,
ur.instance_id as instanceId,
ur.instance_id as instanceId,
re.equ_id
as equipId,
GROUP_CONCAT(DISTINCT re.equ_id)
as equipId,
ur.apply_no as applyNo,
ur.apply_no as applyNo,
ur.next_execute_ids as nextExecuteIds,
ur.next_execute_ids as nextExecuteIds,
ur.promoter,
ur.promoter
as promoter
,
ur.supervisory_code as supervisoryCode,
ur.supervisory_code as supervisoryCode,
ur.use_registration_code as useRegistrationCode,
ur.use_registration_code as useRegistrationCode,
date_format(ur.audit_pass_date, '%Y-%m-%d') as auditPassDate,
date_format(ur.audit_pass_date, '%Y-%m-%d') as auditPassDate,
ur.receive_org_name as receiveOrgName,
ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.is_xixian as isXixian
ur.is_xixian
as isXixian
from tzs_jg_use_registration ur
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
where ur.sequence_nbr = #{id}
where ur.sequence_nbr = #{id}
GROUP BY re.equip_transfer_id
</select>
</select>
<select
id=
"getEquType"
resultType=
"java.lang.String"
>
<select
id=
"getEquType"
resultType=
"java.lang.String"
>
SELECT ec.name
SELECT ec.name
...
@@ -314,7 +315,26 @@
...
@@ -314,7 +315,26 @@
ORDER BY tjmce."rec_date" desc
ORDER BY tjmce."rec_date" desc
LIMIT 1
LIMIT 1
</select>
</select>
<select
id=
"selectEquipList"
resultType=
"java.util.Map"
>
select jui.RECORD as SEQUENCE_NBR,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as EQU_LIST,
jfi.PRODUCE_UNIT_NAME,
jui.USE_INNER_CODE,
jfi.FACTORY_NUM,
jui.ADDRESS as ADDRESS,
jui.RECORD record,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as EQU_DEFINE,
jri.PRODUCT_NAME,
jri.EQU_CODE,
other.SUPERVISORY_CODE,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as EQU_CATEGORY
from tzs_jg_use_registration_eq tjure
LEFT JOIN idx_biz_jg_use_info jui on tjure.equ_id = jui.RECORD
LEFT JOIN idx_biz_jg_factory_info jfi on tjure.equ_id = jfi.RECORD
left JOIN idx_biz_jg_register_info jri on tjure.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_other_info other on other.RECORD = jui.RECORD
WHERE tjure.equip_transfer_id = #{id}
</select>
<select
id=
"queryForUnitPipelineEquipmentPage"
resultType=
"com.alibaba.fastjson.JSONObject"
>
<select
id=
"queryForUnitPipelineEquipmentPage"
resultType=
"com.alibaba.fastjson.JSONObject"
>
SELECT
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_NAME" useUnitName,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgTransferNoticeController.java
View file @
1b68637d
...
@@ -176,13 +176,14 @@ public class JgTransferNoticeController extends BaseController {
...
@@ -176,13 +176,14 @@ public class JgTransferNoticeController extends BaseController {
public
void
generateCertificateReport
(
HttpServletResponse
response
)
{
public
void
generateCertificateReport
(
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 组装模板变量
// 组装模板变量
map
.
put
(
"useRegistrationCode"
,
"202301256456"
);
// 编号
map
.
put
(
"manageType"
,
"unit"
);
// 编号
map
.
put
(
"useRegistrationCode"
,
"容3T陕A0001"
);
// 编号
map
.
put
(
"useUnitName"
,
"西安市高科物业服务有限公司"
);
// 使用单位名称
map
.
put
(
"useUnitName"
,
"西安市高科物业服务有限公司"
);
// 使用单位名称
map
.
put
(
"fullAddress"
,
"西安市曲江新区春临东街南湖意境1单元2号楼"
);
// 设备使用地点
map
.
put
(
"fullAddress"
,
"西安市曲江新区春临东街南湖意境1单元2号楼"
);
// 设备使用地点
map
.
put
(
"equList"
,
"电梯"
);
// 设备种类
map
.
put
(
"equList"
,
"电梯"
);
// 设备种类
map
.
put
(
"equDefine"
,
"曳引驱动电梯啊啊啊啊啊啊啊啊啊啊啊啊啊"
);
// 设备品种
map
.
put
(
"equDefine"
,
"曳引驱动电梯啊啊啊啊啊啊啊啊啊啊啊啊啊"
);
// 设备品种
map
.
put
(
"equipCode"
,
""
);
// 设备代码
map
.
put
(
"equipCode"
,
""
);
// 设备代码
map
.
put
(
"equCategory"
,
"
曳引电梯噜啦噜啦嘞绿绿绿绿绿绿绿
"
);
// 设备类别
map
.
put
(
"equCategory"
,
"
压力管道
"
);
// 设备类别
map
.
put
(
"useInnerCode"
,
"KY-9527555555555555"
);
// 单位内编号
map
.
put
(
"useInnerCode"
,
"KY-9527555555555555"
);
// 单位内编号
map
.
put
(
"factoryNum"
,
"FUCK-G600010000056"
);
// 产品编号
map
.
put
(
"factoryNum"
,
"FUCK-G600010000056"
);
// 产品编号
map
.
put
(
"receiveOrgName"
,
"西安市曲江新区质检院"
);
// 登记机关
map
.
put
(
"receiveOrgName"
,
"西安市曲江新区质检院"
);
// 登记机关
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgUseRegistrationController.java
View file @
1b68637d
...
@@ -54,6 +54,7 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -54,6 +54,7 @@ public class JgUseRegistrationController extends BaseController {
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)),
String
.
valueOf
(
map
.
getOrDefault
(
"carNumber"
,
""
)),
String
.
valueOf
(
map
.
getOrDefault
(
"carNumber"
,
""
)),
String
.
valueOf
(
map
.
getOrDefault
(
"manageType"
,
""
)),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
...
@@ -63,7 +64,8 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -63,7 +64,8 @@ public class JgUseRegistrationController extends BaseController {
@PostMapping
(
value
=
"/withdraw"
)
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
jgUseRegistrationServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
))
);
jgUseRegistrationServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)),
String
.
valueOf
(
map
.
getOrDefault
(
"manageType"
,
"unit"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
...
@@ -122,7 +124,8 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -122,7 +124,8 @@ public class JgUseRegistrationController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"详情"
,
notes
=
"详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"详情"
,
notes
=
"详情"
)
@GetMapping
(
value
=
"/getDetail"
)
@GetMapping
(
value
=
"/getDetail"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetail
(
@RequestParam
(
"record"
)
String
record
,
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
false
)
Long
sequenceNbr
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetail
(
@RequestParam
(
value
=
"record"
,
required
=
false
)
String
record
,
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
false
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgUseRegistrationServiceImpl
.
getDetail
(
record
,
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
jgUseRegistrationServiceImpl
.
getDetail
(
record
,
sequenceNbr
));
}
}
...
@@ -162,8 +165,9 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -162,8 +165,9 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping
(
value
=
"/export"
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
value
=
"printType"
,
defaultValue
=
"0"
)
String
printType
)
{
@RequestParam
(
value
=
"printType"
,
defaultValue
=
"0"
)
String
printType
,
jgUseRegistrationServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
);
@RequestParam
(
value
=
"manageType"
,
defaultValue
=
""
)
String
manageType
)
{
jgUseRegistrationServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
,
manageType
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/IIdxBizJgInspectionDetectionInfoService.java
View file @
1b68637d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
java.util.List
;
/**
/**
* 安全追溯-检验检测信息表接口类
* 安全追溯-检验检测信息表接口类
*
*
...
@@ -13,4 +13,6 @@ public interface IIdxBizJgInspectionDetectionInfoService {
...
@@ -13,4 +13,6 @@ public interface IIdxBizJgInspectionDetectionInfoService {
boolean
saveOrUpdateData
(
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
);
boolean
saveOrUpdateData
(
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
);
IdxBizJgInspectionDetectionInfo
queryNewestDetailByRecord
(
String
record
);
IdxBizJgInspectionDetectionInfo
queryNewestDetailByRecord
(
String
record
);
List
<
IdxBizJgInspectionDetectionInfo
>
checkInspectionInfo
(
List
<
String
>
records
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
1b68637d
...
@@ -707,6 +707,8 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -707,6 +707,8 @@ public class CommonServiceImpl implements ICommonService {
if
(
CollectionUtils
.
isEmpty
(
map
))
{
if
(
CollectionUtils
.
isEmpty
(
map
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
}
String
wordPath
=
"equipment-registration-certificate-report.ftl"
;
wordPath
=
"unit"
.
equals
(
map
.
get
(
"manageType"
))
?
"unit-registration-certificate-report.ftl"
:
wordPath
;
// 组装模板变量
// 组装模板变量
map
.
put
(
"useRegistrationCode"
,
Optional
.
ofNullable
(
map
.
get
(
"useRegistrationCode"
)).
orElse
(
""
).
toString
());
// 编号
map
.
put
(
"useRegistrationCode"
,
Optional
.
ofNullable
(
map
.
get
(
"useRegistrationCode"
)).
orElse
(
""
).
toString
());
// 编号
map
.
put
(
"useUnitName"
,
Optional
.
ofNullable
(
map
.
get
(
"useUnitName"
)).
orElse
(
""
).
toString
());
// 使用单位名称
map
.
put
(
"useUnitName"
,
Optional
.
ofNullable
(
map
.
get
(
"useUnitName"
)).
orElse
(
""
).
toString
());
// 使用单位名称
...
@@ -731,7 +733,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -731,7 +733,7 @@ public class CommonServiceImpl implements ICommonService {
// word转pdf
// word转pdf
File
pdfFile
;
File
pdfFile
;
try
{
try
{
pdfFile
=
this
.
wordToPdf
(
"特种设备使用登记证_"
,
"equipment-registration-certificate-report.ftl"
,
map
);
pdfFile
=
this
.
wordToPdf
(
"特种设备使用登记证_"
,
wordPath
,
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
@@ -816,7 +818,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -816,7 +818,7 @@ public class CommonServiceImpl implements ICommonService {
// 设置文本域的字体为中文字体
// 设置文本域的字体为中文字体
acroFields
.
setFieldProperty
(
param
.
getKey
(),
"textfont"
,
font
,
null
);
acroFields
.
setFieldProperty
(
param
.
getKey
(),
"textfont"
,
font
,
null
);
// 设置字体大小
// 设置字体大小
acroFields
.
setFieldProperty
(
param
.
getKey
(),
"textsize"
,
9
.0f
,
null
);
acroFields
.
setFieldProperty
(
param
.
getKey
(),
"textsize"
,
12
.0f
,
null
);
// 将 map 中的值写到 pdf 模板对应的文本域中
// 将 map 中的值写到 pdf 模板对应的文本域中
acroFields
.
setField
(
param
.
getKey
(),
param
.
getValue
()
+
""
);
acroFields
.
setField
(
param
.
getKey
(),
param
.
getValue
()
+
""
);
}
}
...
...
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/IdxBizJgInspectionDetectionInfoServiceImpl.java
View file @
1b68637d
...
@@ -37,4 +37,11 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
...
@@ -37,4 +37,11 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
return
result
;
return
result
;
}
}
@Override
public
List
<
IdxBizJgInspectionDetectionInfo
>
checkInspectionInfo
(
List
<
String
>
records
)
{
IdxBizJgInspectionDetectionInfo
result
=
new
IdxBizJgInspectionDetectionInfo
();
QueryWrapper
<
IdxBizJgInspectionDetectionInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
in
(
IdxBizJgInspectionDetectionInfo:
:
getRecord
,
records
).
orderByDesc
(
IdxBizJgInspectionDetectionInfo:
:
getInspectDate
);
return
list
(
queryWrapper
);
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
1b68637d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -8,7 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -8,7 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
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.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
...
@@ -35,7 +38,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
...
@@ -35,7 +38,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
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.boot.module.ymt.api.service.InspectionDetectionInfoService
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
...
@@ -47,21 +49,24 @@ import org.redisson.api.RLock;
...
@@ -47,21 +49,24 @@ import org.redisson.api.RLock;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* 服务实现类
* 服务实现类
...
@@ -98,7 +103,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -98,7 +103,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
"inspectReport"
,
"designStandard"
,
"designDoc"
,
"longitudeLatitude"
,
"otherAccessoriesDes"
,
"otherAccessoriesFact"
,
"inspectReport"
,
"designStandard"
,
"designDoc"
,
"longitudeLatitude"
,
"otherAccessoriesDes"
,
"otherAccessoriesFact"
,
"otherAccessoriesReg"
,
"installProxyStatementAttachment"
,
"installContractAttachment"
,
"insOtherAccessories"
,
"otherAccessoriesReg"
,
"installProxyStatementAttachment"
,
"installContractAttachment"
,
"insOtherAccessories"
,
"maintenanceContract"
,
"maintOtherAccessories"
,
"installProxyStatementAttachment"
,
"installContractAttachment"
,
"maintenanceContract"
,
"maintOtherAccessories"
,
"installProxyStatementAttachment"
,
"installContractAttachment"
,
"insOtherAccessories"
,
"maintenanceContract"
,
"factSupervisionInspectionReport"
,
"boilerEnergyEfficiencyCertificate"
};
"insOtherAccessories"
,
"maintenanceContract"
,
"factSupervisionInspectionReport"
,
"boilerEnergyEfficiencyCertificate"
};
@Autowired
CodeUtil
codeUtil
;
@Autowired
@Autowired
private
IdxBizJgUseInfoMapper
useInfoMapper
;
private
IdxBizJgUseInfoMapper
useInfoMapper
;
@Autowired
@Autowired
...
@@ -107,10 +114,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -107,10 +114,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
IdxBizJgOtherInfoMapper
otherInfoMapper
;
private
IdxBizJgOtherInfoMapper
otherInfoMapper
;
@Autowired
@Autowired
private
JgUseRegistrationEqMapper
jgRelationEquipMapper
;
private
JgUseRegistrationEqMapper
jgRelationEquipMapper
;
@Autowired
@Autowired
private
ProduceInfoMapper
produceInfoMapper
;
private
ProduceInfoMapper
produceInfoMapper
;
@Autowired
@Autowired
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
@Autowired
...
@@ -121,12 +126,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -121,12 +126,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
IdxBizJgMaintenanceRecordInfoServiceImpl
idxBizJgMaintenanceRecordInfoService
;
private
IdxBizJgMaintenanceRecordInfoServiceImpl
idxBizJgMaintenanceRecordInfoService
;
@Autowired
@Autowired
private
RedissonClient
redissonClient
;
private
RedissonClient
redissonClient
;
@Autowired
CodeUtil
codeUtil
;
@Autowired
@Autowired
private
Sequence
sequence
;
private
Sequence
sequence
;
@Autowired
private
JgUseRegistrationEqServiceImpl
jgUseRegistrationEqService
;
@Autowired
private
IdxBizJgInspectionDetectionInfoServiceImpl
idxBizJgInspectionDetectionInfoService
;
/**
/**
* @param auditPassDate 通过时间
* @param auditPassDate 通过时间
...
@@ -216,12 +221,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -216,12 +221,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新检验检测信息
// 更新检验检测信息
this
.
updateOrCreateInspectionDetection
(
map
);
this
.
updateOrCreateInspectionDetection
(
map
);
// 更新注册登记信息表
// 更新注册登记信息表
LambdaQueryWrapper
<
JgUseRegistrationEq
>
jgUseRegEqWrapper
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
jgUseRegEqWrapper
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
currentDocumentId
);
jgUseRegEqWrapper
.
eq
(
JgUseRegistrationEq:
:
getIsDelete
,
false
);
JgUseRegistrationEq
jgUseRegistrationEq
=
jgRelationEquipMapper
.
selectOne
(
jgUseRegEqWrapper
);
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
IdxBizJgRegLambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
IdxBizJgRegLambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
IdxBizJgRegLambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
jgUseRegistrationEq
.
getEquId
(
)).
set
(
IdxBizJgRegisterInfo:
:
getRegisterState
,
this
.
getRegCode
());
IdxBizJgRegLambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
map
.
get
(
"equipId"
)).
set
(
IdxBizJgRegisterInfo:
:
getRegisterState
,
this
.
getRegCode
());
idxBizJgRegisterInfoService
.
update
(
IdxBizJgRegLambda
);
idxBizJgRegisterInfoService
.
update
(
IdxBizJgRegLambda
);
// 更新设备监管部门
// 更新设备监管部门
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfo
=
new
IdxBizJgSupervisionInfo
();
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfo
=
new
IdxBizJgSupervisionInfo
();
...
@@ -245,14 +246,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -245,14 +246,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
BeanUtil
.
copyProperties
(
map
,
inspectionDetectionInfo
);
BeanUtil
.
copyProperties
(
map
,
inspectionDetectionInfo
);
if
(
map
.
get
(
"jySeq"
)
!=
null
)
{
if
(
map
.
get
(
"jySeq"
)
!=
null
)
{
// 更新逻辑
// 更新逻辑
InspectionDetectionInfo
inspectionDetectionInfoDb
=
inspectionDetectionInfoMapper
.
selectById
(
map
.
get
(
"jySeq"
).
toString
());
InspectionDetectionInfo
inspectionDetectionInfoDb
=
inspectionDetectionInfoMapper
.
selectById
(
map
.
get
(
"jySeq"
).
toString
());
Bean
.
copyExistPropertis
(
inspectionDetectionInfo
,
inspectionDetectionInfoDb
);
Bean
.
copyExistPropertis
(
inspectionDetectionInfo
,
inspectionDetectionInfoDb
);
inspectionDetectionInfoMapper
.
updateById
(
inspectionDetectionInfo
);
inspectionDetectionInfoMapper
.
updateById
(
inspectionDetectionInfo
);
}
else
{
}
else
{
// 插入逻辑
// 插入逻辑
if
(
inspectionDetectionInfo
.
getInspectType
()
!=
null
&&
inspectionDetectionInfo
.
getInspectConclusion
()
!=
null
)
{
if
(
inspectionDetectionInfo
.
getInspectType
()
!=
null
&&
inspectionDetectionInfo
.
getInspectConclusion
()
!=
null
)
{
inspectionDetectionInfo
.
setRecord
(
map
.
get
(
"equipId"
).
toString
());
inspectionDetectionInfo
.
setRecord
(
map
.
get
(
"equipId"
).
toString
());
inspectionDetectionInfo
.
setRecDate
(
new
Date
());
inspectionDetectionInfo
.
setRecDate
(
new
Date
());
inspectionDetectionInfo
.
setSequenceNbr
(
sequence
.
nextId
()
+
""
);
inspectionDetectionInfo
.
setSequenceNbr
(
sequence
.
nextId
()
+
""
);
...
@@ -325,8 +326,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -325,8 +326,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
/**
* 按单位办理或按台套办理
*
* @param map map
* @return list
*/
@Transactional
@Transactional
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
Map
<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
functionMap
=
MapBuilder
.<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
create
()
.
put
(
"unit"
,
this
::
handleUnitUseRegistration
).
build
();
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>
function
=
functionMap
.
getOrDefault
(
map
.
getString
(
"manageType"
),
this
::
handleUseRegistration
);
return
function
.
apply
(
map
);
}
/**
* 按台套办理
*
* @param map map
* @return list
*/
private
List
<
Map
<
String
,
Object
>>
handleUseRegistration
(
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 使用登记信息
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
...
@@ -380,7 +400,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -380,7 +400,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
city
.
forEach
(
item
->
{
city
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"city"
))))
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"city"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
String
.
valueOf
(
item
.
get
(
"regionName"
)
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
}
});
});
}
}
...
@@ -388,8 +408,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -388,8 +408,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
region
.
forEach
(
item
->
{
region
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"county"
))))
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"county"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
String
.
valueOf
(
item
.
get
(
"regionName"
)));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
}
});
});
}
}
...
@@ -397,8 +416,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -397,8 +416,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
street
.
forEach
(
item
->
{
street
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"factoryUseSiteStreet"
))))
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"factoryUseSiteStreet"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
String
.
valueOf
(
item
.
get
(
"regionName"
)));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
}
});
});
}
}
...
@@ -463,7 +481,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -463,7 +481,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
// 执行流程
// 执行流程
flowExecute
(
jgUseRegistration
.
getSequenceNbr
(),
instanceId
,
"0"
,
""
,
""
,
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
flowExecute
(
jgUseRegistration
.
getSequenceNbr
(),
instanceId
,
"0"
,
""
,
""
,
map
.
getString
(
"manageType"
),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
}
}
}
else
{
}
else
{
ArrayList
<
TaskModelDto
>
list
=
new
ArrayList
<>();
ArrayList
<
TaskModelDto
>
list
=
new
ArrayList
<>();
...
@@ -488,6 +506,253 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -488,6 +506,253 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
}
}
/**
* 按单位办理
*
* @param map map
* @return list
*/
private
List
<
Map
<
String
,
Object
>>
handleUnitUseRegistration
(
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
throw
new
BadRequest
(
"请先选择设备信息!"
);
}
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoService
.
checkInspectionInfo
(
equipmentLists
.
stream
()
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
.
collect
(
Collectors
.
toList
())
);
if
(
inspectionDetectionInfoList
.
stream
().
anyMatch
(
info
->
ObjectUtils
.
isEmpty
(
info
)
||
ObjectUtils
.
isEmpty
(
info
.
getInspectType
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectConclusion
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectOrgCode
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectOrgName
())))
{
throw
new
BadRequest
(
"请补充设备检验检测信息后提交!"
);
}
JgUseRegistration
useRegistration
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgUseRegistration
.
class
);
useRegistration
.
setRegDate
(
new
Date
());
useRegistration
.
setManageType
(
map
.
getString
(
"manageType"
));
useRegistration
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
useRegistration
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
// 使用单位信息
useRegistration
.
setUseUnitName
(
company
.
getCompanyName
());
useRegistration
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
List
<
LinkedHashMap
>
tree
=
commonService
.
getCreatTree
();
// 接收单位信息
Optional
.
ofNullable
(
useRegistration
.
getReceiveOrgCode
())
.
filter
(
code
->
code
.
contains
(
"_"
))
.
map
(
code
->
code
.
split
(
"_"
))
.
ifPresent
(
splitReceiveOrgCode
->
{
String
orgCode
=
this
.
recursiveMatching
(
tree
,
splitReceiveOrgCode
[
0
]);
useRegistration
.
setReceiveOrgCode
(
orgCode
);
useRegistration
.
setReceiveCompanyCode
(
splitReceiveOrgCode
[
0
]);
useRegistration
.
setReceiveOrgName
(
splitReceiveOrgCode
[
1
]);
});
// 安全管理员
Optional
.
ofNullable
(
map
.
getString
(
"safetyManager"
))
.
filter
(
manager
->
manager
.
contains
(
"_"
))
.
map
(
manager
->
manager
.
split
(
"_"
))
.
ifPresent
(
data
->
{
map
.
put
(
"safetyManagerId"
,
data
[
0
]);
map
.
put
(
"safetyManagerName"
,
data
[
1
]);
});
//其他附件
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
useRegistration
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
// 使用地点
Map
<
String
,
List
<
LinkedHashMap
>>
locationMap
=
MapBuilder
.<
String
,
List
<
LinkedHashMap
>>
create
()
.
put
(
"city"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
))
.
put
(
"county"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
))
.
put
(
"factoryUseSiteStreet"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
))
.
build
();
String
fullAddress
=
locationMap
.
entrySet
().
stream
()
.
map
(
entry
->
{
String
mapKey
=
String
.
valueOf
(
map
.
get
(
entry
.
getKey
()));
List
<
LinkedHashMap
>
locations
=
entry
.
getValue
();
return
(!
ObjectUtils
.
isEmpty
(
mapKey
)
&&
!
ObjectUtils
.
isEmpty
(
locations
))
?
locations
.
stream
()
.
filter
(
item
->
mapKey
.
equals
(
String
.
valueOf
(
item
.
get
(
"regionCode"
))))
.
map
(
item
->
String
.
valueOf
(
item
.
get
(
"regionName"
)))
.
findFirst
()
.
orElse
(
""
)
:
""
;
})
.
collect
(
Collectors
.
joining
());
// 具体地址
useRegistration
.
setUseAddress
(
"陕西省"
+
fullAddress
+
map
.
get
(
"address"
));
// 新增或编辑保存
if
(
StringUtils
.
isEmpty
(
useRegistration
.
getSequenceNbr
()))
{
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
getCode
.
get
(
String
.
valueOf
(
map
.
get
(
"businessCode"
))),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"使用登记申请单单号获取失败!"
);
}
useRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
useRegistration
.
setAuditStatus
(
"待提交"
);
useRegistration
.
setStatus
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getPass
());
this
.
save
(
useRegistration
);
}
else
{
this
.
updateById
(
useRegistration
);
// 删除设备关联表记录
jgRelationEquipMapper
.
delete
(
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
().
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
()));
}
// 更新关联气瓶信息
List
<
JgUseRegistrationEq
>
equipList
=
equipmentLists
.
stream
()
.
map
(
x
->
new
JgUseRegistrationEq
()
.
setEquId
(
String
.
valueOf
(
x
.
get
(
"record"
)))
.
setEquipTransferId
(
String
.
valueOf
(
useRegistration
.
getSequenceNbr
())))
.
collect
(
Collectors
.
toList
());
// 保存关联设备信息
jgUseRegistrationEqService
.
saveBatch
(
equipList
);
//启动流程
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
// 删除暂存代办
commonServiceImpl
.
deleteTaskModel
(
String
.
valueOf
(
useRegistration
.
getSequenceNbr
()));
// 新增提交,没有instanceId需要发起流程
if
(
StringUtils
.
isEmpty
(
useRegistration
.
getInstanceId
()))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
DEFINITION_KEY
);
dto
.
setBusinessKey
(
useRegistration
.
getApplyNo
());
dto
.
setCompleteFirstTask
(
true
);
dto
.
setNextExecuteUserCompanyCode
(
useRegistration
.
getReceiveCompanyCode
());
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
actWorkflowBatchDTO
.
setProcess
(
Collections
.
singletonList
(
dto
));
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
resultDto
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
resultDto
.
stream
()
.
findFirst
()
.
ifPresent
(
workflowResultDto
->
this
.
updateUseRegUnitData
(
useRegistration
.
getSequenceNbr
(),
"0"
,
workflowResultDto
,
true
));
}
else
{
// 执行流程
flowExecute
(
useRegistration
.
getSequenceNbr
(),
useRegistration
.
getInstanceId
(),
"0"
,
""
,
""
,
map
.
getString
(
"manageType"
),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
}
}
else
{
String
equType
=
this
.
baseMapper
.
getEquType
(
String
.
valueOf
(
map
.
get
(
"EQU_LIST_CODE"
)));
TaskModelDto
dto
=
TaskModelDto
.
builder
()
.
model
(
BeanUtil
.
copyProperties
(
useRegistration
,
TaskMessageDto
.
class
))
.
taskContent
(
"来自"
+
equType
+
"【"
+
(
ObjectUtils
.
isEmpty
(
useRegistration
.
getSupervisoryCode
())
?
"无"
:
useRegistration
.
getSupervisoryCode
())
+
"】等的业务办理,"
+
"【申请单号:"
+
useRegistration
.
getApplyNo
()
+
"】"
)
.
taskCode
(
useRegistration
.
getApplyNo
())
.
taskType
(
String
.
valueOf
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getCode
()))
.
relationId
(
String
.
valueOf
(
useRegistration
.
getSequenceNbr
()))
.
nextExecuteUser
(
""
)
.
build
();
commonServiceImpl
.
buildTaskModel
(
Collections
.
singletonList
(
dto
));
}
// 设备数据存历史数据,在流程完成时使用
updateHistory
(
map
,
null
,
String
.
valueOf
(
useRegistration
.
getSequenceNbr
()),
useRegistration
.
getSupervisoryCode
());
return
this
.
baseMapper
.
getDetailById
(
useRegistration
.
getSequenceNbr
());
}
/**
* 单位批量办理数据处理
*
* @param sequenceNbr 主键
* @param operate 操作类型
* @param workflowResultDto 工作流返回
* @param isFirst 是否first
*/
private
void
updateUseRegUnitData
(
Long
sequenceNbr
,
String
operate
,
WorkflowResultDto
workflowResultDto
,
Boolean
isFirst
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
String
role
=
workflowResultDto
.
getNextExecutorRoleIds
();
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
if
(!
ObjectUtils
.
isEmpty
(
workflowResultDto
.
getNextTaskCode
()))
{
taskCode
=
workflowResultDto
.
getNextTaskCode
();
}
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
jgUseRegistration
.
setNextTaskId
(
workflowResultDto
.
getNextTaskId
());
jgUseRegistration
.
setNextExecuteUserIds
(
workflowResultDto
.
getNextExecutorUserIds
());
if
(
isFirst
)
{
jgUseRegistration
.
setInstanceStatus
(
workflowResultDto
.
getExecutorRoleIds
());
jgUseRegistration
.
setInstanceId
(
workflowResultDto
.
getInstanceId
());
}
//非完成,进行审核
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
jgUseRegistration
.
setNextExecuteIds
(
role
);
jgUseRegistration
.
setInstanceStatus
(
Optional
.
ofNullable
(
jgUseRegistration
.
getInstanceStatus
())
.
map
(
status
->
String
.
join
(
","
,
status
,
role
))
.
orElse
(
role
)
);
//通过或者驳回
jgUseRegistration
.
setStatus
(
"0"
.
equals
(
operate
)
?
Objects
.
requireNonNull
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
)).
getPass
()
:
Objects
.
requireNonNull
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
)).
getReject
());
jgUseRegistration
.
setPromoter
(
"0"
.
equals
(
operate
)
?
reginParams
.
getUserModel
().
getUserId
():
""
);
if
(
isFirst
)
{
this
.
buildTask
(
jgUseRegistration
,
workflowResultDto
);
}
else
{
// 更新代办状态
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"relationId"
,
jgUseRegistration
.
getInstanceId
());
params
.
put
(
"flowStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
params
.
put
(
"flowStatusLabel"
,
jgUseRegistration
.
getStatus
());
params
.
put
(
"taskStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
params
.
put
(
"taskStatusLabel"
,
jgUseRegistration
.
getStatus
());
TaskV2Model
taskV2Model
=
commonServiceImpl
.
updateTaskModel
(
params
);
// 创建新的代办
if
(!
ObjectUtils
.
isEmpty
(
taskV2Model
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
BeanUtils
.
copyProperties
(
taskV2Model
,
taskModelDto
);
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
jgUseRegistration
,
taskMessageDto
);
//taskMessageDto.setEquipId(jgUseRegistrationEq.getEquId());
taskModelDto
.
setModel
(
taskMessageDto
);
taskModelDto
.
setTaskName
(
workflowResultDto
.
getNextTaskName
());
taskModelDto
.
setExecuteUserIds
(
workflowResultDto
.
getNextExecutorUserIds
());
taskModelDto
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorRoleIds
());
taskModelDto
.
setFlowCode
(
workflowResultDto
.
getNextTaskId
());
if
(
WorkFlowStatusEnum
.
USE_SUBMIT
.
getCode
().
equals
(
taskCode
)
&&
"1"
.
equals
(
operate
))
{
taskModelDto
.
setPageType
(
"edit"
);
}
commonServiceImpl
.
buildTaskModel
(
Collections
.
singletonList
(
taskModelDto
));
}
else
{
workflowResultDto
.
setInstanceId
(
jgUseRegistration
.
getInstanceId
());
buildTask
(
jgUseRegistration
,
workflowResultDto
);
}
}
}
else
{
// 流程结束
jgUseRegistration
.
setStatus
(
taskCode
);
jgUseRegistration
.
setNextExecuteUserIds
(
""
);
//查询历史暂存表
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getOne
(
Wrappers
.<
JgRegistrationHistory
>
lambdaQuery
()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
String
.
valueOf
(
sequenceNbr
)));
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
mapData
.
get
(
"equipmentLists"
);
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
for
(
int
i
=
0
;
i
<
equipmentLists
.
size
();
i
++)
{
Map
<
String
,
Object
>
equipment
=
equipmentLists
.
get
(
i
);
mapData
.
put
(
"equipId"
,
equipment
.
get
(
"record"
));
mapData
.
put
(
"isFirstEquip"
,
i
==
0
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
);
}
}
}
commonServiceImpl
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
}
public
JgUseRegistration
updateData
(
Long
sequenceNbr
,
String
operate
,
WorkflowResultDto
workflowResultDto
,
Boolean
isFirst
,
String
carNumber
)
{
public
JgUseRegistration
updateData
(
Long
sequenceNbr
,
String
operate
,
WorkflowResultDto
workflowResultDto
,
Boolean
isFirst
,
String
carNumber
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
role
=
workflowResultDto
.
getNextExecutorRoleIds
();
String
role
=
workflowResultDto
.
getNextExecutorRoleIds
();
...
@@ -561,9 +826,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -561,9 +826,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
workflowResultDto
.
setInstanceId
(
jgUseRegistration
.
getInstanceId
());
workflowResultDto
.
setInstanceId
(
jgUseRegistration
.
getInstanceId
());
buildTask
(
jgUseRegistration
,
workflowResultDto
);
buildTask
(
jgUseRegistration
,
workflowResultDto
);
}
}
}
}
}
else
{
}
else
{
// 流程结束
// 流程结束
jgUseRegistration
.
setStatus
(
taskCode
);
jgUseRegistration
.
setStatus
(
taskCode
);
...
@@ -573,19 +836,49 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -573,19 +836,49 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambdaSelect
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
String
.
valueOf
(
sequenceNbr
));
lambdaSelect
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
String
.
valueOf
(
sequenceNbr
));
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambdaSelect
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambdaSelect
);
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
// 其他信息
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
);
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambdaOth
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
}
lambdaOth
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
lambdaOth
);
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
// 注册信息
return
jgUseRegistration
;
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
}
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
private
void
processMapData
(
Long
sequenceNbr
,
JSONObject
mapData
,
JgUseRegistration
jgUseRegistration
,
JgRegistrationHistory
jgRegistrationHistory
)
{
// 更新设备信息
// 其他信息
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
,
mapData
,
registerInfo
,
otherInfo
);
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambdaOth
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
// 生成使用登记证编号
lambdaOth
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
lambdaOth
);
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
jgUseRegistrationEq
.
getEquId
(),
jgUseRegistration
.
getSupervisoryCode
(),
jgUseRegistration
.
getReceiveCompanyCode
());
// 注册信息
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 更新设备信息
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
,
mapData
,
registerInfo
,
otherInfo
);
// 生成使用登记证编号
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())){
if
((
Boolean
)
mapData
.
get
(
"isFirstEquip"
))
{
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
String
.
valueOf
(
mapData
.
get
(
"equipId"
)),
jgUseRegistration
.
getSupervisoryCode
(),
jgUseRegistration
.
getReceiveCompanyCode
());
jgUseRegistration
.
setUseRegistrationCode
(
code
);
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
registerInfo
.
setUseOrgCode
(
code
);
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
code
);
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
}
else
{
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
jgUseRegistration
.
getUseRegistrationCode
());
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
}
}
else
{
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
String
.
valueOf
(
mapData
.
get
(
"equipId"
)),
jgUseRegistration
.
getSupervisoryCode
(),
jgUseRegistration
.
getReceiveCompanyCode
());
jgUseRegistration
.
setUseRegistrationCode
(
code
);
jgUseRegistration
.
setUseRegistrationCode
(
code
);
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
registerInfo
.
setUseOrgCode
(
code
);
registerInfo
.
setUseOrgCode
(
code
);
...
@@ -596,43 +889,41 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -596,43 +889,41 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
}
}
// 使用信息
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
lambda
);
String
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
useInfo
.
getStreetName
();
// 更新es
updateEsData
(
usePlace
,
mapData
,
otherInfo
,
jgUseRegistration
);
// 更新代办状态
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"relationId"
,
jgUseRegistration
.
getInstanceId
());
params
.
put
(
"flowStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
params
.
put
(
"flowStatusLabel"
,
jgUseRegistration
.
getStatus
());
params
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
params
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
jgUseRegistration
,
taskMessageDto
);
taskMessageDto
.
setEquipId
(
jgUseRegistrationEq
.
getEquId
());
params
.
put
(
"model"
,
taskMessageDto
);
commonServiceImpl
.
updateTaskModel
(
params
);
}
}
commonServiceImpl
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
// 使用信息
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
return
jgUseRegistration
;
lambda
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
lambda
);
String
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
useInfo
.
getStreetName
();
// 更新es
updateEsData
(
usePlace
,
mapData
,
otherInfo
,
jgUseRegistration
);
// 更新代办状态
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"relationId"
,
jgUseRegistration
.
getInstanceId
());
params
.
put
(
"flowStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
params
.
put
(
"flowStatusLabel"
,
jgUseRegistration
.
getStatus
());
params
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
params
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
jgUseRegistration
,
taskMessageDto
);
taskMessageDto
.
setEquipId
(
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
params
.
put
(
"model"
,
taskMessageDto
);
commonServiceImpl
.
updateTaskModel
(
params
);
}
}
/**
/**
* 系统类型的code 自动生成设备代码
* 系统类型的code 自动生成设备代码
* @param lambda lambda
*
* @param registerInfo 注册信息
* @param lambda lambda
* @param receiveCompanyCode 接收机构行政区划代码
* @param registerInfo 注册信息
* @param mapData 历史数据
* @param receiveCompanyCode 接收机构行政区划代码
* @param mapData 历史数据
* @param jgRegistrationHistory 历史数据行数据
* @param jgRegistrationHistory 历史数据行数据
*/
*/
public
void
justGenerateEquCode
(
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
,
IdxBizJgRegisterInfo
registerInfo
,
String
receiveCompanyCode
,
JSONObject
mapData
,
JgRegistrationHistory
jgRegistrationHistory
)
{
public
void
justGenerateEquCode
(
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
,
IdxBizJgRegisterInfo
registerInfo
,
String
receiveCompanyCode
,
JSONObject
mapData
,
JgRegistrationHistory
jgRegistrationHistory
)
{
if
(
EquCodeTypeEnum
.
SYSTEM_GENERATED
.
getCode
().
equals
(
registerInfo
.
getEquCodeType
()))
{
if
(
EquCodeTypeEnum
.
SYSTEM_GENERATED
.
getCode
().
equals
(
registerInfo
.
getEquCodeType
()))
{
// 更新注册信息表的设备代码字段
// 更新注册信息表的设备代码字段
String
equCode
=
this
.
getEquCode
(
registerInfo
,
receiveCompanyCode
);
String
equCode
=
this
.
getEquCode
(
registerInfo
,
receiveCompanyCode
);
registerInfo
.
setEquCode
(
equCode
);
registerInfo
.
setEquCode
(
equCode
);
mapData
.
put
(
"equCode"
,
equCode
);
mapData
.
put
(
"equCode"
,
equCode
);
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getEquCode
,
equCode
);
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getEquCode
,
equCode
);
...
@@ -642,8 +933,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -642,8 +933,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
private
String
getEquCode
(
IdxBizJgRegisterInfo
registerInfo
,
String
receiveCompanyCode
){
private
String
getEquCode
(
IdxBizJgRegisterInfo
registerInfo
,
String
receiveCompanyCode
)
{
ProduceInfo
produceInfo
=
produceInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
ProduceInfo
>().
eq
(
AbstractEquipBaseEntity:
:
getRecord
,
registerInfo
.
getRecord
()));
ProduceInfo
produceInfo
=
produceInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
ProduceInfo
>().
eq
(
AbstractEquipBaseEntity:
:
getRecord
,
registerInfo
.
getRecord
()));
CodeGenerateDto
codeGenerateDto
=
new
CodeGenerateDto
();
CodeGenerateDto
codeGenerateDto
=
new
CodeGenerateDto
();
codeGenerateDto
.
setEquList
(
registerInfo
.
getEquList
());
codeGenerateDto
.
setEquList
(
registerInfo
.
getEquList
());
codeGenerateDto
.
setEquCategory
(
registerInfo
.
getEquCategory
());
codeGenerateDto
.
setEquCategory
(
registerInfo
.
getEquCategory
());
...
@@ -705,22 +996,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -705,22 +996,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
dto
.
setStartDate
(
new
Date
());
dto
.
setStartDate
(
new
Date
());
jgUseRegistration
.
setInstanceId
(
workflowResultDto
.
getInstanceId
());
jgUseRegistration
.
setInstanceId
(
workflowResultDto
.
getInstanceId
());
// 设备信息
// 设备信息
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda1
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda1
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()));
JgUseRegistrationEq
jgUseRegistrationEq
=
jgRelationEquipMapper
.
selectOne
(
lambda1
);
jgUseRegistration
.
setNextExecuteIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
jgUseRegistration
.
setNextExecuteIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
jgUseRegistration
,
taskMessageDto
);
BeanUtil
.
copyProperties
(
jgUseRegistration
,
taskMessageDto
);
taskMessageDto
.
setEquipId
(
jgUseRegistrationEq
.
getEquId
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
jgUseRegEqWrapper
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
jgUseRegEqWrapper
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()));
List
<
JgUseRegistrationEq
>
jgUseRegistrationEqList
=
jgRelationEquipMapper
.
selectList
(
jgUseRegEqWrapper
);
if
(!
jgUseRegistrationEqList
.
isEmpty
()){
String
equId
=
jgUseRegistrationEqList
.
get
(
0
).
getEquId
();
taskMessageDto
.
setEquipId
(
equId
);
dto
.
setTaskContent
(
"来自"
+
this
.
getBaseMapper
().
getEquType
(
equId
)
+
"【"
+
(
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
())
?
"无"
:
jgUseRegistration
.
getSupervisoryCode
())
+
"】的业务办理,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
}
dto
.
setModel
(
taskMessageDto
);
dto
.
setModel
(
taskMessageDto
);
dto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorRoleIds
());
dto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorRoleIds
());
dto
.
setTaskContent
(
"来自"
+
this
.
getBaseMapper
().
getEquType
(
jgUseRegistrationEq
.
getEquId
())
+
"【"
+
(
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
())
?
"无"
:
jgUseRegistration
.
getSupervisoryCode
())
+
"】的业务办理,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
dto
.
setFlowCode
(
jgUseRegistration
.
getNextTaskId
());
dto
.
setFlowCode
(
jgUseRegistration
.
getNextTaskId
());
list
.
add
(
dto
);
list
.
add
(
dto
);
commonServiceImpl
.
buildTaskModel
(
list
);
commonServiceImpl
.
buildTaskModel
(
list
);
}
}
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
,
String
carNumber
,
String
nextTaskId
)
{
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
,
String
carNumber
,
String
manageType
,
String
nextTaskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
try
{
try
{
...
@@ -757,7 +1053,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -757,7 +1053,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List
<
WorkflowResultDto
>
resultDto
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
List
<
WorkflowResultDto
>
resultDto
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
if
(!
ObjectUtils
.
isEmpty
(
resultDto
)
&&
!
ObjectUtils
.
isEmpty
(
resultDto
.
get
(
0
)))
{
if
(!
ObjectUtils
.
isEmpty
(
resultDto
)
&&
!
ObjectUtils
.
isEmpty
(
resultDto
.
get
(
0
)))
{
WorkflowResultDto
workflowResultDto
=
resultDto
.
get
(
0
);
WorkflowResultDto
workflowResultDto
=
resultDto
.
get
(
0
);
updateData
(
jgUseRegistration
.
getSequenceNbr
(),
operate
,
workflowResultDto
,
Boolean
.
FALSE
,
carNumber
);
//按单位办理
if
(
"unit"
.
equals
(
manageType
))
{
this
.
updateUseRegUnitData
(
jgUseRegistration
.
getSequenceNbr
(),
operate
,
workflowResultDto
,
false
);
}
else
{
this
.
updateData
(
jgUseRegistration
.
getSequenceNbr
(),
operate
,
workflowResultDto
,
false
,
carNumber
);
}
}
}
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -768,7 +1069,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -768,7 +1069,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
public
void
withdraw
(
String
instanceId
,
String
nextTaskId
)
{
public
void
withdraw
(
String
instanceId
,
String
nextTaskId
,
String
manageType
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
try
{
try
{
...
@@ -806,16 +1107,19 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -806,16 +1107,19 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
queryWrapper
.
eq
(
JgUseRegistration:
:
getInstanceId
,
instanceId
);
queryWrapper
.
eq
(
JgUseRegistration:
:
getInstanceId
,
instanceId
);
JgUseRegistration
data
=
this
.
baseMapper
.
selectOne
(
queryWrapper
);
JgUseRegistration
data
=
this
.
baseMapper
.
selectOne
(
queryWrapper
);
// 设备信息
// 设备信息
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda1
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda1
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
String
.
valueOf
(
data
.
getSequenceNbr
()));
JgUseRegistrationEq
jgUseRegistrationEq
=
jgRelationEquipMapper
.
selectOne
(
lambda1
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
data
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
data
));
jsonObject
.
put
(
"nextTaskId"
,
data
.
getNextTaskId
());
jsonObject
.
put
(
"nextTaskId"
,
data
.
getNextTaskId
());
jsonObject
.
put
(
"nextExecuteUser"
,
data
.
getNextExecuteIds
());
jsonObject
.
put
(
"nextExecuteUser"
,
data
.
getNextExecuteIds
());
jsonObject
.
put
(
"taskType"
,
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getCode
());
jsonObject
.
put
(
"taskType"
,
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getCode
());
jsonObject
.
put
(
"equipId"
,
jgUseRegistrationEq
.
getEquId
());
jsonObject
.
put
(
"flowStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
jsonObject
.
put
(
"flowStatus"
,
commonServiceImpl
.
getDictionaryCodeByName
(
jgUseRegistration
.
getStatus
()));
jsonObject
.
put
(
"flowStatusLabel"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"flowStatusLabel"
,
jgUseRegistration
.
getStatus
());
//非单位办理
if
(!
"unit"
.
equals
(
manageType
))
{
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda1
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda1
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
String
.
valueOf
(
data
.
getSequenceNbr
()));
JgUseRegistrationEq
jgUseRegistrationEq
=
jgRelationEquipMapper
.
selectOne
(
lambda1
);
jsonObject
.
put
(
"equipId"
,
jgUseRegistrationEq
.
getEquId
());
}
if
(!
WorkFlowStatusEnum
.
USE_SUBMIT
.
getCode
().
equals
(
taskCode
))
{
if
(!
WorkFlowStatusEnum
.
USE_SUBMIT
.
getCode
().
equals
(
taskCode
))
{
jsonObject
.
put
(
"pageType"
,
"look"
);
jsonObject
.
put
(
"pageType"
,
"look"
);
}
}
...
@@ -849,18 +1153,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -849,18 +1153,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
// 需求:当申请信息由于设备信息错误被驳回及撤回时显示的数据还是旧设备数据,导致该申请单无法使用
// 解决方案:设备基本信息、制造信息、设计信息、安装信息、维保信息,已完成时显示历史数据、非完成时显示最新设备数据
this
.
fillHistoryDataWithNewEquip
(
jsonObject
,
jgUseRegistration
,
record
);
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"instanceId"
);
jsonObject
.
remove
(
"instanceId"
);
// 补充"车牌号"字段
if
(!
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())){
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
// 需求:当申请信息由于设备信息错误被驳回及撤回时显示的数据还是旧设备数据,导致该申请单无法使用
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
// 解决方案:设备基本信息、制造信息、设计信息、安装信息、维保信息,已完成时显示历史数据、非完成时显示最新设备数据
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
this
.
fillHistoryDataWithNewEquip
(
jsonObject
,
jgUseRegistration
,
record
);
// 补充"车牌号"字段
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
}
// 转化 附件 字段
// 转化 附件 字段
commonServiceImpl
.
convertStringToJsonobject
(
jsonObject
,
jsonFields
);
commonServiceImpl
.
convertStringToJsonobject
(
jsonObject
,
jsonFields
);
return
jsonObject
;
return
jsonObject
;
...
@@ -899,40 +1205,40 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -899,40 +1205,40 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
detail
;
return
detail
;
}
}
private
Map
<
String
,
Object
>
getInspectDetail
(
String
record
){
private
Map
<
String
,
Object
>
getInspectDetail
(
String
record
)
{
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
List
<
String
>
permissionInspectTypes
=
getInspectInfoByEquDefine
(
registerInfo
.
getEquList
(),
registerInfo
.
getEquCategory
(),
registerInfo
.
getEquDefine
());
List
<
String
>
permissionInspectTypes
=
getInspectInfoByEquDefine
(
registerInfo
.
getEquList
(),
registerInfo
.
getEquCategory
(),
registerInfo
.
getEquDefine
());
if
(
permissionInspectTypes
.
size
()
>
0
)
{
if
(
permissionInspectTypes
.
size
()
>
0
)
{
return
this
.
baseMapper
.
getInspectDetail
(
record
,
permissionInspectTypes
);
return
this
.
baseMapper
.
getInspectDetail
(
record
,
permissionInspectTypes
);
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
}
private
List
<
String
>
getInspectInfoByEquDefine
(
String
equList
,
String
equCategory
,
String
equDefine
){
private
List
<
String
>
getInspectInfoByEquDefine
(
String
equList
,
String
equCategory
,
String
equDefine
)
{
List
<
String
>
permissionInspectTypes
=
new
ArrayList
<>();
List
<
String
>
permissionInspectTypes
=
new
ArrayList
<>();
// 使用登记时:需要《首次检验》类型检验信息的设备种类、设备类别、设备品种
// 使用登记时:需要《首次检验》类型检验信息的设备种类、设备类别、设备品种
String
[]
FIRST_INSPECT_EQULIST
=
{
"5000"
};
String
[]
FIRST_INSPECT_EQULIST
=
{
"5000"
};
String
[]
FIRST_INSPECT_EQUCATEGORY
=
{
"4400"
,
"4900"
,
"4A00"
};
String
[]
FIRST_INSPECT_EQUCATEGORY
=
{
"4400"
,
"4900"
,
"4A00"
};
String
[]
FIRST_INSPECT_EQUDEFINE
=
{
"4170"
};
String
[]
FIRST_INSPECT_EQUDEFINE
=
{
"4170"
};
// 使用登记时:需要《安装监督验》类型检验信息的设备种类、设备类别、设备品种
// 使用登记时:需要《安装监督验》类型检验信息的设备种类、设备类别、设备品种
String
[]
AZJDJY_INSPECT_EQULIST
=
{
"3000"
,
"6000"
,
"9000"
,
"8000"
,
"1000"
};
String
[]
AZJDJY_INSPECT_EQULIST
=
{
"3000"
,
"6000"
,
"9000"
,
"8000"
,
"1000"
};
String
[]
AZJDJY_INSPECT_EQUCATEGORY
=
{
"4800"
,
"4300"
,
"4700"
,
"4D00"
,
"2100"
,
"2400"
};
String
[]
AZJDJY_INSPECT_EQUCATEGORY
=
{
"4800"
,
"4300"
,
"4700"
,
"4D00"
,
"2100"
,
"2400"
};
String
[]
AZJDJY_INSPECT_EQUDEFINE
=
{
"4110"
,
"4130"
,
"4140"
,
"4150"
,
"4190"
,
"4220"
,
"4210"
,
"4260"
,
"4270"
,
"4290"
};
String
[]
AZJDJY_INSPECT_EQUDEFINE
=
{
"4110"
,
"4130"
,
"4140"
,
"4150"
,
"4190"
,
"4220"
,
"4210"
,
"4260"
,
"4270"
,
"4290"
};
// 使用登记时:需要《首次检验》或者《安装监督验检验》信息的设备种类、设备类别、设备品种
// 使用登记时:需要《首次检验》或者《安装监督验检验》信息的设备种类、设备类别、设备品种
String
[]
SCJY_OR_AZJDJY_EQULIST
=
{};
String
[]
SCJY_OR_AZJDJY_EQULIST
=
{};
String
[]
SCJY_OR_AZJDJY_EQUCATEGORY
=
{};
String
[]
SCJY_OR_AZJDJY_EQUCATEGORY
=
{};
String
[]
SCJY_OR_AZJDJY_INSPECT_EQUDEFINE
=
{
"4230"
,
"4240"
,
"4250"
,
"4280"
};
String
[]
SCJY_OR_AZJDJY_INSPECT_EQUDEFINE
=
{
"4230"
,
"4240"
,
"4250"
,
"4280"
};
if
(
Arrays
.
asList
(
FIRST_INSPECT_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
FIRST_INSPECT_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
FIRST_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
if
(
Arrays
.
asList
(
FIRST_INSPECT_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
FIRST_INSPECT_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
FIRST_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
permissionInspectTypes
.
add
(
"SCJY"
);
permissionInspectTypes
.
add
(
"SCJY"
);
return
permissionInspectTypes
;
return
permissionInspectTypes
;
}
}
if
(
Arrays
.
asList
(
AZJDJY_INSPECT_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
AZJDJY_INSPECT_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
AZJDJY_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
if
(
Arrays
.
asList
(
AZJDJY_INSPECT_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
AZJDJY_INSPECT_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
AZJDJY_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
permissionInspectTypes
.
add
(
"AZJDJY"
);
permissionInspectTypes
.
add
(
"AZJDJY"
);
return
permissionInspectTypes
;
return
permissionInspectTypes
;
}
}
if
(
Arrays
.
asList
(
SCJY_OR_AZJDJY_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
SCJY_OR_AZJDJY_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
SCJY_OR_AZJDJY_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
if
(
Arrays
.
asList
(
SCJY_OR_AZJDJY_EQULIST
).
contains
(
equList
)
||
Arrays
.
asList
(
SCJY_OR_AZJDJY_EQUCATEGORY
).
contains
(
equCategory
)
||
Arrays
.
asList
(
SCJY_OR_AZJDJY_INSPECT_EQUDEFINE
).
contains
(
equDefine
))
{
permissionInspectTypes
.
add
(
"SCJY"
);
permissionInspectTypes
.
add
(
"SCJY"
);
permissionInspectTypes
.
add
(
"AZJDJY"
);
permissionInspectTypes
.
add
(
"AZJDJY"
);
return
permissionInspectTypes
;
return
permissionInspectTypes
;
...
@@ -989,8 +1295,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -989,8 +1295,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
null
;
return
null
;
}
}
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
,
HttpServletResponse
response
,
String
printType
)
{
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
,
HttpServletResponse
response
,
String
printType
,
String
manageType
)
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
exportParamsMap
.
put
(
"manageType"
,
manageType
);
// 查询使用登记详情
// 查询使用登记详情
JgUseRegistration
useRegistration
=
this
.
getById
(
sequenceNbr
);
JgUseRegistration
useRegistration
=
this
.
getById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgUseRegistrationEq
>
useEqLambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
LambdaQueryWrapper
<
JgUseRegistrationEq
>
useEqLambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
...
...
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