Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -7,6 +8,8 @@ import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务提成比例对象 sys_commision
|
||||
@ -28,6 +31,8 @@ public class SysCommision extends BaseEntity {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
/**
|
||||
* 岗位id
|
||||
*/
|
||||
@ -54,6 +59,11 @@ public class SysCommision extends BaseEntity {
|
||||
@Excel(name = "比例", suffix = "%")
|
||||
private Float rate;
|
||||
|
||||
/** 比例开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 提成
|
||||
*/
|
||||
|
@ -22,6 +22,8 @@ public class SysNutritionalVideo extends BaseEntity
|
||||
@Excel(name = "视频分类ID")
|
||||
private Long cateId;
|
||||
|
||||
private String cateName;
|
||||
|
||||
/** 阿里云视频ID */
|
||||
@Excel(name = "阿里云视频ID")
|
||||
private String videoId;
|
||||
@ -30,6 +32,9 @@ public class SysNutritionalVideo extends BaseEntity
|
||||
@Excel(name = "视频封面URL")
|
||||
private String coverUrl;
|
||||
|
||||
//预览URL
|
||||
private String previewUrl;
|
||||
|
||||
/** 视频标题 */
|
||||
@Excel(name = "视频标题")
|
||||
private String title;
|
||||
@ -50,9 +55,21 @@ public class SysNutritionalVideo extends BaseEntity
|
||||
@Excel(name = "是否显示,0不显示 1显示,默认0")
|
||||
private Integer showFlag;
|
||||
|
||||
/** 优先级,默认0 */
|
||||
@Excel(name = "优先级,默认0")
|
||||
private Long priorityLevel;
|
||||
|
||||
/** 视频付费等级,0无需付费 1客户可看 2付费可看 */
|
||||
@Excel(name = "视频付费等级,0无需付费 1客户可看 2付费可看")
|
||||
private Long payLevel;
|
||||
|
||||
private String payLevelName;
|
||||
|
||||
/** 删除标识,0未删除 1已删除,默认0 */
|
||||
private Integer delFlag;
|
||||
|
||||
//文件名称
|
||||
private String fileName;
|
||||
|
||||
private String key;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 视频分类对象 sys_video_classify
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-05-05
|
||||
*/
|
||||
@Data
|
||||
public class SysVideoClassify extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 分类名称 */
|
||||
@Excel(name = "分类名称")
|
||||
private String cateName;
|
||||
|
||||
/** 类型标识,0全部可看 1客户可看 2额外付费观看 */
|
||||
@Excel(name = "类型标识,0全部可看 1客户可看 2额外付费观看")
|
||||
private Integer payFlag;
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Integer delFlag;
|
||||
}
|
@ -68,4 +68,6 @@ public interface SysCommisionMapper
|
||||
* @return
|
||||
*/
|
||||
List<SysCommision> getAfterSaleAndNutri(SysCommision sysCommision);
|
||||
|
||||
List<Long> getAfterSaleId(SysCommision sysCommision);
|
||||
}
|
||||
|
@ -66,4 +66,13 @@ public interface SysNutritionalVideoMapper
|
||||
* @return
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(@Param("videoId")String videoId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新微信展示状态
|
||||
* @param wxShow
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(@Param("wxShow")Integer wxShow, @Param("array") Long[] ids);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysVideoClassify;
|
||||
|
||||
/**
|
||||
* 视频分类Mapper接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-05-05
|
||||
*/
|
||||
public interface SysVideoClassifyMapper
|
||||
{
|
||||
/**
|
||||
* 查询视频分类
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 视频分类
|
||||
*/
|
||||
public SysVideoClassify selectSysVideoClassifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询视频分类列表
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 视频分类集合
|
||||
*/
|
||||
public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 新增视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysVideoClassify(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 修改视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysVideoClassify(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 删除视频分类
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除视频分类
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取所有类别
|
||||
* @return
|
||||
*/
|
||||
public List<SysVideoClassify> getAllClassify();
|
||||
}
|
@ -62,4 +62,11 @@ public interface ISysCommisionService
|
||||
public int deleteSysCommisionById(Long ruleId);
|
||||
|
||||
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 查询售后、营养师用户信息
|
||||
* @param sysCommision
|
||||
* @return
|
||||
*/
|
||||
List<Long> getAfterSaleId(SysCommision sysCommision);
|
||||
}
|
||||
|
@ -39,4 +39,11 @@ public interface ISysCommissionDayService {
|
||||
*/
|
||||
AjaxResult calculateOrderCommissionDetail(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 根据开始生效时间分类提成比例
|
||||
* @param tmpComList
|
||||
* @return
|
||||
*/
|
||||
Map<String, List<SysCommision>> getRateMapByStartTime(List<SysCommision> tmpComList);
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
|
||||
/**
|
||||
@ -25,7 +27,7 @@ public interface ISysNutritionalVideoService
|
||||
* @param sysNutritionalVideo 营养视频
|
||||
* @return 营养视频集合
|
||||
*/
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo);
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo, boolean flag);
|
||||
|
||||
/**
|
||||
* 新增营养视频
|
||||
@ -65,4 +67,18 @@ public interface ISysNutritionalVideoService
|
||||
* @return
|
||||
*/
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(String videoId);
|
||||
|
||||
/**
|
||||
* 阿里云视频查询检索
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> searchVideo(String key, Integer status, Integer pageNo, Integer pageSize, String scrollToken);
|
||||
|
||||
/**
|
||||
* 更新微信展示状态
|
||||
* @param wxShow
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(Integer wxShow, Long[] ids);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysVideoClassify;
|
||||
|
||||
/**
|
||||
* 视频分类Service接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-05-05
|
||||
*/
|
||||
public interface ISysVideoClassifyService
|
||||
{
|
||||
/**
|
||||
* 查询视频分类
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 视频分类
|
||||
*/
|
||||
public SysVideoClassify selectSysVideoClassifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询视频分类列表
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 视频分类集合
|
||||
*/
|
||||
public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 新增视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysVideoClassify(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 修改视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysVideoClassify(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 批量删除视频分类
|
||||
*
|
||||
* @param ids 需要删除的视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除视频分类信息
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyById(Long id);
|
||||
|
||||
/**
|
||||
* 获取所有类别
|
||||
* @return
|
||||
*/
|
||||
public List<SysVideoClassify> getAllClassify();
|
||||
}
|
@ -98,4 +98,14 @@ public class SysCommisionServiceImpl implements ISysCommisionService
|
||||
public List<SysCommision> selectSysCommisionDetail(SysCommision sysCommision) {
|
||||
return sysCommisionMapper.selectSysCommisionDetail(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询售后、营养师用户信息
|
||||
* @param sysCommision
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getAfterSaleId(SysCommision sysCommision){
|
||||
return sysCommisionMapper.getAfterSaleId(sysCommision);
|
||||
}
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
//该笔订单当月的成交总额
|
||||
sysOrderCommisionDayDetail.setMonthOrderTotalAmount(everyMonthTotalAmountMap.get(yearMonth));
|
||||
//该笔订单对应提成比例
|
||||
sysOrderCommisionDayDetail.setCommissionRate(rateMap.get(yearMonth));
|
||||
sysOrderCommisionDayDetail.setCommissionRate(rateMap.get(yearMonth) == null ? rateMap.get("19001") : rateMap.get(yearMonth));
|
||||
//计算该笔订单总提成
|
||||
sysOrderCommisionDayDetail.setOrderCommission(getMoney(sysOrderCommisionDayDetail.getOrderAmount().doubleValue() * sysOrderCommisionDayDetail.getCommissionRate() / 100D));
|
||||
//每年每月提成
|
||||
@ -357,24 +357,43 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
tmpQueryCom.setPostId(postId);
|
||||
List<SysCommision> tmpComList = sysCommisionMapper.selectSysCommisionList(tmpQueryCom);
|
||||
Map<String, Float> rateMap = new TreeMap<>(new MyComparator());
|
||||
//取第一个区间为默认提成比例
|
||||
rateMap.put("19001", (tmpComList != null && tmpComList.size() > 0) ? tmpComList.get(0).getRate() : 0.0F);
|
||||
//按比例开始时间分类
|
||||
Map<String, List<SysCommision>> rateYearMonthMap = getRateMapByStartTime(tmpComList);
|
||||
for(String yearMonth : amountMap.keySet()){
|
||||
BigDecimal orderAmount = amountMap.get(yearMonth);
|
||||
rateMap.put(yearMonth, 0F);
|
||||
if(tmpComList != null && tmpComList.size() > 0){
|
||||
for (int i = 0; i < tmpComList.size(); i++) {
|
||||
SysCommision com = tmpComList.get(i);
|
||||
List<SysCommision> yearMonthRateList = null;
|
||||
for (String rateMonth : rateYearMonthMap.keySet()) {
|
||||
if(Long.parseLong(yearMonth) >= Long.parseLong(rateMonth)){
|
||||
yearMonthRateList = rateYearMonthMap.get(rateMonth);
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(yearMonthRateList != null && yearMonthRateList.size() > 0){
|
||||
for (int i = 0; i < yearMonthRateList.size(); i++) {
|
||||
SysCommision com = yearMonthRateList.get(i);
|
||||
double cAmount = com.getAmount().floatValue();
|
||||
if (orderAmount.floatValue() <= cAmount && i == 0) {
|
||||
Long rateStartYearMonth = null;
|
||||
if(com.getStartTime() != null){
|
||||
rateStartYearMonth = Long.parseLong(DateUtils.dateToLocalDate(com.getStartTime()).getYear() + "" + DateUtils.dateToLocalDate(com.getStartTime()).getMonth().getValue());
|
||||
}else{
|
||||
rateStartYearMonth = 19001L;
|
||||
}
|
||||
|
||||
if (orderAmount.floatValue() <= cAmount && i == 0 && Long.parseLong(yearMonth) >= rateStartYearMonth) {
|
||||
// 第一条规则
|
||||
rateMap.put(yearMonth,com.getRate());
|
||||
break;
|
||||
} else if (i == tmpComList.size() - 1 && orderAmount.floatValue() > cAmount) {
|
||||
} else if (i == yearMonthRateList.size() - 1 && orderAmount.floatValue() > cAmount && Long.parseLong(yearMonth) >= rateStartYearMonth) {
|
||||
// 最后一条规则
|
||||
rateMap.put(yearMonth,com.getRate());
|
||||
break;
|
||||
} else if (cAmount < orderAmount.floatValue() && orderAmount.floatValue() <= tmpComList.get(i + 1).getAmount().floatValue()) {
|
||||
} else if (cAmount < orderAmount.floatValue() && orderAmount.floatValue() <= yearMonthRateList.get(i + 1).getAmount().floatValue() && Long.parseLong(yearMonth) >= rateStartYearMonth) {
|
||||
// 中间规则
|
||||
rateMap.put(yearMonth,tmpComList.get(i + 1).getRate());
|
||||
rateMap.put(yearMonth,yearMonthRateList.get(i + 1).getRate());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -383,6 +402,33 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
return rateMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据比例开始执行时间进行分类
|
||||
* @param tmpComList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<SysCommision>> getRateMapByStartTime(List<SysCommision> tmpComList){
|
||||
Map<String, List<SysCommision>> result = new TreeMap<>(new MyComparator());
|
||||
for (SysCommision sysCommision : tmpComList) {
|
||||
String rateStartYearMonth = null;
|
||||
if(sysCommision.getStartTime() != null){
|
||||
rateStartYearMonth = DateUtils.dateToLocalDate(sysCommision.getStartTime()).getYear() + "" + DateUtils.dateToLocalDate(sysCommision.getStartTime()).getMonth().getValue();
|
||||
}else{
|
||||
rateStartYearMonth = 19001+"";
|
||||
}
|
||||
if(result.containsKey(rateStartYearMonth)){
|
||||
result.get(rateStartYearMonth).add(sysCommision);
|
||||
}else{
|
||||
List<SysCommision> list = new ArrayList<>();
|
||||
list.add(sysCommision);
|
||||
result.put(rateStartYearMonth, list);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询2021年1月份之后所有订单,对订单进行处理,得出每笔订单的相关信息
|
||||
* @param sysCommision 是否
|
||||
@ -547,12 +593,12 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (SysOrderCommisionDayDetail c : sysOrderCommisionDayDetailList) {
|
||||
/**for (SysOrderCommisionDayDetail c : sysOrderCommisionDayDetailList) {
|
||||
System.out.println(c.getOrderId() + "-" + c.getNutritionistId() + "-" + c.getAfterSaleId() + "-"+
|
||||
DateUtils.localDateToString(c.getServerStartDate(),"yyyy-MM-dd") + "-" +
|
||||
DateUtils.localDateToString(c.getServerEndDate(),"yyyy-MM-dd") +
|
||||
"-" + c.getDayMoney().doubleValue() + "-" + c.getOrderAmount().doubleValue());
|
||||
}
|
||||
}**/
|
||||
return sysOrderCommisionDayDetailList;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,15 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.aliyun.vod20170321.models.SearchMediaResponse;
|
||||
import com.aliyun.vod20170321.models.SearchMediaResponseBody;
|
||||
import com.stdiet.common.utils.AliyunVideoUtils;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysNutritionalVideoMapper;
|
||||
@ -39,9 +47,24 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
* @return 营养视频
|
||||
*/
|
||||
@Override
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo)
|
||||
public List<SysNutritionalVideo> selectSysNutritionalVideoList(SysNutritionalVideo sysNutritionalVideo, boolean flag)
|
||||
{
|
||||
return sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo);
|
||||
List<SysNutritionalVideo> list = sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo);
|
||||
if(flag && list != null && list.size() > 0){
|
||||
List<String> fileUrl = new ArrayList<>();
|
||||
for (SysNutritionalVideo video : list) {
|
||||
fileUrl.add(video.getCoverUrl());
|
||||
}
|
||||
List<String> downUrlList = AliyunOSSUtils.generatePresignedUrl(fileUrl);
|
||||
if(downUrlList != null && downUrlList.size() > 0){
|
||||
int index = 0;
|
||||
for (String downUrl : downUrlList) {
|
||||
list.get(index).setCoverUrl(downUrl);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,4 +125,69 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
public SysNutritionalVideo selectSysNutritionalVideByVideoId(String videoId){
|
||||
return sysNutritionalVideoMapper.selectSysNutritionalVideByVideoId(videoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 阿里云视频查询检索
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> searchVideo(String key, Integer showFlag, Integer pageNo, Integer pageSize, String scrollToken){
|
||||
pageSize = pageSize.intValue() > 100 ? 10 : pageSize;
|
||||
long total = 0;
|
||||
String newScrollToken = null;
|
||||
List<SysNutritionalVideo> nutritionalVideoList = new ArrayList<>();
|
||||
try {
|
||||
SearchMediaResponse response = AliyunVideoUtils.searchVideo(key, getStatusString(showFlag), pageNo, pageSize, scrollToken);
|
||||
if(response != null){
|
||||
SearchMediaResponseBody body = response.body;
|
||||
total = body.total;
|
||||
newScrollToken = body.scrollToken;
|
||||
List<SearchMediaResponseBody.SearchMediaResponseBodyMediaList> mediaList = body.mediaList;
|
||||
if(mediaList != null && mediaList.size() > 0){
|
||||
for (SearchMediaResponseBody.SearchMediaResponseBodyMediaList media : mediaList) {
|
||||
SysNutritionalVideo sysNutritionalVideo = new SysNutritionalVideo();
|
||||
sysNutritionalVideo.setTitle(media.video.title);
|
||||
sysNutritionalVideo.setCoverUrl(media.video.coverURL);
|
||||
sysNutritionalVideo.setShowFlag(getStatus(media.video.getStatus()));
|
||||
sysNutritionalVideo.setTags(media.video.tags);
|
||||
//String createTime = media.video.creationTime;
|
||||
sysNutritionalVideo.setDescription(media.video.description);
|
||||
sysNutritionalVideo.setVideoId(media.video.videoId);
|
||||
nutritionalVideoList.add(sysNutritionalVideo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("total", total);
|
||||
result.put("newScrollToken", newScrollToken);
|
||||
result.put("nutritionalVideoList", nutritionalVideoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getStatusString(Integer status){
|
||||
if(status == null){
|
||||
return "Normal,Blocked";
|
||||
}
|
||||
return status.intValue() == 1 ? "Normal" : "Blocked";
|
||||
}
|
||||
|
||||
private Integer getStatus(String status){
|
||||
if(status == null){
|
||||
return 1;
|
||||
}
|
||||
return "Normal".equals(status) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新微信展示状态
|
||||
* @param wxShow
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(Integer wxShow, Long[] ids){
|
||||
return sysNutritionalVideoMapper. updateWxshowByIds(wxShow, ids);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysVideoClassifyMapper;
|
||||
import com.stdiet.custom.domain.SysVideoClassify;
|
||||
import com.stdiet.custom.service.ISysVideoClassifyService;
|
||||
|
||||
/**
|
||||
* 视频分类Service业务层处理
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-05-05
|
||||
*/
|
||||
@Service
|
||||
public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService
|
||||
{
|
||||
@Autowired
|
||||
private SysVideoClassifyMapper sysVideoClassifyMapper;
|
||||
|
||||
/**
|
||||
* 查询视频分类
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 视频分类
|
||||
*/
|
||||
@Override
|
||||
public SysVideoClassify selectSysVideoClassifyById(Long id)
|
||||
{
|
||||
return sysVideoClassifyMapper.selectSysVideoClassifyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询视频分类列表
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 视频分类
|
||||
*/
|
||||
@Override
|
||||
public List<SysVideoClassify> selectSysVideoClassifyList(SysVideoClassify sysVideoClassify)
|
||||
{
|
||||
return sysVideoClassifyMapper.selectSysVideoClassifyList(sysVideoClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysVideoClassify(SysVideoClassify sysVideoClassify)
|
||||
{
|
||||
sysVideoClassify.setCreateTime(DateUtils.getNowDate());
|
||||
return sysVideoClassifyMapper.insertSysVideoClassify(sysVideoClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改视频分类
|
||||
*
|
||||
* @param sysVideoClassify 视频分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysVideoClassify(SysVideoClassify sysVideoClassify)
|
||||
{
|
||||
sysVideoClassify.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysVideoClassifyMapper.updateSysVideoClassify(sysVideoClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除视频分类
|
||||
*
|
||||
* @param ids 需要删除的视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysVideoClassifyByIds(Long[] ids)
|
||||
{
|
||||
return sysVideoClassifyMapper.deleteSysVideoClassifyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除视频分类信息
|
||||
*
|
||||
* @param id 视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysVideoClassifyById(Long id)
|
||||
{
|
||||
return sysVideoClassifyMapper.deleteSysVideoClassifyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有类别
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysVideoClassify> getAllClassify(){
|
||||
return sysVideoClassifyMapper.getAllClassify();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user