接口开发完成
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@ -11,7 +12,7 @@ public class SysServicesQuestion {
|
||||
/**
|
||||
* 问题状态id
|
||||
*/
|
||||
String id;
|
||||
Long id;
|
||||
|
||||
/**
|
||||
* 问题id(搜索用)
|
||||
@ -72,4 +73,6 @@ public class SysServicesQuestion {
|
||||
*/
|
||||
Long userId;
|
||||
|
||||
SysServicesQuestionUserInfo userInfo;
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,11 @@ public interface SysServicesQuestionMapper {
|
||||
|
||||
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int insertSysServicesQuestionStatus(List<SysServicesQuestion> sysServicesQuestion);
|
||||
int insertSysServicesQuestionStatus(List<SysServicesQuestion> servicesQuestion);
|
||||
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int inserSysServicesQuestionReply(SysServicesQuestion servicesQuestion);
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionSessionByQueId(String queId);
|
||||
}
|
||||
|
@ -11,4 +11,8 @@ public interface ISysServicesQuestionService {
|
||||
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||
|
||||
int inserSysServicesQuestionReply(SysServicesQuestion sysServicesQuestion);
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionSessionByQueId(String queId);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import com.stdiet.common.utils.uuid.UUID;
|
||||
import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||
@ -26,6 +27,9 @@ public class SysServicesQuestionServiceImp implements ISysServicesQuestionServic
|
||||
|
||||
@Override
|
||||
public int insertSysServicesQuestion(SysServicesQuestion servicesQuestion) {
|
||||
// 生成uuid
|
||||
servicesQuestion.setQueId(UUID.randomUUID().toString().replaceAll("-", ""));
|
||||
|
||||
servicesQuestionMapper.insertSysServicesQuestion(servicesQuestion);
|
||||
|
||||
SysCustomer customer = sysCustomerMapper.selectSysCustomerById(servicesQuestion.getCusId());
|
||||
@ -34,25 +38,29 @@ public class SysServicesQuestionServiceImp implements ISysServicesQuestionServic
|
||||
SysServicesQuestion customerStatus = new SysServicesQuestion();
|
||||
customerStatus.setUserId(customer.getId());
|
||||
customerStatus.setRole("customer");
|
||||
customerStatus.setQueId(servicesQuestion.getId());
|
||||
customerStatus.setRead(1);
|
||||
customerStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(customerStatus);
|
||||
|
||||
SysServicesQuestion dieticianStatus = new SysServicesQuestion();
|
||||
dieticianStatus.setUserId(customer.getMainDietitian());
|
||||
dieticianStatus.setRole("dietician");
|
||||
dieticianStatus.setQueId(servicesQuestion.getId());
|
||||
customerStatus.setRead(0);
|
||||
dieticianStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(dieticianStatus);
|
||||
|
||||
SysServicesQuestion afterSaleStatus = new SysServicesQuestion();
|
||||
afterSaleStatus.setUserId(customer.getAfterDietitian());
|
||||
afterSaleStatus.setRole("after_sale");
|
||||
afterSaleStatus.setQueId(servicesQuestion.getId());
|
||||
customerStatus.setRead(0);
|
||||
afterSaleStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(afterSaleStatus);
|
||||
|
||||
SysServicesQuestion dieticianAssistantStatus = new SysServicesQuestion();
|
||||
dieticianAssistantStatus.setUserId(customer.getAssistantDietitian());
|
||||
dieticianAssistantStatus.setRole("dietician_assistant");
|
||||
dieticianAssistantStatus.setQueId(servicesQuestion.getId());
|
||||
customerStatus.setRead(0);
|
||||
dieticianAssistantStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(dieticianAssistantStatus);
|
||||
|
||||
return servicesQuestionMapper.insertSysServicesQuestionStatus(statusList);
|
||||
@ -63,4 +71,23 @@ public class SysServicesQuestionServiceImp implements ISysServicesQuestionServic
|
||||
public int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion) {
|
||||
return servicesQuestionMapper.updateSysServicesQuestionStatus(sysServicesQuestion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int inserSysServicesQuestionReply(SysServicesQuestion sysServicesQuestion) {
|
||||
int row = servicesQuestionMapper.inserSysServicesQuestionReply(sysServicesQuestion);
|
||||
if (row > 0) {
|
||||
// 设置未读
|
||||
SysServicesQuestion status = new SysServicesQuestion();
|
||||
status.setRead(0);
|
||||
status.setQueId(sysServicesQuestion.getQueId());
|
||||
status.setRole(sysServicesQuestion.getRole());
|
||||
servicesQuestionMapper.updateSysServicesQuestionStatus(status);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysServicesQuestion> selectSysServicesQuestionSessionByQueId(String queId) {
|
||||
return servicesQuestionMapper.selectSysServicesQuestionSessionByQueId(queId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user