diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 6a9c00fe60..cd3dfa9295 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -97,4 +97,5 @@ public class StaffAgencyController { return staffAgencyService.getLatestGrid(latestGridFormDTO); } + } \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 287da51fec..aba15e9636 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; import java.util.List; +import java.util.List; + /** * @Description diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonAgencyIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonAgencyIdFormDTO.java new file mode 100644 index 0000000000..df06539bb4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonAgencyIdFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName CommonAgencyIdFormDTO + * @Author wangc + * @date 2020.04.23 14:37 + */ +@Data +public class CommonAgencyIdFormDTO implements Serializable { + private static final long serialVersionUID = -4634394162176710898L; + + /** + * 机构Id + * */ + @NotBlank(message = "机构Id不可为空") + private String agencyId; + + /** + * 用户Id(政府工作人员) + * */ + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java new file mode 100644 index 0000000000..df2bc63f60 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格基础信息DTO + * @ClassName GridBaseInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:11 + */ +@Data +public class GridBaseInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -5034984869469273329L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 网格人数 + * */ + private Integer totalUser; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListInfoResultDTO.java new file mode 100644 index 0000000000..8f1facbfc9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListInfoResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 网格列表信息 + * @ClassName GridListInfoResultDTO + * @Author wangc + * @date 2020.04.23 14:21 + */ +@Data +@AllArgsConstructor +@RequiredArgsConstructor +@NoArgsConstructor +public class GridListInfoResultDTO implements Serializable { + private static final long serialVersionUID = -5513674274570559283L; + + /** + * 网格总数 + * */ + private Integer gridCount; + + /** + * 网格信息列表 + * */ + private List gridList; +} 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 d387278ec5..3cda7ddcc5 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 @@ -25,8 +25,10 @@ import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; +import com.epmet.dto.result.GridBaseInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -86,4 +88,22 @@ public interface CustomerGridDao extends BaseDao { */ List selectUserIdByGridId(CustomerGridFormDTO customerGridFormDTO); + + /** + * @Description 得到当前机构的网格总数 + * @Param agencyId(String) 对应CUSTOMER_GRID中的PID字段 + * @return int + * @Author wangc + * @Date 2020.04.23 15:05 + **/ + int selectGridCountByAgencyId(@Param("agencyId") String agencyId); + + /** + * @Description 得到当前机构的网格详情列表 + * @Param agencyId(String) 对应CUSTOMER_GRID中的PID字段 + * @return List -> GridBaseInfoResultDTO :: getGridId :: getGridName :: getTotalUser + * @Author wangc + * @Date 2020.04.23 15:30 + **/ + List selectGridListByAgencyId(@Param("agencyId")String agencyId); } \ No newline at end of file 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 5d427e434a..d0a5e69386 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 @@ -21,11 +21,13 @@ 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.CustomerGridDTO; +import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; +import com.epmet.dto.result.GridListInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -130,4 +132,15 @@ public interface CustomerGridService extends BaseService { * @return */ Result griddetail(CustomerGridFormDTO customerGridFormDTO); + + /** + * @Description 查找指定机构下的网格列表 对应接口:/gov/org/grid/gridlist + * @Param CommonAgencyIdFormDTO -> gridId + * @return Result + * @Author wangc + * @Date 2020.04.23 14:45 + **/ + Result getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO); + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 5a085e3d1d..2199eda56d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -21,7 +21,9 @@ 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.CustomerStaffGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.CustomerStaffGridEntity; @@ -104,4 +106,13 @@ public interface CustomerStaffGridService extends BaseService getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO); + + /** + * @Description 获取添加网格成员的可选人员列表 + * @Param CustomerGridFormDTO + * @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client] + * @Author wangc + * @Date 2020.04.23 16:15 + **/ + Result> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO); } \ No newline at end of file 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 da136fb56a..2ab801c954 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 @@ -28,11 +28,14 @@ import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.CommonAgencyIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridDetailResultDTO; +import com.epmet.dto.result.GridBaseInfoResultDTO; +import com.epmet.dto.result.GridListInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerGridRedis; @@ -178,4 +181,24 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(griddetail); } + /** + * @Description 查找指定机构下的网格列表 对应接口:/gov/org/grid/gridlist + * @Param CommonAgencyIdFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.23 14:45 + **/ + @Override + public Result getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO) { + + //1.查当前机构下网格总数 + int gridCount = baseDao.selectGridCountByAgencyId(agencyFormDTO.getAgencyId()); + //2.查当前机构下每个网格的详情 + List gridList = baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId()); + //3.封装结果 + GridListInfoResultDTO resultData = new GridListInfoResultDTO(gridCount,gridList); + return new Result().ok(resultData); + } + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 074ac2f36a..0f63802be7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -27,9 +27,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.entity.CustomerStaffGridEntity; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerStaffGridRedis; import com.epmet.service.CustomerStaffGridService; import org.apache.commons.lang3.StringUtils; @@ -53,6 +56,9 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -105,6 +111,13 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl customerId ; staffId + * @return CustomerGridDTO + * @Author wangc + * @Date 2020.04.23 09:11 + **/ @Override public Result getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO) { CustomerGridDTO grid = baseDao.selectStaffGridOrderByGridName(latestGridFormDTO); @@ -115,4 +128,17 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl().ok(result); } + /** + * @Description 获取添加网格成员的可选人员列表,先在本服务下查询userId,然后调用EpmetUserFeign校验账户是否被禁用,使用EpmetUser服务的DTO作为返回参数 + * @Param CustomerGridFormDTO -> gridId + * @return Result> -> CommonStaffInfoResultDTO [epmet-user-client] + * @Author wangc + * @Date 2020.04.23 16:28 + **/ + @Override + public Result> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO) { + + return null; + } + } \ No newline at end of file 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 f748ba157e..b58526d55f 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 @@ -139,4 +139,29 @@ AND grid_id = #{gridId} + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java new file mode 100644 index 0000000000..69a668fc7a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 通用工作人员信息DTO + * @ClassName CommonStaffInfoResultDTO + * @Author wangc + * @date 2020.04.23 16:16 + */ +@Data +public class CommonStaffInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4174593133225057232L; + + /** + * 工作人员用户Id + * */ + private String userId; + + /** + * 工作人员用户头像 + * */ + private String userHeadPhoto; + + /** + * 工作人员用户显示昵称 + * */ + private String userShowName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index 5bcfd548cc..4f4d31bdb5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -15,16 +15,34 @@ import java.util.List; public class UserInfoOnEnterGridResultDTO implements Serializable{ private static final long serialVersionUID = 1L; + /** + * 当前客户Id + * */ private String currentCustomerId; + /** + * 当前网格Id + * */ private String currentGridId; + /** + * 当前网格名称 + * */ private String currentGridName; + /** + * 用户昵称 + * */ private String nickname; + /** + * 用户头像 + * */ private String userHeadPhoto; + /** + * 用户身份列表 + * */ private List userRoleList; }