调整项目结构

segment2.0
linrf 2 years ago
parent d19776f9f7
commit 84a7e4060b

@ -0,0 +1,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-docus</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docus-archivefile</artifactId>
<name>Archetype - docus-archivefile</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-api-common</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

@ -0,0 +1,40 @@
package com.docus.server.record;
import com.docus.infrastructure.core.exception.IErrorCode;
public enum RecordExceptionEnum implements IErrorCode {
/**
*
*/
NOT_NULL("1001", "参数不能为空!"),
;
private String msgCode;
private String msg;
/**
* , WX
*/
private String moduleCode = "MR";
RecordExceptionEnum(String msgCode, String msg) {
this.msgCode = msgCode;
this.msg = msg;
}
@Override
public String getCode() {
return moduleCode + this.msgCode;
}
@Override
public String getMessage() {
return msg;
}
}

@ -0,0 +1,5 @@
package com.docus.server.record.controller;
public class Package {
}

@ -0,0 +1,4 @@
package com.docus.server.record.controller.param;
public class Package {
}

@ -0,0 +1,4 @@
package com.docus.server.record.controller.vo;
public class Package {
}

@ -0,0 +1,9 @@
package com.docus.server.archivefile.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.archivefile.pojo.entity.CollectsysDictionary;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AfCollectSysDictionaryMapper extends BaseMapper<CollectsysDictionary> {
}

@ -0,0 +1,31 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfCollectTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* mapper
*
* @author wyb
*/
@Mapper
public interface AfCollectTaskMapper {
/**
*
*
* @param afCollectTask
* @return
*/
int saveTask(@Param("task") AfCollectTask afCollectTask);
/**
*
*
* @param taskId
* @return
*/
AfCollectTask getTaskById(@Param("id") Long taskId);
}

@ -0,0 +1,34 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfJobTime;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* job
* @author wyb
*/
@Mapper
public interface AfJobTimeMapper {
/**
*
* @param jobType
* @return
*/
AfJobTime getAfJobTimeByJobType(@Param("jobType") String jobType);
/**
* job
* @param afJobTime job
* @return
*/
int insert(@Param("afJobTime") AfJobTime afJobTime);
/**
* job
* @param afJobTime job
* @return
*/
int updateById(@Param("afJobTime") AfJobTime afJobTime);
}

@ -0,0 +1,78 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfReportRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*
* @author wyb
*/
@Mapper
public interface AfReportRecordMapper {
/**
*
*
* @param afReportRecord
* @return
*/
int saveRecord(@Param("reportRecord") AfReportRecord afReportRecord);
/**
*
*
* @param serialnum
* @param inpatientNo
* @param admisstimes
* @param sysFlag
* @return
*/
AfReportRecord getRecordBySerialnumAndInpatientNoAndSysFlag(@Param("serialnum") String serialnum, @Param("inpatientNo") String inpatientNo, @Param("admisstimes") Integer admisstimes, @Param("sysFlag") String sysFlag);
/**
*
*
* @param afReportRecord
* @return
*/
int updateRecordByTaskId(@Param("reportRecord") AfReportRecord afReportRecord);
/**
*
*
* @param taskId id
* @return
*/
int updateStateByTaskId(@Param("taskId") Long taskId);
AfReportRecord getReportRecordInfoByTaskId(@Param("taskId") Long taskId);
/**
* idpatientIdid
*
* @param taskIds id
* @return patientIdid
*/
List<Long> getHasPatientIdTaskIdsByTaskIds(@Param("taskIds") List<Long> taskIds);
/**
*
*
* @param page
* @param pageSize
* @return
*/
List<AfReportRecord> getStartStateReportRecord(@Param("page") int page, @Param("pageSize") int pageSize);
/**
* id
*
* @param patientId
* @param taskId id
* @return
*/
int updateReportRecordPatientId(@Param("patientId") String patientId, @Param("taskId") Long taskId);
}

@ -0,0 +1,15 @@
package com.docus.server.archivefile.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.archivefile.pojo.entity.AfViewCollectionLog;
import org.apache.ibatis.annotations.Mapper;
/**
* @author linrf
* @date 2023/6/13 17:05
*/
@Mapper
public interface AfViewCollectionLogMapper extends BaseMapper<AfViewCollectionLog> {
}

@ -0,0 +1,13 @@
package com.docus.server.record.common.pojo.dto;
public enum IdType {
/**
*
*/
JZH,
/**
*
*/
INPATIENT_NO
}

@ -0,0 +1,30 @@
package com.docus.server.record.common.pojo.dto;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.record.RecordExceptionEnum;
/**
*
*/
public class InpatientNo {
private String inpatientNo;
public InpatientNo(String inpatientNo) {
this.inpatientNo = inpatientNo;
this.vaid();
}
public void vaid() {
if (inpatientNo == null) {
throw new BaseException(RecordExceptionEnum.NOT_NULL, "inpatientNo不能为空");
}
}
public static InpatientNo of(String inpatientNo) {
return new InpatientNo(inpatientNo);
}
}

@ -0,0 +1,75 @@
package com.docus.server.archivefile.pojo.dto;
import lombok.Data;
import java.util.Map;
/**
*
*/
@Data
public class ReportDTO {
/**
*
*/
private String inpatientNo;
/**
* /
*/
private String jzh;
/**
*
*/
private Integer admisstimes;
/**
*
*/
private String sysFlag;
/**
*
*/
private String downUrl;
/**
*
*/
private String fileTitle;
/**
* /id
*/
private String serialnum;
/**
* id
*/
private String assortId;
/**
* ( 1:2)
*/
private String fileSource;
/**
* 1:2ftp3
*/
private String filestoragetype;
/**
* id ,
*/
private Long taskId;
/**
*
*/
private String patientId;
/**
* 1:url2:base643:url base644:5base64
*/
private Integer downtype = 1;
/**
*
*/
private Map<String, Object> params;
}

@ -0,0 +1,30 @@
package com.docus.server.archivefile.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ReportDownDTO {
@ApiModelProperty(value = "采集器id")
private String collectorid;
@ApiModelProperty(value = "采集器ip")
private String ip;
@ApiModelProperty(value = "分类id")
private String assortid;
@ApiModelProperty(value = "患者信息")
private ReportDownPatientDTO patient;
@ApiModelProperty(value = "文件信息")
private List<ReportDownScanFileDTO> scanfiles;
@ApiModelProperty(value = "扫描用户代码")
private String scanusercode;
@ApiModelProperty(value = "扫描用户名称")
private String scanusername;
}

@ -0,0 +1,34 @@
package com.docus.server.archivefile.pojo.dto;
import com.docus.server.archivefile.pojo.entity.AfReportRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReportDownPatientDTO {
@ApiModelProperty(value = "记帐号")
private String jzh;
@ApiModelProperty(value = "住院次数,记帐号重复则加这个参数无则Null")
private Integer admisstimes;
@ApiModelProperty(value = "病案主键如有传则使用无则使用jzh")
private String patientid;
@ApiModelProperty(value = "病案号")
private String inpatientno;
@ApiModelProperty(value = "物理存储位置,有则传")
private String storagelocation;
public ReportDownPatientDTO(AfReportRecord reportRecord) {
this.patientid = reportRecord.getPatientId();
this.jzh = reportRecord.getJzh();
this.admisstimes = reportRecord.getAdmissTimes();
this.inpatientno = reportRecord.getInpatientNo();
}
public ReportDownPatientDTO(ReportDTO reportDTO) {
this.patientid = reportDTO.getPatientId();
this.jzh = reportDTO.getJzh();
this.admisstimes = reportDTO.getAdmisstimes();
this.inpatientno = reportDTO.getInpatientNo();
}
}

@ -0,0 +1,51 @@
package com.docus.server.archivefile.pojo.dto;
import com.docus.server.archivefile.pojo.entity.AfReportRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReportDownScanFileDTO {
@ApiModelProperty(value = "任务id(如无效任务id则不更新任务表数据)")
private Long taskid;
@ApiModelProperty(value = "文件标题")
private String filetitle;
@ApiModelProperty(value = "采集类型(文件来源 1:采集器2扫描生产软件)")
private int filesource;
@ApiModelProperty(value = "下载类型(1:服务器本地2ftp服务器3共享文件夹)")
private int filestoragetype;
@ApiModelProperty(value = "文件类型(1:url,2:base64,3:url base64,4:共享文件5本地文件base64)")
private int filetype = 1;
@ApiModelProperty(value = "下载地址")
private String downurl;
// @ApiModelProperty(value = "档案信息")
// private String recordid;
@ApiModelProperty(value = "采集流水号")
private String serialnum;
@ApiModelProperty(value = "排序日期")
private String sortdate;
@ApiModelProperty(value = "是否作废 0否 不作废1是 作废")
private int cancel = 0;
public ReportDownScanFileDTO(AfReportRecord reportRecord) {
this.taskid = reportRecord.getTaskId();
this.filetitle = reportRecord.getFileName();
this.filesource = 1;
this.filestoragetype = 1;
this.filetype = reportRecord.getDownType();
this.downurl = reportRecord.getDownUrl();
this.serialnum = reportRecord.getSerialnum();
}
public ReportDownScanFileDTO(ReportDTO reportDto) {
this.taskid = reportDto.getTaskId();
this.filetitle = reportDto.getFileTitle();
this.filesource = 1;
this.filestoragetype = 1;
this.filetype = reportDto.getDowntype();
this.downurl = reportDto.getDownUrl();
this.serialnum = reportDto.getSerialnum();
}
}

@ -0,0 +1,79 @@
package com.docus.server.archivefile.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-05-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "AfCollectTask对象", description = "病案采集任务")
public class AfCollectTask implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id 主键")
@TableId(value = "id", type = IdType.INPUT)
private Long id;
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "来源 1护理文书2 电子病历3 Pacs检查4心电图5手麻系统6 Lis检验7病案首页8长临医嘱")
private String sysflag;
@ApiModelProperty(value = "开始时间")
private Date startTime;
@ApiModelProperty(value = "结束时间")
private Date endTime;
@ApiModelProperty(value = "任务耗时(毫秒)")
private Long consumingTime;
@ApiModelProperty(value = "-1 等待采集0未开始1:正在采集2采集错误3采集完成")
private String state;
@ApiModelProperty(value = "同步时间")
private Date syncTime;
@ApiModelProperty(value = "最新重新采集时间")
private Date recollectTime;
@ApiModelProperty(value = "最新重新采集人")
private String recollectName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "报告唯一单号")
private String C1;
@ApiModelProperty(value = "c2")
private String C2;
@ApiModelProperty(value = "记账号")
private String C3;
@ApiModelProperty(value = "c4")
private String C4;
@ApiModelProperty(value = "c6")
private String C6;
@ApiModelProperty(value = "c9")
private String C9;
}

@ -0,0 +1,42 @@
package com.docus.server.archivefile.pojo.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-05-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AfJobTime对象", description="")
public class AfJobTime implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "最新刷新时间 格式 yyyy-MM-dd HH:mm:ss")
private String updateTime;
@ApiModelProperty(value = "调度类型。")
private String jobType;
public AfJobTime() {
}
public AfJobTime(Long id, String updateTime, String jobType) {
this.id = id;
this.updateTime = updateTime;
this.jobType = jobType;
}
}

@ -0,0 +1,102 @@
package com.docus.server.archivefile.pojo.entity;
import com.docus.server.archivefile.pojo.dto.ReportDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
*/
@Data
public class AfReportRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* af_collect_task id
*/
private Long taskId;
/**
*
*/
private String inpatientNo;
/**
*
*/
private String jzh;
/**
*
*/
private Integer admissTimes;
/**
* 使 |
*/
private String downUrl;
/**
* 1:url2:base643:url base644:5base64
*/
private Integer downType;
/**
* 0 1
*/
private Integer state;
/**
* id
*/
private String serialnum;
/**
*
*/
private String sysflag;
/**
* id
*/
private String zdAssortId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private String fileName;
/**
*
*/
private String patientId;
public AfReportRecord() {
}
public AfReportRecord(ReportDTO reportDTO) {
this.jzh = reportDTO.getJzh();
this.admissTimes = reportDTO.getAdmisstimes();
this.inpatientNo = reportDTO.getInpatientNo();
this.downUrl = reportDTO.getDownUrl();
this.sysflag = reportDTO.getSysFlag();
this.zdAssortId = reportDTO.getAssortId();
this.serialnum = reportDTO.getSerialnum();
this.fileName = reportDTO.getFileTitle();
this.downType = reportDTO.getDowntype();
}
}

@ -0,0 +1,51 @@
package com.docus.server.archivefile.pojo.entity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zengdl
* @website https://el-admin.vip
* @description /
* @date 2022-03-28
**/
@Data
@TableName("af_view_collection_log")
public class AfViewCollectionLog implements Serializable {
@TableId("id")
@ApiModelProperty(value = "id")
private Long id;
@TableField("jzh")
@ApiModelProperty(value = "记帐号")
private String jzh;
@TableField("sys_code")
@ApiModelProperty(value = "采集器分类")
private String sysCode;
@TableField("file_id")
@ApiModelProperty(value = "文件id")
private String fileId;
@TableField("file_modify_time")
@ApiModelProperty(value = "文件最后修改时间")
private String fileModifyTime;
@TableField("create_time")
@ApiModelProperty(value = "创建时间")
private Date createTime;
public void copy(AfViewCollectionLog source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
}
}

@ -0,0 +1,33 @@
package com.docus.server.archivefile.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author zengdl
* @website https://el-admin.vip
* @description /
* @date 2022-09-02
**/
@Data
@TableName("af_collectsys_dictionary")
public class CollectsysDictionary implements Serializable {
@TableId("id")
@ApiModelProperty(value = "id 雪花算法")
private Long id;
@TableField("sys_code")
@ApiModelProperty(value = "采集来源系统编号")
private String sysCode;
@TableField("sys_name")
@ApiModelProperty(value = "采集来源系统名称")
private String sysName;
}

@ -0,0 +1,7 @@
package com.docus.server.archivefile.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.archivefile.pojo.entity.CollectsysDictionary;
public interface IAfCollectSysDictionary extends IBaseService<CollectsysDictionary> {
}

@ -0,0 +1,11 @@
package com.docus.server.archivefile.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.archivefile.pojo.entity.AfViewCollectionLog;
/**
* @author linrf
* @date 2023/6/13 17:05
*/
public interface IAfViewCollectionLogService extends IBaseService<AfViewCollectionLog> {
}

@ -0,0 +1,11 @@
package com.docus.server.archivefile.service.impl;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.server.archivefile.mapper.AfCollectSysDictionaryMapper;
import com.docus.server.archivefile.pojo.entity.CollectsysDictionary;
import com.docus.server.archivefile.service.IAfCollectSysDictionary;
import org.springframework.stereotype.Service;
@Service
public class AfCollectSysDictionaryImpl extends BaseServiceImpl<AfCollectSysDictionaryMapper, CollectsysDictionary> implements IAfCollectSysDictionary {
}

@ -0,0 +1,17 @@
package com.docus.server.archivefile.service.impl;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.server.archivefile.mapper.AfViewCollectionLogMapper;
import com.docus.server.archivefile.pojo.entity.AfViewCollectionLog;
import com.docus.server.archivefile.service.IAfViewCollectionLogService;
import org.springframework.stereotype.Service;
/**
* @author linrf
* @date 2023/6/13 17:06
*/
@Service
public class AfViewCollectionLogServiceImpl extends BaseServiceImpl<AfViewCollectionLogMapper, AfViewCollectionLog> implements IAfViewCollectionLogService {
}

@ -0,0 +1,17 @@
<?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.docus.server.archivefile.mapper.AfCollectTaskMapper">
<insert id="saveTask">
INSERT INTO `docus_archivefile`.`af_collect_task`(`id`, `patient_id`, `sysflag`,
`state`, `C1`,`C2`, `C3`)
VALUES (#{task.id}, #{task.patientId}, #{task.sysflag}, '0', #{task.C1}, #{task.C2}, #{task.C3});
</insert>
<select id="getTaskById" resultType="com.docus.server.archivefile.pojo.entity.AfCollectTask">
select *
from `docus_archivefile`.`af_collect_task`
where `id` = #{id}
</select>
</mapper>

@ -0,0 +1,22 @@
<?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.docus.server.archivefile.mapper.AfJobTimeMapper">
<insert id="insert">
INSERT INTO `docus_archivefile`.`af_job_time`(`id`, `update_time`, `job_type`)
VALUES (#{afJobTime.id}, #{afJobTime.updateTime}, #{afJobTime.jobType});
</insert>
<update id="updateById">
UPDATE `docus_archivefile`.`af_job_time`
SET `update_time` = #{afJobTime.updateTime},
WHERE `id` = #{afJobTime.id};
</update>
<select id="getAfJobTimeByJobType" resultType="com.docus.server.archivefile.pojo.entity.AfJobTime">
select id, DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%s') as updateTime,job_type as jobType
from `docus_archivefile`.`af_job_time`
where job_type= #{jobType}
</select>
</mapper>

@ -0,0 +1,68 @@
<?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.docus.server.archivefile.mapper.AfReportRecordMapper">
<insert id="saveRecord">
INSERT INTO `docus_archivefile`.`af_report_record`(`task_id`, `inpatient_no`, `jzh`, `admiss_times`, `down_url`,
`down_type`, `state`, `serialnum`, `sysflag`, `zd_assort_id`,
`create_time`, `update_time`, `file_name`, `patient_id`)
VALUES (#{reportRecord.taskId}, #{reportRecord.inpatientNo}, #{reportRecord.jzh}, #{reportRecord.admissTimes},
#{reportRecord.downUrl}, #{reportRecord.downType}, 0, #{reportRecord.serialnum},
#{reportRecord.sysflag}, #{reportRecord.zdAssortId}, now(), now(), #{reportRecord.fileName},
#{reportRecord.patientId});
</insert>
<update id="updateRecordByTaskId">
update `docus_archivefile`.`af_report_record`
set `down_url`=#{reportRecord.downUrl},
`down_type`=#{reportRecord.downType},
`state`=0,
`file_name`=#{reportRecord.fileName},
`patient_id`=#{reportRecord.patientId},
`update_time`=now()
where `task_id` = #{reportRecord.taskId}
</update>
<update id="updateStateByTaskId">
update `docus_archivefile`.`af_report_record`
set `state`= 1,
`update_time`=now()
where `task_id` = #{taskId}
</update>
<update id="updateReportRecordPatientId">
update `docus_archivefile`.`af_report_record`
set `patient_id`= #{patientId}
where `task_id` = #{taskId}
</update>
<select id="getRecordBySerialnumAndInpatientNoAndSysFlag"
resultType="com.docus.server.archivefile.pojo.entity.AfReportRecord">
select *
from `docus_archivefile`.`af_report_record`
where `inpatient_no` = #{inpatientNo}
and `serialnum` = #{serialnum}
and `sysflag` = #{sysFlag}
and admiss_times = #{admisstimes}
</select>
<select id="getReportRecordInfoByTaskId" resultType="com.docus.server.archivefile.pojo.entity.AfReportRecord">
select *
from `docus_archivefile`.`af_report_record`
where `task_id` = #{taskId}
</select>
<select id="getHasPatientIdTaskIdsByTaskIds" resultType="java.lang.Long">
SELECT `task_id`
FROM `docus_archivefile`.`af_report_record`
WHERE `patient_id` IS NOT NULL
AND `patient_id` != ''
AND `task_id` IN
<foreach collection="taskIds" separator="," open="(" close=")" item="taskId">
#{taskId}
</foreach>
</select>
<select id="getStartStateReportRecord" resultType="com.docus.server.archivefile.pojo.entity.AfReportRecord">
SELECT `task_id`, `inpatient_no`, `admiss_times`, `patient_id`
FROM `docus_archivefile`.`af_report_record`
WHERE `state` = 0
LIMIT ${(page-1)*pageSize}
, ${pageSize}
</select>
</mapper>

@ -0,0 +1,37 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-docus</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docus-medical-record</artifactId>
<name>Archetype - docus-medical-record</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-api-common</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

@ -0,0 +1,40 @@
package com.docus.server.record;
import com.docus.infrastructure.core.exception.IErrorCode;
public enum RecordExceptionEnum implements IErrorCode {
/**
*
*/
NOT_NULL("1001", "参数不能为空!"),
;
private String msgCode;
private String msg;
/**
* , WX
*/
private String moduleCode = "MR";
RecordExceptionEnum(String msgCode, String msg) {
this.msgCode = msgCode;
this.msg = msg;
}
@Override
public String getCode() {
return moduleCode + this.msgCode;
}
@Override
public String getMessage() {
return msg;
}
}

@ -0,0 +1,13 @@
package com.docus.server.record.common.pojo.dto;
public enum IdType {
/**
*
*/
JZH,
/**
*
*/
INPATIENT_NO
}

@ -0,0 +1,30 @@
package com.docus.server.record.common.pojo.dto;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.record.RecordExceptionEnum;
/**
*
*/
public class InpatientNo {
private String inpatientNo;
public InpatientNo(String inpatientNo) {
this.inpatientNo = inpatientNo;
this.vaid();
}
public void vaid() {
if (inpatientNo == null) {
throw new BaseException(RecordExceptionEnum.NOT_NULL, "inpatientNo不能为空");
}
}
public static InpatientNo of(String inpatientNo) {
return new InpatientNo(inpatientNo);
}
}

@ -0,0 +1,71 @@
package com.docus.server.record.common.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Map;
/**
* @BelongsProject: docus-webservice-sdry
* @BelongsPackage: com.docus.server.collection.webservice
* @Author: chierhao
* @CreateTime: 2023-02-25 14:44
* @Description: TODO
* @Version: 1.0
*/
@Data
public class TBasicDTO {
// ---------------------- TBasicDTO info ----------------------
@ApiModelProperty(value = "记账号")
private String jzh;
@ApiModelProperty(value = "病案号")
private String inpatientNo;
@ApiModelProperty(value = "住院次数")
private String admissTimes;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "住院日期")
private String admissDate;
@ApiModelProperty(value = "出院日期")
private String disDate;
@ApiModelProperty(value = "住院科室名称")
private String admissDeptName;
@ApiModelProperty(value = "出院科室名称")
private String disDeptName;
@ApiModelProperty(value = "主管医生")
private String attending;
@ApiModelProperty(value = "主管医生名称")
private String attendingName;
@ApiModelProperty(value = "责任护士")
private String dutyNurse;
@ApiModelProperty(value = "住院科室")
private String admissDept;
@ApiModelProperty(value = "年龄_岁")
private String age;
@ApiModelProperty(value = "性别")
private String sex;
@ApiModelProperty(value = "身份证")
private String idCard;
@ApiModelProperty(value = "出院科室")
private String disDept;
@ApiModelProperty(value = "性别名称")
private String sexName;
@ApiModelProperty(value = "床位号")
private String bedNum;
@ApiModelProperty(value = "是否死亡")
private String isDead;
@ApiModelProperty(value = "实际住院天数")
private String admissDays;
// ---------------------- xml info ----------------------
private String serialId;
private String receive;
private String send;
// ---------------------- sdry info ----------------------
private String wardCode;
private String wardName;
private String sdryIndex;
/**
*
*/
private Map<String, Object> params;
}

@ -0,0 +1,117 @@
package com.docus.server.record.common.pojo.entity;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.record.RecordExceptionEnum;
import com.docus.server.record.common.pojo.dto.IdType;
import com.docus.server.record.common.pojo.dto.InpatientNo;
import lombok.Getter;
import java.util.Map;
@Getter
public class MedicalRecord {
/**
*
*/
private InpatientNo inpatientNo;
/**
* /
*/
private String jzh;
/**
*
*/
private Integer admisstimes;
/**
*
*/
private String sysFlag;
/**
*
*/
private String downUrl;
/**
*
*/
private String fileTitle;
/**
* /id
*/
private String serialnum;
/**
* id
*/
private String assortId;
/**
* ( 1:2)
*/
private String fileSource;
/**
*
*/
private String patientId;
private String sourceInfo;
/**
* 1. 2.
*/
private IdType idType;
/**
*
*/
private Map<String, Object> params;
public MedicalRecord(InpatientNo inpatientNo, String jzh, Integer admisstimes,
String sysFlag, String downUrl, String fileTitle, String serialnum,
String assortId, String fileSource,
String patientId, String sourceInfo, IdType idType, Map<String, Object> params) {
this.inpatientNo = inpatientNo;
this.jzh = jzh;
this.admisstimes = admisstimes;
this.sysFlag = sysFlag;
this.downUrl = downUrl;
this.fileTitle = fileTitle;
this.serialnum = serialnum;
this.assortId = assortId;
this.fileSource = fileSource;
this.patientId = patientId;
this.sourceInfo = sourceInfo;
this.idType = idType;
this.params = params;
//需要强校验每个字段是否符合规则,并且限制值范围。
vaid();
}
public void vaid() {
if (idType == IdType.JZH) {
//根据记账号查询,需要判断 是否存在。
if (Func.isEmpty(jzh)) {
throw new BaseException(RecordExceptionEnum.NOT_NULL, "jzh不能为空");
}
} else {
//根据住院号+住院次数
//根据记账号查询,需要判断 是否存在。
if (Func.isEmpty(admisstimes) && Func.isEmpty(inpatientNo)) {
throw new BaseException(RecordExceptionEnum.NOT_NULL, "jzh不能为空");
}
}
}
}

@ -0,0 +1,64 @@
package com.docus.server.record.common.pojo.entity;
public class MedicalRecordEntity {
private Long id;
/**
*
*/
private String inpatientNo;
/**
* /
*/
private String jzh;
/**
*
*/
private Integer admisstimes;
/**
*
*/
private String sysFlag;
/**
*
*/
private String downUrl;
/**
*
*/
private String fileTitle;
/**
* /id
*/
private String serialnum;
/**
* id
*/
private String assortId;
/**
* ( 1:2)
*/
private String fileSource;
/**
*
*/
private String patientId;
/**
* 1. 2.
*/
private String state;
/**
* id
*/
private String taskId;
}

@ -0,0 +1,161 @@
package com.docus.server.record.common.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TBasic对象", description = "病案基本信息")
public class TBasic implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "住院次数")
private Integer admissTimes;
@ApiModelProperty(value = "病案号")
@TableField("inpatientNo")
private String inpatientNo;
@ApiModelProperty(value = "住院ID号")
private String admissId;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "盘号")
private String ph;
@ApiModelProperty(value = "性别")
private String sex;
@ApiModelProperty(value = "年龄_岁")
private Integer age;
@ApiModelProperty(value = "年龄_月")
private Integer ageMonth;
@ApiModelProperty(value = "年龄_天")
private Integer ageDay;
@ApiModelProperty(value = "身份证")
private String idCard;
@ApiModelProperty(value = "手机号码")
private String telphone;
@ApiModelProperty(value = "住院日期")
private Date admissDate;
@ApiModelProperty(value = "住院科室")
private String admissDept;
@ApiModelProperty(value = "住院科室名称")
private String admissDeptName;
@ApiModelProperty(value = "出院日期")
private Date disDate;
@ApiModelProperty(value = "出院科室")
private String disDept;
@ApiModelProperty(value = "出院科室名称")
private String disDeptName;
@ApiModelProperty(value = "实际住院天数")
private Integer admissDays;
@ApiModelProperty(value = "主管医生")
private String attending;
@ApiModelProperty(value = "主管医生名称")
private String attendingName;
@ApiModelProperty(value = "主要诊断编码")
private String mainDiagCode;
@ApiModelProperty(value = "主要诊断名称")
private String mainDiagName;
@ApiModelProperty(value = "主要手术编码")
private String mainOperateCode;
@ApiModelProperty(value = "主要手术名称")
private String mainOperateName;
@ApiModelProperty(value = "是否死亡")
private Integer isDead;
@ApiModelProperty(value = "是否作废(01是)")
private Integer isCancel;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "是否归档 1已归档0未归档")
private Integer isArchive;
@ApiModelProperty(value = "归档时间")
private Date archiveTime;
@ApiModelProperty(value = "文件来源 1:af_archive_detail,2:t_scan_assort")
private Integer fileSource;
@ApiModelProperty(value = "完整性描述")
private String integrityDesc;
private String bColumn1;
private String bColumn2;
private String bColumn3;
private String bColumn4;
private String bColumn5;
private Integer bColumn6;
private Integer bColumn7;
private Integer bColumn8;
private Integer bColumn9;
private Integer bColumn10;
@ApiModelProperty(value = "姓名缩写(内部构成)")
private String nameSpell;
@ApiModelProperty(value = "性别名称")
private String sexName;
@ApiModelProperty(value = "记账号")
private String jzh;
@ApiModelProperty(value = "床位号")
private String bedNum;
@ApiModelProperty(value = "责任护士")
private String dutyNurse;
}

@ -0,0 +1,36 @@
package com.docus.server.record.common.pojo.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @BelongsProject: docus-webservice-sdry
* @BelongsPackage: com.docus.server.collection.entity
* @Author: chierhao
* @CreateTime: 2023-03-07 15:29
* @Description: TODO
* @Version: 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "tBasicExtend对象", description = "病案基本信息扩展")
public class TBasicExtend implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "病区编号")
private String wardCode;
@ApiModelProperty(value = "病区名称")
private String wardName;
@ApiModelProperty(value = "第三方索引")
private String sdryIndex;
}

@ -0,0 +1,5 @@
package com.docus.server.record.controller;
public class Package {
}

@ -0,0 +1,4 @@
package com.docus.server.record.controller.param;
public class Package {
}

@ -0,0 +1,4 @@
package com.docus.server.record.controller.vo;
public class Package {
}

@ -0,0 +1,84 @@
package com.docus.server.record.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.record.common.pojo.entity.TBasic;
import com.docus.server.record.common.pojo.entity.TBasicExtend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
@Mapper
@DS(DSKeyConstants.RECORD_DS_KEY)
public interface TBasicMapper extends BaseMapper<TBasic> {
/**
*
*
* @param inpatientNo
* @param admissTimes
* @return
*/
String getPatientIdByInpatientNoAndAdminssTimes(@Param("inpatientNo") String inpatientNo,
@Param("adminssTimes") Integer admissTimes);
Integer selectOne(@Param("jzh") String jzh);
String getPatientId(@Param("jzh") String jzh);
Integer insertTBasic(@Param("tBasic") TBasic tBasic);
Integer insertExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend);
Integer updateTBasic(@Param("tBasic") TBasic tBasic);
Integer updateExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend);
List<TBasic> selectBasicListByAdmissDate(@Param("admissStartDate") String admissStartDate,
@Param("admissEndDate") String admissEndDate,
@Param("offset") int offset,
@Param("size") int size);
/**
*
*
* @param patientId
* @return
*/
String getSdRyIndexByPatientId(@Param("patientId") String patientId);
List<TBasic> selectBasicListByCreateOrUpdateTime(@Param("startDate") String queryBasicStartDate,
@Param("endDate") String queryBasicEndDate,
@Param("offset") int offset,
@Param("size") int size);
List<TBasic> selectBasicListByPatientIds(@Param("patientIds") List<String> patientIds);
List<Map<String, Object>> getBasicForZYHs(@Param("zyhs") List<String> zyhs);
/**
*
*
* @param param
* @return
*/
List<Map<String, Object>> getBasicOutData(@Param("param") Map<String, Object> param);
/**
*
*
* @param param
* @return
*/
List<Map<String, Object>> getBasicData(@Param("param") Map<String, Object> param);
}

@ -0,0 +1,7 @@
package com.docus.server.record.service;
import com.docus.server.record.common.pojo.entity.MedicalRecord;
public interface IMedicalRecordService {
void receive(MedicalRecord medicalRecord);
}

@ -0,0 +1,60 @@
package com.docus.server.record.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.record.common.pojo.dto.TBasicDTO;
import com.docus.server.record.common.pojo.entity.TBasic;
import java.util.List;
import java.util.Map;
public interface ITBasicService extends IBaseService<TBasic> {
/**
*
*
* @param dto
* @throws Exception
*/
void insertTBasic(TBasicDTO dto);
/**
*
*
* @param dto
* @throws Exception
*/
void updateTBasic(TBasicDTO dto);
/**
*
*
* @param basicDTOList
*/
void batchSaveBasics(List<TBasicDTO> basicDTOList);
/**
*
*
* @param jzh
* @return
*/
Integer findByJzh(String jzh);
/**
*
*
* @param zyhs
* @return
*/
List<Map<String, Object>> getBasicForZYHs(List<String> zyhs);
/**
*
*/
List<Map<String, Object>> getBasicOutData(Map<String, Object> param);
/**
*
*/
List<Map<String, Object>> getBasicData(Map<String, Object> param);
}

@ -0,0 +1,54 @@
package com.docus.server.record.service.impl;
import com.docus.server.record.common.pojo.dto.IdType;
import com.docus.server.record.common.pojo.entity.MedicalRecord;
import com.docus.server.record.service.IMedicalRecordService;
import org.springframework.stereotype.Service;
@Service
public class MedicalRecordServiceImpl implements IMedicalRecordService {
@Override
public void receive(MedicalRecord medicalRecord) {
//判断幂等,不要重复提交。 //判断业务是否正确,
if (isExist(medicalRecord)) {
return;
}
//保存数据内容到数据库。
this.saveMedicalRecord(medicalRecord);
//发起下载任务
}
public void createDownloadTask(MedicalRecord medicalRecord) {
//创建下载任务,改造文件服务,
//确保下载任务成功。
//完成任务,保存对应信息到病案系统。
}
public void saveFileInfo() {
}
public void saveMedicalRecord(MedicalRecord medicalRecord) {
}
public Boolean isExist(MedicalRecord medicalRecord) {
if (medicalRecord.getIdType() == IdType.JZH) {
//根据记账号查询
return true;
} else {
//根据住院号+住院次数
return true;
}
}
}

@ -0,0 +1,242 @@
package com.docus.server.record.service.impl;
import cn.hutool.core.util.NumberUtil;
import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.record.common.pojo.dto.TBasicDTO;
import com.docus.server.record.common.pojo.entity.TBasic;
import com.docus.server.record.common.pojo.entity.TBasicExtend;
import com.docus.server.record.mapper.TBasicMapper;
import com.docus.server.record.service.ITBasicService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class TBasicServiceImpl extends BaseServiceImpl<TBasicMapper, TBasic> implements ITBasicService {
@Resource
private TBasicMapper tBasicMapper;
@Resource
private IdService idService;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertTBasic(TBasicDTO tBasicDTO) {
//判断jzh是否重复
// Integer num = tBasicMapper.selectOne(tBasicDTO.getJzh());
// if (num > 0) {
// updateTBasic(tBasicDTO);
// return;
// }
Long patientId = idService.getDateSeq();
//数据类型转化,格式处理
Date admissDate = null;
if (Func.isNotEmpty(tBasicDTO.getAdmissDate())) {
admissDate = Func.parseDate(tBasicDTO.getAdmissDate(), DateUtil.PATTERN_DATETIME_MINI);
}
Date disDate = null;
if (Func.isNotEmpty(tBasicDTO.getDisDate())) {
disDate = Func.parseDate(tBasicDTO.getDisDate(), DateUtil.PATTERN_DATETIME_MINI);
}
String admissTimesStr = tBasicDTO.getAdmissTimes();
Integer admissTimes = null;
if (NumberUtil.isInteger(admissTimesStr)) {
admissTimes = Integer.parseInt(admissTimesStr);
}
String ageStr = tBasicDTO.getAge();
if (Func.isNotEmpty(ageStr)) {
ageStr = ageStr.substring(0, ageStr.length() - 1);
}
Integer age = null;
if (NumberUtil.isInteger(ageStr)) {
age = Integer.parseInt(ageStr);
}
String sexName = tBasicDTO.getSexName();
if (sexName.length() > 1) {
sexName = sexName.substring(0, 1);
}
String admissDaysStr = tBasicDTO.getAdmissDays();
Integer admissDays = null;
if (NumberUtil.isInteger(admissDaysStr)) {
admissDays = Integer.parseInt(admissDaysStr);
}
String isDeadStr = tBasicDTO.getIsDead();
Integer isDead = 0;
if ("死亡".equals(isDeadStr)) {
isDead = 1;
}
//组装数据
TBasic tBasic = new TBasic();
tBasic.setPatientId(patientId.toString());
tBasic.setJzh(tBasicDTO.getJzh());
tBasic.setInpatientNo(tBasicDTO.getInpatientNo());
tBasic.setAdmissTimes(admissTimes);
tBasic.setName(tBasicDTO.getName());
tBasic.setAdmissDate(admissDate);
tBasic.setDisDate(disDate);
tBasic.setAdmissDeptName(tBasicDTO.getAdmissDeptName());
tBasic.setDisDeptName(tBasicDTO.getDisDeptName());
tBasic.setAttendingName(tBasicDTO.getAttendingName());
tBasic.setAttending(tBasicDTO.getAttending());
tBasic.setDutyNurse(tBasicDTO.getDutyNurse());
tBasic.setAdmissDept(tBasicDTO.getAdmissDept());
tBasic.setCreateTime(DateUtil.now());
tBasic.setAge(age);
tBasic.setSex(tBasicDTO.getSex());
tBasic.setIdCard(tBasicDTO.getIdCard());
tBasic.setDisDept(tBasicDTO.getDisDept());
tBasic.setSexName(sexName);
tBasic.setBedNum(tBasicDTO.getBedNum());
tBasic.setAdmissDays(admissDays);
tBasic.setIsDead(isDead);
TBasicExtend tBasicExtend = new TBasicExtend();
tBasicExtend.setPatientId(patientId.toString());
tBasicExtend.setWardCode(tBasicDTO.getWardCode());
tBasicExtend.setWardName(tBasicDTO.getWardName());
tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex());
//持久化
tBasicMapper.insertTBasic(tBasic);
tBasicMapper.insertExtend(tBasicExtend);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateTBasic(TBasicDTO tBasicDTO) {
//判断jzh是否存在
String patientId = tBasicMapper.getPatientId(tBasicDTO.getJzh());
if (Func.isEmpty(patientId)) {
insertTBasic(tBasicDTO);
return;
}
//数据类型转化,格式处理
Date admissDate = null;
if (Func.isNotEmpty(tBasicDTO.getAdmissDate())) {
admissDate = Func.parseDate(tBasicDTO.getAdmissDate(), DateUtil.PATTERN_DATETIME_MINI);
}
Date disDate = null;
if (Func.isNotEmpty(tBasicDTO.getDisDate())) {
disDate = Func.parseDate(tBasicDTO.getDisDate(), DateUtil.PATTERN_DATETIME_MINI);
}
String admissTimesStr = tBasicDTO.getAdmissTimes();
Integer admissTimes = null;
if (NumberUtil.isInteger(admissTimesStr)) {
admissTimes = Integer.parseInt(admissTimesStr);
}
String ageStr = tBasicDTO.getAge();
if (Func.isNotEmpty(ageStr)) {
ageStr = ageStr.substring(0, ageStr.length() - 1);
}
Integer age = null;
if (NumberUtil.isInteger(ageStr)) {
age = Integer.parseInt(ageStr);
}
String sexName = tBasicDTO.getSexName();
if (sexName.length() > 1) {
sexName = sexName.substring(0, 1);
}
String admissDaysStr = tBasicDTO.getAdmissDays();
Integer admissDays = null;
if (NumberUtil.isInteger(admissDaysStr)) {
admissDays = Integer.parseInt(admissDaysStr);
}
String isDeadStr = tBasicDTO.getIsDead();
Integer isDead = 0;
if ("死亡".equals(isDeadStr)) {
isDead = 1;
}
//组装数据
TBasic tBasic = new TBasic();
tBasic.setJzh(tBasicDTO.getJzh());
tBasic.setPatientId(patientId);
tBasic.setInpatientNo(tBasicDTO.getInpatientNo());
tBasic.setAdmissTimes(admissTimes);
tBasic.setName(tBasicDTO.getName());
tBasic.setAdmissDate(admissDate);
tBasic.setDisDate(disDate);
tBasic.setAdmissDeptName(tBasicDTO.getAdmissDeptName());
tBasic.setDisDeptName(tBasicDTO.getDisDeptName());
tBasic.setAttendingName(tBasicDTO.getAttendingName());
tBasic.setAge(age);
tBasic.setSex(tBasicDTO.getSex());
tBasic.setIdCard(tBasicDTO.getIdCard());
tBasic.setDisDept(tBasicDTO.getDisDept());
tBasic.setSexName(sexName);
tBasic.setBedNum(tBasicDTO.getBedNum());
tBasic.setAdmissDays(admissDays);
tBasic.setIsDead(isDead);
tBasic.setAttending(tBasicDTO.getAttending());
tBasic.setDutyNurse(tBasicDTO.getDutyNurse());
tBasic.setAdmissDept(tBasicDTO.getAdmissDept());
tBasic.setCreateTime(DateUtil.now());
TBasicExtend tBasicExtend = new TBasicExtend();
tBasicExtend.setPatientId(patientId);
tBasicExtend.setWardCode(tBasicDTO.getWardCode());
tBasicExtend.setWardName(tBasicDTO.getWardName());
tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex());
//持久化
tBasicMapper.updateTBasic(tBasic);
tBasicMapper.updateExtend(tBasicExtend);
}
private void convert() {
}
@Transactional(rollbackFor = Exception.class)
@Override
public void batchSaveBasics(List<TBasicDTO> basicDTOList) {
basicDTOList.forEach(this::updateTBasic);
}
@Override
public Integer findByJzh(String jzh) {
//判断jzh是否重复
return tBasicMapper.selectOne(jzh);
}
/**
*
*
* @param zyhs
* @return
*/
@Override
public List<Map<String, Object>> getBasicForZYHs(List<String> zyhs) {
return tBasicMapper.getBasicForZYHs(zyhs);
}
/**
*
*/
@Override
public List<Map<String, Object>> getBasicOutData(Map<String, Object> param) {
return tBasicMapper.getBasicOutData(param);
}
/**
*
*/
@Override
public List<Map<String, Object>> getBasicData(Map<String, Object> param) {
return tBasicMapper.getBasicData(param);
}
}

@ -0,0 +1,242 @@
<?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.docus.server.record.mapper.TBasicMapper">
<select id="getPatientIdByInpatientNoAndAdminssTimes" resultType="java.lang.String">
select `patient_id`
from `docus_medicalrecord`.`t_basic`
where `inpatient_no` = #{inpatientNo}
and `admiss_times` = #{adminssTimes}
</select>
<insert id="insertTBasic">
INSERT INTO `docus_medicalrecord`.`t_basic`
(`admiss_days`,`is_dead`,`sex_name`,`bed_num`,`age`,`sex`,`id_card`,`dis_dept`,`patient_id`, `admiss_times`, `inpatient_no`,`name`, `admiss_date`, `admiss_dept_name`, `dis_date`, `dis_dept_name`,`attending_name`,`jzh`,`create_time`)
VALUES
(#{tBasic.admissDays},#{tBasic.isDead},#{tBasic.sexName},#{tBasic.bedNum},#{tBasic.age},#{tBasic.sex},#{tBasic.idCard},
#{tBasic.disDept},#{tBasic.patientId},#{tBasic.admissTimes},#{tBasic.inpatientNo},
#{tBasic.name},#{tBasic.admissDate},#{tBasic.admissDeptName},#{tBasic.disDate},#{tBasic.disDeptName},
#{tBasic.attendingName},#{tBasic.jzh},now())
</insert>
<insert id="insertExtend">
INSERT INTO `docus_medicalrecord`.`t_basic_extend`
(`patient_id`,`ward_code`,`ward_name`,`sdry_index`)
VALUES
(#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName},#{tBasicExtend.sdryIndex})
</insert>
<update id="updateTBasic">
UPDATE `docus_medicalrecord`.`t_basic`
<set>
<if test="tBasic.admissDays !=null ">
`admiss_days`=#{tBasic.admissDays},
</if>
<if test="tBasic.isDead !=null ">
`is_dead`=#{tBasic.isDead},
</if>
<if test="tBasic.sexName !=null ">
`sex_name`=#{tBasic.sexName},
</if>
<if test="tBasic.bedNum !=null ">
`bed_num`=#{tBasic.bedNum},
</if>
<if test="tBasic.age !=null ">
`age`=#{tBasic.age},
</if>
<if test="tBasic.sex !=null ">
`sex`=#{tBasic.sex},
</if>
<if test="tBasic.idCard !=null ">
`id_card`=#{tBasic.idCard},
</if>
<if test="tBasic.disDept !=null ">
`dis_dept`=#{tBasic.disDept},
</if>
<if test="tBasic.admissTimes !=null ">
`admiss_times`=#{tBasic.admissTimes},
</if>
<if test="tBasic.inpatientNo !=null ">
`inpatient_no`=#{tBasic.inpatientNo},
</if>
<if test="tBasic.name !=null ">
`name`=#{tBasic.name},
</if>
<if test="tBasic.admissDate !=null ">
`admiss_date`=#{tBasic.admissDate},
</if>
<if test="tBasic.admissDeptName !=null ">
`admiss_dept_name`=#{tBasic.admissDeptName},
</if>
<if test="tBasic.disDate !=null ">
`dis_date`=#{tBasic.disDate},
</if>
<if test="tBasic.disDeptName !=null ">
`dis_dept_name`=#{tBasic.disDeptName},
</if>
<if test="tBasic.attendingName !=null ">
`attending_name`=#{tBasic.attendingName},
</if>
`update_time`=now()
</set>
WHERE `patient_id`=#{tBasic.patientId,jdbcType=VARCHAR};
</update>
<update id="updateExtend">
INSERT INTO `docus_medicalrecord`.`t_basic_extend`
(`patient_id`,`ward_code`,`ward_name`,`sdry_index`)
VALUES
(#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName},#{tBasicExtend.sdryIndex})
on DUPLICATE KEY UPDATE
`ward_code`=#{tBasicExtend.wardCode},
`ward_name`=#{tBasicExtend.wardName},
`sdry_index`=#{tBasicExtend.sdryIndex}
</update>
<select id="selectOne" resultType="java.lang.Integer">
select count(patient_id) from `docus_medicalrecord`.`t_basic` where jzh=#{jzh}
</select>
<select id="getPatientId" resultType="java.lang.String">
select patient_id from `docus_medicalrecord`.`t_basic` where jzh=#{jzh}
</select>
<select id="selectBasicListByAdmissDate" resultType="com.docus.server.record.common.pojo.entity.TBasic">
select *
from `docus_medicalrecord`.`t_basic`
where admiss_date between #{admissStartDate} AND #{admissEndDate}
limit #{offset}
, #{size}
</select>
<select id="getSdRyIndexByPatientId" resultType="java.lang.String">
select sdry_index
from `docus_medicalrecord`.`t_basic_extend`
where patient_id=#{patientId}
</select>
<select id="selectBasicListByCreateOrUpdateTime" resultType="com.docus.server.record.common.pojo.entity.TBasic">
select `patient_id`,
`admiss_times`,
`inpatient_no`,
`admiss_id`,
`ph`,
`sex`,
`age`,
`id_card`,
`admiss_date`,
`dis_date`,
`admiss_days`,
`create_time`,
`update_time`,
`file_source`,
`jzh`
from `docus_medicalrecord`.`t_basic`
where (`create_time` between #{startDate} AND #{endDate}
or `update_time` between #{startDate} AND #{endDate})
and `dis_date` > '1801-02-03 00:00:00'
limit #{offset}
, #{size}
</select>
<select id="selectBasicListByPatientIds" resultType="com.docus.server.record.common.pojo.entity.TBasic">
select `patient_id`,
`admiss_times`,
`inpatient_no`,
`admiss_id`,
`ph`,
`sex`,
`age`,
`id_card`,
`admiss_date`,
`dis_date`,
`admiss_days`,
`create_time`,
`update_time`,
`file_source`,
`jzh`
from `docus_medicalrecord`.`t_basic`
where patient_id in
<foreach collection="patientIds" item="patientId" open="(" close=")" separator=",">
#{patientId}
</foreach>
</select>
<select id="getBasicForZYHs" resultType="map">
SELECT
patient_id,
inpatient_no,
DATE_FORMAT( admiss_date, '%Y-%m-%d %H:%i:%s' ) admiss_date,
DATE_FORMAT( dis_date, '%Y-%m-%d %H:%i:%s' ) dis_date,
jzh
FROM
docus_medicalrecord.t_basic
WHERE
1 = 1
<if test="zyhs!= null and zyhs.size()>0">
AND inpatient_no IN
<foreach collection="zyhs" item="zyh" open="(" close=")" separator=",">
#{zyh}
</foreach>
</if>
</select>
<!--查询基础出院数据增量数据-->
<select id="getBasicOutData" resultType="java.util.Map">
SELECT
patient_id patientid,
jzh,
inpatient_no inpatientno,
admiss_times admisstimes,
NAME,
date_format(create_time, '%Y-%m-%d %H:%i:%s') createtime,
date_format(admiss_date, '%Y-%m-%d %H:%i:%s') admissdate,
date_format(dis_date, '%Y-%m-%d %H:%i:%s') disdate,
dis_dept_name disdeptname
FROM
docus_medicalrecord.t_basic
WHERE
1 = 1
AND jzh IS NOT NULL
AND dis_date IS NOT NULL
AND dis_date != '1801-02-03 00:00:00'
AND is_cancel = 0
<if test="param.startTime != null">
AND dis_date <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null">
AND dis_date <![CDATA[ <= ]]> #{param.endTime}
</if>
<if test="param.where != null">
AND #{param.where}
</if>
LIMIT #{param.offset}, #{param.pageSize}
</select>
<!--查询基础创建数据增量数据-->
<select id="getBasicData" resultType="java.util.Map">
SELECT
patient_id patientid,
jzh,
inpatient_no inpatientno,
admiss_times admisstimes,
NAME,
date_format( create_time, '%Y-%m-%d %H:%i:%s' ) createtime,
date_format( admiss_date, '%Y-%m-%d %H:%i:%s' ) admissdate,
date_format( dis_date, '%Y-%m-%d %H:%i:%s' ) disdate,
dis_dept_name disdeptname
FROM
docus_medicalrecord.t_basic
WHERE
1 = 1
AND jzh IS NOT NULL
AND is_cancel =0
<if test="param.startTime != null">
AND dis_date <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null">
AND dis_date <![CDATA[ <= ]]> #{param.endTime}
</if>
<if test="param.where != null">
AND #{param.where}
</if>
LIMIT #{param.offset}, #{param.pageSize}
</select>
</mapper>

@ -0,0 +1,34 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-docus</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docus-sys</artifactId>
<name>Archetype - docus-sys</name>
<url>http://maven.apache.org</url>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-api-common</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,76 @@
package com.docus.server.sys.common.pojo.dto;
import lombok.Data;
import java.util.Map;
/**
* @author Fang Ruichuan
* @date 2022-11-14 19:02
*/
@Data
public class DeptDTO {
// ---------------------- DeptDTO info ----------------------
/**
*
*/
private String deptCode;
/**
*
*/
private String deptName;
/**
* ID
*/
private String authorId;
/**
*
*/
private String authorName;
// ---------------------- xml info ----------------------
/**
* id-
*/
private String messageId;
/**
*
*/
private String message;
/**
*
*/
private String receiver;
/**
* operateTypeC U D
*/
private String operateType;
/**
* xml
*/
private String source;
/**
*
*/
private Map<String, Object> params;
/**
*
*
* @return
*/
public DeptModifyParam transDeptAddParam() {
DeptModifyParam deptModifyParam = new DeptModifyParam();
deptModifyParam.setDeptCode(this.deptCode);
deptModifyParam.setDeptName(this.getDeptName());
deptModifyParam.setAuthorName(this.authorName);
deptModifyParam.setAuthorId(this.authorId);
return deptModifyParam;
}
}

@ -0,0 +1,38 @@
package com.docus.server.sys.common.pojo.dto;
import lombok.Data;
/**
* @author wen yongbin
* @date 202322600:21:00
*/
@Data
public class DeptModifyParam {
/**
* id
*/
private Long deptId;
/**
*
*/
private String deptCode;
/**
*
*/
private String deptName;
/**
*
*/
private String authorName;
/**
* ID
*/
private String authorId;
}

@ -0,0 +1,82 @@
package com.docus.server.sys.common.pojo.dto;
import lombok.Data;
import java.util.Map;
/**
* @author Fang Ruichuan
* @date 2022-11-14 19:02
*/
@Data
public class UserDTO {
// ---------------------- UserDTO info ----------------------
/**
*
*/
private String userName;
/**
*
*/
private String pwd;
/**
*
*/
private String name;
/**
* id(roleId),roleId=0
*/
private String position;
/**
*
*/
private String deptId;
/**
* Id 0
*/
private Long roleId;
/**
*
*/
private String authorName;
/**
* ID
*/
private String authorId;
// ---------------------- xml info ----------------------
/**
* id-
*/
private String messageId;
/**
*
*/
private String receiver;
/**
* operateTypeC U D
*/
private String operateType;
/**
*
*/
private Map<String, Object> params;
/**
*
*
* @return
*/
public UserModifyParam transUserAddParam() {
UserModifyParam userModifyParam = new UserModifyParam();
userModifyParam.setUserName(this.userName);
userModifyParam.setName(this.name);
userModifyParam.setPosition(this.position);
userModifyParam.setRoleId(this.roleId);
userModifyParam.setDeptId(this.deptId);
userModifyParam.setAuthorName(this.authorName);
userModifyParam.setAuthorId(this.authorId);
return userModifyParam;
}
}

@ -0,0 +1,50 @@
package com.docus.server.sys.common.pojo.dto;
import lombok.Data;
/**
* @author Fang Ruichuan
* @date 2022-11-14 19:02
*/
@Data
public class UserModifyParam {
/**
* id
*/
private Long userId;
/**
*
*/
private String name;
/**
*
*/
private String userName;
/**
*
*/
private String deptId;
/**
* id(roleId),roleId=0
*/
private String position;
/**
* Id 0
*/
private Long roleId;
/**
*
*/
private String userPwd;
/**
*
*/
private String authorName;
/**
* ID
*/
private String authorId;
}

@ -0,0 +1,63 @@
package com.docus.server.sys.common.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-15
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "PowerDept对象", description = "科室")
public class PowerDept implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "科室id")
private Long deptId;
@ApiModelProperty(value = "科室代码")
@TableField("dept_code")
private String deptCode;
@ApiModelProperty(value = "科室名称")
private String deptName;
@ApiModelProperty(value = "字典id")
private Integer dictId;
@ApiModelProperty(value = "是否有效")
private Integer effective;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "创建人")
private String creater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "更新人")
private String updater;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "临床科室排序")
private Integer sort;
@ApiModelProperty(value = "0:非临床科室,1:临床科室")
private Integer type;
}

@ -0,0 +1,50 @@
package com.docus.server.sys.common.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "PowerThirdLogin对象", description = "第三方登陆")
public class PowerThirdLogin implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private Long id;
@ApiModelProperty(value = "power_user表id")
private String powerUserId;
@ApiModelProperty(value = "用户")
@TableField("user")
private String user;
@ApiModelProperty(value = "密码")
private String pwd;
@ApiModelProperty(value = "来源")
private Integer source;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}

@ -0,0 +1,88 @@
package com.docus.server.sys.common.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "PowerUser对象", description = "用户表")
public class PowerUser implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "登陆名")
@TableField("user_name")
private String userName;
@ApiModelProperty(value = "用户密码")
private String userPwd;
@ApiModelProperty(value = "性别 0 男 1 女")
private Integer userSex;
@ApiModelProperty(value = "年龄")
private Integer userAge;
@ApiModelProperty(value = "电话")
private String userTel;
@ApiModelProperty(value = "邮箱")
private String userEmail;
@ApiModelProperty(value = "微信信息")
private String wxBank;
@ApiModelProperty(value = "职位")
private String userPosition;
@ApiModelProperty(value = "角色")
private Long roleId;
@ApiModelProperty(value = "部门id")
private String deptId;
@ApiModelProperty(value = "是否有效")
private Integer effective;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "创建人")
private String creater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "更新人")
private String updater;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "登录标志 默认为0为未登录 1登录")
private Integer loginFlag;
@ApiModelProperty(value = "用户名称")
private String name;
@ApiModelProperty(value = "所属科室代码 多个以,分隔")
@TableField(exist = false)
private String deptCode;
@ApiModelProperty(value = "权限科室 拥有对科室查阅权限")
private String powerDept;
@ApiModelProperty(value = "权限 拥有对主管医生查阅权限")
private String powerAttending;
}

@ -0,0 +1,27 @@
package com.docus.server.sys.controller;
import com.docus.infrastructure.util.easyexcel.ExcelUtil;
import com.docus.infrastructure.web.api.CommonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@RestController
public class TestController {
@RequestMapping("upload")
public void upload(MultipartFile multipartFile){
List<Object> objects = ExcelUtil.readExcel(multipartFile, null);
System.out.println(objects);
}
@RequestMapping("test")
public CommonResult test(){
return CommonResult.success("");
}
}

@ -0,0 +1,54 @@
package com.docus.server.sys.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.dto.DeptModifyParam;
import com.docus.server.sys.common.pojo.entity.PowerDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* baseMapper
* </p>
*
* @author wen yongbin
* @since 202322522:28:58
*/
@Mapper
@DS(DSKeyConstants.SYSTEM_DS_KEY)
public interface PowerDeptMapper extends BaseMapper<PowerDept> {
/**
*
*
* @param deptCode
* @return
*/
PowerDept getDeptByDeptCode(@Param("deptCode") String deptCode);
/**
*
*
* @param deptModifyParam
* @return
*/
int updateDept(@Param("dept") DeptModifyParam deptModifyParam);
/**
*
*
* @param deptModifyParam
* @return
*/
int addDept(@Param("dept") DeptModifyParam deptModifyParam);
/**
*
*
* @param deptCode
* @return
*/
int delDeptByDeptCode(@Param("deptCode") String deptCode);
}

@ -0,0 +1,21 @@
package com.docus.server.sys.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.entity.PowerThirdLogin;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2021-04-26
*/
@DS(DSKeyConstants.SYSTEM_DS_KEY)
@Mapper
public interface PowerThirdLoginMapper extends BaseMapper<PowerThirdLogin> {
}

@ -0,0 +1,54 @@
package com.docus.server.sys.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.dto.UserModifyParam;
import com.docus.server.sys.common.pojo.entity.PowerUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* baseMapper
* </p>
*
* @author wen yongbin
* @since 202322522:28:58
*/
@Mapper
@DS(DSKeyConstants.SYSTEM_DS_KEY)
public interface PowerUserMapper extends BaseMapper<PowerUser> {
/**
*
*
* @param userName
* @return
*/
PowerUser getUserByUserName(@Param("userName") String userName);
/**
*
*
* @param userModifyParam
* @return
*/
int updateUser(@Param("user") UserModifyParam userModifyParam);
/**
*
*
* @param userModifyParam
* @return
*/
int addUser(@Param("user") UserModifyParam userModifyParam);
/**
*
*
* @param userName
* @return
*/
int delUserByUserName(@Param("userName") String userName);
}

@ -0,0 +1,33 @@
package com.docus.server.sys.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.entity.PowerDept;
import java.util.List;
public interface IPowerDeptService extends IBaseService<PowerDept> {
/**
*
*
* @param deptDto
* @return
*/
boolean insertOrUpdatePowerDept(DeptDTO deptDto);
/**
*
*
* @param deptCode
* @return
*/
boolean delDeptByDeptCode(String deptCode);
/**
*
*
* @param deptDTOList
*/
void batchInsertOrUpdatePowerDept(List<DeptDTO> deptDTOList);
}

@ -0,0 +1,16 @@
package com.docus.server.sys.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.sys.common.pojo.entity.PowerThirdLogin;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-26
*/
public interface IPowerThirdLoginService extends IBaseService<PowerThirdLogin> {
}

@ -0,0 +1,35 @@
package com.docus.server.sys.service;
import com.docus.infrastructure.core.db.service.IBaseService;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.common.pojo.entity.PowerUser;
import java.util.List;
/**
*
*/
public interface IPowerUserService extends IBaseService<PowerUser> {
/**
*
*
* @param userDTO
* @return
*/
boolean insertOrUpdatePowerUser(UserDTO userDTO);
/**
*
*
* @param userName
* @return
*/
boolean delUserByUserName(String userName);
/**
*
*
* @param users
*/
void batchInsertOrUpdatePowerUser(List<UserDTO> users);
}

@ -0,0 +1,59 @@
package com.docus.server.sys.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.dto.DeptModifyParam;
import com.docus.server.sys.common.pojo.entity.PowerDept;
import com.docus.server.sys.mapper.PowerDeptMapper;
import com.docus.server.sys.service.IPowerDeptService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
*
*
* @author wyb
*/
@Service
public class PowerDeptServiceImpl extends BaseServiceImpl<PowerDeptMapper, PowerDept> implements IPowerDeptService {
@Resource
private IdService idService;
@Transactional
@Override
public void batchInsertOrUpdatePowerDept(List<DeptDTO> deptDTOList) {
deptDTOList.forEach(this::insertOrUpdatePowerDept);
}
@Transactional
@Override
public boolean insertOrUpdatePowerDept(DeptDTO deptDTO) {
PowerDept powerDept = baseMapper.getDeptByDeptCode(deptDTO.getDeptCode());
DeptModifyParam deptModifyParam = deptDTO.transDeptAddParam();
if (Func.isEmpty(powerDept)) {
long deptId = idService.getDateSeq();
deptModifyParam.setDeptId(deptId);
baseMapper.addDept(deptModifyParam);
return true;
}
deptModifyParam.setDeptId(powerDept.getDeptId());
baseMapper.updateDept(deptModifyParam);
return true;
}
@Transactional
@Override
public boolean delDeptByDeptCode(String deptCode) {
PowerDept powerDept = baseMapper.getDeptByDeptCode(deptCode);
if (Func.isEmpty(powerDept)) {
return true;
}
baseMapper.delDeptByDeptCode(deptCode);
return true;
}
}

@ -0,0 +1,22 @@
package com.docus.server.sys.service.impl;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.server.sys.common.pojo.entity.PowerThirdLogin;
import com.docus.server.sys.mapper.PowerThirdLoginMapper;
import com.docus.server.sys.service.IPowerThirdLoginService;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-26
*/
@Service
public class PowerThirdLoginServiceImpl extends BaseServiceImpl<PowerThirdLoginMapper, PowerThirdLogin> implements IPowerThirdLoginService {
}

@ -0,0 +1,65 @@
package com.docus.server.sys.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.db.service.impl.BaseServiceImpl;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.common.config.UserProperties;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.common.pojo.dto.UserModifyParam;
import com.docus.server.sys.common.pojo.entity.PowerUser;
import com.docus.server.sys.mapper.PowerUserMapper;
import com.docus.server.sys.service.IPowerUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
*
*
* @author wyb
*/
@Service
public class PowerUserServiceImpl extends BaseServiceImpl<PowerUserMapper, PowerUser> implements IPowerUserService {
@Resource
private IdService idService;
@Resource
private UserProperties userProperties;
@Transactional
@Override
public void batchInsertOrUpdatePowerUser(List<UserDTO> userDTOList) {
userDTOList.forEach(this::insertOrUpdatePowerUser);
}
@Transactional
@Override
public boolean insertOrUpdatePowerUser(UserDTO userDTO) {
PowerUser powerUser = baseMapper.getUserByUserName(userDTO.getUserName());
UserModifyParam userModifyParam = userDTO.transUserAddParam();
if (Func.isEmpty(powerUser)) {
long userId = idService.getDateSeq();
userModifyParam.setUserId(userId);
userModifyParam.setUserPwd(userProperties.getPassword());
baseMapper.addUser(userModifyParam);
return true;
}
userModifyParam.setUserId(powerUser.getUserId());
baseMapper.updateUser(userModifyParam);
return true;
}
@Transactional
@Override
public boolean delUserByUserName(String userName) {
PowerUser powerUser = baseMapper.getUserByUserName(userName);
if (Func.isEmpty(powerUser)) {
return true;
}
baseMapper.delUserByUserName(userName);
return true;
}
}

@ -0,0 +1,31 @@
<?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.docus.server.sys.mapper.PowerDeptMapper">
<insert id="addDept">
INSERT INTO `docus_system`.`power_dept`(`dept_id`,
`dept_code`,
`dept_name`,
`create_date`,
`creater`,
`update_date`,
`updater`)
VALUES (#{dept.deptId},#{dept.deptCode},#{dept.deptName},now(),#{dept.authorName},now(),#{dept.authorName})
</insert>
<update id="updateDept">
update `docus_system`.`power_dept` set
`dept_name`=#{dept.deptName},
`updater`=#{dept.authorName},
`update_date`=now()
where `dept_code`=#{dept.deptCode}
</update>
<delete id="delDeptByDeptCode">
delete from `docus_system`.`power_dept` where `dept_code` = #{deptCode}
</delete>
<select id="getDeptByDeptCode" resultType="com.docus.server.sys.common.pojo.entity.PowerDept">
SELECT `dept_id`,`dept_code`,`dept_name` FROM `docus_system`.`power_dept`
WHERE `dept_code` = #{deptCode} LIMIT 1
</select>
</mapper>

@ -0,0 +1,38 @@
<?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.docus.server.sys.mapper.PowerUserMapper">
<insert id="addUser">
INSERT INTO `docus_system`.`power_user`(`user_id`,
`user_name`,
`name`,
`user_pwd`,
`user_position`,
`role_id`,
`dept_id`,
`create_date`,
`creater`,
`update_date`,
`updater`)
VALUES (#{user.userId},#{user.userName},#{user.name},#{user.userPwd},#{user.position},#{user.roleId}
,#{user.deptId},now(),#{user.authorName},now(),#{user.authorName})
</insert>
<update id="updateUser">
update `docus_system`.`power_user` set
`updater`=#{user.authorName},
`dept_id`=#{user.deptId},
`user_position`=#{user.position},
`name`=#{user.name},
`update_date`=now()
where `user_id`=#{user.userId}
</update>
<delete id="delUserByUserName">
delete from `docus_system`.`power_user` where `user_name` = #{userName}
</delete>
<select id="getUserByUserName" resultType="com.docus.server.sys.common.pojo.entity.PowerUser">
SELECT `user_id`,`user_name`,`user_pwd` FROM `docus_system`.`power_user`
WHERE `user_name` = #{userName} LIMIT 1
</select>
</mapper>

@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>docus-collector-server</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-docus</artifactId>
<packaging>pom</packaging>
<modules>
<module>docus-sys</module>
<module>docus-medical-record</module>
<module>docus-archivefile</module>
</modules>
</project>

@ -0,0 +1,54 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-sysem</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bl-sysem</artifactId>
<name>Archetype - bl-sysem</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/mapper</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<outputDirectory>../../collect-sdry/target/collect-sdry/mybatis.mapper/bl-mapper</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/*.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,13 @@
package com.docus.server.bl.common.annotation;
import org.springframework.stereotype.Component;
import java.lang.annotation.*;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface CacheLayer {
String value() default "";
}

@ -0,0 +1,4 @@
package com.docus.server.bl.infrastructure.cache;
public class DeptCacheLayer {
}

@ -0,0 +1,4 @@
package com.docus.server.bl.infrastructure.client;
public class DownLoadAPI {
}

@ -0,0 +1,29 @@
package com.docus.server.bl.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Mapper
@DS(DSKeyConstants.BL_DS_KEY)
public interface BlDeptMapper {
List<Map<String, Object>> page(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
List<Map<String, Object>> BatchForJZH(@Param("jzhs") List<String> jzhs);
List<Map<String, Object>> BatchForJZHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForZYHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForEXAMTIME(@Param("datas") List<Map<String, Object>> datas);
}

@ -0,0 +1,22 @@
package com.docus.server.bl.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.record.common.pojo.dto.TBasicDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.BL_DS_KEY)
public interface BlTBasicMapper {
List<TBasicDTO> getTBasicListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,22 @@
package com.docus.server.bl.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.BL_DS_KEY)
public interface BlUserMapper {
List<UserDTO> getUserListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,6 @@
package com.docus.server.bl.service;
import com.docus.server.api.IHospitalApi;
public interface IBlService extends IHospitalApi {
}

@ -0,0 +1,44 @@
package com.docus.server.bl.service.impl;
import com.docus.server.bl.infrastructure.mapper.BlDeptMapper;
import com.docus.server.bl.service.IBlService;
import com.docus.server.constants.DSKeyConstants;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component(DSKeyConstants.BL_DS_KEY + "ServiceImpl")
@AllArgsConstructor
public class BlServiceImpl implements IBlService {
private final BlDeptMapper blDeptMapper;
@Override
public List<Map<String, Object>> page(Date startDate, Date endDate, int pageNum, int pageSize) {
return blDeptMapper.page(startDate, endDate, (pageNum - 1) * pageSize, pageSize);
}
@Override
public List<Map<String, Object>> BatchForJZH(List<String> jzhs) {
return blDeptMapper.BatchForJZH(jzhs);
}
@Override
public List<Map<String, Object>> BatchForJZHAndAdmissTimes(List<Map<String, Object>> datas) {
return blDeptMapper.BatchForJZHAndAdmissTimes(datas);
}
@Override
public List<Map<String, Object>> BatchForZYHAndAdmissTimes(List<Map<String, Object>> datas) {
return blDeptMapper.BatchForZYHAndAdmissTimes(datas);
}
@Override
public List<Map<String, Object>> BatchForEXAMTIME(List<Map<String, Object>> datas) {
return blDeptMapper.BatchForEXAMTIME(datas);
}
}

@ -0,0 +1,180 @@
<?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.docus.server.bl.infrastructure.mapper.BlDeptMapper">
<!--根据更新时间分页查询-->
<select id="page" resultType="java.util.Map">
SELECT DISTINCT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
AND AFFIRM_TIME <![CDATA[ > ]]> #{startDate}
AND AFFIRM_TIME <![CDATA[ <= ]]> #{endDate}
ORDER BY
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') DESC
LIMIT #{offset}, #{pageSize}
</select>
<!--根据jzh取得所需采集的批量数据-->
<select id="BatchForJZH" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
AND JZH IN
<foreach item="item" index="index" collection="jzhs" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!--记账号+住院次数-->
<select id="BatchForJZHAndAdmissTimes" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(JZH =#{item.FVISIT_ID} and ADMISS_TIMES=#{item.ADMISS_TIMES}) or
</foreach>
)
</select>
<select id="BatchForZYHAndAdmissTimes" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(ZYH =#{item.ZYH} and ADMISS_TIMES=#{item.ADMISS_TIMES}) or
</foreach>
)
</select>
<select id="BatchForEXAMTIME" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(ZYH =#{item.ZYH} and EXAM_TIME <![CDATA[ >= ]]> STR_TO_DATE(#{item.admiss_date})
<if test="item.dis_date != null">
and EXAM_TIME <![CDATA[ <= ]]> STR_TO_DATE(#{item.dis_date})
</if>
</foreach>
)
</select>
<!-- mysql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,49 @@
<?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.docus.server.bl.infrastructure.mapper.BlTBasicMapper">
<select id="getTBasicListView" resultType="com.docus.server.record.common.pojo.dto.TBasicDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_basic`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT #{offset}, #{pageSize}
</select>
<!-- mysql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,49 @@
<?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.docus.server.bl.infrastructure.mapper.BlUserMapper">
<select id="getUserListView" resultType="com.docus.server.sys.common.pojo.dto.UserDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_user`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT #{offset}, #{pageSize}
</select>
<!-- mysql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="list" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,53 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-sysem</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ecg-sysem</artifactId>
<name>Archetype - ecg-sysem</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/mapper</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<outputDirectory>../../collect-sdry/target/collect-sdry/mybatis.mapper/ecg-mapper</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/*.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,13 @@
package com.docus.server.ecg.common.annotation;
import org.springframework.stereotype.Component;
import java.lang.annotation.*;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface CacheLayer {
String value() default "";
}

@ -0,0 +1,5 @@
package com.docus.server.ecg.infrastructure.cache;
public class DeptCacheLayer {
}

@ -0,0 +1,4 @@
package com.docus.server.ecg.infrastructure.client;
public class DownLoadAPI {
}

@ -0,0 +1,30 @@
package com.docus.server.ecg.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Mapper
@DS(DSKeyConstants.ECG_DS_KEY)
public interface EcgDeptMapper {
List<Map<String, Object>> page(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
List<Map<String, Object>> BatchForJZH(@Param("jzhs") List<String> jzhs);
List<Map<String, Object>> BatchForJZHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForZYHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForEXAMTIME(@Param("datas") List<Map<String, Object>> datas);
}

@ -0,0 +1,22 @@
package com.docus.server.ecg.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.record.common.pojo.dto.TBasicDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.ECG_DS_KEY)
public interface EcgTBasicMapper {
List<TBasicDTO> getTBasicListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,22 @@
package com.docus.server.ecg.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.ECG_DS_KEY)
public interface EcgUserMapper {
List<UserDTO> getUserListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,6 @@
package com.docus.server.ecg.service;
import com.docus.server.api.IHospitalApi;
public interface IEcgService extends IHospitalApi {
}

@ -0,0 +1,45 @@
package com.docus.server.ecg.service.impl;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.ecg.infrastructure.mapper.EcgDeptMapper;
import com.docus.server.ecg.service.IEcgService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component(DSKeyConstants.ECG_DS_KEY + "ServiceImpl")
@AllArgsConstructor
public class EcgServiceImpl implements IEcgService {
private final EcgDeptMapper ecgDeptMapper;
@Override
public List<Map<String, Object>> page(Date startDate, Date endDate, int pageNum, int pageSize) {
return ecgDeptMapper.page(startDate, endDate, (pageNum - 1) * pageSize, pageSize);
}
@Override
public List<Map<String, Object>> BatchForJZH(List<String> jzhs) {
return ecgDeptMapper.BatchForJZH(jzhs);
}
@Override
public List<Map<String, Object>> BatchForJZHAndAdmissTimes(List<Map<String, Object>> datas) {
return ecgDeptMapper.BatchForJZHAndAdmissTimes(datas);
}
@Override
public List<Map<String, Object>> BatchForZYHAndAdmissTimes(List<Map<String, Object>> datas) {
return ecgDeptMapper.BatchForZYHAndAdmissTimes(datas);
}
@Override
public List<Map<String, Object>> BatchForEXAMTIME(List<Map<String, Object>> datas) {
return ecgDeptMapper.BatchForEXAMTIME(datas);
}
}

@ -0,0 +1,179 @@
<?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.docus.server.ecg.infrastructure.mapper.EcgDeptMapper">
<!--根据更新时间分页查询-->
<select id="page" resultType="java.util.Map">
SELECT DISTINCT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
AND AFFIRM_TIME <![CDATA[ > ]]> #{startDate}
AND AFFIRM_TIME <![CDATA[ <= ]]> #{endDate}
ORDER BY
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') DESC
LIMIT #{offset}, #{pageSize}
</select>
<!--根据jzh取得所需采集的批量数据-->
<select id="BatchForJZH" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
AND JZH IN
<foreach item="item" index="index" collection="jzhs" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!--记账号+住院次数-->
<select id="BatchForJZHAndAdmissTimes" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(JZH =#{item.FVISIT_ID} and ADMISS_TIMES=#{item.ADMISS_TIMES}) or
</foreach>
)
</select>
<select id="BatchForZYHAndAdmissTimes" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(ZYH =#{item.ZYH} and ADMISS_TIMES=#{item.ADMISS_TIMES}) or
</foreach>
)
</select>
<select id="BatchForEXAMTIME" resultType="java.util.Map">
SELECT
'6' AS SYS_CODE,
ZYH AS ZYH,
JZH AS FVISIT_ID,
FILE_NAME AS REPORT_NAME,
'' AS BGLX,
'1503577916225949698' AS ASSORTID,
EXAM_NO AS RP_EXAM_NO,
1 AS PATH_TYPE,
FILE_PATHFILE_PATH AS FILE_PATH,
0 AS ISDELETE,
0 AS state,
'' AS jch,
'' AS checktime,
date_format(AFFIRM_TIME, '%Y-%m-%d %H:%i:%s') AS MODIFYTIME
FROM
V_JSWZH_LISRECORD
WHERE
1 = 1
and (
<foreach item="item" index="index" collection="datas" open="(" separator="," close=")">
(ZYH =#{item.ZYH} and EXAM_TIME <![CDATA[ >= ]]> STR_TO_DATE(#{item.admiss_date})
<if test="item.dis_date != null">
and EXAM_TIME <![CDATA[ <= ]]> STR_TO_DATE(#{item.dis_date})
</if>
</foreach>
)
</select>
<!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,49 @@
<?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.docus.server.ecg.infrastructure.mapper.EcgTBasicMapper">
<select id="getTBasicListView" resultType="com.docus.server.record.common.pojo.dto.TBasicDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_basic`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT #{offset}, #{pageSize}
</select>
<!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,49 @@
<?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.docus.server.ecg.infrastructure.mapper.EcgUserMapper">
<select id="getUserListView" resultType="com.docus.server.sys.common.pojo.dto.UserDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_user`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT #{offset}, #{pageSize}
</select>
<!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -0,0 +1,53 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>common-sysem</artifactId>
<groupId>com.docus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>emr-sysem</artifactId>
<name>Archetype - emr-sysem</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/mapper</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<outputDirectory>../../collect-sdry/target/collect-sdry/mybatis.mapper/emr-mapper</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/*.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,10 @@
package com.docus.server.emr.common;
/**
* @author linrf
* @date 2023/6/9 11:19
*/
public class DSKey {
}

@ -0,0 +1,13 @@
package com.docus.server.emr.common.annotation;
import org.springframework.stereotype.Component;
import java.lang.annotation.*;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface CacheLayer {
String value() default "";
}

@ -0,0 +1,5 @@
package com.docus.server.emr.infrastructure.cache;
public class DeptCacheLayer {
}

@ -0,0 +1,4 @@
package com.docus.server.emr.infrastructure.client;
public class DownLoadAPI {
}

@ -0,0 +1,30 @@
package com.docus.server.emr.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Mapper
@DS(DSKeyConstants.EMR_DS_KEY)
public interface EmrDeptMapper {
List<Map<String, Object>> page(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
List<Map<String, Object>> BatchForJZH(@Param("jzhs") List<String> jzhs);
List<Map<String, Object>> BatchForJZHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForZYHAndAdmissTimes(@Param("datas") List<Map<String, Object>> datas);
List<Map<String, Object>> BatchForEXAMTIME(@Param("datas") List<Map<String, Object>> datas);
}

@ -0,0 +1,22 @@
package com.docus.server.emr.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.record.common.pojo.dto.TBasicDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.EMR_DS_KEY)
public interface EmrTBasicMapper {
List<TBasicDTO> getTBasicListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,22 @@
package com.docus.server.emr.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.constants.DSKeyConstants;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS(DSKeyConstants.EMR_DS_KEY)
public interface EmrUserMapper {
List<UserDTO> getUserListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") int offset,
@Param("pageSize") int pageSize);
}

@ -0,0 +1,6 @@
package com.docus.server.emr.service;
import com.docus.server.api.IHospitalApi;
public interface IEmrService extends IHospitalApi {
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save