Browse Source

死亡管理,治愈管理数据移交完成,面对重复数据错误尚未解决

ry
loser 1 year ago
parent
commit
09b8ad1f7e
  1. 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientDeadController.java
  2. 58
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java
  3. 96
      ruoyi-admin/src/main/resources/templates/patient/patientManage/addCure.html
  4. 96
      ruoyi-admin/src/main/resources/templates/patient/patientManage/addDead.html
  5. 17
      ruoyi-admin/src/main/resources/templates/patient/patientManage/patientManage.html
  6. 4
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientCure.java
  7. 4
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientDead.java
  8. 4
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientManage.java
  9. 19
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/PatientManageMapper.java
  10. 16
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPatientManageService.java
  11. 10
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PatientManageServiceImpl.java
  12. 1
      ruoyi-system/src/main/resources/mapper/PatientCureMapper.xml
  13. 1
      ruoyi-system/src/main/resources/mapper/PatientDeadMapper.xml
  14. 41
      ruoyi-system/src/main/resources/mapper/PatientManageMapper.xml

1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientDeadController.java

@ -175,4 +175,5 @@ public class PatientDeadController extends BaseController
{
return patientDeadService.checkPatientIdCardUnique(patientDead);
}
}

58
ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java

@ -181,4 +181,62 @@ public class PatientManageController extends BaseController
{
return patientManageService.checkPatientIdCardUnique(user);
}
/**
* 添加患者信息至治愈管理
*/
@RequiresPermissions("patient:patientManage:addCure")
@GetMapping("/addCure/{patientId}")
public String addCure(@PathVariable("patientId") Long patientId, ModelMap mmap)
{
PatientManage patientManage = patientManageService.selectPatientManageByPatientId(patientId);
mmap.put("patientManage", patientManage);
return prefix + "/addCure";
}
/**
* 添加患者信息至治愈管理
*/
@RequiresPermissions("patient:patientManage:addCure")
@Log(title = "添加治愈患者", businessType = BusinessType.INSERT)
@PostMapping("/addCure")
@ResponseBody
public AjaxResult addCure(@Validated PatientManage patientManage)
{
if (StringUtils.isNotEmpty(patientManage.getPatientIdCard()) && !patientManageService.checkPatientIdCardUnique(patientManage))
{
return error("治愈患者'" + patientManage.getPatientName() + "'失败,身份证已存在");
}
return toAjax(patientManageService.insertCurePatientManage(patientManage));
}
/**
* 添加患者信息至死亡管理
*/
@RequiresPermissions("patient:patientManage:addCure")
@GetMapping("/addDead/{patientId}")
public String addDead(@PathVariable("patientId") Long patientId, ModelMap mmap)
{
PatientManage patientManage = patientManageService.selectPatientManageByPatientId(patientId);
mmap.put("patientManage", patientManage);
return prefix + "/addDead";
}
/**
* 添加患者信息至死亡管理
*/
@RequiresPermissions("patient:patientManage:addDead")
@Log(title = "添加死亡患者", businessType = BusinessType.INSERT)
@PostMapping("/addDead")
@ResponseBody
public AjaxResult addDead(@Validated PatientManage patientManage)
{
if (StringUtils.isNotEmpty(patientManage.getPatientIdCard()) && !patientManageService.checkPatientIdCardUnique(patientManage))
{
return error("死亡患者'" + patientManage.getPatientName() + "'失败,身份证已存在");
}
return toAjax(patientManageService.insertDeadPatientManage(patientManage));
}
}

96
ruoyi-admin/src/main/resources/templates/patient/patientManage/addCure.html

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('死亡管理提交')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-patientCure-add" th:object="${patientManage}">
<input name="patientId" th:field="*{patientId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">患者姓名:</label>
<div class="col-sm-8">
<input name="patientName" readonly="true" th:field="*{patientName}" class="form-control" type="text">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-9">
<label class="radio-box">
<input type="radio" readonly="true" th:field="*{patientSex}" value="1" id="male" name="patientSex"></label>
<label class="radio-box">
<input type="radio" readonly="true" th:field="*{patientSex}" value="0" id="female" name="patientSex"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">年龄:</label>
<div class="col-sm-8">
<input name="patientAge" readonly="true" th:field="*{patientAge}" class="form-control" type="text" maxlength="4">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">患者身份证:</label>
<div class="col-sm-8">
<input name="patientIdCard" readonly="true" th:field="*{patientIdCard}" class="form-control" type="text" maxlength="18">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当天体温:</label>
<div class="col-sm-8">
<input name="temperature" readonly="true" th:field="*{temperature}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="description" readonly="true" th:field="*{description}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">最近感染地区:</label>
<div class="col-sm-8">
<input name="currentLocation" readonly="true" th:field="*{currentLocation}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">感染时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="diagnosedTime" readonly="true" th:value="${#dates.format(patientManage.diagnosedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "patientDead/dead";
var urlParams = new URLSearchParams(window.location.search);
var aId = urlParams.get("patientId");
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-patientCure-add').serialize());
}
}
$("input[name='diagnosedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

96
ruoyi-admin/src/main/resources/templates/patient/patientManage/addDead.html

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('死亡管理提交')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-patientDead-add" th:object="${patientManage}">
<input name="patientId" th:field="*{patientId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">患者姓名:</label>
<div class="col-sm-8">
<input name="patientName" readonly="true" th:field="*{patientName}" class="form-control" type="text">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-9">
<label class="radio-box">
<input type="radio" readonly="true" th:field="*{patientSex}" value="1" id="male" name="patientSex"></label>
<label class="radio-box">
<input type="radio" readonly="true" th:field="*{patientSex}" value="0" id="female" name="patientSex"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">年龄:</label>
<div class="col-sm-8">
<input name="patientAge" readonly="true" th:field="*{patientAge}" class="form-control" type="text" maxlength="4">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">患者身份证:</label>
<div class="col-sm-8">
<input name="patientIdCard" readonly="true" th:field="*{patientIdCard}" class="form-control" type="text" maxlength="18">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当天体温:</label>
<div class="col-sm-8">
<input name="temperature" readonly="true" th:field="*{temperature}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="description" readonly="true" th:field="*{description}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">最近感染地区:</label>
<div class="col-sm-8">
<input name="currentLocation" readonly="true" th:field="*{currentLocation}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">感染时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="diagnosedTime" readonly="true" th:value="${#dates.format(patientManage.diagnosedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "patientDead/dead";
var id=document.getElementById("patientId").id;
alert()
function submitHandler() {
// if ($.validate.form()) {
// $.operate.save(prefix + "/add", $('#form-patientDead-add').serialize());
// }
alert(id)
}
$("input[name='diagnosedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

17
ruoyi-admin/src/main/resources/templates/patient/patientManage/patientManage.html

@ -149,11 +149,11 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.patientId + '\')"><i class="fa fa-search"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.patientId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.patientId + '\')"><i class="fa fa-remove"></i>删除</a>');
actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.patientId + '\')"><i class="fa fa-search"></i>详情</a> ')
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.patientId + '\')"><i class="fa fa-edit"></i>编辑</a> ')
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.patientId + '\')"><i class="fa fa-remove"></i>删除</a>')
var more = [];
more.push("<a class='btn btn-default btn-xs " + cureFlag + "' href='javascript:void(0)' onclick='cure(" + row.patientId + ")'><i class='fa fa-user'></i>已治愈</a> ");
more.push("<a class='btn btn-default btn-xs " + cureFlag + "' href='javascript:void(0)' onclick='cure(" + row.patientId + ")'><i class='fa fa-user'></i>已治愈</a> ")
more.push("<a class='btn btn-default btn-xs " + deadFlag + "' href='javascript:void(0)' onclick='dead(" + row.patientId + ")'><i class='fa fa-bomb'></i>已死亡</a>");
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>选择患者状态</a>');
return actions.join('');
@ -164,16 +164,17 @@
});
/* 移交治愈 */
function cure(patientId) {
var url = ''+patientId;
location.href=url;
var url = prefix+'/addCure/'+patientId;
$.modal.openTab("分配用户", url);
}
/* 移交死亡 */
function dead(patientId) {
var url = prefix +'//'+patientId;
location.href=url;
var url = prefix +'/addDead/'+patientId;
$.modal.openTab("分配用户", url);
}

4
ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientCure.java

@ -61,8 +61,8 @@ public class PatientCure extends BaseEntity
@Excel(name = "密接状态" ,readConverterExp = "0=非密接人员,1=密接人员")
private String isTouch;
/** 死亡状态 */
@Excel(name = "死亡状态" ,readConverterExp = "0=健在,1=已死亡")
/** 目前状况 */
@Excel(name = "目前状况" ,readConverterExp = "0=已死亡,1=健在")
private String isDead;
/** 是否去高风险地区 */

4
ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientDead.java

@ -61,8 +61,8 @@ public class PatientDead extends BaseEntity
@Excel(name = "密接状态" ,readConverterExp = "0=非密接人员,1=密接人员")
private String isTouch;
/** 死亡状态 */
@Excel(name = "死亡状态" ,readConverterExp = "0=健在,1=已死亡")
/** 目前状况 */
@Excel(name = "目前状况" ,readConverterExp = "0=已死亡,1=健在")
private String isDead;
/** 是否去高风险地区 */

4
ruoyi-system/src/main/java/com/ruoyi/system/domain/PatientManage.java

@ -64,8 +64,8 @@ public class PatientManage extends BaseEntity
@Excel(name = "密接状态" ,readConverterExp = "0=非密接人员,1=密接人员")
private String isTouch;
/** 死亡状态 */
@Excel(name = "死亡状态" ,readConverterExp = "0=健在,1=已死亡")
/** 目前状况 */
@Excel(name = "目前状况" ,readConverterExp = "0=已死亡,1=健在")
private String isDead;
/** 是否去高风险地区 */

19
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PatientManageMapper.java

@ -82,4 +82,23 @@ public interface PatientManageMapper
* @return 患者信息
*/
public PatientManage checkPatientIdCardUnique(String patientIdCard);
/**
* 新增添加治愈患者管理
*
* @param patientManage 患者管理
* @return 结果
*/
public int insertCurePatientManage(PatientManage patientManage);
/**
* 新增添加死亡患者管理
*
* @param patientManage 患者管理
* @return 结果
*/
public int insertDeadPatientManage(PatientManage patientManage);
}

16
ruoyi-system/src/main/java/com/ruoyi/system/service/IPatientManageService.java

@ -83,4 +83,20 @@ public interface IPatientManageService
*/
public boolean checkPatientIdCardUnique(PatientManage patientManage);
/**
* 新增治愈患者管理
*
* @param patientManage 患者管理
* @return 结果
*/
public int insertCurePatientManage(PatientManage patientManage);
/**
* 新增治愈患者管理
*
* @param patientManage 患者管理
* @return 结果
*/
public int insertDeadPatientManage(PatientManage patientManage);
}

10
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PatientManageServiceImpl.java

@ -211,4 +211,14 @@ public class PatientManageServiceImpl implements IPatientManageService
return UserConstants.UNIQUE;
}
@Override
public int insertCurePatientManage(PatientManage patientManage) {
return patientManageMapper.insertCurePatientManage(patientManage);
}
@Override
public int insertDeadPatientManage(PatientManage patientManage) {
return patientManageMapper.insertCurePatientManage(patientManage);
}
}

1
ruoyi-system/src/main/resources/mapper/PatientCureMapper.xml

@ -121,4 +121,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select patient_id, patient_id_card from patient_cure where patient_id_card=#{patientIdCard}
</select>
</mapper>

1
ruoyi-system/src/main/resources/mapper/PatientDeadMapper.xml

@ -121,4 +121,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select patient_id, patient_id_card from patient_dead where patient_id_card=#{patientIdCard}
</select>
</mapper>

41
ruoyi-system/src/main/resources/mapper/PatientManageMapper.xml

@ -125,6 +125,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkPatientIdCardUnique" parameterType="String" resultMap="PatientManageResult">
select patient_id, patient_id_card from patient_manage where patient_id_card=#{patientIdCard}
</select>
<insert id="insertCurePatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId">
insert into patient_cure
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,</if>
<if test="patientName != null">patient_name,</if>
<if test="patientAge != null">patient_age,</if>
<if test="patientSex != null">patient_sex,</if>
<if test="patientIdCard != null">patient_id_card,</if>
<if test="description != null">description,</if>
<if test="currentLocation != null">current_location,</if>
<if test="temperature != null">temperature,</if>
<if test="diagnosedTime != null">diagnosed_time,</if>
<if test="isEmergency != null">is_emergency,</if>
<if test="isTouch != null">is_touch,</if>
<if test="isHigh != null">is_high,</if>
<if test="isDead != null">is_dead,</if>
</trim> select
patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead
from patient_manage where patient_id not in(SELECT patient_id=#{patientId} from patient_cure )
</insert>
<insert id="insertDeadPatientManage" parameterType="PatientManage" useGeneratedKeys="true" keyProperty="patientId">
insert into patient_dead
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,</if>
<if test="patientName != null">patient_name,</if>
<if test="patientAge != null">patient_age,</if>
<if test="patientSex != null">patient_sex,</if>
<if test="patientIdCard != null">patient_id_card,</if>
<if test="description != null">description,</if>
<if test="currentLocation != null">current_location,</if>
<if test="temperature != null">temperature,</if>
<if test="diagnosedTime != null">diagnosed_time,</if>
<if test="isEmergency != null">is_emergency,</if>
<if test="isTouch != null">is_touch,</if>
<if test="isHigh != null">is_high,</if>
<if test="isDead != null">is_dead,</if>
</trim>
select patient_id,patient_name,patient_age,patient_sex,patient_id_card,description,current_location,temperature,diagnosed_time,is_emergency,is_touch,is_high,is_dead
from patient_manage where patient_id not in(SELECT patient_id=#{patientId} from patient_dead )
</insert>
</mapper>
Loading…
Cancel
Save