From 895f428de9f42416a2762e0748fe79fec525ad6f Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Fri, 10 Mar 2023 10:23:06 +0800 Subject: [PATCH] project init --- pom.xml | 11 + .../com/docus/server/AppRunBootstrap.java | 6 +- .../collection/config/UserSyncConfig.java | 16 + .../docus/server/collection/dto/DeptDto.java | 61 ++ .../collection/dto/DeptModifyParam.java | 38 + .../server/collection/dto/TBasicDto.java | 37 + .../docus/server/collection/dto/UserDto.java | 74 ++ .../collection/dto/UserModifyParam.java | 50 + .../server/collection/entity/PowerDept.java | 61 ++ .../server/collection/entity/PowerUser.java | 85 ++ .../server/collection/entity/TBasic.java | 159 ++++ .../collection/entity/TBasicExtend.java | 33 + .../collection/mapper/PowerDeptMapper.java | 44 + .../collection/mapper/PowerUserMapper.java | 44 + .../collection/mapper/TBasicMapper.java | 24 + .../collection/receiver/MzZyMqReceiver.java | 62 ++ .../collection/service/IPowerDeptService.java | 24 + .../collection/service/IPowerUserService.java | 24 + .../collection/service/ITBasicService.java | 8 + .../service/impl/PowerDeptServiceImpl.java | 50 + .../service/impl/PowerUserServiceImpl.java | 54 ++ .../service/impl/TBasicServiceImpl.java | 107 +++ .../docus/server/collection/util/IdUtil.java | 19 + .../docus/server/collection/util/Result.java | 98 ++ .../docus/server/collection/util/XmlUtil.java | 853 ++++++++++++++++++ src/main/resources/bootstrap.yml | 5 +- src/main/resources/mapper/PowerDeptMapper.xml | 31 + src/main/resources/mapper/PowerUserMapper.xml | 38 + src/main/resources/mapper/TBasicMapper.xml | 23 + 29 files changed, 2136 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/docus/server/collection/config/UserSyncConfig.java create mode 100644 src/main/java/com/docus/server/collection/dto/DeptDto.java create mode 100644 src/main/java/com/docus/server/collection/dto/DeptModifyParam.java create mode 100644 src/main/java/com/docus/server/collection/dto/TBasicDto.java create mode 100644 src/main/java/com/docus/server/collection/dto/UserDto.java create mode 100644 src/main/java/com/docus/server/collection/dto/UserModifyParam.java create mode 100644 src/main/java/com/docus/server/collection/entity/PowerDept.java create mode 100644 src/main/java/com/docus/server/collection/entity/PowerUser.java create mode 100644 src/main/java/com/docus/server/collection/entity/TBasic.java create mode 100644 src/main/java/com/docus/server/collection/entity/TBasicExtend.java create mode 100644 src/main/java/com/docus/server/collection/mapper/PowerDeptMapper.java create mode 100644 src/main/java/com/docus/server/collection/mapper/PowerUserMapper.java create mode 100644 src/main/java/com/docus/server/collection/mapper/TBasicMapper.java create mode 100644 src/main/java/com/docus/server/collection/receiver/MzZyMqReceiver.java create mode 100644 src/main/java/com/docus/server/collection/service/IPowerDeptService.java create mode 100644 src/main/java/com/docus/server/collection/service/IPowerUserService.java create mode 100644 src/main/java/com/docus/server/collection/service/ITBasicService.java create mode 100644 src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java create mode 100644 src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java create mode 100644 src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java create mode 100644 src/main/java/com/docus/server/collection/util/IdUtil.java create mode 100644 src/main/java/com/docus/server/collection/util/Result.java create mode 100644 src/main/java/com/docus/server/collection/util/XmlUtil.java create mode 100644 src/main/resources/mapper/PowerDeptMapper.xml create mode 100644 src/main/resources/mapper/PowerUserMapper.xml create mode 100644 src/main/resources/mapper/TBasicMapper.xml diff --git a/pom.xml b/pom.xml index 05d72be..aa5f485 100644 --- a/pom.xml +++ b/pom.xml @@ -164,6 +164,17 @@ docus-http-starter 1.0-SNAPSHOT + + com.neusoft.nhip + ibmmq-jms-spring-boot-starter + 0.0.3-SNAPSHOT + + + + org.springframework + spring-jms + + diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java index 225ee49..f29c327 100644 --- a/src/main/java/com/docus/server/AppRunBootstrap.java +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -3,14 +3,16 @@ package com.docus.server; import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.jms.annotation.EnableJms; @Slf4j -//@EnableFeignClients(basePackages = ("com.feign")) -//@EnableHystrix @SpringBootApplication(scanBasePackages ={"com.docus"}) +@EnableJms +@MapperScan("com.docus.server.**.mapper") public class AppRunBootstrap { public static void main(String[] args) { System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); diff --git a/src/main/java/com/docus/server/collection/config/UserSyncConfig.java b/src/main/java/com/docus/server/collection/config/UserSyncConfig.java new file mode 100644 index 0000000..a839af9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/config/UserSyncConfig.java @@ -0,0 +1,16 @@ +package com.docus.server.collection.config; + +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * 用户同步配置 + * @author wyb + */ +@Data +@Component +public class UserSyncConfig { + @Value("${docus.user.defpwd:}") + private String password; +} diff --git a/src/main/java/com/docus/server/collection/dto/DeptDto.java b/src/main/java/com/docus/server/collection/dto/DeptDto.java new file mode 100644 index 0000000..74375cc --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/DeptDto.java @@ -0,0 +1,61 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class DeptDto { + /** + * id-消息流水号 返回消息体需要 + */ + private String messageId; + /** + * 接收方 + */ + private String receiver; + + /** + * 用户操作 operateType有三种值:C 代表新增、U 代表修改、D 代表删除 + */ + private String operateType; + + /** + * 科室代码 + */ + private String deptCode; + + /** + * 科室名称 + */ + private String deptName; + + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; + + + /** + * 转换用户修改对象 + * + * @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; + } +} diff --git a/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java b/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java new file mode 100644 index 0000000..268ccb9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/DeptModifyParam.java @@ -0,0 +1,38 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author wen yongbin + * @date 2023年2月26日00:21:00 + */ +@Data +public class DeptModifyParam { + + /** + * 科室主键id + */ + private Long deptId; + + /** + * 科室代码 + */ + private String deptCode; + + /** + * 科室名称 + */ + private String deptName; + + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; +} diff --git a/src/main/java/com/docus/server/collection/dto/TBasicDto.java b/src/main/java/com/docus/server/collection/dto/TBasicDto.java new file mode 100644 index 0000000..a2774b2 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/TBasicDto.java @@ -0,0 +1,37 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @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 { + private String serialId; + private String receive; + private String send; + private String jzh; + private String inpatientNo; + private String admissTimes; + private String name ; + private String admissDate ; + private String disDate ; + private String admissDeptName ; + private String disDeptName ; + private String attendingName; + private String age; + private String sex; + private String idCard; + private String disDept; + private String sexName; + private String bedNum; + private String isDead; + private String admissDays; + private String wardCode; + private String wardName; +} diff --git a/src/main/java/com/docus/server/collection/dto/UserDto.java b/src/main/java/com/docus/server/collection/dto/UserDto.java new file mode 100644 index 0000000..1d955b7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/UserDto.java @@ -0,0 +1,74 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:02 + */ +@Data +public class UserDto { + /** + * id-消息流水号 返回消息体需要 + */ + private String messageId; + /** + * 接收方 + */ + private String receiver; + + /** + * 用户操作 operateType有三种值:C 代表新增、U 代表修改、D 代表删除 + */ + private String operateType; + + /** + * 用户姓名 + */ + private String name; + /** + * 用户工号 + */ + private String userName; + /** + * 所属科室编号 + */ + private String deptId; + /** + * 到时同步完让实施找下不重复的导入到角色表,程序再判断职位对应角色表存角色id(roleId),初始roleId=0 + */ + private String position; + /** + * 角色Id 初始 0 + */ + private Long roleId; + + /** + * 操作人名称 + */ + private String authorName; + + + /** + * 操作人ID + */ + private String authorId; + + + /** + * 转换用户修改对象 + * + * @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; + } +} diff --git a/src/main/java/com/docus/server/collection/dto/UserModifyParam.java b/src/main/java/com/docus/server/collection/dto/UserModifyParam.java new file mode 100644 index 0000000..830cba3 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/UserModifyParam.java @@ -0,0 +1,50 @@ +package com.docus.server.collection.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; +} diff --git a/src/main/java/com/docus/server/collection/entity/PowerDept.java b/src/main/java/com/docus/server/collection/entity/PowerDept.java new file mode 100644 index 0000000..3a06f87 --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/PowerDept.java @@ -0,0 +1,61 @@ +package com.docus.server.collection.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 科室 + *

+ * + * @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 = "科室代码") + 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; +} diff --git a/src/main/java/com/docus/server/collection/entity/PowerUser.java b/src/main/java/com/docus/server/collection/entity/PowerUser.java new file mode 100644 index 0000000..12b6647 --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/PowerUser.java @@ -0,0 +1,85 @@ +package com.docus.server.collection.entity; + + +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 = "登陆名") + 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 = "所属科室代码 多个以,分隔") + private String deptCode; + + @ApiModelProperty(value = "权限科室 拥有对科室查阅权限") + private String powerDept; + + @ApiModelProperty(value = "权限 拥有对主管医生查阅权限") + private String powerAttending; + +} diff --git a/src/main/java/com/docus/server/collection/entity/TBasic.java b/src/main/java/com/docus/server/collection/entity/TBasic.java new file mode 100644 index 0000000..3654b9e --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/TBasic.java @@ -0,0 +1,159 @@ +package com.docus.server.collection.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; + +/** + *

+ * 病案基本信息 + *

+ * + * @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 = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + private Long patientId; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "病案号") + 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 = "是否作废(0:否,1:是)") + 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; +} diff --git a/src/main/java/com/docus/server/collection/entity/TBasicExtend.java b/src/main/java/com/docus/server/collection/entity/TBasicExtend.java new file mode 100644 index 0000000..a3096ee --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/TBasicExtend.java @@ -0,0 +1,33 @@ +package com.docus.server.collection.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; +} diff --git a/src/main/java/com/docus/server/collection/mapper/PowerDeptMapper.java b/src/main/java/com/docus/server/collection/mapper/PowerDeptMapper.java new file mode 100644 index 0000000..e689d75 --- /dev/null +++ b/src/main/java/com/docus/server/collection/mapper/PowerDeptMapper.java @@ -0,0 +1,44 @@ +package com.docus.server.collection.mapper; + +import com.docus.server.collection.dto.DeptModifyParam; +import com.docus.server.collection.entity.PowerDept; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 科室表 mapper + *

+ * + * @author wen yongbin + * @since 2023年2月25日22:28:58 + */ +public interface PowerDeptMapper { + + /** + * 根据科室编码查询科室信息 + * @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); +} diff --git a/src/main/java/com/docus/server/collection/mapper/PowerUserMapper.java b/src/main/java/com/docus/server/collection/mapper/PowerUserMapper.java new file mode 100644 index 0000000..d716658 --- /dev/null +++ b/src/main/java/com/docus/server/collection/mapper/PowerUserMapper.java @@ -0,0 +1,44 @@ +package com.docus.server.collection.mapper; + +import com.docus.server.collection.dto.UserModifyParam; +import com.docus.server.collection.entity.PowerUser; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 用户表 mapper + *

+ * + * @author wen yongbin + * @since 2023年2月25日22:28:58 + */ +public interface PowerUserMapper { + + /** + * 根据用户工号查询用户信息 + * @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); +} diff --git a/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java new file mode 100644 index 0000000..9b2dcec --- /dev/null +++ b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java @@ -0,0 +1,24 @@ +package com.docus.server.collection.mapper; + + +import com.docus.server.collection.entity.TBasic; +import com.docus.server.collection.entity.TBasicExtend; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 病案基本信息 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicMapper{ + + Integer selectOne(@Param("jzh") String jzh); + + Integer insert(@Param("tBasic") TBasic tBasic); + + Integer insertExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend); + +} diff --git a/src/main/java/com/docus/server/collection/receiver/MzZyMqReceiver.java b/src/main/java/com/docus/server/collection/receiver/MzZyMqReceiver.java new file mode 100644 index 0000000..5bd71c3 --- /dev/null +++ b/src/main/java/com/docus/server/collection/receiver/MzZyMqReceiver.java @@ -0,0 +1,62 @@ +package com.docus.server.collection.receiver; + +import com.docus.server.collection.service.IPowerDeptService; +import com.docus.server.collection.service.IPowerUserService; +import com.neusoft.nhip.ibmmq.jms.JmsIbmListener; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author jiashi + * 梅州中医医院 MQ 消费者监听 + */ +@Component +@Slf4j +public class MzZyMqReceiver { + + @Autowired + private IPowerUserService powerUserService; + @Autowired + private IPowerDeptService powerDeptService; + + /** + * 订阅队列(注册科室) + * @param message 科室信息 + */ + @JmsIbmListener(destination = "TJ_createDepartment") + public void revCreateDepartment(String message){ + + } + + + + /** + * 订阅队列(变更科室) + * @param message 科室信息 + */ + @JmsIbmListener(destination = "TJ_updateDepartment") + public void revUpdateDepartment(String message){ + + } + + + /** + * 订阅队列(注册人员) + * @param message 人员信息 + */ + @JmsIbmListener(destination = "TJ_createPractitioner") + public void revCreatePractitioner(String message){ + + } + + + /** + * 订阅队列(变更人员) + * @param message 人员信息 + */ + @JmsIbmListener(destination = "TJ_updatePractitione") + public void revUpdatePractitioner(String message){ + + } +} diff --git a/src/main/java/com/docus/server/collection/service/IPowerDeptService.java b/src/main/java/com/docus/server/collection/service/IPowerDeptService.java new file mode 100644 index 0000000..6b00989 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/IPowerDeptService.java @@ -0,0 +1,24 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.DeptDto; + +/** + * 用户服务 + */ +public interface IPowerDeptService { + /** + * 科室注册 + * + * @param deptDto 用户注册参数 + * @return 处理结果 + */ + boolean register(DeptDto deptDto); + + /** + * 根据科室编号删除科室 + * + * @param deptCode 科室编码 + * @return 删除结果 + */ + boolean delDeptByDeptCode(String deptCode); +} diff --git a/src/main/java/com/docus/server/collection/service/IPowerUserService.java b/src/main/java/com/docus/server/collection/service/IPowerUserService.java new file mode 100644 index 0000000..f42964d --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/IPowerUserService.java @@ -0,0 +1,24 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.UserDto; + +/** + * 用户服务 + */ +public interface IPowerUserService { + /** + * 用户注册 + * + * @param userDto 用户注册参数 + * @return 处理结果 + */ + boolean register(UserDto userDto); + + /** + * 根据用户工号删除用户 + * + * @param userName 用户工号 + * @return 删除结果 + */ + boolean delUserByUserName(String userName); +} diff --git a/src/main/java/com/docus/server/collection/service/ITBasicService.java b/src/main/java/com/docus/server/collection/service/ITBasicService.java new file mode 100644 index 0000000..076970c --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/ITBasicService.java @@ -0,0 +1,8 @@ +package com.docus.server.collection.service; + +import com.docus.server.collection.dto.TBasicDto; + +public interface ITBasicService { + + public void setTBasic(TBasicDto dto) throws Exception; +} diff --git a/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java new file mode 100644 index 0000000..f9ab6d1 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/PowerDeptServiceImpl.java @@ -0,0 +1,50 @@ +package com.docus.server.collection.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.dto.DeptDto; +import com.docus.server.collection.dto.DeptModifyParam; +import com.docus.server.collection.entity.PowerDept; +import com.docus.server.collection.mapper.PowerDeptMapper; +import com.docus.server.collection.service.IPowerDeptService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 科室服务实现 + * + * @author wyb + */ +@Service +public class PowerDeptServiceImpl implements IPowerDeptService { + @Resource + private PowerDeptMapper powerDeptMapper; + @Resource + private IdService idService; + + @Override + public boolean register(DeptDto deptDto) { + PowerDept powerDept = powerDeptMapper.getDeptByDeptCode(deptDto.getDeptCode()); + DeptModifyParam deptModifyParam = deptDto.transDeptAddParam(); + if (Func.isEmpty(powerDept)) { + long deptId = idService.getDateSeq(); + deptModifyParam.setDeptId(deptId); + powerDeptMapper.addDept(deptModifyParam); + return true; + } + deptModifyParam.setDeptId(powerDept.getDeptId()); + powerDeptMapper.updateDept(deptModifyParam); + return true; + } + + @Override + public boolean delDeptByDeptCode(String deptCode) { + PowerDept powerDept = powerDeptMapper.getDeptByDeptCode(deptCode); + if (Func.isEmpty(powerDept)) { + return true; + } + powerDeptMapper.delDeptByDeptCode(deptCode); + return true; + } +} diff --git a/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java new file mode 100644 index 0000000..55a3076 --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/PowerUserServiceImpl.java @@ -0,0 +1,54 @@ +package com.docus.server.collection.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.config.UserSyncConfig; +import com.docus.server.collection.dto.UserDto; +import com.docus.server.collection.dto.UserModifyParam; +import com.docus.server.collection.entity.PowerUser; +import com.docus.server.collection.mapper.PowerUserMapper; +import com.docus.server.collection.service.IPowerUserService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 用户服务实现 + * + * @author wyb + */ +@Service +public class PowerUserServiceImpl implements IPowerUserService { + @Resource + private PowerUserMapper powerUserMapper; + @Resource + private IdService idService; + @Resource + private UserSyncConfig syncConfig; + + @Override + public boolean register(UserDto userDto) { + PowerUser powerUser = powerUserMapper.getUserByUserName(userDto.getUserName()); + UserModifyParam userModifyParam = userDto.transUserAddParam(); + if (Func.isEmpty(powerUser)) { + long userId = idService.getDateSeq(); + userModifyParam.setUserId(userId); + userModifyParam.setUserPwd(syncConfig.getPassword()); + powerUserMapper.addUser(userModifyParam); + return true; + } + userModifyParam.setUserId(powerUser.getUserId()); + powerUserMapper.updateUser(userModifyParam); + return true; + } + + @Override + public boolean delUserByUserName(String userName) { + PowerUser powerUser = powerUserMapper.getUserByUserName(userName); + if (Func.isEmpty(powerUser)) { + return true; + } + powerUserMapper.delUserByUserName(userName); + return true; + } +} diff --git a/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java b/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java new file mode 100644 index 0000000..f9cca9d --- /dev/null +++ b/src/main/java/com/docus/server/collection/service/impl/TBasicServiceImpl.java @@ -0,0 +1,107 @@ +package com.docus.server.collection.service.impl; + +import cn.hutool.core.util.NumberUtil; +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.collection.dto.TBasicDto; +import com.docus.server.collection.entity.TBasic; +import com.docus.server.collection.entity.TBasicExtend; +import com.docus.server.collection.mapper.TBasicMapper; +import com.docus.server.collection.service.ITBasicService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.service.impl + * @Author: chierhao + * @CreateTime: 2023-02-28 08:37 + * @Description: TODO + * @Version: 1.0 + */ +@Service +public class TBasicServiceImpl implements ITBasicService { + + @Resource + private TBasicMapper tBasicMapper; + + @Resource + private IdService idService; + + @Override + @Transactional + public void setTBasic(TBasicDto tBasicDto) throws Exception { + //判断jzh是否重复 + Integer num = tBasicMapper.selectOne(tBasicDto.getJzh()); + if (num>0) { + throw new Exception("记帐号已存在"); + } + Long patientId = idService.getDateSeq(); + + //数据类型转化,格式处理 + Date admissDate = Func.parseDate(tBasicDto.getAdmissDate(), DateUtil.PATTERN_DATETIME_MINI); + Date 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(); + ageStr =ageStr.substring(0,ageStr.length()-1); + System.out.println(ageStr); + 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); + 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.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()); + + //持久化 + tBasicMapper.insert(tBasic); + tBasicMapper.insertExtend(tBasicExtend); + } +} + + diff --git a/src/main/java/com/docus/server/collection/util/IdUtil.java b/src/main/java/com/docus/server/collection/util/IdUtil.java new file mode 100644 index 0000000..f1650f9 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/IdUtil.java @@ -0,0 +1,19 @@ +package com.docus.server.collection.util; + +import lombok.Data; + +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; + +@Data +public class IdUtil { + /** + * 得到一个标准的 8-4-4-4-12 UUID + * @return 标准的 8-4-4-4-12 UUID + */ + public static String standardUUID(){ + ThreadLocalRandom random = ThreadLocalRandom.current(); + return (new UUID(random.nextLong(), random.nextLong())).toString(); + } + +} diff --git a/src/main/java/com/docus/server/collection/util/Result.java b/src/main/java/com/docus/server/collection/util/Result.java new file mode 100644 index 0000000..339ac64 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/Result.java @@ -0,0 +1,98 @@ +package com.docus.server.collection.util; + +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import lombok.Data; + +import java.util.Date; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.util + * @Author: chierhao + * @CreateTime: 2023-02-25 16:59 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class Result { + + + + public static String success(String serialId,String receive,String send){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + String message="成功"; + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + public static String failed(String serialId,String message,String receive,String send){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + +} diff --git a/src/main/java/com/docus/server/collection/util/XmlUtil.java b/src/main/java/com/docus/server/collection/util/XmlUtil.java new file mode 100644 index 0000000..9fe12b7 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/XmlUtil.java @@ -0,0 +1,853 @@ +/* + * Copyright (c) 2018-2028, DreamLu All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: DreamLu 卢春梦 (596392912@qq.com) + */ +package com.docus.server.collection.util; + +import com.docus.core.util.Exceptions; +import com.docus.core.util.IoUtil; +import org.springframework.lang.Nullable; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; + +/** + * xpath解析xml + * + *
+ *     文档地址:
+ *     http://www.w3school.com.cn/xpath/index.asp
+ * 
+ * + * @author L.cm + */ +public class XmlUtil { + private final XPath path; + private final Document doc; + + private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory dbf = getDocumentBuilderFactory(); + DocumentBuilder db = dbf.newDocumentBuilder(); + doc = db.parse(inputSource); + path = getXPathFactory().newXPath(); + } + + /** + * 创建工具类 + * + * @param inputSource inputSource + * @return XmlUtil + */ + private static XmlUtil create(InputSource inputSource) { + try { + return new XmlUtil(inputSource); + } catch (ParserConfigurationException | SAXException | IOException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 转换工具类 + * + * @param inputStream inputStream + * @return XmlUtil + */ + public static XmlUtil of(InputStream inputStream) { + InputSource inputSource = new InputSource(inputStream); + return create(inputSource); + } + + /** + * 转换工具类 + * + * @param xmlStr xmlStr + * @return XmlUtil + */ + public static XmlUtil of(String xmlStr) { + StringReader sr = new StringReader(xmlStr.trim()); + InputSource inputSource = new InputSource(sr); + XmlUtil xmlUtil = create(inputSource); + IoUtil.closeQuietly(sr); + return xmlUtil; + } + + /** + * 转换路径 + * + * @param expression 表达式 + * @param item 实体 + * @param returnType 返回类型 + * @return Object + */ + private Object evalXPath(String expression, @Nullable Object item, QName returnType) { + item = null == item ? doc : item; + try { + return path.evaluate(expression, item, returnType); + } catch (XPathExpressionException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 获取String + * + * @param expression 路径 + * @return {String} + */ + public String getString(String expression) { + return (String) evalXPath(expression, null, XPathConstants.STRING); + } + + /** + * 获取Boolean + * + * @param expression 路径 + * @return {String} + */ + public Boolean getBoolean(String expression) { + return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN); + } + + /** + * 获取Number + * + * @param expression 路径 + * @return {Number} + */ + public Number getNumber(String expression) { + return (Number) evalXPath(expression, null, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param expression 路径 + * @return {Node} + */ + public Node getNode(String expression) { + return (Node) evalXPath(expression, null, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param expression 路径 + * @return NodeList + */ + public NodeList getNodeList(String expression) { + return (NodeList) evalXPath(expression, null, XPathConstants.NODESET); + } + + + /** + * 获取String + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public String getString(Object node, String expression) { + return (String) evalXPath(expression, node, XPathConstants.STRING); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public Boolean getBoolean(Object node, String expression) { + return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {Number} + */ + public Number getNumber(Object node, String expression) { + return (Number) evalXPath(expression, node, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param node 节点 + * @param expression 路径 + * @return {Node} + */ + public Node getNode(Object node, String expression) { + return (Node) evalXPath(expression, node, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return NodeList + */ + public NodeList getNodeList(Object node, String expression) { + return (NodeList) evalXPath(expression, node, XPathConstants.NODESET); + } + + /** + * 针对没有嵌套节点的简单处理 + * + * @return map集合 + */ + public Map toMap() { + Element root = doc.getDocumentElement(); + Map params = new HashMap<>(16); + + // 将节点封装成map形式 + NodeList list = root.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if (node instanceof Element) { + params.put(node.getNodeName(), node.getTextContent()); + } + } + return params; + } + + private static volatile boolean preventedXXE = false; + + private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException { + DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory; + if (!preventedXXE) { + preventXXE(dbf); + } + return dbf; + } + + /** + * preventXXE + * + * @param dbf + * @throws ParserConfigurationException + */ + private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException { + // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented + // Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + + // If you can't completely disable DTDs, then at least do the following: + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities + + // JDK7+ - http://xml.org/sax/features/external-general-entities + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities + + // JDK7+ - http://xml.org/sax/features/external-parameter-entities + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + + // Disable external DTDs as well + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + // and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks" + dbf.setXIncludeAware(false); + dbf.setExpandEntityReferences(false); + preventedXXE = true; + } + + private static XPathFactory getXPathFactory() { + return XmlHelperHolder.xPathFactory; + } + + /** + * 内部类单例 + */ + private static class XmlHelperHolder { + private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + private static XPathFactory xPathFactory = XPathFactory.newInstance(); + } + private static String str; + static { + str=" \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 59 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 205室 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 2号楼16楼西区 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 南方医科大学顺德医院 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 常规 \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 张存良 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 文本 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 乳房病类 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " O \n" + + " \n" + + " 0 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 01 \n" + + " \n" + + " 出院医嘱 \n" + + " \n" + + "
\n"; + } + + public static void main(String[] args) { + XmlUtil a=XmlUtil.of(str); + Node node=null; + //id-消息流水号 + node = a.getNode("/PRPA_HIP0032/id/@extension"); + String serialId = node.toString(); + System.out.println(serialId); + //住院流水号 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension"); + String jzh = node.toString(); + System.out.println(jzh); + //住院号标识 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension"); + String inpatientNo = node.toString(); + System.out.println(inpatientNo); + //住院次数[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value"); + String admissTimes=node.toString(); + System.out.println(admissTimes); + //姓名 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value"); + String name = node.toString(); + System.out.println(name); + //入院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value"); + String admissDate = node.toString(); + System.out.println(admissDate); + //出院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value"); + String disDate = node.toString(); + System.out.println(disDate); + //入院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String admissDeptName = node.getTextContent(); + System.out.println(admissDeptName); + //出院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String disDeptName = node.getTextContent(); + System.out.println(disDeptName); + //主治医师[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name"); + String attendingName = node.getTextContent(); + System.out.println(attendingName); + } +} diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index f659e4f..d187f88 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -30,7 +30,7 @@ spring: redis: host: redis.docus.cn - password: 123456 +# password: 123456 cloud: nacos: discovery: @@ -46,6 +46,9 @@ spring: docus: dbtype: mysql + user: + # 用户默认密码 + defpwd: fd29cd53ec12616e5f36b77d4afffbff mybatis-plus: configuration: diff --git a/src/main/resources/mapper/PowerDeptMapper.xml b/src/main/resources/mapper/PowerDeptMapper.xml new file mode 100644 index 0000000..32680ae --- /dev/null +++ b/src/main/resources/mapper/PowerDeptMapper.xml @@ -0,0 +1,31 @@ + + + + + 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}) + + + update `docus_system`.`power_dept` set + `dept_name`=#{dept.deptName}, + `updater`=#{dept.authorName}, + `update_date`=now() + where `dept_code`=#{dept.deptCode} + + + delete from `docus_system`.`power_dept` where `dept_code` = #{deptCode} + + + + diff --git a/src/main/resources/mapper/PowerUserMapper.xml b/src/main/resources/mapper/PowerUserMapper.xml new file mode 100644 index 0000000..d63a165 --- /dev/null +++ b/src/main/resources/mapper/PowerUserMapper.xml @@ -0,0 +1,38 @@ + + + + + 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}) + + + 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} + + + delete from `docus_system`.`power_user` where `user_name` = #{userName} + + + + diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..08b34c6 --- /dev/null +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,23 @@ + + + + + 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`) + 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}) + + + INSERT INTO `docus_medicalrecord`.`t_basic_extend` + (`patient_id`,`ward_code`,`ward_name`) + VALUES + (#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName}) + + + +