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
e8b7dc41
Commit
e8b7dc41
authored
Jul 18, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents
8cbc699a
e7299805
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
1095 additions
and
431 deletions
+1095
-431
JgEquipTransferMapper.java
...amos/boot/module/jg/api/mapper/JgEquipTransferMapper.java
+4
-0
JgMaintenanceContractMapper.java
...oot/module/jg/api/mapper/JgMaintenanceContractMapper.java
+3
-0
IJgChangeRegistrationUnitService.java
...dule/jg/api/service/IJgChangeRegistrationUnitService.java
+1
-1
JgEquipTransferMapper.xml
...g-api/src/main/resources/mapper/JgEquipTransferMapper.xml
+10
-0
JgMaintenanceContractMapper.xml
...src/main/resources/mapper/JgMaintenanceContractMapper.xml
+10
-0
JgChangeRegistrationUnitController.java
...jg/biz/controller/JgChangeRegistrationUnitController.java
+172
-172
JgEquipTransferController.java
...t/module/jg/biz/controller/JgEquipTransferController.java
+18
-19
JgMaintenanceContractController.java
...le/jg/biz/controller/JgMaintenanceContractController.java
+3
-4
ChangeUnitEquipUsedCheckImpl.java
...ule/jg/biz/service/impl/ChangeUnitEquipUsedCheckImpl.java
+1
-1
EquipTransferEquipUsedCheckImpl.java
.../jg/biz/service/impl/EquipTransferEquipUsedCheckImpl.java
+54
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+14
-1
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+75
-179
JgEquipTransferServiceImpl.java
...odule/jg/biz/service/impl/JgEquipTransferServiceImpl.java
+47
-15
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+24
-0
JgMaintenanceContractServiceImpl.java
...jg/biz/service/impl/JgMaintenanceContractServiceImpl.java
+39
-12
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+66
-2
MaintenanceContractEquipUsedCheckImpl.java
...z/service/impl/MaintenanceContractEquipUsedCheckImpl.java
+54
-0
InspectionTimelinesDto.java
...amos/boot/module/jyjc/api/dto/InspectionTimelinesDto.java
+20
-0
PublicityInspectOrgInfoDto.java
.../boot/module/jyjc/api/dto/PublicityInspectOrgInfoDto.java
+38
-0
JyjcInspectionApplication.java
...oot/module/jyjc/api/entity/JyjcInspectionApplication.java
+6
-0
JyjcInspectionResult.java
...mos/boot/module/jyjc/api/entity/JyjcInspectionResult.java
+7
-0
JYJCTypeEnum.java
...yeejoin/amos/boot/module/jyjc/api/enums/JYJCTypeEnum.java
+5
-5
JyjcBaseMapper.java
...join/amos/boot/module/jyjc/api/mapper/JyjcBaseMapper.java
+2
-0
JyjcInspectionApplicationMapper.java
...dule/jyjc/api/mapper/JyjcInspectionApplicationMapper.java
+22
-2
JyjcInspectionResultMapper.java
...ot/module/jyjc/api/mapper/JyjcInspectionResultMapper.java
+5
-0
JyjcOpeningApplicationMapper.java
.../module/jyjc/api/mapper/JyjcOpeningApplicationMapper.java
+8
-0
JyjcInspectionApplicationModel.java
...module/jyjc/api/model/JyjcInspectionApplicationModel.java
+3
-0
JyjcInspectionResultModel.java
...boot/module/jyjc/api/model/JyjcInspectionResultModel.java
+5
-0
JyjcBaseMapper.xml
...ule-jyjc-api/src/main/resources/mapper/JyjcBaseMapper.xml
+3
-0
JyjcInspectionApplicationMapper.xml
...main/resources/mapper/JyjcInspectionApplicationMapper.xml
+28
-0
JyjcInspectionResultMapper.xml
.../src/main/resources/mapper/JyjcInspectionResultMapper.xml
+24
-0
JyjcOpeningApplicationMapper.xml
...rc/main/resources/mapper/JyjcOpeningApplicationMapper.xml
+32
-0
DPStatisticsController.java
...ot/module/jyjc/biz/controller/DPStatisticsController.java
+62
-7
DPStatisticsServiceImpl.java
...module/jyjc/biz/service/impl/DPStatisticsServiceImpl.java
+152
-6
InspectionPlanServiceImpl.java
...dule/jyjc/biz/service/impl/InspectionPlanServiceImpl.java
+17
-5
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+11
-0
ITzBaseEnterpriseInfoService.java
.../module/tcm/api/service/ITzBaseEnterpriseInfoService.java
+2
-0
TzBaseEnterpriseInfoController.java
...le/tcm/biz/controller/TzBaseEnterpriseInfoController.java
+7
-0
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+41
-0
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/mapper/JgEquipTransferMapper.java
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -23,4 +25,6 @@ public interface JgEquipTransferMapper extends CustomBaseMapper<JgEquipTransfer>
@MapKey
(
"sequenceNbr"
)
List
<
Map
<
String
,
Object
>>
queryEquipInformation
(
Long
sequenceNbr
);
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgMaintenanceContractMapper.java
View file @
e8b7dc41
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgMaintenanceContractDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
...
...
@@ -30,4 +31,6 @@ public interface JgMaintenanceContractMapper extends BaseMapper<JgMaintenanceCon
void
updatePromoter
(
@Param
(
"id"
)
Long
id
);
List
<
Map
<
String
,
Object
>>
selectEquipList
(
@Param
(
"id"
)
Long
id
);
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgChangeRegistrationUnitService.java
View file @
e8b7dc41
...
...
@@ -33,7 +33,7 @@ public interface IJgChangeRegistrationUnitService {
* @param noticeDto 安装告知
* @param op 操作类型
*/
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
);
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
,
ReginParams
reginParams
);
/**
* 分页查询
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgEquipTransferMapper.xml
View file @
e8b7dc41
...
...
@@ -210,4 +210,14 @@
jet.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select
id=
"queryForFlowingEquipList"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"
>
select a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where a.sequence_nbr = b.equip_transfer_id
and a.apply_status = '6612'
GROUP BY a.use_unit_credit_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgMaintenanceContractMapper.xml
View file @
e8b7dc41
...
...
@@ -155,4 +155,14 @@
left JOIN idx_biz_jg_register_info jri on mc.equ_id = jri.RECORD
WHERE mc.equip_transfer_id = #{id}
</select>
<select
id=
"queryForFlowingEquipList"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"
>
select a.use_unit_code as companyCode,
group_concat(b.equ_id) as records
from tzs_jg_maintenance_contract a,
tzs_jg_maintenance_contract_eq b
where a.sequence_nbr = b.equip_transfer_id
and a.status in ('监管单位待受理','维保单位待受理')
GROUP BY a.use_unit_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationUnitController.java
View file @
e8b7dc41
...
...
@@ -3,34 +3,30 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 单位变更登记
*
...
...
@@ -45,161 +41,165 @@ public class JgChangeRegistrationUnitController extends BaseController {
@Autowired
JgChangeRegistrationUnitServiceImpl
jgChangeRegistrationUnitServiceImpl
;
@Autowired
CommonServiceImpl
commonService
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位变更"
,
notes
=
"新增单位变更"
)
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
JSONObject
model
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
saveNotice
(
submitType
,
model
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
""
);
}
/**
* 根据sequenceNbr更新
*
* @param model 单位变更
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新单位变更"
,
notes
=
"根据sequenceNbr更新单位变更"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgChangeRegistrationUnitDto
jgChangeRegistrationUnitDto
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
jgChangeRegistrationUnitDto
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"changeRegisInfo"
)).
get
(
"changeCertificateList"
);
jgChangeRegistrationUnitDto
.
setChangeCertificateList
((
List
<
Map
<
String
,
Object
>>)
o
);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
updateInstallationNotice
(
submitType
,
jgChangeRegistrationUnitDto
,
op
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除单位变更"
,
notes
=
"根据sequenceNbr删除单位变更"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
jgChangeRegistrationUnitServiceImpl
.
deleteForBatch
(
new
Long
[]{
sequenceNbr
});
return
ResponseHelper
.
buildResponse
(
Boolean
.
TRUE
);
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/batchDelete"
)
@ApiOperation
(
value
=
"根据sequenceNbr删除维保合同备案"
,
notes
=
"根据sequenceNbr删除维保合同备案"
)
public
ResponseModel
<
Boolean
>
deleteForBatch
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
try
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/details"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个单位变更"
,
notes
=
"根据sequenceNbr查询单个单位变更"
)
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryBySequenceNbr
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更分页查询"
,
notes
=
"单位变更分页查询"
)
public
ResponseModel
<
Page
<
JgChangeRegistrationUnitDto
>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
(
required
=
false
)
JgChangeRegistrationUnitDto
model
)
{
Page
<
JgChangeRegistrationUnit
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
info
=
getSelectedOrgInfo
();
if
(
info
.
getCompany
().
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
)){
type
=
"enterprise"
;
}
else
{
type
=
"supervision"
;
}
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryForJgChangeRegistrationUnitPage
(
page
,
sort
,
model
,
type
,
reginParams
));
}
/**
* 撤销
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/cancel"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更撤销"
,
notes
=
"单位变更撤销"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
cancel
(
@RequestBody
Map
<
String
,
Object
>
model
)
{
JgChangeRegistrationUnitDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
jgChangeRegistrationUnitServiceImpl
.
cancel
(
installationInfo
);
return
ResponseHelper
.
buildResponse
(
installationInfo
);
}
/**
* 受理
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/accept"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更受理"
,
notes
=
"单位变更受理"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
accept
(
@RequestBody
Map
<
String
,
Object
>
model
,
String
op
)
{
// TODO 受理单位变更流程
LinkedHashMap
model1
=
(
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
);
String
opinion
=
(
String
)
model
.
get
(
"opinion"
);
LinkedHashMap
installationInfo
=
(
LinkedHashMap
)
model1
.
get
(
"changeRegisInfo"
);
JgChangeRegistrationUnitDto
jgInstallationNoticeDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installationInfo
),
JgChangeRegistrationUnitDto
.
class
);
jgInstallationNoticeDto
.
setProcessAdvice
(
opinion
);
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
);
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 导出使用登记证
* @param response 返回
* @param sequenceNbr 主键
* @param printType 打印类型,0-正常打印,1-套打(默认0)
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
value
=
"printType"
,
defaultValue
=
"0"
)
String
printType
)
{
jgChangeRegistrationUnitServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
);
}
CommonServiceImpl
commonService
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位变更"
,
notes
=
"新增单位变更"
)
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
JSONObject
model
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
saveNotice
(
submitType
,
model
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
""
);
}
/**
* 根据sequenceNbr更新
*
* @param model 单位变更
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新单位变更"
,
notes
=
"根据sequenceNbr更新单位变更"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgChangeRegistrationUnitDto
jgChangeRegistrationUnitDto
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
jgChangeRegistrationUnitDto
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"changeRegisInfo"
)).
get
(
"changeCertificateList"
);
jgChangeRegistrationUnitDto
.
setChangeCertificateList
((
List
<
Map
<
String
,
Object
>>)
o
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
updateInstallationNotice
(
submitType
,
jgChangeRegistrationUnitDto
,
op
,
reginParams
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除单位变更"
,
notes
=
"根据sequenceNbr删除单位变更"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
jgChangeRegistrationUnitServiceImpl
.
deleteForBatch
(
new
Long
[]{
sequenceNbr
});
return
ResponseHelper
.
buildResponse
(
Boolean
.
TRUE
);
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/batchDelete"
)
@ApiOperation
(
value
=
"根据sequenceNbr删除维保合同备案"
,
notes
=
"根据sequenceNbr删除维保合同备案"
)
public
ResponseModel
<
Boolean
>
deleteForBatch
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
try
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/details"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个单位变更"
,
notes
=
"根据sequenceNbr查询单个单位变更"
)
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryBySequenceNbr
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更分页查询"
,
notes
=
"单位变更分页查询"
)
public
ResponseModel
<
Page
<
JgChangeRegistrationUnitDto
>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
(
required
=
false
)
JgChangeRegistrationUnitDto
model
)
{
Page
<
JgChangeRegistrationUnit
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
if
(
reginParams
.
getCompany
().
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
))
{
type
=
"enterprise"
;
}
else
{
type
=
"supervision"
;
}
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryForJgChangeRegistrationUnitPage
(
page
,
sort
,
model
,
type
,
reginParams
));
}
/**
* 撤销
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/cancel"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更撤销"
,
notes
=
"单位变更撤销"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
cancel
(
@RequestBody
Map
<
String
,
Object
>
model
)
{
JgChangeRegistrationUnitDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
cancel
(
installationInfo
);
return
ResponseHelper
.
buildResponse
(
installationInfo
);
}
/**
* 受理
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/accept"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更受理"
,
notes
=
"单位变更受理"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
accept
(
@RequestBody
Map
<
String
,
Object
>
model
,
String
op
)
{
// TODO 受理单位变更流程
LinkedHashMap
model1
=
(
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
);
String
opinion
=
(
String
)
model
.
get
(
"opinion"
);
LinkedHashMap
installationInfo
=
(
LinkedHashMap
)
model1
.
get
(
"changeRegisInfo"
);
JgChangeRegistrationUnitDto
jgInstallationNoticeDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installationInfo
),
JgChangeRegistrationUnitDto
.
class
);
jgInstallationNoticeDto
.
setProcessAdvice
(
opinion
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 导出使用登记证
*
* @param response 返回
* @param sequenceNbr 主键
* @param printType 打印类型,0-正常打印,1-套打(默认0)
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
value
=
"printType"
,
defaultValue
=
"0"
)
String
printType
)
{
jgChangeRegistrationUnitServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgEquipTransferController.java
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.api.common.BaseException
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEquipTransferServiceImpl
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.*
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEquipTransferServiceImpl
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 设备移交
...
...
@@ -54,9 +53,9 @@ public class JgEquipTransferController extends BaseController {
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备移交"
,
notes
=
"根据sequenceNbr更新设备移交"
)
public
ResponseModel
<
Object
>
updateBySequenceNbr
(
@RequestParam
(
"submitType"
)
String
submitType
,
@RequestBody
JgEquipTransferDto
equipTransferDto
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
return
ResponseHelper
.
buildResponse
(
jgEquipTransferServiceImpl
.
updateEquipTransfer
(
submitType
,
equipTransferDto
,
op
));
@RequestBody
JgEquipTransferDto
equipTransferDto
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
return
ResponseHelper
.
buildResponse
(
jgEquipTransferServiceImpl
.
updateEquipTransfer
(
submitType
,
equipTransferDto
,
op
,
getSelectedOrgInfo
()
));
}
/**
...
...
@@ -112,10 +111,10 @@ public class JgEquipTransferController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备移交分页查询"
,
notes
=
"设备移交分页查询"
)
public
ResponseModel
<
Page
<
JgEquipTransferDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
(
required
=
false
)
JgEquipTransferDto
dto
)
{
Page
<
JgEquipTransferDto
>
page
=
new
Page
<>(
current
,
size
);
return
ResponseHelper
.
buildResponse
(
jgEquipTransferServiceImpl
.
queryForJgEquipTransferPage
(
page
,
sort
,
dto
,
getSelectedOrgInfo
()));
return
ResponseHelper
.
buildResponse
(
jgEquipTransferServiceImpl
.
queryForJgEquipTransferPage
(
page
,
sort
,
dto
,
getSelectedOrgInfo
()));
}
@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/controller/JgMaintenanceContractController.java
View file @
e8b7dc41
...
...
@@ -13,8 +13,6 @@ import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgMaintenanceContractServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -23,6 +21,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
/**
...
...
@@ -176,8 +175,8 @@ public class JgMaintenanceContractController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/cancelApplication"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"维保备案作废"
,
notes
=
"维保备案作废"
)
public
ResponseModel
<
JgMaintenanceContract
>
cancelApplication
(
@RequestBody
JgMaintenanceContractDto
dto
){
JgMaintenanceContract
result
=
jgMaintenanceContractServiceImpl
.
cancelApplication
(
dto
.
getSequenceNbr
(),
dto
.
getCancelReason
());
public
ResponseModel
<
JgMaintenanceContract
>
cancelApplication
(
@RequestBody
JgMaintenanceContractDto
dto
)
{
JgMaintenanceContract
result
=
jgMaintenanceContractServiceImpl
.
cancelApplication
(
dto
.
getSequenceNbr
(),
dto
.
getCancelReason
());
return
ResponseHelper
.
buildResponse
(
result
);
}
}
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/ChangeUnitEquipUsedCheckImpl.java
View file @
e8b7dc41
...
...
@@ -44,7 +44,7 @@ public class ChangeUnitEquipUsedCheckImpl extends BaseEquipUsedCheckService {
@Override
public
void
init
()
{
// 初始化
已经完成或者在流程中安装告知的
设备数据
// 初始化
在流程中
设备数据
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
changeRegistrationUnitMapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
...
...
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/EquipTransferEquipUsedCheckImpl.java
0 → 100644
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@Slf4j
public
class
EquipTransferEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
private
String
bizType
=
"equipmentHandover"
;
private
JgEquipTransferMapper
equipTransferMapper
;
public
EquipTransferEquipUsedCheckImpl
(
RedissonClient
redissonClient
,
JgEquipTransferMapper
equipTransferMapper
)
{
this
.
redissonClient
=
redissonClient
;
this
.
equipTransferMapper
=
equipTransferMapper
;
}
@Override
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
getApplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
// 初始化在流程中的设备数据
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
equipTransferMapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
e8b7dc41
...
...
@@ -738,12 +738,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfoMap
.
put
(
"FULLADDRESS"
,
fullAddress
);
}
useInfoMap
.
put
(
"USEINFO_SEQ"
,
useInfo
.
getSequenceNbr
());
useInfoMap
.
put
(
"USE_PLACE"
,
useInfo
.
getUsePlace
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getLongitudeLatitude
()))
{
useInfoMap
.
put
(
"LONGITUDE_LATITUDE"
,
JSON
.
parseObject
(
useInfo
.
getLongitudeLatitude
()));
useInfoMap
.
put
(
"USE_LONGITUDE_LATITUDE"
,
JSON
.
parseObject
(
useInfo
.
getLongitudeLatitude
()));
}
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getAddress
()))
{
useInfoMap
.
put
(
"USE_ADDRESS"
,
useInfo
.
getAddress
());
useInfoMap
.
put
(
"FULL_ADDRESS"
,
useInfo
.
getAddress
());
}
}
if
(!
useInfoMap
.
isEmpty
())
{
...
...
@@ -2041,7 +2043,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String
dataSource
=
OPERATESAVE
.
equals
(
operateType
)
?
(
"new"
.
equals
(
equipSource
)
?
"jg"
:
"jg_his"
)
:
equipmentInfoForm
.
get
(
"DATA_SOURCE"
).
toString
();
if
(
isCopy
)
{
String
sourceRecord
=
equipmentClassForm
.
get
(
RECORD
).
toString
();
dataSource
=
"new"
.
equals
(
equipSource
)
?
(
"jg_"
+
sourceRecord
)
:
(
"jg_his_"
+
sourceRecord
);
// dataSource = "new".equals(equipSource) ? ("jg_" + sourceRecord) : ("jg_his_" + sourceRecord);
// bug-21203
if
(
equipmentInfoForm
.
containsKey
(
"DATA_SOURCE"
)){
String
dataSourceCopy
=
equipmentInfoForm
.
get
(
"DATA_SOURCE"
).
toString
();
if
(
dataSourceCopy
.
startsWith
(
"jg_his"
)){
dataSource
=
"jg_his_"
+
sourceRecord
;
}
else
{
dataSource
=
"jg_"
+
sourceRecord
;
}
}
else
{
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
}
}
record
=
OPERATESAVE
.
equals
(
operateType
)
?
UUID
.
randomUUID
().
toString
()
:
equipmentInfoForm
.
get
(
RECORD
).
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/JgChangeRegistrationUnitServiceImpl.java
View file @
e8b7dc41
...
...
@@ -29,7 +29,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.*
;
...
...
@@ -68,6 +67,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
@Autowired
...
...
@@ -246,7 +246,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
* @param noticeDto 单位变更
*/
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
)
{
public
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
,
ReginParams
reginParams
)
{
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
...
...
@@ -273,7 +273,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ArrayList
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListNext
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
// 发起流程
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
List
<
ProcessTaskDTO
>
processTasks
=
new
ArrayList
<>();
...
...
@@ -295,12 +294,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
JgChangeRegistrationUnit
notice
=
new
JgChangeRegistrationUnit
();
// JgChangeRegistrationUnit noticeOld = JgChangeRegistrationUnitMapper.selectById(noticeDto.getSequenceNbr());
BeanUtils
.
copyProperties
(
noticeDto
,
notice
);
// boolean submit = submit(notice, op);
notice
.
setChangeCertificate
(
noticeDto
.
getChangeCertificate
());
notice
.
setRemark
(
noticeDto
.
getRemark
());
// notice.setStatus(taskName[0]);
if
(!
ObjectUtils
.
isEmpty
(
notice
.
getInstanceStatus
()))
{
notice
.
setInstanceStatus
(
notice
.
getInstanceStatus
()
+
","
+
roleListAll
);
}
else
{
...
...
@@ -368,7 +364,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
JgChangeRegistrationUnitMapper
.
updateById
(
bean
);
}
// updateHistorySingle(noticeDto.getSequenceNbr());
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
device
->
{
JgChangeRegistrationUnitEq
unitEq
=
new
JgChangeRegistrationUnitEq
();
...
...
@@ -396,14 +391,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
noticeDto
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
return
noticeDto
;
}
private
void
updateHistorySingle
(
Long
seq
)
{
QueryWrapper
<
JgChangeRegistrationUnitEq
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
lambda
().
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
seq
);
List
<
JgChangeRegistrationUnitEq
>
eqs
=
jgChangeRegistrationUnitEqMapper
.
selectList
(
wrapper
);
this
.
updateHistoryAsync
(
eqs
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
noticeDto
;
}
...
...
@@ -421,7 +415,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
JgChangeRegistrationUnitDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
;
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
...
...
@@ -529,7 +522,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
@Override
// @Transactional(rollbackFor = Exception.class)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
...
...
@@ -563,11 +555,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
for
(
JSONObject
jsonObject
:
deviceList
)
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
());
}
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
...
...
@@ -576,7 +563,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
new
ArrayList
<>();
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
// ArrayList<String> roleListSecond = new ArrayList<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
taskIds
=
new
ArrayList
<>();
...
...
@@ -585,18 +571,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//发起流程
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
// for (int i = 0; i < deviceList.size(); i++
// ) {
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setNextExecuteUserCompanyCode
(
model
.
getReceiveCompanyCode
());
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
// }
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
workflowResultDtos
=
commonServiceImpl
.
buildWorkFlowInfo
(
processTaskDTOS
);
...
...
@@ -608,14 +590,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
// List<JgChangeRegistrationUnit> list = new ArrayList<>();
// List<JgChangeRegistrationUnitEq> equipList = new ArrayList<>();
String
finalNextExecutorRoleIds
=
nextExecutorRoleIds
;
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
model
.
getReceiveCompanyCode
());
// deviceList.forEach(obj -> {
// JgChangeRegistrationUnitEq jgRelationEquip = new JgChangeRegistrationUnitEq();
// int i = deviceList.indexOf(obj);
// String applyNo = applyNoList.get(i);
model
.
setApplyNo
(
applyNoList
.
get
(
0
));
model
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
model
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
...
...
@@ -628,15 +604,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
model
.
setNewUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
model
.
setNewUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
// dto.setEquType((String.valueOf(obj.get("EQU_CATEGORY"))));
// dto.setProductNameB((String.valueOf(obj.get("PRODUCT_NAME"))));
// dto.setEquCodeB((String.valueOf(obj.get("EQU_CODE"))));
// dto.setUseInnerCode(ValidationUtil.isEmpty(obj.get("USE_INNER_CODE")) ? "" : String.valueOf(obj.get("USE_INNER_CODE")));
// dto.setEquAddress((String.valueOf(obj.get("ADDRESS"))));
// dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
// dto.setEquList(String.valueOf(obj.get("EQU_LIST")));
// jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
// jgRelationEquip.setUnitChangeRegistrationId(applyNo);
if
(!
CollectionUtils
.
isEmpty
(
nextExecutorUserIds
))
{
model
.
setNextExecuteUserIds
(
nextExecutorUserIds
.
get
(
0
));
}
...
...
@@ -649,11 +616,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(!
CollectionUtils
.
isEmpty
(
taskIds
))
{
model
.
setNextTaskId
(
taskIds
.
get
(
0
));
}
// list.add(dto);
// equipList.add(jgRelationEquip);
// });
// WorkflowResultDto workDto = new WorkflowResultDto();
model
.
setSequenceNbr
(
sequence
.
nextId
());
model
.
setCreateDate
(
new
Date
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
...
...
@@ -665,9 +627,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List
<
TaskModelDto
>
modelDtos
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// for (JgChangeRegistrationUnit obj : list) {
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskMessageDto
ta
=
new
TaskMessageDto
();
ta
.
setInstanceId
(
registrationUnit
.
getInstanceId
());
ta
.
setStatus
(
registrationUnit
.
getStatus
());
...
...
@@ -676,7 +636,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
ta
.
setSequenceNbr
(
registrationUnit
.
getSequenceNbr
());
ta
.
setNextTaskId
(
registrationUnit
.
getNextTaskId
());
taskModelDto
.
setModel
(
ta
);
// dto.setModel(obj);
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setTaskName
(
workflowResultDtos
.
get
(
0
).
getNextTaskName
());
taskModelDto
.
setFlowCode
(
registrationUnit
.
getNextTaskId
());
...
...
@@ -695,9 +654,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setNextExecuteUser
(
workflowResultDtos
.
get
(
0
).
getNextExecutorRoleIds
());
modelDtos
.
add
(
taskModelDto
);
// }
}
else
{
// for (JgChangeRegistrationUnit obj : list) {
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
//行数据
taskModelDto
.
setModel
(
registrationUnit
);
...
...
@@ -712,11 +669,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
modelDtos
.
add
(
taskModelDto
);
// }
}
// for(JgChangeRegistrationUnit obj : list) {
commonServiceImpl
.
saveExecuteFlowData2Redis
(
registrationUnit
.
getInstanceId
(),
buildInstanceRuntimeData
(
registrationUnit
));
// }
commonServiceImpl
.
buildTaskModel
(
modelDtos
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
new
ArrayList
<>();
...
...
@@ -738,12 +691,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
jgRegistrationHistory
.
setCurrentDocumentId
(
registrationUnit
.
getApplyNo
());
//使用登记证历史数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
registrationList
));
// List<JgChangeRegistrationUnitEq> jgRelationEquipList = equipList.stream().map(jgRelationEquip -> {
// List<JgChangeRegistrationUnit> collect = list.stream().filter(jgChangeRegistrationUnit -> jgRelationEquip.getUnitChangeRegistrationId().equals(jgChangeRegistrationUnit.getApplyNo())).collect(Collectors.toList());
// Long sequenceNbr = collect.get(0).getSequenceNbr();
// insertOrUpdateHis(JSON.parseObject(JSONObject.toJSONString(collect.get(0))), jgRelationEquip.getEquId());
// return jgRelationEquip.setUnitChangeRegistrationId(String.valueOf(sequenceNbr));
// }).collect(Collectors.toList());
//先删除之前设备关系数据,在插入最新设备关系数据
registrationUnitEqService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>()
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registrationUnit
.
getSequenceNbr
()));
...
...
@@ -752,6 +699,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationUnit
.
getApplyNo
()));
registrationHistoryService
.
save
(
jgRegistrationHistory
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
Collections
.
singletonList
(
model
);
}
...
...
@@ -776,25 +729,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
void
getNext
(
ArrayList
<
String
>
roleListFirst
,
String
instanceId
,
String
[]
taskName
)
{
AjaxResult
aj
=
Workflow
.
taskClient
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskNoAuth
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
aj
.
get
(
"data"
)));
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
))
{
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeginService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskName
[
0
]
=
String
.
valueOf
(
taskInfo
.
get
(
"taskDefinitionKey"
));
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
private
void
convertField
(
JgChangeRegistrationUnitDto
model
)
{
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
...
...
@@ -834,38 +768,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
// private String convertImageUrl(List<Map<String, String>> urlList) {
// String urls = "";
// if (!CollectionUtils.isEmpty(urlList)) {
// urls = urlList.stream().map(map -> map.get("url")).collect(Collectors.joining(","));
// }
// return urls;
// }
//
// public void insertOrUpdateHis(JSONObject map, String equipId) {
// JgRegistrationHistory jgRegistrationHistory = new JgRegistrationHistory();
// //使用登记编号
// jgRegistrationHistory.setUseRegistrationCode(idxBizJgRegisterInfoMapper.getUseOrgCodeByEquip(equipId));
// //登记类别
// jgRegistrationHistory.setRegistrationClass("单位变更登记");
// //设备id
// jgRegistrationHistory.setEquId(equipId);
// //修改数据
// jgRegistrationHistory.setChangeData(JSONObject.toJSONString(map));
// //设备监管码
// LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
// queryWrapper1.eq(OtherInfo::getRecord, equipId);
// OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
// jgRegistrationHistory.setSupervisoryCode(tzsJgOtherInfo.getSupervisoryCode());
// if (map.containsKey("type") && "edit".equals(String.valueOf(map.get("type")))) {
// jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(equipId, String.valueOf(map.get("sequenceNbr"))));
// jgRegistrationHistoryMapper.updateById(jgRegistrationHistory);
// } else {
// //当前单据id
// jgRegistrationHistory.setCurrentDocumentId(map.get("applyNo").toString());
// jgRegistrationHistoryMapper.insert(jgRegistrationHistory);
// }
// }
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
...
...
@@ -925,24 +827,25 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 待调整
taskCode
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
();
JgChangeRegistrationUnit
jgChangeRegistration
Unit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
jgChangeRegistration
Unit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
jgChangeRegistration
Unit
.
setPromoter
(
""
);
jgChangeRegistration
Unit
.
setNextTaskId
(
nextTaskId
);
jgChangeRegistration
Unit
.
setNextExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
jgChangeRegistration
Unit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
JgChangeRegistrationUnitMapper
.
updateById
(
jgChangeRegistration
Unit
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
jgChangeRegistration
Unit
));
jsonObject
.
put
(
"nextTaskId"
,
jgChangeRegistration
Unit
.
getNextTaskId
());
jsonObject
.
put
(
"nextExecuteUser"
,
jgChangeRegistration
Unit
.
getNextExecutorIds
());
JgChangeRegistrationUnit
change
Unit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
change
Unit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
change
Unit
.
setPromoter
(
""
);
change
Unit
.
setNextTaskId
(
nextTaskId
);
change
Unit
.
setNextExecuteUserIds
(
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
());
change
Unit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
JgChangeRegistrationUnitMapper
.
updateById
(
change
Unit
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
change
Unit
));
jsonObject
.
put
(
"nextTaskId"
,
change
Unit
.
getNextTaskId
());
jsonObject
.
put
(
"nextExecuteUser"
,
change
Unit
.
getNextExecutorIds
());
jsonObject
.
put
(
"taskType"
,
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getCode
());
jsonObject
.
put
(
"flowStatus"
,
this
.
getTaskCodeByName
(
jgChangeRegistration
Unit
.
getStatus
()));
jsonObject
.
put
(
"flowStatusLabel"
,
jgChangeRegistration
Unit
.
getStatus
());
jsonObject
.
put
(
"flowStatus"
,
this
.
getTaskCodeByName
(
change
Unit
.
getStatus
()));
jsonObject
.
put
(
"flowStatusLabel"
,
change
Unit
.
getStatus
());
commonServiceImpl
.
rollbackTask
(
noticeDto
.
getInstanceId
(),
jsonObject
);
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
noticeDto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationUnit
));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
noticeDto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
changeUnit
));
this
.
delRepeatUseEquipData
(
changeUnit
.
getApplyNo
(),
changeUnit
.
getStatus
(),
changeUnit
.
getNewUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -960,9 +863,16 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
build
();
}
// @Transactional(rollbackFor = Exception.class)
/**
* @param dto
* @param op void
* @param reginParams
* @description 执行流程
* @author wangguo
* @date 2024/7/18 11:00
**/
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
)
{
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
,
ReginParams
reginParams
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
dto
.
getInstanceId
());
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
try
{
...
...
@@ -979,12 +889,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
taskId
=
dto
.
getNextTaskId
();
JgChangeRegistrationUnit
registration
=
this
.
JgChangeRegistrationUnitMapper
.
selectById
(
dto
.
getSequenceNbr
());
registration
.
setProcessAdvice
(
dto
.
getProcessAdvice
());
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
// boolean submit = submit(jgChangeRegistrationUnit, op);
// if (submit) {
// getNext(roleList, dto.getInstanceId(), taskName);
//组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
...
...
@@ -1033,23 +939,14 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
// String code = commonServiceImpl.generateRegistrationCode(equipId, tzsJgOtherInfo.getSupervisoryCode(), dto.getReceiveCompanyCode());
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
// if (ValidationUtil.isEmpty(code)) {
// log.error("生成新的使用登记证编号失败");
// return;
// }
useInfoMapper
.
updateById
(
useInfo
);
// jgChangeRegistrationUnit.setUseRegistCode(code);
}
//更新使用注册登记证编号
// idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(equipId, code);
//es中的编号信息
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
// map1.put("USE_ORG_CODE", code);
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
registration
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
resultMap
.
put
(
equipId
,
map1
);
...
...
@@ -1106,6 +1003,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
dto
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
registration
));
this
.
delRepeatUseEquipData
(
registration
.
getApplyNo
(),
registration
.
getStatus
(),
registration
.
getNewUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
...
...
@@ -1116,6 +1014,43 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
/**
* 删除 redis校验重复引用设备的数据
*/
private
void
delRepeatUseEquipData
(
String
applyNo
,
String
status
,
String
companyCode
)
{
JgRegistrationHistory
history
=
registrationHistoryService
.
lambdaQuery
().
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
applyNo
).
one
();
// 获取使用登记证列表
JSONArray
registrationList
=
JSON
.
parseArray
(
history
.
getChangeData
());
if
(
CollectionUtils
.
isEmpty
(
registrationList
))
{
return
;
}
List
<
Long
>
registrationIdList
=
new
ArrayList
<>();
//根据使用登记证查询设备
for
(
Object
o
:
registrationList
)
{
JSONObject
parseObject
=
JSON
.
parseObject
(
o
.
toString
());
if
(
parseObject
.
containsKey
(
"sequenceNbr"
)
&&
ObjectUtils
.
isNotEmpty
(
parseObject
.
get
(
"sequenceNbr"
))
&&
canConvertToLong
(
parseObject
.
get
(
"sequenceNbr"
).
toString
()))
{
registrationIdList
.
add
(
Long
.
parseLong
(
parseObject
.
get
(
"sequenceNbr"
).
toString
()));
}
}
if
(
CollectionUtils
.
isEmpty
(
registrationIdList
))
{
return
;
}
List
<
JSONObject
>
equList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
equList
))
{
return
;
}
List
<
String
>
records
=
new
ArrayList
<>();
for
(
JSONObject
jsonObject
:
equList
)
{
records
.
add
(
jsonObject
.
getString
(
"SEQUENCE_NBR"
));
}
if
(
NOT_FLOWING_STATE
.
contains
(
status
))
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
companyCode
);
}
}
private
Integer
getTaskCodeByName
(
String
auditStatus
)
{
return
commonServiceImpl
.
getDictionaryCodeByName
(
auditStatus
);
}
...
...
@@ -1181,12 +1116,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
exportParamsMap
.
put
(
"supervisoryCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
getAuditPassedDate
(
transfer
.
getAuditPassDate
(),
exportParamsMap
);
//设备使用地址
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
jgChangeRegistrationUnitEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
...
...
@@ -1300,34 +1230,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
});
}
// private void executeOneStep(JgChangeRegistrationUnit jgChangeRegistrationName, String taskName, String nextUserIds, String operate) {
// // 先更新之前的待办
// TaskV2Model taskV2Model = updateTaskModel(jgChangeRegistrationName, operate);
// TaskModelDto taskModelDto = new TaskModelDto();
// taskModelDto.setTaskDesc("");
// taskModelDto.setTaskContent(this.buildTaskContent(jgChangeRegistrationName));
// taskV2Model.setTaskName(taskName);
// taskModelDto.setTaskDesc("");
// taskModelDto.setTaskCode(jgChangeRegistrationName.getApplyNo());
// taskV2Model.setExecuteUserIds(nextUserIds);
// taskV2Model.setRelationId(jgChangeRegistrationName.getInstanceId());
// taskV2Model.setTaskStatus(this.getTaskStatusByName(jgChangeRegistrationName.getAuditStatus()));
// taskV2Model.setTaskStatusLabel(jgChangeRegistrationName.getAuditStatus());
// taskV2Model.setTaskType(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getCode());
// taskModelDto.setStartUser(jgChangeRegistrationName.getCreateUserName());
// taskV2Model.setTaskTypeLabel(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getName());
// taskModelDto.setStartDate(jgChangeRegistrationName.getCreateDate());
// taskModelDto.setStartUserId(jgChangeRegistrationName.getCreateUserId());
// taskModelDto.setStartUserCompanyName(jgChangeRegistrationName.getUseUnitName());
// taskModelDto.setExecuteUserIds(nextUserIds);
// TaskModelDto modelDto = new TaskModelDto();
// BeanUtil.copyProperties(taskV2Model,modelDto);
// modelDto.setNextExecuteUser(jgChangeRegistrationName.getNextExecutorIds());
// modelDto.setModel(jgChangeRegistrationName);
// // 再插入新代办、数据待定
// commonServiceImpl.buildTaskModel(Collections.singletonList(modelDto));
// }
private
void
executeOneStep
(
JgChangeRegistrationUnit
jgChangeRegistrationName
,
String
taskName
,
String
nextUserIds
,
String
operate
)
{
// 先更新之前的待办
TaskV2Model
taskV2Model
=
updateTaskModel
(
jgChangeRegistrationName
,
operate
);
...
...
@@ -1342,12 +1244,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
taskV2Model
.
setTaskStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
taskV2Model
.
setFlowStatus
(
this
.
getTaskStatusByName
(
jgChangeRegistrationName
.
getStatus
()));
taskV2Model
.
setFlowStatusLabel
(
jgChangeRegistrationName
.
getStatus
());
// taskV2Model.setTaskType(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getCode());
// taskV2Model.setStartUser(jgChangeRegistrationName.getCreateUserName());
// taskV2Model.setTaskTypeLabel(BusinessTypeEnum.JG_COMPANY_CHANGE_REGISTRATION.getName());
// taskV2Model.setStartDate(jgChangeRegistrationName.getCreateDate());
// taskV2Model.setStartUserId(jgChangeRegistrationName.getCreateUserId());
// taskV2Model.setStartUserCompanyName(jgChangeRegistrationName.getUseUnitName());
taskV2Model
.
setExecuteUserIds
(
nextUserIds
);
TaskModelDto
modelDto
=
new
TaskModelDto
();
BeanUtil
.
copyProperties
(
taskV2Model
,
modelDto
);
...
...
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/JgEquipTransferServiceImpl.java
View file @
e8b7dc41
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.common.BaseException
;
...
...
@@ -69,8 +70,11 @@ import java.util.stream.Stream;
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
JgEquipTransferServiceImpl
extends
BaseService
<
JgEquipTransferDto
,
JgEquipTransfer
,
JgEquipTransferMapper
>
implements
IJgEquipTransferService
{
private
static
final
String
EQUIP_TRANSFER_PROCESS_KEY
=
"equipmentHandover"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"6610"
,
"6614"
,
"6615"
,
"6617"
,
"6616"
);
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
final
JgEquipTransferEqMapper
jgEquipTransferEqMapper
;
private
final
JgEquipTransferEqServiceImpl
equipTransferEqService
;
private
final
RedisUtils
redisUtils
;
private
final
TzsServiceFeignClient
tzsServiceFeignClient
;
...
...
@@ -148,17 +152,39 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this
.
updateRedisBatch
(
transferList
);
// 创建历史数据
this
.
saveOrUpdateHisDataBatch
(
jgEquipTransferEqList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
jgEquipTransferEqList
.
forEach
(
equipTransferEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
equipTransferEq
.
getEquId
(),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
transferList
;
}
/**
* 删除 redis校验重复引用设备的数据
*/
private
void
delRepeatUseEquipData
(
Long
id
,
String
status
,
String
companyCode
)
{
List
<
JgEquipTransferEq
>
list
=
equipTransferEqService
.
lambdaQuery
().
eq
(
JgEquipTransferEq:
:
getEquipTransferId
,
id
).
list
();
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
;
}
List
<
String
>
records
=
list
.
stream
().
map
(
JgEquipTransferEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
if
(
NOT_FLOWING_STATE
.
contains
(
status
))
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
companyCode
);
}
}
private
void
saveOrUpdateHisDataBatch
(
List
<
JgEquipTransferEq
>
jgEquipTransferEqList
)
{
jgEquipTransferEqList
.
forEach
(
j
->
{
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_EQUIPMENT_HANDOVER
.
getName
(),
getEquipInfoJson
(
j
.
getEquId
())
,
j
.
getEquId
(),
j
.
getEquipTransferId
());
jgEquipTransferEqList
.
forEach
(
j
->
{
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_EQUIPMENT_HANDOVER
.
getName
(),
getEquipInfoJson
(
j
.
getEquId
())
,
j
.
getEquId
(),
j
.
getEquipTransferId
());
});
}
private
JSON
getEquipInfoJson
(
String
record
)
{
Map
<
String
,
Object
>
equipMap
=
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
record
);;
Map
<
String
,
Object
>
equipMap
=
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
record
);
;
equipMap
.
remove
(
"useUnitCreditCode"
);
return
new
JSONObject
(
equipMap
);
}
...
...
@@ -289,10 +315,11 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param submitType 保存或保存并提交
* @param equipTransferDto 设备移交和设备信息
* @param op
* @param reginParams
* @return 设备信息
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
public
JgEquipTransferDto
updateEquipTransfer
(
String
submitType
,
JgEquipTransferDto
equipTransferDto
,
String
op
)
{
public
JgEquipTransferDto
updateEquipTransfer
(
String
submitType
,
JgEquipTransferDto
equipTransferDto
,
String
op
,
ReginParams
reginParams
)
{
if
(
Objects
.
isNull
(
equipTransferDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
...
...
@@ -375,14 +402,17 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
BeanUtils
.
copyProperties
(
equipTransferDto
,
equipTransfer
);
updateById
(
equipTransfer
);
}
this
.
updateHistorySingle
(
equipTransferDto
.
getSequenceNbr
());
List
<
JgEquipTransferEq
>
jgEquipTransferEqList
=
jgEquipTransferEqMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgEquipTransferEq
>().
eq
(
JgEquipTransferEq:
:
getEquipTransferId
,
equipTransferDto
.
getSequenceNbr
()));
this
.
saveOrUpdateHisDataBatch
(
jgEquipTransferEqList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
jgEquipTransferEqList
.
forEach
(
equipTransferEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
equipTransferEq
.
getEquId
(),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
equipTransferDto
;
}
private
void
updateHistorySingle
(
Long
seq
){
List
<
JgEquipTransferEq
>
eqs
=
jgEquipTransferEqMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgEquipTransferEq
>().
eq
(
JgEquipTransferEq:
:
getEquipTransferId
,
seq
));
this
.
saveOrUpdateHisDataBatch
(
eqs
);
}
/**
* 通过和驳回
*
...
...
@@ -476,6 +506,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
updateById
(
jgEquipTransfer
);
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgEquipTransfer
));
this
.
delRepeatUseEquipData
(
jgEquipTransfer
.
getSequenceNbr
(),
jgEquipTransfer
.
getApplyStatus
(),
jgEquipTransfer
.
getUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -531,6 +562,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
jsonObject
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
ROLLBACK
.
getName
());
commonService
.
rollbackTask
(
equipTransfer
.
getInstanceId
(),
jsonObject
);
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
equipTransfer
));
this
.
delRepeatUseEquipData
(
equipTransfer
.
getSequenceNbr
(),
equipTransfer
.
getApplyStatus
(),
equipTransfer
.
getUseUnitCreditCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -559,7 +591,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
}
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
Page
<
JgEquipTransferDto
>
equipTransferPage
=
this
.
baseMapper
.
queryForPage
(
page
,
sortMap
,
dto
,
reginParams
.
getUserModel
().
getUserId
());
Page
<
JgEquipTransferDto
>
equipTransferPage
=
this
.
baseMapper
.
queryForPage
(
page
,
sortMap
,
dto
,
reginParams
.
getUserModel
().
getUserId
());
equipTransferPage
.
getRecords
().
forEach
(
transfer
->
{
if
(
Objects
.
nonNull
(
transfer
.
getApplyStatus
()))
{
transfer
.
setApplyStatusDesc
(
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
transfer
.
getApplyStatus
())));
...
...
@@ -575,12 +607,12 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
return
null
;
}
Map
<
String
,
Object
>
equipTransferInfo
=
createEquipTransferInfo
(
equipTransfer
);
if
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()
==
Integer
.
parseInt
(
equipTransfer
.
getApplyStatus
()))
{
if
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()
==
Integer
.
parseInt
(
equipTransfer
.
getApplyStatus
()))
{
// 已完成状态显示历史数据
// 1.设备历史信息
JSONObject
his
=
commonService
.
queryHistoryData
(
sequenceNbr
);
// 兼容老数据
if
(
his
==
null
)
{
if
(
his
==
null
)
{
// 1.设备信息
Map
<
String
,
Object
>
equipMap
=
getEquipInfonNew
(
sequenceNbr
);
// 2.移交业务字段信息
...
...
@@ -595,7 +627,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
else
{
Map
<
String
,
Object
>
equipMap
=
getEquipInfonNew
(
sequenceNbr
);
return
Stream
.
concat
(
equipTransferInfo
.
entrySet
().
stream
(),
equipMap
.
entrySet
().
stream
())
equipMap
.
entrySet
().
stream
())
.
filter
(
entry
->
entry
.
getValue
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
,
(
existing
,
replacement
)
->
existing
));
}
...
...
@@ -741,7 +773,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
private
Map
<
String
,
Object
>
createEquipTransferInfo
(
JgEquipTransfer
equipTransfer
)
{
Map
<
String
,
Object
>
equipTransferInfo
=
new
HashMap
<>(
BeanUtil
.
beanToMap
(
equipTransfer
,
false
,
true
));
Map
<
String
,
Object
>
equipTransferInfo
=
new
HashMap
<>(
BeanUtil
.
beanToMap
(
equipTransfer
,
false
,
true
));
equipTransferInfo
.
put
(
"installUnitCreditCode"
,
equipTransfer
.
getInstallUnitCreditCode
()
+
"_"
+
equipTransfer
.
getInstallUnitName
());
return
equipTransferInfo
;
}
...
...
@@ -751,7 +783,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
Collection
<
JgEquipTransfer
>
jgEquipTransfers
=
this
.
listByIds
(
Arrays
.
asList
(
ids
));
for
(
JgEquipTransfer
notice
:
jgEquipTransfers
)
{
// 删除代办 + 中止流程
commonService
.
deleteTaskModel
(
String
.
valueOf
(
notice
.
getSequenceNbr
()),
notice
.
getInstanceId
());
commonService
.
deleteTaskModel
(
String
.
valueOf
(
notice
.
getSequenceNbr
()),
notice
.
getInstanceId
());
// 删除单子
this
.
baseMapper
.
deleteById
(
notice
.
getSequenceNbr
());
// 删除对应eq
...
...
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 @
e8b7dc41
...
...
@@ -115,6 +115,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
JgUseRegistrationMapper
jgUseRegistrationMapper
;
@Autowired
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Autowired
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
IdxBizJgRegisterInfoMapper
tzsJgRegistrationInfoMapper
;
...
...
@@ -1394,6 +1396,28 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
this
.
updateById
(
installationNotice
);
// 2.更新关联的业务
this
.
processElseDataByStatus
(
Objects
.
requireNonNull
(
FlowStatusEnum
.
getEumByCode
(
Integer
.
parseInt
(
oldNoticeStatus
))),
installationNotice
);
// 3.更新ES、IdxBizJgUseInfo中关联设备为未纳管
Map
<
String
,
Map
<
String
,
Object
>>
objMap
=
new
HashMap
<>();
LambdaQueryWrapper
<
JgInstallationNoticeEq
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
installationNotice
.
getSequenceNbr
());
List
<
JgInstallationNoticeEq
>
jgInstallationNoticeEqs
=
jgInstallationNoticeEqMapper
.
selectList
(
lambdaQueryWrapper
);
if
(!
ObjectUtils
.
isEmpty
(
jgInstallationNoticeEqs
)
&&
jgInstallationNoticeEqs
.
size
()
>
0
)
{
for
(
JgInstallationNoticeEq
jgInstallationNoticeEq
:
jgInstallationNoticeEqs
)
{
// 组装修改es条件及数据
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"IS_INTO_MANAGEMENT"
,
Boolean
.
FALSE
);
objMap
.
put
(
jgInstallationNoticeEq
.
getEquId
(),
map
);
}
}
// 组装更新IdxBizJgUseInfo条件
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
jgUseInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
jgUseInfoLambdaQueryWrapper
.
in
(
IdxBizJgUseInfo:
:
getRecord
,
jgInstallationNoticeEqs
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
()));
List
<
IdxBizJgUseInfo
>
list
=
idxBizJgUseInfoMapper
.
selectList
(
jgUseInfoLambdaQueryWrapper
);
for
(
IdxBizJgUseInfo
useInfo
:
list
)
{
useInfo
.
setIsIntoManagement
(
Boolean
.
FALSE
);
}
idxBizJgUseInfoService
.
saveOrUpdateBatch
(
list
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
objMap
);
return
installationNotice
;
}
...
...
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/JgMaintenanceContractServiceImpl.java
View file @
e8b7dc41
...
...
@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
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.IIdxBizJgUseInfoService
;
...
...
@@ -72,6 +73,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
public
static
final
String
SUBMIT_DATA
=
"0"
;
public
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
public
static
final
String
WB_PROCESS_DEFINITION_KEY
=
"maintenanceFiling"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"维保单位已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
...
...
@@ -211,6 +213,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
ProcessTaskDTO
complete
=
workflowService
.
completeOrReject
(
taskId
,
dto
,
operate
);
// 更新下一步执行人、创建待办
updateExecuteIds
(
instanceId
,
id
,
operate
,
complete
);
this
.
delRepeatUseEquipData
(
contract
.
getSequenceNbr
(),
contract
.
getStatus
(),
contract
.
getUseUnitCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -220,6 +223,22 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
}
/**
* 删除 redis校验重复引用设备的数据
*/
private
void
delRepeatUseEquipData
(
Long
id
,
String
status
,
String
companyCode
)
{
List
<
JgMaintenanceContractEq
>
list
=
jgMaintenanceContractEqService
.
lambdaQuery
().
eq
(
JgMaintenanceContractEq:
:
getEquipTransferId
,
id
).
list
();
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
;
}
List
<
String
>
records
=
list
.
stream
().
map
(
JgMaintenanceContractEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
if
(
NOT_FLOWING_STATE
.
contains
(
status
))
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
WB_PROCESS_DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
companyCode
);
}
}
public
InstanceRuntimeData
buildInstanceRuntimeData
(
JgMaintenanceContract
jgMaintenanceContract
)
{
return
InstanceRuntimeData
.
builder
()
.
nextExecuteUserIds
(
jgMaintenanceContract
.
getNextExecuteUserIds
())
...
...
@@ -256,7 +275,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
list
.
forEach
(
seq
->
{
JgMaintenanceContract
jgMaintenanceContract
=
this
.
baseMapper
.
selectById
(
seq
);
// 删除待办 及 中止流程
commonService
.
deleteTaskModel
(
String
.
valueOf
(
jgMaintenanceContract
.
getSequenceNbr
()),
jgMaintenanceContract
.
getInstanceId
());
commonService
.
deleteTaskModel
(
String
.
valueOf
(
jgMaintenanceContract
.
getSequenceNbr
()),
jgMaintenanceContract
.
getInstanceId
());
// 删除业务单
this
.
baseMapper
.
deleteById
(
seq
);
// 删除对应eq
...
...
@@ -370,6 +389,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
// redis流程实时数据更新
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
contract
));
this
.
delRepeatUseEquipData
(
contract
.
getSequenceNbr
(),
contract
.
getStatus
(),
contract
.
getUseUnitCode
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -441,9 +461,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
jgMaintenanceContractEqService
.
getBaseMapper
().
delete
(
lambda
);
}
// 更新关联设备信息
List
<
JgMaintenanceContractEq
>
equipList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
contract
.
setEquNum
(
equipmentLists
.
size
());
List
<
JgMaintenanceContractEq
>
equipList
=
new
ArrayList
<>();
equipmentLists
.
forEach
(
x
->
{
JgMaintenanceContractEq
equip
=
new
JgMaintenanceContractEq
();
equip
.
setEquId
(
String
.
valueOf
(
x
.
get
(
"SEQUENCE_NBR"
)));
...
...
@@ -546,6 +566,11 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
updateById
(
contract
);
// 设备数据存历史数据,在流程完成时使用
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_MAINTENANCE_RECORD
.
getName
(),
JSON
.
parseArray
(
JSON
.
toJSONString
(
equipmentLists
)),
null
,
contract
.
getSequenceNbr
().
toString
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submit
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
equipList
.
forEach
(
equip
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
WB_PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
equip
.
getEquId
()),
reginParams
.
getCompany
().
getCompanyCode
()));
}
return
Collections
.
singletonList
(
contract
);
}
...
...
@@ -784,37 +809,39 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
return
null
;
}
private
void
processElseDataByStatus
(
FlowStatusEnum
oldNoticeStatus
,
JgMaintenanceContract
maintenanceC
ontract
)
{
private
void
processElseDataByStatus
(
FlowStatusEnum
oldNoticeStatus
,
JgMaintenanceContract
c
ontract
)
{
switch
(
oldNoticeStatus
)
{
case
TO_BE_SUBMITTED:
// 1.写入历史表
this
.
saveHisDataBeforeUpdate
(
maintenanceC
ontract
);
this
.
saveHisDataBeforeUpdate
(
c
ontract
);
// 2.删除暂存时生成的待办
commonService
.
deleteTasksAndStopProcess
(
maintenanceContract
.
getInstanceId
(),
"监管单位主动作废"
);
commonService
.
deleteTasksAndStopProcess
(
contract
.
getInstanceId
(),
"监管单位主动作废"
);
break
;
case
TO_BE_FINISHED:
// 1.回退表单
updateIdxBizJgRegisterInfo
(
maintenanceC
ontract
);
updateIdxBizJgRegisterInfo
(
c
ontract
);
break
;
default
:
// 流程中(驳回、撤回等)
// 1.待办任务更新为已完成
this
.
finishedTask
(
maintenanceC
ontract
);
this
.
finishedTask
(
c
ontract
);
// 2.终止流程-工作流报错暂时注释掉
iCmWorkflowService
.
stopProcess
(
maintenanceContract
.
getInstanceId
(),
maintenanceC
ontract
.
getCancelReason
());
iCmWorkflowService
.
stopProcess
(
contract
.
getInstanceId
(),
c
ontract
.
getCancelReason
());
// 3.写入历史表
this
.
saveHisDataBeforeUpdate
(
maintenanceContract
);
this
.
saveHisDataBeforeUpdate
(
contract
);
// 4、释放流程中设备
this
.
delRepeatUseEquipData
(
contract
.
getSequenceNbr
(),
contract
.
getStatus
(),
contract
.
getUseUnitCode
());
}
}
private
void
updateIdxBizJgRegisterInfo
(
JgMaintenanceContract
maintenanceContract
)
{
LambdaQueryWrapper
<
JgMaintenanceContractEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgMaintenanceContractEq:
:
getEquipTransferId
,
maintenanceContract
.
getSequenceNbr
());
List
<
JgMaintenanceContractEq
>
equipmentLists
=
maintenanceContractEqMapper
.
selectList
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
List
<
String
>
list
=
equipmentLists
.
stream
().
filter
(
t
->
t
.
getEquId
()
!=
null
).
map
(
JgMaintenanceContractEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
List
<
String
>
list
=
equipmentLists
.
stream
().
filter
(
t
->
t
.
getEquId
()
!=
null
).
map
(
JgMaintenanceContractEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
maintenanceContractEqMapper
.
updateIdxBizJgRegisterInfo
(
list
);
}
}
...
...
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 @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -33,6 +34,7 @@ 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.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.common.StringUtil
;
...
...
@@ -113,6 +115,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
@Autowired
IdxBizJgDesignInfoMapper
idxBizJgDesignInfoMapper
;
@Autowired
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
@Autowired
TzsUserInfoMapper
userInfoMapper
;
@Autowired
ICommonService
commonService
;
...
...
@@ -152,6 +158,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
private
IdxBizJgFactoryInfoMapper
idxBizJgFactoryInfoMapper
;
@Autowired
IIdxBizJgInspectionDetectionInfoService
iIdxBizJgInspectionDetectionInfoService
;
@Autowired
private
IdxBizJgMaintenanceRecordInfoServiceImpl
idxBizJgMaintenanceRecordInfoService
;
@Autowired
private
RedissonClient
redissonClient
;
...
...
@@ -2671,14 +2681,50 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
String
equCode
=
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
());
registerInfo
.
setEquCodeType
(
String
.
valueOf
(
map
.
get
(
"equCodeType"
)));
String
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
registerInfo
.
setEquCode
(
equCode
);
// 设备代码
registerInfo
.
setEquPrice
(
String
.
valueOf
(
map
.
get
(
"equPrice"
)));
registerInfo
.
setProductPhoto
(
JSONObject
.
toJSONString
(
map
.
get
(
"productPhoto"
)));
registerInfo
.
setOtherAccessoriesReg
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesReg"
)));
idxBizJgRegisterInfoMapper
.
updateById
(
registerInfo
);
// 查询设备制造信息
// 设计信息
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>
lambdaDes
=
new
QueryWrapper
<
IdxBizJgDesignInfo
>().
lambda
();
lambdaDes
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoService
.
getOne
(
lambdaDes
);
designInfo
.
setDesignUnitCreditCode
(
String
.
valueOf
(
map
.
get
(
"designUnitCreditCode"
)));
designInfo
.
setDesignUnitName
(
String
.
valueOf
(
map
.
get
(
"designUnitName"
)));
designInfo
.
setDesignLicenseNum
(
String
.
valueOf
(
map
.
get
(
"designLicenseNum"
)));
designInfo
.
setDesignUseDate
(
String
.
valueOf
(
map
.
get
(
"designUseDate"
)));
designInfo
.
setDesignDate
(
DateUtil
.
parse
(
String
.
valueOf
(
map
.
get
(
"designDate"
)),
"yyyy-MM-dd"
));
designInfo
.
setDrawingDo
(
String
.
valueOf
(
map
.
get
(
"drawingDo"
)));
designInfo
.
setAppraisalUnit
(
String
.
valueOf
(
map
.
get
(
"appraisalUnit"
)));
designInfo
.
setAppraisalDate
(
String
.
valueOf
(
map
.
get
(
"appraisalDate"
)));
designInfo
.
setDesignDoc
(
JSONObject
.
toJSONString
(
map
.
get
(
"designDoc"
)));
designInfo
.
setDesignStandard
(
JSONObject
.
toJSONString
(
map
.
get
(
"designStandard"
)));
designInfo
.
setOtherAccessoriesDes
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesDes"
)));
idxBizJgDesignInfoMapper
.
updateById
(
designInfo
);
// 制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
idxBizJgFactoryInfoService
.
getOne
(
factoryInfoWrapper
);
idxBizJgFactoryInfo
.
setProduceUnitCreditCode
(
String
.
valueOf
(
map
.
get
(
"produceUnitCreditCode"
)));
idxBizJgFactoryInfo
.
setProduceUnitName
(
String
.
valueOf
(
map
.
get
(
"produceUnitName"
)));
idxBizJgFactoryInfo
.
setFactoryNum
(
String
.
valueOf
(
map
.
get
(
"factoryNum"
)));
idxBizJgFactoryInfo
.
setProduceLicenseNum
(
String
.
valueOf
(
map
.
get
(
"produceLicenseNum"
)));
idxBizJgFactoryInfo
.
setProduceDate
(
DateUtil
.
parse
(
String
.
valueOf
(
map
.
get
(
"produceDate"
)),
"yyyy-MM-dd"
));
idxBizJgFactoryInfo
.
setImported
(
String
.
valueOf
(
map
.
get
(
"imported"
)));
idxBizJgFactoryInfo
.
setProduceCountry
(
String
.
valueOf
(
map
.
get
(
"produceCountry"
)));
idxBizJgFactoryInfo
.
setOtherAccessoriesFact
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesFact"
)));
idxBizJgFactoryInfo
.
setProductQualityYieldProve
(
JSONObject
.
toJSONString
(
map
.
get
(
"productQualityYieldProve"
)));
idxBizJgFactoryInfo
.
setInsUseMaintainExplain
(
JSONObject
.
toJSONString
(
map
.
get
(
"insUseMaintainExplain"
)));
idxBizJgFactoryInfo
.
setFactoryStandard
(
JSONObject
.
toJSONString
(
map
.
get
(
"factoryStandard"
)));
idxBizJgFactoryInfo
.
setFactSupervisionInspectionReport
(
JSONObject
.
toJSONString
(
map
.
get
(
"factSupervisionInspectionReport"
)));
idxBizJgFactoryInfo
.
setBoilerEnergyEfficiencyCertificate
(
JSONObject
.
toJSONString
(
map
.
get
(
"boilerEnergyEfficiencyCertificate"
)));
idxBizJgFactoryInfoMapper
.
updateById
(
idxBizJgFactoryInfo
);
// 使用信息
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
...
...
@@ -2699,6 +2745,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useInfo
.
setIsNotXiXian
(
String
.
valueOf
(
map
.
get
(
"isXixian"
)));
useInfo
.
setEstateUnitCreditCode
(
String
.
valueOf
(
map
.
get
(
"estateUnitName"
)).
split
(
"_"
)[
0
]);
useInfo
.
setEstateUnitName
(
String
.
valueOf
(
map
.
get
(
"estateUnitName"
)).
split
(
"_"
)[
1
]);
useInfo
.
setPhone
(
String
.
valueOf
(
map
.
get
(
"safetyManager"
)).
split
(
"_"
)[
0
]);
useInfo
.
setSafetyManager
(
String
.
valueOf
(
map
.
get
(
"safetyManager"
)).
split
(
"_"
)[
1
]);
useInfo
.
setUseDate
(
String
.
valueOf
(
map
.
get
(
"useDate"
)));
String
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
"/"
+
useInfo
.
getStreetName
();
useInfoMapper
.
updateById
(
useInfo
);
...
...
@@ -2706,6 +2755,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
otherLambda
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
map
.
get
(
"equipId"
));
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
otherLambda
);
// 检验检测【一对多,暂时只取最新一条数据】
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
if
(
ObjectUtils
.
isEmpty
(
inspectionDetectionInfo
))
{
inspectionDetectionInfo
=
new
IdxBizJgInspectionDetectionInfo
();
}
inspectionDetectionInfo
.
setInspectOrgCode
(
String
.
valueOf
(
map
.
get
(
"inspectOrgCode"
)));
inspectionDetectionInfo
.
setInspectOrgName
(
String
.
valueOf
(
map
.
get
(
"inspectOrgName"
)));
inspectionDetectionInfo
.
setInspectConclusion
(
String
.
valueOf
(
map
.
get
(
"inspectConclusion"
)));
inspectionDetectionInfo
.
setInspectType
(
String
.
valueOf
(
map
.
get
(
"inspectType"
)));
inspectionDetectionInfo
.
setInspectDate
(
DateUtil
.
parse
(
String
.
valueOf
(
map
.
get
(
"inspectDate"
)),
"yyyy-MM-dd"
));
inspectionDetectionInfo
.
setInspectStaff
(
String
.
valueOf
(
map
.
get
(
"inspectStaff"
)));
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
String
.
valueOf
(
map
.
get
(
"nextInspectDate"
)),
"yyyy-MM-dd"
));
inspectionDetectionInfo
.
setInspectReport
(
JSONObject
.
toJSONString
(
map
.
get
(
"inspectReport"
)));
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateData
(
inspectionDetectionInfo
);
// 生成监管码 96333码
this
.
createCode
(
map
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
map
.
put
(
"equCode"
,
equCode
);
...
...
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/MaintenanceContractEquipUsedCheckImpl.java
0 → 100644
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@Slf4j
public
class
MaintenanceContractEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
private
String
bizType
=
"maintenanceFiling"
;
private
JgMaintenanceContractMapper
maintenanceContractMapper
;
public
MaintenanceContractEquipUsedCheckImpl
(
RedissonClient
redissonClient
,
JgMaintenanceContractMapper
maintenanceContractMapper
)
{
this
.
redissonClient
=
redissonClient
;
this
.
maintenanceContractMapper
=
maintenanceContractMapper
;
}
@Override
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
getApplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
// 初始化在流程中的设备数据
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
maintenanceContractMapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/dto/InspectionTimelinesDto.java
0 → 100644
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
dto
;
import
lombok.Data
;
/**
* 机构进行检验时效统计对象
*
* @author Administrator
*/
@Data
public
class
InspectionTimelinesDto
{
private
String
city
;
private
String
name
;
private
String
unitCode
;
private
Long
count
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/dto/PublicityInspectOrgInfoDto.java
0 → 100644
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
dto
;
import
lombok.Data
;
/**
* 检验机构公示
*
* @author Administrator
*/
@Data
public
class
PublicityInspectOrgInfoDto
{
/**
* 单位名称
*/
private
String
unitName
;
/**
* 单位编码
*/
private
String
unitCode
;
/**
* 核准代码
*/
private
String
approvalNumber
;
/**
* 核准有效期
*/
private
String
aapprovalDeadline
;
/**
* 业务有限期
*/
private
String
businessDeadline
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcInspectionApplication.java
View file @
e8b7dc41
...
...
@@ -219,6 +219,12 @@ public class JyjcInspectionApplication extends BaseEntity {
private
JSONObject
planData
;
/**
* 计划下发日期,统计办理时效使用
*/
@TableField
(
value
=
"plan_create_date"
)
private
Date
planCreateDate
;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
@TableField
(
value
=
"is_must_accept"
)
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcInspectionResult.java
View file @
e8b7dc41
...
...
@@ -215,4 +215,11 @@ public class JyjcInspectionResult extends BaseEntity {
*/
@TableField
(
value
=
"safety_level"
)
private
String
safetyLevel
;
/**
* 计划下发日期,,统计办理时效使用"
*/
@TableField
(
value
=
"plan_create_date"
)
private
Date
planCreateDate
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/enums/JYJCTypeEnum.java
View file @
e8b7dc41
...
...
@@ -19,12 +19,12 @@ public enum JYJCTypeEnum {
/**
* 检验检测类型
*/
DTJC
(
"DTJC"
,
"电梯检测"
,
"jc"
,
BizTypeEnum
.
DETECTION
.
getCode
()),
DQJY
(
"DQJY"
,
"定期检验"
,
"jy"
,
BizTypeEnum
.
FIRST_INSPECTION
.
getCode
()),
SCJY
(
"SCJY"
,
"首次检验"
,
"jy"
,
BizTypeEnum
.
FIRST_INSPECTION
.
getCode
()),
WXJDJY
(
"WXJDJY"
,
"维修监督检验"
,
"jy"
,
BizTypeEnum
.
SUPERVISE
.
getCode
()),
AZJDJY
(
"AZJDJY"
,
"安装监督检验"
,
"jy"
,
BizTypeEnum
.
SUPERVISE
.
getCode
()),
GZJDJY
(
"GZJDJY"
,
"改造监督检验"
,
"jy"
,
BizTypeEnum
.
SUPERVISE
.
getCode
()),
AZJDJY
(
"AZJDJY"
,
"安装监督检验"
,
"jy"
,
BizTypeEnum
.
SUPERVISE
.
getCode
());
WXJDJY
(
"WXJDJY"
,
"维修监督检验"
,
"jy"
,
BizTypeEnum
.
SUPERVISE
.
getCode
()),
SCJY
(
"SCJY"
,
"首次检验"
,
"jy"
,
BizTypeEnum
.
FIRST_INSPECTION
.
getCode
()),
DQJY
(
"DQJY"
,
"定期检验"
,
"jy"
,
BizTypeEnum
.
FIRST_INSPECTION
.
getCode
()),
DTJC
(
"DTJC"
,
"电梯检测"
,
"jc"
,
BizTypeEnum
.
DETECTION
.
getCode
());
private
final
String
code
;
private
final
String
name
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcBaseMapper.java
View file @
e8b7dc41
...
...
@@ -42,4 +42,6 @@ public interface JyjcBaseMapper {
List
<
TzsUserInfoDto
>
selectUserByCompanyCodes
(
@Param
(
"companyCodes"
)
List
<
String
>
companyCodes
);
CompanyModel
selectOneCompanyByCode
(
String
companyCode
);
String
getOrgCodeByCompanyCode
(
String
companyCode
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcInspectionApplicationMapper.java
View file @
e8b7dc41
...
...
@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel
;
import
org.
springframework.data.repository.query
.Param
;
import
org.
apache.ibatis.annotations
.Param
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -44,5 +46,23 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
* @param equips 需要判断的设备
* @return 在流程中的设备records
*/
List
<
String
>
queryRecordListInFlowing
(
@org
.
apache
.
ibatis
.
annotations
.
Param
(
"equips"
)
List
<
JyjcInspectionApplicationEquipDto
>
equips
);
List
<
String
>
queryRecordListInFlowing
(
@Param
(
"equips"
)
List
<
JyjcInspectionApplicationEquipDto
>
equips
);
/**
* 按照检验类型、机构、时间统计检验数量(流程中及已完成的)
*
* @param orgCode 区域对应公司orgCode
* @param dpFilterParamDto 过滤条件
* @return 统计信息
*/
List
<
CountDto
>
queryAllFlowingAndFinishedInspectApp
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamDto
);
/**
* 查询待出结果的报检单据数量
*
* @param orgCode 区域对应公司orgCode
* @param dpFilterParamDto 过滤条件
* @return 统计信息
*/
List
<
CountDto
>
queryAllPendingResultInspectApp
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamDto
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcInspectionResultMapper.java
View file @
e8b7dc41
...
...
@@ -2,10 +2,14 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 业务开通申请表 Mapper 接口
*
...
...
@@ -18,4 +22,5 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
Page
<
JyjcInspectionResultModel
>
selectForPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionResultModel
>
page
,
@Param
(
"jyjcInspectionResultModel"
)
JyjcInspectionResultModel
jyjcInspectionResultModel
,
@Param
(
"identity"
)
String
identity
);
List
<
InspectionTimelinesDto
>
queryInspectionTimelinessTopXX
(
@Param
(
"top"
)
String
top
,
@Param
(
"orgCode"
)
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcOpeningApplicationMapper.java
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -26,4 +27,11 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
void
updatePromoter
(
@Param
(
"id"
)
Long
id
);
List
<
Long
>
selectOverdueData
();
/**
* 检验机构公示
* @param orgCode 区域对应的orgCode
* @return List<PublicityInspectOrgInfoDto>
*/
List
<
PublicityInspectOrgInfoDto
>
queryInspectionOrgListForPublicity
(
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/JyjcInspectionApplicationModel.java
View file @
e8b7dc41
...
...
@@ -166,6 +166,9 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty
(
value
=
"是否已经进行计划排期"
)
private
Boolean
isExistPlanData
;
@ApiModelProperty
(
value
=
"计划下发日期,统计办理时效使用,来源JyjcInspectionApplication.planCreateDate"
)
private
Date
planCreateDate
;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/JyjcInspectionResultModel.java
View file @
e8b7dc41
...
...
@@ -150,6 +150,11 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty
(
value
=
"监管码"
)
private
String
supervisoryCode
;
@ApiModelProperty
(
value
=
"计划下发日期,统计办理时效使用"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
planCreateDate
;
/**
* 校验检验系统唯一流水号,排查问题,跟踪问题使用
*/
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcBaseMapper.xml
View file @
e8b7dc41
...
...
@@ -85,6 +85,9 @@
WHERE
c.company_code =#{companyCode}
</select>
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionApplicationMapper.xml
View file @
e8b7dc41
...
...
@@ -216,4 +216,32 @@
UPDATE tz_jyjc_inspection_application set promoter = null
where sequence_nbr = #{id}
</update>
<select
id=
"queryAllFlowingAndFinishedInspectApp"
resultType=
"com.yeejoin.amos.boot.biz.common.dto.CountDto"
>
SELECT
count(1) as longValue,
a.inspection_type as keyStr
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
group by a.inspection_type
</select>
<select
id=
"queryAllPendingResultInspectApp"
resultType=
"com.yeejoin.amos.boot.biz.common.dto.CountDto"
>
SELECT
count(1) as longValue,
a.inspection_type as keyStr
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and b.supervise_org_code like CONCAT(#{orgCode}, '%') and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and date_ge(CAST(a.application_date as date),#{dto.beginDate}) and date_le(CAST(a.application_date as date),#{dto.endDate})
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionResultMapper.xml
View file @
e8b7dc41
...
...
@@ -157,4 +157,28 @@
</where>
ORDER BY res.sequence_nbr DESC
</select>
<select
id=
"queryInspectionTimelinessTopXX"
resultType=
"com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto"
>
select
a1.avgtime as count,
a1.inspection_unit_code as unitCode,
b1.use_unit as name,
b1.city
from
(SELECT
ROUND(avg(EXTRACT(EPOCH FROM ( r.rec_date - r.plan_create_date)) / 60),0) as avgtime,
r.inspection_unit_code
FROM
tz_jyjc_inspection_result r,
tz_base_enterprise_info b
where
r.result_status ='2'
and r.inspection_unit_code= b.use_unit_code
AND b.supervise_org_code like CONCAT(#{orgCode}, '%')
GROUP BY r.inspection_unit_code ORDER BY avgtime
limit #{top}
) a1,
tz_base_enterprise_info b1
WHERE
a1.inspection_unit_code = b1.use_unit_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcOpeningApplicationMapper.xml
View file @
e8b7dc41
...
...
@@ -50,4 +50,36 @@
UPDATE tz_jyjc_opening_application set promoter = null
where sequence_nbr = #{id}
</update>
<select
id=
"queryInspectionOrgListForPublicity"
resultType=
"com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto"
>
select
b.use_unit as unitName,
l.cert_no as approvalNumber,
l.expiry_date as aapprovalDeadline,
b.use_code as unitCode,
a.expiry_date as businessDeadline,
a.licenceType
from
(SELECT
unit_code,
expiry_date,
unit_code_name,
case when
open_biz_type = 'jy' then '1233-1'
when
open_biz_type = 'jc' then '1233-2'
end as open_biz_type,
open_biz_type as licenceType
FROM
"tz_jyjc_opening_application"
where
status = '6616') a,
tz_base_enterprise_info b,
(select cert_no, min(expiry_date) as expiry_date, unit_code, cert_type_code from tz_base_unit_licence GROUP BY cert_no,unit_code,cert_type_code) l
where
a.unit_code= b.use_unit_code
and a.unit_code=l.unit_code
and l.cert_type_code = a.open_biz_type
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
ORDER BY unitName
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/DPStatisticsController.java
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.DPStatisticsServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -42,8 +41,8 @@ public class DPStatisticsController {
@PostMapping
(
value
=
"/inspectTime/count/byEquListAndInspectType"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectTimeCountByTypeAndEquList
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
inspectTimeCountByTypeAndEquList
(
dpFilterParamDto
));
}
...
...
@@ -53,10 +52,66 @@ public class DPStatisticsController {
@PostMapping
(
value
=
"/inspectTimeCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectTimeCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
inspectTimeCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-检验检测-左侧检验检测人员统计"
,
notes
=
"大屏-检验检测-左侧检验检测人员统计"
)
@PostMapping
(
value
=
"/jy/person/count"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectPersonCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
inspectPersonCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-检验检测-各检验类型业务数量统计"
,
notes
=
"大屏-检验检测-各检验类型业务数量统计"
)
@PostMapping
(
value
=
"/jy/allApp/countByType"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
inspectBizNumCountByType
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
queryAllFlowingAndFinishedInspectApp
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-检验检测-各检验类型待检数量统计"
,
notes
=
"大屏-检验检测-各检验类型待检数量统计"
)
@PostMapping
(
value
=
"/jy/pendingApp/countByType"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryAllFlowingAndFinishedInspectApp
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
queryAllPendingResultInspectApp
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-检验检测-按机构进行检验时效统计Top10排名"
,
notes
=
"大屏-检验检测-按机构进行检验时效统计Top10排名"
)
@PostMapping
(
value
=
"/jy/timeliness/top"
)
public
ResponseModel
<
List
<
InspectionTimelinesDto
>>
inspectionTimelinessTopXX
(
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
String
top
,
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
queryInspectionTimelinessTopXX
(
top
,
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-检验检测-检验检测机构公示"
,
notes
=
"大屏-检验检测-检验检测机构公示"
)
@PostMapping
(
value
=
"/jy/inspectionOrgList/publicity"
)
public
ResponseModel
<
List
<
PublicityInspectOrgInfoDto
>>
inspectionOrgListForPublicity
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
queryInspectionOrgListForPublicity
(
dpFilterParamDto
));
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/DPStatisticsServiceImpl.java
View file @
e8b7dc41
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectTimeCountDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationEquipMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.JYJCTypeEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -15,6 +24,7 @@ import java.time.LocalDateTime;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -23,6 +33,7 @@ import java.util.stream.Collectors;
* @author Administrator
*/
@Service
@Slf4j
public
class
DPStatisticsServiceImpl
{
/**
...
...
@@ -39,9 +50,27 @@ public class DPStatisticsServiceImpl {
private
JyjcInspectionApplicationEquipMapper
inspectionApplicationEquipMapper
;
public
DPStatisticsServiceImpl
(
EquipmentCategoryMapper
equipmentCategoryMapper
,
JyjcInspectionApplicationEquipMapper
inspectionApplicationEquipMapper
)
{
private
JyjcInspectionApplicationMapper
inspectionApplicationMapper
;
private
TzsUserInfoMapper
tzsUserInfoMapper
;
private
JyjcBaseMapper
jyjcBaseMapper
;
private
JyjcInspectionResultMapper
inspectionResultMapper
;
private
JyjcOpeningApplicationMapper
openingApplicationMapper
;
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
public
DPStatisticsServiceImpl
(
EquipmentCategoryMapper
equipmentCategoryMapper
,
JyjcInspectionApplicationEquipMapper
inspectionApplicationEquipMapper
,
JyjcInspectionApplicationMapper
inspectionApplicationMapper
,
TzsUserInfoMapper
tzsUserInfoMapper
,
JyjcBaseMapper
jyjcBaseMapper
,
JyjcInspectionResultMapper
inspectionResultMapper
,
JyjcOpeningApplicationMapper
openingApplicationMapper
)
{
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
this
.
inspectionApplicationEquipMapper
=
inspectionApplicationEquipMapper
;
this
.
inspectionApplicationMapper
=
inspectionApplicationMapper
;
this
.
tzsUserInfoMapper
=
tzsUserInfoMapper
;
this
.
jyjcBaseMapper
=
jyjcBaseMapper
;
this
.
inspectionResultMapper
=
inspectionResultMapper
;
this
.
openingApplicationMapper
=
openingApplicationMapper
;
}
...
...
@@ -101,7 +130,7 @@ public class DPStatisticsServiceImpl {
}
private
List
<
Map
<
String
,
Object
>>
getLegendData
(
List
<
BizTypeEnum
>
bizTypeEnums
)
{
return
bizTypeEnums
.
stream
().
map
(
b
->
{
return
bizTypeEnums
.
stream
().
map
(
b
->
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"dataKey"
,
b
.
getCode
());
item
.
put
(
"value"
,
b
.
getName
());
...
...
@@ -130,11 +159,128 @@ public class DPStatisticsServiceImpl {
dpFilterParamDto
.
setBeginDate
(
LocalDateTime
.
of
(
firstDayOfPrevMonth
,
java
.
time
.
LocalTime
.
MIN
).
format
(
sdf
));
dpFilterParamDto
.
setEndDate
(
LocalDateTime
.
of
(
lastDayOfPrevMonth
,
java
.
time
.
LocalTime
.
MAX
).
format
(
sdf
));
Integer
inspectTimeCount
=
inspectionApplicationEquipMapper
.
inspectTimeCount
(
dpFilterParamDto
);
xDataList
.
add
(
firstDayOfPrevMonth
.
getMonthValue
()
+
"月"
);
xDataList
.
add
(
firstDayOfPrevMonth
.
getMonthValue
()
+
"月"
);
yDataList
.
add
(
null
==
inspectTimeCount
?
0
:
inspectTimeCount
);
}
returnMap
.
put
(
"xdata"
,
xDataList
);
returnMap
.
put
(
"ydata"
,
yDataList
);
returnMap
.
put
(
"xdata"
,
xDataList
);
returnMap
.
put
(
"ydata"
,
yDataList
);
return
returnMap
;
}
public
Map
<
String
,
Object
>
inspectPersonCount
(
DPFilterParamDto
dpFilterParamDto
)
{
// 1.查询条件构造未上送时间时,默认查询数据为近一个月数据
this
.
setDefaultFilter
(
dpFilterParamDto
);
// 2.按照前端约定格式返回数据
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
RegionModel
>
childRegion
=
this
.
getRegionList
(
dpFilterParamDto
);
if
(
childRegion
.
isEmpty
())
{
return
new
HashMap
<>(
0
);
}
//2.1 x轴数据构造
result
.
put
(
"xdata"
,
this
.
getXDataForInspectPersonCount
(
childRegion
));
//2.3 y轴数据构造
this
.
buildYDataForInspectPersonCount
(
result
,
childRegion
);
return
result
;
}
private
void
buildYDataForInspectPersonCount
(
Map
<
String
,
Object
>
result
,
List
<
RegionModel
>
childRegion
)
{
List
<
Long
>
yData
=
new
ArrayList
<>();
childRegion
.
forEach
(
regionModel
->
{
String
orgCode
=
this
.
getAndSetOrgCode
(
regionModel
.
getRegionCode
()
+
""
);
if
(
StringUtils
.
isEmpty
(
orgCode
))
{
yData
.
add
(
0L
);
}
else
{
Long
num
=
tzsUserInfoMapper
.
countUserByPostAndAreaCode
(
orgCode
,
"6615"
);
yData
.
add
(
num
);
}
});
result
.
put
(
"ydata"
,
yData
);
}
private
String
getAndSetOrgCode
(
String
regionCode
)
{
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
regionCode
);
if
(
orgCode
==
null
)
{
orgCode
=
jyjcBaseMapper
.
getOrgCodeByCompanyCode
(
regionCode
);
if
(
orgCode
==
null
)
{
return
""
;
}
regionCodeOrgCodeMap
.
put
(
regionCode
,
orgCode
);
}
return
orgCode
;
}
private
List
<
String
>
getXDataForInspectPersonCount
(
List
<
RegionModel
>
childRegion
)
{
return
childRegion
.
stream
().
map
(
RegionModel:
:
getRegionName
).
collect
(
Collectors
.
toList
());
}
private
List
<
RegionModel
>
getRegionList
(
DPFilterParamDto
dpFilterParamDto
)
{
try
{
FeignClientResult
<
List
<
RegionModel
>>
feignClientResult
=
Systemctl
.
regionClient
.
queryByParentRegionCode
(
Integer
.
parseInt
(
dpFilterParamDto
.
getCityCode
()));
return
feignClientResult
.
getResult
();
}
catch
(
Exception
e
)
{
log
.
error
(
"查询行政区域失败:{}"
,
e
.
getMessage
());
}
return
new
ArrayList
<>();
}
public
Map
<
String
,
Object
>
queryAllFlowingAndFinishedInspectApp
(
DPFilterParamDto
dpFilterParamDto
)
{
// 1.查询条件构造未上送时间时,默认查询数据为近一个月数据
this
.
setDefaultFilter
(
dpFilterParamDto
);
// 2.按照前端约定格式返回数据
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
JYJCTypeEnum
[]
jyjcTypeEnums
=
JYJCTypeEnum
.
values
();
//2.1 x轴数据构造
result
.
put
(
"xdata"
,
this
.
getXDataForInspectBizNumCount
(
jyjcTypeEnums
));
//2.3 y轴数据构造
this
.
buildYDataForFlowingAndFinishedInspectApp
(
result
,
jyjcTypeEnums
,
dpFilterParamDto
);
return
result
;
}
public
Map
<
String
,
Object
>
queryAllPendingResultInspectApp
(
DPFilterParamDto
dpFilterParamDto
)
{
// 1.查询条件构造未上送时间时,默认查询数据为近一个月数据
this
.
setDefaultFilter
(
dpFilterParamDto
);
// 2.按照前端约定格式返回数据
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
JYJCTypeEnum
[]
jyjcTypeEnums
=
JYJCTypeEnum
.
values
();
//2.1 x轴数据构造
result
.
put
(
"xdata"
,
this
.
getXDataForInspectBizNumCount
(
jyjcTypeEnums
));
//2.3 y轴数据构造
this
.
buildYDataForPendingResultInspectApp
(
result
,
jyjcTypeEnums
,
dpFilterParamDto
);
return
result
;
}
private
void
buildYDataForPendingResultInspectApp
(
Map
<
String
,
Object
>
result
,
JYJCTypeEnum
[]
jyjcTypeEnums
,
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
List
<
CountDto
>
countDtoList
=
inspectionApplicationMapper
.
queryAllPendingResultInspectApp
(
orgCode
,
dpFilterParamDto
);
fillJYJCYData
(
result
,
jyjcTypeEnums
,
countDtoList
);
}
private
void
fillJYJCYData
(
Map
<
String
,
Object
>
result
,
JYJCTypeEnum
[]
jyjcTypeEnums
,
List
<
CountDto
>
countDtoList
)
{
List
<
Long
>
yData
=
new
ArrayList
<>();
for
(
JYJCTypeEnum
jyjcTypeEnum
:
jyjcTypeEnums
)
{
Long
num
=
countDtoList
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
equals
(
jyjcTypeEnum
.
getCode
())).
mapToLong
(
CountDto:
:
getLongValue
).
sum
();
yData
.
add
(
num
);
}
result
.
put
(
"ydata"
,
yData
);
}
private
void
buildYDataForFlowingAndFinishedInspectApp
(
Map
<
String
,
Object
>
result
,
JYJCTypeEnum
[]
jyjcTypeEnums
,
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
List
<
CountDto
>
countDtoList
=
inspectionApplicationMapper
.
queryAllFlowingAndFinishedInspectApp
(
orgCode
,
dpFilterParamDto
);
fillJYJCYData
(
result
,
jyjcTypeEnums
,
countDtoList
);
}
private
List
<
String
>
getXDataForInspectBizNumCount
(
JYJCTypeEnum
[]
jyjcTypeEnums
)
{
return
Arrays
.
stream
(
jyjcTypeEnums
).
map
(
JYJCTypeEnum:
:
getName
).
collect
(
Collectors
.
toList
());
}
public
List
<
InspectionTimelinesDto
>
queryInspectionTimelinessTopXX
(
String
top
,
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
return
inspectionResultMapper
.
queryInspectionTimelinessTopXX
(
top
,
orgCode
);
}
public
List
<
PublicityInspectOrgInfoDto
>
queryInspectionOrgListForPublicity
(
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
return
openingApplicationMapper
.
queryInspectionOrgListForPublicity
(
orgCode
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/InspectionPlanServiceImpl.java
View file @
e8b7dc41
...
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -25,13 +26,16 @@ public class InspectionPlanServiceImpl {
private
JyjcInspectionApplicationEquipServiceImpl
applicationEquipService
;
private
JyjcInspectionResultServiceImpl
inspectionResultService
;
private
ESEquipmentCategory
esEquipmentCategory
;
public
InspectionPlanServiceImpl
(
JyjcInspectionApplicationServiceImpl
inspectionApplicationService
,
JyjcInspectionApplicationEquipServiceImpl
applicationEquipService
,
ESEquipmentCategory
esEquipmentCategory
)
{
JyjcInspectionResultServiceImpl
inspectionResultService
,
ESEquipmentCategory
esEquipmentCategory
)
{
this
.
inspectionApplicationService
=
inspectionApplicationService
;
this
.
applicationEquipService
=
applicationEquipService
;
this
.
inspectionResultService
=
inspectionResultService
;
this
.
esEquipmentCategory
=
esEquipmentCategory
;
}
...
...
@@ -40,15 +44,23 @@ public class InspectionPlanServiceImpl {
LambdaUpdateWrapper
<
JyjcInspectionApplication
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
JyjcInspectionApplication:
:
getPlanData
,
JSONObject
.
toJSONString
(
model
));
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
applicationSeq
);
updateWrapper
.
set
(
JyjcInspectionApplication:
:
getPlanCreateDate
,
new
Date
());
inspectionApplicationService
.
update
(
updateWrapper
);
// 异步写入计划排期日期,统计办理时效使用
this
.
updatePlanCreateDate
(
applicationSeq
);
return
model
;
}
private
void
updatePlanCreateDate
(
String
applicationSeq
)
{
JyjcInspectionApplication
inspectionApplication
=
inspectionApplicationService
.
getById
(
applicationSeq
);
inspectionResultService
.
updatePlanCreateDateByAppNo
(
inspectionApplication
.
getApplicationNo
());
}
public
JSONObject
getDetail
(
String
applicationSeq
)
{
JyjcInspectionApplication
inspectionApplication
=
inspectionApplicationService
.
getById
(
applicationSeq
);
// 初始时查询设备地址关联设备表
JSONObject
jsonObject
=
inspectionApplication
.
getPlanData
();
if
(
jsonObject
==
null
)
{
if
(
jsonObject
==
null
)
{
jsonObject
=
new
JSONObject
();
String
address
=
this
.
getOneEquipAddress
(
applicationSeq
);
jsonObject
.
put
(
"address"
,
address
);
...
...
@@ -61,10 +73,10 @@ public class InspectionPlanServiceImpl {
List
<
JyjcInspectionApplicationEquip
>
applicationEquips
=
applicationEquipService
.
list
(
new
LambdaQueryWrapper
<
JyjcInspectionApplicationEquip
>().
eq
(
JyjcInspectionApplicationEquip:
:
getApplicationSeq
,
applicationSeq
));
// 拼接地址
List
<
String
>
allAddress
=
new
ArrayList
<>();
applicationEquips
.
forEach
(
e
->
{
applicationEquips
.
forEach
(
e
->
{
String
record
=
e
.
getEquipUnicode
();
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategory
.
findById
(
record
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
allAddress
.
add
(
this
.
concatDetailAddress
(
esEquipmentCategoryDto
));
}
...
...
@@ -77,6 +89,6 @@ public class InspectionPlanServiceImpl {
String
usePlace
=
esEquipmentCategoryDto
.
getUSE_PLACE
();
// 详细地址
String
address
=
esEquipmentCategoryDto
.
getADDRESS
();
return
String
.
format
(
"%s%s"
,
usePlace
,
address
);
return
String
.
format
(
"%s%s"
,
usePlace
,
address
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
e8b7dc41
...
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
...
...
@@ -39,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -504,4 +506,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
String
group
=
getPersonIdentityByType
(
selectedOrgInfo
.
getCompany
().
getCompanyType
());
return
JyjcInspectionApplicationServiceImpl
.
getDictionarieModels
(
group
);
}
@Async
public
void
updatePlanCreateDateByAppNo
(
String
appNo
)
{
LambdaUpdateWrapper
<
JyjcInspectionResult
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JyjcInspectionResult:
:
getApplicationNo
,
appNo
);
updateWrapper
.
set
(
JyjcInspectionResult:
:
getPlanCreateDate
,
new
Date
());
this
.
update
(
updateWrapper
);
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/ITzBaseEnterpriseInfoService.java
View file @
e8b7dc41
...
...
@@ -48,4 +48,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI
String
setLabel
(
List
<
Long
>
enterpriseIds
,
List
<
String
>
enterpriseLabels
);
BaseUnitLicence
getUnitLicenceMessage
(
String
unitCode
);
Map
<
String
,
Object
>
getInfoByUseCodeMap
(
String
useCode
);
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzBaseEnterpriseInfoController.java
View file @
e8b7dc41
...
...
@@ -200,6 +200,13 @@ public class TzBaseEnterpriseInfoController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfoByUseCode/map"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据统一信用代码查询企业详情返回map"
,
notes
=
"根据统一信用代码查询企业详情返回map"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getInfoByUseCodeMap
(
String
useCode
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfoByUseCodeMap
(
useCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfoByUseCodeList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据统一信用代码查询企业详情"
,
notes
=
"根据统一信用代码查询企业详情"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
getInfoByUseCodeList
(
String
useCode
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
e8b7dc41
...
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
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.service.impl.DataDictionaryServiceImpl
;
...
...
@@ -237,6 +238,44 @@ public class TzBaseEnterpriseInfoServiceImpl
}
@Override
public
Map
<
String
,
Object
>
getInfoByUseCodeMap
(
String
useCode
)
{
TzBaseEnterpriseInfoDto
infoByUseCode
=
getInfoByUseCode
(
useCode
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
RegUnitIcDto
regUnitIcDto
=
infoByUseCode
.
getRegUnitIcDto
();
RegUnitInfoDto
regUnitInfoDto
=
infoByUseCode
.
getRegUnitInfoDto
();
TzsBaseInstitution
tzsBaseInstitution
=
infoByUseCode
.
getRegUnitMessage
();
Map
<
String
,
Object
>
regUnitIcDtoMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
regUnitInfoDtoMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
tzsBaseInstitutionMap
=
new
HashMap
<>();
try
{
resultMap
=
objectMapper
.
convertValue
(
infoByUseCode
,
Map
.
class
);
regUnitIcDtoMap
=
objectMapper
.
convertValue
(
regUnitIcDto
,
Map
.
class
);
regUnitInfoDtoMap
=
objectMapper
.
convertValue
(
regUnitInfoDto
,
Map
.
class
);
tzsBaseInstitutionMap
=
objectMapper
.
convertValue
(
tzsBaseInstitution
,
Map
.
class
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(!
ObjectUtils
.
isEmpty
(
regUnitIcDtoMap
)){
resultMap
.
putAll
(
regUnitIcDtoMap
);
}
if
(!
ObjectUtils
.
isEmpty
(
regUnitInfoDtoMap
)){
resultMap
.
putAll
(
regUnitInfoDtoMap
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsBaseInstitutionMap
)){
resultMap
.
putAll
(
tzsBaseInstitutionMap
);
}
resultMap
.
remove
(
"regUnitIcDto"
);
resultMap
.
remove
(
"regUnitInfoDto"
);
resultMap
.
remove
(
"tzsBaseInstitution"
);
return
resultMap
;
}
@Override
public
TzBaseEnterpriseInfoDto
getInfoByUseCode
(
String
useCode
)
{
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
"use_code"
,
useCode
));
...
...
@@ -869,4 +908,6 @@ public class TzBaseEnterpriseInfoServiceImpl
return
baseUnitLicenceService
.
getBaseMapper
().
selectOne
(
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