Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
commit
65d1c156fd
@ -237,16 +237,6 @@ public class SysCommisionController extends BaseController {
|
||||
return getDataTable(sysCommissionDayService.calculateCommissionByDay(sysCommision));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询该用户按天计算提成的详情
|
||||
* */
|
||||
@PreAuthorize("@ss.hasPermi('commisionDay:detail:list')")
|
||||
@GetMapping("/orderDetailDay")
|
||||
public AjaxResult getOrderCommissionDetailDay(SysCommision sysCommision) {
|
||||
startPage();
|
||||
return sysCommissionDayService.calculateOrderCommissionDetail(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出按天计算提成详细列表
|
||||
*/
|
||||
@ -258,4 +248,30 @@ public class SysCommisionController extends BaseController {
|
||||
List<SysCommissionDayDetail> list = sysCommissionDayService.calculateCommissionByDay(sysCommision);
|
||||
return util.exportExcel(list, "commision");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询该用户按天计算提成的详情
|
||||
* */
|
||||
@PreAuthorize("@ss.hasPermi('commisionDay:detail:list')")
|
||||
@GetMapping("/orderDetailDay")
|
||||
public AjaxResult getOrderCommissionDetailDay(SysCommision sysCommision) {
|
||||
startPage();
|
||||
return sysCommissionDayService.calculateOrderCommissionDetail(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出具体地点按天计算提成详细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('commisionDay:detail:export')")
|
||||
@Log(title = "导出具体地点按天计算提成详细列表", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/exportOrderDetailDay")
|
||||
public AjaxResult exportOrderDetailDay(SysCommision sysCommision) {
|
||||
ExcelUtil<SysOrderCommisionDayDetail> util = new ExcelUtil<>(SysOrderCommisionDayDetail.class);
|
||||
AjaxResult result = sysCommissionDayService.calculateOrderCommissionDetail(sysCommision);
|
||||
List<SysOrderCommisionDayDetail> orderDetailList = null;
|
||||
if(result != null && (int)result.get("code") == 200){
|
||||
orderDetailList = (List<SysOrderCommisionDayDetail>)result.get("list");
|
||||
}
|
||||
return util.exportExcel(orderDetailList == null ? new ArrayList<>() : orderDetailList, "commision");
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ import com.stdiet.common.utils.file.MimeTypeUtils;
|
||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||
import com.stdiet.custom.domain.SysCustomerCaseFile;
|
||||
import com.stdiet.custom.dto.request.FileRequest;
|
||||
import com.stdiet.custom.service.ISysPhysicalSignsService;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.unit.DataUnit;
|
||||
@ -49,6 +51,9 @@ public class SysCustomerCaseController extends BaseController
|
||||
@Autowired
|
||||
private ISysCustomerCaseService sysCustomerCaseService;
|
||||
|
||||
@Autowired
|
||||
private ISysPhysicalSignsService sysPhysicalSignsService;
|
||||
|
||||
/**
|
||||
* 查询客户案例管理列表
|
||||
*/
|
||||
@ -56,8 +61,13 @@ public class SysCustomerCaseController extends BaseController
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysCustomerCase sysCustomerCase)
|
||||
{
|
||||
//sysCustomerCase.setKeywordArray(StringUtils.isNotEmpty(sysCustomerCase.getKeyword()) ? sysCustomerCase.getKeyword().split(",") : null);
|
||||
|
||||
if(StringUtils.isNotEmpty(sysCustomerCase.getKeyword())){
|
||||
sysCustomerCase.setSignIdList(sysPhysicalSignsService.getSignIdByName(sysCustomerCase.getKeyword()));
|
||||
}
|
||||
|
||||
startPage();
|
||||
sysCustomerCase.setKeywordArray(StringUtils.isNotEmpty(sysCustomerCase.getKeyword()) ? sysCustomerCase.getKeyword().split(",") : null);
|
||||
List<SysCustomerCase> list = sysCustomerCaseService.selectSysCustomerCaseList(sysCustomerCase);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ public class SysCustomerController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('custom:customer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysCustomer sysCustomer) {
|
||||
startPage();
|
||||
List<SysCustomer> list = new ArrayList<>();
|
||||
if (SecurityUtils.getLoginUser().getUser().getRoles().get(0).getRoleKey().equals("partner")) {
|
||||
String remark = SecurityUtils.getLoginUser().getUser().getRemark();
|
||||
@ -74,7 +73,7 @@ public class SysCustomerController extends BaseController {
|
||||
sysCustomer.setSignIdList(sysPhysicalSignsService.getSignIdByName(sysCustomer.getPhysicalSignsId()));
|
||||
}
|
||||
}
|
||||
|
||||
startPage();
|
||||
list = sysCustomerService.selectSysCustomerList(sysCustomer);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (SysCustomer sysCus : list) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.aliyun.vod20170321.models.CreateUploadVideoResponse;
|
||||
import com.aliyun.vod20170321.models.GetPlayInfoResponseBody;
|
||||
import com.stdiet.common.core.page.TableDataInfo;
|
||||
import com.stdiet.common.utils.AliyunVideoUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
@ -38,14 +38,8 @@ public class SysNutritionalVideoController extends BaseController
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
/*AjaxResult result = AjaxResult.success();
|
||||
Map<String, Object> map = sysNutritionalVideoService.searchVideo(sysNutritionalVideo.getKey(), sysNutritionalVideo.getShowFlag(), pageNum, pageSize, null);
|
||||
if(map != null){
|
||||
result.put("total", map.get("total"));
|
||||
result.put("rows", map.get("nutritionalVideoList"));
|
||||
}
|
||||
return result;*/
|
||||
startPage();
|
||||
sysNutritionalVideo.setSortType(1);
|
||||
List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -72,7 +66,6 @@ public class SysNutritionalVideoController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
sysNutritionalVideo.setShowFlag(1);
|
||||
return toAjax(sysNutritionalVideoService.insertSysNutritionalVideo(sysNutritionalVideo));
|
||||
}
|
||||
|
||||
@ -134,4 +127,26 @@ public class SysNutritionalVideoController extends BaseController
|
||||
return toAjax(sysNutritionalVideoService.updateWxshowByIds(showFlag, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取营养视频播放地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:query')")
|
||||
@GetMapping(value = "/getVideoPlayUrlById/{id}")
|
||||
public AjaxResult getVideoPlayUrlById(@PathVariable("id") Long id)
|
||||
{
|
||||
SysNutritionalVideo sysNutritionalVideos = sysNutritionalVideoService.selectSysNutritionalVideoById(id);
|
||||
if(sysNutritionalVideos != null && StringUtils.isNotEmpty(sysNutritionalVideos.getVideoId())){
|
||||
try{
|
||||
GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(sysNutritionalVideos.getVideoId());
|
||||
List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo;
|
||||
if(playList != null && playList.size() > 0){
|
||||
sysNutritionalVideos.setPlayUrl(playList.get(0).getPlayURL());
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(sysNutritionalVideos);
|
||||
}
|
||||
|
||||
}
|
@ -195,6 +195,4 @@ public class SysOrderController extends OrderBaseController {
|
||||
public AjaxResult remove(@PathVariable Long orderId) {
|
||||
return toAjax(sysOrderService.deleteSysOrderById(orderId));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -113,6 +113,14 @@ public class WechatAppletController extends BaseController {
|
||||
if (StringUtils.isEmpty(sysWxUserInfo.getOpenid()) || StringUtils.isEmpty(sysWxUserInfo.getPhone())) {
|
||||
return AjaxResult.error("手机号为空");
|
||||
}
|
||||
//根据手机号查询返回用户加密ID
|
||||
SysCustomer customer = sysCustomerService.getCustomerByPhone(sysWxUserInfo.getPhone());
|
||||
//加密ID
|
||||
String customerEncId = null;
|
||||
if(customer != null){
|
||||
sysWxUserInfo.setCusId(customer.getId());
|
||||
customerEncId = AesUtils.encrypt(customer.getId() + "", null);
|
||||
}
|
||||
// 查询微信用户
|
||||
SysWxUserInfo userInfo = sysWxUserInfoService.selectSysWxUserInfoById(sysWxUserInfo.getOpenid());
|
||||
if (userInfo != null) {
|
||||
@ -122,9 +130,7 @@ public class WechatAppletController extends BaseController {
|
||||
sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo);
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
//根据手机号查询返回用户加密ID
|
||||
SysCustomer customer = sysCustomerService.getCustomerByPhone(sysWxUserInfo.getPhone());
|
||||
result.put("customerId", customer != null ? AesUtils.encrypt(customer.getId() + "", null) : null);
|
||||
result.put("customerId", customerEncId);
|
||||
//查询未读消息数量
|
||||
SysMessageNotice messageParam = new SysMessageNotice();
|
||||
messageParam.setReadType(0);
|
||||
@ -262,7 +268,7 @@ public class WechatAppletController extends BaseController {
|
||||
List<String> allUrlList = new ArrayList<>();
|
||||
|
||||
for (String key : imageName) {
|
||||
if (!"bodyImages".equals(key)) {
|
||||
if(!"bodyImages".equals(key)){
|
||||
allUrlList.addAll(downUrlList.get(key));
|
||||
allImagesList.addAll(imageUrlMap.get(key));
|
||||
}
|
||||
@ -365,13 +371,18 @@ public class WechatAppletController extends BaseController {
|
||||
*/
|
||||
@GetMapping(value = "/getVideoList")
|
||||
public TableDataInfo getVideoList(SysNutritionalVideo sysNutritionalVideo) {
|
||||
/* AjaxResult result = AjaxResult.success();
|
||||
Map<String, Object> map = sysNutritionalVideoService.searchVideo(sysNutritionalVideo.getKey(), 1, pageNum, pageSize, null);
|
||||
result.put("total", map.get("total"));
|
||||
result.put("rows", map.get("nutritionalVideoList"));
|
||||
return result;*/
|
||||
startPage();
|
||||
sysNutritionalVideo.setShowFlag(1);
|
||||
sysNutritionalVideo.setSortType(2);
|
||||
//普通用户
|
||||
sysNutritionalVideo.setUserType(0);
|
||||
if(StringUtils.isNotEmpty(sysNutritionalVideo.getOpenId())){
|
||||
//查询是否为客户,存在订单就视为客户
|
||||
int orderNum = sysOrderService.getOrderCountByOpenId(sysNutritionalVideo.getOpenId());
|
||||
if(orderNum > 0){
|
||||
sysNutritionalVideo.setUserType(1);
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -384,24 +395,43 @@ public class WechatAppletController extends BaseController {
|
||||
public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) {
|
||||
AjaxResult result = AjaxResult.success();
|
||||
NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse();
|
||||
try {
|
||||
GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(videoId);
|
||||
GetVideoInfoResponseBody videoInfoResponseBody = AliyunVideoUtils.getVideoById(videoId);
|
||||
List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo;
|
||||
if (playList != null && playList.size() > 0) {
|
||||
nutritionalVideoResponse.setPlayUrl(playList.get(0).getPlayURL());
|
||||
}
|
||||
nutritionalVideoResponse.setDescription(videoInfoResponseBody.video.getDescription());
|
||||
nutritionalVideoResponse.setTags(videoInfoResponseBody.video.getTags());
|
||||
nutritionalVideoResponse.setTitle(videoInfoResponseBody.video.getTitle());
|
||||
//nutritionalVideoResponse.setCreateTime(sysNutritionalVideo.getCreateTime() == null ? "" : DateUtils.dateTime(sysNutritionalVideo.getCreateTime()));
|
||||
} catch (Exception e) {
|
||||
try{
|
||||
SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId);
|
||||
if(sysNutritionalVideo != null){
|
||||
GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(videoId);
|
||||
List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo;
|
||||
if(playList != null && playList.size() > 0){
|
||||
nutritionalVideoResponse.setPlayUrl(playList.get(0).getPlayURL());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(sysNutritionalVideo.getCoverUrl())){
|
||||
nutritionalVideoResponse.setCoverUrl(AliyunOSSUtils.generatePresignedUrl(sysNutritionalVideo.getCoverUrl()));
|
||||
}else{
|
||||
nutritionalVideoResponse.setCoverUrl(AliyunVideoUtils.getVideoCoverUrl(videoId));
|
||||
}
|
||||
nutritionalVideoResponse.setDescription(sysNutritionalVideo.getDescription());
|
||||
nutritionalVideoResponse.setTags(sysNutritionalVideo.getTags());
|
||||
nutritionalVideoResponse.setTitle(sysNutritionalVideo.getTitle());
|
||||
nutritionalVideoResponse.setPlayNum(sysNutritionalVideo.getPlayNum());
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
result.put("videoDetail", nutritionalVideoResponse);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新播放次数
|
||||
*/
|
||||
@GetMapping(value = "/updateVideoPlayNum")
|
||||
public AjaxResult updateVideoPlayNum(@RequestParam(value = "videoId") String videoId) {
|
||||
AjaxResult result = AjaxResult.error();
|
||||
if(sysNutritionalVideoService.updateVideoPlayNum(videoId) > 0){
|
||||
result = AjaxResult.success();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody SysWxUserInfo sysWxUserInfo) {
|
||||
if (StringUtils.isEmpty(sysWxUserInfo.getOpenid())) {
|
||||
|
@ -4,6 +4,11 @@ import com.aliyun.vod20170321.models.*;
|
||||
import com.aliyun.teaopenapi.models.*;
|
||||
import com.stdiet.common.config.AliyunOSSConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AliyunVideoUtils {
|
||||
|
||||
public static com.aliyun.vod20170321.Client videoClient = null;
|
||||
@ -19,6 +24,9 @@ public class AliyunVideoUtils {
|
||||
//播放地址日期,30天
|
||||
public static final Long default_authTimeout = 2592000L;
|
||||
|
||||
//阿里云回收站分类ID
|
||||
public static final Long default_delete_cateId = 1860L;
|
||||
|
||||
public static final String search_field = "VideoId,Title,CoverURL,CateName,Tags,Status,Description,CreationTime";
|
||||
|
||||
/**
|
||||
@ -113,12 +121,16 @@ public class AliyunVideoUtils {
|
||||
public static CreateUploadVideoResponse createUploadVideoRequest(Long cateId, String fileName, String title, String coverURL, String tags, String description) throws Exception{
|
||||
com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient();
|
||||
CreateUploadVideoRequest createUploadVideoRequest = new CreateUploadVideoRequest()
|
||||
.setDescription(description)
|
||||
.setCoverURL(coverURL)
|
||||
.setFileName(fileName)
|
||||
.setTitle(title)
|
||||
.setCateId(cateId)
|
||||
.setTags(tags);
|
||||
.setDescription(description).setFileName(fileName).setTitle(title);
|
||||
if(StringUtils.isNotEmpty(coverURL)){
|
||||
createUploadVideoRequest.setCoverURL(coverURL);
|
||||
}
|
||||
if(cateId != null){
|
||||
createUploadVideoRequest.setCateId(cateId);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(tags)){
|
||||
createUploadVideoRequest.setTags(tags);
|
||||
}
|
||||
return client.createUploadVideo(createUploadVideoRequest);
|
||||
}
|
||||
|
||||
@ -154,6 +166,101 @@ public class AliyunVideoUtils {
|
||||
return client.searchMedia(searchMediaRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新视频消息
|
||||
* @param videoId 视频ID必须
|
||||
* @param title
|
||||
* @param tags
|
||||
* @param description
|
||||
* @param cateId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String updateVideo(String videoId, String title, String tags, String description, Long cateId) throws Exception{
|
||||
com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient();
|
||||
if(StringUtils.isEmpty(videoId)){
|
||||
return null;
|
||||
}
|
||||
UpdateVideoInfoRequest updateVideoInfoRequest = new UpdateVideoInfoRequest().setVideoId(videoId);
|
||||
if(StringUtils.isNotEmpty(title)){
|
||||
updateVideoInfoRequest.setTitle(title);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(tags)){
|
||||
updateVideoInfoRequest.setTags(tags);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(description)){
|
||||
updateVideoInfoRequest.setDescription(description);
|
||||
}
|
||||
if(cateId != null && cateId.longValue() > 0){
|
||||
updateVideoInfoRequest.setCateId(cateId);
|
||||
}
|
||||
UpdateVideoInfoResponse updateVideoInfoResponse = client.updateVideoInfo(updateVideoInfoRequest);
|
||||
if(updateVideoInfoResponse != null){
|
||||
return updateVideoInfoResponse.body.requestId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将视频分类到回收站中
|
||||
* @param videoId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String delVideo(String videoId) throws Exception{
|
||||
return updateVideo(videoId, null,null,null, default_delete_cateId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据VideoId获取封面
|
||||
* @param videoId
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getVideoCoverUrl(List<String> videoId){
|
||||
List<String> result = new ArrayList<>();
|
||||
try{
|
||||
com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient();
|
||||
GetVideoInfosRequest getVideoInfosRequest = new GetVideoInfosRequest()
|
||||
.setVideoIds(StringUtils.join(videoId.toArray(), ","));
|
||||
GetVideoInfosResponse getVideoInfosResponse = client.getVideoInfos(getVideoInfosRequest);
|
||||
if(getVideoInfosResponse != null){
|
||||
GetVideoInfosResponseBody body = getVideoInfosResponse.body;
|
||||
List<GetVideoInfosResponseBody.GetVideoInfosResponseBodyVideoList> videoList = body.videoList;
|
||||
if(videoList != null && videoList.size() > 0){
|
||||
for (GetVideoInfosResponseBody.GetVideoInfosResponseBodyVideoList video : videoList) {
|
||||
result.add(video.getCoverURL());
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据VideoId获取封面
|
||||
* @param videoId
|
||||
* @return
|
||||
*/
|
||||
public static String getVideoCoverUrl(String videoId){
|
||||
String coverUrl = null;
|
||||
try{
|
||||
com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient();
|
||||
GetVideoInfoRequest getVideoInfoRequest = new GetVideoInfoRequest()
|
||||
.setVideoId(videoId);
|
||||
GetVideoInfoResponse response = client.getVideoInfo(getVideoInfoRequest);
|
||||
if(response != null){
|
||||
GetVideoInfoResponseBody body = response.body;
|
||||
GetVideoInfoResponseBody.GetVideoInfoResponseBodyVideo video = body.video;
|
||||
coverUrl = video.coverURL;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -54,4 +54,7 @@ public class SysCustomerCase extends BaseEntity
|
||||
|
||||
//案例文件URL数组
|
||||
private String[] caseFileUrl;
|
||||
|
||||
//病史体征ID集合,非持久化字段
|
||||
private List<Long> signIdList;
|
||||
}
|
@ -61,15 +61,29 @@ public class SysNutritionalVideo extends BaseEntity
|
||||
|
||||
/** 视频付费等级,0无需付费 1客户可看 2付费可看 */
|
||||
@Excel(name = "视频付费等级,0无需付费 1客户可看 2付费可看")
|
||||
private Long payLevel;
|
||||
private Integer payLevel;
|
||||
|
||||
private String payLevelName;
|
||||
|
||||
/** 播放次数,默认0 */
|
||||
@Excel(name = "播放次数,默认0")
|
||||
private Integer playNum;
|
||||
|
||||
/** 删除标识,0未删除 1已删除,默认0 */
|
||||
private Integer delFlag;
|
||||
|
||||
private String playUrl;
|
||||
|
||||
//文件名称
|
||||
private String fileName;
|
||||
|
||||
private String key;
|
||||
|
||||
//排序方式 1 按照创建时间倒序 2按照优先级、时间倒序
|
||||
private Integer sortType;
|
||||
|
||||
private String openId;
|
||||
|
||||
//微信用户类型 0 普通用户 1 已下单客户
|
||||
private Integer userType;
|
||||
}
|
@ -19,34 +19,45 @@ public class SysOrderCommisionDayDetail extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**订单ID*/
|
||||
@Excel(name = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/**订单成交时间*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "订单成交时间")
|
||||
private LocalDateTime orderTime;
|
||||
|
||||
/**客户姓名*/
|
||||
@Excel(name = "客户姓名")
|
||||
private String name;
|
||||
|
||||
/**服务结束时间*/
|
||||
/**订单金额或服务订单金额*/
|
||||
@Excel(name = "订单金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**服务开始时间*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "服务开始时间")
|
||||
private LocalDate serverStartDate;
|
||||
|
||||
/**服务结束时间*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "服务结束时间")
|
||||
private LocalDate serverEndDate;
|
||||
|
||||
/**服务月数*/
|
||||
private Integer serverMonth;
|
||||
|
||||
/**服务天数*/
|
||||
@Excel(name = "服务天数")
|
||||
private Integer serverDay;
|
||||
|
||||
/**赠送天数*/
|
||||
private Integer giveDay;
|
||||
|
||||
/**订单金额或服务订单金额*/
|
||||
private BigDecimal orderAmount;
|
||||
/** 暂停总天数 **/
|
||||
|
||||
/**订单总提成**/
|
||||
private BigDecimal orderCommission;
|
||||
private int pauseTotalDay;
|
||||
|
||||
//已发放提成
|
||||
private BigDecimal hasSendOrderCommission;
|
||||
@ -54,15 +65,10 @@ public class SysOrderCommisionDayDetail extends BaseEntity {
|
||||
//未发放提成
|
||||
private BigDecimal notHasSendOrderCommission;
|
||||
|
||||
/**服务天数*/
|
||||
private Integer serverDay;
|
||||
|
||||
/**每天金额*/
|
||||
@Excel(name = "每天金额")
|
||||
private BigDecimal dayMoney;
|
||||
|
||||
/** 暂停总天数 **/
|
||||
private int pauseTotalDay;
|
||||
|
||||
/**每年每月暂停天数*/
|
||||
private Map<String, Integer> everyYearMonthPauseDay;
|
||||
|
||||
@ -79,11 +85,17 @@ public class SysOrderCommisionDayDetail extends BaseEntity {
|
||||
private Map<String, Boolean> everyYearMonthCommissionSendFlag;
|
||||
|
||||
//该笔订单成交的当月的总成交额,用于确定提成比例
|
||||
@Excel(name = "当月的成交额")
|
||||
private BigDecimal monthOrderTotalAmount;
|
||||
|
||||
//该笔订单对应提成比例
|
||||
@Excel(name = "提成比例")
|
||||
private Float commissionRate;
|
||||
|
||||
/**订单总提成**/
|
||||
@Excel(name = "订单提成")
|
||||
private BigDecimal orderCommission;
|
||||
|
||||
//售后
|
||||
private Long afterSaleId;
|
||||
|
||||
|
@ -26,10 +26,10 @@ public class SysOrderPause {
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@JsonIgnore
|
||||
//@JsonIgnore
|
||||
private Long orderId;
|
||||
|
||||
@JsonIgnore
|
||||
//@JsonIgnore
|
||||
private Long cusId;
|
||||
|
||||
private String outId;
|
||||
|
@ -33,6 +33,8 @@ public class NutritionalVideoResponse implements Serializable {
|
||||
//播放链接
|
||||
public String playUrl;
|
||||
|
||||
//播放量
|
||||
private Integer playNum;
|
||||
|
||||
public String createTime;
|
||||
|
||||
|
@ -75,4 +75,17 @@ public interface SysNutritionalVideoMapper
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(@Param("wxShow")Integer wxShow, @Param("array") Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询阿里云的视频ID,包含已删除的
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<String> getVideoIdByIds(@Param("array") Long[] ids);
|
||||
|
||||
/**
|
||||
* 更新视频播放量
|
||||
* @return
|
||||
*/
|
||||
public int updateVideoPlayNum(@Param("videoId")String videoId);
|
||||
}
|
@ -106,4 +106,18 @@ public interface SysOrderMapper
|
||||
* @return
|
||||
*/
|
||||
List<SysOrder> getAllOrderByCusId(@Param("cusId") Long cusId);
|
||||
|
||||
/**
|
||||
* 根据openid查询订单数量
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
int getOrderCountByOpenId(@Param("openid")String openid);
|
||||
|
||||
/**
|
||||
* 根据营养师ID查询最后一个订单
|
||||
* @param nutritionistId
|
||||
* @return
|
||||
*/
|
||||
SysOrder getLastOrderByNutritionistId(@Param("nutritionistId")Long nutritionistId);
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 营养视频Service接口
|
||||
@ -81,4 +82,10 @@ public interface ISysNutritionalVideoService
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(Integer wxShow, Long[] ids);
|
||||
|
||||
/**
|
||||
* 更新视频播放量
|
||||
* @return
|
||||
*/
|
||||
public int updateVideoPlayNum(String videoId);
|
||||
}
|
@ -114,4 +114,11 @@ public interface ISysOrderService
|
||||
* @return
|
||||
*/
|
||||
List<SysOrder> getAllOrderByCusId(Long cusId);
|
||||
|
||||
/**
|
||||
* 根据openid查询订单数量
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
int getOrderCountByOpenId(String openid);
|
||||
}
|
@ -731,7 +731,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
}
|
||||
//更新服务结束时间
|
||||
if(ChronoUnit.DAYS.between(realEndDate,serverEndDate) > 0){
|
||||
serverEndDate = realEndDate;
|
||||
//serverEndDate = realEndDate;
|
||||
}
|
||||
return getEveryYearMonthPauseDay(list, serverStartDate, serverEndDate);
|
||||
}
|
||||
@ -759,7 +759,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
||||
pauseStartDate = serverStartDate;
|
||||
}
|
||||
if(ChronoUnit.DAYS.between(serverEndDate, pauseEndDate) > 0){
|
||||
pauseEndDate = serverEndDate;
|
||||
//pauseEndDate = serverEndDate;
|
||||
}
|
||||
//根据暂停记录获取该条记录在每年每月的暂停天数
|
||||
Map<String, Integer> orderYearMonthPauseDay = getEveryYearMonthDayCount(pauseStartDate, pauseEndDate, null);
|
||||
|
@ -9,8 +9,10 @@ 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.StringUtils;
|
||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysNutritionalVideoMapper;
|
||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||
@ -52,15 +54,42 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
List<SysNutritionalVideo> list = sysNutritionalVideoMapper.selectSysNutritionalVideoList(sysNutritionalVideo);
|
||||
if(flag && list != null && list.size() > 0){
|
||||
List<String> fileUrl = new ArrayList<>();
|
||||
List<String> videoIdList = new ArrayList<>();
|
||||
for (SysNutritionalVideo video : list) {
|
||||
fileUrl.add(video.getCoverUrl());
|
||||
if(StringUtils.isNotEmpty(video.getCoverUrl())){
|
||||
fileUrl.add(video.getCoverUrl());
|
||||
}else{
|
||||
videoIdList.add(video.getVideoId());
|
||||
}
|
||||
}
|
||||
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++;
|
||||
if(fileUrl.size() > 0){
|
||||
List<String> downUrlList = AliyunOSSUtils.generatePresignedUrl(fileUrl);
|
||||
if(downUrlList != null && downUrlList.size() > 0){
|
||||
int index = 0;
|
||||
for (SysNutritionalVideo video : list) {
|
||||
if (StringUtils.isNotEmpty(video.getCoverUrl())) {
|
||||
video.setCoverUrl(downUrlList.get(index));
|
||||
index++;
|
||||
if(index == downUrlList.size()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(videoIdList.size() > 0) {
|
||||
List<String> coverUrlList = AliyunVideoUtils.getVideoCoverUrl(videoIdList);
|
||||
if (coverUrlList != null && coverUrlList.size() > 0) {
|
||||
int index = 0;
|
||||
for (SysNutritionalVideo video : list) {
|
||||
if (StringUtils.isEmpty(video.getCoverUrl())) {
|
||||
video.setCoverUrl(coverUrlList.get(index));
|
||||
index++;
|
||||
if(index == coverUrlList.size()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,7 +119,23 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
public int updateSysNutritionalVideo(SysNutritionalVideo sysNutritionalVideo)
|
||||
{
|
||||
sysNutritionalVideo.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysNutritionalVideoMapper.updateSysNutritionalVideo(sysNutritionalVideo);
|
||||
int row = sysNutritionalVideoMapper.updateSysNutritionalVideo(sysNutritionalVideo);
|
||||
if(row > 0){
|
||||
updateAliyunVideo(sysNutritionalVideo.getId());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Async
|
||||
public void updateAliyunVideo(Long id){
|
||||
try{
|
||||
SysNutritionalVideo sysNutritionalVideo = selectSysNutritionalVideoById(id);
|
||||
if(sysNutritionalVideo != null && sysNutritionalVideo.getVideoId() != null){
|
||||
AliyunVideoUtils.updateVideo(sysNutritionalVideo.getVideoId(), sysNutritionalVideo.getTitle(), sysNutritionalVideo.getTags(), sysNutritionalVideo.getDescription(), null);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +147,11 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
@Override
|
||||
public int deleteSysNutritionalVideoByIds(Long[] ids)
|
||||
{
|
||||
return sysNutritionalVideoMapper.deleteSysNutritionalVideoByIds(ids);
|
||||
int row = sysNutritionalVideoMapper.deleteSysNutritionalVideoByIds(ids);
|
||||
if(row > 0){
|
||||
updateAliyunVideoCateId(ids);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,7 +163,12 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
@Override
|
||||
public int deleteSysNutritionalVideoById(Long id)
|
||||
{
|
||||
return sysNutritionalVideoMapper.deleteSysNutritionalVideoById(id);
|
||||
int row = sysNutritionalVideoMapper.deleteSysNutritionalVideoById(id);
|
||||
if(row > 0){
|
||||
Long[] ids = {id};
|
||||
updateAliyunVideoCateId(ids);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,7 +241,33 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
||||
* @return
|
||||
*/
|
||||
public int updateWxshowByIds(Integer wxShow, Long[] ids){
|
||||
return sysNutritionalVideoMapper. updateWxshowByIds(wxShow, ids);
|
||||
return sysNutritionalVideoMapper.updateWxshowByIds(wxShow, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将删除的阿里云视频放入回收站
|
||||
* @param ids
|
||||
*/
|
||||
@Async
|
||||
public void updateAliyunVideoCateId(Long[] ids){
|
||||
try {
|
||||
List<String> videoIdList = sysNutritionalVideoMapper.getVideoIdByIds(ids);
|
||||
if(videoIdList != null && videoIdList.size() > 0){
|
||||
for (String videoId : videoIdList) {
|
||||
AliyunVideoUtils.delVideo(videoId);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新视频播放量
|
||||
* @return
|
||||
*/
|
||||
public int updateVideoPlayNum(String videoId){
|
||||
return sysNutritionalVideoMapper.updateVideoPlayNum(videoId);
|
||||
}
|
||||
|
||||
}
|
@ -406,4 +406,13 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
||||
public List<SysOrder> getAllOrderByCusId(Long cusId){
|
||||
return sysOrderMapper.getAllOrderByCusId(cusId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据openid查询订单数量
|
||||
* @param openid
|
||||
* @return
|
||||
*/
|
||||
public int getOrderCountByOpenId(String openid){
|
||||
return sysOrderMapper.getOrderCountByOpenId(openid);
|
||||
}
|
||||
}
|
@ -236,16 +236,11 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
if (beforeOrderLastPlan != null) {
|
||||
long differDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), serverStartDate);
|
||||
//检查之前食谱的结束时间和目前该订单的开始时间是否连续
|
||||
if (differDay <= 1) {
|
||||
/*if(differDay <= 0){
|
||||
serverStartDate = DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1);
|
||||
//更新该订单的开始时间
|
||||
sysOrderService.updateOrderStartTime(sysOrder, serverStartDate);1 7 1 3 2
|
||||
}*/
|
||||
if(differDay <= 1){
|
||||
//判断前一个订单食谱是否满七天,不满则需要接上
|
||||
int differNum = beforeOrderLastPlan.getEndNumDay() - beforeOrderLastPlan.getStartNumDay();
|
||||
|
||||
if (differNum < 6) {
|
||||
if(differNum < 6){
|
||||
//更新该食谱计划
|
||||
beforeOrderLastPlan.setEndNumDay(beforeOrderLastPlan.getStartNumDay() + 6);
|
||||
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(6 - differNum)));
|
||||
@ -328,9 +323,9 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
if (ChronoUnit.DAYS.between(pauseStartDate, planStartDate) > 0) {
|
||||
pauseStartDate = planStartDate;
|
||||
}
|
||||
if (ChronoUnit.DAYS.between(planEndDate, pauseEndDate) > 0) {
|
||||
/*if (ChronoUnit.DAYS.between(planEndDate, pauseEndDate) > 0) {
|
||||
pauseEndDate = planEndDate;
|
||||
}
|
||||
}*/
|
||||
//判断暂停记录是否从食谱计划开始时间开始的
|
||||
if (ChronoUnit.DAYS.between(pauseStartDate, planStartDate) == 0) {
|
||||
planStartDate = pauseEndDate.plusDays(1);
|
||||
|
@ -45,6 +45,7 @@
|
||||
<select id="selectSysCustomerCaseList" parameterType="SysCustomerCase" resultMap="SysCustomerCaseResult">
|
||||
select scc.id, scc.name, scc.keyword, scc.remark, scc.customer_id, scc.wx_show, scc.create_time,sc.name as customer_name from sys_customer_case scc
|
||||
left join sys_customer sc on sc.id = scc.customer_id and sc.del_flag = 0
|
||||
left join sys_customer_healthy as sch on sch.customer_id = sc.id and sch.del_flag = 0
|
||||
where scc.del_flag = 0
|
||||
<include refid="searchKey">
|
||||
<property name="keywordArray" value="#{keywordArray}"/>
|
||||
@ -52,6 +53,21 @@
|
||||
<if test="customerName != null and customerName != ''">
|
||||
and sc.name like concat('%', #{customerName}, '%')
|
||||
</if>
|
||||
<if test="keyword != null">
|
||||
and
|
||||
(
|
||||
sc.name like concat('%', #{keyword}, '%') or
|
||||
scc.keyword like concat('%', #{keyword}, '%') or scc.name like concat('%', #{keyword}, '%')
|
||||
or scc.remark like concat('%', #{keyword}, '%') or sch.other_physical_signs like concat('%', #{keyword}, '%')
|
||||
or sch.remark like concat('%', #{keyword}, '%')
|
||||
<if test="signIdList != null">
|
||||
<foreach collection="signIdList " item="signId" index="index" open=" OR (" close=")" separator=" OR ">
|
||||
FIND_IN_SET(#{signId}, sch.physical_signs_id)
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="wxShow != null">
|
||||
and scc.wx_show = #{wxShow}
|
||||
</if>
|
||||
|
@ -62,7 +62,7 @@
|
||||
</if>
|
||||
<if test="signIdList != null">
|
||||
and (
|
||||
sch.other_physical_signs like concat('%', #{name}, '%')
|
||||
sch.other_physical_signs like concat('%', #{physicalSignsId}, '%')
|
||||
<foreach collection="signIdList " item="signId" index="index" open=" OR (" close=")" separator=" OR ">
|
||||
FIND_IN_SET(#{signId}, sch.physical_signs_id)
|
||||
</foreach>
|
||||
|
@ -16,6 +16,7 @@
|
||||
<result property="showFlag" column="show_flag" />
|
||||
<result property="priorityLevel" column="priority_level" />
|
||||
<result property="payLevel" column="pay_level" />
|
||||
<result property="playNum" column="play_num" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
@ -27,11 +28,11 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysNutritionalVideoVo">
|
||||
select id, cate_id, video_id, cover_url, title, description, priority_level,pay_level,video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video
|
||||
select id, cate_id, video_id, cover_url, title, description, priority_level,pay_level,play_num,video_size, tags, show_flag, create_time, create_by, update_time, update_by, del_flag from sys_nutritional_video
|
||||
</sql>
|
||||
|
||||
<select id="selectSysNutritionalVideoList" parameterType="SysNutritionalVideo" resultMap="SysNutritionalVideoResult">
|
||||
select snv.id, snv.cate_id, snv.video_id, snv.cover_url, snv.title, snv.description, snv.priority_level,snv.pay_level,snv.video_size, snv.tags, snv.show_flag, snv.create_time,
|
||||
select snv.id, snv.cate_id, snv.video_id, snv.cover_url, snv.title, snv.description, snv.priority_level,snv.pay_level,snv.play_num,snv.video_size, snv.tags, snv.show_flag, snv.create_time,
|
||||
pay.dict_label as pay_level_name, svc.cate_name
|
||||
from sys_nutritional_video snv
|
||||
left join (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'video_pay_level') AS pay ON pay.dict_value = snv.pay_level
|
||||
@ -46,10 +47,23 @@
|
||||
<if test="payLevel != null">
|
||||
and snv.pay_level = #{payLevel}
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
<if test="userType == 0">
|
||||
and pay_level = 0
|
||||
</if>
|
||||
<if test="userType == 1">
|
||||
and (pay_level = 0 or pay_level = 1)
|
||||
</if>
|
||||
</if>
|
||||
<if test="key != null and key != ''">
|
||||
and (snv.title like concat('%',#{key},'%') or snv.description like concat('%',#{key},'%'))
|
||||
</if>
|
||||
order by snv.priority_level DESC,snv.create_time DESC
|
||||
<if test="sortType == null or sortType == 1">
|
||||
order by snv.create_time DESC
|
||||
</if>
|
||||
<if test="sortType != null and sortType == 2">
|
||||
order by snv.priority_level DESC,snv.create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysNutritionalVideoById" parameterType="Long" resultMap="SysNutritionalVideoResult">
|
||||
@ -69,6 +83,7 @@
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="showFlag != null">show_flag,</if>
|
||||
<if test="priorityLevel != null">priority_level,</if>
|
||||
<if test="playNum != null">play_num,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="payLevel != null">pay_level,</if>
|
||||
@ -86,6 +101,7 @@
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="showFlag != null">#{showFlag},</if>
|
||||
<if test="priorityLevel != null">#{priorityLevel},</if>
|
||||
<if test="playNum != null">#{playNum},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="payLevel != null">#{payLevel},</if>
|
||||
@ -107,6 +123,7 @@
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="showFlag != null">show_flag = #{showFlag},</if>
|
||||
<if test="priorityLevel != null">priority_level = #{priorityLevel},</if>
|
||||
<if test="playNum != null">play_num = #{playNum},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="payLevel != null">pay_level = #{payLevel},</if>
|
||||
@ -139,4 +156,17 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 查询视频的阿里云ID,包含已删除的 -->
|
||||
<select id="getVideoIdByIds" parameterType="String" resultType="String">
|
||||
select video_id from sys_nutritional_video where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 更新视频播放量 -->
|
||||
<update id="updateVideoPlayNum" parameterType="String">
|
||||
update sys_nutritional_video set play_num = play_num + 1 where video_id = #{videoId} and del_flag = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -516,4 +516,15 @@
|
||||
select * from sys_order where del_flag = 0 and cus_id = #{cusId} order by order_time asc
|
||||
</select>
|
||||
|
||||
<!-- 根据微信openId查询客户订单数量 -->
|
||||
<select id="getOrderCountByOpenId" parameterType="String" resultType="int">
|
||||
select count(so.order_id) from sys_order so
|
||||
where so.del_flag = 0 and so.cus_id is not null and so.cus_id = (select su.cus_id from sys_wx_user_info su where su.openid = #{openid} limit 1)
|
||||
</select>
|
||||
|
||||
<!-- 根据营养师ID查询最后一单的情况 -->
|
||||
<select id="getLastOrderByNutritionistId" parameterType="Long" resultMap="SysOrderResult">
|
||||
select * from sys_order so
|
||||
where del_flag = 0 and nutritionist_id = #{nutritionistId} order by order_id desc limit 1
|
||||
</select>
|
||||
</mapper>
|
@ -96,3 +96,13 @@ export function orderDetailDay(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 导出具体订单按天计算提成明细
|
||||
export function exportOrderDetailDay(query) {
|
||||
return request({
|
||||
url: '/custom/commision/exportOrderDetailDay',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,3 +69,12 @@ export function updateWxShow(data){
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询营养视频播放地址
|
||||
export function getVideoPlayUrlById(id) {
|
||||
return request({
|
||||
url: '/custom/nutritionalVideo/getVideoPlayUrlById/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,14 @@
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="imageUrl || coverUrl" :src="imageUrl || coverUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
1、只能上传png、jpg文件,且每个文件不超过{{
|
||||
|
||||
<div class="el-upload__tip" slot="tip" style="color:#1890ff">
|
||||
<el-button v-if="imageUrl || coverUrl" size="small" type="danger" @click="removeFile">移除</el-button>
|
||||
<div>1、只能上传png、jpg文件,且每个文件不超过{{
|
||||
upload.fileSize / (1024 * 1024)
|
||||
}}M
|
||||
}}M</div>
|
||||
<div style="margin-top:5px;">{{tips ? ('2、'+tips) : ''}}</div>
|
||||
|
||||
</div>
|
||||
</el-upload>
|
||||
</template>
|
||||
@ -41,7 +45,7 @@ export default {
|
||||
methods: {
|
||||
resetUpload(){
|
||||
this.imageUrl = null;
|
||||
this.fileUrl = null
|
||||
this.fileUrl = null;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
@ -55,6 +59,11 @@ export default {
|
||||
this.$message.error("文件上传失败");
|
||||
}
|
||||
},
|
||||
removeFile(){
|
||||
this.resetUpload();
|
||||
this.coverUrl = null;
|
||||
this.$emit("callbackMethod", '');
|
||||
},
|
||||
// 文件上传失败处理
|
||||
handleFileFail(err, file, fileList) {
|
||||
this.$message.error("文件上传失败");
|
||||
@ -79,6 +88,10 @@ export default {
|
||||
coverUrl:{
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
tips: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -37,6 +37,7 @@
|
||||
<div
|
||||
class="order_total_data"
|
||||
>
|
||||
|
||||
<span class="order_total_data_span_right20">
|
||||
当前页总服务金额:{{totalServerAmount}}元
|
||||
</span>
|
||||
@ -50,6 +51,18 @@
|
||||
>未发放总提成:{{ totalNotSendCommission }}元</span
|
||||
>
|
||||
</div>
|
||||
<el-row :gutter="10" class="mb8" style="margin-top: 10px;margin-left:10px">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['commisionDay:detail:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="width:100%;height:80%;overflow: auto">
|
||||
<el-table :data="orderList" v-loading="loading" stripe>
|
||||
<el-table-column
|
||||
@ -208,7 +221,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { orderDetailDay } from "@/api/custom/commision";
|
||||
import { orderDetailDay,exportOrderDetailDay } from "@/api/custom/commision";
|
||||
import OrderDetail from "@/components/OrderDetail";
|
||||
|
||||
export default {
|
||||
@ -317,6 +330,23 @@ export default {
|
||||
handleOnDetailClick(data) {
|
||||
this.$refs.orderDetailRef.showDialog(data.orderId);
|
||||
},
|
||||
handleExport(){
|
||||
this.queryParam.serverScopeStartTime = this.serverDateScope && this.serverDateScope.length > 0 ? this.serverDateScope[0] : null;
|
||||
this.queryParam.serverScopeEndTime = this.serverDateScope && this.serverDateScope.length > 0 ? this.serverDateScope[1] : null;
|
||||
const queryParams = this.queryParam;
|
||||
this.$confirm("是否确认导出所有订单提成比例数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return exportOrderDetailDay(queryParams);
|
||||
})
|
||||
.then((response) => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
.catch(function () {});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -332,7 +362,7 @@ export default {
|
||||
.order_total_data {
|
||||
float: right;
|
||||
margin-right: 40px;
|
||||
margin-bottom:20px
|
||||
margin-bottom:15px
|
||||
}
|
||||
|
||||
.order_total_data_span_right20 {
|
||||
|
@ -102,7 +102,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 其他信息 -->
|
||||
<div style="height: 390px; overflow: auto">
|
||||
<div style="height: 370px; overflow: auto">
|
||||
<div
|
||||
v-for="(item, index) in dataList.slice(1, 10)"
|
||||
style="margin-bottom: 50px"
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="请输入视频标题"
|
||||
v-model="videoFrom.title"
|
||||
v-model.trim="videoFrom.title"
|
||||
maxlength="50"
|
||||
rows="1"
|
||||
show-word-limit
|
||||
@ -15,7 +15,7 @@
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="请输入视频描述"
|
||||
v-model="videoFrom.description"
|
||||
v-model.trim="videoFrom.description"
|
||||
maxlength="1000"
|
||||
rows="3"
|
||||
show-word-limit
|
||||
@ -23,7 +23,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="视频封面" prop="coverUrl">
|
||||
<UploadFile ref="uploadFile" :prefix="'videoCover'" @callbackMethod="handleCoverUrl"></UploadFile>
|
||||
<UploadFile ref="uploadFile" :prefix="'videoCover'" @callbackMethod="handleCoverUrl" :tips="'视频未传封面图片时,会主动截取封面,但会存在延迟,请勿直接发布到小程序'"></UploadFile>
|
||||
</el-form-item>
|
||||
<div style="display:flex">
|
||||
<el-form-item label="视频类别" prop="cateId">
|
||||
@ -52,7 +52,9 @@
|
||||
<div>
|
||||
<input type="file" accept=".mp4" ref="videoFile" id="videoFile" @change="fileChange($event)">
|
||||
<div > <span>上传状态:{{statusText}}</span><span style="margin-left:100px">进度:{{authProgress}}%</span></div>
|
||||
<div > 1、只能上传mp4文件,上传大文件时请使用客户端上传,防止上传超时</div>
|
||||
<div style="color:#1890ff">
|
||||
1、只能上传mp4文件,上传大文件时请使用客户端上传,防止上传超时
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="展示状态" prop="wxShow">
|
||||
@ -61,7 +63,7 @@
|
||||
active-text="小程序展示"
|
||||
inactive-text="小程序不展示">
|
||||
</el-switch>
|
||||
<div>提示:请保证内容正确再展示到小程序</div>
|
||||
<div style="color:red">提示:请保证内容正确再展示到小程序</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -86,9 +88,6 @@
|
||||
title: [
|
||||
{ required: true, message: "标题不能为空", trigger: "blur" },
|
||||
],
|
||||
coverUrl: [
|
||||
{ required: true, message: "封面不能为空", trigger: "blur" },
|
||||
],
|
||||
cateId:[
|
||||
{ required: true, message: "视频类别不能为空", trigger: "blur" },
|
||||
],
|
||||
@ -98,7 +97,9 @@
|
||||
},
|
||||
callback: null,
|
||||
classifyList: [],
|
||||
defaultClassify: null,
|
||||
payVideoLevelList:[],
|
||||
defaultPayLevel: null,
|
||||
uploadAuth:{
|
||||
|
||||
},
|
||||
@ -118,17 +119,23 @@
|
||||
uploader: null,
|
||||
statusText: '',
|
||||
fileType:['mp4','MP4'],
|
||||
uploading: false
|
||||
uploading: false,
|
||||
}
|
||||
},
|
||||
created(){
|
||||
getAllClassify().then(response => {
|
||||
/*getAllClassify().then(response => {
|
||||
if(response.code == 200){
|
||||
this.classifyList = response.data;
|
||||
if(response.data != null && response.data.length > 0){
|
||||
this.defaultClassify = response.data[0].id;
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
this.getDicts("video_pay_level").then((response) => {
|
||||
this.payVideoLevelList = response.data;
|
||||
if(response.data != null && response.data.length > 0){
|
||||
this.defaultPayLevel = response.data[0].dictValue;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
@ -136,22 +143,26 @@
|
||||
UploadFile
|
||||
},
|
||||
methods: {
|
||||
showDialog(callback){
|
||||
showDialog(classifyList, callback){
|
||||
if(classifyList != null && classifyList.length > 0){
|
||||
this.defaultClassify = classifyList[0].id;
|
||||
}
|
||||
this.resetVideoFrom();
|
||||
this.open = true;
|
||||
this.callback = callback;
|
||||
this.classifyList = classifyList;
|
||||
},
|
||||
handleCoverUrl(url){
|
||||
this.videoFrom.coverUrl = url;
|
||||
},
|
||||
resetVideoFrom(){
|
||||
this.videoFrom = {
|
||||
cateId: null,
|
||||
cateId: this.defaultClassify ? this.defaultClassify : null,
|
||||
coverUrl: null,
|
||||
title: null,
|
||||
description: null,
|
||||
tags: null,
|
||||
payLevel: 0,
|
||||
payLevel: this.defaultPayLevel ? parseInt(this.defaultPayLevel) : null,
|
||||
videoId: null,
|
||||
wxShow: false
|
||||
};
|
||||
|
@ -17,8 +17,7 @@
|
||||
</el-form-item>-->
|
||||
<el-form-item label="案例信息" prop="name">
|
||||
<el-select
|
||||
v-model="keywordArray"
|
||||
multiple
|
||||
v-model="queryParams.keyword"
|
||||
filterable
|
||||
allow-create
|
||||
clearable
|
||||
@ -150,12 +149,22 @@
|
||||
></AutoHideMessage>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属客户" align="center" prop="customerName" />
|
||||
<el-table-column label="所属客户" align="center" prop="customerName">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="normal"
|
||||
type="text"
|
||||
@click="handleOnHealthSignClick(scope.row.customerId)"
|
||||
title="点击查看用户详情"
|
||||
>{{scope.row.customerName}}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="文件" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
size="normal"
|
||||
type="text"
|
||||
@click="getFileListByCaseId(scope.row)"
|
||||
>文件列表
|
||||
@ -323,6 +332,9 @@
|
||||
@dealCustomerId="dealCustomerId"
|
||||
ref="selectCustomerRef"
|
||||
></SelectCustomer>
|
||||
|
||||
<!-- 健康评估弹窗 -->
|
||||
<PhysicalSignsDialog ref="physicalSignsDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -337,13 +349,16 @@ import {
|
||||
getFileListByCaseId,
|
||||
updateWxShow
|
||||
} from "@/api/custom/customerCase";
|
||||
import {
|
||||
getCustomer
|
||||
} from "@/api/custom/customer";
|
||||
import DragUpload from "@/components/FileUpload/DragUpload";
|
||||
import DragUploadEdit from "@/components/FileUpload/DragUploadEdit";
|
||||
import SelectCustomer from "@/components/Customer/SelectCustomer";
|
||||
import MuchFileDown from "@/components/FileDownload/MuchFileDown";
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
import AutoHideInfo from "@/components/AutoHideInfo";
|
||||
|
||||
import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
|
||||
export default {
|
||||
name: "CustomerCase",
|
||||
data() {
|
||||
@ -398,6 +413,7 @@ export default {
|
||||
AutoHideMessage: AutoHideMessage,
|
||||
AutoHideInfo: AutoHideInfo,
|
||||
DragUploadEdit: DragUploadEdit,
|
||||
PhysicalSignsDialog
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
@ -409,7 +425,7 @@ export default {
|
||||
/** 查询客户案例管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.keyword = this.keywordArray.join(",");
|
||||
//this.queryParams.keyword = this.keywordArray.join(",");
|
||||
listCustomerCase(this.queryParams).then((response) => {
|
||||
this.customerCaseList = response.rows;
|
||||
this.total = response.total;
|
||||
@ -425,6 +441,14 @@ export default {
|
||||
this.$refs["editUploadCaseFile"].uploadReset();
|
||||
this.reset();
|
||||
},
|
||||
handleOnHealthSignClick(id) {
|
||||
getCustomer(id).then((response) => {
|
||||
if(response.code == 200){
|
||||
this.$refs["physicalSignsDialogRef"].showDialog(response.data);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键词" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.key"
|
||||
v-model.trim="queryParams.key"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
size="small"
|
||||
@ -62,6 +62,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-question"
|
||||
@click="handleAskQuestion"
|
||||
v-hasPermi="['custom:askQuestion:list']"
|
||||
>问题解答</el-button>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键词" prop="key">
|
||||
<el-input
|
||||
v-model="queryParams.key"
|
||||
v-model.trim="queryParams.key"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
size="small"
|
||||
@ -76,6 +76,15 @@
|
||||
v-hasPermi="['custom:nutritionalVideo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-menu"
|
||||
@click="handleVideoClassify"
|
||||
v-hasPermi="['custom:videoClassify:list']"
|
||||
>视频分类管理</el-button>
|
||||
</el-col>
|
||||
<!--
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -101,8 +110,16 @@
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标题" align="center" prop="title" width="200"/>
|
||||
<el-table-column label="描述" align="center" prop="description" />
|
||||
<el-table-column label="标题" align="center" prop="title" width="200">
|
||||
<template slot-scope="scope" >
|
||||
<AutoHideMessage :data="scope.row.title == null ? '' : (scope.row.title+'')" :maxLength="20"></AutoHideMessage>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" align="center" prop="description" >
|
||||
<template slot-scope="scope" >
|
||||
<AutoHideMessage :data="scope.row.description == null ? '' : (scope.row.description+'')" :maxLength="100"></AutoHideMessage>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="标签" align="center" prop="tags" width="100"/>-->
|
||||
<el-table-column label="分类" align="center" prop="cateName" width="100"/>
|
||||
<el-table-column label="权限等级" align="center" prop="payLevelName" width="100"/>
|
||||
@ -119,6 +136,13 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="getVideoPlayUrl(scope.row.id)"
|
||||
v-hasPermi="['custom:nutritionalVideo:query']"
|
||||
>播放</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@ -172,7 +196,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频封面" prop="coverUrl">
|
||||
<UploadFile ref="uploadFile" :prefix="'videoCover'" :coverUrl="form.previewUrl" @callbackMethod="handleCoverUrl"></UploadFile>
|
||||
<UploadFile ref="uploadFile" v-if="open" :prefix="'videoCover'" :coverUrl="form.previewUrl" @callbackMethod="handleCoverUrl" :tips="'视频未传封面图片时,会主动截取封面,但会存在延迟,请勿直接发布到小程序'"></UploadFile>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频类别" prop="cateId">
|
||||
<el-select v-model="form.cateId" clearable filterable placeholder="请选择类别">
|
||||
@ -200,7 +224,7 @@
|
||||
active-text="小程序展示"
|
||||
inactive-text="小程序不展示">
|
||||
</el-switch>
|
||||
<div>提示:请保证内容正确再展示到小程序</div>
|
||||
<div style="color:red">提示:请保证内容正确再展示到小程序</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -211,14 +235,21 @@
|
||||
</el-dialog>
|
||||
|
||||
<UploadVideo ref="uploadVideoRef"></UploadVideo>
|
||||
|
||||
<!-- 视频分类管理 -->
|
||||
<el-dialog title="视频分类列表" :visible.sync="videoClassifyOpen" width="800px" append-to-body @closed="getAllVideoClassify();">
|
||||
<VideoClassify ref="videoClassifyRef"></VideoClassify>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listNutritionalVideo, getNutritionalVideo, delNutritionalVideo, addNutritionalVideo, updateNutritionalVideo, exportNutritionalVideo, updateWxShow } from "@/api/custom/nutritionalVideo";
|
||||
import { listNutritionalVideo, getNutritionalVideo, delNutritionalVideo, addNutritionalVideo, updateNutritionalVideo, exportNutritionalVideo, updateWxShow,getVideoPlayUrlById } from "@/api/custom/nutritionalVideo";
|
||||
import {getAllClassify } from "@/api/custom/videoClassify";
|
||||
import UploadVideo from "@/components/UploadVideo";
|
||||
import UploadFile from "@/components/FileUpload/UploadFile";
|
||||
import VideoClassify from "../videoClassify";
|
||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||
export default {
|
||||
name: "NutritionalVideo",
|
||||
data() {
|
||||
@ -254,27 +285,35 @@
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: "标题不能为空", trigger: "blur" },
|
||||
],
|
||||
cateId:[
|
||||
{ required: true, message: "视频类别不能为空", trigger: "blur" },
|
||||
],
|
||||
payLevel:[
|
||||
{ required: true, message: "视频权限不能为空", trigger: "blur" },
|
||||
]
|
||||
},
|
||||
coverImageList:[],
|
||||
//分类列表
|
||||
classifyList:[],
|
||||
//权限等级列表
|
||||
payVideoLevelList:[]
|
||||
payVideoLevelList:[],
|
||||
//视频分类弹窗显示标识
|
||||
videoClassifyOpen:false
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
getAllClassify().then(response => {
|
||||
if(response.code == 200){
|
||||
this.classifyList = response.data;
|
||||
}
|
||||
});
|
||||
this.getAllVideoClassify();
|
||||
this.getDicts("video_pay_level").then((response) => {
|
||||
this.payVideoLevelList = response.data;
|
||||
});
|
||||
},
|
||||
components: {
|
||||
UploadVideo,UploadFile
|
||||
UploadVideo,UploadFile,VideoClassify,AutoHideMessage
|
||||
},
|
||||
methods: {
|
||||
/** 查询营养视频列表 */
|
||||
@ -289,6 +328,14 @@
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//获取所有分类
|
||||
getAllVideoClassify(){
|
||||
getAllClassify().then(response => {
|
||||
if(response.code == 200){
|
||||
this.classifyList = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@ -326,10 +373,13 @@
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
clickUploadVideo(){
|
||||
this.$refs.uploadVideoRef.showDialog(()=>{
|
||||
this.$refs.uploadVideoRef.showDialog(this.classifyList, ()=>{
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
handleVideoClassify(){
|
||||
this.videoClassifyOpen = true;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
@ -347,6 +397,15 @@
|
||||
this.title = "修改营养视频";
|
||||
});
|
||||
},
|
||||
//获取播放地址
|
||||
getVideoPlayUrl(id){
|
||||
getVideoPlayUrlById(id).then(response => {
|
||||
let url = response.data.playUrl;
|
||||
if(url != undefined && url != null){
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
@ -381,6 +440,7 @@
|
||||
},
|
||||
handleCoverUrl(url){
|
||||
this.form.coverUrl = url;
|
||||
console.log(this.form.coverUrl);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
275
stdiet-ui/src/views/custom/videoClassify/index.vue
Normal file
275
stdiet-ui/src/views/custom/videoClassify/index.vue
Normal file
@ -0,0 +1,275 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!--<el-form-item label="分类名称" prop="cateName">
|
||||
<el-input
|
||||
v-model="queryParams.cateName"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型标识,0全部可看 1客户可看 2额外付费观看" prop="payFlag">
|
||||
<el-input
|
||||
v-model="queryParams.payFlag"
|
||||
placeholder="请输入类型标识,0全部可看 1客户可看 2额外付费观看"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:videoClassify:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['custom:videoClassify:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['custom:videoClassify:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<!--<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:videoClassify:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="videoClassifyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分类名称" align="center" prop="cateName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['custom:videoClassify:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:videoClassify:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改视频分类对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="分类名称" prop="cateName">
|
||||
<el-input v-model.trim="form.cateName" placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listVideoClassify, getVideoClassify, delVideoClassify, addVideoClassify, updateVideoClassify, exportVideoClassify } from "@/api/custom/videoClassify";
|
||||
|
||||
export default {
|
||||
name: "VideoClassify",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 视频分类表格数据
|
||||
videoClassifyList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cateName: null,
|
||||
payFlag: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
cateName: [
|
||||
{ required: true, message: "分类名称不能为空", trigger: "blur" },
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询视频分类列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listVideoClassify(this.queryParams).then(response => {
|
||||
this.videoClassifyList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cateName: null,
|
||||
payFlag: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
delFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加视频分类";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getVideoClassify(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改视频分类";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateVideoClassify(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addVideoClassify(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除视频分类编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delVideoClassify(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有视频分类数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportVideoClassify(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user