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
a19bf30b
Commit
a19bf30b
authored
May 08, 2024
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
aa2cf5f1
d59e8ca3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
7 deletions
+87
-7
TemporaryController.java
...s/boot/module/tcm/biz/controller/TemporaryController.java
+56
-0
TzsBaseInstitutionServiceImpl.java
...e/tcm/biz/service/impl/TzsBaseInstitutionServiceImpl.java
+9
-3
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+22
-4
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TemporaryController.java
0 → 100644
View file @
a19bf30b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.BaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.BaseUnitLicenceServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
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.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
@Api
(
tags
=
"临时api"
)
@RequestMapping
(
value
=
"/temporary"
)
public
class
TemporaryController
extends
BaseController
{
@Autowired
RegUnitInfoServiceImpl
regUnitInfoService
;
@Autowired
BaseUnitLicenceServiceImpl
baseUnitLicenceService
;
/**
* 刷新许可信息表中的发证机关code
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"刷新许可信息表中的发证机关code"
,
notes
=
"刷新许可信息表中的发证机关code"
)
@GetMapping
(
value
=
"/brushData"
)
public
ResponseModel
<
String
>
brushData
()
{
Map
<?,
?>
dictOfDJJGMap
=
regUnitInfoService
.
dictOfDJJG
();
// 许可信息
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
isNull
(
BaseUnitLicence:
:
getApprovedOrganCode
));
List
<
BaseUnitLicence
>
updatedLicenses
=
unitLicences
.
stream
().
peek
(
licence
->
{
String
approvedOrgan
=
licence
.
getApprovedOrgan
();
String
approvedOrganCode
=
(
String
)
dictOfDJJGMap
.
getOrDefault
(
approvedOrgan
,
null
);
licence
.
setApprovedOrganCode
(
approvedOrganCode
);
}).
collect
(
Collectors
.
toList
());
baseUnitLicenceService
.
saveOrUpdateBatch
(
updatedLicenses
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
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/TzsBaseInstitutionServiceImpl.java
View file @
a19bf30b
...
...
@@ -21,8 +21,10 @@ import org.apache.commons.lang3.ObjectUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
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
;
...
...
@@ -118,22 +120,26 @@ public class TzsBaseInstitutionServiceImpl extends BaseService<TzsBaseInstitutio
if
(!
ObjectUtils
.
isEmpty
(
regUnitInfo
.
getAdminTel
())){
regUnitInfo
.
setContactPersonTel
(
regUnitInfo
.
getAdminTel
());
}
if
(!
ValidationUtil
.
isEmpty
(
dto
.
getUnitLicences
())){
//添加不在字典中的登记机关
regUnitInfoService
.
addNotInDJJGDictionary
(
dto
.
getUnitLicences
());
}
regUnitInfoService
.
save
(
regUnitInfo
);
// 3.插入单位注册许可信息表:tz_base_unit_licence
Map
<?,
?>
dictOfDJJGMap
=
regUnitInfoService
.
dictOfDJJG
();
List
<
BaseUnitLicence
>
baseUnitLicences
=
dto
.
getUnitLicences
().
stream
().
map
(
s
->
{
s
.
setUnitCode
(
dto
.
getUnitCode
());
s
.
setUnitName
(
dto
.
getName
());
BaseUnitLicence
target
=
new
BaseUnitLicence
();
Bean
.
copyExistPropertis
(
s
,
target
);
target
.
setApprovedOrganCode
((
String
)
dictOfDJJGMap
.
get
(
target
.
getApprovedOrgan
()));
return
target
;
}).
collect
(
Collectors
.
toList
());
if
(!
baseUnitLicences
.
isEmpty
())
{
baseUnitLicenceService
.
saveOrUpdateBatch
(
baseUnitLicences
);
//添加不在字典中的登记机关
regUnitInfoService
.
addNotInDJJGDictionary
(
baseUnitLicences
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
"awds:"
+
e
.
getMessage
(),
e
);
try
{
// 失败后回滚:删除已经创建的企业信息
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAmosCompanySeq
()))
{
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
a19bf30b
...
...
@@ -185,24 +185,28 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
this
.
createCompanyAndUser
(
regUnitInfo
);
// 2.异步调用ugp,同步公司数据
FutureTask
<
ResponseModel
<
Boolean
>>
future
=
getResponseModelFutureTask
(
model
);
//添加不在字典中的登记机关
if
(!
ValidationUtil
.
isEmpty
(
model
.
getUnitLicences
())){
this
.
addNotInDJJGDictionary
(
model
.
getUnitLicences
());
}
// 3.插入单位注册许可信息表:tz_base_unit_licence
// 3.1先删除已有许可信息 (2024-04-02放开企业许可信息编辑功能)
LambdaQueryWrapper
<
BaseUnitLicence
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
BaseUnitLicence:
:
getUnitCode
,
model
.
getUnitCode
());
baseUnitLicenceService
.
remove
(
queryWrapper
);
// 3.2再插入新许可信息
Map
<?,
?>
dictOfDJJGMap
=
this
.
dictOfDJJG
();
List
<
BaseUnitLicence
>
baseUnitLicences
=
model
.
getUnitLicences
().
stream
().
map
(
s
->
{
s
.
setUnitCode
(
model
.
getUnitCode
());
s
.
setUnitName
(
model
.
getName
());
BaseUnitLicence
target
=
new
BaseUnitLicence
();
Bean
.
copyExistPropertis
(
s
,
target
);
target
.
setSequenceNbr
(
null
);
target
.
setApprovedOrganCode
((
String
)
dictOfDJJGMap
.
get
(
target
.
getApprovedOrgan
()));
return
target
;
}).
collect
(
Collectors
.
toList
());
if
(!
baseUnitLicences
.
isEmpty
())
{
baseUnitLicenceService
.
saveOrUpdateBatch
(
baseUnitLicences
);
//添加不在字典中的登记机关
this
.
addNotInDJJGDictionary
(
baseUnitLicences
);
}
// 4.插入工商单位信息表:tz_flc_reg_unit_ic
RegUnitIc
regUnitIc
=
new
RegUnitIc
();
...
...
@@ -262,12 +266,26 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
/**
* 获取登记机关的map
* @return map:key-》机关名称 value-》机关code
*/
public
Map
<?,
?>
dictOfDJJG
()
{
List
<
DataDictionary
>
allDictionaryList
=
this
.
initAllDataDictionaryList
();
return
allDictionaryList
.
stream
()
.
filter
(
d
->
DICT_TYPE_DJJG
.
equals
(
d
.
getType
()))
.
collect
(
Collectors
.
toMap
(
DataDictionary:
:
getName
,
DataDictionary:
:
getCode
,
(
code1
,
code2
)
->
code1
));
}
/**
* 添加不在字典中的登记机关
* @param baseUnitLicences baseUnitLicences
*/
public
void
addNotInDJJGDictionary
(
List
<
BaseUnitLicence
>
baseUnitLicences
)
{
public
void
addNotInDJJGDictionary
(
List
<
BaseUnitLicence
Dto
>
baseUnitLicences
)
{
List
<
String
>
approvedOrganList
=
baseUnitLicences
.
stream
()
.
map
(
BaseUnitLicence:
:
getApprovedOrgan
)
.
map
(
BaseUnitLicence
Dto
:
:
getApprovedOrgan
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
List
<
DataDictionary
>
allDictionaryList
=
this
.
initAllDataDictionaryList
();
...
...
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