Merge remote-tracking branch 'origin/master'

master
heminjian502 2 years ago
commit 1f992472c8

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.api; package com.ruoyi.web.controller.api;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
@ -173,6 +174,9 @@ public class AppController extends BaseController
{ {
TPatient tPatient = new TPatient(); TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient); BeanUtils.copyProperties(appPatientReq, tPatient);
if(UserConstants.NOT_UNIQUE.equals(tPatientService.checkPhoneUnique(tPatient.getPhone()))){
return AjaxResult.error("手机号已注册");
}
tPatientService.insertTPatient(tPatient); tPatientService.insertTPatient(tPatient);
Long identifier = 10000000L + tPatient.getId(); Long identifier = 10000000L + tPatient.getId();
tPatient.setIdentifier(String.valueOf(identifier)); tPatient.setIdentifier(String.valueOf(identifier));
@ -265,4 +269,12 @@ public class AppController extends BaseController
return AjaxResult.success(tPatientService.selectTPatientById(getUserId())); 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("待诊日期开始时间") @ApiModelProperty("待诊日期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime; private String startTime;
@ApiModelProperty("待诊日期结束时间") @ApiModelProperty("待诊日期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime; private String endTime;
public String getName() public String getName()
{ {
@ -149,22 +149,22 @@ public class TRecordResultReq
this.createTime = createTime; this.createTime = createTime;
} }
public Date getStartTime() public String getStartTime()
{ {
return startTime; return startTime;
} }
public void setStartTime(Date startTime) public void setStartTime(String startTime)
{ {
this.startTime = startTime; this.startTime = startTime;
} }
public Date getEndTime() public String getEndTime()
{ {
return endTime; return endTime;
} }
public void setEndTime(Date endTime) public void setEndTime(String endTime)
{ {
this.endTime = endTime; this.endTime = endTime;
} }

@ -65,4 +65,6 @@ public interface TPatientMapper
public TPatient queryTPatient(TPatient tPatient); public TPatient queryTPatient(TPatient tPatient);
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq); List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
int checkPhoneUnique(String phone);
} }

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

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq; import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq;
import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp; import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp;
@ -100,4 +102,15 @@ public class TPatientServiceImpl implements ITPatientService
public List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) { public List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) {
return tPatientMapper.queryByPage(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;
}
} }

@ -152,4 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by a.create_time desc order by a.create_time desc
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultType="int">
select count(1) from t_patient where phone = #{phone} limit 1
</select>
</mapper> </mapper>

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

Loading…
Cancel
Save