diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpAppointmentController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpAppointmentController.java new file mode 100644 index 0000000000000000000000000000000000000000..33781c5cf946b009848577b3f37cff20b52522d0 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpAppointmentController.java @@ -0,0 +1,26 @@ +package cn.sh.stc.sict.theme.hphy.controller.web; + + +import cn.sh.stc.sict.theme.hphy.service.HpAppointmentService; +import com.baomidou.mybatisplus.extension.api.ApiController; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * [黄浦]预约记录(HpAppointment)维护接口 + * + * @author makejava + * @since 2021-01-28 10:35:57 + */ +@Api(value = "[黄浦]预约记录维护接口", tags = "[黄浦]预约记录维护接口") +@RestController +@RequestMapping("hpAppointment") +@AllArgsConstructor +public class HpAppointmentController extends ApiController { + /** + * 服务对象 + */ + private final HpAppointmentService hpAppointmentService; +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java new file mode 100644 index 0000000000000000000000000000000000000000..2dab6a9c3cf621cdd9035783c8288cfa49d0d31b --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDeptInfoController.java @@ -0,0 +1,26 @@ +package cn.sh.stc.sict.theme.hphy.controller.web; + + +import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService; +import com.baomidou.mybatisplus.extension.api.ApiController; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * (HpDeptInfo)维护接口 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +@Api(value = "维护接口", tags = "维护接口") +@RestController +@RequestMapping("hpDeptInfo") +@AllArgsConstructor +public class HpDeptInfoController extends ApiController { + /** + * 服务对象 + */ + private final HpDeptInfoService hpDeptInfoService; +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDocInfoController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDocInfoController.java new file mode 100644 index 0000000000000000000000000000000000000000..81d35b88c391eb089bd8337f4035fce2f01e9591 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpDocInfoController.java @@ -0,0 +1,26 @@ +package cn.sh.stc.sict.theme.hphy.controller.web; + + +import cn.sh.stc.sict.theme.hphy.service.HpDocInfoService; +import com.baomidou.mybatisplus.extension.api.ApiController; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * (HpDocInfo)维护接口 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +@Api(value = "维护接口", tags = "维护接口") +@RestController +@RequestMapping("hpDocInfo") +@AllArgsConstructor +public class HpDocInfoController extends ApiController { + /** + * 服务对象 + */ + private final HpDocInfoService hpDocInfoService; +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpHosInfoController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpHosInfoController.java new file mode 100644 index 0000000000000000000000000000000000000000..9918cbc0ca2a9797d9971f9d75f338a0ffde3eaa --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpHosInfoController.java @@ -0,0 +1,26 @@ +package cn.sh.stc.sict.theme.hphy.controller.web; + + +import cn.sh.stc.sict.theme.hphy.service.HpHosInfoService; +import com.baomidou.mybatisplus.extension.api.ApiController; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * (HpHosInfo)维护接口 + * + * @author makejava + * @since 2021-01-28 10:36:00 + */ +@Api(value = "维护接口", tags = "维护接口") +@RestController +@RequestMapping("hpHosInfo") +@AllArgsConstructor +public class HpHosInfoController extends ApiController { + /** + * 服务对象 + */ + private final HpHosInfoService hpHosInfoService; +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpAppointmentMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpAppointmentMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..c9607907a5f81984d5414d3ffc4eccfec03e8513 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpAppointmentMapper.java @@ -0,0 +1,14 @@ +package cn.sh.stc.sict.theme.hphy.dao; + +import cn.sh.stc.sict.theme.hphy.model.HpAppointment; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * [黄浦]预约记录(HpAppointment)表数据库访问层 + * + * @author makejava + * @since 2021-01-28 10:35:56 + */ +public interface HpAppointmentMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDeptInfoMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDeptInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..e3b96381a853f93c4a026b857e1ed24c856c34a9 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDeptInfoMapper.java @@ -0,0 +1,14 @@ +package cn.sh.stc.sict.theme.hphy.dao; + +import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * (HpDeptInfo)表数据库访问层 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +public interface HpDeptInfoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDocInfoMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDocInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..dc255004640eab0f28bd15536b3327995d10970a --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpDocInfoMapper.java @@ -0,0 +1,14 @@ +package cn.sh.stc.sict.theme.hphy.dao; + +import cn.sh.stc.sict.theme.hphy.model.HpDocInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * (HpDocInfo)表数据库访问层 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +public interface HpDocInfoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpHosInfoMapper.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpHosInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..67aefdb06cd2eae016e75d53569720b0d7ebd420 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpHosInfoMapper.java @@ -0,0 +1,14 @@ +package cn.sh.stc.sict.theme.hphy.dao; + +import cn.sh.stc.sict.theme.hphy.model.HpHosInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * (HpHosInfo)表数据库访问层 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +public interface HpHosInfoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java new file mode 100644 index 0000000000000000000000000000000000000000..331cd683dbd3c08e6d6206176bdc54601da00c83 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java @@ -0,0 +1,137 @@ +package cn.sh.stc.sict.theme.hphy.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * [黄浦]预约记录(HpAppointment)表实体类 + * + * @author makejava + * @since 2021-01-28 10:38:37 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class HpAppointment extends Model { + //id + @TableId + @ApiModelProperty(hidden = false, value = "id") + private Long id; + //医院代码 + @ApiModelProperty(hidden = false, value = "医院代码") + private String hosOrgCode; + //一级科室代码 + @ApiModelProperty(hidden = false, value = "一级科室代码") + private String oneDeptCode; + //二级科室代码 + @ApiModelProperty(hidden = false, value = "二级科室代码") + private String deptCode; + //预约类型:1-医生 2-门诊 + @ApiModelProperty(hidden = false, value = "预约类型:1-医生 2-门诊") + private String orderType; + //医生|门诊代码 + @ApiModelProperty(hidden = false, value = "医生|门诊代码") + private String resourceCode; + //预约渠道方式:1-官网 2-微信 3-app 4-支付宝 5-电话 6-转诊预约 7-(1+1+1)转诊预约 8-现场预约 0-其他 + @ApiModelProperty(hidden = false, value = "预约渠道方式:1-官网 2-微信 3-app 4-支付宝 5-电话 6-转诊预约 7-(1+1+1)转诊预约 8-现场预约 0-其他") + private String channelCode; + //排班id + @ApiModelProperty(hidden = false, value = "排班id") + private String scheduleId; + //号源id + @ApiModelProperty(hidden = false, value = "号源id") + private String numSourceId; + //支付方式 + @ApiModelProperty(hidden = false, value = "支付方式") + private String payMode; + //预约患者类型 + @ApiModelProperty(hidden = false, value = "预约患者类型") + private String patientType; + //1+1+1 签约编号 + @ApiModelProperty(hidden = false, value = "1+1+1 签约编号") + private String patientId; + //就诊人卡号 + @ApiModelProperty(hidden = false, value = "就诊人卡号") + private String mediCardId; + //就诊人卡类型 + @ApiModelProperty(hidden = false, value = "就诊人卡类型") + private String mediCardType; + //就诊人证件类型 + @ApiModelProperty(hidden = false, value = "就诊人证件类型") + private String userCardType; + //就诊人证件号码 + @ApiModelProperty(hidden = false, value = "就诊人证件号码") + private String userCardId; + //就诊人姓名 + @ApiModelProperty(hidden = false, value = "就诊人姓名") + private String userName; + //手机号码 + @ApiModelProperty(hidden = false, value = "手机号码") + private String userPhone; + //就诊人性别 + @ApiModelProperty(hidden = false, value = "就诊人性别") + private String userSex; + //就诊人出生日期 + @ApiModelProperty(hidden = false, value = "就诊人出生日期") + private String userBd; + //就诊人联系地址 + @ApiModelProperty(hidden = false, value = "就诊人联系地址") + private String userContAdd; + //预约人证件类型 + @ApiModelProperty(hidden = false, value = "预约人证件类型") + private String replaceUserCardType; + //预约人证件号码 + @ApiModelProperty(hidden = false, value = "预约人证件号码") + private String replaceUserCardId; + //预约人姓名 + @ApiModelProperty(hidden = false, value = "预约人姓名") + private String replaceUserName; + //ip地址 + @ApiModelProperty(hidden = false, value = "ip地址") + private String ipAddr; + //mac地址 + @ApiModelProperty(hidden = false, value = "mac地址") + private String macAddr; + //预约转诊转出机构代码(1+1+1预约转诊专用) + @ApiModelProperty(hidden = false, value = "预约转诊转出机构代码(1+1+1预约转诊专用)") + private String outHospitalCode; + //预约转诊转出机构本地转诊id + @ApiModelProperty(hidden = false, value = "预约转诊转出机构本地转诊id") + private String outOrderId; + //号源日期 + @ApiModelProperty(hidden = false, value = "号源日期") + private String numSourceDate; + //就诊_开始时段 + @ApiModelProperty(hidden = false, value = "就诊_开始时段") + private String startTime; + //就诊_结束时段 + @ApiModelProperty(hidden = false, value = "就诊_结束时段") + private String endTime; + //预约平台类型 + @ApiModelProperty(hidden = false, value = "预约平台类型") + private String platformType; + //预约平台菜吗 + @ApiModelProperty(hidden = false, value = "预约平台菜吗") + private String platformCode; + //预约渠道描述 + @ApiModelProperty(hidden = false, value = "预约渠道描述") + private String channelName; + //号源来源 + @ApiModelProperty(hidden = false, value = "号源来源") + private String numSourceFrom; + + + /** + * 获取主键值 + * + * @return 主键值 + */ + @Override + protected Serializable pkVal() { + return this.id; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDeptInfo.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDeptInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..8990e66b3cabe2925f247e0b4a77048f62b8426e --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDeptInfo.java @@ -0,0 +1,56 @@ +package cn.sh.stc.sict.theme.hphy.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * (HpDeptInfo)表实体类 + * + * @author makejava + * @since 2021-01-28 10:35:57 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class HpDeptInfo extends Model { + @TableId + @ApiModelProperty(hidden = false, value = "id") + private Long id; + @ApiModelProperty(hidden = false, value = "医院代码") + private String hosOrgCode; + @ApiModelProperty(hidden = false, value = "一级科室代码") + private String oneDeptCode; + @ApiModelProperty(hidden = false, value = "二级科室代码") + private String deptCode; + @ApiModelProperty(hidden = false, value = "医院名称") + private String hosName; + @ApiModelProperty(hidden = false, value = "一级科室名称") + private String oneDeptName; + @ApiModelProperty(hidden = false, value = "二级科室名称") + private String deptName; + @ApiModelProperty(hidden = false, value = "标准二级科室代码") + private String normdeptCode; + @ApiModelProperty(hidden = false, value = "标准二级科室名称") + private String normdeptName; + @ApiModelProperty(hidden = false, value = "科室简介") + private String deptDesc; + @ApiModelProperty(hidden = false, value = "科室级别:1-一级,2-二级") + private Byte deptLevel; + @ApiModelProperty(hidden = false, value = "显示次序") + private String indexNo; + + + /** + * 获取主键值 + * + * @return 主键值 + */ + @Override + protected Serializable pkVal() { + return this.id; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDocInfo.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDocInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..ffe08fad45fbdb1b1f1992177e2bbf5c80c2b1d1 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpDocInfo.java @@ -0,0 +1,64 @@ +package cn.sh.stc.sict.theme.hphy.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * (HpDocInfo)表实体类 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class HpDocInfo extends Model { + @TableId + @ApiModelProperty(hidden = false, value = "医生资源代码") + private String resourceCode; + @ApiModelProperty(hidden = false, value = "医院代码") + private String hosOrgCode; + @ApiModelProperty(hidden = false, value = "一级科室代码") + private String oneDeptCode; + @ApiModelProperty(hidden = false, value = "二级科室代码") + private String deptCode; + @ApiModelProperty(hidden = false, value = "医院名称") + private String hosName; + @ApiModelProperty(hidden = false, value = "一级科室名称") + private String oneDeptName; + @ApiModelProperty(hidden = false, value = "二级科室名称") + private String deptName; + @ApiModelProperty(hidden = false, value = "医生资源姓名") + private String resourceName; + @ApiModelProperty(hidden = false, value = "医生职称") + private String doctTile; + @ApiModelProperty(hidden = false, value = "证件类型") + private String personType; + @ApiModelProperty(hidden = false, value = "证件号") + private String personId; + @ApiModelProperty(hidden = false, value = "医生头像") + private String doctImg; + @ApiModelProperty(hidden = false, value = "医生性别") + private String doctSex; + @ApiModelProperty(hidden = false, value = "医生简介") + private String doctInfo; + @ApiModelProperty(hidden = false, value = "医生特长") + private String doctSpecialty; + @ApiModelProperty(hidden = false, value = "展示次序") + private String indexNo; + + + /** + * 获取主键值 + * + * @return 主键值 + */ + @Override + protected Serializable pkVal() { + return this.resourceCode; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpHosInfo.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpHosInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..3d21162bfa7dc54dfd71eac91f717baeac990efe --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpHosInfo.java @@ -0,0 +1,70 @@ +package cn.sh.stc.sict.theme.hphy.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * (HpHosInfo)表实体类 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class HpHosInfo extends Model { + @TableId + @ApiModelProperty(hidden = false, value = "医院代码") + private String hosOrgCode; + @ApiModelProperty(hidden = false, value = "卫生机构(组织)代码") + private String orgCode; + @ApiModelProperty(hidden = false, value = "医院名称") + private String hosName; + @ApiModelProperty(hidden = false, value = "医院地址") + private String hospitalAdd; + @ApiModelProperty(hidden = false, value = "预约挂号须知") + private String hospitalRule; + @ApiModelProperty(hidden = false, value = "医院网址") + private String hospitalWeb; + @ApiModelProperty(hidden = false, value = "交通指南") + private String trafficGuide; + @ApiModelProperty(hidden = false, value = "医院简介") + private String hospitalDesc; + @ApiModelProperty(hidden = false, value = "联系电话") + private String hospitalTel; + @ApiModelProperty(hidden = false, value = "医院级别") + private String hospitalGrade; + @ApiModelProperty(hidden = false, value = "医院等级") + private String hospitalLevel; + @ApiModelProperty(hidden = false, value = "医院类别") + private String hospitalType; + @ApiModelProperty(hidden = false, value = "支付方式") + private String payMode; + @ApiModelProperty(hidden = false, value = "预约方式") + private String orderMode; + @ApiModelProperty(hidden = false, value = "是否支持分时段") + private String isSpTime; + @ApiModelProperty(hidden = false, value = "医院简称") + private String shortName; + @ApiModelProperty(hidden = false, value = "医院属性") + private String orgSort; + @ApiModelProperty(hidden = false, value = "所属区代码") + private String hospitalArea; + @ApiModelProperty(hidden = false, value = "医院图片") + private String hospitalImage; + + + /** + * 获取主键值 + * + * @return 主键值 + */ + @Override + protected Serializable pkVal() { + return this.hosOrgCode; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java index a43f1b727bff583b0bfbd07dbbf9a828fadffeec..4354e72e8396bdc7d1bb86a8f92117e34e631241 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/schedule/RefreshJob.java @@ -1,10 +1,24 @@ package cn.sh.stc.sict.theme.hphy.schedule; +import cn.hutool.core.collection.CollectionUtil; +import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo; +import cn.sh.stc.sict.theme.hphy.model.HpDocInfo; +import cn.sh.stc.sict.theme.hphy.model.HpHosInfo; +import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService; +import cn.sh.stc.sict.theme.hphy.service.HpDocInfoService; +import cn.sh.stc.sict.theme.hphy.service.HpHosInfoService; +import cn.sh.stc.sict.theme.hphy.wd.DeptInfo; +import cn.sh.stc.sict.theme.hphy.wd.DoctInfo; import cn.sh.stc.sict.theme.hphy.wd.HosInfo; import cn.sh.stc.sict.theme.hphy.wd.WanDaHttpUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import ma.glasnost.orika.MapperFactory; +import ma.glasnost.orika.impl.DefaultMapperFactory; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; /** @@ -14,27 +28,142 @@ import java.util.List; * 3. 每周更新医生信息 * 4. 每天更新可预约信息 */ +@Slf4j @Component +@AllArgsConstructor public class RefreshJob { - @Scheduled(cron = "") + private final HpHosInfoService hpHosInfoService; + private final HpDeptInfoService deptInfoService; + private final HpDocInfoService docInfoService; + + private static final byte TOP_DEPT = 1; + private static final byte TWO_DEPT = 2; + + @Scheduled(cron = "0 44 13 * * ?") public void updateHosp(){ HosInfo hosInfo = new HosInfo(); List list = WanDaHttpUtil.getHospitalInfo(hosInfo); + + if (CollectionUtil.isEmpty(list)){ + return; + } + + MapperFactory factory = new DefaultMapperFactory.Builder().build(); + List hpHosInfos = factory.getMapperFacade().mapAsList(list, HpHosInfo.class); + + for (HpHosInfo hpHosInfo : hpHosInfos) { + saveOrUpdateHospital(hpHosInfo); + } + } + + private void saveOrUpdateHospital(HpHosInfo hpHosInfo){ + try { + if (hpHosInfoService.hospitalExist(hpHosInfo.getHosOrgCode())){ + hpHosInfoService.updateById(hpHosInfo); + }else { + hpHosInfoService.save(hpHosInfo); + } + }catch (Exception e){ + log.error("医院保存出错:{}", hpHosInfo); + log.error(e.getMessage(), e); + } } - @Scheduled(cron = "") - public void updateDeptTop(){ +// @Scheduled(cron = "") + public void updateDept(){ + List hospitals = hpHosInfoService.list(); + if (CollectionUtil.isEmpty(hospitals)){ + return; + } + + // TODO 获取一级科室 + MapperFactory factory = new DefaultMapperFactory.Builder().build(); + for (HpHosInfo hospital : hospitals) { + saveOrUpdateTopDept(hospital.getHosOrgCode(), factory); + } + + // TODO 获取二级科室 } - @Scheduled(cron = "") + private void saveOrUpdateTopDept(String hosOrgCode, MapperFactory factory){ + List deptInfos = WanDaHttpUtil.getDeptInfoTop(new HosInfo(hosOrgCode)); + if (CollectionUtil.isEmpty(deptInfos)){ + return; + } + + List hpDeptInfos = cloneTopDept(deptInfos); + + + } + + + +// @Scheduled(cron = "") public void updateDeptTwo(){ } - @Scheduled(cron = "") + @Scheduled(cron = "0 42 14 * * ?") public void updateDocInfo(){ + List list = hpHosInfoService.list(); + + if (CollectionUtil.isEmpty(list)){ + return; + } + + MapperFactory factory = new DefaultMapperFactory.Builder().build(); + for (HpHosInfo hpHosInfo : list) { + saveOrUpdateDoctor(hpHosInfo.getHosOrgCode(), factory); + } + + } + + private void saveOrUpdateDoctor(String hosOrgCode, MapperFactory factory){ + List doctInfos = WanDaHttpUtil.getDoctInfo(new DeptInfo(hosOrgCode)); + + if (CollectionUtil.isEmpty(doctInfos)){ + return; + } + + List docInfos = factory.getMapperFacade().mapAsList(doctInfos, HpDocInfo.class); + for (HpDocInfo docInfo : docInfos) { + saveOrUpdateDoctor(docInfo); + } } + + private void saveOrUpdateDoctor(HpDocInfo docInfo){ + try { + if (docInfoService.doctorExist(docInfo.getResourceCode())){ + docInfoService.updateById(docInfo); + }else { + docInfoService.save(docInfo); + } + }catch (Exception e){ + log.error("医生信息保存出错:{}", docInfo); + } + } + + private List cloneTopDept(List deptInfos){ + List hpDeptInfos = new ArrayList<>(); + for (DeptInfo deptInfo : deptInfos) { + HpDeptInfo hpDeptInfo = new HpDeptInfo(); + hpDeptInfo.setHosOrgCode(deptInfo.getHosOrgCode()); + hpDeptInfo.setOneDeptCode(deptInfo.getDeptCode()); + hpDeptInfo.setHosName(deptInfo.getHosName()); + hpDeptInfo.setOneDeptName(deptInfo.getDeptName()); + hpDeptInfo.setNormdeptCode(deptInfo.getNormdeptCode()); + hpDeptInfo.setNormdeptName(deptInfo.getNormdeptName()); + hpDeptInfo.setDeptDesc(deptInfo.getDeptDesc()); + hpDeptInfo.setDeptLevel(TOP_DEPT); + hpDeptInfo.setIndexNo(deptInfo.getIndexNo()); + + hpDeptInfos.add(hpDeptInfo); + } + + return hpDeptInfos; + } + } diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpAppointmentService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpAppointmentService.java new file mode 100644 index 0000000000000000000000000000000000000000..e2f55ef4ff8fca3f94882ad552c72235979d9731 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpAppointmentService.java @@ -0,0 +1,14 @@ +package cn.sh.stc.sict.theme.hphy.service; + +import cn.sh.stc.sict.theme.hphy.model.HpAppointment; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * [黄浦]预约记录(HpAppointment)表服务接口 + * + * @author makejava + * @since 2021-01-28 10:35:56 + */ +public interface HpAppointmentService extends IService { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java new file mode 100644 index 0000000000000000000000000000000000000000..42e0d5871921017eb656fec2abcaaaa6973acba7 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDeptInfoService.java @@ -0,0 +1,16 @@ +package cn.sh.stc.sict.theme.hphy.service; + +import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * (HpDeptInfo)表服务接口 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +public interface HpDeptInfoService extends IService { + + + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDocInfoService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDocInfoService.java new file mode 100644 index 0000000000000000000000000000000000000000..bfff237bcac6c1257a94836381857b6fe9617e3e --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpDocInfoService.java @@ -0,0 +1,21 @@ +package cn.sh.stc.sict.theme.hphy.service; + +import cn.sh.stc.sict.theme.hphy.model.HpDocInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * (HpDocInfo)表服务接口 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +public interface HpDocInfoService extends IService { + + /** + * 根据医生的资源id判断医生是否存在 + * @param resourceCode + * @return true-存在;false-不存在 + */ + boolean doctorExist(String resourceCode); + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpHosInfoService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpHosInfoService.java new file mode 100644 index 0000000000000000000000000000000000000000..416a1f2156c4d83b862b2e68a6f4553f2216d4ce --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpHosInfoService.java @@ -0,0 +1,19 @@ +package cn.sh.stc.sict.theme.hphy.service; + +import cn.sh.stc.sict.theme.hphy.model.HpHosInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * (HpHosInfo)表服务接口 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +public interface HpHosInfoService extends IService { + /** + * 根据机构代码查询医院是否存在 + * @param hosOrgCode + * @return true-存在;false-不存在 + */ + boolean hospitalExist(String hosOrgCode); +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpAppointmentServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpAppointmentServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..530f561ad5bdebd4e88643a1f08eb8e922030655 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpAppointmentServiceImpl.java @@ -0,0 +1,18 @@ +package cn.sh.stc.sict.theme.hphy.service.impl; + +import cn.sh.stc.sict.theme.hphy.dao.HpAppointmentMapper; +import cn.sh.stc.sict.theme.hphy.model.HpAppointment; +import cn.sh.stc.sict.theme.hphy.service.HpAppointmentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * [黄浦]预约记录(HpAppointment)表服务实现类 + * + * @author makejava + * @since 2021-01-28 10:35:56 + */ +@Service("hpAppointmentService") +public class HpAppointmentServiceImpl extends ServiceImpl implements HpAppointmentService { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..761ad5e613d6fd233ff49787a0a8319c7f6c1d9c --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDeptInfoServiceImpl.java @@ -0,0 +1,18 @@ +package cn.sh.stc.sict.theme.hphy.service.impl; + +import cn.sh.stc.sict.theme.hphy.dao.HpDeptInfoMapper; +import cn.sh.stc.sict.theme.hphy.model.HpDeptInfo; +import cn.sh.stc.sict.theme.hphy.service.HpDeptInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * (HpDeptInfo)表服务实现类 + * + * @author makejava + * @since 2021-01-28 10:35:58 + */ +@Service("hpDeptInfoService") +public class HpDeptInfoServiceImpl extends ServiceImpl implements HpDeptInfoService { + +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..d728961f394b9c72a1a81834df194b67404b0ff4 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java @@ -0,0 +1,22 @@ +package cn.sh.stc.sict.theme.hphy.service.impl; + +import cn.sh.stc.sict.theme.hphy.dao.HpDocInfoMapper; +import cn.sh.stc.sict.theme.hphy.model.HpDocInfo; +import cn.sh.stc.sict.theme.hphy.service.HpDocInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * (HpDocInfo)表服务实现类 + * + * @author makejava + * @since 2021-01-28 10:35:59 + */ +@Service("hpDocInfoService") +public class HpDocInfoServiceImpl extends ServiceImpl implements HpDocInfoService { + + @Override + public boolean doctorExist(String resourceCode) { + return this.getById(resourceCode) != null; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpHosInfoServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpHosInfoServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..7e8973cf6b300b2b7ed422818aeb29c739c051b6 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpHosInfoServiceImpl.java @@ -0,0 +1,22 @@ +package cn.sh.stc.sict.theme.hphy.service.impl; + +import cn.sh.stc.sict.theme.hphy.dao.HpHosInfoMapper; +import cn.sh.stc.sict.theme.hphy.model.HpHosInfo; +import cn.sh.stc.sict.theme.hphy.service.HpHosInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * (HpHosInfo)表服务实现类 + * + * @author makejava + * @since 2021-01-28 10:36:00 + */ +@Service("hpHosInfoService") +public class HpHosInfoServiceImpl extends ServiceImpl implements HpHosInfoService { + + @Override + public boolean hospitalExist(String hosOrgCode) { + return this.getById(hosOrgCode) != null; + } +} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/DeptInfo.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/DeptInfo.java index 958e83114d206f2da2c13bb4c6e8a50d47a91a7c..1ed699d9b60bb948cc0aaefaff453dccca3e0869 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/DeptInfo.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/DeptInfo.java @@ -1,5 +1,6 @@ package cn.sh.stc.sict.theme.hphy.wd; +import cn.hutool.core.util.StrUtil; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.Data; @@ -16,4 +17,9 @@ public class DeptInfo { public String indexNo; public String oneDeptCode; public String oneDeptName; + + public DeptInfo(String hosOrgCode){ + this.hosOrgCode = hosOrgCode; + } + public DeptInfo(){} } diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/HosInfo.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/HosInfo.java index a13f337eb52f43a4929a32a243bcf9c78232e1d1..e0a2c734f2b77e8e51d741a8afeba4bd4b98c92b 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/HosInfo.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/HosInfo.java @@ -28,4 +28,9 @@ public class HosInfo { public String orgSort; public String hospitalArea; public String hospitalImage; + + public HosInfo(){} + public HosInfo(String hosOrgCode){ + this.hosOrgCode = hosOrgCode; + } } diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/HpAppointmentMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/HpAppointmentMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..3907ad1e8cfd0a96923319359451220121b7a89b --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/HpAppointmentMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, hos_org_code, one_dept_code, dept_code, order_type, resource_code, channel_code, schedule_id, num_source_id, pay_mode, patient_type, patient_id, medi_card_id, medi_card_type, user_card_type, user_card_id, user_name, user_phone, user_sex, user_BD, user_cont_add, replace_user_card_type, replace_user_card_id, replace_user_name, ip_addr, mac_addr, out_hospital_code, out_order_id, num_source_date, start_time, end_time, platform_type, platform_code, channel_name, num_source_from + \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/HpDeptInfoMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/HpDeptInfoMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..538ca6b6f48cc7dc6f95c9282668e85aa2f71289 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/HpDeptInfoMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + id, hos_org_code, one_dept_code, dept_code, hos_name, one_dept_name, dept_name, normdept_code, normdept_name, dept_desc, index_no + \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/HpDocInfoMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/HpDocInfoMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..b63dbe95476f9dec5744cb4f977d17db0ae3a62a --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/HpDocInfoMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + resource_code, hos_org_code, one_dept_code, dept_code, hos_name, one_dept_name, dept_name, resource_name, doct_tile, person_type, person_id, doct_img, doct_sex, doct_info, doct_specialty, index_no + \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/HpHosInfoMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/HpHosInfoMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..051d0cdef77993c2ef456db082b2e1bca74afbbb --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/HpHosInfoMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + hos_org_code, org_code, hos_name, hospital_add, hospital_rule, hospital_web, traffic_guide, hospital_desc, hospital_tel, hospital_grade, hospital_level, hospital_type, pay_mode, order_mode, is_sp_time, short_name, org_sort, hospital_area, hospital_image + \ No newline at end of file