建议问卷导出Excel

This commit is contained in:
xiezhijun
2021-08-14 16:20:16 +08:00
parent 8e963814d8
commit 02d8f7b3d6
7 changed files with 138 additions and 26 deletions

View File

@ -1,10 +1,12 @@
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 lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 售前调查,销售给客户发送简易信息调查链接对象 sys_pre_sale_survey
@ -21,39 +23,53 @@ public class SysPreSaleSurvey extends BaseEntity
private Long id;
/** 客户唯一标识 */
@Excel(name = "客户唯一标识")
//@Excel(name = "客户唯一标识")
private String customerKey;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 身高,厘米 */
@Excel(name = "身高,厘米")
private Integer tall;
/** 体重 */
@Excel(name = "体重")
private BigDecimal weight;
/** 年龄 */
@Excel(name = "年龄")
private Integer age;
/** 0男 1女 */
@Excel(name = "0男 1")
@Excel(name = "性别", readConverterExp = "0=男,1=")
private Integer sex;
/** 身高,厘米 */
@Excel(name = "身高(厘米)")
private Integer tall;
/** 体重 */
@Excel(name = "体重(斤)")
private BigDecimal weight;
/**
* 标准体重
*/
@Excel(name = "标准体重")
private Double standardWeight;
/**
* 标准体重
*/
@Excel(name = "超重")
private Double overWeight ;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 特殊体征ID */
@Excel(name = "特殊体征ID")
private String physicalSignsId;
/** 特殊体征ID */
@Excel(name = "特殊体征")
private String physicalSigns;
/** 其他体征 */
@Excel(name = "其他体征")
private String otherPhysicalSigns;
/** 作息时间 */
@ -61,34 +77,32 @@ public class SysPreSaleSurvey extends BaseEntity
private String timeTable;
/** 减脂或慢病调理经历 */
@Excel(name = "减脂或慢病调理经历")
@Excel(name = "调理经历")
private String experience;
/** 职业 */
@Excel(name = "职业")
private String occupation;
/** 气血数据 */
@Excel(name = "气血数据")
private String bloodData;
/** 湿气数据 */
@Excel(name = "湿气数据")
private String moistureData;
/** 气血数据 */
@Excel(name = "气血数据")
private String bloodData;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "创建时间",dateFormat="yyyy-MM-dd HH:mm")
private Date createTime;
/** 售前ID */
@Excel(name = "售前ID")
private Long preSaleId;
/** 问卷类型 0售前简易问卷 1简易评估问卷 */
@Excel(name = "问卷类型 0售前简易问卷 1简易评估问卷")
private Integer questionType;
/** 删除标识 0未删除 1已删除 */
private Integer delFlag;
/**
* 标准体重
*/
private Double standardWeight;
}

View File

@ -1,6 +1,8 @@
package com.stdiet.custom.mapper;
import java.util.List;
import java.util.Map;
import com.stdiet.custom.domain.SysPreSaleSurvey;
import org.apache.ibatis.annotations.Param;
@ -65,4 +67,12 @@ public interface SysPreSaleSurveyMapper
* @return
*/
public SysPreSaleSurvey getSysPreSaleSurveyByKey(@Param("customerKey")String customerKey);
/**
* 查询字典Label值
* @param dictType
* @param dictValue
* @return
*/
public List<Map<String,Object>> getDictLabelByIds(@Param("dictType")String dictType, @Param("dictValue")String dictValue);
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import com.stdiet.custom.domain.SysPreSaleSurvey;
import org.apache.ibatis.annotations.Param;
/**
* 售前调查销售给客户发送简易信息调查链接Service接口
@ -66,4 +67,12 @@ public interface ISysPreSaleSurveyService
* @return
*/
public SysPreSaleSurvey getSysPreSaleSurveyByKey(String customerKey);
/**
* 查询字典Label值
* @param dictType
* @param dictValue
* @return
*/
public List<Map<String,Object>> getDictLabelByIds(String dictType, String dictValue);
}

View File

@ -7,6 +7,7 @@ import java.util.Map;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.HealthyUtils;
import com.stdiet.custom.utils.NutritionalUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysPreSaleSurveyMapper;
@ -107,4 +108,15 @@ public class SysPreSaleSurveyServiceImpl implements ISysPreSaleSurveyService
public SysPreSaleSurvey getSysPreSaleSurveyByKey(String customerKey){
return sysPreSaleSurveyMapper.getSysPreSaleSurveyByKey(customerKey);
}
/**
* 查询字典Label值
* @param dictType
* @param dictValue
* @return
*/
@Override
public List<Map<String,Object>> getDictLabelByIds(String dictType, String dictValue){
return sysPreSaleSurveyMapper.getDictLabelByIds(dictType, dictValue);
}
}

View File

@ -145,4 +145,12 @@
where del_flag = 0 and customer_key = #{customerKey} limit 1
</select>
<!-- 根据字典ID(可以使用隔开的多个ID)获取对应字典值 -->
<select id="getDictLabelByIds" parameterType="String" resultType="Map">
select dict_label as dictLabel,dict_value as dictValue from sys_dict_data where status = '0' and dict_type = #{dictType}
<if test="dictValue != null and dictValue != ''">
and FIND_IN_SET(dict_value, #{dictValue})
</if>
</select>
</mapper>