健康报告下载名称修改,打卡相关接口优化

This commit is contained in:
xiezhijun
2021-03-24 17:16:36 +08:00
parent 127495e12d
commit 23015d814c
6 changed files with 444 additions and 308 deletions

View File

@ -38,6 +38,8 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
@Autowired
private ISysCustomerService sysCustomerService;
public static final String reportDownFileNameFormat = "%s超重%s斤%s";
/**
* 查询客户健康
*
@ -164,8 +166,10 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
//查询客户健康信息
SysCustomerHealthy sysCustomerHealthy = selectSysCustomerHealthyById(healthyDetailRequest.getId());
if(sysCustomerHealthy != null){
ajaxResult = PdfUtils.generatePdfFile(templatePath, filePath, getReportData(sysCustomerHealthy, healthyDetailRequest));
Map<String, String> reportData = getReportData(sysCustomerHealthy, healthyDetailRequest);
ajaxResult = PdfUtils.generatePdfFile(templatePath, filePath, reportData);
ajaxResult.put("path", fileName);
ajaxResult.put("downReportFileName", reportData.get("downReportFileName")+".pdf");
}
return ajaxResult;
}
@ -235,6 +239,11 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
}
data.put("company","深圳胜唐体控有限公司");
data.put("date", DateUtils.getDate());
//文件下载时的名称,名字+超重几斤+病史体征
String sign = StringUtils.isEmpty(healthyDetailRequest.getPhysicalSigns()) ? "" : healthyDetailRequest.getPhysicalSigns().replace("","").replace(",","").replace("/", "");
String downReportFileName = String.format(reportDownFileNameFormat, healthyDetailRequest.getName(), nutritionalCalories.getOverWeight() > 0 ? nutritionalCalories.getOverWeight().toString() : "0", sign);
data.put("downReportFileName", downReportFileName);
return data;
}

View File

@ -36,14 +36,13 @@
</select>
<select id="selectSysWxUserInfoListNot" parameterType="SysWxUserInfo" resultMap="SysWxUserInfoResult">
select distinct user.openid, user.nick_name, user.appid, user.phone, user.avatar_url, user.sex, user.update_time from sys_wx_user_info user
right join sys_order
on user.phone = sys_order.phone
select distinct wxuser.openid, wxuser.nick_name, wxuser.appid, wxuser.phone, wxuser.avatar_url, wxuser.sex, wxuser.update_time from sys_wx_user_info wxuser
where (SELECT COUNT(wxlog.id) FROM sys_wx_user_log wxlog WHERE wxlog.openid = wxuser.openid) > 0
<where>
<if test="appid != null and appid != ''">and appid = #{appid}</if>
<if test="openid != null and openid != ''">and openid != #{openid}</if>
<if test="appid != null and appid != ''">and wxuser.appid = #{appid}</if>
<if test="openid != null and openid != ''">and wxuser.openid != #{openid}</if>
</where>
order by update_time desc
order by wxuser.update_time desc
</select>
<select id="selectSysWxUserInfoById" parameterType="String" resultMap="SysWxUserInfoResult">