Merge remote-tracking branch 'origin/master'

master
heminjian502 2 years ago
commit c7c4447920

@ -706,4 +706,18 @@ public class AppController extends BaseController
BeanUtils.copyProperties(appPatientRecordReq, tRecordResultReq);
return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(tRecordResultReq));
}
/**
*
*
* @return {@code AjaxResult}
*/
@ApiOperation("APP查询版本信息")
@Log(title = "APP查询版本信息", businessType = BusinessType.OTHER)
@GetMapping("/version/info")
public AjaxResult queryVersionInformation(){
String localPath = RuoYiConfig.getAppInfoPath();
String file = FileUtils.readJsonFile(localPath + "appVersion.json");
return AjaxResult.success(JSONObject.parseObject(file));
}
}

@ -44,6 +44,7 @@ public class LoginFilter implements Filter {
filterUrlList.add("/api/app/doctor/info");
filterUrlList.add("/api/app/patient/info");
filterUrlList.add("/api/app/patient/modify");
filterUrlList.add("/api/app/version/info");
if (!filterUrlList.contains(currentUrl)) {
LoginUser loginUser = userTokenService.getLoginUser((HttpServletRequest) servletRequest);

@ -132,4 +132,20 @@ public class RuoYiConfig
{
return getProfile() + "/upload";
}
/**
*
*/
public static String getAppInfoPath()
{
return getProfile() + "/appInfo";
}
/**
*
*/
public static String getQRCodePath()
{
return getProfile() + "/qrCode";
}
}

@ -282,7 +282,7 @@ public class FileUploadUtils
try {
String codeName = UUID.randomUUID().toString();// 二维码的图片名
String imageType = "jpg";// 图片类型
picPath = codeName + "." + imageType;
picPath = DateUtils.datePath() + "/" + codeName + "." + imageType;
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map<EncodeHintType, String> hints = new HashMap<EncodeHintType, String>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");

@ -1,12 +1,6 @@
package com.ruoyi.common.utils.file;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
@ -345,4 +339,31 @@ public class FileUtils
throw new ServiceException("Base64转图片错误,message is " + e.getMessage());
}
}
/**
* json
*
* @param Filename
* @return {@code String}
*/
public static String readJsonFile(String Filename) {
String jsonStr = "";
try {
File jsonFile = new File(Filename);
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8);
int ch;
StringBuilder sb = new StringBuilder();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
jsonStr = sb.toString();
return jsonStr;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}

@ -3,11 +3,11 @@ package com.ruoyi.framework.web.service;
import javax.annotation.Resource;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.AppRegisterReq;
import com.ruoyi.system.mapper.TDoctorMapper;
@ -15,7 +15,6 @@ import com.ruoyi.system.service.impl.UserTokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
@ -50,8 +49,6 @@ public class SysLoginService
{
private static final Logger log = LoggerFactory.getLogger(SysLoginService.class);
@Value("${ruoyi.profile}")
private String uploadFilePath;
@Autowired
private TokenService tokenService;
@ -208,7 +205,7 @@ public class SysLoginService
map.put("id", tDoctor.getId());
map.put("from", "yinuo");
String content = JSONObject.toJSONString(map);
String qrCode = FileUploadUtils.code(content, uploadFilePath);
String qrCode = FileUploadUtils.code(content, RuoYiConfig.getQRCodePath());
tDoctor.setQrCode(qrCode);
log.info("update doctor :{}", tDoctor);
tDoctorMapper.updateTDoctor(tDoctor);

@ -116,8 +116,11 @@ public class PlatformService {
//15-18
int sum15 = weekMonthTimeResps.stream().filter(a -> a.getCreateTime() >= 15 && a.getCreateTime() < 18).mapToInt(WeekMonthTimeResp::getCount).sum();
//18-21
int sum18 = weekMonthTimeResps.stream().filter(a -> a.getCreateTime() >= 18 && a.getCreateTime() <= 21).mapToInt(WeekMonthTimeResp::getCount).sum();
int sum18 = weekMonthTimeResps.stream().filter(a -> a.getCreateTime() >= 18 && a.getCreateTime() < 21).mapToInt(WeekMonthTimeResp::getCount).sum();
//21-24
int sum21 = weekMonthTimeResps.stream().filter(a -> a.getCreateTime() >= 21 && a.getCreateTime() <= 24).mapToInt(WeekMonthTimeResp::getCount).sum();
map.put("sum0",sum0);map.put("sum3",sum3);map.put("sum6",sum6);map.put("sum9",sum9);map.put("sum12",sum12);map.put("sum15",sum15);map.put("sum18",sum18);
map.put("sum21",sum21);
return map;
}
}

@ -1,13 +1,13 @@
package com.ruoyi.system.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.common.utils.wechat.WechatKeys;
@ -58,9 +58,6 @@ public class WechatServiceImpl implements IWechatService {
@Value("${wx.wechatSecret}")
private String wechatSecret;
@Value("${ruoyi.profile}")
private String uploadFilePath;
@Resource
private TWechatUserMapper tWechatUserMapper;
@ -197,7 +194,7 @@ public class WechatServiceImpl implements IWechatService {
map.put("id", tDoctor.getId());
map.put("from", "yinuo");
String content = JSONObject.toJSONString(map);
String qrCode = FileUploadUtils.code(content, uploadFilePath);
String qrCode = FileUploadUtils.code(content, RuoYiConfig.getQRCodePath());
tDoctor.setQrCode(qrCode);
logger.info("update doctor :{}", tDoctor);
tDoctorMapper.updateTDoctor(tDoctor);

@ -162,7 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and b.hospital_id = #{hospitalId}
</if>
<if test="doctorId != null">
and b.doctor_d = #{doctorId}
and b.doctor_id = #{doctorId}
</if>
<if test="doctorName != null and doctorName != ''">
and d.name like concat('%', #{doctorName}, '%')

@ -214,6 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.name
from t_record a LEFT JOIN t_patient b on a.patient_id = b.id
where TO_DAYS(a.create_time) = TO_DAYS(NOW())
and b.del_flag = 0
<if test="doctorId != null "> and a.doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and a.hospital_id = #{hospitalId}</if>
ORDER BY a.create_time desc
@ -237,10 +238,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="ageCount" resultType="com.ruoyi.system.domain.TPatient">
SELECT
a.id,a.age
DISTINCT(a.phone),a.id,a.age
from t_patient a
inner JOIN t_record b on a.id = b.patient_id
where 1 = 1
and a.del_flag = 0
<if test="doctorId != null "> and b.doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and b.hospital_id = #{hospitalId}</if>
</select>

Loading…
Cancel
Save