| | |
| | | |
| | | public static final String PB_CHECK_UNIT_ERROR_LIST = "PB_CHECK_UNIT_ERROR_LIST_"; |
| | | |
| | | public static final String PB_MEMBER_ROLE_ERROR_LIST = "PB_MEMBER_ROLE_ERROR_LIST_"; |
| | | |
| | | public static final String CLUSTER_MEMBER_DEFAULT_IMAGE_URL = "https://www.psciio.com/files/4822602b68af48bcbbea7842aa463227/a6a7882b3fd24d60ac6809fef42d879d.png"; |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 党委标签枚举 |
| | | */ |
| | | @Getter |
| | | public enum ComPbMemberRoleTypeEnum { |
| | | |
| | | SQDW(1, "社区党委"), CYDWWY(2, "区域党委委员"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | ComPbMemberRoleTypeEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (ComPbMemberRoleTypeEnum item : ComPbMemberRoleTypeEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (ComPbMemberRoleTypeEnum item : ComPbMemberRoleTypeEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleErrorExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.utlis.ListUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * title: 社区党委导入监听 |
| | | * @author : lyq |
| | | */ |
| | | @Slf4j |
| | | public class ComPbMemberRoleExcelListen extends AnalysisEventListener<Map<Integer, String>> { |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 3000; |
| | | private static int headSize = 0; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | private PartyBuildingService partyBuildingService;; |
| | | private Long communityId; |
| | | private Long userId; |
| | | private Map<Integer, String> headData; |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | public ComPbMemberRoleExcelListen(PartyBuildingService partyBuildingService, Long communityId, Long userId, |
| | | StringRedisTemplate stringRedisTemplate) { |
| | | this.partyBuildingService = partyBuildingService; |
| | | this.communityId = communityId; |
| | | this.userId = userId; |
| | | this.stringRedisTemplate = stringRedisTemplate; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(Map<Integer, String> data, AnalysisContext context) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | saveData(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里会一行行的返回头 |
| | | * |
| | | * @param headMap |
| | | * @param context |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | headSize = headMap.size(); |
| | | headData = headMap; |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | saveData(); |
| | | log.info("所有数据解析完成!"); |
| | | } |
| | | |
| | | /** |
| | | * 不是固定的列只能手动处理 |
| | | */ |
| | | private void saveData() { |
| | | log.info("表格总数据:" + list.size()); |
| | | if (list.size() == 0) { |
| | | throw new ServiceException("000", "导入数据为空!"); |
| | | } |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String key = Constants.PB_MEMBER_ROLE_ERROR_LIST + communityId; |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComPbMemberRoleExcelVo> voList = Lists.newArrayList(); |
| | | ArrayList<ComPbMemberRoleErrorExcelVo> mistakes = Lists.newArrayList(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComPbMemberRoleExcelVo vo = new ComPbMemberRoleExcelVo(); |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"党员姓名不可为空,请填写党员姓名")); |
| | | continue; |
| | | }else{ |
| | | //判断导入的名字的长度是否超过30 |
| | | if(oneData.get(0).length() > 10){ |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"党员姓名长度不可超过10,请重新填写党员姓名")); |
| | | continue; |
| | | } |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if (StringUtils.isEmpty(oneData.get(1))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"身份证号不可为空,请填写身份证号")); |
| | | continue; |
| | | } |
| | | vo.setIdCard(oneData.get(1)); |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(2))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"手机号不可为空,请填写手机号")); |
| | | continue; |
| | | } |
| | | vo.setPhone(oneData.get(2)); |
| | | |
| | | if (StringUtils.isNotEmpty(oneData.get(3))) { |
| | | vo.setTypeName(oneData.get(3)); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(4))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"入党日期不可为空,请填写入党日期")); |
| | | continue; |
| | | } |
| | | vo.setJoinTime(oneData.get(4)); |
| | | |
| | | if (StringUtils.isNotEmpty(oneData.get(5))) { |
| | | vo.setEmploymentTime(oneData.get(5)); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(6))) { |
| | | vo.setPosition(oneData.get(6)); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(7))) { |
| | | vo.setJobResponsibilities(oneData.get(7)); |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | List<ComPbMemberRoleExcelVo> newVoList = |
| | | voList.stream().filter(ListUtils.distinctByKey(ComPbMemberRoleExcelVo::getIdCard)) |
| | | .collect(Collectors.toList()); |
| | | R r = partyBuildingService.importPbMemberRole(newVoList, communityId, userId); |
| | | if (!R.isOk(r)) { |
| | | List<ComPbMemberRoleErrorExcelVo> list = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPbMemberRoleErrorExcelVo.class); |
| | | mistakes.addAll(list); |
| | | valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); |
| | | throw new ServiceException("500", key); |
| | | } else { |
| | | if (!mistakes.isEmpty()) { |
| | | valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); |
| | | throw new ServiceException("500", key); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | throw new ServiceException("500", "导入失败"); |
| | | } |
| | | } |
| | | |
| | | private void setError(Map<Integer, String> map, ComPbMemberRoleErrorExcelVo vo) { |
| | | vo.setName(map.get(0)); |
| | | vo.setIdCard(map.get(1)); |
| | | vo.setPhone(map.get(2)); |
| | | vo.setTypeName(map.get(3)); |
| | | vo.setJoinTime(map.get(4)); |
| | | vo.setEmploymentTime(map.get(5)); |
| | | vo.setPosition(map.get(6)); |
| | | vo.setJobResponsibilities(map.get(7)); |
| | | } |
| | | |
| | | /** |
| | | * 组装错误信息 |
| | | * @param oneData 数据表格对象 |
| | | * @param error 错误信息 |
| | | * @return 错误对象 |
| | | */ |
| | | private ComPbMemberRoleErrorExcelVo setErrorObject(Map<Integer, String> oneData, String error){ |
| | | ComPbMemberRoleErrorExcelVo mistake = new ComPbMemberRoleErrorExcelVo(); |
| | | setError(oneData, mistake); |
| | | mistake.setError(error); |
| | | return mistake; |
| | | } |
| | | } |
| | |
| | | @NotBlank(message = "投票结果不能为空", groups = {PutGroup.class}) |
| | | private String publishResult; |
| | | |
| | | @ApiModelProperty("议事内容类型(1.社区议事 2.院落议事 3.党群议事)") |
| | | private Integer contentType; |
| | | |
| | | /** |
| | | * 类型 1 议事 2 投票 |
| | | */ |
New file |
| | |
| | | package com.panzhihua.common.model.vos.partybuilding.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询党建数据统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询党建数据统计返回参数") |
| | | public class ComDataStatisticsMemberExcelVo { |
| | | |
| | | @ExcelProperty(value = "序号", index = 0) |
| | | private Long id; |
| | | |
| | | @ExcelProperty(value = "党员姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "党龄", index = 2) |
| | | private Integer partyAge; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 4) |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "职能", index = 5) |
| | | private String function; |
| | | |
| | | @ExcelProperty(value = "特长", index = 6) |
| | | private String specialtyName; |
| | | |
| | | @ExcelProperty(value = "双报道单位", index = 7) |
| | | private String checkUnitName; |
| | | |
| | | @ExcelProperty(value = "总参与活动次数", index = 8) |
| | | private Integer activityCount; |
| | | |
| | | @ExcelProperty(value = "总参与活动时长(小时)", index = 9) |
| | | private Integer activityDuration; |
| | | |
| | | @ExcelProperty(value = "参与党员活动次数", index = 10) |
| | | private Integer partyActivityCount; |
| | | |
| | | @ExcelProperty(value = "参与党员活动时长(小时)", index = 11) |
| | | private Integer partyActivityDuration; |
| | | |
| | | @ExcelProperty(value = "参与党员活动积分", index = 12) |
| | | private Integer partyActivityIntegral; |
| | | |
| | | @ExcelProperty(value = "参与志愿者活动次数", index = 13) |
| | | private Integer volunteerActivityCount; |
| | | |
| | | @ExcelProperty(value = "参与志愿者活动时长(小时)", index = 14) |
| | | private Integer volunteerActivityDuration; |
| | | |
| | | @ExcelProperty(value = "参与志愿者活动积分", index = 15) |
| | | private Integer volunteerActivityIntegral; |
| | | |
| | | @ExcelProperty(value = "完成微心愿数量", index = 16) |
| | | private Integer wishCount; |
| | | |
| | | @ExcelProperty(value = "完成随手拍数量", index = 17) |
| | | private Integer easyCount; |
| | | |
| | | private Long communityId; |
| | | |
| | | private Long userId; |
| | | |
| | | } |
| | |
| | | @ExcelProperty(value = "负责人联系电话", index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "错误信息", index = 7) |
| | | @ExcelProperty(value = "错误信息", index = 4) |
| | | private String error; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.partybuilding.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询党建数据统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询党建数据统计返回参数") |
| | | public class ComPbMemberRoleErrorExcelVo { |
| | | |
| | | |
| | | @ExcelProperty(value = "党员姓名", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 1) |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "手机号", index = 2) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "党委标签(社区党委/区域党委委员)", index = 3) |
| | | private String typeName; |
| | | |
| | | @ExcelProperty(value = "入党日期", index = 4) |
| | | private String joinTime; |
| | | |
| | | @ExcelProperty(value = "转正日期", index = 5) |
| | | private String employmentTime; |
| | | |
| | | @ExcelProperty(value = "职位", index = 6) |
| | | private String position; |
| | | |
| | | @ExcelProperty(value = "岗位职责", index = 7) |
| | | private String jobResponsibilities; |
| | | |
| | | @ExcelProperty(value = "错误信息", index = 8) |
| | | private String error; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.partybuilding.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询党建数据统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询党建数据统计返回参数") |
| | | public class ComPbMemberRoleExcelVo { |
| | | |
| | | |
| | | @ExcelProperty(value = "党员姓名", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份证号", index = 1) |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "手机号", index = 2) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "党委标签(社区党委/区域党委委员)", index = 3) |
| | | private String typeName; |
| | | |
| | | @ExcelProperty(value = "入党日期", index = 4) |
| | | private String joinTime; |
| | | |
| | | @ExcelProperty(value = "转正日期", index = 5) |
| | | private String employmentTime; |
| | | |
| | | @ExcelProperty(value = "职位", index = 6) |
| | | private String position; |
| | | |
| | | @ExcelProperty(value = "岗位职责", index = 7) |
| | | private String jobResponsibilities; |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | */ |
| | | @GetMapping("/partybuildIng/getHeaderOrgDataStatistics") |
| | | R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @PostMapping("/partybuildIng/exportDataStatisticsMember") |
| | | R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param memberRoleExcelVoList 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/partybuildIng/importPbMemberRole") |
| | | R importPbMemberRole(@RequestBody List<ComPbMemberRoleExcelVo> memberRoleExcelVoList,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId); |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeRightExcelAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeRightStatisticsAdminVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.partybuilding.ComDataStatisticsFeign; |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | | import com.panzhihua.community_backstage.config.SFTPConfig; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | |
| | | public R getHeaderOrgDataStatistics() { |
| | | return partyBuildingService.getHeaderOrgDataStatistics(this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员数据统计-导出党员数据") |
| | | @PostMapping("/dataStatistics/member/export") |
| | | public R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | statisticsMemberDto.setCommunityId(this.getCommunityId()); |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "党员数据统计-党员导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = partyBuildingService.exportDataStatisticsMember(statisticsMemberDto); |
| | | if (R.isOk(r)) { |
| | | List<ComDataStatisticsMemberExcelVo> resultList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComDataStatisticsMemberExcelVo.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComActReserveMakeRightExcelAdminVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党员导出数据").build(); |
| | | excelWriter.write(resultList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | } |
| | |
| | | return this.comPbCheckUnitService.queryByList(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * 批量导入报道单位 |
| | | * @param list 导入数据 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/importCheckUnit") |
| | | public R importCheckUnit(@RequestBody List<ComPbCheckUnitExcelVO> list, @RequestParam(value = "communityId") Long communityId |
| | | ,@RequestParam(value = "userId") Long userId){ |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId) { |
| | | return comPbMemberService.getHeaderOrgDataStatistics(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @PostMapping("/exportDataStatisticsMember") |
| | | public R exportDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | return comPbMemberService.exportDataStatisticsMember(statisticsMemberDto); |
| | | } |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param memberRoleExcelVoList 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/partybuildIng/importPbMemberRole") |
| | | public R importPbMemberRole(@RequestBody List<ComPbMemberRoleExcelVo> memberRoleExcelVoList,@RequestParam("communityId") Long communityId,@RequestParam("userId") Long userId){ |
| | | return comPbMemberService.importPbMemberRole(memberRoleExcelVoList,communityId,userId); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | ComDataStatisticsHeaderOrgVo getHeaderOrgDataStatistics(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | List<ComDataStatisticsMemberExcelVo> exportDataStatisticsMember(@Param("dto") PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | } |
| | |
| | | */ |
| | | R queryByList(PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * 批量导入报道单位 |
| | | * @param list 导入数据 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | R importCheckUnit(List<ComPbCheckUnitExcelVO> list, Long communityId, Long userId); |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | R getHeaderOrgDataStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | R exportDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param list 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | R importPbMemberRole(List<ComPbMemberRoleExcelVo> list, Long communityId, Long userId); |
| | | } |
| | |
| | | return R.ok(this.baseMapper.queryAllByList(comPbCheckUnit)); |
| | | } |
| | | |
| | | /** |
| | | * 批量导入报道单位 |
| | | * @param list 导入数据 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R importCheckUnit(List<ComPbCheckUnitExcelVO> list, Long communityId, Long userId){ |
| | |
| | | ComPbCheckUnitErrorExcelVO checkUnitError = new ComPbCheckUnitErrorExcelVO(); |
| | | BeanUtils.copyProperties(checkUnit,checkUnitError); |
| | | checkUnitError.setError("该单位已存在,不可重复导入"); |
| | | mistakes.add(checkUnitError); |
| | | }else{ |
| | | comPbCheckUnit = new ComPbCheckUnit(); |
| | | BeanUtils.copyProperties(checkUnit,comPbCheckUnit); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.ComPbMemberRoleTypeEnum; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleErrorExcelVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbMemberRoleExcelVo; |
| | | import com.panzhihua.service_dangjian.entity.ComPbCheckUnit; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | IPage<ComDataStatisticsMemberVo> memberPage = comPbMemberDAO.pageDataStatisticsMember(new Page(statisticsMemberDto.getPageNum() |
| | | ,statisticsMemberDto.getPageSize()),statisticsMemberDto); |
| | | memberPage.getRecords().forEach(member -> { |
| | | if(member.getIsRole() > 0){ |
| | | member.setIsRole(1); |
| | | }else{ |
| | | member.setIsRole(2); |
| | | } |
| | | try { |
| | | member.setAge(IdcardUtil.getAgeByIdCard(member.getIdCard())); |
| | | } catch (Exception e) { |
| | | log.error("年龄转义失败"); |
| | | } |
| | | //查询党员统计数据 |
| | | ComDataStatisticsMemberVo statisticsMemberVo = comPbMemberDAO.getMemberStatistics(member.getUserId(),member.getCommunityId()); |
| | | if(statisticsMemberVo != null){ |
| | |
| | | List<Long> orgIds = new ArrayList<>(); |
| | | Long communityId = statisticsOrgDto.getCommunityId(); |
| | | ComDataStatisticsOrgVo statisticsOrgVo = new ComDataStatisticsOrgVo(); |
| | | ComPbOrgDO pbOrgDO = comPbOrgDAO.selectById(statisticsOrgDto.getOrgId()); |
| | | if(pbOrgDO == null){ |
| | | return R.fail("未查询到党组织"); |
| | | } |
| | | //拼接党组织id |
| | | if(pbOrgDO.getOneId() != null){ |
| | | orgIds.add(pbOrgDO.getOneId()); |
| | | } |
| | | if(pbOrgDO.getTwoId() != null){ |
| | | orgIds.add(pbOrgDO.getTwoId()); |
| | | } |
| | | if(pbOrgDO.getThirdId() != null){ |
| | | orgIds.add(pbOrgDO.getThirdId()); |
| | | } |
| | | if(pbOrgDO.getFourId() != null){ |
| | | orgIds.add(pbOrgDO.getFourId()); |
| | | } |
| | | if(pbOrgDO.getFiveId() != null){ |
| | | orgIds.add(pbOrgDO.getFiveId()); |
| | | if(statisticsOrgDto.getOrgId() != null){ |
| | | ComPbOrgDO pbOrgDO = comPbOrgDAO.selectById(statisticsOrgDto.getOrgId()); |
| | | if(pbOrgDO == null){ |
| | | return R.fail("未查询到党组织"); |
| | | } |
| | | //拼接党组织id |
| | | if(pbOrgDO.getOneId() != null){ |
| | | orgIds.add(pbOrgDO.getOneId()); |
| | | } |
| | | if(pbOrgDO.getTwoId() != null){ |
| | | orgIds.add(pbOrgDO.getTwoId()); |
| | | } |
| | | if(pbOrgDO.getThirdId() != null){ |
| | | orgIds.add(pbOrgDO.getThirdId()); |
| | | } |
| | | if(pbOrgDO.getFourId() != null){ |
| | | orgIds.add(pbOrgDO.getFourId()); |
| | | } |
| | | if(pbOrgDO.getFiveId() != null){ |
| | | orgIds.add(pbOrgDO.getFiveId()); |
| | | } |
| | | } |
| | | //拼接查询开始结束时间 |
| | | String startTime = statisticsOrgDto.getYear() + "-01-01 00:00:00"; |
| | |
| | | return R.ok(headerOrgVo); |
| | | } |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | @Override |
| | | public R exportDataStatisticsMember(PageComDataStatisticsMemberDto statisticsMemberDto) { |
| | | List<ComDataStatisticsMemberExcelVo> memberList = comPbMemberDAO.exportDataStatisticsMember(statisticsMemberDto); |
| | | memberList.forEach(member -> { |
| | | //查询党员统计数据 |
| | | ComDataStatisticsMemberVo statisticsMemberVo = comPbMemberDAO.getMemberStatistics(member.getUserId(),member.getCommunityId()); |
| | | if(statisticsMemberVo != null){ |
| | | member.setPartyActivityCount(statisticsMemberVo.getPartyActivityCount()); |
| | | member.setPartyActivityDuration(statisticsMemberVo.getPartyActivityDuration()); |
| | | member.setVolunteerActivityCount(statisticsMemberVo.getVolunteerActivityCount()); |
| | | member.setVolunteerActivityDuration(statisticsMemberVo.getVolunteerActivityDuration()); |
| | | member.setVolunteerActivityIntegral(statisticsMemberVo.getVolunteerActivityIntegral()); |
| | | member.setWishCount(statisticsMemberVo.getWishCount()); |
| | | member.setEasyCount(statisticsMemberVo.getEasyCount()); |
| | | member.setActivityCount(member.getPartyActivityCount() + member.getVolunteerActivityCount()); |
| | | member.setActivityDuration(member.getPartyActivityDuration() + member.getVolunteerActivityDuration()); |
| | | } |
| | | }); |
| | | return R.ok(memberList); |
| | | } |
| | | |
| | | /** |
| | | * 党委导入接口 |
| | | * @param list 数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R importPbMemberRole(List<ComPbMemberRoleExcelVo> list, Long communityId, Long userId) { |
| | | ArrayList<ComPbMemberRoleErrorExcelVo> mistakes = Lists.newArrayList(); |
| | | ArrayList<ComPbMemberRoleDO> saveList = Lists.newArrayList(); |
| | | Date nowDate = new Date(); |
| | | if(list != null && list.size() > 0){ |
| | | list.forEach(memberRole -> { |
| | | ComPbMemberRoleDO memberRoleDO = comPbMemberRoleDAO.selectOne(new QueryWrapper<ComPbMemberRoleDO>().lambda() |
| | | .eq(ComPbMemberRoleDO::getCommunityId,communityId).eq(ComPbMemberRoleDO::getIdCard,memberRole.getIdCard())); |
| | | if(memberRoleDO != null){ |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("该党委已存在,不可重复导入"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | }else{ |
| | | memberRoleDO = new ComPbMemberRoleDO(); |
| | | BeanUtils.copyProperties(memberRole,memberRoleDO); |
| | | Integer type = ComPbMemberRoleTypeEnum.getCodeByName(memberRole.getTypeName()); |
| | | if(type.equals(0)){ |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("党委标签不存在,请核对后再重新导入"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | }else{ |
| | | memberRoleDO.setType(type); |
| | | } |
| | | try { |
| | | Date joinTime = DateUtils.stringToDate(memberRole.getJoinTime(),DateUtils.yyyyMMdd_format); |
| | | memberRoleDO.setJoinTime(joinTime); |
| | | } catch (Exception e) { |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("入党时间格式错误,请按照正确格式填写,如:2022-01-01"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | Date employmentTime = DateUtils.stringToDate(memberRole.getEmploymentTime(),DateUtils.yyyyMMdd_format); |
| | | memberRoleDO.setEmploymentTime(employmentTime); |
| | | } catch (Exception e) { |
| | | ComPbMemberRoleErrorExcelVo roleErrorExcelVo = new ComPbMemberRoleErrorExcelVo(); |
| | | BeanUtils.copyProperties(memberRole,roleErrorExcelVo); |
| | | roleErrorExcelVo.setError("转正时间格式错误,请按照正确格式填写,如:2022-01-01"); |
| | | mistakes.add(roleErrorExcelVo); |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if(saveList.size() > 0){ |
| | | saveList.forEach(save -> { |
| | | comPbMemberRoleDAO.insert(save); |
| | | }); |
| | | } |
| | | if(mistakes.size() > 0){ |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | SELECT |
| | | count( id ) AS tyNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 2 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS wdNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 3 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS yyNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 4 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS msNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category = 5 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS qtNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND specialty_category IS NULL |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS wuNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND type = 1 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS preparePartyMemberNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND type = 2 |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS formalPartyMemberNum, |
| | | ( SELECT count( id ) FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS partyMemberNum |
| | | FROM |
| | | com_pb_member |
| | |
| | | audit_result = 1 |
| | | AND community_id = #{communityId} |
| | | AND specialty_category = 1 |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getOrgDataStatisticsLeftDown" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsOrgVo"> |
| | |
| | | caas.`status` = 1 |
| | | AND caas.is_volunteer = 1 |
| | | AND caas.user_id IN ( SELECT user_id FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND user_id IS NOT NULL |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND caas.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | |
| | | AND cpm.community_id = #{communityId} |
| | | AND cpam.create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) AS participatePartyActivityNum |
| | | FROM |
| | | com_act_act_sign |
| | |
| | | `status` = 1 |
| | | AND is_volunteer = 1 |
| | | AND user_id IN ( SELECT user_id FROM com_pb_member WHERE audit_result = 1 AND community_id = #{communityId} AND user_id IS NOT NULL |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | AND create_at BETWEEN #{startTime} |
| | | AND #{endTime} |
| | |
| | | <where> |
| | | and m.audit_result = 1 |
| | | and m.community_id = #{communityId} |
| | | and m.org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND m.org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | AND org_id IN |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | )) AS cumulativeWishNum, |
| | | (SELECT |
| | | count( caep.id ) |
| | |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | AND org_id IN |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) ) as completeEasyNum, |
| | | (SELECT |
| | | count( caep.id ) |
| | |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | AND org_id IN |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) ) as cumulativeEasyNum |
| | | FROM |
| | | com_act_micro_wish AS camw |
| | |
| | | community_id = #{communityId} |
| | | AND audit_result = 1 |
| | | AND user_id IS NOT NULL |
| | | AND org_id IN |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="orgIds != null and orgIds.size > 0"> |
| | | AND org_id in |
| | | <foreach collection="orgIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | WHERE |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="exportDataStatisticsMember" resultType="com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo"> |
| | | SELECT |
| | | cpm.id, |
| | | cpm.`name`, |
| | | cpm.photo_path, |
| | | cpm.type, |
| | | cpm.`function`, |
| | | cpm.specialty_category, |
| | | cpm.specialty_name, |
| | | cpm.position, |
| | | cpm.position_two, |
| | | cpm.id_card, |
| | | cpm.phone, |
| | | cpm.check_unit_id, |
| | | cpm.user_id, |
| | | cpcu.`name` AS checkUnitName, |
| | | cpm.org_id, |
| | | cpm.community_id, |
| | | cpo.`name` AS orgName, |
| | | YEAR ( |
| | | from_days( |
| | | datediff( now( ), cpm.join_time ))) AS partyAge, |
| | | (select count(id) from com_pb_member_role where id_card = cpm.id_card) as isRole |
| | | FROM |
| | | com_pb_member AS cpm |
| | | LEFT JOIN com_pb_check_unit AS cpcu ON cpcu.id = cpm.check_unit_id |
| | | LEFT JOIN com_pb_org AS cpo ON cpo.id = cpm.org_id |
| | | <where> |
| | | and cpm.audit_result = 1 |
| | | <if test="dto.communityId != null"> |
| | | and cpm.community_id = #{dto.communityId} |
| | | </if> |
| | | |
| | | <if test="dto.keyWord != null and dto.keyWord !=''"> |
| | | and ( |
| | | cpm.`name` like concat (#{dto.keyWord},'%') or |
| | | cpm.`id_card` = #{dto.keyWord} or |
| | | cpm.`phone` like concat (#{dto.keyWord},'%') or |
| | | cpcu.`name` like concat (#{dto.keyWord},'%') or |
| | | cpo.`name` like concat (#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by cpm.create_at desc |
| | | </select> |
| | | </mapper> |
| | | |