Browse Source

修改grouptypelist接口,优先查询当前客户,如果当前客户没有配置,默认查询default。

master
yinzuomei 4 years ago
parent
commit
cced40e2f6
  1. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupSetupController.java
  2. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupSetupService.java
  3. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupSetupServiceImpl.java

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

@ -20,14 +20,10 @@ 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;
@ -52,7 +48,7 @@ public class ResiGroupSetupController {
**/
@PostMapping(value = "grouptypelist")
public Result<GroupTypeListResultDTO> groupTypeList(@LoginUser TokenDto tokenDto){
return new Result<GroupTypeListResultDTO>().ok(resiGroupSetupService.groupTypeList());
return new Result<GroupTypeListResultDTO>().ok(resiGroupSetupService.groupTypeList(tokenDto.getCustomerId()));
}
}

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

@ -34,5 +34,5 @@ public interface ResiGroupSetupService extends BaseService<ResiGroupSetupEntity>
* @Author sun
* @Description 创建小组选择组类型
**/
GroupTypeListResultDTO groupTypeList();
GroupTypeListResultDTO groupTypeList(String customerId);
}

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

@ -18,11 +18,13 @@
package com.epmet.modules.group.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.modules.constant.GroupActConstant;
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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -47,13 +49,16 @@ public class ResiGroupSetupServiceImpl extends BaseServiceImpl<ResiGroupSetupDao
* @Description 创建小组选择组类型
**/
@Override
public GroupTypeListResultDTO groupTypeList() {
public GroupTypeListResultDTO groupTypeList(String customerId) {
if(StringUtils.isBlank(customerId)){
customerId= GroupActConstant.DEFAULT_CUSTOMER_ID;
}
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<GroupTypeListResultDTO.SetUp> list = baseDao.selectGroupList(customerId);
list.forEach(l -> {
if ("ordinary".equals(l.getGroupType())) {
commonUsedGroup.add(l);

Loading…
Cancel
Save