Merge remote-tracking branch 'origin/master'

master
heminjian502 2 years ago
commit 1f992472c8

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.api;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@ -173,6 +174,9 @@ public class AppController extends BaseController
{
TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient);
if(UserConstants.NOT_UNIQUE.equals(tPatientService.checkPhoneUnique(tPatient.getPhone()))){
return AjaxResult.error("手机号已注册");
}
tPatientService.insertTPatient(tPatient);
Long identifier = 10000000L + tPatient.getId();
tPatient.setIdentifier(String.valueOf(identifier));
@ -265,4 +269,12 @@ public class AppController extends BaseController
return AjaxResult.success(tPatientService.selectTPatientById(getUserId()));
}
@GetMapping("/patient/record/historyData")
@ApiOperation("查询患者历史数据图表")
public AjaxResult getHistoryRecordList(AppRecordReq appRecordReq){
TRecord tRecord = new TRecord();
BeanUtils.copyProperties(appRecordReq, tRecord);
return tRecordService.getHistoryList(tRecord);
}
}

@ -43,10 +43,10 @@ public class TRecordResultReq
@ApiModelProperty("待诊日期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
private String startTime;
@ApiModelProperty("待诊日期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private String endTime;
public String getName()
{
@ -149,22 +149,22 @@ public class TRecordResultReq
this.createTime = createTime;
}
public Date getStartTime()
public String getStartTime()
{
return startTime;
}
public void setStartTime(Date startTime)
public void setStartTime(String startTime)
{
this.startTime = startTime;
}
public Date getEndTime()
public String getEndTime()
{
return endTime;
}
public void setEndTime(Date endTime)
public void setEndTime(String endTime)
{
this.endTime = endTime;
}

@ -8,7 +8,7 @@ import tk.mybatis.mapper.common.Mapper;
/**
* Mapper
*
*
* @author ruoyi
* @date 2022-08-03
*/
@ -16,7 +16,7 @@ public interface TPatientMapper
{
/**
*
*
*
* @param id
* @return
*/
@ -24,7 +24,7 @@ public interface TPatientMapper
/**
*
*
*
* @param tPatient
* @return
*/
@ -32,7 +32,7 @@ public interface TPatientMapper
/**
*
*
*
* @param tPatient
* @return
*/
@ -40,7 +40,7 @@ public interface TPatientMapper
/**
*
*
*
* @param tPatient
* @return
*/
@ -48,7 +48,7 @@ public interface TPatientMapper
/**
*
*
*
* @param id
* @return
*/
@ -56,7 +56,7 @@ public interface TPatientMapper
/**
*
*
*
* @param ids
* @return
*/
@ -65,4 +65,6 @@ public interface TPatientMapper
public TPatient queryTPatient(TPatient tPatient);
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
int checkPhoneUnique(String phone);
}

@ -62,4 +62,6 @@ public interface ITPatientService
public int deleteTPatientById(Long id);
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
String checkPhoneUnique(String phone);
}

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq;
import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp;
@ -12,19 +14,19 @@ import com.ruoyi.system.service.ITPatientService;
/**
* Service
*
*
* @author ruoyi
* @date 2022-08-03
*/
@Service
public class TPatientServiceImpl implements ITPatientService
public class TPatientServiceImpl implements ITPatientService
{
@Autowired
private TPatientMapper tPatientMapper;
/**
*
*
*
* @param id
* @return
*/
@ -36,7 +38,7 @@ public class TPatientServiceImpl implements ITPatientService
/**
*
*
*
* @param tPatient
* @return
*/
@ -48,7 +50,7 @@ public class TPatientServiceImpl implements ITPatientService
/**
*
*
*
* @param tPatient
* @return
*/
@ -61,7 +63,7 @@ public class TPatientServiceImpl implements ITPatientService
/**
*
*
*
* @param tPatient
* @return
*/
@ -74,7 +76,7 @@ public class TPatientServiceImpl implements ITPatientService
/**
*
*
*
* @param ids
* @return
*/
@ -86,7 +88,7 @@ public class TPatientServiceImpl implements ITPatientService
/**
*
*
*
* @param id
* @return
*/
@ -100,4 +102,15 @@ public class TPatientServiceImpl implements ITPatientService
public List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) {
return tPatientMapper.queryByPage(pcTPatintQueryByPageReq);
}
@Override
public String checkPhoneUnique(String phone)
{
int count = tPatientMapper.checkPhoneUnique(phone);
if (count > 0)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TPatientMapper">
<resultMap type="TPatient" id="TPatientResult">
<result property="id" column="id" />
<result property="openId" column="open_id" />
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTPatientList" parameterType="TPatient" resultMap="TPatientResult">
<include refid="selectTPatientVo"/>
<where>
<where>
<if test="openId != null and openId != ''"> and open_id = #{openId}</if>
<if test="identifier != null and identifier != ''"> and identifier = #{identifier}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
@ -40,12 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="disease != null and disease != ''"> and disease = #{disease}</if>
</where>
</select>
<select id="selectTPatientById" parameterType="Long" resultMap="TPatientResult">
<include refid="selectTPatientVo"/>
where id = #{id}
</select>
<insert id="insertTPatient" parameterType="TPatient" useGeneratedKeys="true" keyProperty="id">
insert into t_patient
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTPatientByIds" parameterType="String">
delete from t_patient where id in
delete from t_patient where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
@ -152,4 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by a.create_time desc
</select>
</mapper>
<select id="checkPhoneUnique" parameterType="String" resultType="int">
select count(1) from t_patient where phone = #{phone} limit 1
</select>
</mapper>

@ -202,12 +202,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">
and DATE_FORMAT(tp.create_time,'%Y-%m') = DATE_FORMAT(#{createTime},'%Y-%m')
</if>
<if test="startTime != null and endTime != null">
AND tr.create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="startTime != null and endTime != null"></if>
<if test="doctorOder !=null and firstVisitOder!=null" >order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder}</if>
<if test="startTime != null and startTime != '' and endTime == null "> and tr.create_time &gt;= #{startTime}</if>
<if test="startTime == null and endTime != '' and endTime != null "> and tr.create_time &lt;= #{endTime}</if>
<if test="startTime != null and endTime != null "> and tr.create_time between #{startTime} and #{endTime}</if>
</where>
<if test="doctorOder !=null and firstVisitOder!=null" >order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder}</if>
</select>
<select id="selectTRecordById" parameterType="Long" resultMap="TRecordResult">

Loading…
Cancel
Save