Browse Source

获取当前机关下网格列表

master
wangchao 6 years ago
parent
commit
2e749293e0
  1. 1
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java
  2. 2
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  3. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommonAgencyIdFormDTO.java
  4. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
  5. 33
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridListInfoResultDTO.java
  6. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  7. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  8. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  9. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  10. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  11. 25
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  12. 31
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CommonStaffInfoResultDTO.java
  13. 18
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java

1
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);
}
}

2
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

29
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;
}

32
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;
}

33
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<GridBaseInfoResultDTO> gridList;
}

20
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<CustomerGridEntity> {
*/
List<CustomerStaffGridDTO> 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> -> GridBaseInfoResultDTO :: getGridId :: getGridName :: getTotalUser
* @Author wangc
* @Date 2020.04.23 15:30
**/
List<GridBaseInfoResultDTO> selectGridListByAgencyId(@Param("agencyId")String agencyId);
}

13
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<CustomerGridEntity> {
* @return
*/
Result<GridDetailResultDTO> griddetail(CustomerGridFormDTO customerGridFormDTO);
/**
* @Description 查找指定机构下的网格列表 对应接口:/gov/org/grid/gridlist
* @Param CommonAgencyIdFormDTO -> gridId
* @return Result<GridListInfoResultDTO>
* @Author wangc
* @Date 2020.04.23 14:45
**/
Result<GridListInfoResultDTO> getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO);
}

11
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<CustomerStaffGridE
* @Date 2020.04.23 09:11
**/
Result<CustomerGridByUserIdResultDTO> getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO);
/**
* @Description 获取添加网格成员的可选人员列表
* @Param CustomerGridFormDTO
* @return com.epmet.dto.result.CommonStaffInfoResultDTO[epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:15
**/
Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO);
}

23
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<CustomerGridDao, Cu
return new Result<GridDetailResultDTO>().ok(griddetail);
}
/**
* @Description 查找指定机构下的网格列表 对应接口:/gov/org/grid/gridlist
* @Param CommonAgencyIdFormDTO
* @return Result<GridListInfoResultDTO>
* @Author wangc
* @Date 2020.04.23 14:45
**/
@Override
public Result<GridListInfoResultDTO> getGridListByAgency(CommonAgencyIdFormDTO agencyFormDTO) {
//1.查当前机构下网格总数
int gridCount = baseDao.selectGridCountByAgencyId(agencyFormDTO.getAgencyId());
//2.查当前机构下每个网格的详情
List<GridBaseInfoResultDTO> gridList = baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId());
//3.封装结果
GridListInfoResultDTO resultData = new GridListInfoResultDTO(gridCount,gridList);
return new Result<GridListInfoResultDTO>().ok(resultData);
}
}

26
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<CustomerStaffG
@Autowired
private CustomerStaffGridRedis customerStaffGridRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Override
public PageData<CustomerStaffGridDTO> page(Map<String, Object> params) {
IPage<CustomerStaffGridEntity> page = baseDao.selectPage(
@ -105,6 +111,13 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 查询指定客户下一个用户所在的网格按照网格名称升序排序取第一个
* @Param LatestGridFormDTO -> customerId ; staffId
* @return CustomerGridDTO
* @Author wangc
* @Date 2020.04.23 09:11
**/
@Override
public Result<CustomerGridByUserIdResultDTO> getStaffGridOrderByGridName(LatestGridFormDTO latestGridFormDTO) {
CustomerGridDTO grid = baseDao.selectStaffGridOrderByGridName(latestGridFormDTO);
@ -115,4 +128,17 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
return new Result<CustomerGridByUserIdResultDTO>().ok(result);
}
/**
* @Description 获取添加网格成员的可选人员列表先在本服务下查询userId然后调用EpmetUserFeign校验账户是否被禁用使用EpmetUser服务的DTO作为返回参数
* @Param CustomerGridFormDTO -> gridId
* @return Result<List<CommonStaffInfoResultDTO>> -> CommonStaffInfoResultDTO [epmet-user-client]
* @Author wangc
* @Date 2020.04.23 16:28
**/
@Override
public Result<List<CommonStaffInfoResultDTO>> getSelectableStaffs(CustomerGridFormDTO customerGridFormDTO) {
return null;
}
}

25
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -139,4 +139,29 @@
AND grid_id = #{gridId}
</select>
<!-- 得到当前机构的网格总数 -->
<select id="selectGridCountByAgencyId" parameterType="string" resultType="int">
SELECT
COUNT( 0 )
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND
PID = #{agencyId}
</select>
<!-- 得到当前机构的网格列表 -->
<select id="selectGridListByAgencyId" parameterType="string" resultType="com.epmet.dto.result.GridBaseInfoResultDTO">
SELECT
ID AS grdiId,
GRID_NAME,
TOTAL_USER
FROM
CUSTOMER_GRID
WHERE
DEL_FLAG = '0'
AND PID = #{agencyId}
</select>
</mapper>

31
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;
}

18
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<String> userRoleList;
}

Loading…
Cancel
Save