Browse Source

Merge branch 'lingshan_master' of http://git.elinkit.com.cn:7070/r/epmet-cloud

master
luyan 2 years ago
parent
commit
8faf395127
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java
  2. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java
  3. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java
  4. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java
  5. 35
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventRsultCountDTO.java
  6. 29
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  7. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  8. 3
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  9. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  10. 23
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  11. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  12. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java

@ -20,6 +20,11 @@ public class GridManagerListResultDTO implements Serializable {
*/
private String staffId;
private Integer gender;
private Integer age;
private String headPhoto;
/**
* 工作人员手机号
*/

17
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java

@ -1,14 +1,18 @@
package com.epmet.datareport.service.user.impl;
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.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.constant.PatrolConstant;
import com.epmet.datareport.dao.user.StaffPatrolDetailDao;
import com.epmet.datareport.dao.user.StaffPatrolRecordDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService;
import com.epmet.datareport.service.user.StaffPatrolDetailService;
import com.epmet.dto.IcEventDTO;
import com.epmet.dto.form.PatrolCountFormDTO;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
@ -76,7 +80,7 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
if (CollectionUtils.isEmpty(grids)) {
return new ArrayList<>();
}
List<String> gridIds = grids.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<String> gridIds = grids.stream().map(GridManagerListResultDTO::getGridId).collect(Collectors.toList());
// 查询网格下的网格员
Result<List<GridStaffResultDTO>> resultData = govOrgOpenFeignClient.selectGridStaffByGridIds(gridIds);
if (!resultData.success()) {
@ -87,8 +91,17 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
return new ArrayList<>();
}
List<GridManagerListResultDTO> result = ConvertUtils.sourceToTarget(data, GridManagerListResultDTO.class);
result.forEach(staff -> {//获取头像
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), staff.getStaffId());
if (null != staffInfo) {
staff.setHeadPhoto(staffInfo.getHeadPhoto());
}
});
//统计事件
List<IcEventDTO> events = null;
// 查询经纬度
Result<UserNameAndLLResultDTO> selectll = epmetUserOpenFeignClient.selectll(result.stream().map(m -> m.getStaffId()).collect(Collectors.toList()));
Result<UserNameAndLLResultDTO> selectll = epmetUserOpenFeignClient.selectll(result.stream().map(GridManagerListResultDTO::getStaffId).collect(Collectors.toList()));
if (!selectll.success()) {
throw new RenException("查询经纬度和姓名失败【" + selectll.getMsg() + "】");
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java

@ -20,4 +20,8 @@ public class GridStaffResultDTO implements Serializable {
private String mobile;
private Integer age;
private Integer gender;
}

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java

@ -9,6 +9,7 @@ public class IcEventResultDTO {
private String gridId;
private String sourceType;
private String eventType;
private int repayStatus;
private String manageStatus;
private String categoryCode;
private String latitude;

35
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventRsultCountDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.result;
import lombok.Data;
import java.util.List;
/**
* @author yan Lu
* @description 描述
* @create 2023/6/2 16:10
*/
@Data
public class IcEventRsultCountDTO {
/**
* 总量
*/
private Integer eventTotal;
/**
* 已完成
*/
private Integer completeTotal;
/**
* 未完成
*/
private Integer unCompleteTotal;
/**
* 事件列表
*/
private List<IcEventResultDTO> eventList;
}

29
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -40,9 +40,11 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 事件管理表
@ -640,7 +642,7 @@ public class IcEventController {
* @param orgId
* @param orgType
* @param sourceType 事件来源
* @param eventType 响应几杯
* @param eventType 响应级别
* @return
*/
@GetMapping("getListBySourceTypeOrEventType")
@ -671,5 +673,28 @@ public class IcEventController {
return new Result<List<IcEventResultDTO>>().ok(icEventService.getListByStatus(orgId, orgType, eventType, sourceType, status, categoryCode));
}
/**
* @description 根据网格员ID获取统计事件处理情况和事件列表
* @author yan Lu
* @date 2023/6/2 16:13
*/
@GetMapping("getEventsByStaffId")
public Result<IcEventRsultCountDTO> getEventsByStaffId(@RequestParam("staffId") String staffId, @RequestParam("status") String status) {
IcEventRsultCountDTO data = new IcEventRsultCountDTO();
List<IcEventResultDTO> eventList = icEventService.getEventsByStaffId(staffId, status);
if (null != eventList && eventList.size() > 0) {
data.setEventTotal(eventList.size());
Long complateTotal = eventList.stream().filter(e -> e.getRepayStatus() >= 2).collect(Collectors.counting());
Long unComplateTotal = eventList.stream().filter(e -> e.getRepayStatus() < 2).collect(Collectors.counting());
data.setCompleteTotal(Math.toIntExact(complateTotal));
data.setUnCompleteTotal(Math.toIntExact(unComplateTotal));
data.setEventList(eventList);
} else {
data.setEventList(new ArrayList<>());
data.setEventTotal(0);
data.setCompleteTotal(0);
data.setUnCompleteTotal(0);
}
return new Result<IcEventRsultCountDTO>().ok(data);
}
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java

@ -219,4 +219,6 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
@Param("sourceType") String sourceType, @Param("eventType") String eventType);
GridOrVillageEventRateResultDTO getEventRateByGridIds(@Param("orgId") String orgId, @Param("orgType") String orgType);
List<IcEventResultDTO> getEventsByStaffId(@Param("staffId") String staffId, @Param("replyStatus") String status);
}

3
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -278,6 +278,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 根据事件处理状态查询列表
*
* @param sourceType 事件来源
* @param status 事件处理状态
* @return
@ -285,4 +286,6 @@ public interface IcEventService extends BaseService<IcEventEntity> {
List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String eventType, String sourceType, String status, String categoryCode);
List<IcEventResultDTO> getListBySourceTypeOrEventType(String orgId, String orgType, String sourceType, String eventType);
List<IcEventResultDTO> getEventsByStaffId(String staffId, String status);
}

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -2070,6 +2070,11 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
return baseDao.getListBySourceTypeOrEventType(getOrgPath(orgId, orgType), sourceType, eventType);
}
@Override
public List<IcEventResultDTO> getEventsByStaffId(String staffId,String status) {
return baseDao.getEventsByStaffId(staffId,status);
}
/**
* @deprecationg 获取orgPath
*/

23
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -606,6 +606,7 @@
e.GRID_ID AS gridId,
e.SOURCE_TYPE AS sourceType,
e.EVENT_TYPE AS eventType,
e.REPLY_STATUS AS repayStatus,
e.LATITUDE,
e.LONGITUDE,
e.EVENT_CONTENT AS eventContent,
@ -681,4 +682,26 @@
</where>
</select>
<select id="getEventsByStaffId" resultType="com.epmet.dto.result.IcEventResultDTO">
SELECT
<include refid="eventArguments"/>
FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
<if test="null != staffId and staffId != ''">
AND r.FROM_USER_ID = #{staffId}
</if>
LEFT JOIN ic_event_category c ON c.IC_EVENT_ID = e.ID
<where>
e.DEL_FLAG = 0
<if test="replyStatus == 0 and replyStatus !=''">
AND (e.REPLY_STATUS = 0 OR e.REPLY_STATUS = 1 OR e.REPLY_STATUS IS NULL)
</if>
<if test="replyStatus == 1 and replyStatus !=''">
AND (e.REPLY_STATUS = 2 OR e.REPLY_STATUS = 3 OR e.REPLY_STATUS = 4 OR e.REPLY_STATUS = 5)
</if>
</where>
GROUP BY e.ID,c.ic_event_id,r.ic_event_id
ORDER BY r.MANAGE_TIME DESC,e.CREATED_TIME DESC
</select>
</mapper>

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -53,8 +53,10 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/**
* 查询具有某角色的staff列表
*
* @param roleKey
* @param orgId
* @return
@ -71,9 +73,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
}
/**
* @return Result<StaffRolesResultDTO>
* @Description 得到某一个员工在一个客户下的所有角色
* @Param CommonUserFormDTO :: getUserId :: getCustomerId
* @return Result<StaffRolesResultDTO>
* @Author wangc
* @Date 2020.04.26 10:59
**/
@ -83,9 +85,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
}
/**
* @Description 查找具有特定角色的人员Id(可用)
* @param rolesUsersListFormDTO
* @return Result<String>
* @Description 查找具有特定角色的人员Id(可用)
* @author wangc
* @date 2020.04.29 23:44
**/
@ -136,7 +138,8 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
if (CollectionUtils.isEmpty(forms)) {
return new ArrayList<>();
}
List<String> userIds = forms.stream().map(m -> m.getStaffId()).distinct().collect(Collectors.toList());
//不用为什么要下面这一句?
// List<String> userIds = forms.stream().map(m -> m.getStaffId()).distinct().collect(Collectors.toList());
// List<GridStaffResultDTO> result = baseDao.staffGridRoleByIds(userIds);
List<GridStaffResultDTO> result = baseDao.staffGridRole(forms);
if (CollectionUtils.isEmpty(result)) {
@ -206,6 +209,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
/**
* Desc: 查询是否是超级管理员
*
* @param userId
* @author zxc
* @date 2022/7/13 11:03

7
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -200,11 +200,14 @@
SELECT
#{s.gridId} as gridId,
sr.STAFF_ID,
cs.MOBILE
cs.MOBILE,
YEAR(NOW())-YEAR(cs.BIRTHDAY) AS age,
cs.GENDER
FROM staff_role sr
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0
LEFT JOIN customer_staff cs ON cs.USER_ID = sr.STAFF_ID AND cs.customer_id = sr.customer_id AND cs.DEL_FLAG = 0
WHERE sr.DEL_FLAG = 0
WHERE
sr.DEL_FLAG = 0
AND gsr.ROLE_KEY = 'grid_member'
AND sr.STAFF_ID = #{s.staffId}
</foreach>

Loading…
Cancel
Save