提交 f5e152da 作者: 沈振路

Merge branch 'customer_service_SZlu'

package com.yaoyaozw.customer.dto.customer;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -47,4 +48,18 @@ public class CustomerDelaySaveDTO implements Serializable {
@ApiModelProperty("消息内容实体")
private CustomerReferralDTO customerReferralDto;
private Integer hour;
private Integer minute;
public Long getTimeInterval() {
long stamp = 0L;
if (ObjectUtil.isNotNull(this.hour)) {
stamp += this.hour * 1000 * 60 * 60;
}
if (ObjectUtil.isNotNull(this.minute)) {
stamp += this.minute * 1000 * 60;
}
return stamp == 0 ? null : stamp;
}
}
package com.yaoyaozw.customer.dto.customer;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -35,5 +36,19 @@ public class CustomerDelayTextSaveDTO implements Serializable {
@ApiModelProperty("客服消息类型(图文、文本)")
private String type;
private Integer hour;
private Integer minute;
public Long getTimeInterval() {
long stamp = 0L;
if (ObjectUtil.isNotNull(this.hour)) {
stamp += this.hour * 1000 * 60 * 60;
}
if (ObjectUtil.isNotNull(this.minute)) {
stamp += this.minute * 1000 * 60;
}
return stamp == 0 ? null : stamp;
}
}
......@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.components.CustomerServiceCommonAsyncComponent;
import com.yaoyaozw.customer.components.SnowflakeComponent;
......@@ -61,6 +62,16 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
@Override
public GenericsResult<String> insertCustomerDelay(CustomerDelayTextSaveDTO saveDto) {
StringBuilder builder = new StringBuilder();
if (StringUtils.isBlank(saveDto.getName())) {
builder.append("请填写标题");
}
if (ObjectUtil.isNull(saveDto.getTimeInterval())) {
builder.append(StringUtils.isBlank(builder) ? "请填写时间" : "、时间");
}
if (StringUtils.isNotBlank(builder)) {
return new GenericsResult<>(false, builder.toString());
}
// 主体数据
localLog.info("处理主体数据");
CustomerGraphicsDelay customerGraphicsDelay = new CustomerGraphicsDelay();
......
package com.yaoyaozw.customer.vo.customer;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.dto.customer.CustomerReferralDTO;
......@@ -54,4 +55,24 @@ public class CustomerDelayGraphicsDetailVO implements Serializable {
private AuthInfoVO authInfoVo;
private Integer hour;
private Integer minute;
public Integer getHour() {
if (ObjectUtil.isNull(this.timeInterval)) {
return null;
}
long hourNum = this.timeInterval / (1000 * 60 * 60);
return Integer.parseInt(String.valueOf(hourNum));
}
public Integer getMinute() {
// 除去小时,取余
long minuteRest = this.timeInterval % (1000 * 60 * 60);
// 转换成分钟
long minuteNum = minuteRest / (1000 * 60);
return Integer.parseInt(String.valueOf(minuteNum));
}
}
package com.yaoyaozw.customer.vo.customer;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.constants.CustomerCommonConstant;
......@@ -37,6 +38,8 @@ public class CustomerDelayListVO implements Serializable {
@ApiModelProperty("时间间隔")
private String timeInterval;
private Long timeStamp;
@ApiModelProperty("发送状态值")
private String sendStatus;
......@@ -47,5 +50,23 @@ public class CustomerDelayListVO implements Serializable {
return CustomerCommonConstant.getCustomerType(this.type);
}
public String getTimeInterval() {
if (ObjectUtil.isNull(this.timeStamp)) {
return null;
}
// 小时
long hour = this.timeStamp / (1000 * 60 * 60);
// 去除小时
long minuteRest = this.timeStamp % (1000 * 60 * 60);
long minute = minuteRest / (1000 * 60);
if (hour == 0) {
return minute + "分钟";
}
if (minute == 0) {
return hour + "小时";
}
return hour + "小时" + minute + "分钟";
}
}
package com.yaoyaozw.customer.vo.customer;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.vo.AuthInfoVO;
......@@ -48,4 +49,25 @@ public class CustomerDelayTextDetailVO implements Serializable {
private AuthInfoVO authInfoVo;
private Integer hour;
private Integer minute;
public Integer getHour() {
if (ObjectUtil.isNull(this.timeInterval)) {
return null;
}
long hourNum = this.timeInterval / (1000 * 60 * 60);
return Integer.parseInt(String.valueOf(hourNum));
}
public Integer getMinute() {
// 除去小时,取余
long minuteRest = this.timeInterval % (1000 * 60 * 60);
// 转换成分钟
long minuteNum = minuteRest / (1000 * 60);
return Integer.parseInt(String.valueOf(minuteNum));
}
}
......@@ -48,17 +48,13 @@
cgd.type,
ai.nick_name as accountName,
cgd.post_sort as postSort,
t_dic.dic_value as timeInterval,
cgd.time_interval as `timestamp` ,
s_dic.dic_value as sendStatus
from customer_graphics_delay cgd
left join authorizer_info ai
on cgd.app_id = ai.appid
left join sys_dictionary t_dic
on t_dic.group_id = 'CUSTOMER_TIME_INTERVAL'
and t_dic.dic_key = cgd.time_interval
left join sys_dictionary s_dic
on s_dic.group_id = 'CUSTOMER_SEND_STATUS'
and s_dic.dic_key = cgd.send_status
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论