1、增加人员证书无权限接口
parent
defec9effa
commit
a6865ef4de
|
|
@ -44,9 +44,16 @@ public class UserCertificateController {
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@PreAuthorize("@pms.hasAnyPermission('gfd-tzzyrugl', 'gfd-tzsbczrygl', 'gfd-qyzyfzrgl','gfd-qyaqscglrygl', 'qyd-tzzyrugl', 'qyd-tzsbczrygl', 'qyd-zyfzrgl','qyd-aqscglrygl', 'xgfd-zyfzrgl', 'xgfd-tzzzsbczrygl', 'xgfd-aqscglrygl','xgfd-tzzyrugl')")
|
@PreAuthorize("@pms.hasAnyPermission('gfd-tzzyrugl', 'gfd-tzsbczrygl', 'gfd-qyzyfzrgl','gfd-qyaqscglrygl', 'qyd-tzzyrugl', 'qyd-tzsbczrygl', 'qyd-zyfzrgl','qyd-aqscglrygl', 'xgfd-zyfzrgl', 'xgfd-tzzzsbczrygl', 'xgfd-aqscglrygl','xgfd-tzzyrugl')")
|
||||||
public PageResponse<UserCertificateCO> page(@RequestBody UserCertificatePageQry qry) {
|
public PageResponse<UserCertificateCO> page(@RequestBody UserCertificatePageQry qry) {
|
||||||
return userCertificateService.listPage(qry);
|
return userCertificateService.listPage(qry, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页-无权限")
|
||||||
|
@PostMapping("/listPage")
|
||||||
|
public PageResponse<UserCertificateCO> listPage(@RequestBody UserCertificatePageQry qry) {
|
||||||
|
return userCertificateService.listPage(qry, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("所有数据")
|
@ApiOperation("所有数据")
|
||||||
@PostMapping("/listAll")
|
@PostMapping("/listAll")
|
||||||
public MultiResponse<UserCertificateCO> listAll(@RequestBody UserCertificatePageQry qry) {
|
public MultiResponse<UserCertificateCO> listAll(@RequestBody UserCertificatePageQry qry) {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class UserCertificateQueryExe {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public PageResponse<UserCertificateCO> execute(UserCertificatePageQry qry) {
|
public PageResponse<UserCertificateCO> execute(UserCertificatePageQry qry, boolean withPermission) {
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
if (qry.getIsAppQuery() != null) {
|
if (qry.getIsAppQuery() != null) {
|
||||||
qry.setEqUserId(ssoUser != null ? ssoUser.getUserId() : null);
|
qry.setEqUserId(ssoUser != null ? ssoUser.getUserId() : null);
|
||||||
|
|
@ -67,7 +67,10 @@ public class UserCertificateQueryExe {
|
||||||
|
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
PageResponse<UserCertificateDO> iPage = userCertificateRepository.listPageWithUser(params);
|
// 根据权限控制标识调用不同的 repository 方法
|
||||||
|
PageResponse<UserCertificateDO> iPage = withPermission
|
||||||
|
? userCertificateRepository.listPageWithUser(params)
|
||||||
|
: userCertificateRepository.listPageUser(params);
|
||||||
|
|
||||||
List<UserCertificateE> userCertificateES = userCertificateCoConvertor.converDOsToEs(iPage.getData());
|
List<UserCertificateE> userCertificateES = userCertificateCoConvertor.converDOsToEs(iPage.getData());
|
||||||
List<Long> userIds = userCertificateES.stream().map(UserCertificateE::getUserId).distinct().collect(Collectors.toList());
|
List<Long> userIds = userCertificateES.stream().map(UserCertificateE::getUserId).distinct().collect(Collectors.toList());
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ public class UserCertificateServiceImpl implements UserCertificateServiceI {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry){
|
public PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry, boolean withPermission){
|
||||||
|
|
||||||
return userCertificateQueryExe.execute(qry);
|
return userCertificateQueryExe.execute(qry, withPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
public interface UserCertificateServiceI {
|
public interface UserCertificateServiceI {
|
||||||
UserCertificateCO queryById(Long id);
|
UserCertificateCO queryById(Long id);
|
||||||
|
|
||||||
PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry);
|
PageResponse<UserCertificateCO> listPage(UserCertificatePageQry qry, boolean withPermission);
|
||||||
|
|
||||||
SingleResponse<UserCertificateCO> add(UserCertificateAddCmd cmd);
|
SingleResponse<UserCertificateCO> add(UserCertificateAddCmd cmd);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,5 +75,11 @@ public class UserCertificatePageQry extends PageQuery {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "用户ids", name = "inUserIds")
|
@ApiModelProperty(value = "用户ids", name = "inUserIds")
|
||||||
private List<Long> inUserId;;
|
private List<Long> inUserId;;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书类型集合
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "证书类型集合", name = "inCertificateTypes")
|
||||||
|
private List<String> inType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@ public interface UserCertificateMapper extends BaseMapper<UserCertificateDO> {
|
||||||
*/
|
*/
|
||||||
IPage<UserCertificateDO> selectPageWithUser(IPage<UserCertificateDO> page, @Param("params") Map<String, Object> params);
|
IPage<UserCertificateDO> selectPageWithUser(IPage<UserCertificateDO> page, @Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询用户证书信息,包含用户名称,无权限控制
|
||||||
|
*/
|
||||||
|
IPage<UserCertificateDO> selectPageUser(IPage<UserCertificateDO> page, @Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ public interface UserCertificateRepository extends BaseRepository<UserCertificat
|
||||||
*/
|
*/
|
||||||
PageResponse<UserCertificateDO> listPageWithUser(Map<String, Object> params);
|
PageResponse<UserCertificateDO> listPageWithUser(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询包含用户信息,无权限控制
|
||||||
|
*/
|
||||||
|
PageResponse<UserCertificateDO> listPageUser(Map<String, Object> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
* 根据企业/相关方类型查询各企业/相关方各类人员证书数量
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,13 @@ public class UserCertificateRepositoryImpl extends BaseRepositoryImpl<UserCertif
|
||||||
return PageHelper.pageToResponse(iPage, iPage.getRecords());
|
return PageHelper.pageToResponse(iPage, iPage.getRecords());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserCertificateDO> listPageUser(Map<String, Object> params) {
|
||||||
|
IPage<UserCertificateDO> page = new Query<UserCertificateDO>().getPage(params);
|
||||||
|
IPage<UserCertificateDO> iPage = userCertificateMapper.selectPageUser(page, params);
|
||||||
|
return PageHelper.pageToResponse(iPage, iPage.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<UserCertificateStatDO> selectCorpCertificateStatPage(Map<String, Object> params) {
|
public PageResponse<UserCertificateStatDO> selectCorpCertificateStatPage(Map<String, Object> params) {
|
||||||
IPage<UserCertificateDO> page = new Query<UserCertificateDO>().getPage(params);
|
IPage<UserCertificateDO> page = new Query<UserCertificateDO>().getPage(params);
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,63 @@
|
||||||
ORDER BY uc.create_time DESC
|
ORDER BY uc.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPageUser" resultType="com.zcloud.certificate.persistence.dataobject.UserCertificateDO">
|
||||||
|
SELECT
|
||||||
|
uc.*,
|
||||||
|
u.username AS userName,
|
||||||
|
u.employment_flag AS employmentStatus,
|
||||||
|
d.name AS departmentName,
|
||||||
|
p.corpinfo_name AS corpinfoName,
|
||||||
|
p.post_name AS postName
|
||||||
|
FROM
|
||||||
|
user_certificate uc
|
||||||
|
LEFT JOIN
|
||||||
|
user u ON u.id = uc.user_id
|
||||||
|
LEFT JOIN
|
||||||
|
department d ON d.id = u.department_id
|
||||||
|
LEFT JOIN
|
||||||
|
post p ON p.id = u.post_id
|
||||||
|
WHERE 1=1
|
||||||
|
AND uc.delete_enum = 'false'
|
||||||
|
<if test="params.tenantId != null">
|
||||||
|
AND uc.tenant_id = #{params.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="params.orgId != null">
|
||||||
|
AND uc.org_id = #{params.orgId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.likeUserName != null and params.likeUserName != ''">
|
||||||
|
AND u.username LIKE CONCAT('%', #{params.likeUserName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.eqIndustryCategoryCode != null and params.eqIndustryCategoryCode != ''">
|
||||||
|
AND uc.industry_category_code = #{params.eqIndustryCategoryCode}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqIndustryOperatingItemsCode != null and params.eqIndustryOperatingItemsCode != ''">
|
||||||
|
AND uc.industry_operating_items_code = #{params.eqIndustryOperatingItemsCode}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqType != null and params.eqType != ''">
|
||||||
|
AND uc.type = #{params.eqType}
|
||||||
|
</if>
|
||||||
|
<if test="params.eqCorpinfoId != null and params.eqCorpinfoId != ''">
|
||||||
|
AND uc.corpinfo_id = #{params.eqCorpinfoId}
|
||||||
|
</if>
|
||||||
|
<if test="params.likePostName != null and params.likePostName != ''">
|
||||||
|
AND uc.post_name LIKE CONCAT('%', #{params.likePostName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.eqUserId != null and params.eqUserId != ''">
|
||||||
|
AND uc.user_id = #{params.eqUserId}
|
||||||
|
</if>
|
||||||
|
<if test="params.inType != null and params.inType.size() > 0">
|
||||||
|
AND uc.type IN
|
||||||
|
<foreach collection="params.inType" item="type" open="(" separator="," close=")">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
ORDER BY uc.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectUserNamesByUserIds" resultType="com.zcloud.certificate.domain.model.UserBasicInfo">
|
<select id="selectUserNamesByUserIds" resultType="com.zcloud.certificate.domain.model.UserBasicInfo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue