!239 调整个人信息顺序

Merge pull request !239 from 德仔/develop
This commit is contained in:
德仔 2021-05-10 14:51:52 +08:00 committed by Gitee
commit 44e540642f
5 changed files with 74 additions and 21 deletions

View File

@ -4,6 +4,7 @@ import com.aliyun.vod20170321.models.GetPlayInfoResponseBody;
import com.aliyun.vod20170321.models.GetVideoInfoResponseBody; import com.aliyun.vod20170321.models.GetVideoInfoResponseBody;
import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.domain.entity.SysDictData;
import com.stdiet.common.core.page.TableDataInfo; import com.stdiet.common.core.page.TableDataInfo;
import com.stdiet.common.exception.file.FileNameLengthLimitExceededException; import com.stdiet.common.exception.file.FileNameLengthLimitExceededException;
import com.stdiet.common.utils.AliyunVideoUtils; import com.stdiet.common.utils.AliyunVideoUtils;
@ -19,6 +20,7 @@ import com.stdiet.custom.dto.response.MessageNoticeResponse;
import com.stdiet.custom.dto.response.NutritionalVideoResponse; import com.stdiet.custom.dto.response.NutritionalVideoResponse;
import com.stdiet.custom.page.WxLogInfo; import com.stdiet.custom.page.WxLogInfo;
import com.stdiet.custom.service.*; import com.stdiet.custom.service.*;
import com.stdiet.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -50,15 +52,18 @@ public class WechatAppletController extends BaseController {
private ISysAskNutritionQuestionService sysAskNutritionQuestionService; private ISysAskNutritionQuestionService sysAskNutritionQuestionService;
@Autowired @Autowired
private ISysCustomerService iSysCustomerService; private ISysCustomerService iSysCustomerService;
@Autowired @Autowired
private ISysMessageNoticeService sysMessageNoticeService; private ISysMessageNoticeService sysMessageNoticeService;
@Autowired @Autowired
private ISysCustomerService sysCustomerService; private ISysCustomerService sysCustomerService;
@Autowired @Autowired
private ISysNutritionalVideoService sysNutritionalVideoService; private ISysNutritionalVideoService sysNutritionalVideoService;
@Autowired
private ISysRecipesPlanService sysRecipesPlanService;
@Autowired
private ISysOrderPauseService sysOrderPauseService;
@Autowired
private ISysDictTypeService iSysDictTypeService;
/** /**
* 查询微信小程序中展示的客户案例 * 查询微信小程序中展示的客户案例
@ -443,17 +448,23 @@ public class WechatAppletController extends BaseController {
return AjaxResult.error(5003, "未查到用户信息,请联系销售顾问"); return AjaxResult.error(5003, "未查到用户信息,请联系销售顾问");
} }
sysWxUserInfo.setCusId(sysCustomer.getId());
if (StringUtils.isNull(curWxUserInfo)) { if (StringUtils.isNull(curWxUserInfo)) {
// 新增sys_wx_user_info // 新增sys_wx_user_info
sysWxUserInfo.setCusId(sysCustomer.getId());
sysWxUserInfo.setCreateTime(DateUtils.getNowDate()); sysWxUserInfo.setCreateTime(DateUtils.getNowDate());
sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo); sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo);
} else { } else {
// 更新sys_wx_user_info数据 // 更新sys_wx_user_info数据
curWxUserInfo.setCusId(sysCustomer.getId()); sysWxUserInfo.setUpdateTime(DateUtils.getNowDate());
curWxUserInfo.setUpdateTime(DateUtils.getNowDate()); sysWxUserInfoService.updateSysWxUserInfo(sysWxUserInfo);
sysWxUserInfoService.updateSysWxUserInfo(curWxUserInfo);
} }
// 更新对象
curWxUserInfo = sysWxUserInfo;
}
// 更新时间超过7天重新登录获取最新信息
if (StringUtils.isEmpty(curWxUserInfo.getAvatarUrl()) || ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(curWxUserInfo.getUpdateTime()), LocalDate.now()) >= 7) {
return AjaxResult.error(5001, "信息缺失或者过期需要重新登录");
} }
curWxUserInfo.setCustomerId(AesUtils.encrypt(curWxUserInfo.getCusId().toString())); curWxUserInfo.setCustomerId(AesUtils.encrypt(curWxUserInfo.getCusId().toString()));
@ -461,4 +472,38 @@ public class WechatAppletController extends BaseController {
// 并返回一系列登录后的数据 // 并返回一系列登录后的数据
return AjaxResult.success(curWxUserInfo); return AjaxResult.success(curWxUserInfo);
} }
@GetMapping("/getRecipesPlans")
public AjaxResult getRecipesPlans(@RequestParam String customerId) {
Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L;
List<SysRecipesPlan> plans = sysRecipesPlanService.selectPlanListByCusId(cusId);
SysOrderPause orderPause = new SysOrderPause();
orderPause.setCusId(cusId);
List<SysOrderPause> pauses = sysOrderPauseService.selectSysOrderPauseList(orderPause);
Map<String, Object> result = new HashMap<>();
result.put("plans", plans);
result.put("pauses", pauses);
return AjaxResult.success(result);
}
@GetMapping("/getDicts")
public AjaxResult getDicts() {
List<SysDictData> unitDict = iSysDictTypeService.selectDictDataByType("cus_cus_unit");
List<SysDictData> weightDict = iSysDictTypeService.selectDictDataByType("cus_cus_weight");
List<SysDictData> menuTypeDict = iSysDictTypeService.selectDictDataByType("cus_dishes_type");
Map<String, Object> result = new HashMap<>();
result.put("unitDict", unitDict);
result.put("weightDict", weightDict);
result.put("menuTypeDict", menuTypeDict);
return AjaxResult.success(result);
}
} }

View File

@ -1,6 +1,7 @@
package com.stdiet.custom.domain; package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.stdiet.common.annotation.Excel; import com.stdiet.common.annotation.Excel;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -25,8 +26,10 @@ public class SysOrderPause {
/** /**
* 订单id * 订单id
*/ */
@JsonIgnore
private Long orderId; private Long orderId;
@JsonIgnore
private Long cusId; private Long cusId;
private String outId; private String outId;

View File

@ -1,6 +1,7 @@
package com.stdiet.custom.domain; package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.stdiet.common.annotation.Excel; import com.stdiet.common.annotation.Excel;
import lombok.Data; import lombok.Data;
@ -24,6 +25,7 @@ public class SysRecipesPlan {
* 订单ID * 订单ID
*/ */
//@Excel(name = "订单ID") //@Excel(name = "订单ID")
@JsonIgnore
private Long orderId; private Long orderId;
private Long cusId; private Long cusId;
@ -116,7 +118,9 @@ public class SysRecipesPlan {
*/ */
private Integer reviewStatus; private Integer reviewStatus;
/** 该食谱计划中暂停日期,使用 | 隔开 */ /**
* 该食谱计划中暂停日期使用 | 隔开
*/
//@Excel(name = "该食谱计划中暂停日期,使用 | 隔开") //@Excel(name = "该食谱计划中暂停日期,使用 | 隔开")
private String pauseDate; private String pauseDate;

View File

@ -107,6 +107,7 @@ export default {
title: "既往病史/用药史评估", title: "既往病史/用药史评估",
content: [ content: [
{ title: "病史体征", value: "physicalSigns" }, { title: "病史体征", value: "physicalSigns" },
{ title: "忌口过敏食物", value: "dishesIngredient" },
{ title: "湿气数据", value: "moistureDate" }, { title: "湿气数据", value: "moistureDate" },
{ title: "气血数据", value: "bloodData" }, { title: "气血数据", value: "bloodData" },
{ title: "家族疾病史", value: "familyIllnessHistory" }, { title: "家族疾病史", value: "familyIllnessHistory" },
@ -118,7 +119,16 @@ export default {
{ title: "是否出现过过敏症状", value: "allergyFlag" }, { title: "是否出现过过敏症状", value: "allergyFlag" },
{ title: "过敏症状", value: "allergySituation" }, { title: "过敏症状", value: "allergySituation" },
{ title: "过敏源", value: "allergen" }, { title: "过敏源", value: "allergen" },
{ title: "忌口过敏食物", value: "dishesIngredient" }, ],
},
{
title: "运动习惯评估",
content: [
{ title: "每周运动次数", value: "motionNum" },
{ title: "每次运动的时长", value: "motionDuration" },
{ title: "每天运动的时间", value: "motionTime" },
{ title: "运动", value: "motion" },
{ title: "运动场地", value: "motionField" },
], ],
}, },
{ {
@ -193,16 +203,7 @@ export default {
{ title: "排便的颜色", value: "defecationColor" }, { title: "排便的颜色", value: "defecationColor" },
], ],
}, },
{
title: "运动习惯评估",
content: [
{ title: "每周运动次数", value: "motionNum" },
{ title: "每次运动的时长", value: "motionDuration" },
{ title: "每天运动的时间", value: "motionTime" },
{ title: "运动", value: "motion" },
{ title: "运动场地", value: "motionField" },
],
},
{ {
title: "睡眠质量评估", title: "睡眠质量评估",
content: [ content: [

View File

@ -147,7 +147,7 @@
label="创建时间" label="创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
width="100" width="110"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="time in scope.row.createTime.split(' ')" :key="time"> <div v-for="time in scope.row.createTime.split(' ')" :key="time">