暂存
This commit is contained in:
@ -0,0 +1,73 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SysServicesTopic {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Long id;
|
||||
|
||||
/**
|
||||
* 问题id
|
||||
*/
|
||||
String topicId;
|
||||
|
||||
/**
|
||||
* 问题类型
|
||||
*/
|
||||
Integer topicType;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
Long uid;
|
||||
|
||||
Long fromUid;
|
||||
|
||||
Long toUid;
|
||||
|
||||
/**
|
||||
* 问题内容
|
||||
*/
|
||||
String content;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
JSONArray img;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
Date createTime;
|
||||
|
||||
/**
|
||||
* 0-未读 1-已读
|
||||
*/
|
||||
Integer read;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
Date updateTime;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
String role;
|
||||
|
||||
// 非持久化字段
|
||||
/**
|
||||
* 角色名字
|
||||
*/
|
||||
String name;
|
||||
|
||||
}
|
@ -8,7 +8,7 @@ public interface ISysServicesQuestionService {
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
SysServicesQuestion insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.uuid.UUID;
|
||||
import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
@ -26,9 +27,11 @@ public class SysServicesQuestionServiceImp implements ISysServicesQuestionServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSysServicesQuestion(SysServicesQuestion servicesQuestion) {
|
||||
public SysServicesQuestion insertSysServicesQuestion(SysServicesQuestion servicesQuestion) {
|
||||
// 生成uuid
|
||||
servicesQuestion.setQueId(UUID.randomUUID().toString().replaceAll("-", ""));
|
||||
servicesQuestion.setRead(1);
|
||||
servicesQuestion.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
servicesQuestionMapper.insertSysServicesQuestion(servicesQuestion);
|
||||
|
||||
@ -45,25 +48,31 @@ public class SysServicesQuestionServiceImp implements ISysServicesQuestionServic
|
||||
SysServicesQuestion dieticianStatus = new SysServicesQuestion();
|
||||
dieticianStatus.setUserId(customer.getMainDietitian());
|
||||
dieticianStatus.setRole("dietician");
|
||||
customerStatus.setRead(0);
|
||||
dieticianStatus.setRead(0);
|
||||
dieticianStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(dieticianStatus);
|
||||
|
||||
SysServicesQuestion afterSaleStatus = new SysServicesQuestion();
|
||||
afterSaleStatus.setUserId(customer.getAfterDietitian());
|
||||
afterSaleStatus.setRole("after_sale");
|
||||
customerStatus.setRead(0);
|
||||
afterSaleStatus.setRead(0);
|
||||
afterSaleStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(afterSaleStatus);
|
||||
|
||||
SysServicesQuestion dieticianAssistantStatus = new SysServicesQuestion();
|
||||
dieticianAssistantStatus.setUserId(customer.getAssistantDietitian());
|
||||
dieticianAssistantStatus.setRole("dietician_assistant");
|
||||
customerStatus.setRead(0);
|
||||
dieticianAssistantStatus.setRead(0);
|
||||
dieticianAssistantStatus.setQueId(servicesQuestion.getQueId());
|
||||
|
||||
statusList.add(dieticianAssistantStatus);
|
||||
|
||||
return servicesQuestionMapper.insertSysServicesQuestionStatus(statusList);
|
||||
servicesQuestionMapper.insertSysServicesQuestionStatus(statusList);
|
||||
|
||||
servicesQuestion.setId(customerStatus.getId());
|
||||
servicesQuestion.setCusId(null);
|
||||
|
||||
return servicesQuestion;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user