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
74f3fafe
Commit
74f3fafe
authored
Sep 01, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人主体注册相关功能
parent
b2d5ff73
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
335 additions
and
33 deletions
+335
-33
BizCommonConstant.java
...in/amos/boot/module/tcm/api/common/BizCommonConstant.java
+5
-0
BasePersonRegisterDto.java
...n/amos/boot/module/tcm/api/dto/BasePersonRegisterDto.java
+98
-0
ITzsBaseIndividualityService.java
.../module/tcm/api/service/ITzsBaseIndividualityService.java
+3
-0
RegUnitInfoDto.java
...join/amos/boot/module/tcm/flc/api/dto/RegUnitInfoDto.java
+7
-0
IRegUnitInfoService.java
.../boot/module/tcm/flc/api/service/IRegUnitInfoService.java
+4
-2
AmosTcmApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
+5
-0
TzsBaseIndividualityController.java
...le/tcm/biz/controller/TzsBaseIndividualityController.java
+18
-1
TzsBaseInstitutionController.java
...dule/tcm/biz/controller/TzsBaseInstitutionController.java
+1
-1
TzsBaseIndividualityServiceImpl.java
...tcm/biz/service/impl/TzsBaseIndividualityServiceImpl.java
+94
-7
TzsBaseInstitutionServiceImpl.java
...e/tcm/biz/service/impl/TzsBaseInstitutionServiceImpl.java
+1
-1
RegUnitInfoController.java
.../module/tcm/flc/biz/controller/RegUnitInfoController.java
+17
-3
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+82
-18
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/common/BizCommonConstant.java
View file @
74f3fafe
...
@@ -24,6 +24,11 @@ public interface BizCommonConstant {
...
@@ -24,6 +24,11 @@ public interface BizCommonConstant {
String
UNIT_TYPE_LIST_REDIS_KEY
=
"UNIT_TYPE_LIST_REDIS_KEY"
;
String
UNIT_TYPE_LIST_REDIS_KEY
=
"UNIT_TYPE_LIST_REDIS_KEY"
;
/**
/**
* 企业类型数据redisKey
*/
String
PERSON_REGISTER_TYPE_LIST_REDIS_KEY
=
"PERSON_REGISTER_TYPE_LIST_REDIS_KEY"
;
/**
* 所有字典缓存
* 所有字典缓存
*/
*/
String
TCM_ALL_DATA_DICT_REDIS_KEY
=
"TCM_ALL_DATA_DICT_REDIS_KEY"
;
String
TCM_ALL_DATA_DICT_REDIS_KEY
=
"TCM_ALL_DATA_DICT_REDIS_KEY"
;
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/dto/BasePersonRegisterDto.java
0 → 100644
View file @
74f3fafe
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 事业单位注册
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BasePersonRegisterDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
credentialsType
;
@ApiModelProperty
(
value
=
"证件号码"
)
private
String
credentialsNum
;
@ApiModelProperty
(
value
=
"真实姓名"
)
private
String
realName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"有效期开始"
)
private
Date
expirationDateStart
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"有效期结束"
)
private
Date
expirationDateEnd
;
@ApiModelProperty
(
value
=
"有效期类型"
)
private
String
expirationDateType
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"证件code"
)
private
String
unitCode
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
unitCodeType
;
@ApiModelProperty
(
value
=
"证件类型名称"
)
private
String
unitCodeTypeName
;
@ApiModelProperty
(
value
=
"单位类型"
)
private
List
<
String
>
unitTypeList
;
@ApiModelProperty
(
value
=
"单位类型code"
)
private
List
<
String
>
unitTypeCodeList
;
@ApiModelProperty
(
value
=
"管辖机构"
)
private
String
managementUnit
;
@ApiModelProperty
(
value
=
"管辖单位id"
)
private
String
managementUnitId
;
@ApiModelProperty
(
value
=
"管辖单位编码"
)
private
String
managementUnitCompanyCode
;
@ApiModelProperty
(
value
=
"管辖单位orgCode"
)
private
String
managementUnitOrgCode
;
@ApiModelProperty
(
value
=
"管理员用户名"
)
private
String
adminLoginName
;
@ApiModelProperty
(
value
=
"管理员密码"
)
private
String
adminLoginPwd
;
@ApiModelProperty
(
value
=
"管理员手机号"
)
private
String
adminTel
;
@ApiModelProperty
(
value
=
"管理员身份证号"
)
private
String
adminIdNumber
;
// @ApiModelProperty(value = "个人基本信息")
// private TzsBaseIndividualityDto baseIndividualityDto;
@ApiModelProperty
(
value
=
"平台公司id,平台创建公司后更新"
)
private
String
amosCompanySeq
;
@ApiModelProperty
(
value
=
"平台用户id,平台创建用户后更新"
)
private
String
adminUserId
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/ITzsBaseIndividualityService.java
View file @
74f3fafe
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
service
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BasePersonRegisterDto
;
/**
/**
* 接口类
* 接口类
*
*
...
@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
...
@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
*/
*/
public
interface
ITzsBaseIndividualityService
{
public
interface
ITzsBaseIndividualityService
{
void
personRegister
(
BasePersonRegisterDto
dto
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/api/dto/RegUnitInfoDto.java
View file @
74f3fafe
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -124,6 +125,9 @@ public class RegUnitInfoDto extends BaseDto {
...
@@ -124,6 +125,9 @@ public class RegUnitInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"工商信息"
)
@ApiModelProperty
(
value
=
"工商信息"
)
private
RegUnitIcDto
regUnitIc
;
private
RegUnitIcDto
regUnitIc
;
@ApiModelProperty
(
value
=
"事业单位信息"
)
private
TzsBaseInstitutionDto
regUnitMessage
;
@ApiModelProperty
(
value
=
"行政许可"
)
@ApiModelProperty
(
value
=
"行政许可"
)
private
List
<
BaseUnitLicenceDto
>
unitLicences
=
new
ArrayList
<>();
private
List
<
BaseUnitLicenceDto
>
unitLicences
=
new
ArrayList
<>();
...
@@ -135,4 +139,7 @@ public class RegUnitInfoDto extends BaseDto {
...
@@ -135,4 +139,7 @@ public class RegUnitInfoDto extends BaseDto {
private
String
adminUserId
;
private
String
adminUserId
;
JSONObject
form
;
JSONObject
form
;
@ApiModelProperty
(
value
=
"注册类型"
)
private
String
registerType
;
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/api/service/IRegUnitInfoService.java
View file @
74f3fafe
...
@@ -29,10 +29,9 @@ public interface IRegUnitInfoService {
...
@@ -29,10 +29,9 @@ public interface IRegUnitInfoService {
/**
/**
* 单位校验
* 单位校验
* @param unitCode 单位唯一编号
* @param unitCode 单位唯一编号
* @param unitType 单位类型
* @return RegUnitInfoDto
* @return RegUnitInfoDto
*/
*/
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
,
String
companyName
,
String
registerType
,
String
cardType
);
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
companyName
,
String
registerType
,
String
cardType
);
/**
/**
* 单位类型列表字典
* 单位类型列表字典
...
@@ -40,6 +39,8 @@ public interface IRegUnitInfoService {
...
@@ -40,6 +39,8 @@ public interface IRegUnitInfoService {
*/
*/
List
<
DataDictionary
>
getUnitTypeList
();
List
<
DataDictionary
>
getUnitTypeList
();
List
<
DataDictionary
>
getPersonTypeList
();
/**
/**
* 获取管辖机构树
* 获取管辖机构树
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
...
@@ -80,4 +81,5 @@ public interface IRegUnitInfoService {
...
@@ -80,4 +81,5 @@ public interface IRegUnitInfoService {
void
setAllDataDictionaryList
();
void
setAllDataDictionaryList
();
List
<
Menu
>
getDictionaryWithTreeFillId
(
String
type
)
throws
Exception
;
List
<
Menu
>
getDictionaryWithTreeFillId
(
String
type
)
throws
Exception
;
List
<
DataDictionary
>
getDictionaryListByType
(
String
type
)
throws
Exception
;
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
View file @
74f3fafe
...
@@ -148,6 +148,11 @@ public class AmosTcmApplication {
...
@@ -148,6 +148,11 @@ public class AmosTcmApplication {
redisUtil
.
del
(
BizCommonConstant
.
UNIT_TYPE_LIST_REDIS_KEY
);
redisUtil
.
del
(
BizCommonConstant
.
UNIT_TYPE_LIST_REDIS_KEY
);
//5.2再初始化
//5.2再初始化
regUnitInfoService
.
setAndGetUnitTypeList
();
regUnitInfoService
.
setAndGetUnitTypeList
();
//5.企业类型放redis缓存(依赖1)
//5.1先删除缓存
redisUtil
.
del
(
BizCommonConstant
.
PERSON_REGISTER_TYPE_LIST_REDIS_KEY
);
//5.2再初始化
regUnitInfoService
.
getPersonTypeList
();
//6.许可项目放redis缓存
//6.许可项目放redis缓存
//6.1先删除缓存
//6.1先删除缓存
redisUtil
.
del
(
BizCommonConstant
.
TCM_ALL_DATA_DICT_REDIS_KEY
);
redisUtil
.
del
(
BizCommonConstant
.
TCM_ALL_DATA_DICT_REDIS_KEY
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsBaseIndividualityController.java
View file @
74f3fafe
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
controller
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BaseInstitutionRegisterDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BasePersonRegisterDto
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsBaseIndividualityService
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -25,11 +29,13 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
...
@@ -25,11 +29,13 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"Api"
)
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/
tzs-
base-individuality"
)
@RequestMapping
(
value
=
"/base-individuality"
)
public
class
TzsBaseIndividualityController
extends
BaseController
{
public
class
TzsBaseIndividualityController
extends
BaseController
{
@Autowired
@Autowired
TzsBaseIndividualityServiceImpl
tzsBaseIndividualityServiceImpl
;
TzsBaseIndividualityServiceImpl
tzsBaseIndividualityServiceImpl
;
@Autowired
ITzsBaseIndividualityService
tzsBaseIndividualityService
;
/**
/**
* 新增
* 新增
...
@@ -113,4 +119,15 @@ public class TzsBaseIndividualityController extends BaseController {
...
@@ -113,4 +119,15 @@ public class TzsBaseIndividualityController extends BaseController {
public
ResponseModel
<
List
<
TzsBaseIndividualityDto
>>
selectForList
()
{
public
ResponseModel
<
List
<
TzsBaseIndividualityDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
tzsBaseIndividualityServiceImpl
.
queryForTzsBaseIndividualityList
());
return
ResponseHelper
.
buildResponse
(
tzsBaseIndividualityServiceImpl
.
queryForTzsBaseIndividualityList
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/person/register"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"事业单位注册"
,
notes
=
"事业单位注册"
)
public
ResponseModel
<
Object
>
personRegister
(
@RequestBody
BasePersonRegisterDto
dto
)
{
tzsBaseIndividualityService
.
personRegister
(
dto
);
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/controller/TzsBaseInstitutionController.java
View file @
74f3fafe
...
@@ -26,7 +26,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
...
@@ -26,7 +26,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
*/
*/
@RestController
@RestController
@Api
(
tags
=
"Api"
)
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/
tzs-
base-institution"
)
@RequestMapping
(
value
=
"/base-institution"
)
public
class
TzsBaseInstitutionController
extends
BaseController
{
public
class
TzsBaseInstitutionController
extends
BaseController
{
@Autowired
@Autowired
...
...
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/TzsBaseIndividualityServiceImpl.java
View file @
74f3fafe
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.AccountDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BasePersonRegisterDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseIndividualityDto
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsBaseIndividuality
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsBaseIndividuality
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseIndividualityMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.TzsBaseIndividualityMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsBaseIndividualityService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsBaseIndividualityService
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseIndividualityDto
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.dto.RegUnitInfoDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -15,19 +31,89 @@ import java.util.List;
...
@@ -15,19 +31,89 @@ import java.util.List;
* @author system_generator
* @author system_generator
* @date 2023-08-31
* @date 2023-08-31
*/
*/
@Slf4j
@Service
@Service
public
class
TzsBaseIndividualityServiceImpl
extends
BaseService
<
TzsBaseIndividualityDto
,
TzsBaseIndividuality
,
TzsBaseIndividualityMapper
>
implements
ITzsBaseIndividualityService
{
public
class
TzsBaseIndividualityServiceImpl
extends
BaseService
<
TzsBaseIndividualityDto
,
TzsBaseIndividuality
,
TzsBaseIndividualityMapper
>
implements
ITzsBaseIndividualityService
{
@Autowired
RegUnitInfoServiceImpl
regUnitInfoService
;
@Autowired
StartPlatformTokenService
startPlatformTokenService
;
/**
/**
* 分页查询
* 分页查询
*/
*/
public
Page
<
TzsBaseIndividualityDto
>
queryForTzsBaseIndividualityPage
(
Page
<
TzsBaseIndividualityDto
>
page
)
{
public
Page
<
TzsBaseIndividualityDto
>
queryForTzsBaseIndividualityPage
(
Page
<
TzsBaseIndividualityDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
TzsBaseIndividualityDto
>
queryForTzsBaseIndividualityList
()
{
public
List
<
TzsBaseIndividualityDto
>
queryForTzsBaseIndividualityList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
@Override
public
void
personRegister
(
BasePersonRegisterDto
dto
)
{
startPlatformTokenService
.
setRequestContext
();
dto
.
setName
(
dto
.
getRealName
());
dto
.
setUnitCode
(
dto
.
getCredentialsType
()
+
"_"
+
dto
.
getCredentialsNum
());
String
unitType
=
StringUtils
.
join
(
dto
.
getUnitTypeList
(),
","
);
String
unitTypeCode
=
StringUtils
.
join
(
dto
.
getUnitTypeCodeList
(),
","
);
CompanyModel
companyInfo
=
new
CompanyModel
();
companyInfo
.
setAgencyCode
(
"tzs"
);
companyInfo
.
setParentId
(
Long
.
parseLong
(
dto
.
getManagementUnitId
()));
companyInfo
.
setLevel
(
"company"
);
companyInfo
.
setCompanyName
(
dto
.
getCredentialsNum
());
companyInfo
.
setCompanyCode
(
dto
.
getUnitCode
());
companyInfo
.
setCompanyType
(
unitType
);
try
{
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
create
(
companyInfo
);
if
(
companyResult
==
null
||
companyResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"平台单位注册失败"
);
}
CompanyModel
company
=
companyResult
.
getResult
();
dto
.
setAmosCompanySeq
(
company
.
getSequenceNbr
().
toString
());
AccountDto
accountDto
=
new
AccountDto
();
accountDto
.
setCompanyId
(
company
.
getSequenceNbr
());
accountDto
.
setUnitTypeCode
(
unitTypeCode
);
accountDto
.
setAdminTel
(
dto
.
getAdminTel
());
accountDto
.
setPwd
(
dto
.
getAdminLoginPwd
());
accountDto
.
setLoginName
(
dto
.
getAdminLoginName
());
accountDto
.
setAdminUserName
(
dto
.
getRealName
());
AgencyUserModel
user
=
regUnitInfoService
.
createUser
(
accountDto
,
EnterpriseEnums
.
GR_ZT
.
getType
());
dto
.
setAdminUserId
(
user
.
getUserId
());
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
BeanUtils
.
copyProperties
(
dto
,
regUnitInfoDto
);
TzBaseEnterpriseInfo
baseEnterpriseInfo
=
regUnitInfoService
.
createBaseEnterpriseInfo
(
regUnitInfoDto
,
EnterpriseEnums
.
GR_ZT
.
getType
());
TzsBaseIndividuality
tzsBaseIndividuality
=
new
TzsBaseIndividuality
();
BeanUtils
.
copyProperties
(
dto
,
tzsBaseIndividuality
);
tzsBaseIndividuality
.
setEnterpriseId
(
baseEnterpriseInfo
.
getSequenceNbr
());
this
.
save
(
tzsBaseIndividuality
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
try
{
// 失败后回滚:删除已经创建的企业信息
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAmosCompanySeq
()))
{
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
dto
.
getAmosCompanySeq
()));
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
companyClient
.
deleteCompany
(
dto
.
getAmosCompanySeq
());
}
}
// 失败后回滚:删除已经创建的管理员账号
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAdminUserId
()))
{
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
dto
.
getAdminUserId
());
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
dto
.
getAdminUserId
());
}
}
}
catch
(
Exception
rollbackException
)
{
log
.
error
(
"回滚操作发生异常: {}"
,
rollbackException
.
getMessage
(),
rollbackException
);
}
throw
new
RuntimeException
(
"个体单位注册失败: "
+
e
.
getMessage
()
+
" 请联系管理员!"
);
}
}
}
}
}
\ No newline at end of file
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 @
74f3fafe
...
@@ -102,7 +102,7 @@ public class TzsBaseInstitutionServiceImpl extends BaseService<TzsBaseInstitutio
...
@@ -102,7 +102,7 @@ public class TzsBaseInstitutionServiceImpl extends BaseService<TzsBaseInstitutio
accountDto
.
setPwd
(
dto
.
getAdminLoginPwd
());
accountDto
.
setPwd
(
dto
.
getAdminLoginPwd
());
accountDto
.
setLoginName
(
dto
.
getAdminLoginName
());
accountDto
.
setLoginName
(
dto
.
getAdminLoginName
());
accountDto
.
setAdminUserName
(
dto
.
getAdminName
());
accountDto
.
setAdminUserName
(
dto
.
getAdminName
());
AgencyUserModel
user
=
regUnitInfoService
.
createUser
(
accountDto
);
AgencyUserModel
user
=
regUnitInfoService
.
createUser
(
accountDto
,
null
);
dto
.
setAdminUserId
(
user
.
getUserId
());
dto
.
setAdminUserId
(
user
.
getUserId
());
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
BeanUtils
.
copyProperties
(
dto
,
regUnitInfoDto
);
BeanUtils
.
copyProperties
(
dto
,
regUnitInfoDto
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/controller/RegUnitInfoController.java
View file @
74f3fafe
...
@@ -114,15 +114,14 @@ public class RegUnitInfoController extends BaseController {
...
@@ -114,15 +114,14 @@ public class RegUnitInfoController extends BaseController {
@GetMapping
(
value
=
"/{unitCode}/check"
)
@GetMapping
(
value
=
"/{unitCode}/check"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位注册校验"
,
notes
=
"单位注册校验"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位注册校验"
,
notes
=
"单位注册校验"
)
public
ResponseModel
<
RegUnitInfoDto
>
unitCheck
(
@PathVariable
String
unitCode
,
public
ResponseModel
<
RegUnitInfoDto
>
unitCheck
(
@PathVariable
String
unitCode
,
@RequestParam
String
unitType
,
@RequestParam
(
required
=
false
)
String
registerType
,
@RequestParam
String
registerType
,
@RequestParam
(
required
=
false
)
String
cardType
,
@RequestParam
(
required
=
false
)
String
cardType
,
@RequestParam
(
required
=
false
)
String
companyName
)
{
@RequestParam
(
required
=
false
)
String
companyName
)
{
if
(
ValidationUtil
.
isEmpty
(
unitCode
))
{
if
(
ValidationUtil
.
isEmpty
(
unitCode
))
{
throw
new
BadRequest
(
"注册编码不能为空"
);
throw
new
BadRequest
(
"注册编码不能为空"
);
}
}
try
{
try
{
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
,
companyName
,
registerType
,
cardType
);
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
companyName
,
registerType
,
cardType
);
return
ResponseHelper
.
buildResponse
(
regUnitInfoDto
);
return
ResponseHelper
.
buildResponse
(
regUnitInfoDto
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
ResponseModel
<
RegUnitInfoDto
>
response
=
new
ResponseModel
<>();
ResponseModel
<
RegUnitInfoDto
>
response
=
new
ResponseModel
<>();
...
@@ -144,6 +143,14 @@ public class RegUnitInfoController extends BaseController {
...
@@ -144,6 +143,14 @@ public class RegUnitInfoController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/person-type/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位类型列表"
,
notes
=
"单位类型列表"
)
public
ResponseModel
<
List
<
DataDictionary
>>
personTypeList
()
{
List
<
DataDictionary
>
result
=
iRegUnitInfoService
.
getPersonTypeList
();
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/child-list"
)
@GetMapping
(
value
=
"/child-list"
)
...
@@ -161,6 +168,13 @@ public class RegUnitInfoController extends BaseController {
...
@@ -161,6 +168,13 @@ public class RegUnitInfoController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iRegUnitInfoService
.
getDictionaryWithTreeFillId
(
type
));
return
ResponseHelper
.
buildResponse
(
iRegUnitInfoService
.
getDictionaryWithTreeFillId
(
type
));
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/dataDictionaryListByType"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典"
,
notes
=
"根据字典类型查询字典"
)
public
ResponseModel
<
List
<
DataDictionary
>>
getDictionaryListByType
(
@RequestParam
String
type
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iRegUnitInfoService
.
getDictionaryListByType
(
type
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/management-unit/tree"
)
@GetMapping
(
value
=
"/management-unit/tree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管辖机构树"
,
notes
=
"管辖机构树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管辖机构树"
,
notes
=
"管辖机构树"
)
...
...
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 @
74f3fafe
This diff is collapsed.
Click to expand it.
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