Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_temp

dev_shibei_match
yinzuomei 4 years ago
parent
commit
39f834c363
  1. 40
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupTypeListResultDTO.java
  2. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentController.java
  3. 18
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupSetupController.java
  4. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupSetupDao.java
  5. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupSetupService.java
  6. 30
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupSetupServiceImpl.java
  7. 14
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupSetupDao.xml

40
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupTypeListResultDTO.java

@ -0,0 +1,40 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
public class GroupTypeListResultDTO {
/**
* 专用小组
*/
private List<SetUp> dedicatedGroup;
/**
* 常用小组
*/
private List<SetUp> commonUsedGroup;
@NoArgsConstructor
@Data
public static class SetUp {
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 默认头像地址
*/
private String defaultGroupHead;
/**
* 小组介绍
*/
private String introduction;
/**
* 小组名称
*/
private String groupTypeName;
}
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentController.java

@ -17,7 +17,6 @@
package com.epmet.modules.act.controller;
import com.baomidou.mybatisplus.extension.api.R;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -27,10 +26,7 @@ import com.epmet.resi.group.dto.act.form.CommentFormDTO;
import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO;
import com.epmet.resi.group.dto.act.result.CommentResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
@ -59,7 +55,7 @@ public class ActCommentController {
@PostMapping("submit")
public Result submitComment(@LoginUser TokenDto tokenDto, @RequestBody CommentFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCommentContent(tokenDto.getCustomerId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,CommentFormDTO.AddUserShowGroup.class,CommentFormDTO.AddUserInternalGroup.class);
actCommentService.submitComment(formDTO);
return new Result();

18
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupSetupController.java

@ -17,8 +17,17 @@
package com.epmet.modules.group.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.group.service.ResiGroupSetupService;
import com.epmet.resi.group.dto.group.result.GroupTypeListResultDTO;
import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
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;
@ -37,4 +46,13 @@ public class ResiGroupSetupController {
private ResiGroupSetupService resiGroupSetupService;
/**
* @Author sun
* @Description 创建小组选择组类型
**/
@PostMapping(value = "grouptypelist")
public Result<GroupTypeListResultDTO> groupTypeList(@LoginUser TokenDto tokenDto){
return new Result<GroupTypeListResultDTO>().ok(resiGroupSetupService.groupTypeList());
}
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupSetupDao.java

@ -19,7 +19,11 @@ package com.epmet.modules.group.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
import com.epmet.resi.group.dto.group.result.GroupTypeListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 建组设置
@ -30,4 +34,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ResiGroupSetupDao extends BaseDao<ResiGroupSetupEntity> {
/**
* @Author sun
* @Description 创建小组选择组类型
**/
List<GroupTypeListResultDTO.SetUp> selectGroupList(@Param("customerId") String customerId);
}

7
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupSetupService.java

@ -19,6 +19,7 @@ package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
import com.epmet.resi.group.dto.group.result.GroupTypeListResultDTO;
/**
* 建组设置
@ -28,4 +29,10 @@ import com.epmet.modules.group.entity.ResiGroupSetupEntity;
*/
public interface ResiGroupSetupService extends BaseService<ResiGroupSetupEntity> {
/**
* @Author sun
* @Description 创建小组选择组类型
**/
GroupTypeListResultDTO groupTypeList();
}

30
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupSetupServiceImpl.java

@ -22,9 +22,13 @@ import com.epmet.modules.group.dao.ResiGroupSetupDao;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
import com.epmet.modules.group.redis.ResiGroupSetupRedis;
import com.epmet.modules.group.service.ResiGroupSetupService;
import com.epmet.resi.group.dto.group.result.GroupTypeListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 建组设置
*
@ -37,4 +41,30 @@ public class ResiGroupSetupServiceImpl extends BaseServiceImpl<ResiGroupSetupDao
@Autowired
private ResiGroupSetupRedis resiGroupSetupRedis;
/**
* @Author sun
* @Description 创建小组选择组类型
**/
@Override
public GroupTypeListResultDTO groupTypeList() {
GroupTypeListResultDTO resultDTO = new GroupTypeListResultDTO();
List<GroupTypeListResultDTO.SetUp> dedicatedGroup = new ArrayList<>();
List<GroupTypeListResultDTO.SetUp> commonUsedGroup = new ArrayList<>();
//初期所有客户共用一套建组设置,客户Id为default,后边可以根据token用户所属客户查询
List<GroupTypeListResultDTO.SetUp> list = baseDao.selectGroupList("default");
list.forEach(l -> {
if ("ordinary".equals(l.getGroupType())) {
commonUsedGroup.add(l);
} else if ("branch".equals(l.getGroupType())) {
dedicatedGroup.add(l);
}
});
resultDTO.setCommonUsedGroup(commonUsedGroup);
resultDTO.setDedicatedGroup(dedicatedGroup);
return resultDTO;
}
}

14
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupSetupDao.xml

@ -1,7 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiGroupSetupDao">
<mapper namespace="com.epmet.modules.group.dao.ResiGroupSetupDao">
<select id="selectGroupList" resultType="com.epmet.resi.group.dto.group.result.GroupTypeListResultDTO$SetUp">
SELECT
GROUP_TYPE AS 'groupType',
LOGO AS 'defaultGroupHead',
`DESCRIBE` AS 'introduction',
`NAME` AS 'groupTypeName'
FROM
resi_group_setup
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>
Loading…
Cancel
Save