diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java index 9922a2fb6e..fe22284567 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotNull; +import java.io.Serializable; /** * 分页通用类 @@ -12,7 +13,9 @@ import javax.validation.constraints.NotNull; * @date 2020/11/20 17:02 */ @Data -public class PageFormDTO { +public class PageFormDTO implements Serializable { + private static final long serialVersionUID = -4145040961294503137L; + public interface AddUserInternalGroup { } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 35b4f1802b..c8c245b15a 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -486,7 +486,8 @@ epmet: - /data/aggregator/** - /gov/voice/** - /resi/voice/** - - /epmet/point/** + - /point/** + - /heart/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: @@ -523,6 +524,7 @@ epmet: - /third/private-epmet/push-component-access-token - /data/stats/plugins/ofs/** - /data/stats/plugins/workrecord/** + - /epmetuser/staffrole/getGridStaffList #py获取网格员 网格长 # 对外开放接口认证白名单 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffResultDTO.java new file mode 100644 index 0000000000..b325e80461 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:客户下网格工作人员结果 + * @Author zxc + * @DateTime 2021/6/8 3:23 下午 + * @DESC + */ +@Data +public class CustomerGridStaffResultDTO implements Serializable { + + private static final long serialVersionUID = -5910427385795368242L; + + private String userId; + + private String userName; + + private String mobile; + + private Integer gender; + + private String gridId; + + private String gridName; + + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffGridResultDTO.java new file mode 100644 index 0000000000..ece0ebfc73 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffGridResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 在网格中的工作人员 + * @dscription + * @date 2020/4/23 16:08 + */ +@Data +public class CustomerStaffGridResultDTO implements Serializable { + private static final long serialVersionUID = 1301415104939403933L; + /** + * 用户ID + */ + private String userId; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 组织Id + */ + private String agencyId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 6c31c72c8d..1d82763373 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -462,8 +462,8 @@ public interface GovOrgOpenFeignClient { @PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE) Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId); - - + + /** * @Description 获取组织下网格选项 * @Param formDTO @@ -549,7 +549,7 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/agency/getsonagencyid") Result> getSonAgencyId(@RequestParam("orgId")String orgId,@RequestParam("type")String type); - + // /icbuilding/{id}?id=demoData /** @@ -577,6 +577,11 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/customeragency/configcustomerareacode") Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO); + @PostMapping("/gov/org/customergrid/getstaffgridlist") + Result> getStaffGridList(@RequestParam("customerId") String customerId, + @RequestParam("orgId") String orgId, + @RequestParam("orgType") String orgType); + /** * @Author sun * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 2ce6993f47..21067cb674 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -370,6 +370,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "configCustomerAreaCode", formDTO); } + @Override + public Result> getStaffGridList(String customerId, String orgId, String orgType) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList",customerId, orgId, orgType); + } + /** * @Author sun * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 8843d646c5..34628a197f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -330,4 +330,17 @@ public class CustomerGridController { return new Result>().ok(customerGridService.gridListByAgencyId(agencyId)); } + /** + * @Description 获取工作人员所在的网格列表 + * @author sun + **/ + @PostMapping("getstaffgridlist") + Result> getStaffGridList(@RequestParam("customerId")String customerId, + @RequestParam("orgId")String orgId, + @RequestParam("orgType")String orgType) { + //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); + List staffGridList = customerGridService.getStaffGridList(customerId, orgId, orgType); + return new Result>().ok(staffGridList); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 3b5e8c794a..7eef403d38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -156,8 +156,8 @@ public interface CustomerGridDao extends BaseDao { List selectGridByIds(@Param("gridIdList") List gridIdList); /** - * @Description 查询网格名 不限制是否同步条件 SYNC_FLAG * @param gridIdList + * @Description 查询网格名 不限制是否同步条件 SYNC_FLAG * @author zxc * @date 2022/1/12 9:42 上午 */ @@ -279,15 +279,15 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO getGridBaseInfoById(@Param("gridId") String gridId); /** - * @Description 根据网格ID查询pids + * @Description 根据网格ID查询pids * @Param gridId * @author zxc * @date 2021/7/16 9:52 上午 */ - String selectPidsByGridId(@Param("gridId")String gridId); + String selectPidsByGridId(@Param("gridId") String gridId); /** - * @Description 查询网格名字 + * @Description 查询网格名字 * @Param gridId * @author zxc * @date 2021/8/4 4:30 下午 @@ -295,7 +295,7 @@ public interface CustomerGridDao extends BaseDao { String gridName(String gridId); /** - * @Description 查询组织名字 + * @Description 查询组织名字 * @Param orgIds * @author zxc * @date 2021/8/4 6:25 下午 @@ -303,7 +303,7 @@ public interface CustomerGridDao extends BaseDao { List selectOrgNameByType(@Param("orgIds") List orgIds); /** - * @Description 根据人查询所在组织 + * @Description 根据人查询所在组织 * @Param userId * @author zxc * @date 2021/8/5 10:08 上午 @@ -361,7 +361,8 @@ public interface CustomerGridDao extends BaseDao { CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId); int updateSubGridAreaCode(@Param("customerId") String customerId, - @Param("agencyId")String agencyId, + @Param("agencyId") String agencyId, @Param("operateUserId") String operateUserId); + List getStaffGridList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgType") String orgType); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 1bc418d8fd..cac10ea123 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -362,4 +362,16 @@ public interface CustomerGridService extends BaseService { * @Description 查询组织直属网格列表 **/ List gridListByAgencyId(String agencyId); + + /** + * desc: 获取组织及网格下 工作人员网格关系列表 + * + * @param customerId + * @param orgId + * @param orgType + * @return java.util.List + * @author LiuJanJun + * @date 2022/1/17 3:50 下午 + */ + List getStaffGridList(String customerId, String orgId, String orgType); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 115a784406..57fc7340fb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -42,7 +42,6 @@ import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -931,4 +930,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getStaffGridList(String customerId, String orgId, String orgType) { + return baseDao.getStaffGridList(customerId,orgId,orgType); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index ca2e81e89b..a70cf1d9b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -783,5 +783,27 @@ where customer_id=#{customerId} AND pids LIKE concat('%',#{agencyId}, '%' ) + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/SubTableJoinDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/SubTableJoinDTO.java new file mode 100644 index 0000000000..a7b950d891 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/SubTableJoinDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +@Data +public class SubTableJoinDTO implements Serializable { + private static final long serialVersionUID = 8243764437194993736L; + private String tableName; + private String joinTableSql; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 0ccbfa1655..133f98ab11 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -25,7 +25,7 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:16 */ -//@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallbackFactory = OperCustomizeOpenFeignClientFallbackFactory.class,url = "http://localhost:8089") +// @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallbackFactory = OperCustomizeOpenFeignClientFallbackFactory.class,url = "http://localhost:8089") @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallbackFactory = OperCustomizeOpenFeignClientFallbackFactory.class) public interface OperCustomizeOpenFeignClient { @@ -75,7 +75,7 @@ public interface OperCustomizeOpenFeignClient { * @date 2021/11/1 1:07 下午 */ @PostMapping(value = "/oper/customize/icform/querySubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result> querySubTables(@RequestBody CustomerFormQueryDTO queryDTO); + Result> querySubTables(@RequestBody CustomerFormQueryDTO queryDTO); @PostMapping(value = "/oper/customize/icform/queryIcResiSubTables", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> queryIcResiSubTables(@RequestBody CustomerFormQueryDTO queryDTO); diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 9dec3f4afe..a8fdcbff41 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -61,7 +61,7 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe } @Override - public Result> querySubTables(CustomerFormQueryDTO formDto) { + public Result> querySubTables(CustomerFormQueryDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "querySubTables", formDto); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java index 8466ceb6a6..cce2730c6f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -133,9 +133,9 @@ public class IcFormController { * @date 2021/11/1 1:25 下午 */ @PostMapping(value = "querySubTables") - Result> querySubTables(@RequestBody CustomerFormQueryDTO formQueryDTO){ + Result> querySubTables(@RequestBody CustomerFormQueryDTO formQueryDTO){ ValidatorUtils.validateEntity(formQueryDTO,CustomerFormQueryDTO.AddUserInternalGroup.class); - return new Result>().ok(icFormItemService.querySubTables(formQueryDTO.getCustomerId(),formQueryDTO.getFormCode())); + return new Result>().ok(icFormItemService.querySubTables(formQueryDTO.getCustomerId(),formQueryDTO.getFormCode())); } @PostMapping(value = "queryIcResiSubTables") diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java index a0ad3ad839..d20a49202a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java @@ -18,10 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.ConditionResultDTO; -import com.epmet.dto.result.IcFormResColumnDTO; -import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -62,7 +59,7 @@ public interface IcFormItemDao extends BaseDao { * @author yinzuomei * @date 2021/11/1 1:25 下午 */ - List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); + List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); Set queryIcResiSubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java index f9eb17f8e3..a5cab9bc23 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -46,7 +46,7 @@ public interface IcFormItemService extends BaseService { List queryConditions(String customerId,String formCode); - List querySubTables(String customerId, String formCode); + List querySubTables(String customerId, String formCode); Set queryIcResiSubTables(String customerId, String formCode); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index 697aaca89e..f53226d51c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -21,24 +21,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.constant.StrConstant; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcFormItemDao; -import com.epmet.dto.IcFormItemDTO; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import com.epmet.service.IcFormItemService; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; /** * 表单项 @@ -100,7 +97,7 @@ public class IcFormItemServiceImpl extends BaseServiceImpl querySubTables(String customerId, String formCode) { + public List querySubTables(String customerId, String formCode) { return baseDao.querySubTables(customerId,formCode); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index c9b16fd11c..9af84eaee4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -113,9 +113,10 @@ - select - CONCAT('left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER and ',temp.TABLE_NAME,'.del_flag="0" )') as subTables + temp.TABLE_NAME as tableName, + CONCAT('left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER and ',temp.TABLE_NAME,'.del_flag="0" )') as joinTableSql from ( SELECT DISTINCT m.TABLE_NAME diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index edc3a74476..1e970897f2 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -94,7 +94,7 @@ public class IssueServiceImpl implements IssueService { issueDetailResult.setTopicInfo(topicInfoDTOResult == null ? new TopicInfoDTO() : topicInfoDTOResult); } - /*if("branch".equals(topicInfoDTOResult.getGroupType())){//支部小组话题发起人显示真实姓名 + if (null != topicInfoDTOResult && "branch".equals(topicInfoDTOResult.getGroupType())) {//支部小组话题发起人显示真实姓名 List userIdList = new ArrayList<>(); userIdList.add(issueResult.getUserId()); Result> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); @@ -118,8 +118,8 @@ public class IssueServiceImpl implements IssueService { IssueInitiatorResultDTO initiatorResult = userFeignClient.selectIssueInitiator(initiatorFormDTO).getData(); issueDetailResult.setIssueInitiator(initiatorResult == null ? HallConstat.NULL_CHARACTER_STRING : initiatorResult.getIssueInitiator()); } - }*/ - issueDetailResult.setIssueInitiator(topicInfoDTOResult.getPublishedUser()); + } + //issueDetailResult.setIssueInitiator(topicInfoDTOResult.getPublishedUser()); //判断是否投票 CheckVoteFormDTO formDTO = new CheckVoteFormDTO(); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java new file mode 100644 index 0000000000..f7bc145afe --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * DESC:网格下的工作人员 查询 + * @author liujianjun + */ +@Data +public class GridStaffFormDTO extends PageFormDTO { + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {DefaultGroup.class}) + private String customerId; + + /** + * 工作人员Id + */ + private String userId; + + /** + * 工作人员姓名 + */ + private String userName; + + /** + * 手机号 + */ + private String mobile; + + /** + * 角色key + */ + @NotEmpty(message = "角色Key不能为空", groups = {DefaultGroup.class}) + private List roleKeyList; + + /** + * 组织ID + */ + @NotBlank(message = "组织ID不能为空", groups = {DefaultGroup.class}) + private String orgId; + + /** + * 组织类型 agency or grid + */ + @NotBlank(message = "组织类型不能为空", groups = {DefaultGroup.class}) + private String orgType; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index ff63a672dc..9c2113a603 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -254,6 +254,9 @@ public class IcResiUserController { pageFormDTO.setCustomerId(tokenDto.getCustomerId()); pageFormDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(pageFormDTO, IcResiUserPageFormDTO.AddUserInternalGroup.class); + if(null==pageFormDTO.getConditions()){ + pageFormDTO.setConditions(new ArrayList<>()); + } return new Result>>().ok(icResiUserService.pageResiMap(pageFormDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 998c3eba7e..0cf0bc1760 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -2,8 +2,10 @@ package com.epmet.controller; import cn.hutool.core.collection.CollectionUtil; import com.epmet.commons.mybatis.entity.DataScope; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.*; @@ -11,6 +13,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -195,4 +198,23 @@ public class StaffRoleController { ValidatorUtils.validateEntity(formDTO,RoleStaffIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(staffRoleService.queryRoleStaffIds(formDTO)); } + + /** + * desc: 根据角色、用户名、手机号 组织获取网格下的工作人员 精确匹配 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author LiuJanJun + * @date 2022/1/17 2:26 下午 + */ + @PostMapping("getGridStaffList") + Result> getGridStaffList(@RequestHeader(value = "customerId",required = false) String customerId, @RequestBody GridStaffFormDTO formDTO){ + //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(customerId); + } + ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); + + return new Result>().ok(staffRoleService.getGridStaffList(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 31e6591d92..3cfb231881 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.GetRoleKeyListFormDTO; +import com.epmet.dto.form.GridStaffFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; @@ -169,4 +170,14 @@ public interface StaffRoleDao extends BaseDao { * @Description 【事件】网格员服务电话 **/ List staffRoleList(@Param("staffIds") List staffIds); + + /** + * desc: 条件获取工作人员list + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2022/1/17 2:45 下午 + */ + List getStaffList(GridStaffFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index e8737d7a0c..2458ba809d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -22,15 +22,11 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.form.RoleStaffIdFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import java.util.List; -import java.util.Map; import java.util.Set; /** @@ -41,66 +37,6 @@ import java.util.Set; */ public interface StaffRoleService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-04-22 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-04-22 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return StaffRoleDTO - * @author generator - * @date 2020-04-22 - */ - StaffRoleDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-22 - */ - void save(StaffRoleDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-22 - */ - void update(StaffRoleDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-04-22 - */ - void delete(String[] ids); - /** * 查询具有某角色的staff列表 * @param roleKey @@ -176,4 +112,14 @@ public interface StaffRoleService extends BaseService { * @date 2021/8/19 11:14 上午 */ Set queryRoleStaffIds(RoleStaffIdFormDTO formDTO); + + /** + * desc: 条件获取 网格工作人员信息 + * + * @param formDTO + * @return com.epmet.commons.tools.page.PageData + * @author LiuJanJun + * @date 2022/1/17 2:37 下午 + */ + PageData getGridStaffList(GridStaffFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 8ccf84a9bb..3cee2435c1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -493,9 +493,29 @@ public class IcResiUserServiceImpl extends BaseServiceImpl resultColumns = resultColumnRes.getData(); + // 查询结果列对应的表: + Set resultColumnTables=resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet()); + // 查询列表展示项需要用到哪些子表 - Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1); - List subTables =subTablesRes.getData(); + Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1); + List subTables =subTablesRes.getData(); + log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true)); + + //关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重 + Set whereConditionTables=formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet()); + Set tables=new HashSet<>(); + tables.addAll(whereConditionTables); + tables.addAll(resultColumnTables); + log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true)); + //最终关联的子表对应的sql: + List finalSubTables =new ArrayList<>(); + subTables.forEach(subTable->{ + if(tables.contains(subTable.getTableName())){ + finalSubTables.add(subTable.getJoinTableSql()); + } + }); + + PageInfo> pageInfo=new PageInfo<>(); if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) { //分页 @@ -505,15 +525,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> list=baseDao.selectListResiMap(formDTO.getCustomerId(), formDTO.getFormCode(), formDTO.getConditions(), resultColumns, - subTables,staffInfoCacheResult.getAgencyId(), - staffOrgPath,null, formDTO.getKeyword()); + finalSubTables, + staffInfoCacheResult.getAgencyId(), + staffOrgPath,null, + formDTO.getKeyword()); pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); pageInfo.setList(list); } @@ -672,10 +694,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO); + Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO); List subTables=new ArrayList<>(); if(subTablesRes.success()&&CollectionUtils.isNotEmpty(subTablesRes.getData())){ - subTables =subTablesRes.getData(); + subTables =subTablesRes.getData().stream().map(SubTableJoinDTO::getJoinTableSql).collect(Collectors.toList()); } return baseDao.dynamicQuery(customerId,resultTableName,conditions,subTables,currentStaffAgencyId,staffOrgPath); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 181b788434..fca7a68aed 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -17,30 +17,29 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.StaffRoleDTO; -import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.form.RoleStaffIdFormDTO; -import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.StaffRoleService; -import org.apache.commons.lang3.StringUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * 工作人员-角色关系表 @@ -48,61 +47,12 @@ import java.util.*; * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-22 */ +@Slf4j @Service public class StaffRoleServiceImpl extends BaseServiceImpl implements StaffRoleService { - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, StaffRoleDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, StaffRoleDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public StaffRoleDTO get(String id) { - StaffRoleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, StaffRoleDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(StaffRoleDTO dto) { - StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(StaffRoleDTO dto) { - StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; /** * 查询具有某角色的staff列表 * @param roleKey @@ -209,4 +159,47 @@ public class StaffRoleServiceImpl extends BaseServiceImpl getGridStaffList(GridStaffFormDTO formDTO) { + //有这些条件 优先查询用户信息 + List staffList = baseDao.getStaffList(formDTO); + + if (CollectionUtils.isEmpty(staffList)){ + log.warn("getGridStaffList getStaffList return empty,param:{}", JSON.toJSONString(formDTO)); + return new PageData<>(null,NumConstant.ZERO); + } + //继续查询 在网格里的人 + Result> staffGridResult = govOrgOpenFeignClient.getStaffGridList(formDTO.getCustomerId(),formDTO.getOrgId(),formDTO.getOrgType()); + if (staffGridResult == null || !staffGridResult.success() || CollectionUtils.isEmpty(staffGridResult.getData())){ + log.warn("getGridStaffList getStaffGridList return empty,param orgId:{},orgType:{}",formDTO.getOrgId(),formDTO.getOrgType()); + return new PageData<>(null,NumConstant.ZERO); + } + Map> userGridListMap = staffGridResult.getData().stream() + .collect(Collectors.groupingBy(CustomerStaffGridResultDTO::getUserId)); + List result = new ArrayList<>(); + Integer offset = formDTO.getOffset(); + Integer pageSize = formDTO.getPageSize(); + + AtomicInteger count = new AtomicInteger(); + staffList.forEach(staff->{ + List dtoList = userGridListMap.get(staff.getUserId()); + if (dtoList == null){ + return; + } + + dtoList.forEach(grid-> { + CustomerGridStaffResultDTO staffNew = ConvertUtils.sourceToTarget(staff, CustomerGridStaffResultDTO.class); + staffNew.setGridId(grid.getGridId()); + staffNew.setGridName(grid.getGridName()); + staffNew.setAgencyId(grid.getAgencyId()); + if (count.intValue() >= offset && result.size() < pageSize) { + result.add(staffNew); + } + count.getAndIncrement(); + }); + + }); + return new PageData<>(result,count.get()); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index edb8b4e4a4..777ef27ee8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -271,5 +271,36 @@ ORDER BY sr.staff_id, gsr.role_key +