forked from rongchao/epmet-cloud-rizhao
214 changed files with 7848 additions and 828 deletions
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.commons.tools.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* desc:通用Id and Name 不要轻易修改 |
||||
|
* |
||||
|
* @author: LiuJanJun |
||||
|
* @date: 2021/8/19 4:12 下午 |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IdAndNameDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4481647404402681862L; |
||||
|
private String id; |
||||
|
private String name; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
package com.epmet.commons.tools.dto.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* desc:工作人员信息结果类 |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/15 10:00 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerStaffInfoCacheResult implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3519630252798469087L; |
||||
|
/** |
||||
|
* 工作人员所属组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) |
||||
|
*/ |
||||
|
private String twoOrgName; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员ID |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 性别0.未知,1男,2.女 |
||||
|
*/ |
||||
|
private Integer gender; |
||||
|
|
||||
|
/** |
||||
|
* 手机号-唯一键 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headPhoto; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员是从哪中组织类型添加的 3个值:agency,grid,dept |
||||
|
* @see com.epmet.commons.tools.enums.OrgTypeEnum |
||||
|
*/ |
||||
|
private String fromOrgType; |
||||
|
|
||||
|
/** |
||||
|
* 角色map key为角色key value 为角色名称 |
||||
|
*/ |
||||
|
private Map<String,String> roleMap; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织的上级组织 |
||||
|
*/ |
||||
|
private IdAndNameDTO parentAgency; |
||||
|
|
||||
|
/** |
||||
|
* 所属网格列表 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> gridList; |
||||
|
|
||||
|
/** |
||||
|
* 所属部门 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> deptList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.commons.tools.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory; |
||||
|
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* desc:通用工具包里的 agg feignClient |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) |
||||
|
public interface CommonAggFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* desc:根据工作人员Id 获取工作人员信息 |
||||
|
* @param staffId |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/data/aggregator/epmetuser/getStaffInfo/{staffId}") |
||||
|
Result<CustomerStaffInfoCache> getStaffInfo(@PathVariable("staffId") String staffId); |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.commons.tools.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.commons.tools.feign.CommonAggFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class CommonAggFeignClientFallBackFactory implements FallbackFactory<CommonAggFeignClient> { |
||||
|
private CommonAggFeignClientFallback fallback = new CommonAggFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public CommonAggFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.commons.tools.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.feign.CommonAggFeignClient; |
||||
|
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 调用政府端权限 |
||||
|
* @Author wxz |
||||
|
* @Description |
||||
|
* @Date 2020/4/24 11:17 |
||||
|
**/ |
||||
|
@Component |
||||
|
public class CommonAggFeignClientFallback implements CommonAggFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<CustomerStaffInfoCache> getStaffInfo(String staffId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getStaffInfo", staffId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,137 @@ |
|||||
|
package com.epmet.commons.tools.redis.common; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.feign.CommonAggFeignClient; |
||||
|
import com.epmet.commons.tools.redis.RedisKeys; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.jetbrains.annotations.Nullable; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import javax.annotation.PostConstruct; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员缓存通用类 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
public class CustomerStaffRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
@Autowired |
||||
|
private CommonAggFeignClient commonAggFeignClient; |
||||
|
|
||||
|
private static CustomerStaffRedis customerStaffRedis; |
||||
|
private static final String ROLE_MAP_KEY = "roleMap"; |
||||
|
|
||||
|
@PostConstruct |
||||
|
public void init() { |
||||
|
customerStaffRedis = this; |
||||
|
customerStaffRedis.redisUtils = this.redisUtils; |
||||
|
customerStaffRedis.commonAggFeignClient = this.commonAggFeignClient; |
||||
|
} |
||||
|
|
||||
|
public static void initTest() { |
||||
|
CustomerStaffInfoCacheResult role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02"); |
||||
|
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "e08316376c972b5cb3f085bb39a3680f"); |
||||
|
System.out.println(JSON.toJSONString(role)); |
||||
|
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "ec524bbbc41d0662cbb36236161005e9"); |
||||
|
System.out.println(JSON.toJSONString(role)); |
||||
|
System.out.println(JSON.toJSONString(getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a"))); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 根据工作人员Id 获取某工作人员信息,如果缓存不存在则查询db返回;缓存默认一天 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param staffId |
||||
|
* @return com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/8/19 10:29 下午 |
||||
|
* @remark 此方法仅用于 获取某个工作人员的信息,不用于获取客户下所有工作人员信息 |
||||
|
*/ |
||||
|
public static CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { |
||||
|
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); |
||||
|
Map<String, Object> roleMap = customerStaffRedis.redisUtils.hGetAll(key); |
||||
|
if (!CollectionUtils.isEmpty(roleMap)) { |
||||
|
return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class); |
||||
|
} |
||||
|
|
||||
|
CustomerStaffInfoCache resultData = reloadStaffCache(staffId, key); |
||||
|
if (resultData == null) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(resultData, CustomerStaffInfoCacheResult.class); |
||||
|
} |
||||
|
|
||||
|
@Nullable |
||||
|
private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) { |
||||
|
Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId); |
||||
|
if (staffResult == null || !staffResult.success()) { |
||||
|
throw new RenException("获取工作人员信息失败"); |
||||
|
} |
||||
|
CustomerStaffInfoCache resultData = staffResult.getData(); |
||||
|
if (resultData == null) { |
||||
|
log.warn("getStaffInfo staff is null,staffId:{}", staffId); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true); |
||||
|
customerStaffRedis.redisUtils.hMSet(key, map); |
||||
|
return resultData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 根据工作人员Id 获取某工作人员角色map信息 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param staffId |
||||
|
*/ |
||||
|
public static Map<String, String> getStaffRoleMap(String customerId, String staffId) { |
||||
|
int retryTime = 0; |
||||
|
do { |
||||
|
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); |
||||
|
Map<String, String> roleMap = (Map<String, String>) customerStaffRedis.redisUtils.hGet(key, ROLE_MAP_KEY); |
||||
|
if (!CollectionUtils.isEmpty(roleMap)) { |
||||
|
return roleMap; |
||||
|
} |
||||
|
retryTime++; |
||||
|
reloadStaffCache(staffId, key); |
||||
|
} while (retryTime < NumConstant.TWO); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 根据客户id及工作人员Id 删除缓存 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param staffId |
||||
|
* @return boolean |
||||
|
* @author LiuJanJun |
||||
|
* @date 2021/8/19 10:39 下午 |
||||
|
*/ |
||||
|
public static Boolean delStaffInfoFormCache(String customerId, String staffId) { |
||||
|
if (StringUtils.isBlank(customerId) || StringUtils.isBlank(staffId)) { |
||||
|
log.warn("delStaffInfoFormCache param is blank,customerId:{},staffId:{}", customerId, staffId); |
||||
|
return false; |
||||
|
} |
||||
|
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); |
||||
|
return customerStaffRedis.redisUtils.delete(key); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
package com.epmet.commons.tools.redis.common.bean; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* desc:客户工作人员缓存实体类 |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/15 10:00 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerStaffInfoCache implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4627478063125903910L; |
||||
|
/** |
||||
|
* 工作人员所属组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) |
||||
|
*/ |
||||
|
private String twoOrgName; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员ID |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 性别0.未知,1男,2.女 |
||||
|
*/ |
||||
|
private Integer gender; |
||||
|
|
||||
|
/** |
||||
|
* 手机号-唯一键 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headPhoto; |
||||
|
|
||||
|
/** |
||||
|
* 角色map key为角色key value 为角色名称 |
||||
|
*/ |
||||
|
private Map<String,String> roleMap; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员是从哪中组织类型添加的 3个值:agency,grid,dept |
||||
|
* @see com.epmet.commons.tools.enums.OrgTypeEnum |
||||
|
*/ |
||||
|
private String fromOrgType; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员是从哪中组织添加的 组织Id |
||||
|
*/ |
||||
|
private String fromOrgId; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织的上级组织 |
||||
|
*/ |
||||
|
private IdAndNameDTO parentAgency; |
||||
|
|
||||
|
/** |
||||
|
* 所属网格列表 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> gridList; |
||||
|
|
||||
|
/** |
||||
|
* 所属部门 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> deptList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 对外接口--【通讯录】姓名检索工作人员-接口入参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ListStaffFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -3381286960911634231L; |
||||
|
/** |
||||
|
* 待检索姓名 |
||||
|
*/ |
||||
|
@NotBlank(message = "姓名不能为空", groups = ListStaffFormDTO.Staff.class) |
||||
|
private String realName; |
||||
|
/** |
||||
|
* token中客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
public interface Staff extends CustomerClientShowGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/27 10:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3331980620366027460L; |
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 是否包括我(1 是,0 否) |
||||
|
*/ |
||||
|
private String includeMe; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Data 2021/8/19 14:06 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleUsersFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -7732382052293191415L; |
||||
|
@NotBlank(message = "角色ID不能为空") |
||||
|
private String roleId; |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 是否包括我(1 是,0 否) |
||||
|
*/ |
||||
|
private String includeMe; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/6/15 10:00 上午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerStaffResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 6989603307304337912L; |
||||
|
/** |
||||
|
* 工作人员所属组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员ID |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 真实姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 性别0.未知,1男,2.女 |
||||
|
*/ |
||||
|
private Integer gender; |
||||
|
|
||||
|
/** |
||||
|
* 手机号-唯一键 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headPhoto; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员是从哪中组织类型添加的 3个值:agency,grid,dept |
||||
|
* @see com.epmet.commons.tools.enums.OrgTypeEnum |
||||
|
*/ |
||||
|
private String fromOrgType; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员是从哪中组织添加的 组织Id |
||||
|
*/ |
||||
|
private String fromOrgId; |
||||
|
|
||||
|
/** |
||||
|
* 角色map key为角色key value 为角色名称 |
||||
|
*/ |
||||
|
private Map<String,String> roleMap; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织的上级组织 |
||||
|
*/ |
||||
|
private IdAndNameDTO parentAgency; |
||||
|
|
||||
|
/** |
||||
|
* 所属网格列表 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> gridList; |
||||
|
|
||||
|
/** |
||||
|
* 所属部门 |
||||
|
*/ |
||||
|
private List<IdAndNameDTO> deptList; |
||||
|
|
||||
|
//特殊处理的 属性 start ==========
|
||||
|
/** |
||||
|
* 2级组织名称 根据添加的来源返回(xx组织-组织/网格/部门) |
||||
|
*/ |
||||
|
private String twoOrgName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 【通讯录】姓名检索工作人员-接口返参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ListStaffResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 7129564173128153335L; |
||||
|
|
||||
|
//工作人员所属组织Id
|
||||
|
private String agencyId = ""; |
||||
|
//工作人员用户id
|
||||
|
private String staffId = ""; |
||||
|
//工作人员姓名
|
||||
|
private String name = ""; |
||||
|
//性别
|
||||
|
private String gender = ""; |
||||
|
//头像
|
||||
|
private String headPhoto = ""; |
||||
|
//手机号
|
||||
|
private String mobile = ""; |
||||
|
//未禁用enable,已禁用disabled
|
||||
|
private String enableFlag = ""; |
||||
|
//人员新增所属组织名【组织-组织,组织-部门,组织-网格】
|
||||
|
private String orgName = ""; |
||||
|
//职责名称列表
|
||||
|
private List<String> roles; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:16 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class RoleListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -9030492894290373999L; |
||||
|
private String roleId; |
||||
|
private String description; |
||||
|
private String roleName; |
||||
|
private String roleKey; |
||||
|
private Integer staffNum; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dataaggre.dto.epmetuser.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:06 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class RoleUsersResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 7109847663910323991L; |
||||
|
private String staffId; |
||||
|
private String name; |
||||
|
private String headPhoto; |
||||
|
private String orgName; |
||||
|
private Integer gender; |
||||
|
private List<String> roles; |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3659371769044867016L; |
||||
|
private String orgId; |
||||
|
private String orgName; |
||||
|
private String orgType; |
||||
|
private Integer staffNum; |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:50 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReceiverDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 7756394210796777416L; |
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String staffName; |
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headPhoto; |
||||
|
/** |
||||
|
* 所属组织目前显示两级 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
/** |
||||
|
* 1:已读;0:未读 |
||||
|
*/ |
||||
|
private Boolean readFlag; |
||||
|
/** |
||||
|
* 1男2女0未知 |
||||
|
*/ |
||||
|
private Integer gender; |
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 【通讯录】组织/部门/网格下人员列表-接口入参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgStaffListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -1974456701949979946L; |
||||
|
/** |
||||
|
* 组织部门网格Id |
||||
|
*/ |
||||
|
@NotBlank(message = "类型Id不能为空", groups = OrgStaffListFormDTO.OrgStaff.class) |
||||
|
private String orgId; |
||||
|
/** |
||||
|
* 类型【组织:agency 部门:dept 网格:grid】 |
||||
|
*/ |
||||
|
@NotBlank(message = "类型不能为空", groups = OrgStaffListFormDTO.OrgStaff.class) |
||||
|
private String orgType; |
||||
|
/** |
||||
|
* 页码,从1开始 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页码必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class) |
||||
|
private Integer pageNo; |
||||
|
/** |
||||
|
* 页容量,默认10页 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "每页条数必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class) |
||||
|
private Integer pageSize = 10; |
||||
|
/** |
||||
|
* 是否包括我(1 是,0 否)默认值1 |
||||
|
*/ |
||||
|
private String includeMe = "1"; |
||||
|
//客户Id
|
||||
|
private String customerId; |
||||
|
//工作人员id集合
|
||||
|
private List<String> staffIds; |
||||
|
//token中用户Id
|
||||
|
private String staffId; |
||||
|
public interface OrgStaff extends CustomerClientShowGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReceiversFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1588067365064394258L; |
||||
|
@NotBlank(message = "消息ID不能为空") |
||||
|
private String infoId; |
||||
|
private Integer pageNo = 1; |
||||
|
private Integer pageSize = 10; |
||||
|
/** |
||||
|
* 1: 已读,0: 未读 |
||||
|
*/ |
||||
|
private String readFlag; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 【通讯录】人员详情v2-接口返参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffDetailV2FormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -1974456701949979946L; |
||||
|
|
||||
|
//工作人员所属组织
|
||||
|
private String agencyId = ""; |
||||
|
//工作人员用户id
|
||||
|
private String staffId = ""; |
||||
|
//工作人员姓名
|
||||
|
private String name = ""; |
||||
|
//性别
|
||||
|
private String gender = ""; |
||||
|
//手机号
|
||||
|
private String mobile = ""; |
||||
|
//头像
|
||||
|
private String headPhoto = ""; |
||||
|
//激活状态:inactive未激活,active已激活
|
||||
|
private String activeFlag = ""; |
||||
|
//激活时间
|
||||
|
private Date activeTime; |
||||
|
//未禁用enable,已禁用disabled
|
||||
|
private String enableFlag = ""; |
||||
|
//fulltime专职parttime兼职
|
||||
|
private String workType = ""; |
||||
|
//人员新增所属组织名【组织-组织,组织-部门,组织-网格】
|
||||
|
private String orgName = ""; |
||||
|
//人员添加类型的Id
|
||||
|
private String orgId = ""; |
||||
|
//人员添加时的类型【agency;dept;grid】
|
||||
|
private String orgType = ""; |
||||
|
//职责名称列表
|
||||
|
private List<String> roles; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SubOrgFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3651225675593357002L; |
||||
|
@NotBlank(message = "组织ID不能为空") |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 是否包括我(1 是,0 否) |
||||
|
*/ |
||||
|
private String includeMe; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 【通讯录】组织/部门/网格下人员列表-接口返参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgStaffListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* 人员总数 |
||||
|
*/ |
||||
|
private Integer staffCount; |
||||
|
/** |
||||
|
* 人员列表 |
||||
|
*/ |
||||
|
private List<ListStaffResultDTO> staffList; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import com.epmet.dataaggre.dto.govorg.ReceiverDTO; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class ReceiversResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 255217078396991037L; |
||||
|
private Integer total; |
||||
|
private List<ReceiverDTO> dataList; |
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 机关单位信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffAgencyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织机构ID |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级组织机构ID(以英文:隔开) |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级名称,以-连接 |
||||
|
*/ |
||||
|
private String allParentName; |
||||
|
|
||||
|
private String parentAgencyName; |
||||
|
|
||||
|
/** |
||||
|
* 机关级别(社区级:community, |
||||
|
乡(镇、街道)级:street, |
||||
|
区县级: district, |
||||
|
市级: city |
||||
|
省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 地区编码 |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
|
||||
|
/** |
||||
|
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 |
||||
|
*/ |
||||
|
private String parentAreaCode; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 【通讯录】人员详情v2-接口返参 |
||||
|
* @Auth sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffDetailV2ResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 工资人员Id |
||||
|
*/ |
||||
|
@NotBlank(message = "人员Id不能为空", groups = StaffDetailV2ResultDTO.Staff.class) |
||||
|
private String staffId; |
||||
|
public interface Staff extends CustomerClientShowGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询工作人员注册组织信息 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffOrgNameResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
//工作人员所属组织Id
|
||||
|
private String agencyId = ""; |
||||
|
//人员Id
|
||||
|
private String staffId = ""; |
||||
|
//人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
|
||||
|
private String orgName = ""; |
||||
|
//工作人员添加入口Id(agencyId;deptId;gridId)
|
||||
|
private String orgId = ""; |
||||
|
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
|
||||
|
private String orgType = ""; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dataaggre.dto.govorg.result; |
||||
|
|
||||
|
import com.epmet.dataaggre.dto.govorg.OrgDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SubOrgResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3080780461845963616L; |
||||
|
private List<OrgDTO> subAgencyList; |
||||
|
private List<OrgDTO> departmentList; |
||||
|
private List<OrgDTO> gridList; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 群组列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 12:54 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoGroupDetailFormDTO extends PageFormDTO implements Serializable { |
||||
|
@NotBlank(message = "群组id不能为空",groups = PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String receiverGroupId; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 通用dto |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 7:48 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoIdDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3852837936492128925L; |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "消息id不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String infoId; |
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息详情页-回复列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 1:42 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoRepliesFormDTO extends PageFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 8001971787502569463L; |
||||
|
@NotBlank(message = "消息id不能为空",groups = PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String infoId; |
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我发出的消息列表查询 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 2:58 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MySentFormDTO extends PageFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2007425752362914036L; |
||||
|
|
||||
|
private String content; |
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,97 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 消息详情 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 7:49 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoDetailResDTO implements Serializable { |
||||
|
private String infoId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人头像 |
||||
|
*/ |
||||
|
private String headPhoto; |
||||
|
|
||||
|
/** |
||||
|
* 发布人id |
||||
|
*/ |
||||
|
private String publishStaffId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人姓名 |
||||
|
*/ |
||||
|
private String publishStaffName; |
||||
|
|
||||
|
/** |
||||
|
* 发布人2级组织名 |
||||
|
*/ |
||||
|
private String publishStaffOrgName; |
||||
|
|
||||
|
/** |
||||
|
* 发布人性别 |
||||
|
*/ |
||||
|
private String publishStaffGender; |
||||
|
|
||||
|
/** |
||||
|
* 是否本人发布,true:是当前用户发布 |
||||
|
*/ |
||||
|
private Boolean isMine; |
||||
|
|
||||
|
/** |
||||
|
* 消息内容完整版 |
||||
|
*/ |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 发送时间 |
||||
|
*/ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date publishTime; |
||||
|
|
||||
|
/** |
||||
|
* 共XX个接收人 |
||||
|
*/ |
||||
|
private Integer totalReceiver; |
||||
|
|
||||
|
/** |
||||
|
* 已读的数量 |
||||
|
*/ |
||||
|
private Integer readTotal; |
||||
|
|
||||
|
/** |
||||
|
* 未读的数量 |
||||
|
*/ |
||||
|
private Integer unReadCount; |
||||
|
|
||||
|
/** |
||||
|
* 第一个接受人的id |
||||
|
*/ |
||||
|
//@JsonIgnore
|
||||
|
private String firstReceiverStaffId; |
||||
|
|
||||
|
/** |
||||
|
* 第一个接受人的姓名 |
||||
|
*/ |
||||
|
private String firstReceiverName; |
||||
|
|
||||
|
/** |
||||
|
* 未读的回复数量 |
||||
|
*/ |
||||
|
private Integer unReadReplyNum; |
||||
|
|
||||
|
/** |
||||
|
* 附件列表 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 群组详情 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 12:58 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoGroupDetailResDTO implements Serializable { |
||||
|
private String receiverGroupId; |
||||
|
private String name; |
||||
|
private List<StaffInfoCommonDTO> staffList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2021/8/20 3:22 下午 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoRedDotResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 6417699657069808978L; |
||||
|
|
||||
|
/** |
||||
|
* 我发出的,新回复数量 |
||||
|
*/ |
||||
|
private Integer sentNewReplyCount = NumConstant.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 我收到的未读的消息数量 |
||||
|
*/ |
||||
|
private Integer receivedUnReadCount = NumConstant.ZERO; |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息-回复详情 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 2:01 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoReplyDetail extends StaffInfoCommonDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -9038141920493410767L; |
||||
|
private String replyId; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date replyTime; |
||||
|
private String content; |
||||
|
/** |
||||
|
* 附件列表 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息-回复列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 2:00 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class InfoReplyResDTO implements Serializable { |
||||
|
private Integer total; |
||||
|
private List<InfoReplyDetail> dataList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我创建的群组列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 10:30 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MyInfoGroupResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3621868560778309056L; |
||||
|
private String receiverGroupId; |
||||
|
private String name; |
||||
|
private Integer staffNum; |
||||
|
@JsonIgnore |
||||
|
private List<String> staffIdList; |
||||
|
private List<String> staffNameList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我收到的消息列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 6:55 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MyReceivedResDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2602131254448130443L; |
||||
|
private String infoId; |
||||
|
private String publishStaffId; |
||||
|
private String publishStaffName; |
||||
|
private String publishStaffOrgName; |
||||
|
private String headPhoto; |
||||
|
private String content; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date publishTime; |
||||
|
/** |
||||
|
* 附件列表 列表默认返回一个 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
private Boolean readFlag; |
||||
|
private String publishStaffGender; |
||||
|
|
||||
|
private String firstAttId; |
||||
|
private Boolean isMine; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我发送的消息列表 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 3:01 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MySentResDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -6765856639039569052L; |
||||
|
private String infoId; |
||||
|
private String content; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date publishTime; |
||||
|
private Integer totalReceiver; |
||||
|
private Integer readTotal; |
||||
|
private String firstAttId; |
||||
|
private Integer unReadReplyNum; |
||||
|
/** |
||||
|
* 附件列表 列表默认返回一个 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dataaggre.dto.message.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 工作人员列表基本信息,通用吧 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 1:02 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StaffInfoCommonDTO implements Serializable { |
||||
|
private String staffId; |
||||
|
private String staffName; |
||||
|
private String gender; |
||||
|
private String orgName; |
||||
|
private String headPhoto; |
||||
|
|
||||
|
} |
||||
|
|
||||
@ -0,0 +1,158 @@ |
|||||
|
package com.epmet.dataaggre.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoIdDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.MySentFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.*; |
||||
|
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:45 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("info") |
||||
|
public class InfoController { |
||||
|
@Resource |
||||
|
private EpmetMessageService epmetMessageService; |
||||
|
|
||||
|
/** |
||||
|
* @Description 已读未读列表 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link Result<ReceiversResultDTO>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:49 |
||||
|
*/ |
||||
|
@PostMapping("receivers") |
||||
|
public Result<ReceiversResultDTO> receivers(@RequestBody ReceiversFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO); |
||||
|
ReceiversResultDTO result = epmetMessageService.getReceiverList(formDTO); |
||||
|
return new Result<ReceiversResultDTO>().ok(result); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我创建的群组列表 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return com.epmet.commons.tools.utils.Result<List<MyInfoGroupResultDTO>> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 10:32 上午 |
||||
|
*/ |
||||
|
@PostMapping("grouplist") |
||||
|
public Result<List<MyInfoGroupResultDTO>> queryMyGroupList(@LoginUser TokenDto tokenDto){ |
||||
|
return new Result<List<MyInfoGroupResultDTO>>().ok(epmetMessageService.queryMyGroupList(tokenDto.getUserId(),tokenDto.getCustomerId())); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-群组详情 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 12:59 下午 |
||||
|
*/ |
||||
|
@PostMapping("groupdetail") |
||||
|
public Result<InfoGroupDetailResDTO> queryGroupDetail(@LoginUser TokenDto tokenDto, @RequestBody InfoGroupDetailFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<InfoGroupDetailResDTO>().ok(epmetMessageService.queryGroupDetail(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-消息详情-回复列表(分页查询) |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoReplyResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:09 下午 |
||||
|
*/ |
||||
|
@PostMapping("replylist") |
||||
|
public Result<InfoReplyResDTO> queryInfoReplies(@LoginUser TokenDto tokenDto,@RequestBody InfoRepliesFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<InfoReplyResDTO>().ok(epmetMessageService.queryInfoReplies(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 【发送消息】我收到、我发送红点 |
||||
|
* @Param userId |
||||
|
* @author zxc |
||||
|
* @date 2021/8/20 3:38 下午 |
||||
|
*/ |
||||
|
@PostMapping("reddot") |
||||
|
public Result<InfoRedDotResultDTO> redDot(@LoginUser TokenDto tokenDto){ |
||||
|
return new Result<InfoRedDotResultDTO>().ok(epmetMessageService.redDot(tokenDto.getUserId())); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我发送的列表 可根据内容搜索 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param mySentFormDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO>> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 3:02 下午 |
||||
|
*/ |
||||
|
@PostMapping("sentlist") |
||||
|
public Result<List<MySentResDTO>> queryMySent(@LoginUser TokenDto tokenDto, @RequestBody MySentFormDTO mySentFormDTO){ |
||||
|
mySentFormDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
mySentFormDTO.setUserId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(mySentFormDTO,PageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<MySentResDTO>>().ok(epmetMessageService.queryMySent(mySentFormDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我收到的列表 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 6:54 下午 |
||||
|
*/ |
||||
|
@PostMapping("receivedlist") |
||||
|
public Result<List<MyReceivedResDTO>> queryMyReceivedList(@LoginUser TokenDto tokenDto, @RequestBody MySentFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<MyReceivedResDTO>>().ok(epmetMessageService.queryMyReceivedList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 消息详情:我收到的,我发送的,通用 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param infoIdDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoDetailResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:57 下午 |
||||
|
*/ |
||||
|
@PostMapping("infodetail") |
||||
|
public Result<InfoDetailResDTO> queryInfoDetail(@LoginUser TokenDto tokenDto,@RequestBody InfoIdDTO infoIdDTO){ |
||||
|
infoIdDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
infoIdDTO.setUserId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(infoIdDTO,InfoIdDTO.AddUserInternalGroup.class); |
||||
|
return new Result<InfoDetailResDTO>().ok(epmetMessageService.queryInfoDetail(infoIdDTO)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,72 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dao.epmetmessage; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.InfoDetailResDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.MyReceivedResDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.MySentResDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetmessage.InfoProfileEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 消息概要表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface InfoProfileDao extends BaseDao<InfoProfileEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 我发出的消息列表 |
||||
|
* |
||||
|
* @param publishStaffId |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 3:46 下午 |
||||
|
*/ |
||||
|
List<MySentResDTO> selectListMySent(@Param("publishStaffId") String publishStaffId,@Param("content") String content); |
||||
|
|
||||
|
/** |
||||
|
* 我收到的消息列表 |
||||
|
* |
||||
|
* @param userId |
||||
|
* @param content |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:01 下午 |
||||
|
*/ |
||||
|
List<MyReceivedResDTO> selectListMyReceived(@Param("userId") String userId, @Param("content") String content); |
||||
|
|
||||
|
/** |
||||
|
* 消息详情 |
||||
|
* |
||||
|
* @param infoId |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:58 下午 |
||||
|
*/ |
||||
|
InfoDetailResDTO selectInfoDetail(String infoId); |
||||
|
|
||||
|
List<FileCommonDTO> selectInfoAtt(String infoId); |
||||
|
} |
||||
@ -0,0 +1,109 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.dao.epmetmessage; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.InfoReplyDetail; |
||||
|
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO; |
||||
|
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 消息接收人记录表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface InfoReceiversDao extends BaseDao<InfoReceiversEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 我创建的群组列表 |
||||
|
* |
||||
|
* @param staffId |
||||
|
* @param customerId |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 10:37 上午 |
||||
|
*/ |
||||
|
List<MyInfoGroupResultDTO> selectMyGroupList(@Param("staffId") String staffId,@Param("customerId") String customerId,@Param("receiverGroupId")String receiverGroupId); |
||||
|
|
||||
|
/** |
||||
|
* 我创建的组内所有的人 |
||||
|
* |
||||
|
* @param staffId |
||||
|
* @param customerId |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 10:46 上午 |
||||
|
*/ |
||||
|
List<String> selectDistinctStaffIds(@Param("staffId") String staffId, |
||||
|
@Param("customerId") String customerId, |
||||
|
@Param("receiverGroupId")String receiverGroupId); |
||||
|
|
||||
|
/** |
||||
|
* 根据小组id,查询群组基本信息 (群组id, 群组名称) |
||||
|
* |
||||
|
* @param receiverGroupId |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:19 下午 |
||||
|
*/ |
||||
|
InfoGroupDetailResDTO selectGroupInfo(String receiverGroupId); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询消息的回复列表 |
||||
|
* |
||||
|
* @param infoId |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.InfoReplyDetail> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:20 下午 |
||||
|
*/ |
||||
|
List<InfoReplyDetail> selectListReply(String infoId); |
||||
|
|
||||
|
/** |
||||
|
* 回复附件 |
||||
|
* |
||||
|
* @param replyId |
||||
|
* @return java.util.List<com.epmet.commons.tools.dto.form.FileCommonDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:31 下午 |
||||
|
*/ |
||||
|
List<FileCommonDTO> selectReplyAtt(String replyId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询我收到的未读的消息数量 |
||||
|
* @Param userId |
||||
|
* @author zxc |
||||
|
* @date 2021/8/20 4:16 下午 |
||||
|
*/ |
||||
|
Integer selectUnReadCount(@Param("userId") String userId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 我发出的,新回复数量 |
||||
|
* @Param userId |
||||
|
* @author zxc |
||||
|
* @date 2021/8/20 4:20 下午 |
||||
|
*/ |
||||
|
Integer selectNewReplyCount(@Param("userId") String userId); |
||||
|
} |
||||
@ -0,0 +1,78 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.entity.epmetmessage; |
||||
|
|
||||
|
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 2021-08-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("info_profile") |
||||
|
public class InfoProfileEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 消息主表的id |
||||
|
*/ |
||||
|
private String infoId; |
||||
|
|
||||
|
/** |
||||
|
* 发布人id |
||||
|
*/ |
||||
|
private String publishStaffId; |
||||
|
|
||||
|
/** |
||||
|
* 内容概要,取前100字 |
||||
|
*/ |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 附件ID,第一个用于展示 |
||||
|
*/ |
||||
|
private String firstAttId; |
||||
|
|
||||
|
/** |
||||
|
* 应读人数 |
||||
|
*/ |
||||
|
private Integer totalReceiver; |
||||
|
|
||||
|
/** |
||||
|
* 已读人数,插入是为0 |
||||
|
*/ |
||||
|
private Integer readTotal; |
||||
|
|
||||
|
/** |
||||
|
* 未读的回复数量:发布人每次查看详情后,置为0;接收人回复一条+1 |
||||
|
*/ |
||||
|
private Integer unReadReplyNum; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
/** |
||||
|
* 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.dataaggre.entity.epmetmessage; |
||||
|
|
||||
|
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 2021-08-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("info_receivers") |
||||
|
public class InfoReceiversEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 消息主表.id |
||||
|
*/ |
||||
|
private String infoId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 已读:1;未读:0 |
||||
|
*/ |
||||
|
private Boolean readFlag; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
package com.epmet.dataaggre.service.epmetmessage; |
||||
|
|
||||
|
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoIdDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.MySentFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
*/ |
||||
|
public interface EpmetMessageService { |
||||
|
/** |
||||
|
* @Description 获取已读未读人员列表 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link ReceiversResultDTO} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:56 |
||||
|
*/ |
||||
|
ReceiversResultDTO getReceiverList(ReceiversFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 我创建的群组列表 |
||||
|
* |
||||
|
* @param staffId |
||||
|
* @param customerId |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 10:33 上午 |
||||
|
*/ |
||||
|
List<MyInfoGroupResultDTO> queryMyGroupList(String staffId, String customerId); |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-群组详情 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 12:59 下午 |
||||
|
*/ |
||||
|
InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-消息详情-回复列表(分页查询) |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:09 下午 |
||||
|
*/ |
||||
|
InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Description 【发送消息】我收到、我发送红点 |
||||
|
* @Param userId |
||||
|
* @author zxc |
||||
|
* @date 2021/8/20 3:38 下午 |
||||
|
*/ |
||||
|
InfoRedDotResultDTO redDot(String userId); |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我发送的列表 可根据内容搜索 |
||||
|
* |
||||
|
* @param mySentFormDTO |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 3:03 下午 |
||||
|
*/ |
||||
|
List<MySentResDTO> queryMySent(MySentFormDTO mySentFormDTO); |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我收到的消息列表 可根据内容搜索 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:00 下午 |
||||
|
*/ |
||||
|
List<MyReceivedResDTO> queryMyReceivedList(MySentFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 消息详情:我收到的,我发送的,通用 |
||||
|
* |
||||
|
* @param infoIdDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:57 下午 |
||||
|
*/ |
||||
|
InfoDetailResDTO queryInfoDetail(InfoIdDTO infoIdDTO); |
||||
|
} |
||||
@ -0,0 +1,276 @@ |
|||||
|
package com.epmet.dataaggre.service.epmetmessage.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.constant.StrConstant; |
||||
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
||||
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
||||
|
import com.epmet.dataaggre.dao.epmetmessage.InfoProfileDao; |
||||
|
import com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao; |
||||
|
import com.epmet.dataaggre.dto.govorg.ReceiverDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO; |
||||
|
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoIdDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.form.MySentFormDTO; |
||||
|
import com.epmet.dataaggre.dto.message.result.*; |
||||
|
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity; |
||||
|
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 15:23 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.EPMET_MESSAGE) |
||||
|
@Slf4j |
||||
|
public class EpmetMessageServiceImpl implements EpmetMessageService { |
||||
|
@Autowired |
||||
|
private InfoReceiversDao infoReceiversDao; |
||||
|
@Autowired |
||||
|
private InfoProfileDao infoProfileDao; |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 获取已读未读人员列表 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link ReceiversResultDTO} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/8/19 14:56 |
||||
|
*/ |
||||
|
@Override |
||||
|
public ReceiversResultDTO getReceiverList(ReceiversFormDTO formDTO) { |
||||
|
ReceiversResultDTO result = new ReceiversResultDTO(); |
||||
|
//检索已读/未读人员列表,并分页
|
||||
|
LambdaQueryWrapper<InfoReceiversEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(InfoReceiversEntity :: getInfoId, formDTO.getInfoId()); |
||||
|
wrapper.eq(StringUtils.isNotBlank(formDTO.getReadFlag()), InfoReceiversEntity :: getReadFlag, Integer.valueOf(formDTO.getReadFlag())); |
||||
|
Page<InfoReceiversEntity> page = new Page<>(formDTO.getPageNo(), formDTO.getPageSize()); |
||||
|
IPage<InfoReceiversEntity> iPage = infoReceiversDao.selectPage(page, wrapper); |
||||
|
List<InfoReceiversEntity> list = iPage.getRecords(); |
||||
|
result.setTotal((int) iPage.getTotal()); |
||||
|
//结果为空,返回
|
||||
|
if (CollectionUtils.isEmpty(list)) { |
||||
|
result.setDataList(Collections.emptyList()); |
||||
|
return result; |
||||
|
} |
||||
|
//构建人员列表
|
||||
|
List<ReceiverDTO> dataList = list.stream().map(item -> { |
||||
|
ReceiverDTO dto = new ReceiverDTO(); |
||||
|
dto.setStaffId(item.getStaffId()); |
||||
|
dto.setReadFlag(item.getReadFlag()); |
||||
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId()); |
||||
|
if (null != staffInfoCache) { |
||||
|
dto.setStaffName(staffInfoCache.getRealName()); |
||||
|
dto.setGender(staffInfoCache.getGender()); |
||||
|
dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); |
||||
|
dto.setOrgName(staffInfoCache.getTwoOrgName()); |
||||
|
} |
||||
|
|
||||
|
return dto; |
||||
|
}).collect(Collectors.toList()); |
||||
|
result.setDataList(dataList); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 我创建的群组列表 |
||||
|
* |
||||
|
* @param staffId |
||||
|
* @param customerId |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 10:33 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MyInfoGroupResultDTO> queryMyGroupList(String staffId, String customerId) { |
||||
|
// 按照小组的创建时间升序,新创建在后面, 显示的人员时按照info_group_receivers 群成员表的主键升序
|
||||
|
List<MyInfoGroupResultDTO> list = infoReceiversDao.selectMyGroupList(staffId, customerId,null); |
||||
|
if (CollectionUtils.isNotEmpty(list)) { |
||||
|
// 2、遍历每个群组,赋值工作人员姓名列表
|
||||
|
for (MyInfoGroupResultDTO group : list) { |
||||
|
List<String> staffNameList = new ArrayList<>(); |
||||
|
for (String userId : group.getStaffIdList()) { |
||||
|
//查询每个工作人员的基本信息,获取姓名
|
||||
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, userId); |
||||
|
if (null != staffInfoCache) { |
||||
|
staffNameList.add(staffInfoCache.getRealName()); |
||||
|
} |
||||
|
} |
||||
|
group.setStaffNameList(staffNameList); |
||||
|
} |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-群组详情 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 12:59 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO) { |
||||
|
InfoGroupDetailResDTO resDTO = infoReceiversDao.selectGroupInfo(formDTO.getReceiverGroupId()); |
||||
|
if (null == resDTO) { |
||||
|
throw new RenException("info_receiver_group dosen't have record"); |
||||
|
} |
||||
|
resDTO.setStaffList(new ArrayList<>()); |
||||
|
//按照info_group_receivers 群成员表的主键升序
|
||||
|
PageInfo<String> staffIds = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectDistinctStaffIds(formDTO.getUserId(), formDTO.getCustomerId(), formDTO.getReceiverGroupId())); |
||||
|
if (CollectionUtils.isNotEmpty(staffIds.getList())) { |
||||
|
for (String userId : staffIds.getList()) { |
||||
|
//查询每个工作人员的基本信息
|
||||
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId); |
||||
|
if (null != staffInfoCache) { |
||||
|
StaffInfoCommonDTO staffInfo = new StaffInfoCommonDTO(); |
||||
|
staffInfo.setStaffId(userId); |
||||
|
staffInfo.setStaffName(staffInfoCache.getRealName()); |
||||
|
staffInfo.setGender(staffInfoCache.getGender().toString()); |
||||
|
staffInfo.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR); |
||||
|
staffInfo.setOrgName(staffInfoCache.getTwoOrgName()); |
||||
|
resDTO.getStaffList().add(staffInfo); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resDTO; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-消息详情-回复列表(分页查询) |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 2:09 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO) { |
||||
|
InfoReplyResDTO result = new InfoReplyResDTO(); |
||||
|
// 按照回复时间降序排列 ,新回复的在最上面
|
||||
|
PageInfo<InfoReplyDetail> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectListReply(formDTO.getInfoId())); |
||||
|
result.setTotal((int) data.getTotal()); |
||||
|
for (InfoReplyDetail detail : data.getList()) { |
||||
|
//查询每个工作人员的基本信息
|
||||
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), detail.getStaffId()); |
||||
|
detail.setStaffName(staffInfoCache.getRealName()); |
||||
|
detail.setGender(staffInfoCache.getGender().toString()); |
||||
|
detail.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR); |
||||
|
detail.setOrgName(staffInfoCache.getTwoOrgName()); |
||||
|
} |
||||
|
result.setDataList(data.getList()); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 【发送消息】我收到、我发送红点 |
||||
|
* 我发出的查询info_profile限制住created_by=当前用户, sum未读的回复数 |
||||
|
* 我收到的info_receivers,并且未读的 count(distinct info_id) |
||||
|
* @Param userId |
||||
|
* @author zxc |
||||
|
* @date 2021/8/20 3:38 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public InfoRedDotResultDTO redDot(String userId) { |
||||
|
InfoRedDotResultDTO result = new InfoRedDotResultDTO(); |
||||
|
result.setReceivedUnReadCount(infoReceiversDao.selectUnReadCount(userId)); |
||||
|
result.setSentNewReplyCount(infoReceiversDao.selectNewReplyCount(userId)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我发送的列表 可根据内容搜索 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 3:03 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MySentResDTO> queryMySent(MySentFormDTO formDTO) { |
||||
|
PageInfo<MySentResDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoProfileDao.selectListMySent(formDTO.getUserId(),formDTO.getContent())); |
||||
|
return data.getList(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发送消息-我收到的消息列表 可根据内容搜索 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO> |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:00 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MyReceivedResDTO> queryMyReceivedList(MySentFormDTO formDTO) { |
||||
|
PageInfo<MyReceivedResDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) |
||||
|
.doSelectPageInfo(() -> infoProfileDao.selectListMyReceived(formDTO.getUserId(),formDTO.getContent())); |
||||
|
for(MyReceivedResDTO resDTO: data.getList()){ |
||||
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), resDTO.getPublishStaffId()); |
||||
|
resDTO.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR); |
||||
|
resDTO.setPublishStaffGender(String.valueOf(staffInfoCache.getGender())); |
||||
|
resDTO.setPublishStaffOrgName(staffInfoCache.getTwoOrgName()); |
||||
|
resDTO.setPublishStaffName(staffInfoCache.getRealName()); |
||||
|
if(resDTO.getPublishStaffId().equals(formDTO.getUserId())){ |
||||
|
resDTO.setIsMine(true); |
||||
|
}else{ |
||||
|
resDTO.setIsMine(false); |
||||
|
} |
||||
|
} |
||||
|
return data.getList(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 消息详情:我收到的,我发送的,通用 |
||||
|
* |
||||
|
* @param infoIdDTO |
||||
|
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO |
||||
|
* @author yinzuomei |
||||
|
* @date 2021/8/20 7:57 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public InfoDetailResDTO queryInfoDetail(InfoIdDTO infoIdDTO) { |
||||
|
InfoDetailResDTO resDTO=infoProfileDao.selectInfoDetail(infoIdDTO.getInfoId()); |
||||
|
if(null!=resDTO){ |
||||
|
if (resDTO.getPublishStaffId().equals(infoIdDTO.getUserId())) { |
||||
|
resDTO.setIsMine(true); |
||||
|
} else { |
||||
|
resDTO.setIsMine(false); |
||||
|
} |
||||
|
resDTO.setAttachmentList(infoProfileDao.selectInfoAtt(infoIdDTO.getInfoId())); |
||||
|
if(StringUtils.isNotBlank(resDTO.getPublishStaffId())){ |
||||
|
CustomerStaffInfoCacheResult publisher = CustomerStaffRedis.getStaffInfo(infoIdDTO.getCustomerId(), resDTO.getPublishStaffId()); |
||||
|
resDTO.setHeadPhoto(StringUtils.isNotBlank(publisher.getHeadPhoto()) ? publisher.getHeadPhoto() : StrConstant.EPMETY_STR); |
||||
|
resDTO.setPublishStaffOrgName(publisher.getTwoOrgName()); |
||||
|
resDTO.setPublishStaffGender(publisher.getGender().toString()); |
||||
|
resDTO.setPublishStaffName(publisher.getRealName()); |
||||
|
} |
||||
|
if(StringUtils.isNotBlank(resDTO.getFirstReceiverStaffId())){ |
||||
|
CustomerStaffInfoCacheResult first = CustomerStaffRedis.getStaffInfo(infoIdDTO.getCustomerId(), resDTO.getFirstReceiverStaffId()); |
||||
|
resDTO.setFirstReceiverName(first.getRealName()); |
||||
|
} |
||||
|
} |
||||
|
return resDTO; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,145 @@ |
|||||
|
<?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.dataaggre.dao.epmetmessage.InfoProfileDao"> |
||||
|
|
||||
|
<resultMap id="MySentResDTOMap" type="com.epmet.dataaggre.dto.message.result.MySentResDTO"> |
||||
|
<id property="infoId" column="id" /> |
||||
|
<result property="content" column="content"/> |
||||
|
<result property="publishTime" column="CREATED_TIME"/> |
||||
|
<result property="totalReceiver" column="total_receiver"/> |
||||
|
<result property="readTotal" column="read_total"/> |
||||
|
<result property="firstAttId" column="first_att_id"/> |
||||
|
<result property="unReadReplyNum" column="UN_READ_REPLY_NUM"></result> |
||||
|
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" > |
||||
|
<result property="name" column="name"/> |
||||
|
<result property="url" column="url"/> |
||||
|
<result property="type" column="type"/> |
||||
|
<result property="format" column="format"/> |
||||
|
<result property="size" column="size"/> |
||||
|
<result property="duration" column="duration"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
|
||||
|
<!-- 我发出的消息列表--> |
||||
|
<select id="selectListMySent" parameterType="map" resultMap="MySentResDTOMap"> |
||||
|
select |
||||
|
i.id, |
||||
|
ip.content, |
||||
|
i.CREATED_TIME, |
||||
|
ip.total_receiver, |
||||
|
ip.read_total, |
||||
|
ip.first_att_id, |
||||
|
ip.UN_READ_REPLY_NUM, |
||||
|
ia.ATTACHMENT_NAME AS name, |
||||
|
ia.ATTACHMENT_FORMAT AS format, |
||||
|
ia.ATTACHMENT_TYPE AS type, |
||||
|
ia.ATTACHMENT_URL AS url, |
||||
|
(case when ip.first_att_id is null or ip.first_att_id='' then null |
||||
|
else ia.ATTACHMENT_SIZE |
||||
|
end) as size, |
||||
|
(case when ip.first_att_id is null or ip.first_att_id='' then null |
||||
|
else ia.duration |
||||
|
end) as duration |
||||
|
from info_profile ip |
||||
|
inner join info i |
||||
|
on(ip.INFO_ID=i.id) |
||||
|
left join info_att ia |
||||
|
on(ip.first_att_id=ia.id and ia.DEL_FLAG='0') |
||||
|
where ip.DEL_FLAG='0' |
||||
|
and i.DEL_FLAG='0' |
||||
|
and i.publish_staff_id=#{publishStaffId} |
||||
|
<if test="null != content and content !=''"> |
||||
|
and i.content like concat('%',trim(#{content}),'%') |
||||
|
</if> |
||||
|
order by i.CREATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
<resultMap id="MyReceivedResDTOMap" type="com.epmet.dataaggre.dto.message.result.MyReceivedResDTO"> |
||||
|
<id property="infoId" column="INFO_ID" /> |
||||
|
<result property="content" column="content"/> |
||||
|
<result property="publishTime" column="CREATED_TIME"/> |
||||
|
<result property="firstAttId" column="first_att_id"/> |
||||
|
<result property="readFlag" column="READ_FLAG"/> |
||||
|
<result property="publishStaffId" column="publish_staff_id"></result> |
||||
|
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" > |
||||
|
<result property="name" column="name"/> |
||||
|
<result property="url" column="url"/> |
||||
|
<result property="type" column="type"/> |
||||
|
<result property="format" column="format"/> |
||||
|
<result property="size" column="size"/> |
||||
|
<result property="duration" column="duration"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
<select id="selectListMyReceived" parameterType="map" resultMap="MyReceivedResDTOMap"> |
||||
|
SELECT |
||||
|
ir.INFO_ID, |
||||
|
ip.content, |
||||
|
ip.CREATED_TIME, |
||||
|
ir.READ_FLAG, |
||||
|
ip.publish_staff_id, |
||||
|
ip.first_att_id, |
||||
|
ia.ATTACHMENT_NAME AS name, |
||||
|
ia.ATTACHMENT_FORMAT AS format, |
||||
|
ia.ATTACHMENT_TYPE AS type, |
||||
|
ia.ATTACHMENT_URL AS url, |
||||
|
(case when ip.first_att_id is null or ip.first_att_id='' then null |
||||
|
else ia.ATTACHMENT_SIZE |
||||
|
end) as size, |
||||
|
(case when ip.first_att_id is null or ip.first_att_id='' then null |
||||
|
else ia.duration |
||||
|
end) as duration |
||||
|
FROM |
||||
|
info_receivers ir |
||||
|
<if test="null != content and content !=''"> |
||||
|
INNER JOIN info ii ON ( ir.INFO_ID = ii.ID ) |
||||
|
</if> |
||||
|
INNER JOIN info_profile ip ON ( ir.INFO_ID = ip.INFO_ID AND ip.DEL_FLAG = '0' ) |
||||
|
LEFT JOIN info_att ia on ( ip.first_att_id = ia.id AND ia.DEL_FLAG = '0' ) |
||||
|
WHERE |
||||
|
ir.DEL_FLAG = '0' |
||||
|
AND ir.STAFF_ID = #{userId} |
||||
|
<if test="null != content and content !=''"> |
||||
|
AND ii.DEL_FLAG = '0' |
||||
|
and ii.content like concat('%',trim(#{content}),'%') |
||||
|
</if> |
||||
|
ORDER BY |
||||
|
ip.CREATED_TIME DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectInfoDetail" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.message.result.InfoDetailResDTO"> |
||||
|
select |
||||
|
ii.id as infoId, |
||||
|
ii.publish_staff_id as publishStaffId, |
||||
|
ii.content, |
||||
|
ii.CREATED_TIME as publishTime, |
||||
|
ip.total_receiver as totalReceiver, |
||||
|
ip.read_total as readTotal, |
||||
|
ip.total_receiver-ip.read_total as unReadCount, |
||||
|
( |
||||
|
select ir.STAFF_ID from info_receivers ir |
||||
|
where ir.INFO_ID=#{infoId} |
||||
|
and ir.DEL_FLAG='0' |
||||
|
order by ir.id asc limit 1 |
||||
|
) as firstReceiverStaffId, |
||||
|
ip.UN_READ_REPLY_NUM as unReadReplyNum |
||||
|
from info ii |
||||
|
inner join info_profile ip |
||||
|
on(ii.id=ip.INFO_ID) |
||||
|
where ii.DEL_FLAG='0' |
||||
|
and ii.ID=#{infoId} |
||||
|
</select> |
||||
|
<select id="selectInfoAtt" parameterType="java.lang.String" resultType="com.epmet.commons.tools.dto.form.FileCommonDTO"> |
||||
|
select |
||||
|
ia.ATTACHMENT_NAME AS name, |
||||
|
ia.ATTACHMENT_FORMAT AS format, |
||||
|
ia.ATTACHMENT_TYPE AS type, |
||||
|
ia.ATTACHMENT_URL AS url, |
||||
|
ia.ATTACHMENT_SIZE as size, |
||||
|
ia.duration |
||||
|
from info_att ia |
||||
|
where ia.info_id=#{infoId} |
||||
|
and ia.DEL_FLAG = '0' |
||||
|
order by ia.sort asc |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,136 @@ |
|||||
|
<?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.dataaggre.dao.epmetmessage.InfoReceiversDao"> |
||||
|
|
||||
|
<resultMap id="MyInfoGroupResultDTOMap" type="com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO"> |
||||
|
<id property="receiverGroupId" column="receiverGroupId" /> |
||||
|
<result property="name" column="name"/> |
||||
|
<result property="staffNum" column="staffNum"/> |
||||
|
<collection property="staffIdList" ofType="java.lang.String"> |
||||
|
<result column="staffId"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
<!-- 我创建的群组列表 --> |
||||
|
<select id="selectMyGroupList" parameterType="map" resultMap="MyInfoGroupResultDTOMap"> |
||||
|
SELECT |
||||
|
irg.ID as receiverGroupId, |
||||
|
irg.`NAME` as name, |
||||
|
( SELECT count( igr.id ) FROM info_group_receivers igr WHERE igr.DEL_FLAG = '0' AND igr.info_receiver_group_id = irg.id ) AS staffNum, |
||||
|
igr.STAFF_ID as staffId |
||||
|
FROM |
||||
|
info_receiver_group irg |
||||
|
left join info_group_receivers igr |
||||
|
on(irg.id=igr.info_receiver_group_id and igr.DEL_FLAG='0') |
||||
|
WHERE |
||||
|
irg.del_flag='0' |
||||
|
AND irg.CREATE_STAFF_ID = #{staffId} |
||||
|
AND irg.CUSTOMER_ID = #{customerId} |
||||
|
<if test="null != receiverGroupId and receiverGroupId !=''"> |
||||
|
and irg.id=#{receiverGroupId} |
||||
|
</if> |
||||
|
order by irg.CREATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
<!-- 我创建的组内所有的人 --> |
||||
|
<select id="selectDistinctStaffIds" parameterType="map" resultType="java.lang.String"> |
||||
|
SELECT DISTINCT |
||||
|
igr.STAFF_ID |
||||
|
FROM |
||||
|
info_group_receivers igr |
||||
|
LEFT JOIN info_receiver_group irg ON ( igr.info_receiver_group_id = irg.id ) |
||||
|
WHERE |
||||
|
igr.DEL_FLAG = '0' |
||||
|
AND igr.CUSTOMER_ID = #{customerId} |
||||
|
AND irg.DEL_FLAG = '0' |
||||
|
AND irg.CUSTOMER_ID = #{customerId} |
||||
|
AND irg.CREATE_STAFF_ID = #{staffId} |
||||
|
<if test="null != receiverGroupId and receiverGroupId !=''"> |
||||
|
AND irg.id =#{receiverGroupId} |
||||
|
</if> |
||||
|
order by igr.id asc |
||||
|
</select> |
||||
|
|
||||
|
<!-- 根据小组id,查询群组基本信息 --> |
||||
|
<select id="selectGroupInfo" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO"> |
||||
|
SELECT |
||||
|
irg.ID as receiverGroupId, |
||||
|
irg.`NAME` as name |
||||
|
FROM |
||||
|
info_receiver_group irg |
||||
|
where irg.id=#{receiverGroupId} |
||||
|
and irg.DEL_FLAG = '0' |
||||
|
</select> |
||||
|
|
||||
|
<resultMap id="InfoReplyDetailMap" type="com.epmet.dataaggre.dto.message.result.InfoReplyDetail"> |
||||
|
<id property="replyId" column="id" /> |
||||
|
<result property="replyTime" column="CREATED_TIME"/> |
||||
|
<result property="staffId" column="FROM_USER_ID"/> |
||||
|
<result property="content" column="content"></result> |
||||
|
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" column="id" select="com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao.selectReplyAtt"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<!-- 分页查询消息的回复列表 --> |
||||
|
<select id="selectListReply" parameterType="java.lang.String" resultMap="InfoReplyDetailMap"> |
||||
|
SELECT |
||||
|
ir.id, |
||||
|
ir.CREATED_TIME, |
||||
|
ir.FROM_USER_ID, |
||||
|
( SELECT IFNULL( ipc.CONTENT, '' ) FROM info_reply_content ipc WHERE ipc.REPLY_TYPE = 'text' AND ipc.INFO_REPLY_ID = ir.id and ipc.DEL_FLAG='0') AS content |
||||
|
FROM |
||||
|
info_reply ir |
||||
|
WHERE |
||||
|
ir.DEL_FLAG = '0' |
||||
|
AND ir.INFO_ID = #{infoId} |
||||
|
ORDER BY |
||||
|
ir.CREATED_TIME DESC, |
||||
|
ir.id DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectReplyAtt" parameterType="java.lang.String" resultType="com.epmet.commons.tools.dto.form.FileCommonDTO"> |
||||
|
SELECT |
||||
|
m.ATTACHMENT_NAME as name, |
||||
|
( |
||||
|
case when m.ATTACHMENT_NAME is null or m.ATTACHMENT_NAME='' then null |
||||
|
else m.ATTACHMENT_SIZE |
||||
|
end |
||||
|
) as size, |
||||
|
M.ATTACHMENT_FORMAT as format, |
||||
|
M.REPLY_TYPE as `type`, |
||||
|
m.CONTENT as url, |
||||
|
( |
||||
|
case when m.ATTACHMENT_NAME is null or m.ATTACHMENT_NAME='' then null |
||||
|
else m.DURATION |
||||
|
end |
||||
|
)as duration |
||||
|
FROM |
||||
|
info_reply_content m |
||||
|
WHERE |
||||
|
m.DEL_FLAG = '0' |
||||
|
AND m.INFO_REPLY_ID = #{replyId} |
||||
|
AND m.REPLY_TYPE != 'text' |
||||
|
ORDER BY |
||||
|
m.SORT ASC |
||||
|
</select> |
||||
|
|
||||
|
<!-- 查询我收到的未读的消息数量 --> |
||||
|
<select id="selectUnReadCount" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
IFNULL(COUNT(INFO_ID),0) |
||||
|
FROM info_receivers |
||||
|
WHERE |
||||
|
DEL_FLAG = '0' |
||||
|
AND STAFF_ID = #{userId} |
||||
|
AND READ_FLAG = 0 |
||||
|
</select> |
||||
|
|
||||
|
<!-- 我发出的,新回复数量 --> |
||||
|
<select id="selectNewReplyCount" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
IFNULL(SUM(UN_READ_REPLY_NUM) ,0) |
||||
|
FROM info_profile |
||||
|
WHERE |
||||
|
DEL_FLAG = '0' |
||||
|
AND CREATED_BY = #{userId} |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.constant; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author yinzuomei |
||||
|
* @dscription |
||||
|
* @date 2021/08/27 14:22 |
||||
|
*/ |
||||
|
public interface UserMessageTypeConstant { |
||||
|
|
||||
|
//上传下达
|
||||
|
/** |
||||
|
* 工作端发送消息,通知接收人 |
||||
|
*/ |
||||
|
String INFO="info"; |
||||
|
|
||||
|
/** |
||||
|
* 居民端提交热心居民申请,通知网格长 |
||||
|
*/ |
||||
|
String WARMHEARTED_APPLY="warmhearted_apply"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息-新增群组 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 9:39 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AddReceiverGroupFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 6221853016790893895L; |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
public interface AddUserShowGroup extends CustomerClientShowGroup { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "名称不能为空",groups = AddUserShowGroup.class) |
||||
|
@Length(min = 1,max = 20,groups = AddUserShowGroup.class,message = "名称最多输入20个字") |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 单独选择的人的userId集合 |
||||
|
*/ |
||||
|
private Set<String> staffIdList; |
||||
|
/** |
||||
|
* 按架构选择的,组织或者网格或者部门的集合 |
||||
|
*/ |
||||
|
private Set<OrgCommonDTO> orgList; |
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 从架构通用dto |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 10:00 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgCommonDTO implements Serializable { |
||||
|
private String orgId; |
||||
|
private String orgType; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我收到的,列表有红点的,点击消息,调用此接口 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 4:58 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReadInfoFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "infoId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String infoId; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 我发出的,发布人点击详情后,阅读回复,将未读回复数置为0 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 5:49 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReadReplyFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 1315143292245373474L; |
||||
|
|
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "infoId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String infoId; |
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,43 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 回复消息 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 5:18 下午 |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
public class ReplyInfoFormDTO implements Serializable { |
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "infoId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class) |
||||
|
private String infoId; |
||||
|
|
||||
|
private String content; |
||||
|
/** |
||||
|
* 附件列表 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,69 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.FileCommonDTO; |
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息入参DTO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 9:52 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SendInfoFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3668230349576949684L; |
||||
|
|
||||
|
public interface AddUserInternalGroup { |
||||
|
} |
||||
|
|
||||
|
public interface AddUserShowGroup extends CustomerClientShowGroup { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 消息内容,不能超过100,不可为空 |
||||
|
*/ |
||||
|
@NotBlank(message = "消息内容不能为空",groups = AddUserShowGroup.class) |
||||
|
@Length(min = 1, max = 1000, message = "消息内容最多输入1000字", groups = AddUserShowGroup.class) |
||||
|
private String content; |
||||
|
/** |
||||
|
* 单独选择的人的userId集合 |
||||
|
*/ |
||||
|
private Set<String> staffIdList; |
||||
|
/** |
||||
|
* 按架构选择的,组织或者网格或者部门的集合 |
||||
|
*/ |
||||
|
private Set<OrgCommonDTO> orgList; |
||||
|
/** |
||||
|
* 按职责选择时,角色的id集合 |
||||
|
*/ |
||||
|
private Set<String> roleIdList; |
||||
|
/** |
||||
|
* 按群组选择时,群组的id集合 |
||||
|
*/ |
||||
|
private Set<String> groupIdList; |
||||
|
/** |
||||
|
* 附件列表 |
||||
|
*/ |
||||
|
private List<FileCommonDTO> attachmentList; |
||||
|
|
||||
|
|
||||
|
//以下参数从token中获取
|
||||
|
/** |
||||
|
* 当前用户id |
||||
|
*/ |
||||
|
@NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户id |
||||
|
*/ |
||||
|
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) |
||||
|
private String customerId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 添加小组返参 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 9:56 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AddReceiverGroupResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 4729777797252376046L; |
||||
|
private String receiverGroupId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 回复消息返参 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/20 9:51 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ReplyInfoResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -634463925415755405L; |
||||
|
private String replyId; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 发送消息返参DTO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2021/8/19 10:20 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SendInfoResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3339252317982375852L; |
||||
|
private String infoId; |
||||
|
} |
||||
|
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue