Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
		| @@ -4,6 +4,7 @@ import com.stdiet.common.annotation.Log; | ||||
| import com.stdiet.common.core.controller.BaseController; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.core.domain.entity.SysUser; | ||||
| import com.stdiet.common.core.domain.model.LoginUser; | ||||
| import com.stdiet.common.core.page.TableDataInfo; | ||||
| import com.stdiet.common.enums.BusinessType; | ||||
| import com.stdiet.common.utils.SecurityUtils; | ||||
| @@ -74,6 +75,11 @@ public class SysCustomerController extends BaseController { | ||||
|             } | ||||
|         } | ||||
|         startPage(); | ||||
|         //限制客户档案权限,暂时先不放开 | ||||
|         /*LoginUser loginUser = SecurityUtils.getLoginUser(); | ||||
|         if(!SecurityUtils.isManager(loginUser)){ | ||||
|             sysCustomer.setLoginUserId(loginUser.getUser().getUserId()); | ||||
|         }*/ | ||||
|         list = sysCustomerService.selectSysCustomerList(sysCustomer); | ||||
|         if (list != null && list.size() > 0) { | ||||
|             for (SysCustomer sysCus : list) { | ||||
|   | ||||
| @@ -152,6 +152,27 @@ public class SysNutritionalVideoController extends BaseController | ||||
|         return AjaxResult.success(sysNutritionalVideos); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取营养视频播放凭证 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:nutritionalVideo:query')") | ||||
|     @GetMapping(value = "/getVideoPlayAuth/{id}") | ||||
|     public AjaxResult getVideoPlayAuth(@PathVariable("id") Long id) | ||||
|     { | ||||
|         SysNutritionalVideo sysNutritionalVideos = sysNutritionalVideoService.selectSysNutritionalVideoById(id); | ||||
|         if(sysNutritionalVideos != null && StringUtils.isNotEmpty(sysNutritionalVideos.getVideoId())){ | ||||
|             try{ | ||||
|                 String playAuth = AliyunVideoUtils.getVideoPlayAuth(sysNutritionalVideos.getVideoId()); | ||||
|                 sysNutritionalVideos.setPlayAuth(playAuth); | ||||
|             }catch (Exception e){ | ||||
|                 e.printStackTrace(); | ||||
|             } | ||||
|         } | ||||
|         return AjaxResult.success(sysNutritionalVideos); | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 根据视频videoId提交视频截图请求 | ||||
|      */ | ||||
|   | ||||
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; | ||||
| import com.stdiet.common.annotation.Log; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.core.domain.entity.SysUser; | ||||
| import com.stdiet.common.core.domain.model.LoginUser; | ||||
| import com.stdiet.common.enums.BusinessType; | ||||
| import com.stdiet.common.utils.SecurityUtils; | ||||
| import com.stdiet.common.utils.StringUtils; | ||||
| @@ -59,7 +60,12 @@ public class SysOrderController extends OrderBaseController { | ||||
|                 sysOrder.setAccRange(remark.split("\\|")); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         //限制订单权限,暂时先不放开 | ||||
|         /*LoginUser loginUser = SecurityUtils.getLoginUser(); | ||||
|         if(!SecurityUtils.isManager(loginUser)){ | ||||
|             System.out.println(loginUser.getUser().getUserId() + "-------------------------"); | ||||
|             sysOrder.setLoginUserId(loginUser.getUser().getUserId()); | ||||
|         }*/ | ||||
|         list = sysOrderService.selectSysOrderList(sysOrder); | ||||
|         List<SysUser> userList = userService.selectAllUser(); | ||||
|         BigDecimal totalAmount = sysOrderService.selectAllOrderAmount(sysOrder); | ||||
|   | ||||
| @@ -0,0 +1,103 @@ | ||||
| package com.stdiet.custom.controller; | ||||
|  | ||||
| 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.SysWxBannerImage; | ||||
| import com.stdiet.custom.service.ISysWxBannerImageService; | ||||
| import com.stdiet.common.utils.poi.ExcelUtil; | ||||
| import com.stdiet.common.core.page.TableDataInfo; | ||||
|  | ||||
| /** | ||||
|  * 小程序banner图Controller | ||||
|  * | ||||
|  * @author xzj | ||||
|  * @date 2021-07-13 | ||||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/custom/wxBannerImage") | ||||
| public class SysWxBannerImageController extends BaseController | ||||
| { | ||||
|     @Autowired | ||||
|     private ISysWxBannerImageService sysWxBannerImageService; | ||||
|  | ||||
|     /** | ||||
|      * 查询小程序banner图列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:list')") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo list(SysWxBannerImage sysWxBannerImage) | ||||
|     { | ||||
|         startPage(); | ||||
|         List<SysWxBannerImage> list = sysWxBannerImageService.selectSysWxBannerImageList(sysWxBannerImage); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 导出小程序banner图列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:export')") | ||||
|     @Log(title = "小程序banner图", businessType = BusinessType.EXPORT) | ||||
|     @GetMapping("/export") | ||||
|     public AjaxResult export(SysWxBannerImage sysWxBannerImage) | ||||
|     { | ||||
|         List<SysWxBannerImage> list = sysWxBannerImageService.selectSysWxBannerImageList(sysWxBannerImage); | ||||
|         ExcelUtil<SysWxBannerImage> util = new ExcelUtil<SysWxBannerImage>(SysWxBannerImage.class); | ||||
|         return util.exportExcel(list, "wxBannerImage"); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取小程序banner图详细信息 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:query')") | ||||
|     @GetMapping(value = "/{id}") | ||||
|     public AjaxResult getInfo(@PathVariable("id") Long id) | ||||
|     { | ||||
|         return AjaxResult.success(sysWxBannerImageService.selectSysWxBannerImageById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增小程序banner图 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:add')") | ||||
|     @Log(title = "小程序banner图", businessType = BusinessType.INSERT) | ||||
|     @PostMapping | ||||
|     public AjaxResult add(@RequestBody SysWxBannerImage sysWxBannerImage) | ||||
|     { | ||||
|         return toAjax(sysWxBannerImageService.insertSysWxBannerImage(sysWxBannerImage)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改小程序banner图 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:edit')") | ||||
|     @Log(title = "小程序banner图", businessType = BusinessType.UPDATE) | ||||
|     @PutMapping | ||||
|     public AjaxResult edit(@RequestBody SysWxBannerImage sysWxBannerImage) | ||||
|     { | ||||
|         return toAjax(sysWxBannerImageService.updateSysWxBannerImage(sysWxBannerImage)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除小程序banner图 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('custom:wxBannerImage:remove')") | ||||
|     @Log(title = "小程序banner图", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public AjaxResult remove(@PathVariable Long[] ids) | ||||
|     { | ||||
|         return toAjax(sysWxBannerImageService.deleteSysWxBannerImageByIds(ids)); | ||||
|     } | ||||
| } | ||||
| @@ -74,6 +74,9 @@ public class WechatAppletController extends BaseController { | ||||
|     @Autowired | ||||
|     private ISysVideoClassifyService sysVideoClassifyService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysWxBannerImageService sysWxBannerImageService; | ||||
|  | ||||
|     /** | ||||
|      * 查询微信小程序中展示的客户案例 | ||||
|      */ | ||||
| @@ -775,6 +778,87 @@ public class WechatAppletController extends BaseController { | ||||
|             } | ||||
|         } | ||||
|         return AjaxResult.success(result); | ||||
|     }*/ | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 查询打卡社区 | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/getCommunityPunch") | ||||
|     public TableDataInfo getCommunityPunch() { | ||||
|         startPage(); | ||||
|         List<CommunityPunchReponse> list = sysWxUserLogService.getCommunityPunch(new SysWxUserLog()); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改健康减脂宣言 | ||||
|      * @return | ||||
|      */ | ||||
|     @PostMapping("/updateHealthManifesto") | ||||
|     public AjaxResult updateHealthManifesto(@RequestParam("cusId")String cusId, @RequestParam("healthManifesto")String healthManifesto) { | ||||
|         if(StringUtils.isEmpty(healthManifesto,cusId)){ | ||||
|             return AjaxResult.error("缺少必要参数"); | ||||
|         } | ||||
|         cusId = AesUtils.decrypt(cusId); | ||||
|         if(cusId == null){ | ||||
|             return AjaxResult.error("参数不合法"); | ||||
|         } | ||||
|         if(healthManifesto.length() > 200){ | ||||
|             return AjaxResult.error("健康宣言字数过长"); | ||||
|         } | ||||
|         SysWxUserInfo sysWxUserInfo = new SysWxUserInfo(); | ||||
|         sysWxUserInfo.setCusId(Long.parseLong(cusId)); | ||||
|         sysWxUserInfo.setHealthManifesto(healthManifesto); | ||||
|         return toAjax(sysWxUserInfoService.updateHealthManifestoByCusId(sysWxUserInfo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取个人中心数据(健康宣言、消息条数、打卡社区总打卡次数、打卡次数) | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/getCustomerCenterInfo") | ||||
|     public AjaxResult getCustomerCenterInfo(@RequestParam("cusId")String cusId) { | ||||
|         if(StringUtils.isEmpty(cusId)){ | ||||
|             return AjaxResult.error("缺少必要参数"); | ||||
|         } | ||||
|         cusId = AesUtils.decrypt(cusId); | ||||
|         if(cusId == null){ | ||||
|             return AjaxResult.error("参数不合法"); | ||||
|         } | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         //获取健康宣言 | ||||
|         SysWxUserInfo sysWxUserInfo = sysWxUserInfoService.selectSysWxUserInfoByCusId(Long.parseLong(cusId)); | ||||
|         result.put("healthManifesto",sysWxUserInfo.getHealthManifesto() == null ? "" : sysWxUserInfo.getHealthManifesto()); | ||||
|         //获取未读消息条数 | ||||
|         SysMessageNotice messageParam = new SysMessageNotice(); | ||||
|         messageParam.setReadType(0); | ||||
|         messageParam.setMessageCustomer(Long.parseLong(cusId)); | ||||
|         int unReadNoticeTotal = sysMessageNoticeService.getCustomerMessageCount(messageParam); | ||||
|         result.put("unReadNoticeTotal", unReadNoticeTotal); | ||||
|         //获取已打卡几次 | ||||
|         SysWxUserLog sysWxUserLog = new SysWxUserLog(); | ||||
|         sysWxUserLog.setCustomerId(Long.parseLong(cusId)); | ||||
|         int punchNum = sysWxUserLogService.getPunchTotalNum(sysWxUserLog); | ||||
|         result.put("customerPunchNum", unReadNoticeTotal); | ||||
|         //查询社区打卡客户数量 | ||||
|         int punchCustomerNum = sysWxUserLogService.getPunchCustomerTotalNum(); | ||||
|         result.put("punchCustomerNum", punchCustomerNum); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取需要在小程序展示的Banner图 | ||||
|      * @return | ||||
|      */ | ||||
|     @GetMapping("/getShowBannerImage") | ||||
|     public AjaxResult getShowBannerImage() { | ||||
|         SysWxBannerImage sysWxBannerImage = new SysWxBannerImage(); | ||||
|         //获取可以显示的Banner | ||||
|         sysWxBannerImage.setShowFlag(1L); | ||||
|         List<BannerResponse> list = sysWxBannerImageService.getBannerListOrderByOrderNum(sysWxBannerImage); | ||||
|         return AjaxResult.success(list); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/studyVideoClassify") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user