Browse Source

prod,redis

zyh
小久哥 3 years ago
parent
commit
51a987670c
  1. 1
      yudao-server/src/main/resources/application-prod.yaml
  2. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/discuss/dto/DiscussDTO.java
  3. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaService.java
  4. 28
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java
  5. 13
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java

1
yudao-server/src/main/resources/application-prod.yaml

@ -74,6 +74,7 @@ spring:
host: 127.0.0.1 # 地址
port: 6379 # 端口
database: 15 # 数据库索引
password: guozinengliang
--- #################### 定时任务相关配置 ####################

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/discuss/dto/DiscussDTO.java

@ -29,4 +29,6 @@ public class DiscussDTO extends DiscussDO {
private List<WorkUserMsgDTO> workList;
private List<String> areaNameList;
}

7
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaService.java

@ -5,6 +5,8 @@ import javax.validation.*;
import cn.iocoder.yudao.module.farm.controller.admin.area.vo.*;
import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.JsonArray;
/**
* Service 接口
@ -67,4 +69,9 @@ public interface AreaService {
*/
List<AreaDO> getAreaList(AreaExportReqVO exportReqVO);
/**
* 根据区域 返回区域信息List
**/
public List<String> findAreaName(List<AreaDO> areaList, JSONArray areaArray);
}

28
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/area/AreaServiceImpl.java

@ -1,5 +1,8 @@
package cn.iocoder.yudao.module.farm.service.area;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.JsonArray;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -79,4 +82,29 @@ public class AreaServiceImpl implements AreaService {
return areaMapper.selectList(exportReqVO);
}
/**
* 根据区域 返回区域信息List
**/
public List<String> findAreaName(List<AreaDO> areaList, JSONArray areaArray){
List<String> areaNameList = new ArrayList<>();
JSONArray array = JSONArray.parseArray(areaArray.toString());
Long areaParent = Long.valueOf(String.valueOf(array.get(0)));
Long areaSon = Long.valueOf(String.valueOf(array.get(1)));
StringBuilder areaName = new StringBuilder();
for (AreaDO areaDO : areaList) {
if (areaDO.getId().equals(areaParent)){
areaName.append(areaDO.getName());
}
if (areaDO.getId().equals(areaSon)){
areaName.append(areaDO.getName());
}
}
if (ObjectUtil.isNotEmpty(areaName)){
areaNameList.add(areaName.toString());
}
return areaNameList;
}
}

13
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java

@ -10,8 +10,11 @@ import cn.iocoder.yudao.module.farm.controller.admin.discuss.dto.DiscussPageDTO;
import cn.iocoder.yudao.module.farm.controller.admin.project.dto.ProjectListDTO;
import cn.iocoder.yudao.module.farm.controller.admin.workHour.dto.WorkUserMsgDTO;
import cn.iocoder.yudao.module.farm.controller.admin.workHour.vo.WorkHourBaseVO;
import cn.iocoder.yudao.module.farm.dal.dataobject.area.AreaDO;
import cn.iocoder.yudao.module.farm.dal.dataobject.workHour.WorkHourDO;
import cn.iocoder.yudao.module.farm.dal.mysql.area.AreaMapper;
import cn.iocoder.yudao.module.farm.dal.mysql.workHour.WorkHourMapper;
import cn.iocoder.yudao.module.farm.service.area.AreaService;
import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper;
@ -52,6 +55,10 @@ public class DiscussServiceImpl implements DiscussService {
private AdminUserMapper adminUserMapper;
@Resource
private WorkHourMapper workHourMapper;
@Resource
private AreaService areaService;
@Resource
private AreaMapper areaMapper;
@Override
public Long createDiscuss(DiscussCreateReqVO createReqVO) {
@ -124,10 +131,11 @@ public class DiscussServiceImpl implements DiscussService {
List<String> userNameList = adminUserList.stream().map(AdminUserDO::getUsername).collect(Collectors.toList());
//企业用户
List<CpUserDO> cpUserList = cpUserMapper.selectList(Wrappers.<CpUserDO>lambdaQuery());
//工时List
List<Long> workIdList = discussList.stream().map(DiscussDO::getId).collect(Collectors.toList());
List<WorkHourDO> workHourList = workHourMapper.selectList(Wrappers.<WorkHourDO>lambdaQuery().in(WorkHourDO::getProjectId, workIdList));
//全部区域List
List<AreaDO> areaList = areaMapper.selectList();
// key 系统用户id value cpUser
Map<Long, CpUserDO> map = new HashMap<>();
@ -157,6 +165,9 @@ public class DiscussServiceImpl implements DiscussService {
}
}
discussDTO.setWorkList(workUserMsgList);
List<String> areaNameList = areaService.findAreaName(areaList, discussDTO.getAreas());
discussDTO.setAreaNameList(areaNameList);
}
PageVO<DiscussDTO> returnList = PageUtil.convertPageInfo(discussDTOList);
return R.success(returnList);

Loading…
Cancel
Save