Browse Source

Merge remote-tracking branch 'origin/dev_ic_mp' into develop

# Conflicts:
#	epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
dev
yinzuomei 4 years ago
parent
commit
c6cd061e84
  1. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  3. 41
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventLsitFormDTO.java
  4. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
  5. 85
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventListResultDTO.java
  6. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java
  7. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java
  8. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java
  9. 41
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  10. 55
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  11. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -164,12 +164,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if(!demandUserRes.success()||null==demandUserRes.getData()){ if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常");
} }
updateEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId()); updateEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId());
// 查询需求人的居住地址 // 查询需求人的居住地址
Set<String> houseIds=new HashSet<>(); Set<String> houseIds=new HashSet<>();
houseIds.add(updateEntity.getDemandUserHouseId()); houseIds.add(updateEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(houseInfoRes.success()&&CollectionUtils.isNotEmpty(houseInfoRes.getData())){ if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO); HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
updateEntity.setServiceLocation(houseInfoDTO.getNeighborAddress(). updateEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName()) concat(houseInfoDTO.getNeighborHoodName())
@ -178,7 +180,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
.concat(houseInfoDTO.getDoorName())); .concat(houseInfoDTO.getDoorName()));
updateEntity.setLongitude(houseInfoDTO.getBuildingLongitude()); updateEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
updateEntity.setLatitude(houseInfoDTO.getBuildingLatitude()); updateEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
}
baseDao.updateById(updateEntity); baseDao.updateById(updateEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
@ -232,21 +233,22 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if(!demandUserRes.success()||null==demandUserRes.getData()){ if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"+ JSON.toJSONString(demandUserRes)); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"+ JSON.toJSONString(demandUserRes));
} }
insertEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId()); insertEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId());
// 查询需求人的居住地址 // 查询需求人的居住地址
Set<String> houseIds=new HashSet<>(); Set<String> houseIds=new HashSet<>();
houseIds.add(insertEntity.getDemandUserHouseId()); houseIds.add(insertEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds); Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(houseInfoRes.success()&&CollectionUtils.isNotEmpty(houseInfoRes.getData())){ if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
insertEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
} }
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
insertEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
baseDao.insert(insertEntity); baseDao.insert(insertEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(fromDTO.getCustomerId()); logEntity.setCustomerId(fromDTO.getCustomerId());

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -77,6 +77,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -310,7 +311,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
*/ */
@Override @Override
public List<OptionDTO> queryListVolunteer(String customerId, String staffId,String userRealName) { public List<OptionDTO> queryListVolunteer(String customerId, String staffId,String userRealName) {
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(customerId,staffId); CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == staffInfo) { if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常");
} }

41
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventLsitFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author sun
* @Description 事件未处理处理中已办结地图列表
**/
@Data
public class ResiEventLsitFormDTO implements Serializable {
/**
* 网格Id
*/
@NotBlank(message = "网格Id不能为空",groups = Event.class)
private String gridId;
/**
* 未处理:un_read处理中processing已办结closed_case
*/
@NotBlank(message = "statusCondition不能为空",groups = Event.class)
private String statusCondition;
/**
* 请求页码
* */
@Min(1)
private int pageNo = 1;
/**
* 每页多少条数据
* */
private int pageSize = 20;
/**
* 是否分页(:true :false)
* */
private Boolean isPage = true;
public interface Event {}
}

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java

@ -81,7 +81,7 @@ public class EventDetailResultDTO implements Serializable {
*/ */
private List<String> voiceList; private List<String> voiceList;
/** /**
* 报事图片 * 事件附件
*/ */
@JsonIgnore @JsonIgnore
private List<Attachment> attachmentList; private List<Attachment> attachmentList;

85
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventListResultDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author sun
* @Description 事件未处理处理中已办结地图列表
**/
@Data
public class ResiEventListResultDTO implements Serializable {
private static final long serialVersionUID = -7372245830000262134L;
/**
* 事件id
*/
private String resiEventId;
/**
* 事件内容
*/
private String eventContent;
/**
* 图片列表可为空
*/
private List<String> imgList;
/**
* true展示false不展示
*/
private Boolean redDot;
/**
* 处理中processing已办结closed_case
*/
private String status;
/**
* true:已转项目false未立项
*/
private Boolean shiftProject;
/**
* 列表显示时间用此列yyyy-MM-dd HH:mm:ss处理中上报事件时间处理中最新一次处理事件已办结办结时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date showTime;
/**
* true:显示回复false不显示回复按钮
*/
private String replyButtonFlag;
/**
* 事件是否被阅读过;1已读针对报事人待处理列表
*/
private Boolean readFlag;
/**
* 语音附件url集合
*/
private List<String> voiceList;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 事件附件
*/
@JsonIgnore
private List<EventDetailResultDTO.Attachment> attachmentList;
@Data
public static class Attachment {
/**
* url
*/
private String url;
/**
* 附件类型
*/
private String type;
}
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -265,4 +265,14 @@ public class ResiEventController {
return new Result(); return new Result();
} }
/**
* @Author sun
* @Description 事件未处理处理中已办结地图列表
**/
@PostMapping("resieventlist")
public Result<List<ResiEventListResultDTO>> resiEventList(@RequestBody ResiEventLsitFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiEventLsitFormDTO.Event.class);
return new Result<List<ResiEventListResultDTO>>().ok(resiEventService.resiEventList(formDTO));
}
} }

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java

@ -95,4 +95,10 @@ public interface ResiEventDao extends BaseDao<ResiEventEntity> {
* @return * @return
*/ */
List<PageUserReportEventResDTO> selectUserReported(PageUserReportEventFormDTO formDTO); List<PageUserReportEventResDTO> selectUserReported(PageUserReportEventFormDTO formDTO);
/**
* @Author sun
* @Description 查询网格下各种状态事件列表
**/
List<ResiEventListResultDTO> resiEventList(@Param("gridId") String gridId, @Param("statusCondition")String statusCondition);
} }

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java

@ -161,4 +161,10 @@ public interface ResiEventService extends BaseService<ResiEventEntity> {
* @Description 定时任务调用-事件语音附件自动审核 * @Description 定时任务调用-事件语音附件自动审核
**/ **/
void autoAudit(); void autoAudit();
/**
* @Author sun
* @Description 事件未处理处理中已办结地图列表
**/
List<ResiEventListResultDTO> resiEventList(ResiEventLsitFormDTO formDTO);
} }

41
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -997,5 +997,46 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
} }
/**
* @Author sun
* @Description 事件未处理处理中已办结地图列表
* 未处理 发了没有人看过的时间
* 处理中: 有人看正在处理中的
* 已办结有人看已经办结了的
**/
@Override
public List<ResiEventListResultDTO> resiEventList(ResiEventLsitFormDTO formDTO) {
PageInfo<ResiEventListResultDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.resiEventList(formDTO.getGridId(), formDTO.getStatusCondition()));
result.getList().forEach(resultDTO -> {
//附件按类型分组【图片、语音】
List<String> imgList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
resultDTO.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imgList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
resultDTO.setImgList(imgList);
resultDTO.setVoiceList(voiceList);
if (EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resultDTO.getStatus()) || resultDTO.getShiftProject()) {
// 已办结的、立项的不显示回复按钮
resultDTO.setReplyButtonFlag("false");
} else {
// 处理中的事件
if (resultDTO.getReadFlag()) {
// 被别人看过了就显示回复
resultDTO.setReplyButtonFlag("true");
} else {
//别人没看过
resultDTO.setReplyButtonFlag("false");
}
}
});
return result.getList();
}
} }

55
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

@ -98,6 +98,7 @@
and rea.ATTACHMENT_TYPE='image') and rea.ATTACHMENT_TYPE='image')
where re.DEL_FLAG='0' where re.DEL_FLAG='0'
and re.RECALL_FLAG='0' and re.RECALL_FLAG='0'
AND re.audit_status = 'auto_passed'
and re.REPORT_USER_ID=#{userId} and re.REPORT_USER_ID=#{userId}
<if test='statusCondition == "un_read" '> <if test='statusCondition == "un_read" '>
and re.READ_FLAG='0' and re.READ_FLAG='0'
@ -222,4 +223,58 @@
re.REPORT_USER_ID = #{epmetUserId} re.REPORT_USER_ID = #{epmetUserId}
</foreach> </foreach>
</select> </select>
<resultMap id="resiEventListResultMap" type="com.epmet.dto.result.ResiEventListResultDTO">
<id property="resiEventId" column="id"/>
<result property="eventContent" column="event_content"/>
<result property="redDot" column="red_dot" />
<result property="status" column="status" />
<result property="shiftProject" column="shift_project" />
<result property="showTime" column="latest_operated_time" />
<result property="readFlag" column="read_flag" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<collection property="attachmentList" ofType="com.epmet.dto.result.ResiEventListResultDTO$Attachment">
<result column="url" property="url"/>
<result column="type" property="type"/>
</collection>
<!--<collection property="imgList" ofType="java.lang.String">
<constructor>
<arg column="img_url"/>
</constructor>
</collection>-->
</resultMap>
<select id="resiEventList" parameterType="map" resultMap="resiEventListResultMap">
SELECT
re.id,
re.event_content,
(case when #{statusCondition} ='un_read' then '0' else re.red_dot end)as red_dot,
re.`status`,
re.shift_project,
re.latest_operated_time,
rea.attachment_url AS url,
rea.attachment_type AS type,
re.read_flag,
re.longitude,
re.latitude
FROM resi_event re
LEFT JOIN resi_event_attachment rea ON (re.id = rea.resi_event_id AND rea.del_flag = '0')
WHERE re.del_flag='0'
AND re.recall_flag='0'
AND re.audit_status = 'auto_passed'
<if test="gridId != null and gridId != ''">
AND re.grid_id = #{gridId}
</if>
<if test='statusCondition == "un_read" '>
AND re.read_flag = '0'
</if>
<if test='statusCondition != "un_read" '>
AND re.read_flag = '1'
AND re.`status` = #{statusCondition}
</if>
ORDER BY
re.latest_operated_time DESC,
rea.sort ASC
</select>
</mapper> </mapper>

2
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -499,7 +499,7 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
/** /**
* 查找居民端小程序里的用户对应ic里的人以及家属们 * 查找居民端小程序里的用户对应ic里的人以及家属们
* *
* @param epmetUserIdList * @param formDTO
* @return * @return
*/ */
@Override @Override

Loading…
Cancel
Save