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
50a721af
Commit
50a721af
authored
Dec 25, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更名变更API开发
业务补充
parent
c29b4da7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
16 deletions
+133
-16
JgChangeRegistrationNameMapper.java
.../module/jg/api/mapper/JgChangeRegistrationNameMapper.java
+2
-0
JgChangeRegistrationNameMapper.xml
.../main/resources/mapper/JgChangeRegistrationNameMapper.xml
+4
-0
JgChangeRegistrationNameServiceImpl.java
...biz/service/impl/JgChangeRegistrationNameServiceImpl.java
+127
-16
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/JgChangeRegistrationNameMapper.java
View file @
50a721af
...
...
@@ -22,5 +22,7 @@ public interface JgChangeRegistrationNameMapper extends BaseMapper<JgChangeRegis
void
deleteByChangeRegistrationId
(
@Param
(
"changeRegistrationId"
)
Long
changeRegistrationId
);
void
deleteHistoryInfoById
(
@Param
(
"code"
)
String
code
);
Page
<
Map
<
String
,
Object
>>
getListPage
(
Page
<
Map
<
String
,
Object
>>
page
,
JgChangeRegistrationNameDto
dto
,
List
<
String
>
roleIds
,
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationNameMapper.xml
View file @
50a721af
...
...
@@ -57,4 +57,8 @@
</where>
order by ur.rec_date desc
</select>
<delete
id=
"deleteHistoryInfoById"
>
delete from tzs_jg_change_registration_name_eq where current_document_id = #{code}
</delete>
</mapper>
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/JgChangeRegistrationNameServiceImpl.java
View file @
50a721af
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.fastjson.JSON
;
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.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.Jg
ScrapCancel
Dto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.Jg
ChangeRegistrationName
Dto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CancelTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.
JgChangeRegistrationNameMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.
*
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationNameService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationNameDto
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.
IdxBizJgRegister
Info
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.
TzBaseEnterprise
Info
;
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.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
...
...
@@ -31,6 +35,7 @@ import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -38,11 +43,10 @@ import org.springframework.util.StringUtils;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 更名变更登记服务实现类
...
...
@@ -57,6 +61,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
private
JgChangeRegistrationNameEqServiceImpl
jgChangeRegistrationNameEqService
;
@Autowired
private
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
...
...
@@ -68,6 +75,26 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
@Autowired
WorkFlowFeignService
workFlowFeignService
;
@Autowired
private
JgChangeRegistrationReformEqMapper
jgChangeRegistrationReformEqMapper
;
@Autowired
private
JgChangeRegistrationTransferEqMapper
jgChangeRegistrationTransferEqMapper
;
@Autowired
private
JgUseRegistrationEqMapper
jgUseRegistrationEqMapper
;
@Autowired
private
JgChangeRegistrationUnitEqMapper
jgChangeRegistrationUnitEqMapper
;
@Autowired
private
JgChangeRegistrationNameEqMapper
jgChangeRegistrationNameEqMapper
;
@Autowired
private
RegUnitInfoMapper
regUnitInfoMapper
;
@Autowired
private
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
@Autowired
AccessFeignService
accessFeignService
;
...
...
@@ -170,6 +197,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
this
.
save
(
dto
);
List
<
JgChangeRegistrationNameEq
>
equipList
=
new
ArrayList
<>();
List
<
JgRegistrationHistory
>
list
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgChangeRegistrationNameEq
jgRelationEquip
=
new
JgChangeRegistrationNameEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
...
...
@@ -183,11 +211,18 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
jgRegistrationHistory
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRegistrationHistory
.
setCreateDate
(
dto
.
getCreateDate
());
// jgRegistrationHistory.setUseRegistrationCode();
// jgRegistrationHistory.setRegistrationClass();
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
dto
));
jgRegistrationHistory
.
setOldData
(
JSON
.
toJSONString
(
dto
));
jgRegistrationHistory
.
setRegistrationClass
(
"使用单位名称变更登记"
);
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
jgRegistrationHistory
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"supervisoryCode"
)));
jgRegistrationHistory
.
setUseRegistrationCode
(
String
.
valueOf
(
obj
.
get
(
"useOrgCode"
)));
jgRegistrationHistory
.
setCurrentDocumentId
(
dto
.
getApplyNo
());
list
.
add
(
jgRegistrationHistory
);
});
jgChangeRegistrationNameEqService
.
saveBatch
(
equipList
);
jgRegistrationHistoryService
.
saveBatch
(
list
);
}
public
JgChangeRegistrationNameDto
updateInfo
(
String
submitType
,
JgChangeRegistrationNameDto
jgChangeRegistrationNameDto
,
String
op
)
{
...
...
@@ -223,10 +258,16 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
boolean
submit
=
submit
(
jgChangeRegistrationName
,
op
);
//删除重新生成 eq表数据
jgChangeRegistrationNameMapper
.
deleteByChangeRegistrationId
(
jgChangeRegistrationName
.
getSequenceNbr
());
if
(!
Objects
.
isNull
(
jgChangeRegistrationName
.
getSequenceNbr
()))
{
jgChangeRegistrationNameMapper
.
deleteByChangeRegistrationId
(
jgChangeRegistrationName
.
getSequenceNbr
());
}
if
(!
Objects
.
isNull
(
jgChangeRegistrationName
.
getApplyNo
()))
{
jgChangeRegistrationNameMapper
.
deleteHistoryInfoById
(
jgChangeRegistrationName
.
getApplyNo
());
}
List
<
Map
<
String
,
Object
>>
deviceList
=
jgChangeRegistrationNameMapper
.
getEquipInfoByOrgCode
(
reginParams
.
getCompany
().
getCompanyCode
());
List
<
Map
<
String
,
Object
>>
deviceList
=
jgChangeRegistrationNameMapper
.
getEquipInfoByOrgCode
(
reginParams
.
getCompany
().
getCompanyCode
());
List
<
JgRegistrationHistory
>
list
=
new
ArrayList
<>();
List
<
JgChangeRegistrationNameEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgChangeRegistrationNameEq
jgRelationEquip
=
new
JgChangeRegistrationNameEq
();
...
...
@@ -237,9 +278,23 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
jgRelationEquip
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRelationEquip
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
equipList
.
add
(
jgRelationEquip
);
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
jgRegistrationHistory
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRegistrationHistory
.
setCreateDate
(
jgChangeRegistrationName
.
getCreateDate
());
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
jgChangeRegistrationName
));
jgRegistrationHistory
.
setOldData
(
JSON
.
toJSONString
(
jgChangeRegistrationName
));
jgRegistrationHistory
.
setRegistrationClass
(
"使用单位名称变更登记"
);
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
jgRegistrationHistory
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"supervisoryCode"
)));
jgRegistrationHistory
.
setUseRegistrationCode
(
String
.
valueOf
(
obj
.
get
(
"useOrgCode"
)));
jgRegistrationHistory
.
setCurrentDocumentId
(
jgChangeRegistrationName
.
getApplyNo
());
list
.
add
(
jgRegistrationHistory
);
});
jgChangeRegistrationNameEqService
.
saveBatch
(
equipList
);
jgRegistrationHistoryService
.
saveBatch
(
list
);
if
(
submit
)
{
// 查询下节点任务
getNext
(
roleListSecond
,
jgChangeRegistrationName
.
getInstanceId
(),
taskName
);
...
...
@@ -332,8 +387,6 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
public
void
revocation
(
String
instanceId
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
...
...
@@ -441,14 +494,72 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
jgChangeRegistrationName
.
setPromoter
(
null
);
}
}
else
{
// TODO: 2023/12/25 流程完成后业务开发
jgChangeRegistrationName
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgChangeRegistrationName
.
setAuditPassDate
(
new
Date
());
// 修改业务信息
updateInfoOther
(
jgChangeRegistrationName
);
}
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationName
);
}
public
void
updateInfoOther
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
LambdaQueryWrapper
<
JgChangeRegistrationNameEq
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
JgChangeRegistrationNameEq:
:
getNameChangeRegistrationId
,
jgChangeRegistrationName
.
getSequenceNbr
());
List
<
String
>
collect
=
jgChangeRegistrationNameEqService
.
list
(
wrapper
).
stream
().
map
(
JgChangeRegistrationNameEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isNotEmpty
(
collect
))
{
LambdaUpdateWrapper
<
JgChangeRegistrationReformEq
>
updateWrapper1
=
new
LambdaUpdateWrapper
<>();
updateWrapper1
.
in
(
JgChangeRegistrationReformEq:
:
getEquId
,
collect
);
updateWrapper1
.
ne
(
JgChangeRegistrationReformEq:
:
getEquipTransferId
,
jgChangeRegistrationName
.
getSequenceNbr
());
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
new
JgChangeRegistrationReformEq
();
jgChangeRegistrationReformEq
.
setIsInvalid
(
Boolean
.
TRUE
);
jgChangeRegistrationReformEqMapper
.
update
(
jgChangeRegistrationReformEq
,
updateWrapper1
);
LambdaUpdateWrapper
<
JgChangeRegistrationTransferEq
>
updateWrapper2
=
new
LambdaUpdateWrapper
<>();
updateWrapper2
.
in
(
JgChangeRegistrationTransferEq:
:
getEquId
,
collect
);
updateWrapper2
.
ne
(
JgChangeRegistrationTransferEq:
:
getEquipTransferId
,
jgChangeRegistrationName
.
getSequenceNbr
());
JgChangeRegistrationTransferEq
jgChangeRegistrationTransferEq
=
new
JgChangeRegistrationTransferEq
();
jgChangeRegistrationReformEq
.
setIsInvalid
(
Boolean
.
TRUE
);
jgChangeRegistrationTransferEqMapper
.
update
(
jgChangeRegistrationTransferEq
,
updateWrapper2
);
LambdaUpdateWrapper
<
JgUseRegistrationEq
>
updateWrapper3
=
new
LambdaUpdateWrapper
<>();
updateWrapper3
.
in
(
JgUseRegistrationEq:
:
getEquId
,
collect
);
updateWrapper3
.
ne
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgChangeRegistrationName
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setIsInvalid
(
Boolean
.
TRUE
);
jgUseRegistrationEqMapper
.
update
(
jgUseRegistrationEq
,
updateWrapper3
);
LambdaUpdateWrapper
<
JgChangeRegistrationUnitEq
>
updateWrapper4
=
new
LambdaUpdateWrapper
<>();
updateWrapper4
.
in
(
JgChangeRegistrationUnitEq:
:
getEquId
,
collect
);
updateWrapper4
.
ne
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
jgChangeRegistrationName
.
getSequenceNbr
());
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
=
new
JgChangeRegistrationUnitEq
();
jgChangeRegistrationUnitEq
.
setIsInvalid
(
"1"
);
jgChangeRegistrationUnitEqMapper
.
update
(
jgChangeRegistrationUnitEq
,
updateWrapper4
);
LambdaUpdateWrapper
<
JgChangeRegistrationNameEq
>
updateWrapper5
=
new
LambdaUpdateWrapper
<>();
updateWrapper5
.
in
(
JgChangeRegistrationNameEq:
:
getEquId
,
collect
);
updateWrapper5
.
ne
(
JgChangeRegistrationNameEq:
:
getNameChangeRegistrationId
,
jgChangeRegistrationName
.
getSequenceNbr
());
JgChangeRegistrationNameEq
jgChangeRegistrationNameEq
=
new
JgChangeRegistrationNameEq
();
jgChangeRegistrationNameEq
.
setIsInvalid
(
"1"
);
jgChangeRegistrationNameEqMapper
.
update
(
jgChangeRegistrationNameEq
,
updateWrapper5
);
}
LambdaUpdateWrapper
<
RegUnitInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
RegUnitInfo:
:
getUnitCode
,
jgChangeRegistrationName
.
getUseUnitCreditCode
());
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
regUnitInfo
.
setName
(
jgChangeRegistrationName
.
getNewUseUnitName
());
regUnitInfoMapper
.
update
(
regUnitInfo
,
updateWrapper
);
LambdaUpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper2
=
new
LambdaUpdateWrapper
<>();
updateWrapper2
.
eq
(
TzBaseEnterpriseInfo:
:
getUseCode
,
jgChangeRegistrationName
.
getUseUnitCreditCode
());
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
=
new
TzBaseEnterpriseInfo
();
regUnitInfo
.
setName
(
jgChangeRegistrationName
.
getNewUseUnitName
());
tzBaseEnterpriseInfoMapper
.
update
(
tzBaseEnterpriseInfo
,
updateWrapper2
);
// TODO: 2023/12/25 修改平台机构名称
}
public
Map
<
String
,
Object
>
queryBySequenceNbr
(
Long
sequenceNbr
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// Map<String, Object> resultMap = accessFeignService.getData(reginParams.getCompany().getCompanyCode()).getResult();
...
...
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