企业增加多选条件及开户人

main
zhaokai 2025-12-01 16:23:53 +08:00
parent 51e98fe36b
commit 5c683b4d4a
18 changed files with 197 additions and 76 deletions

View File

@ -61,15 +61,23 @@ public class CorpInfoQueryExe {
}
PageResponse<CorpInfoDO> pageResponse = corpInfoRepository.listPage(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 -> {
Long corpInfoId = info.getId();
List<Integer> typeList = Arrays.asList(CorpFormTypeEnum.SELECTFROM.getCode());
List<CorpFormDO> infoByTypeList = corpFormRepository.getInfoByTypeList(corpInfoId, typeList);
Map<Integer, List<CorpFormDO>> groupedByType = infoByTypeList.stream()
.collect(Collectors.groupingBy(CorpFormDO::getType));
info.setSelectfromList(corpFormCoConvertor.converDOsToItemCOs(groupedByType.get(CorpFormTypeEnum.SELECTFROM.getCode())));
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());
}
@ -136,6 +144,16 @@ public class CorpInfoQueryExe {
Map<String, Object> parmas = PageQueryHelper.toHashMap(qry);
PageResponse<CorpInfoDO> pageResponse = corpInfoRepository.corpUserMiddlePage(parmas);
List<CorpUserMiddleCO> examCenterCOS = corpInfoCoConvertor.converDOsToMiddleCOs(pageResponse.getData());
if(CollUtil.isEmpty(examCenterCOS)){
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}
//examCenterCOS获取id集合
List<Long> corpInfoIdList = examCenterCOS.stream().map(CorpUserMiddleCO::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 -> {
info.setDepartMentCount(departmentRepository.getCountByCorpInfoId(info.getId()));
info.setPostCount(postRepository.getCountByCorpInfoId(info.getId()));
@ -158,7 +176,12 @@ public class CorpInfoQueryExe {
info.setSafetyUserCount(0L);
}
// info.setMiddleUserCount(departmentRepository.getCountByCorpInfoId(info.getId()));
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());

View File

@ -128,14 +128,15 @@ public class CorpInfoAddCmd extends Command {
private String countryName;
@ApiModelProperty(value = "所属区县编码", name = "country", required = true)
private String country;
@ApiModelProperty(value = "所属乡镇名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属乡镇编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "所属街道名称", name = "streetName", required = true)
@ApiModelProperty(value = "所属乡镇街道名称", name = "streetName", required = true)
private String streetName;
@ApiModelProperty(value = "所属街道编码", name = "street", required = true)
@ApiModelProperty(value = "所属乡镇街道编码", name = "street", required = true)
private String street;
@ApiModelProperty(value = "所属村居委会名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属村居委会编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "营业执照开始时间", name = "licenseStart", required = true)
@JsonFormat(pattern = "yyyy-MM-dd")

View File

@ -130,14 +130,14 @@ public class CorpInfoUpdateCmd extends Command {
private String countryName;
@ApiModelProperty(value = "所属区县编码", name = "country", required = true)
private String country;
@ApiModelProperty(value = "所属乡镇名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属乡镇编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "所属街道名称", name = "streetName", required = true)
@ApiModelProperty(value = "所属乡镇街道名称", name = "streetName", required = true)
private String streetName;
@ApiModelProperty(value = "所属街道编码", name = "street", required = true)
@ApiModelProperty(value = "所属乡镇街道编码", name = "street", required = true)
private String street;
@ApiModelProperty(value = "所属村居委会名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属村居委会编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "营业执照开始时间", name = "licenseStart", required = true)
@JsonFormat(pattern = "yyyy-MM-dd")

View File

@ -127,14 +127,14 @@ public class CorpInfoXgfUpdateCmd extends Command {
private String countryName;
@ApiModelProperty(value = "所属区县编码", name = "country", required = true)
private String country;
@ApiModelProperty(value = "所属乡镇名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属乡镇编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "所属街道名称", name = "streetName", required = true)
@ApiModelProperty(value = "所属乡镇街道名称", name = "streetName", required = true)
private String streetName;
@ApiModelProperty(value = "所属街道编码", name = "street", required = true)
@ApiModelProperty(value = "所属乡镇街道编码", name = "street", required = true)
private String street;
@ApiModelProperty(value = "所属村居委会名称", name = "villageName", required = true)
private String villageName;
@ApiModelProperty(value = "所属村居委会编码", name = "village", required = true)
private String village;
@ApiModelProperty(value = "营业执照开始时间", name = "licenseStart", required = true)
@JsonFormat(pattern = "yyyy-MM-dd")

View File

@ -43,5 +43,7 @@ public class CorpUserMiddleQry extends PageQuery {
@ApiModelProperty(value = "企业类型0-普通企业1-集团单位2-股份单位3-相关方企业4-货主单位5-驻港单位", name = "eqType")
private String eqType;
@ApiModelProperty(value = "选取形式", name = "selectFrom")
private String selectFrom;
}

View File

@ -165,18 +165,14 @@ public class CorpInfoCO extends ClientObject {
//所属区县编码
@ApiModelProperty(value = "所属区县编码")
private String country;
//所属乡镇名称
@ApiModelProperty(value = "所属乡镇名称")
private String villageName;
//所属乡镇编码
@ApiModelProperty(value = "所属乡镇编码")
private String village;
//所属街道名称
@ApiModelProperty(value = "所属街道名称")
@ApiModelProperty(value = "所属乡镇街道名称")
private String streetName;
//所属街道编码
@ApiModelProperty(value = "所属街道编码")
@ApiModelProperty(value = "所属乡镇街道编码")
private String street;
@ApiModelProperty(value = "所属村居委会名称")
private String villageName;
@ApiModelProperty(value = "所属村居委会编码")
private String village;
@ApiModelProperty(value = "营业执照开始时间")
private LocalDate licenseStart;
@ -262,5 +258,6 @@ public class CorpInfoCO extends ClientObject {
@ApiModelProperty(value = "选取形式", name = "selectfromList", required = true)
private List<CorpInfoXgfItemCO> selectfromList;
private String selectfromString;
}

View File

@ -162,18 +162,19 @@ public class CorpInfoXgfCO extends ClientObject {
//所属区县编码
@ApiModelProperty(value = "所属区县编码")
private String country;
//所属乡镇名称
@ApiModelProperty(value = "所属乡镇名称")
private String villageName;
//所属乡镇编码
@ApiModelProperty(value = "所属乡镇编码")
private String village;
//所属街道名称
@ApiModelProperty(value = "所属街道名称")
@ApiModelProperty(value = "所属乡镇街道名称")
private String streetName;
//所属街道编码
@ApiModelProperty(value = "所属街道编码")
@ApiModelProperty(value = "所属乡镇街道编码")
private String street;
//所属乡镇名称
@ApiModelProperty(value = "所属村居委会名称")
private String villageName;
//所属乡镇编码
@ApiModelProperty(value = "所属村居委会编码")
private String village;
@ApiModelProperty(value = "营业执照开始时间")
private LocalDate licenseStart;

View File

@ -4,6 +4,8 @@ import com.alibaba.cola.dto.ClientObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* web-client
@ -50,5 +52,40 @@ public class CorpUserMiddleCO extends ClientObject {
@ApiModelProperty(value = "特种作业人员信息数量")
private Long specialUserCount;
//所属省名称
@ApiModelProperty(value = "所属省名称")
private String provinceName;
//所属省编码
@ApiModelProperty(value = "所属省编码")
private String province;
//所属市级名称
@ApiModelProperty(value = "所属市级名称")
private String cityName;
//所属市级编码
@ApiModelProperty(value = "所属市级编码")
private String city;
//所属区县名称
@ApiModelProperty(value = "所属区县名称")
private String countryName;
//所属区县编码
@ApiModelProperty(value = "所属区县编码")
private String country;
//所属街道名称
@ApiModelProperty(value = "所属乡镇街道名称")
private String streetName;
//所属街道编码
@ApiModelProperty(value = "所属乡镇街道编码")
private String street;
//所属乡镇名称
@ApiModelProperty(value = "所属村居委会名称")
private String villageName;
//所属乡镇编码
@ApiModelProperty(value = "所属村居委会编码")
private String village;
@ApiModelProperty(value = "选取形式")
private String selectfromString;
}

View File

@ -124,15 +124,15 @@ public class CorpInfoE extends BaseE {
private String countryName;
//所属区县编码
private String country;
//所属乡镇名称
private String villageName;
//所属乡镇编码
private String village;
//所属街道名称
private String streetName;
//所属街道编码
private String street;
//所属乡镇街道名称
private String streetName;
//所属乡镇街道编码
private String street;
//所属所属村居委会名称
private String villageName;
//所属所属村居委会编码
private String village;
//营业执照开始时间
private LocalDate licenseStart;
//营业执照结束时间

View File

@ -116,14 +116,14 @@ public class CorpInfoXgfE extends BaseE {
private String countryName;
//所属区县编码
private String country;
//所属乡镇名称
private String villageName;
//所属乡镇编码
private String village;
//所属街道名称
private String streetName;
//所属街道编码
private String street;
//所属村居委会名称
private String villageName;
//所属村居委会编码
private String village;
//营业执照开始时间
private LocalDate licenseStart;

View File

@ -166,18 +166,19 @@ public class CorpInfoDO extends BaseDO {
//所属区县编码
@ApiModelProperty(value = "所属区县编码")
private String country;
//所属乡镇名称
@ApiModelProperty(value = "所属乡镇名称")
private String villageName;
//所属乡镇编码
@ApiModelProperty(value = "所属乡镇编码")
private String village;
//所属街道名称
@ApiModelProperty(value = "所属街道名称")
//所属乡镇街道名称
@ApiModelProperty(value = "所属乡镇街道名称")
private String streetName;
//所属街道编码
@ApiModelProperty(value = "所属街道编码")
//所属乡镇街道编码
@ApiModelProperty(value = "所属乡镇街道编码")
private String street;
//所属村居委会名称
@ApiModelProperty(value = "所属村居委会名称")
private String villageName;
//所属村居委会编码
@ApiModelProperty(value = "所属村居委会编码")
private String village;
//营业执照开始时间
@ApiModelProperty(value = "营业执照开始时间")
@ -241,6 +242,9 @@ public class CorpInfoDO extends BaseDO {
@ApiModelProperty(value = "密码")
@TableField(exist = false)
private String password;
// @ApiModelProperty(value = "选取形式")
// @TableField(exist = false)
// private String selectfromString;
}

View File

@ -17,5 +17,7 @@ import java.util.List;
public interface CorpFormMapper extends BaseMapper<CorpFormDO> {
List<CorpFormDO> selectListByType(@Param("infoId") Long infoId, @Param("typeList") List<Integer> typeList);
List<CorpFormDO> getCorpListByTypeList(List<Long> corpInfoIdList, List<Integer> typeList);
}

View File

@ -1,11 +1,14 @@
package com.zcloud.basic.info.persistence.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.datascope.annotation.DataScope;
import com.jjb.saas.framework.datascope.annotation.DataScopes;
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/**
* web-infrastructure
*
@ -15,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CorpInfoMapper extends BaseMapper<CorpInfoDO> {
IPage<CorpInfoDO> corpUserMiddlePage(IPage<CorpInfoDO> iPage, Map<String, Object> params);
}

View File

@ -20,6 +20,7 @@ public interface CorpFormRepository extends BaseRepository<CorpFormDO> {
List<CorpFormDO> getInfoByType(Long id, Integer type);
List<CorpFormDO> getInfoByTypeList(Long corpInfoId, List<Integer> typeList);
List<CorpFormDO> getCorpListByTypeList(List<Long> corpInfoId, List<Integer> typeList);
void addBatch(List<CorpFormDO> filteredList);
}

View File

@ -53,6 +53,12 @@ public class CorpFormRepositoryImpl extends BaseRepositoryImpl<CorpFormMapper, C
return corpFormDOList;
}
@Override
public List<CorpFormDO> getCorpListByTypeList(List<Long> corpInfoIdList, List<Integer> typeList) {
List<CorpFormDO> corpFormDOList = corpFormMapper.getCorpListByTypeList(corpInfoIdList,typeList);
return corpFormDOList;
}
@Override
public void addBatch(List<CorpFormDO> filteredList) {
this.saveBatch(filteredList);

View File

@ -173,18 +173,17 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
@Override
public PageResponse<CorpInfoDO> corpUserMiddlePage(Map<String, Object> params) {
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
if(ObjectUtil.isNotNull(params.get("enterpriseType"))){
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
if(CollUtil.isNotEmpty(enterpriseType)){
queryWrapper.in("type",enterpriseType );
}
if(ObjectUtil.isNotEmpty(params.get("eqType"))){
params.put("type", Arrays.asList(params.get("eqType")));
}else{
queryWrapper.in("type", CorpTypeEnum.OrdinaryEnterprises.getCode(), CorpTypeEnum.groupUnits.getCode());
if(ObjectUtil.isNotEmpty(params.get("enterpriseType"))){
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
if(CollUtil.isNotEmpty(enterpriseType)){
params.put("type", enterpriseType);
}
}
}
queryWrapper.orderByAsc("corp_order").orderByDesc("create_time");
IPage<CorpInfoDO> result = corpInfoMapper.selectPage(iPage, queryWrapper);
IPage<CorpInfoDO> result = corpInfoMapper.corpUserMiddlePage(iPage,params);
return PageHelper.pageToResponse(result, result.getRecords());
}
}

View File

@ -22,5 +22,26 @@
#{type}
</foreach>
</select>
<select id="getCorpListByTypeList" resultType="com.zcloud.basic.info.persistence.dataobject.CorpFormDO">
SELECT
f.type,
f.info_id AS infoId,
f.item_code AS itemCode,
f.item_name AS itemName,
c.corp_name AS corpName
FROM
corp_form f
LEFT JOIN corp_info c ON f.info_id = c.id
WHERE
f.info_id IN
<foreach collection="corpInfoIdList" item="infoId" open="(" close=")" separator=",">
#{infoId}
</foreach>
AND f.type IN
<foreach collection="typeList" item="type" open="(" close=")" separator=",">
#{type}
</foreach>
AND f.delete_enum='false'
</select>
</mapper>

View File

@ -4,5 +4,28 @@
<mapper namespace="com.zcloud.basic.info.persistence.mapper.CorpInfoMapper">
<select id="corpUserMiddlePage" resultType="com.zcloud.basic.info.persistence.dataobject.CorpInfoDO">
SELECT c.*
FROM corp_info c
LEFT JOIN corp_form f ON c.id = f.info_id
WHERE
c.delete_enum='false'
<if test="params.type != null">
AND c.type IN
<foreach collection="params.type" item="type" open="(" close=")" separator=",">
#{type}
</foreach>
</if>
<if test="params.selectFrom != null and params.selectFrom.trim() != ''">
AND f.item_code = #{params.selectFrom}
</if>
<if test="params.likeCorpName != null and params.likeCorpName.trim() != ''">
AND c.corp_name like concat('%',#{params.likeCorpName},'%')
</if>
group by c.id
ORDER BY
c.corp_order ASC,
c.create_time DESC
</select>
</mapper>