Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
		| @@ -15,12 +15,14 @@ import com.stdiet.custom.domain.SysCustomerPhysicalSigns; | ||||
| import com.stdiet.custom.service.ISysCustomerHealthyService; | ||||
| import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; | ||||
| import com.stdiet.custom.service.ISysCustomerService; | ||||
| import com.stdiet.custom.service.ISysPhysicalSignsService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.regex.Pattern; | ||||
|  | ||||
| /** | ||||
|  * 客户体征信息Controller | ||||
| @@ -40,6 +42,9 @@ public class SysCustomerController extends BaseController { | ||||
|     @Autowired | ||||
|     private ISysCustomerHealthyService sysCustomerHealthyService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysPhysicalSignsService sysPhysicalSignsService; | ||||
|  | ||||
|     /** | ||||
|      * 查询客户信息列表 | ||||
|      */ | ||||
| @@ -56,6 +61,20 @@ public class SysCustomerController extends BaseController { | ||||
|                 sysCustomer.setChannels(remark.split("\\|")); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         //体征查询 | ||||
|         if(StringUtils.isNotEmpty(sysCustomer.getPhysicalSignsId())){ | ||||
|             //判断是否数字ID | ||||
|             Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); | ||||
|             if(pattern.matcher(sysCustomer.getPhysicalSignsId()).matches()){ | ||||
|                 List<Long> signIdList = new ArrayList<>(); | ||||
|                 signIdList.add(Long.parseLong(sysCustomer.getPhysicalSignsId())); | ||||
|                 sysCustomer.setSignIdList(signIdList); | ||||
|             }else { | ||||
|                 sysCustomer.setSignIdList(sysPhysicalSignsService.getSignIdByName(sysCustomer.getPhysicalSignsId())); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         list = sysCustomerService.selectSysCustomerList(sysCustomer); | ||||
|         if (list != null && list.size() > 0) { | ||||
|             for (SysCustomer sysCus : list) { | ||||
|   | ||||
| @@ -0,0 +1,103 @@ | ||||
| package com.stdiet.web.controller.custom; | ||||
|  | ||||
| import java.util.List; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.PutMapping; | ||||
| import org.springframework.web.bind.annotation.DeleteMapping; | ||||
| import org.springframework.web.bind.annotation.PathVariable; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| import com.stdiet.common.annotation.Log; | ||||
| import com.stdiet.common.core.controller.BaseController; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.enums.BusinessType; | ||||
| import com.stdiet.custom.domain.SysNutritionalVideo; | ||||
| import com.stdiet.custom.service.ISysNutritionalVideoService; | ||||
| import com.stdiet.common.utils.poi.ExcelUtil; | ||||
| import com.stdiet.common.core.page.TableDataInfo; | ||||
|  | ||||
| /** | ||||
|  * 营养视频Controller | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-04-29 | ||||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/custom/nutritionalVideo") | ||||
| public class SysNutritionalVideoController extends BaseController | ||||
| { | ||||
|     @Autowired | ||||
|     private ISysNutritionalVideoService sysNutritionalVideoService; | ||||
|  | ||||
|     /** | ||||
|      * 查询营养视频列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:list')") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo list(SysNutritionalVideo sysNutritionalVideo) | ||||
|     { | ||||
|         startPage(); | ||||
|         List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 导出营养视频列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:export')") | ||||
|     @Log(title = "营养视频", businessType = BusinessType.EXPORT) | ||||
|     @GetMapping("/export") | ||||
|     public AjaxResult export(SysNutritionalVideo sysNutritionalVideo) | ||||
|     { | ||||
|         List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo); | ||||
|         ExcelUtil<SysNutritionalVideo> util = new ExcelUtil<SysNutritionalVideo>(SysNutritionalVideo.class); | ||||
|         return util.exportExcel(list, "nutritionalVideo"); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取营养视频详细信息 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:query')") | ||||
|     @GetMapping(value = "/{id}") | ||||
|     public AjaxResult getInfo(@PathVariable("id") Long id) | ||||
|     { | ||||
|         return AjaxResult.success(sysNutritionalVideoService.selectSysNutritionalVideoById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增营养视频 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:add')") | ||||
|     @Log(title = "营养视频", businessType = BusinessType.INSERT) | ||||
|     @PostMapping | ||||
|     public AjaxResult add(@RequestBody SysNutritionalVideo sysNutritionalVideo) | ||||
|     { | ||||
|         return toAjax(sysNutritionalVideoService.insertSysNutritionalVideo(sysNutritionalVideo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改营养视频 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:edit')") | ||||
|     @Log(title = "营养视频", businessType = BusinessType.UPDATE) | ||||
|     @PutMapping | ||||
|     public AjaxResult edit(@RequestBody SysNutritionalVideo sysNutritionalVideo) | ||||
|     { | ||||
|         return toAjax(sysNutritionalVideoService.updateSysNutritionalVideo(sysNutritionalVideo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除营养视频 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:remove')") | ||||
|     @Log(title = "营养视频", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public AjaxResult remove(@PathVariable Long[] ids) | ||||
|     { | ||||
|         return toAjax(sysNutritionalVideoService.deleteSysNutritionalVideoByIds(ids)); | ||||
|     } | ||||
| } | ||||
| @@ -13,6 +13,7 @@ import com.stdiet.common.utils.poi.ExcelUtil; | ||||
| import com.stdiet.custom.domain.SysWxUserInfo; | ||||
| import com.stdiet.custom.domain.SysWxUserLog; | ||||
| import com.stdiet.custom.page.WxLogInfo; | ||||
| import com.stdiet.custom.service.ISysMessageNoticeService; | ||||
| import com.stdiet.custom.service.ISysOrderService; | ||||
| import com.stdiet.custom.service.ISysWxUserInfoService; | ||||
| import com.stdiet.custom.service.ISysWxUserLogService; | ||||
| @@ -40,8 +41,12 @@ public class SysWxUserLogController extends BaseController { | ||||
|     @Autowired | ||||
|     private ISysWxUserInfoService sysWxUserInfoService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysOrderService sysOrderService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysMessageNoticeService sysMessageNoticeService; | ||||
|  | ||||
|     /** | ||||
|      * 查询微信用户记录列表 | ||||
|      */ | ||||
| @@ -211,6 +216,11 @@ public class SysWxUserLogController extends BaseController { | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxUserLog:query')") | ||||
|     @PostMapping("/commentPunchContent") | ||||
|     public AjaxResult commentPunchContent(@RequestBody SysWxUserLog sysWxUserLog) { | ||||
|         return toAjax(sysWxUserLogService.updateSysWxUserLog(sysWxUserLog)); | ||||
|         int row = sysWxUserLogService.updateSysWxUserLog(sysWxUserLog); | ||||
|         if(row > 0){ | ||||
|             SysWxUserLog log = sysWxUserLogService.selectSysWxUserLogById(sysWxUserLog.getId()+""); | ||||
|             sysMessageNoticeService.sendPunchCommentMessage(log); | ||||
|         } | ||||
|         return toAjax(row); | ||||
|     } | ||||
| } | ||||
| @@ -1,9 +1,14 @@ | ||||
| package com.stdiet.web.controller.custom; | ||||
|  | ||||
| import com.aliyun.vod20170321.models.GetPlayInfoResponseBody; | ||||
| import com.aliyun.vod20170321.models.GetVideoInfoResponseBody; | ||||
| import com.aliyun.vod20170321.models.GetVideoListResponseBody; | ||||
| import com.itextpdf.io.util.DateTimeUtil; | ||||
| import com.stdiet.common.core.controller.BaseController; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.core.page.TableDataInfo; | ||||
| import com.stdiet.common.exception.file.FileNameLengthLimitExceededException; | ||||
| import com.stdiet.common.utils.AliyunVideoUtils; | ||||
| import com.stdiet.common.utils.DateUtils; | ||||
| import com.stdiet.common.utils.StringUtils; | ||||
| import com.stdiet.common.utils.file.FileUploadUtils; | ||||
| @@ -12,8 +17,11 @@ import com.stdiet.common.utils.oss.AliyunOSSUtils; | ||||
| import com.stdiet.common.utils.sign.AesUtils; | ||||
| import com.stdiet.custom.domain.*; | ||||
| import com.stdiet.custom.dto.response.CustomerCaseResponse; | ||||
| import com.stdiet.custom.dto.response.MessageNoticeResponse; | ||||
| import com.stdiet.custom.dto.response.NutritionalVideoResponse; | ||||
| import com.stdiet.custom.page.WxLogInfo; | ||||
| import com.stdiet.custom.service.*; | ||||
| import org.aspectj.weaver.loadtime.Aj; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | ||||
| @@ -46,6 +54,15 @@ public class WechatAppletController extends BaseController { | ||||
|     @Autowired | ||||
|     private ISysCustomerService iSysCustomerService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysMessageNoticeService sysMessageNoticeService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysCustomerService sysCustomerService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysNutritionalVideoService sysNutritionalVideoService; | ||||
|  | ||||
|     /** | ||||
|      * 查询微信小程序中展示的客户案例 | ||||
|      */ | ||||
| @@ -82,8 +99,7 @@ public class WechatAppletController extends BaseController { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 同步客户信息,返回订单数量 | ||||
|      * | ||||
|      * 同步客户信息 | ||||
|      * @param sysWxUserInfo | ||||
|      * @return | ||||
|      */ | ||||
| @@ -100,7 +116,17 @@ public class WechatAppletController extends BaseController { | ||||
|         } else { | ||||
|             sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo); | ||||
|         } | ||||
|         return AjaxResult.success(); | ||||
|         Map<String,Object> result = new HashMap<>(); | ||||
|         //根据手机号查询返回用户加密ID | ||||
|         SysCustomer customer = sysCustomerService.getCustomerByPhone(sysWxUserInfo.getPhone()); | ||||
|         result.put("customerId", customer != null ? AesUtils.encrypt(customer.getId()+"", null) : null); | ||||
|         //查询未读消息数量 | ||||
|         SysMessageNotice messageParam = new SysMessageNotice(); | ||||
|         messageParam.setReadType(0); | ||||
|         messageParam.setMessageCustomer(customer != null ? customer.getId() : 0); | ||||
|         int unReadNoticeTotal = sysMessageNoticeService.getCustomerMessageCount(messageParam); | ||||
|         result.put("unReadNoticeTotal", unReadNoticeTotal); | ||||
|         return AjaxResult.success(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -305,6 +331,98 @@ public class WechatAppletController extends BaseController { | ||||
|         return toAjax(sysAskNutritionQuestionService.insertSysAskNutritionQuestion(sysAskNutritionQuestion)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取用户通知消息 | ||||
|      */ | ||||
|     @GetMapping(value = "/getCustomerMessage") | ||||
|     public TableDataInfo getCustomerMessage(SysMessageNotice sysMessageNotice) { | ||||
|         startPage(); | ||||
|         if(StringUtils.isNotEmpty(sysMessageNotice.getCustomerId())){ | ||||
|             sysMessageNotice.setMessageCustomer(Long.parseLong(AesUtils.decrypt(sysMessageNotice.getCustomerId(), null))); | ||||
|         }else{ | ||||
|             sysMessageNotice.setMessageCustomer(0L); | ||||
|         } | ||||
|         List<MessageNoticeResponse> list = sysMessageNoticeService.getCustomerMessage(sysMessageNotice); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 更新用户通知消息已读状态 | ||||
|      */ | ||||
|     @GetMapping(value = "/updateMessageReadStatus") | ||||
|     public AjaxResult updateMessageReadStatus(@RequestParam("id")Long id) { | ||||
|         SysMessageNotice sysMessageNotice = new SysMessageNotice(); | ||||
|         sysMessageNotice.setReadType(1); | ||||
|         sysMessageNotice.setId(id); | ||||
|         return toAjax(sysMessageNoticeService.updateSysMessageNotice(sysMessageNotice)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 更新用户通知消息已读状态 | ||||
|      */ | ||||
|     @GetMapping(value = "/getVideoList") | ||||
|     public TableDataInfo getVideoList(SysNutritionalVideo sysNutritionalVideo) { | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         startPage(); | ||||
|         //int total = 0; | ||||
|         //List<NutritionalVideoResponse> nutritionalVideoList = new ArrayList<>(); | ||||
|         try{ | ||||
|             /**GetVideoListResponseBody videoListResponseBody = AliyunVideoUtils.getVideoListByPage(null, "Normal", 1, 10); | ||||
|             if(videoListResponseBody != null){ | ||||
|                 total = videoListResponseBody.total; | ||||
|                 for (GetVideoListResponseBody.GetVideoListResponseBodyVideoListVideo video : videoListResponseBody.videoList.video) { | ||||
|                     NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse(); | ||||
|                     nutritionalVideoResponse.setCoverURL(video.getCoverURL()); | ||||
|                     nutritionalVideoResponse.setTitle(video.getTitle()); | ||||
|                     nutritionalVideoResponse.setVideoId(video.getVideoId()); | ||||
|                     nutritionalVideoResponse.setDescription(video.getDescription()); | ||||
|                     nutritionalVideoResponse.setTags(video.getTags()); | ||||
|                     nutritionalVideoList.add(nutritionalVideoResponse); | ||||
|                     System.out.println(video.getVideoId()); | ||||
|                     System.out.println(video.getCoverURL()); | ||||
|                     System.out.println(video.getTitle()); | ||||
|                     System.out.println(video.getDescription()); | ||||
|                 } | ||||
|             } | ||||
|             System.out.println();**/ | ||||
|             sysNutritionalVideo.setShowFlag(1); | ||||
|             List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo); | ||||
|             return getDataTable(list); | ||||
|         }catch (Exception e){ | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 根据视频id获取播放链接 | ||||
|      */ | ||||
|     @GetMapping(value = "/getVideoDetailById") | ||||
|     public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) { | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse(); | ||||
|         try{ | ||||
|             SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId); | ||||
|             if(sysNutritionalVideo != null){ | ||||
|                 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(sysNutritionalVideo.getDescription()); | ||||
|                 nutritionalVideoResponse.setTags(sysNutritionalVideo.getTags()); | ||||
|                 nutritionalVideoResponse.setTitle(sysNutritionalVideo.getTitle()); | ||||
|                 nutritionalVideoResponse.setCreateTime(DateUtils.dateTime(sysNutritionalVideo.getCreateTime())); | ||||
|             } | ||||
|         }catch (Exception e){ | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|         result.put("videoDetail", nutritionalVideoResponse); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/login") | ||||
|     public AjaxResult login(@RequestBody SysWxUserInfo sysWxUserInfo) { | ||||
|         if (StringUtils.isEmpty(sysWxUserInfo.getOpenid())) { | ||||
| @@ -333,5 +451,4 @@ public class WechatAppletController extends BaseController { | ||||
|         sysWxUserInfoService.updateSysWxUserInfo(curWxUserInfo); | ||||
|  | ||||
|         return AjaxResult.success(curWxUserInfo); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user