| | |
| | | |
| | | /** |
| | | * 通用常量信息 |
| | | * |
| | | * |
| | | * @author HUANGHONGFA |
| | | */ |
| | | public class Constants { |
| | |
| | | |
| | | public static final String CLUSTER_MEMBER_ERROR_LIST = "CLUSTER_MEMBER_ERROR_LIST_"; |
| | | |
| | | public static final String COM_MNG_VOLUNTEER_ERROR_LIST = "COM_MNG_VOLUNTEER_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.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.volunteer.ComMngVolunteerErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | 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.stream.Collectors; |
| | | |
| | | /** |
| | | * title: 志愿者导入监听 |
| | | * @author : lyq |
| | | */ |
| | | @Slf4j |
| | | public class ComMngVolunteerExcelListen 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 CommunityService communityService; |
| | | private Long communityId; |
| | | private Long userId; |
| | | private Map<Integer, String> headData; |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | public ComMngVolunteerExcelListen(CommunityService communityService, Long communityId, Long userId, |
| | | StringRedisTemplate stringRedisTemplate) { |
| | | this.communityService = communityService; |
| | | 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.COM_MNG_VOLUNTEER_ERROR_LIST + communityId; |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngVolunteerExcelVO> voList = Lists.newArrayList(); |
| | | ArrayList<ComMngVolunteerErrorExcelVO> mistakes = Lists.newArrayList(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComMngVolunteerExcelVO vo = new ComMngVolunteerExcelVO(); |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者名称不可为空,请填写志愿者名称")); |
| | | continue; |
| | | }else{ |
| | | //判断导入的名字的长度是否超过10 |
| | | 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.setPhone(oneData.get(1)); |
| | | if (StringUtils.isEmpty(oneData.get(2))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者身份证不可为空,请填写志愿者身份证")); |
| | | continue; |
| | | } |
| | | // 判断身份证号码位数 |
| | | if (oneData.get(2).length() != 18) { |
| | | if (oneData.get(2).length() != 15) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者身份证位数有误,请检查身份证号码是否正确")); |
| | | continue; |
| | | } |
| | | } |
| | | if (oneData.get(2).length() != 15) { |
| | | if (oneData.get(2).length() != 18) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者身份证位数有误,请检查身份证号码是否正确")); |
| | | continue; |
| | | } |
| | | } |
| | | vo.setIdCard(oneData.get(2).toUpperCase()); |
| | | if (StringUtils.isEmpty(oneData.get(3))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者组织不可为空,请填写志愿者组织")); |
| | | continue; |
| | | } |
| | | vo.setOrgName(oneData.get(3)); |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(4))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者队伍不可为空,请填写志愿者队伍")); |
| | | continue; |
| | | } |
| | | vo.setTeamName(oneData.get(4)); |
| | | if (StringUtils.isEmpty(oneData.get(5))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"志愿者技能不可为空,请填写志愿者技能")); |
| | | continue; |
| | | } |
| | | vo.setSkillName(oneData.get(5)); |
| | | if (StringUtils.isEmpty(oneData.get(6))) { |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"是否是大学生不可为空,请填写是否是大学生")); |
| | | continue; |
| | | } |
| | | if(!oneData.get(6).equals("1") && !oneData.get(6).equals("2")){ |
| | | index++; |
| | | mistakes.add(setErrorObject(oneData,"是否是大学生选择错误,请选择是否")); |
| | | continue; |
| | | } |
| | | vo.setIsUniversity(Integer.parseInt(oneData.get(6))); |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | List<ComMngVolunteerExcelVO> newVoList = |
| | | voList.stream().filter(ListUtils.distinctByKey(ComMngVolunteerExcelVO::getIdCard)) |
| | | .collect(Collectors.toList()); |
| | | R r = communityService.importVolunteerAdmin(newVoList, communityId, userId); |
| | | if (!R.isOk(r)) { |
| | | List<ComMngVolunteerErrorExcelVO> list = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComMngVolunteerErrorExcelVO.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, ComMngVolunteerErrorExcelVO vo) { |
| | | vo.setName(map.get(0)); |
| | | vo.setPhone(map.get(1)); |
| | | vo.setIdCard(map.get(2)); |
| | | vo.setOrgName(map.get(3)); |
| | | vo.setTeamName(map.get(4)); |
| | | vo.setSkillName(map.get(5)); |
| | | } |
| | | |
| | | /** |
| | | * 组装错误信息 |
| | | * @param oneData 数据表格对象 |
| | | * @param error 错误信息 |
| | | * @return 错误对象 |
| | | */ |
| | | private ComMngVolunteerErrorExcelVO setErrorObject(Map<Integer, String> oneData, String error){ |
| | | ComMngVolunteerErrorExcelVO mistake = new ComMngVolunteerErrorExcelVO(); |
| | | setError(oneData, mistake); |
| | | mistake.setError(error); |
| | | return mistake; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 新增志愿者组织队伍表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:04:49 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增志愿者组织队伍表请求参数") |
| | | public class AddComMngVolunteerOrgTeamDto { |
| | | |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 父级id,为0时则为组织,不为0则为队伍 |
| | | */ |
| | | @ApiModelProperty(value = "父级id,为0时则为组织,不为0则为队伍") |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 服务类型 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型") |
| | | private Long serviceTypeId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 新增志愿者服务类型表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增志愿者服务类型表请求参数") |
| | | public class AddComMngVolunteerServiceTypeDto { |
| | | |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 新增志愿者技能表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增志愿者技能表请求参数") |
| | | public class AddComMngVolunteerSkillDto { |
| | | |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 编辑志愿者组织队伍表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:04:50 |
| | | */ |
| | | @Data |
| | | @ApiModel("编辑志愿者组织队伍表请求参数") |
| | | public class EditComMngVolunteerOrgTeamDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 父级id,为0时则为组织,不为0则为队伍 |
| | | */ |
| | | @ApiModelProperty(value = "父级id,为0时则为组织,不为0则为队伍") |
| | | private Long parentId; |
| | | /** |
| | | * 服务类型 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型") |
| | | private Long serviceTypeId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 编辑志愿者服务类型表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | @Data |
| | | @ApiModel("编辑志愿者服务类型表请求参数") |
| | | public class EditComMngVolunteerServiceTypeDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @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") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 编辑志愿者技能表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("编辑志愿者技能表请求参数") |
| | | public class EditComMngVolunteerSkillDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分页查询志愿者组织队伍表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:04:48 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询志愿者组织队伍表请求参数") |
| | | public class PageComMngVolunteerOrgTeamDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 父级id,为0时则为组织,不为0则为队伍 |
| | | */ |
| | | @ApiModelProperty(value = "父级id,为0时则为组织,不为0则为队伍") |
| | | private Long parentId; |
| | | /** |
| | | * 服务类型 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型") |
| | | private Long serviceTypeId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | |
| | | @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.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分页查询志愿者服务类型表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询志愿者服务类型表请求参数") |
| | | public class PageComMngVolunteerServiceTypeDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @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") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @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.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分页查询志愿者技能表请求参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询志愿者技能表请求参数") |
| | | public class PageComMngVolunteerSkillDto { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @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") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty(value = "修改人id") |
| | | private Long updateBy; |
| | | |
| | | @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.vos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 志愿者组织队伍表返回参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:06:57 |
| | | */ |
| | | @Data |
| | | @ApiModel("志愿者组织队伍表返回参数") |
| | | public class ComMngVolunteerOrgTeamVo { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 父级id,为0时则为组织,不为0则为队伍 |
| | | */ |
| | | @ApiModelProperty(value = "父级id,为0时则为组织,不为0则为队伍") |
| | | private Long parentId; |
| | | /** |
| | | * 服务类型 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型") |
| | | private Long serviceTypeId; |
| | | /** |
| | | * 服务类型名称 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型名称") |
| | | private String serviceTypeName; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "修改时间") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty(value = "组织下队伍列表") |
| | | private List<ComMngVolunteerOrgTeamVo> childList; |
| | | |
| | | @ApiModelProperty(value = "创建人名字") |
| | | private String createByName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 志愿者服务类型表返回参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | @Data |
| | | @ApiModel("志愿者服务类型表返回参数") |
| | | public class ComMngVolunteerServiceTypeVo { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @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; |
| | | /** |
| | | * 创建人名称 |
| | | */ |
| | | @ApiModelProperty(value = "创建人名称") |
| | | private String createByName; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @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; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.common; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 志愿者技能表返回参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("志愿者技能表返回参数") |
| | | public class ComMngVolunteerSkillVo { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @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; |
| | | /** |
| | | * 创建人名称 |
| | | */ |
| | | @ApiModelProperty(value = "创建人名称") |
| | | private String createByName; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @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; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.common; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * 志愿者组织统计返回参数 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:06:57 |
| | | */ |
| | | @Data |
| | | @ApiModel("志愿者组织统计返回参数") |
| | | public class ComMngVolunteerStatisticsVo { |
| | | |
| | | @ApiModelProperty(value = "组织数量") |
| | | private Integer orgTotal; |
| | | |
| | | @ApiModelProperty(value = "队伍数量") |
| | | private Integer teamTotal; |
| | | |
| | | @ApiModelProperty(value = "志愿者数量") |
| | | private Integer volunteerTotal; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | |
| | | @ApiModelProperty(value = "申请提交人ID", hidden = true) |
| | | private Long submitUserId; |
| | | |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "组织id") |
| | | private Long orgId; |
| | | |
| | | @ApiModelProperty(value = "队伍id") |
| | | private Long teamId; |
| | | |
| | | @ApiModelProperty(value = "技能id") |
| | | private Long skillId; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "组织名称") |
| | | private String orgName; |
| | | |
| | | @ApiModelProperty(value = "队伍名称") |
| | | private String teamName; |
| | | |
| | | @ApiModelProperty(value = "技能名称") |
| | | private String skillName; |
| | | |
| | | @ApiModelProperty(value = "服务类型id") |
| | | private Long serviceTypeId; |
| | | |
| | | @ApiModelProperty(value = "服务类型名称") |
| | | private String serviceTypeName; |
| | | |
| | | @ApiModelProperty(value = "是否是在校大学生(1.是 2.否)") |
| | | private Integer isUniversity; |
| | | |
| | | @Length(max = 30) |
| | | @ApiModelProperty(value = "大学名称") |
| | | private String universityName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.volunteer; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 批量导入志愿者请求参数 |
| | | * @author : lyq |
| | | */ |
| | | @Data |
| | | public class ComMngVolunteerErrorExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "志愿者名称", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "志愿者手机号", index = 1) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "志愿者身份证", index = 2) |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "志愿者组织", index = 3) |
| | | private String orgName; |
| | | |
| | | @ExcelProperty(value = "志愿者队伍", index = 4) |
| | | private String teamName; |
| | | |
| | | @ExcelProperty(value = "技能", index = 5) |
| | | private String skillName; |
| | | |
| | | @ExcelProperty(value = "是否是大学生", index = 6) |
| | | private Integer isUniversity; |
| | | |
| | | @ExcelProperty(value = "错误信息", index = 7) |
| | | private String error; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.volunteer; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @description: 批量导入志愿者请求参数 |
| | | * @author : lyq |
| | | */ |
| | | @Data |
| | | public class ComMngVolunteerExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "志愿者名称", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "志愿者手机号", index = 1) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "志愿者身份证", index = 2) |
| | | private String idCard; |
| | | |
| | | @ExcelProperty(value = "志愿者组织", index = 3) |
| | | private String orgName; |
| | | |
| | | @ExcelProperty(value = "志愿者队伍", index = 4) |
| | | private String teamName; |
| | | |
| | | @ExcelProperty(value = "技能", index = 5) |
| | | private String skillName; |
| | | |
| | | @ExcelProperty(value = "是否是大学生", index = 6) |
| | | private Integer isUniversity; |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | @PostMapping("/common/data/history/filled") |
| | | R filledPopulationPersonType(@RequestBody List<ComMngPopulationServeExcelVO> newVoList, |
| | | @RequestParam("communityId") Long communityId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 社区后台-分页查询志愿者组织队伍 |
| | | * |
| | | * @param orgTeamDto 请求参数 |
| | | * @return 志愿者组织队伍 |
| | | */ |
| | | @PostMapping("/comMngVolunteerOrgTeam/page") |
| | | R pageVolunteerOrgAdmin(@RequestBody PageComMngVolunteerOrgTeamDto orgTeamDto); |
| | | |
| | | /** |
| | | * 社区后台-新增志愿者组织队伍 |
| | | * |
| | | * @param orgTeamDto 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comMngVolunteerOrgTeam/add") |
| | | R addVolunteerOrgAdmin(@RequestBody AddComMngVolunteerOrgTeamDto orgTeamDto); |
| | | |
| | | /** |
| | | * 社区后台-编辑志愿者组织队伍 |
| | | * |
| | | * @param orgTeamDto 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/comMngVolunteerOrgTeam/edit") |
| | | R editVolunteerOrgAdmin(@RequestBody EditComMngVolunteerOrgTeamDto orgTeamDto); |
| | | |
| | | /** |
| | | * 社区后台-删除志愿者组织队伍 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comMngVolunteerOrgTeam/delete") |
| | | R deleteVolunteerOrgAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者组织列表 |
| | | * |
| | | * @param orgTeamDto 请求参数 |
| | | * @return 志愿者组织列表 |
| | | */ |
| | | @PostMapping("/comMngVolunteerOrgTeam/list") |
| | | R listVolunteerOrgAdmin(@RequestBody PageComMngVolunteerOrgTeamDto orgTeamDto); |
| | | |
| | | /** |
| | | * 社区后台-分页查询服务类型 |
| | | * |
| | | * @param serviceTypeDto 请求参数 |
| | | * @return 服务类型列表 |
| | | */ |
| | | @PostMapping("/comMngVolunteerServiceType/page") |
| | | R pageServiceTypeAdmin(@RequestBody PageComMngVolunteerServiceTypeDto serviceTypeDto); |
| | | |
| | | /** |
| | | * 社区后台-新增服务类型 |
| | | * |
| | | * @param serviceTypeDto 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comMngVolunteerServiceType/add") |
| | | R addServiceTypeAdmin(@RequestBody AddComMngVolunteerServiceTypeDto serviceTypeDto); |
| | | |
| | | /** |
| | | * 社区后台-编辑服务类型 |
| | | * |
| | | * @param serviceTypeDto 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/comMngVolunteerServiceType/edit") |
| | | R editServiceTypeAdmin(@RequestBody EditComMngVolunteerServiceTypeDto serviceTypeDto); |
| | | |
| | | /** |
| | | * 社区后台-删除服务类型 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comMngVolunteerServiceType/delete") |
| | | R deleteServiceTypeAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 社区后台-分页查询志愿者技能列表 |
| | | * |
| | | * @param volunteerSkillDto 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | @PostMapping("/comMngVolunteerSkill/page") |
| | | R pageVolunteerSkillAdmin(@RequestBody PageComMngVolunteerSkillDto volunteerSkillDto); |
| | | |
| | | /** |
| | | * 社区后台-新增志愿者技能 |
| | | * |
| | | * @param volunteerSkillDto 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comMngVolunteerSkill/add") |
| | | R addVolunteerSkillAdmin(@RequestBody AddComMngVolunteerSkillDto volunteerSkillDto); |
| | | |
| | | /** |
| | | * 社区后台-编辑志愿者技能 |
| | | * |
| | | * @param volunteerSkillDto 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/comMngVolunteerSkill/edit") |
| | | R editVolunteerSkillAdmin(@RequestBody EditComMngVolunteerSkillDto volunteerSkillDto); |
| | | |
| | | /** |
| | | * 社区后台-删除志愿者技能 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comMngVolunteerSkill/delete") |
| | | R deleteVolunteerSkillAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者服务类型列表 |
| | | * |
| | | * @param serviceTypeDto 请求参数 |
| | | * @return 志愿者服务列表 |
| | | */ |
| | | @PostMapping("/comMngVolunteerServiceType/list") |
| | | R listServiceTypeAdmin(@RequestBody PageComMngVolunteerServiceTypeDto serviceTypeDto); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者技能列表 |
| | | * |
| | | * @param volunteerSkillDto 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | @PostMapping("/comMngVolunteerSkill/list") |
| | | R listVolunteerSkillAdmin(@RequestBody PageComMngVolunteerSkillDto volunteerSkillDto); |
| | | |
| | | /** |
| | | * 社区后台-志愿者组织统计 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 志愿者组织统计 |
| | | */ |
| | | @GetMapping("/comMngVolunteerOrgTeam/statistics") |
| | | R statisticsVolunteerOrgAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 志愿者导入 |
| | | * |
| | | * @param list 志愿者数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/volunteer/import/admin") |
| | | R importVolunteerAdmin(@RequestBody List<ComMngVolunteerExcelVO> 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.ComMngVolunteerExcelListen; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerStatisticsVo; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerErrorExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | 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.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 志愿者模块 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"志愿者模块"}) |
| | | @RestController |
| | | @RequestMapping("/volunteer/") |
| | | public class VolunteerApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @ApiOperation(value = "分页查询志愿者组织", response = ComMngVolunteerOrgTeamVo.class) |
| | | @PostMapping("/org/page") |
| | | public R pageVolunteerOrgAdmin(@RequestBody PageComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | orgTeamDto.setParentId(0L); |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者组织列表", response = ComMngVolunteerOrgTeamVo.class) |
| | | @GetMapping("/org/list") |
| | | public R listVolunteerOrgAdmin() { |
| | | PageComMngVolunteerOrgTeamDto orgTeamDto = new PageComMngVolunteerOrgTeamDto(); |
| | | orgTeamDto.setParentId(0L); |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询志愿者组织下队伍列表", response = ComMngVolunteerOrgTeamVo.class) |
| | | @PostMapping("/org/team/page") |
| | | public R pageVolunteerOrgTeamAdmin(@RequestBody PageComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增志愿者组织") |
| | | @PostMapping("/org/add") |
| | | public R addVolunteerOrgAdmin(@RequestBody AddComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | if(StringUtils.isEmpty(orgTeamDto.getName())){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | orgTeamDto.setParentId(0L); |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.addVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增志愿者队伍") |
| | | @PostMapping("/org/team/add") |
| | | public R addVolunteerOrgTeamAdmin(@RequestBody AddComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | if(orgTeamDto.getParentId() == null || orgTeamDto.getServiceTypeId() == null || StringUtils.isEmpty(orgTeamDto.getName())){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.addVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑志愿者组织") |
| | | @PostMapping("/org/edit") |
| | | public R editVolunteerOrgAdmin(@RequestBody EditComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | if(StringUtils.isEmpty(orgTeamDto.getName()) || orgTeamDto.getId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.editVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑志愿者队伍") |
| | | @PostMapping("/org/team/edit") |
| | | public R editVolunteerOrgTeamAdmin(@RequestBody EditComMngVolunteerOrgTeamDto orgTeamDto) { |
| | | if(orgTeamDto.getId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.editVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除志愿者组织/队伍") |
| | | @PostMapping("/org/delete") |
| | | public R deleteVolunteerOrgAdmin(@RequestParam("id") Long id) { |
| | | if(id == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.deleteVolunteerOrgAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询服务类型", response = ComMngVolunteerOrgTeamVo.class) |
| | | @PostMapping("/service/type/page") |
| | | public R pageServiceTypeAdmin(@RequestBody PageComMngVolunteerServiceTypeDto serviceTypeDto) { |
| | | serviceTypeDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageServiceTypeAdmin(serviceTypeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增服务类型") |
| | | @PostMapping("/service/type/add") |
| | | public R addServiceTypeAdmin(@RequestBody AddComMngVolunteerServiceTypeDto serviceTypeDto) { |
| | | if(StringUtils.isEmpty(serviceTypeDto.getName())){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | serviceTypeDto.setCommunityId(this.getCommunityId()); |
| | | serviceTypeDto.setUserId(this.getUserId()); |
| | | return communityService.addServiceTypeAdmin(serviceTypeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑服务类型") |
| | | @PostMapping("/service/type/edit") |
| | | public R editServiceTypeAdmin(@RequestBody EditComMngVolunteerServiceTypeDto serviceTypeDto) { |
| | | if(StringUtils.isEmpty(serviceTypeDto.getName()) || serviceTypeDto.getId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | serviceTypeDto.setUserId(this.getUserId()); |
| | | return communityService.editServiceTypeAdmin(serviceTypeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除志愿者组织/队伍") |
| | | @PostMapping("/service/type/delete") |
| | | public R deleteServiceTypeAdmin(@RequestParam("id") Long id) { |
| | | if(id == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.deleteServiceTypeAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询志愿者技能列表", response = ComMngVolunteerSkillVo.class) |
| | | @PostMapping("/skill/page") |
| | | public R pageVolunteerSkillAdmin(@RequestBody PageComMngVolunteerSkillDto volunteerSkillDto) { |
| | | volunteerSkillDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageVolunteerSkillAdmin(volunteerSkillDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增志愿者技能列表") |
| | | @PostMapping("/skill/add") |
| | | public R addVolunteerSkillAdmin(@RequestBody AddComMngVolunteerSkillDto volunteerSkillDto) { |
| | | if(StringUtils.isEmpty(volunteerSkillDto.getName())){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | volunteerSkillDto.setCommunityId(this.getCommunityId()); |
| | | volunteerSkillDto.setUserId(this.getUserId()); |
| | | return communityService.addVolunteerSkillAdmin(volunteerSkillDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑志愿者技能列表") |
| | | @PostMapping("/skill/edit") |
| | | public R editVolunteerSkillAdmin(@RequestBody EditComMngVolunteerSkillDto volunteerSkillDto) { |
| | | if(StringUtils.isEmpty(volunteerSkillDto.getName()) || volunteerSkillDto.getId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | volunteerSkillDto.setUserId(this.getUserId()); |
| | | return communityService.editVolunteerSkillAdmin(volunteerSkillDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除志愿者技能列表") |
| | | @PostMapping("/skill/delete") |
| | | public R deleteVolunteerSkillAdmin(@RequestParam("id") Long id) { |
| | | if(id == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.deleteVolunteerSkillAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者服务类型列表", response = ComMngVolunteerServiceTypeVo.class) |
| | | @GetMapping("/service/type/list") |
| | | public R listVolunteerServiceTypeAdmin() { |
| | | PageComMngVolunteerServiceTypeDto serviceTypeDto = new PageComMngVolunteerServiceTypeDto(); |
| | | serviceTypeDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listServiceTypeAdmin(serviceTypeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者技能列表", response = ComMngVolunteerSkillVo.class) |
| | | @GetMapping("/skill/list") |
| | | public R listVolunteerSkillAdmin() { |
| | | PageComMngVolunteerSkillDto volunteerSkillDto = new PageComMngVolunteerSkillDto(); |
| | | volunteerSkillDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listVolunteerSkillAdmin(volunteerSkillDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "志愿者组织统计接口", response = ComMngVolunteerStatisticsVo.class) |
| | | @GetMapping("/org/statistics") |
| | | public R statisticsVolunteerOrgAdmin() { |
| | | return communityService.statisticsVolunteerOrgAdmin(this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "志愿者导入模板下载") |
| | | @GetMapping("/import/template/download") |
| | | public R importTemplateDownload() { |
| | | return R.ok(sftpConfig.getExcelUrl() + "志愿者导入模板.xlsx"); |
| | | } |
| | | |
| | | @ApiOperation(value = "志愿者导入") |
| | | @PostMapping("/import") |
| | | public R importAdmin(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // 获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | ComMngVolunteerExcelListen clusterMemberExcelListen = new ComMngVolunteerExcelListen( |
| | | communityService, this.getCommunityId(), this.getUserId(), stringRedisTemplate); |
| | | EasyExcel.read(inputStream, null, clusterMemberExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载导入失败志愿者错误数据") |
| | | @PostMapping("/download/error") |
| | | public R downloadErrorDrugPopulation(@RequestParam(value = "key") String key) { |
| | | List<ComMngVolunteerErrorExcelVO> 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, ComMngVolunteerErrorExcelVO.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, ComMngVolunteerErrorExcelVO.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(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerOrgTeamService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 志愿者组织队伍表(ComMngVolunteerOrgTeam)表控制层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 15:51:21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comMngVolunteerOrgTeam") |
| | | public class ComMngVolunteerOrgTeamApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComMngVolunteerOrgTeamService comMngVolunteerOrgTeamService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | return this.comMngVolunteerOrgTeamService.queryByPage(comMngVolunteerOrgTeam); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R queryById(@PathVariable("id") Long id) { |
| | | return this.comMngVolunteerOrgTeamService.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 实体 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | return this.comMngVolunteerOrgTeamService.insert(comMngVolunteerOrgTeam); |
| | | } |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 实体 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | return this.comMngVolunteerOrgTeamService.update(comMngVolunteerOrgTeam); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 删除是否成功 |
| | | */ |
| | | @GetMapping("/delete") |
| | | public R deleteById(Long id) { |
| | | return this.comMngVolunteerOrgTeamService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者组织列表 |
| | | * @param comMngVolunteerOrgTeam 请求参数 |
| | | * @return 志愿者组织列表 |
| | | */ |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | return this.comMngVolunteerOrgTeamService.queryByList(comMngVolunteerOrgTeam); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-志愿者组织统计 |
| | | * @param communityId 社区id |
| | | * @return 志愿者组织统计 |
| | | */ |
| | | @GetMapping("/statistics") |
| | | public R statisticsVolunteerOrgAdmin(@RequestParam("communityId") Long communityId) { |
| | | return this.comMngVolunteerOrgTeamService.statisticsVolunteerOrgAdmin(communityId); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerServiceTypeService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 志愿者服务类型表(ComMngVolunteerServiceType)表控制层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comMngVolunteerServiceType") |
| | | public class ComMngVolunteerServiceTypeApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComMngVolunteerServiceTypeService comMngVolunteerServiceTypeService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerServiceType 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | return this.comMngVolunteerServiceTypeService.queryByPage(comMngVolunteerServiceType); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R queryById(@PathVariable("id") Long id) { |
| | | return this.comMngVolunteerServiceTypeService.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 实体 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | return this.comMngVolunteerServiceTypeService.insert(comMngVolunteerServiceType); |
| | | } |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 实体 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | return this.comMngVolunteerServiceTypeService.update(comMngVolunteerServiceType); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 删除是否成功 |
| | | */ |
| | | @GetMapping("/delete") |
| | | public R deleteById(Long id) { |
| | | return this.comMngVolunteerServiceTypeService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者服务类型列表 |
| | | * @param comMngVolunteerServiceType 请求参数 |
| | | * @return 志愿者服务列表 |
| | | */ |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | return this.comMngVolunteerServiceTypeService.queryByList(comMngVolunteerServiceType); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerSkillService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 志愿者技能表(ComMngVolunteerSkill)表控制层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:36 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comMngVolunteerSkill") |
| | | public class ComMngVolunteerSkillApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComMngVolunteerSkillService comMngVolunteerSkillService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerSkill 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | return this.comMngVolunteerSkillService.queryByPage(comMngVolunteerSkill); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R queryById(@PathVariable("id") Long id) { |
| | | return this.comMngVolunteerSkillService.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerSkill 实体 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | return this.comMngVolunteerSkillService.insert(comMngVolunteerSkill); |
| | | } |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * |
| | | * @param comMngVolunteerSkill 实体 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | return this.comMngVolunteerSkillService.update(comMngVolunteerSkill); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 删除是否成功 |
| | | */ |
| | | @GetMapping("/delete") |
| | | public R deleteById(Long id) { |
| | | return this.comMngVolunteerSkillService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者技能列表 |
| | | * @param comMngVolunteerSkill 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | return this.comMngVolunteerSkillService.queryByList(comMngVolunteerSkill); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | |
| | | |
| | | /** |
| | | * 社区后台分页查询社区活动 |
| | | * |
| | | * |
| | | * @param comActActivityVO |
| | | * 查询参数 |
| | | * @return 返回结果 |
| | |
| | | |
| | | /** |
| | | * 查询随手拍是否有活动 |
| | | * |
| | | * |
| | | * @return 活动详情 |
| | | */ |
| | | @PostMapping("getEasyPhotoActivity") |
| | |
| | | |
| | | /** |
| | | * 查询所有建筑类型 |
| | | * |
| | | * |
| | | * @return 类型列表 |
| | | */ |
| | | @PostMapping("listbuildtype") |
| | |
| | | |
| | | /** |
| | | * 分页查询 其他建筑 |
| | | * |
| | | * |
| | | * @param comMngStructOtherBuildVO |
| | | * 分页查询参数 |
| | | * @return 查询结果 |
| | |
| | | |
| | | /** |
| | | * 增加志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 志愿者信息 |
| | | * @return 增加结果 |
| | |
| | | |
| | | /** |
| | | * 获取志愿者详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 手机号 |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 编辑志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | |
| | | |
| | | /** |
| | | * 分页展示志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 查询参数 |
| | | * @return 分页集合返回 |
| | |
| | | |
| | | /** |
| | | * 分页展示志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | |
| | | |
| | | /** |
| | | * 志愿者审核详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键 |
| | | * @return 详情 |
| | |
| | | |
| | | /** |
| | | * 志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 审核操作 |
| | | * @return 审核结果 |
| | |
| | | |
| | | /** |
| | | * 删除志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 主键 |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 查询区域 |
| | | * |
| | | * |
| | | * @param comActVO |
| | | * 登录人的经纬度、或者指定区域的社区 |
| | | * @return 社区集合 |
| | |
| | | |
| | | /** |
| | | * 用户修改手机号对应的志愿者手机号也要修改 |
| | | * |
| | | * |
| | | * @param userPhoneVO |
| | | * 新旧手机号 |
| | | * @return 修改结果 |
| | |
| | | |
| | | /** |
| | | * 房屋地址下拉列表 |
| | | * |
| | | * |
| | | * @param parentCode |
| | | * 父级编码 |
| | | * @param areaId |
| | |
| | | |
| | | /** |
| | | * 新增房屋 |
| | | * |
| | | * |
| | | * @param comMngStructHouseVO |
| | | * 房屋信息 |
| | | * @return 新增结果 |
| | |
| | | |
| | | /** |
| | | * 查询小区 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 小区集合 |
| | |
| | | |
| | | /** |
| | | * 用户参加的所有社区活动 |
| | | * |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @return 活动列表 |
| | |
| | | |
| | | /** |
| | | * 用户确认心愿 |
| | | * |
| | | * |
| | | * @param comActMicroWishVO |
| | | * 用户评价 |
| | | * @return 确认结果 |
| | |
| | | |
| | | /** |
| | | * 建筑类型 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 建筑集合 |
| | |
| | | |
| | | /** |
| | | * 增加删除建筑类型 |
| | | * |
| | | * |
| | | * @param systemmanagementConfigVO |
| | | * 操作内容 |
| | | * @return 操作结果 |
| | |
| | | |
| | | /** |
| | | * 社区详情 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 社区详情 |
| | |
| | | |
| | | /** |
| | | * 小区详情 |
| | | * |
| | | * |
| | | * @param areaId |
| | | * 小区id |
| | | * @return 小区信息 |
| | |
| | | |
| | | /** |
| | | * 分页查询社区 |
| | | * |
| | | * |
| | | * @param pageComActDTO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | |
| | | |
| | | /** |
| | | * 志愿者详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键 |
| | | * @return 志愿者 |
| | |
| | | |
| | | /** |
| | | * 查询平台所有的社区 |
| | | * |
| | | * |
| | | * @return 社区集合 按照创建顺序倒序排列 |
| | | */ |
| | | @PostMapping("listcommunityall") |
| | |
| | | |
| | | /** |
| | | * 社区管理后台数据看板 代办事件 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @param userId |
| | |
| | | |
| | | /** |
| | | * 删除社区 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 定时任务刷新社区动态置顶状态 |
| | | * |
| | | * |
| | | * @return 刷新结果 |
| | | */ |
| | | @PostMapping("timedtaskdynistopping") |
| | |
| | | |
| | | /** |
| | | * 定时任务刷新社区动态发布状态 |
| | | * |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("timedtaskdynstatus") |
| | |
| | | |
| | | /** |
| | | * 定时任务查询所有要取消的社区活动 |
| | | * |
| | | * |
| | | * @return 社区活动集合 |
| | | */ |
| | | @PostMapping("timedtaskactactivity") |
| | |
| | | |
| | | /** |
| | | * 定时任务刷新社区活动的各个状态 除取消外 |
| | | * |
| | | * |
| | | * @return 更新结果 |
| | | */ |
| | | @PostMapping("timedtaskactactivityall") |
| | |
| | | |
| | | /** |
| | | * 定时任务刷新微心愿的状态 |
| | | * |
| | | * |
| | | * @return 更新结果 |
| | | */ |
| | | @PostMapping("timedtaskactmicrowish") |
| | |
| | | |
| | | /** |
| | | * 其他建筑详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键id |
| | | * @return 建筑内容 |
| | |
| | | |
| | | /** |
| | | * 编辑其他建筑 |
| | | * |
| | | * |
| | | * @param comMngStructOtherBuildVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | |
| | | |
| | | /** |
| | | * 删除其他建筑 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键 |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 小程序分页查询随手拍 |
| | | * |
| | | * |
| | | * @param comActEasyPhotoVO |
| | | * 查询参数 |
| | | * @return 返回结果 |
| | |
| | | |
| | | /** |
| | | * 随手拍评论分页查询 |
| | | * |
| | | * |
| | | * @param pageComActEasyPhotoCommentDTO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | |
| | | |
| | | /** |
| | | * 评论点赞/取消点赞 |
| | | * |
| | | * |
| | | * @param comActEasyPhotoCommentUserDTO |
| | | * 操作 |
| | | * @return 操作结果 |
| | |
| | | |
| | | /** |
| | | * 随手拍--评论--新增评论 |
| | | * |
| | | * |
| | | * @param comActEasyPhotoCommentDTO |
| | | * 新增内容 |
| | | * @return 新增结果 |
| | |
| | | |
| | | /** |
| | | * 查询城市下属所有地区列表 |
| | | * |
| | | * |
| | | * @param cityAdcode |
| | | * 城市地址编码 |
| | | * @return 地区列表 |
| | |
| | | |
| | | /** |
| | | * 首页图表数据汇总 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 图表数据 IndexDataVO |
| | |
| | | |
| | | /** |
| | | * 选择导入的小区 |
| | | * |
| | | * |
| | | * @param param |
| | | * 小区名字 模糊查询 |
| | | * @param communityId |
| | |
| | | |
| | | /** |
| | | * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则 |
| | | * |
| | | * |
| | | * @param id |
| | | * 小区id |
| | | * @return ComMngStructAreaVO |
| | |
| | | |
| | | /** |
| | | * 新增留言 |
| | | * |
| | | * |
| | | * @param comActMessageVO |
| | | * 新增留言信息 |
| | | * @return 发布结果 |
| | |
| | | |
| | | /** |
| | | * 我发的留言 |
| | | * |
| | | * |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemymessage") |
| | |
| | | |
| | | /** |
| | | * 发给我的留言 |
| | | * |
| | | * |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagesendtomemessage") |
| | |
| | | |
| | | /** |
| | | * 根据id查询留言集合 |
| | | * |
| | | * |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemessagebyuser") |
| | |
| | | |
| | | /** |
| | | * 社区留言 |
| | | * |
| | | * |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemycommunitymessage") |
| | |
| | | |
| | | /** |
| | | * 新增留言回复 |
| | | * |
| | | * |
| | | * @param comActMessageBackVO |
| | | * 新增留言回复信息 |
| | | * @return 发布结果 |
| | |
| | | |
| | | /** |
| | | * 导出房屋信息 |
| | | * |
| | | * |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查看用户问卷调查详细 |
| | | * |
| | | * |
| | | * @param userId |
| | | * 用户ID |
| | | * @param questId |
| | |
| | | |
| | | /** |
| | | * 查看问卷调查详细 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 问卷ID |
| | | * @return 用户问卷调查详细 |
| | |
| | | |
| | | /** |
| | | * 小程序-问卷调查详情 |
| | | * |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param questId |
| | |
| | | |
| | | /** |
| | | * 社区后台-查询问卷调查详情 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 问卷id |
| | | * @return 问卷调查详情 |
| | |
| | | |
| | | /** |
| | | * 新增社区问卷 |
| | | * |
| | | * |
| | | * @param questnaireVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 小程序-社区问卷列表 |
| | | * |
| | | * |
| | | * @param pageQuestnaireDTO |
| | | * 请求参数 |
| | | * @return 社区问卷列表 |
| | |
| | | |
| | | /** |
| | | * 社区后台-社区问卷列表 |
| | | * |
| | | * |
| | | * @param pageQuestnaireDTO |
| | | * 请求参数 |
| | | * @return 社区问卷列表 |
| | |
| | | |
| | | /** |
| | | * 编辑问卷——问卷、题目、选项 |
| | | * |
| | | * |
| | | * @param questnaireVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改问卷状态 |
| | | * |
| | | * |
| | | * @param editComActQuestnaireVo |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除问卷 ——隐藏 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 调查问卷Id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查看用户问卷调查统计信息 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 问卷ID |
| | | * @return 用户问卷调查统计信息 |
| | |
| | | |
| | | /** |
| | | * 社区问卷回答用户分页 |
| | | * |
| | | * |
| | | * @param pageQuestnaireAnswerDTO |
| | | * @return 分页数据 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 小程序-用户弹窗添加不在提醒接口 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 问卷id |
| | | * @param userId |
| | |
| | | |
| | | /** |
| | | * 删除微心愿 |
| | | * |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增高龄认证 |
| | | * |
| | | * |
| | | * @param eldersAuthAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改高龄认证 |
| | | * |
| | | * |
| | | * @param eldersAuthEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查找高龄认证 |
| | | * |
| | | * |
| | | * @param pageEldersAuthDTO |
| | | * @return 维护结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除高龄认证 |
| | | * |
| | | * |
| | | * @param EldersAuthDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询高龄认证详细信息 |
| | | * |
| | | * |
| | | * @param id |
| | | * 高龄认证 id |
| | | * @return 查找结果 |
| | |
| | | |
| | | /** |
| | | * 新增高龄认证社区反馈 |
| | | * |
| | | * |
| | | * @param {classNameFirstLower}AddDTO |
| | | * 添加高龄认证社区反馈传递对象 |
| | | * @return 新增结果 |
| | |
| | | |
| | | /** |
| | | * 查询导出高龄老人 |
| | | * |
| | | * |
| | | * @param pageEldersAuthDTO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 设置社区认证方式 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区ID |
| | | * @param type |
| | |
| | | |
| | | /** |
| | | * 随手拍活动定时任务 |
| | | * |
| | | * |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("timeTaskEasyPhotoActivity") |
| | |
| | | |
| | | /** |
| | | * 社区随手拍列表统计 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 统计结果 |
| | |
| | | |
| | | /** |
| | | * 综治后台-查询社区列表 |
| | | * |
| | | * |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/eventgrid/community/list") |
| | |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * |
| | | * |
| | | * @param grantRewardDTO |
| | | * 请求参数 |
| | | * @return 发放结果 |
| | |
| | | |
| | | /** |
| | | * 获取最新活动和用户最新收益 |
| | | * |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param communityId |
| | |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @return 读取结果 |
| | |
| | | |
| | | /** |
| | | * 问卷调查统计汇总 |
| | | * |
| | | * |
| | | * @param summaryDTO |
| | | * 请求参数 |
| | | * @return 统计汇总 |
| | |
| | | |
| | | /** |
| | | * 问卷调查统计汇总导出数据查询 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 调查问卷id |
| | | * @return 调查统计汇总导出数据 |
| | |
| | | |
| | | /** |
| | | * 问卷调查统计汇总表头统计 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 调查问卷id |
| | | * @return 问卷调查统计汇总表头统计数据 |
| | |
| | | |
| | | /** |
| | | * 小程序-新增问卷调查浏览数量 |
| | | * |
| | | * |
| | | * @param questId |
| | | * 问卷调查id |
| | | * @return 增加结果 |
| | |
| | | |
| | | /** |
| | | * 社区后台-切换随手拍公示状态 |
| | | * |
| | | * |
| | | * @param comActEasyPhotoVO |
| | | * 请求参数 |
| | | * @return 切换结果 |
| | |
| | | |
| | | /** |
| | | * 查询社区待处理随手拍id集合 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 社区待处理随手拍id集合 |
| | |
| | | public R listMyActivityEvaluate(@RequestParam("userId") Long userId, @RequestParam("activityId") Long activityId) { |
| | | return comActActEvaluateService.listMyActivityEvaluate(userId, activityId); |
| | | } |
| | | |
| | | /** |
| | | * 志愿者导入 |
| | | * |
| | | * @param list 志愿者数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/volunteer/import/admin") |
| | | public R importVolunteerAdmin(@RequestBody List<ComMngVolunteerExcelVO> list, |
| | | @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId) { |
| | | return comMngVolunteerMngService.importVolunteerAdmin(list,communityId,userId); |
| | | } |
| | | } |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComMngVolunteerMngDAO extends BaseMapper<ComMngVolunteerMngDO> { |
| | | // @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" + "id,\n" + "`name`,\n" + "photo_path,\n" + "phone,\n" + "integral,\n" |
| | | + "create_at \n" + "FROM\n" + "com_mng_volunteer_mng \n" |
| | | + " where state=2 and community_id = ${comMngVolunteerMngVO.communityId}" |
| | | + "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != ""'>" |
| | | + " and name like concat(#{comMngVolunteerMngVO.name},'%') \n" + " </if> " |
| | | + "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != ""'>" |
| | | + "AND phone like concat(#{comMngVolunteerMngVO.phone},'%') " + " </if> " |
| | | + " order by integral desc,create_at desc" + "</script>") |
| | | |
| | | /** |
| | | * 分页查询志愿者列表 |
| | | * @param page 分页参数 |
| | | * @param comMngVolunteerMngVO 请求参数 |
| | | * @return 志愿者列表 |
| | | */ |
| | | IPage<ComMngVolunteerMngVO> pageVolunteer(Page page, |
| | | @Param("comMngVolunteerMngVO") ComMngVolunteerMngVO comMngVolunteerMngVO); |
| | | |
| | |
| | | @Select("select user_id from sys_user where type=1 and phone=#{phone}") |
| | | Long selectUserIdByPhone(String phone); |
| | | |
| | | @Select("select id_card from sys_user where type=1 and phone=#{idCard}") |
| | | Long selectUserIdByIdCard(String idCard); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.common.*; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerOrgTeam; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 志愿者组织队伍表表数据库访问层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:20:44 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngVolunteerOrgTeamMapper extends BaseMapper<ComMngVolunteerOrgTeam> { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | ComMngVolunteerOrgTeamVo queryById(Long id); |
| | | |
| | | /** |
| | | * 查询指定行数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 查询条件 |
| | | * @param page 分页对象 |
| | | * @return 对象列表 |
| | | */ |
| | | IPage<ComMngVolunteerOrgTeamVo> queryAllByLimit(@Param("dto") PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam, Page page); |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerOrgTeam> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<ComMngVolunteerOrgTeam> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerOrgTeam> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<ComMngVolunteerOrgTeam> entities); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者组织列表 |
| | | * @param comMngVolunteerOrgTeam 请求参数 |
| | | * @return 志愿者组织列表 |
| | | */ |
| | | List<ComMngVolunteerOrgTeamVo> queryAll(@Param("dto") PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam); |
| | | |
| | | /** |
| | | * 社区后台-志愿者组织统计 |
| | | * @param communityId 社区id |
| | | * @return 志愿者组织统计 |
| | | */ |
| | | ComMngVolunteerStatisticsVo statisticsVolunteerOrgAdmin(@Param("communityId") Long communityId); |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.common.*; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerServiceType; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 志愿者服务类型表表数据库访问层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:09 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngVolunteerServiceTypeMapper extends BaseMapper<ComMngVolunteerServiceType> { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | ComMngVolunteerServiceTypeVo queryById(Long id); |
| | | |
| | | /** |
| | | * 查询指定行数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 查询条件 |
| | | * @param page 分页对象 |
| | | * @return 对象列表 |
| | | */ |
| | | IPage<ComMngVolunteerServiceTypeVo> queryAllByLimit(@Param("dto") PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType, Page page); |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerServiceType> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<ComMngVolunteerServiceType> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerServiceType> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<ComMngVolunteerServiceType> entities); |
| | | |
| | | /** |
| | | * 查询所有志愿者服务类型列表 |
| | | * @param comMngVolunteerServiceType 请求参数 |
| | | * @return 志愿者服务列表 |
| | | */ |
| | | List<ComMngVolunteerServiceTypeVo> queryAll(@Param("dto") PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType); |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.common.*; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerSkill; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 志愿者技能表表数据库访问层 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:36 |
| | | */ |
| | | @Mapper |
| | | public interface ComMngVolunteerSkillMapper extends BaseMapper<ComMngVolunteerSkill> { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | ComMngVolunteerSkillVo queryById(Long id); |
| | | |
| | | /** |
| | | * 查询指定行数据 |
| | | * |
| | | * @param comMngVolunteerSkill 查询条件 |
| | | * @param page 分页对象 |
| | | * @return 对象列表 |
| | | */ |
| | | IPage<ComMngVolunteerSkillVo> queryAllByLimit(@Param("dto") PageComMngVolunteerSkillDto comMngVolunteerSkill, Page page); |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerSkill> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<ComMngVolunteerSkill> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities List<ComMngVolunteerSkill> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<ComMngVolunteerSkill> entities); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者技能列表 |
| | | * @param comMngVolunteerSkill 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | List<ComMngVolunteerSkillVo> queryAll(@Param("dto") PageComMngVolunteerSkillDto comMngVolunteerSkill); |
| | | } |
| | | |
| | |
| | | * 申请提交人ID |
| | | */ |
| | | private Long submitUserId; |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | private String idCard; |
| | | /** |
| | | * 组织id |
| | | */ |
| | | private Long orgId; |
| | | /** |
| | | * 队伍id |
| | | */ |
| | | private Long teamId; |
| | | /** |
| | | * 技能id |
| | | */ |
| | | private Long skillId; |
| | | /** |
| | | * 是否是在校大学生(1.是 2.否) |
| | | */ |
| | | private Integer isUniversity; |
| | | /** |
| | | * 大学名称 |
| | | */ |
| | | private String universityName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 志愿者组织队伍表(ComMngVolunteerOrgTeam)实体类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 15:51:23 |
| | | */ |
| | | @Data |
| | | public class ComMngVolunteerOrgTeam implements Serializable { |
| | | private static final long serialVersionUID = -87266346603371467L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 父级id,为0时则为组织,不为0则为队伍 |
| | | */ |
| | | private Long parentId; |
| | | /** |
| | | * 服务类型 |
| | | */ |
| | | private Long serviceTypeId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 志愿者服务类型表(ComMngVolunteerServiceType)实体类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:09 |
| | | */ |
| | | @Data |
| | | public class ComMngVolunteerServiceType implements Serializable { |
| | | private static final long serialVersionUID = 884034720723106601L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 志愿者技能表(ComMngVolunteerSkill)实体类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:36 |
| | | */ |
| | | @Data |
| | | public class ComMngVolunteerSkill implements Serializable { |
| | | private static final long serialVersionUID = -32441531233450711L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | private Long createBy; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | |
| | | /** |
| | |
| | | public interface ComMngVolunteerMngService { |
| | | /** |
| | | * 增加志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 志愿者信息 |
| | | * @return 增加结果 |
| | |
| | | |
| | | /** |
| | | * 删除志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 手机号 |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 编辑志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | |
| | | |
| | | /** |
| | | * 分页展示志愿者 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 查询参数 |
| | | * @return 分页集合返回 |
| | |
| | | |
| | | /** |
| | | * 分页展示志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 查询参数 |
| | | * @return 查询结果 |
| | |
| | | |
| | | /** |
| | | * 志愿者审核详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键 |
| | | * @return 详情 |
| | |
| | | |
| | | /** |
| | | * 志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 审核操作 |
| | | * @return 审核结果 |
| | |
| | | |
| | | /** |
| | | * 删除志愿者审核 |
| | | * |
| | | * |
| | | * @param comMngVolunteerMngVO |
| | | * 主键 |
| | | * @return 删除结果 |
| | |
| | | |
| | | /** |
| | | * 用户修改手机号对应的志愿者手机号也要修改 |
| | | * |
| | | * |
| | | * @param userPhoneVO |
| | | * 新旧手机号 |
| | | * @return 修改结果 |
| | |
| | | |
| | | /** |
| | | * 志愿者详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * 主键 |
| | | * @return 志愿者 |
| | |
| | | |
| | | /** |
| | | * 社区后台数据看板 |
| | | * |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @param userId |
| | |
| | | |
| | | /** |
| | | * 获取志愿者详情 |
| | | * |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getVolunteerById(Long id); |
| | | |
| | | /** |
| | | * 志愿者导入 |
| | | * |
| | | * @param list 志愿者数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | R importVolunteerAdmin(List<ComMngVolunteerExcelVO> list, Long communityId, Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | |
| | | /** |
| | | * 志愿者组织队伍表表服务接口 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 15:51:23 |
| | | */ |
| | | public interface ComMngVolunteerOrgTeamService { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | R queryById(Long id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | R queryByPage(PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R insert(AddComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R update(EditComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam); |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | R deleteById(Long id); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者组织列表 |
| | | * @param comMngVolunteerOrgTeam 请求参数 |
| | | * @return 志愿者组织列表 |
| | | */ |
| | | R queryByList(PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam); |
| | | |
| | | /** |
| | | * 社区后台-志愿者组织统计 |
| | | * @param communityId 社区id |
| | | * @return 志愿者组织统计 |
| | | */ |
| | | R statisticsVolunteerOrgAdmin(Long communityId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | |
| | | /** |
| | | * 志愿者服务类型表表服务接口 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | public interface ComMngVolunteerServiceTypeService { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | R queryById(Long id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerServiceType 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | R queryByPage(PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R insert(AddComMngVolunteerServiceTypeDto comMngVolunteerServiceType); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R update(EditComMngVolunteerServiceTypeDto comMngVolunteerServiceType); |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | R deleteById(Long id); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者服务类型列表 |
| | | * @param comMngVolunteerServiceType 请求参数 |
| | | * @return 志愿者服务列表 |
| | | */ |
| | | R queryByList(PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | |
| | | /** |
| | | * 志愿者技能表表服务接口 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:36 |
| | | */ |
| | | public interface ComMngVolunteerSkillService { |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | R queryById(Long id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerSkill 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | R queryByPage(PageComMngVolunteerSkillDto comMngVolunteerSkill); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerSkill 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R insert(AddComMngVolunteerSkillDto comMngVolunteerSkill); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comMngVolunteerSkill 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | R update(EditComMngVolunteerSkillDto comMngVolunteerSkill); |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | R deleteById(Long id); |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者技能列表 |
| | | * @param comMngVolunteerSkill 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | R queryByList(PageComMngVolunteerSkillDto comMngVolunteerSkill); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.community.volunteer.ComMngVolunteerExcelVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerOrgTeamMapper; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerSkillMapper; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerOrgTeam; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerSkill; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | public class ComMngVolunteerMngServiceImpl implements ComMngVolunteerMngService { |
| | | @Resource |
| | | private ComMngVolunteerMngDAO comMngVolunteerMngDAO; |
| | | @Resource |
| | | private ComMngVolunteerOrgTeamMapper comMngVolunteerOrgTeamMapper; |
| | | @Resource |
| | | private ComMngVolunteerSkillMapper comMngVolunteerSkillMapper; |
| | | |
| | | /** |
| | | * 增加志愿者 |
| | |
| | | page.setCurrent(pageNum); |
| | | IPage<ComMngVolunteerMngVO> iPage = comMngVolunteerMngDAO.pageVolunteer(page, comMngVolunteerMngVO); |
| | | iPage.getRecords().forEach(record -> { |
| | | record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone())); |
| | | if(StringUtils.isNotEmpty(record.getIdCard())){ |
| | | record.setAge(IdcardUtil.getAgeByIdCard(record.getIdCard())); |
| | | } |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | |
| | | BeanUtils.copyProperties(comMngVolunteerMngDO, vo); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | /** |
| | | * 志愿者导入 |
| | | * |
| | | * @param list 志愿者数据列表 |
| | | * @param communityId 社区id |
| | | * @param userId 用户id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R importVolunteerAdmin(List<ComMngVolunteerExcelVO> list, Long communityId, Long userId){ |
| | | //错误集合 |
| | | List<ComMngVolunteerErrorExcelVO> errorList = new ArrayList<>(); |
| | | for (ComMngVolunteerExcelVO excel : list) { |
| | | //查询组织 |
| | | ComMngVolunteerOrgTeam orgVo = comMngVolunteerOrgTeamMapper.selectOne(new QueryWrapper<ComMngVolunteerOrgTeam>().lambda() |
| | | .eq(ComMngVolunteerOrgTeam::getName,excel.getOrgName()).eq(ComMngVolunteerOrgTeam::getCommunityId,communityId) |
| | | .eq(ComMngVolunteerOrgTeam::getParentId,0)); |
| | | if(orgVo == null){ |
| | | ComMngVolunteerErrorExcelVO errorExcelVO = new ComMngVolunteerErrorExcelVO(); |
| | | BeanUtils.copyProperties(excel,errorExcelVO); |
| | | errorExcelVO.setError("该志愿者组织不存在,请先通过后台添加该志愿者组织"); |
| | | errorList.add(errorExcelVO); |
| | | continue; |
| | | } |
| | | //查询队伍 |
| | | ComMngVolunteerOrgTeam teamVo = comMngVolunteerOrgTeamMapper.selectOne(new QueryWrapper<ComMngVolunteerOrgTeam>().lambda() |
| | | .eq(ComMngVolunteerOrgTeam::getName,excel.getTeamName()).eq(ComMngVolunteerOrgTeam::getCommunityId,communityId) |
| | | .eq(ComMngVolunteerOrgTeam::getParentId,orgVo.getId())); |
| | | if(teamVo == null){ |
| | | ComMngVolunteerErrorExcelVO errorExcelVO = new ComMngVolunteerErrorExcelVO(); |
| | | BeanUtils.copyProperties(excel,errorExcelVO); |
| | | errorExcelVO.setError("该志愿者队伍不存在,请先通过后台添加该志愿者队伍"); |
| | | errorList.add(errorExcelVO); |
| | | continue; |
| | | } |
| | | //查询技能 |
| | | ComMngVolunteerSkill skillVo = comMngVolunteerSkillMapper.selectOne(new QueryWrapper<ComMngVolunteerSkill>().lambda() |
| | | .eq(ComMngVolunteerSkill::getName,excel.getSkillName()).eq(ComMngVolunteerSkill::getCommunityId,communityId)); |
| | | if(skillVo == null){ |
| | | ComMngVolunteerErrorExcelVO errorExcelVO = new ComMngVolunteerErrorExcelVO(); |
| | | BeanUtils.copyProperties(excel,errorExcelVO); |
| | | errorExcelVO.setError("该志愿者技能不存在,请先通过后台添加该志愿者技能"); |
| | | errorList.add(errorExcelVO); |
| | | continue; |
| | | } |
| | | Date nowDate = new Date(); |
| | | ComMngVolunteerMngDO comMngVolunteerMngDO = comMngVolunteerMngDAO.selectOne(new QueryWrapper<ComMngVolunteerMngDO>().lambda() |
| | | .eq(ComMngVolunteerMngDO::getIdCard,excel.getIdCard()).in(ComMngVolunteerMngDO::getState,1,2)); |
| | | if(comMngVolunteerMngDO != null){ |
| | | if(comMngVolunteerMngDO.getState().equals(1)){ |
| | | BeanUtils.copyProperties(excel,comMngVolunteerMngDO); |
| | | comMngVolunteerMngDO.setState(2); |
| | | comMngVolunteerMngDO.setOrgId(orgVo.getId()); |
| | | comMngVolunteerMngDO.setTeamId(teamVo.getId()); |
| | | comMngVolunteerMngDO.setSkillId(skillVo.getId()); |
| | | comMngVolunteerMngDAO.updateById(comMngVolunteerMngDO); |
| | | }else{ |
| | | ComMngVolunteerErrorExcelVO errorExcelVO = new ComMngVolunteerErrorExcelVO(); |
| | | BeanUtils.copyProperties(excel,errorExcelVO); |
| | | errorExcelVO.setError("该志愿者已存在,不可重复添加"); |
| | | errorList.add(errorExcelVO); |
| | | } |
| | | }else{ |
| | | comMngVolunteerMngDO = new ComMngVolunteerMngDO(); |
| | | BeanUtils.copyProperties(excel,comMngVolunteerMngDO); |
| | | comMngVolunteerMngDO.setCommunityId(communityId); |
| | | comMngVolunteerMngDO.setState(2); |
| | | comMngVolunteerMngDO.setOrgId(orgVo.getId()); |
| | | comMngVolunteerMngDO.setTeamId(teamVo.getId()); |
| | | comMngVolunteerMngDO.setSkillId(skillVo.getId()); |
| | | comMngVolunteerMngDO.setCreateAt(nowDate); |
| | | //查询用户id,如果存在则需要绑定 |
| | | Long volunteerUserId = comMngVolunteerMngDAO.selectUserIdByIdCard(excel.getIdCard()); |
| | | if(volunteerUserId != null){ |
| | | comMngVolunteerMngDO.setSubmitUserId(volunteerUserId); |
| | | } |
| | | comMngVolunteerMngDAO.insert(comMngVolunteerMngDO); |
| | | } |
| | | } |
| | | if(errorList.size() > 0){ |
| | | return R.fail(errorList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerOrgTeamMapper; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerMngDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerOrgTeam; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerOrgTeamService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 志愿者组织队伍表(ComMngVolunteerOrgTeam)表服务实现类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:32:54 |
| | | */ |
| | | @Service("comMngVolunteerOrgTeamService") |
| | | public class ComMngVolunteerOrgTeamServiceImpl extends ServiceImpl<ComMngVolunteerOrgTeamMapper, ComMngVolunteerOrgTeam> implements ComMngVolunteerOrgTeamService { |
| | | |
| | | @Resource |
| | | private ComMngVolunteerMngDAO comMngVolunteerMngDAO; |
| | | |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R queryById(Long id) { |
| | | return R.ok(this.baseMapper.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R queryByPage(PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | return R.ok(this.baseMapper.queryAllByLimit(comMngVolunteerOrgTeam,new Page(comMngVolunteerOrgTeam.getPageNum(), comMngVolunteerOrgTeam.getPageSize()))); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerOrgTeam 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R insert(AddComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam) { |
| | | ComMngVolunteerOrgTeam entity = new ComMngVolunteerOrgTeam(); |
| | | BeanUtils.copyProperties(comMngVolunteerOrgTeam, entity); |
| | | if (this.baseMapper.insert(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param editDto 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R update(EditComMngVolunteerOrgTeamDto editDto) { |
| | | ComMngVolunteerOrgTeam 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("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | ComMngVolunteerOrgTeam volunteerOrgTeam = this.baseMapper.selectById(id); |
| | | if(volunteerOrgTeam != null){ |
| | | //组织 |
| | | if(volunteerOrgTeam.getParentId().equals(0L)){ |
| | | Integer count = this.baseMapper.selectCount(new QueryWrapper<ComMngVolunteerOrgTeam>().lambda() |
| | | .eq(ComMngVolunteerOrgTeam::getParentId,id)); |
| | | if(count > 0){ |
| | | return R.fail("内容已引用,无法删除!"); |
| | | } |
| | | Integer volunteerCount = comMngVolunteerMngDAO.selectCount(new QueryWrapper<ComMngVolunteerMngDO>().lambda() |
| | | .eq(ComMngVolunteerMngDO::getOrgId,id).ne(ComMngVolunteerMngDO::getState,3)); |
| | | if(volunteerCount > 0){ |
| | | return R.fail("内容已引用,无法删除!"); |
| | | } |
| | | }else{//队伍 |
| | | Integer volunteerCount = comMngVolunteerMngDAO.selectCount(new QueryWrapper<ComMngVolunteerMngDO>().lambda() |
| | | .eq(ComMngVolunteerMngDO::getTeamId,id).ne(ComMngVolunteerMngDO::getState,3)); |
| | | if(volunteerCount > 0){ |
| | | return R.fail("内容已引用,无法删除!"); |
| | | } |
| | | } |
| | | } |
| | | if(this.baseMapper.deleteById(id) > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者组织列表 |
| | | * @param comMngVolunteerOrgTeam 请求参数 |
| | | * @return 志愿者组织列表 |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComMngVolunteerOrgTeamDto comMngVolunteerOrgTeam){ |
| | | //查询所有组织列表 |
| | | List<ComMngVolunteerOrgTeamVo> orgList = this.baseMapper.queryAll(comMngVolunteerOrgTeam); |
| | | for (ComMngVolunteerOrgTeamVo org : orgList) { |
| | | comMngVolunteerOrgTeam = new PageComMngVolunteerOrgTeamDto(); |
| | | comMngVolunteerOrgTeam.setParentId(org.getId()); |
| | | comMngVolunteerOrgTeam.setCommunityId(org.getCommunityId()); |
| | | List<ComMngVolunteerOrgTeamVo> teamList = this.baseMapper.queryAll(comMngVolunteerOrgTeam); |
| | | if(!teamList.isEmpty()){ |
| | | org.setChildList(teamList); |
| | | } |
| | | } |
| | | return R.ok(orgList); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-志愿者组织统计 |
| | | * @param communityId 社区id |
| | | * @return 志愿者组织统计 |
| | | */ |
| | | @Override |
| | | public R statisticsVolunteerOrgAdmin(Long communityId){ |
| | | return R.ok(this.baseMapper.statisticsVolunteerOrgAdmin(communityId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerOrgTeamMapper; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerServiceTypeMapper; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerOrgTeam; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerServiceType; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerServiceTypeService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 志愿者服务类型表(ComMngVolunteerServiceType)表服务实现类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:10 |
| | | */ |
| | | @Service("comMngVolunteerServiceTypeService") |
| | | public class ComMngVolunteerServiceTypeServiceImpl extends ServiceImpl<ComMngVolunteerServiceTypeMapper, ComMngVolunteerServiceType> implements ComMngVolunteerServiceTypeService { |
| | | |
| | | @Resource |
| | | private ComMngVolunteerOrgTeamMapper comMngVolunteerOrgTeamMapper; |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R queryById(Long id) { |
| | | return R.ok(this.baseMapper.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerServiceType 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R queryByPage(PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | return R.ok(this.baseMapper.queryAllByLimit(comMngVolunteerServiceType,new Page(comMngVolunteerServiceType.getPageNum(), comMngVolunteerServiceType.getPageSize()))); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerServiceType 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R insert(AddComMngVolunteerServiceTypeDto comMngVolunteerServiceType) { |
| | | ComMngVolunteerServiceType entity = new ComMngVolunteerServiceType(); |
| | | BeanUtils.copyProperties(comMngVolunteerServiceType, entity); |
| | | entity.setCreateAt(new Date()); |
| | | entity.setCreateBy(comMngVolunteerServiceType.getUserId()); |
| | | if (this.baseMapper.insert(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param editDto 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R update(EditComMngVolunteerServiceTypeDto editDto) { |
| | | ComMngVolunteerServiceType entity = this.baseMapper.selectById(editDto.getId()); |
| | | if (entity == null) { |
| | | return R.fail("未查询到该记录"); |
| | | } |
| | | BeanUtils.copyProperties(editDto, entity); |
| | | entity.setUpdateAt(new Date()); |
| | | entity.setUpdateBy(editDto.getUserId()); |
| | | if (this.baseMapper.updateById(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | Integer count = comMngVolunteerOrgTeamMapper.selectCount(new QueryWrapper<ComMngVolunteerOrgTeam>().lambda() |
| | | .eq(ComMngVolunteerOrgTeam::getServiceTypeId,id)); |
| | | if(count > 0){ |
| | | return R.fail("该分类名称已被引用,无法删除!"); |
| | | } |
| | | if (this.baseMapper.deleteById(id) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者服务类型列表 |
| | | * @param comMngVolunteerServiceType 请求参数 |
| | | * @return 志愿者服务列表 |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComMngVolunteerServiceTypeDto comMngVolunteerServiceType){ |
| | | return R.ok(this.baseMapper.queryAll(comMngVolunteerServiceType)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO; |
| | | import com.panzhihua.service_community.dao.ComMngVolunteerSkillMapper; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerMngDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVolunteerSkill; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerSkillService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 志愿者技能表(ComMngVolunteerSkill)表服务实现类 |
| | | * |
| | | * @author lyq |
| | | * @since 2021-10-30 16:47:37 |
| | | */ |
| | | @Service("comMngVolunteerSkillService") |
| | | public class ComMngVolunteerSkillServiceImpl extends ServiceImpl<ComMngVolunteerSkillMapper, ComMngVolunteerSkill> implements ComMngVolunteerSkillService { |
| | | |
| | | @Resource |
| | | private ComMngVolunteerMngDAO comMngVolunteerMngDAO; |
| | | |
| | | |
| | | /** |
| | | * 通过ID查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R queryById(Long id) { |
| | | return R.ok(this.baseMapper.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param comMngVolunteerSkill 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R queryByPage(PageComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | return R.ok(this.baseMapper.queryAllByLimit(comMngVolunteerSkill,new Page(comMngVolunteerSkill.getPageNum(), comMngVolunteerSkill.getPageSize()))); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comMngVolunteerSkill 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R insert(AddComMngVolunteerSkillDto comMngVolunteerSkill) { |
| | | ComMngVolunteerSkill entity = new ComMngVolunteerSkill(); |
| | | BeanUtils.copyProperties(comMngVolunteerSkill, entity); |
| | | entity.setCreateBy(comMngVolunteerSkill.getUserId()); |
| | | entity.setCreateAt(new Date()); |
| | | if (this.baseMapper.insert(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param editDto 实例对象 |
| | | * @return 实例对象 |
| | | */ |
| | | @Override |
| | | public R update(EditComMngVolunteerSkillDto editDto) { |
| | | ComMngVolunteerSkill entity = this.baseMapper.selectById(editDto.getId()); |
| | | if (entity == null) { |
| | | return R.fail("未查询到该记录"); |
| | | } |
| | | BeanUtils.copyProperties(editDto, entity); |
| | | entity.setUpdateAt(new Date()); |
| | | entity.setUpdateBy(editDto.getUserId()); |
| | | if (this.baseMapper.updateById(entity) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键删除数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 是否成功 |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | Integer count = comMngVolunteerMngDAO.selectCount(new QueryWrapper<ComMngVolunteerMngDO>().lambda() |
| | | .eq(ComMngVolunteerMngDO::getSkillId,id).ne(ComMngVolunteerMngDO::getState,3)); |
| | | if(count > 0){ |
| | | return R.fail("该技能已被引用,无法删除!"); |
| | | } |
| | | if (this.baseMapper.deleteById(id) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询志愿者技能列表 |
| | | * @param comMngVolunteerSkill 请求参数 |
| | | * @return 志愿者技能列表 |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComMngVolunteerSkillDto comMngVolunteerSkill){ |
| | | return R.ok(this.baseMapper.queryAll(comMngVolunteerSkill)); |
| | | } |
| | | } |
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_community.dao.ComMngVolunteerMngDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngVolunteerMngDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="state" property="state" /> |
| | | <result column="name" property="name" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="photo_path" property="photoPath" /> |
| | | <result column="political_face" property="politicalFace" /> |
| | | <result column="reject_reson" property="rejectReson" /> |
| | | <result column="apply_reson" property="applyReson" /> |
| | | <result column="address" property="address" /> |
| | | <result column="age" property="age" /> |
| | | <result column="job" property="job" /> |
| | | <result column="integral" property="integral" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="submit_user_id" property="submitUserId" /> |
| | | <result column="id_card" property="idCard" /> |
| | | <result column="org_id" property="orgId" /> |
| | | <result column="team_id" property="teamId" /> |
| | | <result column="skill_id" property="skillId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, create_at, state, name, phone, photo_path, political_face, reject_reson, apply_reson, address, age, job, integral, community_id, submit_user_id, id_card, org_id, team_id, skill_id |
| | | </sql> |
| | | |
| | | <select id="pageVolunteer" resultType="com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO"> |
| | | SELECT |
| | | cmvm.id, |
| | | cmvm.`name`, |
| | | cmvm.photo_path, |
| | | cmvm.phone, |
| | | cmvm.integral, |
| | | cmvm.id_card, |
| | | cmvm.is_university, |
| | | cmvm.university_name, |
| | | cmvot.`name` as orgName, |
| | | cmvot1.`name` as teamName, |
| | | cmvot1.`service_type_id`, |
| | | cmvst.`name` as serviceTypeName, |
| | | cmvs.`name` as skillName, |
| | | cmvm.create_at |
| | | FROM |
| | | com_mng_volunteer_mng as cmvm |
| | | left join com_mng_volunteer_org_team as cmvot on cmvot.id = cmvm.org_id |
| | | left join com_mng_volunteer_org_team as cmvot1 on cmvot1.id = cmvm.team_id |
| | | left join com_mng_volunteer_skill as cmvs on cmvs.id = cmvm.skill_id |
| | | left join com_mng_volunteer_service_type as cmvst on cmvst.id = cmvot1.service_type_id |
| | | WHERE |
| | | cmvm.state = 2 |
| | | AND cmvm.community_id = #{comMngVolunteerMngVO.communityId} |
| | | <if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name != ""'> |
| | | and cmvm.name like concat(#{comMngVolunteerMngVO.name},'%') |
| | | </if> |
| | | <if test='comMngVolunteerMngVO.keyWord != null and comMngVolunteerMngVO.keyWord != ""'> |
| | | and ( |
| | | cmvm.name like concat(#{comMngVolunteerMngVO.keyWord},'%') or |
| | | cmvm.phone like concat(#{comMngVolunteerMngVO.keyWord},'%') or |
| | | cmvm.id_card = #{comMngVolunteerMngVO.keyWord} or |
| | | cmvm.university_name like concat(#{comMngVolunteerMngVO.keyWord},'%') |
| | | ) |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.orgId != null"> |
| | | and cmvm.org_id = #{comMngVolunteerMngVO.orgId} |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.teamId != null"> |
| | | and cmvm.team_id = #{comMngVolunteerMngVO.teamId} |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.isUniversity != null"> |
| | | and cmvm.is_university = #{comMngVolunteerMngVO.isUniversity} |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.skillId != null"> |
| | | and cmvm.skill_id = #{comMngVolunteerMngVO.skillId} |
| | | </if> |
| | | <if test="comMngVolunteerMngVO.serviceTypeId != null"> |
| | | and cmvot1.service_type_id = #{comMngVolunteerMngVO.serviceTypeId} |
| | | </if> |
| | | <if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone != ""'> |
| | | AND cmvm.phone like concat(#{comMngVolunteerMngVO.phone},'%') |
| | | </if> |
| | | ORDER BY |
| | | integral DESC, |
| | | cmvm.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_community.dao.ComMngVolunteerOrgTeamMapper"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.model.dos.ComMngVolunteerOrgTeam" id="ComMngVolunteerOrgTeamMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="parentId" column="parent_id" jdbcType="INTEGER"/> |
| | | <result property="serviceTypeId" column="service_type_id" jdbcType="INTEGER"/> |
| | | <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!--查询单个--> |
| | | <select id="queryById" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo"> |
| | | select |
| | | id, community_id, name, parent_id, service_type_id, create_at, update_at |
| | | from com_mng_volunteer_org_team |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo"> |
| | | select |
| | | id, community_id, name, parent_id, service_type_id, create_at, update_at |
| | | from com_mng_volunteer_org_team |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and `name` = #{name} |
| | | </if> |
| | | <if test="dto.parentId != null"> |
| | | and parent_id = #{dto.parentId} |
| | | </if> |
| | | <if test="dto.serviceTypeId != null"> |
| | | and service_type_id = #{dto.serviceTypeId} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and update_at = #{dto.updateAt} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <!--新增所有列--> |
| | | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_org_team(community_id, name, parent_id, service_type_id, create_at, update_at) |
| | | values (#{communityId}, #{name}, #{parentId}, #{serviceTypeId}, #{createAt}, #{updateAt}) |
| | | </insert> |
| | | |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_org_team(community_id, name, parent_id, service_type_id, create_at, update_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.parentId}, #{entity.serviceTypeId}, #{entity.createAt}, #{entity.updateAt}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_org_team(community_id, name, parent_id, service_type_id, create_at, update_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.parentId}, #{entity.serviceTypeId}, #{entity.createAt}, #{entity.updateAt}) |
| | | </foreach> |
| | | on duplicate key update |
| | | community_id = values(community_id), |
| | | name = values(name), |
| | | parent_id = values(parent_id), |
| | | service_type_id = values(service_type_id), |
| | | create_at = values(create_at), |
| | | update_at = values(update_at) |
| | | </insert> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo"> |
| | | select |
| | | cmvot.id, cmvot.community_id, cmvot.name, cmvot.parent_id, cmvot.service_type_id, cmvot.create_at, cmvot.update_at, cmvst.`name` as serviceTypeName |
| | | from com_mng_volunteer_org_team as cmvot |
| | | left join com_mng_volunteer_service_type as cmvst on cmvst.id = cmvot.service_type_id |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and cmvot.id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and cmvot.community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and cmvot.`name` = #{name} |
| | | </if> |
| | | <if test="dto.parentId != null"> |
| | | and cmvot.parent_id = #{dto.parentId} |
| | | </if> |
| | | <if test="dto.serviceTypeId != null"> |
| | | and cmvot.service_type_id = #{dto.serviceTypeId} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and cmvot.create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and cmvot.update_at = #{dto.updateAt} |
| | | </if> |
| | | </where> |
| | | order by cmvot.create_at desc |
| | | </select> |
| | | |
| | | <select id="statisticsVolunteerOrgAdmin" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerStatisticsVo"> |
| | | SELECT |
| | | count( id ) AS orgTotal,( |
| | | SELECT |
| | | count( id ) |
| | | FROM |
| | | com_mng_volunteer_org_team |
| | | WHERE |
| | | parent_id != 0 |
| | | AND community_id = #{communityId} |
| | | ) AS teamTotal,( |
| | | SELECT |
| | | count( id ) |
| | | FROM |
| | | com_mng_volunteer_mng |
| | | WHERE |
| | | state = 2 |
| | | AND community_id = #{communityId} |
| | | ) AS volunteerTotal |
| | | FROM |
| | | com_mng_volunteer_org_team |
| | | WHERE |
| | | parent_id = 0 |
| | | AND community_id = #{communityId} |
| | | </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_community.dao.ComMngVolunteerServiceTypeMapper"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.model.dos.ComMngVolunteerServiceType" |
| | | id="ComMngVolunteerServiceTypeMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" 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.ComMngVolunteerServiceTypeVo"> |
| | | select |
| | | id, community_id, name, remark, create_at, create_by, update_at, update_by |
| | | from com_mng_volunteer_service_type |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo"> |
| | | select |
| | | cmvst.id, cmvst.community_id, cmvst.name, cmvst.remark, cmvst.create_at, cmvst.create_by, cmvst.update_at, cmvst.update_by, IFNULL(su.`name`,su.nick_name) as createByName |
| | | from com_mng_volunteer_service_type as cmvst |
| | | left join sys_user as su on su.user_id = cmvst.create_by |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and cmvst.id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and cmvst.community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and cmvst.name = #{dto.name} |
| | | </if> |
| | | <if test="dto.remark != null and dto.remark != ''"> |
| | | and cmvst.remark = #{dto.remark} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and cmvst.create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.createBy != null"> |
| | | and cmvst.create_by = #{dto.createBy} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and cmvst.update_at = #{dto.updateAt} |
| | | </if> |
| | | <if test="dto.updateBy != null"> |
| | | and cmvst.update_by = #{dto.updateBy} |
| | | </if> |
| | | </where> |
| | | order by cmvst.create_at desc |
| | | </select> |
| | | |
| | | <!--新增所有列--> |
| | | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_service_type(community_id, name, remark, create_at, create_by, update_at, update_by) |
| | | values (#{communityId}, #{name}, #{remark}, #{createAt}, #{createBy}, #{updateAt}, #{updateBy}) |
| | | </insert> |
| | | |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_service_type(community_id, name, remark, create_at, create_by, update_at, |
| | | update_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.remark}, #{entity.createAt}, #{entity.createBy}, |
| | | #{entity.updateAt}, #{entity.updateBy}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_service_type(community_id, name, remark, create_at, create_by, update_at, |
| | | update_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.remark}, #{entity.createAt}, #{entity.createBy}, |
| | | #{entity.updateAt}, #{entity.updateBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | community_id = values(community_id), |
| | | name = values(name), |
| | | remark = values(remark), |
| | | create_at = values(create_at), |
| | | create_by = values(create_by), |
| | | update_at = values(update_at), |
| | | update_by = values(update_by) |
| | | </insert> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo"> |
| | | select |
| | | id, community_id, name, remark, create_at, create_by, update_at, update_by |
| | | from com_mng_volunteer_service_type |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and name = #{dto.name} |
| | | </if> |
| | | <if test="dto.remark != null and dto.remark != ''"> |
| | | and remark = #{dto.remark} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.createBy != null"> |
| | | and create_by = #{dto.createBy} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and update_at = #{dto.updateAt} |
| | | </if> |
| | | <if test="dto.updateBy != null"> |
| | | and update_by = #{dto.updateBy} |
| | | </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_community.dao.ComMngVolunteerSkillMapper"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.model.dos.ComMngVolunteerSkill" id="ComMngVolunteerSkillMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="communityId" column="community_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" 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.ComMngVolunteerSkillVo"> |
| | | select |
| | | id, community_id, name, remark, create_at, create_by, update_at, update_by |
| | | from com_mng_volunteer_skill |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <!--查询指定行数据--> |
| | | <select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo"> |
| | | select |
| | | cmvs.id, cmvs.community_id, cmvs.name, IFNULL(su.`name`,su.nick_name) as createByName, cmvs.remark, cmvs.create_at, cmvs.create_by, cmvs.update_at, cmvs.update_by |
| | | from com_mng_volunteer_skill as cmvs |
| | | left join sys_user as su on su.user_id = cmvs.create_by |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and cmvs.id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and cmvs.community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and cmvs.name = #{dto.name} |
| | | </if> |
| | | <if test="dto.remark != null and dto.remark != ''"> |
| | | and cmvs.remark = #{dto.remark} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and cmvs.create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.createBy != null"> |
| | | and cmvs.create_by = #{dto.createBy} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and cmvs.update_at = #{dto.updateAt} |
| | | </if> |
| | | <if test="dto.updateBy != null"> |
| | | and cmvs.update_by = #{dto.updateBy} |
| | | </if> |
| | | </where> |
| | | order by cmvs.create_at desc |
| | | </select> |
| | | |
| | | <!--新增所有列--> |
| | | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_skill(community_id, name, remark, create_at, create_by, update_at, update_by) |
| | | values (#{communityId}, #{name}, #{remark}, #{createAt}, #{createBy}, #{updateAt}, #{updateBy}) |
| | | </insert> |
| | | |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_skill(community_id, name, remark, create_at, create_by, update_at, update_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.remark}, #{entity.createAt}, #{entity.createBy}, |
| | | #{entity.updateAt}, #{entity.updateBy}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into com_mng_volunteer_skill(community_id, name, remark, create_at, create_by, update_at, update_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.communityId}, #{entity.name}, #{entity.remark}, #{entity.createAt}, #{entity.createBy}, |
| | | #{entity.updateAt}, #{entity.updateBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | community_id = values(community_id), |
| | | name = values(name), |
| | | remark = values(remark), |
| | | create_at = values(create_at), |
| | | create_by = values(create_by), |
| | | update_at = values(update_at), |
| | | update_by = values(update_by) |
| | | </insert> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo"> |
| | | select |
| | | id, community_id, name, remark, create_at, create_by, update_at, update_by |
| | | from com_mng_volunteer_skill |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | and id = #{dto.id} |
| | | </if> |
| | | <if test="dto.communityId != null"> |
| | | and community_id = #{dto.communityId} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and name = #{dto.name} |
| | | </if> |
| | | <if test="dto.remark != null and dto.remark != ''"> |
| | | and remark = #{dto.remark} |
| | | </if> |
| | | <if test="dto.createAt != null"> |
| | | and create_at = #{dto.createAt} |
| | | </if> |
| | | <if test="dto.createBy != null"> |
| | | and create_by = #{dto.createBy} |
| | | </if> |
| | | <if test="dto.updateAt != null"> |
| | | and update_at = #{dto.updateAt} |
| | | </if> |
| | | <if test="dto.updateBy != null"> |
| | | and update_by = #{dto.updateBy} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | | |