Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
commit
ab291f3032
@ -4,6 +4,7 @@ import com.stdiet.common.annotation.Log;
|
|||||||
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.SysUser;
|
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.core.page.TableDataInfo;
|
||||||
import com.stdiet.common.enums.BusinessType;
|
import com.stdiet.common.enums.BusinessType;
|
||||||
import com.stdiet.common.utils.SecurityUtils;
|
import com.stdiet.common.utils.SecurityUtils;
|
||||||
@ -74,6 +75,11 @@ public class SysCustomerController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
|
//限制客户档案权限,暂时先不放开
|
||||||
|
/*LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if(!SecurityUtils.isManager(loginUser)){
|
||||||
|
sysCustomer.setLoginUserId(loginUser.getUser().getUserId());
|
||||||
|
}*/
|
||||||
list = sysCustomerService.selectSysCustomerList(sysCustomer);
|
list = sysCustomerService.selectSysCustomerList(sysCustomer);
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (SysCustomer sysCus : list) {
|
for (SysCustomer sysCus : list) {
|
||||||
|
@ -152,6 +152,27 @@ public class SysNutritionalVideoController extends BaseController
|
|||||||
return AjaxResult.success(sysNutritionalVideos);
|
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提交视频截图请求
|
* 根据视频videoId提交视频截图请求
|
||||||
*/
|
*/
|
||||||
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.stdiet.common.annotation.Log;
|
import com.stdiet.common.annotation.Log;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
import com.stdiet.common.core.domain.entity.SysUser;
|
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.enums.BusinessType;
|
||||||
import com.stdiet.common.utils.SecurityUtils;
|
import com.stdiet.common.utils.SecurityUtils;
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
@ -59,7 +60,12 @@ public class SysOrderController extends OrderBaseController {
|
|||||||
sysOrder.setAccRange(remark.split("\\|"));
|
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 = sysOrderService.selectSysOrderList(sysOrder);
|
||||||
List<SysUser> userList = userService.selectAllUser();
|
List<SysUser> userList = userService.selectAllUser();
|
||||||
BigDecimal totalAmount = sysOrderService.selectAllOrderAmount(sysOrder);
|
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
|
@Autowired
|
||||||
private ISysVideoClassifyService sysVideoClassifyService;
|
private ISysVideoClassifyService sysVideoClassifyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysWxBannerImageService sysWxBannerImageService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询微信小程序中展示的客户案例
|
* 查询微信小程序中展示的客户案例
|
||||||
*/
|
*/
|
||||||
@ -775,6 +778,87 @@ public class WechatAppletController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(result);
|
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")
|
@GetMapping("/studyVideoClassify")
|
||||||
|
@ -137,6 +137,29 @@ public class AliyunVideoUtils {
|
|||||||
return client.createUploadVideo(createUploadVideoRequest);
|
return client.createUploadVideo(createUploadVideoRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据视频ID获取对应播放凭证
|
||||||
|
* @param videoId
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String getVideoPlayAuth(String videoId) throws Exception{
|
||||||
|
com.aliyun.vod20170321.Client client = AliyunVideoUtils.createClient();
|
||||||
|
GetVideoPlayAuthRequest getVideoPlayAuthRequest = new GetVideoPlayAuthRequest()
|
||||||
|
.setVideoId(videoId);
|
||||||
|
GetVideoPlayAuthResponse response = client.getVideoPlayAuth(getVideoPlayAuthRequest);
|
||||||
|
if(response != null){
|
||||||
|
GetVideoPlayAuthResponseBody body = response.body;
|
||||||
|
if(body != null && StringUtils.isNotEmpty(body.playAuth)){
|
||||||
|
return body.playAuth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.stdiet.common.utils;
|
package com.stdiet.common.utils;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.domain.entity.SysRole;
|
||||||
|
import com.stdiet.common.core.domain.entity.SysUser;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
@ -7,6 +9,9 @@ import com.stdiet.common.constant.HttpStatus;
|
|||||||
import com.stdiet.common.core.domain.model.LoginUser;
|
import com.stdiet.common.core.domain.model.LoginUser;
|
||||||
import com.stdiet.common.exception.CustomException;
|
import com.stdiet.common.exception.CustomException;
|
||||||
|
|
||||||
|
import javax.management.relation.Role;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全服务工具类
|
* 安全服务工具类
|
||||||
*
|
*
|
||||||
@ -14,6 +19,8 @@ import com.stdiet.common.exception.CustomException;
|
|||||||
*/
|
*/
|
||||||
public class SecurityUtils
|
public class SecurityUtils
|
||||||
{
|
{
|
||||||
|
public static final String[] managerRolePower = {"after_sale_manager","operations","personnel","sales_manager","admin","manager","admin-dev"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户账户
|
* 获取用户账户
|
||||||
**/
|
**/
|
||||||
@ -87,4 +94,32 @@ public class SecurityUtils
|
|||||||
{
|
{
|
||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为管理人员
|
||||||
|
*/
|
||||||
|
public static boolean isManager(LoginUser loginUser)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(loginUser != null && loginUser.getUser() != null){
|
||||||
|
SysUser user = loginUser.getUser();
|
||||||
|
List<SysRole> roleList = user.getRoles();
|
||||||
|
if(roleList != null && roleList.size() > 0){
|
||||||
|
for (SysRole role : roleList) {
|
||||||
|
for (String power : managerRolePower) {
|
||||||
|
if(power.equals(role.getRoleKey())){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new CustomException("操作异常", HttpStatus.UNAUTHORIZED);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,21 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
return isNull(str) || NULLSTR.equals(str.trim());
|
return isNull(str) || NULLSTR.equals(str.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断多个字符串是否为空,一个为空则返回true
|
||||||
|
*
|
||||||
|
* @param str String
|
||||||
|
* @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(String ... str) {
|
||||||
|
for (String value : str) {
|
||||||
|
if(isEmpty(value)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * 判断一个字符串是否为非空串
|
* * 判断一个字符串是否为非空串
|
||||||
*
|
*
|
||||||
|
@ -93,6 +93,9 @@ public class SysCustomer extends BaseEntity
|
|||||||
|
|
||||||
private Long salesman;
|
private Long salesman;
|
||||||
|
|
||||||
|
//售中
|
||||||
|
private Long onSaleId;
|
||||||
|
|
||||||
/** 负责人 */
|
/** 负责人 */
|
||||||
@Excel(name = "负责人")
|
@Excel(name = "负责人")
|
||||||
private Long chargePerson;
|
private Long chargePerson;
|
||||||
@ -118,4 +121,6 @@ public class SysCustomer extends BaseEntity
|
|||||||
//病史体征ID
|
//病史体征ID
|
||||||
private String physicalSignsId;
|
private String physicalSignsId;
|
||||||
|
|
||||||
|
private Long loginUserId;
|
||||||
|
|
||||||
}
|
}
|
@ -74,6 +74,9 @@ public class SysNutritionalVideo extends BaseEntity
|
|||||||
|
|
||||||
private String playUrl;
|
private String playUrl;
|
||||||
|
|
||||||
|
//播放凭证
|
||||||
|
private String playAuth;
|
||||||
|
|
||||||
//文件名称
|
//文件名称
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
|
||||||
|
@ -296,4 +296,7 @@ public class SysOrder extends BaseEntity {
|
|||||||
//食谱计划是否连续上个订单
|
//食谱计划是否连续上个订单
|
||||||
private Integer recipesPlanContinue;
|
private Integer recipesPlanContinue;
|
||||||
|
|
||||||
|
//登录用户ID
|
||||||
|
private Long loginUserId;
|
||||||
|
|
||||||
}
|
}
|
@ -159,4 +159,8 @@ public class SysRecipesPlan {
|
|||||||
private Integer subSend;
|
private Integer subSend;
|
||||||
|
|
||||||
private Integer smsSend;
|
private Integer smsSend;
|
||||||
|
|
||||||
|
/** 食谱计划总共几天,大于0小于等于7 */
|
||||||
|
@Excel(name = "食谱计划总共几天,大于0小于等于7")
|
||||||
|
private Integer totalNumDay;
|
||||||
}
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import com.stdiet.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序banner图对象 sys_wx_banner_image
|
||||||
|
*
|
||||||
|
* @author xzj
|
||||||
|
* @date 2021-07-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysWxBannerImage extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** banner图标题 */
|
||||||
|
@Excel(name = "banner图标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** banner图内容 */
|
||||||
|
@Excel(name = "banner图内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** banner图片地址 */
|
||||||
|
@Excel(name = "banner图片地址")
|
||||||
|
private String bannerUrl;
|
||||||
|
|
||||||
|
/** 点击跳转地址 */
|
||||||
|
@Excel(name = "点击跳转地址")
|
||||||
|
private String jumpUrl;
|
||||||
|
|
||||||
|
/** 展示标识 0不展示 1展示 */
|
||||||
|
@Excel(name = "展示标识 0不展示 1展示")
|
||||||
|
private Long showFlag;
|
||||||
|
|
||||||
|
/** 顺序优先级,0-100 */
|
||||||
|
@Excel(name = "顺序优先级,0-100")
|
||||||
|
private Long orderNum;
|
||||||
|
|
||||||
|
/** 删除标识 0未删除 1已删除 */
|
||||||
|
private Long delFlag;
|
||||||
|
}
|
@ -74,6 +74,10 @@ public class SysWxUserInfo {
|
|||||||
@Excel(name = "国家")
|
@Excel(name = "国家")
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
|
/** 健康宣言 */
|
||||||
|
@Excel(name = "健康宣言")
|
||||||
|
private String healthManifesto;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
@ -146,6 +146,14 @@ public class SysWxUserLog extends BaseEntity
|
|||||||
@Excel(name = "点评")
|
@Excel(name = "点评")
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
|
/** 点赞数量 */
|
||||||
|
@Excel(name = "点赞数量")
|
||||||
|
private Long thumbsupNum;
|
||||||
|
|
||||||
|
/** 健康宣言 */
|
||||||
|
@Excel(name = "健康宣言")
|
||||||
|
private String healthManifesto;
|
||||||
|
|
||||||
/** 删除标识 0未删除 1已删除 */
|
/** 删除标识 0未删除 1已删除 */
|
||||||
private Long delFlag;
|
private Long delFlag;
|
||||||
|
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import com.stdiet.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BannerResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** banner图标题 */
|
||||||
|
@Excel(name = "banner图标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** banner图内容 */
|
||||||
|
@Excel(name = "banner图内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** banner图片地址 */
|
||||||
|
@Excel(name = "banner图片地址")
|
||||||
|
private String bannerUrl;
|
||||||
|
|
||||||
|
/** 点击跳转地址 */
|
||||||
|
@Excel(name = "点击跳转地址")
|
||||||
|
private String jumpUrl;
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打卡社区
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommunityPunchReponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信openid
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户ID
|
||||||
|
*/
|
||||||
|
private Long cusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打卡日期时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date logTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当天打卡体重
|
||||||
|
*/
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营养师评论
|
||||||
|
*/
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞数
|
||||||
|
*/
|
||||||
|
private Integer thumbsupNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康宣言
|
||||||
|
*/
|
||||||
|
private String healthManifesto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 近期打卡体重信息 logTime: 打卡日期 weight: 体重
|
||||||
|
*/
|
||||||
|
private List<Map<String,Object>> recentWeight;
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.stdiet.custom.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||||
|
import com.stdiet.custom.dto.response.BannerResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序banner图Mapper接口
|
||||||
|
*
|
||||||
|
* @author xzj
|
||||||
|
* @date 2021-07-13
|
||||||
|
*/
|
||||||
|
public interface SysWxBannerImageMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 小程序banner图
|
||||||
|
*/
|
||||||
|
public SysWxBannerImage selectSysWxBannerImageById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图列表
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 小程序banner图集合
|
||||||
|
*/
|
||||||
|
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除小程序banner图
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysWxBannerImageById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除小程序banner图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysWxBannerImageByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据优先级排序获取banner图
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage);
|
||||||
|
}
|
@ -77,4 +77,11 @@ public interface SysWxUserInfoMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int removeCusIdByOpenId(@Param("openid")String openid);
|
public int removeCusIdByOpenId(@Param("openid")String openid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据cusId更新健康减脂宣言
|
||||||
|
* @param sysWxUserInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo);
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||||
import com.stdiet.custom.domain.SysWxUserLog;
|
import com.stdiet.custom.domain.SysWxUserLog;
|
||||||
|
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||||
import com.stdiet.custom.page.WxLogInfo;
|
import com.stdiet.custom.page.WxLogInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,4 +93,24 @@ public interface SysWxUserLogMapper
|
|||||||
*/
|
*/
|
||||||
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区记录
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据打卡社区
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getPunchTotalNum(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区总共打卡人数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getPunchCustomerTotalNum();
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.stdiet.custom.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||||
|
import com.stdiet.custom.dto.response.BannerResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序banner图Service接口
|
||||||
|
*
|
||||||
|
* @author xzj
|
||||||
|
* @date 2021-07-13
|
||||||
|
*/
|
||||||
|
public interface ISysWxBannerImageService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 小程序banner图
|
||||||
|
*/
|
||||||
|
public SysWxBannerImage selectSysWxBannerImageById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图列表
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 小程序banner图集合
|
||||||
|
*/
|
||||||
|
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除小程序banner图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的小程序banner图ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysWxBannerImageByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除小程序banner图信息
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSysWxBannerImageById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据优先级排序获取banner图
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage);
|
||||||
|
}
|
@ -77,5 +77,12 @@ public interface ISysWxUserInfoService
|
|||||||
*/
|
*/
|
||||||
public int removeCusIdByOpenId(String openid);
|
public int removeCusIdByOpenId(String openid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据cusId更新健康减脂宣言
|
||||||
|
* @param sysWxUserInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||||
import com.stdiet.custom.domain.SysWxUserLog;
|
import com.stdiet.custom.domain.SysWxUserLog;
|
||||||
|
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||||
import com.stdiet.custom.page.WxLogInfo;
|
import com.stdiet.custom.page.WxLogInfo;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@ -94,4 +95,24 @@ public interface ISysWxUserLogService
|
|||||||
*/
|
*/
|
||||||
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区记录
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据打卡社区
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getPunchTotalNum(SysWxUserLog sysWxUserLog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区总共打卡人数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getPunchCustomerTotalNum();
|
||||||
|
|
||||||
}
|
}
|
@ -191,7 +191,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
pauseParam.setCusId(sysOrder.getCusId());
|
pauseParam.setCusId(sysOrder.getCusId());
|
||||||
List<SysOrderPause> pauseList = sysOrderPauseService.getPauseListByCusIdAndOrderId(pauseParam);
|
List<SysOrderPause> pauseList = sysOrderPauseService.getPauseListByCusIdAndOrderId(pauseParam);
|
||||||
|
|
||||||
List<SysRecipesPlan> planList = generatePlan(sysOrder, DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList);
|
List<SysRecipesPlan> planList = generatePlan(sysOrder, DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()), pauseList, oldRecipesPlanList);
|
||||||
if (oldRecipesPlanList != null && oldRecipesPlanList.size() > 0) {
|
if (oldRecipesPlanList != null && oldRecipesPlanList.size() > 0) {
|
||||||
updateOrAddRecipesPlan(oldRecipesPlanList, planList);
|
updateOrAddRecipesPlan(oldRecipesPlanList, planList);
|
||||||
} else {
|
} else {
|
||||||
@ -328,13 +328,15 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
* @param pauseList 暂停列表
|
* @param pauseList 暂停列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<SysRecipesPlan> generatePlan(SysOrder sysOrder, LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList) {
|
private List<SysRecipesPlan> generatePlan(SysOrder sysOrder, LocalDate serverStartDate, LocalDate serverEndDate, List<SysOrderPause> pauseList, List<SysRecipesPlan> oldRecipesPlanList) {
|
||||||
//查询在上一个订单最后一条食谱计划
|
//查询在上一个订单最后一条食谱计划
|
||||||
SysRecipesPlan beforeOrderLastPlan = getLastDayRecipesPlan(sysOrder.getCusId(), sysOrder.getOrderTime());
|
SysRecipesPlan beforeOrderLastPlan = getLastDayRecipesPlan(sysOrder.getCusId(), sysOrder.getOrderTime());
|
||||||
int startNumDay = 0;
|
int startNumDay = 0;
|
||||||
//System.out.println(sysOrder.getRecipesPlanContinue() == null);
|
//System.out.println(sysOrder.getRecipesPlanContinue() == null);
|
||||||
int totalDays = (beforeOrderLastPlan != null ? beforeOrderLastPlan.getEndNumDay() : 0) + Integer.parseInt(ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()))+"") + 1;
|
int totalDays = (beforeOrderLastPlan != null ? beforeOrderLastPlan.getEndNumDay() : 0) + Integer.parseInt(ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(sysOrder.getStartTime()), DateUtils.dateToLocalDate(sysOrder.getServerEndTime()))+"") + 1;
|
||||||
//System.out.println(totalDays);
|
//System.out.println(totalDays);
|
||||||
|
//每条食谱计划日期相差的天数
|
||||||
|
int totalNumDay = 6;
|
||||||
//之前是否存在食谱以及该订单食谱计划是否需要连续
|
//之前是否存在食谱以及该订单食谱计划是否需要连续
|
||||||
if (beforeOrderLastPlan != null && sysOrder.getRecipesPlanContinue().intValue() == 1) {
|
if (beforeOrderLastPlan != null && sysOrder.getRecipesPlanContinue().intValue() == 1) {
|
||||||
long differDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), serverStartDate);
|
long differDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), serverStartDate);
|
||||||
@ -342,21 +344,14 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
if (differDay <= 1) {
|
if (differDay <= 1) {
|
||||||
//判断前一个订单食谱是否满七天,不满则需要接上
|
//判断前一个订单食谱是否满七天,不满则需要接上
|
||||||
int differNum = beforeOrderLastPlan.getEndNumDay() - beforeOrderLastPlan.getStartNumDay();
|
int differNum = beforeOrderLastPlan.getEndNumDay() - beforeOrderLastPlan.getStartNumDay();
|
||||||
if (differNum < 6) {
|
totalNumDay = beforeOrderLastPlan.getTotalNumDay() - 1;
|
||||||
|
if (differNum != totalNumDay) {
|
||||||
//更新该食谱计划
|
//更新该食谱计划
|
||||||
beforeOrderLastPlan.setEndNumDay(beforeOrderLastPlan.getStartNumDay() + 6);
|
beforeOrderLastPlan.setEndNumDay(beforeOrderLastPlan.getStartNumDay() + totalNumDay);
|
||||||
//
|
String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(totalNumDay-differNum), pauseList, totalNumDay);
|
||||||
String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(6-differNum), pauseList);
|
|
||||||
//LocalDate planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
//LocalDate planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
||||||
LocalDate planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
LocalDate planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
||||||
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(planEndDate));
|
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(planEndDate));
|
||||||
|
|
||||||
//beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(6 - differNum)));
|
|
||||||
//
|
|
||||||
/*String[] pauseResult = dealPlanPause(DateUtils.dateToLocalDate(beforeOrderLastPlan.getStartDate()), DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()), pauseList);
|
|
||||||
//LocalDate planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
|
||||||
LocalDate planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
|
||||||
beforeOrderLastPlan.setEndDate(DateUtils.localDateToDate(planEndDate));*/
|
|
||||||
sysRecipesPlanMapper.updateSysRecipesPlan(beforeOrderLastPlan);
|
sysRecipesPlanMapper.updateSysRecipesPlan(beforeOrderLastPlan);
|
||||||
serverStartDate = DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1);
|
serverStartDate = DateUtils.dateToLocalDate(beforeOrderLastPlan.getEndDate()).plusDays(1);
|
||||||
}
|
}
|
||||||
@ -368,15 +363,17 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
LocalDate planStartDate = null;
|
LocalDate planStartDate = null;
|
||||||
LocalDate planEndDate = serverStartDate.plusDays(-1);
|
LocalDate planEndDate = serverStartDate.plusDays(-1);
|
||||||
boolean breakFlag = true;
|
boolean breakFlag = true;
|
||||||
|
Map<String,Integer> totalDayNumMap = getOldEveryPlanTotalNumDay(oldRecipesPlanList);
|
||||||
do {
|
do {
|
||||||
|
totalNumDay = totalDayNumMap.containsKey(startNumDay+1+"") ? totalDayNumMap.get(startNumDay+1+"") : 6;
|
||||||
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
SysRecipesPlan sysRecipesPlan = new SysRecipesPlan();
|
||||||
planStartDate = planEndDate.plusDays(1);
|
planStartDate = planEndDate.plusDays(1);
|
||||||
planEndDate = planStartDate.plusDays(6);
|
planEndDate = planStartDate.plusDays(totalNumDay);
|
||||||
//判断是否大于服务到期时间
|
//判断是否大于服务到期时间
|
||||||
if (ChronoUnit.DAYS.between(planEndDate, serverEndDate) <= 0) {
|
if (ChronoUnit.DAYS.between(planEndDate, serverEndDate) <= 0) {
|
||||||
planEndDate = serverEndDate;
|
planEndDate = serverEndDate;
|
||||||
}
|
}
|
||||||
String[] pauseResult = dealPlanPause(planStartDate, planEndDate, pauseList);
|
String[] pauseResult = dealPlanPause(planStartDate, planEndDate, pauseList,totalNumDay);
|
||||||
//根据暂停结果返回的数据更新计划开始、结束时间
|
//根据暂停结果返回的数据更新计划开始、结束时间
|
||||||
planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
planStartDate = DateUtils.stringToLocalDate(pauseResult[0], "yyyyMMdd");
|
||||||
planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
planEndDate = DateUtils.stringToLocalDate(pauseResult[1], "yyyyMMdd");
|
||||||
@ -402,7 +399,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
startNumDay += 1;
|
startNumDay += 1;
|
||||||
sysRecipesPlan.setStartNumDay(startNumDay);
|
sysRecipesPlan.setStartNumDay(startNumDay);
|
||||||
long dayNumber = ChronoUnit.DAYS.between(planStartDate, planEndDate);
|
long dayNumber = ChronoUnit.DAYS.between(planStartDate, planEndDate);
|
||||||
startNumDay += dayNumber > 6 ? 6 : dayNumber;
|
startNumDay += dayNumber > totalNumDay ? totalNumDay : dayNumber;
|
||||||
sysRecipesPlan.setEndNumDay(startNumDay > totalDays ? totalDays : startNumDay);//
|
sysRecipesPlan.setEndNumDay(startNumDay > totalDays ? totalDays : startNumDay);//
|
||||||
//添加暂停范围内的日期
|
//添加暂停范围内的日期
|
||||||
planList.add(sysRecipesPlan);
|
planList.add(sysRecipesPlan);
|
||||||
@ -411,6 +408,14 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
return planList;
|
return planList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getOldEveryPlanTotalNumDay(List<SysRecipesPlan> oldRecipesPlanList){
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
for (SysRecipesPlan plan : oldRecipesPlanList) {
|
||||||
|
map.put(plan.getStartNumDay()+"", plan.getTotalNumDay()-1);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据食谱开始时间、结束时间、暂停列表获取在食谱计划范围内的暂停天数,以及返回调整之后的计划开始、结束时间,以及暂停日期
|
* 根据食谱开始时间、结束时间、暂停列表获取在食谱计划范围内的暂停天数,以及返回调整之后的计划开始、结束时间,以及暂停日期
|
||||||
*
|
*
|
||||||
@ -419,7 +424,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
* @param pauseList 暂停列表集合
|
* @param pauseList 暂停列表集合
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String[] dealPlanPause(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList) {
|
private String[] dealPlanPause(LocalDate planStartDate, LocalDate planEndDate, List<SysOrderPause> pauseList, int totalNumDay) {
|
||||||
//分别为计划开始时间、计划结束时间,范围内暂停天数,具体暂停日期,使用|隔开
|
//分别为计划开始时间、计划结束时间,范围内暂停天数,具体暂停日期,使用|隔开
|
||||||
String[] result = {"", "", "0", ""};
|
String[] result = {"", "", "0", ""};
|
||||||
long pauseDay = 0;
|
long pauseDay = 0;
|
||||||
@ -443,7 +448,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
//判断暂停记录是否从食谱计划开始时间开始的
|
//判断暂停记录是否从食谱计划开始时间开始的
|
||||||
if (ChronoUnit.DAYS.between(pauseStartDate, planStartDate) == 0) {
|
if (ChronoUnit.DAYS.between(pauseStartDate, planStartDate) == 0) {
|
||||||
planStartDate = pauseEndDate.plusDays(1);
|
planStartDate = pauseEndDate.plusDays(1);
|
||||||
planEndDate = planStartDate.plusDays(6);
|
planEndDate = planStartDate.plusDays(totalNumDay);
|
||||||
} else {
|
} else {
|
||||||
planEndDate = planEndDate.plusDays(ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate) + 1);
|
planEndDate = planEndDate.plusDays(ChronoUnit.DAYS.between(pauseStartDate, pauseEndDate) + 1);
|
||||||
pauseDateString.addAll(getPauseDateString(pauseStartDate, pauseEndDate));
|
pauseDateString.addAll(getPauseDateString(pauseStartDate, pauseEndDate));
|
||||||
|
@ -0,0 +1,106 @@
|
|||||||
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.custom.dto.response.BannerResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.stdiet.custom.mapper.SysWxBannerImageMapper;
|
||||||
|
import com.stdiet.custom.domain.SysWxBannerImage;
|
||||||
|
import com.stdiet.custom.service.ISysWxBannerImageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序banner图Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xzj
|
||||||
|
* @date 2021-07-13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysWxBannerImageServiceImpl implements ISysWxBannerImageService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SysWxBannerImageMapper sysWxBannerImageMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 小程序banner图
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysWxBannerImage selectSysWxBannerImageById(Long id)
|
||||||
|
{
|
||||||
|
return sysWxBannerImageMapper.selectSysWxBannerImageById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询小程序banner图列表
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 小程序banner图
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysWxBannerImage> selectSysWxBannerImageList(SysWxBannerImage sysWxBannerImage)
|
||||||
|
{
|
||||||
|
return sysWxBannerImageMapper.selectSysWxBannerImageList(sysWxBannerImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSysWxBannerImage(SysWxBannerImage sysWxBannerImage)
|
||||||
|
{
|
||||||
|
sysWxBannerImage.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return sysWxBannerImageMapper.insertSysWxBannerImage(sysWxBannerImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改小程序banner图
|
||||||
|
*
|
||||||
|
* @param sysWxBannerImage 小程序banner图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSysWxBannerImage(SysWxBannerImage sysWxBannerImage)
|
||||||
|
{
|
||||||
|
sysWxBannerImage.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return sysWxBannerImageMapper.updateSysWxBannerImage(sysWxBannerImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除小程序banner图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的小程序banner图ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysWxBannerImageByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return sysWxBannerImageMapper.deleteSysWxBannerImageByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除小程序banner图信息
|
||||||
|
*
|
||||||
|
* @param id 小程序banner图ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSysWxBannerImageById(Long id)
|
||||||
|
{
|
||||||
|
return sysWxBannerImageMapper.deleteSysWxBannerImageById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据优先级排序获取banner图
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BannerResponse> getBannerListOrderByOrderNum(SysWxBannerImage sysWxBannerImage){
|
||||||
|
return sysWxBannerImageMapper.getBannerListOrderByOrderNum(sysWxBannerImage);
|
||||||
|
}
|
||||||
|
}
|
@ -115,4 +115,13 @@ public class SysWxUserInfoServiceImpl implements ISysWxUserInfoService {
|
|||||||
public int removeCusIdByOpenId(String openid){
|
public int removeCusIdByOpenId(String openid){
|
||||||
return sysWxUserInfoMapper.removeCusIdByOpenId(openid);
|
return sysWxUserInfoMapper.removeCusIdByOpenId(openid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据cusId更新健康减脂宣言
|
||||||
|
* @param sysWxUserInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateHealthManifestoByCusId(SysWxUserInfo sysWxUserInfo){
|
||||||
|
return sysWxUserInfoMapper.updateHealthManifestoByCusId(sysWxUserInfo);
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,6 +11,7 @@ import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
|||||||
import com.stdiet.custom.domain.SysMessageNotice;
|
import com.stdiet.custom.domain.SysMessageNotice;
|
||||||
import com.stdiet.custom.domain.SysWxUserInfo;
|
import com.stdiet.custom.domain.SysWxUserInfo;
|
||||||
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
||||||
|
import com.stdiet.custom.dto.response.CommunityPunchReponse;
|
||||||
import com.stdiet.custom.page.WxLogInfo;
|
import com.stdiet.custom.page.WxLogInfo;
|
||||||
import com.stdiet.custom.service.ISysMessageNoticeService;
|
import com.stdiet.custom.service.ISysMessageNoticeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -145,4 +146,30 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
|
|||||||
return sysWxUserLogMapper.getWxLogInfoDetailById(sysWxUserLog);
|
return sysWxUserLogMapper.getWxLogInfoDetailById(sysWxUserLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区记录
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog){
|
||||||
|
return sysWxUserLogMapper.getCommunityPunch(sysWxUserLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据打卡社区
|
||||||
|
* @param sysWxUserLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getPunchTotalNum(SysWxUserLog sysWxUserLog){
|
||||||
|
return sysWxUserLogMapper.getPunchTotalNum(sysWxUserLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打卡社区总共打卡人数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getPunchCustomerTotalNum(){
|
||||||
|
return sysWxUserLogMapper.getPunchCustomerTotalNum();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -28,6 +28,7 @@
|
|||||||
<result property="assistantDietitian" column="assistant_dietitian"/>
|
<result property="assistantDietitian" column="assistant_dietitian"/>
|
||||||
<result property="afterDietitian" column="after_dietitian"/>
|
<result property="afterDietitian" column="after_dietitian"/>
|
||||||
<result property="salesman" column="salesman"/>
|
<result property="salesman" column="salesman"/>
|
||||||
|
<result property="onSaleId" column="on_sale_id" />
|
||||||
|
|
||||||
<association property="dietitianName" column="{id=main_dietitian}" select="selectUserName"/>
|
<association property="dietitianName" column="{id=main_dietitian}" select="selectUserName"/>
|
||||||
<association property="assDietitianName" column="{id=assistant_dietitian}" select="selectUserName"/>
|
<association property="assDietitianName" column="{id=assistant_dietitian}" select="selectUserName"/>
|
||||||
@ -40,14 +41,23 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="selectSysCustomerVo">
|
<sql id="selectSysCustomerVo">
|
||||||
select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by, channel_id from sys_customer
|
select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, on_sale_id, charge_person, follow_status, create_time, create_by, update_time, update_by, channel_id from sys_customer
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchLoginUserId">
|
||||||
|
<if test="loginUserId != null">
|
||||||
|
and (
|
||||||
|
sc.main_dietitian = #{loginUserId} or sc.assistant_dietitian = #{loginUserId} or sc.after_dietitian = #{loginUserId} or sc.salesman = #{loginUserId}
|
||||||
|
or sc.on_sale_id = #{loginUserId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
||||||
select
|
select
|
||||||
sc.id, sc.name, sc.phone, sc.email, sc.fans_time, sc.fans_channel, sc.address, sc.pay_date, sc.start_date,
|
sc.id, sc.name, sc.phone, sc.email, sc.fans_time, sc.fans_channel, sc.address, sc.pay_date, sc.start_date,
|
||||||
sc.purchase_num, sc.pay_total, sc.main_dietitian,
|
sc.purchase_num, sc.pay_total, sc.main_dietitian,
|
||||||
sc.assistant_dietitian, sc.after_dietitian, sc.salesman, sc.charge_person, sc.follow_status,
|
sc.assistant_dietitian, sc.after_dietitian, sc.on_sale_id, sc.salesman, sc.charge_person, sc.follow_status,
|
||||||
sc.create_time,sc.channel_id
|
sc.create_time,sc.channel_id
|
||||||
from sys_customer sc
|
from sys_customer sc
|
||||||
left join sys_customer_healthy as sch
|
left join sys_customer_healthy as sch
|
||||||
@ -60,6 +70,7 @@
|
|||||||
<if test="mainDietitian == 0">and (isnull(sc.main_dietitian) or sc.main_dietitian=0)</if>
|
<if test="mainDietitian == 0">and (isnull(sc.main_dietitian) or sc.main_dietitian=0)</if>
|
||||||
<if test="salesman != null and salesman != ''">and sc.salesman = #{salesman}</if>
|
<if test="salesman != null and salesman != ''">and sc.salesman = #{salesman}</if>
|
||||||
<if test="salesman == 0">and (isnull(sc.salesman) or sc.salesman=0)</if>
|
<if test="salesman == 0">and (isnull(sc.salesman) or sc.salesman=0)</if>
|
||||||
|
<if test="onSaleId != null">and sc.on_sale_id = #{onSaleId}</if>
|
||||||
<if test="afterDietitian != null and afterDietitian != ''">and sc.after_dietitian = #{afterDietitian}</if>
|
<if test="afterDietitian != null and afterDietitian != ''">and sc.after_dietitian = #{afterDietitian}</if>
|
||||||
<if test="afterDietitian == 0">and (isnull(sc.after_dietitian) or sc.after_dietitian=0)</if>
|
<if test="afterDietitian == 0">and (isnull(sc.after_dietitian) or sc.after_dietitian=0)</if>
|
||||||
<if test="assistantDietitian != null and assistantDietitian != ''">and sc.assistant_dietitian =
|
<if test="assistantDietitian != null and assistantDietitian != ''">and sc.assistant_dietitian =
|
||||||
@ -82,6 +93,9 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<include refid="searchLoginUserId">
|
||||||
|
<property name="loginUserId" value="#{loginUserId}"/>
|
||||||
|
</include>
|
||||||
order by sc.create_time desc
|
order by sc.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -107,6 +121,7 @@
|
|||||||
<if test="assistantDietitian != null">assistant_dietitian,</if>
|
<if test="assistantDietitian != null">assistant_dietitian,</if>
|
||||||
<if test="afterDietitian != null">after_dietitian,</if>
|
<if test="afterDietitian != null">after_dietitian,</if>
|
||||||
<if test="salesman != null">salesman,</if>
|
<if test="salesman != null">salesman,</if>
|
||||||
|
<if test="onSaleId != null">on_sale_id,</if>
|
||||||
<if test="chargePerson != null">charge_person,</if>
|
<if test="chargePerson != null">charge_person,</if>
|
||||||
<if test="followStatus != null">follow_status,</if>
|
<if test="followStatus != null">follow_status,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
@ -130,6 +145,7 @@
|
|||||||
<if test="assistantDietitian != null">#{assistantDietitian},</if>
|
<if test="assistantDietitian != null">#{assistantDietitian},</if>
|
||||||
<if test="afterDietitian != null">#{afterDietitian},</if>
|
<if test="afterDietitian != null">#{afterDietitian},</if>
|
||||||
<if test="salesman != null">#{salesman},</if>
|
<if test="salesman != null">#{salesman},</if>
|
||||||
|
<if test="onSaleId != null">#{onSaleId},</if>
|
||||||
<if test="chargePerson != null">#{chargePerson},</if>
|
<if test="chargePerson != null">#{chargePerson},</if>
|
||||||
<if test="followStatus != null">#{followStatus},</if>
|
<if test="followStatus != null">#{followStatus},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
@ -157,6 +173,7 @@
|
|||||||
<if test="assistantDietitian != null">assistant_dietitian = #{assistantDietitian},</if>
|
<if test="assistantDietitian != null">assistant_dietitian = #{assistantDietitian},</if>
|
||||||
<if test="afterDietitian != null">after_dietitian = #{afterDietitian},</if>
|
<if test="afterDietitian != null">after_dietitian = #{afterDietitian},</if>
|
||||||
<if test="salesman != null">salesman = #{salesman},</if>
|
<if test="salesman != null">salesman = #{salesman},</if>
|
||||||
|
<if test="onSaleId != null">on_sale_id = #{onSaleId},</if>
|
||||||
<if test="chargePerson != null">charge_person = #{chargePerson},</if>
|
<if test="chargePerson != null">charge_person = #{chargePerson},</if>
|
||||||
<if test="followStatus != null">follow_status = #{followStatus},</if>
|
<if test="followStatus != null">follow_status = #{followStatus},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
@ -95,12 +95,81 @@
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchLoginUserId">
|
||||||
|
<if test="loginUserId != null">
|
||||||
|
and (
|
||||||
|
sc.main_dietitian = #{loginUserId} or sc.assistant_dietitian = #{loginUserId} or sc.after_dietitian = #{loginUserId} or sc.salesman = #{loginUserId}
|
||||||
|
or o.pre_sale_id = #{loginUserId} or o.on_sale_id = #{loginUserId} or o.after_sale_id = #{loginUserId} or o.nutritionist_id = #{loginUserId} or
|
||||||
|
o.nutri_assis_id = #{loginUserId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal">
|
<select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal">
|
||||||
SELECT SUM(amount) FROM sys_order
|
SELECT SUM(amount) FROM sys_order o LEFT JOIN sys_customer sc ON sc.id = o.cus_id
|
||||||
<where>
|
<where>
|
||||||
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
|
<if test="orderId != null and orderId != ''">and o.order_id = #{orderId}</if>
|
||||||
<if test="customer != null and customer != ''">
|
<if test="customer != null and customer != ''">
|
||||||
and (customer like concat('%',#{customer},'%') or phone like concat('%',#{customer},'%'))
|
and (o.customer like concat('%',#{customer},'%') or o.phone like concat('%',#{customer},'%'))
|
||||||
|
</if>
|
||||||
|
<if test="accRange != null">
|
||||||
|
and o.account_id in
|
||||||
|
<foreach collection="accRange" separator="," item="acc" open="(" close=")" >
|
||||||
|
#{acc}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="cusId != null and cusId != ''">and o.cus_id = #{cusId}</if>
|
||||||
|
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
|
||||||
|
<if test="status != null ">and o.status = #{status}</if>
|
||||||
|
<if test="payTypeId != null ">and o.pay_type_id = #{payTypeId}</if>
|
||||||
|
<if test="preSaleId != null ">and o.pre_sale_id = #{preSaleId}</if>
|
||||||
|
<if test="pushPreSaleId != null ">and o.push_pre_sale_id = #{pushPreSaleId}</if>
|
||||||
|
<if test="onSaleId != null">
|
||||||
|
and o.on_sale_id = #{onSaleId}
|
||||||
|
</if>
|
||||||
|
<if test="afterSaleId != null ">and o.after_sale_id = #{afterSaleId}</if>
|
||||||
|
<if test="nutritionistId != null ">and o.nutritionist_id = #{nutritionistId}</if>
|
||||||
|
<if test="nutriAssisId != null ">and o.nutri_assis_id = #{nutriAssisId}</if>
|
||||||
|
<if test="accountId != null ">and o.account_id = #{accountId}</if>
|
||||||
|
<if test="plannerId != null ">and o.planner_id = #{plannerId}</if>
|
||||||
|
<if test="plannerAssisId != null ">and o.planner_assis_id = #{plannerAssisId}</if>
|
||||||
|
<if test="operatorId != null ">and o.operator_id = #{operatorId}</if>
|
||||||
|
<if test="operatorAssisId != null ">and o.operator_assis_id = #{operatorAssisId}</if>
|
||||||
|
<if test="recommender != null and recommender != ''">and o.recommender = #{recommender}</if>
|
||||||
|
<if test="beginTime != null and beginTime != ''">and date_format(o.order_time,'%y%m%d') >=
|
||||||
|
date_format(#{beginTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">and date_format(o.order_time,'%y%m%d') <=
|
||||||
|
date_format(#{endTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="serveTimeId != null ">and o.serve_time_id = #{serveTimeId}</if>
|
||||||
|
<if test="reviewStatus != null ">and o.review_status = #{reviewStatus}</if>
|
||||||
|
<if test="amountFlag != null">
|
||||||
|
<if test="amountFlag == 0">
|
||||||
|
and o.amount >= 0
|
||||||
|
</if>
|
||||||
|
<if test="amountFlag == 1">
|
||||||
|
and 0 > o.amount
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
<include refid="searchOrderType">
|
||||||
|
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||||
|
</include>
|
||||||
|
<include refid="searchLoginUserId">
|
||||||
|
<property name="loginUserId" value="#{loginUserId}"/>
|
||||||
|
</include>
|
||||||
|
<if test="true">and o.del_flag = 0</if>
|
||||||
|
<!-- 计算总额时需要除去二开售后提成单 -->
|
||||||
|
AND o.after_sale_commiss_order = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||||
|
<include refid="selectSysOrderVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="orderId != null and orderId != ''">and sc.order_id = #{orderId}</if>
|
||||||
|
<if test="customer != null and customer != ''">
|
||||||
|
and (sc.name like concat('%',#{customer},'%') or sc.phone like concat('%',#{customer},'%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="accRange != null">
|
<if test="accRange != null">
|
||||||
and account_id in
|
and account_id in
|
||||||
@ -109,14 +178,14 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
||||||
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
|
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
|
||||||
<if test="status != null ">and status = #{status}</if>
|
<if test="status != null ">and status = #{status}</if>
|
||||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</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="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
|
||||||
<if test="onSaleId != null">
|
<if test="onSaleId != null">
|
||||||
and on_sale_id = #{onSaleId}
|
and o.on_sale_id = #{onSaleId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||||
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
||||||
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
||||||
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
||||||
@ -145,61 +214,8 @@
|
|||||||
<include refid="searchOrderType">
|
<include refid="searchOrderType">
|
||||||
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
||||||
</include>
|
</include>
|
||||||
<if test="true">and del_flag = 0</if>
|
<include refid="searchLoginUserId">
|
||||||
<!-- 计算总额时需要除去二开售后提成单 -->
|
<property name="loginUserId" value="#{loginUserId}"/>
|
||||||
AND after_sale_commiss_order = 0
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
|
||||||
<include refid="selectSysOrderVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
|
|
||||||
<if test="customer != null and customer != ''">
|
|
||||||
and (sc.name like concat('%',#{customer},'%') or sc.phone like concat('%',#{customer},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="accRange != null">
|
|
||||||
and account_id in
|
|
||||||
<foreach collection="accRange" separator="," item="acc" open="(" close=")">
|
|
||||||
#{acc}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
|
|
||||||
<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>
|
|
||||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
|
||||||
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
|
||||||
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
|
||||||
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
|
||||||
<if test="accountId != null ">and account_id = #{accountId}</if>
|
|
||||||
<if test="plannerId != null ">and planner_id = #{plannerId}</if>
|
|
||||||
<if test="plannerAssisId != null ">and planner_assis_id = #{plannerAssisId}</if>
|
|
||||||
<if test="operatorId != null ">and operator_id = #{operatorId}</if>
|
|
||||||
<if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if>
|
|
||||||
<if test="recommender != null and recommender != ''">and recommender = #{recommender}</if>
|
|
||||||
<if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >=
|
|
||||||
date_format(#{beginTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <=
|
|
||||||
date_format(#{endTime},'%y%m%d')
|
|
||||||
</if>
|
|
||||||
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
|
|
||||||
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
|
|
||||||
<if test="amountFlag != null">
|
|
||||||
<if test="amountFlag == 0">
|
|
||||||
and amount >= 0
|
|
||||||
</if>
|
|
||||||
<if test="amountFlag == 1">
|
|
||||||
and 0 > amount
|
|
||||||
</if>
|
|
||||||
</if>
|
|
||||||
<include refid="searchOrderType">
|
|
||||||
<property name="reviewStatus" value="#{searchOrderTypeArray}"/>
|
|
||||||
</include>
|
</include>
|
||||||
<if test="true">and o.del_flag = 0</if>
|
<if test="true">and o.del_flag = 0</if>
|
||||||
</where>
|
</where>
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<result property="outId" column="out_id"/>
|
<result property="outId" column="out_id"/>
|
||||||
<result property="subSend" column="sub_send"/>
|
<result property="subSend" column="sub_send"/>
|
||||||
<result property="smsSend" column="sms_send"/>
|
<result property="smsSend" column="sms_send"/>
|
||||||
|
<result property="totalNumDay" column="total_num_day" />
|
||||||
<!-- 非持久化字段 -->
|
<!-- 非持久化字段 -->
|
||||||
<!-- <result property="customerId" column="cus_id"></result><!– 客户ID –>-->
|
<!-- <result property="customerId" column="cus_id"></result><!– 客户ID –>-->
|
||||||
<result property="customer" column="customer"/><!-- 客户姓名 -->
|
<result property="customer" column="customer"/><!-- 客户姓名 -->
|
||||||
@ -41,7 +42,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<sql id="selectSysRecipesPlanVo">
|
<sql id="selectSysRecipesPlanVo">
|
||||||
select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed, remark
|
select id, order_id, cus_id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, send_flag, send_time, pause_date, create_time, create_by, update_time, update_by, del_flag, review_status, sub_send, sms_send, subscribed, remark,total_num_day
|
||||||
from sys_recipes_plan
|
from sys_recipes_plan
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -96,6 +97,7 @@
|
|||||||
<if test="delFlag != null">del_flag,</if>
|
<if test="delFlag != null">del_flag,</if>
|
||||||
<if test="reviewStatus != null">review_status,</if>
|
<if test="reviewStatus != null">review_status,</if>
|
||||||
<if test="type != null">type,</if>
|
<if test="type != null">type,</if>
|
||||||
|
<if test="totalNumDay != null">total_num_day,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">#{orderId},</if>
|
<if test="orderId != null">#{orderId},</if>
|
||||||
@ -116,6 +118,7 @@
|
|||||||
<if test="delFlag != null">#{delFlag},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||||
<if test="type != null">#{type},</if>
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="totalNumDay != null">#{totalNumDay},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -144,6 +147,7 @@
|
|||||||
<if test="subSend != null">sub_send = #{subSend},</if>
|
<if test="subSend != null">sub_send = #{subSend},</if>
|
||||||
<if test="smsSend != null">sms_send = #{smsSend},</if>
|
<if test="smsSend != null">sms_send = #{smsSend},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="totalNumDay != null">total_num_day = #{totalNumDay},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</update>
|
</update>
|
||||||
@ -226,7 +230,7 @@
|
|||||||
|
|
||||||
<!-- 根据订单ID查询食谱计划 -->
|
<!-- 根据订单ID查询食谱计划 -->
|
||||||
<select id="selectPlanListByOrderId" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
<select id="selectPlanListByOrderId" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||||
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time
|
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time,srp.total_num_day
|
||||||
FROM sys_recipes_plan srp
|
FROM sys_recipes_plan srp
|
||||||
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
||||||
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.order_id = #{orderId}
|
WHERE srp.del_flag = 0 AND sr.del_flag = 0 AND srp.order_id = #{orderId}
|
||||||
|
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.stdiet.custom.mapper.SysWxBannerImageMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysWxBannerImage" id="SysWxBannerImageResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="title" column="title" />
|
||||||
|
<result property="content" column="content" />
|
||||||
|
<result property="bannerUrl" column="banner_url" />
|
||||||
|
<result property="jumpUrl" column="jump_url" />
|
||||||
|
<result property="showFlag" column="show_flag" />
|
||||||
|
<result property="orderNum" column="order_num" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysWxBannerImageVo">
|
||||||
|
select id, title, content, banner_url, jump_url, show_flag, order_num, create_time, create_by, update_time, update_by, del_flag from sys_wx_banner_image
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysWxBannerImageList" parameterType="SysWxBannerImage" resultMap="SysWxBannerImageResult">
|
||||||
|
<include refid="selectSysWxBannerImageVo"/> where del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysWxBannerImageById" parameterType="Long" resultMap="SysWxBannerImageResult">
|
||||||
|
<include refid="selectSysWxBannerImageVo"/>
|
||||||
|
where id = #{id} and del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSysWxBannerImage" parameterType="SysWxBannerImage" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_wx_banner_image
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="title != null">title,</if>
|
||||||
|
<if test="content != null">content,</if>
|
||||||
|
<if test="bannerUrl != null">banner_url,</if>
|
||||||
|
<if test="jumpUrl != null">jump_url,</if>
|
||||||
|
<if test="showFlag != null">show_flag,</if>
|
||||||
|
<if test="orderNum != null">order_num,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="title != null">#{title},</if>
|
||||||
|
<if test="content != null">#{content},</if>
|
||||||
|
<if test="bannerUrl != null">#{bannerUrl},</if>
|
||||||
|
<if test="jumpUrl != null">#{jumpUrl},</if>
|
||||||
|
<if test="showFlag != null">#{showFlag},</if>
|
||||||
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysWxBannerImage" parameterType="SysWxBannerImage">
|
||||||
|
update sys_wx_banner_image
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="title != null">title = #{title},</if>
|
||||||
|
<if test="content != null">content = #{content},</if>
|
||||||
|
<if test="bannerUrl != null">banner_url = #{bannerUrl},</if>
|
||||||
|
<if test="jumpUrl != null">jump_url = #{jumpUrl},</if>
|
||||||
|
<if test="showFlag != null">show_flag = #{showFlag},</if>
|
||||||
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysWxBannerImageById" parameterType="Long">
|
||||||
|
update sys_wx_banner_image set del_flag = 1 where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteSysWxBannerImageByIds" parameterType="String">
|
||||||
|
update sys_wx_banner_image set del_flag = 1 where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 按照优先级顺序获取banner图 -->
|
||||||
|
<select id="getBannerListOrderByOrderNum" parameterType="SysWxBannerImage" resultType="com.stdiet.custom.dto.response.BannerResponse">
|
||||||
|
select title, content, banner_url as bannerUrl, jump_url as jumpUrl from sys_wx_banner_image
|
||||||
|
where del_flag = 0
|
||||||
|
<if test="showFlag != null">
|
||||||
|
and show_flag = #{showFlag}
|
||||||
|
</if>
|
||||||
|
order by order_num desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -21,6 +21,7 @@
|
|||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="remark" column="remark"/>
|
<result property="remark" column="remark"/>
|
||||||
<result property="language" column="language"/>
|
<result property="language" column="language"/>
|
||||||
|
<result property="healthManifesto" column="health_manifesto" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysWxUserInfoVo">
|
<sql id="selectSysWxUserInfoVo">
|
||||||
@ -75,6 +76,7 @@
|
|||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="language != null">language,</if>
|
<if test="language != null">language,</if>
|
||||||
|
<if test="healthManifesto != null">health_manifesto,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="openid != null">#{openid},</if>
|
<if test="openid != null">#{openid},</if>
|
||||||
@ -93,6 +95,7 @@
|
|||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="language != null">#{language},</if>
|
<if test="language != null">#{language},</if>
|
||||||
|
<if test="healthManifesto != null">#{healthManifesto},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -114,6 +117,7 @@
|
|||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="language != null">language = #{language},</if>
|
<if test="language != null">language = #{language},</if>
|
||||||
|
<if test="healthManifesto != null">health_manifesto = #{healthManifesto},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where openid = #{openid}
|
where openid = #{openid}
|
||||||
</update>
|
</update>
|
||||||
@ -140,4 +144,9 @@
|
|||||||
update sys_wx_user_info set cus_id = null where openid = #{openid}
|
update sys_wx_user_info set cus_id = null where openid = #{openid}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 根据客户ID更新健康减脂宣言 -->
|
||||||
|
<update id="updateHealthManifestoByCusId" parameterType="SysWxUserInfo">
|
||||||
|
update sys_wx_user_info set health_manifesto = #{healthManifesto} where cus_id = #{cusId}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -38,6 +38,8 @@
|
|||||||
<result property="targetWeight" column="target_weight" />
|
<result property="targetWeight" column="target_weight" />
|
||||||
<result property="executionScore" column="execution_score" />
|
<result property="executionScore" column="execution_score" />
|
||||||
<result property="comment" column="comment" />
|
<result property="comment" column="comment" />
|
||||||
|
<result property="thumbsupNum" column="thumbsup_num" />
|
||||||
|
<result property="healthManifesto" column="health_manifesto" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
<!-- 非持久字段 -->
|
<!-- 非持久字段 -->
|
||||||
<result property="customerName" column="customer_name"></result>
|
<result property="customerName" column="customer_name"></result>
|
||||||
@ -71,6 +73,8 @@
|
|||||||
<result property="targetWeight" column="target_weight" />
|
<result property="targetWeight" column="target_weight" />
|
||||||
<result property="executionScore" column="execution_score" />
|
<result property="executionScore" column="execution_score" />
|
||||||
<result property="comment" column="comment" />
|
<result property="comment" column="comment" />
|
||||||
|
<result property="thumbsupNum" column="thumbsup_num" />
|
||||||
|
<result property="healthManifesto" column="health_manifesto" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysWxUserLogVo">
|
<sql id="selectSysWxUserLogVo">
|
||||||
@ -168,6 +172,8 @@
|
|||||||
<if test="targetWeight != null">target_weight,</if>
|
<if test="targetWeight != null">target_weight,</if>
|
||||||
<if test="executionScore != null">execution_score,</if>
|
<if test="executionScore != null">execution_score,</if>
|
||||||
<if test="comment != null">comment,</if>
|
<if test="comment != null">comment,</if>
|
||||||
|
<if test="thumbsupNum != null">thumbsup_num,</if>
|
||||||
|
<if test="healthManifesto != null">health_manifesto,</if>
|
||||||
<if test="delFlag != null">del_flag,</if>
|
<if test="delFlag != null">del_flag,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
@ -202,6 +208,8 @@
|
|||||||
<if test="targetWeight != null">target_weight = #{targetWeight},</if>
|
<if test="targetWeight != null">target_weight = #{targetWeight},</if>
|
||||||
<if test="executionScore != null">execution_score = #{executionScore},</if>
|
<if test="executionScore != null">execution_score = #{executionScore},</if>
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
<if test="thumbsupNum != null">#{thumbsupNum},</if>
|
||||||
|
<if test="healthManifesto != null">#{healthManifesto},</if>
|
||||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
@ -240,6 +248,8 @@
|
|||||||
<if test="targetWeight != null">target_weight = #{targetWeight},</if>
|
<if test="targetWeight != null">target_weight = #{targetWeight},</if>
|
||||||
<if test="executionScore != null">execution_score = #{executionScore},</if>
|
<if test="executionScore != null">execution_score = #{executionScore},</if>
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
<if test="thumbsupNum != null">thumbsup_num = #{thumbsupNum},</if>
|
||||||
|
<if test="healthManifesto != null">health_manifesto = #{healthManifesto},</if>
|
||||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -307,4 +317,48 @@
|
|||||||
order by wxlog.log_time desc
|
order by wxlog.log_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap id="punchReponseMap" type="com.stdiet.custom.dto.response.CommunityPunchReponse">
|
||||||
|
<result property="openid" column="openid" />
|
||||||
|
<result property="cusId" column="cus_id"/>
|
||||||
|
<result property="nickName" column="nick_name"/>
|
||||||
|
<result property="avatarUrl" column="avatar_url"/>
|
||||||
|
<result property="logTime" column="log_time"/>
|
||||||
|
<result property="weight" column="weight"/>
|
||||||
|
<result property="comment" column="comment"/>
|
||||||
|
<result property="thumbsupNum" column="thumbsup_num"/>
|
||||||
|
<result property="healthManifesto" column="health_manifesto"/>
|
||||||
|
<!-- 查询最近五天体重 -->
|
||||||
|
<association property="recentWeight" column="{cusId=cus_id,logTime=log_time}" select="getRecentWeight"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 查询打卡社区内容 -->
|
||||||
|
<select id="getCommunityPunch" resultMap="punchReponseMap" parameterType="SysWxUserLog">
|
||||||
|
select wxinfo.openid,wxinfo.cus_id,wxinfo.nick_name,wxinfo.avatar_url,wxlog.log_time,wxlog.weight,wxlog.comment,wxlog.thumbsup_num,wxlog.health_manifesto from sys_wx_user_log wxlog
|
||||||
|
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||||
|
where wxlog.del_flag = 0
|
||||||
|
order by wxlog.log_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询最近一周的打卡体重 -->
|
||||||
|
<select id="getRecentWeight" resultType="Map">
|
||||||
|
select DATE_FORMAT(wxlog.log_time,'%Y-%m-%d') as logTime,wxlog.weight as weight from sys_wx_user_log wxlog
|
||||||
|
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||||
|
where wxlog.del_flag = 0 and wxinfo.cus_id = #{cusId} and #{logTime} >= wxlog.log_time
|
||||||
|
order by wxlog.log_time desc limit 7
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据客户ID查询总共打卡次数 -->
|
||||||
|
<select id="getPunchTotalNum" parameterType="SysWxUserLog" resultType="int">
|
||||||
|
select count(1) from sys_wx_user_log wxlog
|
||||||
|
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
|
||||||
|
where wxlog.del_flag = 0 and wxinfo.cus_id = #{customerId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询打卡社区总共几个人在打卡 -->
|
||||||
|
<select id="getPunchCustomerTotalNum" resultType="int">
|
||||||
|
select count(1) from (select openid from sys_wx_user_log wxlog where wxlog.del_flag = 0 group by openid) num_table
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -13,9 +13,12 @@
|
|||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="//at.alicdn.com/t/font_2343184_w0runuauamq.css"
|
href="//at.alicdn.com/t/font_2343184_w0runuauamq.css"
|
||||||
/>
|
/>
|
||||||
|
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.6/skins/default/aliplayer-min.css" />
|
||||||
<script src="../lib/aliyunVideo/es6-promise.min.js"></script>
|
<script src="../lib/aliyunVideo/es6-promise.min.js"></script>
|
||||||
<script src="../lib/aliyunVideo/aliyun-oss-sdk-6.13.0.min.js"></script>
|
<script src="../lib/aliyunVideo/aliyun-oss-sdk-6.13.0.min.js"></script>
|
||||||
<script src="../lib/aliyunVideo/aliyun-upload-sdk-1.5.2.min.js"></script>
|
<script src="../lib/aliyunVideo/aliyun-upload-sdk-1.5.2.min.js"></script>
|
||||||
|
<script src="https://g.alicdn.com/de/prismplayer/2.9.6/aliplayer-min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
<style>
|
<style>
|
||||||
|
@ -96,5 +96,14 @@ export function getVideoSnapshot(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询营养视频播放凭证
|
||||||
|
export function getVideoPlayAuth(id) {
|
||||||
|
return request({
|
||||||
|
url: '/custom/nutritionalVideo/getVideoPlayAuth/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -275,14 +275,14 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<!--<el-col :span="8">
|
||||||
<el-form-item label="食谱是否连续" prop="recipesPlanContinue">
|
<el-form-item label="食谱是否连续" prop="recipesPlanContinue">
|
||||||
<el-select v-model="form.recipesPlanContinue" placeholder="请选择食谱连续状态">
|
<el-select v-model="form.recipesPlanContinue" placeholder="请选择食谱连续状态">
|
||||||
<el-option label="是" :value="parseInt('1')"></el-option>
|
<el-option label="是" :value="parseInt('1')"></el-option>
|
||||||
<el-option label="否" :value="parseInt('0')"></el-option>
|
<el-option label="否" :value="parseInt('0')"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-form-item label="服务开始时间" prop="startTime" label-width="180">
|
<el-form-item label="服务开始时间" prop="startTime" label-width="180">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
63
stdiet-ui/src/components/VideoPlay/index.vue
Normal file
63
stdiet-ui/src/components/VideoPlay/index.vue
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="visible"
|
||||||
|
width="680px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
|
||||||
|
<VideoTemplate v-if="visible" :videoId="video.videoId" :playAuth="video.playAuth" ></VideoTemplate>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import VideoTemplate from "@/components/VideoPlay/video";
|
||||||
|
export default {
|
||||||
|
name: "VideoPlay",
|
||||||
|
props: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: "",
|
||||||
|
visible:false,
|
||||||
|
player: null,
|
||||||
|
video: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
components:{
|
||||||
|
VideoTemplate
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showDialog(video) {
|
||||||
|
this.player = null;
|
||||||
|
this.video = video;
|
||||||
|
this.title = this.video.title;
|
||||||
|
this.visible = true;
|
||||||
|
/*let self = this;
|
||||||
|
let t = setTimeout(function(){
|
||||||
|
self.createPlayer();
|
||||||
|
},500);*/
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.visible = false;
|
||||||
|
// this.reset();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
78
stdiet-ui/src/components/VideoPlay/video/index.vue
Normal file
78
stdiet-ui/src/components/VideoPlay/video/index.vue
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="prism-player" id="J_prismPlayer" :style="'height:'+height+'px;width:'+width+'px'"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "video",
|
||||||
|
props: {
|
||||||
|
videoId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
playAuth: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
width:{
|
||||||
|
type: Number,
|
||||||
|
default: 630
|
||||||
|
},
|
||||||
|
height:{
|
||||||
|
type: Number,
|
||||||
|
default: 350
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return{
|
||||||
|
player: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.$nextTick(function(){
|
||||||
|
this.createPlayer();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
createPlayer(){
|
||||||
|
this.player = new Aliplayer({
|
||||||
|
/*id: 'J_prismPlayer',
|
||||||
|
width: '100%',
|
||||||
|
autoplay: false,
|
||||||
|
//支持播放地址播放,此播放优先级最高
|
||||||
|
source : this.video.playUrl*/
|
||||||
|
"id": "J_prismPlayer",
|
||||||
|
"vid": this.videoId,
|
||||||
|
"playauth": this.playAuth,
|
||||||
|
"qualitySort": "asc",
|
||||||
|
"format": "mp4",
|
||||||
|
"mediaType": "video",
|
||||||
|
"width": "100%",
|
||||||
|
"height": "500px",
|
||||||
|
"autoplay": false,
|
||||||
|
"isLive": false,
|
||||||
|
"rePlay": false,
|
||||||
|
"playsinline": true,
|
||||||
|
"preload": true,
|
||||||
|
"controlBarVisibility": "hover",
|
||||||
|
"useH5Prism": true
|
||||||
|
},function(){
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -823,12 +823,12 @@ export function dealHealthy(customerHealthy) {
|
|||||||
return customerHealthy;
|
return customerHealthy;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂"};
|
export const extendHealthyTitle = {"0":"减脂","5":"降血压","6":"降血糖","3": "备孕营养", "1": "月经不调", "2": "多囊调理", "11":"心脑血管调理","13":"胃肠肿瘤调理","4":"产后调理","7":"高血脂","10":"消化系统管理"};
|
||||||
export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂"};
|
export const projectName = {"0":"减脂","5":"高血压","6":"高血糖","3": "备孕营养", "1":"月经不调", "2":"多囊卵巢综合症", "13":"胃肠肿瘤","4":"产后调理","7":"高血脂","10":"消化系统管理"};
|
||||||
//需要填写慢病调查问卷的项目
|
//需要填写慢病调查问卷的项目
|
||||||
export const extendHealthyIndex = [5, 6, 1, 2, 13,4,7];
|
export const extendHealthyIndex = [5, 6, 1, 2, 13,4,7];
|
||||||
//跳过减脂经历问卷的项目
|
//跳过减脂经历问卷的项目
|
||||||
export const notExperienceIndex = [3,1,2,13,4,7];
|
export const notExperienceIndex = [3,1,2,13,4,7,10];
|
||||||
|
|
||||||
export function getTitleKey(projectId){
|
export function getTitleKey(projectId){
|
||||||
return extendHealthyTitle[projectId+""] != null ? extendHealthyTitle[projectId+""] : extendHealthyTitle["0"];
|
return extendHealthyTitle[projectId+""] != null ? extendHealthyTitle[projectId+""] : extendHealthyTitle["0"];
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营养师" prop="mainDietitian" v-if="!isPartner">
|
<el-form-item label="营养师" prop="mainDietitian" v-if="!isPartner">
|
||||||
<el-select v-model="queryParams.mainDietitian" placeholder="请选择">
|
<el-select v-model="queryParams.mainDietitian" clearable filterable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutritionistIdOptions"
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -59,6 +59,8 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.assistantDietitian"
|
v-model="queryParams.assistantDietitian"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutriAssisIdOptions"
|
v-for="dict in nutriAssisIdOptions"
|
||||||
@ -69,7 +71,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售人员" prop="salesman" v-if="!isPartner">
|
<el-form-item label="销售人员" prop="salesman" v-if="!isPartner">
|
||||||
<el-select v-model="queryParams.salesman" placeholder="请选择">
|
<el-select v-model="queryParams.salesman" clearable filterable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -77,9 +79,19 @@
|
|||||||
:value="parseInt(dict.dictValue)"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="售中人员" prop="onSaleId" v-if="!isPartner">
|
||||||
|
<el-select v-model="queryParams.onSaleId" clearable filterable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in onSaleIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="售后营养师" prop="afterDietitian" v-if="!isPartner">
|
<el-form-item label="售后营养师" prop="afterDietitian" v-if="!isPartner">
|
||||||
<el-select v-model="queryParams.afterDietitian" placeholder="请选择">
|
<el-select v-model="queryParams.afterDietitian" clearable filterable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in afterSaleIdOptions"
|
v-for="dict in afterSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -183,7 +195,7 @@
|
|||||||
:formatter="channelFormat"
|
:formatter="channelFormat"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="客户姓名" align="center" prop="name" />
|
<el-table-column label="客户姓名" align="center" prop="name" />
|
||||||
<el-table-column label="手机号" align="center" prop="phone" />
|
<el-table-column label="手机号" align="center" prop="phone" width="120"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="主营养师"
|
label="主营养师"
|
||||||
align="center"
|
align="center"
|
||||||
@ -208,6 +220,12 @@
|
|||||||
prop="salesman"
|
prop="salesman"
|
||||||
:formatter="preSaleIdFormat"
|
:formatter="preSaleIdFormat"
|
||||||
/>
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="售中人员"
|
||||||
|
align="center"
|
||||||
|
prop="onSaleId"
|
||||||
|
:formatter="onSaleIdFormat"
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="订单"
|
label="订单"
|
||||||
align="center"
|
align="center"
|
||||||
@ -392,6 +410,18 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="售中" prop="salesman">
|
||||||
|
<el-select v-model="form.onSaleId" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in onSaleIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="售后" prop="afterDietitian">
|
<el-form-item label="售后" prop="afterDietitian">
|
||||||
<el-select v-model="form.afterDietitian" placeholder="请选择">
|
<el-select v-model="form.afterDietitian" placeholder="请选择">
|
||||||
@ -521,6 +551,7 @@ export default {
|
|||||||
assistantDietitian: null,
|
assistantDietitian: null,
|
||||||
afterDietitian: null,
|
afterDietitian: null,
|
||||||
salesman: null,
|
salesman: null,
|
||||||
|
onSaleId: null,
|
||||||
physicalSignsId: null,
|
physicalSignsId: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@ -597,6 +628,8 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
// 售前字典
|
// 售前字典
|
||||||
"preSaleIdOptions",
|
"preSaleIdOptions",
|
||||||
|
//售中
|
||||||
|
"onSaleIdOptions",
|
||||||
// 售后字典
|
// 售后字典
|
||||||
"afterSaleIdOptions",
|
"afterSaleIdOptions",
|
||||||
// 主营养师字典
|
// 主营养师字典
|
||||||
@ -623,6 +656,10 @@ export default {
|
|||||||
preSaleIdFormat(row, column) {
|
preSaleIdFormat(row, column) {
|
||||||
return this.selectDictLabel(this.preSaleIdOptions, row.salesman);
|
return this.selectDictLabel(this.preSaleIdOptions, row.salesman);
|
||||||
},
|
},
|
||||||
|
// 售中字典翻译
|
||||||
|
onSaleIdFormat(row, column) {
|
||||||
|
return this.selectDictLabel(this.onSaleIdOptions, row.onSaleId);
|
||||||
|
},
|
||||||
// 售后字典翻译
|
// 售后字典翻译
|
||||||
afterSaleIdFormat(row, column) {
|
afterSaleIdFormat(row, column) {
|
||||||
return this.selectDictLabel(this.afterSaleIdOptions, row.afterDietitian);
|
return this.selectDictLabel(this.afterSaleIdOptions, row.afterDietitian);
|
||||||
@ -691,6 +728,7 @@ export default {
|
|||||||
assistantDietitian: null,
|
assistantDietitian: null,
|
||||||
afterDietitian: null,
|
afterDietitian: null,
|
||||||
salesman: null,
|
salesman: null,
|
||||||
|
onSaleId: null,
|
||||||
chargePerson: null,
|
chargePerson: null,
|
||||||
fansChannel: 0,
|
fansChannel: 0,
|
||||||
fansTime: null,
|
fansTime: null,
|
||||||
|
@ -208,7 +208,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="getVideoPlayUrl(scope.row.id)"
|
@click="showVideoPlay(scope.row)"
|
||||||
v-hasPermi="['custom:nutritionalVideo:query']"
|
v-hasPermi="['custom:nutritionalVideo:query']"
|
||||||
>播放</el-button
|
>播放</el-button
|
||||||
>
|
>
|
||||||
@ -360,6 +360,9 @@
|
|||||||
|
|
||||||
<!-- 手动选择封面 -->
|
<!-- 手动选择封面 -->
|
||||||
<VideoSelectCover ref="videoSelectCoverRef"></VideoSelectCover>
|
<VideoSelectCover ref="videoSelectCoverRef"></VideoSelectCover>
|
||||||
|
|
||||||
|
<!-- 视频播放 -->
|
||||||
|
<VideoPlay ref="videoPlayRef"></VideoPlay>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -373,6 +376,7 @@ import {
|
|||||||
exportNutritionalVideo,
|
exportNutritionalVideo,
|
||||||
updateWxShow,
|
updateWxShow,
|
||||||
getVideoPlayUrlById,
|
getVideoPlayUrlById,
|
||||||
|
getVideoPlayAuth
|
||||||
} from "@/api/custom/nutritionalVideo";
|
} from "@/api/custom/nutritionalVideo";
|
||||||
import { getAllClassify } from "@/api/custom/videoClassify";
|
import { getAllClassify } from "@/api/custom/videoClassify";
|
||||||
import UploadVideo from "@/components/UploadVideo";
|
import UploadVideo from "@/components/UploadVideo";
|
||||||
@ -383,6 +387,7 @@ import Treeselect from "@riophae/vue-treeselect";
|
|||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import IconSelect from "@/components/IconSelect";
|
import IconSelect from "@/components/IconSelect";
|
||||||
import VideoSelectCover from "@/components/VideoSelectCover";
|
import VideoSelectCover from "@/components/VideoSelectCover";
|
||||||
|
import VideoPlay from "@/components/VideoPlay";
|
||||||
export default {
|
export default {
|
||||||
name: "NutritionalVideo",
|
name: "NutritionalVideo",
|
||||||
data() {
|
data() {
|
||||||
@ -452,6 +457,7 @@ export default {
|
|||||||
Treeselect,
|
Treeselect,
|
||||||
IconSelect,
|
IconSelect,
|
||||||
VideoSelectCover,
|
VideoSelectCover,
|
||||||
|
VideoPlay
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询营养视频列表 */
|
/** 查询营养视频列表 */
|
||||||
@ -649,6 +655,16 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(function () {});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
|
showVideoPlay(row){
|
||||||
|
getVideoPlayAuth(row.id).then((response) => {
|
||||||
|
row.playAuth = response.data.playAuth;;
|
||||||
|
if (row.playAuth != undefined && row.playAuth != null) {
|
||||||
|
this.$refs.videoPlayRef.showDialog(row);
|
||||||
|
}else{
|
||||||
|
this.msgError("视频资源不存在");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user