Browse Source

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

dev
zxc 4 years ago
parent
commit
3a83357ae8
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CancelDemandFormDTO.java
  3. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
  4. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
  5. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  6. 83
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  7. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  8. 119
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  9. 41
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  10. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java
  11. 24
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java
  12. 28
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  13. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  14. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -93,8 +93,8 @@ public enum EpmetErrorCode {
DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"),
DEMAND_NOT_EXITS(8224,"需求不存在"),
DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"),
DEMAND_CAN_NOT_TAKE_ORDER(8226, "当前状态,不可指派"),
DEMAND_CAN_NOT_TAKE_ORDER(8226, "当前状态,不可接单"),
DEMAND_CAN_NOT_EVALUATE(8227, "当前状态,不可评价"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java → epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CancelDemandFormDTO.java

@ -4,8 +4,11 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 取消需求入参dto
*/
@Data
public class StaffCancelFormDTO {
public class CancelDemandFormDTO {
public interface AddUserInternalGroup {}
@NotBlank(message = "需求id不能为空",groups = AddUserInternalGroup.class)
private String demandRecId;
@ -14,4 +17,12 @@ public class StaffCancelFormDTO {
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* staff:pc工作人员取消
* resi:居民端用户主动需求
* 代码里写死的UserDemandConstant.RESI/STAFF
*/
private String userType;
}

44
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 居民端-需求-服务评价入参
*/
@Data
public class EvaluateDemandFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface ShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class)
private String demandRecId;
@NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class)
private String serviceId;
@NotBlank(message = "完成结果不能为空", groups = ShowGroup.class)
private String finishResult;
@Length(max = 1000,message = "最多输入1000字",groups = {ShowGroup.class})
private String finishDesc;
@NotNull(message = "得分不能为空", groups = ShowGroup.class)
private BigDecimal score;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java

@ -10,6 +10,8 @@ import java.io.Serializable;
*/
@Data
public class FinishResultDTO implements Serializable {
private Boolean sendCalStatisfaction;
private String partyUnitId;
private String serverId;
private String serviceType;
private Boolean grantPoint;
private Integer awardPoint;
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -19,6 +19,7 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -29,10 +30,6 @@ import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
@ -150,10 +147,11 @@ public class IcUserDemandRecController {
* @return
*/
@PostMapping("cancel")
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody StaffCancelFormDTO formDTO){
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StaffCancelFormDTO.AddUserInternalGroup.class);
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class);
icUserDemandRecService.cancel(formDTO);
return new Result();
}
@ -191,14 +189,18 @@ public class IcUserDemandRecController {
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
if(finishResultDTO.getSendCalStatisfaction()){
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
}
return new Result();
}

83
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -1,19 +1,22 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.demand.DemandDetailFormDTO;
import com.epmet.dto.form.demand.FinishStaffFromDTO;
import com.epmet.dto.form.demand.ListHallFormDTO;
import com.epmet.dto.form.demand.TakeOrderFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandDetailResDTO;
import com.epmet.dto.result.demand.DemandHallResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.TakeOrderResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,18 +40,21 @@ import java.util.List;
public class ResiDemandController {
@Autowired
private IcUserDemandRecService icUserDemandRecService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* 居民端-需求大厅未处理处理中已完成
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("list-hall")
public Result<List<DemandHallResultDTO>> listHall(@LoginUser TokenDto tokenDto, @RequestBody ListHallFormDTO formDTO){
public Result<List<DemandHallResultDTO>> listHall(@LoginUser TokenDto tokenDto, @RequestBody ListHallFormDTO formDTO) {
formDTO.setCurrentUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class,ListHallFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, ListHallFormDTO.AddUserInternalGroup.class);
return new Result<List<DemandHallResultDTO>>().ok(icUserDemandRecService.listHall(formDTO));
}
@ -60,38 +66,91 @@ public class ResiDemandController {
* @return
*/
@PostMapping("detail-hall")
public Result<DemandDetailResDTO> queryDetailHall(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO){
public Result<DemandDetailResDTO> queryDetailHall(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,DemandDetailFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, DemandDetailFormDTO.AddUserInternalGroup.class);
return new Result<DemandDetailResDTO>().ok(icUserDemandRecService.queryDetailHall(formDTO));
}
/**
* 需求大厅-我要接单
*
* @param tokenDto
* @return
*/
@PostMapping("takeorder")
public Result<TakeOrderResultDTO> takeOrder(@LoginUser TokenDto tokenDto, @RequestBody TakeOrderFormDTO formDTO){
public Result<TakeOrderResultDTO> takeOrder(@LoginUser TokenDto tokenDto, @RequestBody TakeOrderFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,TakeOrderFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, TakeOrderFormDTO.AddUserInternalGroup.class);
return new Result<TakeOrderResultDTO>().ok(icUserDemandRecService.takeOrder(formDTO));
}
/**
* 需求大厅-完成需求
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("finish")
public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO){
public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setType(UserDemandConstant.FINISHED);
formDTO.setUserType(UserDemandConstant.RESI);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.ResiShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class);
icUserDemandRecService.finish(formDTO);
return new Result();
}
/**
* 我的需求-服务评价
* 已经完成的可以评价
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("evaluate")
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
}
return new Result();
}
/**
* 我的需求-取消需求
* 取消未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("cancel")
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setUserType(UserDemandConstant.RESI);
ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class);
icUserDemandRecService.cancel(formDTO);
return new Result();
}
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -106,11 +106,11 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
PageData<DemandRecResultDTO> pageList(UserDemandPageFormDTO formDTO);
/**
* 未完成之前都可以取消
* 未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param formDTO
*/
void cancel(StaffCancelFormDTO formDTO);
void cancel(CancelDemandFormDTO formDTO);
/**
* 指派
@ -196,4 +196,12 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO);
/**
* 居民端-我的需求-服务评价
*
* @param formDTO
* @return
*/
FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO);
}

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

@ -382,13 +382,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
/**
* 未完成之前都可以取消
* 未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void cancel(StaffCancelFormDTO formDTO) {
public void cancel(CancelDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
@ -403,11 +403,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
entity.setCancelTime(new Date());
baseDao.updateById(entity);
//2、插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.STAFF);
logEntity.setUserId(formDTO.getUserId());
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.CANCEL);
logEntity.setOperateTime(entity.getCancelTime());
operateLogDao.insert(logEntity);
@ -466,25 +462,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
@Transactional(rollbackFor = Exception.class)
@Override
public FinishResultDTO finish(FinishStaffFromDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
}
IcUserDemandRecEntity entity = checkFinishPreCondition(formDTO.getDemandRecId());
//1、插入完成操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(formDTO.getUserType());
logEntity.setUserId(formDTO.getUserId());
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.FINISH);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
@ -500,20 +481,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
serviceEntity.setFinishDesc(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandServiceDao.updateById(serviceEntity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setPartyUnitId(serviceEntity.getServerId());
finishResultDTO.setSendCalStatisfaction(false);
// 3、pc完成情况:完成+评价
if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){
//3.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=new IcUserDemandSatisfactionEntity();
satisfactionEntity.setCustomerId(formDTO.getCustomerId());
satisfactionEntity.setDemandRecId(formDTO.getDemandRecId());
satisfactionEntity.setUserType(formDTO.getUserType());
satisfactionEntity.setUserId(formDTO.getUserId());
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setScore(formDTO.getScore());
demandSatisfactionDao.insert(satisfactionEntity);
// 3.2插入评价操作日志
@ -521,11 +493,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
operateLogDao.insert(evaluateEntity);
//3.3、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
finishResultDTO.setSendCalStatisfaction(true);
}
//3.4更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
@ -535,9 +502,35 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
entity.setStatus(UserDemandConstant.FINISHED);
baseDao.updateById(entity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
return finishResultDTO;
}
/**
* 校验需求是否可以点击完成
*
* @param demandRecId
* @return
*/
private IcUserDemandRecEntity checkFinishPreCondition(String demandRecId) {
IcUserDemandRecEntity entity=baseDao.selectById(demandRecId);
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
}
return entity;
}
/**
* 数据分析-个人档案居民需求列表table
*
@ -1022,10 +1015,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
/**
* 需求大厅-我要接单
* 未处理列表中不包含自己提出的需求不会存在自己提的需求自己接单
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
@ -1079,5 +1074,51 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return takeOrderResultDTO;
}
/**
* 居民端-我的需求-服务评价
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) {
// 已完成的可以评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getMsg());
}
// todo 只有需求人才可以评价
// 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(new Date());
satisfactionEntity.setUserType(UserDemandConstant.RESI);
demandSatisfactionDao.insert(satisfactionEntity);
// 2、插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime());
evaluateEntity.setUserType(UserDemandConstant.RESI);
operateLogDao.insert(evaluateEntity);
// 3、更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
baseDao.updateById(entity);
//4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectById(formDTO.getServiceId());
FinishResultDTO finishResultDTO = new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
return finishResultDTO;
}
}

41
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -14,17 +14,25 @@
<result property="pmEndTime" column="pmEndTime"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<collection property="matterList" ofType="com.epmet.dto.MatterListDTO">
<result property="matterId" column="matterId"/>
<result property="allowTime" column="allowTime"/>
<result property="matterName" column="matterName"/>
<result property="startTime" column="startTime"/>
<result property="endTime" column="endTime"/>
<result property="appointmentType" column="appointmentType"/>
<result property="sort" column="sort"/>
<result property="matterImg" column="matterImg"/>
</collection>
<collection property="matterList" ofType="com.epmet.dto.MatterListDTO"
column="partyServiceCenterId" select="matterListByPartyServiceCenterId"/>
</resultMap>
<select id="matterListByPartyServiceCenterId" resultType="com.epmet.dto.MatterListDTO">
select
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.START_TIME AS startTime,
cm.END_TIME AS endTime,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
from ic_party_service_center_matter cm
where del_flag = 0
and PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId}
</select>
<select id="partyServiceCenterList" resultMap="partyServiceCenterListMap">
SELECT
sc.ID AS partyServiceCenterId,
@ -36,19 +44,8 @@
sc.PM_START_TIME AS pmStartTime,
sc.PM_END_TIME AS pmEndTime,
sc.LONGITUDE AS longitude,
sc.LATITUDE AS latitude,
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.START_TIME AS startTime,
cm.END_TIME AS endTime,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
sc.LATITUDE AS latitude
FROM ic_party_service_center sc
LEFT JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = sc.ID AND cm.DEL_FLAG = 0)
WHERE sc.DEL_FLAG = 0
AND ORG_ID = #{orgId}
ORDER BY sc.CREATED_TIME DESC

22
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -31,4 +32,25 @@ public class NewEventsResultDTO implements Serializable {
private List<String> eventImgs;
private String eventId;
/**
* 语音附件url集合
*/
private List<String> voiceList;
/**
* 事件附件
*/
@JsonIgnore
private List<EventDetailResultDTO.Attachment> attachmentList;
@Data
public static class Attachment {
/**
* url
*/
private String url;
/**
* 附件类型
*/
private String type;
}
}

24
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -58,4 +59,27 @@ public class UserMentionResultDTO implements Serializable {
*/
private String replyButtonFlag;
/**
* 语音附件url集合
*/
private List<String> voiceList;
/**
* 事件附件
*/
@JsonIgnore
private List<EventDetailResultDTO.Attachment> attachmentList;
@Data
public static class Attachment {
/**
* url
*/
private String url;
/**
* 附件类型
*/
private String type;
}
}

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

@ -627,6 +627,19 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
formDTO.getPageSize()).doSelectPageInfo(() -> resiEventMentionDao.selectMentionList(formDTO.getUserId(),
formDTO.getReadFlag()));
result.getList().forEach(dto->{
//附件按类型分组【图片、语音】
List<String> imgList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
dto.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imgList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
dto.setImgList(imgList);
dto.setVoiceList(voiceList);
if(dto.getShiftProject()||dto.getStatus().equals(EventConstant.EVENT_STATUS_CLOSED_CASE)){
// 立项和办结了不能回复哈。
dto.setReplyButtonFlag("false");
@ -652,6 +665,21 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
List<String> orgIds = listResult.getData();
if (!CollectionUtils.isEmpty(orgIds)){
List<NewEventsResultDTO> result = baseDao.newEvents(orgIds);
//附件按类型分组【图片、语音】
result.forEach(re->{
List<String> eventImgs = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
re.getAttachmentList().forEach(file->{
if ("image".equals(file.getType())) {
eventImgs.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
re.setEventImgs(eventImgs);
re.setVoiceList(voiceList);
});
return result;
}
return new ArrayList<>();

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

@ -31,7 +31,7 @@
(CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject,
(CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot
FROM resi_event_report_org ro
INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0')
INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed')
AND ro.DEL_FLAG = '0'
and ro.ORG_ID = #{orgId}
<if test='eventType == "undisposed" '>
@ -185,18 +185,23 @@
<result property="eventContent" column="eventContent"/>
<result property="eventTime" column="eventTime"/>
<result property="eventId" column="eventId"/>
<collection property="eventImgs" ofType="java.lang.String">
<result column="img"/>
<collection property="attachmentList" ofType="com.epmet.dto.result.NewEventsResultDTO$Attachment">
<result column="url" property="url"/>
<result column="type" property="type"/>
</collection>
<!--<collection property="eventImgs" ofType="java.lang.String">
<result column="img"/>
</collection>-->
</resultMap>
<select id="newEvents" resultMap="newEventsMap">
SELECT
IFNULL(re.EVENT_CONTENT,'') AS eventContent,
DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime,
ea.ATTACHMENT_URL AS img,
ea.attachment_url AS url,
ea.attachment_type AS type,
re.id as eventId
FROM resi_event_report_org ro
LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0')
LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed')
LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = ro.RESI_EVENT_ID AND ea.DEL_FLAG = '0' AND
ea.ATTACHMENT_TYPE = 'image' AND ea.SORT IN (3,1,2))
WHERE ro.DEL_FLAG = '0'

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

@ -10,11 +10,15 @@
<result property="status" column="STATUS" />
<result property="shiftProject" column="SHIFT_PROJECT" />
<result property="showTime" column="LATEST_OPERATED_TIME" />
<collection property="imgList" ofType="java.lang.String">
<collection property="attachmentList" ofType="com.epmet.dto.result.UserMentionResultDTO$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>
</collection>-->
</resultMap>
<select id="selectMentionList" parameterType="map" resultMap="UserMentionResultDTOMap">
@ -29,11 +33,12 @@
re.`STATUS`,
re.SHIFT_PROJECT,
re.LATEST_OPERATED_TIME,
rea.ATTACHMENT_URL as img_url
rea.attachment_url AS url,
rea.attachment_type AS type
FROM
resi_event_mention rem
LEFT JOIN resi_event re
ON ( rem.RESI_EVENT_ID = re.id )
ON ( rem.RESI_EVENT_ID = re.id AND re.audit_status = 'auto_passed')
LEFT JOIN resi_event_attachment rea
ON ( re.id = rea.RESI_EVENT_ID
AND rea.DEL_FLAG = '0'

Loading…
Cancel
Save