Browse Source

病例上报

master
zhizhi wu 4 years ago
parent
commit
03292ad4e7
  1. 12
      src/main/java/com/ccsens/carbasics/api/PatientController.java
  2. 49
      src/main/java/com/ccsens/carbasics/api/UserController.java
  3. 13
      src/main/java/com/ccsens/carbasics/bean/dto/PatientDto.java
  4. 11
      src/main/java/com/ccsens/carbasics/bean/po/FirstAid.java
  5. 60
      src/main/java/com/ccsens/carbasics/bean/po/FirstAidExample.java
  6. 3
      src/main/java/com/ccsens/carbasics/bean/vo/PatientVo.java
  7. 30
      src/main/java/com/ccsens/carbasics/service/FirstAidService.java
  8. 9
      src/main/java/com/ccsens/carbasics/service/IFirstAidService.java
  9. 1
      src/main/java/com/ccsens/carbasics/util/Constant.java
  10. 2
      src/main/resources/mapper_dao/FirstAidDao.xml
  11. 27
      src/main/resources/mapper_raw/FirstAidMapper.xml
  12. 6
      src/main/resources/mbg.xml

12
src/main/java/com/ccsens/carbasics/api/PatientController.java

@ -4,6 +4,7 @@ import com.ccsens.carbasics.bean.dto.PatientDto;
import com.ccsens.carbasics.bean.vo.PatientVo;
import com.ccsens.carbasics.service.IFirstAidService;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.CodeError;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
@ -83,6 +84,17 @@ public class PatientController {
return JsonResponse.newInstance().ok(list);
}
@MustLogin
@ApiOperation(value = "质检员上报数据状态", notes = "whj")
@RequestMapping(value = "/report", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse report(@ApiParam @Validated @RequestBody QueryDto<PatientDto.Report> params) throws Exception{
log.info("质检员上报数据状态:{}", params);
CodeError.Code code = firstAidService.report(params.getParam(), params.getUserId());
log.info("质检员上报数据状态成功");
return JsonResponse.newInstance().ok(code);
}
@MustLogin
@ApiOperation(value = "秘书查看审核列表", notes = "zy")
@RequestMapping(value = "/listBySecretary", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})

49
src/main/java/com/ccsens/carbasics/api/UserController.java

@ -0,0 +1,49 @@
package com.ccsens.carbasics.api;
import com.ccsens.common.bean.dto.CMemberDto;
import com.ccsens.common.service.IMemberService;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author zy
*/
@Api(tags = "用户")
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
@Resource
private IMemberService memberService;
@ApiOperation(value = "根据手机号更新成员的userId",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/memberWithPhone",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse memberWithPhone(@ApiParam @Validated @RequestBody CMemberDto.PhoneAndUserId params) throws Exception {
log.info("根据手机号更新成员userId");
memberService.relevancePhone(params);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "合并用户后修改userId",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/mergeUser",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse mergeUser(@ApiParam @Validated @RequestBody CMemberDto.MergeUser params) throws Exception {
log.info("合并用户后修改userId");
memberService.mergeUser(params);
return JsonResponse.newInstance().ok();
}
}

13
src/main/java/com/ccsens/carbasics/bean/dto/PatientDto.java

@ -187,6 +187,8 @@ public class PatientDto {
private String idcard;
@ApiModelProperty("查询类型,0:急救 1:出院")
private Byte queryType = 0;
@ApiModelProperty("上报情况 0:未上报 1:上报成功")
private Byte reported;
@ApiModelProperty("第几页")
@Min(value = 1)
@ -207,4 +209,15 @@ public class PatientDto {
private byte dataStatus;
}
@Data
@ApiModel("质检员上报数据")
public static class Report{
@NotNull
@ApiModelProperty("急救id")
private Long firstAidId;
@NotNull
@ApiModelProperty("上报情况 0:未上报 1:上报成功")
private Byte reported;
}
}

11
src/main/java/com/ccsens/carbasics/bean/po/FirstAid.java

@ -30,6 +30,8 @@ public class FirstAid implements Serializable {
private Long hospitalId;
private Byte reported;
private Long operator;
private Date createdAt;
@ -144,6 +146,14 @@ public class FirstAid implements Serializable {
this.hospitalId = hospitalId;
}
public Byte getReported() {
return reported;
}
public void setReported(Byte reported) {
this.reported = reported;
}
public Long getOperator() {
return operator;
}
@ -195,6 +205,7 @@ public class FirstAid implements Serializable {
sb.append(", dataStatus=").append(dataStatus);
sb.append(", projectId=").append(projectId);
sb.append(", hospitalId=").append(hospitalId);
sb.append(", reported=").append(reported);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

60
src/main/java/com/ccsens/carbasics/bean/po/FirstAidExample.java

@ -925,6 +925,66 @@ public class FirstAidExample {
return (Criteria) this;
}
public Criteria andReportedIsNull() {
addCriterion("reported is null");
return (Criteria) this;
}
public Criteria andReportedIsNotNull() {
addCriterion("reported is not null");
return (Criteria) this;
}
public Criteria andReportedEqualTo(Byte value) {
addCriterion("reported =", value, "reported");
return (Criteria) this;
}
public Criteria andReportedNotEqualTo(Byte value) {
addCriterion("reported <>", value, "reported");
return (Criteria) this;
}
public Criteria andReportedGreaterThan(Byte value) {
addCriterion("reported >", value, "reported");
return (Criteria) this;
}
public Criteria andReportedGreaterThanOrEqualTo(Byte value) {
addCriterion("reported >=", value, "reported");
return (Criteria) this;
}
public Criteria andReportedLessThan(Byte value) {
addCriterion("reported <", value, "reported");
return (Criteria) this;
}
public Criteria andReportedLessThanOrEqualTo(Byte value) {
addCriterion("reported <=", value, "reported");
return (Criteria) this;
}
public Criteria andReportedIn(List<Byte> values) {
addCriterion("reported in", values, "reported");
return (Criteria) this;
}
public Criteria andReportedNotIn(List<Byte> values) {
addCriterion("reported not in", values, "reported");
return (Criteria) this;
}
public Criteria andReportedBetween(Byte value1, Byte value2) {
addCriterion("reported between", value1, value2, "reported");
return (Criteria) this;
}
public Criteria andReportedNotBetween(Byte value1, Byte value2) {
addCriterion("reported not between", value1, value2, "reported");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;

3
src/main/java/com/ccsens/carbasics/bean/vo/PatientVo.java

@ -168,7 +168,8 @@ public class PatientVo {
private Integer times;
@ApiModelProperty("项目ID")
private Long projectId;
@ApiModelProperty("上报情况 0:未上报 1:上报成功")
private Byte reported;
public int getDataStatus() {
if(dataStatus == Constant.DataStatus.FirstAidPass.status && times >= Constant.MAX_UPDATE_NUMBER){
return 100;

30
src/main/java/com/ccsens/carbasics/service/FirstAidService.java

@ -21,11 +21,13 @@ import com.ccsens.carbasics.util.DefaultCodeError;
import com.ccsens.common.bean.dto.CProjectDto;
import com.ccsens.common.bean.vo.CProjectVo;
import com.ccsens.common.service.IProjectService;
import com.ccsens.util.CodeError;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -601,4 +603,32 @@ public class FirstAidService implements IFirstAidService{
detail.setValueType(firstAid.getValueType());
return detail;
}
@Override
public CodeError.Code report(PatientDto.Report param, Long userId) {
FirstAid firstAid = firstAidDao.selectByPrimaryKey(param.getFirstAidId());
log.info("急救:{}", firstAid);
if (firstAid == null) {
return DefaultCodeError.NOT_FIRST_AID_ID;
}
if (firstAid.getReported() != null && firstAid.getReported().byteValue() == param.getReported()) {
return DefaultCodeError.DATA_STATUS_SAME;
}
// 修改上报状态
FirstAid newFirstAid = new FirstAid();
newFirstAid.setId(param.getFirstAidId());
newFirstAid.setReported(param.getReported());
firstAidDao.updateByPrimaryKeySelective(newFirstAid);
// 添加日志
FirstAidLog log = new FirstAidLog();
log.setId(snowflake.nextId());
log.setFirstAidId(param.getFirstAidId());
log.setOperationTime(System.currentTimeMillis());
log.setOperationUserId(userId);
log.setOperationType(Constant.FirstAidLogType.ReportedSuccess.status);
log.setOperationRole((byte)3);
firstAidLogDao.insertSelective(log);
return DefaultCodeError.SUCCESS;
}
}

9
src/main/java/com/ccsens/carbasics/service/IFirstAidService.java

@ -5,6 +5,7 @@ import com.ccsens.carbasics.bean.dto.FirstAidDto;
import com.ccsens.carbasics.bean.dto.PatientDto;
import com.ccsens.carbasics.bean.vo.FirstAidVo;
import com.ccsens.carbasics.bean.vo.PatientVo;
import com.ccsens.util.CodeError;
import com.github.pagehelper.PageInfo;
public interface IFirstAidService {
@ -92,4 +93,12 @@ public interface IFirstAidService {
* @return 病例信息
*/
FirstAidVo.FirstAidBase getDetail(FirstAidDto.Project param, Long userId);
/**
* 修改急救上报状态
* @param param 上报信息
* @param userId 操作者ID
* @return 成功与否
*/
CodeError.Code report(PatientDto.Report param, Long userId);
}

1
src/main/java/com/ccsens/carbasics/util/Constant.java

@ -287,6 +287,7 @@ public class Constant {
ApplyForRefuse((byte) 7,"申请拒绝"),
join((byte) 8,"加入"),
quit((byte) 9,"退出"),
ReportedSuccess((byte)10,"上报成功"),
;
public byte status;
public String message;

2
src/main/resources/mapper_dao/FirstAidDao.xml

@ -74,6 +74,7 @@
`type`,
nation,
idcard,
reported,
data_status AS dataStatus,
project_id as projectId,
updated_at
@ -83,6 +84,7 @@
hospital_id = #{hospitalId}
AND value_type = 0
<if test="param.dataStatus != null"> and data_status = #{param.dataStatus}</if>
<if test="param.reported != null"> and reported = #{param.reported}</if>
<if test="param.name!=null and param.name!=''">
AND `name` LIKE concat('%',#{param.name},'%')
</if>

27
src/main/resources/mapper_raw/FirstAidMapper.xml

@ -15,6 +15,7 @@
<result column="data_status" jdbcType="TINYINT" property="dataStatus" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="hospital_id" jdbcType="BIGINT" property="hospitalId" />
<result column="reported" jdbcType="TINYINT" property="reported" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -80,7 +81,7 @@
</sql>
<sql id="Base_Column_List">
id, name, gender, age, nation, idcard, phone, type, value_type, save_type, data_status,
project_id, hospital_id, operator, created_at, updated_at, rec_status
project_id, hospital_id, reported, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.carbasics.bean.po.FirstAidExample" resultMap="BaseResultMap">
select
@ -117,14 +118,16 @@
age, nation, idcard,
phone, type, value_type,
save_type, data_status, project_id,
hospital_id, operator, created_at,
updated_at, rec_status)
hospital_id, reported, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
#{age,jdbcType=INTEGER}, #{nation,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{valueType,jdbcType=TINYINT},
#{saveType,jdbcType=TINYINT}, #{dataStatus,jdbcType=TINYINT}, #{projectId,jdbcType=BIGINT},
#{hospitalId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{hospitalId,jdbcType=BIGINT}, #{reported,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.carbasics.bean.po.FirstAid">
insert into t_qcp_first_aid
@ -168,6 +171,9 @@
<if test="hospitalId != null">
hospital_id,
</if>
<if test="reported != null">
reported,
</if>
<if test="operator != null">
operator,
</if>
@ -221,6 +227,9 @@
<if test="hospitalId != null">
#{hospitalId,jdbcType=BIGINT},
</if>
<if test="reported != null">
#{reported,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
@ -283,6 +292,9 @@
<if test="record.hospitalId != null">
hospital_id = #{record.hospitalId,jdbcType=BIGINT},
</if>
<if test="record.reported != null">
reported = #{record.reported,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
@ -315,6 +327,7 @@
data_status = #{record.dataStatus,jdbcType=TINYINT},
project_id = #{record.projectId,jdbcType=BIGINT},
hospital_id = #{record.hospitalId,jdbcType=BIGINT},
reported = #{record.reported,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -362,6 +375,9 @@
<if test="hospitalId != null">
hospital_id = #{hospitalId,jdbcType=BIGINT},
</if>
<if test="reported != null">
reported = #{reported,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
@ -391,6 +407,7 @@
data_status = #{dataStatus,jdbcType=TINYINT},
project_id = #{projectId,jdbcType=BIGINT},
hospital_id = #{hospitalId,jdbcType=BIGINT},
reported = #{reported,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

6
src/main/resources/mbg.xml

@ -21,7 +21,7 @@
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://49.233.89.188:3306/carbasics?useUnicode=true&amp;characterEncoding=UTF-8&amp;tinyInt1isBit=false"
connectionURL="jdbc:mysql://121.36.3.207:3306/carbasics?useUnicode=true&amp;characterEncoding=UTF-8&amp;tinyInt1isBit=false"
userId="root"
password="po3OynBO[M3579p6L7)o">
</jdbcConnection>
@ -58,7 +58,7 @@
<!-- <table tableName="t_organization" domainObjectName="Organization"></table>-->
<!-- <table tableName="t_qcp_ocr_keyword" domainObjectName="OcrKeyword"></table>-->
<table tableName="t_qcp_ocr_keyword_option" domainObjectName="OcrKeywordOption"></table>
<!-- <table tableName="t_qcp_ocr_keyword_option" domainObjectName="OcrKeywordOption"></table>-->
<!-- <table tableName="t_organization_department" domainObjectName="OrganizationDepartment"></table>-->
<!-- <table tableName="t_organization_member" domainObjectName="OrganizationMember"></table>-->
<!-- <table tableName="t_organization_parent" domainObjectName="OrganizationParent"></table>-->
@ -67,7 +67,7 @@
<!-- <table tableName="t_organization_template" domainObjectName="OrganizationTemplate"></table>-->
<!-- <table tableName="t_qcp_code_dictionaries" domainObjectName="CodeDictionaries"></table>-->
<!-- <table tableName="t_qcp_code_parent" domainObjectName="CodeParent"></table>-->
<!-- <table tableName="t_qcp_first_aid" domainObjectName="FirstAid"></table>-->
<table tableName="t_qcp_first_aid" domainObjectName="FirstAid"></table>
<!-- <table tableName="t_qcp_first_aid_log" domainObjectName="FirstAidLog"></table>-->
<!-- <table tableName="t_qcp_first_aid_member" domainObjectName="FirstAidMember"></table>-->
<!-- <table tableName="t_qcp_first_aid_record" domainObjectName="FirstAidRecord"></table>-->

Loading…
Cancel
Save