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
2aabbf60
Commit
2aabbf60
authored
Aug 11, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.字典增加字段落code 和 name
2.数据脚本整理
parent
2638fced
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
151 additions
and
26 deletions
+151
-26
BaseUnitLicenceDto.java
...join/amos/boot/module/tzs/api/dto/BaseUnitLicenceDto.java
+22
-1
BaseUnitLicence.java
...join/amos/boot/module/tzs/api/entity/BaseUnitLicence.java
+24
-0
RegUnitIcDto.java
...eejoin/amos/boot/module/tzs/flc/api/dto/RegUnitIcDto.java
+7
-1
RegUnitInfoDto.java
...join/amos/boot/module/tzs/flc/api/dto/RegUnitInfoDto.java
+6
-2
RegUnitIc.java
...eejoin/amos/boot/module/tzs/flc/api/entity/RegUnitIc.java
+15
-2
RegUnitInfo.java
...join/amos/boot/module/tzs/flc/api/entity/RegUnitInfo.java
+10
-2
IRegUnitInfoService.java
.../boot/module/tzs/flc/api/service/IRegUnitInfoService.java
+7
-0
RegUnitInfoController.java
.../module/tzs/flc/biz/controller/RegUnitInfoController.java
+9
-0
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+50
-18
changelog-master.xml
...-biz/src/main/resources/db/changelog/changelog-master.xml
+1
-0
tzs-1.0.0.1.xml
...e-tzs-biz/src/main/resources/db/changelog/tzs-1.0.0.1.xml
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/BaseUnitLicenceDto.java
View file @
2aabbf60
...
...
@@ -33,6 +33,9 @@ public class BaseUnitLicenceDto extends BaseDto {
@ApiModelProperty
(
value
=
"证书类型"
)
private
String
certType
;
@ApiModelProperty
(
value
=
"证书类型code"
)
private
String
certTypeCode
;
@ApiModelProperty
(
value
=
"证书编号"
)
private
String
certNo
;
...
...
@@ -45,9 +48,18 @@ public class BaseUnitLicenceDto extends BaseDto {
@ApiModelProperty
(
value
=
"变更日期"
)
private
Date
changeDate
;
@ApiModelProperty
(
value
=
"许可
评审方式
"
)
@ApiModelProperty
(
value
=
"许可
方式/许可状态
"
)
private
String
applyType
;
@ApiModelProperty
(
value
=
"许可方式/许可状态code"
)
private
String
applyTypeCode
;
@ApiModelProperty
(
value
=
"许可评审方式"
)
private
String
appraisalType
;
@ApiModelProperty
(
value
=
"许可评审方式code"
)
private
String
appraisalTypeCode
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
...
...
@@ -66,7 +78,16 @@ public class BaseUnitLicenceDto extends BaseDto {
@ApiModelProperty
(
value
=
"许可参数/充装介质名称"
)
private
String
parameter
;
@ApiModelProperty
(
value
=
"许可参数/充装介质code"
)
private
String
parameterCode
;
@ApiModelProperty
(
value
=
"固定检验地址"
)
private
String
itemAddress
;
@ApiModelProperty
(
value
=
"发证机关"
)
private
String
approvedOrgan
;
@ApiModelProperty
(
value
=
"发证机关code"
)
private
String
approvedOrganCode
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/BaseUnitLicence.java
View file @
2aabbf60
...
...
@@ -46,6 +46,13 @@ public class BaseUnitLicence extends BaseEntity {
@TableField
(
"cert_type"
)
private
String
certType
;
/**
* 证书类型code
*/
@TableField
(
"cert_type_code"
)
private
String
certTypeCode
;
/**
* 证书编号
*/
...
...
@@ -112,10 +119,27 @@ public class BaseUnitLicence extends BaseEntity {
@TableField
(
"parameter"
)
private
String
parameter
;
/**
* 许可参数/充装介质code
*/
@TableField
(
"parameterCode"
)
private
String
parameterCode
;
/**
* 固定检验地址
*/
@TableField
(
"item_address"
)
private
String
itemAddress
;
/**
* 发证机关
*/
private
String
approvedOrgan
;
/**
* 发证机关code
*/
private
String
approvedOrganCode
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/RegUnitIcDto.java
View file @
2aabbf60
...
...
@@ -33,10 +33,16 @@ public class RegUnitIcDto extends BaseDto {
@ApiModelProperty
(
value
=
"登记机关"
)
private
String
registeredOrgan
;
@ApiModelProperty
(
value
=
"登记机关编码"
)
private
String
registeredOrganCode
;
@ApiModelProperty
(
value
=
"核准时间"
)
private
Date
approvedDate
;
@ApiModelProperty
(
value
=
"经
验
状态:在业、吊销、注销、迁入、迁出、停业、清算"
)
@ApiModelProperty
(
value
=
"经
营
状态:在业、吊销、注销、迁入、迁出、停业、清算"
)
private
String
businessState
;
@ApiModelProperty
(
value
=
"经营状态code"
)
private
String
businessStateCode
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/RegUnitInfoDto.java
View file @
2aabbf60
...
...
@@ -112,6 +112,10 @@ public class RegUnitInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"行政许可"
)
private
List
<
BaseUnitLicenceDto
>
unitLicences
;
@ApiModelProperty
(
value
=
"机场单位id"
)
private
Long
orgUserId
;
@ApiModelProperty
(
value
=
"平台公司id,平台创建公司后更新"
)
private
String
amosCompanySeq
;
@ApiModelProperty
(
value
=
"平台用户id,平台创建用户后更新"
)
private
String
adminUserId
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/RegUnitIc.java
View file @
2aabbf60
...
...
@@ -42,21 +42,34 @@ public class RegUnitIc extends BaseEntity {
private
String
industryName
;
/**
* 登记机关
* 登记机关
名称
*/
@TableField
(
"registered_organ"
)
private
String
registeredOrgan
;
/**
* 登记机关code
*/
@TableField
(
"registered_organ_code"
)
private
String
registeredOrganCode
;
/**
* 核准时间
*/
@TableField
(
"approved_date"
)
private
Date
approvedDate
;
/**
* 经
验状态
:在业、吊销、注销、迁入、迁出、停业、清算
* 经
营状态名称
:在业、吊销、注销、迁入、迁出、停业、清算
*/
@TableField
(
"business_state"
)
private
String
businessState
;
/**
* 经营状态code
*/
@TableField
(
"business_state_code"
)
private
String
businessStateCode
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/RegUnitInfo.java
View file @
2aabbf60
...
...
@@ -183,7 +183,15 @@ public class RegUnitInfo extends BaseEntity {
@TableField
(
"state"
)
private
String
state
;
@TableField
(
"org_user_id"
)
private
Long
orgUserId
;
/**
* 平台公司id,平台创建公司后更新
*/
@TableField
(
"amos_company_seq"
)
private
String
amosCompanySeq
;
/**
* 平台用户id,平台创建用户后更新
*/
private
String
adminUserId
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IRegUnitInfoService.java
View file @
2aabbf60
...
...
@@ -43,4 +43,11 @@ public interface IRegUnitInfoService {
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
*/
Collection
<
CompanyModel
>
getManagementUnitTree
();
/**
* 单位注销
* @param unitCode 单位唯一标识
* @return 是否成功
*/
Boolean
unitLogOut
(
String
unitCode
);
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitInfoController.java
View file @
2aabbf60
...
...
@@ -22,6 +22,7 @@ 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
javax.ws.rs.DELETE
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -150,4 +151,12 @@ public class RegUnitInfoController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{unitCode}/logOut"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"企业注销"
,
notes
=
"企业注销"
)
public
ResponseModel
unitLogOut
(
@PathVariable
String
unitCode
){
return
ResponseHelper
.
buildResponse
(
iRegUnitInfoService
.
unitLogOut
(
unitCode
));
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
2aabbf60
...
...
@@ -28,6 +28,7 @@ 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.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -66,14 +67,14 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
TzBaseEnterpriseInfoServiceImpl
tzBaseEnterpriseInfoService
;
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1
051
* 使用单位的类型,数据来源:cb_data_dictionary code = 1
232
*/
private
static
String
USE_UNIT_TYPE_CODE
=
"1
051
"
;
private
static
String
USE_UNIT_TYPE_CODE
=
"1
232
"
;
/**
* 单位类型,数据来源:cb_data_dictionary type = UNIT_TYPE
*/
private
static
String
DICT_TYPE_UNIT_TYPE
=
"UNIT_TYPE"
;
private
static
String
DICT_TYPE_UNIT_TYPE
=
"UNIT_TYPE
_NEW
"
;
@Override
...
...
@@ -105,7 +106,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
if
(
UnitReviewStateEnum
.
NO_NEED_REVIEW
.
getCode
().
equals
(
model
.
getState
()))
{
// 4.1 自动创建:调用平台进行创建单位、用户信息
this
.
createCompanyAndUser
(
regUnitInfo
);
// 4.2
todo 同步用户信息 需要吴江提交表相关代码
// 4.2
创建企业信息
this
.
createBaseEnterpriseInfo
(
model
);
}
this
.
save
(
regUnitInfo
);
...
...
@@ -127,12 +128,12 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
baseEnterpriseInfo
.
setCity
(
regUnitInfo
.
getCity
());
baseEnterpriseInfo
.
setDistrict
(
regUnitInfo
.
getDistrict
());
baseEnterpriseInfo
.
setStreet
(
regUnitInfo
.
getStree
());
baseEnterpriseInfo
.
setCommunity
(
regUnitInfo
.
getCommunity
())
;
baseEnterpriseInfo
.
setAddress
(
regUnitInfo
.
getAddress
())
;
baseEnterpriseInfo
.
setLegalPerson
(
regUnitInfo
.
getLegalPerson
())
;
baseEnterpriseInfo
.
setLegalPhone
(
regUnitInfo
.
getLegalPersonTel
())
;
baseEnterpriseInfo
.
setUseContact
(
regUnitInfo
.
getContactPerson
())
;
baseEnterpriseInfo
.
setContactPhone
(
regUnitInfo
.
getContactPersonTel
())
;
baseEnterpriseInfo
.
setCommunity
(
regUnitInfo
.
getCommunity
());
baseEnterpriseInfo
.
setAddress
(
regUnitInfo
.
getAddress
());
baseEnterpriseInfo
.
setLegalPerson
(
regUnitInfo
.
getLegalPerson
());
baseEnterpriseInfo
.
setLegalPhone
(
regUnitInfo
.
getLegalPersonTel
());
baseEnterpriseInfo
.
setUseContact
(
regUnitInfo
.
getContactPerson
());
baseEnterpriseInfo
.
setContactPhone
(
regUnitInfo
.
getContactPersonTel
());
baseEnterpriseInfo
.
setLongitude
(
regUnitInfo
.
getLongitude
());
baseEnterpriseInfo
.
setLatitude
(
regUnitInfo
.
getLatitude
());
baseEnterpriseInfo
.
setGoverningBody
(
regUnitInfo
.
getManagementUnit
());
...
...
@@ -177,17 +178,46 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
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
->
{
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
);
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
unitLogOut
(
String
unitCode
)
{
RegUnitInfo
regUnitInfo
=
this
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
if
(
regUnitInfo
==
null
){
return
Boolean
.
FALSE
;
}
tzsAuthServiceImpl
.
setRequestContext
();
String
companyId
=
regUnitInfo
.
getAmosCompanySeq
();
// 1.删除已经创建的 企业信息
if
(
StringUtils
.
isNotEmpty
(
companyId
))
{
CompanyModel
companyModel
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
companyId
)).
getResult
();
if
(
companyModel
!=
null
)
{
Privilege
.
companyClient
.
deleteCompany
(
companyId
);
}
}
// 2.删除管理员账号
Privilege
.
agencyUserClient
.
multDeleteUser
(
regUnitInfo
.
getAdminUserId
());
// 3.企业注册表删除
this
.
remove
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
// 4.工商信息表删除
regUnitIcService
.
remove
(
new
LambdaQueryWrapper
<
RegUnitIc
>().
eq
(
RegUnitIc:
:
getUnitCode
,
unitCode
));
// 5.许可信息删除
baseUnitLicenceService
.
remove
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
// 6.企业数据信息 删除
tzBaseEnterpriseInfoService
.
remove
(
new
LambdaQueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
TzBaseEnterpriseInfo:
:
getUseCode
,
unitCode
));
return
Boolean
.
TRUE
;
}
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
);
}).
peek
(
n
->
{
CompanyModel
c
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
n
),
CompanyModel
.
class
);
dealChildCompany
(
c
.
getChildren
()
!=
null
?
new
ArrayList
()
:
c
.
getChildren
());
}).
collect
(
Collectors
.
toList
());
}
...
...
@@ -229,7 +259,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String
unitTypeCode
=
regUnitInfo
.
getUnitTypeCode
();
// 根据unitTypeCode 获取应用和角色 数据字典配置
DataDictionary
unitType
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
unitTypeCode
));
String
appCode
=
unitType
.
getTypeDesc
()
!=
null
?
unitType
.
getTypeDesc
():
""
;
String
appCode
=
unitType
.
getTypeDesc
()
!=
null
?
unitType
.
getTypeDesc
()
:
""
;
String
[]
appCodes
=
appCode
.
split
(
","
);
Set
<
String
>
appCodesSet
=
new
HashSet
<>();
Collections
.
addAll
(
appCodesSet
,
appCodes
);
...
...
@@ -268,6 +298,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
org
.
setAmosOrgId
(
companyInfo
.
getSequenceNbr
()
+
""
);
org
.
setAmosOrgCode
(
companyInfo
.
getOrgCode
());
iOrgUsrService
.
save
(
org
);
regUnitInfo
.
setOrgUserId
(
org
.
getSequenceNbr
());
regUnitInfo
.
setAdminUserId
(
userResult
.
getResult
().
getUserId
());
regUnitInfo
.
setAmosCompanySeq
(
companyInfo
.
getSequenceNbr
().
toString
());
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/db/changelog/changelog-master.xml
View file @
2aabbf60
...
...
@@ -7,4 +7,5 @@
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<include
file=
"tzs-1.0.0.0.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"tzs-1.0.0.1.xml"
relativeToChangelogFile=
"true"
/>
</databaseChangeLog>
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/db/changelog/tzs-1.0.0.1.xml
0 → 100644
View file @
2aabbf60
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