diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 5bfb7b698f..5a03583011 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java +++ b/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 getStaffInfo(@PathVariable("staffId") String staffId); + + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("/data/aggregator/org/agency") + Result getAgencyInfo(@RequestParam("agencyId")String agencyId); + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("/data/aggregator/org/grid") + Result getGridInfo(@RequestParam("gridId")String gridId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java index 2495d6b588..02f209f4f2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java +++ b/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 getStaffInfo(String staffId) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getStaffInfo", staffId); } + + @Override + public Result getAgencyInfo(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getAgencyInfo", agencyId); + } + + @Override + public Result getGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getGridInfo", gridId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java new file mode 100644 index 0000000000..9cf82c29d6 --- /dev/null +++ b/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 grid = customerOrgRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(grid)) { + return ConvertUtils.mapToEntity(grid, GridInfoCache.class); + } + Result gridInfoResult = customerOrgRedis.commonAggFeignClient.getGridInfo(gridId); + if (!gridInfoResult.success()){ + throw new RenException("查询网格信息失败..."); + } + if (null == gridInfoResult.getData()){ + throw new RenException("没有此网格信息..."); + } + Map 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 agency = customerOrgRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(agency)) { + return ConvertUtils.mapToEntity(agency, AgencyInfoCache.class); + } + Result agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId); + if (!agencyInfoResult.success()){ + throw new RenException("查询组织信息失败..."); + } + if (null == agencyInfoResult.getData()){ + throw new RenException("没有此组织信息..."); + } + Map map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true); + customerOrgRedis.redisUtils.hMSet(key, map); + return agencyInfoResult.getData(); + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java new file mode 100644 index 0000000000..684440db65 --- /dev/null +++ b/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; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java new file mode 100644 index 0000000000..cf90afee5b --- /dev/null +++ b/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; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 所属组织机构名 + */ + private String agencyName; + + /** + * 所有上级组织名 + */ + private String allParentName; + + /** + * 坐标区域 + */ + private String coordinates; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java index 10620c89d2..fcb6d13250 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java +++ b/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; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 17f939b2c6..14500cc2ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/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>().ok(govOrgService.getAgencyTree(tokenDto, formDTO)); } + /** + * @Description 查询组织信息 + * @param agencyId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("agency") + public Result getAgencyInfo(@RequestParam("agencyId")String agencyId){ + return new Result().ok(govOrgService.getAgencyInfo(agencyId)); + } + + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 2:54 下午 + */ + @PostMapping("grid") + public Result getGridInfo(@RequestParam("gridId")String gridId){ + return new Result().ok(govOrgService.getGridInfo(gridId)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java index 56d07daafb..4ee22247f2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java +++ b/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 { **/ List getGridListByAgencyId(@Param("agencyId") String agencyId); + /** + * @Description 查询网格信息 + * @param gridId + * @author zxc + * @date 2021/11/5 3:39 下午 + */ + CustomerGridDTO getGridInfo(@Param("gridId") String gridId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 41b97b57ac..77c8c33d0f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/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 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); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index d4e265cdec..db39899f4f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/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); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index 0fa266afc8..fde243eafa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -163,4 +163,16 @@ AND cg.pid = #{agencyId} + + + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryProjectListFormDTO.java new file mode 100644 index 0000000000..3da140aa04 --- /dev/null +++ b/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; + + /** + * 是否分页,默认true,false的时候 给导出用 + */ + private Boolean isPage = true; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectCategoryFormDTO.java new file mode 100644 index 0000000000..8cd3a4f083 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryProjectListResultDTO.java new file mode 100644 index 0000000000..5250826a3c --- /dev/null +++ b/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 = ""; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/PageCategoryProjectListResultDTO.java new file mode 100644 index 0000000000..c17f00bf77 --- /dev/null +++ b/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 list; + + public PageCategoryProjectListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryResultDTO.java new file mode 100644 index 0000000000..d51825c27b --- /dev/null +++ b/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 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; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategorySonResultDTO.java new file mode 100644 index 0000000000..22cbbbd0bb --- /dev/null +++ b/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 = ""; + } +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index bf1878effd..ee992fd107 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -116,6 +116,16 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + ${project.basedir}/src/main/java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 94cd036277..87aa340fac 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/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>().ok(screenProjectService.categoryTopAppeal(formDTO)); } + + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + @PostMapping("selectprojectcategory") + public Result> selectProjectCategory(@RequestBody ProjectCategoryFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.ProjectCategoryForm.class); + return new Result>().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 data = screenProjectService.selectProjectCategory(formDTO, tokenDto); + String templatePath = "excel/project_category_temp.xlsx"; + + List 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 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 selectCategoryProjectList(@RequestBody CategoryProjectListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, CategoryProjectListFormDTO.CategoryProjectListForm.class); + return new Result().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 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(); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java index e3cf3d074d..93b6564f87 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java +++ b/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 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 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 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 selectCategoryByCustomerId(@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java index 49797b9cb2..11c019e4d9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/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 selectColorProjectByAreaCode(@Param("areaCode") String areaCode,@Param("monthCount")Integer monthCount); + + /** + * @Description 查询分类下的项目列表 + * @param customerId + * @param orgId + * @author zxc + * @date 2021/11/5 1:40 下午 + */ + List selectCategoryProjectList(@Param("customerId") String customerId,@Param("orgId") String orgId, + @Param("categoryCode")String categoryCode,@Param("status")String status); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java index 2a26119d9c..aeb20bdb97 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java +++ b/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 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); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index e8d9110198..2f268cd35e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/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 categoryTopAppeal(CategoryTopAppealFormDTO formDTO); + + /** + * @Description 【项目分类】查询项目分类 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:38 下午 + */ + List selectProjectCategory(ProjectCategoryFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 【项目分类】查询分类下的项目 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/4 3:39 下午 + */ + PageCategoryProjectListResultDTO selectCategoryProjectList(CategoryProjectListFormDTO formDTO, TokenDto tokenDto); + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index a23152697e..4c0833ba3e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/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 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 result = screenProjectCategoryOrgDailyDao.selectCategoryByCustomerId(tokenDto.getCustomerId()); + List 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 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 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 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 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 list; + if (formDTO.getIsPage()){ + PageInfo 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; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx new file mode 100644 index 0000000000..6054a88289 Binary files /dev/null and b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_category_temp.xlsx differ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx new file mode 100644 index 0000000000..743bd60ecc Binary files /dev/null and b/epmet-module/data-report/data-report-server/src/main/resources/excel/project_temp.xlsx differ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml index 5731b27e2b..b9dfb3faaa 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/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} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index e890e36389..accf6111e4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/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)) ) + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml index 4189b03d16..0294005b7f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml +++ b/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 + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java index 66e3943591..d4a767f525 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java +++ b/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; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java index 8681c525da..72e12ff5dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java +++ b/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); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index 9fbca67078..ec0377ab83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/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 { 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()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml index 109c194e18..c2f3323cd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/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 = '') 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') #{dateId} GROUP BY categoryCode diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index e4592c5b0b..808e25d791 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -41,9 +41,12 @@ public class AgencyResultDTO implements Serializable { * 机关组织名称 */ private String agencyName = ""; + + private String pid; + private String level; /** * 所有上级组织机构ID(以英文:隔开) */ @JsonIgnore private String pids = ""; -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index 896ebfb57c..3afae3011a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/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; /** * 下级机关组织 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index c3937127ba..1b12beb474 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/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().ok(customerAgencyService.getAgencyList(formDTO)); } + /** + * @Description 获取当前登陆人的 所属组织及下级组织/网格(含直属网格)树 + * @Param tokenDTO + * @Return {@link Result< AgencyTreeResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 15:20 + */ + @PostMapping("agencygridtree") + public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { + return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 145178f50f..8968d6e288 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -243,4 +243,4 @@ public interface CustomerAgencyDao extends BaseDao { AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId); List getSubAgencyList(@Param("pid") String pid); -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index b13bae23e7..96932318db 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/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 * @Date 2021/9/8 15:21 */ AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO); -} \ No newline at end of file + + /** + * desc:获取用户所属组织的组织及网格树 + * @param staffId + * @return + */ + AgencyTreeResultDTO getOrgTreeData(String staffId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index fc9f181a20..451a50deb9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/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%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 agencyList, List 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 diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 89a5df87f4..f49a8cf4e6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/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 @@ + @@ -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 @@ -539,4 +544,4 @@ AND CUSTOMER_ID = #{customerId} - \ No newline at end of file + diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java new file mode 100644 index 0000000000..00c96a08f6 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExUserDTO.java new file mode 100644 index 0000000000..d0f61777ca --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java index 531ecc8cde..628c4802ca 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java +++ b/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) { diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseConflictsResolveDao.java new file mode 100644 index 0000000000..29be2a6c23 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExUserDao.java new file mode 100644 index 0000000000..4a3c4ecc13 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java new file mode 100644 index 0000000000..fe9a50a92a --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java new file mode 100644 index 0000000000..f178336ab1 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseConflictsResolveService.java new file mode 100644 index 0000000000..85cb47c7b9 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java new file mode 100644 index 0000000000..9c76d86500 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseConflictsResolveServiceImpl.java new file mode 100644 index 0000000000..270cbb365f --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements BaseConflictsResolveService { + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java index 7802dfc707..e50d9404e4 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java +++ b/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> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO); + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1); if (!result.success()) { throw new RenException(result.getInternalMsg()); } @@ -110,7 +112,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO); + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1); if (!result.success()) { throw new RenException(result.getInternalMsg()); } @@ -141,7 +144,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO); + com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1); if (!result.success()) { throw new RenException(result.getInternalMsg()); } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java new file mode 100644 index 0000000000..4badca6794 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements ExUserService { + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml index ba20d99170..6aed25bf51 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml @@ -21,7 +21,8 @@ - when grid_code = #{item.gridCode} then #{item.deptIdQx} + + when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx} @@ -29,7 +30,8 @@ - when grid_code = #{item.gridCode} then #{item.deptNameQx} + when dept_name_qx = #{item.deptNameQx} then #{item.deptIdQx} + @@ -38,7 +40,8 @@ WHERE 1=1 - grid_code = #{item.gridCode} + + dept_name_qx = #{item.deptNameQx}