This commit is contained in:
huangdeliang 2021-08-04 17:46:01 +08:00
parent b1305e4e79
commit 90f79a689c
8 changed files with 311 additions and 256 deletions

View File

@ -76,12 +76,14 @@ public class WechatAppletController extends BaseController {
private ISysServicesTopicService iSysServicesTopicService;
@Autowired
private ISysVideoClassifyService sysVideoClassifyService;
@Autowired
private ISysWxBannerImageService sysWxBannerImageService;
@Autowired
private ISysPunchThumbsupService sysPunchThumbsupService;
@Autowired
private ISysCustomerHealthyService sysCustomerHealthyService;
@Autowired
private ISysCustomerPhysicalSignsService sysCustomerPhysicalSignsService;
/**
* 查询微信小程序中展示的客户案例
@ -446,9 +448,20 @@ public class WechatAppletController extends BaseController {
return AjaxResult.error(5001, "信息缺失或者过期需要重新登录");
}
SysCustomerHealthy customerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(curWxUserInfo.getCusId());
if (customerHealthy == null) {
SysCustomerPhysicalSigns customerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(curWxUserInfo.getCusId());
if (customerPhysicalSigns != null) {
curWxUserInfo.setSex(customerPhysicalSigns.getSex().toString());
}
} else {
curWxUserInfo.setSex(customerHealthy.getSex().toString());
}
curWxUserInfo.setCustomerId(AesUtils.encrypt(curWxUserInfo.getCusId().toString()));
curWxUserInfo.setCusId(null);
// 并返回一系列登录后的数据
return AjaxResult.success(curWxUserInfo);
}
@ -715,16 +728,19 @@ public class WechatAppletController extends BaseController {
public TableDataInfo getCommunityPunch() {
startPage();
List<CommunityPunchReponse> list = sysWxUserLogService.getCommunityPunch(new SysWxUserLog());
// if (list != null && list.size() > 0) {
// for (CommunityPunchReponse comm : list) {
// comm.setId(AesUtils.encrypt(comm.getId()));
// comm.setCusId(AesUtils.encrypt(comm.getCusId()));
// comm.setThumbsupNum(comm.getThumbsupOpenid() != null ? comm.getThumbsupOpenid().size() : 0);
// }
// }
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getCustomerActivity")
public TableDataInfo getCustomerActivity(@RequestParam String openid){
startPage();
return getDataTable(sysWxUserLogService.getCommunityPunchByOpenid(openid));
}
/**
* 打卡社区点赞
*

View File

@ -3,7 +3,6 @@ package com.stdiet.custom.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
import com.stdiet.common.utils.StringUtils;
import lombok.Data;
import java.math.BigDecimal;
@ -65,6 +64,9 @@ public class SysWxUserLog extends BaseEntity {
private String sportDesc;
@Excel(name = "是否生理期", readConverterExp = "Y=是,N=否")
private String menstrualPeriod;
/**
* 用户头像
*/
@ -89,155 +91,126 @@ public class SysWxUserLog extends BaseEntity {
*/
@Excel(name = "排便情况", readConverterExp = "Y=是,N=否")
private String defecation;
public void setDefecation(String defecation) {
if (defecation.equals("Y") || defecation.equals("N")) {
this.defecation = defecation.equals("Y") ? "" : "";
// this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
} else {
this.defecation = defecation;
}
}
private String defecationDesc;
/**
* 饮水量
*/
@Excel(name = "饮水量")
private Long water;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date logTime;
//客户ID
private Long customerId;
//建议
private String remark;
/**
* 非持久化字段客户姓名
*/
@Excel(name = "姓名")
private String customerName;
//营养师ID
private Long nutritionistId;
/**
* 非持久化字段营养师
*/
@Excel(name = "营养师")
private String nutritionist;
/**
* 情绪
*/
@Excel(name = "情绪")
private String emotion;
private String emotionDesc;
/**
* 食谱之外的食物
*/
@Excel(name = "食谱之外的食物")
private String slyEatFood;
/**
* 是否便秘Y是 N否
*/
@Excel(name = "是否便秘", readConverterExp = "Y=是,N=否")
private String constipation;
/**
* 食材描述
*/
@Excel(name = "食材描述")
private String ingredientDesc;
/**
* 早餐照片
*/
@Excel(name = "早餐照片")
private String breakfastImages;
/**
* 午餐照片
*/
@Excel(name = "午餐照片")
private String lunchImages;
/**
* 午餐照片
*/
@Excel(name = "午餐照片")
private String dinnerImages;
/**
* 加餐照片
*/
@Excel(name = "加餐照片")
private String extraMealImages;
/**
* 体型对比照
*/
@Excel(name = "体型对比照")
private String bodyImages;
private String bodyDesc;
/**
* 服务建议
*/
@Excel(name = "服务建议")
private String suggest;
/**
* 目标体重
*/
@Excel(name = "目标体重")
private BigDecimal targetWeight;
/**
* 执行评分五分制
*/
@Excel(name = "执行评分,五分制")
private BigDecimal executionScore;
/**
* 点评
*/
@Excel(name = "点评")
private String comment;
/**
* 点赞数量
*/
@Excel(name = "点赞数量")
private Long thumbsupNum;
/**
* 健康宣言
*/
@Excel(name = "健康宣言")
private String healthManifesto;
/**
* 删除标识 0未删除 1已删除
*/
private Long delFlag;
//售后营养师ID
private Long afterNutritionistId;
//售后营养师
@Excel(name = "售后营养师")
private String afterNutritionist;
//图片预览路径
private Map<String, List<String>> imagesUrl;
public void setDefecation(String defecation) {
if (defecation.equals("Y") || defecation.equals("N")) {
// this.defecation = defecation.equals("Y") ? "" : "";
this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
} else {
this.defecation = defecation;
}
}
}

View File

@ -100,6 +100,8 @@ public interface SysWxUserLogMapper
*/
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid);
/**
* 根据打卡社区
* @param sysWxUserLog

View File

@ -1,7 +1,6 @@
package com.stdiet.custom.page;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.utils.StringUtils;
import lombok.Data;
import java.math.BigDecimal;
@ -53,6 +52,11 @@ public class WxLogInfo {
*/
private String constipation;
/**
* 是否生理期
*/
private String menstrualPeriod;
/**
* 食材描述
*/
@ -123,8 +127,8 @@ public class WxLogInfo {
public void setDefecation(String defecation) {
if (defecation.equals("Y") || defecation.equals("N")) {
this.defecation = defecation.equals("Y") ? "" : "";
// this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
// this.defecation = defecation.equals("Y") ? "" : "";
this.defecation = defecation.equals("Y") ? "顺畅" : "其他";
} else {
this.defecation = defecation;
}
@ -146,4 +150,8 @@ public class WxLogInfo {
this.constipation = constipation.equals("Y") ? "" : "";
}
public void setMenstrualPeriod(String menstrualPeriod) {
this.menstrualPeriod = menstrualPeriod.equals("Y") ? "" : "";
}
}

View File

@ -102,6 +102,8 @@ public interface ISysWxUserLogService
*/
List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog);
List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid);
/**
* 根据打卡社区
* @param sysWxUserLog

View File

@ -1,25 +1,14 @@
package com.stdiet.custom.service.impl;
import java.util.List;
import com.stdiet.common.config.AliyunOSSConfig;
import com.stdiet.common.exception.file.FileNameLengthLimitExceededException;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.file.FileUploadUtils;
import com.stdiet.common.utils.file.MimeTypeUtils;
import com.stdiet.common.utils.oss.AliyunOSSUtils;
import com.stdiet.custom.domain.SysMessageNotice;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
import com.stdiet.custom.mapper.SysWxUserLogMapper;
import com.stdiet.custom.page.WxLogInfo;
import com.stdiet.custom.service.ISysMessageNoticeService;
import com.stdiet.custom.service.ISysWxUserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysWxUserLogMapper;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.service.ISysWxUserLogService;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 微信用户记录Service业务层处理
@ -56,7 +45,7 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
@Override
public List<WxLogInfo> selectWxLogInfoList(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.selectWxLogInfoList(sysWxUserLog);
return sysWxUserLogMapper.selectWxLogInfoList(sysWxUserLog);
}
/**
@ -110,64 +99,76 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
/**
* 根据openid和手机号查询打卡记录
*
* @return
*/
@Override
public List<WxLogInfo> getWxLogInfoList(SysWxUserLog sysWxUserLog){
public List<WxLogInfo> getWxLogInfoList(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.getWxLogInfoList(sysWxUserLog);
}
/**
* 根据日期和openid查询打卡记录
*
* @param sysWxUserLog
* @return
*/
public SysWxUserLog selectSysWxUserLogByDateAndOpenId(SysWxUserLog sysWxUserLog){
public SysWxUserLog selectSysWxUserLogByDateAndOpenId(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.selectSysWxUserLogByDateAndOpenId(sysWxUserLog);
}
/**
* 根据客户ID查询对应打卡体重数据
*
* @param sysWxUserLog
* @return
*/
public List<SysWxUserLog> getWxUserLogListByCustomerId(SysWxUserLog sysWxUserLog){
public List<SysWxUserLog> getWxUserLogListByCustomerId(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.getWxUserLogListByCustomerId(sysWxUserLog);
}
/**
* 根据ID查询打卡详情
*
* @param sysWxUserLog
* @return
*/
public WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog){
public WxLogInfo getWxLogInfoDetailById(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.getWxLogInfoDetailById(sysWxUserLog);
}
/**
* 查询打卡社区记录
*
* @param sysWxUserLog
* @return
*/
public List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog){
public List<CommunityPunchReponse> getCommunityPunch(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.getCommunityPunch(sysWxUserLog);
}
public List<CommunityPunchReponse> getCommunityPunchByOpenid(String openid) {
return sysWxUserLogMapper.getCommunityPunchByOpenid(openid);
}
/**
* 根据打卡社区
*
* @param sysWxUserLog
* @return
*/
public int getPunchTotalNum(SysWxUserLog sysWxUserLog){
return sysWxUserLogMapper.getPunchTotalNum(sysWxUserLog);
public int getPunchTotalNum(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.getPunchTotalNum(sysWxUserLog);
}
/**
* 查询打卡社区总共打卡人数
*
* @return
*/
public int getPunchCustomerTotalNum(){
return sysWxUserLogMapper.getPunchCustomerTotalNum();
public int getPunchCustomerTotalNum() {
return sysWxUserLogMapper.getPunchCustomerTotalNum();
}
}

View File

@ -5,123 +5,123 @@
<mapper namespace="com.stdiet.custom.mapper.SysCustomerHealthyMapper">
<resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult">
<result property="id" column="id" />
<result property="customerId" column="customer_id" />
<result property="id" column="id"/>
<result property="customerId" column="customer_id"/>
<!-- 非持久化字段,客户姓名 -->
<result property="name" column="name"></result>
<result property="name" column="name"/>
<!-- 非持久化字段,客户手机号 -->
<result property="phone" column="phone"></result>
<result property="conditioningProjectId" column="conditioning_project_id" />
<result property="phone" column="phone"/>
<result property="conditioningProjectId" column="conditioning_project_id"/>
<!-- 非持久化字段,调理项目名称 -->
<result property="conditioningProject" column="conditioning_project" />
<result property="sex" column="sex" />
<result property="age" column="age" />
<result property="weight" column="weight" />
<result property="tall" column="tall" />
<result property="condiment" column="condiment" />
<result property="otherCondiment" column="other_condiment" />
<result property="cookingStyle" column="cooking_style" />
<result property="cookingStyleRate" column="cooking_style_rate" />
<result property="washVegetablesStyle" column="wash_vegetables_style" />
<result property="otherWashVegetablesStyle" column="other_wash_vegetables_style" />
<result property="breakfastType" column="breakfast_type" />
<result property="breakfastFood" column="breakfast_food" />
<result property="lunchType" column="lunch_type" />
<result property="dinner" column="dinner" />
<result property="vegetableRate" column="vegetable_rate" />
<result property="commonMeat" column="common_meat" />
<result property="dinnerTime" column="dinner_time" />
<result property="supperNum" column="supper_num" />
<result property="supperFood" column="supper_food" />
<result property="dietHotAndCold" column="diet_hot_and_cold" />
<result property="dietFlavor" column="diet_flavor" />
<result property="vegetablesNum" column="vegetables_num" />
<result property="vegetablesRateType" column="vegetables_rate_type" />
<result property="fruitsNum" column="fruits_num" />
<result property="fruitsTime" column="fruits_time" />
<result property="fruitsRate" column="fruits_rate" />
<result property="riceNum" column="rice_num" />
<result property="riceFull" column="rice_full" />
<result property="eatingSpeed" column="eating_speed" />
<result property="snacks" column="snacks" />
<result property="otherSnacks" column="other_snacks" />
<result property="healthProductsFlag" column="health_products_flag" />
<result property="healthProductsBrand" column="health_products_brand" />
<result property="healthProductsName" column="health_products_name" />
<result property="healthProductsWeekRate" column="health_products_week_rate" />
<result property="healthProductsDayRate" column="health_products_day_rate" />
<result property="waterNum" column="water_num" />
<result property="waterType" column="water_type" />
<result property="waterHabit" column="water_habit" />
<result property="drinksNum" column="drinks_num" />
<result property="drinkWineFlag" column="drink_wine_flag" />
<result property="drinkWineClassify" column="drink_wine_classify" />
<result property="otherWineClassify" column="other_wine_classify" />
<result property="drinkWineAmount" column="drink_wine_amount" />
<result property="smokeFlag" column="smoke_flag" />
<result property="smokeRate" column="smoke_rate" />
<result property="secondSmoke" column="second_smoke" />
<result property="workIndustry" column="work_industry" />
<result property="workType" column="work_type" />
<result property="defecationNum" column="defecation_num" />
<result property="otherDefecationNum" column="other_defecation_num" />
<result property="defecationTime" column="defecation_time" />
<result property="defecationShape" column="defecation_shape" />
<result property="defecationSmell" column="defecation_smell" />
<result property="defecationSpeed" column="defecation_speed" />
<result property="defecationColor" column="defecation_color" />
<result property="motionNum" column="motion_num" />
<result property="motionDuration" column="motion_duration" />
<result property="motionTime" column="motion_time" />
<result property="aerobicMotionClassify" column="aerobic_motion_classify" />
<result property="anaerobicMotionClassify" column="anaerobic_motion_classify" />
<result property="anaerobicAerobicMotionClassify" column="anaerobic_aerobic_motion_classify" />
<result property="otherMotionClassify" column="other_motion_classify" />
<result property="motionField" column="motion_field" />
<result property="otherMotionField" column="other_motion_field" />
<result property="sleepTime" column="sleep_time" />
<result property="sleepQuality" column="sleep_quality" />
<result property="sleepDrugFlag" column="sleep_drug_flag" />
<result property="sleepDrug" column="sleep_drug" />
<result property="stayupLateFlag" column="stayup_late_flag" />
<result property="stayupLateWeekNum" column="stayup_late_week_num" />
<result property="familyIllnessHistory" column="family_illness_history" />
<result property="otherFamilyIllnessHistory" column="other_family_illness_history" />
<result property="operationHistory" column="operation_history" />
<result property="otherOperationHistory" column="other_operation_history" />
<result property="nearOperationFlag" column="near_operation_flag" />
<result property="recoveryeSituation" column="recoverye_situation" />
<result property="longEatDrugFlag" column="long_eat_drug_flag" />
<result property="longEatDrugClassify" column="long_eat_drug_classify" />
<result property="otherLongEatDrugClassify" column="other_long_eat_drug_classify" />
<result property="allergyFlag" column="allergy_flag" />
<result property="allergySituation" column="allergy_situation" />
<result property="allergen" column="allergen" />
<result property="otherAllergen" column="other_allergen" />
<result property="medicalReport" column="medical_report" />
<result property="medicalReportName" column="medical_report_name" />
<result property="position" column="position" />
<result property="experience" column="experience" />
<result property="rebound" column="rebound" />
<result property="difficulty" column="difficulty" />
<result property="crux" column="crux" />
<result property="dishesIngredient" column="dishes_ingredient" />
<result property="makeFoodType" column="make_food_type" />
<result property="physicalSignsId" column="physical_signs_id" />
<result property="otherPhysicalSigns" column="other_physical_signs" />
<result property="bloodData" column="blood_data" />
<result property="moistureDate" column="moisture_date" />
<result property="remark" column="remark"></result>
<result property="guidance" column="guidance" />
<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" />
<result property="avoidFood" column="avoid_food" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler" />
<result property="conditioningProject" column="conditioning_project"/>
<result property="sex" column="sex"/>
<result property="age" column="age"/>
<result property="weight" column="weight"/>
<result property="tall" column="tall"/>
<result property="condiment" column="condiment"/>
<result property="otherCondiment" column="other_condiment"/>
<result property="cookingStyle" column="cooking_style"/>
<result property="cookingStyleRate" column="cooking_style_rate"/>
<result property="washVegetablesStyle" column="wash_vegetables_style"/>
<result property="otherWashVegetablesStyle" column="other_wash_vegetables_style"/>
<result property="breakfastType" column="breakfast_type"/>
<result property="breakfastFood" column="breakfast_food"/>
<result property="lunchType" column="lunch_type"/>
<result property="dinner" column="dinner"/>
<result property="vegetableRate" column="vegetable_rate"/>
<result property="commonMeat" column="common_meat"/>
<result property="dinnerTime" column="dinner_time"/>
<result property="supperNum" column="supper_num"/>
<result property="supperFood" column="supper_food"/>
<result property="dietHotAndCold" column="diet_hot_and_cold"/>
<result property="dietFlavor" column="diet_flavor"/>
<result property="vegetablesNum" column="vegetables_num"/>
<result property="vegetablesRateType" column="vegetables_rate_type"/>
<result property="fruitsNum" column="fruits_num"/>
<result property="fruitsTime" column="fruits_time"/>
<result property="fruitsRate" column="fruits_rate"/>
<result property="riceNum" column="rice_num"/>
<result property="riceFull" column="rice_full"/>
<result property="eatingSpeed" column="eating_speed"/>
<result property="snacks" column="snacks"/>
<result property="otherSnacks" column="other_snacks"/>
<result property="healthProductsFlag" column="health_products_flag"/>
<result property="healthProductsBrand" column="health_products_brand"/>
<result property="healthProductsName" column="health_products_name"/>
<result property="healthProductsWeekRate" column="health_products_week_rate"/>
<result property="healthProductsDayRate" column="health_products_day_rate"/>
<result property="waterNum" column="water_num"/>
<result property="waterType" column="water_type"/>
<result property="waterHabit" column="water_habit"/>
<result property="drinksNum" column="drinks_num"/>
<result property="drinkWineFlag" column="drink_wine_flag"/>
<result property="drinkWineClassify" column="drink_wine_classify"/>
<result property="otherWineClassify" column="other_wine_classify"/>
<result property="drinkWineAmount" column="drink_wine_amount"/>
<result property="smokeFlag" column="smoke_flag"/>
<result property="smokeRate" column="smoke_rate"/>
<result property="secondSmoke" column="second_smoke"/>
<result property="workIndustry" column="work_industry"/>
<result property="workType" column="work_type"/>
<result property="defecationNum" column="defecation_num"/>
<result property="otherDefecationNum" column="other_defecation_num"/>
<result property="defecationTime" column="defecation_time"/>
<result property="defecationShape" column="defecation_shape"/>
<result property="defecationSmell" column="defecation_smell"/>
<result property="defecationSpeed" column="defecation_speed"/>
<result property="defecationColor" column="defecation_color"/>
<result property="motionNum" column="motion_num"/>
<result property="motionDuration" column="motion_duration"/>
<result property="motionTime" column="motion_time"/>
<result property="aerobicMotionClassify" column="aerobic_motion_classify"/>
<result property="anaerobicMotionClassify" column="anaerobic_motion_classify"/>
<result property="anaerobicAerobicMotionClassify" column="anaerobic_aerobic_motion_classify"/>
<result property="otherMotionClassify" column="other_motion_classify"/>
<result property="motionField" column="motion_field"/>
<result property="otherMotionField" column="other_motion_field"/>
<result property="sleepTime" column="sleep_time"/>
<result property="sleepQuality" column="sleep_quality"/>
<result property="sleepDrugFlag" column="sleep_drug_flag"/>
<result property="sleepDrug" column="sleep_drug"/>
<result property="stayupLateFlag" column="stayup_late_flag"/>
<result property="stayupLateWeekNum" column="stayup_late_week_num"/>
<result property="familyIllnessHistory" column="family_illness_history"/>
<result property="otherFamilyIllnessHistory" column="other_family_illness_history"/>
<result property="operationHistory" column="operation_history"/>
<result property="otherOperationHistory" column="other_operation_history"/>
<result property="nearOperationFlag" column="near_operation_flag"/>
<result property="recoveryeSituation" column="recoverye_situation"/>
<result property="longEatDrugFlag" column="long_eat_drug_flag"/>
<result property="longEatDrugClassify" column="long_eat_drug_classify"/>
<result property="otherLongEatDrugClassify" column="other_long_eat_drug_classify"/>
<result property="allergyFlag" column="allergy_flag"/>
<result property="allergySituation" column="allergy_situation"/>
<result property="allergen" column="allergen"/>
<result property="otherAllergen" column="other_allergen"/>
<result property="medicalReport" column="medical_report"/>
<result property="medicalReportName" column="medical_report_name"/>
<result property="position" column="position"/>
<result property="experience" column="experience"/>
<result property="rebound" column="rebound"/>
<result property="difficulty" column="difficulty"/>
<result property="crux" column="crux"/>
<result property="dishesIngredient" column="dishes_ingredient"/>
<result property="makeFoodType" column="make_food_type"/>
<result property="physicalSignsId" column="physical_signs_id"/>
<result property="otherPhysicalSigns" column="other_physical_signs"/>
<result property="bloodData" column="blood_data"/>
<result property="moistureDate" column="moisture_date"/>
<result property="remark" column="remark"/>
<result property="guidance" column="guidance"/>
<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"/>
<result property="avoidFood" column="avoid_food" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>
<!-- column是传的参数, select是调用的查询 -->
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
<association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"></association>
<association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"/>
</resultMap>
<sql id="selectSysCustomerHealthyVo">
@ -134,9 +134,10 @@
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
from sys_customer_healthy as sch
LEFT JOIN sys_customer sc on sc.id = sch.customer_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
cp.dict_value = sch.conditioning_project_id
where sch.del_flag = 0 and sc.del_flag = 0
<if test="conditioningProjectId != null "> and sch.conditioning_project_id = #{conditioningProjectId}</if>
<if test="conditioningProjectId != null ">and sch.conditioning_project_id = #{conditioningProjectId}</if>
<if test="name != null and name != ''">
and (sc.name like concat('%',#{name},'%') or sc.phone like concat('%',#{name},'%'))
</if>
@ -147,7 +148,8 @@
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
from sys_customer_healthy as sch
left join sys_customer sc on sc.id = sch.customer_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
cp.dict_value = sch.conditioning_project_id
where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id}
</select>
@ -156,11 +158,12 @@
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone,cp.dict_label as conditioning_project
from sys_customer_healthy as sch
left join sys_customer sc on sc.id = sch.customer_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON
cp.dict_value = sch.conditioning_project_id
where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} order by sch.id desc limit 1
</select>
<insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy" useGeneratedKeys="true" keyProperty="id">
<insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_healthy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -380,7 +383,9 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="avoidFood != null">#{avoid_food, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
<if test="avoidFood != null">
#{avoid_food, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},
</if>
</trim>
</insert>
@ -450,7 +455,9 @@
<if test="motionTime != null">motion_time = #{motionTime},</if>
<if test="aerobicMotionClassify != null">aerobic_motion_classify = #{aerobicMotionClassify},</if>
<if test="anaerobicMotionClassify != null">anaerobic_motion_classify = #{anaerobicMotionClassify},</if>
<if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify = #{anaerobicAerobicMotionClassify},</if>
<if test="anaerobicAerobicMotionClassify != null">anaerobic_aerobic_motion_classify =
#{anaerobicAerobicMotionClassify},
</if>
<if test="otherMotionClassify != null">other_motion_classify = #{otherMotionClassify},</if>
<if test="motionField != null">motion_field = #{motionField},</if>
<if test="otherMotionField != null">other_motion_field = #{otherMotionField},</if>
@ -461,7 +468,8 @@
<if test="stayupLateFlag != null">stayup_late_flag = #{stayupLateFlag},</if>
<if test="stayupLateWeekNum != null">stayup_late_week_num = #{stayupLateWeekNum},</if>
<if test="familyIllnessHistory != null">family_illness_history = #{familyIllnessHistory},</if>
<if test="otherFamilyIllnessHistory != null">other_family_illness_history = #{otherFamilyIllnessHistory},</if>
<if test="otherFamilyIllnessHistory != null">other_family_illness_history = #{otherFamilyIllnessHistory},
</if>
<if test="operationHistory != null">operation_history = #{operationHistory},</if>
<if test="otherOperationHistory != null">other_operation_history = #{otherOperationHistory},</if>
<if test="nearOperationFlag != null">near_operation_flag = #{nearOperationFlag},</if>
@ -493,7 +501,9 @@
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="avoidFood != null">avoid_food = #{avoidFood, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},</if>
<if test="avoidFood != null">avoid_food =
#{avoidFood, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ArrayJsonHandler},
</if>
</trim>
where id = #{id}
</update>
@ -527,41 +537,43 @@
</update>
<resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<id property="dictCode" column="dict_code"/>
<result property="dictSort" column="dict_sort"/>
<result property="dictLabel" column="dict_label"/>
<result property="dictValue" column="dict_value"/>
<result property="dictType" column="dict_type"/>
</resultMap>
<select id="selectDictDataByTypeAndValue" parameterType="SysDictData" resultMap="SysDictDataResult">
select dict_code, dict_sort, dict_label, dict_value, dict_type from sys_dict_data
where status = '0' and dict_type = #{dictType}
and dict_value in <foreach collection="dictValueList" item="item" index="index"
open="(" separator="," close=")">#{item}</foreach>
and dict_value in
<foreach collection="dictValueList" item="item" index="index"
open="(" separator="," close=")">#{item}
</foreach>
order by dict_sort asc
</select>
<resultMap type="SysCustomerHealthyExtended" id="HealthyExtendedResult">
<result property="id" column="id" />
<result property="healthyId" column="healthy_id" />
<result property="waist" column="waist" />
<result property="hipline" column="hipline" />
<result property="eatFruitsMessage" column="eat_fruits_message" />
<result property="longEatDrugMessage" column="long_eat_drug_message" />
<result property="medicationCompliance" column="medication_compliance" />
<result property="adverseReactionsFlag" column="adverse_reactions_flag" />
<result property="adverseReactions" column="adverse_reactions" />
<result property="bloodSugarMessage" column="blood_sugar_message" />
<result property="depressedStateMessage" column="depressed_state_message" />
<result property="bloodPressureMessage" column="blood_pressure_message" />
<result property="anxietyStateMessage" column="anxiety_state_message" />
<result property="menstruationMessage" column="menstruation_message" />
<result property="gastrointestinalMessage" column="gastrointestinal_message" />
<result property="postpartumConditioningMessage" column="postpartum_conditioning_message" />
<result property="hypertensionMessage" column="hypertension_message" />
<result property="hyperlipidemiaMessage" column="hyperlipidemia_message" />
<result property="delFlag" column="del_flag" />
<result property="id" column="id"/>
<result property="healthyId" column="healthy_id"/>
<result property="waist" column="waist"/>
<result property="hipline" column="hipline"/>
<result property="eatFruitsMessage" column="eat_fruits_message"/>
<result property="longEatDrugMessage" column="long_eat_drug_message"/>
<result property="medicationCompliance" column="medication_compliance"/>
<result property="adverseReactionsFlag" column="adverse_reactions_flag"/>
<result property="adverseReactions" column="adverse_reactions"/>
<result property="bloodSugarMessage" column="blood_sugar_message"/>
<result property="depressedStateMessage" column="depressed_state_message"/>
<result property="bloodPressureMessage" column="blood_pressure_message"/>
<result property="anxietyStateMessage" column="anxiety_state_message"/>
<result property="menstruationMessage" column="menstruation_message"/>
<result property="gastrointestinalMessage" column="gastrointestinal_message"/>
<result property="postpartumConditioningMessage" column="postpartum_conditioning_message"/>
<result property="hypertensionMessage" column="hypertension_message"/>
<result property="hyperlipidemiaMessage" column="hyperlipidemia_message"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<select id="getHealthyExtendedByHealthyId" parameterType="Long" resultMap="HealthyExtendedResult">

View File

@ -46,11 +46,12 @@
<result property="thumbsupNum" column="thumbsup_num"/>
<result property="healthManifesto" column="health_manifesto"/>
<result property="delFlag" column="del_flag"/>
<result property="menstrualPeriod" column="menstrual_period"/>
<!-- 非持久字段 -->
<result property="customerName" column="customer_name"></result>
<result property="customerName" column="customer_name"/>
<!-- 营养师 -->
<result property="nutritionist" column="nutritionist"></result>
<result property="afterNutritionist" column="after_nutritionist"></result>
<result property="nutritionist" column="nutritionist"/>
<result property="afterNutritionist" column="after_nutritionist"/>
</resultMap>
<resultMap type="com.stdiet.custom.page.WxLogInfo" id="WxLogInfo">
@ -73,16 +74,21 @@
<result property="constipation" column="constipation"/>
<result property="remark" column="remark"/>
<result property="ingredientDesc" column="ingredient_desc"/>
<!-- <result property="breakfastImages" column="breakfast_images"/>-->
<result property="breakfastImagesUrl" column="breakfast_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="lunchImages" column="lunch_images"/>-->
<result property="lunchImagesUrl" column="lunch_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="dinnerImages" column="dinner_images"/>-->
<result property="dinnerImagesUrl" column="dinner_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="extraMealImages" column="extra_meal_images"/>-->
<result property="extraMealImagesUrl" column="extra_meal_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="bodyImages" column="body_images"/>-->
<result property="bodyImagesUrl" column="body_images" typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="breakfastImages" column="breakfast_images"/>-->
<result property="breakfastImagesUrl" column="breakfast_images"
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="lunchImages" column="lunch_images"/>-->
<result property="lunchImagesUrl" column="lunch_images"
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="dinnerImages" column="dinner_images"/>-->
<result property="dinnerImagesUrl" column="dinner_images"
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="extraMealImages" column="extra_meal_images"/>-->
<result property="extraMealImagesUrl" column="extra_meal_images"
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<!-- <result property="bodyImages" column="body_images"/>-->
<result property="bodyImagesUrl" column="body_images"
typeHandler="com.stdiet.custom.typehandler.ImagesHandler"/>
<result property="bodyDesc" column="body_desc"/>
<result property="suggest" column="suggest"/>
<result property="targetWeight" column="target_weight"/>
@ -90,11 +96,12 @@
<result property="comment" column="comment"/>
<result property="thumbsupNum" column="thumbsup_num"/>
<result property="healthManifesto" column="health_manifesto"/>
<result property="menstrualPeriod" column="menstrual_period"/>
</resultMap>
<sql id="selectSysWxUserLogVo">
select id,openid, weight, appid, phone, log_time, sleep_time, wakeup_time, sport, sport_desc, avatar_url, diet, diet_desc, insomnia, defecation, defecation_desc, water, create_by, create_time, update_by, update_time, remark,
emotion, emotion_desc,sly_eat_food,constipation,ingredient_desc,breakfast_images,lunch_images,dinner_images,extra_meal_images,body_images,body_desc,suggest,execution_score,comment,health_manifesto
emotion, emotion_desc,sly_eat_food,constipation,ingredient_desc,breakfast_images,lunch_images,dinner_images,extra_meal_images,body_images,body_desc,suggest,execution_score,comment,health_manifesto,menstrual_period
from sys_wx_user_log
</sql>
@ -106,8 +113,10 @@
<select id="selectSysWxUserLogList" parameterType="SysWxUserLog" resultMap="SysWxUserLogResult">
SELECT
wxlog.id,wxinfo.appid,wxinfo.openid,wxinfo.avatar_url,wxinfo.phone,wxlog.weight,wxlog.log_time,wxlog.sleep_time,
wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,wxlog.remark,
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport,
wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,wxlog.remark,
wxlog.emotion, wxlog.menstrual_period,
wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images,wxlog.body_desc,
wxlog.suggest,wxlog.execution_score,wxlog.comment,sc.name as customer_name, su.nick_name as nutritionist,
su_atferSale.nick_name as after_nutritionist, wxlog.health_manifesto, wxlog.log_time
@ -205,6 +214,7 @@
<if test="thumbsupNum != null">thumbsup_num,</if>
<if test="healthManifesto != null">health_manifesto,</if>
<if test="delFlag != null">del_flag,</if>
<if test="menstrualPeriod != null">menstrual_period,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="openid != null">#{openid},</if>
@ -246,6 +256,7 @@
<if test="thumbsupNum != null">#{thumbsupNum},</if>
<if test="healthManifesto != null">#{healthManifesto},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="menstrualPeriod != null">menstrual_period = #{menstrualPeriod},</if>
</trim>
</insert>
@ -288,6 +299,7 @@
<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="menstrualPeriod != null">menstrual_period = #{menstrualPeriod},</if>
</trim>
where id = #{id}
</update>
@ -305,9 +317,11 @@
<!-- 根据openid和手机号查询对应打卡记录 -->
<select id="getWxLogInfoList" parameterType="SysWxUserLog" resultMap="WxLogInfo">
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc
,wxlog.remark,wxlog.execution_score,wxlog.comment, wxlog.health_manifesto
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc,
wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc,
wxlog.remark,wxlog.execution_score,wxlog.comment, wxlog.health_manifesto, wxlog.menstrual_period
FROM sys_wx_user_log wxlog
where wxlog.del_flag = 0 and wxlog.openid = #{openid}
order by wxlog.log_time asc
@ -350,9 +364,11 @@
<!-- 根据openid和手机号查询对应打卡记录 -->
<select id="getWxLogInfoDetailById" parameterType="SysWxUserLog" resultMap="WxLogInfo">
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc, wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc
,wxlog.remark,wxlog.execution_score,wxlog.comment
SELECT wxlog.id,wxlog.weight,wxlog.log_time,wxlog.sleep_time, wxlog.wakeup_time,wxlog.defecation, wxlog.defecation_desc,
wxlog.water, wxlog.insomnia,wxlog.sport, wxlog.sport_desc,wxlog.diet, wxlog.diet_desc,
wxlog.emotion, wxlog.emotion_desc,wxlog.sly_eat_food,wxlog.constipation,wxlog.ingredient_desc,wxlog.breakfast_images,
wxlog.lunch_images,wxlog.dinner_images,wxlog.extra_meal_images,wxlog.body_images, wxlog.body_desc,
wxlog.remark,wxlog.execution_score,wxlog.comment,wxlog.menstrual_period
FROM sys_wx_user_log wxlog left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
where wxlog.del_flag = 0 and wxlog.id = #{id}
order by wxlog.log_time desc
@ -365,11 +381,10 @@
<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="healthManifesto" column="health_manifesto"/>
<association property="thumbsupNum" column="id" select="getPunchThumbsupCount"/>
<!-- 查询最近五天体重 -->
<association property="thumbsupNum" column="id" select="getPunchThumbsupCount"/>
<!-- 查询体重 -->
<association property="weightData" column="{id=openid}" select="getRecentWeight"/>
<!-- 查询点赞的openid -->
<association property="thumbsupUser" column="id" select="getPunchThumbsupList"/>
@ -378,19 +393,45 @@
<!-- 查询打卡社区内容 -->
<select id="getCommunityPunch" resultMap="punchReponseMap" parameterType="SysWxUserLog">
SELECT * FROM
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log WHERE TO_DAYS(log_time) = TO_DAYS(NOW()) AND del_flag = 0) AS wxlog
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log
WHERE TO_DAYS(log_time) = TO_DAYS(NOW()) AND del_flag = 0) AS wxlog
LEFT JOIN (SELECT openid, nick_name, avatar_url FROM sys_wx_user_info) AS wxinfo
USING(openid)
ORDER BY log_time DESC
</select>
<resultMap id="punchReponseMap2" type="com.stdiet.custom.dto.response.CommunityPunchReponse">
<result property="id" column="id" typeHandler="com.stdiet.custom.typehandler.EncryptedIdHandler"/>
<result property="openid" column="openid"/>
<result property="nickName" column="nick_name"/>
<result property="avatarUrl" column="avatar_url"/>
<result property="logTime" column="log_time"/>
<result property="comment" column="comment"/>
<result property="healthManifesto" column="health_manifesto"/>
<association property="thumbsupNum" column="id" select="getPunchThumbsupCount"/>
<!-- 查询体重 -->
<!-- <association property="weightData" column="{id=openid}" select="getRecentWeight"/>-->
<!-- 查询点赞的openid -->
<association property="thumbsupUser" column="id" select="getPunchThumbsupList"/>
</resultMap>
<!-- 客户活动-->
<select id="getCommunityPunchByOpenid" resultMap="punchReponseMap2" parameterType="String">
SELECT * FROM
(SELECT id, openid, `comment`, health_manifesto, log_time FROM sys_wx_user_log
WHERE openid = #{openid} AND del_flag = 0) AS wxlog
LEFT JOIN (SELECT openid, nick_name, avatar_url FROM sys_wx_user_info) AS wxinfo
USING(openid)
ORDER BY log_time DESC
</select>
<!-- 查询打卡社区中点赞的openid -->
<!-- <select id="getPunchThumbsupList" parameterType="Long" resultType="Map">-->
<!-- select * from-->
<!-- (select id, cus_openid as openid, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i') as `time` from sys_punch_thumbsup where punch_id = #{id} and del_flag = 0 order by create_time asc) as tu-->
<!-- left join (SELECT openid, nick_name as nickName, avatar_url as avatarUrl FROM sys_wx_user_info) AS wxinfo-->
<!-- using(openid)-->
<!-- </select>-->
<!-- <select id="getPunchThumbsupList" parameterType="Long" resultType="Map">-->
<!-- select * from-->
<!-- (select id, cus_openid as openid, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i') as `time` from sys_punch_thumbsup where punch_id = #{id} and del_flag = 0 order by create_time asc) as tu-->
<!-- left join (SELECT openid, nick_name as nickName, avatar_url as avatarUrl FROM sys_wx_user_info) AS wxinfo-->
<!-- using(openid)-->
<!-- </select>-->
<resultMap id="thumbupUserResultMap" type="Map">
<result property="id" column="id" typeHandler="com.stdiet.custom.typehandler.EncryptedIdHandler"/>