Commit 1a2b37b2cb6d1bcbceb3823921c608538134c428

Authored by jiangjiazhi
1 parent 54b18cfbe5
Exists in master

产检劵相关开发

Showing 7 changed files with 308 additions and 0 deletions

parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/PatientCheckTicketMapper.java View file @ 1a2b37b
  1 +package com.lyms.hospital.dao.woman;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.dao.DataAccessException;
  7 +import org.springframework.data.redis.connection.RedisConnection;
  8 +import org.springframework.data.redis.core.RedisCallback;
  9 +import org.springframework.data.redis.core.RedisTemplate;
  10 +import org.springframework.stereotype.Repository;
  11 +
  12 +/**
  13 + * 产检劵dal
  14 + * <p/>
  15 + * data access layer
  16 + * <p/>
  17 + * 示例代码
  18 + * <pre>
  19 + * </pre>
  20 + *
  21 + * @author JiaZhi.Jiang
  22 + * @version PLATFORM V100R001 2017-3-31
  23 + * @since PLATFORM V100R001C40B104
  24 + */
  25 +@Repository
  26 +public abstract class PatientCheckTicketMapper implements WomanCheckTicketMapper {
  27 +
  28 + @Autowired
  29 + private RedisTemplate<Serializable, Serializable> redisTemplate;
  30 +
  31 + /**
  32 + * 获取该区域内的产检劵号
  33 + *
  34 + * <li>@param areaCode
  35 + * <li>@return
  36 + * <li>创建人:Administrator
  37 + * <li>创建时间:2017-3-31
  38 + * <li>修改人:
  39 + * <li>修改时间:
  40 + */
  41 + public Integer nextPatientTicketId(final String areaCode) {
  42 +
  43 + return redisTemplate.execute(new RedisCallback<Integer>() {
  44 + @Override
  45 + public Integer doInRedis(RedisConnection arg0) throws DataAccessException {
  46 + Serializable obj = redisTemplate.opsForValue().increment(areaCode.getBytes(), 1);
  47 + return (Integer) obj;
  48 + }
  49 + });
  50 + }
  51 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/WomanCheckTicketMapper.java View file @ 1a2b37b
  1 +package com.lyms.hospital.dao.woman;
  2 +
  3 +import com.lyms.hospital.entity.woman.WomanCheckTicket;
  4 +import com.baomidou.mybatisplus.mapper.BaseMapper;
  5 +import org.springframework.stereotype.Repository;
  6 +import java.io.Serializable;
  7 +/**
  8 + * <p>
  9 + * Mapper接口
  10 + * </p>
  11 + *
  12 + * @author jiangjiazhi
  13 + * @since 2017-03-31
  14 + */
  15 +@Repository
  16 +public interface WomanCheckTicketMapper extends BaseMapper<WomanCheckTicket> {
  17 +
  18 + public Integer deleteLogicById(Serializable id);
  19 +
  20 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/WomanCheckTicketMapper.xml View file @ 1a2b37b
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lyms.hospital.dao.woman.WomanCheckTicketMapper">
  4 +
  5 + <!-- 通用查询映射结果 -->
  6 + <resultMap id="BaseResultMap" type="com.lyms.hospital.entity.woman.WomanCheckTicket">
  7 + <id column="ID" property="id" />
  8 + <result column="WOMAN_ID" property="womanId" />
  9 + <result column="HOSPITAL_ID" property="hospitalId" />
  10 + <result column="PID" property="pid" />
  11 + <result column="CONSUME_HOSPITAL_ID" property="consumeHospitalId" />
  12 + <result column="STATUS" property="status" />
  13 + <result column="CREATE_TIME" property="createTime" />
  14 + <result column="CONSUME_TIME" property="consumeTime" />
  15 + </resultMap>
  16 +
  17 + <!-- 通用查询结果列 -->
  18 + <sql id="Base_Column_List">
  19 + ID AS id, WOMAN_ID AS womanId, HOSPITAL_ID AS hospitalId, PID AS pid, CONSUME_HOSPITAL_ID AS consumeHospitalId, STATUS AS status, CREATE_TIME AS createTime, CONSUME_TIME AS consumeTime
  20 + </sql>
  21 +</mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/woman/WomanCheckTicket.java View file @ 1a2b37b
  1 +package com.lyms.hospital.entity.woman;
  2 +
  3 +import com.baomidou.mybatisplus.annotations.TableId;
  4 +import com.baomidou.mybatisplus.annotations.TableField;
  5 +import com.baomidou.mybatisplus.annotations.TableName;
  6 +import java.io.Serializable;
  7 +import java.util.Date;
  8 +
  9 +/**
  10 + * <p>
  11 + * 产检劵记录表
  12 + * </p>
  13 + *
  14 + * @author jiangjiazhi
  15 + * @since 2017-03-31
  16 + */
  17 +@TableName("WOMAN_CHECK_TICKET")
  18 +public class WomanCheckTicket implements Serializable {
  19 +
  20 + private static final long serialVersionUID = 1L;
  21 +
  22 + /**
  23 + *
  24 + */
  25 + @TableId(value="ID")
  26 + private String id;
  27 + /**
  28 + * 建档记录id
  29 + */
  30 + @TableField(value="WOMAN_ID")
  31 + private String womanId;
  32 + /**
  33 + * 发产检劵id
  34 + */
  35 + @TableField(value="HOSPITAL_ID")
  36 + private String hospitalId;
  37 + /**
  38 + * PERSON id
  39 + */
  40 + @TableField(value="PID")
  41 + private String pid;
  42 + /**
  43 + * 消费医院id
  44 + */
  45 + @TableField(value="CONSUME_HOSPITAL_ID")
  46 + private String consumeHospitalId;
  47 + /**
  48 + * // 1:创建未使用, 2:产检使用,3:分娩销毁 4:建档删除 删除
  49 + */
  50 + @TableField(value="STATUS")
  51 + private Integer status;
  52 + /**
  53 + *
  54 + */
  55 + @TableField(value="CREATE_TIME")
  56 + private Date createTime;
  57 + /**
  58 + *
  59 + */
  60 + @TableField(value="CONSUME_TIME")
  61 + private Date consumeTime;
  62 +
  63 +
  64 + public String getId() {
  65 + return id;
  66 + }
  67 +
  68 + public void setId(String id) {
  69 + this.id = id;
  70 + }
  71 +
  72 + public String getWomanId() {
  73 + return womanId;
  74 + }
  75 +
  76 + public void setWomanId(String womanId) {
  77 + this.womanId = womanId;
  78 + }
  79 +
  80 + public String getHospitalId() {
  81 + return hospitalId;
  82 + }
  83 +
  84 + public void setHospitalId(String hospitalId) {
  85 + this.hospitalId = hospitalId;
  86 + }
  87 +
  88 + public String getPid() {
  89 + return pid;
  90 + }
  91 +
  92 + public void setPid(String pid) {
  93 + this.pid = pid;
  94 + }
  95 +
  96 + public String getConsumeHospitalId() {
  97 + return consumeHospitalId;
  98 + }
  99 +
  100 + public void setConsumeHospitalId(String consumeHospitalId) {
  101 + this.consumeHospitalId = consumeHospitalId;
  102 + }
  103 +
  104 + public Integer getStatus() {
  105 + return status;
  106 + }
  107 +
  108 + public void setStatus(Integer status) {
  109 + this.status = status;
  110 + }
  111 +
  112 + public Date getCreateTime() {
  113 + return createTime;
  114 + }
  115 +
  116 + public void setCreateTime(Date createTime) {
  117 + this.createTime = createTime;
  118 + }
  119 +
  120 + public Date getConsumeTime() {
  121 + return consumeTime;
  122 + }
  123 +
  124 + public void setConsumeTime(Date consumeTime) {
  125 + this.consumeTime = consumeTime;
  126 + }
  127 +
  128 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/DiagnoseTypeEnums.java View file @ 1a2b37b
  1 +package com.lyms.hospital.enums;
  2 +
  3 +/**
  4 + * 添加类的一句话简单描述。
  5 + * <p/>
  6 + * 详细描述
  7 + * <p/>
  8 + * 示例代码
  9 + * <pre>
  10 + * </pre>
  11 + *
  12 + * @author JiaZhi.Jiang
  13 + * @version PLATFORM V100R001 2017-3-31
  14 + * @since PLATFORM V100R001C40B104
  15 + */
  16 +
  17 +public enum DiagnoseTypeEnums {
  18 + // 0为初诊,1为复诊
  19 +
  20 + CHUZHEN(0), FUZHEN(1);
  21 +
  22 + private DiagnoseTypeEnums(int type) {
  23 + this.type = type;
  24 + }
  25 +
  26 + private int type;
  27 +
  28 + public int getType() {
  29 + return type;
  30 + }
  31 +
  32 + public static DiagnoseTypeEnums getEnumType(int type) {
  33 + for (DiagnoseTypeEnums e : values()) {
  34 + if (type == e.getType()) {
  35 + return e;
  36 + }
  37 + }
  38 + return null;
  39 + }
  40 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanCheckTicketService.java View file @ 1a2b37b
  1 +package com.lyms.hospital.service.woman;
  2 +
  3 +import com.lyms.hospital.entity.woman.WomanCheckTicket;
  4 +import com.lyms.web.service.BaseService;
  5 +import java.io.Serializable;
  6 +
  7 +/**
  8 + * <p>
  9 + * 服务类
  10 + * </p>
  11 + *
  12 + * @author jiangjiazhi
  13 + * @since 2017-03-31
  14 + */
  15 +public interface WomanCheckTicketService extends BaseService<WomanCheckTicket> {
  16 +
  17 + /**
  18 + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
  19 + * <li>@param id 删除主键id
  20 + * <li>@return 大于0修改成功,否则为失败
  21 + */
  22 + public Integer deleteLogicById(Serializable id);
  23 +
  24 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanCheckTicketServiceImpl.java View file @ 1a2b37b
  1 +package com.lyms.hospital.service.woman.impl;
  2 +
  3 +import com.lyms.hospital.entity.woman.WomanCheckTicket;
  4 +import com.lyms.hospital.dao.woman.WomanCheckTicketMapper;
  5 +import com.lyms.hospital.service.woman.WomanCheckTicketService;
  6 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  7 +import org.springframework.stereotype.Service;
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * <p>
  12 + * 产检劵记录表 服务实现类
  13 + * </p>
  14 + *
  15 + * @author jiangjiazhi
  16 + * @since 2017-03-31
  17 + */
  18 +@Service
  19 +public class WomanCheckTicketServiceImpl extends ServiceImpl<WomanCheckTicketMapper, WomanCheckTicket> implements WomanCheckTicketService {
  20 +
  21 + public Integer deleteLogicById(Serializable id){
  22 + return baseMapper.deleteLogicById(id);
  23 + }
  24 +}