Browse Source

Merge remote-tracking branch 'origin/feature/lc_pointsVolunteer'

feature/syp_points
liuchuang 6 years ago
parent
commit
96c65b598a
  1. 95
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ResidentConfigDTO.java
  2. 31
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/ResidentConfigResultDTO.java
  3. 14
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java
  4. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java
  5. 37
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiResidentConfigController.java
  6. 94
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ResidentConfigController.java
  7. 64
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ResidentConfigDao.java
  8. 61
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ResidentConfigEntity.java
  9. 68
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ResidentConfigExcel.java
  10. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java
  11. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java
  12. 47
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ResidentConfigRedis.java
  13. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java
  14. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java
  15. 116
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ResidentConfigService.java
  16. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java
  17. 7
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  18. 126
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ResidentConfigServiceImpl.java
  19. 75
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ResidentConfigDao.xml
  20. 52
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/MyPartyTopicFormDTO.java
  21. 15
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java
  22. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java
  23. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java
  24. 17
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java
  25. 48
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml
  26. 13
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java
  27. 1
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java
  28. 15
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java
  29. 40
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java
  30. 80
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/EpdcAdjustUserPointsDTO.java
  31. 57
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMemberModifyFormDTO.java
  32. 128
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserPointsDTO.java
  33. 92
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java
  34. 25
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  35. 61
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java
  36. 205
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  37. 135
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

95
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ResidentConfigDTO.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Data
public class ResidentConfigDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 配置类型
*/
private String residentType;
/**
* 配置编码
*/
private String residentCode;
/**
* 配置内容
*/
private String residentValue;
/**
* 排序
*/
private String sort;
/**
* 删除标识 0未删除1删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 备注
*/
private String remark;
}

31
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/ResidentConfigResultDTO.java

@ -0,0 +1,31 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* APP 获取局面端配置
*
* @author songyunpeng
* @date 2020/06/08 18:30
*/
@Data
public class ResidentConfigResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 类型
*/
private String residentType;
/**
*
*/
private String residentValue;
/**
* 编码
*/
private String residentCode;
}

14
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiNewsController.java

@ -151,11 +151,23 @@ public class ApiNewsController {
*
*/
@PostMapping("news/browse")
@RecordUserBehavior(behavior = BehaviorEnum.NEWS_BROWSE, referenceId = "#{newsBrowseFromDTO.getNewsId}", userId = "#{userDetail.getUserId}")
public Result modifyNewsBrowse(@LoginUser TokenDto userDetail,@RequestBody EpdcNewsBrowseFromDTO newsBrowseFromDTO) {
ValidatorUtils.validateEntity(newsBrowseFromDTO);
return newsService.modifyNewsBrowse(userDetail,newsBrowseFromDTO);
}
/**
* @Description 新闻浏览有效加积分
* @Author songyunpeng
* @Date 2020/6/9
* @Param [userDetail, newsBrowseFromDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
@PostMapping("news/browsePoints")
@RecordUserBehavior(behavior = BehaviorEnum.NEWS_BROWSE, referenceId = "#{newsBrowseFromDTO.getNewsId}", userId = "#{userDetail.getUserId}")
public Result browsePoints(@LoginUser TokenDto userDetail,@RequestBody EpdcNewsBrowseFromDTO newsBrowseFromDTO) {
ValidatorUtils.validateEntity(newsBrowseFromDTO);
return newsService.browsePoints(userDetail,newsBrowseFromDTO);
}
/**
* 用户消息已读

12
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java

@ -77,6 +77,18 @@ public class ApiPartyGroupController {
return partyGroupService.topicList(userDetail, formDto);
}
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
* @Description 我的话题
* @Author songyunpeng
* @Date 2020/6/3
* @Param [formDto]
**/
@GetMapping(value = "myTopicList/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PartyTopicResultDTO> myTopicList(@LoginUser TokenDto userDetail, MyPartyTopicFormDTO formDto) {
return partyGroupService.myTopicList(userDetail, formDto);
}
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Description 发布话题

37
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiResidentConfigController.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.result.ResidentConfigResultDTO;
import com.elink.esua.epdc.service.ResidentConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* APP 获取居民端配置
*
* @author zhangyong
* @date 2020/05/27 18:30
*/
@RestController
@RequestMapping("residentConfig")
public class ApiResidentConfigController {
@Autowired
private ResidentConfigService residentConfigService;
/**
* @Description 获取居民端配置
* @Author songyunpeng
* @Date 2020/6/9
* @Param [residentType]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ResidentConfigResultDTO>>
**/
@GetMapping("getResidentConfig")
public Result<List<ResidentConfigResultDTO>> getImgUrlList(String residentType){
return residentConfigService.listResidentConfig(residentType);
}
}

94
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ResidentConfigController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.ResidentConfigDTO;
import com.elink.esua.epdc.excel.ResidentConfigExcel;
import com.elink.esua.epdc.service.ResidentConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@RestController
@RequestMapping("residentconfig")
public class ResidentConfigController {
@Autowired
private ResidentConfigService residentConfigService;
@GetMapping("page")
public Result<PageData<ResidentConfigDTO>> page(@RequestParam Map<String, Object> params){
PageData<ResidentConfigDTO> page = residentConfigService.page(params);
return new Result<PageData<ResidentConfigDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ResidentConfigDTO> get(@PathVariable("id") String id){
ResidentConfigDTO data = residentConfigService.get(id);
return new Result<ResidentConfigDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ResidentConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
residentConfigService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ResidentConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
residentConfigService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
residentConfigService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ResidentConfigDTO> list = residentConfigService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ResidentConfigExcel.class);
}
}

64
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ResidentConfigDao.java

@ -0,0 +1,64 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.ResidentConfigDTO;
import com.elink.esua.epdc.dto.result.ResidentConfigResultDTO;
import com.elink.esua.epdc.entity.ResidentConfigEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Mapper
public interface ResidentConfigDao extends BaseDao<ResidentConfigEntity> {
/**
* @Description pc获取列表
* @Author songyunpeng
* @Date 2020/6/8
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.ResidentConfigDTO>
**/
List<ResidentConfigDTO> selectListResidentConfig(Map<String, Object> params);
/**
* @Description app根据类型获取居民配置列表
* @Author songyunpeng
* @Date 2020/6/8
* @Param [residentType]
* @return java.util.List<com.elink.esua.epdc.dto.ResidentConfigDTO>
**/
List<ResidentConfigResultDTO> selectListResidentConfigByResidentType(@Param(value = "residentType") String residentType);
/**
* @Description 根据类型和编码获取配置
* @Author songyunpeng
* @Date 2020/6/8
* @Param [residentType, residentCode]
* @return com.elink.esua.epdc.dto.ResidentConfigDTO
**/
ResidentConfigDTO selectResidentConfigDTOByTypeAndCode(String residentType, String residentCode);
}

61
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ResidentConfigEntity.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_resident_config")
public class ResidentConfigEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 配置类型
*/
private String residentType;
/**
* 配置编码
*/
private String residentCode;
/**
* 配置内容
*/
private String residentValue;
/**
* 排序
*/
private String sort;
/**
* 备注
*/
private String remark;
}

68
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ResidentConfigExcel.java

@ -0,0 +1,68 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Data
public class ResidentConfigExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "配置类型")
private String residentType;
@Excel(name = "配置编码")
private String residentCode;
@Excel(name = "配置内容")
private String residentValue;
@Excel(name = "排序")
private String sort;
@Excel(name = "删除标识 0:未删除,1:删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

4
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java

@ -140,4 +140,8 @@ public interface PartyGroupFeignClient {
**/
@PostMapping(value = "partyGroup/user/updateInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result updateInfo(@RequestBody PartyUserNewInfoFormDTO formDTO);
@GetMapping(value = "partyGroup/topic/myTopicList", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PartyTopicResultDTO> myTopicList(MyPartyTopicFormDTO formDto);
}

5
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java

@ -80,4 +80,9 @@ public class PartyGroupFeignClientFallback implements PartyGroupFeignClient {
public Result updateInfo(PartyUserNewInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "updateInfo",formDTO);
}
@Override
public Result<PartyTopicResultDTO> myTopicList(MyPartyTopicFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "myTopicList",formDto);
}
}

47
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ResidentConfigRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Component
public class ResidentConfigRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/NewsService.java

@ -144,4 +144,12 @@ public interface NewsService {
* @Date 09:46 2020-05-19
**/
Result<List<EpdcNoticeListResultDTO>> listV2Notice(TokenDto userDetail, EpdcNoticeListV2FormDTO formDto);
/**
* @Description 新闻浏览有效时间内加积分接口
* @Author songyunpeng
* @Date 2020/6/9
* @Param [userDetail, newsBrowseFromDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result browsePoints(TokenDto userDetail, EpdcNewsBrowseFromDTO newsBrowseFromDTO);
}

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java

@ -105,4 +105,12 @@ public interface PartyGroupService {
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result joinGroup(TokenDto userDetail, PartyUserJoinGroupFormDTO formDto);
/**
* @Description 我的话题列表
* @Author songyunpeng
* @Date 2020/6/11
* @Param [userDetail, formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>
**/
Result<PartyTopicResultDTO> myTopicList(TokenDto userDetail, MyPartyTopicFormDTO formDto);
}

116
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ResidentConfigService.java

@ -0,0 +1,116 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ResidentConfigDTO;
import com.elink.esua.epdc.dto.result.ResidentConfigResultDTO;
import com.elink.esua.epdc.entity.ResidentConfigEntity;
import java.util.List;
import java.util.Map;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
public interface ResidentConfigService extends BaseService<ResidentConfigEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ResidentConfigDTO>
* @author generator
* @date 2020-06-08
*/
PageData<ResidentConfigDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ResidentConfigDTO>
* @author generator
* @date 2020-06-08
*/
List<ResidentConfigDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ResidentConfigDTO
* @author generator
* @date 2020-06-08
*/
ResidentConfigDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-08
*/
void save(ResidentConfigDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-08
*/
void update(ResidentConfigDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-08
*/
void delete(String[] ids);
/**
* app根据类型获取居民配置
*
* @Author songyunpeng
* @Date 2020/6/8
* @Param [residentType]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ResidentConfigResultDTO>>
**/
Result<List<ResidentConfigResultDTO>> listResidentConfig(String residentType);
/**
* @Description 根据类型和编码获取配置
* @Author songyunpeng
* @Date 2020/6/8
* @Param [residentType, residentCode]
* @return com.elink.esua.epdc.dto.ResidentConfigDTO
**/
ResidentConfigDTO getResidentConfigDTOByTypeAndCode(String residentType,String residentCode);
}

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java

@ -111,4 +111,12 @@ public class NewsServiceImpl implements NewsService {
formDto.setDeptId(userDetail.getGridId());
return newsFeignClient.listV2Notice(formDto);
}
@Override
public Result browsePoints(TokenDto userDetail, EpdcNewsBrowseFromDTO newsBrowseFromDTO) {
if(userDetail!=null){
newsBrowseFromDTO.setUserId(userDetail.getUserId());
}
return new Result();
}
}

7
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java

@ -147,4 +147,11 @@ public class PartyGroupServiceImpl implements PartyGroupService {
formDto.setMobile(userDetail.getMobile());
return partyGroupFeignClient.joinGroup(formDto);
}
@Override
public Result<PartyTopicResultDTO> myTopicList(TokenDto userDetail, MyPartyTopicFormDTO formDto) {
if(userDetail!=null){
formDto.setUserId(userDetail.getUserId());
}
return partyGroupFeignClient.myTopicList(formDto); }
}

126
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ResidentConfigServiceImpl.java

@ -0,0 +1,126 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.ResidentConfigDao;
import com.elink.esua.epdc.dto.ResidentConfigDTO;
import com.elink.esua.epdc.dto.result.ResidentConfigResultDTO;
import com.elink.esua.epdc.entity.ResidentConfigEntity;
import com.elink.esua.epdc.redis.ResidentConfigRedis;
import com.elink.esua.epdc.service.ResidentConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 居民端配置表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-08
*/
@Service
public class ResidentConfigServiceImpl extends BaseServiceImpl<ResidentConfigDao, ResidentConfigEntity> implements ResidentConfigService {
@Autowired
private ResidentConfigRedis residentConfigRedis;
@Override
public PageData<ResidentConfigDTO> page(Map<String, Object> params) {
IPage<ResidentConfigDTO> page = getPage(params);
List<ResidentConfigDTO> list = baseDao.selectListResidentConfig(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ResidentConfigDTO> list(Map<String, Object> params) {
List<ResidentConfigEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ResidentConfigDTO.class);
}
private QueryWrapper<ResidentConfigEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResidentConfigEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ResidentConfigDTO get(String id) {
ResidentConfigEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ResidentConfigDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ResidentConfigDTO dto) {
//校验同意类型下 编码是否重复
ResidentConfigDTO residentConfigDTOByTypeAndCode = getResidentConfigDTOByTypeAndCode(dto.getResidentType(), dto.getResidentCode());
if(residentConfigDTOByTypeAndCode!=null){
throw new RenException("同一类型下编码不能重复!");
}
ResidentConfigEntity entity = ConvertUtils.sourceToTarget(dto, ResidentConfigEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ResidentConfigDTO dto) {
//校验同意类型下 编码是否重复
ResidentConfigDTO residentConfigDTOByTypeAndCode = getResidentConfigDTOByTypeAndCode(dto.getResidentType(), dto.getResidentCode());
//若是存在相同且ID不同的话代表编码重复!
if(residentConfigDTOByTypeAndCode!=null && !residentConfigDTOByTypeAndCode.getId().equals(dto.getId())){
throw new RenException("同一类型下编码不能重复!");
}
ResidentConfigEntity entity = ConvertUtils.sourceToTarget(dto, ResidentConfigEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result<List<ResidentConfigResultDTO>> listResidentConfig(String residentType) {
return new Result<List<ResidentConfigResultDTO>>().ok(baseDao.selectListResidentConfigByResidentType(residentType));
}
@Override
public ResidentConfigDTO getResidentConfigDTOByTypeAndCode(String residentType, String residentCode) {
return baseDao.selectResidentConfigDTOByTypeAndCode(residentType,residentCode);
}
}

75
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ResidentConfigDao.xml

@ -0,0 +1,75 @@
<?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.elink.esua.epdc.dao.ResidentConfigDao">
<resultMap type="com.elink.esua.epdc.entity.ResidentConfigEntity" id="residentConfigMap">
<result property="id" column="ID"/>
<result property="residentType" column="RESIDENT_TYPE"/>
<result property="residentCode" column="RESIDENT_CODE"/>
<result property="residentValue" column="RESIDENT_VALUE"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="remark" column="REMARK"/>
</resultMap>
<select id="selectListResidentConfig" resultType="com.elink.esua.epdc.dto.ResidentConfigDTO">
select
ID,
RESIDENT_TYPE,
RESIDENT_CODE,
RESIDENT_VALUE,
SORT,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
REMARK
from epdc_resident_config
where DEL_FLAG = '0'
<if test="residentType!=null and residentType != ''">
and RESIDENT_TYPE = #{residentType}
</if>
ORDER BY SORT,CREATED_TIME DESC
</select>
<select id="selectListResidentConfigByResidentType" resultType="com.elink.esua.epdc.dto.result.ResidentConfigResultDTO">
SELECT
RESIDENT_TYPE,
RESIDENT_CODE,
RESIDENT_VALUE
FROM
`epdc_resident_config`
WHERE DEL_FLAG = 0
<if test="residentType!=null and residentType!=''">
and RESIDENT_TYPE = #{residentType}
</if>
ORDER BY SORT,CREATED_TIME DESC
</select>
<select id="selectResidentConfigDTOByTypeAndCode" resultType="com.elink.esua.epdc.dto.ResidentConfigDTO">
select
ID,
RESIDENT_TYPE,
RESIDENT_CODE,
RESIDENT_VALUE,
SORT,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
REMARK
from epdc_resident_config
where DEL_FLAG = '0' and RESIDENT_TYPE = #{residentType} and RESIDENT_CODE = #{residentCode}
</select>
</mapper>

52
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/MyPartyTopicFormDTO.java

@ -0,0 +1,52 @@
package com.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author songyunpeng
* @Date 2020/6/3 16:24
*/
@Data
public class MyPartyTopicFormDTO implements Serializable {
private static final long serialVersionUID = -3034807666143092535L;
/**
* 页码
*/
@NotNull(message = "页码不能为空")
private Integer pageIndex;
/**
* 页容量
*/
@NotNull(message = "分页数量不能为空")
private Integer pageSize;
/**
* 第一页查询发起时的时间
*/
@NotBlank(message = "时间戳不能为空")
private String timestamp;
/**
* 用户ID
*/
private String userId;
/**
* 话题类型
*/
private String topicType;
/**
* 党群ID
*/
private String partyGroupId;
/**
* 话题ID
*/
private String partyTopicId;
}

15
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.form.MyPartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicSubmitFormDTO;
import com.elink.esua.epdc.dto.form.TopicStatementFormDTO;
@ -27,8 +28,6 @@ import com.elink.esua.epdc.service.PartyTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 话题表
@ -55,6 +54,18 @@ public class AppPartyTopicController {
return partyTopicService.getAllPartyTopicResultDTO(formDTO);
}
/**
* @Description 我的话题列表
* @Author songyunpeng
* @Date 2020/6/3
* @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
**/
@GetMapping("myTopicList")
public Result<PartyTopicResultDTO> myTopicList(@RequestBody MyPartyTopicFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return partyTopicService.getMyPartyTopicResultDTO(formDTO);
}
/**
* @Description 发布话题
* @Author songyunpeng

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PartyTopicDTO;
import com.elink.esua.epdc.dto.form.MyPartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.result.TopicList;
import com.elink.esua.epdc.entity.PartyTopicEntity;
@ -77,4 +78,12 @@ public interface PartyTopicDao extends BaseDao<PartyTopicEntity> {
* @return void
**/
void updateSupportNum(String id,Integer num);
/**
* @Description 我的话题列表
* @Author songyunpeng
* @Date 2020/6/11
* @Param [formDto]
* @return java.util.List<com.elink.esua.epdc.dto.result.TopicList>
**/
List<TopicList> selectListOfMyPartyTopic(MyPartyTopicFormDTO formDto);
}

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java

@ -22,6 +22,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.GroupTopicCloseFormDTO;
import com.elink.esua.epdc.dto.PartyTopicDTO;
import com.elink.esua.epdc.dto.form.MyPartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicSubmitFormDTO;
import com.elink.esua.epdc.dto.form.TopicStatementFormDTO;
@ -154,4 +155,12 @@ public interface PartyTopicService extends BaseService<PartyTopicEntity> {
* @return void
**/
void statement(TopicStatementFormDTO formDto);
/**
* @Description 我的话题列表
* @Author songyunpeng
* @Date 2020/6/11
* @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>
**/
Result<PartyTopicResultDTO> getMyPartyTopicResultDTO(MyPartyTopicFormDTO formDTO);
}

17
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java

@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.PartyTopicDTO;
import com.elink.esua.epdc.dto.PartyTopicUserAttitudeDTO;
import com.elink.esua.epdc.dto.PartyUserGroupDTO;
import com.elink.esua.epdc.dto.constant.PartyGroupConstant;
import com.elink.esua.epdc.dto.form.MyPartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicSubmitFormDTO;
import com.elink.esua.epdc.dto.form.TopicStatementFormDTO;
@ -221,4 +222,20 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
}
}
@Override
public Result<PartyTopicResultDTO> getMyPartyTopicResultDTO(MyPartyTopicFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex);
List<TopicList> topicLists = baseDao.selectListOfMyPartyTopic(formDto);
PartyTopicResultDTO partyTopicResultDTO = new PartyTopicResultDTO();
//获取当前用户在当前党群禁言状态
PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(formDto.getPartyGroupId(), formDto.getUserId());
if(userByGroupIdAndUserId!=null && userByGroupIdAndUserId.getBannedEndTime()!=null && new Date().before(userByGroupIdAndUserId.getBannedEndTime())){
partyTopicResultDTO.setBannedFlag("1");
}else{
partyTopicResultDTO.setBannedFlag("0");
}
partyTopicResultDTO.setTopicList(topicLists);
return new Result<PartyTopicResultDTO>().ok(partyTopicResultDTO); }
}

48
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

@ -204,6 +204,54 @@
LIMIT #{pageIndex},#{pageSize}) tmp)
order by t.CREATED_TIME desc,t3.CREATED_TIME
</select>
<select id="selectListOfMyPartyTopic" resultMap="partyTopicResult">
select t.ID,
t.NICKNAME,
t.USER_FACE,
t.PARTY_MEMBER,
t.CREATED_TIME,
t.TOPIC_CONTENT,
t.TOPIC_MODULE,
t.SUPPORT_NUM,
t.COMMENT_NUM,
t.TOPIC_ADDRESS,
<if test='userId != "" and userId != null'>
if( ATTITUDE_FLAG='0',1,0)likeFlag,
</if>
t2.IMG_URL,
t3.ID as commentId,
t3.USERNAME as username,
t3.USER_FACE as commentUserFace,
t3.CONTENT as content,
t3.PARTY_MEMBER as commentPartyMemberDEL_FLAG
from epdc_party_topic t
<if test='userId != "" and userId != null'>
left join epdc_party_topic_user_attitude t1 on t.ID = t1.PARTY_TOPIC_ID and t1.DEL_FLAG='0' and t1.USER_ID = #{userId}
</if>
left join epdc_party_topic_img t2 on t.ID = t2.REFERENCE_ID and t2.DEL_FLAG='0'
left join (select ID,USERNAME,USER_FACE,PARTY_MEMBER,CONTENT,TOPIC_ID,DEL_FLAG,CREATED_TIME from epdc_party_topic_comment order by CREATED_TIME desc) t3 on t.ID = t3.TOPIC_ID and t3.DEL_FLAG='0'
where
t.ID in (select tmp.ID from (SELECT
t1.ID
FROM
epdc_party_topic t1
WHERE
t1.DEL_FLAG = '0' and t1.STATE = '0' and t1.USER_ID = #{userId}
<if test="timestamp != null and timestamp.trim() != ''">
<![CDATA[ AND DATE_FORMAT(t1.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
<if test="topicType != null and topicType != ''">
and t1.TOPIC_MODULE = #{topicType}
</if>
<if test="partyTopicId!=null and partyTopicId != ''">
and t1.ID = #{partyTopicId}
</if>
ORDER BY
t1.CREATED_TIME DESC
LIMIT #{pageIndex},#{pageSize}) tmp)
order by t.CREATED_TIME desc,t3.CREATED_TIME
</select>
<update id="updateCommentNum">
UPDATE epdc_party_topic SET COMMENT_NUM = COMMENT_NUM + #{num} WHERE ID = #{id}

13
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java

@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.EpdcAdjustUserPointsDTO;
import com.elink.esua.epdc.dto.PointsLogsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.excel.PointsLogsExcel;
@ -108,4 +109,16 @@ public class PointsLogsController {
ValidatorUtils.validateEntity(formDto);
return pointsLogsService.confirmAdjustPoint(formDto);
}
/**
* @Description 积分管理-积分统计 -统计调整积分
* @Author songyunpeng
* @Date 2020/6/9
* @Param [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
@PostMapping("confirmUserAdjustPoint")
public Result confirmUserAdjustPoint(@RequestBody EpdcAdjustUserPointsDTO formDto){
ValidatorUtils.validateEntity(formDto);
return pointsLogsService.confirmUserAdjustPoint(formDto);
}
}

1
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java

@ -27,7 +27,6 @@ import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**

15
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java

@ -20,17 +20,16 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.EpdcAdjustUserPointsDTO;
import com.elink.esua.epdc.dto.PointsLogsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.form.PointsLogsFormDTO;
import com.elink.esua.epdc.dto.result.PointsLogsResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogsSumResultDTO;
import com.elink.esua.epdc.dto.form.EpdcAppPointsRankingFormDTO;
import com.elink.esua.epdc.dto.form.EpdcAppPointsRecordFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogsFormDTO;
import com.elink.esua.epdc.dto.result.EpdcAppPointsRankingResultDTO;
import com.elink.esua.epdc.dto.result.EpdcAppPointsRecordResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogsResultDTO;
import com.elink.esua.epdc.entity.PointsLogsEntity;
import io.swagger.models.auth.In;
import java.util.List;
import java.util.Map;
@ -164,4 +163,12 @@ public interface PointsLogsService extends BaseService<PointsLogsEntity> {
* @Date: 2020-04-30
*/
EpdcAppPointsRankingResultDTO listPointsRanking(EpdcAppPointsRankingFormDTO formDto);
/**
* @Description 积分管理-积分统计 -统计调整积分
* @Author songyunpeng
* @Date 2020/6/9
* @Param [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result confirmUserAdjustPoint(EpdcAdjustUserPointsDTO formDto);
}

40
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java

@ -21,34 +21,33 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.async.NewsTask;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.PointsConstant;
import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum;
import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum;
import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.PointsLogsDao;
import com.elink.esua.epdc.dto.EpdcAdjustUserPointsDTO;
import com.elink.esua.epdc.dto.PointsLogsDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.constant.PointsNoticeConstant;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.form.PointsLogsFormDTO;
import com.elink.esua.epdc.dto.result.*;
import com.elink.esua.epdc.dto.form.EpdcAppPointsRankingFormDTO;
import com.elink.esua.epdc.dto.form.EpdcAppPointsRecordFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogsFormDTO;
import com.elink.esua.epdc.dto.result.*;
import com.elink.esua.epdc.entity.PointsLogsEntity;
import com.elink.esua.epdc.feign.UsersFeignClient;
import com.elink.esua.epdc.redis.PointsLogsRedis;
import com.elink.esua.epdc.service.PointsBehaviorService;
import com.elink.esua.epdc.service.PointsLogsService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.Rank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -253,6 +252,37 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points
return rangking;
}
@Override
public Result confirmUserAdjustPoint(EpdcAdjustUserPointsDTO formDto) {
if(formDto.getOperatePoints()== NumConstant.ZERO){
return new Result().error("操作积分不能为0");
}
PointsLogsEntity pointsLogsEntity=new PointsLogsEntity();
pointsLogsEntity.setUserId(formDto.getId());
pointsLogsEntity.setNickname(formDto.getNickname());
pointsLogsEntity.setFaceImg(formDto.getFaceImg());
pointsLogsEntity.setOperationTime(new Date());
pointsLogsEntity.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_ADMIN.getOperationMode());//操作方式(user-用户操作,admin-管理员操作,sys-系统操作)
pointsLogsEntity.setRuleCode(PointsConstant.ruleCode);
pointsLogsEntity.setBehaviorCode(PointsConstant.behaviorCodeCode);
pointsLogsEntity.setOperationDesc(formDto.getAdjustReason());//操作描述
pointsLogsEntity.setPoints(formDto.getOperatePoints());
pointsLogsEntity.setOperationType(formDto.getOperationType());//积分操作类型(0-减积分,1-加积分)
pointsLogsEntity.setReferenceId(formDto.getId());//积分操作类型(0-减积分,1-加积分)
EpdcUserPointsFormDTO userPointsFormDTO = new EpdcUserPointsFormDTO();
userPointsFormDTO.setUserId(formDto.getId());
userPointsFormDTO.setPoints(formDto.getOperatePoints());
userPointsFormDTO.setOperationType(formDto.getOperationType());
Result<UserDTO> result = usersFeignClient.handleUserPoints(userPointsFormDTO);
if (!result.success()) {
return new Result().error("调整用户积分失败");
}
//剩余积分
pointsLogsEntity.setLavePoints(result.getData().getPoints());
this.insert(pointsLogsEntity);
return new Result();
}
/**
* 获取排好序的排行榜数据
* @param formDto

80
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/EpdcAdjustUserPointsDTO.java

@ -0,0 +1,80 @@
package com.elink.esua.epdc.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 用户积分调整入参DTO
* @Author
* @Date 2019/12/16 17:25
*/
@Data
public class EpdcAdjustUserPointsDTO implements Serializable {
private static final long serialVersionUID = -2810969141214818209L;
/**
* 用户ID
*/
@NotBlank(message = "用户不能为空")
private String id;
/**
* 姓名
*/
private String realName;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String faceImg;
/**
* 性别(0-1-)
*/
private String sex;
/**
* 出生日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;
/**
* 手机号
*/
private String mobile;
/**
* 用户当前积分
*/
private Integer points;
/**
* 调整原因
*/
@NotBlank(message = "调整原因不能为空")
private String adjustReason;
/**
* 积分操作类型
*/
@NotBlank(message = "操作类型不能为空")
private String operationType;
/**
* 积分调整值
*/
private Integer operatePoints;
}

57
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMemberModifyFormDTO.java

@ -0,0 +1,57 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Authorliuchuang
* @Date2020/3/24 19:39
*/
@Data
public class PartyMemberModifyFormDTO implements Serializable {
/**
* 用户ID
*/
@NotBlank(message = "用户ID不能为空")
private String userId;
/**
* 用户状态
*/
private String state;
/**
* 党员标识
*/
private String partyFlag;
/**
* 备注
*/
private String remark;
/**
* 真实姓名
*/
@NotBlank(message = "姓名不能为空")
private String realName;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空")
private String identityNo;
/**
* 党员ID
*/
private String partyMemberId;
}

128
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserPointsDTO.java

@ -0,0 +1,128 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 用户信息表
*
* @author songyunpeng
* @since v1.0.0 2019-09-02
*/
@Data
public class UserPointsDTO implements Serializable {
private static final long serialVersionUID = 915598602233599300L;
/**
* 主键
*/
private String id;
/**
* 昵称
*/
private String nickname;
/**
* 手机号
*/
private String mobile;
/**
* 电话
*/
private String telephone;
/**
* 真实姓名
*/
private String realName;
/**
* 居民住址
*/
private String address;
/**
* 用户积分
*/
private Integer points;
/**
* 用户累计积分
*/
private Integer pointsTotle;
/**
* 社区
*/
private String communityName;
/**
* 社区ID
*/
private Long communityId;
/**
* 网格
*/
private String gridName;
/**
* 网格ID
*/
private Long gridId;
/**
* 居住网格id
*/
private Long deptId;
/**
* 父所有部门
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
}

92
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java

@ -27,12 +27,15 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.PartyMemberModifyFormDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserPointsDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO;
import com.elink.esua.epdc.enums.AppUserStatesEnum;
import com.elink.esua.epdc.excel.UserExcel;
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior;
import com.elink.esua.epdc.service.UserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -61,6 +64,35 @@ public class UserController {
return new Result<PageData<UserDTO>>().ok(page);
}
/**
* @Description 待认证党员
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserDTO>>
**/
@GetMapping("waitPartyPage")
@DataFilter(tableAlias = "ug", isPendingCreator = false, deptId = "GRID_ID", prefix = "AND")
public Result<PageData<UserDTO>> waitPartyPage(@RequestParam Map<String, Object> params) {
PageData<UserDTO> page = userService.waitPartyPage(params);
return new Result<PageData<UserDTO>>().ok(page);
}
/**
* @Description 待认证党员导出
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params, response]
* @return void
**/
@GetMapping("exportWaitParty")
@DataFilter(tableAlias = "ug", isPendingCreator = false, deptId = "GRID_ID", prefix = "AND")
public void exportWaitParty(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserDTO> list = userService.listOfWaitParty(params);
ExcelUtils.exportExcelToTarget(response, "待认证党员", list, UserExcel.class);
}
@GetMapping("{id}")
public Result<UserDTO> get(@PathVariable("id") String id) {
UserDTO data = userService.get(id);
@ -202,4 +234,64 @@ public class UserController {
public Result<PageData<UserDTO>> getUserListPage(@RequestParam Map<String, Object> params) {
PageData<UserDTO> page = userService.getUserListPage(params);
return new Result<PageData<UserDTO>>().ok(page); }
/**
* @Description 用户积分统计列表
* @Author songyunpeng
* @Date 2020/6/9
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserPointsDTO>>
**/
@GetMapping("pageForPoints")
public Result<PageData<UserPointsDTO>> pageForPoints(@RequestParam Map<String, Object> params) {
PageData<UserPointsDTO> page = userService.pageForPoints(params);
return new Result<PageData<UserPointsDTO>>().ok(page);
}
/**
* @Description 党员认证通过并更新党员库信息
* @Author songyunpeng
* @Date 2020/6/10
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
@PostMapping("updatePartyInfo")
public Result updatePartyInfo(@RequestBody PartyMemberModifyFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
if (StringUtils.isEmpty(dto.getPartyMemberId())) {
return new Result().error("党员ID不能为空");
}
return userService.modifyPartyInfo(dto);
}
/**
*
* 党员认证
*
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2020/3/24 15:58
*/
@PostMapping("partyReview")
public Result partyReview(@RequestBody UserDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return userService.partyReview(dto);
}
/**
*
* 新增党员信息并认证通过
*
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2020/3/25 14:31
*/
@PostMapping("insertPartyInfo")
public Result insertPartyInfo(@RequestBody PartyMemberModifyFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return userService.addPartyInfo(dto);
}
}

25
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java

@ -20,6 +20,7 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.CachingUserInfoDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserPointsDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppUserRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUnauthorizedAmountFromDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
@ -231,4 +232,28 @@ public interface UserDao extends BaseDao<UserEntity> {
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/
List<UserDTO> getUserListPage(Map<String, Object> params);
/**
* @Description 用户积分列表
* @Author songyunpeng
* @Date 2020/6/9
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.UserPointsDTO>
**/
List<UserPointsDTO> selectListUserPoints(Map<String, Object> params);
/**
* @Description 待认证居民
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/
List<UserDTO> selectListWaitUserDto(Map<String, Object> params);
/**
* @Description 待认证党员
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/
List<UserDTO> selectListOfWaitPartyUserDto(Map<String, Object> params);
}

61
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java

@ -21,17 +21,11 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CachingUserInfoDTO;
import com.elink.esua.epdc.dto.PartyMemberModifyFormDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO;
import com.elink.esua.epdc.dto.UserPointsDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO;
import com.elink.esua.epdc.entity.UserEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
@ -332,4 +326,55 @@ public interface UserService extends BaseService<UserEntity> {
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserDTO>
**/
PageData<UserDTO> getUserListPage(Map<String, Object> params);
/**
* @Description 积分模块用户列表
* @Author songyunpeng
* @Date 2020/6/9
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserDTO>
**/
PageData<UserPointsDTO> pageForPoints(Map<String, Object> params);
/**
* @Description 待认证党员
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserDTO>
**/
PageData<UserDTO> waitPartyPage(Map<String, Object> params);
/**
* @Description 待认证党员导出
* @Author songyunpeng
* @Date 2020/6/10
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/
List<UserDTO> listOfWaitParty(Map<String, Object> params);
/**
* @Description 党员认证通过并更新党员库信息
* @Author songyunpeng
* @Date 2020/6/10
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result modifyPartyInfo(PartyMemberModifyFormDTO dto);
/**
* @Description 党员认证
* @Author songyunpeng
* @Date 2020/6/10
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result partyReview(UserDTO dto);
/**
*
* 新增党员信息并认证通过
*
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2020/3/25 14:33
*/
Result addPartyInfo(PartyMemberModifyFormDTO dto);
}

205
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -107,9 +107,15 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
Long userId = SecurityUser.getUserId();
// 查询当前用户所具有的的数据权限
UserDetail userDetail = userDetailRedis.get(userId);
IPage<UserDTO> iPage = this.getPage(params);
List<UserDTO> userDtoList = this.baseDao.selectListUserDto(params);
return new PageData<>(userDtoList, iPage.getTotal());
if (NumConstant.ONE_STR.equals(params.get("state").toString())) {
IPage<UserDTO> iPage = this.getPage(params);
List<UserDTO> userDtoList = this.baseDao.selectListWaitUserDto(params);
return new PageData<>(userDtoList, iPage.getTotal());
} else {
IPage<UserDTO> iPage = this.getPage(params);
List<UserDTO> userDtoList = this.baseDao.selectListUserDto(params);
return new PageData<>(userDtoList, iPage.getTotal());
}
}
@Override
@ -1036,6 +1042,199 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return rangking;
}
@Override
public PageData<UserPointsDTO> pageForPoints(Map<String, Object> params) {
// 查询当前用户所具有的的数据权限
List<Long> deptIdList = SecurityUser.getUser().getDeptIdList();
params.put("deptIdList",deptIdList);
IPage<UserPointsDTO> page = getPage(params);
List<UserPointsDTO> list = baseDao.selectListUserPoints(params);
return new PageData<>(list, page.getTotal()); }
@Override
public PageData<UserDTO> waitPartyPage(Map<String, Object> params) {
this.verifyParams(params);
IPage<UserDTO> iPage = this.getPage(params);
List<UserDTO> userDtoList = this.baseDao.selectListOfWaitPartyUserDto(params);
return new PageData<>(userDtoList, iPage.getTotal());
}
@Override
public List<UserDTO> listOfWaitParty(Map<String, Object> params) {
this.verifyParams(params);
return this.baseDao.selectListOfWaitPartyUserDto(params);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result modifyPartyInfo(PartyMemberModifyFormDTO dto) {
// 更新党员库信息
PartyMembersEntity entity = new PartyMembersEntity();
entity.setId(dto.getPartyMemberId());
entity.setRealName(dto.getRealName());
entity.setIdentityNo(dto.getIdentityNo());
partyMembersDao.updateById(entity);
// 用户认证党员信息通过
UserDTO userDTO = ConvertUtils.sourceToTarget(dto, UserDTO.class);
userDTO.setId(dto.getUserId());
userDTO.setPartyFlag(YesOrNoEnum.YES.value());
this.partyReview(userDTO);
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<List<PartyMembersDTO>> partyReview(UserDTO dto) {
this.verifyUserInfo(dto);
UserEntity findUser = this.baseDao.selectById(dto.getId());
dto.setState(NumConstant.THREE_STR);
// 手动认证为党员
if (YesOrNoEnum.YES.value().equals(dto.getPartyFlag())) {
// 校验是党员库是否存在相同的身份证号或者姓名
boolean isParty = getPartyMemberByRealNameAndIdentityNo(dto.getRealName(), dto.getIdentityNo());
if (!isParty) {
Result<List<PartyMembersDTO>> result = getPartyMemberByRealNameOrIdentityNo(dto.getRealName(), dto.getIdentityNo());
if (result.getCode() != 0) {
return result;
} else {
// 插入党员库
insertPartyMember(dto);
}
}
}
// createdTime作为提交注册时间,registerTime作为注册审核时间(即注册时间)
dto.setRegisterTime(new Date());
//先删除以前审核未通过的那条数据
UserEntity entity = ConvertUtils.sourceToTarget(dto, UserEntity.class);
updateById(entity);
// 组装数据并插入用户认证历史表
findUser.setMobile(dto.getMobile());
findUser.setRealName(dto.getRealName());
saveUserAuthenticateHistory(findUser, dto.getPartyFlag(), dto.getRemark(), dto.getState());
// 修改党员库信息
if (YesOrNoEnum.YES.value().equals(dto.getPartyFlag())) {
updatePartyMember(findUser, dto.getRegisterTime());
}
return new Result<>();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result addPartyInfo(PartyMemberModifyFormDTO dto) {
// 新增党员库信息
PartyMembersEntity entity = new PartyMembersEntity();
entity.setRealName(dto.getRealName());
entity.setIdentityNo(dto.getIdentityNo());
entity.setRegistFlag(PartyMemberRegFlagEnum.NO.getValue());
partyMembersDao.insert(entity);
// 用户认证党员信息通过
UserDTO userDTO = ConvertUtils.sourceToTarget(dto, UserDTO.class);
userDTO.setId(dto.getUserId());
userDTO.setPartyFlag(YesOrNoEnum.YES.value());
this.partyReview(userDTO);
return new Result();
}
/**
*
* 新增党员信息
*
* @params [dto, findUser]
* @return void
* @author liuchuang
* @since 2020/3/23 19:35
*/
private void insertPartyMember(UserDTO dto) {
PartyMembersEntity entity = new PartyMembersEntity();
entity.setRealName(dto.getRealName());
entity.setIdentityNo(dto.getIdentityNo());
entity.setRegistFlag(PartyMemberRegFlagEnum.MANUAL.getValue());
partyMembersDao.insert(entity);
}
/**
*
* 获取党员信息
*
* @params [realName, identityNo]
* @return boolean
* @author liuchuang
* @since 2020/3/23 18:30
*/
private boolean getPartyMemberByRealNameAndIdentityNo(String realName, String identityNo) {
QueryWrapper<PartyMembersEntity> wrapper = new QueryWrapper<>();
wrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo)
.eq(UserFieldConsant.REAL_NAME, realName);
Integer count = this.partyMembersDao.selectCount(wrapper);
return count != NumConstant.ZERO;
}
/**
*
* 获取党员信息
*
* @params [realName, identityNo]
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
* @author liuchuang
* @since 2020/3/23 18:35
*/
private Result<List<PartyMembersDTO>> getPartyMemberByRealNameOrIdentityNo(String realName, String identityNo) {
List<PartyMembersEntity> partyMembersEntities = null;
List<PartyMembersDTO> data = null;
Result<List<PartyMembersDTO>> result = new Result<>();
// 根据身份证号查询党员库
QueryWrapper<PartyMembersEntity> identityNoWrapper = new QueryWrapper<>();
identityNoWrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo);
partyMembersEntities = this.partyMembersDao.selectList(identityNoWrapper);
if (null != partyMembersEntities && partyMembersEntities.size() > 0) {
data = ConvertUtils.sourceToTarget(partyMembersEntities, PartyMembersDTO.class);
result.setCode(NumConstant.ONE);
result.setData(data);
return result;
}
// 根据姓名查询党员库
QueryWrapper<PartyMembersEntity> realNameWrapper = new QueryWrapper<>();
realNameWrapper.eq(UserFieldConsant.REAL_NAME, realName);
partyMembersEntities = this.partyMembersDao.selectList(realNameWrapper);
if (null != partyMembersEntities && partyMembersEntities.size() > 0) {
data = ConvertUtils.sourceToTarget(partyMembersEntities, PartyMembersDTO.class);
result.setCode(NumConstant.TWO);
result.setData(data);
return result;
}
return new Result<>();
}
/**
*
* 用户信息校验
*
* @params [dto]
* @return com.elink.esua.epdc.dto.UserDTO
* @author liuchuang
* @since 2020/3/23 18:23
*/
private UserDTO verifyUserInfo(UserDTO dto) {
if (StringUtils.isBlank(dto.getRealName()) && StringUtils.isBlank(dto.getRealName().trim())) {
throw new RenException("用户姓名不能为空");
}
if (StringUtils.isBlank(dto.getMobile()) && StringUtils.isBlank(dto.getMobile().trim())) {
throw new RenException("手机号不能为空");
}
if (StringUtils.isBlank(dto.getIdentityNo()) && StringUtils.isBlank(dto.getIdentityNo().trim())) {
throw new RenException("身份证号不能为空");
}
dto.setRealName(dto.getRealName().trim());
dto.setMobile(dto.getMobile().trim());
dto.setIdentityNo(dto.getIdentityNo().trim());
return dto;
}
/**
* 返回本次 积分排行 用户网格关系表中的用户id
* @param formDto

135
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -608,4 +608,139 @@
</select>
<select id="selectListUserPoints" resultType="com.elink.esua.epdc.dto.UserPointsDTO">
select * from(
SELECT u.id,
u.NICKNAME,
u.REAL_NAME,
u.MOBILE,
u.REGISTER_TIME,
ADDRESS,
ug.ALL_DEPT_NAMES AS myGridName,
u.DEL_FLAG,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.GRID_ID, u.DEPT_ID) as GRID_ID,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.PARENT_DEPT_IDS, u.PARENT_DEPT_IDS) as PARENT_DEPT_IDS,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.ALL_DEPT_IDS, u.ALL_DEPT_IDS) as ALL_DEPT_IDS,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), substring_index(ug.ALL_DEPT_NAMES, '-', -1), substring_index(u.ALL_DEPT_NAMES, '-', -1) ) as gridName,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), substring_index(substring_index(ug.ALL_DEPT_NAMES,'-',-2), '-', 1) , substring_index(substring_index(u.ALL_DEPT_NAMES,'-',-2), '-', 1) ) as communityName,
u.POINTS,
u.POINTS_TOTLE
FROM epdc_user u
LEFT JOIN ( select * from (select * from epdc_user_grid_relation order by CREATED_TIME)t group by t.USER_ID) ug ON u.ID = ug.USER_ID)ug
where
ug.del_flag = '0'
<if test="realName != '' and realName != null">and ug.real_name like '%${realName}%' or ug.nickname like '%${realName}%'</if>
<if test="mobile != '' and mobile != null">and ug.mobile like '%${mobile}%'</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ug.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ug.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (ug.grid_id = #{gridId}
OR find_in_set(#{gridId},ug.ALL_DEPT_IDS))
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
AND ug.GRID_ID IN
<foreach collection="deptIdList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
GROUP BY
ug.ID
ORDER BY
ug.POINTS desc,
ug.register_time desc
</select>
<select id="selectListWaitUserDto" resultType="com.elink.esua.epdc.dto.UserDTO">
select * from(
SELECT u.id,
u.REAL_NAME,
u.NICKNAME,
u.MOBILE,
u.REGISTER_TIME,
u.CREATED_TIME,
u.UPDATED_TIME,
IDENTITY_NO,
ADDRESS,
STATE,
PARTY_FLAG,
ug.ALL_DEPT_NAMES AS myGridName,
u.DEL_FLAG,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.GRID_ID, u.DEPT_ID) as GRID_ID,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.PARENT_DEPT_IDS, u.PARENT_DEPT_IDS) as PARENT_DEPT_IDS,
IF((u.DEPT_ID is null or u.DEPT_ID = '0'), ug.ALL_DEPT_IDS, u.ALL_DEPT_IDS) as ALL_DEPT_IDS
FROM epdc_user u
LEFT JOIN ( select * from (select * from epdc_user_grid_relation order by CREATED_TIME)t group by t.USER_ID) ug ON u.ID = ug.USER_ID)ug
where
ug.del_flag = '0'
and (ug.IDENTITY_NO is null or ug.IDENTITY_NO = '')
<if test="startTime != '' and endTime != ''">and ug.CREATED_TIME between #{startTime} and #{endTime}</if>
<if test="state != '' and state != null">and ug.state = #{state}</if>
<if test="realName != '' and realName != null">and ug.real_name like '%${realName}%'</if>
<if test="nickname != '' and nickname != null">and ug.NICKNAME like '%${nickname}%'</if>
<if test="mobile != '' and mobile != null">and ug.mobile like '%${mobile}%'</if>
<if test="identityNo != '' and identityNo != null">and ug.identity_no like '%${identityNo}%'</if>
<if test="partyFlag != '' and partyFlag != null">and ug.party_flag = #{partyFlag}</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ug.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ug.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (ug.grid_id = #{gridId}
OR find_in_set(#{gridId},ug.ALL_DEPT_IDS))
</if>
GROUP BY
ug.ID
ORDER BY
ug.register_time desc
</select>
<select id="selectListOfWaitPartyUserDto" resultType="com.elink.esua.epdc.dto.UserDTO">
SELECT
u.id,
u.REAL_NAME,
u.NICKNAME,
u.MOBILE,
u.REGISTER_TIME,
u.CREATED_TIME,
u.IDENTITY_NO,
u.ADDRESS,
u.STATE,
u.PARTY_FLAG,
u.ALL_DEPT_NAMES
FROM
epdc_user u
LEFT JOIN epdc_user_grid_relation ug ON u.ID = ug.USER_ID
where
u.del_flag = '0'
and u.IDENTITY_NO is not null
and u.state = '1'
<![CDATA[ AND u.IDENTITY_NO != '' ]]>
<if test="startTime != '' and endTime != ''">and u.CREATED_TIME between #{startTime} and #{endTime}</if>
<if test="realName != '' and realName != null">and u.real_name like '%${realName}%'</if>
<if test="mobile != '' and mobile != null">and u.mobile like '%${mobile}%'</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ug.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ug.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (ug.grid_id = #{gridId}
OR find_in_set(#{gridId},ug.ALL_DEPT_IDS))
</if>
GROUP BY
u.ID
ORDER BY
u.register_time desc
</select>
</mapper>

Loading…
Cancel
Save