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
f5df4d7d
Commit
f5df4d7d
authored
Nov 26, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FLC 企业人员相关代码
parent
62d37c8d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
579 additions
and
38 deletions
+579
-38
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+2
-0
PersonQualityDto.java
...in/amos/boot/module/tzs/flc/api/dto/PersonQualityDto.java
+4
-0
PersonQuality.java
...in/amos/boot/module/tzs/flc/api/entity/PersonQuality.java
+8
-0
IUnitPersonService.java
...s/boot/module/tzs/flc/api/service/IUnitPersonService.java
+10
-1
UnitPersonMapper.xml
...le-tzs-api/src/main/resources/mapper/UnitPersonMapper.xml
+26
-20
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+12
-0
UnitInfoController.java
...oot/module/tzs/flc/biz/controller/UnitInfoController.java
+1
-0
UnitPersonController.java
...t/module/tzs/flc/biz/controller/UnitPersonController.java
+209
-14
UnitPersonServiceImpl.java
...odule/tzs/flc/biz/service/impl/UnitPersonServiceImpl.java
+284
-3
tzs-1.0.0.0.xml
...ystem-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
+23
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
f5df4d7d
...
@@ -278,4 +278,6 @@ public interface IOrgUsrService {
...
@@ -278,4 +278,6 @@ public interface IOrgUsrService {
OrgUsrDto
saveOrgPersonFlc
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
OrgUsrDto
saveOrgPersonFlc
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
void
updateByIdOrgPersonFlc
(
OrgPersonDto
OrgPersonVo
,
Long
id
)
throws
Exception
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/PersonQualityDto.java
View file @
f5df4d7d
...
@@ -56,4 +56,8 @@ public class PersonQualityDto extends BaseDto {
...
@@ -56,4 +56,8 @@ public class PersonQualityDto extends BaseDto {
@ApiModelProperty
(
value
=
"证书信息"
)
@ApiModelProperty
(
value
=
"证书信息"
)
private
List
<
AttachmentDto
>
licenceInfo
;
private
List
<
AttachmentDto
>
licenceInfo
;
@ApiModelProperty
(
value
=
"发证日期"
)
private
Date
licenceDate
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/PersonQuality.java
View file @
f5df4d7d
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.entity;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -82,4 +83,11 @@ public class PersonQuality extends BaseEntity {
...
@@ -82,4 +83,11 @@ public class PersonQuality extends BaseEntity {
@TableField
(
"remark"
)
@TableField
(
"remark"
)
private
String
remark
;
private
String
remark
;
/**
* 发证日期
*/
@TableField
(
"licence_date"
)
private
Date
licenceDate
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IUnitPersonService.java
View file @
f5df4d7d
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitPersonInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitPersonInfoDto
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -14,5 +15,13 @@ public interface IUnitPersonService {
...
@@ -14,5 +15,13 @@ public interface IUnitPersonService {
UnitPersonInfoDto
getPersonById
(
Long
sequenceNbr
);
UnitPersonInfoDto
getPersonById
(
Long
sequenceNbr
);
Object
pagePerson
(
Long
parentId
,
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
requestBody
);
Object
pagePerson
(
List
<
Long
>
parentId
,
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
requestBody
);
Boolean
removeById
(
Long
sequenceNbr
);
Boolean
batchDelete
(
List
<
Long
>
sequenceNbrList
);
UnitPersonInfoDto
saveSupUser
(
UnitPersonInfoDto
unitPersonInfoDto
);
UnitPersonInfoDto
updateUser
(
UnitPersonInfoDto
unitPersonInfoDto
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/UnitPersonMapper.xml
View file @
f5df4d7d
...
@@ -7,8 +7,11 @@
...
@@ -7,8 +7,11 @@
select count(1) from (
select count(1) from (
SELECT
SELECT
DISTINCT
DISTINCT
u.sequence_nbr AS sequenceNbr,
u.*,
u.*,
replace(CONCAT(u.org_expand_attr6->'$.province',u.org_expand_attr6->'$.city',u.org_expand_attr6->'$.district',u.org_expand_attr6->'$.address'),'"','') fulladdress ,
g.*,
g.*,
p.biz_org_name as parentName,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
case
case
when count(q.sequence_nbr) > 0 then '有'
when count(q.sequence_nbr) > 0 then '有'
...
@@ -18,19 +21,15 @@
...
@@ -18,19 +21,15 @@
LEFT JOIN
LEFT JOIN
( SELECT
( SELECT
v.`instance_id`,
v.`instance_id`,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person
T
ype,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person
_t
ype,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence
T
ype,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence
_t
ype,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence
C
ode,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence
_c
ode,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email
max(case v.field_code when 'province' then IFNULL(v.field_value_label,v.field_value) end) province,
max(case v.field_code when 'city' then IFNULL(v.field_value_label,v.field_value) end) city,
max(case v.field_code when 'district' then IFNULL(v.field_value_label,v.field_value) end) district,
max(case v.field_code when 'address' then IFNULL(v.field_value_label,v.field_value) end) address
FROM
FROM
`cb_dynamic_form_instance` v
`cb_dynamic_form_instance` v
WHERE
WHERE
...
@@ -39,12 +38,16 @@
...
@@ -39,12 +38,16 @@
v.`instance_id`
v.`instance_id`
) g
) g
on u.sequence_nbr = g.instance_id
on u.sequence_nbr = g.instance_id
LEFT JOIN tz_flc_person_quality q on q.sequence_nbr = u.sequence_nbr
LEFT JOIN tz_flc_person_quality q on q.pserson_id = u.sequence_nbr
LEFT JOIN cb_org_usr p on p.sequence_nbr = u.parent_id
where
where
u.biz_org_type = 'person'
u.biz_org_type = 'person'
AND
AND
u.is_delete = 0
u.is_delete = 0
AND u.parent_id = #{map.parentId}
<if
test=
"map.parentId != null"
>
AND u.parent_id in
<foreach
collection=
"map.parentId"
item=
"item"
open=
"("
close=
")"
separator=
","
>
${item}
</foreach>
</if>
GROUP BY
GROUP BY
u.sequence_nbr ,
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_name ,
...
@@ -84,8 +87,11 @@
...
@@ -84,8 +87,11 @@
select * from (
select * from (
SELECT
SELECT
DISTINCT
DISTINCT
u.sequence_nbr AS sequenceNbr,
u.*,
u.*,
replace(CONCAT(u.org_expand_attr6->'$.province',u.org_expand_attr6->'$.city',u.org_expand_attr6->'$.district',u.org_expand_attr6->'$.address'),'"','') fulladdress ,
g.*,
g.*,
p.biz_org_name as parentName,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
case
case
when count(q.sequence_nbr) > 0 then '有'
when count(q.sequence_nbr) > 0 then '有'
...
@@ -95,19 +101,15 @@
...
@@ -95,19 +101,15 @@
LEFT JOIN
LEFT JOIN
( SELECT
( SELECT
v.`instance_id`,
v.`instance_id`,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person
T
ype,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person
_t
ype,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence
T
ype,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence
_t
ype,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence
C
ode,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence
_c
ode,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email
max(case v.field_code when 'province' then IFNULL(v.field_value_label,v.field_value) end) province,
max(case v.field_code when 'city' then IFNULL(v.field_value_label,v.field_value) end) city,
max(case v.field_code when 'district' then IFNULL(v.field_value_label,v.field_value) end) district,
max(case v.field_code when 'address' then IFNULL(v.field_value_label,v.field_value) end) address
FROM
FROM
`cb_dynamic_form_instance` v
`cb_dynamic_form_instance` v
WHERE
WHERE
...
@@ -116,12 +118,16 @@
...
@@ -116,12 +118,16 @@
v.`instance_id`
v.`instance_id`
) g
) g
on u.sequence_nbr = g.instance_id
on u.sequence_nbr = g.instance_id
LEFT JOIN tz_flc_person_quality q on q.sequence_nbr = u.sequence_nbr
LEFT JOIN tz_flc_person_quality q on q.pserson_id = u.sequence_nbr
LEFT JOIN cb_org_usr p on p.sequence_nbr = u.parent_id
where
where
u.biz_org_type = 'person'
u.biz_org_type = 'person'
AND
AND
u.is_delete = 0
u.is_delete = 0
AND u.parent_id = #{map.parentId}
<if
test=
"map.parentId != null"
>
AND u.parent_id in
<foreach
collection=
"map.parentId"
item=
"item"
open=
"("
close=
")"
separator=
","
>
${item}
</foreach>
</if>
GROUP BY
GROUP BY
u.sequence_nbr ,
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_name ,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
f5df4d7d
...
@@ -2025,4 +2025,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -2025,4 +2025,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
result
;
return
result
;
}
}
@Override
public
void
updateByIdOrgPersonFlc
(
OrgPersonDto
OrgPersonVo
,
Long
id
)
throws
Exception
{
// 修改人员信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setSequenceNbr
(
id
);
updateById
(
orgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgPersonVo
.
getDynamicFormValue
());
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/UnitInfoController.java
View file @
f5df4d7d
...
@@ -448,4 +448,5 @@ public class UnitInfoController extends BaseController {
...
@@ -448,4 +448,5 @@ public class UnitInfoController extends BaseController {
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/UnitPersonController.java
View file @
f5df4d7d
...
@@ -12,15 +12,21 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...
@@ -12,15 +12,21 @@ 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.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitPersonInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitPersonInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitPersonService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitPersonService
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoChangeServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoChangeServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.ApplicationModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -37,8 +43,13 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -37,8 +43,13 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
/**
* 企业人员
* 企业人员
...
@@ -66,6 +77,9 @@ public class UnitPersonController extends BaseController {
...
@@ -66,6 +77,9 @@ public class UnitPersonController extends BaseController {
@Autowired
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
IUnitInfoService
iUnitInfoService
;
/**
/**
* 新增人员信息
* 新增人员信息
...
@@ -76,13 +90,28 @@ public class UnitPersonController extends BaseController {
...
@@ -76,13 +90,28 @@ public class UnitPersonController extends BaseController {
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增人员信息"
,
notes
=
"新增人员信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增人员信息"
,
notes
=
"新增人员信息"
)
public
ResponseModel
<?>
saveOrgUsr
(
@RequestBody
UnitPersonInfoDto
unitPersonInfoDto
)
{
public
ResponseModel
<?>
saveOrgUsr
(
@RequestBody
UnitPersonInfoDto
unitPersonInfoDto
)
{
if
(
ValidationUtil
.
isEmpty
(
unitPersonInfoDto
.
getParentId
())
||
ValidationUtil
.
isEmpty
(
unitPersonInfoDto
.
getParentName
())
)
{
if
(
ValidationUtil
.
isEmpty
(
unitPersonInfoDto
.
getParentId
()))
{
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
}
}
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
saveUser
(
unitPersonInfoDto
));
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
saveUser
(
unitPersonInfoDto
));
}
}
/**
/**
* 新增人员信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveSup"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增监管人员信息"
,
notes
=
"新增监管人员信息"
)
public
ResponseModel
<?>
saveSupOrgUsr
(
@RequestBody
UnitPersonInfoDto
unitPersonInfoDto
)
{
if
(
ValidationUtil
.
isEmpty
(
unitPersonInfoDto
.
getParentId
())
)
{
throw
new
BadRequest
(
"参数校验失败."
);
}
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
saveSupUser
(
unitPersonInfoDto
));
}
/**
* 根据当前登录人获取企业信息列表 所在单位 以及 所属组织
* 根据当前登录人获取企业信息列表 所在单位 以及 所属组织
* @return
* @return
*/
*/
...
@@ -90,15 +119,11 @@ public class UnitPersonController extends BaseController {
...
@@ -90,15 +119,11 @@ public class UnitPersonController extends BaseController {
@GetMapping
(
value
=
"/companyTree"
)
@GetMapping
(
value
=
"/companyTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前登录人获取企业树(所在单位以及所属组织)"
,
notes
=
"根据当前登录人获取企业树(所在单位以及所属组织)"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前登录人获取企业树(所在单位以及所属组织)"
,
notes
=
"根据当前登录人获取企业树(所在单位以及所属组织)"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getUserUnit
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getUserUnit
()
throws
Exception
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
List
<
CompanyModel
>
companys
=
user
.
getCompanys
();
List
<
OrgMenuDto
>
menus
=
new
ArrayList
<>();
List
<
OrgMenuDto
>
menus
=
new
ArrayList
<>();
for
(
CompanyModel
c
:
companys
)
{
OrgUsr
temp
=
getMyUnit
();
OrgUsr
temp
=
iOrgUsrService
.
getOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getAmosOrgId
,
c
.
getSequenceNbr
()));
if
(
temp
!=
null
)
{
if
(
temp
!=
null
)
{
menus
=
iOrgUsrService
.
getTreeFlc
(
Long
.
parseLong
(
temp
.
getAmosOrgId
()),
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getAmosOrgId"
,
"getBizOrgType"
);
menus
=
iOrgUsrService
.
getTreeFlc
(
Long
.
parseLong
(
temp
.
getAmosOrgId
()),
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getAmosOrgId"
,
"getBizOrgType"
);
}
}
}
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
...
@@ -111,8 +136,8 @@ public class UnitPersonController extends BaseController {
...
@@ -111,8 +136,8 @@ public class UnitPersonController extends BaseController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getOrgCode/{companyId}"
)
@GetMapping
(
value
=
"/getOrgCode/{companyId}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据
当前登录人获取企业树"
,
notes
=
"根据当前登录人获取企业树
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据
所在单位生成人员code"
,
notes
=
"根据所在单位生成人员code
"
)
public
ResponseModel
<
String
>
getOrgCode
(
@PathVariable
Long
companyId
)
throws
Exception
{
public
ResponseModel
<
String
>
getOrgCode
(
@PathVariable
Long
companyId
)
{
OrgUsr
company
=
iOrgUsrService
.
getById
(
companyId
);
OrgUsr
company
=
iOrgUsrService
.
getById
(
companyId
);
String
code
=
company
.
getBizOrgCode
()
+
iOrgUsrService
.
getOrgCodeStr
();
String
code
=
company
.
getBizOrgCode
()
+
iOrgUsrService
.
getOrgCodeStr
();
return
ResponseHelper
.
buildResponse
(
code
);
return
ResponseHelper
.
buildResponse
(
code
);
...
@@ -165,16 +190,186 @@ public class UnitPersonController extends BaseController {
...
@@ -165,16 +190,186 @@ public class UnitPersonController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/listMyUnitPerson"
)
@GetMapping
(
value
=
"/listMyUnitPerson"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前登录人获取人员信息 带分页搜索"
,
notes
=
"根据当前登录人获取人员信息 带分页搜索"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据当前登录人获取人员信息 带分页搜索"
,
notes
=
"根据当前登录人获取人员信息 带分页搜索"
)
public
ResponseModel
<
Object
>
listMyUnitPerson
(
@RequestParam
(
required
=
false
)
Map
<
String
,
Object
>
requestBody
)
throws
Exception
{
public
ResponseModel
<
Object
>
listMyUnitPerson
(
@RequestParam
(
required
=
false
)
Map
<
String
,
Object
>
requestBody
)
{
List
<
Long
>
unitIds
=
getMyUnitList
();
List
<
Long
>
parentIds
=
new
ArrayList
<>();
unitIds
.
stream
().
forEach
(
id
->
{
OrgUsr
unit
=
iOrgUsrService
.
getOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getAmosOrgId
,
id
));
if
(
unit
!=
null
)
{
parentIds
.
add
(
unit
.
getSequenceNbr
());
}
});
if
(
parentIds
.
size
()
==
0
)
{
parentIds
.
add
(-
1
l
);
}
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
pagePerson
(
parentIds
,
requestBody
.
get
(
"pageNum"
).
toString
(),
requestBody
.
get
(
"pageSize"
).
toString
(),
requestBody
));
}
/**
* 获取本单位拥有的角色信息
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/listMyUnitRoles"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取本单位拥有的角色信息"
,
notes
=
"获取本单位拥有的角色信息"
)
public
ResponseModel
<
List
<
RoleModel
>>
listMyUnitRoles
()
{
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
OrgUsr
myUnit
=
getMyUnit
();
if
(
myUnit
!=
null
)
{
UnitInfoDto
unitInfo
=
iUnitInfoService
.
getDtoByOrgId
(
myUnit
.
getSequenceNbr
());
String
unitType
=
unitInfo
.
getUnitType
();
String
[]
roles
=
unitType
.
split
(
","
);
List
<
RoleModel
>
allRoleList
=
roleListResult
.
getResult
();
allRoleList
.
stream
().
forEach
(
t
->
{
for
(
String
roleName
:
roles
)
{
if
(
t
.
getRoleName
().
equals
(
roleName
))
{
userRoleList
.
add
(
t
);
}
}
});
}
return
ResponseHelper
.
buildResponse
(
userRoleList
);
}
/**
* 获取本单位拥有的应用信息
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/listMyUnitApp"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取本单位拥有的应用信息"
,
notes
=
"获取本单位拥有的应用信息"
)
public
ResponseModel
<
List
<
ApplicationModel
>>
listMyUnitApp
()
{
List
<
ApplicationModel
>
allApp
=
Privilege
.
applicationClient
.
queryAgencyApplications
().
getResult
();
Set
<
String
>
appSet
=
new
HashSet
<>();
OrgUsr
myUnit
=
getMyUnit
();
if
(
myUnit
!=
null
)
{
UnitInfoDto
unitInfo
=
iUnitInfoService
.
getDtoByOrgId
(
myUnit
.
getSequenceNbr
());
String
unitTypeCode
=
unitInfo
.
getUnitTypeCode
();
String
[]
unitTypeCodes
=
unitTypeCode
.
split
(
","
);
for
(
String
code
:
unitTypeCodes
)
{
DataDictionary
unitType
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
code
));
String
appCode
=
unitType
.
getTypeDesc
();
String
[]
appCodes
=
appCode
.
split
(
","
);
for
(
String
tempCode
:
appCodes
)
{
appSet
.
add
(
tempCode
);
}
}
}
allApp
=
allApp
.
stream
().
filter
(
t
->
appSet
.
contains
(
t
.
getAppCode
())).
peek
(
System
.
out
::
println
).
collect
(
Collectors
.
toList
());
return
ResponseHelper
.
buildResponse
(
allApp
);
}
/**
* 获取本单位信息
* @return
*/
private
OrgUsr
getMyUnit
()
{
OrgUsr
myUnit
=
null
;
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
List
<
CompanyModel
>
companys
=
user
.
getCompanys
();
List
<
CompanyModel
>
companys
=
user
.
getCompanys
();
List
<
OrgMenuDto
>
menus
=
new
ArrayList
<>();
Long
parentId
=
-
1
l
;
for
(
CompanyModel
c
:
companys
)
{
for
(
CompanyModel
c
:
companys
)
{
OrgUsr
temp
=
iOrgUsrService
.
getOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getAmosOrgId
,
c
.
getSequenceNbr
()));
myUnit
=
iOrgUsrService
.
getOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getAmosOrgId
,
c
.
getSequenceNbr
()));
parentId
=
temp
.
getSequenceNbr
();
}
return
myUnit
;
}
/**
* 根据sequenceNbr删除
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/delete_batch"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"批量删除人员信息"
,
notes
=
"批量删除人员信息"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"sequenceNbrList"
)
List
<
Long
>
sequenceNbrList
){
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
batchDelete
(
sequenceNbrList
));
}
/**
* 根据当前登录人获取人员信息 带分页搜索监管端
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/listUnitPerson"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管端根据当前登录人获取人员信息 带分页搜索"
,
notes
=
"监管端根据当前登录人获取人员信息 带分页搜索"
)
public
ResponseModel
<
Object
>
listUnitPerson
(
@RequestParam
(
required
=
false
)
Map
<
String
,
Object
>
requestBody
)
{
List
<
Long
>
unitIds
=
getMyUnitList
();
List
<
Long
>
parentIds
=
new
ArrayList
<>();
unitIds
.
stream
().
forEach
(
id
->
{
OrgUsr
unit
=
iOrgUsrService
.
getOne
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getAmosOrgId
,
id
));
if
(
unit
!=
null
)
{
parentIds
.
add
(
unit
.
getSequenceNbr
());
}
});
if
(
parentIds
.
size
()
==
0
)
{
parentIds
.
add
(-
1
l
);
}
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
pagePerson
(
parentIds
,
requestBody
.
get
(
"pageNum"
).
toString
(),
requestBody
.
get
(
"pageSize"
).
toString
(),
requestBody
));
}
/**
* 获取监管单位下子单位信息
* @return
*/
private
List
<
Long
>
getMyUnitList
()
{
Collection
<
CompanyModel
>
companys
=
Privilege
.
companyClient
.
treeByCompany
(
null
).
getResult
();
List
<
Long
>
companyIds
=
new
ArrayList
<
Long
>();
for
(
CompanyModel
c
:
companys
)
{
getAllOrgIds
(
companyIds
,
c
);
}
return
companyIds
;
}
private
void
getAllOrgIds
(
List
<
Long
>
ids
,
CompanyModel
start
)
{
ids
.
add
(
start
.
getSequenceNbr
());
if
(
start
.
getChildren
()
!=
null
)
{
Collection
<
Map
>
children
=
start
.
getChildren
();
for
(
Map
c
:
children
)
{
getAllOrgIds
(
ids
,
c
);
}
}
}
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
pagePerson
(
parentId
,
requestBody
.
get
(
"pageNum"
).
toString
(),
requestBody
.
get
(
"pageSize"
).
toString
(),
requestBody
));
}
private
void
getAllOrgIds
(
List
<
Long
>
ids
,
Map
start
)
{
ids
.
add
(
Long
.
parseLong
(
start
.
get
(
"sequenceNbr"
).
toString
()));
if
(
start
.
get
(
"children"
)
!=
null
)
{
Collection
<
Map
>
children
=
(
Collection
<
Map
>)
start
.
get
(
"children"
);
for
(
Map
c
:
children
)
{
getAllOrgIds
(
ids
,
c
);
}
}
}
/**
* 监管端获取本单位人员信息 带分页搜索
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/listSupPerson"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管端获取本单位人员信息 带分页搜索"
,
notes
=
"监管端获取本单位人员信息 带分页搜索"
)
public
ResponseModel
<
Object
>
listSupPerson
(
@RequestParam
(
required
=
false
)
Map
<
String
,
Object
>
requestBody
)
{
List
<
Long
>
unitIds
=
getMyUnitList
();
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
pagePerson
(
unitIds
,
requestBody
.
get
(
"pageNum"
).
toString
(),
requestBody
.
get
(
"pageSize"
).
toString
(),
requestBody
));
}
/**
* 更新企业端人员信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateUser"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新企业端人员信息"
,
notes
=
"更新企业端人员信息"
)
public
ResponseModel
<?>
updateUser
(
@RequestBody
UnitPersonInfoDto
unitPersonInfoDto
)
{
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
updateUser
(
unitPersonInfoDto
));
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/UnitPersonServiceImpl.java
View file @
f5df4d7d
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -31,9 +33,11 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonEducation;
...
@@ -31,9 +33,11 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonEducation;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonQuality
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonQuality
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitPersonMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitPersonMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitPersonService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitPersonService
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
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
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
@@ -100,6 +104,9 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -100,6 +104,9 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
String
pwd
=
DesUtil
.
encode
(
unitPersonInfoDto
.
getOrgExpandAttr2
(),
"qaz"
);
String
pwd
=
DesUtil
.
encode
(
unitPersonInfoDto
.
getOrgExpandAttr2
(),
"qaz"
);
unitPersonInfoDto
.
setOrgExpandAttr2
(
pwd
);
unitPersonInfoDto
.
setOrgExpandAttr2
(
pwd
);
}
}
// 只有parentId 需要手动填充name
OrgUsr
parent
=
iOrgUsrService
.
getById
(
Long
.
parseLong
(
unitPersonInfoDto
.
getParentId
()));
unitPersonInfoDto
.
setParentName
(
parent
.
getBizOrgName
());
BeanUtils
.
copyProperties
(
unitPersonInfoDto
,
orgPersonVo
);
BeanUtils
.
copyProperties
(
unitPersonInfoDto
,
orgPersonVo
);
try
{
try
{
...
@@ -133,6 +140,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -133,6 +140,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
userAttach
=
new
HashMap
<>();
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_INFO
,
personQualityDto
.
getLicenceInfo
());
userAttach
.
put
(
TzsCommonParam
.
LICENCE_INFO
,
personQualityDto
.
getLicenceInfo
());
iSourceFileService
.
saveAttachments
(
personQualityDto
.
getSequenceNbr
(),
userAttach
);
iSourceFileService
.
saveAttachments
(
personQualityDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonQualityDto
(
personQualityDto
);
}
}
if
(
personEducationDto
!=
null
)
{
if
(
personEducationDto
!=
null
)
{
...
@@ -142,6 +150,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -142,6 +150,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
userAttach
=
new
HashMap
<>();
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
ATTACHMENT
,
personEducationDto
.
getAttachment
());
userAttach
.
put
(
TzsCommonParam
.
ATTACHMENT
,
personEducationDto
.
getAttachment
());
iSourceFileService
.
saveAttachments
(
personEducationDto
.
getSequenceNbr
(),
userAttach
);
iSourceFileService
.
saveAttachments
(
personEducationDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonEducationDto
(
personEducationDto
);
}
}
...
@@ -264,7 +273,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -264,7 +273,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
}
}
@Override
@Override
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
L
ong
parentId
,
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
req
)
{
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
L
ist
<
Long
>
parentId
,
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
req
)
{
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
...
@@ -298,7 +307,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -298,7 +307,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
sql
.
add
(
" AND birthday <= '"
+
req
.
get
(
"birthdayEnd"
)+
"'"
);
sql
.
add
(
" AND birthday <= '"
+
req
.
get
(
"birthdayEnd"
)+
"'"
);
}
}
if
(
req
.
get
(
"hasLicence"
)
!=
null
)
{
if
(
req
.
get
(
"hasLicence"
)
!=
null
)
{
sql
.
add
(
" AND hasLicence = '"
+
req
.
get
(
"
birthdayEnd
"
)+
"'"
);
sql
.
add
(
" AND hasLicence = '"
+
req
.
get
(
"
hasLicence
"
)+
"'"
);
}
}
if
(
req
.
get
(
"account"
)
!=
null
)
{
if
(
req
.
get
(
"account"
)
!=
null
)
{
sql
.
add
(
" AND org_expand_attr1 like '%"
+
req
.
get
(
"account"
)+
"%'"
);
sql
.
add
(
" AND org_expand_attr1 like '%"
+
req
.
get
(
"account"
)+
"%'"
);
...
@@ -312,7 +321,12 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -312,7 +321,12 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
if
(
req
.
get
(
"bizOrgName"
)
!=
null
)
{
if
(
req
.
get
(
"bizOrgName"
)
!=
null
)
{
sql
.
add
(
" AND biz_org_name like '%"
+
req
.
get
(
"bizOrgName"
)+
"%'"
);
sql
.
add
(
" AND biz_org_name like '%"
+
req
.
get
(
"bizOrgName"
)+
"%'"
);
}
}
if
(
req
.
get
(
"ages"
)
!=
null
)
{
// 0: 60以上 1: 50-59 2: 40-49 3: 30-39 4: 20-29 5:20 以下
map
.
put
(
"ages"
,
req
.
get
(
"ages"
));
}
if
(
req
.
get
(
"address"
)
!=
null
)
{
// address 模糊搜索
sql
.
add
(
" AND fulladdress like '%"
+
req
.
get
(
"address"
)+
"%'"
);
}
map
.
put
(
"sql"
,
sql
);
map
.
put
(
"sql"
,
sql
);
pageBean
.
setTotal
(
unitPersonMapper
.
selectPersonListCount
(
map
));
pageBean
.
setTotal
(
unitPersonMapper
.
selectPersonListCount
(
map
));
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
...
@@ -322,6 +336,273 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
...
@@ -322,6 +336,273 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
return
pageBean
;
return
pageBean
;
}
}
@Transactional
@Override
public
Boolean
removeById
(
Long
sequenceNbr
)
{
// 删除 人员基本信息 逻辑删除
OrgUsr
user
=
iOrgUsrService
.
getById
(
sequenceNbr
);
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
sequenceNbr
).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
// 删除 人员相关表信息
flcPersonQualityServiceImpl
.
update
(
new
LambdaUpdateWrapper
<
PersonQuality
>().
eq
(
PersonQuality:
:
getPsersonId
,
sequenceNbr
).
set
(
PersonQuality:
:
getIsDelete
,
true
));
personEducationServiceImpl
.
update
(
new
LambdaUpdateWrapper
<
PersonEducation
>().
eq
(
PersonEducation:
:
getPsersonId
,
sequenceNbr
).
set
(
PersonEducation:
:
getIsDelete
,
true
));
// 删除 人员账号信息
Boolean
flag
=
false
;
try
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
user
.
getAmosOrgId
());
flag
=
true
;
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
@Transactional
@Override
public
Boolean
batchDelete
(
List
<
Long
>
sequenceNbrList
)
{
for
(
Long
sequenceNbr
:
sequenceNbrList
)
{
if
(!
removeById
(
sequenceNbr
))
{
throw
new
BadRequest
(
"删除"
+
sequenceNbr
+
"用户失败"
);
}
}
return
true
;
}
@Override
public
UnitPersonInfoDto
saveSupUser
(
UnitPersonInfoDto
unitPersonInfoDto
)
{
unitPersonInfoDto
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
OrgPersonDto
orgPersonVo
=
new
OrgPersonDto
();
if
(
StringUtils
.
isNotBlank
(
unitPersonInfoDto
.
getOrgExpandAttr2
()))
{
String
pwd
=
DesUtil
.
encode
(
unitPersonInfoDto
.
getOrgExpandAttr2
(),
"qaz"
);
unitPersonInfoDto
.
setOrgExpandAttr2
(
pwd
);
}
// 只有parentId 需要手动填充name
FeignClientResult
<
CompanyModel
>
company
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
unitPersonInfoDto
.
getParentId
()));
if
(
company
==
null
||
company
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"所在单位选择有误"
);
}
unitPersonInfoDto
.
setParentName
(
company
.
getResult
().
getCompanyName
());
BeanUtils
.
copyProperties
(
unitPersonInfoDto
,
orgPersonVo
);
try
{
OrgUsrDto
result
=
iOrgUsrService
.
saveOrgPersonFlc
(
orgPersonVo
);
PersonQualityDto
personQualityDto
=
unitPersonInfoDto
.
getPersonQualityDto
();
PersonEducationDto
personEducationDto
=
unitPersonInfoDto
.
getPersonEducationDto
();
// 处理图片信息 -- 证照和图片
Map
<
String
,
List
<
AttachmentDto
>>
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_PIC
,
unitPersonInfoDto
.
getLicencePic
());
userAttach
.
put
(
TzsCommonParam
.
HEAD_SHOT
,
unitPersonInfoDto
.
getHeadshot
());
iSourceFileService
.
saveAttachments
(
result
.
getSequenceNbr
(),
userAttach
);
if
(
personQualityDto
!=
null
)
{
String
[]
licenceTypeCode
=
personQualityDto
.
getLicenceTypeCode
().
split
(
","
);
List
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getIsDelete
,
false
).
in
(
DataDictionary:
:
getCode
,
licenceTypeCode
));
String
licenceType
=
""
;
for
(
DataDictionary
temp
:
list
)
{
licenceType
+=
","
+
temp
.
getName
();
}
if
(
licenceType
.
length
()
>
0
)
{
licenceType
=
licenceType
.
substring
(
1
);
personQualityDto
.
setLicenceType
(
licenceType
);
}
// 创建人员资质信息
personQualityDto
.
setPsersonId
(
result
.
getSequenceNbr
());
personQualityDto
=
flcPersonQualityServiceImpl
.
createWithModel
(
personQualityDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_INFO
,
personQualityDto
.
getLicenceInfo
());
iSourceFileService
.
saveAttachments
(
personQualityDto
.
getSequenceNbr
(),
userAttach
);
}
if
(
personEducationDto
!=
null
)
{
// 创建人员教育信息
personEducationDto
.
setPsersonId
(
result
.
getSequenceNbr
());
personEducationDto
=
personEducationServiceImpl
.
createWithModel
(
personEducationDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
ATTACHMENT
,
personEducationDto
.
getAttachment
());
iSourceFileService
.
saveAttachments
(
personEducationDto
.
getSequenceNbr
(),
userAttach
);
}
// 创建账号信息
if
(
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr1
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr2
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr3
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr4
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr5
()
))
{
String
roleName
=
unitPersonInfoDto
.
getOrgExpandAttr5
();
Long
companyId
=
Long
.
parseLong
(
unitPersonInfoDto
.
getOrgExpandAttr3
());
String
appcode
=
unitPersonInfoDto
.
getOrgExpandAttr4
();
// 创建人员账户信息
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setUserName
(
unitPersonInfoDto
.
getOrgExpandAttr1
());
agencyUserModel
.
setRealName
(
unitPersonInfoDto
.
getBizOrgName
());
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setPassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setRePassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setAgencyCode
(
"tzs"
);
// agencyUserModel.setMobile(adminTel); 不存储电话信息
// 所属组织
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
RoleModel
>
allRoleList
=
roleListResult
.
getResult
();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
allRoleList
.
stream
().
forEach
(
t
->
{
if
(
t
.
getRoleName
().
equals
(
roleName
))
{
userRoleList
.
add
(
t
);
}
});
userRoleList
.
stream
().
forEach
(
r
->
{
roleIds
.
add
(
r
.
getSequenceNbr
());
});
roleSeqsMap
.
put
(
companyId
,
roleIds
);
List
<
String
>
appCodes
=
new
ArrayList
<>();
appCodes
.
add
(
appcode
);
agencyUserModel
.
setAppCodes
(
appCodes
);
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
orgRoles
.
put
(
companyId
,
userRoleList
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
agencyUserModel
=
userResult
.
getResult
();
orgPersonVo
.
setSequenceNbr
(
result
.
getSequenceNbr
());
orgPersonVo
.
setAmosOrgId
(
agencyUserModel
.
getUserId
()
+
""
);
result
=
iOrgUsrService
.
saveOrgPersonFlc
(
orgPersonVo
);
BeanUtils
.
copyProperties
(
result
,
unitPersonInfoDto
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
unitPersonInfoDto
;
}
@Transactional
@Override
public
UnitPersonInfoDto
updateUser
(
UnitPersonInfoDto
unitPersonInfoDto
)
{
unitPersonInfoDto
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
OrgPersonDto
orgPersonVo
=
new
OrgPersonDto
();
if
(
StringUtils
.
isNotBlank
(
unitPersonInfoDto
.
getOrgExpandAttr2
()))
{
String
pwd
=
DesUtil
.
encode
(
unitPersonInfoDto
.
getOrgExpandAttr2
(),
"qaz"
);
unitPersonInfoDto
.
setOrgExpandAttr2
(
pwd
);
}
// 只有parentId 需要手动填充name
OrgUsr
parent
=
iOrgUsrService
.
getById
(
Long
.
parseLong
(
unitPersonInfoDto
.
getParentId
()));
unitPersonInfoDto
.
setParentName
(
parent
.
getBizOrgName
());
BeanUtils
.
copyProperties
(
unitPersonInfoDto
,
orgPersonVo
);
try
{
iOrgUsrService
.
updateByIdOrgPersonFlc
(
orgPersonVo
,
unitPersonInfoDto
.
getSequenceNbr
());
PersonQualityDto
personQualityDto
=
unitPersonInfoDto
.
getPersonQualityDto
();
PersonEducationDto
personEducationDto
=
unitPersonInfoDto
.
getPersonEducationDto
();
// 处理图片信息 -- 证照和图片
Map
<
String
,
List
<
AttachmentDto
>>
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_PIC
,
unitPersonInfoDto
.
getLicencePic
());
userAttach
.
put
(
TzsCommonParam
.
HEAD_SHOT
,
unitPersonInfoDto
.
getHeadshot
());
iSourceFileService
.
saveAttachments
(
unitPersonInfoDto
.
getSequenceNbr
(),
userAttach
);
if
(
personQualityDto
!=
null
)
{
String
[]
licenceTypeCode
=
personQualityDto
.
getLicenceTypeCode
().
split
(
","
);
List
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getIsDelete
,
false
).
in
(
DataDictionary:
:
getCode
,
licenceTypeCode
));
String
licenceType
=
""
;
for
(
DataDictionary
temp
:
list
)
{
licenceType
+=
","
+
temp
.
getName
();
}
if
(
licenceType
.
length
()
>
0
)
{
licenceType
=
licenceType
.
substring
(
1
);
personQualityDto
.
setLicenceType
(
licenceType
);
}
// 更新人员资质信息
personQualityDto
.
setPsersonId
(
unitPersonInfoDto
.
getSequenceNbr
());
personQualityDto
=
flcPersonQualityServiceImpl
.
updateWithModel
(
personQualityDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_INFO
,
personQualityDto
.
getLicenceInfo
());
iSourceFileService
.
saveAttachments
(
personQualityDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonQualityDto
(
personQualityDto
);
}
if
(
personEducationDto
!=
null
)
{
// 更新人员教育信息
personEducationDto
.
setPsersonId
(
unitPersonInfoDto
.
getSequenceNbr
());
personEducationDto
=
personEducationServiceImpl
.
updateWithModel
(
personEducationDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
ATTACHMENT
,
personEducationDto
.
getAttachment
());
iSourceFileService
.
saveAttachments
(
personEducationDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonEducationDto
(
personEducationDto
);
}
// 更新账号信息
if
(
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr1
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr2
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr3
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr4
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr5
()
))
{
String
roleName
=
unitPersonInfoDto
.
getOrgExpandAttr5
();
String
orgId
=
unitPersonInfoDto
.
getOrgExpandAttr3
();
// 拿到的是 org_user的id 需要转换成amosid
OrgUsr
temp
=
iOrgUsrService
.
getById
(
Long
.
parseLong
(
orgId
));
Long
companyId
=
Long
.
parseLong
(
temp
.
getAmosOrgId
());
String
appcode
=
unitPersonInfoDto
.
getOrgExpandAttr4
();
// 创建人员账户信息
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
AgencyUserModel
agencyUserModel
=
Privilege
.
agencyUserClient
.
queryByUserId
(
orgPersonVo
.
getAmosOrgId
()).
getResult
();
agencyUserModel
.
setUserName
(
unitPersonInfoDto
.
getOrgExpandAttr1
());
agencyUserModel
.
setRealName
(
unitPersonInfoDto
.
getBizOrgName
());
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setPassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setRePassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setAgencyCode
(
"tzs"
);
// agencyUserModel.setMobile(adminTel); 不存储电话信息
// 所属组织
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
RoleModel
>
allRoleList
=
roleListResult
.
getResult
();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
allRoleList
.
stream
().
forEach
(
t
->
{
if
(
t
.
getRoleName
().
equals
(
roleName
))
{
userRoleList
.
add
(
t
);
}
});
userRoleList
.
stream
().
forEach
(
r
->
{
roleIds
.
add
(
r
.
getSequenceNbr
());
});
roleSeqsMap
.
put
(
companyId
,
roleIds
);
List
<
String
>
appCodes
=
new
ArrayList
<>();
appCodes
.
add
(
appcode
);
agencyUserModel
.
setAppCodes
(
appCodes
);
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
orgRoles
.
put
(
companyId
,
userRoleList
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
orgPersonVo
.
getAmosOrgId
());
// 密码另外更新
Privilege
.
agencyUserClient
.
modifyPassword
(
orgPersonVo
.
getAmosOrgId
(),
agencyUserModel
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
unitPersonInfoDto
;
}
public
String
saveQrCode
(
OrgPersonFormDto
orgPerson
)
{
public
String
saveQrCode
(
OrgPersonFormDto
orgPerson
)
{
// 二维码生成规则 人员类型 企业编码 人员编号
// 二维码生成规则 人员类型 企业编码 人员编号
...
...
amos-boot-system-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
View file @
f5df4d7d
...
@@ -444,6 +444,29 @@
...
@@ -444,6 +444,29 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"kongfm"
id=
"2021-11-25-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<sqlCheck
expectedResult=
"1"
>
select count(*) from cb_dynamic_form_column where sequence_nbr = 10
</sqlCheck>
</preConditions>
<comment>
delete person record
</comment>
<sql>
delete FROM cb_dynamic_form_column where sequence_nbr = 10;
delete FROM cb_dynamic_form_column where sequence_nbr = 11;
delete FROM cb_dynamic_form_column where sequence_nbr = 12;
delete FROM cb_dynamic_form_column where sequence_nbr = 13;
</sql>
</changeSet>
<changeSet
author=
"kongfm"
id=
"2021-11-26-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"tz_flc_person_quality"
/>
</preConditions>
<comment>
modify table tz_flc_person_quality add licence_date columns
</comment>
<sql>
ALTER TABLE `tz_flc_person_quality` add licence_date datetime COMMENT '发证日期';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
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