13个文件已修改
2个文件已删除
19个文件已添加
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private ComPbCheckUnitFeign pbCheckUnitFeign; |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date(); |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区下所有党员报到单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/comPbCheckUnit/list") |
| | | public R getPbCheckUnitList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | if(comPbCheckUnit.getCommunityId() == null){ |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return pbCheckUnitFeign.queryByList(comPbCheckUnit); |
| | | } |
| | | } |
| | |
| | | private Long orgId; |
| | | @ApiModelProperty(value = "头像图片路径") |
| | | private String photoPath; |
| | | |
| | | @ApiModelProperty(value = "党员类型(1.预备党员 2.正式党员)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "报道单位id") |
| | | private Integer checkUnitId; |
| | | @ApiModelProperty(value = "职位") |
| | | private String position; |
| | | @ApiModelProperty(value = "职能") |
| | | private String function; |
| | | @ApiModelProperty(value = "特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他)") |
| | | private Integer specialtyCategory; |
| | | @ApiModelProperty(value = "特长描述") |
| | | private String specialtyName; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 通用常量信息 |
| | | * |
| | | * |
| | | * @author HUANGHONGFA |
| | | */ |
| | | public class Constants { |
| | |
| | | |
| | | public static final String CLUSTER_MEMBER_ERROR_LIST = "CLUSTER_MEMBER_ERROR_LIST_"; |
| | | |
| | | public static final String PB_CHECK_UNIT_ERROR_LIST = "PB_CHECK_UNIT_ERROR_LIST_"; |
| | | |
| | | public static final String CLUSTER_MEMBER_DEFAULT_IMAGE_URL = "https://www.psciio.com/files/4822602b68af48bcbbea7842aa463227/a6a7882b3fd24d60ac6809fef42d879d.png"; |
| | | |
| | | /** |
| | |
| | | * 字典表民族系统配置码key |
| | | */ |
| | | public static final String NATION_DICT_KEY = "nation"; |
| | | /** |
| | | * 党建包名 |
| | | */ |
| | | public static final String SERVICE_PARTYBUILDING = "partybuilding"; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 党员双报道单位类型枚举 |
| | | */ |
| | | @Getter |
| | | public enum ComPbCheckUnitTypeEnum { |
| | | |
| | | GYQY(1, "国有企业"), GYKGQY(2, "国有控股企业"), WZQY(3, "外资企业") |
| | | , HZQY(4, "合资企业"), SYQY(5, "私营企业"), SYDW(6, "事业单位") |
| | | , GJXZJG(7, "国家行政机关"), ZF(6, "政府"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | ComPbCheckUnitTypeEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (ComPbCheckUnitTypeEnum item : ComPbCheckUnitTypeEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (ComPbCheckUnitTypeEnum item : ComPbCheckUnitTypeEnum.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.community.cluster.admin.ComClusterMemberExcelErrorVO; |
| | | import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | 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 ComPbCheckUnitExcelListen 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 ComPbCheckUnitFeign checkUnitService; |
| | | private Long communityId; |
| | | private Long userId; |
| | | private Map<Integer, String> headData; |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | public ComPbCheckUnitExcelListen(ComPbCheckUnitFeign checkUnitService, Long communityId, Long userId, |
| | | StringRedisTemplate stringRedisTemplate) { |
| | | this.checkUnitService = checkUnitService; |
| | | 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_CHECK_UNIT_ERROR_LIST + communityId; |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComPbCheckUnitExcelVO> voList = Lists.newArrayList(); |
| | | ArrayList<ComPbCheckUnitErrorExcelVO> mistakes = Lists.newArrayList(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComPbCheckUnitExcelVO vo = new ComPbCheckUnitExcelVO(); |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"单位名称不可为空,请填写单位名称")); |
| | | continue; |
| | | }else{ |
| | | //判断导入的名字的长度是否超过30 |
| | | if(oneData.get(0).length() > 30){ |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"单位名称长度不可超过30,请重新填写单位名称")); |
| | | continue; |
| | | } |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if (StringUtils.isEmpty(oneData.get(1))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"单位类别不可为空,请填写单位类别")); |
| | | continue; |
| | | } |
| | | vo.setType(oneData.get(1)); |
| | | if (StringUtils.isNotEmpty(oneData.get(2))) { |
| | | vo.setContacts(oneData.get(2)); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(3))) { |
| | | //验证手机号正则 |
| | | String regex = "^[1][3,4,5,6,7,8,9][0-9]{9}$"; |
| | | Pattern pattern = Pattern.compile(regex); |
| | | Matcher m = pattern.matcher(oneData.get(3)); |
| | | if(!m.matches()){ |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"联系电话输入错误,请核对联系电话")); |
| | | continue; |
| | | } |
| | | vo.setPhone(oneData.get(3)); |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | List<ComPbCheckUnitExcelVO> newVoList = |
| | | voList.stream().filter(ListUtils.distinctByKey(ComPbCheckUnitExcelVO::getName)) |
| | | .collect(Collectors.toList()); |
| | | R r = checkUnitService.importCheckUnit(newVoList, communityId, userId); |
| | | if (!R.isOk(r)) { |
| | | List<ComPbCheckUnitErrorExcelVO> list = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComPbCheckUnitErrorExcelVO.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, ComPbCheckUnitErrorExcelVO vo) { |
| | | vo.setName(map.get(0)); |
| | | vo.setType(map.get(1)); |
| | | vo.setContacts(map.get(2)); |
| | | vo.setPhone(map.get(3)); |
| | | } |
| | | |
| | | /** |
| | | * 组装错误信息 |
| | | * @param oneData 数据表格对象 |
| | | * @param error 错误信息 |
| | | * @return 错误对象 |
| | | */ |
| | | private ComPbCheckUnitErrorExcelVO setErrorObject(Map<Integer, String> oneData, String error){ |
| | | ComPbCheckUnitErrorExcelVO mistake = new ComPbCheckUnitErrorExcelVO(); |
| | | setError(oneData, mistake); |
| | | mistake.setError(error); |
| | | return mistake; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * title: 新增党建-报到单位请求参数 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 新增党建-报到单位请求参数 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:40 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增党建-报到单位请求参数") |
| | | public class AddComPbCheckUnitDto { |
| | | |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府) |
| | | */ |
| | | @ApiModelProperty(value = "单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | @ApiModelProperty(value = "负责人") |
| | | private String contacts; |
| | | |
| | | /** |
| | | * 负责人联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "负责人联系电话") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * title: 编辑党建-报到单位请求参数 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 编辑党建-报到单位请求参数 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:40 |
| | | */ |
| | | @Data |
| | | @ApiModel("编辑党建-报到单位请求参数") |
| | | public class EditComPbCheckUnitDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String name; |
| | | /** |
| | | * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府) |
| | | */ |
| | | @ApiModelProperty(value = "单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)") |
| | | private Integer type; |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | @ApiModelProperty(value = "负责人") |
| | | private String contacts; |
| | | /** |
| | | * 负责人联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "负责人联系电话") |
| | | private String phone; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * title: 分页查询党建-报到单位请求参数 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 分页查询党建-报到单位请求参数 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询党建-报到单位请求参数") |
| | | public class PageComPbCheckUnitDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String name; |
| | | /** |
| | | * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府) |
| | | */ |
| | | @ApiModelProperty(value = "单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)") |
| | | private Integer type; |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | @ApiModelProperty(value = "负责人") |
| | | private String contacts; |
| | | /** |
| | | * 负责人联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "负责人联系电话") |
| | | private String phone; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "分页每页数量", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.partybuilding; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询党建数据统计请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询党建数据统计请求参数") |
| | | public class PageComDataStatisticsMemberDto { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "1.本年 2.") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.common; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * title: 党建-报到单位返回参数 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位返回参数 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:40 |
| | | */ |
| | | @Data |
| | | @ApiModel("党建-报到单位返回参数") |
| | | public class ComPbCheckUnitVo { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String name; |
| | | /** |
| | | * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府) |
| | | */ |
| | | @ApiModelProperty(value = "单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)") |
| | | private Integer type; |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | @ApiModelProperty(value = "负责人") |
| | | private String contacts; |
| | | /** |
| | | * 负责人联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "负责人联系电话") |
| | | private String phone; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "党员类型(1.预备党员 2.正式党员)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "报道单位id") |
| | | private Long checkUnitId; |
| | | |
| | | @ApiModelProperty(value = "特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他)") |
| | | private Long specialtyCategory; |
| | | } |
| | |
| | | private String refuseReason; |
| | | @ApiModelProperty(value = "是否党员 1是 2否") |
| | | private Integer isPb; |
| | | |
| | | @ApiModelProperty(value = "党员类型(1.预备党员 2.正式党员)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "职位") |
| | | private String position; |
| | | |
| | | @ApiModelProperty(value = "报道单位id") |
| | | private Long checkUnitId; |
| | | |
| | | @ApiModelProperty(value = "报道单位名称") |
| | | private String checkUnitName; |
| | | |
| | | @ApiModelProperty(value = "职能") |
| | | private String function; |
| | | |
| | | @ApiModelProperty(value = "特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他)") |
| | | private Integer specialtyCategory; |
| | | |
| | | @ApiModelProperty(value = "特长描述") |
| | | private String specialtyName; |
| | | |
| | | @ApiModelProperty(value = "职位2") |
| | | private String positionTwo; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "每页记录数") |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "党委标签(1.社区党委 2.区域党委委员)") |
| | | private Integer type; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "入党时间") |
| | | private Date joinTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "转正时间") |
| | | private Date employmentTime; |
| | | |
| | | @ApiModelProperty(value = "职能") |
| | | private String function; |
| | | |
| | | @ApiModelProperty(value = "特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他)") |
| | | private Integer specialtyCategory; |
| | | |
| | | @ApiModelProperty(value = "特长描述") |
| | | private String specialtyName; |
| | | |
| | | @ApiModelProperty(value = "报道单位id") |
| | | private Long checkUnitId; |
| | | |
| | | @ApiModelProperty(value = "报道单位名称") |
| | | private Long checkUnitName; |
| | | |
| | | @ApiModelProperty(value = "负责党组织id") |
| | | private Long orgId; |
| | | |
| | | @ApiModelProperty(value = "负责党组织名字") |
| | | private String orgName; |
| | | |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.partybuilding.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 批量导入党员双报道单位 |
| | | * @author : lyq |
| | | */ |
| | | @Data |
| | | public class ComPbCheckUnitErrorExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "单位名称", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "单位类别", index = 1) |
| | | private String type; |
| | | |
| | | @ExcelProperty(value = "单位负责人", index = 2) |
| | | private String contacts; |
| | | |
| | | @ExcelProperty(value = "负责人联系电话", index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "错误信息", index = 7) |
| | | private String error; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.partybuilding.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 批量导入党员双报道单位 |
| | | * @author : lyq |
| | | */ |
| | | @Data |
| | | public class ComPbCheckUnitExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "单位名称", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "单位类别", index = 1) |
| | | private String type; |
| | | |
| | | @ExcelProperty(value = "单位负责人", index = 2) |
| | | private String contacts; |
| | | |
| | | @ExcelProperty(value = "负责人联系电话", index = 3) |
| | | private String phone; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.partybuilding; |
| | | |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.dtos.common.AddComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-数据统计业务层接口 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-数据统计业务层接口 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @FeignClient(name = Constants.SERVICE_PARTYBUILDING, contextId = "comDataStatistics", path = "comDataStatistics") |
| | | public interface ComDataStatisticsFeign { |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @PostMapping("/page") |
| | | R pageDataStatisticsMember(@RequestBody PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.partybuilding; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位业务层接口 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位业务层接口 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @FeignClient(name = Constants.SERVICE_PARTYBUILDING, contextId = "comPbCheckUnit", path = "comPbCheckUnit") |
| | | public interface ComPbCheckUnitFeign { |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @PostMapping("/page") |
| | | R queryByPage(@RequestBody PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description insert 新增数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @PostMapping("/add") |
| | | R insert(@RequestBody AddComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description update 修改数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 修改结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @PutMapping("/edit") |
| | | R update(@RequestBody EditComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description deleteById 通过主键删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @GetMapping("/delete") |
| | | R deleteById(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @GetMapping("/detail") |
| | | R detailById(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * description queryByList 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:48 |
| | | */ |
| | | @PostMapping("/list") |
| | | R queryByList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * 批量导入报道单位 |
| | | * @param list 导入数据 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/importCheckUnit") |
| | | R importCheckUnit(@RequestBody List<ComPbCheckUnitExcelVO> list,@RequestParam(value = "communityId") Long communityId |
| | | ,@RequestParam(value = "userId") Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComPbCheckUnitExcelListen; |
| | | import com.panzhihua.common.model.dtos.FtpConfig; |
| | | import com.panzhihua.common.model.dtos.common.AddComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.config.SFTPConfig; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位(ComPbCheckUnit) 控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"党建-报到单位"}) |
| | | @RestController |
| | | @RequestMapping("/checkUnit") |
| | | public class ComPbCheckUnitApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComPbCheckUnitFeign comPbCheckUnitService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "分页查询报道单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | return this.comPbCheckUnitService.queryByPage(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description add 新增数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "新增报道单位") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | comPbCheckUnit.setCreateBy(this.getUserId()); |
| | | comPbCheckUnit.setCreateAt(new Date()); |
| | | return this.comPbCheckUnitService.insert(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description edit 编辑数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 编辑结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "编辑报道单位") |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | comPbCheckUnit.setUpdateBy(this.getUserId()); |
| | | comPbCheckUnit.setUpdateAt(new Date()); |
| | | return this.comPbCheckUnitService.update(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description deleteById 删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "删除报道单位") |
| | | @GetMapping("/delete") |
| | | public R deleteById(@RequestParam("id") Long id) { |
| | | return this.comPbCheckUnitService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "查询报道单位", response = ComPbCheckUnitVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comPbCheckUnitService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "查询报道单位列表", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | return this.comPbCheckUnitService.queryByList(comPbCheckUnit); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量新增党员报道单位导入excel") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | log.info("传入文件名字【{}】", file.getOriginalFilename()); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, ComPbCheckUnitExcelVO.class, |
| | | new ComPbCheckUnitExcelListen(comPbCheckUnitService,this.getCommunityId(),this.getUserId(),stringRedisTemplate)).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载导入失败党员报道单位数据") |
| | | @PostMapping("/download/error/populationDrug") |
| | | public R downloadErrorDrugPopulation(@RequestParam(value = "key") String key) { |
| | | List<ComPbCheckUnitErrorExcelVO> list = new ArrayList<>(); |
| | | Boolean isExits = stringRedisTemplate.hasKey(key); |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | if (isExits) { |
| | | String json = valueOperations.get(key); |
| | | list = JSONArray.parseArray(json, ComPbCheckUnitErrorExcelVO.class); |
| | | } |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "党员报道单位错误数据" + nowDate + ".xlsx"; |
| | | 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, ComPbCheckUnitErrorExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("党员报道单位错误数据").build(); |
| | | excelWriter.write(list, 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(sftpConfig.getExcelUrl() + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.partybuilding.ComDataStatisticsFeign; |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | @Resource |
| | | private ComDataStatisticsFeign dataStatisticsService; |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @GetMapping("listpartyorganization") |
| | |
| | | public R addPartyCommittee(@RequestBody @Validated(AddGroup.class) PartyCommitteeVO partyCommitteeVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | partyCommitteeVO.setCommunityId(communityId); |
| | | return partyBuildingService.addPartyCommittee(partyCommitteeVO); |
| | | R r = partyBuildingService.addPartyCommittee(partyCommitteeVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = userService.updateUserIsPartymember(partyCommitteeVO.getIdCard()); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @OperLog(operModul = "党委管理", operType = 2) |
| | |
| | | return R.ok(urlList); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "党员数据统计-分页查询党员数据") |
| | | @PostMapping("/dataStatistics/member/page") |
| | | public R pageDataStatisticsMember(@RequestParam("id") Long id) { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.api; |
| | | |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.service_dangjian.service.ComPbCheckUnitService; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位(ComPbCheckUnit) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/comPbCheckUnit") |
| | | public class ComPbCheckUnitController { |
| | | |
| | | @Resource |
| | | private ComPbCheckUnitService comPbCheckUnitService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | return this.comPbCheckUnitService.queryByPage(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description add 新增数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComPbCheckUnitDto comPbCheckUnit) { |
| | | return this.comPbCheckUnitService.insert(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description edit 编辑数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 编辑结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComPbCheckUnitDto comPbCheckUnit) { |
| | | return this.comPbCheckUnitService.update(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description deleteById 删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @GetMapping("/delete") |
| | | public R deleteById(@RequestParam("id") Long id) { |
| | | return this.comPbCheckUnitService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comPbCheckUnitService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | return this.comPbCheckUnitService.queryByList(comPbCheckUnit); |
| | | } |
| | | |
| | | @PostMapping("/importCheckUnit") |
| | | public R importCheckUnit(@RequestBody List<ComPbCheckUnitExcelVO> list, @RequestParam(value = "communityId") Long communityId |
| | | ,@RequestParam(value = "userId") Long userId){ |
| | | return this.comPbCheckUnitService.importCheckUnit(list,communityId,userId); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_dangjian.dao; |
| | | |
| | | import com.panzhihua.service_dangjian.entity.ComPbCheckUnit; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.common.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位表数据库访问层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位表数据库访问层 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @Mapper |
| | | public interface ComPbCheckUnitMapper extends BaseMapper<ComPbCheckUnit> { |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | ComPbCheckUnitVo queryById(Long id); |
| | | |
| | | /** |
| | | * description queryAllByLimit 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @param page 分页参数 |
| | | * @return 分页查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | IPage<ComPbCheckUnitVo> queryAllByLimit(@Param("dto") PageComPbCheckUnitDto comPbCheckUnit, Page page); |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | List<ComPbCheckUnitVo> queryAllByList(@Param("dto") PageComPbCheckUnitDto comPbCheckUnit); |
| | | } |
| | | |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComPbMemberDAO extends BaseMapper<ComPbMemberDO> { |
| | | // -------------------动态模板------------- |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMemberVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" + "m.join_time,\n" + "m.audit_result, \n" |
| | | + "m.employment_time,\n" + "CASE\n" + "WHEN u.id_card IS NULL THEN\n" + "'未注册' ELSE '已注册' \n" + "END STATUS," |
| | | + " m.create_at \n" + "FROM\n" + "com_pb_member m\n" + "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" |
| | | + "LEFT JOIN com_pb_org o ON m.org_id = o.id" + " where m.audit_result in (0,3) " |
| | | + "<if test='pagePartyBuildingMemberVO.phone != null and pagePartyBuildingMemberVO.phone != ""'>" |
| | | + " and u.phone LIKE CONCAT('%',#{pagePartyBuildingMemberVO.phone},'%') " + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.name != null and pagePartyBuildingMemberVO.name != ""'>" |
| | | + " and u.name like concat ('%',#{pagePartyBuildingMemberVO.name},'%')" + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.auditStatus != null'>" |
| | | + " and m.audit_result = #{pagePartyBuildingMemberVO.auditStatus}" + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.communityId != null'>" |
| | | + " and m.community_id = ${pagePartyBuildingMemberVO.communityId}" + " </if> " + " order by m.join_time desc " |
| | | + "</script>") |
| | | /** |
| | | * 分页查询待认证党员列表 |
| | | * @param page 分页参数 |
| | | * @param pagePartyBuildingMemberVO 请求参数 |
| | | * @return 待认证党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMembersVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | |
| | | + "<if test='organizationVO.name != null and organizationVO.name != ""'>" |
| | | + " and cpm.name like concat (#{organizationVO.name},'%')" + " </if> " + "</script>") |
| | | List<ComPbMemberExcelVO> exportPbMember(@Param("organizationVO") PagePartyOrganizationVO organizationVO); |
| | | |
| | | /** |
| | | * 分页查询党员列表 |
| | | * @param page 分页参数 |
| | | * @param buildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> queryAllByLimit(Page page,@Param("dto") PagePartyOrganizationVO buildingMemberVO); |
| | | |
| | | /** |
| | | * 根据id查询党员信息 |
| | | * @param id 主键id |
| | | * @return 党员信息 |
| | | */ |
| | | PartyBuildingMemberVO queryById(@Param("id") Long id); |
| | | } |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComPbMemberRoleDAO extends BaseMapper<ComPbMemberRoleDO> { |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + "SELECT\n" + "*,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "t.birth_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) age\n" + "FROM\n" + "com_pb_member_role t\n" + "WHERE\n" |
| | | + "t.community_id = ${partyCommitteeVO.communityId} \n" + "</script>") |
| | | |
| | | /** |
| | | * 分页查询党委列表 |
| | | * @param page 分页参数 |
| | | * @param partyCommitteeVO 请求参数 |
| | | * @return 党委列表 |
| | | */ |
| | | IPage<PartyCommitteeVO> pagePartyOrganization(Page page, |
| | | @Param("partyCommitteeVO") PartyCommitteeVO partyCommitteeVO); |
| | | |
| | | @Select("select * from sys_user where phone=#{phone} and type=1") |
| | | SysUserVO getSysUserByPhone(@Param("phone") String phone); |
| | | |
| | | /** |
| | | * 根据身份证查询小程序用户id |
| | | * @param idCard 身份证 |
| | | * @return 小程序用户id |
| | | */ |
| | | Long getUserIdByIdCard(@Param("idCard") String idCard); |
| | | |
| | | /** |
| | | * 根据手机号查询小程序用户id |
| | |
| | | |
| | | @Select("select * from com_pb_member_role where id=#{id}") |
| | | PartyCommitteeVO selectPartyCommitteeById(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 根据身份证查询用户数量 |
| | | * @param idCard 身份证号码 |
| | | * @return 用户数量 |
| | | */ |
| | | Integer getSysUserByIdCardCount(@Param("idCard") String idCard); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 党建-报到单位(ComPbCheckUnit)实体类 |
| | | * |
| | | * @author lyq |
| | | * @since 2022-02-16 16:22:18 |
| | | */ |
| | | @Data |
| | | public class ComPbCheckUnit implements Serializable { |
| | | private static final long serialVersionUID = 877551680973276301L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | private String contacts; |
| | | /** |
| | | * 负责人联系电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | private String refuseReason; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 党员类型(1.预备党员 2.正式党员) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 职位 |
| | | */ |
| | | private String position; |
| | | |
| | | /** |
| | | * 报道单位id |
| | | */ |
| | | private Long checkUnitId; |
| | | |
| | | /** |
| | | * 职能 |
| | | */ |
| | | private String function; |
| | | |
| | | /** |
| | | * 特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他) |
| | | */ |
| | | private Integer specialtyCategory; |
| | | |
| | | /** |
| | | * 特长描述 |
| | | */ |
| | | private String specialtyName; |
| | | |
| | | /** |
| | | * 职位2 |
| | | */ |
| | | private String positionTwo; |
| | | |
| | | /** |
| | | * 党员审查结果 0待审核 1 审核通过 3审核失败 |
| | | */ |
| | | public interface AuditResult{ |
| | | int DSH = 0; |
| | | int SHTG = 1; |
| | | int SHBH = 3; |
| | | } |
| | | |
| | | /** |
| | | * 党员类型(1.预备党员 2.正式党员) |
| | | */ |
| | | public interface Type{ |
| | | int YBDY = 1; |
| | | int ZSDY = 2; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 党委标签(1.社区党委 2.区域党委委员) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 入党时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 转正时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date employmentTime; |
| | | |
| | | /** |
| | | * 职能 |
| | | */ |
| | | private String function; |
| | | |
| | | /** |
| | | * 特长类别(1.体育类 2.舞蹈类 3.音乐类 4.美术类 5.其他) |
| | | */ |
| | | private Integer specialtyCategory; |
| | | |
| | | /** |
| | | * 特长描述 |
| | | */ |
| | | private String specialtyName; |
| | | |
| | | /** |
| | | * 报道单位id |
| | | */ |
| | | private Long checkUnitId; |
| | | |
| | | /** |
| | | * 负责党组织id |
| | | */ |
| | | private Long orgId; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | private String idCard; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位表服务接口 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位表服务接口 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | public interface ComPbCheckUnitService { |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R queryByPage(PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description insert 新增数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R insert(AddComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description update 修改数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 修改结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R update(EditComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | /** |
| | | * description deleteById 通过主键删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R deleteById(Long id); |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R detailById(Long id); |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | R queryByList(PageComPbCheckUnitDto comPbCheckUnit); |
| | | |
| | | R importCheckUnit(List<ComPbCheckUnitExcelVO> list, Long communityId, Long userId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.ComPbCheckUnitTypeEnum; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | | import com.panzhihua.service_dangjian.dao.ComPbMemberDAO; |
| | | import com.panzhihua.service_dangjian.dao.ComPbMemberRoleDAO; |
| | | import com.panzhihua.service_dangjian.entity.ComPbCheckUnit; |
| | | import com.panzhihua.service_dangjian.dao.ComPbCheckUnitMapper; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberRoleDO; |
| | | import com.panzhihua.service_dangjian.service.ComPbCheckUnitService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: 党建-报到单位表服务实现类 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位表服务实现类 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Service("comPbCheckUnitService") |
| | | public class ComPbCheckUnitServiceImpl extends ServiceImpl<ComPbCheckUnitMapper, ComPbCheckUnit> implements ComPbCheckUnitService { |
| | | |
| | | @Resource |
| | | private ComPbMemberDAO comPbMemberDAO; |
| | | @Resource |
| | | private ComPbMemberRoleDAO comPbMemberRoleDAO; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R queryByPage(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | return R.ok(this.baseMapper.queryAllByLimit(comPbCheckUnit, new Page(comPbCheckUnit.getPageNum(), comPbCheckUnit.getPageSize()))); |
| | | } |
| | | |
| | | /** |
| | | * description insert 新增数据 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R insert(AddComPbCheckUnitDto comPbCheckUnit) { |
| | | ComPbCheckUnit entity = new ComPbCheckUnit(); |
| | | BeanUtils.copyProperties(comPbCheckUnit, entity); |
| | | if (this.baseMapper.insert(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * description update 修改数据 |
| | | * |
| | | * @param editDto 请求参数 |
| | | * @return 修改结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R update(EditComPbCheckUnitDto editDto) { |
| | | ComPbCheckUnit entity = this.baseMapper.selectById(editDto.getId()); |
| | | if (entity == null) { |
| | | return R.fail("未查询到该记录"); |
| | | } |
| | | BeanUtils.copyProperties(editDto, entity); |
| | | if (this.baseMapper.updateById(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * description deleteById 通过主键删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | Integer memberCount = comPbMemberDAO.selectCount(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getCheckUnitId,id)); |
| | | if(memberCount > 0){ |
| | | return R.fail("该数据已被引用,无法删除!"); |
| | | } |
| | | Integer memberRoleCount = comPbMemberRoleDAO.selectCount(new QueryWrapper<ComPbMemberRoleDO>().lambda() |
| | | .eq(ComPbMemberRoleDO::getCheckUnitId,id)); |
| | | if(memberRoleCount > 0){ |
| | | return R.fail("该数据已被引用,无法删除!"); |
| | | } |
| | | if (this.baseMapper.deleteById(id) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R detailById(Long id) { |
| | | return R.ok(this.baseMapper.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:26 |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | return R.ok(this.baseMapper.queryAllByList(comPbCheckUnit)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R importCheckUnit(List<ComPbCheckUnitExcelVO> list, Long communityId, Long userId){ |
| | | ArrayList<ComPbCheckUnitErrorExcelVO> mistakes = Lists.newArrayList(); |
| | | ArrayList<ComPbCheckUnit> saveList = Lists.newArrayList(); |
| | | Date nowDate = new Date(); |
| | | if(list != null && list.size() > 0){ |
| | | list.forEach(checkUnit -> { |
| | | ComPbCheckUnit comPbCheckUnit = this.baseMapper.selectOne(new QueryWrapper<ComPbCheckUnit>().lambda() |
| | | .eq(ComPbCheckUnit::getCommunityId,communityId).eq(ComPbCheckUnit::getName,checkUnit.getName())); |
| | | if(comPbCheckUnit != null){ |
| | | ComPbCheckUnitErrorExcelVO checkUnitError = new ComPbCheckUnitErrorExcelVO(); |
| | | BeanUtils.copyProperties(checkUnit,checkUnitError); |
| | | checkUnitError.setError("该单位已存在,不可重复导入"); |
| | | }else{ |
| | | comPbCheckUnit = new ComPbCheckUnit(); |
| | | BeanUtils.copyProperties(checkUnit,comPbCheckUnit); |
| | | comPbCheckUnit.setType(ComPbCheckUnitTypeEnum.getCodeByName(checkUnit.getType())); |
| | | comPbCheckUnit.setCommunityId(communityId); |
| | | comPbCheckUnit.setCreateAt(nowDate); |
| | | comPbCheckUnit.setCreateBy(userId); |
| | | saveList.add(comPbCheckUnit); |
| | | } |
| | | }); |
| | | } |
| | | if(saveList.size() > 0){ |
| | | this.saveBatch(saveList); |
| | | } |
| | | if(mistakes.size() > 0){ |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<PartyBuildingMemberVO> iPage = comPbMemberDAO.pagePartyOrganization(page, pagePartyOrganizationVO); |
| | | IPage<PartyBuildingMemberVO> iPage = comPbMemberDAO.queryAllByLimit(page, pagePartyOrganizationVO); |
| | | iPage.getRecords().forEach(record -> { |
| | | record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard())); |
| | | }); |
| | |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addPartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | ComPbMemberRoleDO comPbMemberRoleDO = new ComPbMemberRoleDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbMemberRoleDO); |
| | | comPbMemberRoleDO.setCreateAt(new Date()); |
| | | comPbMemberRoleDO.setUpdateAt(new Date()); |
| | | comPbMemberRoleDO.setIsReg(2); |
| | | SysUserVO sysUser = comPbMemberRoleDAO.getSysUserByPhone(partyCommitteeVO.getPhone()); |
| | | if (!ObjectUtils.isEmpty(sysUser)) { |
| | | Integer userCount = comPbMemberRoleDAO.getSysUserByIdCardCount(partyCommitteeVO.getIdCard()); |
| | | if (userCount > 0) { |
| | | comPbMemberRoleDO.setIsReg(1); |
| | | } |
| | | Date nowDate = new Date(); |
| | | //判断党员信息是否存在党委信息 |
| | | ComPbMemberDO pbMemberDO = comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getIdCard,partyCommitteeVO.getIdCard()) |
| | | .eq(ComPbMemberDO::getAuditResult,ComPbMemberDO.AuditResult.SHTG) |
| | | .eq(ComPbMemberDO::getCommunityId,partyCommitteeVO.getCommunityId())); |
| | | if(pbMemberDO == null){ |
| | | //不存在则创建党委党员信息 |
| | | pbMemberDO = new ComPbMemberDO(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setAuditResult(ComPbMemberDO.AuditResult.SHTG); |
| | | pbMemberDO.setCreateAt(nowDate); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberDO.Type.ZSDY); |
| | | comPbMemberDAO.insert(pbMemberDO); |
| | | }else{ |
| | | //存在则更新党委党员信息 |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberDO.Type.ZSDY); |
| | | comPbMemberDAO.updateById(pbMemberDO); |
| | | } |
| | | int insert = comPbMemberRoleDAO.insert(comPbMemberRoleDO); |
| | | if (insert > 0) { |
| | |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R updatePartyCommittee(PartyCommitteeVO partyCommitteeVO) { |
| | | ComPbMemberRoleDO comPbMemberRoleDO = new ComPbMemberRoleDO(); |
| | | Date nowDate = new Date(); |
| | | BeanUtils.copyProperties(partyCommitteeVO, comPbMemberRoleDO); |
| | | ComPbMemberRoleDO comPbMemberRoleDOOld = comPbMemberRoleDAO.selectById(partyCommitteeVO.getId()); |
| | | comPbMemberRoleDO.setCreateAt(comPbMemberRoleDOOld.getCreateAt()); |
| | | comPbMemberRoleDO.setUpdateAt(new Date()); |
| | | comPbMemberRoleDO.setPositionTwo(partyCommitteeVO.getPositionTwo()); |
| | | comPbMemberRoleDO.setUpdateAt(nowDate); |
| | | comPbMemberRoleDO.setIsReg(2); |
| | | PartyCommitteeVO oldPartyCommitteeVO = comPbMemberRoleDAO.selectPartyCommitteeById(partyCommitteeVO.getId()); |
| | | String oldphone = oldPartyCommitteeVO.getPhone(); |
| | | SysUserVO sysUserOld = comPbMemberRoleDAO.getSysUserByPhone(oldphone); |
| | | String newphone = partyCommitteeVO.getPhone(); |
| | | SysUserVO sysUserNew = comPbMemberRoleDAO.getSysUserByPhone(newphone); |
| | | if (!ObjectUtils.isEmpty(sysUserOld) || !ObjectUtils.isEmpty(sysUserNew)) { |
| | | Integer userCount = comPbMemberRoleDAO.getSysUserByIdCardCount(partyCommitteeVO.getIdCard()); |
| | | if (userCount > 0) { |
| | | comPbMemberRoleDO.setIsReg(1); |
| | | } |
| | | if (!newphone.equals(oldphone)) { |
| | | comPbMemberRoleDAO.updateUserPhone(newphone, oldphone); |
| | | //查询党员信息并更新 |
| | | ComPbMemberDO pbMemberDO = comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda() |
| | | .eq(ComPbMemberDO::getIdCard,partyCommitteeVO.getIdCard()) |
| | | .eq(ComPbMemberDO::getAuditResult,ComPbMemberDO.AuditResult.SHTG) |
| | | .eq(ComPbMemberDO::getCommunityId,partyCommitteeVO.getCommunityId())); |
| | | if(pbMemberDO != null){ |
| | | BeanUtils.copyProperties(partyCommitteeVO, pbMemberDO); |
| | | pbMemberDO.setUpdateAt(nowDate); |
| | | pbMemberDO.setType(ComPbMemberDO.Type.ZSDY); |
| | | comPbMemberDAO.updateById(pbMemberDO); |
| | | } |
| | | int update = comPbMemberRoleDAO.updateById(comPbMemberRoleDO); |
| | | if (update > 0) { |
| | |
| | | } |
| | | int delete = comPbMemberRoleDAO.deleteById(partyCommitteeVO.getId()); |
| | | if (delete > 0) { |
| | | SysUserVO sysUserVO = comPbMemberRoleDAO.getSysUserByPhone(comPbMemberRoleDO.getPhone()); |
| | | Long userId = comPbMemberRoleDAO.getUserIdByIdCard(comPbMemberRoleDO.getIdCard()); |
| | | // 删除用户信息缓存 |
| | | if (sysUserVO != null) { |
| | | Long userId = sysUserVO.getUserId(); |
| | | if (userId != null) { |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | return R.ok(); |
| | |
| | | if (comPbMemberDO == null) { |
| | | return R.fail("未找到党员认证信息"); |
| | | } |
| | | BeanUtils.copyProperties(partyBuildingMemberVO, comPbMemberDO); |
| | | comPbMemberDO.setAuditResult(partyBuildingMemberVO.getAuditResult()); |
| | | if (partyBuildingMemberVO.getAuditResult() != null && partyBuildingMemberVO.getAuditResult().equals(3)) { |
| | | comPbMemberDO.setRefuseReason(partyBuildingMemberVO.getRefuseReason()); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_dangjian.dao.ComPbCheckUnitMapper"> |
| | | |
| | | <resultMap type="com.panzhihua.service_dangjian.entity.ComPbCheckUnit" id="ComPbCheckUnitMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="contacts" column="contacts" jdbcType="VARCHAR"/> |
| | | <result property="phone" column="phone" jdbcType="VARCHAR"/> |
| | | <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createBy" column="create_by" jdbcType="INTEGER"/> |
| | | <result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updateBy" column="update_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!--查询单个--> |
| | | <select id="queryById" resultType="com.panzhihua.common.model.vos.common.ComPbCheckUnitVo"> |
| | | select |
| | | id, name, type, contacts, phone, create_at, create_by, update_at, update_by, community_id |
| | | from com_pb_check_unit |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComPbCheckUnitVo"> |
| | | select |
| | | id, name, type, contacts, phone, create_at, create_by, update_at, update_by, community_id |
| | | from com_pb_check_unit |
| | | <where> |
| | | <if test="dto.type != null"> |
| | | and type = #{dto.type} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.keyWord != null and dto.keyWord != ''"> |
| | | and (`name` like concat(#{dto.keyWord},'%') or |
| | | `contacts` like concat(#{dto.keyWord},'%')) |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <!--查询所有数据--> |
| | | <select id="queryAllByList" resultType="com.panzhihua.common.model.vos.common.ComPbCheckUnitVo"> |
| | | select |
| | | id, name, type, contacts, phone, create_at, create_by, update_at, update_by |
| | | from com_pb_check_unit |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and id = #{dto.id} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and name = #{dto.name} |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | and type = #{dto.type} |
| | | </if> |
| | | <if test="dto.contacts != null and dto.contacts != ''"> |
| | | and contacts = #{dto.contacts} |
| | | </if> |
| | | <if test="dto.phone != null and dto.phone != ''"> |
| | | and phone = #{dto.phone} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and community_id = #{dto.communityId} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_dangjian.dao.ComPbMemberDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_dangjian.model.dos.ComPbMemberDO" id="ComPbMemberMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="orgId" column="org_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="idCard" column="id_card" jdbcType="VARCHAR"/> |
| | | <result property="photoPath" column="photo_path" jdbcType="VARCHAR"/> |
| | | <result property="joinTime" column="join_time" jdbcType="TIMESTAMP"/> |
| | | <result property="employmentTime" column="employment_time" jdbcType="TIMESTAMP"/> |
| | | <result property="auditResult" column="audit_result" jdbcType="INTEGER"/> |
| | | <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="refuseReason" column="refuse_reason" jdbcType="VARCHAR"/> |
| | | <result property="phone" column="phone" jdbcType="VARCHAR"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="position" column="position" jdbcType="VARCHAR"/> |
| | | <result property="checkUnitId" column="check_unit_id" jdbcType="INTEGER"/> |
| | | <result property="function" column="function" jdbcType="VARCHAR"/> |
| | | <result property="specialtyCategory" column="specialty_category" jdbcType="INTEGER"/> |
| | | <result property="specialtyName" column="specialty_name" jdbcType="VARCHAR"/> |
| | | <result property="positionTwo" column="position_two" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!--查询单个--> |
| | | <select id="queryById" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | where m.id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id |
| | | <where> |
| | | and m.audit_result = 1 |
| | | <if test='dto.orgName != null and dto.orgName != ""'> |
| | | and o.name like concat(#{dto.orgName},'%') |
| | | </if> |
| | | <if test='dto.orgId != null'> |
| | | and o.id = #{dto.orgId} |
| | | </if> |
| | | <if test='dto.account != null and dto.account != ""'> |
| | | and u.phone like concat (#{dto.account},'%') |
| | | </if> |
| | | <if test='dto.name != null and dto.name != ""'> |
| | | and m.name like concat (#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.orgId != null"> |
| | | and m.org_id = #{dto.orgId} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and m.community_id = ${dto.communityId} |
| | | </if> |
| | | <if test="dto.keyWord != null and dto.keyWord != ''"> |
| | | and (m.name like concat (#{dto.keyWord},'%') or |
| | | u.phone like concat (#{dto.keyWord},'%') or |
| | | cpcu.name like concat (#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | and m.type = #{dto.type} |
| | | </if> |
| | | <if test="dto.checkUnitId != null"> |
| | | and m.check_unit_id = #{dto.checkUnitId} |
| | | </if> |
| | | <if test="dto.specialtyCategory != null"> |
| | | and m.specialty_category = #{dto.specialtyCategory} |
| | | </if> |
| | | </where> |
| | | order by m.create_at desc |
| | | </select> |
| | | |
| | | <select id="pagePartyBuildingMembersVO" resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | select |
| | | m.id, m.org_id, m.name, m.id_card, m.photo_path, m.join_time, m.employment_time, m.audit_result, m.create_at, m.update_at, |
| | | m.community_id, m.user_id, m.refuse_reason, m.phone, m.type, m.position, m.check_unit_id, m.function, m.specialty_category, |
| | | m.specialty_name, m.position_two, o.`name` orgName,cpcu.name as checkUnitName, |
| | | TIMESTAMPDIFF( |
| | | YEAR, |
| | | m.employment_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge, |
| | | CASE |
| | | |
| | | WHEN u.id_card IS NULL THEN |
| | | '未注册' ELSE '已注册' |
| | | END status |
| | | from com_pb_member as m |
| | | LEFT JOIN sys_user u ON m.id_card = u.id_card |
| | | LEFT JOIN com_pb_org o ON m.org_id = o.id |
| | | LEFT JOIN com_pb_check_unit as cpcu on cpcu.id = m.check_unit_id |
| | | WHERE |
| | | m.audit_result IN ( 0, 3 ) |
| | | <if test='pagePartyBuildingMemberVO.phone != null and pagePartyBuildingMemberVO.phone != ""'> |
| | | and u.phone LIKE CONCAT('%',#{pagePartyBuildingMemberVO.phone},'%') |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.name != null and pagePartyBuildingMemberVO.name != ""'> |
| | | and u.name like concat ('%',#{pagePartyBuildingMemberVO.name},'%') |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.auditStatus != null'> |
| | | and m.audit_result = #{pagePartyBuildingMemberVO.auditStatus} |
| | | </if> |
| | | <if test='pagePartyBuildingMemberVO.communityId != null'> |
| | | and m.community_id = ${pagePartyBuildingMemberVO.communityId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="org_id" property="orgId" /> |
| | | <result column="check_unit_id" property="checkUnitId" /> |
| | | <result column="id_card" property="idCard" /> |
| | | <result column="type" property="type" /> |
| | | <result column="join_time" property="joinTime" /> |
| | | <result column="employment_time" property="employmentTime" /> |
| | | <result column="function" property="function" /> |
| | | <result column="specialty_category" property="specialtyCategory" /> |
| | | <result column="specialty_name" property="specialtyName" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, phone, is_reg, name, sex, birth_time, position, position_two, job_responsibilities, photo_path, create_at, update_at, community_id |
| | | id, phone, is_reg, name, sex, birth_time, position, position_two, job_responsibilities, photo_path, create_at, update_at, community_id, org_id |
| | | , check_unit_id, id_card, type, join_time, employment_time, function, specialty_category, specialty_name |
| | | </sql> |
| | | |
| | | <select id="getSysUserIdByPhone" resultType="long"> |
| | | SELECT user_id FROM sys_user WHERE phone = #{phone} AND `type` = 1 |
| | | </select> |
| | | |
| | | <select id="getSysUserByIdCardCount" resultType="integer"> |
| | | SELECT count(user_id) FROM sys_user WHERE id_card = #{idCard} AND `type` = 1 |
| | | </select> |
| | | |
| | | <select id="getUserIdByIdCard" resultType="long"> |
| | | select user_id from sys_user WHERE id_card = #{idCard} AND `type` = 1 |
| | | </select> |
| | | |
| | | <select id="pagePartyOrganization" resultType="com.panzhihua.common.model.vos.partybuilding.PartyCommitteeVO"> |
| | | select cpmr.id,cpmr.community_id,cpmr.`name`,cpmr.id_card,cpmr.org_id,cpmr.check_unit_id |
| | | , cpmr.phone,cpmr.is_reg,cpmr.sex,cpmr.birth_time,cpmr.position,cpmr.position_two |
| | | , cpmr.job_responsibilities,cpmr.photo_path,cpmr.type,cpmr.join_time,cpmr.employment_time |
| | | , cpmr.create_at,cpmr.update_at,cpmr.function,cpmr.specialty_category,cpmr.specialty_name |
| | | ,TIMESTAMPDIFF( |
| | | YEAR, |
| | | cpmr.birth_time, |
| | | DATE_FORMAT( NOW(), '%Y-%m-%d' )) age,cpo.`name` as orgName,cpcu.`name` as checkUnitName |
| | | from com_pb_member_role as cpmr |
| | | left join com_pb_org as cpo on cpo.id = cpmr.org_id |
| | | left join com_pb_check_unit as cpcu on cpcu.id = cpmr.check_unit_id |
| | | <where> |
| | | <if test="partyCommitteeVO.communityId != null"> |
| | | and cpmr.community_id = #{partyCommitteeVO.communityId} |
| | | </if> |
| | | <if test="partyCommitteeVO.type != null"> |
| | | and cpmr.type = #{partyCommitteeVO.type} |
| | | </if> |
| | | <if test="partyCommitteeVO.sex != null"> |
| | | and cpmr.sex = #{partyCommitteeVO.sex} |
| | | </if> |
| | | <if test="partyCommitteeVO.keyWord != null and partyCommitteeVO.keyWord != ''"> |
| | | and (cpmr.name like concat (#{partyCommitteeVO.keyWord},'%') or |
| | | cpmr.phone like concat (#{partyCommitteeVO.keyWord},'%') or |
| | | cpmr.id_card = #{partyCommitteeVO.keyWord} |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by cpmr.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |