+ * 科室 + *
+ * + * @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 "+ * 文档地址: + * 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
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 突发特发性听觉丧失 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 无 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 常规 \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 治愈 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 张存良 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 耳鼻咽喉头颈外科 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 突发特发性听觉丧失 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 文本 \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " 无 \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " 乳房病类 \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "