新增接口
This commit is contained in:
parent
65d1c156fd
commit
7b16561591
@ -1,7 +1,6 @@
|
|||||||
package com.stdiet.web.controller.custom;
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
import com.aliyun.vod20170321.models.GetPlayInfoResponseBody;
|
import com.aliyun.vod20170321.models.GetPlayInfoResponseBody;
|
||||||
import com.aliyun.vod20170321.models.GetVideoInfoResponseBody;
|
|
||||||
import com.stdiet.common.core.controller.BaseController;
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
import com.stdiet.common.core.domain.entity.SysDictData;
|
import com.stdiet.common.core.domain.entity.SysDictData;
|
||||||
@ -117,7 +116,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
SysCustomer customer = sysCustomerService.getCustomerByPhone(sysWxUserInfo.getPhone());
|
SysCustomer customer = sysCustomerService.getCustomerByPhone(sysWxUserInfo.getPhone());
|
||||||
//加密ID
|
//加密ID
|
||||||
String customerEncId = null;
|
String customerEncId = null;
|
||||||
if(customer != null){
|
if (customer != null) {
|
||||||
sysWxUserInfo.setCusId(customer.getId());
|
sysWxUserInfo.setCusId(customer.getId());
|
||||||
customerEncId = AesUtils.encrypt(customer.getId() + "", null);
|
customerEncId = AesUtils.encrypt(customer.getId() + "", null);
|
||||||
}
|
}
|
||||||
@ -130,7 +129,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo);
|
sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo);
|
||||||
}
|
}
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("customerId", customerEncId);
|
result.put("customerId", customerEncId);
|
||||||
//查询未读消息数量
|
//查询未读消息数量
|
||||||
SysMessageNotice messageParam = new SysMessageNotice();
|
SysMessageNotice messageParam = new SysMessageNotice();
|
||||||
messageParam.setReadType(0);
|
messageParam.setReadType(0);
|
||||||
@ -268,7 +267,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
List<String> allUrlList = new ArrayList<>();
|
List<String> allUrlList = new ArrayList<>();
|
||||||
|
|
||||||
for (String key : imageName) {
|
for (String key : imageName) {
|
||||||
if(!"bodyImages".equals(key)){
|
if (!"bodyImages".equals(key)) {
|
||||||
allUrlList.addAll(downUrlList.get(key));
|
allUrlList.addAll(downUrlList.get(key));
|
||||||
allImagesList.addAll(imageUrlMap.get(key));
|
allImagesList.addAll(imageUrlMap.get(key));
|
||||||
}
|
}
|
||||||
@ -375,10 +374,10 @@ public class WechatAppletController extends BaseController {
|
|||||||
sysNutritionalVideo.setSortType(2);
|
sysNutritionalVideo.setSortType(2);
|
||||||
//普通用户
|
//普通用户
|
||||||
sysNutritionalVideo.setUserType(0);
|
sysNutritionalVideo.setUserType(0);
|
||||||
if(StringUtils.isNotEmpty(sysNutritionalVideo.getOpenId())){
|
if (StringUtils.isNotEmpty(sysNutritionalVideo.getOpenId())) {
|
||||||
//查询是否为客户,存在订单就视为客户
|
//查询是否为客户,存在订单就视为客户
|
||||||
int orderNum = sysOrderService.getOrderCountByOpenId(sysNutritionalVideo.getOpenId());
|
int orderNum = sysOrderService.getOrderCountByOpenId(sysNutritionalVideo.getOpenId());
|
||||||
if(orderNum > 0){
|
if (orderNum > 0) {
|
||||||
sysNutritionalVideo.setUserType(1);
|
sysNutritionalVideo.setUserType(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,25 +394,25 @@ public class WechatAppletController extends BaseController {
|
|||||||
public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) {
|
public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) {
|
||||||
AjaxResult result = AjaxResult.success();
|
AjaxResult result = AjaxResult.success();
|
||||||
NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse();
|
NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse();
|
||||||
try{
|
try {
|
||||||
SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId);
|
SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId);
|
||||||
if(sysNutritionalVideo != null){
|
if (sysNutritionalVideo != null) {
|
||||||
GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(videoId);
|
GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(videoId);
|
||||||
List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo;
|
List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo;
|
||||||
if(playList != null && playList.size() > 0){
|
if (playList != null && playList.size() > 0) {
|
||||||
nutritionalVideoResponse.setPlayUrl(playList.get(0).getPlayURL());
|
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){
|
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();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
result.put("videoDetail", nutritionalVideoResponse);
|
result.put("videoDetail", nutritionalVideoResponse);
|
||||||
@ -426,7 +425,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
@GetMapping(value = "/updateVideoPlayNum")
|
@GetMapping(value = "/updateVideoPlayNum")
|
||||||
public AjaxResult updateVideoPlayNum(@RequestParam(value = "videoId") String videoId) {
|
public AjaxResult updateVideoPlayNum(@RequestParam(value = "videoId") String videoId) {
|
||||||
AjaxResult result = AjaxResult.error();
|
AjaxResult result = AjaxResult.error();
|
||||||
if(sysNutritionalVideoService.updateVideoPlayNum(videoId) > 0){
|
if (sysNutritionalVideoService.updateVideoPlayNum(videoId) > 0) {
|
||||||
result = AjaxResult.success();
|
result = AjaxResult.success();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -500,11 +499,15 @@ public class WechatAppletController extends BaseController {
|
|||||||
List<SysDictData> unitDict = iSysDictTypeService.selectDictDataByType("cus_cus_unit");
|
List<SysDictData> unitDict = iSysDictTypeService.selectDictDataByType("cus_cus_unit");
|
||||||
List<SysDictData> weightDict = iSysDictTypeService.selectDictDataByType("cus_cus_weight");
|
List<SysDictData> weightDict = iSysDictTypeService.selectDictDataByType("cus_cus_weight");
|
||||||
List<SysDictData> menuTypeDict = iSysDictTypeService.selectDictDataByType("cus_dishes_type");
|
List<SysDictData> menuTypeDict = iSysDictTypeService.selectDictDataByType("cus_dishes_type");
|
||||||
|
List<SysDictData> igdUnitDict = iSysDictTypeService.selectDictDataByType("sys_ingredient_unit");
|
||||||
|
List<SysDictData> idgTypeDict = iSysDictTypeService.selectDictDataByType("cus_ing_type");
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("unitDict", unitDict);
|
result.put("unitDict", unitDict);
|
||||||
result.put("weightDict", weightDict);
|
result.put("weightDict", weightDict);
|
||||||
result.put("menuTypeDict", menuTypeDict);
|
result.put("menuTypeDict", menuTypeDict);
|
||||||
|
result.put("igdUnitDict", igdUnitDict);
|
||||||
|
result.put("idgTypeDict", idgTypeDict);
|
||||||
|
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
@ -513,6 +516,11 @@ public class WechatAppletController extends BaseController {
|
|||||||
public AjaxResult getRecipesDetail(@RequestParam Long menuId) {
|
public AjaxResult getRecipesDetail(@RequestParam Long menuId) {
|
||||||
return AjaxResult.success(iSysRecipesService.selectDishesByMenuId(menuId));
|
return AjaxResult.success(iSysRecipesService.selectDishesByMenuId(menuId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getPlanDetail")
|
||||||
|
public AjaxResult getPlanDetail(@RequestParam Long planId) {
|
||||||
|
return AjaxResult.success(iSysRecipesService.selectSysRecipesByRecipesId(planId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user