修复翻页
This commit is contained in:
@ -1,76 +0,0 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SysServicesQuestion {
|
||||
/**
|
||||
* 问题状态id
|
||||
*/
|
||||
Long id;
|
||||
|
||||
/**
|
||||
* 问题id(搜索用)
|
||||
*/
|
||||
String queId;
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
Long cusId;
|
||||
|
||||
/**
|
||||
* 问题内容
|
||||
*/
|
||||
String content;
|
||||
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
JSONArray img;
|
||||
|
||||
/**
|
||||
* 问题类型
|
||||
*/
|
||||
Integer type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
Long userId;
|
||||
|
||||
}
|
@ -35,11 +35,11 @@ public class SysServicesTopic {
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
Long uid;
|
||||
String uid;
|
||||
|
||||
Long fromUid;
|
||||
String fromUid;
|
||||
|
||||
Long toUid;
|
||||
String toUid;
|
||||
|
||||
/**
|
||||
* 问题内容
|
||||
|
@ -1,19 +0,0 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysServicesQuestionMapper {
|
||||
List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int insertSysServicesQuestionStatus(List<SysServicesQuestion> servicesQuestion);
|
||||
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int inserSysServicesQuestionReply(SysServicesQuestion servicesQuestion);
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionSessionByQueId(String queId);
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
import com.stdiet.custom.domain.SysServicesTopic;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysServicesQuestionService {
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion);
|
||||
|
||||
SysServicesQuestion insertSysServicesQuestion(SysServicesQuestion servicesQuestion);
|
||||
|
||||
int updateSysServicesQuestionStatus(SysServicesQuestion sysServicesQuestion);
|
||||
|
||||
int inserSysServicesQuestionReply(SysServicesQuestion sysServicesQuestion);
|
||||
|
||||
List<SysServicesQuestion> selectSysServicesQuestionSessionByQueId(String queId);
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import com.stdiet.custom.domain.SysServicesQuestion;
|
||||
import com.stdiet.custom.domain.SysServicesTopic;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,102 +0,0 @@
|
||||
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;
|
||||
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||
import com.stdiet.custom.mapper.SysServicesQuestionMapper;
|
||||
import com.stdiet.custom.service.ISysServicesQuestionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysServicesQuestionServiceImp implements ISysServicesQuestionService {
|
||||
@Autowired
|
||||
SysServicesQuestionMapper servicesQuestionMapper;
|
||||
|
||||
@Autowired
|
||||
SysCustomerMapper sysCustomerMapper;
|
||||
|
||||
@Override
|
||||
public List<SysServicesQuestion> selectSysServicesQuestionByUserIdAndRole(SysServicesQuestion servicesQuestion) {
|
||||
return servicesQuestionMapper.selectSysServicesQuestionByUserIdAndRole(servicesQuestion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysServicesQuestion insertSysServicesQuestion(SysServicesQuestion servicesQuestion) {
|
||||
// 生成uuid
|
||||
servicesQuestion.setQueId(UUID.randomUUID().toString().replaceAll("-", ""));
|
||||
servicesQuestion.setRead(1);
|
||||
servicesQuestion.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
servicesQuestionMapper.insertSysServicesQuestion(servicesQuestion);
|
||||
|
||||
SysCustomer customer = sysCustomerMapper.selectSysCustomerById(servicesQuestion.getCusId());
|
||||
|
||||
List<SysServicesQuestion> statusList = new ArrayList<>();
|
||||
SysServicesQuestion customerStatus = new SysServicesQuestion();
|
||||
customerStatus.setUserId(customer.getId());
|
||||
customerStatus.setRole("customer");
|
||||
customerStatus.setRead(1);
|
||||
customerStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(customerStatus);
|
||||
|
||||
SysServicesQuestion dieticianStatus = new SysServicesQuestion();
|
||||
dieticianStatus.setUserId(customer.getMainDietitian());
|
||||
dieticianStatus.setRole("dietician");
|
||||
dieticianStatus.setRead(0);
|
||||
dieticianStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(dieticianStatus);
|
||||
|
||||
SysServicesQuestion afterSaleStatus = new SysServicesQuestion();
|
||||
afterSaleStatus.setUserId(customer.getAfterDietitian());
|
||||
afterSaleStatus.setRole("after_sale");
|
||||
afterSaleStatus.setRead(0);
|
||||
afterSaleStatus.setQueId(servicesQuestion.getQueId());
|
||||
statusList.add(afterSaleStatus);
|
||||
|
||||
SysServicesQuestion dieticianAssistantStatus = new SysServicesQuestion();
|
||||
dieticianAssistantStatus.setUserId(customer.getAssistantDietitian());
|
||||
dieticianAssistantStatus.setRole("dietician_assistant");
|
||||
dieticianAssistantStatus.setRead(0);
|
||||
dieticianAssistantStatus.setQueId(servicesQuestion.getQueId());
|
||||
|
||||
statusList.add(dieticianAssistantStatus);
|
||||
|
||||
servicesQuestionMapper.insertSysServicesQuestionStatus(statusList);
|
||||
|
||||
servicesQuestion.setId(customerStatus.getId());
|
||||
servicesQuestion.setCusId(null);
|
||||
|
||||
return servicesQuestion;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
@ -36,33 +36,33 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
|
||||
|
||||
servicesTopicMapper.insertSysServicesTopic(topic);
|
||||
|
||||
SysCustomer customer = sysCustomerMapper.selectSysCustomerById(topic.getUid());
|
||||
SysCustomer customer = sysCustomerMapper.selectSysCustomerById(Long.parseLong(topic.getUid()));
|
||||
|
||||
List<SysServicesTopic> statusList = new ArrayList<>();
|
||||
|
||||
SysServicesTopic customerStatus = new SysServicesTopic();
|
||||
customerStatus.setUid(customer.getId());
|
||||
customerStatus.setUid(String.valueOf(customer.getId()));
|
||||
customerStatus.setRole("customer");
|
||||
customerStatus.setRead(1);
|
||||
customerStatus.setTopicId(topic.getTopicId());
|
||||
statusList.add(customerStatus);
|
||||
|
||||
SysServicesTopic dieticianStatus = new SysServicesTopic();
|
||||
dieticianStatus.setUid(customer.getMainDietitian());
|
||||
dieticianStatus.setUid(String.valueOf(customer.getMainDietitian()));
|
||||
dieticianStatus.setRole("dietician");
|
||||
dieticianStatus.setRead(0);
|
||||
dieticianStatus.setTopicId(topic.getTopicId());
|
||||
statusList.add(dieticianStatus);
|
||||
|
||||
SysServicesTopic afterSaleStatus = new SysServicesTopic();
|
||||
afterSaleStatus.setUid(customer.getAfterDietitian());
|
||||
afterSaleStatus.setUid(String.valueOf(customer.getAfterDietitian()));
|
||||
afterSaleStatus.setRole("after_sale");
|
||||
afterSaleStatus.setRead(0);
|
||||
afterSaleStatus.setTopicId(topic.getTopicId());
|
||||
statusList.add(afterSaleStatus);
|
||||
|
||||
SysServicesTopic dieticianAssistantStatus = new SysServicesTopic();
|
||||
dieticianAssistantStatus.setUid(customer.getAssistantDietitian());
|
||||
dieticianAssistantStatus.setUid(String.valueOf(customer.getAssistantDietitian()));
|
||||
dieticianAssistantStatus.setRole("dietician_assistant");
|
||||
dieticianAssistantStatus.setRead(0);
|
||||
dieticianAssistantStatus.setTopicId(topic.getTopicId());
|
||||
|
Reference in New Issue
Block a user