Commit b56732a6 authored by 廖旭伟's avatar 廖旭伟

问答管理,建议管理,帮助管理,消息推送等后端接口

parent a576e758
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 评价等级
*/
public enum EvaluateLevelEnum implements IBaseEnum {
LEVEL_0(0,"未评价",SysConstains.STYLE_DEFAULT),
LEVEL_1(1,"非常不满意",SysConstains.STYLE_DEFAULT),
LEVEL_2(2,"不满意", SysConstains.STYLE_DEFAULT),
LEVEL_3(3,"基本满意",SysConstains.STYLE_DEFAULT),
LEVEL_4(4,"满意", SysConstains.STYLE_DEFAULT),
LEVEL_5(5,"完美解决问题", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
EvaluateLevelEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static EvaluateLevelEnum getByValue(int value) {
for (EvaluateLevelEnum e : EvaluateLevelEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (EvaluateLevelEnum item : EvaluateLevelEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 评价类型
*/
public enum EvaluateType implements IBaseEnum {
USEFUL(1,"有用", SysConstains.STYLE_DEFAULT),
USELESS(2,"没用", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
EvaluateType(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static EvaluateType getByValue(int value) {
for (EvaluateType e : EvaluateType.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (EvaluateType item : EvaluateType.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 消息类型
*/
public enum MessageTypeEnum implements IBaseEnum {
TITLE(1,"提标题消息", SysConstains.STYLE_DEFAULT),
DYNAMIC(2,"动态消息", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
MessageTypeEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static MessageTypeEnum getByValue(int value) {
for (MessageTypeEnum e : MessageTypeEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (MessageTypeEnum item : MessageTypeEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 问题记录类型
*/
public enum QuestionRecordType implements IBaseEnum {
QUESTION(1,"提问", SysConstains.STYLE_DEFAULT),
ANSWER(2,"答复", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
QuestionRecordType(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static QuestionRecordType getByValue(int value) {
for (QuestionRecordType e : QuestionRecordType.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (QuestionRecordType item : QuestionRecordType.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 问答状态
*/
public enum QuestionStatusEnum implements IBaseEnum {
NOT_FINISHED(0,"未完成", SysConstains.STYLE_DEFAULT),
Finished(1,"已完成", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
QuestionStatusEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static QuestionStatusEnum getByValue(int value) {
for (QuestionStatusEnum e : QuestionStatusEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (QuestionStatusEnum item : QuestionStatusEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 查阅状态
*/
public enum ReadStatusEnum implements IBaseEnum {
READ(1,"已读", SysConstains.STYLE_DEFAULT),
UN_READ(0,"未读", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
ReadStatusEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static ReadStatusEnum getByValue(int value) {
for (ReadStatusEnum e : ReadStatusEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (ReadStatusEnum item : ReadStatusEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 客户建议回复状态
*/
public enum ReplyStatusEnum implements IBaseEnum {
UN_REPLY(0,"未回复", SysConstains.STYLE_DEFAULT),
REPLY(1,"已回复", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
ReplyStatusEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static ReplyStatusEnum getByValue(int value) {
for (ReplyStatusEnum e : ReplyStatusEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (ReplyStatusEnum item : ReplyStatusEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 发送方式
*/
public enum SendModeEnum implements IBaseEnum {
ON_SITE(1,"站内发送", SysConstains.STYLE_DEFAULT),
ON_SMS(2,"短信发送", SysConstains.STYLE_DEFAULT),
ALL(3,"同时发送", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
SendModeEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static SendModeEnum getByValue(int value) {
for (SendModeEnum e : SendModeEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (SendModeEnum item : SendModeEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 发送范围
*/
public enum SendScopeEnum implements IBaseEnum {
ALL(1,"所有人可见", SysConstains.STYLE_DEFAULT),
VIP(2,"VIP可见", SysConstains.STYLE_DEFAULT),
ORDINARY(3,"普通用户可见", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
SendScopeEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static SendScopeEnum getByValue(int value) {
for (SendScopeEnum e : SendScopeEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (SendScopeEnum item : SendScopeEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 发送状态
*/
public enum SendStatusEnum implements IBaseEnum {
UNSENT(0,"未发送", SysConstains.STYLE_DEFAULT),
SENT(1,"已发送", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
SendStatusEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static SendStatusEnum getByValue(int value) {
for (SendStatusEnum e : SendStatusEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (SendStatusEnum item : SendStatusEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
......@@ -3,8 +3,6 @@ package com.mortals.xhx.module.customer.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -15,10 +13,10 @@ import com.mortals.xhx.module.customer.model.vo.CustomerVo;
* 客户管理实体对象
*
* @author zxfei
* @date 2022-06-13
* @date 2022-07-01
*/
public class CustomerEntity extends CustomerVo implements IUser {
public class CustomerEntity extends CustomerVo implements IUser {
private static final long serialVersionUID = 1L;
/**
......@@ -65,6 +63,10 @@ public class CustomerEntity extends CustomerVo implements IUser {
* 职位
*/
private String job;
/**
* 头像图片地址
*/
private String avatar;
/**
* 客户来源
*/
......@@ -76,7 +78,6 @@ public class CustomerEntity extends CustomerVo implements IUser {
/**
* 最后一次登录时间
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
/**
* 最后一次登录地址
......@@ -90,7 +91,6 @@ public class CustomerEntity extends CustomerVo implements IUser {
* 获取 用户登录账号
* @return String
*/
@Override
public String getLoginName(){
return loginName;
}
......@@ -241,6 +241,20 @@ public class CustomerEntity extends CustomerVo implements IUser {
public void setJob(String job){
this.job = job;
}
/**
* 获取 头像图片地址
* @return String
*/
public String getAvatar(){
return avatar;
}
/**
* 设置 头像图片地址
* @param avatar
*/
public void setAvatar(String avatar){
this.avatar = avatar;
}
/**
* 获取 客户来源
* @return Long
......@@ -330,6 +344,7 @@ public class CustomerEntity extends CustomerVo implements IUser {
sb.append(",sex:").append(getSex());
sb.append(",mailbox:").append(getMailbox());
sb.append(",job:").append(getJob());
sb.append(",avatar:").append(getAvatar());
sb.append(",customerSrc:").append(getCustomerSrc());
sb.append(",status:").append(getStatus());
sb.append(",lastLoginTime:").append(getLastLoginTime());
......@@ -361,6 +376,8 @@ public class CustomerEntity extends CustomerVo implements IUser {
this.job = "";
this.avatar = "";
this.customerSrc = null;
this.status = 0;
......@@ -431,5 +448,4 @@ public class CustomerEntity extends CustomerVo implements IUser {
public String getMenuUrl() {
return null;
}
}
\ No newline at end of file
......@@ -7,170 +7,188 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.customer.model.vo.CustomerWorkDesignVo;
/**
* 客户作品信息实体对象
*
* @author zxfei
* @date 2022-06-14
*/
* 客户作品信息实体对象
*
* @author zxfei
* @date 2022-07-01
*/
public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
* 客户ID
*/
private Long customerId;
/**
* 作品名称
*/
* 作品名称
*/
private String workDesignName;
/**
* 作品状态:0:草稿,1:发布
*/
* 作品状态:0:草稿,1:发布
*/
private Integer workDesignStatus;
/**
* 作品描述
*/
* 作品描述
*/
private String workDesignDesc;
/**
* 模版引用的图片
*/
* 模版引用的图片
*/
private String pictureIds;
/**
* 模版引用的素材
*/
* 模版引用的素材
*/
private String pictureSrcIds;
/**
* 模版引用的背景
*/
* 模版引用的背景
*/
private String pictureBackgroundIds;
/**
* 作品引用的字体
*/
* 作品引用的字体
*/
private String fontIds;
/**
* 作品图片预览地址(相对地址)
*/
private String previewUrl;
public CustomerWorkDesignEntity(){}
/**
* 获取 客户ID
* @return Long
*/
* 获取 客户ID
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 客户ID
* @param customerId
*/
* 设置 客户ID
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 作品名称
* @return String
*/
* 获取 作品名称
* @return String
*/
public String getWorkDesignName(){
return workDesignName;
}
/**
* 设置 作品名称
* @param workDesignName
*/
* 设置 作品名称
* @param workDesignName
*/
public void setWorkDesignName(String workDesignName){
this.workDesignName = workDesignName;
}
/**
* 获取 作品状态:0:草稿,1:发布
* @return Integer
*/
* 获取 作品状态:0:草稿,1:发布
* @return Integer
*/
public Integer getWorkDesignStatus(){
return workDesignStatus;
}
/**
* 设置 作品状态:0:草稿,1:发布
* @param workDesignStatus
*/
* 设置 作品状态:0:草稿,1:发布
* @param workDesignStatus
*/
public void setWorkDesignStatus(Integer workDesignStatus){
this.workDesignStatus = workDesignStatus;
}
/**
* 获取 作品描述
* @return String
*/
* 获取 作品描述
* @return String
*/
public String getWorkDesignDesc(){
return workDesignDesc;
}
/**
* 设置 作品描述
* @param workDesignDesc
*/
* 设置 作品描述
* @param workDesignDesc
*/
public void setWorkDesignDesc(String workDesignDesc){
this.workDesignDesc = workDesignDesc;
}
/**
* 获取 模版引用的图片
* @return String
*/
* 获取 模版引用的图片
* @return String
*/
public String getPictureIds(){
return pictureIds;
}
/**
* 设置 模版引用的图片
* @param pictureIds
*/
* 设置 模版引用的图片
* @param pictureIds
*/
public void setPictureIds(String pictureIds){
this.pictureIds = pictureIds;
}
/**
* 获取 模版引用的素材
* @return String
*/
* 获取 模版引用的素材
* @return String
*/
public String getPictureSrcIds(){
return pictureSrcIds;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIds
*/
* 设置 模版引用的素材
* @param pictureSrcIds
*/
public void setPictureSrcIds(String pictureSrcIds){
this.pictureSrcIds = pictureSrcIds;
}
/**
* 获取 模版引用的背景
* @return String
*/
* 获取 模版引用的背景
* @return String
*/
public String getPictureBackgroundIds(){
return pictureBackgroundIds;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
public void setPictureBackgroundIds(String pictureBackgroundIds){
this.pictureBackgroundIds = pictureBackgroundIds;
}
/**
* 获取 作品引用的字体
* @return String
*/
* 获取 作品引用的字体
* @return String
*/
public String getFontIds(){
return fontIds;
}
/**
* 设置 作品引用的字体
* @param fontIds
*/
* 设置 作品引用的字体
* @param fontIds
*/
public void setFontIds(String fontIds){
this.fontIds = fontIds;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return String
*/
public String getPreviewUrl(){
return previewUrl;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrl
*/
public void setPreviewUrl(String previewUrl){
this.previewUrl = previewUrl;
}
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -178,7 +196,7 @@ public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
if (obj instanceof CustomerWorkDesignEntity) {
CustomerWorkDesignEntity tmp = (CustomerWorkDesignEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -194,25 +212,28 @@ public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
sb.append(",pictureSrcIds:").append(getPictureSrcIds());
sb.append(",pictureBackgroundIds:").append(getPictureBackgroundIds());
sb.append(",fontIds:").append(getFontIds());
sb.append(",previewUrl:").append(getPreviewUrl());
return sb.toString();
}
public void initAttrValue(){
this.customerId = null;
this.customerId = null;
this.workDesignName = "";
this.workDesignName = "";
this.workDesignStatus = null;
this.workDesignStatus = null;
this.workDesignDesc = "";
this.workDesignDesc = "";
this.pictureIds = "";
this.pictureIds = "";
this.pictureSrcIds = "";
this.pictureSrcIds = "";
this.pictureBackgroundIds = "";
this.pictureBackgroundIds = "";
this.fontIds = "";
this.fontIds = "";
this.previewUrl = "";
}
}
\ No newline at end of file
......@@ -7,224 +7,242 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.design.model.vo.DesignMasterplateVo;
/**
* 模版管理实体对象
*
* @author zxfei
* @date 2022-06-14
*/
* 模版管理实体对象
*
* @author zxfei
* @date 2022-07-01
*/
public class DesignMasterplateEntity extends DesignMasterplateVo {
private static final long serialVersionUID = 1L;
/**
* 模版名称
*/
* 模版名称
*/
private String masterplateName;
/**
* 模版编码
*/
* 模版编码
*/
private Integer masterplateCode;
/**
* 发布人
*/
* 发布人
*/
private Long customerId;
/**
* 发布人名称
*/
* 发布人名称
*/
private String customerName;
/**
* 模版描述
*/
* 模版描述
*/
private String masterplateDesc;
/**
* 模版下载地址(相对地址)
*/
* 模版下载地址(相对地址)
*/
private String masterplatePath;
/**
* 模版被引用的次数。默认:0
*/
private Integer masterplateUseNum;
/**
* 模版引用的图片
*/
* 模版引用的图片
*/
private String pictureIds;
/**
* 模版引用的素材
*/
* 模版引用的素材
*/
private String pictureSrcIds;
/**
* 模版引用的背景
*/
* 模版引用的背景
*/
private String pictureBackgroundIds;
/**
* 模版引用的字体
*/
* 模版引用的字体
*/
private String fontIds;
/**
* 模版被引用的次数。默认:0
*/
private Integer masterplateUseNum;
/**
* 作品图片预览地址(相对地址)
*/
private String previewUrl;
public DesignMasterplateEntity(){}
/**
* 获取 模版名称
* @return String
*/
* 获取 模版名称
* @return String
*/
public String getMasterplateName(){
return masterplateName;
}
/**
* 设置 模版名称
* @param masterplateName
*/
* 设置 模版名称
* @param masterplateName
*/
public void setMasterplateName(String masterplateName){
this.masterplateName = masterplateName;
}
/**
* 获取 模版编码
* @return Integer
*/
* 获取 模版编码
* @return Integer
*/
public Integer getMasterplateCode(){
return masterplateCode;
}
/**
* 设置 模版编码
* @param masterplateCode
*/
* 设置 模版编码
* @param masterplateCode
*/
public void setMasterplateCode(Integer masterplateCode){
this.masterplateCode = masterplateCode;
}
/**
* 获取 发布人
* @return Long
*/
* 获取 发布人
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 发布人
* @param customerId
*/
* 设置 发布人
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 发布人名称
* @return String
*/
* 获取 发布人名称
* @return String
*/
public String getCustomerName(){
return customerName;
}
/**
* 设置 发布人名称
* @param customerName
*/
* 设置 发布人名称
* @param customerName
*/
public void setCustomerName(String customerName){
this.customerName = customerName;
}
/**
* 获取 模版描述
* @return String
*/
* 获取 模版描述
* @return String
*/
public String getMasterplateDesc(){
return masterplateDesc;
}
/**
* 设置 模版描述
* @param masterplateDesc
*/
* 设置 模版描述
* @param masterplateDesc
*/
public void setMasterplateDesc(String masterplateDesc){
this.masterplateDesc = masterplateDesc;
}
/**
* 获取 模版下载地址(相对地址)
* @return String
*/
* 获取 模版下载地址(相对地址)
* @return String
*/
public String getMasterplatePath(){
return masterplatePath;
}
/**
* 设置 模版下载地址(相对地址)
* @param masterplatePath
*/
* 设置 模版下载地址(相对地址)
* @param masterplatePath
*/
public void setMasterplatePath(String masterplatePath){
this.masterplatePath = masterplatePath;
}
/**
* 获取 模版被引用的次数。默认:0
* @return Integer
*/
public Integer getMasterplateUseNum(){
return masterplateUseNum;
}
/**
* 设置 模版被引用的次数。默认:0
* @param masterplateUseNum
*/
public void setMasterplateUseNum(Integer masterplateUseNum){
this.masterplateUseNum = masterplateUseNum;
}
/**
* 获取 模版引用的图片
* @return String
*/
* 获取 模版引用的图片
* @return String
*/
public String getPictureIds(){
return pictureIds;
}
/**
* 设置 模版引用的图片
* @param pictureIds
*/
* 设置 模版引用的图片
* @param pictureIds
*/
public void setPictureIds(String pictureIds){
this.pictureIds = pictureIds;
}
/**
* 获取 模版引用的素材
* @return String
*/
* 获取 模版引用的素材
* @return String
*/
public String getPictureSrcIds(){
return pictureSrcIds;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIds
*/
* 设置 模版引用的素材
* @param pictureSrcIds
*/
public void setPictureSrcIds(String pictureSrcIds){
this.pictureSrcIds = pictureSrcIds;
}
/**
* 获取 模版引用的背景
* @return String
*/
* 获取 模版引用的背景
* @return String
*/
public String getPictureBackgroundIds(){
return pictureBackgroundIds;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
public void setPictureBackgroundIds(String pictureBackgroundIds){
this.pictureBackgroundIds = pictureBackgroundIds;
}
/**
* 获取 模版引用的字体
* @return String
*/
* 获取 模版引用的字体
* @return String
*/
public String getFontIds(){
return fontIds;
}
/**
* 设置 模版引用的字体
* @param fontIds
*/
* 设置 模版引用的字体
* @param fontIds
*/
public void setFontIds(String fontIds){
this.fontIds = fontIds;
}
/**
* 获取 模版被引用的次数。默认:0
* @return Integer
*/
public Integer getMasterplateUseNum(){
return masterplateUseNum;
}
/**
* 设置 模版被引用的次数。默认:0
* @param masterplateUseNum
*/
public void setMasterplateUseNum(Integer masterplateUseNum){
this.masterplateUseNum = masterplateUseNum;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return String
*/
public String getPreviewUrl(){
return previewUrl;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrl
*/
public void setPreviewUrl(String previewUrl){
this.previewUrl = previewUrl;
}
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -232,7 +250,7 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
if (obj instanceof DesignMasterplateEntity) {
DesignMasterplateEntity tmp = (DesignMasterplateEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -246,36 +264,39 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
sb.append(",customerName:").append(getCustomerName());
sb.append(",masterplateDesc:").append(getMasterplateDesc());
sb.append(",masterplatePath:").append(getMasterplatePath());
sb.append(",masterplateUseNum:").append(getMasterplateUseNum());
sb.append(",pictureIds:").append(getPictureIds());
sb.append(",pictureSrcIds:").append(getPictureSrcIds());
sb.append(",pictureBackgroundIds:").append(getPictureBackgroundIds());
sb.append(",fontIds:").append(getFontIds());
sb.append(",masterplateUseNum:").append(getMasterplateUseNum());
sb.append(",previewUrl:").append(getPreviewUrl());
return sb.toString();
}
public void initAttrValue(){
this.masterplateName = "";
this.masterplateName = "";
this.masterplateCode = null;
this.masterplateCode = null;
this.customerId = null;
this.customerId = null;
this.customerName = "";
this.customerName = "";
this.masterplateDesc = "";
this.masterplateDesc = "";
this.masterplatePath = "";
this.masterplatePath = "";
this.pictureIds = "";
this.masterplateUseNum = null;
this.pictureSrcIds = "";
this.pictureIds = "";
this.pictureBackgroundIds = "";
this.pictureSrcIds = "";
this.fontIds = "";
this.pictureBackgroundIds = "";
this.masterplateUseNum = null;
this.fontIds = "";
this.previewUrl = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.help.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.help.model.HelpEntity;
import java.util.List;
/**
* 帮助信息Dao
* 帮助信息 DAO接口
*
* @author zxfei
* @date 2022-06-28
*/
public interface HelpDao extends ICRUDDao<HelpEntity,Long>{
}
package com.mortals.xhx.module.help.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.help.model.HelpEvaluateEntity;
import java.util.List;
/**
* 帮助评价信息Dao
* 帮助评价信息 DAO接口
*
* @author zxfei
* @date 2022-06-29
*/
public interface HelpEvaluateDao extends ICRUDDao<HelpEvaluateEntity,Long>{
}
package com.mortals.xhx.module.help.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.help.dao.HelpDao;
import com.mortals.xhx.module.help.model.HelpEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 帮助信息DaoImpl DAO接口
*
* @author zxfei
* @date 2022-06-28
*/
@Repository("helpDao")
public class HelpDaoImpl extends BaseCRUDDaoMybatis<HelpEntity,Long> implements HelpDao {
}
package com.mortals.xhx.module.help.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.help.dao.HelpEvaluateDao;
import com.mortals.xhx.module.help.model.HelpEvaluateEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 帮助评价信息DaoImpl DAO接口
*
* @author zxfei
* @date 2022-06-29
*/
@Repository("helpEvaluateDao")
public class HelpEvaluateDaoImpl extends BaseCRUDDaoMybatis<HelpEvaluateEntity,Long> implements HelpEvaluateDao {
}
package com.mortals.xhx.module.help.model;
import com.mortals.xhx.module.help.model.vo.HelpVo;
/**
* 帮助信息实体对象
*
* @author zxfei
* @date 2022-06-29
*/
public class HelpEntity extends HelpVo {
private static final long serialVersionUID = 1L;
/**
* 排序号
*/
private Integer sortNum;
/**
* 问题标题
*/
private String title;
/**
* 问题内容
*/
private String content;
/**
* 问题回复
*/
private String answerContent;
/**
* 问题类型备用字段
*/
private Integer questionType;
/**
* 状态备用字段
*/
private Integer status;
/**
* 有用统计
*/
private Integer useful;
/**
* 无用统计
*/
private Integer useless;
/**
* 创建用户名称
*/
private String createUserName;
/**
* 修改用户名称
*/
private String updateUserName;
public HelpEntity(){}
/**
* 获取 排序号
* @return Integer
*/
public Integer getSortNum(){
return sortNum;
}
/**
* 设置 排序号
* @param sortNum
*/
public void setSortNum(Integer sortNum){
this.sortNum = sortNum;
}
/**
* 获取 问题标题
* @return String
*/
public String getTitle(){
return title;
}
/**
* 设置 问题标题
* @param title
*/
public void setTitle(String title){
this.title = title;
}
/**
* 获取 问题内容
* @return String
*/
public String getContent(){
return content;
}
/**
* 设置 问题内容
* @param content
*/
public void setContent(String content){
this.content = content;
}
/**
* 获取 问题回复
* @return String
*/
public String getAnswerContent(){
return answerContent;
}
/**
* 设置 问题回复
* @param answerContent
*/
public void setAnswerContent(String answerContent){
this.answerContent = answerContent;
}
/**
* 获取 问题类型备用字段
* @return Integer
*/
public Integer getQuestionType(){
return questionType;
}
/**
* 设置 问题类型备用字段
* @param questionType
*/
public void setQuestionType(Integer questionType){
this.questionType = questionType;
}
/**
* 获取 状态备用字段
* @return Integer
*/
public Integer getStatus(){
return status;
}
/**
* 设置 状态备用字段
* @param status
*/
public void setStatus(Integer status){
this.status = status;
}
/**
* 获取 有用统计
* @return Integer
*/
public Integer getUseful(){
return useful;
}
/**
* 设置 有用统计
* @param useful
*/
public void setUseful(Integer useful){
this.useful = useful;
}
/**
* 获取 无用统计
* @return Integer
*/
public Integer getUseless(){
return useless;
}
/**
* 设置 无用统计
* @param useless
*/
public void setUseless(Integer useless){
this.useless = useless;
}
/**
* 获取 创建用户名称
* @return String
*/
public String getCreateUserName(){
return createUserName;
}
/**
* 设置 创建用户名称
* @param createUserName
*/
public void setCreateUserName(String createUserName){
this.createUserName = createUserName;
}
/**
* 获取 修改用户名称
* @return String
*/
public String getUpdateUserName(){
return updateUserName;
}
/**
* 设置 修改用户名称
* @param updateUserName
*/
public void setUpdateUserName(String updateUserName){
this.updateUserName = updateUserName;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof HelpEntity) {
HelpEntity tmp = (HelpEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",sortNum:").append(getSortNum());
sb.append(",title:").append(getTitle());
sb.append(",content:").append(getContent());
sb.append(",answerContent:").append(getAnswerContent());
sb.append(",questionType:").append(getQuestionType());
sb.append(",status:").append(getStatus());
sb.append(",useful:").append(getUseful());
sb.append(",useless:").append(getUseless());
sb.append(",createUserName:").append(getCreateUserName());
sb.append(",updateUserName:").append(getUpdateUserName());
return sb.toString();
}
public void initAttrValue(){
this.sortNum = null;
this.title = "";
this.content = "";
this.answerContent = "";
this.questionType = null;
this.status = null;
this.useful = 0;
this.useless = 0;
this.createUserName = "";
this.updateUserName = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.help.model;
import com.mortals.xhx.module.help.model.vo.HelpEvaluateVo;
import java.util.Date;
/**
* 帮助评价信息实体对象
*
* @author zxfei
* @date 2022-06-29
*/
public class HelpEvaluateEntity extends HelpEvaluateVo {
private static final long serialVersionUID = 1L;
/**
* 帮助ID
*/
private Long helpId;
/**
* 客户id
*/
private Long customerId;
/**
* 客户真实名称
*/
private String custName;
/**
* 单位名称
*/
private String organization;
/**
* 联系电话
*/
private String contactTelphone;
/**
* 评价结果1有用2没用
*/
private Integer evaluateType;
/**
* 评价时间
*/
private Date evaluateTime;
public HelpEvaluateEntity(){}
/**
* 获取 帮助ID
* @return Long
*/
public Long getHelpId(){
return helpId;
}
/**
* 设置 帮助ID
* @param helpId
*/
public void setHelpId(Long helpId){
this.helpId = helpId;
}
/**
* 获取 客户id
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 客户id
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 客户真实名称
* @return String
*/
public String getCustName(){
return custName;
}
/**
* 设置 客户真实名称
* @param custName
*/
public void setCustName(String custName){
this.custName = custName;
}
/**
* 获取 单位名称
* @return String
*/
public String getOrganization(){
return organization;
}
/**
* 设置 单位名称
* @param organization
*/
public void setOrganization(String organization){
this.organization = organization;
}
/**
* 获取 联系电话
* @return String
*/
public String getContactTelphone(){
return contactTelphone;
}
/**
* 设置 联系电话
* @param contactTelphone
*/
public void setContactTelphone(String contactTelphone){
this.contactTelphone = contactTelphone;
}
/**
* 获取 评价结果1有用2没用
* @return Integer
*/
public Integer getEvaluateType(){
return evaluateType;
}
/**
* 设置 评价结果1有用2没用
* @param evaluateType
*/
public void setEvaluateType(Integer evaluateType){
this.evaluateType = evaluateType;
}
/**
* 获取 评价时间
* @return Date
*/
public Date getEvaluateTime(){
return evaluateTime;
}
/**
* 设置 评价时间
* @param evaluateTime
*/
public void setEvaluateTime(Date evaluateTime){
this.evaluateTime = evaluateTime;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof HelpEvaluateEntity) {
HelpEvaluateEntity tmp = (HelpEvaluateEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",helpId:").append(getHelpId());
sb.append(",customerId:").append(getCustomerId());
sb.append(",custName:").append(getCustName());
sb.append(",organization:").append(getOrganization());
sb.append(",contactTelphone:").append(getContactTelphone());
sb.append(",evaluateType:").append(getEvaluateType());
sb.append(",evaluateTime:").append(getEvaluateTime());
return sb.toString();
}
public void initAttrValue(){
this.helpId = null;
this.customerId = null;
this.custName = "";
this.organization = "";
this.contactTelphone = "";
this.evaluateType = 1;
this.evaluateTime = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.help.model.vo;
import com.mortals.framework.model.BaseEntityLong;
/**
* 帮助评价信息视图对象
*
* @author zxfei
* @date 2022-06-29
*/
public class HelpEvaluateVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.help.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 帮助信息视图对象
*
* @author zxfei
* @date 2022-06-28
*/
@Data
public class HelpVo extends BaseEntityLong {
/** 查询条件 */
private String query;
}
\ No newline at end of file
package com.mortals.xhx.module.help.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.help.model.HelpEvaluateEntity;
/**
* HelpEvaluateService
*
* 帮助评价信息 service接口
*
* @author zxfei
* @date 2022-06-29
*/
public interface HelpEvaluateService extends ICRUDService<HelpEvaluateEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.help.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.help.model.HelpEntity;
/**
* HelpService
*
* 帮助信息 service接口
*
* @author zxfei
* @date 2022-06-28
*/
public interface HelpService extends ICRUDService<HelpEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.help.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.help.dao.HelpEvaluateDao;
import com.mortals.xhx.module.help.model.HelpEvaluateEntity;
import com.mortals.xhx.module.help.service.HelpEvaluateService;
/**
* HelpEvaluateService
* 帮助评价信息 service实现
*
* @author zxfei
* @date 2022-06-29
*/
@Service("helpEvaluateService")
public class HelpEvaluateServiceImpl extends AbstractCRUDServiceImpl<HelpEvaluateDao, HelpEvaluateEntity, Long> implements HelpEvaluateService {
@Override
protected HelpEvaluateEntity findBefore(HelpEvaluateEntity params, PageInfo pageInfo, Context context) throws AppException {
pageInfo.setPrePageResult(-1);
return super.findBefore(params, pageInfo, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.help.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.EvaluateType;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.help.dao.HelpDao;
import com.mortals.xhx.module.help.model.HelpEntity;
import com.mortals.xhx.module.help.model.HelpEvaluateEntity;
import com.mortals.xhx.module.help.service.HelpEvaluateService;
import com.mortals.xhx.module.help.service.HelpService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* HelpService
* 帮助信息 service实现
*
* @author zxfei
* @date 2022-06-28
*/
@Service("helpService")
public class HelpServiceImpl extends AbstractCRUDServiceImpl<HelpDao, HelpEntity, Long> implements HelpService {
@Autowired
private HelpEvaluateService helpEvaluateService;
@Override
protected HelpEntity findBefore(HelpEntity entity, PageInfo pageInfo, Context context) throws AppException {
if(StringUtils.isNotEmpty(entity.getQuery())){
StringBuffer condition = new StringBuffer("%");
condition.append(entity.getQuery()).append("%");
entity.setContent(condition.toString());
}
return entity;
}
@Override
protected void findAfter(HelpEntity params, PageInfo pageInfo, Context context, List<HelpEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)) {
list.stream().forEach(item -> {
HelpEvaluateEntity query = new HelpEvaluateEntity();
query.setHelpId(item.getId());
List<HelpEvaluateEntity> evaluateEntities = helpEvaluateService.find(query);
if(CollectionUtils.isNotEmpty(evaluateEntities)){
Map<Integer, List<HelpEvaluateEntity>> map = evaluateEntities.stream().collect(Collectors.groupingBy(HelpEvaluateEntity::getEvaluateType));
item.setUseful(CollectionUtils.isNotEmpty(map.get(EvaluateType.USEFUL.getValue()))?map.get(EvaluateType.USEFUL.getValue()).size():0);
item.setUseless(CollectionUtils.isNotEmpty(map.get(EvaluateType.USELESS.getValue()))?map.get(EvaluateType.USELESS.getValue()).size():0);
}else {
item.setUseful(0);
item.setUseless(0);
}
});
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment