Commit 410bf8f9 by 崔彦峰

svn to git

0 parents
Showing 171 changed files with 17084 additions and 0 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-weapp-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
<name>rpc-dj-weapp-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.weapp.remote</deploy.scanPackage>
</properties>
<dependencies>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-marketing-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>rpc-api-deploy-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-weapp-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author zhoudan
* @date 2020/4/21
*/
public class CustomerServiceMessageDTO extends CustomerServiceMessage {
@ApiModelProperty(name = "avatarUrlLog", notes = "发送人头像", dataType = "string")
private String avatarUrlLog;
@ApiModelProperty(name = "nickName", notes = "发送人昵称", dataType = "string")
private String nickName;
@ApiModelProperty(name = "phone", notes = "手机号", dataType = "string")
private String phone;
@ApiModelProperty(name = "messageContentNew", notes = "最新一条消息内容", dataType = "string")
private String messageContentNew;
@ApiModelProperty(name = "messageTypeNew", notes = "最新一条消息类型", dataType = "string")
private String messageTypeNew;
@ApiModelProperty(name = "unreadCount", notes = "未读总数", dataType = "string")
private String unreadCount;
public String getUnreadCount() {
return unreadCount;
}
public void setUnreadCount(String unreadCount) {
this.unreadCount = unreadCount;
}
public String getAvatarUrlLog() {
return avatarUrlLog;
}
public void setAvatarUrlLog(String avatarUrlLog) {
this.avatarUrlLog = avatarUrlLog;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getMessageContentNew() {
return messageContentNew;
}
public void setMessageContentNew(String messageContentNew) {
this.messageContentNew = messageContentNew;
}
public String getMessageTypeNew() {
return messageTypeNew;
}
public void setMessageTypeNew(String messageTypeNew) {
this.messageTypeNew = messageTypeNew;
}
@Override
public String toString() {
return "CustomerServiceMessageDTO{" +
"avatarUrlLog='" + avatarUrlLog + '\'' +
", nickName='" + nickName + '\'' +
", phone='" + phone + '\'' +
", messageContentNew='" + messageContentNew + '\'' +
", messageTypeNew='" + messageTypeNew + '\'' +
", unreadCount='" + unreadCount + '\'' +
'}';
}
}
package cn.com.glsx.dj.weapp.dto;/**
* @title: IntelligentRemindRuleDTO
* @description: 智能提醒服务对象DTO
* @author: huangsc
* @date: 2020-10-30 10:16
* @version: 1.0
**/
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial;
import io.swagger.annotations.ApiModelProperty;
/**
* @title: IntelligentRemindRuleDTO
* @description: 智能提醒服务对象DTO
* @author: huangsc
* @date: 2020-10-30 10:16
* @version: 1.0
*
**/
public class IntelligentRemindRuleDTO extends IntelligentRemindRule {
private static final long serialVersionUID = -7629150059485317295L;
@ApiModelProperty(name = "intelligentRemindServiceCarSeries", notes = "智能提醒服务使用车系对象", dataType = "object")
private IntelligentRemindServiceCarSeries intelligentRemindServiceCarSeries;
@ApiModelProperty(name = "intelligentRemindServiceMaterial", notes = "智能提醒服务素材对象", dataType = "object")
private IntelligentRemindServiceMaterial intelligentRemindServiceMaterial;
public IntelligentRemindServiceCarSeries getIntelligentRemindServiceCarSeries() {
return intelligentRemindServiceCarSeries;
}
public void setIntelligentRemindServiceCarSeries(IntelligentRemindServiceCarSeries intelligentRemindServiceCarSeries) {
this.intelligentRemindServiceCarSeries = intelligentRemindServiceCarSeries;
}
public IntelligentRemindServiceMaterial getIntelligentRemindServiceMaterial() {
return intelligentRemindServiceMaterial;
}
public void setIntelligentRemindServiceMaterial(IntelligentRemindServiceMaterial intelligentRemindServiceMaterial) {
this.intelligentRemindServiceMaterial = intelligentRemindServiceMaterial;
}
@Override
public String toString() {
return "IntelligentRemindRuleDTO{" +
"intelligentRemindServiceCarSeries=" + intelligentRemindServiceCarSeries +
", intelligentRemindServiceMaterial=" + intelligentRemindServiceMaterial +
"} " + super.toString();
}
}
package cn.com.glsx.dj.weapp.dto;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* @Title: IntelligentRemindServiceCopyInfoDTO.java
* @Description: 智能提醒服务拷贝
* @author Alvin
* @date 2020年10月17日 下午3:36:49
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class IntelligentRemindServiceCopyInfoDTO implements Serializable{
private static final long serialVersionUID = 8038838430425174117L;
/**
* 源提醒服务ID
*/
private Integer sourceRemindServiceId;
/**
* 目标商户ID
*/
private Integer targetMerchantId;
/**
* 源提醒服务ID列表,以英文逗号“,”分割
*/
private String sourceRemindServiceIds;
/**
* 目标商户ID列表,以英文逗号“,”分割
*/
private String targetMerchantIds;
public Integer getSourceRemindServiceId() {
return sourceRemindServiceId;
}
public void setSourceRemindServiceId(Integer sourceRemindServiceId) {
this.sourceRemindServiceId = sourceRemindServiceId;
}
public Integer getTargetMerchantId() {
return targetMerchantId;
}
public void setTargetMerchantId(Integer targetMerchantId) {
this.targetMerchantId = targetMerchantId;
}
public String getSourceRemindServiceIds() {
return sourceRemindServiceIds;
}
public void setSourceRemindServiceIds(String sourceRemindServiceIds) {
this.sourceRemindServiceIds = sourceRemindServiceIds;
}
public String getTargetMerchantIds() {
return targetMerchantIds;
}
public void setTargetMerchantIds(String targetMerchantIds) {
this.targetMerchantIds = targetMerchantIds;
}
@Override
public String toString() {
return "IntelligentRemindServiceCopyInfoDTO [sourceRemindServiceId="
+ sourceRemindServiceId + ", targetMerchantId="
+ targetMerchantId + ", sourceRemindServiceIds="
+ sourceRemindServiceIds + ", targetMerchantIds="
+ targetMerchantIds + "]";
}
}
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.marketing.dto.ShopActivityInfoDTO;
import cn.com.glsx.dj.weapp.model.*;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
* @Title: IntelligentRemindServiceDTO
* @Description: 智能提醒服务DTO
* @author zhoudan
* @date 2020/04/21
*/
public class IntelligentRemindServiceDTO extends IntelligentRemindService {
private static final long serialVersionUID = -1730132489801050466L;
@ApiModelProperty(name = "intelligentRemindServiceCarSeries", notes = "适用车系信息", dataType = "list")
private List<IntelligentRemindServiceCarSeries> intelligentRemindServiceCarSeries;
@ApiModelProperty(name = "intelligentRemindServiceMaterial", notes = "素材描述信息", dataType = "list")
private List<IntelligentRemindServiceMaterial> intelligentRemindServiceMaterial;
@ApiModelProperty(name = "intelligentRemindRule", notes = "规则对象", dataType = "IntelligentRemindRule")
private IntelligentRemindRule intelligentRemindRule;
@ApiModelProperty(name = "shopActivityInfoDTO", notes = "活动对象", dataType = "ShopActivityInfoDTO")
private ShopActivityInfoDTO shopActivityInfoDTO;
@ApiModelProperty(name = "searchKey", notes = "规则类型(1:里程;2:时间;3:其他;null:全部)", dataType = "string")
private String searchKey;
@ApiModelProperty(name = "projectName", notes = "项目名称", dataType = "string")
private String projectName;
@ApiModelProperty(name = "mileOrCarAge", notes = "当前里程或车龄", dataType = "int")
private Integer mileOrCarAge;
@ApiModelProperty(name = "videoBrowsingCount", notes = "累计视频浏览", dataType = "int")
private Integer videoBrowsingCount;
@ApiModelProperty(name = "activityBrowsingCount", notes = "累计活动浏览", dataType = "int")
private Integer activityBrowsingCount;
@ApiModelProperty(name = "payCount", notes = "累计购买", dataType = "int")
private Integer payCount;
@ApiModelProperty(name = "flag", notes = "调用页面标记(1:视频管理 2:项目消息)", dataType = "int")
private Integer flag;
@ApiModelProperty(name = "referActivityId", notes = "视频操作映射id", dataType = "int")
private Integer referActivityId;
@ApiModelProperty(name = "userId", notes = "用户id", dataType = "int")
private Integer userId;
@ApiModelProperty(name = "logo", notes = "用户头像", dataType = "string")
private String logo;
@ApiModelProperty(name = "nickName", notes = "用户昵称", dataType = "string")
private String nickName;
@ApiModelProperty(name = "mobile", notes = "用户手机号", dataType = "string")
private String mobile;
@ApiModelProperty(name = "seasonRule", notes = "季节规则", dataType = "string")
private String seasonRule;
@ApiModelProperty(name = "intelligentRemindServiceClassifyTags", notes = "服务分类标签(最多设置4个)", dataType = "list")
private List<IntelligentRemindServiceClassifyTag> intelligentRemindServiceClassifyTags;
@ApiModelProperty("分类标签ID")
private Long classifyTagId;
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getReferActivityId() {
return referActivityId;
}
public void setReferActivityId(Integer referActivityId) {
this.referActivityId = referActivityId;
}
public Integer getFlag() {
return flag;
}
public void setFlag(Integer flag) {
this.flag = flag;
}
public Integer getVideoBrowsingCount() {
return videoBrowsingCount;
}
public void setVideoBrowsingCount(Integer videoBrowsingCount) {
this.videoBrowsingCount = videoBrowsingCount;
}
public Integer getActivityBrowsingCount() {
return activityBrowsingCount;
}
public void setActivityBrowsingCount(Integer activityBrowsingCount) {
this.activityBrowsingCount = activityBrowsingCount;
}
public Integer getPayCount() {
return payCount;
}
public void setPayCount(Integer payCount) {
this.payCount = payCount;
}
public Integer getMileOrCarAge() {
return mileOrCarAge;
}
public ShopActivityInfoDTO getShopActivityInfoDTO() {
return shopActivityInfoDTO;
}
public void setShopActivityInfoDTO(ShopActivityInfoDTO shopActivityInfoDTO) {
this.shopActivityInfoDTO = shopActivityInfoDTO;
}
public void setMileOrCarAge(Integer mileOrCarAge) {
this.mileOrCarAge = mileOrCarAge;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String searchKey) {
this.searchKey = searchKey;
}
public IntelligentRemindRule getIntelligentRemindRule() {
return intelligentRemindRule;
}
public void setIntelligentRemindRule(IntelligentRemindRule intelligentRemindRule) {
this.intelligentRemindRule = intelligentRemindRule;
}
public List<IntelligentRemindServiceCarSeries> getIntelligentRemindServiceCarSeries() {
return intelligentRemindServiceCarSeries;
}
public void setIntelligentRemindServiceCarSeries(List<IntelligentRemindServiceCarSeries> intelligentRemindServiceCarSeries) {
this.intelligentRemindServiceCarSeries = intelligentRemindServiceCarSeries;
}
public List<IntelligentRemindServiceMaterial> getIntelligentRemindServiceMaterial() {
return intelligentRemindServiceMaterial;
}
public void setIntelligentRemindServiceMaterial(List<IntelligentRemindServiceMaterial> intelligentRemindServiceMaterial) {
this.intelligentRemindServiceMaterial = intelligentRemindServiceMaterial;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getSeasonRule() {
return seasonRule;
}
public void setSeasonRule(String seasonRule) {
this.seasonRule = seasonRule;
}
public List<IntelligentRemindServiceClassifyTag> getIntelligentRemindServiceClassifyTags() {
return intelligentRemindServiceClassifyTags;
}
public void setIntelligentRemindServiceClassifyTags(
List<IntelligentRemindServiceClassifyTag> intelligentRemindServiceClassifyTags) {
this.intelligentRemindServiceClassifyTags = intelligentRemindServiceClassifyTags;
}
public Long getClassifyTagId() {
return classifyTagId;
}
public void setClassifyTagId(Long classifyTagId) {
this.classifyTagId = classifyTagId;
}
@Override
public String toString() {
return "IntelligentRemindServiceDTO [intelligentRemindServiceCarSeries="
+ intelligentRemindServiceCarSeries
+ ", intelligentRemindServiceMaterial="
+ intelligentRemindServiceMaterial
+ ", intelligentRemindRule="
+ intelligentRemindRule
+ ", shopActivityInfoDTO="
+ shopActivityInfoDTO
+ ", searchKey="
+ searchKey
+ ", projectName="
+ projectName
+ ", mileOrCarAge="
+ mileOrCarAge
+ ", videoBrowsingCount="
+ videoBrowsingCount
+ ", activityBrowsingCount="
+ activityBrowsingCount
+ ", payCount="
+ payCount
+ ", flag="
+ flag
+ ", referActivityId="
+ referActivityId
+ ", userId="
+ userId
+ ", logo="
+ logo
+ ", nickName="
+ nickName
+ ", mobile="
+ mobile
+ ", seasonRule="
+ seasonRule
+ ", intelligentRemindServiceClassifyTags="
+ intelligentRemindServiceClassifyTags
+ ", classifyTagId="
+ classifyTagId + ", toString()=" + super.toString() + "]";
}
}
package cn.com.glsx.dj.weapp.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Title: IntelligentRemindServiceListConditionDTO
* @Description: 智能提醒服务查询列表条件DTO
* @author alvin
* @date 2020/11/09
*/
@ApiModel("智能提醒服务查询列表条件")
public class IntelligentRemindServiceListConditionDTO implements Serializable{
private static final long serialVersionUID = -3402416898239924605L;
/**
* 商户号
*/
@ApiModelProperty("商户号")
private Integer merchantId;
@ApiModelProperty("分类标签ID")
private Long classifyTagId;
public Integer getMerchantId() {
return merchantId;
}
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public Long getClassifyTagId() {
return classifyTagId;
}
public void setClassifyTagId(Long classifyTagId) {
this.classifyTagId = classifyTagId;
}
@Override
public String toString() {
return "IntelligentRemindServiceListConditionDTO [merchantId="
+ merchantId + ", classifyTagId=" + classifyTagId + "]";
}
}
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.marketing.dto.ActivityOfUserDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
/**
* @Title: IntelligentReminderDTO
* @Description: 智能提醒DTO
* @author yangjia
* @date 2019/04/30
*/
public class IntelligentReminderDTO extends IntelligentReminder {
private static final long serialVersionUID = 8943035595793025085L;
private ActivityOfUserDTO activityCouponUserDTO;
public ActivityOfUserDTO getActivityCouponUserDTO() {
return activityCouponUserDTO;
}
public void setActivityCouponUserDTO(ActivityOfUserDTO activityCouponUserDTO) {
this.activityCouponUserDTO = activityCouponUserDTO;
}
@Override
public String toString() {
return "IntelligentReminderDTO{" +
"activityCouponUserDTO=" + activityCouponUserDTO +
'}';
}
}
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.weapp.model.MerchantModule;
/**
* @Title: WeappModuleDTO
* @Description: 首页商户功能模块DTO
* @author yangjia
* @date 2019/04/28
*/
public class MerchantModuleDTO extends MerchantModule {
private static final long serialVersionUID = 5006342450983667728L;
/**
* MODULE_NAME:模块名
*/
private String moduleName;
/**
* MODULE_PATH:模块路径
*/
private String modulePath;
/**
* MODULE_ICON:模块图片
*/
private String moduleIcon;
/**
* MODULE_CLASS:模块样式
*/
private String moduleClass;
/**
* PATH_CATEGORY:路径类别(H5:网页;WEAPP:小程序)
*/
private String pathCategory;
/**
* MODULE_ALIAS:模块别名
*/
private String moduleAlias;
/**
* MODULE_LEVEL:模块层级
*/
private Integer moduleLevel;
/**
* PARENT_ID:上级模块ID(DDH_WEAPP_FUNCTION_MODULE.ID)
*/
private Integer parentId;
/**
* MODULE_STATUS:模块状态(ON:上架;OF:下架)
*/
private String moduleStatus;
/**
* NEED_LOGIN:登录状态
*/
private String needLogin;
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName;
}
public String getModulePath() {
return modulePath;
}
public void setModulePath(String modulePath) {
this.modulePath = modulePath;
}
public String getModuleIcon() {
return moduleIcon;
}
public void setModuleIcon(String moduleIcon) {
this.moduleIcon = moduleIcon;
}
public String getModuleClass() {
return moduleClass;
}
public void setModuleClass(String moduleClass) {
this.moduleClass = moduleClass;
}
public String getPathCategory() {
return pathCategory;
}
public void setPathCategory(String pathCategory) {
this.pathCategory = pathCategory;
}
public String getModuleAlias() {
return moduleAlias;
}
public void setModuleAlias(String moduleAlias) {
this.moduleAlias = moduleAlias;
}
public Integer getModuleLevel() {
return moduleLevel;
}
public void setModuleLevel(Integer moduleLevel) {
this.moduleLevel = moduleLevel;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getModuleStatus() {
return moduleStatus;
}
public void setModuleStatus(String moduleStatus) {
this.moduleStatus = moduleStatus;
}
public String getNeedLogin() {
return needLogin;
}
public void setNeedLogin(String needLogin) {
this.needLogin = needLogin;
}
@Override
public String toString() {
return "MerchantModuleDTO{" +
"moduleName='" + moduleName + '\'' +
", modulePath='" + modulePath + '\'' +
", moduleIcon='" + moduleIcon + '\'' +
", moduleClass='" + moduleClass + '\'' +
", pathCategory='" + pathCategory + '\'' +
", moduleAlias='" + moduleAlias + '\'' +
", moduleLevel=" + moduleLevel +
", parentId=" + parentId +
", moduleStatus='" + moduleStatus + '\'' +
", needLogin='" + needLogin + '\'' +
'}';
}
}
package cn.com.glsx.dj.weapp.dto;
import java.io.Serializable;
import java.util.Date;
/**
* @Title: PageVisitDTO.java
* @Description: 页面访问记录
* @author zengqi
* @date 2021年6月4日 下午1:43:38
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
public class PageVisitDTO implements Serializable{
private static final long serialVersionUID = 573334972278787001L;
/**
* 微信应用ID
*/
private String appId;
/**
* 商户号
*/
private Integer merchantId;
/**
* 页面路径
*/
private String path;
/**
* 页面参数
*/
private String query;
/**
* openId
*/
private String openId;
/**
* 进入时间
*/
private Date enterTime;
/**
* 离开时间
*/
private Date leaveTime;
/**
* 停留时间(单位:毫秒)
*/
private Long stayTime;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public Integer getMerchantId() {
return merchantId;
}
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public Date getEnterTime() {
return enterTime;
}
public void setEnterTime(Date enterTime) {
this.enterTime = enterTime;
}
public Date getLeaveTime() {
return leaveTime;
}
public void setLeaveTime(Date leaveTime) {
this.leaveTime = leaveTime;
}
public Long getStayTime() {
return stayTime;
}
public void setStayTime(Long stayTime) {
this.stayTime = stayTime;
}
@Override
public String toString() {
return "PageVisitDTO [appId=" + appId + ", merchantId=" + merchantId
+ ", path=" + path + ", query=" + query + ", openId=" + openId
+ ", enterTime=" + enterTime + ", leaveTime=" + leaveTime
+ ", stayTime=" + stayTime + "]";
}
}
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
public class VpFocusUserDTO extends VpFocusUser{
/**
*
*/
private static final long serialVersionUID = -3833072499273630422L;
}
package cn.com.glsx.dj.weapp.dto;
import java.util.List;
import cn.com.glsx.dj.weapp.model.VpMaterialCarSeries;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
import io.swagger.annotations.ApiModelProperty;
public class VpMaterialInfoDTO extends VpMaterialInfo {
/**
*
*/
private static final long serialVersionUID = -1448813981628891674L;
@ApiModelProperty(name = "tplResList", notes = "模板资源列表", dataType = "array")
private List<VpMaterialResource> tplResList;
@ApiModelProperty(name = "pmpResList", notes = "产品主图资源列表", dataType = "array")
private List<VpMaterialResource> pmpResList;
@ApiModelProperty(name = "carSeriesList", notes = "车系列表", dataType = "array")
private List<VpMaterialCarSeries> carSeriesList;
@ApiModelProperty(name = "descriptionList", notes = "视频素材描述", dataType = "array")
private List<VpMaterialDescription> descriptionList;
/**
* 关注者用户ID
*/
private Integer focusUserId;
public List<VpMaterialResource> getTplResList() {
return tplResList;
}
public void setTplResList(List<VpMaterialResource> tplResList) {
this.tplResList = tplResList;
}
public Integer getFocusUserId() {
return focusUserId;
}
public void setFocusUserId(Integer focusUserId) {
this.focusUserId = focusUserId;
}
public List<VpMaterialCarSeries> getCarSeriesList() {
return carSeriesList;
}
public void setCarSeriesList(List<VpMaterialCarSeries> carSeriesList) {
this.carSeriesList = carSeriesList;
}
public List<VpMaterialResource> getPmpResList() {
return pmpResList;
}
public void setPmpResList(List<VpMaterialResource> pmpResList) {
this.pmpResList = pmpResList;
}
public List<VpMaterialDescription> getDescriptionList() {
return descriptionList;
}
public void setDescriptionList(List<VpMaterialDescription> descriptionList) {
this.descriptionList = descriptionList;
}
@Override
public String toString() {
return super.toString() + "VpMaterialInfoDTO [" + (tplResList != null ? "tplResList=" + tplResList + ", " : "")
+ (pmpResList != null ? "pmpResList=" + pmpResList + ", " : "")
+ (carSeriesList != null ? "carSeriesList=" + carSeriesList + ", " : "")
+ (descriptionList != null ? "descriptionList=" + descriptionList + ", " : "")
+ (focusUserId != null ? "focusUserId=" + focusUserId : "") + "]";
}
}
package cn.com.glsx.dj.weapp.dto;
import cn.com.glsx.dj.weapp.model.WeappModule;
/**
* @Title: WeappModuleDTO
* @Description: 首页功能模块DTO
* @author yangjia
* @date 2019/04/28
*/
public class WeappModuleDTO extends WeappModule {
private static final long serialVersionUID = -8578971016345221166L;
/**
* 功能模块ID
* */
private Long functionModuleId;
/**
* 功能模块名
* */
private String functionModuleName;
/**
* 功能模块排序
* */
private Integer functionModuleSort;
public Long getFunctionModuleId() {
return functionModuleId;
}
public void setFunctionModuleId(Long functionModuleId) {
this.functionModuleId = functionModuleId;
}
public String getFunctionModuleName() {
return functionModuleName;
}
public void setFunctionModuleName(String functionModuleName) {
this.functionModuleName = functionModuleName;
}
public Integer getFunctionModuleSort() {
return functionModuleSort;
}
public void setFunctionModuleSort(Integer functionModuleSort) {
this.functionModuleSort = functionModuleSort;
}
@Override
public String toString() {
return "WeappModuleDTO{" +
"functionModuleId=" + functionModuleId +
", functionModuleName='" + functionModuleName + '\'' +
", functionModuleSort=" + functionModuleSort + '\'' +
super.toString()+
'}';
}
}
package cn.com.glsx.dj.weapp.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
/**
* @Title CacheKeyEnum
* @Description 缓存key枚举
* @author yangjia
* @date 2019/04/28
*
*/
public enum CacheKeyEnum implements BaseEnum<CacheKeyEnum, String> {
/**
* 根据accountId查找用户当前选中设备
* */
GET_PRESENT_DEVICE_BY_ACCOUNT("get_present_device_by_account", "根据accountId查找用户当前选中设备"),
/**
* 根据模块别名获取模块详细信息
* */
GET_WEAPP_MODULE_BY_ALIAS("get_weapp_module_by_alias", "根据模块别名获取模块详细信息"),
/**
* 根据商户和模块的ID获取模块信息
* */
GET_WEAPP_MERCHANT_MODULE_BY_ID("get_weapp_merchant_module_by_alias", "根据商户和模块的ID获取模块信息"),
/**
* 根据id获取智能提醒中的优惠券信息
* */
GET_ACTIVITY_COUPON_USER_BY_ID("get_activity_coupon_user_by_id","根据id获取智能提醒中的优惠券信息"),
DEVICE_BIND_TIP("device_bind_tip_","设备绑定查询"),
DEFAULT_RULE_IS_COPY("get_merchant_id_judge_if_copy","根据商户号判断是否已经拷贝默认规则"),
/**
* 客服消息
*/
CUSTOMER_SERVICE_MESSAGE("CUSTOMER_SERVICE_MESSAGE", "客服消息");
private String value;
private String displayName;
CacheKeyEnum(String value, String displayName){
this.value = value;
this.displayName = displayName;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
}
package cn.com.glsx.dj.weapp.enums;
/**
* @Title: ModuleStatusEnum.java
* @Description: 模块状态枚举定义
* @author Alvin.zengqi
* @date 2018年3月26日 下午7:14:47
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
public enum ModuleStatusEnum {
// 上架
ON,
// 下架
OF;
}
package cn.com.glsx.dj.weapp.enums;
import cn.com.glsx.framework.core.enums.BaseEnum;
/**
* @Title StatusEnum
* @Description: 状态枚举
* @author zhoudan
*
*/
public enum StatusEnum implements BaseEnum<StatusEnum, String>{
/**
* 状态枚举
*/
ONLINE("Y","上架"),
UN_ONLINE("N","下架"),
UNREAD("N", "未读"),
ALREADY_READ("Y", "已读"),
UNSEND("N", "未发"),
ALREADY_SEND("Y", "已发"),
TAG_CUSTOM("Y", "自定义"),
TAG_DEFAULT("N", "默认(非自定义)"),
RULE_SEARCH_KEY_ONE("1","里程"),
RULE_SEARCH_KEY_TWO("2","时间"),
RULE_SEARCH_KEY_THREE("3","无");
private String value;
private String displayName;
StatusEnum(String value, String dispalyName){
this.value = value;
this.displayName = dispalyName;
}
@Override
public String getValue() {
return this.value;
}
@Override
public String getDisplayName() {
return this.displayName;
}
public static StatusEnum get(String value){
if(value == null){
return null;
}
for (StatusEnum anEnum : StatusEnum.values()) {
if (value.equals(anEnum.getValue())) {
return anEnum;
}
}
return null;
}
}
package cn.com.glsx.dj.weapp.enums;
public class VideoPlusEnum {
public enum DescriptionType {
/** 图片**/
IMAGE((byte)1),
/** 文本**/
TEXT((byte)2);
private final byte value;
DescriptionType(byte value){
this.value = value;
}
public byte getValue(){
return value;
}
}
public enum ResourceType {
/** 图片**/
IMAGE((byte)1),
/** 文本**/
VIDEO((byte)2);
private final byte value;
ResourceType(byte value){
this.value = value;
}
public byte getValue(){
return value;
}
}
public enum BizType {
/** 业务类型-产品主图**/
PRODUCT_MAIN_PHOTO((byte)1),
/** 业务类型-模板资源**/
TEMPLATE_RES((byte)2);
private final byte value;
BizType(byte value){
this.value = value;
}
public byte getValue(){
return value;
}
}
public enum VideoStatus {
/** 视频合成状态-未开始**/
NOT_START((byte)1),
/** 视频合成状态-合成中**/
COMPOSITING((byte)2),
/** 视频合成状态-已完成**/
FINISH((byte)3);
private final byte value;
VideoStatus(byte value){
this.value = value;
}
public byte getValue(){
return value;
}
}
public enum LogType {
/** 购车顾问{0}生成了意向单**/
CREATE_INTENT((byte)1,"购车顾问{0}生成了意向单"),
/** 购车顾问{0}修改了意向单,{1}**/
UPDATE_INTENT((byte)2,"购车顾问{0}修改了意向单,{1}"),
/** 购车顾问{0}标记了已成交**/
UPDATE_INTENT_FINISH((byte)3,"购车顾问{0}标记了已成交"),
/** {0}浏览了意向单**/
CUSTOMER_BROWSE_INTENT((byte)4,"{0}浏览了意向单"),
/** {0}修改了意向单,{1}**/
CUSTOMER_UPDATE_INTENT((byte)5,"{0}修改了意向单,{1}"),
/** {0}授权了手机号**/
CUSTOMER_AUTH_PHONE((byte)6,"{0}授权了手机号"),
;
private final byte value;
private final String content;
LogType(byte value,String content){
this.value = value;
this.content = content;
}
public byte getValue(){
return value;
}
public String getContent(){
return content;
}
}
}
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "dj_weapp_customer_service_message")
public class CustomerServiceMessage extends BaseModel {
/**
* 客户ID
*/
@ApiModelProperty(name = "accountId", notes = "客户ID", dataType = "int")
@Column(name = "account_id")
private Integer accountId;
/**
* 商户号
*/
@ApiModelProperty(name = "merchantId", notes = "商户号", dataType = "int")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 发送方类型(B:B端商户;C:C端客户)
*/
@ApiModelProperty(name = "sendType", notes = "发送方类型(B:B端商户;C:C端客户)", dataType = "string")
@Column(name = "send_type")
private String sendType;
/**
* 发送状态(Y:已发 N:未发)
*/
@ApiModelProperty(name = "sendStatus", notes = "发送状态(Y:已发 N:未发)", dataType = "string")
@Column(name = "send_status")
private String sendStatus;
/**
* 消息状态(Y:已读 N:未读)
*/
@ApiModelProperty(name = "messageStatus", notes = "消息状态(Y:已读 N:未读)", dataType = "string")
@Column(name = "message_status")
private String messageStatus;
/**
* 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
@ApiModelProperty(name = "messageType", notes = "消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)", dataType = "string")
@Column(name = "message_type")
private String messageType;
/**
* 消息封面
*/
@ApiModelProperty(name = "messageCover", notes = "消息封面", dataType = "string")
@Column(name = "message_cover")
private String messageCover;
/**
* 消息内容
*/
@ApiModelProperty(name = "messageContent", notes = "消息内容", dataType = "string")
@Column(name = "message_content")
private String messageContent;
/**
* 发送人头像
*/
@ApiModelProperty(name = "avatarUrl", notes = "发送人头像", dataType = "string")
@Column(name = "avatar_url")
private String avatarUrl;
/**
* 获取客户ID
*
* @return account_id - 客户ID
*/
public Integer getAccountId() {
return accountId;
}
/**
* 设置客户ID
*
* @param accountId 客户ID
*/
public void setAccountId(Integer accountId) {
this.accountId = accountId;
}
/**
* 获取商户号
*
* @return merchant_id - 商户号
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户号
*
* @param merchantId 商户号
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public String getSendType() {
return sendType;
}
public void setSendType(String sendType) {
this.sendType = sendType;
}
/**
* 获取消息状态(Y:已读 N:未读)
*
* @return message_status - 消息状态(Y:已读 N:未读)
*/
public String getMessageStatus() {
return messageStatus;
}
public String getSendStatus() {
return sendStatus;
}
public void setSendStatus(String sendStatus) {
this.sendStatus = sendStatus;
}
/**
* 设置消息状态(Y:已读 N:未读)
*
* @param messageStatus 消息状态(Y:已读 N:未读)
*/
public void setMessageStatus(String messageStatus) {
this.messageStatus = messageStatus == null ? null : messageStatus.trim();
}
/**
* 获取消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*
* @return message_type - 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
public String getMessageType() {
return messageType;
}
/**
* 设置消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*
* @param messageType 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
public void setMessageType(String messageType) {
this.messageType = messageType == null ? null : messageType.trim();
}
/**
* 获取消息封面
*
* @return message_cover - 消息封面
*/
public String getMessageCover() {
return messageCover;
}
/**
* 设置消息封面
*
* @param messageCover 消息封面
*/
public void setMessageCover(String messageCover) {
this.messageCover = messageCover == null ? null : messageCover.trim();
}
/**
* 获取消息内容
*
* @return message_content - 消息内容
*/
public String getMessageContent() {
return messageContent;
}
/**
* 设置消息内容
*
* @param messageContent 消息内容
*/
public void setMessageContent(String messageContent) {
this.messageContent = messageContent == null ? null : messageContent.trim();
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl;
}
@Override
public String toString() {
return "CustomerServiceMessage{" +
"accountId=" + accountId +
", merchantId=" + merchantId +
", sendType='" + sendType + '\'' +
", sendStatus='" + sendStatus + '\'' +
", messageStatus='" + messageStatus + '\'' +
", messageType='" + messageType + '\'' +
", messageCover='" + messageCover + '\'' +
", messageContent='" + messageContent + '\'' +
", avatarUrl='" + avatarUrl + '\'' +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "dj_weapp_customer_service_message_catalog")
public class CustomerServiceMessageCatalog extends BaseModel {
/**
* 客户ID
*/
@ApiModelProperty(name = "accountId", notes = "客户ID", dataType = "int")
@Column(name = "account_id")
private Integer accountId;
/**
* 商户号
*/
@ApiModelProperty(name = "merchantId", notes = "商户号", dataType = "int")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 发送方类型(B:B端商户;C:C端客户)
*/
@ApiModelProperty(name = "sendType", notes = "发送方类型(B:B端商户;C:C端客户)", dataType = "string")
@Column(name = "send_type")
private String sendType;
/**
* 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
@ApiModelProperty(name = "messageTypeNew", notes = "消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)", dataType = "string")
@Column(name = "message_type_new")
private String messageTypeNew;
/**
* 最新一条消息内容
*/
@ApiModelProperty(name = "messageContentNew", notes = "最新一条消息内容", dataType = "string")
@Column(name = "message_content_new")
private String messageContentNew;
/**
* 发送人头像
*/
@ApiModelProperty(name = "avatarUrl", notes = "发送人头像", dataType = "string")
@Column(name = "avatar_url")
private String avatarUrl;
/**
* 发送人昵称
*/
@ApiModelProperty(name = "nickName", notes = "发送人昵称", dataType = "string")
@Column(name = "nick_name")
private String nickName;
/**
* 发送人手机号
*/
@ApiModelProperty(name = "phone", notes = "发送人手机号", dataType = "string")
private String phone;
/**
* 未读消息数
*/
@ApiModelProperty(name = "unreadCount", notes = "未读消息数", dataType = "int")
@Column(name = "unread_count")
private Integer unreadCount;
/**
* 获取客户ID
*
* @return account_id - 客户ID
*/
public Integer getAccountId() {
return accountId;
}
/**
* 设置客户ID
*
* @param accountId 客户ID
*/
public void setAccountId(Integer accountId) {
this.accountId = accountId;
}
/**
* 获取商户号
*
* @return merchant_id - 商户号
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户号
*
* @param merchantId 商户号
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public String getSendType() {
return sendType;
}
public void setSendType(String sendType) {
this.sendType = sendType;
}
/**
* 获取消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*
* @return message_type_new - 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
public String getMessageTypeNew() {
return messageTypeNew;
}
/**
* 设置消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*
* @param messageTypeNew 消息类型(TEXT:文本;IMG:图片;VIDEO:视频;VOICE:语音;VIEW:链接)
*/
public void setMessageTypeNew(String messageTypeNew) {
this.messageTypeNew = messageTypeNew == null ? null : messageTypeNew.trim();
}
/**
* 获取最新一条消息内容
*
* @return message_content_new - 最新一条消息内容
*/
public String getMessageContentNew() {
return messageContentNew;
}
/**
* 设置最新一条消息内容
*
* @param messageContentNew 最新一条消息内容
*/
public void setMessageContentNew(String messageContentNew) {
this.messageContentNew = messageContentNew == null ? null : messageContentNew.trim();
}
/**
* 获取发送人头像
*
* @return avatar_url - 发送人头像
*/
public String getAvatarUrl() {
return avatarUrl;
}
/**
* 设置发送人头像
*
* @param avatarUrl 发送人头像
*/
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
/**
* 获取发送人昵称
*
* @return nick_name - 发送人昵称
*/
public String getNickName() {
return nickName;
}
/**
* 设置发送人昵称
*
* @param nickName 发送人昵称
*/
public void setNickName(String nickName) {
this.nickName = nickName == null ? null : nickName.trim();
}
/**
* 获取发送人手机号
*
* @return phone - 发送人手机号
*/
public String getPhone() {
return phone;
}
/**
* 设置发送人手机号
*
* @param phone 发送人手机号
*/
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
/**
* 获取未读消息数
*
* @return unread_count - 未读消息数
*/
public Integer getUnreadCount() {
return unreadCount;
}
/**
* 设置未读消息数
*
* @param unreadCount 未读消息数
*/
public void setUnreadCount(Integer unreadCount) {
this.unreadCount = unreadCount;
}
@Override
public String toString() {
return "CustomerServiceMessageCatalog{" +
"accountId=" + accountId +
", merchantId=" + merchantId +
", sendType='" + sendType + '\'' +
", messageTypeNew='" + messageTypeNew + '\'' +
", messageContentNew='" + messageContentNew + '\'' +
", avatarUrl='" + avatarUrl + '\'' +
", nickName='" + nickName + '\'' +
", phone='" + phone + '\'' +
", unreadCount=" + unreadCount +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "dj_weapp_intelligent_remind_rule")
public class IntelligentRemindRule extends BaseModel {
/**
* 分类
*/
@ApiModelProperty(name = "ruleClassify", notes = "分类", dataType = "string")
@Column(name = "rule_classify")
private String ruleClassify;
/**
* 里程规则
*/
@ApiModelProperty(name = "mileRule", notes = "里程规则", dataType = "string")
@Column(name = "mile_rule")
private String mileRule;
/**
* 时间规则
*/
@ApiModelProperty(name = "timeRule", notes = "时间规则", dataType = "string")
@Column(name = "time_rule")
private String timeRule;
/**
* 季节规则
*/
@ApiModelProperty(name = "seasonRule", notes = "时间规则", dataType = "string")
@Column(name = "season_rule")
private String seasonRule;
/**
* 项目名称
*/
@ApiModelProperty(name = "ruleName", notes = "项目名称", dataType = "string")
@Column(name = "rule_name")
private String ruleName;
/**
* 门店ID(默认规则门店id为-1)
*/
@ApiModelProperty(name = "merchantId", notes = "门店ID(默认规则门店id为-1)", dataType = "int")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 获取分类
*
* @return rule_classify - 分类
*/
public String getRuleClassify() {
return ruleClassify;
}
/**
* 设置分类
*
* @param ruleClassify 分类
*/
public void setRuleClassify(String ruleClassify) {
this.ruleClassify = ruleClassify == null ? null : ruleClassify.trim();
}
/**
* 获取规则名称
*
* @return rule_name - 规则名称
*/
public String getRuleName() {
return ruleName;
}
/**
* 设置规则名称
*
* @param ruleName 规则名称
*/
public void setRuleName(String ruleName) {
this.ruleName = ruleName == null ? null : ruleName.trim();
}
/**
* 获取门店ID(默认规则门店id为null)
*
* @return merchant_id - 门店ID(默认规则门店id为null)
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置门店ID(默认规则门店id为null)
*
* @param merchantId 门店ID(默认规则门店id为null)
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public String getMileRule() {
return mileRule;
}
public void setMileRule(String mileRule) {
this.mileRule = mileRule;
}
public String getTimeRule() {
return timeRule;
}
public void setTimeRule(String timeRule) {
this.timeRule = timeRule;
}
public String getSeasonRule() {
return seasonRule;
}
public void setSeasonRule(String seasonRule) {
this.seasonRule = seasonRule;
}
@Override
public String toString() {
return "IntelligentRemindRule{" +
"ruleClassify='" + ruleClassify + '\'' +
", mileRule='" + mileRule + '\'' +
", timeRule='" + timeRule + '\'' +
", seasonRule='" + seasonRule + '\'' +
", ruleName='" + ruleName + '\'' +
", merchantId=" + merchantId +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "dj_weapp_intelligent_remind_service")
public class IntelligentRemindService extends BaseModel {
/**
* 商户号
*/
@ApiModelProperty(name = "merchantId", notes = "商户号", dataType = "int")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 视频标题
*/
@ApiModelProperty(name = "title", notes = "视频标题", dataType = "string")
private String title;
/**
* 视频地址
*/
@ApiModelProperty(name = "videoUrl", notes = "视频地址", dataType = "string")
@Column(name = "video_url")
private String videoUrl;
/**
* 发布标识(Y:上架;N:下架)
*/
@ApiModelProperty(name = "onlineFlag", notes = "发布标识(Y:上架;N:下架)", dataType = "string")
@Column(name = "online_flag")
private String onlineFlag;
/**
* 封面图
*/
@ApiModelProperty(name = "coverUrl", notes = "封面图", dataType = "string")
@Column(name = "cover_url")
private String coverUrl;
/**
* 视频分享推荐语
*/
@ApiModelProperty(name = "shareRecommend", notes = "视频分享推荐语", dataType = "string")
@Column(name = "share_recommend")
private String shareRecommend;
/**
* 提醒规则id
*/
@ApiModelProperty(name = "remindRuleId", notes = "提醒规则id", dataType = "int")
@Column(name = "remind_rule_id")
private Integer remindRuleId;
/**
* 活动id
*/
@ApiModelProperty(name = "activityId", notes = "活动id", dataType = "int")
@Column(name = "activity_id")
private Integer activityId;
/**
* 获取商户号
*
* @return merchant_id - 商户号
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户号
*
* @param merchantId 商户号
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取视频标题
*
* @return title - 视频标题
*/
public String getTitle() {
return title;
}
/**
* 设置视频标题
*
* @param title 视频标题
*/
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
/**
* 获取视频地址
*
* @return video_url - 视频地址
*/
public String getVideoUrl() {
return videoUrl;
}
/**
* 设置视频地址
*
* @param videoUrl 视频地址
*/
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl == null ? null : videoUrl.trim();
}
/**
* 获取发布标识(Y:上架;N:下架)
*
* @return online_flag - 发布标识(Y:上架;N:下架)
*/
public String getOnlineFlag() {
return onlineFlag;
}
/**
* 设置发布标识(Y:上架;N:下架)
*
* @param onlineFlag 发布标识(Y:上架;N:下架)
*/
public void setOnlineFlag(String onlineFlag) {
this.onlineFlag = onlineFlag == null ? null : onlineFlag.trim();
}
/**
* 获取封面图
*
* @return cover_url - 封面图
*/
public String getCoverUrl() {
return coverUrl;
}
/**
* 设置封面图
*
* @param coverUrl 封面图
*/
public void setCoverUrl(String coverUrl) {
this.coverUrl = coverUrl == null ? null : coverUrl.trim();
}
public String getShareRecommend() {
return shareRecommend;
}
public void setShareRecommend(String shareRecommend) {
this.shareRecommend = shareRecommend;
}
/**
* 获取提醒规则id
*
* @return remind_rule_id - 提醒规则id
*/
public Integer getRemindRuleId() {
return remindRuleId;
}
/**
* 设置提醒规则id
*
* @param remindRuleId 提醒规则id
*/
public void setRemindRuleId(Integer remindRuleId) {
this.remindRuleId = remindRuleId;
}
/**
* 获取活动id
*
* @return activity_id - 活动id
*/
public Integer getActivityId() {
return activityId;
}
/**
* 设置活动id
*
* @param activityId 活动id
*/
public void setActivityId(Integer activityId) {
this.activityId = activityId;
}
@Override
public String toString() {
return "IntelligentRemindService{" +
"merchantId=" + merchantId +
", title='" + title + '\'' +
", videoUrl='" + videoUrl + '\'' +
", onlineFlag='" + onlineFlag + '\'' +
", coverUrl='" + coverUrl + '\'' +
", shareRecommend='" + shareRecommend + '\'' +
", remindRuleId=" + remindRuleId +
", activityId=" + activityId +
"} " + super.toString();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
@Table(name = "dj_weapp_intelligent_remind_service_car_series")
public class IntelligentRemindServiceCarSeries extends BaseModel {
/**
* 车辆品牌LOGO
*/
@ApiModelProperty(name = "carBrandLogo", notes = "车辆品牌LOGO", dataType = "string")
@Column(name = "car_brand_logo")
private String carBrandLogo;
/**
* 车辆品牌id
*/
@ApiModelProperty(name = "carBrandId", notes = "车辆品牌id", dataType = "int")
@Column(name = "car_brand_id")
private Integer carBrandId;
/**
* 车辆品牌名称
*/
@ApiModelProperty(name = "carBrand", notes = "车辆品牌名称", dataType = "string")
@Column(name = "car_brand")
private String carBrand;
/**
* 子品牌id
*/
@ApiModelProperty(name = "carChildsBrandId", notes = "子品牌id", dataType = "imt")
@Column(name = "car_childs_brand_id")
private Integer carChildsBrandId;
/**
* 子品牌名字
*/
@ApiModelProperty(name = "carChildsBrandName", notes = "项目名称", dataType = "string")
@Column(name = "car_childs_brand_name")
private String carChildsBrandName;
/**
* 车系id
*/
@ApiModelProperty(name = "carSeriesId", notes = "车系id", dataType = "int")
@Column(name = "car_series_id")
private Integer carSeriesId;
/**
* 车系名字
*/
@ApiModelProperty(name = "carSeriesName", notes = "车系名字", dataType = "string")
@Column(name = "car_series_name")
private String carSeriesName;
/**
* 智能提醒服务id
*/
@ApiModelProperty(name = "intelligentRemindServiceId", notes = "智能提醒服务id", dataType = "int")
@Column(name = "intelligent_remind_service_id")
private Integer intelligentRemindServiceId;
/**
* 获取车辆品牌LOGO
*
* @return car_brand_logo - 车辆品牌LOGO
*/
public String getCarBrandLogo() {
return carBrandLogo;
}
/**
* 设置车辆品牌LOGO
*
* @param carBrandLogo 车辆品牌LOGO
*/
public void setCarBrandLogo(String carBrandLogo) {
this.carBrandLogo = carBrandLogo == null ? null : carBrandLogo.trim();
}
/**
* 获取车辆品牌id
*
* @return car_brand_id - 车辆品牌id
*/
public Integer getCarBrandId() {
return carBrandId;
}
/**
* 设置车辆品牌id
*
* @param carBrandId 车辆品牌id
*/
public void setCarBrandId(Integer carBrandId) {
this.carBrandId = carBrandId;
}
/**
* 获取车辆品牌名称
*
* @return car_brand - 车辆品牌名称
*/
public String getCarBrand() {
return carBrand;
}
/**
* 设置车辆品牌名称
*
* @param carBrand 车辆品牌名称
*/
public void setCarBrand(String carBrand) {
this.carBrand = carBrand == null ? null : carBrand.trim();
}
/**
* 获取子品牌id
*
* @return car_childs_brand_id - 子品牌id
*/
public Integer getCarChildsBrandId() {
return carChildsBrandId;
}
/**
* 设置子品牌id
*
* @param carChildsBrandId 子品牌id
*/
public void setCarChildsBrandId(Integer carChildsBrandId) {
this.carChildsBrandId = carChildsBrandId;
}
/**
* 获取子品牌名字
*
* @return car_childs_brand_name - 子品牌名字
*/
public String getCarChildsBrandName() {
return carChildsBrandName;
}
/**
* 设置子品牌名字
*
* @param carChildsBrandName 子品牌名字
*/
public void setCarChildsBrandName(String carChildsBrandName) {
this.carChildsBrandName = carChildsBrandName == null ? null : carChildsBrandName.trim();
}
/**
* 获取车系id
*
* @return car_series_id - 车系id
*/
public Integer getCarSeriesId() {
return carSeriesId;
}
/**
* 设置车系id
*
* @param carSeriesId 车系id
*/
public void setCarSeriesId(Integer carSeriesId) {
this.carSeriesId = carSeriesId;
}
/**
* 获取车系名字
*
* @return car_series_name - 车系名字
*/
public String getCarSeriesName() {
return carSeriesName;
}
/**
* 设置车系名字
*
* @param carSeriesName 车系名字
*/
public void setCarSeriesName(String carSeriesName) {
this.carSeriesName = carSeriesName == null ? null : carSeriesName.trim();
}
/**
* 获取智能提醒服务id
*
* @return intelligent_remind_service_id - 智能提醒服务id
*/
public Integer getIntelligentRemindServiceId() {
return intelligentRemindServiceId;
}
/**
* 设置智能提醒服务id
*
* @param intelligentRemindServiceId 智能提醒服务id
*/
public void setIntelligentRemindServiceId(Integer intelligentRemindServiceId) {
this.intelligentRemindServiceId = intelligentRemindServiceId;
}
@Override
public String toString() {
return "IntelligentRemindServiceCarSeries{" +
"carBrandLogo='" + carBrandLogo + '\'' +
", carBrandId=" + carBrandId +
", carBrand='" + carBrand + '\'' +
", carChildsBrandId=" + carChildsBrandId +
", carChildsBrandName='" + carChildsBrandName + '\'' +
", carSeriesId=" + carSeriesId +
", carSeriesName='" + carSeriesName + '\'' +
", intelligentRemindServiceId=" + intelligentRemindServiceId +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Column;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
@Table(name = "dj_weapp_intelligent_remind_service_classify_tag")
public class IntelligentRemindServiceClassifyTag extends BaseModel{
private static final long serialVersionUID = 1867364531283207347L;
/**
* 商户号
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 分类标签名
*/
@Column(name = "classify_tag_name")
private String classifyTagName;
/**
* 是否自定义标识(N:非自定义;Y:自定义)
*/
@Column(name = "on_custom")
private String onCustom;
/**
* 获取商户号
*
* @return merchant_id - 商户号
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户号
*
* @param merchantId 商户号
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取分类标签名
*
* @return classify_tag_name - 分类标签名
*/
public String getClassifyTagName() {
return classifyTagName;
}
/**
* 设置分类标签名
*
* @param classifyTagName 分类标签名
*/
public void setClassifyTagName(String classifyTagName) {
this.classifyTagName = classifyTagName == null ? null : classifyTagName.trim();
}
/**
* 获取是否自定义标识(N:非自定义;Y:自定义)
*
* @return on_custom - 是否自定义标识(N:非自定义;Y:自定义)
*/
public String getOnCustom() {
return onCustom;
}
/**
* 设置是否自定义标识(N:非自定义;Y:自定义)
*
* @param onCustom 是否自定义标识(N:非自定义;Y:自定义)
*/
public void setOnCustom(String onCustom) {
this.onCustom = onCustom == null ? null : onCustom.trim();
}
@Override
public String toString() {
return "IntelligentRemindServiceClassifyTag [merchantId=" + merchantId
+ ", classifyTagName=" + classifyTagName + ", onCustom="
+ onCustom + ", toString()=" + super.toString() + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Column;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
@Table(name = "dj_weapp_intelligent_remind_service_classify_tag_ref")
public class IntelligentRemindServiceClassifyTagRef extends BaseModel{
private static final long serialVersionUID = 5777995384206697932L;
/**
* 提醒服务id,关联dj_weapp_intelligent_remind_service.id
*/
@Column(name = "service_id")
private Long serviceId;
/**
* 分类标签id,关联dj_weapp_intelligent_remind_classify_tag.id
*/
@Column(name = "classify_tag_id")
private Long classifyTagId;
/**
* 获取提醒服务id,关联dj_weapp_intelligent_remind_service.id
*
* @return service_id - 提醒服务id,关联dj_weapp_intelligent_remind_service.id
*/
public Long getServiceId() {
return serviceId;
}
/**
* 设置提醒服务id,关联dj_weapp_intelligent_remind_service.id
*
* @param serviceId 提醒服务id,关联dj_weapp_intelligent_remind_service.id
*/
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
}
/**
* 获取分类标签id,关联dj_weapp_intelligent_remind_classify_tag.id
*
* @return classify_tag_id - 分类标签id,关联dj_weapp_intelligent_remind_classify_tag.id
*/
public Long getClassifyTagId() {
return classifyTagId;
}
/**
* 设置分类标签id,关联dj_weapp_intelligent_remind_classify_tag.id
*
* @param classifyTagId 分类标签id,关联dj_weapp_intelligent_remind_classify_tag.id
*/
public void setClassifyTagId(Long classifyTagId) {
this.classifyTagId = classifyTagId;
}
@Override
public String toString() {
return "IntelligentRemindServiceClassifyTagRef [serviceId=" + serviceId
+ ", classifyTagId=" + classifyTagId + ", toString()="
+ super.toString() + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
/**
* @author huangsc
*/
@Table(name = "dj_weapp_intelligent_remind_service_material")
public class IntelligentRemindServiceMaterial extends BaseModel {
private static final long serialVersionUID = -3288226761893990093L;
/**
* 智能提醒服务id
*/
@ApiModelProperty(name = "intelligentRemindServiceId", notes = "智能提醒服务id", dataType = "int")
@Column(name = "intelligent_remind_service_id")
private Integer intelligentRemindServiceId;
/**
* 素材归属(1:产品;2:描述)
*/
@ApiModelProperty(name = "materialBelong", notes = "素材归属(1:产品;2:描述)", dataType = "string")
@Column(name = "material_belong")
private Short materialBelong;
/**
* 素材类型(1:图片;2:文本)
*/
@ApiModelProperty(name = "resType", notes = "素材类型(1:图片;2:文本,)", dataType = "short")
@Column(name = "material_type")
private Short materialType;
/**
* 内容(图片地址或文本内容)
*/
@ApiModelProperty(name = "material_content", notes = "内容(图片地址或文本内容)", dataType = "short")
@Column(name = "material_content")
private String materialContent;
/**
* 排列顺序(升序)
*/
@ApiModelProperty(name = "sort", notes = "排列顺序(升序)", dataType = "short")
private Short sort;
/**
* 获取智能提醒服务id
*
* @return intelligent_remind_service_id - 智能提醒服务id
*/
public Integer getIntelligentRemindServiceId() {
return intelligentRemindServiceId;
}
/**
* 设置智能提醒服务id
*
* @param intelligentRemindServiceId 智能提醒服务id
*/
public void setIntelligentRemindServiceId(Integer intelligentRemindServiceId) {
this.intelligentRemindServiceId = intelligentRemindServiceId;
}
/**
* 获取素材归属(1:产品;2:描述)
*
* @return material_belong - 素材归属(1:产品;2:描述)
*/
public Short getMaterialBelong() {
return materialBelong;
}
/**
* 设置素材归属(1:产品;2:描述)
*
* @param materialBelong 素材归属(1:产品;2:描述)
*/
public void setMaterialBelong(Short materialBelong) {
this.materialBelong = materialBelong;
}
/**
* 获取素材类型(1:图片;2:文本)
*
* @return material_type - 素材类型(1:图片;2:文本)
*/
public Short getMaterialType() {
return materialType;
}
/**
* 设置素材类型(1:图片;2:文本)
*
* @param materialType 素材类型(1:图片;2:文本)
*/
public void setMaterialType(Short materialType) {
this.materialType = materialType;
}
/**
* 获取内容(图片地址或文本内容)
*
* @return material_content - 内容(图片地址或文本内容)
*/
public String getMaterialContent() {
return materialContent;
}
/**
* 设置内容(图片地址或文本内容)
*
* @param materialContent 内容(图片地址或文本内容)
*/
public void setMaterialContent(String materialContent) {
this.materialContent = materialContent == null ? null : materialContent.trim();
}
/**
* 获取排列顺序(升序)
*
* @return sort - 排列顺序(升序)
*/
public Short getSort() {
return sort;
}
/**
* 设置排列顺序(升序)
*
* @param sort 排列顺序(升序)
*/
public void setSort(Short sort) {
this.sort = sort;
}
@Override
public String toString() {
return "IntelligentRemindServiceMaterial{" +
"intelligentRemindServiceId=" + intelligentRemindServiceId +
", materialBelong=" + materialBelong +
", materialType=" + materialType +
", materialContent='" + materialContent + '\'' +
", sort=" + sort +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
/**
* @title IntelligentReminder
* @description 智能提醒
* @author yangjia
* @date 2019/04/30
* */
@Table(name = "dj_intelligent_reminder")
public class IntelligentReminder extends BaseModel {
private static final long serialVersionUID = -7478082759996900073L;
/**
* 账户ID(用户中心账号ID)
*/
private Integer accountId;
/**
* 商户ID
*/
private Integer merchantId;
/**
* 商户名字
*/
private String merchantName;
/**
* 提醒关联ID,如是优惠卷就是活动用户优惠卷ID,关联ActivityCouponUser
*/
private Integer reminderId;
/**
* 提醒名称
*/
private String reminderName;
/**
* 提醒类别:1:优惠卷 2:年检
*/
private Byte reminderType;
/**
* 描述
*/
private String remark;
/**
* 来源 1:爱车保镖 2:嘀加
*/
private Byte source;
/**
* 获取账户ID(用户中心账号ID)
*
* @return ACCOUNT_ID - 账户ID(用户中心账号ID)
*/
public Integer getAccountId() {
return accountId;
}
/**
* 设置账户ID(用户中心账号ID)
*
* @param accountId 账户ID(用户中心账号ID)
*/
public void setAccountId(Integer accountId) {
this.accountId = accountId;
}
/**
* 获取商户ID
*
* @return MERCHANT_ID - 商户ID
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户ID
*
* @param merchantId 商户ID
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取商户名字
*
* @return MERCHANT_NAME - 商户名字
*/
public String getMerchantName() {
return merchantName;
}
/**
* 设置商户名字
*
* @param merchantName 商户名字
*/
public void setMerchantName(String merchantName) {
this.merchantName = merchantName == null ? null : merchantName.trim();
}
/**
* 获取提醒关联ID,如是优惠卷就是优惠卷ID
*
* @return REMINDER_ID - 提醒关联ID,如是优惠卷就是优惠卷ID
*/
public Integer getReminderId() {
return reminderId;
}
/**
* 设置提醒关联ID,如是优惠卷就是优惠卷ID
*
* @param reminderId 提醒关联ID,如是优惠卷就是优惠卷ID
*/
public void setReminderId(Integer reminderId) {
this.reminderId = reminderId;
}
/**
* 获取提醒名称
*
* @return REMINDER_NAME - 提醒名称
*/
public String getReminderName() {
return reminderName;
}
/**
* 设置提醒名称
*
* @param reminderName 提醒名称
*/
public void setReminderName(String reminderName) {
this.reminderName = reminderName == null ? null : reminderName.trim();
}
/**
* 获取提醒类别:1:优惠卷 2:年检
*
* @return REMINDER_TYPE - 提醒类别:1:优惠卷 2:年检
*/
public Byte getReminderType() {
return reminderType;
}
/**
* 设置提醒类别:1:优惠卷 2:年检
*
* @param reminderType 提醒类别:1:优惠卷 2:年检
*/
public void setReminderType(Byte reminderType) {
this.reminderType = reminderType;
}
/**
* 获取描述
*
* @return REMARK - 描述
*/
public String getRemark() {
return remark;
}
/**
* 设置描述
*
* @param remark 描述
*/
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
/**
* 获取来源 1:爱车保镖 2:嘀加
*
* @return SOURCE - 来源 1:爱车保镖 2:嘀加
*/
public Byte getSource() {
return source;
}
/**
* 设置来源 1:爱车保镖 2:嘀加
*
* @param source 来源 1:爱车保镖 2:嘀加
*/
public void setSource(Byte source) {
this.source = source;
}
@Override
public String toString() {
return "IntelligentReminder{" +
"accountId=" + accountId +
", merchantId=" + merchantId +
", merchantName='" + merchantName + '\'' +
", reminderId=" + reminderId +
", reminderName='" + reminderName + '\'' +
", reminderType=" + reminderType +
", remark='" + remark + '\'' +
", source=" + source +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
/**
* @Title: MerchantModule.java
* @Description: 模块配置
* @author yangjia
* @date 2019/04/28
*/
@Table(name = "dj_weapp_merchant_module")
public class MerchantModule extends BaseModel {
private static final long serialVersionUID = -5889259896915649616L;
/**
* 商户ID
*/
private Integer merchantId;
/**
* 小程序应用ID
*/
private String appId;
/**
* 模块ID(DJ_WEAPP_MODULE.ID)
*/
private Integer moduleId;
/**
* 模块排序
*/
private Integer moduleSort;
/**
* 获取商户ID
*
* @return MERCHANT_ID - 商户ID
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置商户ID
*
* @param merchantId 商户ID
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取小程序应用ID
*
* @return APP_ID - 小程序应用ID
*/
public String getAppId() {
return appId;
}
/**
* 设置小程序应用ID
*
* @param appId 小程序应用ID
*/
public void setAppId(String appId) {
this.appId = appId == null ? null : appId.trim();
}
/**
* 获取模块ID(DJ_WEAPP_MODULE.ID)
*
* @return MODULE_ID - 模块ID(DJ_WEAPP_MODULE.ID)
*/
public Integer getModuleId() {
return moduleId;
}
/**
* 设置模块ID(DJ_WEAPP_MODULE.ID)
*
* @param moduleId 模块ID(DJ_WEAPP_MODULE.ID)
*/
public void setModuleId(Integer moduleId) {
this.moduleId = moduleId;
}
/**
* 获取模块排序
*
* @return MODULE_SORT - 模块排序
*/
public Integer getModuleSort() {
return moduleSort;
}
/**
* 设置模块排序
*
* @param moduleSort 模块排序
*/
public void setModuleSort(Integer moduleSort) {
this.moduleSort = moduleSort;
}
@Override
public String toString() {
return "MerchantModule{" +
"merchantId=" + merchantId +
", appId='" + appId + '\'' +
", moduleId=" + moduleId +
", moduleSort=" + moduleSort +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
/**
* 商户小程序公告
* <P>Description: </P>
*
* @author Alvin
* @version 1.0
*/
@Table(name = "dj_merchant_weapp_notice")
public class MerchantWeappNotice extends BaseModel{
private static final long serialVersionUID = 1394170452736189206L;
/**
* MERCHANT_ID:商户号
*/
private Integer merchantId;
/**
* APP_ID:小程序应用ID
*/
private String appId;
/**
* NOTICE:公告内容
*/
private String notice;
/**
* NOTICE_SOURCE:公告来源(B:B端小程序;C:C端小程序)
*/
private String noticeSource;
public String getNoticeSource() {
return noticeSource;
}
public void setNoticeSource(String noticeSource) {
this.noticeSource = noticeSource;
}
public Integer getMerchantId() {
return merchantId;
}
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId == null ? null : appId.trim();
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice == null ? null : notice.trim();
}
@Override
public String toString() {
return "MerchantWeappNotice{" +
"merchantId=" + merchantId +
", appId='" + appId + '\'' +
", notice='" + notice + '\'' +
", noticeSource=" + noticeSource +
"} " + super.toString();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import cn.com.glsx.framework.core.beans.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "dj_weapp_qrcode_manage")
public class QrCodeManage extends BaseModel {
/**
* 门店ID
*/
@ApiModelProperty(name = "merchantId", notes = "门店ID", dataType = "int")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 二维码地址
*/
@ApiModelProperty(name = "qrcodeUrl", notes = "二维码地址", dataType = "string")
@Column(name = "qrcode_url")
private String qrcodeUrl;
/**
* 二维码上传时间
*/
@ApiModelProperty(name = "uploadDate", notes = "二维码上传时间", dataType = "date")
@Column(name = "upload_date")
private Date uploadDate;
/**
* 获取门店ID
*
* @return merchant_id - 门店ID
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置门店ID
*
* @param merchantId 门店ID
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取二维码地址
*
* @return qrcode_url - 二维码地址
*/
public String getQrcodeUrl() {
return qrcodeUrl;
}
/**
* 设置二维码地址
*
* @param qrcodeUrl 二维码地址
*/
public void setQrcodeUrl(String qrcodeUrl) {
this.qrcodeUrl = qrcodeUrl == null ? null : qrcodeUrl.trim();
}
public Date getUploadDate() {
return uploadDate;
}
public void setUploadDate(Date uploadDate) {
this.uploadDate = uploadDate;
}
@Override
public String toString() {
return "QrCodeManage{" +
"merchantId=" + merchantId +
", qrcodeUrl='" + qrcodeUrl + '\'' +
", uploadDate=" + uploadDate +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "dj_weapp_user_address")
public class UserAddress implements Serializable{
private static final long serialVersionUID = 8080025823091534093L;
/**
* 主键id
*/
@Id
private Integer id;
/**
* 联系人
*/
@ApiModelProperty(name = "name", notes = "联系人", dataType = "string")
private String name;
/**
* 联系电话
*/
@ApiModelProperty(name = "phone", notes = "联系电话", dataType = "string")
private String phone;
/**
* C端用户微信OPENID
*/
@Column(name = "open_id")
private String openId;
/**
* 用户ID
*/
@Column(name = "account_id")
private Integer accountId;
/**
* 省份名称
*/
@Column(name = "province_name")
@ApiModelProperty(name = "provinceName", notes = "省份名称", dataType = "string")
private String provinceName;
/**
* 城市名称
*/
@Column(name = "city_name")
@ApiModelProperty(name = "cityName", notes = "城市名称", dataType = "string")
private String cityName;
/**
* 区县名称
*/
@Column(name = "area_name")
@ApiModelProperty(name = "areaName", notes = "区县名称", dataType = "string")
private String areaName;
/**
* 详细地址
*/
@ApiModelProperty(name = "address", notes = "详细地址", dataType = "string")
private String address;
/**
* 经度
*/
@ApiModelProperty(name = "lng", notes = "经度", dataType = "string")
private Double lng;
/**
* 纬度
*/
@ApiModelProperty(name = "lat", notes = "纬度", dataType = "string")
private Double lat;
/**
* 是否默认(Y:是;N:否)
*/
@Column(name = "is_default")
@ApiModelProperty(name = "isDefault", notes = "是否默认(Y:是;N:否)", dataType = "string")
private String isDefault;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键id
*
* @return id - 主键id
*/
public Integer getId() {
return id;
}
/**
* 设置主键id
*
* @param id 主键id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取联系人
*
* @return name - 联系人
*/
public String getName() {
return name;
}
/**
* 设置联系人
*
* @param name 联系人
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 获取联系电话
*
* @return phone - 联系电话
*/
public String getPhone() {
return phone;
}
/**
* 设置联系电话
*
* @param phone 联系电话
*/
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
/**
* 获取C端用户微信OPENID
*
* @return open_id - C端用户微信OPENID
*/
public String getOpenId() {
return openId;
}
/**
* 设置C端用户微信OPENID
*
* @param openId C端用户微信OPENID
*/
public void setOpenId(String openId) {
this.openId = openId == null ? null : openId.trim();
}
/**
* 获取用户ID
*
* @return account_id - 用户ID
*/
public Integer getAccountId() {
return accountId;
}
/**
* 设置用户ID
*
* @param accountId 用户ID
*/
public void setAccountId(Integer accountId) {
this.accountId = accountId;
}
/**
* 获取省份名称
*
* @return province_name - 省份名称
*/
public String getProvinceName() {
return provinceName;
}
/**
* 设置省份名称
*
* @param provinceName 省份名称
*/
public void setProvinceName(String provinceName) {
this.provinceName = provinceName == null ? null : provinceName.trim();
}
/**
* 获取城市名称
*
* @return city_name - 城市名称
*/
public String getCityName() {
return cityName;
}
/**
* 设置城市名称
*
* @param cityName 城市名称
*/
public void setCityName(String cityName) {
this.cityName = cityName == null ? null : cityName.trim();
}
/**
* 获取区县名称
*
* @return area_name - 区县名称
*/
public String getAreaName() {
return areaName;
}
/**
* 设置区县名称
*
* @param areaName 区县名称
*/
public void setAreaName(String areaName) {
this.areaName = areaName == null ? null : areaName.trim();
}
/**
* 获取详细地址
*
* @return address - 详细地址
*/
public String getAddress() {
return address;
}
/**
* 设置详细地址
*
* @param address 详细地址
*/
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
/**
* 获取经度(高德坐标)
*
* @return lng - 经度(高德坐标)
*/
public Double getLng() {
return lng;
}
/**
* 设置经度(高德坐标)
*
* @param lng 经度(高德坐标)
*/
public void setLng(Double lng) {
this.lng = lng;
}
/**
* 获取纬度(高德坐标)
*
* @return lat - 纬度(高德坐标)
*/
public Double getLat() {
return lat;
}
/**
* 设置纬度(高德坐标)
*
* @param lat 纬度(高德坐标)
*/
public void setLat(Double lat) {
this.lat = lat;
}
/**
* 获取是否默认(Y:是;N:否)
*
* @return is_default - 是否默认(Y:是;N:否)
*/
public String getIsDefault() {
return isDefault;
}
/**
* 设置是否默认(Y:是;N:否)
*
* @param isDefault 是否默认(Y:是;N:否)
*/
public void setIsDefault(String isDefault) {
this.isDefault = isDefault == null ? null : isDefault.trim();
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "UserAddress{" +
"id=" + id +
", name='" + name + '\'' +
", phone='" + phone + '\'' +
", openId='" + openId + '\'' +
", accountId=" + accountId +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", areaName='" + areaName + '\'' +
", address='" + address + '\'' +
", lng=" + lng +
", lat=" + lat +
", isDefault='" + isDefault + '\'' +
", createdBy='" + createdBy + '\'' +
", createdDate=" + createdDate +
", updatedBy='" + updatedBy + '\'' +
", updatedDate=" + updatedDate +
", deletedFlag='" + deletedFlag + '\'' +
'}';
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
@Table(name = "dj_weapp_video_plus_focus_user")
public class VpFocusUser implements Serializable{
/**
*
*/
private static final long serialVersionUID = 4647831554948593215L;
/**
* 主键ID
*/
@Id
private Integer id;
/**
* 用户ID(关注者,-1表示所有人都关注)
*/
@Column(name = "user_id")
private Integer userId;
/**
* 门店ID(关注者,-1表示所有人都关注)
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 用户ID(被关注者)
*/
@Column(name = "focused_user_id")
private Integer focusedUserId;
/**
* 门店ID(被关注者)
*/
@Column(name = "focused_merchant_id")
private Integer focusedMerchantId;
/**
* 关注标识(Y:已关注;N:未关注)
*/
private String status;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public Integer getId() {
return id;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取用户ID(关注者,-1表示所有人都关注)
*
* @return user_id - 用户ID(关注者,-1表示所有人都关注)
*/
public Integer getUserId() {
return userId;
}
/**
* 设置用户ID(关注者,-1表示所有人都关注)
*
* @param userId 用户ID(关注者,-1表示所有人都关注)
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取门店ID(关注者,-1表示所有人都关注)
*
* @return merchant_id - 门店ID(关注者,-1表示所有人都关注)
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置门店ID(关注者,-1表示所有人都关注)
*
* @param merchantId 门店ID(关注者,-1表示所有人都关注)
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取用户ID(被关注者)
*
* @return focused_user_id - 用户ID(被关注者)
*/
public Integer getFocusedUserId() {
return focusedUserId;
}
/**
* 设置用户ID(被关注者)
*
* @param focusedUserId 用户ID(被关注者)
*/
public void setFocusedUserId(Integer focusedUserId) {
this.focusedUserId = focusedUserId;
}
/**
* 获取门店ID(被关注者)
*
* @return focused_merchant_id - 门店ID(被关注者)
*/
public Integer getFocusedMerchantId() {
return focusedMerchantId;
}
/**
* 设置门店ID(被关注者)
*
* @param focusedMerchantId 门店ID(被关注者)
*/
public void setFocusedMerchantId(Integer focusedMerchantId) {
this.focusedMerchantId = focusedMerchantId;
}
/**
* 获取关注标识(Y:已关注;N:未关注)
*
* @return status - 关注标识(Y:已关注;N:未关注)
*/
public String getStatus() {
return status;
}
/**
* 设置关注标识(Y:已关注;N:未关注)
*
* @param status 关注标识(Y:已关注;N:未关注)
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "VpFocusUser [" + (id != null ? "id=" + id + ", " : "")
+ (userId != null ? "userId=" + userId + ", " : "")
+ (merchantId != null ? "merchantId=" + merchantId + ", " : "")
+ (focusedUserId != null ? "focusedUserId=" + focusedUserId + ", " : "")
+ (focusedMerchantId != null ? "focusedMerchantId=" + focusedMerchantId + ", " : "")
+ (status != null ? "status=" + status + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "dj_weapp_video_plus_material_car_series")
public class VpMaterialCarSeries implements Serializable{
/**
*
*/
private static final long serialVersionUID = -1314240529133220768L;
/**
* 主键
*/
@Id
private Long id;
/**
* 素材ID
*/
@Column(name = "material_id")
private Integer materialId;
/**
* 车辆品牌LOGO
*/
@Column(name = "car_brand_logo")
private String carBrandLogo;
/**
* 车辆品牌id
*/
@Column(name = "car_brand_id")
private Integer carBrandId;
/**
* 车辆品牌名称
*/
@Column(name = "car_brand")
private String carBrand;
/**
* 子品牌id
*/
@Column(name = "car_childs_brand_id")
private Integer carChildsBrandId;
/**
* 子品牌名字
*/
@Column(name = "car_childs_brand_name")
private String carChildsBrandName;
/**
* 车系id
*/
@Column(name = "car_series_id")
private Integer carSeriesId;
/**
* 车系名字
*/
@Column(name = "car_series_name")
private String carSeriesName;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键
*
* @return id - 主键
*/
public Long getId() {
return id;
}
/**
* 设置主键
*
* @param id 主键
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取素材ID
*
* @return material_id - 素材ID
*/
public Integer getMaterialId() {
return materialId;
}
/**
* 设置素材ID
*
* @param materialId 素材ID
*/
public void setMaterialId(Integer materialId) {
this.materialId = materialId;
}
/**
* 获取车辆品牌LOGO
*
* @return car_brand_logo - 车辆品牌LOGO
*/
public String getCarBrandLogo() {
return carBrandLogo;
}
/**
* 设置车辆品牌LOGO
*
* @param carBrandLogo 车辆品牌LOGO
*/
public void setCarBrandLogo(String carBrandLogo) {
this.carBrandLogo = carBrandLogo == null ? null : carBrandLogo.trim();
}
/**
* 获取车辆品牌id
*
* @return car_brand_id - 车辆品牌id
*/
public Integer getCarBrandId() {
return carBrandId;
}
/**
* 设置车辆品牌id
*
* @param carBrandId 车辆品牌id
*/
public void setCarBrandId(Integer carBrandId) {
this.carBrandId = carBrandId;
}
/**
* 获取车辆品牌名称
*
* @return car_brand - 车辆品牌名称
*/
public String getCarBrand() {
return carBrand;
}
/**
* 设置车辆品牌名称
*
* @param carBrand 车辆品牌名称
*/
public void setCarBrand(String carBrand) {
this.carBrand = carBrand == null ? null : carBrand.trim();
}
/**
* 获取子品牌id
*
* @return car_childs_brand_id - 子品牌id
*/
public Integer getCarChildsBrandId() {
return carChildsBrandId;
}
/**
* 设置子品牌id
*
* @param carChildsBrandId 子品牌id
*/
public void setCarChildsBrandId(Integer carChildsBrandId) {
this.carChildsBrandId = carChildsBrandId;
}
/**
* 获取子品牌名字
*
* @return car_childs_brand_name - 子品牌名字
*/
public String getCarChildsBrandName() {
return carChildsBrandName;
}
/**
* 设置子品牌名字
*
* @param carChildsBrandName 子品牌名字
*/
public void setCarChildsBrandName(String carChildsBrandName) {
this.carChildsBrandName = carChildsBrandName == null ? null : carChildsBrandName.trim();
}
/**
* 获取车系id
*
* @return car_series_id - 车系id
*/
public Integer getCarSeriesId() {
return carSeriesId;
}
/**
* 设置车系id
*
* @param carSeriesId 车系id
*/
public void setCarSeriesId(Integer carSeriesId) {
this.carSeriesId = carSeriesId;
}
/**
* 获取车系名字
*
* @return car_series_name - 车系名字
*/
public String getCarSeriesName() {
return carSeriesName;
}
/**
* 设置车系名字
*
* @param carSeriesName 车系名字
*/
public void setCarSeriesName(String carSeriesName) {
this.carSeriesName = carSeriesName == null ? null : carSeriesName.trim();
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "VpMaterialCarSeries [" + (id != null ? "id=" + id + ", " : "")
+ (materialId != null ? "materialId=" + materialId + ", " : "")
+ (carBrandLogo != null ? "carBrandLogo=" + carBrandLogo + ", " : "")
+ (carBrandId != null ? "carBrandId=" + carBrandId + ", " : "")
+ (carBrand != null ? "carBrand=" + carBrand + ", " : "")
+ (carChildsBrandId != null ? "carChildsBrandId=" + carChildsBrandId + ", " : "")
+ (carChildsBrandName != null ? "carChildsBrandName=" + carChildsBrandName + ", " : "")
+ (carSeriesId != null ? "carSeriesId=" + carSeriesId + ", " : "")
+ (carSeriesName != null ? "carSeriesName=" + carSeriesName + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Table(name = "dj_weapp_video_plus_material_collect")
public class VpMaterialCollect implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8356044801064684696L;
/**
* 主键ID
*/
@Id
private Integer id;
/**
* 收藏者用户ID
*/
@Column(name = "user_id")
private Integer userId;
/**
* 收藏者门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 素材ID
*/
@Column(name = "material_id")
private Integer materialId;
/**
* 收藏标识(Y:已收藏;N:未收藏)
*/
private String status;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public Integer getId() {
return id;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取收藏者用户ID
*
* @return user_id - 收藏者用户ID
*/
public Integer getUserId() {
return userId;
}
/**
* 设置收藏者用户ID
*
* @param userId 收藏者用户ID
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取收藏者门店ID
*
* @return merchant_id - 收藏者门店ID
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置收藏者门店ID
*
* @param merchantId 收藏者门店ID
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取素材ID
*
* @return material_id - 素材ID
*/
public Integer getMaterialId() {
return materialId;
}
/**
* 设置素材ID
*
* @param materialId 素材ID
*/
public void setMaterialId(Integer materialId) {
this.materialId = materialId;
}
/**
* 获取收藏标识(Y:已收藏;N:未收藏)
*
* @return status - 收藏标识(Y:已收藏;N:未收藏)
*/
public String getStatus() {
return status;
}
/**
* 设置收藏标识(Y:已收藏;N:未收藏)
*
* @param status 收藏标识(Y:已收藏;N:未收藏)
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "VpMaterialCollect [" + (id != null ? "id=" + id + ", " : "")
+ (userId != null ? "userId=" + userId + ", " : "")
+ (merchantId != null ? "merchantId=" + merchantId + ", " : "")
+ (materialId != null ? "materialId=" + materialId + ", " : "")
+ (status != null ? "status=" + status + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
@Table(name = "dj_weapp_video_plus_material_description")
public class VpMaterialDescription implements Serializable{
/**
*
*/
private static final long serialVersionUID = -5762224364372397914L;
/**
* 主键
*/
@Id
private Long id;
/**
* 素材ID
*/
@Column(name = "material_id")
private Integer materialId;
/**
* 规则类型(1:图片;2:文本)
*/
@ApiModelProperty(name = "type", notes = "规则类型(1:图片;2:文本)", dataType = "int")
private Byte type;
/**
* 内容(图片地址或文本内容)
*/
@ApiModelProperty(name = "content", notes = "内容(图片地址或文本内容)", dataType = "string")
private String content;
/**
* 排列顺序(升序)
*/
private Short sort;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键
*
* @return id - 主键
*/
public Long getId() {
return id;
}
/**
* 设置主键
*
* @param id 主键
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取素材ID
*
* @return material_id - 素材ID
*/
public Integer getMaterialId() {
return materialId;
}
/**
* 设置素材ID
*
* @param materialId 素材ID
*/
public void setMaterialId(Integer materialId) {
this.materialId = materialId;
}
/**
* 获取规则类型(1:图片;2:文本)
*
* @return type - 规则类型(1:图片;2:文本)
*/
public Byte getType() {
return type;
}
/**
* 设置规则类型(1:图片;2:文本)
*
* @param type 规则类型(1:图片;2:文本)
*/
public void setType(Byte type) {
this.type = type;
}
/**
* 获取内容(图片地址或文本内容)
*
* @return content - 内容(图片地址或文本内容)
*/
public String getContent() {
return content;
}
/**
* 设置内容(图片地址或文本内容)
*
* @param content 内容(图片地址或文本内容)
*/
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
/**
* 获取排列顺序(升序)
*
* @return sort - 排列顺序(升序)
*/
public Short getSort() {
return sort;
}
/**
* 设置排列顺序(升序)
*
* @param sort 排列顺序(升序)
*/
public void setSort(Short sort) {
this.sort = sort;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "VpMaterialDescription [" + (id != null ? "id=" + id + ", " : "")
+ (materialId != null ? "materialId=" + materialId + ", " : "")
+ (type != null ? "type=" + type + ", " : "") + (content != null ? "content=" + content + ", " : "")
+ (sort != null ? "sort=" + sort + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
@Table(name = "dj_weapp_video_plus_material_info")
public class VpMaterialInfo implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1344951704230667915L;
/**
* 主键ID
*/
@Id
private Integer id;
/**
* 用户ID
*/
@Column(name = "user_id")
private Integer userId;
/**
* 门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 模板编号
*/
@ApiModelProperty(name = "templateNum", notes = "模板编号", dataType = "int")
@Column(name = "template_num")
private Byte templateNum;
/**
* LOGO图地址
*/
@ApiModelProperty(name = "logoUrl", notes = "logo图片", dataType = "string")
@Column(name = "logo_url")
private String logoUrl;
/**
* 顶部广告图片
*/
@ApiModelProperty(name = "bannerImgUrl", notes = "顶部广告图片", dataType = "string")
@Column(name = "banner_img_url")
private String bannerImgUrl;
/**
* 底部广告图片
*/
@ApiModelProperty(name = "btmBannerImgUrl", notes = "底部广告图片", dataType = "string")
@Column(name = "btm_banner_img_url")
private String btmBannerImgUrl;
/**
* 名称
*/
@ApiModelProperty(name = "name", notes = "名称", dataType = "string")
private String name;
/**
* 分类
*/
@ApiModelProperty(name = "type", notes = "分类", dataType = "int")
private Byte type;
/**
* 分类名称
*/
@ApiModelProperty(name = "typeName", notes = "分类名称", dataType = "string")
@Column(name = "type_name")
private String typeName;
/**
* 子分类
*/
@ApiModelProperty(name = "subType", notes = "子分类", dataType = "int")
@Column(name = "sub_type")
private Integer subType;
/**
* 子分类名称
*/
@ApiModelProperty(name = "subTypeName", notes = "子分类名称", dataType = "string")
@Column(name = "sub_type_name")
private String subTypeName;
/**
* 文案
*/
@ApiModelProperty(name = "copywriting", notes = "文案", dataType = "string")
private String copywriting;
/**
* 音乐地址
*/
@ApiModelProperty(name = "musicUrl", notes = "音乐地址", dataType = "string")
@Column(name = "music_url")
private String musicUrl;
/**
* 音乐编号
*/
@ApiModelProperty(name = "musicId", notes = "音乐编号", dataType = "int")
@Column(name = "music_id")
private Integer musicId;
/**
* 原视频静音标识(Y:是;N:否)
*/
@ApiModelProperty(name = "videoMuteFlag", notes = "原视频静音标识(Y:是;N:否)", dataType = "string")
@Column(name = "video_mute_flag")
private String videoMuteFlag;
/**
* 产品封面图地址
*/
@ApiModelProperty(name = "productCoverUrl", notes = "产品封面图地址", dataType = "string")
@Column(name = "product_cover_url")
private String productCoverUrl;
/**
* 视频封面图(视频首帧图)
*/
@Column(name = "video_cover_url")
private String videoCoverUrl;
/**
* 标签名
*/
@ApiModelProperty(name = "labelName", notes = "标签名", dataType = "string")
@Column(name = "label_name")
private String labelName;
/**
* 发布标识(Y:是;N:否)
*/
@ApiModelProperty(name = "onlineFlag", notes = "发布标识(Y:是;N:否)", dataType = "string")
@Column(name = "online_flag")
private String onlineFlag;
/**
* 视频合成状态:1未开始;2合成中;3已完成
*/
@ApiModelProperty(name = "videoStatus", notes = "视频合成状态:1未开始;2合成中;3已完成", dataType = "string")
@Column(name = "video_status")
private Byte videoStatus;
/**
* 原始素材ID
*/
@Column(name = "original_material_id")
private Integer originalMaterialId;
/**
* 视频合成后地址
*/
@ApiModelProperty(name = "videoUrl", notes = "视频合成后地址", dataType = "string")
@Column(name = "video_url")
private String videoUrl;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public Integer getId() {
return id;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取用户ID
*
* @return user_id - 用户ID
*/
public Integer getUserId() {
return userId;
}
/**
* 设置用户ID
*
* @param userId 用户ID
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取门店ID
*
* @return merchant_id - 门店ID
*/
public Integer getMerchantId() {
return merchantId;
}
/**
* 设置门店ID
*
* @param merchantId 门店ID
*/
public void setMerchantId(Integer merchantId) {
this.merchantId = merchantId;
}
/**
* 获取模板编号
*
* @return template_num - 模板编号
*/
public Byte getTemplateNum() {
return templateNum;
}
/**
* 设置模板编号
*
* @param templateNum 模板编号
*/
public void setTemplateNum(Byte templateNum) {
this.templateNum = templateNum;
}
/**
* 获取LOGO图地址
*
* @return logo_url - LOGO图地址
*/
public String getLogoUrl() {
return logoUrl;
}
/**
* 设置LOGO图地址
*
* @param logoUrl LOGO图地址
*/
public void setLogoUrl(String logoUrl) {
this.logoUrl = logoUrl == null ? null : logoUrl.trim();
}
/**
* 获取名称
*
* @return name - 名称
*/
public String getName() {
return name;
}
/**
* 设置名称
*
* @param name 名称
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 获取分类
*
* @return type - 分类
*/
public Byte getType() {
return type;
}
/**
* 设置分类
*
* @param type 分类
*/
public void setType(Byte type) {
this.type = type;
}
/**
* 获取分类名称
*
* @return type_name - 分类名称
*/
public String getTypeName() {
return typeName;
}
/**
* 设置分类名称
*
* @param typeName 分类名称
*/
public void setTypeName(String typeName) {
this.typeName = typeName == null ? null : typeName.trim();
}
/**
* 获取子分类
*
* @return sub_type - 子分类
*/
public Integer getSubType() {
return subType;
}
/**
* 设置子分类
*
* @param subType 子分类
*/
public void setSubType(Integer subType) {
this.subType = subType;
}
/**
* 获取子分类名称
*
* @return sub_type_name - 子分类名称
*/
public String getSubTypeName() {
return subTypeName;
}
/**
* 设置子分类名称
*
* @param subTypeName 子分类名称
*/
public void setSubTypeName(String subTypeName) {
this.subTypeName = subTypeName == null ? null : subTypeName.trim();
}
/**
* 获取文案
*
* @return copywriting - 文案
*/
public String getCopywriting() {
return copywriting;
}
/**
* 设置文案
*
* @param copywriting 文案
*/
public void setCopywriting(String copywriting) {
this.copywriting = copywriting == null ? null : copywriting.trim();
}
/**
* 获取音乐地址
*
* @return music_url - 音乐地址
*/
public String getMusicUrl() {
return musicUrl;
}
/**
* 设置音乐地址
*
* @param musicUrl 音乐地址
*/
public void setMusicUrl(String musicUrl) {
this.musicUrl = musicUrl == null ? null : musicUrl.trim();
}
/**
* 获取原视频静音标识(Y:是;N:否)
*
* @return video_mute_flag - 原视频静音标识(Y:是;N:否)
*/
public String getVideoMuteFlag() {
return videoMuteFlag;
}
/**
* 设置原视频静音标识(Y:是;N:否)
*
* @param videoMuteFlag 原视频静音标识(Y:是;N:否)
*/
public void setVideoMuteFlag(String videoMuteFlag) {
this.videoMuteFlag = videoMuteFlag == null ? null : videoMuteFlag.trim();
}
/**
* 获取产品封面图地址
*
* @return product_cover_url - 产品封面图地址
*/
public String getProductCoverUrl() {
return productCoverUrl;
}
/**
* 设置产品封面图地址
*
* @param productCoverUrl 产品封面图地址
*/
public void setProductCoverUrl(String productCoverUrl) {
this.productCoverUrl = productCoverUrl == null ? null : productCoverUrl.trim();
}
/**
* 获取标签名
*
* @return label_name - 标签名
*/
public String getLabelName() {
return labelName;
}
/**
* 设置标签名
*
* @param labelName 标签名
*/
public void setLabelName(String labelName) {
this.labelName = labelName == null ? null : labelName.trim();
}
/**
* 获取发布标识(Y:是;N:否)
*
* @return online_flag - 发布标识(Y:是;N:否)
*/
public String getOnlineFlag() {
return onlineFlag;
}
/**
* 设置发布标识(Y:是;N:否)
*
* @param onlineFlag 发布标识(Y:是;N:否)
*/
public void setOnlineFlag(String onlineFlag) {
this.onlineFlag = onlineFlag == null ? null : onlineFlag.trim();
}
/**
* 获取视频合成状态:1未开始;2合成中;3已完成
*
* @return video_status - 视频合成状态:1未开始;2合成中;3已完成
*/
public Byte getVideoStatus() {
return videoStatus;
}
/**
* 设置视频合成状态:1未开始;2合成中;3已完成
*
* @param videoStatus 视频合成状态:1未开始;2合成中;3已完成
*/
public void setVideoStatus(Byte videoStatus) {
this.videoStatus = videoStatus;
}
/**
* 获取原始素材ID
*
* @return original_material_id - 原始素材ID
*/
public Integer getOriginalMaterialId() {
return originalMaterialId;
}
/**
* 设置原始素材ID
*
* @param originalMaterialId 原始素材ID
*/
public void setOriginalMaterialId(Integer originalMaterialId) {
this.originalMaterialId = originalMaterialId;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
public String getVideoCoverUrl() {
return videoCoverUrl;
}
public void setVideoCoverUrl(String videoCoverUrl) {
this.videoCoverUrl = videoCoverUrl;
}
public String getBannerImgUrl() {
return bannerImgUrl;
}
public void setBannerImgUrl(String bannerImgUrl) {
this.bannerImgUrl = bannerImgUrl;
}
public String getVideoUrl() {
return videoUrl;
}
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
public Integer getMusicId() {
return musicId;
}
public void setMusicId(Integer musicId) {
this.musicId = musicId;
}
public String getBtmBannerImgUrl() {
return btmBannerImgUrl;
}
public void setBtmBannerImgUrl(String btmBannerImgUrl) {
this.btmBannerImgUrl = btmBannerImgUrl;
}
@Override
public String toString() {
return "VpMaterialInfo [" + (id != null ? "id=" + id + ", " : "")
+ (userId != null ? "userId=" + userId + ", " : "")
+ (merchantId != null ? "merchantId=" + merchantId + ", " : "")
+ (templateNum != null ? "templateNum=" + templateNum + ", " : "")
+ (logoUrl != null ? "logoUrl=" + logoUrl + ", " : "")
+ (bannerImgUrl != null ? "bannerImgUrl=" + bannerImgUrl + ", " : "")
+ (btmBannerImgUrl != null ? "btmBannerImgUrl=" + btmBannerImgUrl + ", " : "")
+ (name != null ? "name=" + name + ", " : "") + (type != null ? "type=" + type + ", " : "")
+ (typeName != null ? "typeName=" + typeName + ", " : "")
+ (subType != null ? "subType=" + subType + ", " : "")
+ (subTypeName != null ? "subTypeName=" + subTypeName + ", " : "")
+ (copywriting != null ? "copywriting=" + copywriting + ", " : "")
+ (musicUrl != null ? "musicUrl=" + musicUrl + ", " : "")
+ (musicId != null ? "musicId=" + musicId + ", " : "")
+ (videoMuteFlag != null ? "videoMuteFlag=" + videoMuteFlag + ", " : "")
+ (productCoverUrl != null ? "productCoverUrl=" + productCoverUrl + ", " : "")
+ (videoCoverUrl != null ? "videoCoverUrl=" + videoCoverUrl + ", " : "")
+ (labelName != null ? "labelName=" + labelName + ", " : "")
+ (onlineFlag != null ? "onlineFlag=" + onlineFlag + ", " : "")
+ (videoStatus != null ? "videoStatus=" + videoStatus + ", " : "")
+ (originalMaterialId != null ? "originalMaterialId=" + originalMaterialId + ", " : "")
+ (videoUrl != null ? "videoUrl=" + videoUrl + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
@Table(name = "dj_weapp_video_plus_material_resource")
public class VpMaterialResource implements Serializable{
/**
*
*/
private static final long serialVersionUID = 8583577640878037787L;
/**
* ID
*/
@Id
private Long id;
/**
* 素材ID
*/
@Column(name = "material_id")
private Integer materialId;
/**
* 资源地址
*/
@ApiModelProperty(name = "resUrl", notes = "资源地址", dataType = "string")
@Column(name = "res_url")
private String resUrl;
/**
* 资源类型(1:图片;2:视频,)
*/
@ApiModelProperty(name = "resType", notes = "资源类型(1:图片;2:视频,)", dataType = "int")
@Column(name = "res_type")
private Byte resType;
/**
* 业务类型(1:产品主图;2:模板资源,)
*/
@Column(name = "biz_type")
private Byte bizType;
/**
* 编号(用于定位模板资源在哪个位置显示)
*/
@Column(name = "biz_num")
@ApiModelProperty(name = "bizNum", notes = "编号(用于定位模板资源在哪个位置显示)", dataType = "int")
private Byte bizNum;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 获取ID
*
* @return id - ID
*/
public Long getId() {
return id;
}
/**
* 设置ID
*
* @param id ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取素材ID
*
* @return material_id - 素材ID
*/
public Integer getMaterialId() {
return materialId;
}
/**
* 设置素材ID
*
* @param materialId 素材ID
*/
public void setMaterialId(Integer materialId) {
this.materialId = materialId;
}
/**
* 获取资源地址
*
* @return res_url - 资源地址
*/
public String getResUrl() {
return resUrl;
}
/**
* 设置资源地址
*
* @param resUrl 资源地址
*/
public void setResUrl(String resUrl) {
this.resUrl = resUrl == null ? null : resUrl.trim();
}
/**
* 获取资源类型(1:图片;2:视频,)
*
* @return res_type - 资源类型(1:图片;2:视频,)
*/
public Byte getResType() {
return resType;
}
/**
* 设置资源类型(1:图片;2:视频,)
*
* @param resType 资源类型(1:图片;2:视频,)
*/
public void setResType(Byte resType) {
this.resType = resType;
}
/**
* 获取业务类型(1:产品主图;2:模板资源,)
*
* @return biz_type - 业务类型(1:产品主图;2:模板资源,)
*/
public Byte getBizType() {
return bizType;
}
/**
* 设置业务类型(1:产品主图;2:模板资源,)
*
* @param bizType 业务类型(1:产品主图;2:模板资源,)
*/
public void setBizType(Byte bizType) {
this.bizType = bizType;
}
/**
* 获取编号(用于定位模板资源在哪个位置显示)
*
* @return biz_num - 编号(用于定位模板资源在哪个位置显示)
*/
public Byte getBizNum() {
return bizNum;
}
/**
* 设置编号(用于定位模板资源在哪个位置显示)
*
* @param bizNum 编号(用于定位模板资源在哪个位置显示)
*/
public void setBizNum(Byte bizNum) {
this.bizNum = bizNum;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
@Override
public String toString() {
return "VpMaterialResource [" + (id != null ? "id=" + id + ", " : "")
+ (materialId != null ? "materialId=" + materialId + ", " : "")
+ (resUrl != null ? "resUrl=" + resUrl + ", " : "")
+ (resType != null ? "resType=" + resType + ", " : "")
+ (bizType != null ? "bizType=" + bizType + ", " : "")
+ (bizNum != null ? "bizNum=" + bizNum + ", " : "")
+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
+ (createdDate != null ? "createdDate=" + createdDate + ", " : "")
+ (updatedBy != null ? "updatedBy=" + updatedBy + ", " : "")
+ (updatedDate != null ? "updatedDate=" + updatedDate + ", " : "")
+ (deletedFlag != null ? "deletedFlag=" + deletedFlag : "") + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.model;
import javax.persistence.Table;
import cn.com.glsx.framework.core.beans.BaseModel;
/**
* @Title: WeappModule.java
* @Description: 模块配置
* @author yangjia
* @date 2019/04/28
*/
@Table(name = "dj_weapp_module")
public class WeappModule extends BaseModel {
private static final long serialVersionUID = -5086510739653894345L;
/**
* 模块名
*/
private String moduleName;
/**
* 模块路径
*/
private String modulePath;
/**
* 模块图片
*/
private String moduleIcon;
/**
* 模块样式
*/
private String moduleClass;
/**
* 路径类别(H5:网页;WEAPP:小程序)
*/
private String pathCategory;
/**
* 模块别名
*/
private String moduleAlias;
/**
* 模块层级
*/
private Integer moduleLevel;
/**
* 模块排序
*/
private Integer moduleSort;
/**
* 上级模块ID(DJ_WEAPP_MODULE.ID)
*/
private Integer parentId;
/**
* 模块状态(ON:上架;OF:下架)
*/
private String moduleStatus;
/**
* 是否需要登录(Y:是;N:否)
*/
private String needLogin;
/**
* 微信应用ID
*/
private String appId;
/**
* 获取模块名
*
* @return MODULE_NAME - 模块名
*/
public String getModuleName() {
return moduleName;
}
/**
* 设置模块名
*
* @param moduleName 模块名
*/
public void setModuleName(String moduleName) {
this.moduleName = moduleName == null ? null : moduleName.trim();
}
/**
* 获取模块路径
*
* @return MODULE_PATH - 模块路径
*/
public String getModulePath() {
return modulePath;
}
/**
* 设置模块路径
*
* @param modulePath 模块路径
*/
public void setModulePath(String modulePath) {
this.modulePath = modulePath == null ? null : modulePath.trim();
}
/**
* 获取模块图片
*
* @return MODULE_ICON - 模块图片
*/
public String getModuleIcon() {
return moduleIcon;
}
/**
* 设置模块图片
*
* @param moduleIcon 模块图片
*/
public void setModuleIcon(String moduleIcon) {
this.moduleIcon = moduleIcon == null ? null : moduleIcon.trim();
}
/**
* 获取模块样式
*
* @return MODULE_CLASS - 模块样式
*/
public String getModuleClass() {
return moduleClass;
}
/**
* 设置模块样式
*
* @param moduleClass 模块样式
*/
public void setModuleClass(String moduleClass) {
this.moduleClass = moduleClass == null ? null : moduleClass.trim();
}
/**
* 获取路径类别(H5:网页;WEAPP:小程序)
*
* @return PATH_CATEGORY - 路径类别(H5:网页;WEAPP:小程序)
*/
public String getPathCategory() {
return pathCategory;
}
/**
* 设置路径类别(H5:网页;WEAPP:小程序)
*
* @param pathCategory 路径类别(H5:网页;WEAPP:小程序)
*/
public void setPathCategory(String pathCategory) {
this.pathCategory = pathCategory == null ? null : pathCategory.trim();
}
/**
* 获取模块别名
*
* @return MODULE_ALIAS - 模块别名
*/
public String getModuleAlias() {
return moduleAlias;
}
/**
* 设置模块别名
*
* @param moduleAlias 模块别名
*/
public void setModuleAlias(String moduleAlias) {
this.moduleAlias = moduleAlias == null ? null : moduleAlias.trim();
}
/**
* 获取模块层级
*
* @return MODULE_LEVEL - 模块层级
*/
public Integer getModuleLevel() {
return moduleLevel;
}
/**
* 设置模块层级
*
* @param moduleLevel 模块层级
*/
public void setModuleLevel(Integer moduleLevel) {
this.moduleLevel = moduleLevel;
}
/**
* 获取模块排序
*
* @return MODULE_SORT - 模块排序
*/
public Integer getModuleSort() {
return moduleSort;
}
/**
* 设置模块排序
*
* @param moduleSort 模块排序
*/
public void setModuleSort(Integer moduleSort) {
this.moduleSort = moduleSort;
}
/**
* 获取上级模块ID(DJ_WEAPP_MODULE.ID)
*
* @return PARENT_ID - 上级模块ID(DJ_WEAPP_MODULE.ID)
*/
public Integer getParentId() {
return parentId;
}
/**
* 设置上级模块ID(DJ_WEAPP_MODULE.ID)
*
* @param parentId 上级模块ID(DJ_WEAPP_MODULE.ID)
*/
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
/**
* 获取模块状态(ON:上架;OF:下架)
*
* @return MODULE_STATUS - 模块状态(ON:上架;OF:下架)
*/
public String getModuleStatus() {
return moduleStatus;
}
/**
* 设置模块状态(ON:上架;OF:下架)
*
* @param moduleStatus 模块状态(ON:上架;OF:下架)
*/
public void setModuleStatus(String moduleStatus) {
this.moduleStatus = moduleStatus == null ? null : moduleStatus.trim();
}
/**
* 获取是否需要登录(Y:是;N:否)
*
* @return NEED_LOGIN - 是否需要登录(Y:是;N:否)
*/
public String getNeedLogin() {
return needLogin;
}
/**
* 设置是否需要登录(Y:是;N:否)
*
* @param needLogin 是否需要登录(Y:是;N:否)
*/
public void setNeedLogin(String needLogin) {
this.needLogin = needLogin == null ? null : needLogin.trim();
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
@Override
public String toString() {
return "WeappModule [moduleName=" + moduleName + ", modulePath="
+ modulePath + ", moduleIcon=" + moduleIcon + ", moduleClass="
+ moduleClass + ", pathCategory=" + pathCategory
+ ", moduleAlias=" + moduleAlias + ", moduleLevel="
+ moduleLevel + ", moduleSort=" + moduleSort + ", parentId="
+ parentId + ", moduleStatus=" + moduleStatus + ", needLogin="
+ needLogin + ", appId=" + appId + ", toString()="
+ super.toString() + "]";
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: CustomerServiceMessageCatalogRemote.java
* @Description: 客服消息列表远程服务
* @author zhoudan
* @date 2020/04/21
*/
@ApiService(value="智慧门店-客服消息列表接口",owner="zhoudan")
public interface CustomerServiceMessageCatalogRemote {
/**
* 创建客服消息
* @param customerServiceMessageCatalog
* @return
*/
@ApiMethod(value = "创建客服消息列表")
@ApiParams({@ApiParam(name = "customerServiceMessageCatalog",notes = "客服消息列表",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的客服消息列表")
RpcResponse<CustomerServiceMessageCatalog> insert(CustomerServiceMessageCatalog customerServiceMessageCatalog);
/**
* 由ID获取客服消息列表
* @param id
* @return
*/
@ApiMethod(value = "由ID获取客服消息列表")
@ApiParams({@ApiParam(name = "id",notes = "客服消息id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的客服消息列表")
RpcResponse<CustomerServiceMessageCatalog> getById(Integer id);
/**
* 由客户ID获取客服消息列表
* @param accountId
* @return
*/
@ApiMethod(value = "由客户ID获取客服消息列表")
@ApiParams({@ApiParam(name = "accountId",notes = "客户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true),
@ApiParam(name = "merchantId",notes = "商户号",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的客服消息列表")
RpcResponse<CustomerServiceMessageCatalog> getByAccountId(Integer accountId,Integer merchantId);
/**
* 分页获取客服消息列表
* @param pagination
* @return
*/
@ApiMethod(value = "分页获取客服消息列表")
@ApiParams({@ApiParam(name = "pagination",notes = "分页对象",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的客服消息列表")
RpcResponse<RpcPagination<CustomerServiceMessageCatalog>> getByPage(RpcPagination<CustomerServiceMessageCatalog> pagination);
/**
* 更新客服消息列表
* @param customerServiceMessageCatalog
* @return
*/
@ApiMethod(value = "更新客服消息列表")
@ApiParams({@ApiParam(name = "customerServiceMessageCatalog",notes = "客服消息列表",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("更新结果")
RpcResponse<Integer> updateByAccountId(CustomerServiceMessageCatalog customerServiceMessageCatalog);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title: CustomerServiceMessageRemote.java
* @Description: 客服消息远程服务
* @author zhoudan
* @date 2020/04/21
*/
@ApiService(value="智慧门店-客服消息接口",owner="zhoudan")
public interface CustomerServiceMessageRemote {
/**
* 创建客服消息
* @param customerServiceMessage
* @return
*/
@ApiMethod(value = "创建客服消息")
@ApiParams({@ApiParam(name = "customerServiceMessage",notes = "客服消息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的客服消息")
RpcResponse<CustomerServiceMessageDTO> insert(CustomerServiceMessageDTO customerServiceMessage);
/**
* 由商户ID获取客服消息
* @param merchantId
* @return
*/
@ApiMethod(value = "由商户ID获取客服消息")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的客服消息")
RpcResponse<List<CustomerServiceMessage>> getByMerchantId(Integer merchantId);
/**
* 由客户ID获取客服消息
* @param accountId
* @return
*/
@ApiMethod(value = "由客户ID获取客服消息")
@ApiParams({@ApiParam(name = "accountId",notes = "客户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true),
@ApiParam(name = "merchantId",notes = "商户号",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的客服消息")
RpcResponse<List<CustomerServiceMessageDTO>> getByAccountId(Integer accountId,Integer merchantId);
/**
* 由客户ID获取未读客服消息
* @param customerServiceMessage
* @return
*/
@ApiMethod(value = "页面停留轮询获取未读客服消息")
@ApiParams({@ApiParam(name = "customerServiceMessage",notes = "客服消息对象",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("获取的客服消息")
RpcResponse<List<CustomerServiceMessageDTO>> getUnreadByAccountId(CustomerServiceMessage customerServiceMessage);
/**
* 更新客服消息
* @param customerServiceMessage
* @return
*/
@ApiMethod(value = "更新客服消息")
@ApiParams({@ApiParam(name = "customerServiceMessage",notes = "客服消息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("更新结果")
RpcResponse<Integer> updateByAccountId(CustomerServiceMessage customerServiceMessage);
/**
* 统计待处理消息
* @param merchantId
* @return
*/
@ApiMethod(value = "统计待处理消息")
@ApiParams({@ApiParam(name = "merchantId",notes = "待处理消息",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("统计结果")
RpcResponse<Integer> countByMerchantId(Integer merchantId);
/**
* 获取有未读消息的商户
* @param status
* @return
*/
@ApiMethod(value = "获取有未读消息的商户")
@ApiParams({@ApiParam(name = "status",notes = "消息状态",dataType = ApiParam.DataTypeEnum.STRING,required = true),
@ApiParam(name = "type",notes = "发送方类型",dataType = ApiParam.DataTypeEnum.STRING,required = true)})
@ApiResponse("获取的商户")
RpcResponse<List<CustomerServiceMessage>> getMerchantByUnread(String status,String type);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title: IntelligentRemindRuleRemote.java
* @Description: 智能提醒规则远程服务
* @author zhoudan
* @date 2020/04/21
*/
@ApiService(value="智慧门店-智能提醒规则接口",owner="zhoudan")
public interface IntelligentRemindRuleRemote {
/**
* 分页获取智能提醒规则大类
* @param pagination
* @return
*/
@ApiMethod(value = "分页获取智能提醒规则")
@ApiParams({@ApiParam(name="pagination", notes="分页对象", dataType= ApiParam.DataTypeEnum.OBJECT, required=true)})
@ApiResponse("返回分页智能提醒规则")
RpcResponse<RpcPagination<IntelligentRemindRule>> selectByPage(RpcPagination<IntelligentRemindRule> pagination);
/**
* 获取智能提醒规则分类
* @param
* @return
*/
@ApiMethod(value = "获取智能提醒规则所有分类")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户号",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒规则分类")
RpcResponse<List<IntelligentRemindRule>> getRuleClass(Integer merchantId);
/**
* 获取智能提醒规则大类中的子类
* @param
* @return
*/
@ApiMethod(value = "获取智能提醒规则大类中的子类")
@ApiParams({@ApiParam(name = "intelligentReminder",notes = "提醒规则",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("获取的智能提醒规则子类")
RpcResponse<List<IntelligentRemindRule>> getRuleList(IntelligentRemindRule intelligentRemindRule);
/**
* 创建智能提醒规则
* @param intelligentRemindRule
* @return
*/
@ApiMethod(value = "创建智能提醒规则")
@ApiParams({@ApiParam(name = "intelligentReminder",notes = "提醒规则",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的提醒规则")
RpcResponse<IntelligentRemindRule> insert(IntelligentRemindRule intelligentRemindRule);
/**
* 由ID获取智能提醒规则
* @param id
* @return
*/
@ApiMethod(value = "由ID获取智能提醒规则")
@ApiParams({@ApiParam(name = "id",notes = "提醒规则id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒规则")
RpcResponse<IntelligentRemindRule> getById(Integer id);
/**
* 由商户ID获取智能提醒规则列表
* @param merchantId
* @return
*/
@ApiMethod(value = "由商户ID获取智能提醒规则列表")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒规则列表")
RpcResponse<List<IntelligentRemindRule>> getByMerchantId(Integer merchantId);
/**
* 更新智能提醒规则
* @param intelligentRemindRule
* @return
*/
@ApiMethod(value = "更新智能提醒规则")
@ApiParams({@ApiParam(name = "intelligentRemindRule",notes = "提醒规则",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("更新结果")
RpcResponse<Integer> update(IntelligentRemindRule intelligentRemindRule);
/**
* 根据id删除智能提醒规则
* @param id
* @return
*/
@ApiMethod(value = "根据id删除智能提醒规则")
@ApiParams({@ApiParam(name = "id",notes = "提醒规则",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("删除结果")
RpcResponse<Integer> deleteById(Integer id);
/**
* 首次登录门店拷贝默认规则
* @param merchantId
* @return
*/
@ApiMethod(value = "首次登录门店拷贝默认规则")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒规则子类")
RpcResponse<Integer> copyRuleList(Integer merchantId);
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: IntelligentRemindServiceClassifyTagRemote.java
* @Description:智慧门店-智能提醒服务分类标签远程接口
* @author Alvin
* @date 2020年11月9日 上午11:26:48
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@ApiService(value="智慧门店-智能提醒服务分类标签接口", owner="alvin")
public interface IntelligentRemindServiceClassifyTagRemote {
@ApiMethod(value = "创建智能提醒服务分类标签")
@ApiParams({@ApiParam(name = "serviceClassifyTag",notes = "服务分类标签",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("服务分类标签")
RpcResponse<IntelligentRemindServiceClassifyTag> add(IntelligentRemindServiceClassifyTag serviceClassifyTag);
@ApiMethod(value = "删除自定义智能提醒服务分类标签")
@ApiParams({@ApiParam(name = "classifyTagId",notes = "服务分类标签",dataType = ApiParam.DataTypeEnum.LONG,required = true)})
RpcResponse<Boolean> delete(Long classifyTagId);
@ApiMethod(value = "获取智能提醒服务分类标签列表")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户号",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("服务分类标签列表")
RpcResponse<List<IntelligentRemindServiceClassifyTag>> list(Integer merchantId);
@ApiMethod(value = "查询智能提醒服务分类标签列表")
@ApiParams({@ApiParam(name = "condition",notes = "查询条件",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("服务分类标签列表")
RpcResponse<List<IntelligentRemindServiceClassifyTag>> search(IntelligentRemindServiceClassifyTag condition);
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceCopyInfoDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.model.IntelligentRemindService;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: IntelligentRemindServiceRemote.java
* @Description: 智能提醒服务远程服务
* @author zhoudan
* @date 2020/04/21
*/
@ApiService(value="智慧门店-智能提醒服务接口",owner="zhoudan")
public interface IntelligentRemindServiceRemote {
/**
* 创建智能提醒服务
* @param intelligentRemindService
* @return
*/
@ApiMethod(value = "创建智能提醒服务")
@ApiParams({@ApiParam(name = "intelligentReminder",notes = "提醒服务",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的提醒服务")
RpcResponse<IntelligentRemindServiceDTO> insert(IntelligentRemindServiceDTO intelligentRemindService);
/**
* 分页获取提醒服务
* @param pagination
* @return
*/
@ApiMethod(value = "分页获取提醒服务")
@ApiParams({@ApiParam(name="pagination", notes="分页对象", dataType= ApiParam.DataTypeEnum.OBJECT, required=true)})
@ApiResponse("返回分页提醒服务")
RpcResponse<RpcPagination<IntelligentRemindServiceDTO>> selectByPage(RpcPagination<IntelligentRemindServiceDTO> pagination);
/**
* 由ID获取智能提醒服务详情
* @param id
* @return
*/
@ApiMethod(value = "由ID获取智能提醒服务")
@ApiParams({@ApiParam(name = "id",notes = "提醒服务id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒服务")
RpcResponse<IntelligentRemindServiceDTO> getById(Integer id);
/**
* 由商户ID获取智能提醒服务列表
* @param merchantId
* @return
*/
@ApiMethod(value = "由商户ID获取智能提醒服务列表")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的智能提醒服务列表")
RpcResponse<List<IntelligentRemindServiceDTO>> getByMerchantId(Integer merchantId);
/**
* 获取智能提醒服务列表
* @param intelligentRemindServiceDTO
* @return
*/
@ApiMethod(value = "获取智能提醒服务列表", deprecated = true)
@ApiParams({@ApiParam(name = "intelligentRemindServiceDTO",notes = "提醒服务",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("获取的智能提醒服务列表")
@Deprecated
RpcResponse<List<IntelligentRemindServiceDTO>> getByCondition(IntelligentRemindServiceDTO intelligentRemindServiceDTO);
/**
* 获取智能提醒服务列表(新)
* @param intelligentRemindServiceDTO
* @return
*/
@ApiMethod(value = "获取智能提醒服务列表(新)")
@ApiParams({@ApiParam(name = "conditionDTO", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("获取的智能提醒服务列表")
RpcResponse<List<IntelligentRemindService>> getRemindServiceList(IntelligentRemindServiceListConditionDTO conditionDTO);
/**
* 由规则ID获取智能提醒服务列表
* @param remindRuleId
* @return
*/
@ApiMethod(value = "由规则ID获取智能提醒服务列表")
@ApiParams({@ApiParam(name = "remindRuleId",notes = "规则id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("由规则ID获取智能提醒服务列表")
RpcResponse<List<IntelligentRemindServiceDTO>> getByRemindRuleId(Integer remindRuleId);
/**
* 更新智能提醒服务
* @param intelligentRemindServiceDTO
* @return
*/
@ApiMethod(value = "更新智能提醒服务")
@ApiParams({@ApiParam(name = "intelligentRemindServiceDTO",notes = "提醒服务",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("更新结果")
RpcResponse<Integer> update(IntelligentRemindServiceDTO intelligentRemindServiceDTO);
/**
* 根据id删除智能提醒服务
* @param id
* @return
*/
@ApiMethod(value = "根据id删除智能提醒服务")
@ApiParams({@ApiParam(name = "id",notes = "提醒服务",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("删除结果")
RpcResponse<Integer> deleteById(Integer id);
/**
* 拷贝智能提醒服务
* @param copyInfo
* @return
* @author Alvin
* @date 2020年10月17日 下午3:41:09
*/
@ApiMethod(value = "拷贝智能提醒服务")
@ApiParams({@ApiParam(name = "copyInfo",notes = "拷贝信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("成功条数")
RpcResponse<Integer> copyRemindService(IntelligentRemindServiceCopyInfoDTO copyInfo);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title: IntelligentRminderRemote.java
* @Description: 智能提醒程服务
* @author yangjia
* @date 2019/04/30
*/
@ApiService(value="嘀加系统-智能提醒接口",owner="yangjia")
public interface IntelligentRminderRemote {
@ApiMethod(value = "创建智能提醒")
@ApiParams({@ApiParam(name = "intelligentReminder",notes = "提醒信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的提醒")
RpcResponse<IntelligentReminder> insertIntelligentReminder(IntelligentReminder intelligentReminder);
@ApiMethod(value = "由ID获取智能提醒")
@ApiParams({@ApiParam(name = "id",notes = "提醒信息",dataType = ApiParam.DataTypeEnum.LONG,required = true)})
@ApiResponse("获取的智能提醒")
RpcResponse<IntelligentReminder> getIntelligentReminderById(Long id);
@ApiMethod(value = "根据账户ID和商户ID分页获取提醒信息")
@ApiParams({@ApiParam(name = "accountId",notes = "账户ID",dataType = ApiParam.DataTypeEnum.INTEGER,required = true),
@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)
})
@ApiResponse("返回分页提醒信息")
RpcResponse<RpcPagination<IntelligentReminderDTO>> selectByCondition(RpcPagination<IntelligentReminderDTO> pagination);
@ApiMethod(value = "更新智能提醒")
@ApiParams({@ApiParam(name = "intelligentReminder",notes = "提醒信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("更新结果")
RpcResponse<IntelligentReminder> updateReminderByCondition(IntelligentReminder intelligentReminder);
@ApiMethod(value = "根据id删除智能提醒")
@ApiParams({@ApiParam(name = "id",notes = "提醒信息",dataType = ApiParam.DataTypeEnum.LONG,required = true)})
@ApiResponse("删除结果")
RpcResponse<?> deleterReminderById(Long id);
@ApiMethod(value = "根据reminderId删除智能提醒")
@ApiParams({@ApiParam(name = "reminderId",notes = "提醒信息",dataType = ApiParam.DataTypeEnum.LONG,required = true)})
@ApiResponse("删除结果")
RpcResponse<Integer> deleterReminderByReminderId(Integer reminderId);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title: MerchantModuleRemote.java
* @Description: 商户模块接口
* @author yangjia
* @date 2019/05/01
*/
@ApiService(value="嘀加系统-商户模块接口",owner="yangjia")
public interface MerchantModuleRemote {
/**
* @Title: listMerchantModuleById
* @Description: 根据商户ID和模块ID获取某商户某模块可展示的子模块
* @param merchantId
* @param moduleId
* @return RpcResponse<<MerchantModuleDTO>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "根据商户ID和模块ID获取某商户某模块可展示的子模块")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true),
@ApiParam(name = "moduleId",notes = "模块的ID",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("已上架的子模块列表")
RpcResponse<List<MerchantModuleDTO>> listMerchantModuleById(Integer merchantId, Long moduleId);
/**
* @Title: insertMerchantModule
* @Description: 批量插入商户模块信息
* @param merchantModules
* @return RpcResponse
* @author yangjia
* @Date: 22019/04/28
*/
@ApiMethod(value = "批量插入商户模块信息")
@ApiParam(name = "List<MerchantModule>",notes = "商户模块列表",dataType = ApiParam.DataTypeEnum.LIST,required = true)
@ApiResponse("插入结果")
RpcResponse<?> insertMerchantModule(List<MerchantModule> merchantModules);
/**
* @Title: updateMerchantModule
* @Description: 批量修改商户模块信息
* @param merchantModules
* @return RpcResponse
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "批量修改商户模块信息")
@ApiParam(name = "List<MerchantModule>",notes = "商户模块列表",dataType = ApiParam.DataTypeEnum.LIST,required = true)
@ApiResponse("修改结果")
RpcResponse<?> updateMerchantModule(List<MerchantModule> merchantModules);
/**
* @Title: listAllMerchantModuleByMerchantId
* @Description: 查询某商户下所有的模块信息
* @param merchantId
* @return RpcResponse<List<MerchantModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "查询某商户下所有的模块信息")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true),
@ApiParam(name = "deleteFlag",notes = "删除标志",dataType = ApiParam.DataTypeEnum.STRING)})
@ApiResponse("商户模块列表")
RpcResponse<List<MerchantModule>> listAllMerchantModuleByMerchantId(Integer merchantId,String deleteFlag);
/**
* @Title: cleanMerchantModuleCache
* @Description: 清除商户下面的所有模块缓存
* @param merchantId
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "清除商户下面的所有模块缓存")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true)})
@ApiResponse("清除结果")
RpcResponse<Boolean> cleanMerchantModuleCache(Integer merchantId);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.annotation.ApiParam.DataTypeEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: MerchantWeappNoticeRemote.java
* @Description: 商户小程序公告远程服务
* @author Alvin
* @date 2019年4月30日 下午9:49:39
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@ApiService(value = "商户小程序公告远程服务", owner = "zengqi")
public interface MerchantWeappNoticeRemote {
/**
* 修改公告
* @param merchantWeappNotice 公告参数
* @return
* @author Alvin
* @date 2019年4月30日 下午9:52:08
*/
@ApiMethod("修改公告")
@ApiParam(name = "merchantWeappNotice", notes = "公告参数", required = true, dataType = DataTypeEnum.OBJECT)
@ApiResponse("修改后的公告信息")
RpcResponse<MerchantWeappNotice> merge(MerchantWeappNotice merchantWeappNotice);
/**
* 根据商户号获取公告信息
* @param merchantId 商户号
* @return
* @author Alvin
* @date 2019年4月30日 下午9:52:39
*/
@ApiMethod("根据商户号获取公告信息")
@ApiParam(name = "merchantId", notes = "商户号", required = true, dataType = DataTypeEnum.INTEGER)
@ApiResponse("公告信息")
RpcResponse<MerchantWeappNotice> getByMerchantId(Integer merchantId);
/**
* 根据小程序应用Id获取公告信息
* @param merchantId 商户号
* @return
* @author Alvin
* @date 2019年4月30日 下午9:52:39
*/
@ApiMethod("根据小程序应用Id获取公告信息")
@ApiParam(name = "appId", notes = "小程序应用Id", required = true, dataType = DataTypeEnum.INTEGER)
@ApiResponse("公告信息")
RpcResponse<MerchantWeappNotice> getByAppId(String appId);
/**
* 获取B端小程序系统公告信息
* @return
* @author Alvin
* @date 2020年11月9日 上午10:15:42
*/
@ApiMethod("获取B端小程序系统公告信息")
@ApiResponse("公告信息")
RpcResponse<MerchantWeappNotice> getPlatfromNotice();
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.PageVisitDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.Map;
/**
* @Title: PageVisitCollectRemote.java
* @Description:智慧门店-页面访问收集接口
* @author zengqi
* @date 2021年6月4日 下午1:57:08
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@ApiService(value="智慧门店-页面访问收集接口", owner="zengqi")
public interface PageVisitCollectRemote {
/**
* 收集页面访问记录
* @param pageVisit
* @return
* @author zengqi
* @date 2021年6月4日 下午4:22:18
*/
@ApiMethod(value = "收集页面访问记录")
@ApiParams({@ApiParam(name = "pageVisit",notes = "页面信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("页面访问总数")
RpcResponse<Long> collect(PageVisitDTO pageVisit);
/**
* 获取指定条件页面访问总数
* @param pageVisit
* @return
* @author zengqi
* @date 2021年6月4日 下午4:43:07
*/
@ApiMethod(value = "获取指定条件页面访问总数")
@ApiParams({@ApiParam(name = "pageVisit",notes = "页面信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true),
@ApiParam(name = "startDate",notes = "页面信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = false),
@ApiParam(name = "endDate",notes = "页面信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = false),
})
@ApiResponse("页面访问总数")
RpcResponse<Map<String,Long>> getCount(PageVisitDTO pageVisit,String startDate,String endDate);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: QrCodeManageRemote.java
* @Description: 加群二维码管理远程服务
* @author zhoudan
* @date 2020/04/21
*/
@ApiService(value="智慧门店-加群二维码接口",owner="zhoudan")
public interface QrCodeManageRemote {
/**
* 创建智能提醒规则
* @param qrCodeManage
* @return
*/
@ApiMethod(value = "创建二维码信息")
@ApiParams({@ApiParam(name = "qrCodeManage",notes = "二维码信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)})
@ApiResponse("创建的二维码信息")
RpcResponse<QrCodeManage> insert(QrCodeManage qrCodeManage);
/**
* 由ID获取二维码信息
* @param id
* @return
*/
@ApiMethod(value = "由ID获取二维码信息")
@ApiParams({@ApiParam(name = "id",notes = "二维码id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的二维码信息")
RpcResponse<QrCodeManage> getById(Integer id);
/**
* 由商户ID获取二维码信息
* @param merchantId
* @return
*/
@ApiMethod(value = "由商户ID获取二维码信息")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户id",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("获取的二维码")
RpcResponse<QrCodeManage> getByMerchantId(Integer merchantId);
/**
* 更新二维码信息
* @param qrCodeManage
* @return
*/
@ApiMethod(value = "更新二维码信息")
@ApiParams({@ApiParam(name = "qrCodeManage",notes = "二维码信息",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("更新结果")
RpcResponse<Integer> update(QrCodeManage qrCodeManage);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.UserAddress;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title UserAddressRemote
* @Description
* @Author zhaojp
* @Date 2020年06月08日 17:38:24
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
@ApiService(value="嘀加小程序-我的地址",owner="zhoulm")
public interface UserAddressRemote {
@ApiMethod("新增我的地址")
@ApiParam(name="userAddress",notes="我的地址",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回我的地址")
RpcResponse<UserAddress> insert(UserAddress userAddress);
@ApiMethod("编辑我的地址")
@ApiParam(name="userAddress",notes="我的地址",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回我的地址")
RpcResponse<UserAddress> update(UserAddress userAddress);
@ApiMethod("获取我的地址")
@ApiParam(name="id",notes="地址ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("返回我的地址")
RpcResponse<UserAddress> getById(Integer id);
@ApiMethod("获取我的地址列表")
@ApiParam(name="userAddress",notes="我的地址",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回我的地址列表")
RpcResponse<List<UserAddress>> selectList(UserAddress userAddress);
@ApiMethod("删除地址")
@ApiParam(name="id",notes="地址ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("成功数")
RpcResponse<Integer> deleteById(Integer id);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.VpFocusUserDTO;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="嘀加系统-视频+关注接口",owner="zhoulm")
public interface VpFocusUserRemote {
@ApiMethod("分页获取关注信息")
@ApiParam(name="pagination",notes="分页对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分页关注信息")
RpcResponse<RpcPagination<VpFocusUserDTO>> listWithPage(RpcPagination<VpFocusUserDTO> pagination);
@ApiMethod("关注")
@ApiParam(name="focusUser",notes="关注信息对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回关注信息")
RpcResponse<VpFocusUser> focus(VpFocusUser focusUser);
@ApiMethod("取消关注")
@ApiParam(name="focusUser",notes="关注信息对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回关注信息")
RpcResponse<VpFocusUser> cancelFocus(VpFocusUser focusUser);
@ApiMethod("是否已关注")
@ApiParams({@ApiParam(name="userId",notes="关注者用户ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true),
@ApiParam(name="focusedUserId",notes="被关注者用户ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)})
@ApiResponse("返回是否关注")
RpcResponse<Boolean> isFocus(Integer userId,Integer focusedUserId);
@ApiMethod("获取关注信息")
@ApiParams({@ApiParam(name="userId",notes="关注者用户ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true),
@ApiParam(name="focusedUserId",notes="被关注者用户ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)}) @ApiResponse("返回关注信息")
RpcResponse<VpFocusUser> get(Integer userId,Integer focusedUserId);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="嘀加系统-视频+收藏素材接口",owner="zhoulm")
public interface VpMaterialCollectRemote {
@ApiMethod("收藏素材")
@ApiParam(name="collect",notes="收藏素材信息对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回关注信息")
RpcResponse<VpMaterialCollect> collect(VpMaterialCollect collect);
@ApiMethod("是否已收藏")
@ApiParams({@ApiParam(name="merchantId",notes="收藏者商户ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true),
@ApiParam(name="materialId",notes="视频素材ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)})
@ApiResponse("返回是否收藏")
RpcResponse<Boolean> isCollect(Integer merchantId,Integer materialId);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="嘀加系统-视频+素材接口",owner="zhoulm")
public interface VpMaterialInfoRemote {
@ApiMethod("添加视频素材")
@ApiParam(name="materialInfoDTO",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回视频素材")
RpcResponse<VpMaterialInfoDTO> insert(VpMaterialInfoDTO materialInfoDTO);
@ApiMethod("修改视频所有资料(重新生成视频)")
@ApiParam(name="materialInfoDTO",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回视频素材")
RpcResponse<VpMaterialInfoDTO> updateRebuildVideo(VpMaterialInfoDTO materialInfoDTO);
@ApiMethod("修改视频部分资料(不重新生成视频,不修改生成视频所需的资料)")
@ApiParam(name="materialInfoDTO",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回视频素材")
RpcResponse<VpMaterialInfoDTO> updateNotRebuildVideo(VpMaterialInfoDTO materialInfoDTO);
@ApiMethod("更新视频素材发布标识")
@ApiParam(name="info",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回操作结果")
RpcResponse<VpMaterialInfo> updateOnlineFlag(VpMaterialInfo info);
@ApiMethod("分页获取视频素材")
@ApiParam(name="pagination",notes="分页对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分页视频素材")
RpcResponse<RpcPagination<VpMaterialInfoDTO>> listWithPage(RpcPagination<VpMaterialInfoDTO> pagination);
@ApiMethod("根据ID获取视频素材详情")
@ApiParam(name="materialId",notes="视频素材ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("返回视频素材")
RpcResponse<VpMaterialInfoDTO> getAllById(Integer materialId);
@ApiMethod("视频合成完成通知")
@ApiParam(name="info",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回视频素材对象")
RpcResponse<VpMaterialInfo> videoFinishNotify(VpMaterialInfo info);
@ApiMethod("配至新车礼包")
@ApiParam(name="info",notes="视频素材对象",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回操作结果")
RpcResponse<Boolean> configToCarboutique(VpMaterialInfo info);
@ApiMethod("根据ID删除视频素材")
@ApiParam(name="materialId",notes="视频素材ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("返回视频素材")
RpcResponse<Boolean> deleteById(Integer materialId);
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.WeappModuleDTO;
import cn.com.glsx.dj.weapp.enums.ModuleStatusEnum;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
/**
* @Title: WeappModuleRemote
* @Description: 首页模块RPC服务暴露层
* @author yangjia
*/
@ApiService(value = "嘀加首页子模块接口",owner = "yangjia")
public interface WeappModuleRemote {
/**
* @Title: listWeappModuleByPage
* @Description: 分页获取首页所有子模块
* @param weappModuleRpcPagination
* @return RpcResponse<RpcPagination<WeappModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "根据模块别名或者模块ID,分页获取此模块下的所有子模块")
@ApiParam(name = "RpcPagination<WeappModule>",notes = "首页子模块分页信息",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)
@ApiResponse("首页子模块分页信息")
RpcResponse<RpcPagination<WeappModule>> listWeappModuleByPage(RpcPagination<WeappModule> weappModuleRpcPagination);
/**
* @Title: listWeappFunctionModuleByPage
* @Description: 分页根据条件获取首页下所有的功能模块
* @param weappModuleDTORpcPagination
* @return RpcResponse<RpcPagination<WeappModuleDTO>>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "根据模块别名或者模块ID,分页获取首页下所有的功能模块")
@ApiParam(name = "RpcPagination<WeappModuleDTO>",notes = "首页功能模块分页对象",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)
@ApiResponse("首页功能模块分页信息")
RpcResponse<RpcPagination<WeappModuleDTO>> listWeappFunctionModuleByPage(RpcPagination<WeappModuleDTO> weappModuleDTORpcPagination);
/**
* @Title: insertWeappFunctionModule
* @Description: 插入首页功能模块
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "插入首页功能模块")
@ApiParam(name = "weappModule",notes = "首页功能模块对象",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)
@ApiResponse("首页功能模块插入对象")
RpcResponse<Long> insertWeappFunctionModule(WeappModule weappModule);
/**
* @Title: updateWeappFunctionModule
* @Description: 更新首页功能模块信息
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "更新首页功能模块信息")
@ApiParam(name = "weappModule",notes = "首页功能模块对象",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)
@ApiResponse("首页功能模块更新对象")
RpcResponse<Integer> updateWeappFunctionModule(WeappModule weappModule);
/**
* @Title: deleteWeappModule
* @Description: 删除模块信息
* @param id
* @return RpcResponse<Integer>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "删除模块信息")
@ApiParam(name = "id",notes = "模块ID",dataType = ApiParam.DataTypeEnum.LONG,required = true)
@ApiResponse("模块删除结果")
RpcResponse<Integer> deleteWeappModule(Long id);
/**
* @Title: getWeappModuleByCondition
* @Description: 条件获取模块信息
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "条件获取某个模块ID")
@ApiParam(name = "WeappModule",notes = "首页模块对象",dataType = ApiParam.DataTypeEnum.OBJECT,required = true)
@ApiResponse("首页模块信息")
RpcResponse<WeappModule> getWeappModuleByCondition(WeappModule weappModule);
/**
* @Title: listWeappModuleSortById
* @Description: 获取某个子模块的所有功能
* @param moduleId
* @return RpcResponse<List<WeappModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@ApiMethod(value = "获取某个子模块的所有功能")
@ApiParam(name = "moduleId",notes = "模块ID",dataType = ApiParam.DataTypeEnum.INTEGER)
@ApiResponse("功能模块列表")
RpcResponse<List<WeappModule>> listWeappModuleSortById(Integer moduleId);
/**
* @Title: listAllWeappModule
* @Description: 获取小程序所有未被删除的模块
* @return RpcResponse<List<WeappModule>>
* @author yangjia
* @Date: 2018/4/13
*/
@ApiMethod(value = "获取小程序所有未被删除的模块")
@ApiParam(name = "moduleStatus",notes = "模块状态",dataType = ApiParam.DataTypeEnum.ENUM)
@ApiResponse("功能模块列表")
RpcResponse<List<WeappModule>> listAllWeappModule(ModuleStatusEnum moduleStatus);
}
# framework-archetype-rpc-api
RPC-API项目骨架
一、项目结构说明:
└─src
├─main
├─java
├─cn.com.glsx.dj.weapp.dto 数据传输模型层
├─cn.com.glsx.dj.weapp.enums 枚举定义
├─cn.com.glsx.dj.weapp.model 数据模型层
└─cn.com.glsx.dj.weapp.remote RPC暴露服务层
└─resources 资源文件目录
└─rpc
└─dubbo.xml dubbo接口配置
└─pom.xml pom文件
二、使用说明:
1、API改动后,请及时deploy到Maven仓库
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
</beans>
\ No newline at end of file \ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-weapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rpc-dj-weapp</name>
<packaging>war</packaging>
<properties>
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-weapp-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-marketing-api</artifactId>
<version>0.0.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-elasticjob</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-wechat-api</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-system-api</artifactId>
<version>0.0.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-car-boutique-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp;
import org.oreframework.boot.main.AbsOreBootStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
/**
* @Title: Main.java
* @author yangjia
* @date 2019/04/30
*/
@SpringBootApplication
@ServletComponentScan
@EnableCaching
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
main.run(args);
}
}
package cn.com.glsx.dj.weapp.config;
import cn.com.glsx.dj.car.boutique.remote.*;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CarBoutiqueDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public CarBoutiqueRemote carBoutiqueRemote(){
return factory.builder(CarBoutiqueRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import cn.com.glsx.dj.marketing.remote.WeappActivityRemote;
import cn.com.glsx.dj.system.remote.MerchantRemote;
import cn.com.glsx.dj.system.remote.UserRemote;
import cn.com.glsx.dj.wechat.remote.WechatMessageRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public WechatMessageRemote wechatMessageRemote(){
return factory.builder(WechatMessageRemote.class).check(false).timeout(3000).build();
}
@Bean
public UserRemote userRemote(){
return factory.builder(UserRemote.class).check(false).timeout(3000).build();
}
@Bean
public MerchantRemote merchantRemote(){
return factory.builder(MerchantRemote.class).check(false).timeout(3000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.marketing.remote.ActivityCouponUserRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivityRemote;
import cn.com.glsx.dj.marketing.remote.WeappActivityRemote;
import cn.com.glsx.dj.marketing.remote.WxShopActivityRemote;
/**
* @Title: MarketingDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年10月17日 下午3:43:28
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class MarketingDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 活动优惠券远程服务
* @author yangjia
* @date 2019/05/02
*/
@Bean
public ActivityCouponUserRemote activityCouponUserRemote(){
return factory.builder(ActivityCouponUserRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
@Bean
public WxShopActivityRemote wxShopActivityRemote(){
return factory.builder(WxShopActivityRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
@Bean
public WeappActivityRemote weappActivityRemote(){
return factory.builder(WeappActivityRemote.class).check(false).timeout(3000).build();
}
@Bean
public ShopActivityRemote shopActivityRemote(){
return factory.builder(ShopActivityRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.system.remote.ConfigRemote;
@Configuration
public class SystemDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public ConfigRemote configRemote(){
return factory.builder(ConfigRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: SystemProperty.java
* @author yangjia
* @date 2019/04/28
*/
@Configuration
@ConfigurationProperties("system")
public class SystemProperty {
/**
* 对应配置项:system.name
* */
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package cn.com.glsx.dj.weapp.job;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.oreframework.util.json.JacksonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StopWatch;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceCopyInfoDTO;
import cn.com.glsx.dj.weapp.service.IntelligentRemindServeService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
/**
* @Title: CopyIntlligentRemindServiceJob.java
* @Description: 拷贝智能提醒服务任务
* @author Alvin
* @date 2020年10月17日 下午6:00:00
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@ElasticJobConf(name = "CopyIntlligentRemindServiceJob", cron = "0 0 0 * * ? 2099", description="拷贝智能提醒服务", overwrite = true)
public class CopyIntlligentRemindServiceJob implements SimpleJob{
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IntelligentRemindServeService intelligentRemindServeService;
@Override
public void execute(ShardingContext shardingContext) {
StopWatch watch = new StopWatch("CopyIntlligentRemindServiceJob");
watch.start("拷贝智能提醒服务任务");
logger.info("任务信息:{}", shardingContext);
IntelligentRemindServiceCopyInfoDTO copyInfo = JacksonUtils.jsonCastBean(shardingContext.getJobParameter(), IntelligentRemindServiceCopyInfoDTO.class);
if(copyInfo != null){
try{
intelligentRemindServeService.copyRemindService(copyInfo);
}catch(Exception e){
logger.error(e.getMessage(), e);
}
}
watch.stop();
logger.info(watch.prettyPrint());
}
}
package cn.com.glsx.dj.weapp.job;
import cn.com.glsx.dj.weapp.service.PageVisitCollectService;
import cn.com.glsx.framework.core.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.Date;
import java.util.Set;
/**
* 每天 00:10:00 点跑一次
* @author pengfang
*/
@ElasticJobConf(name = "PageVisitCollectJob", cron = "0 10 0 ? * *", description="collect current day page visit", overwrite = true)
public class PageVisitCollectJob implements SimpleJob {
private static final Logger LOGGER = LoggerFactory.getLogger(PageVisitCollectJob.class);
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Override
public void execute(ShardingContext shardingContext) {
LOGGER.info("PageVisitCollectJob excute start");
Set<Object> keys = redisTemplate.opsForSet().members(PageVisitCollectService.PAGE_CURRENT_KEY_COLLECT_CACHE_KEY_PREFIX);
LOGGER.info("keys:{}",keys.toString());
Long score = DateUtils.getOffsetDayDate(new Date(),1).getTime();
if (keys != null){
for (Object key : keys) {
String akey = key.toString().concat(":a");
Long count = redisTemplate.opsForValue().increment(akey,0L);
if (count > 0){
String zkey = PageVisitCollectService.PAGE_APP_VISIT_ZSET_KEY.concat(akey);
redisTemplate.opsForZSet().add(zkey, String.valueOf(score).concat(":").concat(count.toString()),score );
redisTemplate.opsForValue().getOperations().delete(akey);
LOGGER.info("zkey:{},count:{}",zkey,count);
}
Set<Object> keyss = redisTemplate.opsForHash().keys(key.toString().concat(":m"));
if (keyss != null){
for (Object m : keyss) {
String mkey = key.toString().concat(":m");
Long countm = redisTemplate.opsForHash().increment(mkey,m.toString(),0L);
if (countm > 0){
String mmkey = PageVisitCollectService.PAGE_APP_VISIT_ZSET_KEY.concat(mkey).concat(":").concat(m.toString());
redisTemplate.opsForZSet().add(mmkey, String.valueOf(score).concat(":").concat(countm.toString()), score);
redisTemplate.opsForHash().delete(mkey,m);
LOGGER.info("mmkey:{},count:{}",mmkey,countm);
}
}
}
redisTemplate.opsForSet().remove(PageVisitCollectService.PAGE_CURRENT_KEY_COLLECT_CACHE_KEY_PREFIX,key);
}
}
}
}
package cn.com.glsx.dj.weapp.job;
import cn.com.glsx.dj.system.dto.UserDTO;
import cn.com.glsx.dj.system.model.Merchant;
import cn.com.glsx.dj.system.remote.MerchantRemote;
import cn.com.glsx.dj.system.remote.UserRemote;
import cn.com.glsx.dj.weapp.enums.StatusEnum;
import cn.com.glsx.dj.weapp.mapper.CustomerServiceMessageMapper;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.dj.wechat.enums.WechatMsgTypeEnum;
import cn.com.glsx.dj.wechat.enums.WechatUserTypeEnum;
import cn.com.glsx.dj.wechat.remote.WechatMessageRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.apache.commons.collections.CollectionUtils;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
/**
* 1分钟跑一次
* @author zhoudan
*/
@ElasticJobConf(name = "SendMessageToBJob", cron = "0 */1 * * * ?", description="向B端推送客户消息提醒", overwrite = true)
public class SendMessageToBJob implements SimpleJob{
private static final Logger LOGGER = LoggerFactory.getLogger(SendMessageToBJob.class);
@Autowired
private CustomerServiceMessageMapper messageMapper;
@Autowired
private WechatMessageRemote wechatMessageRemote;
@Autowired
private UserRemote userRemote;
@Autowired
private MerchantRemote merchantRemote;
@Override
public void execute(ShardingContext shardingContext) {
LOGGER.info("----------------向B端推送客户消息提醒开始-----------------");
try{
List<CustomerServiceMessage> merchantList = messageMapper.getMerchantByUnread(StatusEnum.UNREAD.getValue(), WechatUserTypeEnum.CUSTOMER.getValue());
LOGGER.info("需要推送消息的商户merchantList size:{}",merchantList.size());
if(CollectionUtils.isNotEmpty(merchantList)){
merchantList.forEach((item) -> {
if(item.getSendStatus().equals(StatusEnum.UNSEND.getValue())&&item.getSendType().equals(WechatUserTypeEnum.CUSTOMER.getValue())){
Merchant merchant = merchantRemote.getByMerchantId(item.getMerchantId()).getResult();
if (merchant!=null){
UserDTO dto = new UserDTO();
dto.setMerchantId(item.getMerchantId());
RpcResponse<List<UserDTO>> userList = userRemote.list(dto);
if(userList.hasResult()){
for(UserDTO userDTO : userList.getResult()) {
String content;
if(item.getMessageContent().length()>100){
content = item.getMessageContent().substring(0,80)+"...";
}else {
content = item.getMessageContent();
}
wechatMessageRemote.sendMessage(WechatMsgTypeEnum.CUSTOMER_MESSAGE_PUSH_TOB,userDTO.getId(),item.getMerchantId().toString(), merchant.getMerchantName(), DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"), content, DateUtils.formatDate(item.getCreatedDate(), "yyyy-MM-dd HH:mm:ss")).getResult();
item.setSendStatus(StatusEnum.ALREADY_SEND.getValue());
messageMapper.updateByPrimaryKeySelective(item);
}
}
}
}
});
}
}catch(Exception e){
LOGGER.error(e.getMessage(),e);
}
LOGGER.info("----------------向B端推送客户消息提醒结束-----------------");
}
}
package cn.com.glsx.dj.weapp.job;
import cn.com.glsx.dj.system.model.Merchant;
import cn.com.glsx.dj.system.model.User;
import cn.com.glsx.dj.system.remote.MerchantRemote;
import cn.com.glsx.dj.system.remote.UserRemote;
import cn.com.glsx.dj.weapp.mapper.QrCodeManageMapper;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
import cn.com.glsx.dj.weapp.util.DateUtil;
import cn.com.glsx.dj.wechat.enums.WechatMsgTypeEnum;
import cn.com.glsx.dj.wechat.remote.WechatMessageRemote;
import cn.com.glsx.framework.core.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.apache.commons.collections.CollectionUtils;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
/**
* 每天上午9点跑一次
* @author zhoudan
*/
@ElasticJobConf(name = "UpdateGroupCodeJob", cron = "0 0 9 ? * *", description="更新加群码以及推送更新提醒消息", overwrite = true)
public class UpdateGroupCodeJob implements SimpleJob{
private static final Logger LOGGER = LoggerFactory.getLogger(UpdateGroupCodeJob.class);
private final static int REMIND_TIME = 6;
@Autowired
private QrCodeManageMapper qrCodeManageMapper;
@Autowired
private WechatMessageRemote wechatMessageRemote;
@Autowired
private UserRemote userRemote;
@Autowired
private MerchantRemote merchantRemote;
@Override
public void execute(ShardingContext shardingContext) {
LOGGER.info("----------------发送加群码提醒消息任务开始-----------------");
try{
List<QrCodeManage> codeList = qrCodeManageMapper.selectAll();
LOGGER.info("加群码codeList size:{}",codeList.size());
//二维码7天失效,第6天发消息提醒更换
if(CollectionUtils.isNotEmpty(codeList)){
codeList.forEach((item) -> {
long naturalIntervalDay = DateUtil.naturalIntervalDay(item.getUploadDate(),new Date());
if(naturalIntervalDay==REMIND_TIME){
User user = userRemote.getByMerchantId(item.getMerchantId()).getResult();
Merchant merchant = merchantRemote.getByMerchantId(item.getMerchantId()).getResult();
if (user!=null&&merchant!=null){
wechatMessageRemote.sendMessage(WechatMsgTypeEnum.GROUP_CODE_EXPIRED_SOON,user.getId(),item.getMerchantId().toString(),merchant.getMerchantName(),merchant.getMerchantName(),merchant.getPhone(), DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
}
}
});
}
}catch(Exception e){
LOGGER.error(e.getMessage(),e);
}
LOGGER.info("----------------发送加群码提醒消息任务结束-----------------");
}
}
package cn.com.glsx.dj.weapp.manager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.com.glsx.dj.marketing.dto.ShopActivityCopyInfoDTO;
import cn.com.glsx.dj.marketing.dto.ShopActivityInfoDTO;
import cn.com.glsx.dj.marketing.remote.ShopActivityRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: ShopActivityManager.java
* @Description: 营销活动接口管理
* @author Alvin
* @date 2020年10月17日 下午3:42:52
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Component
public class ShopActivityManager {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ShopActivityRemote shopActivityRemote;
/**
* 拷贝营销活动
* @param activityCopyInfo
* @return
* @author Alvin
* @date 2020年10月17日 下午3:50:13
*/
public ShopActivityInfoDTO copyActivity(ShopActivityCopyInfoDTO activityCopyInfo){
RpcResponse<ShopActivityInfoDTO> response = shopActivityRemote.copyActivity(activityCopyInfo);
if(response.hasResult()){
return response.getResult();
}
logger.error(response.getMessage(), response.getException());
return null;
}
}
package cn.com.glsx.dj.weapp.manager;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.oreframework.util.encrypt.MD5Util;
import org.oreframework.util.http.HttpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum;
import cn.com.glsx.dj.weapp.model.VpMaterialCarSeries;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
import cn.com.glsx.framework.core.enums.StatusEnum;
@Component
public class SubmitTransMediaManager {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private Environment env;
public String getPost(VpMaterialInfoDTO bean){
final String url = env.getProperty("video.plus.compound.url");
try{
HashMap<String, Object> params = getParams(bean);
logger.info("SubmitTransMedia request:{},params:{}",url,JSONObject.toJSONString(params));
String result = HttpUtil.post(url, JSONObject.toJSONString(params));
logger.info("SubmitTransMedia response:{}",result);
return result;
}catch(Exception e){
logger.error(e.getMessage(),e);
}
return null;
}
protected HashMap<String, Object> getParams(VpMaterialInfoDTO bean){
HashMap<String, Object> params = new HashMap<String, Object>();
final String appid = env.getProperty("video.plus.compound.appid");
final String appsecret = env.getProperty("video.plus.compound.appsecret");
final String time = String.valueOf(new Date().getTime() / 1000);
params.put("appid", appid);
params.put("time",time);
params.put("token", MD5Util.md5(appid + appsecret + time).toUpperCase());
params.put("JobId", bean.getId().toString());
params.put("TempGroupId", "00" + bean.getTemplateNum());
params.put("Priority", "6");
JSONObject userData = new JSONObject();
userData.put("TopBarPic", bean.getBannerImgUrl());
userData.put("BtmBarPic", bean.getBtmBannerImgUrl());
userData.put("LogoPicture",bean.getLogoUrl());
userData.put("MasterAudioUrl", bean.getMusicUrl());
JSONArray mediaList = new JSONArray();
for(int index = 0;index < bean.getTplResList().size();index++){
VpMaterialResource r = bean.getTplResList().get(index);
JSONObject o = new JSONObject();
o.put("00" + (index + 1), r.getResUrl());
if(r.getResType() == VideoPlusEnum.ResourceType.VIDEO.getValue()){
if(StringUtils.isNotBlank(bean.getVideoMuteFlag()) && StatusEnum.YES.getValue().equals(bean.getVideoMuteFlag())){
o.put("offBackSound", true);
}else{
o.put("offBackSound", false);
}
}
mediaList.add(o);
}
userData.put("MediaList", mediaList);
JSONObject adText = new JSONObject();
adText.put("Title", bean.getName());
adText.put("text", bean.getCopywriting());
// adText.put("textFont", "");
// adText.put("textSize", "");
// adText.put("textColor", "");
// adText.put("AdShowStyle", "");
userData.put("AdText", adText);
params.put("UserData", userData);
return params;
}
public static void main(String[] args){
VpMaterialInfoDTO dto = new VpMaterialInfoDTO();
dto.setId(1);
dto.setCreatedBy("sadmin");
dto.setUserId(1);
dto.setMerchantId(122913);
dto.setTemplateNum((byte)1);
dto.setLogoUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101175823074c758a11fbfc3403f96298c21a292d4fe.png");
dto.setMusicUrl("https://www.w3cschool.cn//statics/demosource/horse.mp3");
dto.setCopywriting("文案内容");
List<VpMaterialResource> tplResList = new ArrayList<>();
VpMaterialResource r1 = new VpMaterialResource();
r1.setBizNum((byte)1);
r1.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
r1.setResType(VideoPlusEnum.ResourceType.IMAGE.getValue());
tplResList.add(r1);
VpMaterialResource r2 = new VpMaterialResource();
r2.setBizNum((byte)2);
r2.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/video/2020041517135696254f0cdec26bd41de8c1ce7532b8c8b24.mp4");
r2.setResType(VideoPlusEnum.ResourceType.VIDEO.getValue());
tplResList.add(r2);
dto.setTplResList(tplResList);
dto.setName("测试模板0");
dto.setType((byte)5);
dto.setTypeName("改装装潢");
dto.setSubType(501);
dto.setSubTypeName("升级改装");
List<VpMaterialCarSeries> carSeriesList = new ArrayList<>();
VpMaterialCarSeries carSeries1 = new VpMaterialCarSeries();
carSeries1.setCarBrand("安凯客车");
carSeries1.setCarBrandId(7);
carSeries1.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/8d471c00-cec0-4167-9ff8-34d3bff5b2aa.png");
carSeries1.setCarChildsBrandId(8);
carSeries1.setCarChildsBrandName("安凯客车");
carSeries1.setCarSeriesId(103);
carSeries1.setCarSeriesName("宝斯通");
carSeriesList.add(carSeries1);
VpMaterialCarSeries carSeries2 = new VpMaterialCarSeries();
carSeries2.setCarBrand("广汽集团");
carSeries2.setCarBrandId(220);
carSeries2.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/262760ed-db53-45c6-8583-db96cddeb27c.png");
carSeries2.setCarChildsBrandId(222);
carSeries2.setCarChildsBrandName("广汽丰田");
carSeries2.setCarSeriesId(1147);
carSeries2.setCarSeriesName("雷凌");
carSeriesList.add(carSeries2);
dto.setCarSeriesList(carSeriesList);
dto.setLabelName("自定义标签");
dto.setProductCoverUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101143713625836643420ccd463dbc485ec05ad3f4a4.png");
List<VpMaterialResource> pmpResList = new ArrayList<>();
VpMaterialResource r3 = new VpMaterialResource();
r3.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r3);
VpMaterialResource r4 = new VpMaterialResource();
r4.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r4);
dto.setPmpResList(pmpResList);
List<VpMaterialDescription> descriptionList = new ArrayList<>();
VpMaterialDescription d1 = new VpMaterialDescription();
d1.setContent("文本内容");
d1.setType(VideoPlusEnum.DescriptionType.TEXT.getValue());
descriptionList.add(d1);
VpMaterialDescription d2 = new VpMaterialDescription();
d2.setContent("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
d2.setType(VideoPlusEnum.DescriptionType.IMAGE.getValue());
descriptionList.add(d2);
dto.setDescriptionList(descriptionList);
SubmitTransMediaManager m = new SubmitTransMediaManager();
System.out.println(m.getPost(dto));
}
}
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
/**
* @author zhoudan
*/
@Mapper
public interface CustomerServiceMessageCatalogMapper extends OreMapper<CustomerServiceMessageCatalog> {
/**
* 根据accountId获取客服消息列表
* @param accountId
* @return
*/
CustomerServiceMessageCatalog getByAccountId(@Param("accountId") Integer accountId,@Param("merchantId")Integer merchantId);
/**
* 分页获取客服消息列表
* @param remindService
* @return
*/
Page<CustomerServiceMessageCatalog> selectByPage(CustomerServiceMessageCatalog remindService);
/**
* 更新客服消息列表
* @param record
* @return
*/
int updateByAccountId(@Param("record")CustomerServiceMessageCatalog record);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface CustomerServiceMessageMapper extends OreMapper<CustomerServiceMessage> {
/**
* 统计该门店总计待处理消息
* @param merchantId
* @return
*/
int countByMerchantId(Integer merchantId);
/**
* 根据客户id获取消息内容
* @param accountId
* @return
*/
List<CustomerServiceMessageDTO> getByAccountId(@Param("accountId") Integer accountId,@Param("merchantId")Integer merchantId);
/**
* 页面停留轮询获取未读客服消息
* @param record
* @return
*/
List<CustomerServiceMessageDTO> getUnreadByAccountId(@Param("record")CustomerServiceMessage record);
/**
* 根据门店id获取消息内容
* @param merchantId
* @return
*/
List<CustomerServiceMessage> getByMerchantId(Integer merchantId);
/**
* 更新
* @param record
* @return
*/
int updateByAccountId(@Param("record")CustomerServiceMessage record);
/**
* 根据消息状态获取商户
* @param status
* @return
*/
List<CustomerServiceMessage> getMerchantByUnread(@Param("status")String status,@Param("type")String type);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface IntelligentRemindRuleMapper extends OreMapper<IntelligentRemindRule> {
Page<IntelligentRemindRule> selectByPage(IntelligentRemindRule remindService);
List<IntelligentRemindRule> getRuleClass(Integer merchantId);
List<IntelligentRemindRule> getRuleList(IntelligentRemindRule remindService);
IntelligentRemindRule getById(Integer id);
List<IntelligentRemindRule> getByMerchantId(Integer merchantId);
int update(@Param("record")IntelligentRemindRule intelligentRemindRule);
int deleteById(Integer id);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface IntelligentRemindServiceCarSeriesMapper extends OreMapper<IntelligentRemindServiceCarSeries> {
List<IntelligentRemindServiceCarSeries> getById(Integer serviceId);
int update(@Param("record")IntelligentRemindServiceCarSeries remindServiceCarSeries);
int deleteById(Integer id);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import java.util.List;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface IntelligentRemindServiceClassifyTagMapper extends OreMapper<IntelligentRemindServiceClassifyTag> {
List<IntelligentRemindServiceClassifyTag> getByServiceId(Long serviceId);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTagRef;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface IntelligentRemindServiceClassifyTagRefMapper extends OreMapper<IntelligentRemindServiceClassifyTagRef> {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.model.IntelligentRemindService;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface IntelligentRemindServiceMapper extends OreMapper<IntelligentRemindService> {
Page<IntelligentRemindServiceDTO> selectByPage(IntelligentRemindServiceDTO remindService);
IntelligentRemindServiceDTO getById(Integer id);
List<IntelligentRemindServiceDTO> getByMerchantId(Integer merchantId);
List<IntelligentRemindServiceDTO> getByCondition(@Param("record")IntelligentRemindServiceDTO remindService);
List<IntelligentRemindService> getRemindServiceList(@Param("condition") IntelligentRemindServiceListConditionDTO condition);
List<IntelligentRemindServiceDTO> getByRemindRuleId(Integer remindRuleId);
int update(@Param("record")IntelligentRemindServiceDTO intelligentRemindServiceDTO);
int deleteById(Integer id);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface IntelligentRemindServiceMaterialMapper extends OreMapper<IntelligentRemindServiceMaterial> {
List<IntelligentRemindServiceMaterial> getById(Integer serviceId);
int update(@Param("record")IntelligentRemindServiceMaterial remindServiceCarSeries);
int deleteById(Integer id);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
import java.util.Map;
/**
* 智能提醒Mapper
* @author yangjia
* @date 2019/04/30
*/
@Mapper
public interface IntelligentReminderMapper extends OreMapper<IntelligentReminder> {
/**
* 插入智能提醒信息
* @param intelligentReminder 智能提醒
* @return int
* @author yangjia
* @date 2019/04/30
*/
int insertReminder(IntelligentReminder intelligentReminder);
/**
* 根据id获取智能提醒信息
* @param id
* @return IntelligentReminder
* @author yangjia
* @date 2019/04/30
*/
IntelligentReminder getIntelligentReminderById(Long id);
/**
* 该账户的提醒信息
* @param condition
* accountId 账户id
* merchantId 商户id
* @return List<IntelligentReminderDTO>
* @author yangjia
* @date 2019/04/30
* */
List<IntelligentReminderDTO> selectByCondition(IntelligentReminderDTO condition);
/**
* 更新智能提醒信息
* @param intelligentReminder
* @return int
* @author yangjia
* @date 2019/04/30
*/
int updateReminderByCondition(IntelligentReminder intelligentReminder);
/**
* 删除智能提醒信息
* @param id
* @return int
* @author yangjia
* @date 2019/04/30
*/
int deleterReminderById(Long id);
/**
* 删除智能提醒信息
* @param reminderId 关联的活动优惠券id
* @return Integer
* @author yangjia
* @date 2019/04/30
*/
int deleterReminderByReminderId(Integer reminderId);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
/**
* @Title: MerchantModuleMapper
* 商户商户模块接口层
* @author yangjia
* @date 2019/04/28
*/
@Mapper
public interface MerchantModuleMapper extends OreMapper<MerchantModule> {
/**
* listMerchantModuleById
* 分页获取某商户某模块可展示的子模块
* @param merchantId
* @param moduleId
* @return Page<MerchantModuleDTO>
* @author yangjia
* @date 2019/04/28
*/
Page<MerchantModuleDTO> listMerchantModuleById(@Param("merchantId")Integer merchantId, @Param("parentId")Long moduleId);
/**
* listAllMerchantModule
* 获取某模块下所有子模块
* @param moduleId 模块id
* @return Page<MerchantModuleDTO>
* @author yangjia
* @date 2019/05/10
*/
Page<MerchantModuleDTO> listAllMerchantModule(@Param("parentId")Long moduleId);
/**
* insertMerchantModule
* 插入商户模块
* @param merchantModule
* @return Integer
* @author yangjia
* @date 2019/04/28
*/
void insertMerchantModule(MerchantModule merchantModule);
/**
* updateMerchantModule
* 更新商户模块
* @param merchantModule
* @author yangjia
* @date 2019/04/28
*/
void updateMerchantModule(MerchantModule merchantModule);
/**
* listAllMerchantModuleByMerchantId
* 查询某商户下所有的模块信息
* @param merchantId 商户id
* @param deletedFlag 删除标志
* @return Page<MerchantModule>
* @author yangjia
* @date 2019/04/28
*/
Page<MerchantModule> listAllMerchantModuleByMerchantId(@Param("merchantId")Integer merchantId, @Param("deletedFlag")String deletedFlag);
/**
* deleteMerchantModules
* 删除某一商户的所有模块信息
* @param merchantModule
* @return void
* @author yangjia
* @date 2019/04/28
*/
int deleteMerchantModules(MerchantModule merchantModule);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
@Mapper
public interface MerchantWeappNoticeMapper extends OreMapper<MerchantWeappNotice>{
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
@Mapper
public interface QrCodeManageMapper extends OreMapper<QrCodeManage> {
QrCodeManage getById(Integer id);
QrCodeManage getByMerchantId(Integer merchantId);
int update(@Param("record")QrCodeManage qrCodeManage);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.model.UserAddress;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
/**
* @Title UserAddressMapper
* @Description
* @Author zhaojp
* @Date 2020年06月08日 17:58:38
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
@Mapper
public interface UserAddressMapper extends OreMapper<UserAddress> {
List<UserAddress> list(UserAddress userAddress);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.dto.VpFocusUserDTO;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
@Mapper
public interface VpFocusUserMapper extends OreMapper<VpFocusUser> {
List<VpFocusUserDTO> list(VpFocusUserDTO record);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialCarSeries;
@Mapper
public interface VpMaterialCarSeriesMapper extends OreMapper<VpMaterialCarSeries> {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
@Mapper
public interface VpMaterialCollectMapper extends OreMapper<VpMaterialCollect> {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
@Mapper
public interface VpMaterialDescriptionMapper extends OreMapper<VpMaterialDescription> {
List<VpMaterialDescription> list(VpMaterialDescription record);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
@Mapper
public interface VpMaterialInfoMapper extends OreMapper<VpMaterialInfo> {
List<VpMaterialInfoDTO> list(VpMaterialInfoDTO record);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
@Mapper
public interface VpMaterialResourceMapper extends OreMapper<VpMaterialResource> {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.mapper;
import cn.com.glsx.dj.weapp.dto.WeappModuleDTO;
import cn.com.glsx.dj.weapp.model.WeappModule;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
/**
* WeappModuleMapper.java
* 模块配置业务层
* @author yangjia
* @date 2019/04/28
*/
@Mapper
public interface WeappModuleMapper extends OreMapper<WeappModule> {
/**
* listWeappModuleByCondition
* 条件获取首页子模块信息
* @param weappModule
* @return Page<WeappModule>
* @author yangjia
* date 2019/04/28
*/
Page<WeappModule> listWeappModuleByCondition(WeappModule weappModule);
/**
* 条件获取功能模块信息
* @param weappModuleDTO
* @return Page<WeappModule>
* @author yangjia
* date 2019/04/28
*/
Page<WeappModuleDTO> listWeappFunctionModuleByCondition(WeappModuleDTO weappModuleDTO);
/**
* insertWeappFunctionModule
* 插入首页功能模块
* @param weappModule
* @return WeappModule
* @author yangjia
* date 2019/04/28
*/
Long insertWeappFunctionModule(WeappModule weappModule);
/**
* updateWeappFunctionModule
* 更新首页功能模块信息
* @param weappModule
* @return WeappModule
* @author yangjia
* date 2019/04/28
*/
Integer updateWeappFunctionModule(WeappModule weappModule);
/**
* deleteWeappModule
* 删除首页模块
* @param id
* @return Integer
* @author yangjia
* date 2019/04/28
*/
Integer deleteWeappModule(@Param("id")Long id);
/**
* getWeappModuleByCondition
* 可通过别名,模块名获取已上架的模块
* @param weappModule
* @return WeappModule
* @author yangjia
* date 2019/04/28
*/
WeappModule getWeappModuleByCondition(WeappModule weappModule);
/**
* listWeappModuleSortById
* 根据模块ID取出所有的排序
* @param moduleId
* @return List<Integer>
* @author yangjia
* date 2019/04/28
*/
Page<WeappModule> listWeappModuleSortById(@Param("moduleId")Integer moduleId);
/**
* listAllWeappModule
* 获取小程序所有未被删除的模块
* @param moduleStatus 模块状态
* @return Page<WeappModule>
* @author yangjia
* date 2019/04/28
*/
Page<WeappModule> listAllWeappModule(@Param("moduleStatus") String moduleStatus);
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog;
import cn.com.glsx.dj.weapp.service.CustomerServiceMessageCatalogService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
/**
* @author zhoudan
*/
@DubboService(protocol = "dubbo")
public class CustomerServiceMessageCatalogRemoteImpl implements CustomerServiceMessageCatalogRemote {
Logger logger = LoggerFactory.getLogger(CustomerServiceMessageCatalogRemoteImpl.class);
@Autowired
private CustomerServiceMessageCatalogService customerServiceMessageCatalogService;
@Override
public RpcResponse<CustomerServiceMessageCatalog> insert(CustomerServiceMessageCatalog customerServiceMessageCatalog) {
logger.info("insert customerServiceMessageCatalog:{}", customerServiceMessageCatalog);
try {
return RpcResponse.success(customerServiceMessageCatalogService.insert(customerServiceMessageCatalog));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<CustomerServiceMessageCatalog> getById(Integer id) {
logger.info("getById id:{}", id);
try {
return RpcResponse.success(customerServiceMessageCatalogService.getById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<CustomerServiceMessageCatalog> getByAccountId(Integer accountId,Integer merchantId) {
logger.info("getByAccountId accountId:{}", accountId);
logger.info("getByAccountId merchantId:{}", merchantId);
try {
return RpcResponse.success(customerServiceMessageCatalogService.getByAccountId(accountId,merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<CustomerServiceMessageCatalog>> getByPage(RpcPagination<CustomerServiceMessageCatalog> pagination) {
logger.info("getByPage pagination:{}", pagination.getCondition());
try {
Page<CustomerServiceMessageCatalog> page = customerServiceMessageCatalogService.selectByPage(pagination);
RpcPagination<CustomerServiceMessageCatalog> rpcPagination = RpcPagination.copyPage(page);
return RpcResponse.success(rpcPagination);
} catch (RpcServiceException e) {
logger.error("selectByPage error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Integer> updateByAccountId(CustomerServiceMessageCatalog customerServiceMessageCatalog) {
logger.info("update customerServiceMessageCatalog:{}", customerServiceMessageCatalog);
try {
return RpcResponse.success(customerServiceMessageCatalogService.updateByAccountId(customerServiceMessageCatalog));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.dj.weapp.service.CustomerServiceMessageService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @author zhoudan
*/
@DubboService(protocol = "dubbo")
public class CustomerServiceMessageRemoteImpl implements CustomerServiceMessageRemote {
Logger logger = LoggerFactory.getLogger(CustomerServiceMessageRemoteImpl.class);
@Autowired
private CustomerServiceMessageService customerServiceMessageService;
@Override
public RpcResponse<CustomerServiceMessageDTO> insert(CustomerServiceMessageDTO customerServiceMessage) {
try {
return RpcResponse.success(customerServiceMessageService.insert(customerServiceMessage));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<CustomerServiceMessage>> getByMerchantId(Integer merchantId) {
try {
return RpcResponse.success(customerServiceMessageService.getByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<CustomerServiceMessageDTO>> getByAccountId(Integer accountId,Integer merchantId) {
try {
return RpcResponse.success(customerServiceMessageService.getByAccountId(accountId,merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<CustomerServiceMessageDTO>> getUnreadByAccountId(CustomerServiceMessage customerServiceMessage) {
try {
return RpcResponse.success(customerServiceMessageService.getUnreadByAccountId(customerServiceMessage));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> updateByAccountId(CustomerServiceMessage customerServiceMessage) {
try {
return RpcResponse.success(customerServiceMessageService.updateByAccountId(customerServiceMessage));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> countByMerchantId(Integer merchantId) {
try {
return RpcResponse.success(customerServiceMessageService.countByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<CustomerServiceMessage>> getMerchantByUnread(String status,String type) {
try {
return RpcResponse.success(customerServiceMessageService.getMerchantByUnread(status,type));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.dj.weapp.service.IntelligentRemindRuleService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
/**
* @author zhoudan
*/
@DubboService(protocol = "dubbo")
public class IntelligentRemindRuleRemoteImpl implements IntelligentRemindRuleRemote {
Logger logger = LoggerFactory.getLogger(IntelligentRemindRuleRemoteImpl.class);
@Autowired
private IntelligentRemindRuleService intelligentRemindRuleService;
@Override
public RpcResponse<RpcPagination<IntelligentRemindRule>> selectByPage(RpcPagination<IntelligentRemindRule> pagination) {
logger.info("selectByPage params:{}", pagination.getCondition());
try {
Page<IntelligentRemindRule> page = intelligentRemindRuleService.selectByPage(pagination);
RpcPagination<IntelligentRemindRule> rpcPagination = RpcPagination.copyPage(page);
return RpcResponse.success(rpcPagination);
} catch (RpcServiceException e) {
logger.error("selectByPage error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<IntelligentRemindRule>> getRuleClass(Integer merchantId) {
logger.info("getRuleClass merchantId:{}", merchantId);
try {
return RpcResponse.success(intelligentRemindRuleService.getRuleClass(merchantId));
} catch (RpcServiceException e) {
logger.error("getByRuleList error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<IntelligentRemindRule>> getRuleList(IntelligentRemindRule intelligentRemindRule) {
logger.info("getByRuleList intelligentRemindRule:{}", intelligentRemindRule);
try {
return RpcResponse.success(intelligentRemindRuleService.getRuleList(intelligentRemindRule));
} catch (RpcServiceException e) {
logger.error("getByRuleList error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<IntelligentRemindRule> insert(IntelligentRemindRule intelligentRemindRule) {
logger.info("insert intelligentRemindRule:{}", intelligentRemindRule);
try {
return RpcResponse.success(intelligentRemindRuleService.insert(intelligentRemindRule));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<IntelligentRemindRule> getById(Integer id) {
logger.info("getById id:{}", id);
try {
return RpcResponse.success(intelligentRemindRuleService.getById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<IntelligentRemindRule>> getByMerchantId(Integer merchantId) {
logger.info("getByMerchantId merchantId:{}", merchantId);
try {
return RpcResponse.success(intelligentRemindRuleService.getByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error("getByMerchantId error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Integer> update(IntelligentRemindRule intelligentRemindRule) {
logger.info("update intelligentRemindRule:{}", intelligentRemindRule);
try {
return RpcResponse.success(intelligentRemindRuleService.update(intelligentRemindRule));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> deleteById(Integer id) {
logger.info("deleteById reminderId:{}", id);
try {
return RpcResponse.success(intelligentRemindRuleService.deleteById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> copyRuleList(Integer merchantId) {
logger.info("copyRuleList merchantId:{}", merchantId);
try {
return RpcResponse.success(intelligentRemindRuleService.copyRuleListByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import cn.com.glsx.dj.weapp.service.IntelligentRemindServiceClassifyTagService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @Title: IntelligentRemindServiceClassifyTagRemoteImpl.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午12:12:06
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@DubboService
public class IntelligentRemindServiceClassifyTagRemoteImpl implements
IntelligentRemindServiceClassifyTagRemote {
@Autowired
private IntelligentRemindServiceClassifyTagService intelligentRemindServiceClassifyTagService;
@Override
public RpcResponse<IntelligentRemindServiceClassifyTag> add(IntelligentRemindServiceClassifyTag serviceClassifyTag) {
try{
serviceClassifyTag = intelligentRemindServiceClassifyTagService.add(serviceClassifyTag);
return RpcResponse.success(serviceClassifyTag);
}catch(RpcServiceException e){
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> delete(Long classifyTagId) {
try{
Boolean result = intelligentRemindServiceClassifyTagService.delete(classifyTagId);
return RpcResponse.success(result);
}catch(RpcServiceException e){
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<IntelligentRemindServiceClassifyTag>> list(Integer merchantId) {
try{
List<IntelligentRemindServiceClassifyTag> list = intelligentRemindServiceClassifyTagService.list(merchantId);
return RpcResponse.success(list);
}catch(RpcServiceException e){
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<IntelligentRemindServiceClassifyTag>> search(
IntelligentRemindServiceClassifyTag condition) {
try{
List<IntelligentRemindServiceClassifyTag> list = intelligentRemindServiceClassifyTagService.search(condition);
return RpcResponse.success(list);
}catch(RpcServiceException e){
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceCopyInfoDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.model.IntelligentRemindService;
import cn.com.glsx.dj.weapp.service.IntelligentRemindRuleService;
import cn.com.glsx.dj.weapp.service.IntelligentRemindServeService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
/**
* @author zhoudan
*/
@DubboService(protocol = "dubbo")
public class IntelligentRemindServiceRemoteImpl implements IntelligentRemindServiceRemote {
Logger logger = LoggerFactory.getLogger(IntelligentRemindServiceRemoteImpl.class);
@Autowired
private IntelligentRemindServeService intelligentRemindServeService;
@Autowired
private IntelligentRemindRuleService intelligentRemindRuleService;
@Override
public RpcResponse<IntelligentRemindServiceDTO> insert(IntelligentRemindServiceDTO intelligentRemindService) {
logger.info("insert intelligentRemindService:{}", intelligentRemindService);
try {
return RpcResponse.success(intelligentRemindServeService.insert(intelligentRemindService));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<IntelligentRemindServiceDTO>> selectByPage(RpcPagination<IntelligentRemindServiceDTO> pagination) {
logger.info("selectByPage params:{}", pagination.getCondition());
logger.info("selectByPage MerchantId:{}", pagination.getCondition().getMerchantId());
logger.info("selectByPage OnlineFlag:{}", pagination.getCondition().getOnlineFlag());
try {
Page<IntelligentRemindServiceDTO> page = intelligentRemindServeService.selectByPage(pagination);
RpcPagination<IntelligentRemindServiceDTO> rpcPagination = RpcPagination.copyPage(page);
return RpcResponse.success(rpcPagination);
} catch (RpcServiceException e) {
logger.error("selectByPage error:{}", e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<IntelligentRemindServiceDTO> getById(Integer id) {
logger.info("getById id:{}", id);
try {
return RpcResponse.success(intelligentRemindServeService.getById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<IntelligentRemindServiceDTO>> getByMerchantId(Integer merchantId) {
logger.info("getByMerchantId merchantId:{}", merchantId);
try {
return RpcResponse.success(intelligentRemindServeService.getByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<IntelligentRemindServiceDTO>> getByCondition(IntelligentRemindServiceDTO serviceDTO) {
logger.info("getByMerchantId merchantId:{},mileOrCarAge:{},searchKey:{}", serviceDTO.getMerchantId(), serviceDTO.getMileOrCarAge(), serviceDTO.getSearchKey());
try {
return RpcResponse.success(intelligentRemindServeService.getByCondition(serviceDTO));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<IntelligentRemindService>> getRemindServiceList(IntelligentRemindServiceListConditionDTO conditionDTO) {
try{
return RpcResponse.success(intelligentRemindServeService.getRemindServiceList(conditionDTO));
}catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<IntelligentRemindServiceDTO>> getByRemindRuleId(Integer remindRuleId) {
logger.info("getByRemindRuleId remindRuleId:{}", remindRuleId);
try {
return RpcResponse.success(intelligentRemindServeService.getByRemindRuleId(remindRuleId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> update(IntelligentRemindServiceDTO intelligentRemindServiceDTO) {
logger.info("update intelligentRemindServiceDTO:{}", intelligentRemindServiceDTO);
try {
return RpcResponse.success(intelligentRemindServeService.update(intelligentRemindServiceDTO));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> deleteById(Integer id) {
logger.info("deleteById reminderId:{}", id);
try {
return RpcResponse.success(intelligentRemindServeService.deleteById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> copyRemindService(IntelligentRemindServiceCopyInfoDTO copyInfo) {
try {
Integer count = intelligentRemindServeService.copyRemindService(copyInfo);
return RpcResponse.success(count);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.dubbo.config.annotation.DubboService;
import org.oreframework.util.collection.ListUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import cn.com.glsx.dj.marketing.dto.ActivityOfUserDTO;
import cn.com.glsx.dj.marketing.remote.ActivityCouponUserRemote;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import cn.com.glsx.dj.weapp.service.IntelligentReminderService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
/**
* @Title: IntelligentReminderRemoteImpl
* @Description: 智能提醒模块Rpc服务暴露层
* @author yangjia
* @date 2019/04/30
*/
@DubboService(protocol = "dubbo")
public class IntelligentReminderRemoteImpl implements IntelligentRminderRemote {
Logger logger = LoggerFactory.getLogger(IntelligentReminderRemoteImpl.class);
@Autowired
private IntelligentReminderService intelligentReminderService;
@Autowired
private RedisTemplate<String,Object> redisTemplate;
@Autowired
private ActivityCouponUserRemote activityCouponUserRemote;
/**
* @Description: 添加智能提醒
* @param intelligentReminder
* @author yangjia
* @date 2019/04/30
* */
@Override
public RpcResponse<IntelligentReminder> insertIntelligentReminder(IntelligentReminder intelligentReminder) {
RpcAssert.assertNotNull(intelligentReminder, DefaultErrorEnum.DATA_NULL, "渠道模块列表不能为空!");
try {
logger.debug("insertIntelligentReminder intelligentReminder:{}", intelligentReminder);
intelligentReminderService.insertIntelligentReminder(intelligentReminder);
return RpcResponse.success(intelligentReminder);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Description: 由ID获取智能提醒
* @param id
* @author yangjia
* @date 2019/04/30
*/
@Override
public RpcResponse<IntelligentReminder> getIntelligentReminderById(Long id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try {
logger.debug("getIntelligentReminderById id:{}", id);
IntelligentReminder reminder = intelligentReminderService.getIntelligentReminderById(id);
return RpcResponse.success(reminder);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Description: 该账户的提醒信息
* @param pagination
* accountId 账户id
* merchantId 商户id
* @author yangjia
* @date 2019/04/30
* */
@Override
public RpcResponse<RpcPagination<IntelligentReminderDTO>> selectByCondition(RpcPagination<IntelligentReminderDTO> pagination) {
IntelligentReminderDTO condition = pagination.getCondition();
RpcAssert.assertNotNull(condition.getAccountId(), DefaultErrorEnum.DATA_NULL, "账户ID不能为空!");
RpcAssert.assertNotNull(condition.getMerchantId(), DefaultErrorEnum.DATA_NULL, "商户ID不能为空!");
logger.info("selectByCondition condition:{}", condition);
try {
Page<IntelligentReminderDTO> pageNext = intelligentReminderService.selectByCondition(pagination);
logger.info("selectByCondition result:{}", pageNext);
//解决ArraryList在多线程中ConcurrentModificationException的问题
CopyOnWriteArrayList<IntelligentReminderDTO> rminderCopyOnWriteArrayList = new CopyOnWriteArrayList(pageNext);
if(ListUtil.isNotEmpty(rminderCopyOnWriteArrayList)) {
rminderCopyOnWriteArrayList.forEach(item -> {
//关联的活动优惠券id
Integer rminderId = item.getReminderId();
ActivityOfUserDTO activityCouponUserDTO = null;
ActivityOfUserDTO codition = new ActivityOfUserDTO();
codition.setId(rminderId);
RpcResponse<ActivityOfUserDTO> rpcResponse = activityCouponUserRemote.getActivityOfUserInfo(codition);
logger.info("activityCouponUserRemote getActivityOfUserInfo:{}", rpcResponse.getResult());
//过滤掉有效类型为时间段类型且已经过期的
if(rpcResponse.getResult() == null){
rminderCopyOnWriteArrayList.remove(item);
return;
}
activityCouponUserDTO = rpcResponse.getResult();
item.setActivityCouponUserDTO(activityCouponUserDTO);
}
);
}
RpcPagination paginationNext = RpcPagination.copyPage(pageNext);
return RpcResponse.success(paginationNext);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Description: 更新智能提醒信息
* @param intelligentReminder
* @return RpcResponse<IntelligentReminder>
* @author yangjia
* @Date: 2019/04/30
*/
@Override
public RpcResponse<IntelligentReminder> updateReminderByCondition(IntelligentReminder intelligentReminder) {
RpcAssert.assertNotNull(intelligentReminder, DefaultErrorEnum.DATA_NULL, "要更新信息不能为空!");
logger.debug("updateReminderByCondition intelligentReminder:{}", intelligentReminder);
try {
intelligentReminderService.updateReminderByCondition(intelligentReminder);
logger.debug("updateReminderByCondition res:{}", intelligentReminder);
return RpcResponse.success(intelligentReminder);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Description: 根据id删除智能提醒
* @param id
* @return RpcResponse
* @author yangjia
* @Date: 2019/04/30
*/
@Override
public RpcResponse<?> deleterReminderById(Long id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
logger.debug("deleterReminder id:{}", id);
try {
intelligentReminderService.deleterReminderById(id);
logger.debug("deleterReminder id:{}", id);
return RpcResponse.success(null);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Description: 根据reminderId删除智能提醒
* @param reminderId
* @return RpcResponse
* @author yangjia
* @Date: 2019/04/30
*/
@Override
public RpcResponse<Integer> deleterReminderByReminderId(Integer reminderId) {
RpcAssert.assertNotNull(reminderId, DefaultErrorEnum.DATA_NULL, "reminderId不能为空!");
logger.debug("deleterReminderByReminderId reminderId:{}", reminderId);
try {
Integer res = intelligentReminderService.deleterReminderByReminderId(reminderId);
logger.debug("deleterReminderByReminderId reminderId:{}", reminderId);
return RpcResponse.success(res);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import cn.com.glsx.dj.weapp.service.MerchatModuleService;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
/**
* @Title: MerchantModuleRemoteImpl
* @Description: 商户模块Rpc服务暴露层
* @author yangjia
* @version V1.0
*/
@DubboService(protocol = "dubbo")
public class MerchantModuleRemoteImpl implements MerchantModuleRemote{
Logger logger = LoggerFactory.getLogger(MerchantModuleRemoteImpl.class);
@Autowired
private MerchatModuleService merchatModuleService;
/**
* @Title: listChannelModuleById
* @Description: 根据商户ID和模块ID获取某商户某模块可展示的子模块
* @param merchantId
* @param moduleId
* @return RpcResponse<<MerchantModuleDTO>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
@ApiMethod(value = "根据商户ID和模块ID获取某商户某模块可展示的子模块")
@ApiParams({@ApiParam(name = "String",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true),
@ApiParam(name = "Long",notes = "模块的ID",dataType = ApiParam.DataTypeEnum.INTEGER,required = true)})
@ApiResponse("已上架的子模块列表")
public RpcResponse<List<MerchantModuleDTO>> listMerchantModuleById(Integer merchantId, Long moduleId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "商户ID不能为空!");
RpcAssert.assertNotNull(moduleId, DefaultErrorEnum.DATA_NULL, "模块ID不能为空!");
try {
logger.debug("listChannelModuleById merchantId:{},moduleId:{}", merchantId, moduleId);
List<MerchantModuleDTO> merchantModuleDTOS = merchatModuleService.listMerchantModuleById(merchantId, moduleId);
return RpcResponse.success(merchantModuleDTOS);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: insertMerchantModule
* @Description: 批量插入商户模块信息
* @param merchantModules
* @return RpcResponse
* @author yangjia
* @Date: 22019/04/28
*/
@ApiMethod(value = "批量插入商户模块信息")
@ApiParam(name = "List<MerchantModule>",notes = "商户模块列表",dataType = ApiParam.DataTypeEnum.LIST,required = true)
@ApiResponse("插入结果")
@Override
public RpcResponse<?> insertMerchantModule(List<MerchantModule> merchantModules) {
RpcAssert.assertNotNull(merchantModules, DefaultErrorEnum.DATA_NULL, "渠道模块列表不能为空!");
try {
logger.debug("insertMerchantModule merchantModules:{}", merchantModules);
merchatModuleService.insertMerchantModule(merchantModules);
return RpcResponse.success(null);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: updateMerchantModule
* @Description: 批量修改商户模块信息
* @param merchantModules
* @return RpcResponse
* @author yangjia
* @Date: 2019/04/28
*/
@Override
@ApiMethod(value = "批量修改商户模块信息")
@ApiParam(name = "List<MerchantModule>",notes = "商户模块列表",dataType = ApiParam.DataTypeEnum.LIST,required = true)
@ApiResponse("修改结果")
public RpcResponse<?> updateMerchantModule(List<MerchantModule> merchantModules) {
RpcAssert.assertNotNull(merchantModules, DefaultErrorEnum.DATA_NULL, "商户模块列表不能为空!");
logger.debug("updateMerchantModule merchantModules:{}", merchantModules);
try {
merchatModuleService.updateMerchantModule(merchantModules);
return RpcResponse.success(null);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: listAllMerchantModuleByChannelId
* @Description: 查询某商户下所有的模块信息
* @param merchantId
* @return RpcResponse<List<MerchantModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
@ApiMethod(value = "查询某商户下所有的模块信息")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true),
@ApiParam(name = "deleteFlag",notes = "删除标志",dataType = ApiParam.DataTypeEnum.STRING)})
@ApiResponse("商户模块列表")
public RpcResponse<List<MerchantModule>> listAllMerchantModuleByMerchantId(Integer merchantId, String deleteFlag) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "商户模块ID不能为空!");
logger.debug("listAllmerchantModuleByChannelId merchantId:{}", merchantId);
try {
List<MerchantModule> merchantModules = merchatModuleService.listAllMerchantModuleByMerchantId(merchantId,deleteFlag);
logger.debug("listAllmerchantModuleByChannelId merchantModules:{}", merchantModules);
return RpcResponse.success(merchantModules);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: cleanMerchantModuleCache
* @Description: 清除商户下面的所有模块缓存
* @param merchantId
* @author yangjia
* @Date: 2019/04/28
*/
@Override
@ApiMethod(value = "清除商户下面的所有模块缓存")
@ApiParams({@ApiParam(name = "merchantId",notes = "商户ID",dataType = ApiParam.DataTypeEnum.STRING,required = true)})
@ApiResponse("清除结果")
public RpcResponse<Boolean> cleanMerchantModuleCache(Integer merchantId) {
return RpcResponse.success(merchatModuleService.cleanMerchantModuleCache(merchantId));
}
}
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
import cn.com.glsx.dj.weapp.service.MerchantWeappNoticeService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @Title: MerchantWeappNoticeRemoteImpl.java
* @Description:
* @author Alvin
* @date 2019年4月30日 下午9:53:58
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@DubboService(protocol = "dubbo")
public class MerchantWeappNoticeRemoteImpl implements MerchantWeappNoticeRemote {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private MerchantWeappNoticeService merchantWeappNoticeService;
@Override
public RpcResponse<MerchantWeappNotice> merge(
MerchantWeappNotice merchantWeappNotice) {
try{
merchantWeappNotice = merchantWeappNoticeService.merge(merchantWeappNotice);
return RpcResponse.success(merchantWeappNotice);
}catch(RpcServiceException e){
logger.error("merge merchant weapp notice error:" + e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantWeappNotice> getByMerchantId(Integer merchantId) {
try{
MerchantWeappNotice merchantWeappNotice = merchantWeappNoticeService.getByMerchantId(merchantId);
return RpcResponse.success(merchantWeappNotice);
}catch(RpcServiceException e){
logger.error("merge merchant weapp notice error:" + e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantWeappNotice> getByAppId(String appId) {
try{
MerchantWeappNotice merchantWeappNotice = merchantWeappNoticeService.getByAppId(appId);
return RpcResponse.success(merchantWeappNotice);
}catch(RpcServiceException e){
logger.error("merge merchant weapp notice error:" + e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantWeappNotice> getPlatfromNotice() {
try{
MerchantWeappNotice merchantWeappNotice = merchantWeappNoticeService.getPlatformNotice();
return RpcResponse.success(merchantWeappNotice);
}catch(RpcServiceException e){
logger.error("get merchant weapp notice error:" + e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.PageVisitDTO;
import cn.com.glsx.dj.weapp.service.PageVisitCollectService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import java.util.Map;
/**
* @Title: PageVisitCollectRemoteImpl.java
* @Description:
* @author zengqi
* @date 2021年6月4日 下午4:44:50
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@DubboService(protocol = "dubbo")
public class PageVisitCollectRemoteImpl implements PageVisitCollectRemote {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private PageVisitCollectService pageVisitCollectService;
@Override
public RpcResponse<Long> collect(PageVisitDTO pageVisit) {
try{
return RpcResponse.success(pageVisitCollectService.collect(pageVisit));
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Map<String,Long>> getCount(PageVisitDTO pageVisit,String startDate,String endDate) {
try{
return RpcResponse.success(pageVisitCollectService.getCount(pageVisit,startDate,endDate));
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR,e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
import cn.com.glsx.dj.weapp.service.QrCodeManageService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @author zhoudan
*/
@DubboService(protocol = "dubbo")
public class QrCodeManageRemoteImpl implements QrCodeManageRemote {
Logger logger = LoggerFactory.getLogger(QrCodeManageRemoteImpl.class);
@Autowired
private QrCodeManageService qrCodeManageService;
@Override
public RpcResponse<QrCodeManage> insert(QrCodeManage qrCodeManage) {
logger.info("insert qrCodeManage:{}", qrCodeManage);
try {
return RpcResponse.success(qrCodeManageService.insert(qrCodeManage));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<QrCodeManage> getById(Integer id) {
logger.info("getById id:{}", id);
try {
return RpcResponse.success(qrCodeManageService.getById(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<QrCodeManage> getByMerchantId(Integer merchantId) {
logger.info("getByMerchantId merchantId:{}", merchantId);
try {
return RpcResponse.success(qrCodeManageService.getByMerchantId(merchantId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> update(QrCodeManage qrCodeManage) {
logger.info("update qrCodeManage:{}", qrCodeManage);
try {
return RpcResponse.success(qrCodeManageService.update(qrCodeManage));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.UserAddress;
import cn.com.glsx.dj.weapp.service.UserAddressService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @Title UserAddressRemoteImpl
* @Description
* @Author zhaojp
* @Date 2020年06月08日 17:58:34
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
@DubboService(protocol = "dubbo")
public class UserAddressRemoteImpl implements UserAddressRemote{
private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
@Autowired
private UserAddressService userAddressService;
@Override
public RpcResponse<UserAddress> insert(UserAddress userAddress) {
try {
return RpcResponse.success(userAddressService.insert(userAddress));
} catch (RpcServiceException e) {
LOGGER.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<UserAddress> update(UserAddress userAddress) {
try {
return RpcResponse.success(userAddressService.update(userAddress));
} catch (RpcServiceException e) {
LOGGER.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<UserAddress> getById(Integer id) {
try {
return RpcResponse.success(userAddressService.getById(id));
} catch (RpcServiceException e) {
LOGGER.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<List<UserAddress>> selectList(UserAddress userAddress) {
try {
return RpcResponse.success(userAddressService.selectList(userAddress));
} catch (RpcServiceException e) {
LOGGER.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Integer> deleteById(Integer id) {
try {
return RpcResponse.success(userAddressService.deleteById(id));
} catch (RpcServiceException e) {
LOGGER.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.VpFocusUserDTO;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
import cn.com.glsx.dj.weapp.service.VpFocusUserService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
@DubboService(protocol = "dubbo")
public class VpFocusUserRemoteImpl implements VpFocusUserRemote {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpFocusUserService vpFocusUserService;
@Override
public RpcResponse<RpcPagination<VpFocusUserDTO>> listWithPage(RpcPagination<VpFocusUserDTO> pagination) {
try {
Page<VpFocusUserDTO> page = vpFocusUserService.listWithPage(pagination);
return RpcResponse.success(RpcPagination.copyPage(page));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpFocusUser> focus(VpFocusUser focusUser) {
try {
return RpcResponse.success(vpFocusUserService.focus(focusUser));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpFocusUser> cancelFocus(VpFocusUser focusUser) {
try {
return RpcResponse.success(vpFocusUserService.cancelFocus(focusUser));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> isFocus(Integer userId, Integer focusedUserId) {
try {
return RpcResponse.success(vpFocusUserService.isFocus(userId, focusedUserId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpFocusUser> get(Integer userId, Integer focusedUserId) {
try {
return RpcResponse.success(vpFocusUserService.get(userId, focusedUserId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
import cn.com.glsx.dj.weapp.service.VpMaterialCollectService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
@DubboService(protocol = "dubbo")
public class VpMaterialCollectRemoteImpl implements VpMaterialCollectRemote {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialCollectService vpMaterialCollectService;
@Override
public RpcResponse<VpMaterialCollect> collect(VpMaterialCollect collect) {
try {
return RpcResponse.success(vpMaterialCollectService.collect(collect));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> isCollect(Integer userId, Integer materialId) {
try {
return RpcResponse.success(vpMaterialCollectService.isCollect(userId, materialId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
import cn.com.glsx.dj.weapp.service.VpMaterialInfoService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
@DubboService(protocol = "dubbo")
public class VpMaterialInfoRemoteImpl implements VpMaterialInfoRemote {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialInfoService vpMaterialInfoService;
@Override
public RpcResponse<VpMaterialInfoDTO> insert(VpMaterialInfoDTO materialInfoDTO) {
try {
return RpcResponse.success(vpMaterialInfoService.insert(materialInfoDTO));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpMaterialInfo> updateOnlineFlag(VpMaterialInfo info) {
try {
return RpcResponse.success(vpMaterialInfoService.updateOnlineFlag(info));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<VpMaterialInfoDTO>> listWithPage(RpcPagination<VpMaterialInfoDTO> pagination) {
try {
Page<VpMaterialInfoDTO> page = vpMaterialInfoService.listWithPage(pagination);
return RpcResponse.success(RpcPagination.copyPage(page));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpMaterialInfoDTO> getAllById(Integer materialId) {
try {
return RpcResponse.success(vpMaterialInfoService.getAllById(materialId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpMaterialInfoDTO> updateRebuildVideo(VpMaterialInfoDTO materialInfoDTO) {
try {
return RpcResponse.success(vpMaterialInfoService.updateRebuildVideo(materialInfoDTO));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpMaterialInfoDTO> updateNotRebuildVideo(VpMaterialInfoDTO materialInfoDTO) {
try {
return RpcResponse.success(vpMaterialInfoService.updateNotRebuildVideo(materialInfoDTO));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<VpMaterialInfo> videoFinishNotify(VpMaterialInfo info) {
try {
return RpcResponse.success(vpMaterialInfoService.videoFinishNotify(info));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> configToCarboutique(VpMaterialInfo info) {
try {
return RpcResponse.success(vpMaterialInfoService.configToCarboutique(info));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> deleteById(Integer materialId) {
try {
return RpcResponse.success(vpMaterialInfoService.deleteById(materialId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.List;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.WeappModuleDTO;
import cn.com.glsx.dj.weapp.enums.ModuleStatusEnum;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.dj.weapp.service.WeappModuleService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
/**
* @Title: WeappChannelModuleRemoteImpl
* @Description: 首页子模块信息RPC服务实现层
* @author yangjia
*/
@DubboService(protocol = "dubbo")
public class WeappModuleRemoteImpl implements WeappModuleRemote{
Logger logger = LoggerFactory.getLogger(WeappModuleRemoteImpl.class);
@Autowired
private WeappModuleService weappModuleService;
/**
* @Title: listWeappModuleByPage
* @Description: 分页获取首页所有子模块
* @param weappModuleRpcPagination
* @return RpcResponse<RpcPagination<WeappModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<RpcPagination<WeappModule>> listWeappModuleByPage(RpcPagination<WeappModule> weappModuleRpcPagination) {
try {
logger.debug("listWeappModuleByPage weappModuleRpcPagination:{}", weappModuleRpcPagination);
WeappModule weappModule = weappModuleRpcPagination.getCondition();
RpcAssert.assertNotNull(weappModule, DefaultErrorEnum.DATA_NULL,"模块信息不能为空!");
if(weappModule.getId() == null){
if(weappModule.getModuleAlias() != null){
weappModule = weappModuleService.getWeappModuleByCondition(weappModule);
if(weappModule == null || weappModule.getId() == null){
logger.error("listWeappFunctionModuleByPage获取首页模块信息出错");
}
}else{
logger.error("listWeappFunctionModuleByPage模块ID和模块别名不能同时传空!");
}
}
weappModuleRpcPagination.setCondition(weappModule);
//查询子模块
Page<WeappModule> weappModulePage =weappModuleService.listWeappModuleByCondition(weappModuleRpcPagination);
weappModuleRpcPagination = RpcPagination.copyPage(weappModulePage);
return RpcResponse.success(weappModuleRpcPagination);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: listWeappFunctionModuleByPage
* @Description: 分页根据条件获取首页下所有的功能模块
* @param weappModuleDTORpcPagination
* @return RpcResponse<RpcPagination<WeappModuleDTO>>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<RpcPagination<WeappModuleDTO>> listWeappFunctionModuleByPage(RpcPagination<WeappModuleDTO> weappModuleDTORpcPagination) {
RpcAssert.assertNotNull(weappModuleDTORpcPagination, DefaultErrorEnum.DATA_NULL,"功能模块分页信息不能为空!");
try {
WeappModuleDTO weappModuleDTO = weappModuleDTORpcPagination.getCondition();
RpcAssert.assertNotNull(weappModuleDTO, DefaultErrorEnum.DATA_NULL,"模块信息不能为空!");
if(weappModuleDTO.getId() == null){
if(weappModuleDTO.getModuleAlias() != null){
WeappModule weappMo = new WeappModule();
weappMo.setModuleAlias(weappModuleDTO.getModuleAlias());
weappMo = weappModuleService.getWeappModuleByCondition(weappMo);
if(weappMo.getId() == null){
logger.error("listWeappFunctionModuleByPage获取首页模块信息出错");
}else{
weappModuleDTO.setId(weappMo.getId());
}
}else{
logger.error("listWeappFunctionModuleByPage模块ID和模块别名不能同时传空!");
}
}
weappModuleDTORpcPagination.setCondition(weappModuleDTO);
Page<WeappModuleDTO> weappModuleDTOPage =weappModuleService.listWeappFunctionModuleByPageCondition(weappModuleDTORpcPagination);
weappModuleDTORpcPagination = RpcPagination.copyPage(weappModuleDTOPage);
return RpcResponse.success(weappModuleDTORpcPagination);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: insertWeappFunctionModule
* @Description: 插入首页功能模块信息
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<Long> insertWeappFunctionModule(WeappModule weappModule) {
RpcAssert.assertNotNull(weappModule, DefaultErrorEnum.DATA_NULL,"功能模块对象不能为空!");
try {
logger.debug("insertWeappFunctionModule weappModule:{}", weappModule);
Long weappModuleId =weappModuleService.insertWeappFunctionModule(weappModule);
return RpcResponse.success(weappModuleId);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: updateWeappFunctionModule
* @Description: 更新首页功能模块信息
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<Integer> updateWeappFunctionModule(WeappModule weappModule) {
RpcAssert.assertNotNull(weappModule, DefaultErrorEnum.DATA_NULL,"功能模块对象不能为空!");
try {
logger.debug("updateWeappFunctionModule weappModule:{}", weappModule);
Integer result =weappModuleService.updateWeappFunctionModule(weappModule);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: deleteWeappModule
* @Description: 删除首页模块信息
* @param id
* @return RpcResponse<Integer>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<Integer> deleteWeappModule(Long id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"首页模块ID不能为空!");
try {
logger.debug("deleteWeappFunctionModule id:{}", id);
return RpcResponse.success(weappModuleService.deleteWeappModule(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: getWeappModuleByCondition
* @Description: 条件获取上架的模块信息
* @param weappModule
* @return RpcResponse<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<WeappModule> getWeappModuleByCondition(WeappModule weappModule) {
RpcAssert.assertNotNull(weappModule, DefaultErrorEnum.DATA_NULL,"首页模块信息不能为空!");
try {
logger.debug("getWeappModuleByCondition weappModule:{}", weappModule);
return RpcResponse.success(weappModuleService.getWeappModuleByCondition(weappModule));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: listWeappModuleSortById
* @Description: 获取某个模块的所有功能模块
* @param moduleId
* @return RpcResponse<List<WeappModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<List<WeappModule>> listWeappModuleSortById(Integer moduleId) {
try {
logger.debug("listWeappModuleSortById moduleId:{}", moduleId);
return RpcResponse.success(weappModuleService.listWeappModuleSortById(moduleId));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
/**
* @Title: listAllWeappModule
* @Description: 获取小程序所有未被删除的模块
* @return RpcResponse<List<WeappModule>>
* @author yangjia
* @Date: 2019/04/28
*/
@Override
public RpcResponse<List<WeappModule>> listAllWeappModule(ModuleStatusEnum moduleStatus) {
try {
return RpcResponse.success(weappModuleService.listAllWeappModule(moduleStatus));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.mapper.CustomerServiceMessageCatalogMapper;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* @author zhoudan
*/
@Service
public class CustomerServiceMessageCatalogService {
Logger logger = LoggerFactory.getLogger(CustomerServiceMessageCatalogService.class);
@Autowired
private CustomerServiceMessageCatalogMapper customerServiceMessageCatalogMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public CustomerServiceMessageCatalog insert(CustomerServiceMessageCatalog customerServiceMessageCatalog) {
RpcAssert.assertNotNull(customerServiceMessageCatalog, DefaultErrorEnum.DATA_NULL, "消息列表对象不能为空!");
try {
Date now = new Date();
customerServiceMessageCatalog.setUpdatedBy(customerServiceMessageCatalog.getCreatedBy());
customerServiceMessageCatalog.setCreatedDate(now);
customerServiceMessageCatalog.setUpdatedDate(now);
customerServiceMessageCatalog.setDeletedFlag(DeletedFlagEnum.N.name());
customerServiceMessageCatalogMapper.insertUseGeneratedKeys(customerServiceMessageCatalog);
logger.info("insert customerServiceMessageCatalog:{}", customerServiceMessageCatalog);
return customerServiceMessageCatalog;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public CustomerServiceMessageCatalog getById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try {
CustomerServiceMessageCatalog catalog = new CustomerServiceMessageCatalog();
catalog.setId(id.longValue());
CustomerServiceMessageCatalog res = customerServiceMessageCatalogMapper.selectOne(catalog);
logger.info("getIntelligentReminderById res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public CustomerServiceMessageCatalog getByAccountId(Integer accountId,Integer merchantId) {
RpcAssert.assertNotNull(accountId, DefaultErrorEnum.DATA_NULL, "accountId不能为空!");
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
return customerServiceMessageCatalogMapper.getByAccountId(accountId,merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public Page<CustomerServiceMessageCatalog> selectByPage(RpcPagination<CustomerServiceMessageCatalog> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "pagination is no null");
RpcAssert.assertNotNull(pagination.getCondition(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition is no null");
RpcAssert.assertNotNull(pagination.getCondition().getMerchantId(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition.getMerchantId() is no null");
try{
CustomerServiceMessageCatalog messageCatalog = pagination.getCondition();
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
Page<CustomerServiceMessageCatalog> page = customerServiceMessageCatalogMapper.selectByPage(messageCatalog);
return page;
} catch (Exception e){
logger.info(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int updateByAccountId(CustomerServiceMessageCatalog customerServiceMessageCatalog) {
RpcAssert.assertNotNull(customerServiceMessageCatalog, DefaultErrorEnum.DATA_NULL, "更新对象不能为空!");
RpcAssert.assertNotNull(customerServiceMessageCatalog.getAccountId(), DefaultErrorEnum.DATA_NULL, "客户id不能为空!");
try {
customerServiceMessageCatalog.setUpdatedDate(new Date());
return customerServiceMessageCatalogMapper.updateByAccountId(customerServiceMessageCatalog);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO;
import cn.com.glsx.dj.weapp.enums.CacheKeyEnum;
import cn.com.glsx.dj.weapp.enums.StatusEnum;
import cn.com.glsx.dj.weapp.mapper.CustomerServiceMessageMapper;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog;
import cn.com.glsx.dj.wechat.enums.WechatUserTypeEnum;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* @author zhoudan
*/
@Service
public class CustomerServiceMessageService {
Logger logger = LoggerFactory.getLogger(CustomerServiceMessageService.class);
@Autowired
private CustomerServiceMessageMapper customerServiceMessageMapper;
@Autowired
private CustomerServiceMessageCatalogService catalogService;
private RedisTemplate<String,Object> redisTemplate;
@Autowired
public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
this.redisTemplate = redisTemplate;
redisTemplate.setHashValueSerializer(new StringRedisSerializer());
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public CustomerServiceMessageDTO insert(CustomerServiceMessageDTO customerServiceMessage){
RpcAssert.assertNotNull(customerServiceMessage, DefaultErrorEnum.DATA_NULL, "客服信息对象不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getMerchantId(), DefaultErrorEnum.DATA_NULL, "商户号不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getAccountId(), DefaultErrorEnum.DATA_NULL, "用户id不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getSendType(), DefaultErrorEnum.DATA_NULL, "发送方类型不能为空!");
try {
Date now = new Date();
customerServiceMessage.setUpdatedBy(customerServiceMessage.getCreatedBy());
customerServiceMessage.setCreatedDate(now);
customerServiceMessage.setUpdatedDate(now);
customerServiceMessage.setDeletedFlag(DeletedFlagEnum.N.name());
customerServiceMessage.setSendStatus(StatusEnum.UNSEND.getValue());
int num = customerServiceMessageMapper.insertUseGeneratedKeys(customerServiceMessage);
if(num==1){
//新增消息成功,消息列表新增或更新
logger.info("insert sendType():{}", customerServiceMessage.getSendType());
CustomerServiceMessageCatalog catalog = catalogService.getByAccountId(customerServiceMessage.getAccountId(),customerServiceMessage.getMerchantId());
logger.info("getByAccountId catalog:{}", catalog);
if(customerServiceMessage.getSendType().equals(WechatUserTypeEnum.CUSTOMER.getValue())){
//C端发送的消息 需要计数
if(catalog!=null){
//更新
catalog.setUnreadCount(catalog.getUnreadCount()+1);
catalog.setMessageContentNew(customerServiceMessage.getMessageContentNew());
catalog.setMessageTypeNew(customerServiceMessage.getMessageTypeNew());
catalog.setPhone(customerServiceMessage.getPhone());
catalog.setNickName(customerServiceMessage.getNickName());
catalog.setAvatarUrl(customerServiceMessage.getAvatarUrl());
catalog.setSendType(WechatUserTypeEnum.CUSTOMER.getValue());
catalogService.updateByAccountId(catalog);
}else {
//新增
CustomerServiceMessageCatalog customerServiceMessageCatalog = new CustomerServiceMessageCatalog();
BeanUtils.copyProperties(customerServiceMessage,customerServiceMessageCatalog);
customerServiceMessageCatalog.setUnreadCount(1);
logger.info("insert customerServiceMessageCatalog:{}", customerServiceMessageCatalog);
catalogService.insert(customerServiceMessageCatalog);
}
}else {
//B端发送的消息只需要显示
if(catalog!=null){
catalog.setMessageContentNew(customerServiceMessage.getMessageContent());
catalog.setMessageTypeNew(customerServiceMessage.getMessageType());
catalog.setSendType(WechatUserTypeEnum.MERCHANT.getValue());
catalog.setAvatarUrl(customerServiceMessage.getAvatarUrl());
catalog.setNickName(customerServiceMessage.getNickName());
catalog.setPhone(customerServiceMessage.getPhone());
catalogService.updateByAccountId(catalog);
}else {
CustomerServiceMessageCatalog customerServiceMessageCatalog = new CustomerServiceMessageCatalog();
BeanUtils.copyProperties(customerServiceMessage,customerServiceMessageCatalog);
logger.info("insert customerServiceMessageCatalog:{}", customerServiceMessageCatalog);
catalogService.insert(customerServiceMessageCatalog);
}
}
String hashKey = customerServiceMessage.getSendType().concat(":").concat(customerServiceMessage.getMerchantId().toString()).concat(":").concat(customerServiceMessage.getAccountId().toString());
Boolean hasKey = redisTemplate.opsForHash().hasKey(CacheKeyEnum.CUSTOMER_SERVICE_MESSAGE.getValue(), hashKey);
long unreadCount = 1;
if(hasKey){
unreadCount = redisTemplate.opsForHash().increment(CacheKeyEnum.CUSTOMER_SERVICE_MESSAGE.getValue(), hashKey, unreadCount);
}else{
redisTemplate.opsForHash().put(CacheKeyEnum.CUSTOMER_SERVICE_MESSAGE.getValue(), hashKey, "1");
}
logger.info("{} = {}", hashKey, unreadCount);
}
logger.info("insert customerServiceMessage:{}", customerServiceMessage);
return customerServiceMessage;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<CustomerServiceMessage> getByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
return customerServiceMessageMapper.getByMerchantId(merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public List<CustomerServiceMessageDTO> getByAccountId(Integer accountId,Integer merchantId) {
RpcAssert.assertNotNull(accountId, DefaultErrorEnum.DATA_NULL, "accountId不能为空!");
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
return customerServiceMessageMapper.getByAccountId(accountId,merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public List<CustomerServiceMessageDTO> getUnreadByAccountId(CustomerServiceMessage customerServiceMessage) {
RpcAssert.assertNotNull(customerServiceMessage.getAccountId(), DefaultErrorEnum.DATA_NULL, "accountId不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getMerchantId(), DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getSendType(), DefaultErrorEnum.DATA_NULL, "sendType不能为空!");
try{
String hashKey = customerServiceMessage.getSendType().concat(":").concat(customerServiceMessage.getMerchantId().toString()).concat(":").concat(customerServiceMessage.getAccountId().toString());
Object unreadCount = redisTemplate.opsForHash().get(CacheKeyEnum.CUSTOMER_SERVICE_MESSAGE.getValue(), hashKey);
if(unreadCount == null){
return null;
}
return customerServiceMessageMapper.getUnreadByAccountId(customerServiceMessage);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int updateByAccountId(CustomerServiceMessage customerServiceMessage) {
RpcAssert.assertNotNull(customerServiceMessage, DefaultErrorEnum.DATA_NULL, "更新对象不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getAccountId(), DefaultErrorEnum.DATA_NULL, "客户id不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getMerchantId(), DefaultErrorEnum.DATA_NULL, "商户号不能为空!");
RpcAssert.assertNotNull(customerServiceMessage.getSendType(), DefaultErrorEnum.DATA_NULL, "发送方类型不能为空!");
try {
customerServiceMessage.setMessageStatus(StatusEnum.ALREADY_READ.getValue());
int num = customerServiceMessageMapper.updateByAccountId(customerServiceMessage);
if(num>0){
//消息表更新完毕 消息列表更新
if(customerServiceMessage.getSendType().equals(WechatUserTypeEnum.CUSTOMER.getValue())){
CustomerServiceMessageCatalog catalog = catalogService.getByAccountId(customerServiceMessage.getAccountId(),customerServiceMessage.getMerchantId());
if(catalog!=null){
catalog.setUnreadCount(0);
catalogService.updateByAccountId(catalog);
}
}
String hashKey = customerServiceMessage.getSendType().concat(":").concat(customerServiceMessage.getMerchantId().toString()).concat(":").concat(customerServiceMessage.getAccountId().toString());
redisTemplate.opsForHash().delete(CacheKeyEnum.CUSTOMER_SERVICE_MESSAGE.getValue(), hashKey);
}
return num;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public int countByMerchantId(Integer merchantId){
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try {
return customerServiceMessageMapper.countByMerchantId(merchantId);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public List<CustomerServiceMessage> getMerchantByUnread(String status,String type) {
RpcAssert.assertNotNull(status, DefaultErrorEnum.DATA_NULL, "status不能为空!");
try{
return customerServiceMessageMapper.getMerchantByUnread(status,type);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.enums.CacheKeyEnum;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindRuleMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.redis.service.RedisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* @author zhoudan
*/
@Service
public class IntelligentRemindRuleService {
private final Logger logger = LoggerFactory.getLogger(IntelligentRemindRuleService.class);
@Autowired
private IntelligentRemindRuleMapper intelligentRemindRuleMapper;
@Autowired
private RedisService redisService;
public Page<IntelligentRemindRule> selectByPage(RpcPagination<IntelligentRemindRule> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "pagination is no null");
RpcAssert.assertNotNull(pagination.getCondition(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition is no null");
RpcAssert.assertNotNull(pagination.getCondition().getMerchantId(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition.getMerchantId() is no null");
try{
IntelligentRemindRule intelligentRemindRule = pagination.getCondition();
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
Page<IntelligentRemindRule> page = intelligentRemindRuleMapper.selectByPage(intelligentRemindRule);
return page;
} catch (Exception e){
logger.info(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL);
}
}
public List<IntelligentRemindRule> getRuleClass(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId is no null");
try{
return intelligentRemindRuleMapper.getRuleClass(merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public List<IntelligentRemindRule> getRuleList(IntelligentRemindRule intelligentRemindRule) {
RpcAssert.assertNotNull(intelligentRemindRule, DefaultErrorEnum.DATA_NULL, "intelligentRemindRule is no null");
RpcAssert.assertNotNull(intelligentRemindRule.getMerchantId(), DefaultErrorEnum.DATA_NULL, "intelligentRemindRule.getMerchantId() is no null");
RpcAssert.assertNotNull(intelligentRemindRule.getRuleClassify(), DefaultErrorEnum.DATA_NULL, "intelligentRemindRule.getRuleClassify() is no null");
try{
return intelligentRemindRuleMapper.getRuleList(intelligentRemindRule);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindRule insert(IntelligentRemindRule intelligentRemindRule) {
RpcAssert.assertNotNull(intelligentRemindRule, DefaultErrorEnum.DATA_NULL, "规则对象不能为空!");
RpcAssert.assertNotNull(intelligentRemindRule.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindRule.getCreatedBy不能为空");
try {
Date now = new Date();
intelligentRemindRule.setUpdatedBy(intelligentRemindRule.getCreatedBy());
intelligentRemindRule.setCreatedDate(now);
intelligentRemindRule.setUpdatedDate(now);
intelligentRemindRule.setDeletedFlag(DeletedFlagEnum.N.name());
intelligentRemindRuleMapper.insertUseGeneratedKeys(intelligentRemindRule);
logger.info("insert intelligentRemindRule:{}", intelligentRemindRule);
return intelligentRemindRule;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public IntelligentRemindRule getById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try {
IntelligentRemindRule res = intelligentRemindRuleMapper.getById(id);
logger.info("getById res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<IntelligentRemindRule> getByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
return intelligentRemindRuleMapper.getByMerchantId(merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int update(IntelligentRemindRule intelligentRemindRule) {
RpcAssert.assertNotNull(intelligentRemindRule, DefaultErrorEnum.DATA_NULL, "更新对象不能为空!");
RpcAssert.assertNotNull(intelligentRemindRule.getId(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindRule.getId is not null");
try {
return intelligentRemindRuleMapper.update(intelligentRemindRule);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int deleteById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try{
return intelligentRemindRuleMapper.deleteById(id);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int copyRuleListByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
//先查询redis有没有拷贝标识 无则拷贝
String key = CacheKeyEnum.DEFAULT_RULE_IS_COPY.getValue().concat(merchantId.toString());
logger.info("copyRuleListByMerchantId key:{}", key);
if (!redisService.exists(key)) {
//首次登录 拷贝一份默认规则给当前登陆门店
List<IntelligentRemindRule> remindRuleList = intelligentRemindRuleMapper.getByMerchantId(-1);
for (IntelligentRemindRule remindRule : remindRuleList) {
remindRule.setId(null);
remindRule.setMerchantId(merchantId);
intelligentRemindRuleMapper.insert(remindRule);
}
redisService.set(key,merchantId.toString());
}
return 1;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.IntConsumer;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.marketing.dto.ShopActivityCopyInfoDTO;
import cn.com.glsx.dj.marketing.dto.ShopActivityInfoDTO;
import cn.com.glsx.dj.marketing.dto.ShopActivityOperationLogDTO;
import cn.com.glsx.dj.marketing.enums.ActivityOperationTypeEnums;
import cn.com.glsx.dj.marketing.remote.WeappActivityRemote;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceCopyInfoDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.enums.StatusEnum;
import cn.com.glsx.dj.weapp.manager.ShopActivityManager;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.dj.weapp.model.IntelligentRemindService;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTagRef;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
/**
* @author zhoudan
*/
@Service
public class IntelligentRemindServeService {
private final Logger logger = LoggerFactory.getLogger(IntelligentRemindServeService.class);
@Autowired
private IntelligentRemindServiceMapper remindServiceMapper;
@Autowired
private IntelligentRemindRuleService remindRuleService;
@Autowired
private IntelligentRemindServiceCarSeriesService remindServiceCarSeriesService;
@Autowired
private IntelligentRemindServiceMaterialService remindServiceMaterialService;
@Autowired
private IntelligentRemindServiceClassifyTagRefService intelligentRemindServiceClassifyTagRefService;
@Autowired
private IntelligentRemindServiceClassifyTagService intelligentRemindServiceClassifyTagService;
@Autowired
private WeappActivityRemote weappActivityRemote;
@Autowired
private ShopActivityManager shopActivityManager;
private final static String MAJOR_SERVICE="大保养服务";
private final static String MINOR_SERVICE="小保养服务";
@Value("${service.classify.tag.count.max:4}")
private Integer serviceClassifyTagCountMax;
/**
* 服务项目写库时,车型信息、素材信息同时入库
* @param serviceDTO
* @return
* @throws RpcServiceException
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceDTO insert(IntelligentRemindServiceDTO serviceDTO){
RpcAssert.assertNotNull(serviceDTO, DefaultErrorEnum.DATA_NULL, "服务对象不能为空!");
RpcAssert.assertNotNull(serviceDTO.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceDTO.getCreatedBy is not null");
RpcAssert.assertIsTrue(CollectionUtils.isNotEmpty(serviceDTO.getIntelligentRemindServiceClassifyTags()), DefaultErrorEnum.DATA_NULL, "分类不能为空");
RpcAssert.assertIsTrue(serviceDTO.getIntelligentRemindServiceClassifyTags().size() <= serviceClassifyTagCountMax, DefaultErrorEnum.VALIDATE_FAILED, "分类数量不能超过4个");
RpcAssert.assertIsTrue((serviceDTO.getActivityId() != null || StringUtils.isNotEmpty(serviceDTO.getVideoUrl())), DefaultErrorEnum.DATA_NULL, "视频和活动不能同时为空");
try {
logger.info("insert serviceDTO:{}", serviceDTO);
Date now = new Date();
serviceDTO.setUpdatedBy(serviceDTO.getCreatedBy());
serviceDTO.setCreatedDate(now);
serviceDTO.setUpdatedDate(now);
serviceDTO.setDeletedFlag(DeletedFlagEnum.N.name());
int num = remindServiceMapper.insertUseGeneratedKeys(serviceDTO);
if (num == 1) {
if (CollectionUtils.isNotEmpty(serviceDTO.getIntelligentRemindServiceMaterial())) {
List<IntelligentRemindServiceMaterial> material = serviceDTO.getIntelligentRemindServiceMaterial();
for (IntelligentRemindServiceMaterial serviceMaterial : material) {
serviceMaterial.setIntelligentRemindServiceId(serviceDTO.getId().intValue());
serviceMaterial.setCreatedBy(serviceDTO.getCreatedBy());
remindServiceMaterialService.insert(serviceMaterial);
}
}
if (CollectionUtils.isNotEmpty(serviceDTO.getIntelligentRemindServiceCarSeries())) {
List<IntelligentRemindServiceCarSeries> carSeries = serviceDTO.getIntelligentRemindServiceCarSeries();
for (IntelligentRemindServiceCarSeries carSery : carSeries) {
carSery.setIntelligentRemindServiceId(serviceDTO.getId().intValue());
carSery.setCreatedBy(serviceDTO.getCreatedBy());
remindServiceCarSeriesService.insert(carSery);
}
}
// 已选分类标签
if (CollectionUtils.isNotEmpty(serviceDTO.getIntelligentRemindServiceClassifyTags())){
for(IntelligentRemindServiceClassifyTag classifyTag:serviceDTO.getIntelligentRemindServiceClassifyTags()){
// 如为自定义分类,则创建商户对应的分类
if(StatusEnum.TAG_CUSTOM.getValue().equals(classifyTag.getOnCustom())){
classifyTag.setId(null);
classifyTag.setMerchantId(serviceDTO.getMerchantId());
classifyTag.setCreatedBy(serviceDTO.getCreatedBy());
classifyTag = intelligentRemindServiceClassifyTagService.checkAndAdd(classifyTag);
}
IntelligentRemindServiceClassifyTagRef serviceClassifyTagRef = new IntelligentRemindServiceClassifyTagRef();
serviceClassifyTagRef.setClassifyTagId(classifyTag.getId());
serviceClassifyTagRef.setServiceId(serviceDTO.getId());
serviceClassifyTagRef.setCreatedBy(serviceDTO.getCreatedBy());
intelligentRemindServiceClassifyTagRefService.add(serviceClassifyTagRef);
}
}
if(serviceDTO.getUserId() != null){
ShopActivityOperationLogDTO record = new ShopActivityOperationLogDTO();
record.setWechatLogo(serviceDTO.getLogo());
record.setWechatName(serviceDTO.getNickName());
record.setVideoId(serviceDTO.getId());
record.setUserId(serviceDTO.getUserId());
record.setMerchantId(serviceDTO.getMerchantId());
record.setMobile(serviceDTO.getMobile());
record.setOperationType(ActivityOperationTypeEnums.ACTIVITY_CREATE.getValue());
weappActivityRemote.createLogRecord(record);
}
}
return serviceDTO;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public Page<IntelligentRemindServiceDTO> selectByPage(RpcPagination<IntelligentRemindServiceDTO> pagination) {
try{
IntelligentRemindServiceDTO intelligentRemindService = pagination.getCondition();
PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
Page<IntelligentRemindServiceDTO> pageInfo = remindServiceMapper.selectByPage(intelligentRemindService);
return pageInfo;
} catch (Exception e){
logger.info(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATA_NULL);
}
}
/**
* 查询服务详情(活动、智能提醒规则、车型、素材)
* @param id
* @return
* @throws RpcServiceException
*/
public IntelligentRemindServiceDTO getById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try {
IntelligentRemindServiceDTO res = remindServiceMapper.getById(id);
if(res == null){
throw new RpcServiceException(DefaultErrorEnum.DATA_INVALID, "id不存在");
}
if (res.getRemindRuleId() != null) {
res.setIntelligentRemindRule(remindRuleService.getById(res.getRemindRuleId()));
}
res.setIntelligentRemindServiceCarSeries(remindServiceCarSeriesService.getById(id));
res.setIntelligentRemindServiceMaterial(remindServiceMaterialService.getById(id));
res.setIntelligentRemindServiceClassifyTags(intelligentRemindServiceClassifyTagService.getByServiceId(res.getId()));
logger.info("getById res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<IntelligentRemindServiceDTO> getByMerchantId(Integer merchantId){
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try{
return remindServiceMapper.getByMerchantId(merchantId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
public List<IntelligentRemindServiceDTO> getByCondition(IntelligentRemindServiceDTO serviceDTO) {
RpcAssert.assertNotNull(serviceDTO, DefaultErrorEnum.DATA_NULL, "serviceDTO不能为空!");
RpcAssert.assertNotNull(serviceDTO.getMerchantId(), DefaultErrorEnum.DATA_NULL, "serviceDTO.getMerchantId()不能为空!");
try{
List<IntelligentRemindServiceDTO> list = remindServiceMapper.getByCondition(serviceDTO);
for (IntelligentRemindServiceDTO remindServiceDTO : list) {
if(remindServiceDTO.getRemindRuleId() == null){
continue;
}
IntelligentRemindRule remindRule = remindRuleService.getById(remindServiceDTO.getRemindRuleId());
if (remindRule != null) {
remindServiceDTO.setProjectName(remindRule.getRuleName());
remindServiceDTO.setSeasonRule(remindRule.getSeasonRule());
if (StatusEnum.RULE_SEARCH_KEY_ONE.getValue().equals(serviceDTO.getSearchKey())) {
remindServiceDTO.setSearchKey(remindRule.getMileRule());
} else if (StatusEnum.RULE_SEARCH_KEY_TWO.getValue().equals(serviceDTO.getSearchKey())) {
remindServiceDTO.setSearchKey(remindRule.getTimeRule());
}
}
}
if (serviceDTO.getSearchKey() == null || serviceDTO.getMileOrCarAge() == null ||
StatusEnum.RULE_SEARCH_KEY_THREE.getValue().equals(serviceDTO.getSearchKey())) {
return list;
}
List<IntelligentRemindServiceDTO> result = new ArrayList<>();
List<IntelligentRemindServiceDTO> result1 = new ArrayList<>();
Integer mile = serviceDTO.getMileOrCarAge();
Map<String, List<IntelligentRemindServiceDTO>> map = new HashMap<>();
for (IntelligentRemindServiceDTO dto : list) {
if (NumberUtils.isDigits(dto.getSearchKey())) {
if (map.get(dto.getSearchKey()) == null) {
map.put(dto.getSearchKey(), new ArrayList<>());
}
map.get(dto.getSearchKey()).add(dto);
} else {
result1.add(dto);
}
}
for (String key : map.keySet()) {
Integer mileRule = Integer.valueOf(key);
if (mile >0 && mile % mileRule == 0) {
result.addAll(map.get(key));
}
}
if (result.isEmpty()) {
Integer mix = 0;
for (String key : map.keySet()) {
Integer diff = 0;
Integer mileRule = Integer.valueOf(key);
if (mile > mileRule && mile % mileRule > 0) {
diff = (mile / mileRule + 1) * mileRule - mile;
}
if (mileRule > mile) {
diff = mileRule - mile;
}
if (result.isEmpty() || diff < mix) {
mix = diff;
result.clear();
result.addAll(map.get(key));
} else if (diff.equals(mix)) {
result.addAll(map.get(key));
}
}
}
if (!StatusEnum.RULE_SEARCH_KEY_THREE.getValue().equals(serviceDTO.getSearchKey())) {
for (IntelligentRemindServiceDTO dto : result1) {
Calendar cal = Calendar.getInstance();
int currMonth = cal.get(Calendar.MONTH)+1;
String[] s = dto.getSeasonRule().split("-");
if (s != null && s.length > 1) {
if (NumberUtils.isDigits(s[0]) && NumberUtils.isDigits(s[1])) {
Integer start = Integer.valueOf(s[0]);
Integer end = Integer.valueOf(s[1]);
if (currMonth >= start && currMonth <= end) {
result.add(dto);
}
}
}
}
}
long count1 = result.stream().filter(type -> type.getProjectName().equals(MAJOR_SERVICE)).count();
long count2 = result.stream().filter(type -> type.getProjectName().equals(MAJOR_SERVICE)).count();
if (count1 > 0 && count2 > 0) {
//大小保养都存在
Iterator<IntelligentRemindServiceDTO> iterator = result.iterator();
while (iterator.hasNext()) {
if (iterator.next().getProjectName().equals(MINOR_SERVICE)) {
iterator.remove();
break;
}
}
}
return result;
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<IntelligentRemindService> getRemindServiceList(IntelligentRemindServiceListConditionDTO conditionDTO){
try{
return remindServiceMapper.getRemindServiceList(conditionDTO);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
public List<IntelligentRemindServiceDTO> getByRemindRuleId(Integer remindRuleId) {
RpcAssert.assertNotNull(remindRuleId, DefaultErrorEnum.DATA_NULL, "remindRuleId不能为空!");
try{
return remindServiceMapper.getByRemindRuleId(remindRuleId);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int update(IntelligentRemindServiceDTO intelligentRemindServiceDTO) {
RpcAssert.assertNotNull(intelligentRemindServiceDTO, DefaultErrorEnum.DATA_NULL, "更新对象不能为空!");
RpcAssert.assertNotNull(intelligentRemindServiceDTO.getId(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceDTO.getId is not null");
IntelligentRemindService intelligentRemindService = remindServiceMapper.selectByPrimaryKey(intelligentRemindServiceDTO.getId());
RpcAssert.assertNotNull(intelligentRemindService, DefaultErrorEnum.DATA_INVALID, "智能提醒服务ID不存在");
try {
if(CollectionUtils.isNotEmpty(intelligentRemindServiceDTO.getIntelligentRemindServiceMaterial())){
List<IntelligentRemindServiceMaterial> material = intelligentRemindServiceDTO.getIntelligentRemindServiceMaterial();
for (IntelligentRemindServiceMaterial serviceMaterial : material) {
serviceMaterial.setIntelligentRemindServiceId(intelligentRemindServiceDTO.getId().intValue());
serviceMaterial.setUpdatedDate(new Date());
remindServiceMaterialService.update(serviceMaterial);
}
}
if(CollectionUtils.isNotEmpty(intelligentRemindServiceDTO.getIntelligentRemindServiceCarSeries())){
List<IntelligentRemindServiceCarSeries> carSeries = intelligentRemindServiceDTO.getIntelligentRemindServiceCarSeries();
for (IntelligentRemindServiceCarSeries carSery : carSeries) {
carSery.setIntelligentRemindServiceId(intelligentRemindServiceDTO.getId().intValue());
carSery.setUpdatedDate(new Date());
remindServiceCarSeriesService.update(carSery);
}
}
// 已选分类标签
if (CollectionUtils.isNotEmpty(intelligentRemindServiceDTO.getIntelligentRemindServiceClassifyTags())){
// 先删除旧标签关系
intelligentRemindServiceClassifyTagRefService.deleteByServiceId(intelligentRemindServiceDTO.getId());
for(IntelligentRemindServiceClassifyTag classifyTag:intelligentRemindServiceDTO.getIntelligentRemindServiceClassifyTags()){
IntelligentRemindServiceClassifyTagRef serviceClassifyTagRef = new IntelligentRemindServiceClassifyTagRef();
serviceClassifyTagRef.setClassifyTagId(classifyTag.getId());
serviceClassifyTagRef.setServiceId(intelligentRemindService.getId());
serviceClassifyTagRef.setCreatedBy(intelligentRemindService.getCreatedBy());
intelligentRemindServiceClassifyTagRefService.add(serviceClassifyTagRef);
}
}
IntelligentRemindServiceDTO res = getById(intelligentRemindServiceDTO.getId().intValue());
if(intelligentRemindServiceDTO.getActivityId()==null && res.getActivityId()!=null){
intelligentRemindServiceDTO.setActivityId(res.getActivityId());
}
if(intelligentRemindServiceDTO.getRemindRuleId()==null && res.getRemindRuleId()!=null){
intelligentRemindServiceDTO.setRemindRuleId(res.getRemindRuleId());
}
intelligentRemindServiceDTO.setUpdatedDate(new Date());
int result = remindServiceMapper.update(intelligentRemindServiceDTO);
if(result == 1){
ShopActivityOperationLogDTO record = new ShopActivityOperationLogDTO();
record.setWechatLogo(intelligentRemindServiceDTO.getLogo());
record.setWechatName(intelligentRemindServiceDTO.getNickName());
record.setVideoId(intelligentRemindServiceDTO.getId());
record.setUserId(intelligentRemindServiceDTO.getUserId());
record.setMerchantId(intelligentRemindServiceDTO.getMerchantId());
record.setMobile(intelligentRemindServiceDTO.getMobile());
record.setOperationType(ActivityOperationTypeEnums.ACTIVITY_EDIT.getValue());
if(null != intelligentRemindServiceDTO.getReferActivityId()){
record.setReferActivityId(intelligentRemindServiceDTO.getReferActivityId().longValue());
}
weappActivityRemote.createLogRecord(record);
}
return result;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int deleteById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try{
IntelligentRemindService service = remindServiceMapper.getById(id);
if (service == null) {
logger.info("智能提醒服务不存在,id:{}",id);
return 0;
}
IntelligentRemindServiceMaterial material = new IntelligentRemindServiceMaterial();
material.setIntelligentRemindServiceId(id);
material.setUpdatedDate(new Date());
material.setDeletedFlag(DeletedFlagEnum.D.name());
remindServiceMaterialService.update(material);
IntelligentRemindServiceCarSeries carSeries = new IntelligentRemindServiceCarSeries();
carSeries.setIntelligentRemindServiceId(id);
carSeries.setUpdatedDate(new Date());
carSeries.setDeletedFlag(DeletedFlagEnum.D.name());
remindServiceCarSeriesService.update(carSeries);
// 删除服务关联的分类标签
intelligentRemindServiceClassifyTagRefService.deleteByServiceId(service.getId());
return remindServiceMapper.deleteById(id);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public Integer copyRemindService(IntelligentRemindServiceCopyInfoDTO copyInfo){
RpcAssert.assertNotNull(copyInfo, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertIsTrue((StringUtils.isNotEmpty(copyInfo.getSourceRemindServiceIds()) || copyInfo.getSourceRemindServiceId() != null), DefaultErrorEnum.PARAMETER_NULL, "提醒服务ID为空");
RpcAssert.assertIsTrue((StringUtils.isNotEmpty(copyInfo.getTargetMerchantIds()) || copyInfo.getTargetMerchantId() != null), DefaultErrorEnum.PARAMETER_NULL, "提醒服务ID为空");
Integer copyCount = 0;
Iterator<Integer> serviceIdIterator = getServiceIdSet(copyInfo).iterator();
while(serviceIdIterator.hasNext()){
Integer serviceId = serviceIdIterator.next();
try{
IntelligentRemindServiceDTO remindServiceDTO = getById(serviceId);
copyCount += copyRemindService(remindServiceDTO, getMerchantIdSet(copyInfo));
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
}
}
logger.info("拷贝活动成功{}条", copyCount);
return copyCount;
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
private Integer copyRemindService(IntelligentRemindServiceDTO remindServiceDTO, Set<Integer> merchantIdSet){
Integer copyCount = 0;
Iterator<Integer> merchantIdIterator = merchantIdSet.iterator();
while(merchantIdIterator.hasNext()){
Integer merchantId = merchantIdIterator.next();
if(merchantId.equals(remindServiceDTO.getMerchantId())){
logger.info("不拷贝本商户:{}", merchantId);
continue;
}
ShopActivityCopyInfoDTO activityCopyInfo = new ShopActivityCopyInfoDTO();
activityCopyInfo.setTargetMerchantId(merchantId);
activityCopyInfo.setSourceActivityId(remindServiceDTO.getActivityId().longValue());
// 拷贝营销活动
ShopActivityInfoDTO activity = shopActivityManager.copyActivity(activityCopyInfo);
if(activity == null){
continue;
}
logger.info("拷贝营销活动:{} 成功", activityCopyInfo);
remindServiceDTO.setId(null);
remindServiceDTO.setActivityId(activity.getId().intValue());
remindServiceDTO.setMerchantId(merchantId);
remindServiceDTO.setCreatedBy(activity.getCreatedBy());
remindServiceDTO.setUpdatedBy(activity.getUpdatedBy());
// 拷贝智能提醒服务
try{
remindServiceDTO = insert(remindServiceDTO);
copyCount ++;
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
}
}
return copyCount;
}
private Set<Integer> getServiceIdSet(IntelligentRemindServiceCopyInfoDTO copyInfo){
Set<Integer> serviceIdSet = new HashSet<>();
if(copyInfo.getSourceRemindServiceId() != null){
serviceIdSet.add(copyInfo.getSourceRemindServiceId());
}
if(StringUtils.isNotEmpty(copyInfo.getSourceRemindServiceIds())){
List<String> serviceIds = Arrays.asList(copyInfo.getSourceRemindServiceIds().split(","));
serviceIds.stream().mapToInt(s -> Integer.valueOf(s)).forEach(new IntConsumer() {
@Override
public void accept(int value) {
serviceIdSet.add(value);
}
});
}
logger.info("拷贝智能提醒服务源ID列表:{}", serviceIdSet);
return serviceIdSet;
}
private Set<Integer> getMerchantIdSet(IntelligentRemindServiceCopyInfoDTO copyInfo){
Set<Integer> merchantIdSet = new HashSet<Integer>();
if(copyInfo.getTargetMerchantId() != null){
merchantIdSet.add(copyInfo.getTargetMerchantId());
}
if(StringUtils.isNotEmpty(copyInfo.getTargetMerchantIds())){
List<String> serviceIds = Arrays.asList(copyInfo.getTargetMerchantIds().split(","));
serviceIds.stream().mapToInt(s -> Integer.valueOf(s)).forEach(new IntConsumer() {
@Override
public void accept(int value) {
merchantIdSet.add(value);
}
});
}
logger.info("拷贝智能提醒服务目标商户号列表:{}", merchantIdSet);
return merchantIdSet;
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceCarSeriesMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
/**
* @author zhoudan
*/
@Service
public class IntelligentRemindServiceCarSeriesService {
Logger logger = LoggerFactory.getLogger(IntelligentRemindServiceCarSeriesService.class);
@Autowired
private IntelligentRemindServeService remindServeService;
@Autowired
private IntelligentRemindServiceCarSeriesMapper carSeriesMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceCarSeries insert(IntelligentRemindServiceCarSeries remindServiceCarSeries) {
RpcAssert.assertNotNull(remindServiceCarSeries, DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceCarSeries is not null");
RpcAssert.assertNotNull(remindServiceCarSeries.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceCarSeries.getCreatedBy is not null");
try {
remindServiceCarSeries.setUpdatedBy(remindServiceCarSeries.getCreatedBy());
remindServiceCarSeries.setCreatedDate(new Date());
remindServiceCarSeries.setUpdatedDate(new Date());
remindServiceCarSeries.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
carSeriesMapper.insertUseGeneratedKeys(remindServiceCarSeries);
logger.info("insert remindServiceCarSeries:{}", remindServiceCarSeries);
return remindServiceCarSeries;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* 通过服务id查询详情
* @param serviceId
* @return
* @throws RpcServiceException
*/
public List<IntelligentRemindServiceCarSeries> getById(Integer serviceId) {
try {
List<IntelligentRemindServiceCarSeries> res = carSeriesMapper.getById(serviceId);
logger.info("getById res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int update(IntelligentRemindServiceCarSeries remindServiceCarSeries) {
RpcAssert.assertNotNull(remindServiceCarSeries, DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceCarSeries is not null");
try {
return carSeriesMapper.update(remindServiceCarSeries);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int deleteById(Integer id) {
try{
return carSeriesMapper.deleteById(id);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<IntelligentRemindServiceCarSeries> getRemindServiceCarSeriesByRemindRuleId(Integer remindRuleId) {
try{
Example exampleCar = new Example(IntelligentRemindServiceCarSeries.class);
exampleCar.createCriteria().andEqualTo("intelligentRemindServiceId",remindRuleId).andEqualTo("deletedFlag","N");
return carSeriesMapper.selectByExample(exampleCar);
}catch(Exception e){
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceClassifyTagRefMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTagRef;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
/**
* @Title: IntelligentRemindServiceClassifyTagRefService.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午12:13:25
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Service
public class IntelligentRemindServiceClassifyTagRefService {
@Autowired
private IntelligentRemindServiceClassifyTagRefMapper intelligentRemindServiceClassifyTagRefMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceClassifyTagRef add(IntelligentRemindServiceClassifyTagRef serviceClassifyTagRef){
RpcAssert.assertNotNull(serviceClassifyTagRef, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertNotNull(serviceClassifyTagRef.getServiceId(), DefaultErrorEnum.PARAMETER_NULL, "智能提醒服务ID为空");
RpcAssert.assertNotNull(serviceClassifyTagRef.getClassifyTagId(), DefaultErrorEnum.PARAMETER_NULL, "服务分类标签ID为空");
try{
serviceClassifyTagRef.setCreatedDate(new Date());
serviceClassifyTagRef.setUpdatedDate(new Date());
serviceClassifyTagRef.setUpdatedBy(serviceClassifyTagRef.getCreatedBy());
serviceClassifyTagRef.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
intelligentRemindServiceClassifyTagRefMapper.insertUseGeneratedKeys(serviceClassifyTagRef);
return serviceClassifyTagRef;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public Integer deleteByServiceId(Long serviceId){
RpcAssert.assertNotNull(serviceId, DefaultErrorEnum.PARAMETER_NULL, "智能提醒服务ID为空");
try{
IntelligentRemindServiceClassifyTagRef serviceClassifyTagRef = new IntelligentRemindServiceClassifyTagRef();
serviceClassifyTagRef.setUpdatedDate(new Date());
serviceClassifyTagRef.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
Example example = new Example(IntelligentRemindServiceClassifyTagRef.class);
example.createCriteria().andEqualTo("serviceId", serviceId);
return intelligentRemindServiceClassifyTagRefMapper.updateByExampleSelective(serviceClassifyTagRef, example);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceClassifyTagMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
/**
* @Title: IntelligentRemindServiceClassifyTagService.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午12:12:43
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Service
public class IntelligentRemindServiceClassifyTagService {
@Autowired
private IntelligentRemindServiceClassifyTagMapper intelligentRemindServiceClassifyTagMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceClassifyTag add(IntelligentRemindServiceClassifyTag serviceClassifyTag){
RpcAssert.assertNotNull(serviceClassifyTag, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertNotNull(serviceClassifyTag.getMerchantId(), DefaultErrorEnum.PARAMETER_NULL, "商户号为空");
RpcAssert.assertNotEmpty(serviceClassifyTag.getClassifyTagName(), DefaultErrorEnum.PARAMETER_NULL, "标签名为空");
// 断言标签名唯一
assertUnique(serviceClassifyTag.getMerchantId(), serviceClassifyTag.getClassifyTagName());
try{
serviceClassifyTag.setOnCustom(StatusEnum.YES.getValue());
serviceClassifyTag.setCreatedDate(new Date());
serviceClassifyTag.setUpdatedDate(new Date());
serviceClassifyTag.setUpdatedBy(serviceClassifyTag.getCreatedBy());
serviceClassifyTag.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
intelligentRemindServiceClassifyTagMapper.insertUseGeneratedKeys(serviceClassifyTag);
return serviceClassifyTag;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public Boolean delete(Long classifyTagId){
RpcAssert.assertNotNull(classifyTagId, DefaultErrorEnum.PARAMETER_NULL, "标签ID为空");
try{
IntelligentRemindServiceClassifyTag serviceClassifyTag = new IntelligentRemindServiceClassifyTag();
serviceClassifyTag.setId(classifyTagId);
serviceClassifyTag.setUpdatedDate(new Date());
serviceClassifyTag.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
int result = intelligentRemindServiceClassifyTagMapper.updateByPrimaryKeySelective(serviceClassifyTag);
return result == 1;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public List<IntelligentRemindServiceClassifyTag> list(Integer merchantId){
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.PARAMETER_NULL, "商户号为空");
try{
List<IntelligentRemindServiceClassifyTag> list = new ArrayList<IntelligentRemindServiceClassifyTag>();
IntelligentRemindServiceClassifyTag condition = new IntelligentRemindServiceClassifyTag();
condition.setMerchantId(merchantId);
condition.setOnCustom(StatusEnum.YES.getValue());
condition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
// 商户自定义标签列表
List<IntelligentRemindServiceClassifyTag> customTagList = intelligentRemindServiceClassifyTagMapper.select(condition);
// 没有定义标签则获取默认标签
if(CollectionUtils.isEmpty(customTagList)){
condition = new IntelligentRemindServiceClassifyTag();
condition.setOnCustom(StatusEnum.NO.getValue());
condition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
// 默认标签列表
List<IntelligentRemindServiceClassifyTag> defaultTagList = intelligentRemindServiceClassifyTagMapper.select(condition);
list.addAll(defaultTagList);
}else{
list.addAll(customTagList);
}
return list;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public List<IntelligentRemindServiceClassifyTag> search(IntelligentRemindServiceClassifyTag condition) {
RpcAssert.assertNotNull(condition, DefaultErrorEnum.PARAMETER_NULL, "查询条件为空");
try{
return intelligentRemindServiceClassifyTagMapper.select(condition);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceClassifyTag getOneByCondition(IntelligentRemindServiceClassifyTag condition){
try{
return intelligentRemindServiceClassifyTagMapper.selectOne(condition);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<IntelligentRemindServiceClassifyTag> getByServiceId(Long serviceId){
try{
return intelligentRemindServiceClassifyTagMapper.getByServiceId(serviceId);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
/**
* 断言标签名唯一
* @param merchantId
* @param classifyTagName
* @author Alvin
* @date 2020年11月9日 下午2:25:33
*/
private void assertUnique(Integer merchantId, String classifyTagName){
IntelligentRemindServiceClassifyTag serviceClassifyTag = checkUnique(merchantId, classifyTagName);
// 判断标签名在本商户下是否已存在
RpcAssert.assertIsNull(serviceClassifyTag, DefaultErrorEnum.DATA_EXIST, "标签名称已存在");
IntelligentRemindServiceClassifyTag condition = new IntelligentRemindServiceClassifyTag();
condition.setOnCustom(StatusEnum.NO.getValue());
condition.setClassifyTagName(classifyTagName);
condition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
serviceClassifyTag = getOneByCondition(condition);
// 判断是否已存在非自定义标签名
RpcAssert.assertIsNull(serviceClassifyTag, DefaultErrorEnum.DATA_EXIST, "标签名称已存在");
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public IntelligentRemindServiceClassifyTag checkUnique(Integer merchantId, String classifyTagName){
IntelligentRemindServiceClassifyTag condition = new IntelligentRemindServiceClassifyTag();
condition.setMerchantId(merchantId);
condition.setOnCustom(StatusEnum.YES.getValue());
condition.setClassifyTagName(classifyTagName);
condition.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
return getOneByCondition(condition);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceClassifyTag checkAndAdd(IntelligentRemindServiceClassifyTag serviceClassifyTag){
RpcAssert.assertNotNull(serviceClassifyTag, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertNotNull(serviceClassifyTag.getMerchantId(), DefaultErrorEnum.PARAMETER_NULL, "商户号为空");
RpcAssert.assertNotEmpty(serviceClassifyTag.getClassifyTagName(), DefaultErrorEnum.PARAMETER_NULL, "标签名为空");
IntelligentRemindServiceClassifyTag old = checkUnique(serviceClassifyTag.getMerchantId(), serviceClassifyTag.getClassifyTagName());
if(old != null){
return old;
}
return add(serviceClassifyTag);
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceMaterialMapper;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
/**
* @author zhoudan
*/
@Service
public class IntelligentRemindServiceMaterialService {
Logger logger = LoggerFactory.getLogger(IntelligentRemindServiceMaterialService.class);
@Autowired
private IntelligentRemindServiceMaterialMapper remindServiceMaterialMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public IntelligentRemindServiceMaterial insert(IntelligentRemindServiceMaterial remindServiceMaterial) {
RpcAssert.assertNotNull(remindServiceMaterial, DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceMaterial is not null");
RpcAssert.assertNotNull(remindServiceMaterial.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceMaterial.getCreatedBy is not null");
try {
remindServiceMaterial.setUpdatedBy(remindServiceMaterial.getCreatedBy());
remindServiceMaterial.setCreatedDate(new Date());
remindServiceMaterial.setUpdatedDate(new Date());
remindServiceMaterial.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
remindServiceMaterialMapper.insertUseGeneratedKeys(remindServiceMaterial);
logger.info("insert remindServiceMaterial:{}", remindServiceMaterial);
return remindServiceMaterial;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* 通过服务id查询详情
* @param serviceId
* @return
* @throws RpcServiceException
*/
public List<IntelligentRemindServiceMaterial> getById(Integer serviceId) {
try {
List<IntelligentRemindServiceMaterial> res = remindServiceMaterialMapper.getById(serviceId);
logger.info("getById res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int update(IntelligentRemindServiceMaterial remindServiceMaterial) {
RpcAssert.assertNotNull(remindServiceMaterial, DefaultErrorEnum.DATA_NULL, "IntelligentRemindServiceMaterial is not null");
try {
return remindServiceMaterialMapper.update(remindServiceMaterial);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int deleteById(Integer id) {
try{
return remindServiceMaterialMapper.deleteById(id);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<IntelligentRemindServiceMaterial> getRemindServiceMaterialByRemindRuleId(Integer remindRuleId) {
Example exampleMaterial = new Example(IntelligentRemindServiceMaterial.class);
Example.Criteria criteria1 = exampleMaterial.createCriteria();
criteria1.andEqualTo("intelligentRemindServiceId",remindRuleId);
try{
return remindServiceMaterialMapper.selectByExample(exampleMaterial);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.mapper.IntelligentReminderMapper;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* IntelligentReminderService.java
* 智能提醒业务处理
* @author yangjia
* @date 2019/04/30
*/
@Service
public class IntelligentReminderService {
Logger logger = LoggerFactory.getLogger(IntelligentReminderService.class);
@Autowired
private IntelligentReminderMapper intelligentReminderMapper;
/**
* @param intelligentReminder
* @return void
* @Title: insertIntelligentReminder
* @Description: 插入智能提醒信息
* @author yangjia
* @Date: 2019/04/30
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public void insertIntelligentReminder(IntelligentReminder intelligentReminder) throws RpcServiceException {
try {
int res = intelligentReminderMapper.insertReminder(intelligentReminder);
logger.info("insertIntelligentReminder res:{}", res);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* @param id
* @return IntelligentReminder
* @Description: 根据id获取智能提醒信息
* @author yangjia
* @Date: 2019/04/30
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public IntelligentReminder getIntelligentReminderById(Long id) throws RpcServiceException {
try {
IntelligentReminder res = intelligentReminderMapper.getIntelligentReminderById(id);
logger.info("getIntelligentReminderById res:{}", res);
return res;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* @param pagination accountId 账户id
* @param pagination merchantId 商户id
* @Description: 该账户的提醒信息
* @author yangjia
* @date 2019/04/30
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public Page<IntelligentReminderDTO> selectByCondition(RpcPagination<IntelligentReminderDTO> pagination) throws RpcServiceException {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "pagination is no null");
RpcAssert.assertNotNull(pagination.getCondition(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition is no null");
if (pagination.getCondition() == null) {
logger.info("入参为空");
return null;
}
logger.info("分页参数=== {}, == {}", pagination.getPageNum(), pagination.getPageSize());
try {
Page<IntelligentReminderDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
List<IntelligentReminderDTO> list = intelligentReminderMapper.selectByCondition(pagination.getCondition());
logger.info("selectByCondition list:{}", list);
return page;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* @param intelligentReminder
* @return void
* @Description: 更新智能提醒信息
* @author yangjia
* @Date: 2019/04/30
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public void updateReminderByCondition(IntelligentReminder intelligentReminder) throws RpcServiceException {
RpcAssert.assertNotNull(intelligentReminder, DefaultErrorEnum.DATA_NULL, "id must not be null");
try {
int res = intelligentReminderMapper.updateReminderByCondition(intelligentReminder);
logger.info("updateReminderByCondition res:{}", res);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* @param id
* @return void
* @Description: 删除智能提醒信息
* @author yangjia
* @Date: 2019/04/30
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public void deleterReminderById(Long id) throws RpcServiceException {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id must not be null");
try {
int res = intelligentReminderMapper.deleterReminderById(id);
logger.info("deleterReminderById res:{}", res);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* @param reminderId 关联的活动优惠券id
* @return Integer
* @Description: 删除智能提醒信息
* @author yangjia
* @Date: 2019/04/30
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public Integer deleterReminderByReminderId(Integer reminderId) throws RpcServiceException {
RpcAssert.assertNotNull(reminderId, DefaultErrorEnum.DATA_NULL, "reminderId must not be null");
Integer res = 0;
try {
res = intelligentReminderMapper.deleterReminderByReminderId(reminderId);
logger.info("deleterReminderByReminderId res:{}", res);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
return res;
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.weapp.mapper.MerchantWeappNoticeMapper;
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
import cn.com.glsx.dj.wechat.enums.WechatCustomerTypeEnum;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
/**
* @Title: MerchantWeappNoticeService.java
* @Description: 小程序公告服务
* @author Alvin
* @date 2019年4月30日 下午9:36:02
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Service
public class MerchantWeappNoticeService {
@Autowired
private MerchantWeappNoticeMapper merchantWeappNoticeMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public MerchantWeappNotice merge(MerchantWeappNotice merchantWeappNotice) throws RpcServiceException{
RpcAssert.assertNotNull(merchantWeappNotice, DefaultErrorEnum.PARAMETER_NULL);
try{
MerchantWeappNotice oldmMerchantWeappNotice = null;
if(StringUtils.isNotEmpty(merchantWeappNotice.getNoticeSource()) && WechatCustomerTypeEnum.B.getValue().equals(merchantWeappNotice.getNoticeSource())){
// B端小程序系统公告
oldmMerchantWeappNotice = getPlatformNotice();
merchantWeappNotice.setMerchantId(null);
merchantWeappNotice.setAppId(null);
}else{
// C端小程序商户公告
oldmMerchantWeappNotice = getByMerchantId(merchantWeappNotice.getMerchantId());
merchantWeappNotice.setNoticeSource(WechatCustomerTypeEnum.C.getValue());
}
if(oldmMerchantWeappNotice == null){
merchantWeappNotice.setCreatedDate(new Date());
merchantWeappNotice.setUpdatedDate(new Date());
merchantWeappNotice.setDeletedFlag(DeletedFlagEnum.N.name());
merchantWeappNoticeMapper.insertUseGeneratedKeys(merchantWeappNotice);
}else{
merchantWeappNotice.setId(oldmMerchantWeappNotice.getId());
merchantWeappNotice.setUpdatedDate(new Date());
merchantWeappNoticeMapper.updateByPrimaryKeySelective(merchantWeappNotice);
}
return merchantWeappNotice;
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public MerchantWeappNotice getByMerchantId(Integer merchantId)throws RpcServiceException {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.PARAMETER_NULL, "merchantId is null");
try{
MerchantWeappNotice merchantWeappNotice = new MerchantWeappNotice();
merchantWeappNotice.setMerchantId(merchantId);
merchantWeappNotice.setDeletedFlag(DeletedFlagEnum.N.name());
return merchantWeappNoticeMapper.selectOne(merchantWeappNotice);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public MerchantWeappNotice getByAppId(String appId)throws RpcServiceException {
RpcAssert.assertNotEmpty(appId, DefaultErrorEnum.PARAMETER_NULL, "appId is null");
try{
MerchantWeappNotice merchantWeappNotice = new MerchantWeappNotice();
merchantWeappNotice.setAppId(appId);
merchantWeappNotice.setDeletedFlag(DeletedFlagEnum.N.name());
return merchantWeappNoticeMapper.selectOne(merchantWeappNotice);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = {RpcServiceException.class})
public MerchantWeappNotice getPlatformNotice(){
try{
MerchantWeappNotice merchantWeappNotice = new MerchantWeappNotice();
merchantWeappNotice.setNoticeSource(WechatCustomerTypeEnum.B.getValue());
merchantWeappNotice.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
return merchantWeappNoticeMapper.selectOne(merchantWeappNotice);
}catch(Exception e){
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e);
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.dj.weapp.enums.CacheKeyEnum;
import cn.com.glsx.dj.weapp.mapper.MerchantModuleMapper;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Title: MerchatModuleService
* @Description: 商户模块业务层
* @author yangjia
*/
@Service
public class MerchatModuleService {
Logger logger = LoggerFactory.getLogger(MerchatModuleService.class);
@Autowired
private MerchantModuleMapper merchantModuleMapper;
@Autowired
private RedisTemplate<String,Object> redisTemplate;
@Autowired
private WeappModuleService weappModuleService;
/**
* @Title: listMerchantModuleById
* @Description: 分页获取某商户某模块可展示的子模块
* @param merchantId
* @param moduleId
* @return Page<MerchantModuleDTO>
* @author yangjia
* @Date: 2019/04/29
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public Page<MerchantModuleDTO> listMerchantModuleById(Integer merchantId, Long moduleId) throws RpcServiceException{
RpcAssert.assertNotNull(merchantId,DefaultErrorEnum.DATA_NULL,"merchantId must not be null");
RpcAssert.assertNotNull(moduleId,DefaultErrorEnum.DATA_NULL,"moduleId must not be null");
try {
Page<MerchantModuleDTO> merchantModuleDTOPage = merchantModuleMapper.listMerchantModuleById(merchantId,moduleId);
//若某商户下未配置任何模块权限,则显示该模块下所有子模块 update at 2019/05/10
if(merchantModuleDTOPage.getTotal() == 0){
merchantModuleDTOPage = merchantModuleMapper.listAllMerchantModule(moduleId);
}
return merchantModuleDTOPage;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: insertMerchantModule
* @Description: 批量插入商户模块信息
* @param weappMerchantModules
* @return void
* @author yangjia
* @Date: 2019/04/29
*/
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {RpcServiceException.class})
public void insertMerchantModule(List<MerchantModule> weappMerchantModules) throws RpcServiceException{
try {
for(MerchantModule merchantModule : weappMerchantModules){
merchantModuleMapper.insertMerchantModule(merchantModule);
}
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: updateWeappMerchantModule
* @Description: 批量修改商户模块信息
* @param merchantModules
* @return void
* @author yangjia
* @Date: 2019/04/29
*/
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {RpcServiceException.class})
public void updateMerchantModule(List<MerchantModule> merchantModules) throws RpcServiceException{
MerchantModule merchantMo = merchantModules.get(0);
logger.info("updateWeappMerchantModule merchantMo:{}",merchantMo);
RpcAssert.assertNotNull(merchantMo.getMerchantId(), DefaultErrorEnum.DATA_NULL,"商户ID不能为空");
try {
Integer merchantId = merchantMo.getMerchantId();
cleanMerchantModuleCache(merchantId);
// 删除旧的商户模块数据
MerchantModule we = new MerchantModule();
we.setMerchantId(merchantId);
merchantModuleMapper.deleteMerchantModules(we);
// 重新插入更新数据
for(MerchantModule merchantModule : merchantModules){
merchantModuleMapper.insertMerchantModule(merchantModule);
}
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: listAllMerchantModuleByMerchantId
* @Description: 查询某商户下所有的模块信息
* @param merchantId
* @return List<MerchantModule>
* @author yangjia
* @Date: 2019/04/28
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public List<MerchantModule> listAllMerchantModuleByMerchantId(Integer merchantId,String deleteFlag) throws RpcServiceException{
try {
return merchantModuleMapper.listAllMerchantModuleByMerchantId(merchantId,deleteFlag);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: cleanMerchantModuleCache
* @Description: 清空商户模块缓存
* @param merchantId 商户ID
* @author yangjia
* @Date: 2019/04/29
*/
public Boolean cleanMerchantModuleCache(Integer merchantId){
Page<MerchantModule> merchantModulePage = merchantModuleMapper.listAllMerchantModuleByMerchantId(merchantId,null);
if(merchantModulePage.getResult() != null && merchantModulePage.size() > 0){
List<MerchantModule> merchantModuleList = merchantModulePage.getResult();
for(MerchantModule weappMerchantModule: merchantModuleList){
Integer id = weappMerchantModule.getModuleId();
if(id != null){
String key = CacheKeyEnum.GET_WEAPP_MERCHANT_MODULE_BY_ID.getValue().concat(merchantId.toString()+id);
if(redisTemplate.opsForValue().get(key) != null){
redisTemplate.delete(key);
}
WeappModule wm = weappModuleService.getModuleInfoById(id.longValue());
if(wm != null && wm.getModuleAlias() != null){
String key2 = CacheKeyEnum.GET_WEAPP_MODULE_BY_ALIAS.getValue().concat(wm.getModuleAlias());
Object obj = redisTemplate.opsForValue().get(key2);
if(obj != null){
redisTemplate.delete(key2);
}
}
}
}
return true;
}
return false;
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.framework.core.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import cn.com.glsx.dj.weapp.dto.PageVisitDTO;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.util.RpcAssert;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @Title: PageVisitCollectService.java
* @Description:
* @author zengqi
* @date 2021年6月4日 下午4:45:41
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Service
public class PageVisitCollectService {
private final String PAGE_VISIT_COLLECT_CACHE_KEY_PREFIX = "pvc:";
private final String PAGE_CURRENT_VISIT_COLLECT_CACHE_KEY_PREFIX = "cpvc:";
public static final String PAGE_CURRENT_KEY_COLLECT_CACHE_KEY_PREFIX = "current_day_visit_page_keys_list:";
public static final String PAGE_APP_VISIT_ZSET_KEY = "page_visit_zset_key:";
@Autowired
private RedisTemplate<String, Object> redisTemplate;
public Long collect(PageVisitDTO pageVisit){
return collect(pageVisit, 1L);
}
/**
* get current day visit count
* @param pageVisit
* @return
*/
public Map<String,Long> getCount(PageVisitDTO pageVisit,String startDate,String endDate){
RpcAssert.assertNotNull(pageVisit, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertNotEmpty(pageVisit.getAppId(), DefaultErrorEnum.PARAMETER_NULL, "appId is null");
RpcAssert.assertNotEmpty(pageVisit.getPath(), DefaultErrorEnum.PARAMETER_NULL, "path is null");
Map<String,Long> map = new HashMap<>();
String page = pageVisit.getPath().replace("/", "_");
Long min = 0L;
Long max = new Date().getTime();
if (startDate != null){
min = DateUtils.parseDate(startDate).getTime();
}
if (endDate != null){
max = DateUtils.parseDate(endDate).getTime();
}
String key = PAGE_VISIT_COLLECT_CACHE_KEY_PREFIX.concat(pageVisit.getAppId()).concat(":").concat(page); // total key
String key2 = PAGE_CURRENT_VISIT_COLLECT_CACHE_KEY_PREFIX.concat(pageVisit.getAppId()).concat(":").concat(page); // current key
map.put("currentAppCount",redisTemplate.opsForValue().increment(key2.concat(":a"), 0L));
map.put("totalAppCount",redisTemplate.opsForValue().increment(key.concat(":a"), 0L));
map.put("rangeAppCount",countBySet(redisTemplate.opsForZSet().rangeByScore(PAGE_APP_VISIT_ZSET_KEY.concat(key2).concat(":a"),min,max)));
if (pageVisit.getMerchantId() != null){
map.put("currentMerchantCount",redisTemplate.opsForHash().increment(key2.concat(":m"), String.valueOf(pageVisit.getMerchantId()), 0L));
map.put("totalMerchantCount",redisTemplate.opsForHash().increment(key.concat(":m"), String.valueOf(pageVisit.getMerchantId()), 0L));
map.put("rangeMerchantCount",countBySet(redisTemplate.opsForZSet().rangeByScore(PAGE_APP_VISIT_ZSET_KEY.concat(key2).concat(":m").concat(":").concat(String.valueOf(pageVisit.getMerchantId())),min,max)));
}
return map;
}
private Long countBySet(Set<Object> set1){
Long total = 0L;
if (set1 != null ){
for (Object o : set1) {
Long value = Long.valueOf(o.toString().split(":")[1]);
total += value;
}
}
return total;
}
/**
* page visit count
* @param pageVisit
* @param delta
* @return current day visit count
*/
private Long collect(PageVisitDTO pageVisit, Long delta){
RpcAssert.assertNotNull(pageVisit, DefaultErrorEnum.PARAMETER_NULL);
RpcAssert.assertNotEmpty(pageVisit.getAppId(), DefaultErrorEnum.PARAMETER_NULL, "appId is null");
RpcAssert.assertNotEmpty(pageVisit.getPath(), DefaultErrorEnum.PARAMETER_NULL, "path is null");
String page = pageVisit.getPath().replace("/", "_");
String key = PAGE_VISIT_COLLECT_CACHE_KEY_PREFIX.concat(pageVisit.getAppId()).concat(":").concat(page);
String currKey = PAGE_CURRENT_VISIT_COLLECT_CACHE_KEY_PREFIX.concat(pageVisit.getAppId()).concat(":").concat(page);
Long result = redisTemplate.opsForValue().increment(currKey.concat(":a"), delta); // current +1
redisTemplate.opsForValue().increment(key.concat(":a"), delta); // total +1
redisTemplate.opsForSet().add(PAGE_CURRENT_KEY_COLLECT_CACHE_KEY_PREFIX,currKey); // save currKey
if(pageVisit.getMerchantId() == null){
return result;
}
redisTemplate.opsForHash().increment(key.concat(":m"), String.valueOf(pageVisit.getMerchantId()), delta); // total merchantId +1
return redisTemplate.opsForHash().increment(currKey.concat(":m"), String.valueOf(pageVisit.getMerchantId()), delta); // current merchantId +1
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.mapper.QrCodeManageMapper;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@Service
public class QrCodeManageService {
Logger logger = LoggerFactory.getLogger(QrCodeManageService.class);
@Autowired
private QrCodeManageMapper qrCodeManageMapper;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public QrCodeManage insert(QrCodeManage qrCodeManage) {
RpcAssert.assertNotNull(qrCodeManage, DefaultErrorEnum.DATA_NULL, "二维码对象不能为空!");
RpcAssert.assertNotNull(qrCodeManage.getQrcodeUrl(), DefaultErrorEnum.DATA_NULL, "二维码地址不能为空!");
try {
Date now = new Date();
qrCodeManage.setUpdatedBy(qrCodeManage.getCreatedBy());
qrCodeManage.setCreatedDate(now);
qrCodeManage.setUploadDate(now);
qrCodeManage.setUpdatedDate(now);
qrCodeManage.setDeletedFlag(DeletedFlagEnum.N.name());
qrCodeManageMapper.insertUseGeneratedKeys(qrCodeManage);
logger.info("insert qrCodeManage:{}", qrCodeManage);
return qrCodeManage;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public QrCodeManage getById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id不能为空!");
try {
return qrCodeManageMapper.getById(id);
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public QrCodeManage getByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId不能为空!");
try {
QrCodeManage res = qrCodeManageMapper.getByMerchantId(merchantId);
logger.info("getByMerchantId res:{}", res);
return res;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public int update(QrCodeManage qrCodeManage) {
RpcAssert.assertNotNull(qrCodeManage, DefaultErrorEnum.DATA_NULL, "更新对象不能为空!");
try {
qrCodeManage.setUploadDate(new Date());
return qrCodeManageMapper.update(qrCodeManage);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, DefaultErrorEnum.DATABASE_ERROR.getDisplayName());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.mapper.UserAddressMapper;
import cn.com.glsx.dj.weapp.model.UserAddress;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
/**
* @Title UserAddressService
* @Description
* @Author zhaojp
* @Date 2020年06月08日 17:59:42
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
@Service
public class UserAddressService {
private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
@Autowired
private UserAddressMapper userAddressMapper;
@Transactional(propagation= Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public UserAddress insert(UserAddress userAddress) {
RpcAssert.assertNotNull(userAddress, DefaultErrorEnum.DATA_NULL, "userAddress is not null");
RpcAssert.assertNotNull(userAddress.getName(), DefaultErrorEnum.DATA_NULL, "userAddress.getName is not null");
RpcAssert.assertNotNull(userAddress.getPhone(), DefaultErrorEnum.DATA_NULL, "userAddress.getPhone is not null");
RpcAssert.assertNotNull(userAddress.getOpenId(), DefaultErrorEnum.DATA_NULL, "userAddress.getOpenId is not null");
RpcAssert.assertNotNull(userAddress.getAccountId(), DefaultErrorEnum.DATA_NULL, "userAddress.getAccountId is not null");
RpcAssert.assertNotNull(userAddress.getProvinceName(), DefaultErrorEnum.DATA_NULL, "userAddress.getProvinceName is not null");
RpcAssert.assertNotNull(userAddress.getCityName(), DefaultErrorEnum.DATA_NULL, "userAddress.getCityName is not null");
RpcAssert.assertNotNull(userAddress.getAreaName(), DefaultErrorEnum.DATA_NULL, "userAddress.getAreaName is not null");
RpcAssert.assertNotNull(userAddress.getAddress(), DefaultErrorEnum.DATA_NULL, "userAddress.getAddress is not null");
RpcAssert.assertNotNull(userAddress.getLng(), DefaultErrorEnum.DATA_NULL, "userAddress.getLng is not null");
RpcAssert.assertNotNull(userAddress.getLat(), DefaultErrorEnum.DATA_NULL, "userAddress.getLat is not null");
RpcAssert.assertNotNull(userAddress.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "userAddress.getCreatedBy is not null");
try {
if(userAddress.getIsDefault() == null){
userAddress.setIsDefault(StatusEnum.NO.getValue());
}else if(userAddress.getIsDefault().equals(StatusEnum.YES.getValue())){
this.updateOtherDefaultN();
}
userAddress.setUpdatedBy(userAddress.getCreatedBy());
userAddress.setCreatedDate(new Date());
userAddress.setUpdatedDate(new Date());
userAddress.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
userAddressMapper.insertUseGeneratedKeys(userAddress);
return userAddress;
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void updateOtherDefaultN() {
try {
UserAddress userAddress = new UserAddress();
userAddress.setIsDefault(StatusEnum.NO.getValue());
userAddress.setUpdatedDate(new Date());
Example example = new Example(UserAddress.class);
example.createCriteria().andEqualTo("deletedFlag","N");
userAddressMapper.updateByExampleSelective(userAddress,example);
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public UserAddress update(UserAddress userAddress) {
RpcAssert.assertNotNull(userAddress, DefaultErrorEnum.DATA_NULL, "userAddress is not null");
RpcAssert.assertNotNull(userAddress.getId(), DefaultErrorEnum.DATA_NULL, "userAddress.getId is not null");
RpcAssert.assertNotNull(userAddress.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "userAddress.getUpdatedBy is not null");
try {
if(userAddress.getIsDefault().equals(StatusEnum.YES.getValue())){
this.updateOtherDefaultN();
}
userAddress.setUpdatedDate(new Date());
userAddressMapper.updateByPrimaryKeySelective(userAddress);
return userAddress;
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public UserAddress getById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id is not null");
try {
UserAddress userAddress = new UserAddress();
userAddress.setId(id);
userAddress.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
userAddress = userAddressMapper.selectOne(userAddress);
return userAddress;
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
public List<UserAddress> selectList(UserAddress userAddress) {
RpcAssert.assertNotNull(userAddress, DefaultErrorEnum.DATA_NULL, "userAddress is not null");
try {
List<UserAddress> result = userAddressMapper.list(userAddress);
return result;
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public Integer deleteById(Integer id) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id is not null");
try {
UserAddress userAddress = new UserAddress();
userAddress.setId(id);
userAddress.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
return userAddressMapper.updateByPrimaryKeySelective(userAddress);
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import cn.com.glsx.dj.weapp.dto.VpFocusUserDTO;
import cn.com.glsx.dj.weapp.mapper.VpFocusUserMapper;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpFocusUserService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpFocusUserMapper focusUserMapper;
public Page<VpFocusUserDTO> listWithPage(RpcPagination<VpFocusUserDTO> pagination){
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "pagination is no null");
RpcAssert.assertNotNull(pagination.getCondition(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition is no null");
try {
Page<VpFocusUserDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
focusUserMapper.list(pagination.getCondition());
return page;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public VpFocusUser focus(VpFocusUser focusUser){
RpcAssert.assertNotNull(focusUser, DefaultErrorEnum.DATA_NULL, "VpFocusUser is no null");
RpcAssert.assertNotNull(focusUser.getUserId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.userId is no null");
RpcAssert.assertNotNull(focusUser.getMerchantId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.merchantId is no null");
RpcAssert.assertNotNull(focusUser.getFocusedUserId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.focusedUserId is no null");
RpcAssert.assertNotNull(focusUser.getFocusedMerchantId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.focusedMerchantId is no null");
RpcAssert.assertNotEmpty(focusUser.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.createdBy is no null");
logger.info("focus:{}",focusUser);
try {
if(focusUser.getUserId() == -1 || focusUser.getMerchantId() == -1){
throw new RpcServiceException("参数无效");
}
if(focusUser.getMerchantId().intValue() == focusUser.getFocusedMerchantId()){
throw new RpcServiceException("所属同一商户不能相互关注");
}
Date now = new Date();
VpFocusUser old = get(focusUser.getUserId(), focusUser.getFocusedUserId());
if(old == null){
focusUser.setStatus(StatusEnum.YES.getValue());
focusUser.setCreatedDate(now);
focusUser.setUpdatedDate(now);
focusUser.setUpdatedBy(focusUser.getCreatedBy());
focusUser.setDeletedFlag(DeletedFlagEnum.N.name());
focusUserMapper.insertUseGeneratedKeys(focusUser);
return focusUser;
}
if(StatusEnum.YES.getValue().equals(old.getStatus())){
throw new RpcServiceException("您已经关注过了,请勿重复关注");
}
old.setMerchantId(focusUser.getMerchantId());
old.setFocusedMerchantId(focusUser.getFocusedMerchantId());
old.setStatus(StatusEnum.YES.getValue());
old.setUpdatedDate(now);
old.setUpdatedBy(focusUser.getCreatedBy());
focusUserMapper.updateByPrimaryKeySelective(old);
return old;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public VpFocusUser cancelFocus(VpFocusUser focusUser){
RpcAssert.assertNotNull(focusUser, DefaultErrorEnum.DATA_NULL, "VpFocusUser is no null");
RpcAssert.assertNotNull(focusUser.getUserId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.userId is no null");
RpcAssert.assertNotNull(focusUser.getFocusedUserId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.focusedUserId is no null");
RpcAssert.assertNotEmpty(focusUser.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.createdBy is no null");
logger.info("cancelFocus:{}",focusUser);
try {
if(focusUser.getUserId() == -1){
throw new RpcServiceException("参数无效");
}
Date now = new Date();
VpFocusUser old = get(focusUser.getUserId(), focusUser.getFocusedUserId());
if(old == null){
throw new RpcServiceException("您尚未关注该用户,无法取消关注");
}
if(StatusEnum.NO.getValue().equals(old.getStatus())){
throw new RpcServiceException("您已经取消关注了,无法再次取消关注");
}
old.setStatus(StatusEnum.NO.getValue());
old.setUpdatedDate(now);
old.setUpdatedBy(focusUser.getCreatedBy());
focusUserMapper.updateByPrimaryKeySelective(old);
return old;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public VpFocusUser get(Integer userId,Integer focusedUserId){
RpcAssert.assertNotNull(userId, DefaultErrorEnum.DATA_NULL, "userId is no null");
RpcAssert.assertNotNull(focusedUserId, DefaultErrorEnum.DATA_NULL, "focusedUserId is no null");
try {
VpFocusUserDTO info = new VpFocusUserDTO();
info.setUserId(userId);
info.setFocusedUserId(focusedUserId);
List<VpFocusUserDTO> list = focusUserMapper.list(info);
if(CollectionUtils.isEmpty(list)){
return null;
}
return list.get(0);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public boolean isFocus(Integer userId, Integer focusedUserId){
VpFocusUser focusUser = this.get(userId, focusedUserId);
if(focusUser != null && StatusEnum.YES.getValue().equals(focusUser.getStatus())){
return true;
}
return false;
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.weapp.mapper.VpMaterialCarSeriesMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialCarSeries;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import tk.mybatis.mapper.entity.Example;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpMaterialCarSeriesService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialCarSeriesMapper vpMaterialCarSeriesMapper;
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void insertList(List<VpMaterialCarSeries> list){
RpcAssert.assertNotEmpty(list, DefaultErrorEnum.DATA_NULL, "list must not be null");
try{
vpMaterialCarSeriesMapper.insertList(list);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void deleteByMaterialId(Integer materialId,String updatedBy,Date updatedDate){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not be null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy must not be empty");
RpcAssert.assertNotNull(updatedDate, DefaultErrorEnum.DATA_NULL, "updatedDate must not be null");
try{
VpMaterialCarSeries info = new VpMaterialCarSeries();
info.setMaterialId(materialId);
info.setUpdatedBy(updatedBy);
info.setUpdatedDate(updatedDate);
info.setDeletedFlag(DeletedFlagEnum.D.name());
Example example = new Example(VpMaterialCarSeries.class);
example.createCriteria().andEqualTo("materialId", info.getMaterialId())
.andEqualTo("deletedFlag", DeletedFlagEnum.N.name());
vpMaterialCarSeriesMapper.updateByExampleSelective(info, example);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<VpMaterialCarSeries> getByMaterialId(Integer materialId){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not ne null");
try{
VpMaterialCarSeries res = new VpMaterialCarSeries();
res.setMaterialId(materialId);
res.setDeletedFlag(DeletedFlagEnum.N.name());
return vpMaterialCarSeriesMapper.select(res);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.util.StringUtil;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.mapper.VpMaterialCollectMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import tk.mybatis.mapper.entity.Example;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpMaterialCollectService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialCollectMapper vpMaterialCollectMapper;
@Autowired
private VpMaterialInfoService vpMaterialInfoService;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public VpMaterialCollect collect(VpMaterialCollect collect){
RpcAssert.assertNotNull(collect, DefaultErrorEnum.DATA_NULL, "VpMaterialCollect is no null");
RpcAssert.assertNotNull(collect.getUserId(), DefaultErrorEnum.DATA_NULL, "VpMaterialCollect.userId is no null");
RpcAssert.assertNotNull(collect.getMerchantId(), DefaultErrorEnum.DATA_NULL, "VpMaterialCollect.merchantId is no null");
RpcAssert.assertNotNull(collect.getMaterialId(), DefaultErrorEnum.DATA_NULL, "VpFocusUser.materialId is no null");
RpcAssert.assertNotEmpty(collect.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialCollect.createdBy is no null");
logger.info("collect:{}",collect);
try {
VpMaterialInfoDTO vpMaterialInfo = vpMaterialInfoService.getAllById(collect.getMaterialId());
if(vpMaterialInfo == null){
throw new RpcServiceException("收藏失败!视频素材不存在");
}
// if(StringUtil.isEmpty(vpMaterialInfo.getOnlineFlag()) || !vpMaterialInfo.getOnlineFlag().equals(StatusEnum.YES.getValue())){
// throw new RpcServiceException("收藏失败!视频素材未发布");
// }
if(collect.getMerchantId().intValue() == vpMaterialInfo.getMerchantId()){
throw new RpcServiceException("收藏失败!所属同一商户不能相互收藏");
}
Date now = new Date();
VpMaterialCollect old = get(collect.getMerchantId(), collect.getMaterialId());
if(old == null){
collect.setStatus(StatusEnum.YES.getValue());
collect.setCreatedDate(now);
collect.setUpdatedDate(now);
collect.setUpdatedBy(collect.getCreatedBy());
collect.setDeletedFlag(DeletedFlagEnum.N.name());
vpMaterialCollectMapper.insertUseGeneratedKeys(collect);
copyMaterialInfo(collect, vpMaterialInfo);
return collect;
}
if(StatusEnum.YES.getValue().equals(old.getStatus())){
throw new RpcServiceException("收藏失败!所属商户已经收藏过了");
}
old.setMerchantId(collect.getMerchantId());
old.setStatus(StatusEnum.YES.getValue());
old.setUpdatedDate(now);
old.setUpdatedBy(collect.getCreatedBy());
vpMaterialCollectMapper.updateByPrimaryKeySelective(old);
copyMaterialInfo(collect, vpMaterialInfo);
return old;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public void copyMaterialInfo(VpMaterialCollect collect,VpMaterialInfoDTO vpMaterialInfo){
vpMaterialInfo.setUserId(collect.getUserId());
vpMaterialInfo.setMerchantId(collect.getMerchantId());
vpMaterialInfo.setOriginalMaterialId(vpMaterialInfo.getId());
vpMaterialInfo.setId(null);
vpMaterialInfo.setOnlineFlag(StatusEnum.NO.getValue());
vpMaterialInfoService.insert(vpMaterialInfo);
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {RpcServiceException.class})
public void cancelCollectByMaterialId(VpMaterialCollect collect){
RpcAssert.assertNotNull(collect, DefaultErrorEnum.DATA_NULL, "VpMaterialCollect must not ne null");
RpcAssert.assertNotNull(collect.getMaterialId(), DefaultErrorEnum.DATA_NULL, "VpMaterialCollect.materialId must not be null");
RpcAssert.assertNotEmpty(collect.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialCollect.updatedBy must not be empty");
try{
if(collect.getUpdatedDate() == null){
collect.setUpdatedDate(new Date());
}
collect.setStatus(StatusEnum.NO.getValue());
Example example = new Example(VpMaterialCollect.class);
example.createCriteria().andEqualTo("materialId", collect.getMaterialId())
.andEqualTo("status", StatusEnum.YES.getValue())
.andEqualTo("deletedFlag", DeletedFlagEnum.N.name());
vpMaterialCollectMapper.updateByExampleSelective(collect, example);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public VpMaterialCollect get(Integer merchantId,Integer materialId){
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL, "merchantId is no null");
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId is no null");
try {
VpMaterialCollect info = new VpMaterialCollect();
info.setMerchantId(merchantId);
info.setMaterialId(materialId);
info.setDeletedFlag(DeletedFlagEnum.N.name());
return vpMaterialCollectMapper.selectOne(info);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public boolean isCollect(Integer merchantId, Integer materialId){
VpMaterialCollect collect = this.get(merchantId, materialId);
if(collect != null && StatusEnum.YES.getValue().equals(collect.getStatus())){
return true;
}
return false;
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import java.util.List;
import org.oreframework.util.lang.EmojiUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.weapp.mapper.VpMaterialDescriptionMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import tk.mybatis.mapper.entity.Example;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpMaterialDescriptionService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialDescriptionMapper vpMaterialDescriptionMapper;
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void insertList(List<VpMaterialDescription> list){
RpcAssert.assertNotEmpty(list, DefaultErrorEnum.DATA_NULL, "list must not be null");
try{
list.stream().forEach(item ->{
item.setContent(EmojiUtil.filterEmoji(item.getContent()));
});
vpMaterialDescriptionMapper.insertList(list);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void deleteByMaterialId(Integer materialId, String updatedBy,Date updatedDate){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not be null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy must not be empty");
RpcAssert.assertNotNull(updatedDate, DefaultErrorEnum.DATA_NULL, "updatedDate must not be null");
try{
VpMaterialDescription description = new VpMaterialDescription();
description.setMaterialId(materialId);
description.setUpdatedBy(updatedBy);
description.setUpdatedDate(updatedDate);
description.setDeletedFlag(DeletedFlagEnum.D.name());
Example example = new Example(VpMaterialDescription.class);
example.createCriteria().andEqualTo("materialId", description.getMaterialId())
.andEqualTo("deletedFlag", DeletedFlagEnum.N.name());
vpMaterialDescriptionMapper.updateByExampleSelective(description, example);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<VpMaterialDescription> getByMaterialId(Integer materialId){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not be null");
try{
VpMaterialDescription condition = new VpMaterialDescription();
condition.setMaterialId(materialId);
return vpMaterialDescriptionMapper.list(condition);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.oreframework.util.lang.EmojiUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import cn.com.glsx.dj.car.boutique.dto.CarBoutiqueDTO;
import cn.com.glsx.dj.car.boutique.enums.CarBoutiqueEnum;
import cn.com.glsx.dj.car.boutique.model.CarBoutiqueDescription;
import cn.com.glsx.dj.car.boutique.model.CarBoutiqueImg;
import cn.com.glsx.dj.car.boutique.model.CarBoutiqueLabel;
import cn.com.glsx.dj.car.boutique.remote.CarBoutiqueRemote;
import cn.com.glsx.dj.system.enums.ConfGroupEnum;
import cn.com.glsx.dj.system.model.Config;
import cn.com.glsx.dj.system.remote.ConfigRemote;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum.BizType;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum.ResourceType;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum.VideoStatus;
import cn.com.glsx.dj.weapp.manager.SubmitTransMediaManager;
import cn.com.glsx.dj.weapp.mapper.VpMaterialInfoMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpMaterialInfoService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialInfoMapper vpMaterialInfoMapper;
@Autowired
private VpMaterialResourceService vpMaterialResourceService;
@Autowired
private VpMaterialCollectService vpMaterialCollectService;
@Autowired
private VpMaterialCarSeriesService vpMaterialCarSeriesService;
@Autowired
private VpMaterialDescriptionService vpMaterialDescriptionService;
@Autowired
private CarBoutiqueRemote carBoutiqueRemote;
@Autowired
private ConfigRemote configRemote;
@Autowired
private SubmitTransMediaManager submitTransMediaManager;
private VpMaterialInfoDTO changeOtherInfo(VpMaterialInfoDTO record){
if(record == null || record.getId() == null){
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR);
}
BaseModel orig = new BaseModel();
orig.setUpdatedBy(record.getUpdatedBy());
orig.setUpdatedDate(record.getUpdatedDate());
orig.setCreatedBy(record.getUpdatedBy());
orig.setCreatedDate(record.getUpdatedDate());
orig.setDeletedFlag(DeletedFlagEnum.N.name());
if(CollectionUtils.isNotEmpty(record.getTplResList())){
int size = record.getTplResList().size();
for(int i=0;i<size;i++){
VpMaterialResource item = record.getTplResList().get(i);
BeanUtils.copyProperties(orig, item);
item.setMaterialId(record.getId());
item.setBizType(VideoPlusEnum.BizType.TEMPLATE_RES.getValue());
item.setBizNum((byte)i);
}
}
if(CollectionUtils.isNotEmpty(record.getPmpResList())){
int size = record.getPmpResList().size();
for(int i=0;i<size;i++){
VpMaterialResource item = record.getPmpResList().get(i);
BeanUtils.copyProperties(orig, item);
item.setMaterialId(record.getId());
item.setBizType(VideoPlusEnum.BizType.PRODUCT_MAIN_PHOTO.getValue());
item.setResType(ResourceType.IMAGE.getValue());
item.setBizNum((byte)i);
}
}
if(CollectionUtils.isNotEmpty(record.getCarSeriesList())){
record.getCarSeriesList().forEach((item) -> {
BeanUtils.copyProperties(orig, item);
item.setMaterialId(record.getId());
});
}
if(CollectionUtils.isNotEmpty(record.getDescriptionList())){
int size = record.getDescriptionList().size();
for(int index=0;index<size;index++){
VpMaterialDescription item = record.getDescriptionList().get(index);
BeanUtils.copyProperties(orig, item);
item.setMaterialId(record.getId());
item.setSort((short)index);
}
}
return record;
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfoDTO insert(VpMaterialInfoDTO record){
RpcAssert.assertNotNull(record, DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO is no null");
RpcAssert.assertNotNull(record.getUserId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.userId is no null");
RpcAssert.assertNotNull(record.getMerchantId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.merchantId is no null");
RpcAssert.assertNotNull(record.getTemplateNum(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.templateNum is no null");
RpcAssert.assertNotEmpty(record.getName(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.name is no null");
RpcAssert.assertNotNull(record.getType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.type is no null");
RpcAssert.assertNotNull(record.getSubType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.subType is no null");
RpcAssert.assertNotEmpty(record.getTplResList(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.tplResList is no empty");
RpcAssert.assertNotEmpty(record.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.createdBy is no null");
logger.info("insert:{}",record);
try {
Date now = new Date();
if(record.getOriginalMaterialId() == null){
record.setOnlineFlag(StatusEnum.NO.getValue());
record.setVideoStatus(VideoPlusEnum.VideoStatus.COMPOSITING.getValue());
if(StringUtils.isBlank(record.getVideoMuteFlag())){
record.setVideoMuteFlag(StatusEnum.NO.getValue());
}
}
record.setName(EmojiUtil.filterEmoji(record.getName()));
record.setCopywriting(EmojiUtil.filterEmoji(record.getCopywriting()));
record.setLabelName(EmojiUtil.filterEmoji(record.getLabelName()));
record.setUpdatedBy(record.getCreatedBy());
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(DeletedFlagEnum.N.name());
vpMaterialInfoMapper.insertUseGeneratedKeys(record);
changeOtherInfo(record);
if(CollectionUtils.isNotEmpty(record.getTplResList())){
vpMaterialResourceService.insertList(record.getTplResList());
}
if(CollectionUtils.isNotEmpty(record.getPmpResList())){
vpMaterialResourceService.insertList(record.getPmpResList());
}
if(CollectionUtils.isNotEmpty(record.getCarSeriesList())){
vpMaterialCarSeriesService.insertList(record.getCarSeriesList());
}
if(CollectionUtils.isNotEmpty(record.getDescriptionList())){
vpMaterialDescriptionService.insertList(record.getDescriptionList());
}
submitTransMediaManager.getPost(record);
return record;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfoDTO updateNotRebuildVideo(VpMaterialInfoDTO record){
RpcAssert.assertNotNull(record, DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO is no null");
RpcAssert.assertNotNull(record.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.id is no null");
RpcAssert.assertNotEmpty(record.getName(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.name is no null");
RpcAssert.assertNotNull(record.getType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.type is no null");
RpcAssert.assertNotNull(record.getSubType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.subType is no null");
RpcAssert.assertNotEmpty(record.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.createdBy is no null");
logger.info("updateNotRebuildVideo:{}",record);
try {
VpMaterialInfo old = this.getBaseById(record.getId());
if(old == null){
throw new RpcServiceException("视频不存在或已删除");
}
//不重建视频,不能修改合成视频的属性
record.setLabelName(EmojiUtil.filterEmoji(record.getLabelName()));
record.setUserId(old.getUserId());
record.setMerchantId(old.getMerchantId());
record.setTemplateNum(old.getTemplateNum());
record.setLogoUrl(old.getLogoUrl());
record.setBannerImgUrl(old.getBannerImgUrl());
record.setBtmBannerImgUrl(old.getBtmBannerImgUrl());
record.setMusicUrl(old.getMusicUrl());
record.setMusicId(old.getMusicId());
record.setVideoMuteFlag(old.getVideoMuteFlag());
record.setVideoCoverUrl(old.getVideoCoverUrl());
record.setOnlineFlag(old.getOnlineFlag());
record.setVideoStatus(old.getVideoStatus());
record.setOriginalMaterialId(old.getOriginalMaterialId());
record.setVideoUrl(old.getVideoUrl());
record.setCreatedBy(old.getCreatedBy());
record.setCreatedDate(old.getCreatedDate());
record.setUpdatedDate(new Date());
record.setDeletedFlag(DeletedFlagEnum.N.name());
vpMaterialInfoMapper.updateByPrimaryKey(record);
changeOtherInfo(record);
vpMaterialResourceService.deleteByMaterialIdAndBizType(record.getId(),BizType.PRODUCT_MAIN_PHOTO,record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getPmpResList())){
vpMaterialResourceService.insertList(record.getPmpResList());
}
vpMaterialCarSeriesService.deleteByMaterialId(record.getId(), record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getCarSeriesList())){
vpMaterialCarSeriesService.insertList(record.getCarSeriesList());
}
vpMaterialDescriptionService.deleteByMaterialId(record.getId(), record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getDescriptionList())){
vpMaterialDescriptionService.insertList(record.getDescriptionList());
}
return record;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfoDTO updateRebuildVideo(VpMaterialInfoDTO record){
RpcAssert.assertNotNull(record, DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO is no null");
RpcAssert.assertNotNull(record.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.id is no null");
RpcAssert.assertNotNull(record.getTemplateNum(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.templateNum is no null");
RpcAssert.assertNotEmpty(record.getName(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.name is no null");
RpcAssert.assertNotNull(record.getType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.type is no null");
RpcAssert.assertNotNull(record.getSubType(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.subType is no null");
RpcAssert.assertNotEmpty(record.getTplResList(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.tplResList is no empty");
RpcAssert.assertNotEmpty(record.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfoDTO.createdBy is no null");
logger.info("updateRebuildVideo:{}",record);
try {
VpMaterialInfo old = this.getBaseById(record.getId());
if(old == null){
throw new RpcServiceException("视频不存在或已删除");
}
record.setName(EmojiUtil.filterEmoji(record.getName()));
record.setCopywriting(EmojiUtil.filterEmoji(record.getCopywriting()));
record.setLabelName(EmojiUtil.filterEmoji(record.getLabelName()));
record.setUserId(old.getUserId());
record.setMerchantId(old.getMerchantId());
record.setCreatedBy(old.getCreatedBy());
record.setCreatedDate(old.getCreatedDate());
record.setUpdatedDate(new Date());
record.setDeletedFlag(DeletedFlagEnum.N.name());
record.setOnlineFlag(old.getOnlineFlag());
record.setVideoStatus(VideoPlusEnum.VideoStatus.COMPOSITING.getValue());
if(StringUtils.isBlank(record.getVideoMuteFlag())){
record.setVideoMuteFlag(StatusEnum.NO.getValue());
}
vpMaterialInfoMapper.updateByPrimaryKey(record);
changeOtherInfo(record);
vpMaterialResourceService.deleteByMaterialIdAndBizType(record.getId(),BizType.TEMPLATE_RES,record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getTplResList())){
vpMaterialResourceService.insertList(record.getTplResList());
}
vpMaterialResourceService.deleteByMaterialIdAndBizType(record.getId(),BizType.PRODUCT_MAIN_PHOTO,record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getPmpResList())){
vpMaterialResourceService.insertList(record.getPmpResList());
}
vpMaterialCarSeriesService.deleteByMaterialId(record.getId(), record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getCarSeriesList())){
vpMaterialCarSeriesService.insertList(record.getCarSeriesList());
}
vpMaterialDescriptionService.deleteByMaterialId(record.getId(), record.getUpdatedBy(),record.getUpdatedDate());
if(CollectionUtils.isNotEmpty(record.getDescriptionList())){
vpMaterialDescriptionService.insertList(record.getDescriptionList());
}
submitTransMediaManager.getPost(record);
return record;
}catch(RpcServiceException e){
throw e;
} catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfo updateSelective(VpMaterialInfo info){
RpcAssert.assertNotNull(info, DefaultErrorEnum.DATA_NULL, "VpMaterialInfo is no null");
RpcAssert.assertNotNull(info.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.id is no null");
RpcAssert.assertNotNull(info.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.updatedBy is no null");
try{
info.setUpdatedDate(new Date());
vpMaterialInfoMapper.updateByPrimaryKeySelective(info);
return info;
}catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfo updateOnlineFlag(VpMaterialInfo info){
RpcAssert.assertNotNull(info, DefaultErrorEnum.DATA_NULL, "VpMaterialInfo is no null");
RpcAssert.assertNotNull(info.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.id is no null");
RpcAssert.assertNotEmpty(info.getOnlineFlag(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.onlineFlag is no null");
RpcAssert.assertNotNull(info.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.updatedBy is no null");
try{
VpMaterialInfo materialInfo = this.getBaseById(info.getId());
if(materialInfo == null){
throw new RpcServiceException("视频不存在或已删除");
}
if(StatusEnum.YES.getValue().equals(info.getOnlineFlag()) &&
materialInfo.getVideoStatus() != VideoStatus.FINISH.getValue()){
throw new RpcServiceException("视频尚未合成完成不能发布");
}
VpMaterialInfo vpMaterialInfo = this.updateSelective(info);
//取消发布后,所有此素材已收藏全部变为未收藏
if(vpMaterialInfo != null && StatusEnum.NO.getValue().equals(vpMaterialInfo.getOnlineFlag())){
VpMaterialCollect collect = new VpMaterialCollect();
collect.setMaterialId(vpMaterialInfo.getId());
collect.setUpdatedBy(vpMaterialInfo.getUpdatedBy());
collect.setUpdatedDate(vpMaterialInfo.getUpdatedDate());
vpMaterialCollectService.cancelCollectByMaterialId(collect);
}
return vpMaterialInfo;
}catch(RpcServiceException e){
throw e;
}catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public Page<VpMaterialInfoDTO> listWithPage(RpcPagination<VpMaterialInfoDTO> pagination){
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "pagination is no null");
RpcAssert.assertNotNull(pagination.getCondition(), DefaultErrorEnum.DATA_NULL, "pagination.getCondition is no null");
try {
Page<VpMaterialInfoDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(),pagination.isNeedCount());
vpMaterialInfoMapper.list(pagination.getCondition());
return page;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public VpMaterialInfoDTO getAllById(Integer materialId){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId is no null");
try {
VpMaterialInfoDTO record = new VpMaterialInfoDTO();
record.setId(materialId);
List<VpMaterialInfoDTO> list = vpMaterialInfoMapper.list(record);
if(CollectionUtils.isNotEmpty(list)){
VpMaterialInfoDTO dto = list.get(0);
dto.setTplResList(vpMaterialResourceService.getByMaterialIdAndBizType(dto.getId(), BizType.TEMPLATE_RES));
dto.setCarSeriesList(vpMaterialCarSeriesService.getByMaterialId(dto.getId()));
dto.setDescriptionList(vpMaterialDescriptionService.getByMaterialId(dto.getId()));
dto.setPmpResList(vpMaterialResourceService.getByMaterialIdAndBizType(dto.getId(), BizType.PRODUCT_MAIN_PHOTO));
return dto;
}
return null;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public VpMaterialInfo getBaseById(Integer materialId){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId is no null");
try {
VpMaterialInfo record = new VpMaterialInfo();
record.setId(materialId);
record.setDeletedFlag(DeletedFlagEnum.N.name());
return vpMaterialInfoMapper.selectOne(record);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public VpMaterialInfo videoFinishNotify(VpMaterialInfo info) {
RpcAssert.assertNotNull(info, DefaultErrorEnum.DATA_NULL, "VpMaterialInfo is no null");
RpcAssert.assertNotNull(info.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.id is no null");
RpcAssert.assertNotEmpty(info.getVideoUrl(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.videoUrl is no null");
RpcAssert.assertNotEmpty(info.getVideoCoverUrl(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.videoCoverUrl is no null");
try{
VpMaterialInfo materialInfo = this.getBaseById(info.getId());
if(materialInfo == null){
throw new RpcServiceException("视频不存在或已删除");
}
if(materialInfo.getVideoStatus() == VideoStatus.FINISH.getValue()){
throw new RpcServiceException("已有合成视频地址");
}
materialInfo.setVideoCoverUrl(info.getVideoCoverUrl());
materialInfo.setVideoUrl(info.getVideoUrl());
materialInfo.setVideoStatus(VideoStatus.FINISH.getValue());
materialInfo.setUpdatedDate(new Date());
vpMaterialInfoMapper.updateByPrimaryKeySelective(materialInfo);
return materialInfo;
}catch(RpcServiceException e){
throw e;
}catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public boolean configToCarboutique(VpMaterialInfo info) {
RpcAssert.assertNotNull(info, DefaultErrorEnum.DATA_NULL, "VpMaterialInfo is no null");
RpcAssert.assertNotNull(info.getId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.id is no null");
RpcAssert.assertNotNull(info.getUserId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.userId is no null");
RpcAssert.assertNotNull(info.getMerchantId(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.merchantId is no null");
RpcAssert.assertNotEmpty(info.getCreatedBy(), DefaultErrorEnum.DATA_NULL, "VpMaterialInfo.createdBy is no null");
try{
VpMaterialInfoDTO materialInfo = this.getAllById(info.getId());
if(materialInfo == null){
throw new RpcServiceException("视频素材不存在");
}
if(materialInfo.getVideoStatus() != VideoStatus.FINISH.getValue()){
throw new RpcServiceException("视频尚未合成不能进行此操作");
}
Config config = new Config();
config.setConfGroup(ConfGroupEnum.CAR_BOUTIQUE_TYPE.getValue());
config.setConfValue(materialInfo.getType().toString());
List<Config> configList = configRemote.selectList(config).getResult();
if(CollectionUtils.isEmpty(configList)){
throw new RpcServiceException("此视频分类非新车礼包分类,不能进行此操作");
}
CarBoutiqueDTO boutique = new CarBoutiqueDTO();
boutique.setUserId(info.getUserId());
boutique.setMerchantId(info.getMerchantId());
boutique.setName(materialInfo.getName());
boutique.setType(materialInfo.getType());
boutique.setTypeName(materialInfo.getTypeName());
boutique.setSubType(materialInfo.getSubType());
boutique.setSubTypeName(materialInfo.getSubTypeName());
boutique.setStyleType(CarBoutiqueEnum.StyleType.FULL_SCREEN_STYLE.getValue());
boutique.setThumbUrl(materialInfo.getProductCoverUrl());
boutique.setVideoUrl(materialInfo.getVideoUrl());
boutique.setCompleteStatus(StatusEnum.NO.getValue());
boutique.setSource(CarBoutiqueEnum.SourceType.VIDEO_JIA.getValue());
boutique.setCreatedBy(info.getCreatedBy());
if(CollectionUtils.isNotEmpty(materialInfo.getDescriptionList())){
boutique.setDescriptionList(materialInfo.getDescriptionList().stream().map(item ->{
CarBoutiqueDescription description = new CarBoutiqueDescription();
description.setType(item.getType());
description.setContent(item.getContent());
return description;
}).collect(Collectors.toList()));
}
if(CollectionUtils.isNotEmpty(materialInfo.getPmpResList())){
boutique.setImgList(materialInfo.getPmpResList().stream().map(item ->{
CarBoutiqueImg img = new CarBoutiqueImg();
img.setImgUrl(item.getResUrl());
return img;
}).collect(Collectors.toList()));
}
if(StringUtils.isNotBlank(materialInfo.getLabelName())){
List<CarBoutiqueLabel> label1List = new ArrayList<>();
CarBoutiqueLabel label1 = new CarBoutiqueLabel();
label1.setLabelName(materialInfo.getLabelName());
label1List.add(label1);
boutique.setLabel1List(label1List);
}
carBoutiqueRemote.insert(boutique);
return true;
}catch(RpcServiceException e){
throw e;
}catch (Exception e) {
logger.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public boolean deleteById(Integer materialId){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId is no null");
try {
VpMaterialInfo materialInfo = new VpMaterialInfo();
materialInfo.setId(materialId);
materialInfo.setDeletedFlag(DeletedFlagEnum.D.name());
materialInfo.setUpdatedDate(new Date());
return vpMaterialInfoMapper.updateByPrimaryKeySelective(materialInfo) > 0;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum.BizType;
import cn.com.glsx.dj.weapp.mapper.VpMaterialResourceMapper;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import tk.mybatis.mapper.entity.Example;
@Service
@Transactional(propagation=Propagation.SUPPORTS,rollbackFor={RpcServiceException.class})
public class VpMaterialResourceService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private VpMaterialResourceMapper materialResourceMapper;
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void insertList(List<VpMaterialResource> list){
RpcAssert.assertNotEmpty(list, DefaultErrorEnum.DATA_NULL, "list must not be null");
try{
materialResourceMapper.insertList(list);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor={RpcServiceException.class})
public void deleteByMaterialIdAndBizType(Integer materialId,BizType bizType,String updatedBy,Date updatedDate){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not be null");
RpcAssert.assertNotNull(bizType, DefaultErrorEnum.DATA_NULL, "bizType must not be null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy must not be empty");
RpcAssert.assertNotNull(updatedDate, DefaultErrorEnum.DATA_NULL, "updatedDate must not be null");
try{
VpMaterialResource res = new VpMaterialResource();
res.setMaterialId(materialId);
res.setBizType(bizType.getValue());
res.setUpdatedBy(updatedBy);
res.setUpdatedDate(updatedDate);
res.setDeletedFlag(DeletedFlagEnum.D.name());
Example example = new Example(VpMaterialResource.class);
example.createCriteria().andEqualTo("materialId", res.getMaterialId())
.andEqualTo("bizType", res.getBizType())
.andEqualTo("deletedFlag", DeletedFlagEnum.N.name());
materialResourceMapper.updateByExampleSelective(res, example);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<VpMaterialResource> getByMaterialIdAndBizType(Integer materialId,VideoPlusEnum.BizType bizType){
RpcAssert.assertNotNull(materialId, DefaultErrorEnum.DATA_NULL, "materialId must not ne null");
RpcAssert.assertNotNull(bizType, DefaultErrorEnum.DATA_NULL, "bizType must not ne null");
try{
VpMaterialResource res = new VpMaterialResource();
res.setBizType(bizType.getValue());
res.setMaterialId(materialId);
res.setDeletedFlag(DeletedFlagEnum.N.name());
return materialResourceMapper.select(res);
}catch(Exception e){
logger.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.WeappModuleDTO;
import cn.com.glsx.dj.weapp.enums.CacheKeyEnum;
import cn.com.glsx.dj.weapp.enums.ModuleStatusEnum;
import cn.com.glsx.dj.weapp.mapper.MerchantModuleMapper;
import cn.com.glsx.dj.weapp.mapper.WeappModuleMapper;
import cn.com.glsx.dj.weapp.model.MerchantModule;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Title: WeappModuleService
* @Description: 首页模块业务层
* @author yangjia
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Service
public class WeappModuleService {
@Autowired
private WeappModuleMapper weappModuleMapper;
@Autowired
private MerchantModuleMapper merchantModuleMapper;
@Autowired
private RedisTemplate<String,Object> redisTemplate;
/**
* @Title: listWeappModuleByCondition
* @Description: 条件获取首页子模块信息
* @param weappModuleRpcPagination
* @return Page<WeappModule>
* @author yangjia
* @Date: 2018/3/27
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public Page<WeappModule> listWeappModuleByCondition(RpcPagination<WeappModule> weappModuleRpcPagination) throws RpcServiceException{
try {
WeappModule weappModule = weappModuleRpcPagination.getCondition();
PageHelper.startPage(weappModuleRpcPagination.getPageNum(), weappModuleRpcPagination.getPageSize());
return weappModuleMapper.listWeappModuleByCondition(weappModule);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: listWeappFunctionModuleByPageCondition
* @Description: 分页根据条件获取首页下所有的功能模块
* @param weappModuleDTORpcPagination
* @return Page<WeappModuleDTO>
* @author yangjia
* @Date: 2018/3/29
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public Page<WeappModuleDTO> listWeappFunctionModuleByPageCondition(RpcPagination<WeappModuleDTO> weappModuleDTORpcPagination) throws RpcServiceException{
WeappModuleDTO weappModuleDTO = weappModuleDTORpcPagination.getCondition();
RpcAssert.assertNotNull(weappModuleDTO, DefaultErrorEnum.DATA_NULL,"条件不能为空!");
RpcAssert.assertNotNull(weappModuleDTO.getId(), DefaultErrorEnum.DATA_NULL,"子模块ID不能为空!");
try {
PageHelper.startPage(weappModuleDTORpcPagination.getPageNum(), weappModuleDTORpcPagination.getPageSize());
return weappModuleMapper.listWeappFunctionModuleByCondition(weappModuleDTO);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: insertWeappFunctionModule
* @Description: 插入首页功能模块信息
* @param weappModule
* @return WeappModule
* @author yangjia
* @Date: 2018/3/29
*/
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {RpcServiceException.class})
public Long insertWeappFunctionModule(WeappModule weappModule) throws RpcServiceException{
try {
return weappModuleMapper.insertWeappFunctionModule(weappModule);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: updateWeappFunctionModule
* @Description: 更新首页功能模块信息
* @param weappModule
* @return WeappModule
* @author yangjia
* @Date: 2018/3/29
*/
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {RpcServiceException.class})
public Integer updateWeappFunctionModule(WeappModule weappModule) throws RpcServiceException{
RpcAssert.assertNotNull(weappModule, DefaultErrorEnum.DATA_NULL,"模块不能为空!");
RpcAssert.assertNotNull(weappModule.getId(), DefaultErrorEnum.DATA_NULL,"功能模块ID不能为空!");
try {
return weappModuleMapper.updateWeappFunctionModule(weappModule);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: deleteWeappModule
* @Description: 删除模块
* @param id
* @return Integer
* @author yangjia
* @Date: 2019/04/28
*/
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {RpcServiceException.class})
public Integer deleteWeappModule(Long id) throws RpcServiceException{
try {
WeappModule weap = getModuleInfoById(id);
Integer result = weappModuleMapper.deleteWeappModule(id);
if(result > 0){
MerchantModule weappChannelModule = new MerchantModule();
Integer moduleId = id.intValue();
if(moduleId.equals(null)){
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST,"模块ID为:"+moduleId+"的数据删除失败。");
}
weappChannelModule.setModuleId(moduleId);
Integer deleteResult = merchantModuleMapper.deleteMerchantModules(weappChannelModule);
if(deleteResult > 0 && weap != null){
//清除缓存
String key = CacheKeyEnum.GET_WEAPP_MODULE_BY_ALIAS.getValue().concat(weap.getModuleAlias());
Object obj = redisTemplate.opsForValue().get(key);
if(obj != null){
redisTemplate.delete(key);
}
}
return deleteResult;
}else{
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST,"模块ID为:"+id+"的数据删除失败。");
}
} catch (Exception e) {
if(e instanceof RpcServiceException){
throw new RpcServiceException(((RpcServiceException) e).getError(), e.getMessage());
}
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: getWeappModuleByCondition
* @Description: 条件获取上架的模块信息
* @param weappModule
* @return WeappModule
* @author yangjia
* @Date: 2019/04/28
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public WeappModule getWeappModuleByCondition(WeappModule weappModule) throws RpcServiceException{
try {
WeappModule we;
if(weappModule.getModuleAlias() == null){
we = weappModuleMapper.getWeappModuleByCondition(weappModule);
return we;
}
we = weappModuleMapper.getWeappModuleByCondition(weappModule);
return we;
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: listWeappModuleSortById
* @Description: 根据子模块ID取出所有的功能模块
* @param moduleId
* @return List<Integer>
* @author yangjia
* @Date: 2018/4/13
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public List<WeappModule> listWeappModuleSortById(Integer moduleId) throws RpcServiceException{
try {
return weappModuleMapper.listWeappModuleSortById(moduleId);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: listAllWeappModule
* @Description: 获取小程序所有未被删除的模块
* @return List<WeappModule>
* @author yangjia
* @Date: 2019/04/28
*/
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = {RpcServiceException.class})
public List<WeappModule> listAllWeappModule(ModuleStatusEnum moduleStatus) throws RpcServiceException{
try {
String str = null;
if(moduleStatus != null){
str = moduleStatus.toString();
}
return weappModuleMapper.listAllWeappModule(str);
} catch (Exception e) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e.getMessage());
}
}
/**
* @Title: getModuleInfoById
* @Description: 通过模块ID获取模块信息
* @param id
* @return WeappModule
* @author yangjia
* @Date: 2019/04/28
*/
public WeappModule getModuleInfoById(Long id){
if(id == null){
return null;
}
WeappModule we = new WeappModule();
we.setId(id);
we = weappModuleMapper.getWeappModuleByCondition(we);
return we;
}
}
package cn.com.glsx.dj.weapp.util;
import org.apache.commons.lang.time.DateUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.concurrent.TimeUnit;
/**
*
* 功能:扩展 apache 的日期工具类,增加获取本周开始日期,本周结束日期,本月开始日期,本月结束日期,自然日计算(两种) <br/>
*/
public class DateUtil extends DateUtils{
private static final int THREE = 3;
private static final int FOUR = 4;
private static final int SIX = 6;
private static final int SEVEN = 7;
private static final int NINE = 9;
private static final int TEN = 10;
private static final int TWELVE = 12;
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午3:57:41<br/>
* 功能:获取日期的开始日期,精确到毫秒 <br/>
* 今天的开始日期为 yyyy-MM-dd 00:00:00
* @param date
* @return
*/
public static Date dateStart(Date date){
return truncate(date, Calendar.DAY_OF_MONTH);
}
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午3:59:16<br/>
* 功能:获取日期的结束日期,实现为加一天的开始时间减一毫秒 <br/>
* @param date
* @return
*/
public static Date dateEnd(Date date){
Date tomorrow = DateUtils.addDays(date, 1);
Date tomorrowStart = dateStart(tomorrow);
return new Date(tomorrowStart.getTime() - 1);
}
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午4:03:46<br/>
* 功能:获取日期所在周的周一 <br/>
* 周一认为是一周的开始
* @param date
* @return
*/
public static Date weekStart(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
// 解决周日会出现 并到下一周的情况
calendar.add(Calendar.DAY_OF_MONTH, -1);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
Date time = calendar.getTime();
return dateStart(time);
}
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午4:04:18<br/>
* 功能:获取日期所在周的周末,周日 <br/>
* @param date
* @return
*/
public static Date weekEnd(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
calendar.add(Calendar.WEEK_OF_YEAR, 1);
return dateEnd(calendar.getTime());
}
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午4:18:55<br/>
* 功能:获取日期所在月的月初 <br/>
* @param date
* @return
*/
public static Date monthStart(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return dateStart(calendar.getTime());
}
/**
*
* 作者:sanri <br/>
* 时间:2017-10-17下午4:22:53<br/>
* 功能:获取日期所在月的月末 <br/>
* @param date
* @return
*/
public static Date monthEnd(Date date){
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return dateEnd(calendar.getTime());
}
/**
*
* 作者:sanri <br/>
* 时间:2017-9-15上午10:17:05<br/>
* 功能:计算两个日期的间隔,使用时间戳间隔然后取整 <br/>
* @param date1 日期 1
* @param date2 日期 2
* @param timeUnit
* @return
*/
public static long interval(Date date1,Date date2 ,TimeUnit timeUnit){
return interval(date1.getTime(), date2.getTime(), timeUnit);
}
public static long interval(Calendar cal1,Calendar cal2 ,TimeUnit timeUnit){
return interval(cal1.getTimeInMillis(),cal2.getTimeInMillis() , timeUnit);
}
public static long interval(long millis1,long millis2,TimeUnit timeUnit){
long duration = Math.abs(millis2 - millis1);
return interval(duration, timeUnit);
}
public static long interval(long duration,TimeUnit timeUnit){
return timeUnit.convert(duration, TimeUnit.MILLISECONDS);
}
public static int diffMinute(Date date1, Date date2){
Long a = (date2.getTime() - date1.getTime())/(1000 * 60);
return a.intValue();
}
/**
*
* 作者:sanri <br/>
* 时间:2017-9-15下午12:41:04<br/>
* 功能:计算两个日期间的自然日期间隔 从后一天开始计算,只算天数<br/>
* 注:此方法没有包含当天
* @param date1
* @param date2
* @return
*/
public static long naturalIntervalDay(Calendar cal1,Calendar cal2){
int day1 = cal1.get(Calendar.DAY_OF_YEAR);
int day2 = cal2.get(Calendar.DAY_OF_YEAR);
//add by sanri at 2017/11/21 解决不同年,算出来的天数不一致的问题
int year1 = cal1.get(Calendar.YEAR);
int year2 = cal2.get(Calendar.YEAR);
if(year1 == year2){
//如果是同年,则直接可以时间相减
return Math.abs(day2 - day1);
}
int yearSwap = year1;
if(year1 > year2){
//交换两个年
year1 = year2;
year2 = yearSwap;
}
int timeDistance = 0;
for (int i = year1; i < year2; i++) {
boolean flag1 = i % 4 == 0 && i % 100 != 0;
boolean flag2 = i % 400 == 0;
if(flag1 || flag2){
//闰年
timeDistance += 366;
}else{
timeDistance += 365;
}
}
return Math.abs(timeDistance + (day2 - day1));
}
public static long naturalIntervalDay(Date date1,Date date2){
Calendar calendar1 = Calendar.getInstance();
calendar1.setTime(date1);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTime(date2);
return naturalIntervalDay(calendar1, calendar2);
}
public static long naturalIntervalDay(long millis1,long millis2){
Calendar calendar1 = Calendar.getInstance();
calendar1.setTimeInMillis(millis1);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTimeInMillis(millis2);
return naturalIntervalDay(calendar1, calendar2);
}
/**
* 将时间前进N分钟
*
* @param date
* @param minute 前进的分钟数
* @return
*/
public static Date getMinuteBefore(Date date, int minute) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
//要前进的分钟数
cal.add(Calendar.MINUTE, minute);
return cal.getTime();
}
/**
* 获得今天日期
* @return
*/
/* public static Date getTodayDate() {
Date date = new Date();
return date;
}*/
/**
* 根据日期获取当天起始时间
*
* @param date
* @return
*/
public static Date getStartDateOfCurrentDay(Date date){
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
/**
* 获得昨天日期
* @return
*/
public static Date getYesterday() {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DATE, -1);
return cal.getTime();
}
/**
* 获取昨天开始日期
* @param date
* @return
*/
public static Date getStartYesterday(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
public static Date getTomorrow() {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DATE, 1);
return cal.getTime();
}
/****
* 时间加一天
* @param d1
* @return
*/
public static Date getToCondtionDay(Date d1) {
Calendar cal = Calendar.getInstance();
cal.setTime(d1);
cal.add(Calendar.DATE, 1);
return cal.getTime();
}
/**
* 获得本周一的日期
*
* @return
*/
public static Date getMondayOfThisWeek() {
Calendar c = Calendar.getInstance();
int dayofweek = c.get(Calendar.DAY_OF_WEEK) - 1;
if (dayofweek == 0) {
dayofweek = 7;
}
c.add(Calendar.DATE, -dayofweek + 1);
return c.getTime();
}
/**
* 获取本周星期天的日期
*
* @return
*/
public static Date getCurrentWeekday() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
cal.add(Calendar.WEEK_OF_YEAR, 1);
return cal.getTime();
}
/****
* 获取下周一日期
* @return
*/
public static Date getXiaWeekday() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
cal.add(Calendar.WEEK_OF_YEAR, 1);
cal.add(Calendar.DATE, 1);
return cal.getTime();
}
/**
* 获取上周一的日期
*
* @param date
* @return
*/
public static Date getLastWeekMonday(Date date) {
Date a = DateUtils.addDays(date, -1);
Calendar cal = Calendar.getInstance();
cal.setTime(a);
// 一周
cal.add(Calendar.WEEK_OF_YEAR, -1);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return cal.getTime();
}
/***
* 得到本月的第一天
* @return
*/
public static Date getMonthFirstDay() {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return calendar.getTime();
}
/***
* 上月第一天
* @return
*/
public static Date getPreviousMonthFirst() {
Calendar lastDate = Calendar.getInstance();
lastDate.set(5, 1);
lastDate.add(2, -1);
return lastDate.getTime();
}
/***
* 上月最后一天
* @return
*/
public static Date getPreviousMonthEnd() {
Calendar lastDate = Calendar.getInstance();
lastDate.add(2, -1);
lastDate.set(5, 1);
lastDate.roll(5, -1);
return lastDate.getTime();
}
/**
* 得到上个月的第一天
*/
public static Date getLastMonthFirstDay() {
//上个月第一天
GregorianCalendar gcLast = (GregorianCalendar) Calendar.getInstance();
gcLast.setTime(new Date());
gcLast.add(Calendar.MONTH, -1);
gcLast.set(Calendar.DAY_OF_MONTH, 1);
return gcLast.getTime();
}
/**
* 获取当年的第一天
*
* @param
* @return
*/
public static Date getCurrYearFirst() {
Calendar currCal = Calendar.getInstance();
int currentYear = currCal.get(Calendar.YEAR);
return getYearFirst(currentYear);
}
/**
* 获取当年的最后一天
*
* @param
* @return
*/
public static Date getCurrYearLast() {
Calendar currCal = Calendar.getInstance();
int currentYear = currCal.get(Calendar.YEAR);
return getYearLast(currentYear);
}
/**
* 获取某年第一天日期
*
* @param year 年份
* @return Date
*/
public static Date getYearFirst(int year) {
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
Date currYearFirst = calendar.getTime();
return currYearFirst;
}
/**
* 获取某年最后一天日期
*
* @param year 年份
* @return Date
*/
public static Date getYearLast(int year) {
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
calendar.roll(Calendar.DAY_OF_YEAR, -1);
Date currYearLast = calendar.getTime();
return currYearLast;
}
/**
* 当前季度的开始时间
*
* @return
*/
public static Date getCurrentQuarterStartTime() {
String dateSecond = "yyyy-MM-dd HH:mm:ss";
String dateYear = "yyyy-MM-dd";
Calendar c = Calendar.getInstance();
int currentMonth = c.get(Calendar.MONTH) + 1;
SimpleDateFormat longSdf = new SimpleDateFormat(dateSecond);
SimpleDateFormat shortSdf = new SimpleDateFormat(dateYear);
Date now = null;
try {
if (currentMonth >= 1 && currentMonth <= THREE){
c.set(Calendar.MONTH, 0);
}else if (currentMonth >= FOUR && currentMonth <= SIX){
c.set(Calendar.MONTH, 3);
}else if (currentMonth >= SEVEN && currentMonth <= NINE){
c.set(Calendar.MONTH, 4);
}else if (currentMonth >= TEN && currentMonth <= TWELVE){
c.set(Calendar.MONTH, 9);
}
c.set(Calendar.DATE, 1);
now = longSdf.parse(shortSdf.format(c.getTime()) + " 00:00:00");
} catch (Exception e) {
e.printStackTrace();
}
return now;
}
/**
* 当前季度的结束时间
*
* @return
*/
public static Date getCurrentQuarterEndTime() {
Calendar cal = Calendar.getInstance();
cal.setTime(getCurrentQuarterStartTime());
cal.add(Calendar.MONTH, 3);
return cal.getTime();
}
public static Date getDayOfNextNyear(int n, Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.YEAR, n);
cal.add(Calendar.DATE, -1);
cal.set(Calendar.SECOND,59);
cal.set(Calendar.HOUR,23);
cal.set(Calendar.MINUTE,59);
return cal.getTime();
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.CustomerServiceMessageCatalogMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="account_id" property="accountId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="send_type" property="sendType" jdbcType="CHAR" />
<result column="message_type_new" property="messageTypeNew" jdbcType="VARCHAR" />
<result column="message_content_new" property="messageContentNew" jdbcType="VARCHAR" />
<result column="avatar_url" property="avatarUrl" jdbcType="VARCHAR" />
<result column="nick_name" property="nickName" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="unread_count" property="unreadCount" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, account_id, merchant_id, send_type, message_type_new, message_content_new, avatar_url, nick_name,
phone, unread_count, created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="getByAccountId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_customer_service_message_catalog
where account_id = #{accountId} and merchant_id=#{merchantId} and deleted_flag = 'N'
</select>
<select id="selectByPage" parameterType="cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_customer_service_message_catalog
where merchant_id = #{merchantId} and deleted_flag = 'N' order by updated_date desc
</select>
<update id="updateByAccountId" parameterType="cn.com.glsx.dj.weapp.model.CustomerServiceMessageCatalog" >
update dj_weapp_customer_service_message_catalog
<set >
<if test="record.merchantId != null" >
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.sendType != null" >
send_type = #{record.sendType,jdbcType=CHAR},
</if>
<if test="record.messageTypeNew != null" >
message_type_new = #{record.messageTypeNew,jdbcType=VARCHAR},
</if>
<if test="record.messageContentNew != null" >
message_content_new = #{record.messageContentNew,jdbcType=VARCHAR},
</if>
<if test="record.avatarUrl != null" >
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
</if>
<if test="record.nickName != null" >
nick_name = #{record.nickName,jdbcType=VARCHAR},
</if>
<if test="record.phone != null" >
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.unreadCount != null" >
unread_count = #{record.unreadCount,jdbcType=INTEGER},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where account_id = #{record.accountId,jdbcType=INTEGER} and merchant_id = #{record.merchantId,jdbcType=INTEGER} and deleted_flag='N'
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.CustomerServiceMessageMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.CustomerServiceMessage" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="account_id" property="accountId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="send_type" property="sendType" jdbcType="CHAR" />
<result column="send_status" property="sendStatus" jdbcType="CHAR" />
<result column="message_status" property="messageStatus" jdbcType="CHAR" />
<result column="message_type" property="messageType" jdbcType="VARCHAR" />
<result column="message_cover" property="messageCover" jdbcType="VARCHAR" />
<result column="message_content" property="messageContent" jdbcType="VARCHAR" />
<result column="avatar_url" property="avatarUrl" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO" extends="BaseResultMap">
<result column="avatar_url" property="avatarUrl" jdbcType="VARCHAR" />
<result column="nick_name" property="nickName" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="message_content_new" property="messageContentNew" jdbcType="VARCHAR" />
<result column="message_type_new" property="messageTypeNew" jdbcType="VARCHAR" />
<result column="unread_count" property="unreadCount" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, account_id, merchant_id, send_type, send_status, message_status, message_type, message_cover, message_content,avatar_url,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="countByMerchantId" parameterType="java.lang.Integer" resultType="java.lang.Integer" >
select count(*) from dj_weapp_customer_service_message
WHERE message_status='N' AND deleted_flag='N' and send_type='C'
AND merchant_id = #{merchantId,jdbcType=INTEGER}
</select>
<select id="getByAccountId" resultMap="DTOResultMap">
select
a.id, a.account_id, a.merchant_id, a.send_type, a.message_status, a.message_type, a.message_cover, a.message_content, a.avatar_url, a.created_date, a.created_by,
b.avatar_url,b.nick_name,b.phone,b.message_type_new,b.message_content_new,b.unread_count
from dj_weapp_customer_service_message a
LEFT JOIN dj_weapp_customer_service_message_catalog b on a.merchant_id=b.merchant_id
where a.account_id=b.account_id and a.account_id = #{accountId} and a.merchant_id = #{merchantId} and a.deleted_flag = 'N' and b.deleted_flag='N' order by a.created_date
</select>
<select id="getUnreadByAccountId" resultMap="DTOResultMap">
select
a.id, a.account_id, a.merchant_id, a.send_type, a.message_status, a.message_type, a.message_cover, a.message_content, a.avatar_url, a.created_date, a.created_by,
b.avatar_url,b.nick_name,b.phone,b.message_type_new,b.message_content_new,b.unread_count
from dj_weapp_customer_service_message a
LEFT JOIN dj_weapp_customer_service_message_catalog b on a.merchant_id=b.merchant_id
where a.account_id=b.account_id and a.account_id = #{record.accountId}
and a.send_type=#{record.sendType} and a.merchant_id = #{record.merchantId}
and a.deleted_flag = 'N' and a.message_status='N' and b.deleted_flag='N' order by a.created_date
</select>
<select id="getByMerchantId" parameterType="java.lang.Integer"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_customer_service_message
where merchant_id = #{merchantId} and deleted_flag = 'N'
</select>
<select id="getMerchantByUnread" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_customer_service_message a
where message_status= #{status} and send_type=#{type} and deleted_flag = 'N'
</select>
<update id="updateByAccountId" parameterType="cn.com.glsx.dj.weapp.model.CustomerServiceMessage" >
update dj_weapp_customer_service_message
<set >
<if test="record.merchantId != null" >
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.sendType != null" >
send_type = #{record.sendType,jdbcType=CHAR},
</if>
<if test="record.sendStatus != null" >
send_status = #{record.sendStatus,jdbcType=CHAR},
</if>
<if test="record.messageStatus != null" >
message_status = #{record.messageStatus,jdbcType=CHAR},
</if>
<if test="record.messageType != null" >
message_type = #{record.messageType,jdbcType=VARCHAR},
</if>
<if test="record.messageCover != null" >
message_cover = #{record.messageCover,jdbcType=VARCHAR},
</if>
<if test="record.messageContent != null" >
message_content = #{record.messageContent,jdbcType=VARCHAR},
</if>
<if test="record.avatarUrl != null" >
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where account_id = #{record.accountId,jdbcType=INTEGER} and send_type=#{record.sendType,jdbcType=CHAR}
and merchant_id = #{record.merchantId,jdbcType=INTEGER} and deleted_flag='N'
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindRuleMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindRule" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="rule_classify" property="ruleClassify" jdbcType="VARCHAR" />
<result column="mile_rule" property="mileRule" jdbcType="VARCHAR" />
<result column="rule_name" property="ruleName" jdbcType="VARCHAR" />
<result column="time_rule" property="timeRule" jdbcType="VARCHAR" />
<result column="season_rule" property="seasonRule" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, rule_classify, mile_rule, rule_name, time_rule, season_rule, merchant_id, created_by, created_date,
updated_by, updated_date, deleted_flag
</sql>
<select id="selectByPage" resultMap="BaseResultMap" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindRule" >
select
rule_classify
from dj_weapp_intelligent_remind_rule
WHERE deleted_flag='N' and merchant_id=#{merchantId}
group by rule_classify order by created_date desc
</select>
<select id="getRuleClass" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
rule_classify
from dj_weapp_intelligent_remind_rule
WHERE deleted_flag='N' and merchant_id=#{merchantId}
group by rule_classify order by created_date desc
</select>
<select id="getRuleList" resultMap="BaseResultMap" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindRule" >
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_rule
WHERE deleted_flag='N' and merchant_id=#{merchantId}
<if test="ruleClassify != null">
and rule_classify = #{ruleClassify, jdbcType=VARCHAR}
</if>
order by created_date desc
</select>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_rule
where id = #{id} and deleted_flag = 'N'
</select>
<select id="getByMerchantId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_rule
where merchant_id = #{merchantId} and deleted_flag = 'N' order by created_date desc
</select>
<update id="deleteById" parameterType="java.lang.Integer">
update dj_weapp_intelligent_remind_rule
set
deleted_flag = 'D'
where id = #{id}
</update>
<update id="update" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindRule" >
update dj_weapp_intelligent_remind_rule
<set >
<if test="record.ruleClassify != null" >
rule_classify = #{record.ruleClassify,jdbcType=VARCHAR},
</if>
<if test="record.ruleName != null" >
rule_name = #{record.ruleName,jdbcType=VARCHAR},
</if>
time_rule = #{record.timeRule,jdbcType=VARCHAR},
mile_rule = #{record.mileRule,jdbcType=VARCHAR},
season_rule = #{record.seasonRule,jdbcType=VARCHAR},
<if test="record.merchantId != null" >
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where id = #{record.id}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceCarSeriesMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="car_brand_logo" property="carBrandLogo" jdbcType="VARCHAR" />
<result column="car_brand_id" property="carBrandId" jdbcType="INTEGER" />
<result column="car_brand" property="carBrand" jdbcType="VARCHAR" />
<result column="car_childs_brand_id" property="carChildsBrandId" jdbcType="INTEGER" />
<result column="car_childs_brand_name" property="carChildsBrandName" jdbcType="VARCHAR" />
<result column="car_series_id" property="carSeriesId" jdbcType="INTEGER" />
<result column="car_series_name" property="carSeriesName" jdbcType="VARCHAR" />
<result column="intelligent_remind_service_id" property="intelligentRemindServiceId" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, car_brand_logo, car_brand_id, car_brand, car_childs_brand_id, car_childs_brand_name,
car_series_id, car_series_name, intelligent_remind_service_id, created_by, created_date,
updated_by, updated_date, deleted_flag
</sql>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_service_car_series
where intelligent_remind_service_id = #{serviceId} and deleted_flag = 'N'
</select>
<update id="update" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceCarSeries" >
update dj_weapp_intelligent_remind_service_car_series
<set >
<if test="record.carBrandLogo != null" >
car_brand_logo = #{record.carBrandLogo,jdbcType=VARCHAR},
</if>
<if test="record.carBrandId != null" >
car_brand_id = #{record.carBrandId,jdbcType=INTEGER},
</if>
<if test="record.carBrand != null" >
car_brand = #{record.carBrand,jdbcType=VARCHAR},
</if>
<if test="record.carChildsBrandId != null" >
car_childs_brand_id = #{record.carChildsBrandId,jdbcType=INTEGER},
</if>
<if test="record.carChildsBrandName != null" >
car_childs_brand_name = #{record.carChildsBrandName,jdbcType=VARCHAR},
</if>
<if test="record.carSeriesId != null" >
car_series_id = #{record.carSeriesId,jdbcType=INTEGER},
</if>
<if test="record.carSeriesName != null" >
car_series_name = #{record.carSeriesName,jdbcType=VARCHAR},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where intelligent_remind_service_id = #{record.intelligentRemindServiceId,jdbcType=INTEGER}
</update>
<update id="deleteById" parameterType="java.lang.Integer">
update dj_weapp_intelligent_remind_service_car_series
set deleted_flag = 'D'
where id = #{id}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceClassifyTagMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="classify_tag_name" property="classifyTagName" jdbcType="VARCHAR" />
<result column="on_custom" property="onCustom" jdbcType="CHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, classify_tag_name, on_custom, created_by, created_date, updated_by,
updated_date, deleted_flag
</sql>
<select id="getByServiceId" resultMap="BaseResultMap" parameterType="java.lang.Long">
select t2.*
from
dj_weapp_intelligent_remind_service_classify_tag_ref t1
left join
dj_weapp_intelligent_remind_service_classify_tag t2
on t1.classify_tag_id = t2.id
where
t1.service_id = #{serviceId}
and t1.deleted_flag = 'N'
and t2.deleted_flag = 'N'
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceClassifyTagRefMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTagRef" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="classify_tag_id" property="classifyTagId" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, service_id, classify_tag_id, created_by, created_date, updated_by, updated_date,
deleted_flag
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindService" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="video_url" property="videoUrl" jdbcType="VARCHAR" />
<result column="online_flag" property="onlineFlag" jdbcType="CHAR" />
<result column="cover_url" property="coverUrl" jdbcType="VARCHAR" />
<result column="share_recommend" property="shareRecommend" jdbcType="VARCHAR" />
<result column="remind_rule_id" property="remindRuleId" jdbcType="INTEGER" />
<result column="activity_id" property="activityId" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO" extends="BaseResultMap">
<result column="mile_rule" property="searchKey" jdbcType="VARCHAR" />
<result column="time_rule" property="searchKey" jdbcType="VARCHAR" />
<result column="season_rule" property="searchKey" jdbcType="VARCHAR" />
<result column="rule_name" property="projectName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, merchant_id, title, video_url, online_flag, cover_url, share_recommend, remind_rule_id, activity_id,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="selectByPage" resultMap="DTOResultMap" parameterType="cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO" >
select a.*
from dj_weapp_intelligent_remind_service a
WHERE a.deleted_flag='N'
and a.merchant_id = #{merchantId,jdbcType=INTEGER}
<if test="searchKey != null">
<choose>
<when test='searchKey=="1"'>
and EXISTS(select 1 from dj_weapp_intelligent_remind_rule b WHERE b.id = a.remind_rule_id and b.deleted_flag='N'
and (b.mile_rule is not null and b.mile_rule != '' or (b.season_rule is not null and b.season_rule != '')))
</when>
<when test='searchKey=="2"'>
and EXISTS(select 1 from dj_weapp_intelligent_remind_rule b WHERE b.id = a.remind_rule_id and b.deleted_flag='N'
and (b.time_rule is not null and b.time_rule != '' or (b.season_rule is not null and b.season_rule != '')))
</when>
<otherwise>
and a.remind_rule_id is null
</otherwise>
</choose>
</if>
<if test="onlineFlag != null">
and a.online_flag = #{onlineFlag, jdbcType=VARCHAR}
</if>
order by a.updated_date desc
</select>
<select id="getById" resultMap="DTOResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_service
WHERE id = #{id,jdbcType=INTEGER} and deleted_flag='N'
</select>
<select id="getByMerchantId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_service
WHERE merchant_id = #{merchantId,jdbcType=INTEGER} and deleted_flag='N' order by updated_date desc
</select>
<select id="getByCondition" resultMap="DTOResultMap">
select a.*
from dj_weapp_intelligent_remind_service a
WHERE a.deleted_flag='N' and a.online_flag = 'Y'
and a.merchant_id = #{record.merchantId,jdbcType=INTEGER}
<if test="record.searchKey != null">
<choose>
<when test='record.searchKey=="1"'>
and EXISTS(select 1 from dj_weapp_intelligent_remind_rule b WHERE b.id = a.remind_rule_id and b.deleted_flag='N'
and (b.mile_rule is not null and b.mile_rule != '' or (b.season_rule is not null and b.season_rule != '')))
</when>
<when test='record.searchKey=="2"'>
and EXISTS(select 1 from dj_weapp_intelligent_remind_rule b WHERE b.id = a.remind_rule_id and b.deleted_flag='N'
and (b.time_rule is not null and b.time_rule != '' or (b.season_rule is not null and b.season_rule != '')))
</when>
<when test='record.searchKey=="3"'>
and a.remind_rule_id is null
</when>
</choose>
</if>
order by a.updated_date desc
</select>
<select id="getByRemindRuleId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_service
WHERE remind_rule_id = #{remindRuleId,jdbcType=INTEGER} and deleted_flag='N' order by updated_date desc
</select>
<update id="update" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindService" >
update dj_weapp_intelligent_remind_service
<set >
<if test="record.merchantId != null" >
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.title != null" >
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.videoUrl != null" >
video_url = #{record.videoUrl,jdbcType=VARCHAR},
</if>
<if test="record.onlineFlag != null" >
online_flag = #{record.onlineFlag,jdbcType=CHAR},
</if>
<if test="record.coverUrl != null" >
cover_url = #{record.coverUrl,jdbcType=VARCHAR},
</if>
share_recommend = #{record.shareRecommend,jdbcType=VARCHAR},
remind_rule_id = #{record.remindRuleId,jdbcType=INTEGER},
activity_id = #{record.activityId,jdbcType=INTEGER},
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where id = #{record.id}
</update>
<update id="deleteById" parameterType="java.lang.Integer">
update dj_weapp_intelligent_remind_service
set deleted_flag = 'D'
where id = #{id}
</update>
<select id="getRemindServiceList" parameterType="cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO" resultMap="BaseResultMap">
select a.*
from
dj_weapp_intelligent_remind_service a
left join
dj_weapp_intelligent_remind_service_classify_tag_ref b
on a.id = b.service_id
WHERE a.deleted_flag='N'
and a.online_flag = 'Y'
and b.deleted_flag='N'
and a.merchant_id = #{condition.merchantId}
<if test="condition.classifyTagId != null">
and b.classify_tag_id = #{condition.classifyTagId}
</if>
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceMaterialMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="intelligent_remind_service_id" property="intelligentRemindServiceId" jdbcType="INTEGER" />
<result column="material_belong" property="materialBelong" jdbcType="SMALLINT" />
<result column="material_type" property="materialType" jdbcType="SMALLINT" />
<result column="material_content" property="materialContent" jdbcType="VARCHAR" />
<result column="sort" property="sort" jdbcType="SMALLINT" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, intelligent_remind_service_id, material_belong, material_type, material_content,
sort, created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_intelligent_remind_service_material
where intelligent_remind_service_id = #{serviceId} and deleted_flag = 'N'
</select>
<update id="update" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial" >
<!--
WARNING - @mbg.generated
-->
update dj_weapp_intelligent_remind_service_material
<set >
<if test="record.materialBelong != null" >
material_belong = #{record.materialBelong,jdbcType=SMALLINT},
</if>
<if test="record.materialType != null" >
material_type = #{record.materialType,jdbcType=SMALLINT},
</if>
<if test="record.materialContent != null" >
material_content = #{record.materialContent,jdbcType=VARCHAR},
</if>
<if test="record.sort != null" >
sort = #{record.sort,jdbcType=SMALLINT},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where intelligent_remind_service_id = #{record.intelligentRemindServiceId,jdbcType=INTEGER}
</update>
<update id="deleteById" parameterType="java.lang.Integer">
update dj_weapp_intelligent_remind_service_material
set
deleted_flag = 'D'
where id = #{id}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.IntelligentReminderMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentReminder" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="MERCHANT_NAME" property="merchantName" jdbcType="VARCHAR" />
<result column="REMINDER_ID" property="reminderId" jdbcType="INTEGER" />
<result column="REMINDER_NAME" property="reminderName" jdbcType="VARCHAR" />
<result column="REMINDER_TYPE" property="reminderType" jdbcType="TINYINT" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="SOURCE" property="source" jdbcType="TINYINT" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETE_FALG" property="deleteFalg" jdbcType="CHAR" />
</resultMap>
<resultMap id="ResultMapDTO" type="cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="MERCHANT_NAME" property="merchantName" jdbcType="VARCHAR" />
<result column="REMINDER_ID" property="reminderId" jdbcType="INTEGER" />
<result column="REMINDER_NAME" property="reminderName" jdbcType="VARCHAR" />
<result column="REMINDER_TYPE" property="reminderType" jdbcType="TINYINT" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="SOURCE" property="source" jdbcType="TINYINT" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, ACCOUNT_ID, MERCHANT_ID, MERCHANT_NAME, REMINDER_ID, REMINDER_NAME, REMINDER_TYPE,
REMARK, SOURCE, CREATED_BY, CREATED_DATE, UPDATED_BY,UPDATED_DATE, DELETED_FLAG
</sql>
<select id="selectByCondition" parameterType="java.util.HashMap" resultMap="ResultMapDTO">
SELECT
<include refid="Base_Column_List" />
FROM dj_intelligent_reminder
WHERE 1=1
<if test="accountId != null">
AND ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
</if>
<if test="merchantId != null">
AND MERCHANT_ID = #{merchantId,jdbcType=INTEGER}
</if>
AND DELETED_FLAG = 'N'
ORDER BY UPDATED_DATE DESC
</select>
<insert id="insertReminder" parameterType="cn.com.glsx.dj.weapp.model.IntelligentReminder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO dj_intelligent_reminder (ACCOUNT_ID, MERCHANT_ID, MERCHANT_NAME,REMINDER_ID,REMINDER_NAME,
REMINDER_TYPE,REMARK,SOURCE,CREATED_BY,CREATED_DATE,UPDATED_BY,UPDATED_DATE,DELETED_FLAG
)
VALUES (#{accountId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER}, #{merchantName,jdbcType=VARCHAR},
#{reminderId,jdbcType=INTEGER},#{reminderName,jdbcType=VARCHAR},#{reminderType,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR},#{source,jdbcType=TINYINT},
#{createdBy,jdbcType=VARCHAR}, NOW(),#{updatedBy,jdbcType=VARCHAR}, NOW(), 'N')
</insert>
<select id="getIntelligentReminderById" parameterType="java.lang.Long" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM dj_intelligent_reminder
WHERE ID = #{id,jdbcType=INTEGER}
</select>
<update id="updateReminderByCondition" parameterType="cn.com.glsx.dj.weapp.model.IntelligentReminder">
UPDATE dj_intelligent_reminder
SET
<if test="accountId != null">
ACCOUNT_ID = #{accountId},
</if>
<if test="merchantId != null">
MERCHANT_ID = #{merchantId},
</if>
<if test="merchantName != null">
MERCHANT_NAME = #{merchantName},
</if>
<if test="reminderName != null">
REMINDER_NAME = #{reminderName},
</if>
<if test="reminderType != null">
REMINDER_TYPE = #{reminderType},
</if>
<if test="remark != null">
REMARK = #{remark},
</if>
<if test="source != null">
SOURCE = #{source},
</if>
UPDATED_BY = #{updatedBy},
UPDATED_DATE = NOW()
WHERE
ID = #{id,jdbcType=INTEGER}
</update>
<update id="deleterReminderById" parameterType="java.lang.Long">
UPDATE dj_intelligent_reminder
SET DELETED_FLAG = 'Y' , UPDATED_DATE = NOW()
WHERE ID = #{id}
</update>
<update id="deleterReminderByReminderId" parameterType="java.lang.Integer">
UPDATE dj_intelligent_reminder
SET DELETED_FLAG = 'Y' , UPDATED_DATE = NOW()
WHERE REMINDER_ID = #{reminderId}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.MerchantModuleMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.MerchantModule" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="APP_ID" property="appId" jdbcType="VARCHAR" />
<result column="MODULE_ID" property="moduleId" jdbcType="INTEGER" />
<result column="MODULE_SORT" property="moduleSort" jdbcType="INTEGER" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, MERCHANT_ID, APP_ID, MODULE_ID, MODULE_SORT, CREATED_BY, CREATED_DATE, UPDATED_BY,
UPDATED_DATE, DELETED_FLAG
</sql>
<resultMap id="ModuleResultMap" type="cn.com.glsx.dj.weapp.dto.MerchantModuleDTO" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="MERCHANT_ID" property="merchantId" jdbcType="INTEGER" />
<result column="MODULE_ID" property="moduleId" jdbcType="INTEGER" />
<result column="MODULE_SORT" property="moduleSort" jdbcType="INTEGER" />
<result column="MODULE_NAME" property="moduleName" jdbcType="VARCHAR" />
<result column="MODULE_PATH" property="modulePath" jdbcType="VARCHAR" />
<result column="MODULE_ICON" property="moduleIcon" jdbcType="VARCHAR" />
<result column="MODULE_CLASS" property="moduleClass" jdbcType="VARCHAR" />
<result column="PATH_CATEGORY" property="pathCategory" jdbcType="VARCHAR" />
<result column="MODULE_ALIAS" property="moduleAlias" jdbcType="VARCHAR" />
<result column="MODULE_LEVEL" property="moduleLevel" jdbcType="INTEGER" />
<result column="PARENT_ID" property="parentId" jdbcType="INTEGER" />
<result column="MODULE_STATUS" property="moduleStatus" jdbcType="CHAR" />
<result column="NEED_LOGIN" property="needLogin" jdbcType="CHAR" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="module_Column_List" >
dwmm.ID, dwmm.MERCHANT_ID, dwmm.MODULE_ID, dwmm.MODULE_SORT,
dwm.MODULE_NAME,dwm.MODULE_PATH,dwm.MODULE_ICON,dwm.MODULE_CLASS,
dwm.PATH_CATEGORY,dwm.MODULE_ALIAS,dwm.MODULE_LEVEL,dwm.PARENT_ID,dwm.MODULE_STATUS,dwm.NEED_LOGIN,
dwmm.CREATED_BY, dwmm.CREATED_DATE, dwmm.UPDATED_BY, dwmm.UPDATED_DATE,dwmm.DELETED_FLAG
</sql>
<select id="listMerchantModuleById" resultMap="ModuleResultMap">
SELECT
<include refid="module_Column_List"/>
FROM dj_weapp_merchant_module dwmm,dj_weapp_module dwm
where dwmm.MODULE_ID = dwm.ID
AND dwmm.MERCHANT_ID = #{merchantId}
AND dwm.PARENT_ID = #{parentId}
AND dwm.DELETED_FLAG = 'N'
AND dwmm.DELETED_FLAG = 'N'
AND dwm.MODULE_STATUS = 'ON'
ORDER BY dwmm.MODULE_SORT ASC
</select>
<select id="listAllMerchantModule" resultMap="ModuleResultMap">
SELECT
dwm.MODULE_NAME,
dwm.MODULE_PATH,
dwm.MODULE_ICON,
dwm.MODULE_CLASS,
dwm.PATH_CATEGORY,
dwm.MODULE_ALIAS,
dwm.MODULE_LEVEL,
dwm.PARENT_ID,
dwm.MODULE_STATUS,
dwm.NEED_LOGIN
FROM
dj_weapp_module dwm
WHERE
dwm.PARENT_ID = #{parentId}
AND dwm.MODULE_STATUS = 'ON'
AND dwm.DELETED_FLAG = 'N'
ORDER BY
dwm.MODULE_SORT ASC
</select>
<insert id="insertMerchantModule" parameterType="cn.com.glsx.dj.weapp.model.MerchantModule">
INSERT INTO dj_weapp_merchant_module
(
<include refid="Base_Column_List"/>
)
VALUES
(NULL,#{merchantId},#{moduleId},#{moduleSort},#{createdBy},now(),#{updatedBy},now(),#{deletedFlag})
</insert>
<update id="updateMerchantModule" parameterType="cn.com.glsx.dj.weapp.model.MerchantModule">
UPDATE dj_weapp_merchant_module
SET
<if test="moduleSort != null">
MODULE_SORT = #{moduleSort},
</if>
<if test="deletedFlag != null">
DELETED_FLAG = #{deletedFlag},
</if>
UPDATED_BY = #{updatedBy},
UPDATED_DATE = NOW()
WHERE
MERCHANT_ID = #{merchantId}
AND MODULE_ID = #{moduleId}
</update>
<select id="listAllMerchantModuleByMerchantId" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
from dj_weapp_merchant_module
where MERCHANT_ID = #{merchantId}
<if test="deletedFlag != null">
AND DELETED_FLAG = #{deletedFlag}
</if>
</select>
<delete id="deleteMerchantModules" parameterType="cn.com.glsx.dj.weapp.model.MerchantModule">
DELETE FROM dj_weapp_merchant_module
WHERE 1=1
<if test="merchantId != null">
AND MERCHANT_ID = #{merchantId}
</if>
<if test="moduleId != null">
AND MODULE_ID = #{moduleId}
</if>
</delete>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.dj.weapp.mapper.MerchantWeappNoticeMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.MerchantWeappNotice">
<id column="ID" jdbcType="INTEGER" property="id" />
<result column="MERCHANT_ID" jdbcType="INTEGER" property="merchantId" />
<result column="APP_ID" jdbcType="VARCHAR" property="appId" />
<result column="NOTICE" jdbcType="VARCHAR" property="notice" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_DATE" jdbcType="TIMESTAMP" property="createdDate" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_DATE" jdbcType="TIMESTAMP" property="updatedDate" />
<result column="DELETED_FLAG" jdbcType="CHAR" property="deletedFlag" />
</resultMap>
<sql id="Base_Column_List">
ID, MERCHANT_ID, APP_ID, NOTICE, CREATED_BY, CREATED_DATE, UPDATED_BY, UPDATED_DATE,
DELETED_FLAG
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.QrCodeManageMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.QrCodeManage" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="qrcode_url" property="qrcodeUrl" jdbcType="VARCHAR" />
<result column="upload_date" property="uploadDate" jdbcType="TIMESTAMP" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, qrcode_url, upload_date, created_by, created_date, updated_by, updated_date,
deleted_flag
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from dj_weapp_qrcode_manage
WHERE id = #{id,jdbcType=INTEGER} and deleted_flag='N'
</select>
<select id="getByMerchantId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_weapp_qrcode_manage
where merchant_id = #{merchantId} and deleted_flag = 'N'
</select>
<update id="update" parameterType="cn.com.glsx.dj.weapp.model.QrCodeManage" >
update dj_weapp_qrcode_manage
<set >
<if test="record.merchantId != null" >
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.qrcodeUrl != null" >
qrcode_url = #{record.qrcodeUrl,jdbcType=VARCHAR},
</if>
<if test="record.uploadDate != null" >
upload_date = #{record.uploadDate,jdbcType=TIMESTAMP},
</if>
<if test="record.createdBy != null" >
created_by = #{record.createdBy,jdbcType=VARCHAR},
</if>
<if test="record.createdDate != null" >
created_date = #{record.createdDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedBy != null" >
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
</if>
<if test="record.updatedDate != null" >
updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="record.deletedFlag != null" >
deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
</if>
</set>
where id = #{record.id}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.UserAddressMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.UserAddress" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="open_id" property="openId" jdbcType="VARCHAR" />
<result column="account_id" property="accountId" jdbcType="INTEGER" />
<result column="province_name" property="provinceName" jdbcType="VARCHAR" />
<result column="city_name" property="cityName" jdbcType="VARCHAR" />
<result column="area_name" property="areaName" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="lng" property="lng" jdbcType="DOUBLE" />
<result column="lat" property="lat" jdbcType="DOUBLE" />
<result column="is_default" property="isDefault" jdbcType="CHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, name, phone, open_id, account_id, province_name, city_name, area_name, address,
lng, lat, is_default, created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="list" resultType="cn.com.glsx.dj.weapp.model.UserAddress" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM dj_weapp_user_address
WHERE deleted_flag = 'N'
<if test="openId != null and openId !=''">
AND open_id =#{openId}
</if>
<if test="accountId != null">
AND account_id =#{accountId}
</if>
ORDER BY updated_date DESC
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpFocusUserMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpFocusUser" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="focused_user_id" property="focusedUserId" jdbcType="INTEGER" />
<result column="focused_merchant_id" property="focusedMerchantId" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="CHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.weapp.dto.VpFocusUserDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, user_id, merchant_id, focused_user_id, focused_merchant_id, status, created_by,
created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.weapp.model.VpFocusUser" resultMap="DTOResultMap">
select <include refid="Base_Column_List"/> from dj_weapp_video_plus_focus_user
<where>
deleted_flag='N'
<if test="userId != null">
and (user_id = #{userId} or user_id = -1)
</if>
<if test="merchantId != null">
and (merchant_id = #{merchantId} or merchant_id = -1)
</if>
<if test="focusedUserId != null">
and focused_user_id = #{focusedUserId}
</if>
<if test="focusedMerchantId != null">
and focused_merchant_id = #{focusedMerchantId}
</if>
<if test="status != null and status !=''">
and status = #{status}
</if>
</where>
order by updated_date desc
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpMaterialCarSeriesMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpMaterialCarSeries" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="material_id" property="materialId" jdbcType="INTEGER" />
<result column="car_brand_logo" property="carBrandLogo" jdbcType="VARCHAR" />
<result column="car_brand_id" property="carBrandId" jdbcType="INTEGER" />
<result column="car_brand" property="carBrand" jdbcType="VARCHAR" />
<result column="car_childs_brand_id" property="carChildsBrandId" jdbcType="INTEGER" />
<result column="car_childs_brand_name" property="carChildsBrandName" jdbcType="VARCHAR" />
<result column="car_series_id" property="carSeriesId" jdbcType="INTEGER" />
<result column="car_series_name" property="carSeriesName" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, material_id, car_brand_logo, car_brand_id, car_brand, car_childs_brand_id, car_childs_brand_name,
car_series_id, car_series_name, created_by, created_date, updated_by, updated_date,
deleted_flag
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpMaterialCollectMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpMaterialCollect" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="material_id" property="materialId" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="CHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, user_id, merchant_id, material_id, status, created_by, created_date, updated_by,
updated_date, deleted_flag
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpMaterialDescriptionMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpMaterialDescription" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="material_id" property="materialId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="TINYINT" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="sort" property="sort" jdbcType="SMALLINT" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, material_id, type, content, sort, created_by, created_date, updated_by, updated_date,
deleted_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.weapp.model.VpMaterialDescription" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from dj_weapp_video_plus_material_description
<where>
deleted_flag = 'N'
<if test="materialId != null">
and material_id = #{materialId}
</if>
<if test="type != null">
and type = #{type}
</if>
</where>
order by sort asc
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpMaterialInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpMaterialInfo" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="template_num" property="templateNum" jdbcType="TINYINT" />
<result column="logo_url" property="logoUrl" jdbcType="VARCHAR" />
<result column="banner_img_url" property="bannerImgUrl"/>
<result column="btm_banner_img_url" property="btmBannerImgUrl"/>
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="TINYINT" />
<result column="type_name" property="typeName" jdbcType="VARCHAR" />
<result column="sub_type" property="subType" jdbcType="INTEGER" />
<result column="sub_type_name" property="subTypeName" jdbcType="VARCHAR" />
<result column="copywriting" property="copywriting" jdbcType="VARCHAR" />
<result column="music_url" property="musicUrl" jdbcType="VARCHAR" />
<result column="music_id" property="musicId"/>
<result column="video_mute_flag" property="videoMuteFlag" jdbcType="CHAR" />
<result column="product_cover_url" property="productCoverUrl" jdbcType="VARCHAR" />
<result column="video_cover_url" property="videoCoverUrl" jdbcType="VARCHAR" />
<result column="label_name" property="labelName" jdbcType="VARCHAR" />
<result column="online_flag" property="onlineFlag" jdbcType="CHAR" />
<result column="video_status" property="videoStatus" jdbcType="TINYINT" />
<result column="original_material_id" property="originalMaterialId" jdbcType="INTEGER" />
<result column="video_url" property="videoUrl"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
mi.id, mi.user_id, mi.merchant_id, mi.template_num, mi.logo_url,mi.banner_img_url,mi.btm_banner_img_url,mi.name, mi.type, mi.type_name, mi.sub_type,
mi.sub_type_name, mi.copywriting, mi.music_url,mi.music_id, mi.video_mute_flag, mi.product_cover_url,mi.video_cover_url,
mi.label_name, mi.online_flag, mi.video_status, mi.original_material_id,mi.video_url, mi.created_by, mi.created_date,
mi.updated_by, mi.updated_date, mi.deleted_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"/> from dj_weapp_video_plus_material_info mi
<where>
deleted_flag = 'N'
<if test="id != null">
and id = #{id}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="type != null">
and type = #{type}
</if>
<if test="subType != null">
and sub_type = #{subType}
</if>
<if test="onlineFlag != null and onlineFlag !=''">
and online_flag = #{onlineFlag}
</if>
<if test="videoStatus != null and videoStatus !=''">
and video_status = #{videoStatus}
</if>
<if test="focusUserId != null">
and exists (
select 1 from dj_weapp_video_plus_focus_user fu where fu.deleted_flag='N' and fu.status='Y'
and (fu.user_id=#{focusUserId} or fu.user_id=-1) and fu.focused_user_id=mi.user_id limit 1
)
</if>
</where>
order by updated_date desc
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.VpMaterialResourceMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.VpMaterialResource" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="material_id" property="materialId" jdbcType="INTEGER" />
<result column="res_url" property="resUrl" jdbcType="VARCHAR" />
<result column="res_type" property="resType" jdbcType="TINYINT" />
<result column="biz_type" property="bizType" jdbcType="TINYINT" />
<result column="biz_num" property="bizNum" jdbcType="TINYINT" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, material_id, res_url, res_type, biz_type, biz_num, created_by, created_date,
updated_by, updated_date, deleted_flag
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.weapp.mapper.WeappModuleMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.WeappModule" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="MODULE_NAME" property="moduleName" jdbcType="VARCHAR" />
<result column="MODULE_PATH" property="modulePath" jdbcType="VARCHAR" />
<result column="MODULE_ICON" property="moduleIcon" jdbcType="VARCHAR" />
<result column="MODULE_CLASS" property="moduleClass" jdbcType="VARCHAR" />
<result column="PATH_CATEGORY" property="pathCategory" jdbcType="VARCHAR" />
<result column="MODULE_ALIAS" property="moduleAlias" jdbcType="VARCHAR" />
<result column="MODULE_LEVEL" property="moduleLevel" jdbcType="INTEGER" />
<result column="MODULE_SORT" property="moduleSort" jdbcType="INTEGER" />
<result column="PARENT_ID" property="parentId" jdbcType="INTEGER" />
<result column="MODULE_STATUS" property="moduleStatus" jdbcType="CHAR" />
<result column="NEED_LOGIN" property="needLogin" jdbcType="CHAR" />
<result column="APP_ID" property="appId" jdbcType="VARCHAR" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="FunctionModuleResultMap" type="cn.com.glsx.dj.weapp.dto.WeappModuleDTO" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="MODULE_NAME" property="moduleName" jdbcType="VARCHAR" />
<result column="FUNCTION_MODULE_ID" property="functionModuleId" jdbcType="INTEGER" />
<result column="FUNCTION_MODULE_NAME" property="functionModuleName" jdbcType="VARCHAR" />
<result column="FUNCTION_MODULE_SORT" property="functionModuleSort" jdbcType="INTEGER" />
<result column="MODULE_PATH" property="modulePath" jdbcType="VARCHAR" />
<result column="MODULE_ICON" property="moduleIcon" jdbcType="VARCHAR" />
<result column="MODULE_CLASS" property="moduleClass" jdbcType="VARCHAR" />
<result column="PATH_CATEGORY" property="pathCategory" jdbcType="VARCHAR" />
<result column="MODULE_ALIAS" property="moduleAlias" jdbcType="VARCHAR" />
<result column="MODULE_LEVEL" property="moduleLevel" jdbcType="INTEGER" />
<result column="MODULE_SORT" property="moduleSort" jdbcType="INTEGER" />
<result column="PARENT_ID" property="parentId" jdbcType="INTEGER" />
<result column="MODULE_STATUS" property="moduleStatus" jdbcType="CHAR" />
<result column="APP_ID" property="appId" jdbcType="VARCHAR" />
<result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
<result column="CREATED_DATE" property="createdDate" jdbcType="TIMESTAMP" />
<result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
<result column="UPDATED_DATE" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="DELETED_FLAG" property="deletedFlag" jdbcType="CHAR" />
<result column="NEED_LOGIN" property="needLogin" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, MODULE_NAME, MODULE_PATH, MODULE_ICON, MODULE_CLASS, PATH_CATEGORY, MODULE_ALIAS,
MODULE_LEVEL, MODULE_SORT, PARENT_ID, MODULE_STATUS, NEED_LOGIN, APP_ID, CREATED_BY, CREATED_DATE, UPDATED_BY,
UPDATED_DATE, DELETED_FLAG
</sql>
<sql id="Function_Module_Column_List" >
ID FUNCTION_MODULE_ID, MODULE_NAME FUNCTION_MODULE_NAME, MODULE_PATH, MODULE_ICON, MODULE_CLASS, PATH_CATEGORY, MODULE_ALIAS,
MODULE_LEVEL, MODULE_SORT FUNCTION_MODULE_SORT, PARENT_ID, MODULE_STATUS, NEED_LOGIN, APP_ID, CREATED_BY, CREATED_DATE, UPDATED_BY,
UPDATED_DATE, DELETED_FLAG
</sql>
<select id="listWeappModuleByCondition" parameterType="cn.com.glsx.dj.weapp.model.WeappModule" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from dj_weapp_module
where
PARENT_ID = #{id} AND
DELETED_FLAG = 'N'
ORDER BY MODULE_SORT
</select>
<select id="listWeappFunctionModuleByCondition" parameterType="cn.com.glsx.dj.weapp.dto.WeappModuleDTO" resultMap="FunctionModuleResultMap">
SELECT
dwm.ID,
dwm.MODULE_NAME,
a.*
FROM
dj_weapp_module dwm
RIGHT JOIN (
SELECT
<include refid="Function_Module_Column_List"/>
FROM
dj_weapp_module
WHERE
PARENT_ID IN (
SELECT
ID
FROM
dj_weapp_module
WHERE
PARENT_ID = #{id}
AND DELETED_FLAG = 'N')
AND DELETED_FLAG = 'N'
) a ON dwm.ID = a.PARENT_ID
WHERE
dwm.PARENT_ID = #{id}
<if test="appId != null ">
AND dwm.APP_ID = #{appId}
AND a.APP_ID = #{appId}
</if>
<if test="moduleName != null ">
AND dwm.MODULE_NAME LIKE CONCAT('%', #{moduleName}, '%')
</if>
<if test="functionModuleName != null ">
AND a.FUNCTION_MODULE_NAME LIKE CONCAT('%', #{functionModuleName}, '%')
</if>
<if test="moduleStatus != null ">
AND a.MODULE_STATUS = #{moduleStatus}
</if>
ORDER BY
UPDATED_DATE DESC
</select>
<update id="updateWeappFunctionModule" parameterType="cn.com.glsx.dj.weapp.model.WeappModule">
UPDATE dj_weapp_module
SET
UPDATED_BY = #{updatedBy},
UPDATED_DATE = now()
<if test="moduleStatus != null ">
,MODULE_STATUS = #{moduleStatus}
</if>
<if test="parentId != null ">
,PARENT_ID = #{parentId}
</if>
<if test="moduleIcon != null ">
,MODULE_ICON = #{moduleIcon}
</if>
<if test="moduleSort != null ">
,MODULE_SORT = #{moduleSort}
</if>
<if test="modulePath != null ">
,MODULE_PATH = #{modulePath}
</if>
<if test="moduleName != null ">
,MODULE_NAME = #{moduleName}
</if>
<if test="moduleAlias != null ">
,MODULE_ALIAS = #{moduleAlias}
</if>
<if test="pathCategory != null ">
,PATH_CATEGORY = #{pathCategory}
</if>
<if test="needLogin != null ">
,NEED_LOGIN = #{needLogin}
</if>
WHERE ID = #{id}
</update>
<insert id="insertWeappFunctionModule" useGeneratedKeys="true" keyProperty="id" parameterType="cn.com.glsx.dj.weapp.model.WeappModule">
INSERT INTO glsx_dj.dj_weapp_module (
ID,
MODULE_NAME,
<if test="modulePath != null ">
MODULE_PATH,
</if>
<if test="moduleIcon != null ">
MODULE_ICON,
</if>
<if test="moduleClass != null ">
MODULE_CLASS,
</if>
<if test="pathCategory != null ">
PATH_CATEGORY,
</if>
<if test="moduleAlias != null ">
MODULE_ALIAS,
</if>
MODULE_LEVEL,
MODULE_SORT,
PARENT_ID,
<if test="moduleStatus != null ">
MODULE_STATUS,
</if>
<if test="needLogin != null ">
NEED_LOGIN,
</if>
<if test="appId != null ">
APP_ID,
</if>
CREATED_BY,
CREATED_DATE,
UPDATED_BY,
UPDATED_DATE,
DELETED_FLAG
)
VALUES
(
NULL,
#{moduleName},
<if test="modulePath != null ">
#{modulePath},
</if>
<if test="moduleIcon != null ">
#{moduleIcon},
</if>
<if test="moduleClass != null ">
#{moduleClass},
</if>
<if test="pathCategory != null ">
#{pathCategory},
</if>
<if test="moduleAlias != null ">
#{moduleAlias},
</if>
'3',
#{moduleSort},
#{parentId},
<if test="moduleStatus != null ">
#{moduleStatus},
</if>
<if test="needLogin != null ">
#{needLogin},
</if>
<if test="appId != null ">
#{appId},
</if>
#{createdBy},
now(),
#{updatedBy},
now(),
'N'
)
</insert>
<update id="deleteWeappModule" parameterType="java.lang.Long">
update dj_weapp_module
set DELETED_FLAG = 'D'
where ID = #{id}
</update>
<select id="getWeappModuleByCondition" parameterType="cn.com.glsx.dj.weapp.model.WeappModule" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM dj_weapp_module
WHERE DELETED_FLAG = 'N'
<if test="id != null">
AND ID = #{id}
</if>
<if test="moduleStatus != null">
AND MODULE_STATUS = #{moduleStatus}
</if>
<if test="moduleAlias != null">
AND MODULE_ALIAS = #{moduleAlias}
</if>
<if test="moduleName != null">
AND MODULE_NAME = #{moduleName}
</if>
<if test="appId != null">
AND APP_ID = #{appId}
</if>
<if test="appId == null">
AND APP_ID IS NULL
</if>
ORDER BY UPDATED_DATE DESC
</select>
<select id="listWeappModuleSortById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM dj_weapp_module
WHERE DELETED_FLAG = 'N'
<if test="moduleId != null">
AND PARENT_ID = #{moduleId};
</if>
</select>
<select id="listAllWeappModule" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM dj_weapp_module
WHERE DELETED_FLAG = 'N'
<if test="moduleStatus != null">
AND MODULE_STATUS = #{moduleStatus}
</if>
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
# framework-archetype-rpc
RPC服务项目骨架
一、项目结构说明:
└─src
├─main
├─java
├─cn.com.glsx.dj.weapp.config 配置层
├─cn.com.glsx.dj.weapp.manager 通用处理层
├─cn.com.glsx.dj.weapp.mapper Dao映射层
├─cn.com.glsx.dj.weapp.remote RPC接口实现层
├─cn.com.glsx.dj.weapp.service 业务层
├─cn.com.glsx.dj.weapp.util 工具包
└─cn.com.glsx.dj.weapp.Main.java 程序入口
├─resources 资源文件目录
├─config
├─application.properties 应用配置文件
├─META-INF
└─orm SQL配置文件
├─templates 模板目录
└─*.flt freemarker模板,(可用于邮件模板)
└─logback.xml 日志配置文件
└─webapp web前端文件目录
└─WEB-INF
└─bin shell脚本文件(包含启动、停止、重启等)
└─test 测试目录
├─java
└─cn.com.glsx.dj.weapp/service 测试代码
└─resources 测试资源目录
└─pom.xml pom文件
二、使用说明:
1、运行项目前需在配置中心创建配置信息,配置内容参考三配置说明:
1.1> dataId : application.properties --> ore.diamond.dataId + ore.diamond.env
1.2> group : application.properties --> ore.diamond.group
1.3> content : 参考三配置说明
2、生成mybatis文件的插件,使用说明:
1.1> 生成之后可以删掉插件
1.2> IDEA内:点击右侧Maven Projects > 项目 plugins > mybatis-generator 运行
1.3> ECLIPSE内:右键点击项目,选择RUN AS maven build > 输入maven命令:
mybatis-generator:generate -e > 运行
3、Bean转换器mapstruct使用说明:
1.1> 在converter包内建立Bean转换对应的转换器,传入source和target的类型。
1.2> 在remote内使用spring的方式引入bean。
1.3> Bean的属性名一样的情况下,不需要重写方法。
4、自定义过滤器加入方式:
1.1> 在src.main.resources.META-INF.dubbo文件夹下新建文件com.alibaba.dubbo.rpc.Filter
1.2> 在该文件内写入自定义过滤器类的完整地址,以键值对的形式加入,左边为key名称,例如:
dubboAuthorizeFilter=cn.com.glsx.payment.roof.filter.DubboAuthorizeFilter
1.3> 在钻石配置中加入dubbo过滤器的配置,名字为key,例如:
ore.dubbo.provider.enabled=true
ore.dubbo.provider.filter=dubboAuthorizeFilter
三、配置说明:
#----------------------------------------------------------------------------------------------------------
# dubbo配置
# dubbo应用名称
ore.dubbo.application.name=rpc-dj-weapp
# dubbo应用所有者
ore.dubbo.application.owner=zengqi
# dubbo服务注册地址
ore.dubbo.registry.address=zookeeper://192.168.3.206:2181
# dubbo服务注册超时时间
ore.dubbo.registry.timeout=30000
# 默认协议:dubbo
ore.dubbo.protocol.name=dubbo
# dubbo服务扫描包路径
ore.dubbo.scan=cn.com.glsx.dj.weapp.remote
# dubbo自定义过滤器配置
ore.dubbo.provider.enabled=true
ore.dubbo.provider.filter=过滤器名称
#----------------------------------------------------------------------------------------------------------
# druid连接池及数据源配置
ore.druid.url=jdbc:mysql://host:port/数据库名?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
ore.druid.driver-class=com.mysql.jdbc.Driver
ore.druid.username=用户名
ore.druid.password=密码
ore.druid.initial-size=1
ore.druid.min-idle=1
ore.druid.max-active=20
ore.druid.test-on-borrow=true
# druid连接池监控配置
# 是否开启监控
ore.druid.monitor.enabled=true
# 监控后台用户名,默认:admin
ore.druid.monitor.login-username=admin
# 监控后台密码,默认:admin123
ore.druid.monitor.login-password=admin123
# 监控访问路径匹配规则,默认:/druid/*
ore.druid.monitor.url-mappings=/druid/*
# 监控访问IP白名单,多个以英文逗号“,”隔开,默认:127.0.0.1
ore.druid.monitor.allow=127.0.0.1
# 监控访问IP黑名单(存在共同时,deny优先于allow),多个以英文逗号“,”隔开
ore.druid.monitor.deny=192.168.0.1
# 是否能够重置数据,默认:false,则隐藏页面重置按钮
ore.druid.monitor.reset-enable=false
#----------------------------------------------------------------------------------------------------------
# mybatis配置
# 实体模型包
mybatis.type-aliases-package=cn.com.glsx.dj.weapp.model
# SQL脚本文件路径
mybatis.mapper-locations=classpath:/META-INF/orm/*Mapper.xml
mapper.mappers=org.oreframework.datasource.mybatis.mapper.OreMapper
mapper.not-empty=false
mapper.identity=MYSQL
#----------------------------------------------------------------------------------------------------------
# 分页配置
pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql
#----------------------------------------------------------------------------------------------------------
# Freemarker模板配置
# 模板存放路径
spring.freemarker.template-loader-path=classpath:/templates/
# 是否开启模板缓存,默认是开启,开发时请关闭
spring.freemarker.cache=false
# 模板的编码设置,默认UTF-8
spring.freemarker.charset=UTF-8
# 是否检测模板已存在本地
spring.freemarker.check-template-location=true
# 模板的媒体类型设置,默认为text/html
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=true
spring.freemarker.expose-session-attributes=true
spring.freemarker.request-context-attribute=request
# 后缀设置,默认为.ftl
spring.freemarker.suffix=.ftl
┌------------------------------------------------------------┐
注:如需使用freemarker需在pom中添加如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# kafka生产者配置
spring.kafka.bootstrap-servers=192.168.3.207:9092
spring.kafka.template.default-topic=消息主题
┌------------------------------------------------------------┐
注:如需使用kafka发送消息需在pom中添加如下依赖
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
└------------------------------------------------------------┘
#----------------------------------------------------------------------------------------------------------
# kafka消费者配置
spring.kafka.consumer.group-id=rpc-dj-weapp-consumer
spring.kafka.consumer.auto-offset-reset=smallest
spring.kafka.properties.zookeeper.connect=192.168.3.207:2181
spring.kafka.properties.zookeeper.connection.timeout.ms=15000
spring.kafka.properties.zookeeper.session.timeout.ms=15000
spring.kafka.properties.nThreads=5
spring.kafka.properties.topic=消息主题
spring.kafka.properties.auto.commit.interval.ms=1000
┌------------------------------------------------------------┐
注:如需使用kafka接收消息需在pom中添加如下依赖
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-kafka</artifactId>
</dependency>
└------------------------------------------------------------┘
\ No newline at end of file \ No newline at end of file
server.port=9274
server.display-name=rpc-dj-weapp
server.servlet.context-path=/rpc-dj-weapp
server.servlet.application-display-name=rpc-dj-weapp
logging.config=classpath:logback.xml
logging.path=/data/java_log/jetty/rpc-dj-weapp/rpc-dj-weapp.log
logging.level.root=info
ore.starter.class-name=Main
# diamond config
ore.diamond.group=dijia
ore.diamond.dataId=rpc-dj-weapp
ore.diamond.env=release
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<property resource="config/application.properties" />
<property name="APP_NAME" value="${server.display-name}" />
<property name="LOG_PATH" value="${logging.path}" />
<property name="LOG_LEVEL" value="${logging.level}" />
<contextName>${APP_NAME}</contextName>
<turboFilter class="org.oreframework.boot.logging.logback.OreBootTurboFilter">
<Marker>oreframework</Marker>
</turboFilter>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</pattern>
</layout>
</appender>
<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- <Encoding> Label Old version of this label can not be used -->
<!-- <Encoding>UTF-8</Encoding> -->
<File>${LOG_PATH}</File>
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<FileNamePattern>${LOG_PATH}.%d{yyyy-MM-dd}.%i</FileNamePattern>
<MaxHistory>15</MaxHistory>
<maxFileSize>200MB</maxFileSize>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${APP_NAME}] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
</layout>
<!-- 根据文件大小滚动,不支持 SizeBasedTriggeringPolicy 这种配置-->
<!-- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>200MB</MaxFileSize>
</triggeringPolicy> -->
</appender>
<root level="${LOG_LEVEL}">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
\ No newline at end of file \ No newline at end of file
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/name="LOG_PATH"/!d;s/.*value="\(.*\)".*/\1/g' classes/logback.xml`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
DUMP_DIR=$LOGS_DIR/dump
if [ ! -d $DUMP_DIR ]; then
mkdir $DUMP_DIR
fi
DUMP_DATE=`date +%Y%m%d%H%M%S`
DATE_DIR=$DUMP_DIR/$DUMP_DATE
if [ ! -d $DATE_DIR ]; then
mkdir $DATE_DIR
fi
echo -e "Dumping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
jstack $PID > $DATE_DIR/jstack-$PID.dump 2>&1
echo -e ".\c"
jinfo $PID > $DATE_DIR/jinfo-$PID.dump 2>&1
echo -e ".\c"
jstat -gcutil $PID > $DATE_DIR/jstat-gcutil-$PID.dump 2>&1
echo -e ".\c"
jstat -gccapacity $PID > $DATE_DIR/jstat-gccapacity-$PID.dump 2>&1
echo -e ".\c"
jmap $PID > $DATE_DIR/jmap-$PID.dump 2>&1
echo -e ".\c"
jmap -heap $PID > $DATE_DIR/jmap-heap-$PID.dump 2>&1
echo -e ".\c"
jmap -histo $PID > $DATE_DIR/jmap-histo-$PID.dump 2>&1
echo -e ".\c"
if [ -r /usr/sbin/lsof ]; then
/usr/sbin/lsof -p $PID > $DATE_DIR/lsof-$PID.dump
echo -e ".\c"
fi
done
if [ -r /bin/netstat ]; then
/bin/netstat -an > $DATE_DIR/netstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/iostat ]; then
/usr/bin/iostat > $DATE_DIR/iostat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/mpstat ]; then
/usr/bin/mpstat > $DATE_DIR/mpstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/vmstat ]; then
/usr/bin/vmstat > $DATE_DIR/vmstat.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/free ]; then
/usr/bin/free -t > $DATE_DIR/free.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/sar ]; then
/usr/bin/sar > $DATE_DIR/sar.dump 2>&1
echo -e ".\c"
fi
if [ -r /usr/bin/uptime ]; then
/usr/bin/uptime > $DATE_DIR/uptime.dump 2>&1
echo -e ".\c"
fi
echo "OK!"
echo "DUMP: $DATE_DIR"
#!/bin/bash
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
./stop.sh
./start.sh $ENV
\ No newline at end of file \ No newline at end of file
#!/bin/bash
cd `dirname $0`
if [ "$1" = "start" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV
else
if [ "$1" = "stop" ]; then
./stop.sh
else
if [ "$1" = "debug" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./start.sh $ENV debug
else
if [ "$1" = "restart" ]; then
ENV=$2
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
./restart.sh $ENV
else
if [ "$1" = "dump" ]; then
./dump.sh
else
echo "ERROR: Please input argument: start or stop or debug or restart or dump"
exit 1
fi
fi
fi
fi
fi
#!/bin/bash
JAVA_HOME="/app/soft/jdk1.8.0_20"
ENV=$1
if [ -z "$ENV" ]; then
echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. "
echo "app exit"
exit 1
fi
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/server.display-name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
SERVER_PORT=`sed '/server.port/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
#LOGS_FILE=`sed '/log4j.appender.logToFile.File/!d;s/.*=//' classes/log4j.properties | tr -d '\r'`
LOGS_FILE=`sed '/logging.path/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
echo "server name is $SERVER_NAME"
echo "server port is $SERVER_PORT"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME already started!"
echo "PID: $PIDS"
exit 1
fi
if [ -n "$SERVER_PORT" ]; then
SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
fi
LOGS_DIR=""
if [ -n "$LOGS_FILE" ]; then
LOGS_DIR=`dirname $LOGS_FILE`
else
LOGS_DIR=$DEPLOY_DIR/logs
fi
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
STDOUT_FILE=$LOGS_DIR/stdout.log
LIB_DIR=$DEPLOY_DIR/lib
LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
JAVA_DEBUG_OPTS=""
if [ "$2" = "debug" ]; then
JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
fi
JAVA_JMX_OPTS=""
if [ "$2" = "jmx" ]; then
JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS=""
BITS=`file $JAVA_HOME/bin/java | grep 64-bit`
if [ -n "$BITS" ]; then
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
else
JAVA_MEM_OPTS=" -server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
echo -e "Starting the $SERVER_NAME ...\c"
nohup $JAVA_HOME/bin/java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS org.oreframework.boot.bootstrap.OreBootApplication env=$ENV > $STDOUT_FILE 2>&1 &
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
if [ -n "$SERVER_PORT" ]; then
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
else
COUNT=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
fi
if [ $COUNT -gt 0 ]; then
break
fi
done
echo "OK!"
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$DEPLOY_DIR" | awk '{print $2}'`
echo "PID: $PIDS"
echo "STDOUT: $STDOUT_FILE"
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/classes
SERVER_NAME=`sed '/application.name/!d;s/.*=//' classes/config/application.properties | tr -d '\r'`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps --no-heading -C java -f --width 1000 | grep "$CONF_DIR" |awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
#if [ "$1" != "skip" ]; then
#$BIN_DIR/dump.sh
#fi
echo -e "Stopping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
kill $PID > /dev/null 2>&1
done
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
COUNT=1
for PID in $PIDS ; do
PID_EXIST=`ps --no-heading -p $PID`
if [ -n "$PID_EXIST" ]; then
COUNT=0
break
fi
done
done
echo "OK!"
echo "PID: $PIDS"
package cn.com.glsx.dj.weapp.remote;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.dj.weapp.Main;
/**
* @Title: BaseRemoteTest.java
* @Description:
* @author zengqi
* @date 2018年1月6日 下午3:58:33
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class, webEnvironment = WebEnvironment.RANDOM_PORT)
public class BaseRemoteTest {
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
public class IntelligentRemindServiceRemoteTest extends BaseRemoteTest{
@Autowired
private IntelligentRemindServiceRemote intelligentRemindServiceRemote;
@Autowired
private IntelligentRemindRuleRemote intelligentRemindRuleRemote;
@Test
public void testService(){
IntelligentRemindServiceDTO dto = new IntelligentRemindServiceDTO();
dto.setMerchantId(122913);
dto.setSearchKey("1");
dto.setMileOrCarAge(5300);
RpcResponse<List<IntelligentRemindServiceDTO>> response = intelligentRemindServiceRemote.getByCondition(dto);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQueryBigRule(){
RpcPagination<IntelligentRemindRule> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
IntelligentRemindRule rule = new IntelligentRemindRule();
rule.setMerchantId(122913);
pagination.setCondition(rule);
RpcResponse<RpcPagination<IntelligentRemindRule>> response = intelligentRemindRuleRemote.selectByPage(pagination);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQuerySmallRule(){
IntelligentRemindRule rule = new IntelligentRemindRule();
rule.setMerchantId(122913);
rule.setRuleClassify("常规");
RpcResponse<List<IntelligentRemindRule>> response = intelligentRemindRuleRemote.getRuleList(rule);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testSaveRule(){
IntelligentRemindRule rule = new IntelligentRemindRule();
rule.setMerchantId(-1);
rule.setRuleClassify("常规");
rule.setRuleName("刹车片4");
rule.setMileRule("10000");
rule.setCreatedBy("admin");
rule.setCreatedDate(new Date());
rule.setUpdatedDate(new Date());
rule.setUpdatedBy("admin");
RpcResponse<IntelligentRemindRule> response = intelligentRemindRuleRemote.insert(rule);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testDeleteRule(){
Integer id = 15;
RpcResponse<Integer> response = intelligentRemindRuleRemote.deleteById(id);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testUpdateRule(){
IntelligentRemindRule rule = new IntelligentRemindRule();
Integer id = 19;
rule.setId(id.longValue());
rule.setMileRule("3000");
RpcResponse<Integer> response = intelligentRemindRuleRemote.update(rule);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQueryService(){
RpcPagination<IntelligentRemindServiceDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
IntelligentRemindServiceDTO service = new IntelligentRemindServiceDTO();
service.setMerchantId(122913);
service.setOnlineFlag("N");
service.setSearchKey("1");
pagination.setCondition(service);
RpcResponse<RpcPagination<IntelligentRemindServiceDTO>> response = intelligentRemindServiceRemote.selectByPage(pagination);
System.out.println(JSON.toJSONString(response));
}
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.dubbo.config.annotation.Reference;
import org.junit.Test;
import java.util.List;
public class IntelligentRminderRemoteTest extends BaseRemoteTest {
@Reference
private IntelligentRminderRemote intelligentRminderRemote;
@Test
public void insertIntelligentReminderTest(){
IntelligentReminder intelligentReminder = new IntelligentReminder();
intelligentReminder.setAccountId(20190501);
intelligentReminder.setMerchantId(2019050113);
intelligentReminder.setMerchantName("0430门店名");
intelligentReminder.setReminderId(20190501);
intelligentReminder.setReminderName("爱车该保养了,送你一张专属保养券");
//1:优惠卷 2:年检
intelligentReminder.setReminderType((byte)1);
//1:爱车保镖 2:嘀加
intelligentReminder.setSource((byte)2);
intelligentReminder.setCreatedBy("yangjia");
intelligentReminder.setUpdatedBy("yangjia");
RpcResponse<IntelligentReminder> intelligentReminderRpcResponse = intelligentRminderRemote.insertIntelligentReminder(intelligentReminder);
System.out.println(intelligentReminderRpcResponse);
}
@Test
public void getIntelligentReminderByIdTest(){
RpcResponse<IntelligentReminder> intelligentReminder = intelligentRminderRemote.getIntelligentReminderById(33l);
System.out.println(intelligentReminder);
}
@Test
public void selectByConditionTest(){
Integer accountId = 91705476;
Integer merchantId = 122913;
RpcPagination<IntelligentReminderDTO> pagination = new RpcPagination();
IntelligentReminderDTO condition = new IntelligentReminderDTO();
condition.setAccountId(accountId);
condition.setMerchantId(merchantId);
pagination.setCondition(condition);
pagination.setPageNum(1);
pagination.setPageSize(10);
RpcResponse<RpcPagination<IntelligentReminderDTO>> listRpcResponse = intelligentRminderRemote.selectByCondition(pagination);
System.out.println(listRpcResponse);
}
@Test
public void updateIntelligentReminderTest(){
IntelligentReminder intelligentReminder = new IntelligentReminder();
intelligentReminder.setId(34l);
intelligentReminder.setMerchantName("05011413名称更新");
intelligentReminder.setUpdatedBy("yangjia");
intelligentRminderRemote.updateReminderByCondition(intelligentReminder);
}
@Test
public void deleterReminderByIdTest(){
intelligentRminderRemote.deleterReminderById(34l);
}
}
package cn.com.glsx.dj.weapp.remote;/**
* @title: MerchantWeappNoticeRemoteTest
* @description: 测试小程序公告接口
* @author: huangsc
* @date: 2020-11-05 14:49
* @version: 1.0
**/
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @title: MerchantWeappNoticeRemoteTest
* @description: 测试小程序公告接口
* @author: huangsc
* @date: 2020-11-05 14:49
* @version: 1.0
*
**/
public class MerchantWeappNoticeRemoteTest extends BaseRemoteTest {
@Autowired
private MerchantWeappNoticeRemote merchantWeappNoticeRemote;
@Test
public void getWeappModuleByConditionTest(){
RpcResponse<MerchantWeappNotice> byMerchantId = merchantWeappNoticeRemote.getByMerchantId(44187652);
System.out.println("byMerchantId = " + byMerchantId);
}
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.dubbo.config.annotation.Reference;
import org.junit.Test;
import java.util.List;
public class MerchatModuleRemoteTest extends BaseRemoteTest {
@Reference
private MerchantModuleRemote merchantModuleRemote;
@Test
public void listMerchantModuleByIdTest(){
Integer merchantId = 20190423;
Long moduleId = 1l;
RpcResponse<List<MerchantModuleDTO>> rpcResponse = merchantModuleRemote.listMerchantModuleById(merchantId,moduleId);
System.out.println(rpcResponse);
}
}
package cn.com.glsx.dj.weapp.remote;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.PageVisitDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.Map;
/**
* @Title: PageVisitCollectRemoteTest.java
* @Description:
* @author zengqi
* @date 2021年6月4日 下午6:54:48
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
public class PageVisitCollectRemoteTest extends BaseRemoteTest {
@Autowired
private PageVisitCollectRemote pageVisitCollectRemote;
@Test
public void collect(){
PageVisitDTO pageVisit = new PageVisitDTO();
pageVisit.setAppId("wx0df0f98cdb6625e6");
pageVisit.setMerchantId(44188010);
pageVisit.setPath("pages/tab/index/index/");
RpcResponse<Map<String,Long>> response = pageVisitCollectRemote.getCount(pageVisit,null,null);
System.out.println(response.getResult());
}
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.UserAddress;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Title UserAddressRemoteTest
* @Description
* @Author zhaojp
* @Date 2020年06月09日 16:40:44
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
public class UserAddressRemoteTest extends BaseRemoteTest{
@Autowired
private UserAddressRemote userAddressRemote;
@Test
public void list(){
UserAddress userAddress = new UserAddress();
RpcResponse<List<UserAddress>> response = userAddressRemote.selectList(userAddress);
System.out.println();
}
@Test
public void insert(){
UserAddress userAddress = new UserAddress();
userAddress.setName("熊大");
userAddress.setPhone("123456789");
userAddress.setAccountId(1);
userAddress.setOpenId("123123");
userAddress.setProvinceName("广东省");
userAddress.setCityName("深圳市");
userAddress.setAreaName("南山区");
userAddress.setAddress("南山智园1号楼");
userAddress.setLng(123D);
userAddress.setLat(123D);
userAddress.setCreatedBy("admin");
RpcResponse<UserAddress> response = userAddressRemote.insert(userAddress);
System.out.println();
}
@Test
public void update(){
UserAddress userAddress = new UserAddress();
userAddress.setId(1);
userAddress.setName("熊二");
userAddress.setUpdatedBy("zjp");
RpcResponse<UserAddress> response = userAddressRemote.update(userAddress);
System.out.println();
}
@Test
public void getById(){
RpcResponse<UserAddress> response = userAddressRemote.getById(1);
System.out.println();
}
}
package cn.com.glsx.dj.weapp.remote;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.VpFocusUserDTO;
import cn.com.glsx.dj.weapp.model.VpFocusUser;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
public class VpFocusUserRemoteTest extends BaseRemoteTest{
@Autowired
private VpFocusUserRemote focusUserRemote;
//@Test
public void testFocus(){
VpFocusUser user = new VpFocusUser();
user.setCreatedBy("admin");
user.setUserId(2);
user.setMerchantId(127803);
user.setFocusedUserId(23);
user.setFocusedMerchantId(44190343);
System.out.println(focusUserRemote.focus(user).getResult());
}
//@Test
public void testCancelFocus(){
VpFocusUser user = new VpFocusUser();
user.setCreatedBy("admin");
user.setUserId(2);
user.setFocusedUserId(23);
System.out.println(focusUserRemote.cancelFocus(user).getResult());
}
//@Test
public void testListWithPage(){
RpcPagination<VpFocusUserDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setNeedCount(true);
VpFocusUserDTO user = new VpFocusUserDTO();
user.setUserId(2);
pagination.setCondition(user);
System.out.println(focusUserRemote.listWithPage(pagination).getResult().getList());
}
@Test
public void test(){
System.out.println(focusUserRemote.isFocus(2,23).getResult());
}
}
package cn.com.glsx.dj.weapp.remote;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.VpMaterialCollect;
public class VpMaterialCollectRemoteTest extends BaseRemoteTest{
@Autowired
private VpMaterialCollectRemote vpMaterialCollectRemote;
//@Test
public void testCollect(){
VpMaterialCollect collect = new VpMaterialCollect();
collect.setCreatedBy("sadmin");
collect.setMaterialId(1);
collect.setUserId(2);
collect.setMerchantId(127803);
System.out.println(vpMaterialCollectRemote.collect(collect).getResult());
}
@Test
public void testIsCollect(){
System.out.println(vpMaterialCollectRemote.isCollect(127803, 1).getResult());
}
}
package cn.com.glsx.dj.weapp.remote;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.VpMaterialInfoDTO;
import cn.com.glsx.dj.weapp.enums.VideoPlusEnum;
import cn.com.glsx.dj.weapp.model.VpMaterialCarSeries;
import cn.com.glsx.dj.weapp.model.VpMaterialDescription;
import cn.com.glsx.dj.weapp.model.VpMaterialInfo;
import cn.com.glsx.dj.weapp.model.VpMaterialResource;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.StatusEnum;
public class VpMaterialInfoRemoteTest extends BaseRemoteTest{
@Autowired
private VpMaterialInfoRemote vpMaterialInfoRemote;
//@Test
public void testListWithPage(){
RpcPagination<VpMaterialInfoDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
pagination.setNeedCount(true);
VpMaterialInfoDTO condition = new VpMaterialInfoDTO();
condition.setMerchantId(122913);
condition.setType((byte)5);
pagination.setCondition(condition);
System.out.println(vpMaterialInfoRemote.listWithPage(pagination).getResult().getList());
}
//@Test
public void testUpdateOnlineFlag(){
VpMaterialInfo info = new VpMaterialInfo();
info.setId(1);
info.setOnlineFlag(StatusEnum.NO.getValue());
info.setUpdatedBy("sadmin");
System.out.println(vpMaterialInfoRemote.updateOnlineFlag(info).getResult());
}
//@Test
public void testInsert(){
VpMaterialInfoDTO dto = new VpMaterialInfoDTO();
dto.setCreatedBy("sadmin");
dto.setUserId(1);
dto.setMerchantId(122913);
dto.setTemplateNum((byte)0);
dto.setLogoUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101175823074c758a11fbfc3403f96298c21a292d4fe.png");
dto.setMusicUrl("https://www.w3cschool.cn//statics/demosource/horse.mp3");
dto.setCopywriting("文案内容");
List<VpMaterialResource> tplResList = new ArrayList<>();
VpMaterialResource r1 = new VpMaterialResource();
r1.setBizNum((byte)1);
r1.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
r1.setResType(VideoPlusEnum.ResourceType.IMAGE.getValue());
tplResList.add(r1);
VpMaterialResource r2 = new VpMaterialResource();
r2.setBizNum((byte)2);
r2.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/video/2020041517135696254f0cdec26bd41de8c1ce7532b8c8b24.mp4");
r2.setResType(VideoPlusEnum.ResourceType.VIDEO.getValue());
tplResList.add(r2);
dto.setTplResList(tplResList);
dto.setName("测试模板0");
dto.setType((byte)5);
dto.setTypeName("改装装潢");
dto.setSubType(501);
dto.setSubTypeName("升级改装");
List<VpMaterialCarSeries> carSeriesList = new ArrayList<>();
VpMaterialCarSeries carSeries1 = new VpMaterialCarSeries();
carSeries1.setCarBrand("安凯客车");
carSeries1.setCarBrandId(7);
carSeries1.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/8d471c00-cec0-4167-9ff8-34d3bff5b2aa.png");
carSeries1.setCarChildsBrandId(8);
carSeries1.setCarChildsBrandName("安凯客车");
carSeries1.setCarSeriesId(103);
carSeries1.setCarSeriesName("宝斯通");
carSeriesList.add(carSeries1);
VpMaterialCarSeries carSeries2 = new VpMaterialCarSeries();
carSeries2.setCarBrand("广汽集团");
carSeries2.setCarBrandId(220);
carSeries2.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/262760ed-db53-45c6-8583-db96cddeb27c.png");
carSeries2.setCarChildsBrandId(222);
carSeries2.setCarChildsBrandName("广汽丰田");
carSeries2.setCarSeriesId(1147);
carSeries2.setCarSeriesName("雷凌");
carSeriesList.add(carSeries2);
dto.setCarSeriesList(carSeriesList);
dto.setLabelName("自定义标签");
dto.setProductCoverUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101143713625836643420ccd463dbc485ec05ad3f4a4.png");
List<VpMaterialResource> pmpResList = new ArrayList<>();
VpMaterialResource r3 = new VpMaterialResource();
r3.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r3);
VpMaterialResource r4 = new VpMaterialResource();
r4.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r4);
dto.setPmpResList(pmpResList);
List<VpMaterialDescription> descriptionList = new ArrayList<>();
VpMaterialDescription d1 = new VpMaterialDescription();
d1.setContent("文本内容");
d1.setType(VideoPlusEnum.DescriptionType.TEXT.getValue());
descriptionList.add(d1);
VpMaterialDescription d2 = new VpMaterialDescription();
d2.setContent("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
d2.setType(VideoPlusEnum.DescriptionType.IMAGE.getValue());
descriptionList.add(d2);
dto.setDescriptionList(descriptionList);
System.out.println(vpMaterialInfoRemote.insert(dto).getResult());
}
//@Test
public void testUpdateNotRebuildVideo(){
VpMaterialInfoDTO dto = new VpMaterialInfoDTO();
dto.setId(4);
dto.setUpdatedBy("sadmin");
dto.setName("测试模板1");
dto.setType((byte)6);
dto.setTypeName("美容保养");
dto.setSubType(601);
dto.setSubTypeName("美容清洗");
List<VpMaterialCarSeries> carSeriesList = new ArrayList<>();
VpMaterialCarSeries carSeries1 = new VpMaterialCarSeries();
carSeries1.setCarBrand("安凯客车");
carSeries1.setCarBrandId(7);
carSeries1.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/8d471c00-cec0-4167-9ff8-34d3bff5b2aa.png");
carSeries1.setCarChildsBrandId(8);
carSeries1.setCarChildsBrandName("安凯客车");
carSeries1.setCarSeriesId(103);
carSeries1.setCarSeriesName("宝斯通");
carSeriesList.add(carSeries1);
dto.setCarSeriesList(carSeriesList);
dto.setLabelName("自定义标签1");
dto.setProductCoverUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101143713625836643420ccd463dbc485ec05ad3f4a4.png");
List<VpMaterialResource> pmpResList = new ArrayList<>();
VpMaterialResource r3 = new VpMaterialResource();
r3.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r3);
dto.setPmpResList(pmpResList);
List<VpMaterialDescription> descriptionList = new ArrayList<>();
VpMaterialDescription d1 = new VpMaterialDescription();
d1.setContent("文本内容");
d1.setType(VideoPlusEnum.DescriptionType.TEXT.getValue());
descriptionList.add(d1);
dto.setDescriptionList(descriptionList);
System.out.println(vpMaterialInfoRemote.updateNotRebuildVideo(dto).getResult());
}
//@Test
public void testUpdateRebuildVideo(){
VpMaterialInfoDTO dto = new VpMaterialInfoDTO();
dto.setId(4);
dto.setUpdatedBy("sadmin");
dto.setTemplateNum((byte)0);
dto.setLogoUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101175823074c758a11fbfc3403f96298c21a292d4fe.png");
dto.setMusicUrl("https://www.w3cschool.cn//statics/demosource/horse.mp3");
dto.setCopywriting("文案内容");
List<VpMaterialResource> tplResList = new ArrayList<>();
VpMaterialResource r1 = new VpMaterialResource();
r1.setBizNum((byte)1);
r1.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
r1.setResType(VideoPlusEnum.ResourceType.IMAGE.getValue());
tplResList.add(r1);
dto.setTplResList(tplResList);
dto.setName("测试模板1");
dto.setType((byte)6);
dto.setTypeName("美容保养");
dto.setSubType(601);
dto.setSubTypeName("美容清洗");
List<VpMaterialCarSeries> carSeriesList = new ArrayList<>();
VpMaterialCarSeries carSeries1 = new VpMaterialCarSeries();
carSeries1.setCarBrand("安凯客车");
carSeries1.setCarBrandId(7);
carSeries1.setCarBrandLogo("http://qcimg01.glsx.net:7060/upload/carbrand/8d471c00-cec0-4167-9ff8-34d3bff5b2aa.png");
carSeries1.setCarChildsBrandId(8);
carSeries1.setCarChildsBrandName("安凯客车");
carSeries1.setCarSeriesId(103);
carSeries1.setCarSeriesName("宝斯通");
carSeriesList.add(carSeries1);
dto.setCarSeriesList(carSeriesList);
//dto.setLabelName("自定义标签1");
//dto.setProductCoverUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/20191101143713625836643420ccd463dbc485ec05ad3f4a4.png");
List<VpMaterialResource> pmpResList = new ArrayList<>();
VpMaterialResource r3 = new VpMaterialResource();
r3.setResUrl("https://dj.test.glsx.com.cn/web-dj-site/upload/image/201911011437019130fe4a570199d42f386881ec2c09d05be.png");
pmpResList.add(r3);
dto.setPmpResList(pmpResList);
List<VpMaterialDescription> descriptionList = new ArrayList<>();
VpMaterialDescription d1 = new VpMaterialDescription();
d1.setContent("文本内容");
d1.setType(VideoPlusEnum.DescriptionType.TEXT.getValue());
descriptionList.add(d1);
dto.setDescriptionList(descriptionList);
System.out.println(vpMaterialInfoRemote.updateRebuildVideo(dto).getResult());
}
@Test
public void testDeleteById(){
System.out.println(vpMaterialInfoRemote.deleteById(11).getResult());
}
}
package cn.com.glsx.dj.weapp.remote;
import cn.com.glsx.dj.weapp.model.WeappModule;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.dubbo.config.annotation.Reference;
import org.junit.Test;
public class WeappModuleRemoteTest extends BaseRemoteTest{
@Reference
private WeappModuleRemote weappModuleRemote;
@Test
public void getWeappModuleByConditionTest(){
WeappModule weappModule = new WeappModule();
weappModule.setModuleAlias("HOME");
RpcResponse<WeappModule> weappModuleRpcResponse = weappModuleRemote.getWeappModuleByCondition(weappModule);
System.out.println(weappModuleRpcResponse);
}
}
package cn.com.glsx.dj.weapp.service;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.dj.weapp.Main;
/**
* @Title: BaseServiceTest.java
* @Description:
* @author zengqi
* @date 2018年1月6日 下午1:23:03
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class, webEnvironment = WebEnvironment.RANDOM_PORT)
public class BaseServiceTest {
}
package cn.com.glsx.dj.weapp.service;/**
* @title: IntelligentRemindServeServiceTest
* @description: 测试插入
* @author: huangsc
* @date: 2020-11-03 14:33
* @version: 1.0
**/
import java.util.List;
import java.util.function.Consumer;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.model.IntelligentRemindService;
import cn.com.glsx.dj.weapp.remote.BaseRemoteTest;
public class IntelligentRemindServeServiceTest extends BaseRemoteTest {
@Autowired
private IntelligentRemindServeService intelligentRemindServeService;
@Test
public void getRemindServiceList(){
IntelligentRemindServiceListConditionDTO conditionDTO = new IntelligentRemindServiceListConditionDTO();
conditionDTO.setMerchantId(44187815);
conditionDTO.setClassifyTagId(1L);
List<IntelligentRemindService> list = intelligentRemindServeService.getRemindServiceList(conditionDTO);
list.forEach(new Consumer<IntelligentRemindService>() {
@Override
public void accept(IntelligentRemindService t) {
System.out.println(t);
}
});
}
}
package cn.com.glsx.dj.weapp.service;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTagRef;
/**
* @Title: IntelligentRemindServiceClassifyTagRefServiceTest.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午3:04:09
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
public class IntelligentRemindServiceClassifyTagRefServiceTest extends BaseServiceTest {
@Autowired
private IntelligentRemindServiceClassifyTagRefService intelligentRemindServiceClassifyTagRefService;
@Test
public void add(){
IntelligentRemindServiceClassifyTagRef serviceClassifyTagRef = new IntelligentRemindServiceClassifyTagRef();
serviceClassifyTagRef.setServiceId(300L);
serviceClassifyTagRef.setClassifyTagId(3L);
serviceClassifyTagRef.setCreatedBy("admin");
serviceClassifyTagRef.setUpdatedBy("admin");
serviceClassifyTagRef = intelligentRemindServiceClassifyTagRefService.add(serviceClassifyTagRef);
System.out.println(serviceClassifyTagRef);
}
@Test
public void deleteByServiceId(){
Long serviceId = 300L;
Integer result = intelligentRemindServiceClassifyTagRefService.deleteByServiceId(serviceId);
System.out.println(result);
}
}
package cn.com.glsx.dj.weapp.service;
import java.util.List;
import java.util.function.Consumer;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
/**
* @Title: IntelligentRemindServiceClassifyTagServiceTest.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午1:48:16
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
public class IntelligentRemindServiceClassifyTagServiceTest extends BaseServiceTest {
@Autowired
private IntelligentRemindServiceClassifyTagService intelligentRemindServiceClassifyTagService;
@Test
public void add(){
IntelligentRemindServiceClassifyTag serviceClassifyTag = new IntelligentRemindServiceClassifyTag();
serviceClassifyTag.setMerchantId(44187815);
serviceClassifyTag.setClassifyTagName("双保");
serviceClassifyTag.setCreatedBy("admin");
serviceClassifyTag.setUpdatedBy("admin");
serviceClassifyTag = intelligentRemindServiceClassifyTagService.add(serviceClassifyTag);
System.out.println(serviceClassifyTag);
}
@Test
public void delete(){
Long classifyTagId = 1L;
Boolean result = intelligentRemindServiceClassifyTagService.delete(classifyTagId);
Assert.assertTrue(result);
}
@Test
public void list(){
Integer merchantId = 44187815;
List<IntelligentRemindServiceClassifyTag> list = intelligentRemindServiceClassifyTagService.list(merchantId);
list.forEach(new Consumer<IntelligentRemindServiceClassifyTag>() {
@Override
public void accept(IntelligentRemindServiceClassifyTag t) {
System.out.println(t);
}
});
}
@Test
public void getByServiceId(){
Long serviceId = 310L;
List<IntelligentRemindServiceClassifyTag> list = intelligentRemindServiceClassifyTagService.getByServiceId(serviceId);
list.forEach(new Consumer<IntelligentRemindServiceClassifyTag>() {
@Override
public void accept(IntelligentRemindServiceClassifyTag t) {
System.out.println(t);
}
});
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceCopyInfoDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.enums.StatusEnum;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.dj.weapp.model.IntelligentRemindRule;
import cn.com.glsx.dj.weapp.remote.BaseRemoteTest;
import cn.com.glsx.dj.wechat.enums.WechatUserTypeEnum;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
public class IntelligentRemindServiceTest extends BaseRemoteTest{
@Autowired
private IntelligentRemindRuleService intelligentRemindRuleService;
@Autowired
private IntelligentRemindServeService intelligentRemindService;
@Autowired
private CustomerServiceMessageService messageService;
@Test
public void testService(){
IntelligentRemindServiceDTO dto = new IntelligentRemindServiceDTO();
dto.setMerchantId(123);
dto.setSearchKey("1");
dto.setMileOrCarAge(3000);
List<IntelligentRemindServiceDTO> response = intelligentRemindService.getByCondition(dto);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQuerySmallRule(){
IntelligentRemindRule rule = new IntelligentRemindRule();
rule.setMerchantId(122912);
rule.setRuleClassify("常规");
List<IntelligentRemindRule> response = intelligentRemindRuleService.getRuleList(rule);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testSaveRule(){
IntelligentRemindRule rule = new IntelligentRemindRule();
rule.setMerchantId(122913);
rule.setRuleClassify("增值");
rule.setRuleName("小保养");
rule.setMileRule("5000");
rule.setSeasonRule("3-5");
rule.setCreatedBy("admin");
rule.setCreatedDate(new Date());
rule.setUpdatedDate(new Date());
rule.setUpdatedBy("admin");
IntelligentRemindRule response = intelligentRemindRuleService.insert(rule);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQueryServiceDetail(){
Integer id = 2;
IntelligentRemindServiceDTO response = intelligentRemindService.getById(id);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testQueryRuleDetail(){
Integer id = 2;
IntelligentRemindRule response = intelligentRemindRuleService.getById(id);
System.out.println(JSON.toJSONString(response));
}
@Test
public void testGetMerchantList(){
List<CustomerServiceMessage> list = messageService.getMerchantByUnread(StatusEnum.UNREAD.getValue(), WechatUserTypeEnum.CUSTOMER.getValue());
System.out.println(JSON.toJSONString(list));
}
@Test
public void copyRemindService(){
IntelligentRemindServiceCopyInfoDTO copyInfo = new IntelligentRemindServiceCopyInfoDTO();
copyInfo.setSourceRemindServiceId(30);
copyInfo.setTargetMerchantId(199211);
copyInfo.setSourceRemindServiceIds("30,31");
copyInfo.setTargetMerchantIds("44188010,199211");
Integer count = intelligentRemindService.copyRemindService(copyInfo);
System.out.println(count);
}
}
package cn.com.glsx.dj.weapp.service;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.model.IntelligentReminder;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class IntelligentReminderServiceTest extends BaseServiceTest {
@Autowired
private IntelligentReminderService intelligentReminderService;
// IntelligentRemindServeService
@Test
public void insertIntelligentReminderTest(){
IntelligentReminder intelligentReminder = new IntelligentReminder();
intelligentReminder.setAccountId(91705476);
intelligentReminder.setMerchantId(2019043020);
intelligentReminder.setMerchantName("0430门店名");
intelligentReminder.setReminderId(91705476);
intelligentReminder.setReminderName("爱车该保养了,送你一张专属保养券");
//1:优惠卷 2:年检
intelligentReminder.setReminderType((byte)1);
//1:爱车保镖 2:嘀加
intelligentReminder.setSource((byte)2);
intelligentReminder.setCreatedBy("yangjia");
intelligentReminder.setUpdatedBy("yangjia");
intelligentReminderService.insertIntelligentReminder(intelligentReminder);
}
@Test
public void getIntelligentReminderTest(){
IntelligentReminder intelligentReminder = intelligentReminderService.getIntelligentReminderById(33l);
System.out.println(intelligentReminder);
}
@Test
public void updateIntelligentReminderTest(){
IntelligentReminder intelligentReminder = new IntelligentReminder();
intelligentReminder.setId(33l);
intelligentReminder.setMerchantName("0501名称更新");
intelligentReminder.setUpdatedBy("yangjia");
intelligentReminderService.updateReminderByCondition(intelligentReminder);
}
@Test
public void selectByConditionTest(){
Integer accountId = 91705476;
Integer merchantId = 122913;
RpcPagination<IntelligentReminderDTO> pagination = new RpcPagination<>();
IntelligentReminderDTO condition = new IntelligentReminderDTO();
condition.setAccountId(accountId);
condition.setMerchantId(merchantId);
pagination.setCondition(condition);
pagination.setPageNum(1);
pagination.setPageSize(10);
List<IntelligentReminderDTO> list = intelligentReminderService.selectByCondition(pagination);
System.out.println(list);
}
@Test
public void deleterReminderByIdTest(){
intelligentReminderService.deleterReminderById(33l);
}
// intelligentRemindServeService
// remindServiceRemote
@Test
public void deleterReminderByIdTest2(){
IntelligentRemindServiceDTO dto = new IntelligentRemindServiceDTO();
//商户id
dto.setMerchantId(44184606);
dto.setRemindRuleId(639);
}
}
package cn.com.glsx.dj.weapp.service;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.weapp.model.MerchantWeappNotice;
/**
* @Title: MerchantWeappNoticeServiceTest.java
* @Description:
* @author Alvin
* @date 2019年5月1日 上午9:49:04
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
public class MerchantWeappNoticeServiceTest extends BaseServiceTest {
@Autowired
private MerchantWeappNoticeService merchantWeappNoticeService;
private String appId = "wx73abd06f43ecdad6";
private Integer merchantId = 10000;
@Test
public void testMerge(){
MerchantWeappNotice merchantWeappNotice = new MerchantWeappNotice();
merchantWeappNotice.setMerchantId(merchantId);
merchantWeappNotice.setAppId(appId);
merchantWeappNotice.setNotice("五一节大甩卖,全场低至1折起");
merchantWeappNotice = merchantWeappNoticeService.merge(merchantWeappNotice);
System.out.println(merchantWeappNotice);
}
@Test
public void testGetByMerchantId(){
MerchantWeappNotice merchantWeappNotice = merchantWeappNoticeService.getByMerchantId(merchantId);
System.out.println(merchantWeappNotice);
}
@Test
public void testGetByAppId(){
MerchantWeappNotice merchantWeappNotice = merchantWeappNoticeService.getByAppId(appId);
System.out.println(merchantWeappNotice);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!-- 数据库驱动-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="org.oreframework.datasource.mybatis.mapper.OreMapper"/>
<property name="caseSensitive" value="true"/>
<property name="useActualColumnNames" value="true" />
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.227:3306/glsx_dj?characterEncoding=utf8" userId="dev_admin" password="1f7e1ed2" />
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="cn.com.glsx.dj.weapp.model" targetProject="../rpc-dj-weapp-api/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="META-INF/orm" targetProject="src/main/resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.com.glsx.dj.weapp.mapper" targetProject="MAVEN" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="dj_weapp_intelligent_remind_service_classify_tag" domainObjectName="IntelligentRemindServiceClassifyTag" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
<table tableName="dj_weapp_intelligent_remind_service_classify_tag_ref" domainObjectName="IntelligentRemindServiceClassifyTagRef" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!