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
2cd7f6d9
Commit
2cd7f6d9
authored
Aug 10, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.单位注册
parent
c7ff5f91
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1681 additions
and
1 deletion
+1681
-1
DataDictionary.java
...m/yeejoin/amos/boot/biz/common/entity/DataDictionary.java
+0
-1
MyBatisPlusCodeGeneratorTzs.java
...os/boot/biz/common/utils/MyBatisPlusCodeGeneratorTzs.java
+305
-0
BaseUnitLicenceDto.java
...join/amos/boot/module/tzs/api/dto/BaseUnitLicenceDto.java
+72
-0
BaseUnitLicence.java
...join/amos/boot/module/tzs/api/entity/BaseUnitLicence.java
+121
-0
BaseUnitLicenceMapper.java
...mos/boot/module/tzs/api/mapper/BaseUnitLicenceMapper.java
+14
-0
IBaseUnitLicenceService.java
.../boot/module/tzs/api/service/IBaseUnitLicenceService.java
+12
-0
RegUnitIcDto.java
...eejoin/amos/boot/module/tzs/flc/api/dto/RegUnitIcDto.java
+42
-0
RegUnitInfoDto.java
...join/amos/boot/module/tzs/flc/api/dto/RegUnitInfoDto.java
+117
-0
RegUnitIc.java
...eejoin/amos/boot/module/tzs/flc/api/entity/RegUnitIc.java
+62
-0
RegUnitInfo.java
...join/amos/boot/module/tzs/flc/api/entity/RegUnitInfo.java
+189
-0
UnitReviewStateEnum.java
...os/boot/module/tzs/flc/api/enums/UnitReviewStateEnum.java
+29
-0
RegUnitIcMapper.java
.../amos/boot/module/tzs/flc/api/mapper/RegUnitIcMapper.java
+14
-0
RegUnitInfoMapper.java
...mos/boot/module/tzs/flc/api/mapper/RegUnitInfoMapper.java
+14
-0
IRegUnitIcService.java
...os/boot/module/tzs/flc/api/service/IRegUnitIcService.java
+12
-0
IRegUnitInfoService.java
.../boot/module/tzs/flc/api/service/IRegUnitInfoService.java
+46
-0
BaseUnitLicenceMapper.xml
...s-api/src/main/resources/mapper/BaseUnitLicenceMapper.xml
+5
-0
RegUnitIcMapper.xml
...ule-tzs-api/src/main/resources/mapper/RegUnitIcMapper.xml
+5
-0
RegUnitInfoMapper.xml
...e-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
+5
-0
BaseUnitLicenceController.java
.../module/tzs/biz/controller/BaseUnitLicenceController.java
+45
-0
BaseUnitLicenceServiceImpl.java
...dule/tzs/biz/service/impl/BaseUnitLicenceServiceImpl.java
+35
-0
RegUnitIcController.java
...ot/module/tzs/flc/biz/controller/RegUnitIcController.java
+116
-0
RegUnitInfoController.java
.../module/tzs/flc/biz/controller/RegUnitInfoController.java
+153
-0
RegUnitIcServiceImpl.java
...module/tzs/flc/biz/service/impl/RegUnitIcServiceImpl.java
+35
-0
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+233
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/entity/DataDictionary.java
View file @
2cd7f6d9
...
@@ -40,7 +40,6 @@ public class DataDictionary extends BaseEntity {
...
@@ -40,7 +40,6 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty
(
value
=
"类型说明"
)
@ApiModelProperty
(
value
=
"类型说明"
)
private
String
typeDesc
;
private
String
typeDesc
;
//新加排序字段
@ApiModelProperty
(
value
=
"排序字段"
)
@ApiModelProperty
(
value
=
"排序字段"
)
private
int
sortNum
;
private
int
sortNum
;
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/MyBatisPlusCodeGeneratorTzs.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
;
import
com.baomidou.mybatisplus.core.exceptions.MybatisPlusException
;
import
com.baomidou.mybatisplus.core.toolkit.StringPool
;
import
com.baomidou.mybatisplus.generator.AutoGenerator
;
import
com.baomidou.mybatisplus.generator.InjectionConfig
;
import
com.baomidou.mybatisplus.generator.config.*
;
import
com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert
;
import
com.baomidou.mybatisplus.generator.config.po.TableInfo
;
import
com.baomidou.mybatisplus.generator.config.rules.DbColumnType
;
import
com.baomidou.mybatisplus.generator.config.rules.IColumnType
;
import
com.baomidou.mybatisplus.generator.config.rules.NamingStrategy
;
import
com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
/**
* @author DELL
*/
public
class
MyBatisPlusCodeGeneratorTzs
{
/**
* 项目名称缩写
*/
static
String
projectShortName
=
"tzs"
;
/**
* 项目api目录
*/
static
String
apiAddress
=
"/amos-boot-system-"
+
projectShortName
+
"/"
+
"amos-boot-module-"
+
projectShortName
+
"-api/"
;
/**
* 项目biz目录
*/
static
String
bizAddress
=
"/amos-boot-system-"
+
projectShortName
+
"/"
+
"amos-boot-module-"
+
projectShortName
+
"-biz/"
;
/**
* 项目api路径
*/
static
String
apiPath
=
apiAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
+
"/api"
;
/**
* 项目biz路径
*/
static
String
bizPath
=
bizAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
+
"/biz"
;
/**
* 接口及实体等代码生成路径
*/
static
String
interfaceCodeOutPath
=
System
.
getProperty
(
"user.dir"
).
replace
(
"\\amos-boot-biz-common"
,
"\\"
)
+
apiPath
;
/**
* 控制器及接口实现等代码生成路径
*/
static
String
controllerCodeOutPath
=
System
.
getProperty
(
"user.dir"
).
replace
(
"\\amos-boot-biz-common"
,
"\\"
)
+
bizPath
;
/**
* 读取控制台内容
*/
public
static
String
scanner
(
String
tip
)
{
Scanner
scanner
=
new
Scanner
(
System
.
in
);
StringBuilder
help
=
new
StringBuilder
();
help
.
append
(
"请输入"
+
tip
+
":"
);
System
.
out
.
println
(
help
.
toString
());
if
(
scanner
.
hasNext
())
{
String
ipt
=
scanner
.
next
();
if
(
StringUtils
.
isNotEmpty
(
ipt
))
{
return
ipt
;
}
}
throw
new
MybatisPlusException
(
"请输入正确的"
+
tip
+
"!"
);
}
public
static
void
main
(
String
[]
args
)
{
// 代码生成器
AutoGenerator
autoGenerator
=
new
AutoGenerator
();
// 全局配置
GlobalConfig
gc
=
new
GlobalConfig
();
// 工程路径-最外层
final
String
projectPath
=
System
.
getProperty
(
"user.dir"
).
replace
(
"\\amos-boot-biz-common"
,
"\\"
);
System
.
out
.
println
(
"projectPath:"
+
projectPath
);
// 代码输出目录
//gc.setOutputDir(codeOutPath);
// 作者
gc
.
setAuthor
(
"system_generator"
);
// 是否自动打开文件夹 建议开启
gc
.
setOpen
(
false
);
// 开启Swagger2 注解支持
gc
.
setSwagger2
(
true
);
// 注入autoGenerator
autoGenerator
.
setGlobalConfig
(
gc
);
gc
.
setActiveRecord
(
false
);
// 数据源配置
DataSourceConfig
dsc
=
new
DataSourceConfig
();
dsc
.
setUrl
(
"jdbc:mysql://172.16.10.90:53306/tzs_amos_tzs_biz?serverTimezone=GMT%2B8"
);
// dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.jdbc.Driver");
dsc
.
setDriverName
(
"com.mysql.cj.jdbc.Driver"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setPassword
(
"Yeejoin@2020"
);
dsc
.
setTypeConvert
(
new
ITypeConvert
()
{
@Override
public
IColumnType
processTypeConvert
(
GlobalConfig
globalConfig
,
String
fieldType
)
{
String
t
=
fieldType
.
toLowerCase
();
if
(
t
.
contains
(
"datetime"
))
{
return
DbColumnType
.
DATE
;
}
if
(
t
.
contains
(
"date"
))
{
return
DbColumnType
.
DATE
;
}
//其它字段采用默认转换(非mysql数据库可以使用其它默认的数据库转换器)
return
new
MySqlTypeConvert
().
processTypeConvert
(
globalConfig
,
fieldType
);
}
});
autoGenerator
.
setDataSource
(
dsc
);
// 包配置
final
PackageConfig
pc
=
new
PackageConfig
();
// 填写对应模块
pc
.
setModuleName
(
projectShortName
);
// 实体路径
pc
.
setParent
(
"com.yeejoin.amos.boot.module"
);
pc
.
setEntity
(
"api.entity"
);
pc
.
setMapper
(
"api.mapper"
);
pc
.
setService
(
"api.service"
);
pc
.
setServiceImpl
(
"biz.service.impl"
);
pc
.
setController
(
"biz.controller"
);
pc
.
setXml
(
"api.dto"
);
autoGenerator
.
setPackageInfo
(
pc
);
// 自定义配置
InjectionConfig
cfg
=
new
InjectionConfig
()
{
@Override
public
void
initMap
()
{
// to do nothing
}
};
// 如果模板引擎是 freemarker
String
controller
=
"/template/controller.java.ftl"
;
String
entity
=
"/template/bean.java.ftl"
;
String
mapper
=
"/template/mapper.java.ftl"
;
String
service
=
"/template/service.java.ftl"
;
String
serviceImpl
=
"/template/serviceImpl.java.ftl"
;
String
mapperXml
=
"/template/mapper.xml.ftl"
;
String
dto
=
"/template/dto.java.ftl"
;
String
vo
=
"/template/vo.java.ftl"
;
// 自定义配置会被优先输出
List
<
FileOutConfig
>
focList
=
new
ArrayList
<>();
focList
.
add
(
new
FileOutConfig
(
controller
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
controllerCodeOutPath
+
"/controller/"
+
tableInfo
.
getControllerName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"controller:"
+
filePath
);
return
filePath
;
}
});
focList
.
add
(
new
FileOutConfig
(
entity
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
+
"/entity/"
+
tableInfo
.
getEntityName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"entity:"
+
filePath
);
return
filePath
;
}
});
focList
.
add
(
new
FileOutConfig
(
dto
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
+
"/dto/"
+
tableInfo
.
getEntityName
()
+
"Dto"
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"dto:"
+
filePath
);
return
filePath
;
}
});
// focList.add(new FileOutConfig(vo) {
// @Override
// public String outputFile(TableInfo tableInfo) {
// String filePath = interfaceCodeOutPath
// + "/vo/" + tableInfo.getEntityName() + "Vo" + StringPool.DOT_JAVA;
// System.out.println("vo:"+filePath);
// return filePath;
// }
// });
focList
.
add
(
new
FileOutConfig
(
mapper
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
+
"/mapper/"
+
tableInfo
.
getEntityName
()
+
"Mapper"
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"mapper:"
+
filePath
);
return
filePath
;
}
});
focList
.
add
(
new
FileOutConfig
(
service
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
+
"/service/"
+
tableInfo
.
getServiceName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"service:"
+
filePath
);
return
filePath
;
}
});
focList
.
add
(
new
FileOutConfig
(
serviceImpl
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
controllerCodeOutPath
+
"/service/impl/"
+
tableInfo
.
getServiceImplName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"service/impl:"
+
filePath
);
return
filePath
;
}
});
// focList.add(new FileOutConfig(mapperXml) {
// @Override
// public String outputFile(TableInfo tableInfo) {
// // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
// return projectPath + projectName + "src/main/resources/mapper/" + pc.getModuleName()
// + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
// }
// });
focList
.
add
(
new
FileOutConfig
(
mapperXml
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
String
filePath
=
projectPath
+
apiAddress
+
"src/main/resources/mapper/"
+
tableInfo
.
getEntityName
()
+
"Mapper"
+
StringPool
.
DOT_XML
;
System
.
out
.
println
(
"mapper:"
+
filePath
);
return
filePath
;
}
});
/*
cfg.setFileCreate(new IFileCreate() {
@Override
public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
// 判断自定义文件夹是否需要创建
checkDir("调用默认方法创建的目录");
return false;
}
});
*/
cfg
.
setFileOutConfigList
(
focList
);
autoGenerator
.
setCfg
(
cfg
);
// 配置模板
TemplateConfig
templateConfig
=
new
TemplateConfig
();
// 配置自定义输出模板
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// templateConfig.setEntity("templates/entity2.java");
// templateConfig.setService();
// templateConfig.setController();
templateConfig
.
setXml
(
null
);
autoGenerator
.
setTemplate
(
templateConfig
);
// 策略配置
StrategyConfig
strategy
=
new
StrategyConfig
();
strategy
.
setNaming
(
NamingStrategy
.
underline_to_camel
);
strategy
.
setColumnNaming
(
NamingStrategy
.
underline_to_camel
);
strategy
.
setSuperEntityClass
(
"com.yeejoin.amos.boot.biz.common.entity.BaseEntity"
);
strategy
.
setEntityLombokModel
(
true
);
strategy
.
setRestControllerStyle
(
true
);
// 公共父类-开启将导致swagger无效化
//strategy.setSuperControllerClass("com.test.base.BaseController");
// 写于父类中的公共字段
strategy
.
setSuperEntityColumns
(
"sequence_nbr"
,
"rec_date"
,
"rec_user_id"
,
"rec_user_name"
,
"is_delete"
);
// 建议以后开启
strategy
.
setInclude
(
scanner
(
"表名,多个英文逗号分割"
).
split
(
","
));
strategy
.
setControllerMappingHyphenStyle
(
true
);
strategy
.
setTablePrefix
();
//去除表名前缀
//去除表名前缀
strategy
.
setTablePrefix
(
"t_"
,
"tb_"
,
"sys_"
,
"other_"
,
"rpm_"
,
"s_"
,
"tcb_"
,
"cb_"
,
"tz_"
,
"jc_"
,
"jcb_"
);
// 设置父级Controller
strategy
.
setSuperControllerClass
(
"com.yeejoin.amos.boot.biz.common.controller.BaseController"
);
autoGenerator
.
setStrategy
(
strategy
);
autoGenerator
.
setTemplateEngine
(
new
FreemarkerTemplateEngine
());
autoGenerator
.
execute
();
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/BaseUnitLicenceDto.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 单位注册许可信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"BaseUnitLicenceDto"
,
description
=
"单位注册许可信息表"
)
public
class
BaseUnitLicenceDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"单位编码"
)
private
String
unitCode
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"许可地址"
)
private
String
licAddress
;
@ApiModelProperty
(
value
=
"证书类型"
)
private
String
certType
;
@ApiModelProperty
(
value
=
"证书编号"
)
private
String
certNo
;
@ApiModelProperty
(
value
=
"有效期至"
)
private
Date
expiryDate
;
@ApiModelProperty
(
value
=
"发证日期"
)
private
Date
issueDate
;
@ApiModelProperty
(
value
=
"变更日期"
)
private
Date
changeDate
;
@ApiModelProperty
(
value
=
"许可评审方式"
)
private
String
applyType
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"许可项目/检验类型/设备品种编码"
)
private
String
itemCode
;
@ApiModelProperty
(
value
=
"许可项目/检验类型/设备品种"
)
private
String
itemCodeName
;
@ApiModelProperty
(
value
=
"许可子项目/检验项目/充装介质类别code"
)
private
String
subItemCode
;
@ApiModelProperty
(
value
=
"许可子项目/检验项目/充装介质类别"
)
private
String
subItemName
;
@ApiModelProperty
(
value
=
"许可参数/充装介质名称"
)
private
String
parameter
;
@ApiModelProperty
(
value
=
"固定检验地址"
)
private
String
itemAddress
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/BaseUnitLicence.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 单位注册许可信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz_base_unit_licence"
)
public
class
BaseUnitLicence
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 单位编码
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 单位名称
*/
@TableField
(
"unit_name"
)
private
String
unitName
;
/**
* 许可地址
*/
@TableField
(
"lic_address"
)
private
String
licAddress
;
/**
* 证书类型
*/
@TableField
(
"cert_type"
)
private
String
certType
;
/**
* 证书编号
*/
@TableField
(
"cert_no"
)
private
String
certNo
;
/**
* 有效期至
*/
@TableField
(
"expiry_date"
)
private
Date
expiryDate
;
/**
* 发证日期
*/
@TableField
(
"issue_date"
)
private
Date
issueDate
;
/**
* 变更日期
*/
@TableField
(
"change_date"
)
private
Date
changeDate
;
/**
* 许可评审方式
*/
@TableField
(
"apply_type"
)
private
String
applyType
;
/**
* 备注
*/
@TableField
(
"remark"
)
private
String
remark
;
/**
* 许可项目/检验类型/设备品种编码
*/
@TableField
(
"item_code"
)
private
String
itemCode
;
/**
* 许可项目/检验类型/设备品种
*/
@TableField
(
"item_code_name"
)
private
String
itemCodeName
;
/**
* 许可子项目/检验项目/充装介质类别code
*/
@TableField
(
"sub_item_code"
)
private
String
subItemCode
;
/**
* 许可子项目/检验项目/充装介质类别
*/
@TableField
(
"sub_item_name"
)
private
String
subItemName
;
/**
* 许可参数/充装介质名称
*/
@TableField
(
"parameter"
)
private
String
parameter
;
/**
* 固定检验地址
*/
@TableField
(
"item_address"
)
private
String
itemAddress
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/BaseUnitLicenceMapper.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 单位注册许可信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-09
*/
public
interface
BaseUnitLicenceMapper
extends
BaseMapper
<
BaseUnitLicence
>
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IBaseUnitLicenceService.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
/**
* 单位注册许可信息表接口类
*
* @author system_generator
* @date 2022-08-09
*/
public
interface
IBaseUnitLicenceService
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/RegUnitIcDto.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 注册单位工商信息表
*
* @author system_generator
* @date 2022-08-10
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"RegUnitIcDto"
,
description
=
"注册单位工商信息表"
)
public
class
RegUnitIcDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"证件code"
)
private
String
unitCode
;
@ApiModelProperty
(
value
=
"所属行业"
)
private
String
industryName
;
@ApiModelProperty
(
value
=
"登记机关"
)
private
String
registeredOrgan
;
@ApiModelProperty
(
value
=
"核准时间"
)
private
Date
approvedDate
;
@ApiModelProperty
(
value
=
"经验状态:在业、吊销、注销、迁入、迁出、停业、清算"
)
private
String
businessState
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/RegUnitInfoDto.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.List
;
/**
* 单位注册信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"RegUnitInfoDto"
,
description
=
"单位注册信息表"
)
public
class
RegUnitInfoDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"证件code"
)
private
String
unitCode
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
unitCodeType
;
@ApiModelProperty
(
value
=
"单位类型"
)
private
String
unitType
;
@ApiModelProperty
(
value
=
"单位类型code"
)
private
String
unitTypeCode
;
@ApiModelProperty
(
value
=
"管辖机构"
)
private
String
managementUnit
;
@ApiModelProperty
(
value
=
"管辖单位id"
)
private
String
managementUnitId
;
@ApiModelProperty
(
value
=
"区域编码"
)
private
String
regionCode
;
@ApiModelProperty
(
value
=
"国家"
)
private
String
country
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"县区"
)
private
String
district
;
@ApiModelProperty
(
value
=
"街道"
)
private
String
stree
;
@ApiModelProperty
(
value
=
"小区"
)
private
String
community
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"经度"
)
private
String
longitude
;
@ApiModelProperty
(
value
=
"纬度"
)
private
String
latitude
;
@ApiModelProperty
(
value
=
"单位法人"
)
private
String
legalPerson
;
@ApiModelProperty
(
value
=
"法人电话"
)
private
String
legalPersonTel
;
@ApiModelProperty
(
value
=
"单位联系人"
)
private
String
contactPerson
;
@ApiModelProperty
(
value
=
"联系人电话"
)
private
String
contactPersonTel
;
@ApiModelProperty
(
value
=
"管理员姓名"
)
private
String
adminName
;
@ApiModelProperty
(
value
=
"管理员用户名"
)
private
String
adminLoginName
;
@ApiModelProperty
(
value
=
"管理员密码"
)
private
String
adminLoginPwd
;
@ApiModelProperty
(
value
=
"管理员手机号"
)
private
String
adminTel
;
@ApiModelProperty
(
value
=
"管理员身份证号"
)
private
String
adminIdNumber
;
@ApiModelProperty
(
value
=
"审核状态:1-无需审核;2-待审核;3-已审核"
)
private
String
state
;
@ApiModelProperty
(
value
=
"工商信息"
)
private
RegUnitIcDto
regUnitIc
;
@ApiModelProperty
(
value
=
"行政许可"
)
private
List
<
BaseUnitLicenceDto
>
unitLicences
;
@ApiModelProperty
(
value
=
"机场单位id"
)
private
Long
orgUserId
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/RegUnitIc.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 注册单位工商信息表
*
* @author system_generator
* @date 2022-08-10
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz_flc_reg_unit_ic"
)
public
class
RegUnitIc
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 单位名称
*/
@TableField
(
"unit_name"
)
private
String
unitName
;
/**
* 证件code
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 所属行业
*/
@TableField
(
"industry_name"
)
private
String
industryName
;
/**
* 登记机关
*/
@TableField
(
"registered_organ"
)
private
String
registeredOrgan
;
/**
* 核准时间
*/
@TableField
(
"approved_date"
)
private
Date
approvedDate
;
/**
* 经验状态:在业、吊销、注销、迁入、迁出、停业、清算
*/
@TableField
(
"business_state"
)
private
String
businessState
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/RegUnitInfo.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* 单位注册信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tz_flc_reg_unit_info"
)
public
class
RegUnitInfo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 单位名称
*/
@TableField
(
"name"
)
private
String
name
;
/**
* 证件code
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 证件类型
*/
@TableField
(
"unit_code_type"
)
private
String
unitCodeType
;
/**
* 单位类型
*/
@TableField
(
"unit_type"
)
private
String
unitType
;
/**
* 单位类型code
*/
@TableField
(
"unit_type_code"
)
private
String
unitTypeCode
;
/**
* 管辖机构
*/
@TableField
(
"management_unit"
)
private
String
managementUnit
;
/**
* 管辖单位id
*/
@TableField
(
"management_unit_id"
)
private
String
managementUnitId
;
/**
* 区域编码
*/
@TableField
(
"region_code"
)
private
String
regionCode
;
/**
* 国家
*/
@TableField
(
"country"
)
private
String
country
;
/**
* 省
*/
@TableField
(
"province"
)
private
String
province
;
/**
* 市
*/
@TableField
(
"city"
)
private
String
city
;
/**
* 县区
*/
@TableField
(
"district"
)
private
String
district
;
/**
* 街道
*/
@TableField
(
"stree"
)
private
String
stree
;
/**
* 小区
*/
@TableField
(
"community"
)
private
String
community
;
/**
* 详细地址
*/
@TableField
(
"address"
)
private
String
address
;
/**
* 经度
*/
@TableField
(
"longitude"
)
private
String
longitude
;
/**
* 纬度
*/
@TableField
(
"latitude"
)
private
String
latitude
;
/**
* 单位法人
*/
@TableField
(
"legal_person"
)
private
String
legalPerson
;
/**
* 法人电话
*/
@TableField
(
"legal_person_tel"
)
private
String
legalPersonTel
;
/**
* 单位联系人
*/
@TableField
(
"contact_person"
)
private
String
contactPerson
;
/**
* 联系人电话
*/
@TableField
(
"contact_person_tel"
)
private
String
contactPersonTel
;
/**
* 管理员姓名
*/
@TableField
(
"admin_name"
)
private
String
adminName
;
/**
* 管理员用户名
*/
@TableField
(
"admin_login_name"
)
private
String
adminLoginName
;
/**
* 管理员密码
*/
@TableField
(
"admin_login_pwd"
)
private
String
adminLoginPwd
;
/**
* 管理员手机号
*/
@TableField
(
"admin_tel"
)
private
String
adminTel
;
/**
* 管理元身份证号
*/
@TableField
(
"admin_id_number"
)
private
String
adminIdNumber
;
/**
* 审核状态:1-无需审核;2-待审核;3-已审核
*/
@TableField
(
"state"
)
private
String
state
;
@TableField
(
"org_user_id"
)
private
Long
orgUserId
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/enums/UnitReviewStateEnum.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
enums
;
import
lombok.Getter
;
/**
* @author Administrator
*/
@Getter
public
enum
UnitReviewStateEnum
{
/**
* 单位审核状态
*/
NO_NEED_REVIEW
(
"无需审核"
,
"1"
),
WAIT_REVIEW
(
"待审核"
,
"2"
),
HAVING_REVIEW
(
"已审核"
,
"3"
);
private
String
name
;
private
String
code
;
UnitReviewStateEnum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/mapper/RegUnitIcMapper.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc
;
/**
* 注册单位工商信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-10
*/
public
interface
RegUnitIcMapper
extends
BaseMapper
<
RegUnitIc
>
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/mapper/RegUnitInfoMapper.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RegUnitInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 单位注册信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-09
*/
public
interface
RegUnitInfoMapper
extends
BaseMapper
<
RegUnitInfo
>
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IRegUnitIcService.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
/**
* 注册单位工商信息表接口类
*
* @author system_generator
* @date 2022-08-10
*/
public
interface
IRegUnitIcService
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IRegUnitInfoService.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 单位注册信息表接口类
*
* @author system_generator
* @date 2022-08-09
*/
public
interface
IRegUnitInfoService
{
/**
* 单位注册
* @param model RegUnitInfoDto
* @return RegUnitInfoDto
*/
RegUnitInfoDto
registerUnit
(
RegUnitInfoDto
model
);
/**
* 单位校验
* @param unitCode 单位唯一编号
* @param unitType 单位类型
* @return RegUnitInfoDto
*/
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
);
/**
* 单位类型列表字典
* @return List<DataDictionary>
*/
List
<
DataDictionary
>
getUnitTypeList
();
/**
* 获取管辖机构树
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
*/
Collection
<
CompanyModel
>
getManagementUnitTree
();
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/BaseUnitLicenceMapper.xml
0 → 100644
View file @
2cd7f6d9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.api.mapper.BaseUnitLicenceMapper"
>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/RegUnitIcMapper.xml
0 → 100644
View file @
2cd7f6d9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.flc.api.mapper.RegUnitIcMapper"
>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
0 → 100644
View file @
2cd7f6d9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.flc.api.mapper.RegUnitInfoMapper"
>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/BaseUnitLicenceController.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
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.List
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl
;
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.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 单位注册许可信息表
*
* @author system_generator
* @date 2022-08-09
*/
@RestController
@Api
(
tags
=
"单位注册许可信息表Api"
)
@RequestMapping
(
value
=
"/base-unit-licence"
)
public
class
BaseUnitLicenceController
extends
BaseController
{
@Autowired
BaseUnitLicenceServiceImpl
baseUnitLicenceServiceImpl
;
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位注册许可信息表列表全部数据查询"
,
notes
=
"单位注册许可信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/{unitCode}/list"
)
public
ResponseModel
<
List
<
BaseUnitLicenceDto
>>
selectForList
(
@PathVariable
String
unitCode
)
{
return
ResponseHelper
.
buildResponse
(
baseUnitLicenceServiceImpl
.
queryForBaseUnitLicenceList
(
unitCode
));
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/BaseUnitLicenceServiceImpl.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.BaseUnitLicenceMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IBaseUnitLicenceService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 单位注册许可信息表服务实现类
*
* @author system_generator
* @date 2022-08-09
*/
@Service
public
class
BaseUnitLicenceServiceImpl
extends
BaseService
<
BaseUnitLicenceDto
,
BaseUnitLicence
,
BaseUnitLicenceMapper
>
implements
IBaseUnitLicenceService
{
/**
* 分页查询
*/
public
Page
<
BaseUnitLicenceDto
>
queryForBaseUnitLicencePage
(
Page
<
BaseUnitLicenceDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询
* @param unitCode 单位编号
*/
public
List
<
BaseUnitLicenceDto
>
queryForBaseUnitLicenceList
(
String
unitCode
)
{
return
this
.
queryForList
(
""
,
false
,
unitCode
);
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitIcController.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.RegUnitIcServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
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.HttpServletRequest
;
import
java.util.List
;
/**
* 注册单位工商信息表
*
* @author system_generator
* @date 2022-08-10
*/
@RestController
@Api
(
tags
=
"注册单位工商信息表Api"
)
@RequestMapping
(
value
=
"/reg-unit-ic"
)
public
class
RegUnitIcController
extends
BaseController
{
@Autowired
RegUnitIcServiceImpl
regUnitIcServiceImpl
;
/**
* 新增注册单位工商信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增注册单位工商信息表"
,
notes
=
"新增注册单位工商信息表"
)
public
ResponseModel
<
RegUnitIcDto
>
save
(
@RequestBody
RegUnitIcDto
model
)
{
model
=
regUnitIcServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新注册单位工商信息表"
,
notes
=
"根据sequenceNbr更新注册单位工商信息表"
)
public
ResponseModel
<
RegUnitIcDto
>
updateBySequenceNbrRegUnitIc
(
@RequestBody
RegUnitIcDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
regUnitIcServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除注册单位工商信息表"
,
notes
=
"根据sequenceNbr删除注册单位工商信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
regUnitIcServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个注册单位工商信息表"
,
notes
=
"根据sequenceNbr查询单个注册单位工商信息表"
)
public
ResponseModel
<
RegUnitIcDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
regUnitIcServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"注册单位工商信息表分页查询"
,
notes
=
"注册单位工商信息表分页查询"
)
public
ResponseModel
<
Page
<
RegUnitIcDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
RegUnitIcDto
>
page
=
new
Page
<
RegUnitIcDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
regUnitIcServiceImpl
.
queryForRegUnitIcPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"注册单位工商信息表列表全部数据查询"
,
notes
=
"注册单位工商信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
RegUnitIcDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
regUnitIcServiceImpl
.
queryForRegUnitIcList
());
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitInfoController.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Random
;
/**
* 单位注册信息表
*
* @author system_generator
* @date 2022-08-09
*/
@RestController
@Api
(
tags
=
"单位注册信息表Api"
)
@RequestMapping
(
value
=
"/reg-unit-info"
)
public
class
RegUnitInfoController
extends
BaseController
{
@Autowired
IRegUnitInfoService
iRegUnitInfoService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${flc.sms.tempCode}"
)
private
String
smsTempCode
;
@Value
(
"${flc.sms.timeout:600}"
)
private
int
timeout
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位注册信息表"
,
notes
=
"新增单位注册信息表"
)
public
ResponseModel
<
RegUnitInfoDto
>
save
(
@RequestBody
RegUnitInfoDto
model
)
{
model
=
iRegUnitInfoService
.
registerUnit
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/{unitCode}/check"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位注册校验"
,
notes
=
"单位注册校验"
)
public
ResponseModel
<
RegUnitInfoDto
>
unitCheck
(
@PathVariable
String
unitCode
,
@RequestParam
String
unitType
)
{
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
);
return
ResponseHelper
.
buildResponse
(
regUnitInfoDto
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/unit-type/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位类型列表"
,
notes
=
"单位类型列表"
)
public
ResponseModel
<
List
<
DataDictionary
>>
unitTypeList
()
{
List
<
DataDictionary
>
result
=
iRegUnitInfoService
.
getUnitTypeList
();
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/management-unit/tree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"管辖机构树"
,
notes
=
"管辖机构树"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
managementUnitTree
()
{
Collection
<
CompanyModel
>
result
=
iRegUnitInfoService
.
getManagementUnitTree
();
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{tel}/sendTelCode"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"发送手机号验证码"
,
notes
=
"发送手机号验证码"
)
public
ResponseModel
<
Boolean
>
sendTelCode
(
@PathVariable
(
value
=
"tel"
)
String
tel
)
{
Boolean
flag
=
false
;
HashMap
<
String
,
String
>
params
=
new
HashMap
<>();
String
code
=
this
.
getRandomCode
();
params
.
put
(
"code"
,
code
);
params
.
put
(
"mobile"
,
tel
);
params
.
put
(
"smsCode"
,
smsTempCode
);
try
{
Systemctl
.
smsClient
.
sendCommonSms
(
params
).
getResult
();
flag
=
true
;
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"发送短信失败:"
+
e
.
getMessage
());
}
// code 保存到缓存中
redisUtils
.
set
(
RedisKey
.
FLC_USER_TEL
+
tel
,
code
,
timeout
);
return
ResponseHelper
.
buildResponse
(
flag
);
}
private
String
getRandomCode
()
{
StringBuilder
code
=
new
StringBuilder
();
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
//每次随机出一个数字(0-9)
int
r
=
random
.
nextInt
(
10
);
//把每次随机出的数字拼在一起
code
.
append
(
r
);
}
return
code
.
toString
();
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{tel}/{code}/verifyTelCode"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"验证手机号验证码是否成功"
,
notes
=
"验证手机号验证码是否成功"
)
public
ResponseModel
<
Boolean
>
verifyTelCode
(
@PathVariable
(
value
=
"tel"
)
String
tel
,
@PathVariable
(
value
=
"code"
)
String
code
)
{
Boolean
flag
=
false
;
if
(
ValidationUtil
.
isEmpty
(
tel
)
||
ValidationUtil
.
isEmpty
(
code
))
{
throw
new
BadRequest
(
"参数校验失败."
);
}
if
(
redisUtils
.
hasKey
(
RedisKey
.
FLC_USER_TEL
+
tel
))
{
String
redisCode
=
redisUtils
.
get
(
RedisKey
.
FLC_USER_TEL
+
tel
).
toString
();
if
(
code
.
equals
(
redisCode
))
{
flag
=
true
;
}
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{userName}/hasExistUser"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断用户是否存在"
,
notes
=
"判断用户是否存在"
)
public
ResponseModel
<
Boolean
>
hasExistUser
(
@PathVariable
(
value
=
"userName"
)
String
userName
)
{
Boolean
flag
=
false
;
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserName
(
userName
).
getResult
();
if
(
user
!=
null
)
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitIcServiceImpl.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRegUnitIcService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.RegUnitIcMapper
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.List
;
/**
* 注册单位工商信息表服务实现类
*
* @author system_generator
* @date 2022-08-10
*/
@Service
public
class
RegUnitIcServiceImpl
extends
BaseService
<
RegUnitIcDto
,
RegUnitIc
,
RegUnitIcMapper
>
implements
IRegUnitIcService
{
/**
* 分页查询
*/
public
Page
<
RegUnitIcDto
>
queryForRegUnitIcPage
(
Page
<
RegUnitIcDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
RegUnitIcDto
>
queryForRegUnitIcList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
0 → 100644
View file @
2cd7f6d9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRegUnitInfoService
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.UnitReviewStateEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
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
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 单位注册信息表服务实现类
*
* @author system_generator
* @date 2022-08-09
*/
@Service
public
class
RegUnitInfoServiceImpl
extends
BaseService
<
RegUnitInfoDto
,
RegUnitInfo
,
RegUnitInfoMapper
>
implements
IRegUnitInfoService
{
@Autowired
BaseUnitLicenceServiceImpl
baseUnitLicenceService
;
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
RegUnitIcServiceImpl
regUnitIcService
;
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1051
*/
private
static
String
USE_UNIT_TYPE_CODE
=
"1051"
;
/**
* 单位类型,数据来源:cb_data_dictionary type = UNIT_TYPE
*/
private
static
String
DICT_TYPE_UNIT_TYPE
=
"UNIT_TYPE"
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
RegUnitInfoDto
registerUnit
(
RegUnitInfoDto
model
)
{
// 1.插入注册单位基本信息表:tz_flc_reg_unit_info
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
// 注册用统一信用码注册,默认证件类型为营业执照,数据来源:cb_data_dictionary code = 1060
model
.
setUnitType
(
"营业执照"
);
model
.
setUnitTypeCode
(
"1060"
);
Bean
.
copyExistPropertis
(
model
,
regUnitInfo
);
// 2.插入单位注册许可信息表:tz_base_unit_licence
List
<
BaseUnitLicenceDto
>
unitLicenceDtos
=
model
.
getUnitLicences
();
List
<
BaseUnitLicence
>
baseUnitLicences
=
unitLicenceDtos
.
stream
().
map
(
s
->
{
BaseUnitLicence
target
=
new
BaseUnitLicence
();
Bean
.
copyExistPropertis
(
s
,
target
);
return
target
;
}).
collect
(
Collectors
.
toList
());
baseUnitLicenceService
.
saveOrUpdateBatch
(
baseUnitLicences
);
// 3.插入工商单位信息表:tz_flc_reg_unit_ic
RegUnitIc
regUnitIc
=
new
RegUnitIc
();
model
.
getRegUnitIc
().
setUnitCode
(
model
.
getUnitCode
());
model
.
getRegUnitIc
().
setUnitName
(
model
.
getName
());
Bean
.
copyExistPropertis
(
model
.
getRegUnitIc
(),
regUnitIc
);
regUnitIcService
.
save
(
regUnitIc
);
// 4.调用平台进行创建单位、用户信息,同步用户信息
if
(
UnitReviewStateEnum
.
NO_NEED_REVIEW
.
getCode
().
equals
(
model
.
getState
()))
{
// 4.1 自动创建:调用平台进行创建单位、用户信息
createCompanyAndUser
(
regUnitInfo
);
// 4.2 todo 同步用户信息 需要吴江提交表相关代码
}
this
.
save
(
regUnitInfo
);
// 5.组织返回数据
// 5.1企业基本信息
Bean
.
copyExistPropertis
(
regUnitInfo
,
model
);
// 5.2行政许可数据
model
.
setUnitLicences
(
Bean
.
toModels
(
baseUnitLicences
,
BaseUnitLicenceDto
.
class
));
// 5.3工商信息
model
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
return
model
;
}
@Override
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
)
{
// 1.校验重复性
RegUnitInfo
regUnitInfo
=
this
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
if
(
regUnitInfo
!=
null
)
{
throw
new
RuntimeException
(
"该单位已注册,请联系企业管理员!"
);
}
// 2.组织返回数据
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
if
(
USE_UNIT_TYPE_CODE
.
equals
(
unitType
))
{
// 2.1 使用单位调用行政许可系统接口进行查询工商信息
// 2.2 工商信息组装
}
else
{
RegUnitIc
regUnitIc
=
regUnitIcService
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitIc
>().
eq
(
RegUnitIc:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setRegUnitIc
(
Bean
.
toModel
(
regUnitIc
,
new
RegUnitIcDto
()));
}
// 2.3 许可信息组装
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setUnitLicences
(
Bean
.
toModels
(
unitLicences
,
BaseUnitLicenceDto
.
class
));
return
regUnitInfoDto
;
}
@Override
public
List
<
DataDictionary
>
getUnitTypeList
()
{
return
iDataDictionaryService
.
getByType
(
DICT_TYPE_UNIT_TYPE
);
}
@Override
public
Collection
<
CompanyModel
>
getManagementUnitTree
()
{
// 组织架构中单位级别为:省级、地市级、区县级的单位
Collection
<
CompanyModel
>
companyModels
=
Privilege
.
companyClient
.
companyTreeWithoutAuth
().
getResult
();
return
companyModels
.
stream
().
filter
(
c
->
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
())).
peek
(
n
->{
this
.
dealChildCompany
(
n
.
getChildren
());
}).
collect
(
Collectors
.
toList
());
}
private
void
dealChildCompany
(
Collection
children
){
children
.
stream
().
filter
(
n
->{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
return
"headquarter"
.
equals
(
c
.
getLevel
())
||
"prefecture-level"
.
equals
(
c
.
getLevel
())
||
"county"
.
equals
(
c
.
getLevel
());
}).
peek
(
n
->{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
dealChildCompany
(
c
.
getChildren
());
}).
collect
(
Collectors
.
toList
());
}
private
void
createCompanyAndUser
(
RegUnitInfo
regUnitInfo
)
{
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
List
<
RoleModel
>
allRoleList
=
roleListResult
.
getResult
();
List
<
RoleModel
>
userRoleList
;
List
<
Long
>
roleIds
=
new
ArrayList
<>();
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
// 3.1创建公司
CompanyModel
companyInfo
=
new
CompanyModel
();
companyInfo
.
setAddress
(
regUnitInfo
.
getProvince
()
+
regUnitInfo
.
getCity
()
+
regUnitInfo
.
getDistrict
()
+
regUnitInfo
.
getStree
()
+
regUnitInfo
.
getCommunity
()
+
regUnitInfo
.
getAddress
());
companyInfo
.
setAgencyCode
(
"tzs"
);
companyInfo
.
setParentId
(
Long
.
parseLong
(
regUnitInfo
.
getManagementUnitId
()));
companyInfo
.
setLevel
(
"company"
);
companyInfo
.
setCompanyName
(
regUnitInfo
.
getName
());
companyInfo
.
setContact
(
regUnitInfo
.
getLegalPersonTel
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
create
(
companyInfo
);
if
(
companyResult
==
null
||
companyResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"单位注册失败"
);
}
String
adminUserName
=
regUnitInfo
.
getAdminName
();
String
loginName
=
regUnitInfo
.
getAdminLoginName
();
String
pwd
=
regUnitInfo
.
getAdminLoginPwd
();
String
adminTel
=
regUnitInfo
.
getAdminTel
();
// 3.2 创建平台用户
companyInfo
=
companyResult
.
getResult
();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setUserName
(
loginName
);
agencyUserModel
.
setRealName
(
adminUserName
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setPassword
(
pwd
);
agencyUserModel
.
setRePassword
(
pwd
);
agencyUserModel
.
setAgencyCode
(
"tzs"
);
agencyUserModel
.
setMobile
(
adminTel
);
String
unitTypeCode
=
regUnitInfo
.
getUnitTypeCode
();
// 根据unitTypeCode 获取应用和角色 数据字典配置
DataDictionary
unitType
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
unitTypeCode
));
String
appCode
=
unitType
.
getTypeDesc
();
String
[]
appCodes
=
appCode
.
split
(
","
);
Set
<
String
>
appCodesSet
=
new
HashSet
<>();
Collections
.
addAll
(
appCodesSet
,
appCodes
);
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
roleNameSet
.
add
(
unitType
.
getName
());
userRoleList
=
allRoleList
.
stream
().
filter
(
r
->
r
.
getRoleName
().
equals
(
unitType
.
getName
())).
collect
(
Collectors
.
toList
());
userRoleList
.
forEach
(
r
->
{
roleIds
.
add
(
r
.
getSequenceNbr
());
});
roleSeqMap
.
put
(
companyInfo
.
getSequenceNbr
(),
roleIds
);
agencyUserModel
.
setAppCodes
(
new
ArrayList
<>(
appCodesSet
));
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
orgRoles
.
put
(
companyInfo
.
getSequenceNbr
(),
userRoleList
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
FeignClientResult
<
AgencyUserModel
>
userResult
;
try
{
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
}
catch
(
InnerInvokException
e
)
{
// 删除已经创建的 企业信息
Privilege
.
companyClient
.
deleteCompany
(
companyInfo
.
getSequenceNbr
()
+
""
);
throw
new
BadRequest
(
e
.
getMessage
());
}
if
(
userResult
==
null
||
userResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"注册失败"
);
}
// 3.3 org_user 创建组织机构
OrgUsr
org
=
new
OrgUsr
();
org
.
setBizOrgCode
(
TreeParser
.
genTreeCode
());
org
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
org
.
setBizOrgName
(
regUnitInfo
.
getName
());
org
.
setRecDate
(
new
Date
());
org
.
setRecUserId
(
userResult
.
getResult
().
getUserId
());
org
.
setRecUserName
(
userResult
.
getResult
().
getUserName
());
org
.
setAmosOrgId
(
companyInfo
.
getSequenceNbr
()
+
""
);
org
.
setAmosOrgCode
(
companyInfo
.
getOrgCode
());
iOrgUsrService
.
save
(
org
);
regUnitInfo
.
setOrgUserId
(
org
.
getSequenceNbr
());
}
}
\ No newline at end of file
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