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
ea960101
Commit
ea960101
authored
Jun 17, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):暂存功能修改
parent
8f970efd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
87 deletions
+199
-87
IdxBizJqEquipmentRegisterController.java
...g/biz/controller/IdxBizJqEquipmentRegisterController.java
+33
-0
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+16
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+19
-14
JgMaintainNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgMaintainNoticeServiceImpl.java
+58
-32
JgReformNoticeServiceImpl.java
...module/jg/biz/service/impl/JgReformNoticeServiceImpl.java
+28
-18
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+45
-23
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/IdxBizJqEquipmentRegisterController.java
View file @
ea960101
...
...
@@ -135,6 +135,39 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
}
/**
* 查询设备注册列表
*
* @param map
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/tempEquipPage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"暂存设备信息分页查询"
,
notes
=
"暂存设备信息分页查询"
)
@FieldMapping
({
@FieldMapping
.
FieldMap
(
sourceField
=
"useUnitSeq"
,
targetField
=
"useUnitCreditCode"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitCreditInfoBySeq"
),})
public
ResponseModel
<
Page
<
JSONObject
>>
tempEquipPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
JSONObject
json
=
new
JSONObject
(
map
);
json
.
put
(
"IS_INTO_MANAGEMENT"
,
false
);
// Stream.of(
// new AbstractMap.SimpleEntry<>(EQU_LIST, "EQU_LIST_CODE"),
// new AbstractMap.SimpleEntry<>(EQU_CATEGORY, "EQU_CATEGORY_CODE")
// ).forEach(entry -> {
// Optional.ofNullable(map.get(entry.getKey()))
// .map(Object::toString)
// .filter(StringUtils::isNotBlank)
// .ifPresent(val -> json.put(entry.getValue(), val));
// json.remove(entry.getKey());
// });
//
// Optional.ofNullable(map.get(DATA_SOURCE))
// .map(Object::toString)
// .filter(StringUtils::isNotBlank)
// .map(EquipSourceEnum::getDataSourceCode)
// .ifPresent(val -> json.put("DATA_SOURCE", val));
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
queryForEquipmentRegisterPage
(
json
));
}
/**
* @author LiuLin
*
* 历史无证设备分页查询接口(ES)
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
ea960101
...
...
@@ -3,12 +3,14 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldMapping
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -65,6 +67,20 @@ public class JgInstallationNoticeController extends BaseController {
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新安装告知"
,
notes
=
"根据sequenceNbr更新安装告知"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
@FieldMapping
({
@FieldMapping
.
FieldMap
(
sourceField
=
"installationInfo.propertyUnitSeq"
,
paramIndex
=
1
,
targetField
=
"installationInfo.propertyUnitName"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitCreditInfoBySeq"
),
@FieldMapping
.
FieldMap
(
sourceField
=
"installationInfo.useUnitSeq"
,
paramIndex
=
1
,
targetField
=
"installationInfo.useUnitCreditCode"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitCreditInfoBySeq"
)
})
public
ResponseModel
<
JgInstallationNoticeDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgInstallationNoticeDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"installationInfo"
)),
JgInstallationNoticeDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
...
...
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/JgInstallationNoticeServiceImpl.java
View file @
ea960101
...
...
@@ -864,11 +864,11 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"设备列表为空"
);
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"设备列表为空"
);
}
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取告知单号
...
...
@@ -904,7 +904,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgInstallationNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
if
(!
CollectionUtils
.
isEmpty
(
jgRelationEquipList
)){
jgInstallationNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
this
.
updateRedisBatch
(
list
);
return
list
;
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
...
...
@@ -1009,7 +1011,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto
.
setNoticeDate
(
new
Date
());
// 统计使用
dto
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
dto
.
setEquList
(
Optional
.
ofNullable
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST"
)).
map
(
String:
:
valueOf
).
orElse
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"equListName"
))));
if
(!
CollectionUtils
.
isEmpty
(
deviceList
))
{
dto
.
setEquList
(
Optional
.
ofNullable
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST"
)).
map
(
String:
:
valueOf
).
orElse
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"equListName"
))));
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
workflowResultList
.
get
(
0
).
getNextExecutorRoleIds
());
dto
.
setNextExecuteUserIds
(
workflowResultList
.
get
(
0
).
getNextExecutorUserIds
());
...
...
@@ -1033,15 +1037,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
dto
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
list
.
add
(
dto
);
deviceList
.
forEach
(
obj
->
{
JgInstallationNoticeEq
jgRelationEquip
=
new
JgInstallationNoticeEq
();
jgRelationEquip
.
setEquId
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"SEQUENCE_NBR"
))
?
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
))
:
String
.
valueOf
(
obj
.
get
(
"record"
)));
jgRelationEquip
.
setEquCategoryCode
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"EQU_CATEGORY_CODE"
))
?
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
))
:
String
.
valueOf
(
obj
.
get
(
"equCategory"
)));
jgRelationEquip
.
setEquListCode
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"EQU_LIST_CODE"
))
?
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
))
:
String
.
valueOf
(
obj
.
get
(
"equList"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
equipList
.
add
(
jgRelationEquip
);
});
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
forEach
(
obj
->
{
JgInstallationNoticeEq
jgRelationEquip
=
new
JgInstallationNoticeEq
();
jgRelationEquip
.
setEquId
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"SEQUENCE_NBR"
))
?
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
))
:
String
.
valueOf
(
obj
.
get
(
"record"
)));
jgRelationEquip
.
setEquCategoryCode
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"EQU_CATEGORY_CODE"
))
?
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
))
:
String
.
valueOf
(
obj
.
get
(
"equCategory"
)));
jgRelationEquip
.
setEquListCode
(!
ValidationUtil
.
isEmpty
(
obj
.
get
(
"EQU_LIST_CODE"
))
?
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
))
:
String
.
valueOf
(
obj
.
get
(
"equList"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
equipList
.
add
(
jgRelationEquip
);
});
}
}
/**
...
...
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/JgMaintainNoticeServiceImpl.java
View file @
ea960101
...
...
@@ -331,12 +331,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
noticeDto
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备"
);
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请)
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备"
);
}
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
...
...
@@ -447,16 +447,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
lambdaQueryWrapper
.
eq
(
JgMaintainNoticeEq:
:
getEquipTransferId
,
noticeDto
.
getSequenceNbr
());
jgMaintainNoticeEqMapper
.
delete
(
lambdaQueryWrapper
);
List
<
JgMaintainNoticeEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgMaintainNoticeEq
jgRelationEquip
=
new
JgMaintainNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
noticeDto
.
getSequenceNbr
().
toString
());
jgRelationEquip
.
setEquCode
(
ObjectUtils
.
isEmpty
(
obj
.
get
(
"EQU_CODE"
))?
null
:
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
)));
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
jgRelationEquip
.
setEquCategoryCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
)));
equipList
.
add
(
jgRelationEquip
);
});
jgMaintainNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
forEach
(
obj
->
{
JgMaintainNoticeEq
jgRelationEquip
=
new
JgMaintainNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
noticeDto
.
getSequenceNbr
().
toString
());
jgRelationEquip
.
setEquCode
(
ObjectUtils
.
isEmpty
(
obj
.
get
(
"EQU_CODE"
))?
null
:
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
)));
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
jgRelationEquip
.
setEquCategoryCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
)));
equipList
.
add
(
jgRelationEquip
);
});
jgMaintainNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
}
// 更新历史表
notice
.
setDeviceList
(
deviceList
);
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_MAINTENANCE_NOTIFICATION
.
getName
(),
JSON
.
parseObject
(
JSON
.
toJSONString
(
notice
)),
""
,
notice
.
getSequenceNbr
().
toString
());
...
...
@@ -585,12 +588,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
convertField
(
model
);
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备"
);
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请)
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备"
);
}
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取告知单号
...
...
@@ -626,9 +629,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
notice
.
setNextExecuteUserIds
(
reginParams
.
getUserModel
().
getUserId
());
notice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
}
notice
.
setEquListCode
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST_CODE"
)));
notice
.
setEquCategory
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_CATEGORY_CODE"
)));
notice
.
setEquListCode
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
list
->
!
list
.
isEmpty
()
&&
list
.
get
(
0
)
!=
null
)
.
map
(
list
->
list
.
get
(
0
).
get
(
"EQU_LIST_CODE"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
)
);
notice
.
setEquCategory
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
list
->
!
list
.
isEmpty
()
&&
list
.
get
(
0
)
!=
null
)
.
map
(
list
->
list
.
get
(
0
).
get
(
"EQU_CATEGORY_CODE"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
)
);
notice
.
setInstallUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
notice
.
setInstallUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
notice
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
...
...
@@ -636,17 +650,27 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
DataDictionary
dictionary
=
iDataDictionaryService
.
getByCode
(
notice
.
getMaintainType
(),
"WXLX"
);
notice
.
setMaintainTypeDesc
(
dictionary
.
getName
());
notice
.
setFullAddress
(
notice
.
getProvinceName
()
+
notice
.
getCityName
()
+
notice
.
getCountyName
()
+
notice
.
getStreetName
()
+
notice
.
getAddress
());
notice
.
setEquCategoryDesc
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_CATEGORY"
)));
notice
.
setEquList
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST"
)));
deviceList
.
forEach
(
obj
->
{
JgMaintainNoticeEq
jgRelationEquip
=
new
JgMaintainNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
jgRelationEquip
.
setEquCode
(
ObjectUtils
.
isEmpty
(
obj
.
get
(
"EQU_CODE"
))?
null
:
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
)));
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
jgRelationEquip
.
setEquCategoryCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
)));
equipList
.
add
(
jgRelationEquip
);
});
notice
.
setEquCategoryDesc
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
list
->
!
list
.
isEmpty
()
&&
list
.
get
(
0
)
!=
null
)
.
map
(
list
->
list
.
get
(
0
).
get
(
"EQU_CATEGORY"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
));
notice
.
setEquList
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
list
->
!
list
.
isEmpty
()
&&
list
.
get
(
0
)
!=
null
)
.
map
(
list
->
list
.
get
(
0
).
get
(
"EQU_LIST"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
));
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
forEach
(
obj
->
{
JgMaintainNoticeEq
jgRelationEquip
=
new
JgMaintainNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
jgRelationEquip
.
setEquCode
(
ObjectUtils
.
isEmpty
(
obj
.
get
(
"EQU_CODE"
))?
null
:
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
)));
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
jgRelationEquip
.
setEquCategoryCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY_CODE"
)));
equipList
.
add
(
jgRelationEquip
);
});
}
notice
.
setCreateDate
(
new
Date
());
jgMaintainNoticeMapper
.
insert
(
notice
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
...
...
@@ -655,8 +679,10 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// 暂存任务
buildTaskDraft
(
notice
);
}
List
<
JgMaintainNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()))).
collect
(
Collectors
.
toList
());
jgMaintainNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
List
<
JgMaintainNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()))).
collect
(
Collectors
.
toList
());
jgMaintainNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
this
.
updateRedisBatch
(
notice
);
// 写入历史表
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_MAINTENANCE_NOTIFICATION
.
getName
(),
JSON
.
parseObject
(
JSON
.
toJSONString
(
notice
)),
""
,
notice
.
getSequenceNbr
().
toString
());
...
...
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/JgReformNoticeServiceImpl.java
View file @
ea960101
...
...
@@ -245,7 +245,12 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
List
<
Map
<
String
,
Object
>>
deviceList
=
noticeDto
.
getDeviceList
();
// 管道校验管道编号不重复
this
.
verifyThatThePipeNumberIsUnique
(
notice
.
getEquListCode
(),
deviceList
);
List
<
String
>
records
=
deviceList
.
stream
().
filter
(
item
->
!
Objects
.
isNull
(
item
.
get
(
RECORD
))).
map
(
equ
->
String
.
valueOf
(
equ
.
get
(
RECORD
))).
collect
(
Collectors
.
toList
());
List
<
String
>
records
=
Optional
.
ofNullable
(
deviceList
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
item
->
item
!=
null
&&
item
.
get
(
RECORD
)
!=
null
)
.
map
(
item
->
String
.
valueOf
(
item
.
get
(
RECORD
)))
.
collect
(
Collectors
.
toList
());
this
.
checkRepeatUsed
(
submitType
,
records
,
notice
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
...
...
@@ -337,14 +342,16 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// eq关系表
List
<
JgReformNoticeEq
>
noticeEqs
=
new
ArrayList
<>();
// 更新设备关系表
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
forEach
(
obj
->
{
JgReformNoticeEq
jgRelationEquip
=
new
JgReformNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
equSeq
)));
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
noticeEqs
.
add
(
jgRelationEquip
);
});
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
forEach
(
obj
->
{
JgReformNoticeEq
jgRelationEquip
=
new
JgReformNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
equSeq
)));
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
noticeEqs
.
add
(
jgRelationEquip
);
});
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
}
return
noticeDto
;
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -488,13 +495,14 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
// 业务单据中的设备主键 管道的为record 其他设备为SEQUENCE_NBR
String
equSeq
=
!
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
)
?
SEQUENCE_NBR
:
RECORD
;
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备!"
);
}
// 管道校验管道编号不重复
this
.
verifyThatThePipeNumberIsUnique
(
equListCode
,
deviceList
);
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备!"
);
}
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取申请单号
...
...
@@ -567,12 +575,14 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 插入业务单
jgReformNoticeMapper
.
insert
(
notice
);
// 更新设备关系表
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
map
(
obj
->
new
JgReformNoticeEq
()
.
setEquId
(
obj
.
get
(
equSeq
).
toString
())
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
)))
.
forEach
(
noticeEqs:
:
add
);
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
))
{
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
map
(
obj
->
new
JgReformNoticeEq
()
.
setEquId
(
obj
.
get
(
equSeq
).
toString
())
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
)))
.
forEach
(
noticeEqs:
:
add
);
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
}
this
.
updateRedisBatch
(
Collections
.
singletonList
(
notice
));
return
Collections
.
singletonList
(
notice
);
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
...
...
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 @
ea960101
...
...
@@ -449,13 +449,15 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
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
.
getSequenceNbr
().
toString
());
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
noticeDto
.
getSequenceNbr
().
toString
());
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
}
return
noticeDto
;
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -511,11 +513,11 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
convertField
(
model
);
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
return
new
ArrayList
<>();
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请)
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备"
);
}
this
.
repeatUsedEquipCheck
(
deviceList
,
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取告知单号
...
...
@@ -610,9 +612,27 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
else
{
dto
.
setNextExecuteUserIds
(
reginParams
.
getUserModel
().
getUserId
());
}
dto
.
setEquCategory
(
deviceList
.
get
(
0
).
getOrDefault
(
"EQU_CATEGORY"
,
""
).
toString
());
//设备类别
dto
.
setEquList
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST"
)));
//设备种类
dto
.
setEquListCode
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST_CODE"
)));
//设备种类编码
dto
.
setEquCategory
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
v
->
!
v
.
isEmpty
()
&&
v
.
get
(
0
)
!=
null
)
.
map
(
v
->
v
.
get
(
0
).
get
(
"EQU_CATEGORY"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
)
);
dto
.
setEquList
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
v
->
!
v
.
isEmpty
()
&&
v
.
get
(
0
)
!=
null
)
.
map
(
v
->
v
.
get
(
0
).
get
(
"EQU_LIST"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
)
);
dto
.
setEquListCode
(
Optional
.
ofNullable
(
deviceList
)
.
filter
(
v
->
!
v
.
isEmpty
()
&&
v
.
get
(
0
)
!=
null
)
.
map
(
v
->
v
.
get
(
0
).
get
(
"EQU_LIST_CODE"
))
.
map
(
String:
:
valueOf
)
.
orElse
(
""
)
);
dto
.
setInstallUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setInstallUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
if
(!
CollectionUtils
.
isEmpty
(
workflowResultList
))
{
...
...
@@ -627,16 +647,18 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
// dto.setEquAddress(obj.getOrDefault("ADDRESS", "").toString());
list
.
add
(
dto
);
jgTransferNoticeMapper
.
insert
(
list
.
get
(
0
));
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
dto
.
getSequenceNbr
().
toString
());
jgRelationEquip
.
setEquCategory
(
obj
.
getOrDefault
(
"EQU_CATEGORY"
,
""
).
toString
());
//设备类别
jgRelationEquip
.
setEquList
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST"
)));
//设备种类
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
//设备种类编码
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
if
(!
CollectionUtils
.
isEmpty
(
deviceList
)){
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
dto
.
getSequenceNbr
().
toString
());
jgRelationEquip
.
setEquCategory
(
obj
.
getOrDefault
(
"EQU_CATEGORY"
,
""
).
toString
());
//设备类别
jgRelationEquip
.
setEquList
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST"
)));
//设备种类
jgRelationEquip
.
setEquListCode
(
String
.
valueOf
(
obj
.
get
(
"EQU_LIST_CODE"
)));
//设备种类编码
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
equipList
);
}
}
...
...
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