Browse Source

Merge remote-tracking branch 'origin/dev0.2' into dev0.2

dev_shibei_match
wangchao 5 years ago
parent
commit
bd556f1ef5
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/FieldConstant.java
  2. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  3. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  4. 14
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  5. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  6. 107
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java
  7. 94
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java
  8. 39
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java
  9. 73
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/UserMessageEntity.java
  10. 77
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/UserMessageExcel.java
  11. 47
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/UserMessageRedis.java
  12. 104
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java
  13. 116
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java
  14. 27
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml
  15. 15
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java
  16. 22
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  17. 1
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java
  18. 4
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/entity/OssEntity.java
  19. 5
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  20. 35
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  21. 7
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml
  22. 10
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/ResiPartymemberFeignClient.java
  23. 6
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/fallback/ResiPartymemberFeignClientFallBack.java
  24. 11
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
  25. 10
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedService.java
  26. 27
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedServiceImpl.java
  27. 65
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java
  28. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java
  29. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
  30. 40
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java
  31. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java
  32. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/FieldConstant.java

@ -49,6 +49,7 @@ public interface FieldConstant {
String GRID_ID = "GRID_ID";
String GRID_ID_HUMP = "gridId";
String USER_ID = "USER_ID";
String USER_ID_HUMP = "userId";
}

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -24,6 +24,11 @@ public interface ServiceConstant {
*/
String EPMET_AUTH_SERVER = "epmet-auth-server";
/**
* 文件对象模块
*/
String EPMET_OSS_SERVER = "epmet-oss-server";
/**
* 用户管理模块
*/

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -25,7 +25,8 @@ public enum EpmetErrorCode {
*/
MOBILE_EXIST(8201, "该手机号已注册居民,请使用其他手机号注册!"),
PARAMETER_EXCEPTION(8202, "必要参数存在空值或手机号输入不合规,请检查参数赋值情况!!"),
UPDATE_EXCEPTION(8203, "用户居民注册访问记录表更新数据失败!");
UPDATE_EXCEPTION(8203, "用户居民注册访问记录表更新数据失败!"),
PARTICIPATION_EXCEPTION(8204, "参数异常,请检查所传参数是否合规!");
private int value;

14
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -135,4 +135,18 @@ public class RedisKeys {
return rootPrefix.concat("party:member:confirm:").concat(userId).concat("-").concat(mobile).concat("-").concat(code);
}
/**
*
* 居民注册手机验证码key
*
* @param userId 用户id
* @param mobile 手机号
* @param code 验证码
* @return String
* @author sun
*/
public static String getResiRegisterMobileCodeKey(String userId, String mobile, String code) {
return rootPrefix.concat("resiregister:confirm:").concat(userId).concat("-").concat(mobile).concat("-").concat(code);
}
}

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -52,6 +52,7 @@ spring:
- Path=${server.servlet.context-path}/oss/**
filters:
- StripPrefix=1
- CpAuth=true
#消息服务
- id: epmet-message-server
uri: @gateway.routes.epmet-message-server.uri@

107
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java

@ -0,0 +1,107 @@
/**
* 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.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Data
public class UserMessageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* app=resi时此列为gridId,其他情况暂定 *
*/
private String gridId;
/**
* 对应用户id
*/
private String userId;
/**
* 消息通知对象居民端用户resi政府端工作人员gov运营端工作人员oper
*/
private String app;
/**
* 消息标题
*/
private String title;
/**
* 消息通知内容
*/
private String messageContent;
/**
* read已读unread未读
*/
private String readFlag;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人(发布消息的人)
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

94
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.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.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.UserMessageDTO;
import com.epmet.excel.UserMessageExcel;
import com.epmet.service.UserMessageService;
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 generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@RestController
@RequestMapping("usermessage")
public class UserMessageController {
@Autowired
private UserMessageService userMessageService;
@GetMapping("page")
public Result<PageData<UserMessageDTO>> page(@RequestParam Map<String, Object> params){
PageData<UserMessageDTO> page = userMessageService.page(params);
return new Result<PageData<UserMessageDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<UserMessageDTO> get(@PathVariable("id") String id){
UserMessageDTO data = userMessageService.get(id);
return new Result<UserMessageDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody UserMessageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userMessageService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody UserMessageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userMessageService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userMessageService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserMessageDTO> list = userMessageService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserMessageExcel.class);
}
}

39
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java

@ -0,0 +1,39 @@
/**
* 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.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.UserMessageEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Mapper
public interface UserMessageDao extends BaseDao<UserMessageEntity> {
/**
* 更新阅读状态为已读
*
* @param entity 参数
*/
void updateReadFlag(UserMessageEntity entity);
}

73
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/UserMessageEntity.java

@ -0,0 +1,73 @@
/**
* 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.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("user_message")
public class UserMessageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* app=resi时此列为gridId,其他情况暂定 *
*/
private String gridId;
/**
* 对应用户id
*/
private String userId;
/**
* 消息通知对象居民端用户resi政府端工作人员gov运营端工作人员oper
*/
private String app;
/**
* 消息标题
*/
private String title;
/**
* 消息通知内容
*/
private String messageContent;
/**
* read已读unread未读
*/
private String readFlag;
}

77
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/UserMessageExcel.java

@ -0,0 +1,77 @@
/**
* 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.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Data
public class UserMessageExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户id")
private String customerId;
@Excel(name = "app=resi时,此列为gridId,其他情况暂定 *")
private String gridId;
@Excel(name = "对应用户id")
private String userId;
@Excel(name = "消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper")
private String app;
@Excel(name = "消息标题")
private String title;
@Excel(name = "消息通知内容")
private String messageContent;
@Excel(name = "read已读、unread未读")
private String readFlag;
@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;
}

47
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/UserMessageRedis.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.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Component
public class UserMessageRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

104
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java

@ -0,0 +1,104 @@
/**
* 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.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserMessageDTO;
import com.epmet.entity.UserMessageEntity;
import java.util.List;
import java.util.Map;
/**
* 用户消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
public interface UserMessageService extends BaseService<UserMessageEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<UserMessageDTO>
* @author generator
* @date 2020-04-07
*/
PageData<UserMessageDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<UserMessageDTO>
* @author generator
* @date 2020-04-07
*/
List<UserMessageDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return UserMessageDTO
* @author generator
* @date 2020-04-07
*/
UserMessageDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-04-07
*/
void save(UserMessageDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-04-07
*/
void update(UserMessageDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-04-07
*/
void delete(String[] ids);
/**
* 全部已读
*
* @param messageDTO 参数
* @return Result
*/
Result allRead(UserMessageDTO messageDTO);
}

116
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.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.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserMessageDao;
import com.epmet.dto.UserMessageDTO;
import com.epmet.entity.UserMessageEntity;
import com.epmet.redis.UserMessageRedis;
import com.epmet.service.UserMessageService;
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 generator generator@elink-cn.com
* @since v1.0.0 2020-04-07
*/
@Service
public class UserMessageServiceImpl extends BaseServiceImpl<UserMessageDao, UserMessageEntity> implements UserMessageService {
@Autowired
private UserMessageRedis userMessageRedis;
@Override
public PageData<UserMessageDTO> page(Map<String, Object> params) {
IPage<UserMessageEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, UserMessageDTO.class);
}
@Override
public List<UserMessageDTO> list(Map<String, Object> params) {
List<UserMessageEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, UserMessageDTO.class);
}
private QueryWrapper<UserMessageEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
String communityId = (String) params.get(FieldConstant.COMMUNITY_ID_HUMP);
String gridId = (String) params.get(FieldConstant.GRID_ID_HUMP);
String userId = (String) params.get(FieldConstant.USER_ID_HUMP);
QueryWrapper<UserMessageEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id)
.eq(StringUtils.isNotBlank(communityId), FieldConstant.COMMUNITY_ID, communityId)
.eq(StringUtils.isNotBlank(gridId), FieldConstant.GRID_ID, gridId)
.eq(StringUtils.isNotBlank(userId), FieldConstant.USER_ID, userId);
return wrapper;
}
@Override
public UserMessageDTO get(String id) {
UserMessageEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, UserMessageDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserMessageDTO dto) {
UserMessageEntity entity = ConvertUtils.sourceToTarget(dto, UserMessageEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(UserMessageDTO dto) {
UserMessageEntity entity = ConvertUtils.sourceToTarget(dto, UserMessageEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result allRead(UserMessageDTO messageDTO) {
return null;
}
}

27
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml

@ -0,0 +1,27 @@
<?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.epmet.dao.UserMessageDao">
<resultMap type="com.epmet.entity.UserMessageEntity" id="userMessageMap">
<result property="id" column="ID"/>
<result property="customerId" column="customer_id"/>
<result property="gridId" column="grid_id"/>
<result property="userId" column="user_id"/>
<result property="app" column="app"/>
<result property="title" column="title"/>
<result property="messageContent" column="message_content"/>
<result property="readFlag" column="read_flag"/>
<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"/>
</resultMap>
<update id="updateReadFlag" parameterType="com.epmet.entity.UserMessageEntity">
</update>
</mapper>

15
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 上传图片返参DTO
* @Author yinzuomei
* @Date 2020/4/7 12:35
*/
@Data
public class UploadImgResultDTO implements Serializable {
private String url;
}

22
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -8,23 +8,23 @@
package com.epmet.controller;
import com.google.gson.Gson;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.cloud.CloudStorageConfig;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.cloud.CloudStorageConfig;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.tools.validator.group.AliyunGroup;
import com.epmet.commons.tools.validator.group.QcloudGroup;
import com.epmet.commons.tools.validator.group.QiniuGroup;
import com.epmet.dto.UploadDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import com.epmet.enums.OssTypeEnum;
import com.epmet.exception.ModuleErrorCode;
import com.epmet.remote.ParamsRemoteService;
import com.epmet.service.OssService;
import com.epmet.utils.ModuleConstant;
import com.epmet.remote.ParamsRemoteService;
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.FilenameUtils;
@ -106,7 +106,6 @@ public class OssController {
//保存文件信息
OssEntity ossEntity = new OssEntity();
ossEntity.setUrl(url);
ossEntity.setCreateDate(new Date());
ossService.insertOssEntity(ossEntity);
//文件信息
@ -126,4 +125,15 @@ public class OssController {
return new Result();
}
/**
* @param file
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author yinzuomei
* @Description 上传图片
* @Date 2020/4/7 10:39
**/
@PostMapping("uploadimg")
public Result<UploadImgResultDTO> uploadImg(@RequestParam("file") MultipartFile file) {
return ossService.uploadImg(file);
}
}

1
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java

@ -20,5 +20,4 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OssDao extends BaseDao<OssEntity> {
int insertOssEntity(String url);
}

4
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/entity/OssEntity.java

@ -9,7 +9,7 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEntity;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_oss")
public class OssEntity extends BaseEntity {
public class OssEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**

5
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -10,7 +10,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
@ -24,4 +27,6 @@ public interface OssService extends BaseService<OssEntity> {
PageData<OssEntity> page(Map<String, Object> params);
int insertOssEntity(OssEntity ossEntity);
Result<UploadImgResultDTO> uploadImg(MultipartFile file);
}

35
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -10,14 +10,21 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.OssDao;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import com.epmet.exception.ModuleErrorCode;
import com.epmet.service.OssService;
import org.apache.commons.io.FilenameUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.Map;
@Service
@ -34,6 +41,32 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
@Override
public int insertOssEntity(OssEntity ossEntity) {
return baseDao.insertOssEntity(ossEntity.getUrl());
return baseDao.insert(ossEntity);
}
@Override
public Result<UploadImgResultDTO> uploadImg(MultipartFile file) {
if (file.isEmpty()) {
return new Result<UploadImgResultDTO>().error(ModuleErrorCode.UPLOAD_FILE_EMPTY);
}
//上传文件
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
String url = null;
try {
url = OssFactory.build().uploadSuffix(file.getBytes(), extension);
} catch (IOException e) {
e.printStackTrace();
return new Result<UploadImgResultDTO>().error("图片上传异常");
}
//保存文件信息
OssEntity ossEntity = new OssEntity();
ossEntity.setUrl(url);
baseDao.insert(ossEntity);
//文件信息
UploadImgResultDTO dto = new UploadImgResultDTO();
dto.setUrl(url);
return new Result<UploadImgResultDTO>().ok(dto);
}
}

7
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml

@ -3,11 +3,4 @@
<mapper namespace="com.epmet.dao.OssDao">
<insert id="insertOssEntity" parameterType="java.lang.String">
INSERT INTO `sys_oss` ( `url`, `creator`, `create_date` )
VALUES
( #{url},
"1",
now( ) )
</insert>
</mapper>

10
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/ResiPartymemberFeignClient.java

@ -7,6 +7,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -76,4 +77,13 @@ public interface ResiPartymemberFeignClient {
*/
@PostMapping("/resi/partymember/confirm/extra")
Result partyMemberInfoExtra(@RequestBody PartymemberInfoDTO partyMemberInfoDTO);
/**
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/manageaudit")
Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
}

6
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/fallback/ResiPartymemberFeignClientFallBack.java

@ -8,6 +8,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -61,4 +62,9 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC
public Result partyMemberInfoExtra(PartymemberInfoDTO partyMemberInfoDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "partyMemberInfoExtra", partyMemberInfoDTO);
}
@Override
public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "manageAudit", formDTO);
}
}

11
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.service.ResiWarmheartedService;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -44,5 +45,15 @@ public class ResiWarmheartedController {
return resiWarmheartedService.submit(tokenDTO, formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@PostMapping("manageaudit")
public Result manageAudit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedAuditFormDTO formDTO) {
return resiWarmheartedService.manageAudit(tokenDTO, formDTO);
}
}

10
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedService.java

@ -2,6 +2,7 @@ package com.epmet.modules.warmhearted.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -31,4 +32,13 @@ public interface ResiWarmheartedService {
*/
Result submit(TokenDto tokenDTO, ResiWarmheartedSubmitFormDTO formDTO);
/**
* 政府端-热心居民申请人工审核
*
* @param
* @return void
* @author sun
*/
Result manageAudit(TokenDto tokenDTO, ResiWarmheartedAuditFormDTO formDTO);
}

27
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedServiceImpl.java

@ -1,11 +1,13 @@
package com.epmet.modules.warmhearted.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.feign.ResiPartymemberFeignClient;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.modules.warmhearted.service.ResiWarmheartedService;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -51,15 +53,36 @@ public class ResiWarmheartedServiceImpl implements ResiWarmheartedService {
@Override
public Result submit(TokenDto tokenDTO, ResiWarmheartedSubmitFormDTO formDTO) {
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) {
return new Result<ResiWarmheartedResultDTO>().error(ModuleConstant.USER_NOT_NULL);
return new Result().error(ModuleConstant.USER_NOT_NULL);
}
if (null == formDTO || StringUtils.isBlank(formDTO.getCustomerId())
|| StringUtils.isBlank(formDTO.getGridId())
|| StringUtils.isBlank(formDTO.getResiWarmVisitId())
|| StringUtils.isBlank(formDTO.getReason())) {
return new Result<ResiWarmheartedResultDTO>().error(EpmetErrorCode.PARAMETER_EXCEPTION.getName());
return new Result().error(EpmetErrorCode.PARAMETER_EXCEPTION.getName());
}
formDTO.setUserId(tokenDTO.getUserId());
return resiPartymemberFeignClient.submit(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@Override
public Result manageAudit(TokenDto tokenDTO, ResiWarmheartedAuditFormDTO formDTO) {
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) {
return new Result().error(ModuleConstant.USER_NOT_NULL);
}
if (null == formDTO || StringUtils.isBlank(formDTO.getCustomerId())
|| StringUtils.isBlank(formDTO.getResiWarmApplyId())
|| StringUtils.isBlank(formDTO.getAuditStatus())
|| (!NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())&&!NumConstant.ONE_STR.equals(formDTO.getAuditStatus()))) {
return new Result().error(EpmetErrorCode.PARTICIPATION_EXCEPTION.getName());
}
formDTO.setUserId(tokenDTO.getUserId());
return resiPartymemberFeignClient.manageAudit(formDTO);
}
}

65
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java

@ -0,0 +1,65 @@
/**
* 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.epmet.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 政府端-人工审核热心居民申请-配置入参
* @author sun
*/
@Data
public class ResiWarmheartedAuditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
private String resiWarmApplyId;
/**
* 审核状态(0:取消驳回 1:审核通过)
*/
@NotBlank(message = "审核状态不能为空")
private String auditStatus;
/**
* 驳回理由
*/
@NotBlank(message = "驳回理由不能为空")
private String refuseReason;
/**
* 客户Id CUSTOMER.id
*/
@NotBlank(message = "客户ID不能为空")
private String customerId;
/**
* 用户Id
*/
@NotBlank(message = "用户ID不能为空")
private String userId;
}

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java

@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.warmhearted.excel.ResiWarmheartedApplyExcel;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -40,7 +41,7 @@ import java.util.Map;
/**
* 热心居民申请表
* 热心居民申请表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
@ -48,24 +49,24 @@ import java.util.Map;
@RestController
@RequestMapping("resiwarmheartedapply")
public class ResiWarmheartedApplyController {
@Autowired
private ResiWarmheartedApplyService resiWarmheartedApplyService;
@GetMapping("page")
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params){
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ResiWarmheartedApplyDTO> page = resiWarmheartedApplyService.page(params);
return new Result<PageData<ResiWarmheartedApplyDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id){
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id) {
ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
return new Result<ResiWarmheartedApplyDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ResiWarmheartedApplyDTO dto){
public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.save(dto);
@ -73,7 +74,7 @@ public class ResiWarmheartedApplyController {
}
@PutMapping
public Result update(@RequestBody ResiWarmheartedApplyDTO dto){
public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.update(dto);
@ -81,7 +82,7 @@ public class ResiWarmheartedApplyController {
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
resiWarmheartedApplyService.delete(ids);
@ -95,13 +96,18 @@ public class ResiWarmheartedApplyController {
}
@PostMapping("init")
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO){
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO) {
return resiWarmheartedApplyService.init(formDTO);
}
@PostMapping("submit")
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO){
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
return resiWarmheartedApplyService.submit(formDTO);
}
@PostMapping("manageaudit")
public Result manageAudit(@RequestBody ResiWarmheartedAuditFormDTO formDTO) {
return resiWarmheartedApplyService.manageAudit(formDTO);
}
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -114,4 +115,13 @@ public interface ResiWarmheartedApplyService extends BaseService<ResiWarmhearted
* @author sun
*/
Result submit(ResiWarmheartedSubmitFormDTO formDTO);
/**
* 政府端-热心居民申请人工审核
*
* @param
* @return void
* @author sun
*/
Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
}

40
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

@ -21,11 +21,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.dto.UserRoleDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
@ -33,6 +38,7 @@ import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -65,6 +71,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
private ResiWarmheartedVisitService resiWarmheartedVisitService;
@Autowired
private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Override
public PageData<ResiWarmheartedApplyDTO> page(Map<String, Object> params) {
@ -123,7 +131,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) {
//1:热心居民申请行为记录表新增数据
Result<ResiWarmheartedResultDTO> result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
if(!result.success()){
if (!result.success()) {
log.warn(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
}
ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
@ -150,6 +158,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
/**
* 热心居民申请表新增数据
*
* @param formDTO
* @return
*/
@ -165,4 +174,33 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
baseDao.insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
Result result = new Result();
//1:更新热心居民申请表数据
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setId(formDTO.getResiWarmApplyId());
if (NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())) {
//审核状态-未通过
entity.setAuditStatus(PartyMemberConstant.REJECTED);
} else {
//审核状态-通过
entity.setAuditStatus(PartyMemberConstant.APPROVED);
}
entity.setRefuseReason(formDTO.getRefuseReason());
baseDao.updateById(entity);
//2:审核通过的添加热心居民的角色
if(NumConstant.ONE_STR.equals(formDTO.getAuditStatus())){
UserRoleDTO dto = new UserRoleDTO();
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserId(formDTO.getUserId());
//所属端-居民端
dto.setApp(AppClientConstant.APP_RESI);
//角色-热心居民
dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
result = epmetUserFeignClient.saveUserRole(dto);
}
return result;
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java

@ -46,13 +46,13 @@ public class UserResiInfoRedis {
}
public void setUserResiMobileCode(String userId, String mobile, String verificationCode){
String key = RedisKeys.getUserMobileCodeKey(userId, mobile, verificationCode);
//手机验证码放入缓存中 有效时间10分钟
redisUtils.set(key, verificationCode,RedisUtils.MINUTE_TEN_EXPIRE);
String key = RedisKeys.getResiRegisterMobileCodeKey(userId, mobile, verificationCode);
//手机验证码放入缓存中 有效时间30分钟
redisUtils.set(key, verificationCode,RedisUtils.MINUTE_THIRTY_EXPIRE);
}
public String getUserResiMobileCode(String userId, String mobile, String verificationCode){
String key = RedisKeys.getUserMobileCodeKey(userId, mobile, verificationCode);
String key = RedisKeys.getResiRegisterMobileCodeKey(userId, mobile, verificationCode);
return (String) redisUtils.get(key);
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -165,10 +165,18 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
result.setMsg(EpmetErrorCode.MOBILE_CODE_ERROR.getName());
return result;
}
//2:校验成功 数据存入居民注册表 更新行为记录表数据
//2:再次判断手机号是否可用
if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile())) {
//手机号验证失败则更新行为记录表数据 返回前台结果
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
result.setCode(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getValue());
result.setMsg(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getName());
return result;
}
//3:校验成功 数据存入居民注册表 更新行为记录表数据
saveUserResiInfo(userResiInfoDTO);
userResiRegisterVisitService.updateResiRegisterVisit(true, userResiInfoDTO);
//3:居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
//4:居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
registerRelationService.saveRegisterRelation(userResiInfoDTO);
return result;
}

Loading…
Cancel
Save