修改打卡详情页面,支持前一天后一天翻页查看

This commit is contained in:
xiezhijun
2021-08-25 18:19:55 +08:00
parent e815da39cd
commit b3c7d68705
18 changed files with 213 additions and 38 deletions

View File

@ -206,6 +206,12 @@ public class SysWxUserLog extends BaseEntity {
//图片预览路径
private Map<String, List<String>> imagesUrl;
//获取详情标识
private Integer nextFlag;
//客户性别
private Integer sex;
public void setDefecation(String defecation) {
if (defecation.equals("Y") || defecation.equals("N")) {
// this.defecation = defecation.equals("Y") ? "是" : "否";

View File

@ -88,4 +88,11 @@ public interface SysCustomerHealthyMapper
* @return
*/
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData);
/**
* 查询客户性别
* @param cusId
* @return
*/
Integer getCustomerSexByCusId(Long cusId);
}

View File

@ -73,4 +73,11 @@ public interface SysCustomerPhysicalSignsMapper
* @return
*/
int delCustomerSignByCustomerId(@Param("customerId")Long customerId);
/**
* 查询客户性别
* @param cusId
* @return
*/
Integer getCustomerSexByCusId(Long cusId);
}

View File

@ -123,4 +123,11 @@ public interface SysWxUserLogMapper
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
/**
* 查询打卡详情(下一条、上一条)
* @param sysWxUserLog
* @return
*/
SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog);
}

View File

@ -94,4 +94,11 @@ public interface ISysCustomerHealthyService
* @return
*/
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData);
/**
* 查询客户性别
* @param cusId
* @return
*/
Integer getCustomerSexByCusId(Long cusId);
}

View File

@ -92,4 +92,11 @@ public interface ISysCustomerPhysicalSignsService {
*/
int delCustomerSignByCustomerId(Long customerId);
/**
* 获取客户性别
* @param cusId
* @return
*/
Integer getCustomerSexByCusId(Long cusId);
}

View File

@ -88,4 +88,11 @@ public interface ISysCustomerService
*/
SysCustomer getCustomerByOpenId(String openid);
/**
* 根据客户ID查询性别
* @param cusId 客户ID
* @return
*/
Integer getCustomerSex(Long cusId);
}

View File

@ -124,4 +124,11 @@ public interface ISysWxUserLogService
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
/**
* 查询打卡详情(下一条、上一条)
* @param sysWxUserLog
* @return
*/
SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog);
}

View File

@ -272,4 +272,13 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
public List<SysDictData> selectDictDataByTypeAndValue(SysDictData sysDictData){
return sysCustomerHealthyMapper.selectDictDataByTypeAndValue(sysDictData);
}
/**
* 查询客户性别
* @param cusId
* @return
*/
public Integer getCustomerSexByCusId(Long cusId){
return sysCustomerHealthyMapper.getCustomerSexByCusId(cusId);
}
}

View File

@ -192,4 +192,14 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical
public int delCustomerSignByCustomerId(Long customerId){
return sysCustomerPhysicalSignsMapper.delCustomerSignByCustomerId(customerId);
}
/**
* 查询客户性别
* @param cusId
* @return
*/
@Override
public Integer getCustomerSexByCusId(Long cusId){
return sysCustomerPhysicalSignsMapper.getCustomerSexByCusId(cusId);
}
}

View File

@ -231,4 +231,17 @@ public class SysCustomerServiceImpl implements ISysCustomerService {
}
}
}
/**
* 根据客户ID查询性别
* @param cusId 客户ID
* @return
*/
public Integer getCustomerSex(Long cusId){
Integer sex = sysCustomerHealthyService.getCustomerSexByCusId(cusId);
if(sex == null){
sex = sysCustomerPhysicalSignsService.getCustomerSexByCusId(cusId);
}
return sex;
}
}

View File

@ -182,4 +182,13 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
return sysWxUserLogMapper.selectNotPunchCustomerByDate(sysCustomer);
}
/**
* 查询打卡详情(下一条、上一条)
* @param sysWxUserLog
* @return
*/
public SysWxUserLog getPunchLogDetail(SysWxUserLog sysWxUserLog){
return sysWxUserLogMapper.getPunchLogDetail(sysWxUserLog);
}
}

View File

@ -583,4 +583,9 @@
from sys_customer_healthy_extended where del_flag = 0 and healthy_id = #{id} limit 1
</select>
<!-- 查询客户性别 -->
<select id="getCustomerSexByCusId" parameterType="Long" resultType="Integer">
select sex from sys_customer_healthy where del_flag = 0 and customer_id = #{cusId} limit 1
</select>
</mapper>

View File

@ -222,4 +222,9 @@
update sys_customer_physical_signs set del_flag = 1 where customer_id = #{customerId}
</update>
<!-- 查询客户性别 -->
<select id="getCustomerSexByCusId" parameterType="Long" resultType="Integer">
select sex from sys_customer_physical_signs where del_flag = 0 and customer_id = #{cusId} limit 1
</select>
</mapper>

View File

@ -49,6 +49,7 @@
<result property="menstrualPeriod" column="menstrual_period"/>
<!-- 非持久字段 -->
<result property="customerName" column="customer_name"/>
<result property="customerId" column="cus_id"/>
<!-- 营养师 -->
<result property="nutritionist" column="nutritionist"/>
<result property="afterNutritionist" column="after_nutritionist"/>
@ -495,5 +496,41 @@
order by plan.cus_id desc
</select>
<!-- 获取打卡详情(上一天、下一天) -->
<select id="getPunchLogDetail" 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.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,wxlog.health_manifesto, wxlog.log_time,
sc.id as cus_id,sc.name as customer_name
FROM sys_wx_user_log wxlog
left join sys_wx_user_info wxinfo on wxinfo.openid = wxlog.openid
left join sys_customer sc on sc.id = wxinfo.cus_id and sc.del_flag = 0
where wxlog.del_flag = 0
<if test="nextFlag == 0">
and wxlog.id = #{id}
</if>
<if test="nextFlag == -1">
and #{id} > wxlog.id
</if>
<if test="nextFlag == 1">
and wxlog.id > #{id}
</if>
<if test="customerId != null">
and sc.id = #{customerId}
</if>
<if test="nextFlag == -1">
order by id desc
</if>
<if test="nextFlag == 1">
order by id asc
</if>
limit 1
</select>
</mapper>