Browse Source

需求大厅

dev_shibei_match
yinzuomei 4 years ago
parent
commit
58ef2d14da
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java
  4. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java
  5. 100
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  6. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  7. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java
  8. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  9. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  10. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  11. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  12. 137
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  13. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

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

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

27
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -16,27 +17,31 @@ public class FinishStaffFromDTO implements Serializable {
public interface AddUserInternalGroup { public interface AddUserInternalGroup {
} }
public interface AddUserShowGroup extends CustomerClientShowGroup { public interface IcShowGroup extends CustomerClientShowGroup {
}
public interface ResiShowGroup extends CustomerClientShowGroup {
} }
@NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class)
private String demandRecId; private String demandRecId;
@NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class) @NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class)
private String serviceId; private String serviceId;
@NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class) @NotNull(message = "实际服务开始不能为空", groups = {IcShowGroup.class,ResiShowGroup.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceStartTime; private Date serviceStartTime;
@NotNull(message = "实际服务结束不能为空", groups = AddUserShowGroup.class) @NotNull(message = "实际服务结束不能为空", groups = {IcShowGroup.class,ResiShowGroup.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceEndTime; private Date serviceEndTime;
@NotBlank(message = "完成结果不能为空", groups = AddUserShowGroup.class) @NotBlank(message = "完成结果不能为空", groups = IcShowGroup.class)
private String finishResult; private String finishResult;
@Length(max = 1000,message = "最多输入1000字",groups = {IcShowGroup.class})
private String finishDesc; private String finishDesc;
@NotNull(message = "得分不能为空", groups = AddUserShowGroup.class) @NotNull(message = "得分不能为空", groups = IcShowGroup.class)
private BigDecimal score; private BigDecimal score;
@ -45,4 +50,14 @@ public class FinishStaffFromDTO implements Serializable {
private String userId; private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId; private String customerId;
/**
* pc完成情况完成+评价 UserDemandConstant.FINISH_AND_EVALUATE
* 居民端完成UserDemandConstant.FINISHED
*/
private String type;
/**
* pc完成情况UserDemandConstant.STAFF
* 居民端完成UserDemandConstant.RESI
*/
private String userType;
} }

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java

@ -23,7 +23,7 @@ public class ListHallFormDTO extends PageFormDTO implements Serializable {
/** /**
* 未处理unprocessed处理中processing已完成finished * 未处理unprocessed处理中processing已完成finished
*/ */
@NotBlank(message = "type不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "type不能为空,未处理:unprocessed;处理中:processing;已完成:finished", groups = AddUserInternalGroup.class)
private String type; private String type;
// 以下入参从token中获取 // 以下入参从token中获取

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求大厅-我要接单
*/
@Data
public class TakeOrderFormDTO implements Serializable {
private static final long serialVersionUID = -2030750128789890382L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "demandRecId不能为空", groups = AddUserInternalGroup.class)
private String demandRecId;
@NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

100
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java

@ -0,0 +1,100 @@
package com.epmet.dto.result.demand;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 需求大厅-需求详情
*/
@Data
public class DemandDetailResDTO implements Serializable {
private String demandRecId;
@JsonIgnore
private String categoryCode;
@JsonIgnore
private String parentCode;
/**
* 二级分类名称
*/
private String categoryName;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 需求内容
*/
private String content;
/**
* 服务要求-服务时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date wantServiceTime;
/**
* 服务要求-联系人需求人名称
*/
private String demandUserName;
/**
* 服务要求-联系人需求人电话
*/
private String demandUserMobile;
/**
* 服务地点
*/
private String serviceAddress;
/**
* 实际服务开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceStartTime;
/**
* 实际服务结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceEndTime;
/**
* 得分可为半星
*/
private BigDecimal score;
/**
* 完成结果已解决 resolved未解决 unresolved
*/
private String finishResult;
/**
* 完成情况
*/
private String finishDesc;
/**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/
private String status;
/**
* 1已评价0未评价;评价后ic_user_satisfaction表有记录
*/
private Boolean evaluateFlag;
/**
* 服务记录主键
*/
private String serviceId;
}

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -121,4 +121,14 @@ public class DemandRecResultDTO implements Serializable {
private String icResiUserId; private String icResiUserId;
private String epmetUserId; private String epmetUserId;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 服务地点
*/
private String serviceAddress;
} }

15
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
/**
* 需求大厅-我要接单
*/
@Data
public class TakeOrderResultDTO implements Serializable {
private static final long serialVersionUID = -4390598017224563310L;
private Boolean isVolunteer;
private String serviceId;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -59,4 +59,9 @@ public interface UserDemandConstant {
*/ */
String PERSONAL_DATA="personal-data"; String PERSONAL_DATA="personal-data";
String DEMAND_ANALYSIS="demand-analysis"; String DEMAND_ANALYSIS="demand-analysis";
/**
* pc完成情况完成+评价
*/
String FINISH_AND_EVALUATE="finish_and_evaluate";
} }

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

@ -187,7 +187,9 @@ public class IcUserDemandRecController {
public Result finish(@LoginUser TokenDto tokenDto,@RequestBody FinishStaffFromDTO formDTO){ public Result finish(@LoginUser TokenDto tokenDto,@RequestBody FinishStaffFromDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class); formDTO.setType(UserDemandConstant.FINISH_AND_EVALUATE);
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO); FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
if(finishResultDTO.getSendCalStatisfaction()){ if(finishResultDTO.getSendCalStatisfaction()){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();

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

@ -6,8 +6,14 @@ import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
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.ListHallFormDTO;
import com.epmet.dto.form.demand.TakeOrderFormDTO;
import com.epmet.dto.result.demand.DemandDetailResDTO;
import com.epmet.dto.result.demand.DemandHallResultDTO; import com.epmet.dto.result.demand.DemandHallResultDTO;
import com.epmet.dto.result.demand.TakeOrderResultDTO;
import com.epmet.service.IcUserDemandRecService; import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -45,4 +51,47 @@ public class ResiDemandController {
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)); return new Result<List<DemandHallResultDTO>>().ok(icUserDemandRecService.listHall(formDTO));
} }
/**
* 需求大厅-需求详情
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("detail-hall")
public Result<DemandDetailResDTO> queryDetailHall(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
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){
formDTO.setUserId(tokenDto.getUserId());
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){
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);
icUserDemandRecService.finish(formDTO);
return new Result();
}
} }

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

@ -182,4 +182,18 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return * @return
*/ */
List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO); List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO);
/**
* 需求大厅-需求详情
* @param formDTO
* @return
*/
DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO);
/**
* 需求大厅-我要接单
* @param formDTO
* @return
*/
TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO);
} }

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

@ -38,10 +38,7 @@ import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao; import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao; import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao; import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.*;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.FindIcUserFormDTO; import com.epmet.dto.form.FindIcUserFormDTO;
import com.epmet.dto.form.ResiUserFormDTO; import com.epmet.dto.form.ResiUserFormDTO;
@ -54,6 +51,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService; import com.epmet.service.IcUserDemandRecService;
import com.epmet.service.VolunteerInfoService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -91,7 +89,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired @Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient; private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private VolunteerInfoService volunteerInfoService;
@Override @Override
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) { public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) {
@ -477,53 +476,63 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//已经完成 //已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg()); throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
} }
//1、修改主表
entity.setStatus(UserDemandConstant.FINISHED);
entity.setFinishResult(formDTO.getFinishResult());
entity.setEvaluateFlag(true);
baseDao.updateById(entity);
//2、插入操作日志 //1、插入完成操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity(); IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId()); logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId()); logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.STAFF); logEntity.setUserType(formDTO.getUserType());
logEntity.setUserId(formDTO.getUserId()); logEntity.setUserId(formDTO.getUserId());
logEntity.setActionCode(UserDemandConstant.FINISH); logEntity.setActionCode(UserDemandConstant.FINISH);
logEntity.setOperateTime(new Date()); logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity); operateLogDao.insert(logEntity);
// 2.1插入评价日志
IcUserDemandOperateLogEntity evaluateEntity=ConvertUtils.sourceToTarget(logEntity,IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
operateLogDao.insert(evaluateEntity);
//3、更新服务记录
//2、更新服务记录,记录实际开始,实际结束时间
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId()); IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId());
if(null==serviceEntity){ if(null==serviceEntity){
throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg()); throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg());
} }
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
serviceEntity.setFinishDesc(formDTO.getFinishDesc()); serviceEntity.setFinishDesc(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandServiceDao.updateById(serviceEntity); demandServiceDao.updateById(serviceEntity);
//4、插入评价 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(); IcUserDemandSatisfactionEntity satisfactionEntity=new IcUserDemandSatisfactionEntity();
satisfactionEntity.setCustomerId(formDTO.getCustomerId()); satisfactionEntity.setCustomerId(formDTO.getCustomerId());
satisfactionEntity.setDemandRecId(formDTO.getDemandRecId()); satisfactionEntity.setDemandRecId(formDTO.getDemandRecId());
satisfactionEntity.setUserType(UserDemandConstant.STAFF); satisfactionEntity.setUserType(formDTO.getUserType());
satisfactionEntity.setUserId(formDTO.getUserId()); satisfactionEntity.setUserId(formDTO.getUserId());
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime()); satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setScore(formDTO.getScore()); satisfactionEntity.setScore(formDTO.getScore());
demandSatisfactionDao.insert(satisfactionEntity); demandSatisfactionDao.insert(satisfactionEntity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setPartyUnitId(serviceEntity.getServerId()); // 3.2插入评价操作日志
finishResultDTO.setSendCalStatisfaction(false); IcUserDemandOperateLogEntity evaluateEntity=ConvertUtils.sourceToTarget(logEntity,IcUserDemandOperateLogEntity.class);
//5、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。 evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
operateLogDao.insert(evaluateEntity);
//3.3、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){ if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
finishResultDTO.setSendCalStatisfaction(true); finishResultDTO.setSendCalStatisfaction(true);
} }
//3.4更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
}
//4、修改主表状态为已完成
entity.setStatus(UserDemandConstant.FINISHED);
baseDao.updateById(entity);
return finishResultDTO; return finishResultDTO;
} }
@ -988,5 +997,85 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return result.getList(); return result.getList();
} }
/**
* 需求大厅-需求详情
*
* @param formDTO
* @return
*/
@Override
public DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO) {
DemandRecResultDTO demandRecResultDTO = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId());
if (null != demandRecResultDTO) {
DemandDetailResDTO result = ConvertUtils.sourceToTarget(demandRecResultDTO, DemandDetailResDTO.class);
//设置分类名称
IcResiDemandDictEntity demandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), result.getCategoryCode());
if (null != demandDictEntity) {
result.setCategoryName(demandDictEntity.getCategoryName());
}
return result;
}
return null;
}
/**
* 需求大厅-我要接单
*
* @param formDTO
* @return
*/
@Override
public TakeOrderResultDTO takeOrder(TakeOrderFormDTO 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())) {
//待处理的才可以抢单
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getMsg());
}
TakeOrderResultDTO takeOrderResultDTO=new TakeOrderResultDTO();
//只有志愿者才可以接单
VolunteerInfoDTO volunteerInfoDTO=volunteerInfoService.queryUserVolunteerInfo(formDTO.getUserId());
if(null==volunteerInfoDTO){
takeOrderResultDTO.setIsVolunteer(false);
return takeOrderResultDTO;
}
takeOrderResultDTO.setIsVolunteer(true);
//1、修改主表
//置为已接单
entity.setStatus(UserDemandConstant.HAVE_ORDER);
baseDao.updateById(entity);
//2、插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(entity.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.RESI);
logEntity.setUserId(formDTO.getUserId());
logEntity.setActionCode(UserDemandConstant.TAKE_ORDER);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
//3、插入或更新服务记录
IcUserDemandServiceEntity origin=demandServiceDao.selectByRecId(formDTO.getDemandRecId());
String serviceId="";
if (null == origin) {
IcUserDemandServiceEntity serviceEntity=new IcUserDemandServiceEntity();
serviceEntity.setCustomerId(entity.getCustomerId());
serviceEntity.setDemandRecId(entity.getId());
serviceEntity.setServiceType(UserDemandConstant.VOLUNTEER);
serviceEntity.setServerId(formDTO.getUserId());
demandServiceDao.insert(serviceEntity);
serviceId=serviceEntity.getId();
}else{
origin.setServiceType(UserDemandConstant.VOLUNTEER);
origin.setServerId(formDTO.getUserId());
origin.setUpdatedBy(formDTO.getUserId());
demandServiceDao.updateById(origin);
serviceId=origin.getId();
}
takeOrderResultDTO.setServiceId(serviceId);
return takeOrderResultDTO;
}
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -205,7 +205,9 @@
CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID
ELSE '' ELSE ''
END END
) as epmetUserId ) as epmetUserId,
r.AWARD_POINT as awardPoint,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress
FROM FROM
ic_user_demand_rec r ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )

Loading…
Cancel
Save