fixed:新增无权限企业列表(临时)
parent
65597d3927
commit
faed5624b1
|
|
@ -55,6 +55,12 @@ public class CorpInfoController {
|
|||
public PageResponse<CorpInfoCO> page(@Validated @RequestBody CorpInfoPageQry qry) {
|
||||
return corpInfoService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/listNoPms")
|
||||
public PageResponse<CorpInfoCO> list(@Validated @RequestBody CorpInfoPageQry qry) {
|
||||
return corpInfoService.listPageNoPms(qry);
|
||||
}
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<CorpInfoCO> listAll(CorpInfoQry corpInfoQry) {
|
||||
|
|
|
|||
|
|
@ -86,6 +86,36 @@ public class CorpInfoQueryExe {
|
|||
});
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public PageResponse<CorpInfoCO> executeNoPms(CorpInfoPageQry corpInfoPageQry) {
|
||||
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(corpInfoPageQry);
|
||||
if (corpInfoPageQry.getLeCreateTime() != null) {
|
||||
parmas.put("leCreateTime", corpInfoPageQry.getLeCreateTime().plusDays(1));
|
||||
}
|
||||
PageResponse<CorpInfoDO> pageResponse = corpInfoRepository.listPageNoPms(parmas);
|
||||
List<CorpInfoCO> examCenterCOS = corpInfoCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
if (CollUtil.isEmpty(examCenterCOS)) {
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
//examCenterCOS获取id集合
|
||||
List<Long> corpInfoIdList = examCenterCOS.stream().map(CorpInfoCO::getId).collect(Collectors.toList());
|
||||
List<CorpFormDO> corpFormDOList = corpFormRepository.getCorpListByTypeList(corpInfoIdList, Arrays.asList(CorpFormTypeEnum.SELECTFROM.getCode()));
|
||||
//corpFormDOList 按照企业分组
|
||||
Map<Long, List<CorpFormDO>> groupedByCorpInfoId = corpFormDOList.stream()
|
||||
.collect(Collectors.groupingBy(CorpFormDO::getInfoId));
|
||||
// 组装营业执照和多选框
|
||||
examCenterCOS.forEach(info -> {
|
||||
if (CollUtil.isNotEmpty(groupedByCorpInfoId) && CollUtil.isNotEmpty(groupedByCorpInfoId.get(info.getId()))) {
|
||||
//infoByTypeList name按照逗号分隔
|
||||
info.setSelectfromString(groupedByCorpInfoId.get(info.getId()).stream()
|
||||
.map(CorpFormDO::getItemName)
|
||||
.collect(Collectors.joining(",")));
|
||||
}
|
||||
});
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public MultiResponse<CorpInfoCO> executeListAll(CorpInfoQry corpInfoQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(corpInfoQry);
|
||||
List<CorpInfoDO> corpInfoDOList = corpInfoRepository.listAll(params);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ public class CorpInfoServiceImpl implements CorpInfoServiceI {
|
|||
return corpInfoQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpInfoCO> listPageNoPms(CorpInfoPageQry qry) {
|
||||
return corpInfoQueryExe.executeNoPms(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<CorpInfoCO> listAll(CorpInfoQry corpInfoQry) {
|
||||
return corpInfoQueryExe.executeListAll(corpInfoQry);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface CorpInfoServiceI {
|
||||
PageResponse<CorpInfoCO> listPage(CorpInfoPageQry qry);
|
||||
PageResponse<CorpInfoCO> listPageNoPms(CorpInfoPageQry qry);
|
||||
|
||||
MultiResponse<CorpInfoCO> listAll(CorpInfoQry corpInfoQry);
|
||||
SingleResponse<CorpInfoCO> add(CorpInfoAddCmd cmd);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ public interface CorpInfoMapper extends BaseMapper<CorpInfoDO> {
|
|||
|
||||
IPage<CorpInfoDO> selectUserPage(IPage<CorpInfoDO> iPage, @Param("ew") QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms);
|
||||
|
||||
IPage<CorpInfoDO> selectUserPageNoPms(IPage<CorpInfoDO> iPage, @Param("ew") QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Map;
|
|||
*/
|
||||
public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
|
||||
PageResponse<CorpInfoDO> listPage(Map<String, Object> parmas);
|
||||
PageResponse<CorpInfoDO> listPageNoPms(Map<String, Object> parmas);
|
||||
List<CorpInfoDO> listAll(Map<String, Object> params);
|
||||
|
||||
Long getCorpCountByCorpName(String corpName);
|
||||
|
|
|
|||
|
|
@ -81,6 +81,25 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpInfoDO> listPageNoPms(Map<String, Object> params) {
|
||||
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
queryWrapper.in("type", enterpriseType);
|
||||
}
|
||||
queryWrapper.orderByAsc("corp_order").orderByDesc("create_time");
|
||||
String menuPerms = "";
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))) {
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.selectUserPageNoPms(iPage, queryWrapper, menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CorpInfoDO> listAll(Map<String, Object> params) {
|
||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
|
|
|
|||
|
|
@ -48,5 +48,11 @@
|
|||
FROM corp_info
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectUserPageNoPms" resultType="com.zcloud.basic.info.persistence.dataobject.CorpInfoDO">
|
||||
SELECT *
|
||||
FROM corp_info
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue