Browse Source

Merge branch 'dev'

master
zxc 4 years ago
parent
commit
58b63eddb0
  1. 21
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java
  2. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java
  3. 93
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  4. 142
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java
  5. 116
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java
  6. 10
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
  7. 31
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  8. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  9. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  10. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  11. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  12. 49
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java
  13. 38
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java
  14. 76
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java
  15. 28
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java
  16. 80
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java
  17. 56
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java
  18. 10
      epmet-module/data-report/data-report-server/pom.xml
  19. 124
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  20. 31
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  21. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  22. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java
  23. 26
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  24. 179
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  25. BIN
      epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx
  26. BIN
      epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx
  27. 54
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
  28. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  29. 26
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml
  30. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
  31. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java
  32. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java
  33. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
  34. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java
  35. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
  36. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  37. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  38. 58
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  39. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  40. 77
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java
  41. 76
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java
  42. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java
  43. 33
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java
  44. 33
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java
  45. 48
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java
  46. 72
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java
  47. 31
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java
  48. 31
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java
  49. 36
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java
  50. 10
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java
  51. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java
  52. 48
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java
  53. 9
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml

21
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java

@ -2,11 +2,14 @@ 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.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
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;
import org.springframework.web.bind.annotation.RequestParam;
/**
@ -24,4 +27,22 @@ public interface CommonAggFeignClient {
*/
@PostMapping("/data/aggregator/epmetuser/getStaffInfo/{staffId}")
Result<CustomerStaffInfoCache> getStaffInfo(@PathVariable("staffId") String staffId);
/**
* @Description 查询组织信息
* @param agencyId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("/data/aggregator/org/agency")
Result<AgencyInfoCache> getAgencyInfo(@RequestParam("agencyId")String agencyId);
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("/data/aggregator/org/grid")
Result<GridInfoCache> getGridInfo(@RequestParam("gridId")String gridId);
}

12
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java

@ -2,7 +2,9 @@ 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.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import org.springframework.stereotype.Component;
@ -20,4 +22,14 @@ public class CommonAggFeignClientFallback implements CommonAggFeignClient {
public Result<CustomerStaffInfoCache> getStaffInfo(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getStaffInfo", staffId);
}
@Override
public Result<AgencyInfoCache> getAgencyInfo(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getAgencyInfo", agencyId);
}
@Override
public Result<GridInfoCache> getGridInfo(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId);
}
}

93
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -0,0 +1,93 @@
package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
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.*;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j;
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 zxc
* @DateTime 2021/11/5 2:29 下午
* @DESC
*/
@Slf4j
@Component
public class CustomerOrgRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private CommonAggFeignClient commonAggFeignClient;
private static CustomerOrgRedis customerOrgRedis;
private static final String ROLE_MAP_KEY = "roleMap";
@PostConstruct
public void init() {
customerOrgRedis = this;
customerOrgRedis.redisUtils = this.redisUtils;
customerOrgRedis.commonAggFeignClient = this.commonAggFeignClient;
}
/**
* @Description 获取网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 3:12 下午
*/
public static GridInfoCache getGridInfo(String gridId){
String key = RedisKeys.getGridInfoKey(gridId);
Map<String, Object> grid = customerOrgRedis.redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(grid)) {
return ConvertUtils.mapToEntity(grid, GridInfoCache.class);
}
Result<GridInfoCache> gridInfoResult = customerOrgRedis.commonAggFeignClient.getGridInfo(gridId);
if (!gridInfoResult.success()){
throw new RenException("查询网格信息失败...");
}
if (null == gridInfoResult.getData()){
throw new RenException("没有此网格信息...");
}
Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map);
return gridInfoResult.getData();
}
/**
* @Description 获取组织信息
* @param agencyId
* @author zxc
* @date 2021/11/5 3:12 下午
*/
public static AgencyInfoCache getAgencyInfo(String agencyId){
String key = RedisKeys.getAgencyByIdKey(agencyId);
Map<String, Object> agency = customerOrgRedis.redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(agency)) {
return ConvertUtils.mapToEntity(agency, AgencyInfoCache.class);
}
Result<AgencyInfoCache> agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId);
if (!agencyInfoResult.success()){
throw new RenException("查询组织信息失败...");
}
if (null == agencyInfoResult.getData()){
throw new RenException("没有此组织信息...");
}
Map<String, Object> map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map);
return agencyInfoResult.getData();
}
}

142
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java

@ -0,0 +1,142 @@
package com.epmet.commons.tools.redis.common.bean;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2021/11/5 2:45 下午
* @DESC
*/
@Data
public class AgencyInfoCache implements Serializable {
private static final long serialVersionUID = -1332373159954084159L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 上级组织机构ID
*/
private String pid;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
private String pids;
/**
* 所有上级名称,-连接
*/
private String allParentName;
/**
* 组织名称
*/
private String organizationName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String level;
/**
* 地区编码
*/
private String areaCode;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 总人数
*/
private Integer totalUser;
/**
*
*/
private String province;
/**
*
*/
private String city;
/**
* 区县
*/
private String district;
/**
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 街道
*/
private String street;
/**
* 社区
*/
private String community;
/**
* 坐标区域
*/
private String coordinates;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

116
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java

@ -0,0 +1,116 @@
package com.epmet.commons.tools.redis.common.bean;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2021/11/5 2:24 下午
* @DESC
*/
@Data
public class GridInfoCache implements Serializable {
private static final long serialVersionUID = -6159429894486235267L;
/**
* ID 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格名称
*/
private String gridName;
/** 组织-网格 */
private String gridNamePath;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 所属地区码所属组织地区码
*/
private String areaCode;
/**
* 删除标识:0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 管辖区域
*/
private String manageDistrict;
/**
* 当前网格总人数
*/
private Integer totalUser;
/**
* 所属组织机构IDcustomer_organization.id
*/
private String pid;
/**
* 所有上级组织ID
*/
private String pids;
/**
* 所属组织机构名
*/
private String agencyName;
/**
* 所有上级组织名
*/
private String allParentName;
/**
* 坐标区域
*/
private String coordinates;
}

10
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java

@ -59,6 +59,11 @@ public class CustomerGridDTO implements Serializable {
*/
private String latitude;
/**
* 坐标区域
*/
private String coordinates;
/**
* 所属地区码所属组织地区码
*/
@ -123,4 +128,9 @@ public class CustomerGridDTO implements Serializable {
* 所有上级组织名
*/
private String allParentName;
/**
* 组织-网格
*/
private String gridNamePath;
}

31
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -9,18 +9,19 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
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.ArrayList;
import java.util.List;
@ -178,4 +179,26 @@ public class GovOrgController {
return new Result<List<OrgTreeResultDTO>>().ok(govOrgService.getAgencyTree(tokenDto, formDTO));
}
/**
* @Description 查询组织信息
* @param agencyId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("agency")
public Result<CustomerAgencyEntity> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyEntity>().ok(govOrgService.getAgencyInfo(agencyId));
}
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@PostMapping("grid")
public Result<CustomerGridDTO> getGridInfo(@RequestParam("gridId")String gridId){
return new Result<CustomerGridDTO>().ok(govOrgService.getGridInfo(gridId));
}
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java

@ -76,4 +76,12 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
**/
List<StaffAgencyGridListResultDTO.GridResultDTO> getGridListByAgencyId(@Param("agencyId") String agencyId);
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 3:39 下午
*/
CustomerGridDTO getGridInfo(@Param("gridId") String gridId);
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -10,6 +10,8 @@ import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import java.util.List;
@ -154,4 +156,20 @@ public interface GovOrgService {
* @Date 2021/9/23 10:14
*/
List<String> getStaffOrgList(String staffId);
/**
* @Description 查询组织信息
* @param agencyId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
CustomerAgencyEntity getAgencyInfo(String agencyId);
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 2:57 下午
*/
CustomerGridDTO getGridInfo(String gridId);
}

23
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -20,6 +20,7 @@ import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dataaggre.service.commonservice.AreaCodeService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -532,4 +533,26 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerAgencyDao.getOrgList(staffId);
}
/**
* @Description 查询组织信息
* @param agencyId
* @author zxc
* @date 2021/11/5 2:54 下午
*/
@Override
public CustomerAgencyEntity getAgencyInfo(String agencyId) {
return customerAgencyDao.selectById(agencyId);
}
/**
* @Description 查询网格信息
* @param gridId
* @author zxc
* @date 2021/11/5 2:57 下午
*/
@Override
public CustomerGridDTO getGridInfo(String gridId) {
return customerGridDao.getGridInfo(gridId);
}
}

12
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -163,4 +163,16 @@
AND cg.pid = #{agencyId}
</select>
<!-- 查询网格信息 -->
<select id="getGridInfo" resultType="com.epmet.dataaggre.dto.govorg.CustomerGridDTO">
SELECT
ca.ORGANIZATION_NAME AS agencyName,
CONCAT(ca.ORGANIZATION_NAME,'-',cg.GRID_NAME) AS gridNamePath,
cg.*
FROM customer_grid cg
LEFT JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.DEL_FLAG = '0')
WHERE cg.DEL_FLAG = '0'
AND cg.ID = #{gridId}
</select>
</mapper>

49
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java

@ -0,0 +1,49 @@
package com.epmet.project.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/4 3:23 下午
* @DESC
*/
@Data
public class CategoryProjectListFormDTO extends ProjectCategoryFormDTO implements Serializable {
private static final long serialVersionUID = -5448734274886241594L;
public interface CategoryProjectListForm{}
@NotNull(message = "pageSize不能为空",groups = CategoryProjectListForm.class)
private Integer pageSize;
@NotNull(message = "pageNo不能为空",groups = CategoryProjectListForm.class)
private Integer pageNo;
/**
* 项目状态closed已结案all全部
*/
@NotNull(message = "status不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class})
private String status;
@NotNull(message = "categoryCode不能为空",groups = {CategoryProjectListForm.class, CategoryProjectExportForm.class})
private String categoryCode;
@NotNull(message = "categoryName不能为空",groups = CategoryProjectExportForm.class)
private String categoryName;
private String parentCategoryName;
/**
* 组织ID
*/
private String orgId;
/**
* 是否分页默认truefalse的时候 给导出用
*/
private Boolean isPage = true;
}

38
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.project.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/4 3:18 下午
* @DESC
*/
@Data
public class ProjectCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 5047143743629810527L;
public interface ProjectCategoryForm{}
public interface CategoryProjectExportForm {}
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型 组织agency网格grid
*/
private String orgType;
@NotBlank(message = "结束时间不能为空",groups = {ProjectCategoryForm.class,CategoryProjectExportForm.class})
private String endTime;
/**
* 开始时间
*/
private String startTime;
}

76
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java

@ -0,0 +1,76 @@
package com.epmet.project.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/4 3:31 下午
* @DESC
*/
@Data
public class CategoryProjectListResultDTO implements Serializable {
private static final long serialVersionUID = 8820354423099062062L;
/**
* 分类
*/
private String category;
/**
* 项目状态:待处理 pending结案closed
*/
private String projectStatus;
/**
* 项目标题
*/
private String projectTitle;
/**
* 网格
*/
private String gridName;
/**
* 项目创建时间
*/
private String createTime;
/**
* 项目ID
*/
private String projectId;
/**
* 上报人
*/
private String linkName;
/**
* 上报人电话
*/
private String linkMobile;
/**
* 事件地址
*/
private String projectAddress;
@JsonIgnore
private String orgId;
@JsonIgnore
private String orgType;
public CategoryProjectListResultDTO() {
this.category = "";
this.projectStatus = "";
this.projectTitle = "";
this.gridName = "";
this.createTime = "";
}
}

28
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.project.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/5 1:51 下午
* @DESC
*/
@Data
public class PageCategoryProjectListResultDTO implements Serializable {
private static final long serialVersionUID = 8822993169364931502L;
private Integer total;
private List<CategoryProjectListResultDTO> list;
public PageCategoryProjectListResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
}

80
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java

@ -0,0 +1,80 @@
package com.epmet.project.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/4 3:13 下午
* @DESC
*/
@Data
public class ProjectCategoryResultDTO implements Serializable {
private static final long serialVersionUID = -2662970383306349424L;
/**
* 分类CODE
*/
private String categoryCode;
/**
* 分类code父级
*/
private String parentCategoryCode;
/**
* 分类名字
*/
private String categoryName;
/**
* 分类名字父级
*/
private String parentCategoryName;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 结案项目数
*/
private Integer closedProjectTotal;
/**
* 所有项目总数
*/
private Integer allProjectTotal;
/**
* 总数占比
*/
private String totalRatio;
/**
* 结案率
*/
private String closedRatio;
private List<ProjectCategoryResultDTO> children;
@JsonIgnore
private int index;
public ProjectCategoryResultDTO() {
this.categoryCode = "";
this.categoryName = "";
this.projectTotal = NumConstant.ZERO;
this.closedProjectTotal = NumConstant.ZERO;
this.totalRatio = "0.00%";
this.closedRatio = "0.00%";
this.children = new ArrayList<>();
this.allProjectTotal = NumConstant.ZERO;
}
}

56
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.project.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/11/4 3:13 下午
* @DESC
*/
@Data
public class ProjectCategorySonResultDTO implements Serializable {
private static final long serialVersionUID = -2662970383306349424L;
/**
* 分类CODE
*/
private String categoryCode;
/**
* 分类名字
*/
private String categoryName;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 结案项目数
*/
private Integer closedProjectTotal;
/**
* 总数占比
*/
private String totalRatio;
/**
* 结案率
*/
private String closedRatio;
public ProjectCategorySonResultDTO() {
this.categoryCode = "";
this.categoryName = "";
this.projectTotal = NumConstant.ZERO;
this.closedProjectTotal = NumConstant.ZERO;
this.totalRatio = "";
this.closedRatio = "";
}
}

10
epmet-module/data-report/data-report-server/pom.xml

@ -116,6 +116,16 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>

124
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -1,5 +1,13 @@
package com.epmet.datareport.controller.screen;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService;
@ -12,13 +20,25 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.project.dto.form.CategoryProjectListFormDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.form.ProjectCategoryFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import com.epmet.project.dto.result.PageCategoryProjectListResultDTO;
import com.epmet.project.dto.result.ProjectCategoryResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 项目
@ -155,4 +175,108 @@ public class ScreenProjectController {
return new Result<List<CategoryTopAppealResultDTO>>().ok(screenProjectService.categoryTopAppeal(formDTO));
}
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
@PostMapping("selectprojectcategory")
public Result<List<ProjectCategoryResultDTO>> selectProjectCategory(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.ProjectCategoryForm.class);
return new Result<List<ProjectCategoryResultDTO>>().ok(screenProjectService.selectProjectCategory(formDTO,tokenDto));
}
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
@PostMapping("selectprojectcategory/export")
public void selectProjectCategoryExport(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class);
List<ProjectCategoryResultDTO> data = screenProjectService.selectProjectCategory(formDTO, tokenDto);
String templatePath = "excel/project_category_temp.xlsx";
List<ProjectCategoryResultDTO> resultDTOList = new ArrayList<>();
data.forEach(e->{
resultDTOList.add(e);
e.setIndex(1);
resultDTOList.addAll(ConvertUtils.sourceToTarget(e.getChildren(),ProjectCategoryResultDTO.class));
});
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
Map<String,Object> mapData = new HashMap<>();
mapData.put("list",resultDTOList);
mapData.put("orgName",staffInfo.getAgencyName());
mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime()));
Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目分类统计.xls", "UTF-8"));
workbook.write(response.getOutputStream());
}
/**
* @Description 项目分类查询分类下的项目
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:39 下午
*/
@PostMapping("selectcategoryprojectlist")
public Result<PageCategoryProjectListResultDTO> selectCategoryProjectList(@RequestBody CategoryProjectListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, CategoryProjectListFormDTO.CategoryProjectListForm.class);
return new Result<PageCategoryProjectListResultDTO>().ok(screenProjectService.selectCategoryProjectList(formDTO,tokenDto));
}
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
@PostMapping("selectcategoryprojectlist/export")
public void selectProjectCategoryExport(@RequestBody CategoryProjectListFormDTO formDTO,@LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
formDTO.setIsPage(false);
//formDTO.setStatus("all");
//formDTO.setCategoryCode("0102");
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class);
PageCategoryProjectListResultDTO data = screenProjectService.selectCategoryProjectList(formDTO,tokenDto);
String templatePath = "excel/project_temp.xlsx";
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
Map<String,Object> mapData = new HashMap<>();
mapData.put("list",data.getList());
mapData.put("orgName",staffInfo.getAgencyName());
mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime()));
mapData.put("categoryName", formDTO.getCategoryName());
if (StringUtils.isNotBlank(formDTO.getParentCategoryName())){
mapData.put("categoryName", formDTO.getParentCategoryName().concat(StrConstant.HYPHEN).concat(formDTO.getCategoryName()));
}
Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目统计.xls", "UTF-8"));
workbook.write(response.getOutputStream());
}
@NotNull
private String getExportDateStr(String startTime,String endTime) {
StringBuilder dateBuilder = new StringBuilder();
if (StringUtils.isNotBlank(startTime)) {
dateBuilder.append(startTime).append(StrConstant.HYPHEN);
}
if (StringUtils.isNotBlank(endTime)) {
dateBuilder.append(endTime);
}
return dateBuilder.toString();
}
}

31
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java

@ -19,7 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.project.CustomerProjectCategoryDTO;
import com.epmet.project.dto.form.ProjectCategoryFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import com.epmet.project.dto.result.ProjectCategoryResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +54,33 @@ public interface ScreenProjectCategoryOrgDailyDao {
* @date 2021/8/18 1:40 下午
*/
List<CategoryTopAppealResultDTO> categoryTopAppeal(@Param("agencyId") String agencyId,@Param("customerId")String customerId,@Param("topCount")Integer topCount);
/**
* @Description 组织查询分类
* @param customerId
* @param time
* @param orgId
* @author zxc
* @date 2021/11/5 8:54 上午
*/
List<ProjectCategoryResultDTO> selectProjectCategoryByAgency(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId);
/**
* @Description 网格查询分类
* @param customerId
* @param time
* @param orgId
* @author zxc
* @date 2021/11/5 8:55 上午
*/
List<ProjectCategoryResultDTO> selectProjectCategoryByGrid(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId);
/**
* @Description 查询客户下所有分类
* @param customerId
* @author zxc
* @date 2021/11/4 5:45 下午
*/
List<ProjectCategoryResultDTO> selectCategoryByCustomerId(@Param("customerId")String customerId);
}

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -3,6 +3,7 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.ColorProjectTotalResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.project.dto.result.CategoryProjectListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -45,4 +46,15 @@ public interface ScreenProjectDataDao {
* @date 2021/6/1 3:48 下午
*/
List<ColorProjectTotalResultDTO> selectColorProjectByAreaCode(@Param("areaCode") String areaCode,@Param("monthCount")Integer monthCount);
/**
* @Description 查询分类下的项目列表
* @param customerId
* @param orgId
* @author zxc
* @date 2021/11/5 1:40 下午
*/
List<CategoryProjectListResultDTO> selectCategoryProjectList(@Param("customerId") String customerId,@Param("orgId") String orgId,
@Param("categoryCode")String categoryCode,@Param("status")String status);
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO;
import com.epmet.dto.result.screen.ProjectQuantityResultDTO;
import com.epmet.project.dto.form.ProjectCategoryFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -45,4 +46,9 @@ public interface ScreenProjectOrgDailyDao {
* @description 下级组织的效率解决率列表
**/
List<EfficiencyAnalysisResultDTO> queryEfficiencyAnalysis(@Param("customerId")String customerId,@Param("areaCode") String areaCode);
Integer selectProjectTotalByAgency(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId);
Integer selectProjectTotalByGrid(@Param("customerId")String customerId,@Param("time")String time,@Param("orgId")String orgId);
}

26
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
@ -10,8 +11,13 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.project.dto.form.CategoryProjectListFormDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.form.ProjectCategoryFormDTO;
import com.epmet.project.dto.result.CategoryProjectListResultDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import com.epmet.project.dto.result.PageCategoryProjectListResultDTO;
import com.epmet.project.dto.result.ProjectCategoryResultDTO;
import java.util.List;
@ -62,4 +68,24 @@ public interface ScreenProjectService {
*/
List<CategoryTopAppealResultDTO> categoryTopAppeal(CategoryTopAppealFormDTO formDTO);
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
List<ProjectCategoryResultDTO> selectProjectCategory(ProjectCategoryFormDTO formDTO, TokenDto tokenDto);
/**
* @Description 项目分类查询分类下的项目
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:39 下午
*/
PageCategoryProjectListResultDTO selectCategoryProjectList(CategoryProjectListFormDTO formDTO, TokenDto tokenDto);
}

179
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -3,14 +3,18 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.AppClientConstant;
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.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.UserDTO;
import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO;
@ -26,15 +30,21 @@ import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.project.CustomerProjectCategoryDTO;
import com.epmet.project.dto.form.CategoryProjectListFormDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import com.epmet.project.dto.form.ProjectCategoryFormDTO;
import com.epmet.project.dto.result.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -63,6 +73,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Autowired
private ScreenProjectOrgDailyDao screenProjectOrgDailyDao;
/**
* @Description 3项目详情
* @param projectDetailFormDTO
@ -228,4 +241,160 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
}
return result;
}
/**
* @Description 项目分类查询项目分类
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:38 下午
*/
@Override
public List<ProjectCategoryResultDTO> selectProjectCategory(ProjectCategoryFormDTO formDTO, TokenDto tokenDto) {
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new RenException("未查询到此工作人员的所属组织信息...");
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(FactConstant.AGENCY);
}
String customerId = tokenDto.getCustomerId();
String endTime = formDTO.getEndTime();
String startTime = formDTO.getStartTime();
String orgId = formDTO.getOrgId();
// 查询客户下的所有分类
List<ProjectCategoryResultDTO> result = screenProjectCategoryOrgDailyDao.selectCategoryByCustomerId(tokenDto.getCustomerId());
List<ProjectCategoryResultDTO> endCategoryList = new ArrayList<>();
if (formDTO.getOrgType().equals(FactConstant.GRID)){
Integer endTotal = screenProjectOrgDailyDao.selectProjectTotalByGrid(customerId, endTime, orgId);
endTotal = null == endTotal ? NumConstant.ZERO : endTotal;
endCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByGrid(customerId,endTime,orgId);
Integer total = endTotal;
if (StringUtils.isNotBlank(startTime)){
Integer startTotal = screenProjectOrgDailyDao.selectProjectTotalByGrid(customerId, startTime, orgId);
startTotal = null == startTotal ? NumConstant.ZERO : startTotal;
total = endTotal - startTotal;
List<ProjectCategoryResultDTO> startCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByGrid(customerId,startTime,orgId);
endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setProjectTotal(subtract(e.getProjectTotal(),s.getProjectTotal()))));
endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setClosedProjectTotal(subtract(e.getClosedProjectTotal(),s.getClosedProjectTotal()))));
}
Integer finalTotal = total;
endCategoryList.forEach(e -> {
e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal));
e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal()));
e.setAllProjectTotal(finalTotal);
});
}else {
Integer endTotal = screenProjectOrgDailyDao.selectProjectTotalByAgency(customerId, endTime, orgId);
endTotal = null == endTotal ? NumConstant.ZERO : endTotal;
endCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByAgency(customerId,endTime,orgId);
Integer total = endTotal;
if (StringUtils.isNotBlank(startTime)){
Integer startTotal = screenProjectOrgDailyDao.selectProjectTotalByAgency(customerId, startTime, orgId);
startTotal = null == startTotal ? NumConstant.ZERO : startTotal;
total = endTotal - startTotal;
List<ProjectCategoryResultDTO> startCategoryList = screenProjectCategoryOrgDailyDao.selectProjectCategoryByAgency(customerId,startTime,orgId);
endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setProjectTotal(subtract(e.getProjectTotal(),s.getProjectTotal()))));
endCategoryList.forEach(e -> startCategoryList.stream().filter(s -> e.getCategoryCode().equals(s.getCategoryCode())).forEach(s -> e.setClosedProjectTotal(subtract(e.getClosedProjectTotal(),s.getClosedProjectTotal()))));
}
Integer finalTotal = total;
endCategoryList.forEach(e -> {
e.setTotalRatio(ratio(e.getProjectTotal(), finalTotal));
e.setClosedRatio(ratio(e.getClosedProjectTotal(),e.getProjectTotal()));
e.setAllProjectTotal(finalTotal);
});
}
List<ProjectCategoryResultDTO> finalEndCategoryList = endCategoryList;
result.forEach(r -> {
finalEndCategoryList.stream().filter(e -> r.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> {
r.setTotalRatio(e.getTotalRatio());r.setClosedRatio(e.getClosedRatio());
r.setProjectTotal(e.getProjectTotal());
r.setClosedProjectTotal(e.getClosedProjectTotal());
r.setAllProjectTotal(e.getAllProjectTotal());
});
r.getChildren().forEach(son -> finalEndCategoryList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> {
son.setTotalRatio(e.getTotalRatio());son.setClosedRatio(e.getClosedRatio());
son.setProjectTotal(e.getProjectTotal());son.setClosedProjectTotal(e.getClosedProjectTotal());
son.setAllProjectTotal(e.getAllProjectTotal());
}));
});
// 排序
List<ProjectCategoryResultDTO> collect = result.stream().sorted(Comparator.comparing(ProjectCategoryResultDTO::getProjectTotal).reversed()).collect(Collectors.toList());
collect.forEach(c -> {
c.setChildren(c.getChildren().stream().sorted(Comparator.comparing(ProjectCategoryResultDTO::getProjectTotal).reversed()).collect(Collectors.toList()));
});
return collect;
}
/**
* @Description 俩数相减小于0就赋值为0
* @param end
* @param start
* @author zxc
* @date 2021/11/5 9:18 上午
*/
public Integer subtract(Integer end,Integer start){
return end - start < NumConstant.ZERO ? NumConstant.ZERO : end - start;
}
/**
* @Description 返回占比,保留小数点2位
* @param molecule 分子
* @param denominator 分母
* @author zxc
* @date 2021/11/5 9:26 上午
*/
public String ratio(Integer molecule, Integer denominator){
if (denominator == NumConstant.ZERO){
return "0.00%";
}
BigDecimal bigDecimalMolecule = new BigDecimal(molecule * NumConstant.ONE_HUNDRED);
BigDecimal bigDecimalDenominator = new BigDecimal(denominator);
BigDecimal divide = bigDecimalMolecule.divide(bigDecimalDenominator, NumConstant.TWO, BigDecimal.ROUND_HALF_UP);
return divide+"%";
}
/**
* @Description 项目分类查询分类下的项目
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/11/4 3:39 下午
*/
@Override
public PageCategoryProjectListResultDTO selectCategoryProjectList(CategoryProjectListFormDTO formDTO, TokenDto tokenDto) {
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new RenException("未查询到此工作人员的所属组织信息...");
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(FactConstant.AGENCY);
}
PageCategoryProjectListResultDTO result = new PageCategoryProjectListResultDTO();
List<CategoryProjectListResultDTO> list;
if (formDTO.getIsPage()){
PageInfo<CategoryProjectListResultDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> screenProjectDataDao.selectCategoryProjectList(tokenDto.getCustomerId(), formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus()));
list = objectPageInfo.getList();
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal())));
}else {
list = screenProjectDataDao.selectCategoryProjectList(tokenDto.getCustomerId(), formDTO.getOrgId(), formDTO.getCategoryCode(), formDTO.getStatus());
}
if (!CollectionUtils.isEmpty(list)){
list.forEach(l -> {
if (l.getOrgType().equals(FactConstant.AGENCY)){
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(l.getOrgId());
l.setGridName(agencyInfo.getOrganizationName());
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getOrgId());
l.setGridName(gridInfo.getGridNamePath());
}
});
}
result.setList(list);
return result;
}
}

BIN
epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx

Binary file not shown.

BIN
epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx

Binary file not shown.

54
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -63,4 +63,58 @@
AND DATE_ID = (select date_id from screen_project_category_org_daily where del_flag = '0' and ORG_ID = #{agencyId} and CUSTOMER_ID= #{customerId} order by date_id desc, created_time desc limit 1)
ORDER BY PROJECT_TOTAL DESC LIMIT #{topCount}
</select>
<!-- 组织查询分类 -->
<select id="selectProjectCategoryByAgency" resultType="com.epmet.project.dto.result.ProjectCategoryResultDTO">
SELECT
co.CATEGORY_CODE,
co.PROJECT_TOTAL,
co.CLOSED_PROJECT_TOTAL
FROM screen_project_category_org_daily co
WHERE co.DEL_FLAG = '0'
AND co.ORG_ID = #{orgId}
AND co.CUSTOMER_ID = #{customerId}
AND co.DATE_ID = #{time}
</select>
<!-- 网格查询分类 -->
<select id="selectProjectCategoryByGrid" resultType="com.epmet.project.dto.result.ProjectCategoryResultDTO">
SELECT
co.CATEGORY_CODE,
co.PROJECT_TOTAL,
co.CLOSED_PROJECT_TOTAL
FROM screen_project_category_grid_daily co
WHERE co.DEL_FLAG = '0'
AND co.GRID_ID = #{orgId}
AND co.CUSTOMER_ID = #{customerId}
AND co.DATE_ID = #{time}
</select>
<!-- 查询客户下所有分类 -->
<resultMap id="selectCategoryByCustomerIdMap" type="com.epmet.project.dto.result.ProjectCategoryResultDTO">
<result column="c" property="categoryCode"/>
<result column="n" property="categoryName"/>
<result column="pc1" property="parentCategoryCode"/>
<collection property="children" ofType="com.epmet.project.dto.result.ProjectCategoryResultDTO">
<result column="c2" property="categoryCode"/>
<result column="n2" property="categoryName"/>
<result column="pc2" property="parentCategoryCode"/>
<result column="n" property="parentCategoryName"/>
</collection>
</resultMap>
<select id="selectCategoryByCustomerId" resultMap="selectCategoryByCustomerIdMap">
SELECT
p1.CATEGORY_CODE AS c,
p2.CATEGORY_CODE AS c2,
p1.CATEGORY_NAME AS n,
p2.CATEGORY_NAME AS n2,
p1.PARENT_CATEGORY_CODE AS pc1,
p2.PARENT_CATEGORY_CODE AS pc2
FROM customer_project_category_dict p1,customer_project_category_dict p2
WHERE p1.DEL_FLAG = '0'
AND p2.DEL_FLAG = '0'
AND p1.CUSTOMER_ID = #{customerId}
AND p2.CUSTOMER_ID = #{customerId}
AND p1.CATEGORY_CODE = p2.PARENT_CATEGORY_CODE
</select>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -158,4 +158,28 @@
AND UNIX_TIMESTAMP(pd.CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL #{monthCount} MONTH))
)
</select>
<!-- 查询分类下的项目列表 -->
<select id="selectCategoryProjectList" resultType="com.epmet.project.dto.result.CategoryProjectListResultDTO">
SELECT
ALL_CATEGORY_NAME AS category,
CASE WHEN PROJECT_STATUS_CODE = 'closed_case' THEN 'closed' ELSE PROJECT_STATUS_CODE END AS projectStatus,
IFNULL(PROJECT_TITLE,'') AS projectTitle,
DATE_FORMAT(PROJECT_CREATE_TIME,'%Y-%m-%d %h:%i:%s') AS createTime,
ORG_ID,
ORG_TYPE,
PROJECT_ID,
LINK_NAME,
LINK_MOBILE,
PROJECT_ADDRESS
FROM screen_project_data
WHERE DEL_FLAG = '0'
<if test=' status == "closed" '>
AND PROJECT_STATUS_CODE IN ('closed_case','closed')
</if>
AND CONCAT(ALL_PARENT_IDS,':',ORG_ID) LIKE CONCAT('%',#{orgId},'%')
AND CATEGORY_CODE LIKE CONCAT('%',#{categoryCode},'%')
AND CUSTOMER_ID = #{customerId}
ORDER BY PROJECT_CREATE_TIME DESC
</select>
</mapper>

26
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml

@ -54,4 +54,30 @@
)and m.CUSTOMER_ID=#{customerId}
order by resolvedRatio+0 desc
</select>
<!-- 查询项目总数组织 -->
<select id="selectProjectTotalByAgency" resultType="java.lang.Integer">
SELECT
PROJECT_TOTAL
FROM
screen_project_org_daily
WHERE
del_flag = '0'
AND ORG_ID = #{orgId}
AND DATE_ID = #{time}
AND CUSTOMER_ID = #{customerId}
</select>
<!-- 查询项目总数网格 -->
<select id="selectProjectTotalByGrid" resultType="java.lang.Integer">
SELECT
PROJECT_TOTAL
FROM
screen_project_grid_daily
WHERE
del_flag = '0'
AND grid_id = #{orgId}
AND DATE_ID = #{time}
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java

@ -132,4 +132,8 @@ public class ScreenProjectDataInfoFormDTO implements Serializable {
* 满意度得分
*/
private BigDecimal satisfactionScore;
/**
* 项目创建人
*/
private String projectCreator;
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java

@ -14,6 +14,7 @@ import com.epmet.constant.SystemMessageType;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -160,7 +161,7 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently
type = SystemMessageType.PROJECT_EDIT;
}
DisputeProcessMQMsg msg = new DisputeProcessMQMsg(customerId, msgObj.getProjectId(), type);
//SpringContextUtils.getBean(ScreenProjectDataService.class).sendProjectChangeMq(msg);
SpringContextUtils.getBean(ScreenProjectDataService.class).sendProjectChangeMq(msg);
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【RocketMQ】消费项目变动消息失败:",e);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java

@ -195,7 +195,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl<ScreenProj
agencyInfos.forEach(a -> {
a.setDateId(dateId);
projectOrgDaily.forEach(p -> {
if (a.getAreaCode().equals(p.getAreaCode())){
if (a.getOrgId().equals(p.getOrgId())){
a.setBadTotal(p.getBadTotal() + a.getBadTotal());
a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal());
a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal());

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -208,7 +208,7 @@
AND (cd.EPMET_CATEGORY_CODE IS NULL OR cd.EPMET_CATEGORY_CODE = '')
</if>
AND cd.EPMET_CATEGORY_CODE != ''
AND pd.PROJECT_STATUS_CODE = 'closed'
AND pd.PROJECT_STATUS_CODE IN ('closed','closed_case')
AND pd.ALL_PARENT_IDS LIKE CONCAT('%',(SELECT AGENCY_ID FROM screen_customer_agency WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} AND PID = '0'),'%')
AND DATE_FORMAT(pd.project_create_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY categoryCode

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java

@ -41,6 +41,9 @@ public class AgencyResultDTO implements Serializable {
* 机关组织名称
*/
private String agencyName = "";
private String pid;
private String level;
/**
* 所有上级组织机构ID(以英文:隔开)
*/

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java

@ -24,6 +24,8 @@ public class AgencyTreeResultDTO implements Serializable {
private String agencyName;
private String pid;
private String level;
/**
* 下级机关组织
*/

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -325,7 +325,7 @@ public class CustomerAgencyController {
}
/**
* @Description 获取客户下组织树
* @Description 获取客户下组织树不含网格和部门
* @Param tokenDTO
* @Return {@link Result< AgencyTreeResultDTO >}
* @Author zhaoqifeng
@ -339,4 +339,16 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getAgencyList(formDTO));
}
/**
* @Description 获取当前登陆人的 所属组织及下级组织/网格含直属网格
* @Param tokenDTO
* @Return {@link Result< AgencyTreeResultDTO >}
* @Author zhaoqifeng
* @Date 2021/9/8 15:20
*/
@PostMapping("agencygridtree")
public Result<AgencyTreeResultDTO> getOrgTreeData(@LoginUser TokenDto tokenDTO) {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId()));
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -19,7 +19,6 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
@ -255,4 +254,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2021/9/8 15:21
*/
AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO);
/**
* desc:获取用户所属组织的组织及网格树
* @param staffId
* @return
*/
AgencyTreeResultDTO getOrgTreeData(String staffId);
}

58
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -16,7 +16,6 @@
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -1107,6 +1106,63 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return agency;
}
@Override
public AgencyTreeResultDTO getOrgTreeData(String staffId) {
AgencyTreeResultDTO result = new AgencyTreeResultDTO();
//1.查询工作人员所属组织信息
AgencyResultDTO rootAgency = baseDao.selectAgencyByStaffId(staffId);
if (null == rootAgency) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
}
result.setPid(rootAgency.getPid());
result.setAgencyName(rootAgency.getAgencyName());
result.setAgencyId(rootAgency.getAgencyId());
result.setLevel(rootAgency.getLevel());
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId());
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList());
return result;
}
/**
* 递归查询子节点
* @param root 根节点
* @param all 所有节点
* @return 根节点信息
*/
private void convert2AgencyTreeResult(AgencyTreeResultDTO root, List<ExtStaffPermissionResultDTO> agencyList, List<ExtGridResultDTO> gridList) {
try {
for (ExtStaffPermissionResultDTO agency : agencyList) {
AgencyTreeResultDTO resultDTO = new AgencyTreeResultDTO();
resultDTO.setAgencyId(agency.getAgencyId());
resultDTO.setAgencyName(agency.getAgencyName());
resultDTO.setPid(root.getAgencyId());
resultDTO.setLevel(agency.getLevel());
if (root.getSubAgencyList() == null) {
root.setSubAgencyList(new ArrayList<>());
}
root.getSubAgencyList().add(resultDTO);
if (CollectionUtils.isNotEmpty(agency.getSubAgencyList()) || CollectionUtils.isNotEmpty(agency.getGridList())) {
convert2AgencyTreeResult(resultDTO, agency.getSubAgencyList(), agency.getGridList());
}
}
for (ExtGridResultDTO o : gridList) {
AgencyTreeResultDTO grid = new AgencyTreeResultDTO();
grid.setAgencyId(o.getGridId());
grid.setAgencyName(o.getGridName());
grid.setPid(root.getAgencyId());
grid.setLevel("grid");
grid.setSubAgencyList(null);
if (root.getSubAgencyList() == null) {
root.setSubAgencyList(new ArrayList<>());
}
root.getSubAgencyList().add(grid);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @Description 组织树最后一级没有数据的话设null
* @Param agencyList

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -304,7 +304,9 @@
SELECT
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids"
ca.pids AS "pids",
ca.PID AS pid,
ca.LEVEL
FROM
customer_agency ca
INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id
@ -507,6 +509,7 @@
<result column="agencyId" property="agencyId"/>
<result column="agencyName" property="agencyName"/>
<result column="pid" property="pid"/>
<result column="level" property="level"/>
</resultMap>
<resultMap id="NodeTreeResult" type="com.epmet.dto.result.AgencyTreeResultDTO"
extends="BaseResultMap">
@ -519,7 +522,8 @@
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
PID,
LEVEL
from customer_agency
where
DEL_FLAG = 0
@ -530,7 +534,8 @@
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
PID,
LEVEL
from
customer_agency
where

77
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java

@ -0,0 +1,77 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Data
public class BaseConflictsResolveDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 事件ID
*/
private String id;
/**
* 事件信息
*/
private String eventInfo;
/**
* 事件所属网格ID
*/
private String gridId;
/**
*
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
*
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

76
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java

@ -0,0 +1,76 @@
/**
* 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.opendata.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 系统用户中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Data
public class ExUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 市平台 用户ID
*/
private String userId;
/**
* 市平台 用户名
*/
private String userName;
/**
* 市平台 用户身份证号
*/
private String idCard;
/**
* 市平台 用户手机号
*/
private String mobile;
/**
* 区县平台 用户ID
*/
private String userIdQx;
/**
* 区县平台 用户名
*/
private String userNameQx;
/**
* 区县平台 用户账号
*/
private String userAccount;
/**
* 删除标识
*/
private String delFlag;
}

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java

@ -44,7 +44,7 @@ public class BaseGridInfoController {
/**
* @Author sun
* @Description 组织基础信息中库同步
* @Description 组织基础信息中库同步
**/
@PostMapping("agencybaseinfo")
public Result getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) {
@ -55,7 +55,7 @@ public class BaseGridInfoController {
/**
* @Author sun
* @Description 网格基础信息中库同步
* @Description 网格基础信息中库同步
**/
@PostMapping("gridbaseinfo")
public Result getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) {

33
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java

@ -0,0 +1,33 @@
/**
* 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.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseConflictsResolveEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Mapper
public interface BaseConflictsResolveDao extends BaseDao<BaseConflictsResolveEntity> {
}

33
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java

@ -0,0 +1,33 @@
/**
* 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.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.ExUserEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 系统用户中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Mapper
public interface ExUserDao extends BaseDao<ExUserEntity> {
}

48
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java

@ -0,0 +1,48 @@
/**
* 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.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("base_conflicts_resolve")
public class BaseConflictsResolveEntity {
private static final long serialVersionUID = 1L;
/**
* 事件信息
*/
private String eventInfo;
/**
* 事件所属网格ID
*/
private String gridId;
}

72
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java

@ -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.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 系统用户中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ex_user")
public class ExUserEntity {
private static final long serialVersionUID = 1L;
/**
* 市平台 用户ID
*/
private String userId;
/**
* 市平台 用户名
*/
private String userName;
/**
* 市平台 用户身份证号
*/
private String idCard;
/**
* 市平台 用户手机号
*/
private String mobile;
/**
* 区县平台 用户ID
*/
private String userIdQx;
/**
* 区县平台 用户名
*/
private String userNameQx;
/**
* 区县平台 用户账号
*/
private String userAccount;
}

31
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java

@ -0,0 +1,31 @@
/**
* 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.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.entity.BaseConflictsResolveEntity;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
public interface BaseConflictsResolveService extends BaseService<BaseConflictsResolveEntity> {
}

31
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java

@ -0,0 +1,31 @@
/**
* 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.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.entity.ExUserEntity;
/**
* 系统用户中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
public interface ExUserService extends BaseService<ExUserEntity> {
}

36
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java

@ -0,0 +1,36 @@
/**
* 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.opendata.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.opendata.dao.BaseConflictsResolveDao;
import com.epmet.opendata.entity.BaseConflictsResolveEntity;
import com.epmet.opendata.service.BaseConflictsResolveService;
import org.springframework.stereotype.Service;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Service
public class BaseConflictsResolveServiceImpl extends BaseServiceImpl<BaseConflictsResolveDao, BaseConflictsResolveEntity> implements BaseConflictsResolveService {
}

10
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.opendata.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
@ -58,7 +59,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
@Transactional(rollbackFor = Exception.class)
public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询组织基础信息
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO);
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
@ -110,7 +112,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
@Transactional(rollbackFor = Exception.class)
public void getGridBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO);
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class);
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
@ -141,7 +144,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
ExList.add(entity);
});
if (null != formDTO.getType() && "all".equals(formDTO.getType())) {
exDeptDao.updateBatchGrid(ExList);
exDeptDao.updateBatch(ExList);
//exDeptDao.updateBatchGrid(ExList);
} else {
exDeptDao.insertBatch(ExList);
}

3
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java

@ -56,7 +56,8 @@ public class BaseGridUserServiceImpl extends BaseServiceImpl<BaseGridUserDao, Ba
@Transactional(rollbackFor = Exception.class)
public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO);
com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class);
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}

48
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java

@ -0,0 +1,48 @@
/**
* 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.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.opendata.dao.ExUserDao;
import com.epmet.opendata.dto.ExUserDTO;
import com.epmet.opendata.entity.ExUserEntity;
import com.epmet.opendata.service.ExUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 系统用户中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
*/
@Service
public class ExUserServiceImpl extends BaseServiceImpl<ExUserDao, ExUserEntity> implements ExUserService {
}

9
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml

@ -21,7 +21,8 @@
<trim prefix="dept_id_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptIdQx'>
when grid_code = #{item.gridCode} then #{item.deptIdQx}
<!-- when grid_code = #{item.gridCode} then #{item.deptIdQx} -->
when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx}
</if>
</foreach>
</trim>
@ -29,7 +30,8 @@
<trim prefix="dept_name_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptNameQx'>
when grid_code = #{item.gridCode} then #{item.deptNameQx}
when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx}
<!-- when grid_code = #{item.gridCode} then #{item.deptNameQx} -->
</if>
</foreach>
</trim>
@ -38,7 +40,8 @@
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
grid_code = #{item.gridCode}
<!-- grid_code = #{item.gridCode} -->
dept_name_qx = #{item.deptNameQx}
</foreach>
</update>

Loading…
Cancel
Save