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
3e6b11e7
Commit
3e6b11e7
authored
Jul 23, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
28180 【监管】移装告知业务改为批量提交批量审批
parent
ce6858a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
95 deletions
+143
-95
JgTransferNoticeController.java
.../module/jg/biz/controller/JgTransferNoticeController.java
+7
-8
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+136
-87
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgTransferNoticeController.java
View file @
3e6b11e7
...
@@ -7,11 +7,9 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...
@@ -7,11 +7,9 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -21,6 +19,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
...
@@ -21,6 +19,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.*
;
...
@@ -142,17 +141,17 @@ public class JgTransferNoticeController extends BaseController {
...
@@ -142,17 +141,17 @@ public class JgTransferNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"移装造告知分页查询"
,
notes
=
"移装造告知分页查询"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"移装造告知分页查询"
,
notes
=
"移装造告知分页查询"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryForPage
(
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@RequestBody
(
required
=
false
)
JgTransferNoticeDto
model
@RequestBody
(
required
=
false
)
JgTransferNoticeDto
model
)
{
)
{
Page
<
JgTransferNotice
>
page
=
new
Page
<>(
current
,
size
);
Page
<
JgTransferNotice
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
type
=
(
String
)
iJgInstallationNoticeService
.
getCompanyType
().
get
(
"companyLevel"
);
type
=
(
String
)
iJgInstallationNoticeService
.
getCompanyType
().
get
(
"companyLevel"
);
return
ResponseHelper
.
buildResponse
(
jgTransferNoticeService
.
queryForJgTransferNoticePage
(
page
,
sort
,
model
,
type
,
reginParams
));
return
ResponseHelper
.
buildResponse
(
jgTransferNoticeService
.
queryForJgTransferNoticePage
(
page
,
sort
,
model
,
type
,
reginParams
));
}
}
/**
/**
...
@@ -163,8 +162,8 @@ public class JgTransferNoticeController extends BaseController {
...
@@ -163,8 +162,8 @@ public class JgTransferNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"移装告知列表全部数据查询"
,
notes
=
"移装造告知列表全部数据查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"移装告知列表全部数据查询"
,
notes
=
"移装造告知列表全部数据查询"
)
@GetMapping
(
value
=
"/generate-report"
)
@GetMapping
(
value
=
"/generate-report"
)
public
void
selectForList
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
void
selectForList
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
jgTransferNoticeService
.
generateTransferNoticeReport
(
sequenceNbr
,
response
);
jgTransferNoticeService
.
generateTransferNoticeReport
(
sequenceNbr
,
response
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -194,7 +193,7 @@ public class JgTransferNoticeController extends BaseController {
...
@@ -194,7 +193,7 @@ public class JgTransferNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"(测试使用)特种设备登记证套打"
,
notes
=
"(测试使用)特种设备登记证套打"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"(测试使用)特种设备登记证套打"
,
notes
=
"(测试使用)特种设备登记证套打"
)
@GetMapping
(
value
=
"/generate/pdf/print"
)
@GetMapping
(
value
=
"/generate/pdf/print"
)
public
void
printing
(
HttpServletResponse
response
)
{
public
void
printing
(
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"useRegistrationCode"
,
"梯10 陕B00005(24)"
);
map
.
put
(
"useRegistrationCode"
,
"梯10 陕B00005(24)"
);
map
.
put
(
"useUnitName"
,
"西安市高科物业服务有限公司"
);
map
.
put
(
"useUnitName"
,
"西安市高科物业服务有限公司"
);
...
...
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/JgTransferNoticeServiceImpl.java
View file @
3e6b11e7
...
@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...
@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
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.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice
;
...
@@ -27,6 +29,7 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...
@@ -27,6 +29,7 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.dao.ESElavtorRepository
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
...
@@ -40,6 +43,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
...
@@ -40,6 +43,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.redisson.api.RLock
;
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
;
...
@@ -106,6 +110,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -106,6 +110,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
private
JgRegistrationHistoryMapper
jgRegistrationHistoryMapper
;
private
JgRegistrationHistoryMapper
jgRegistrationHistoryMapper
;
@Autowired
@Autowired
private
RedissonClient
redissonClient
;
private
RedissonClient
redissonClient
;
@Autowired
ESEquipmentCategory
esEquipmentCategory
;
/**
/**
* 根据sequenceNbr查询
* 根据sequenceNbr查询
...
@@ -134,8 +140,11 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -134,8 +140,11 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
String
[]
fields
=
{
"otherAccessories"
,
"powerOfAttorney"
,
"constructionContract"
};
String
[]
fields
=
{
"otherAccessories"
,
"powerOfAttorney"
,
"constructionContract"
};
// 设备信息
// 设备信息
List
<
Map
<
String
,
Object
>>
equipmentInfos
=
jgTransferNoticeMapper
.
queryEquipInformation
(
sequenceNbr
);
// List<Map<String, Object>> equipmentInfos = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr);
List
<
JgTransferNoticeEq
>
jgTransferNoticeEqs
=
jgTransferNoticeEqMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgTransferNoticeEq
>().
eq
(
JgTransferNoticeEq:
:
getEquipTransferId
,
sequenceNbr
));
List
<
String
>
ids
=
jgTransferNoticeEqs
.
stream
().
map
(
JgTransferNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Iterable
<
ESEquipmentCategoryDto
>
allById
=
esEquipmentCategory
.
findAllById
(
ids
);
List
<
Map
<
String
,
Object
>>
equipListMaps
=
getEquipListMaps
(
allById
);
for
(
String
s
:
fields
)
{
for
(
String
s
:
fields
)
{
if
(
transferNotice
.
containsKey
(
s
))
{
if
(
transferNotice
.
containsKey
(
s
))
{
if
(
"powerOfAttorney"
.
equalsIgnoreCase
(
s
))
{
if
(
"powerOfAttorney"
.
equalsIgnoreCase
(
s
))
{
...
@@ -154,7 +163,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -154,7 +163,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
JSONObject
hisData
=
commonService
.
queryHistoryData
(
notice
.
getSequenceNbr
());
JSONObject
hisData
=
commonService
.
queryHistoryData
(
notice
.
getSequenceNbr
());
// 兼容老数据
// 兼容老数据
if
(
hisData
==
null
)
{
if
(
hisData
==
null
)
{
Map
<
String
,
Object
>
detail
=
getEquipInfoNew
(
companyLevel
,
transferNotice
,
equip
mentInfo
s
);
Map
<
String
,
Object
>
detail
=
getEquipInfoNew
(
companyLevel
,
transferNotice
,
equip
ListMap
s
);
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"transferNoticeInfo"
,
detail
);
this
.
put
(
"transferNoticeInfo"
,
detail
);
}};
}};
...
@@ -167,7 +176,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -167,7 +176,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
}
else
{
}
else
{
// 显示最新的设备信息
// 显示最新的设备信息
Map
<
String
,
Object
>
detail
=
getEquipInfoNew
(
companyLevel
,
transferNotice
,
equip
mentInfo
s
);
Map
<
String
,
Object
>
detail
=
getEquipInfoNew
(
companyLevel
,
transferNotice
,
equip
ListMap
s
);
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"transferNoticeInfo"
,
detail
);
this
.
put
(
"transferNoticeInfo"
,
detail
);
}};
}};
...
@@ -175,15 +184,29 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -175,15 +184,29 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
private
void
checkRepeatUsed
(
String
submitType
,
JgTransferNotice
notice
)
{
private
List
<
Map
<
String
,
Object
>>
getEquipListMaps
(
Iterable
<
ESEquipmentCategoryDto
>
equips
)
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
// 流程中校验
equips
.
forEach
(
equip
->
{
LambdaQueryWrapper
<
JgTransferNoticeEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
Map
<
String
,
Object
>
objectHashMap
=
new
HashMap
<>();
queryWrapper
.
eq
(
JgTransferNoticeEq:
:
getEquipTransferId
,
notice
.
getSequenceNbr
());
BeanUtil
.
beanToMap
(
equip
,
objectHashMap
,
false
,
false
);
JgTransferNoticeEq
noticeEq
=
jgTransferNoticeEqMapper
.
selectOne
(
queryWrapper
);
objectHashMap
.
put
(
"record"
,
equip
.
getSEQUENCE_NBR
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
objectHashMap
.
put
(
"ADDRESS"
,
concatDetailAddress
(
equip
));
.
equipRepeatUsedCheck
(
noticeEq
.
getEquId
(),
notice
.
getInstallUnitCreditCode
());
arrayList
.
add
(
objectHashMap
);
}
});
return
arrayList
;
}
private
String
concatDetailAddress
(
ESEquipmentCategoryDto
esEquipmentCategoryDto
)
{
// 省、市、区
String
usePlace
=
esEquipmentCategoryDto
.
getUSE_PLACE
();
// 详细地址
String
address
=
esEquipmentCategoryDto
.
getADDRESS
();
return
String
.
format
(
"%s%s"
,
usePlace
,
address
);
}
private
void
checkRepeatUsed
(
List
<
Map
<
String
,
Object
>>
deviceList
,
JgTransferNotice
notice
)
{
deviceList
.
forEach
(
obj
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)),
notice
.
getInstallUnitCreditCode
()));
}
}
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
...
@@ -209,21 +232,22 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -209,21 +232,22 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
private
Map
<
String
,
Object
>
getEquipInfoNew
(
String
companyLevel
,
Map
<
String
,
Object
>
transferNotice
,
List
<
Map
<
String
,
Object
>>
equipmentInfos
)
{
private
Map
<
String
,
Object
>
getEquipInfoNew
(
String
companyLevel
,
Map
<
String
,
Object
>
transferNotice
,
List
<
Map
<
String
,
Object
>>
equipmentInfos
)
{
Map
<
String
,
Object
>
detail
=
equipmentInfos
.
get
(
0
);
// Map<String, Object> detail = equipmentInfos.get(0);
Map
<
String
,
Object
>
equInfo
=
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
detail
.
get
(
"equId"
).
toString
());
// Map<String, Object> equInfo = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(detail.get("equId").toString());
equInfo
.
put
(
"useUnitCreditCodeUse"
,
equInfo
.
getOrDefault
(
"useUnitCreditCode"
,
""
));
// equInfo.put("useUnitCreditCodeUse", equInfo.getOrDefault("useUnitCreditCode", ""));
equInfo
.
put
(
"useUnitNameUse"
,
equInfo
.
getOrDefault
(
"useUnitName"
,
""
));
// equInfo.put("useUnitNameUse", equInfo.getOrDefault("useUnitName", ""));
equInfo
.
put
(
"productPhoto"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"productPhoto"
))));
// equInfo.put("productPhoto", JSON.parse(String.valueOf(detail.get("productPhoto"))));
equInfo
.
put
(
"factoryStandard"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"factoryStandard"
))));
// equInfo.put("factoryStandard", JSON.parse(String.valueOf(detail.get("factoryStandard"))));
equInfo
.
put
(
"productQualityYieldProve"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"productQualityYieldProve"
))));
// equInfo.put("productQualityYieldProve", JSON.parse(String.valueOf(detail.get("productQualityYieldProve"))));
equInfo
.
put
(
"insUseMaintainExplain"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"insUseMaintainExplain"
))));
// equInfo.put("insUseMaintainExplain", JSON.parse(String.valueOf(detail.get("insUseMaintainExplain"))));
equInfo
.
put
(
"inspectReport"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"inspectReport"
))));
// equInfo.put("inspectReport", JSON.parse(String.valueOf(detail.get("inspectReport"))));
equInfo
.
put
(
"designStandard"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"designStandard"
))));
// equInfo.put("designStandard", JSON.parse(String.valueOf(detail.get("designStandard"))));
equInfo
.
put
(
"designDoc"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"designDoc"
))));
// equInfo.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc"))));
BeanUtil
.
copyProperties
(
equInfo
,
detail
);
// BeanUtil.copyProperties(equInfo, detail);
BeanUtil
.
copyProperties
(
transferNotice
,
detail
,
"equList"
,
"supervisoryCode"
);
// BeanUtil.copyProperties(transferNotice, detail, "equList", "supervisoryCode");
detail
.
put
(
"companyLevel"
,
companyLevel
);
transferNotice
.
put
(
"companyLevel"
,
companyLevel
);
return
detail
;
transferNotice
.
put
(
"deviceList"
,
equipmentInfos
);
return
transferNotice
;
}
}
@Override
@Override
...
@@ -296,8 +320,10 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -296,8 +320,10 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
this
.
convertField
(
noticeDto
);
this
.
convertField
(
noticeDto
);
noticeDto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
noticeDto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
JgTransferNotice
notice
=
this
.
getById
(
noticeDto
.
getSequenceNbr
());
JgTransferNotice
notice
=
this
.
getById
(
noticeDto
.
getSequenceNbr
());
this
.
checkRepeatUsed
(
submitType
,
notice
);
//校验设备是否在流程中
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
noticeDto
.
getDeviceList
();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
this
.
checkRepeatUsed
(
deviceList
,
notice
);
//校验设备是否在流程中
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
// 发起流程
// 发起流程
ProcessTaskDTO
processTaskDTO
=
new
ProcessTaskDTO
();
ProcessTaskDTO
processTaskDTO
=
new
ProcessTaskDTO
();
...
@@ -396,6 +422,17 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -396,6 +422,17 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
jgTransferNoticeMapper
.
updateById
(
bean
);
jgTransferNoticeMapper
.
updateById
(
bean
);
}
}
jgTransferNoticeEqMapper
.
delete
(
new
LambdaQueryWrapper
<
JgTransferNoticeEq
>().
eq
(
JgTransferNoticeEq:
:
getEquipTransferId
,
noticeDto
.
getSequenceNbr
().
toString
()));
List
<
JgTransferNoticeEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
noticeDto
.
getApplyNo
());
jgRelationEquip
.
setEquipTransferId
(
noticeDto
.
getSequenceNbr
().
toString
());
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
return
noticeDto
;
return
noticeDto
;
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
@@ -410,16 +447,19 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -410,16 +447,19 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
}
}
@Autowired
ESElavtorRepository
esElavtorRepository
;
/**
/**
* 分页查询
* 分页查询
*/
*/
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
queryForJgTransferNoticePage
(
Page
<
JgTransferNotice
>
page
,
String
sort
,
JgTransferNoticeDto
model
,
String
type
,
ReginParams
reginParams
)
{
public
Page
<
Map
<
String
,
Object
>>
queryForJgTransferNoticePage
(
Page
<
JgTransferNotice
>
page
,
String
sort
,
JgTransferNoticeDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
String
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
model
.
setTransferToUserIds
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setTransferToUserIds
(
reginParams
.
getUserModel
().
getUserId
());
Page
<
Map
<
String
,
Object
>>
noticePage
=
jgTransferNoticeMapper
.
queryForPage
(
page
,
sortMap
,
model
,
type
,
orgCode
);
Page
<
Map
<
String
,
Object
>>
noticePage
=
jgTransferNoticeMapper
.
queryForPage
(
page
,
sortMap
,
model
,
type
,
orgCode
);
List
<
Map
<
String
,
Object
>>
mappedRecords
=
noticePage
.
getRecords
().
stream
().
peek
(
notice
->
{
List
<
Map
<
String
,
Object
>>
mappedRecords
=
noticePage
.
getRecords
().
stream
().
peek
(
notice
->
{
Optional
<
Long
>
noticeStatusOpt
=
Optional
.
ofNullable
((
String
)
notice
.
get
(
"noticeStatus"
)).
map
(
Long:
:
valueOf
);
Optional
<
Long
>
noticeStatusOpt
=
Optional
.
ofNullable
((
String
)
notice
.
get
(
"noticeStatus"
)).
map
(
Long:
:
valueOf
);
noticeStatusOpt
.
ifPresent
(
status
->
{
noticeStatusOpt
.
ifPresent
(
status
->
{
...
@@ -450,17 +490,16 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -450,17 +490,16 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
}
// 获取告知单号
// 获取告知单号
ResponseModel
<
List
<
String
>>
responseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
YZGZ
.
getCode
(),
deviceList
.
size
()
);
ResponseModel
<
List
<
String
>>
responseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
YZGZ
.
getCode
(),
1
);
if
(
CollectionUtils
.
isEmpty
(
responseModel
.
getResult
()))
{
if
(
CollectionUtils
.
isEmpty
(
responseModel
.
getResult
()))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
// 启动工作流并返回信息
// 启动工作流并返回信息
List
<
WorkflowResultDto
>
workflowResultList
=
workFlowInfo
(
submitType
,
deviceList
,
model
.
getReceiveCompanyCode
());
List
<
WorkflowResultDto
>
workflowResultList
=
this
.
workFlowInfo
(
submitType
,
model
.
getReceiveCompanyCode
());
List
<
JgTransferNotice
>
list
=
new
ArrayList
<>();
List
<
JgTransferNotice
>
list
=
new
ArrayList
<>();
List
<
JgTransferNoticeEq
>
equipList
=
new
ArrayList
<>();
List
<
JgTransferNoticeEq
>
equipList
=
new
ArrayList
<>();
//业务数据组装等
//业务数据组装等
businessData
(
submitType
,
reginParams
,
model
,
deviceList
,
responseModel
,
workflowResultList
,
list
,
equipList
);
businessData
(
submitType
,
reginParams
,
model
,
deviceList
,
responseModel
,
workflowResultList
,
list
,
equipList
);
jgTransferNoticeMapper
.
insertBatchSomeColumn
(
list
);
// 如果为保存并提交,则创建代办
// 如果为保存并提交,则创建代办
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
buildTask
(
list
,
workflowResultList
,
Boolean
.
TRUE
);
buildTask
(
list
,
workflowResultList
,
Boolean
.
TRUE
);
...
@@ -468,12 +507,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -468,12 +507,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
// 暂存任务
// 暂存任务
buildTaskDraft
(
list
);
buildTaskDraft
(
list
);
}
}
List
<
JgTransferNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgTransferNotice
>
collect
=
list
.
stream
().
filter
(
JgTransferNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
JgTransferNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
this
.
updateRedisBatch
(
list
);
this
.
updateRedisBatch
(
list
);
return
list
;
return
list
;
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
...
@@ -524,48 +557,54 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -524,48 +557,54 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
/**
/**
* 组装业务数据
* 组装业务数据
*/
*/
private
void
businessData
(
String
submitType
,
ReginParams
reginParams
,
JgTransferNoticeDto
model
,
List
<
Map
<
String
,
Object
>>
deviceList
,
ResponseModel
<
List
<
String
>>
responseModel
,
List
<
WorkflowResultDto
>
workflowResultList
,
List
<
JgTransferNotice
>
list
,
List
<
JgTransferNoticeEq
>
equipList
)
{
private
void
businessData
(
String
submitType
,
ReginParams
reginParams
,
JgTransferNoticeDto
model
,
List
<
Map
<
String
,
Object
>>
deviceList
,
ResponseModel
<
List
<
String
>>
responseModel
,
List
<
WorkflowResultDto
>
workflowResultList
,
List
<
JgTransferNotice
>
list
,
List
<
JgTransferNoticeEq
>
equipList
)
{
CompanyBo
companyBo
=
commonService
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
CompanyBo
companyBo
=
commonService
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
JgTransferNotice
dto
=
new
JgTransferNotice
();
BeanUtils
.
copyProperties
(
model
,
dto
);
dto
.
setCreateUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
int
i
=
0
;
String
applyNo
=
responseModel
.
getResult
().
get
(
i
);
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setApplyNo
(
applyNo
);
dto
.
setNoticeDate
(
new
Date
());
// 统计用
dto
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
workflowResultList
.
get
(
i
).
getNextExecutorRoleIds
());
dto
.
setNextExecuteUserIds
(
workflowResultList
.
get
(
i
).
getNextExecutorUserIds
());
dto
.
setInstanceStatus
(
workflowResultList
.
get
(
i
).
getNextExecutorRoleIds
()
+
","
+
workflowResultList
.
get
(
i
).
getExecutorRoleIds
());
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setNextTaskId
(
workflowResultList
.
get
(
i
).
getNextTaskId
());
}
else
{
dto
.
setNextExecuteUserIds
(
reginParams
.
getUserModel
().
getUserId
());
}
// dto.setEquipCateName(obj.getOrDefault("EQU_CATEGORY", "").toString());
// dto.setEquList(String.valueOf(obj.get("EQU_LIST")));
// dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
dto
.
setInstallUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setInstallUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
if
(!
CollectionUtils
.
isEmpty
(
workflowResultList
))
{
dto
.
setInstanceId
(
workflowResultList
.
get
(
i
).
getInstanceId
());
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
}
else
{
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
}
dto
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
dto
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
// dto.setEquAddress(obj.getOrDefault("ADDRESS", "").toString());
list
.
add
(
dto
);
jgTransferNoticeMapper
.
insertBatchSomeColumn
(
list
);
deviceList
.
forEach
(
obj
->
{
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
JgTransferNotice
dto
=
new
JgTransferNotice
();
BeanUtils
.
copyProperties
(
model
,
dto
);
dto
.
setCreateUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
int
i
=
deviceList
.
indexOf
(
obj
);
String
applyNo
=
responseModel
.
getResult
().
get
(
i
);
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setApplyNo
(
applyNo
);
dto
.
setNoticeDate
(
new
Date
());
// 统计用
dto
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
workflowResultList
.
get
(
i
).
getNextExecutorRoleIds
());
dto
.
setNextExecuteUserIds
(
workflowResultList
.
get
(
i
).
getNextExecutorUserIds
());
dto
.
setInstanceStatus
(
workflowResultList
.
get
(
i
).
getNextExecutorRoleIds
()
+
","
+
workflowResultList
.
get
(
i
).
getExecutorRoleIds
());
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setNextTaskId
(
workflowResultList
.
get
(
i
).
getNextTaskId
());
}
else
{
dto
.
setNextExecuteUserIds
(
reginParams
.
getUserModel
().
getUserId
());
}
dto
.
setEquipCateName
(
obj
.
getOrDefault
(
"EQU_CATEGORY"
,
""
).
toString
());
dto
.
setEquList
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST"
)));
dto
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"SUPERVISORY_CODE"
)));
dto
.
setInstallUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setInstallUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
if
(!
CollectionUtils
.
isEmpty
(
workflowResultList
))
{
jgRelationEquip
.
setEquipTransferId
(
dto
.
getSequenceNbr
().
toString
());
dto
.
setInstanceId
(
workflowResultList
.
get
(
i
).
getInstanceId
());
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
}
else
{
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
}
dto
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
dto
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setEquAddress
(
obj
.
getOrDefault
(
"ADDRESS"
,
""
).
toString
());
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
equipList
.
add
(
jgRelationEquip
);
});
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
}
}
...
@@ -611,22 +650,21 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -611,22 +650,21 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
* 工作流启动并执行
* 工作流启动并执行
*
*
* @param submitType 是否提交
* @param submitType 是否提交
* @param deviceList 设备信息
* @return 工作流返回相关数据
* @return 工作流返回相关数据
*/
*/
private
List
<
WorkflowResultDto
>
workFlowInfo
(
String
submitType
,
List
<
Map
<
String
,
Object
>>
deviceList
,
String
receiveOrgCode
)
{
private
List
<
WorkflowResultDto
>
workFlowInfo
(
String
submitType
,
String
receiveOrgCode
)
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
deviceList
.
forEach
(
item
->
{
//
deviceList.forEach(item -> {
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
item
.
get
(
"SEQUENCE_NBR"
)));
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
(
)));
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
//下一节点执行人单位(下节点接收机构code)
//下一节点执行人单位(下节点接收机构code)
dto
.
setNextExecuteUserCompanyCode
(
receiveOrgCode
);
dto
.
setNextExecuteUserCompanyCode
(
receiveOrgCode
);
list
.
add
(
dto
);
list
.
add
(
dto
);
});
//
});
actWorkflowBatchDTO
.
setProcess
(
list
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
iCmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
iCmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
// 组装工作流返回的数据
// 组装工作流返回的数据
...
@@ -769,6 +807,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -769,6 +807,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgTransferNoticeDto
dto
,
String
op
,
String
opinion
)
{
public
void
accept
(
JgTransferNoticeDto
dto
,
String
op
,
String
opinion
)
{
String
instanceId
=
dto
.
getInstanceId
();
String
instanceId
=
dto
.
getInstanceId
();
String
nextTaskId
=
dto
.
getNextTaskId
();
String
nextTaskId
=
dto
.
getNextTaskId
();
...
@@ -933,9 +972,19 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
...
@@ -933,9 +972,19 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
}
}
@Autowired
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
private
void
saveHisDataBeforeUpdate
(
JgTransferNotice
jgTransferNotice
,
String
equId
)
{
private
void
saveHisDataBeforeUpdate
(
JgTransferNotice
jgTransferNotice
,
String
equId
)
{
Map
<
String
,
Object
>
map
=
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
equId
);
String
seq
=
jgTransferNotice
.
getSequenceNbr
().
toString
();
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_ADVICE_REMOVAL
.
getName
(),
new
JSONObject
(
map
),
equId
,
jgTransferNotice
.
getSequenceNbr
().
toString
());
JSONObject
json
=
(
JSONObject
)
JSONObject
.
toJSON
(
jgTransferNotice
);
List
<
JgTransferNoticeEq
>
jgTransferNoticeEqs
=
jgTransferNoticeEqMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgTransferNoticeEq
>().
eq
(
JgTransferNoticeEq:
:
getEquipTransferId
,
seq
));
List
<
String
>
ids
=
jgTransferNoticeEqs
.
stream
().
map
(
JgTransferNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Iterable
<
ESEquipmentCategoryDto
>
allById
=
esEquipmentCategory
.
findAllById
(
ids
);
List
<
Map
<
String
,
Object
>>
equipListMaps
=
getEquipListMaps
(
allById
);
json
.
put
(
"deviceList"
,
equipListMaps
);
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_ADVICE_REMOVAL
.
getName
(),
json
,
equId
,
jgTransferNotice
.
getSequenceNbr
().
toString
());
}
}
...
...
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