wangfeng пре 6 година
родитељ
комит
cd606ca44c

+ 225 - 0
icss-service/src/main/java/com/diagbot/entity/PrintRecord.java

@@ -0,0 +1,225 @@
+package com.diagbot.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * <p>
+ * 打印记录表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-19
+ */
+@TableName("icss_print_record")
+public class PrintRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 医生id
+     */
+    private Long doctorId;
+
+    /**
+     * 部门id
+     */
+    private Long hospitalDeptId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 就诊号
+     */
+    private String inquiryCode;
+
+    /**
+     * 文本内容
+     */
+    private String content;
+
+    /**
+     * 内容JSON字符串(打印页面展示)
+     */
+    private String dataJson;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Long getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(Long doctorId) {
+        this.doctorId = doctorId;
+    }
+    public Long getHospitalDeptId() {
+        return hospitalDeptId;
+    }
+
+    public void setHospitalDeptId(Long hospitalDeptId) {
+        this.hospitalDeptId = hospitalDeptId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public Long getPatientId() {
+        return patientId;
+    }
+
+    public void setPatientId(Long patientId) {
+        this.patientId = patientId;
+    }
+    public String getInquiryCode() {
+        return inquiryCode;
+    }
+
+    public void setInquiryCode(String inquiryCode) {
+        this.inquiryCode = inquiryCode;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getDataJson() {
+        return dataJson;
+    }
+
+    public void setDataJson(String dataJson) {
+        this.dataJson = dataJson;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "PrintRecord{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", name=" + name +
+        ", doctorId=" + doctorId +
+        ", hospitalDeptId=" + hospitalDeptId +
+        ", hospitalId=" + hospitalId +
+        ", patientId=" + patientId +
+        ", inquiryCode=" + inquiryCode +
+        ", content=" + content +
+        ", dataJson=" + dataJson +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 42 - 0
icss-service/src/main/java/com/diagbot/facade/PrintRecordFacade.java

@@ -0,0 +1,42 @@
+package com.diagbot.facade;
+
+import com.diagbot.util.DateUtil;
+import org.springframework.stereotype.Component;
+
+import com.diagbot.entity.PrintRecord;
+import com.diagbot.service.impl.PrintRecordServiceImpl;
+import com.diagbot.vo.PrintRecordsVO;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 打印记录
+ * @date 2018年11月19日 上午10:04:42
+ */
+@Component
+public class PrintRecordFacade extends PrintRecordServiceImpl{
+
+	/**
+	 * 保存打印记录
+	 * @param printRecordsVO
+	 * @return boolean
+	 */
+	public boolean savePrintRecord(PrintRecordsVO printRecordsVO) {
+		//获取传入的参数值,保存在数据表中
+		PrintRecord printRecord = new PrintRecord();
+		printRecord.setCreator(printRecordsVO.getDoctorId().toString());//创建人id
+		printRecord.setDoctorId(printRecordsVO.getDoctorId());//医生
+		printRecord.setGmtCreate(DateUtil.now());//创建时间
+		printRecord.setName(printRecordsVO.getName());//打印的名称
+		printRecord.setHospitalDeptId(printRecordsVO.getHospitalDeptId());//部门id
+		printRecord.setHospitalId(printRecordsVO.getHospitalId());//医院id
+		printRecord.setInquiryCode(printRecordsVO.getInquiryCode());//就诊号
+		printRecord.setPatientId(printRecordsVO.getPatientId());//患者id
+		printRecord.setContent(printRecordsVO.getContent());//文件展现
+		printRecord.setDataJson(printRecordsVO.getDataJson());//打印数据json
+		boolean res = save(printRecord);
+		return res;
+	}
+
+	
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/mapper/PrintRecordMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.PrintRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 打印记录表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-19
+ */
+public interface PrintRecordMapper extends BaseMapper<PrintRecord> {
+
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/service/PrintRecordService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.PrintRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 打印记录表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-19
+ */
+public interface PrintRecordService extends IService<PrintRecord> {
+
+}

+ 20 - 0
icss-service/src/main/java/com/diagbot/service/impl/PrintRecordServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.PrintRecord;
+import com.diagbot.mapper.PrintRecordMapper;
+import com.diagbot.service.PrintRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 打印记录表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-19
+ */
+@Service
+public class PrintRecordServiceImpl extends ServiceImpl<PrintRecordMapper, PrintRecord> implements PrintRecordService {
+
+}

+ 63 - 0
icss-service/src/main/java/com/diagbot/vo/PrintRecordsVO.java

@@ -0,0 +1,63 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 保存打印记录
+ * @date 2018年11月19日 上午10:25:00
+ */
+@Getter
+@Setter
+public class PrintRecordsVO {
+	/**
+	 * 名称
+	 */
+	@NotBlank(message = "请输打印的名称")
+	private String name;
+	/**
+     * 医生id
+     */
+	@NotNull(message = "请输入医生id")
+    private Long doctorId;
+
+    /**
+     * 医院编码
+     */
+	@NotNull(message = "请输入医院id")
+    private Long hospitalId;
+
+    /**
+     * 患者id
+     */
+	@NotNull(message = "请输入患者id")
+    private Long patientId;
+	/**
+     * 医院部门id
+     */
+	@NotNull(message = "请输入医院部门id")
+	private Long hospitalDeptId;
+    /**
+     * 问诊号
+     */
+	@NotBlank(message = "请输入就诊号")
+    private String inquiryCode;
+
+    /**
+     * 文本内容
+     */
+	@NotBlank(message = "请输入文本内容")
+    private String content;
+
+    /**
+     * 内容JSON字符串(打印页面展示)
+     */
+	@NotBlank(message = "请输入内容JSON字符串")
+    private String dataJson;
+
+}

+ 48 - 0
icss-service/src/main/java/com/diagbot/web/PrintRecordController.java

@@ -0,0 +1,48 @@
+package com.diagbot.web;
+
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PrintRecordFacade;
+import com.diagbot.vo.PrintRecordsVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 打印记录表 前端控制器
+ * @date 2018年11月19日 上午10:03:12
+ */
+@RestController
+@RequestMapping("/printRecord")
+@Api(value = "打印记录API[by:wangfeng]", tags = { "打印记录API" })
+@SuppressWarnings("unchecked")
+public class PrintRecordController {
+	
+	@Autowired
+	PrintRecordFacade printRecordFacade;
+	
+	@ApiOperation(value = "保存打印记录",notes = "保存打印记录")
+    @PostMapping("/savePrintRecords")
+	@SysLogger("savePrintRecords")
+	@Transactional
+    public RespDTO<Boolean> savePrintRecords(@Valid @RequestBody PrintRecordsVO printRecordsVO) {
+
+        boolean res = printRecordFacade.savePrintRecord(printRecordsVO);
+        
+        return RespDTO.onSuc(res);
+    }
+	
+
+}

+ 24 - 0
icss-service/src/main/resources/mapper/PrintRecordMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.PrintRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.PrintRecord">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="name" property="name" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="hospital_dept_id" property="hospitalDeptId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="patient_id" property="patientId" />
+        <result column="inquiry_code" property="inquiryCode" />
+        <result column="content" property="content" />
+        <result column="data_json" property="dataJson" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>