commit
f5189344b6
@ -1,5 +1,6 @@
|
||||
package com.stdiet.web.controller;
|
||||
|
||||
import com.stdiet.common.utils.AliyunVideoUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||
import com.stdiet.custom.domain.SysNutritionQuestion;
|
||||
@ -43,6 +44,27 @@ public class MyApplicationRunner implements ApplicationRunner {
|
||||
System.out.println("--------------项目启动调用方法结束-------------");
|
||||
}
|
||||
|
||||
/**
|
||||
* 给现有视频更新截图图片
|
||||
*/
|
||||
public void getVideoSn(){
|
||||
List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(new SysNutritionalVideo(), false);
|
||||
int success = 0;
|
||||
if(list != null && list.size() > 0){
|
||||
for (SysNutritionalVideo video : list) {
|
||||
try{
|
||||
Thread.sleep(500);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(AliyunVideoUtils.submitVideoSnapshot(video.getVideoId())){
|
||||
success ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("成功数量:" + success);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从微信用户表中查询openid更新到用户打卡日志表中
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.custom.typehandler.ArrayJsonHandler;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -92,7 +94,11 @@ public class SysVideoClassifyController extends BaseController
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysVideoClassifyService.deleteSysVideoClassifyByIds(ids));
|
||||
if(ids != null && ids.length == 1){
|
||||
//只支持单个删除
|
||||
return sysVideoClassifyService.deleteSysVideoClassifyById(ids[0]);
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,4 +88,11 @@ public interface SysNutritionalVideoMapper
|
||||
* @return
|
||||
*/
|
||||
public int updateVideoPlayNum(@Param("videoId")String videoId);
|
||||
|
||||
/**
|
||||
* 根据视频分类ID查询该分类下存在视频数量
|
||||
* @param cateId
|
||||
* @return
|
||||
*/
|
||||
public int getVideoCountByCateId(@Param("cateId")Long cateId);
|
||||
}
|
@ -3,6 +3,7 @@ package com.stdiet.custom.mapper;
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysVideoClassify;
|
||||
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 视频分类Mapper接口
|
||||
@ -72,4 +73,11 @@ public interface SysVideoClassifyMapper
|
||||
* @return
|
||||
*/
|
||||
public List<VideoClassifyResponse> getOneAllClassifyAndVideo(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 根据分类ID查询分类以及分类下的子类ID
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getVideoClassifyIdsById(@Param("id")Long id);
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.common.core.domain.AjaxResult;
|
||||
import com.stdiet.custom.domain.SysVideoClassify;
|
||||
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||
|
||||
@ -44,13 +46,6 @@ public interface ISysVideoClassifyService
|
||||
*/
|
||||
public int updateSysVideoClassify(SysVideoClassify sysVideoClassify);
|
||||
|
||||
/**
|
||||
* 批量删除视频分类
|
||||
*
|
||||
* @param ids 需要删除的视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除视频分类信息
|
||||
@ -58,7 +53,7 @@ public interface ISysVideoClassifyService
|
||||
* @param id 视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysVideoClassifyById(Long id);
|
||||
public AjaxResult deleteSysVideoClassifyById(Long id);
|
||||
|
||||
/**
|
||||
* 获取所有类别
|
||||
|
@ -379,15 +379,18 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
||||
//判断是否提成单,拆分单中的副单,体验单,定金单
|
||||
if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 ||
|
||||
"2".equals(sysOrder.getOrderType()) || !isNeedByOrderMoneyType(sysOrder)){
|
||||
continue;
|
||||
}
|
||||
//设置服务到期时间
|
||||
setOrderServerEndDate(sysOrder);
|
||||
sysOrder.setUpdateTime(new Date());
|
||||
row = updateSysOrder(sysOrder);
|
||||
}else {
|
||||
//判断前一个订单的结束时间是否大于第二个订单的
|
||||
if(lastServerEndTime != null && ChronoUnit.DAYS.between(lastServerEndTime, DateUtils.dateToLocalDate(sysOrder.getStartTime())) <= 0){
|
||||
if (lastServerEndTime != null && ChronoUnit.DAYS.between(lastServerEndTime, DateUtils.dateToLocalDate(sysOrder.getStartTime())) <= 0) {
|
||||
newStartTime = lastServerEndTime.plusDays(1);
|
||||
//本月第一天
|
||||
LocalDate monthStart = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
||||
//旧的开始时间和新的开始时间都要需要大于本月第一天
|
||||
if(sysOrder.getCommissStartTime() != null && ChronoUnit.DAYS.between(monthStart, DateUtils.dateToLocalDate(sysOrder.getCommissStartTime())) >= 0 && ChronoUnit.DAYS.between(monthStart, newStartTime) >= 0){
|
||||
if (sysOrder.getCommissStartTime() != null && ChronoUnit.DAYS.between(monthStart, DateUtils.dateToLocalDate(sysOrder.getCommissStartTime())) >= 0 && ChronoUnit.DAYS.between(monthStart, newStartTime) >= 0) {
|
||||
sysOrder.setCommissStartTime(DateUtils.localDateToDate(newStartTime));
|
||||
}
|
||||
sysOrder.setStartTime(DateUtils.localDateToDate(newStartTime));
|
||||
@ -398,13 +401,14 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
||||
row = updateSysOrder(sysOrder);
|
||||
lastServerEndTime = DateUtils.dateToLocalDate(sysOrder.getServerEndTime());
|
||||
}
|
||||
}
|
||||
//异步更新食谱计划
|
||||
sysRecipesPlanService.regenerateRecipesPlan(cusId);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
//定金单或尾款单是否需要生成食谱计划,2021-01-12修改为6月11日之后成交的订单只生成定金单计划
|
||||
//定金单或尾款单是否需要生成食谱计划,2021-01-12修改为6月1日之后成交的订单只生成定金单计划
|
||||
private boolean isNeedByOrderMoneyType(SysOrder sysOrder){
|
||||
if("0".equals(sysOrder.getOrderMoneyType())){
|
||||
return true;
|
||||
|
@ -45,7 +45,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
private SysRecipesMapper sysRecipesMapper;
|
||||
|
||||
//2021-06-11之后(大于等于)成交的订单,只生成定金单食谱计划,不生成尾款食谱计划,之前成交的订单还是保持之前逻辑
|
||||
public static final LocalDate newVersionPlanStartDate = DateUtils.stringToLocalDate("2021-06-11", "yyyy-MM-dd");
|
||||
public static final LocalDate newVersionPlanStartDate = DateUtils.stringToLocalDate("2021-06-01", "yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
* 查询食谱计划
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.common.core.domain.AjaxResult;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||
import com.stdiet.custom.mapper.SysNutritionalVideoMapper;
|
||||
@ -75,17 +77,6 @@ public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService
|
||||
return sysVideoClassifyMapper.updateSysVideoClassify(sysVideoClassify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除视频分类
|
||||
*
|
||||
* @param ids 需要删除的视频分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysVideoClassifyByIds(Long[] ids)
|
||||
{
|
||||
return sysVideoClassifyMapper.deleteSysVideoClassifyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除视频分类信息
|
||||
@ -94,15 +85,31 @@ public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysVideoClassifyById(Long id)
|
||||
public AjaxResult deleteSysVideoClassifyById(Long id)
|
||||
{
|
||||
return sysVideoClassifyMapper.deleteSysVideoClassifyById(id);
|
||||
return delChildrenClassify(id);
|
||||
}
|
||||
|
||||
private boolean delChildrenClassify(Long id){
|
||||
/**
|
||||
* 删除分类以及子分类,删除之前需要判断分类下是否存在视频
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private AjaxResult delChildrenClassify(Long id){
|
||||
//判断分类下是否存在视频,存在视频不能删除
|
||||
|
||||
return true;
|
||||
int videoNum = sysNutritionalVideoMapper.getVideoCountByCateId(id);
|
||||
if(videoNum > 0){
|
||||
return AjaxResult.error("该分类下存在视频,无法直接删除");
|
||||
}
|
||||
//删除该分类以及全部子分类
|
||||
List<Long> childrenIds = sysVideoClassifyMapper.getVideoClassifyIdsById(id);
|
||||
if(childrenIds != null && childrenIds.size() > 0){
|
||||
Long[] ids = new Long[childrenIds.size()];
|
||||
if(sysVideoClassifyMapper.deleteSysVideoClassifyByIds(childrenIds.toArray(ids)) > 0) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,4 +173,14 @@
|
||||
update sys_nutritional_video set play_num = play_num + 1 where video_id = #{videoId} and del_flag = 0
|
||||
</update>
|
||||
|
||||
<!-- 根据视频分类ID查询该分类下视频总量 -->
|
||||
<select id="getVideoCountByCateId" parameterType="Long" resultType="int">
|
||||
select count(snv.id) from sys_nutritional_video snv where snv.del_flag = 0
|
||||
and snv.cate_id in (
|
||||
select id from sys_video_classify where del_flag = 0
|
||||
and (id = #{cateId} or id in (select s.id from sys_video_classify s where s.parent_id = #{cateId} and s.del_flag = 0)
|
||||
or id in (select ss.id from sys_video_classify ss where ss.del_flag = 0 and ss.parent_id in (select a.id from sys_video_classify a where a.parent_id = #{cateId} and a.del_flag = 0 )))
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -113,6 +113,7 @@
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
|
||||
<if test="onSaleId != null">
|
||||
and on_sale_id = #{onSaleId}
|
||||
</if>
|
||||
@ -167,6 +168,7 @@
|
||||
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
|
||||
<if test="onSaleId != null">
|
||||
and on_sale_id = #{onSaleId}
|
||||
</if>
|
||||
|
@ -159,4 +159,11 @@
|
||||
order by priority_level asc
|
||||
</select>
|
||||
|
||||
<!-- 根据分类ID查询该分类ID以及分类下的子类ID -->
|
||||
<select id="getVideoClassifyIdsById" parameterType="Long" resultType="Long">
|
||||
select id from sys_video_classify where del_flag = 0
|
||||
and (id = #{id} or id in (select s.id from sys_video_classify s where s.parent_id = #{id} and s.del_flag = 0)
|
||||
or id in (select ss.id from sys_video_classify ss where ss.del_flag = 0 and ss.parent_id in (select a.id from sys_video_classify a where a.parent_id = #{id} and a.del_flag = 0 )))
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -88,6 +88,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="售前推送" prop="pushPreSaleId">
|
||||
<el-select
|
||||
v-model="queryParams.pushPreSaleId"
|
||||
placeholder="请选择售前推送"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in pushPreSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6" v-if="!isPartner">
|
||||
<el-form-item label="售中" prop="onSaleId">
|
||||
<el-select
|
||||
@ -266,7 +285,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="26">
|
||||
<el-form-item label="订单类型" prop="searchOrderTypeArray">
|
||||
<el-cascader
|
||||
placeholder="请选择订单类型"
|
||||
@ -277,9 +296,7 @@
|
||||
clearable
|
||||
></el-cascader> </el-form-item
|
||||
><!-- -->
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-form-item label="成交日期" prop="orderTime" style="margin-left:80px">
|
||||
<el-date-picker
|
||||
style="width:300px"
|
||||
v-model="daterange"
|
||||
@ -294,7 +311,7 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left:50px">
|
||||
<el-form-item style="margin-left:40px">
|
||||
<el-button
|
||||
type="cyan"
|
||||
icon="el-icon-search"
|
||||
@ -606,6 +623,7 @@ export default {
|
||||
phone: null,
|
||||
payTypeId: null,
|
||||
preSaleId: null,
|
||||
pushPreSaleId: null,
|
||||
onSaleId: null,
|
||||
afterSaleId: null,
|
||||
nutritionistId: null,
|
||||
@ -653,6 +671,8 @@ export default {
|
||||
"operatorIdOptions",
|
||||
// 运营助理字典
|
||||
"operatorAssisIdOptions",
|
||||
//售前推送
|
||||
"pushPreSaleIdOptions",
|
||||
//
|
||||
"userId",
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user