Browse Source

pc完成情况修改

dev_shibei_match
yinzuomei 4 years ago
parent
commit
db83e7b7c1
  1. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java
  2. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  3. 37
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

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

@ -2,7 +2,6 @@ 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;
@ -35,13 +34,13 @@ public class FinishStaffFromDTO implements Serializable {
@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 = IcShowGroup.class) // @NotBlank(message = "完成结果不能为空", groups = IcShowGroup.class)
private String finishResult; private String finishResult;
@Length(max = 1000,message = "最多输入1000字",groups = {IcShowGroup.class}) // @Length(max = 1000,message = "最多输入1000字",groups = {IcShowGroup.class})
private String finishDesc; private String finishDesc;
@NotNull(message = "得分不能为空", groups = IcShowGroup.class) // @NotNull(message = "得分不能为空", groups = IcShowGroup.class)
private BigDecimal score; private BigDecimal score;

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

@ -82,4 +82,5 @@ public interface UserDemandConstant {
String DEFAULT_EVALUATE_REMARK="此用户没有填写内容,由系统默认评分"; String DEFAULT_EVALUATE_REMARK="此用户没有填写内容,由系统默认评分";
// 完成结果:已解决 resolved,未解决 unresolved // 完成结果:已解决 resolved,未解决 unresolved
String RESOLVED="resolved"; String RESOLVED="resolved";
String UN_RESOLVED="unresolved";
} }

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

@ -436,23 +436,26 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
// 2、pc完成情况:完成+评价 // 2、pc完成情况:完成+评价
if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){ if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){
//2.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(nowDate);
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandSatisfactionDao.insert(satisfactionEntity);
// 2.2插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(nowDate);
evaluateEntity.setId(null);
operateLogDao.insert(evaluateEntity);
//2.3更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
if(StringUtils.isNotBlank(formDTO.getFinishResult())){
// 评价
//2.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(nowDate);
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandSatisfactionDao.insert(satisfactionEntity);
// 2.2插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(nowDate);
evaluateEntity.setId(null);
operateLogDao.insert(evaluateEntity);
//2.3更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
}
//2.4如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。 //2.4如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
sendVolunnterEvaluated(entity); sendVolunnterEvaluated(entity);
@ -466,7 +469,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent(); String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent();
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content)); finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content));
finishResultDTO.setFinishResult(formDTO.getFinishResult()); finishResultDTO.setFinishResult(StringUtils.isNotBlank(formDTO.getFinishResult())?formDTO.getFinishResult():UserDemandConstant.UN_RESOLVED);
} }
baseDao.updateById(entity); baseDao.updateById(entity);

Loading…
Cancel
Save