Преглед изворни кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/PostFilter.java
wangzhinan пре 4 година
родитељ
комит
ea2042ff8a
100 измењених фајлова са 7596 додато и 48 уклоњено
  1. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java
  2. 29 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  3. 397 1
      common/common-entity/sql记录
  4. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  5. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultTeamDo.java
  6. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  7. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/assistance/EmergencyAssistanceDO.java
  8. 144 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/common/BusinessSysDictDO.java
  9. 83 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/common/DictDietDO.java
  10. 92 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseCatalogueDO.java
  11. 254 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseDO.java
  12. 155 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseSalesOrderRecordDO.java
  13. 60 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CustomerServiceDO.java
  14. 248 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/PatientOrderRefundDO.java
  15. 142 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/RecruitStudentsDO.java
  16. 198 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/course/RecruitStudentsRecordDO.java
  17. 13 1
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientDevice.java
  18. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java
  19. 88 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachCancelLogDO.java
  20. 80 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachConclusionDO.java
  21. 79 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachDoctorStatusDO.java
  22. 193 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachFeeDetailDO.java
  23. 1195 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachOrderDO.java
  24. 89 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachPatientConfirmLogDO.java
  25. 93 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachProcessLogDO.java
  26. 99 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/exam/ChildrenExaminationRecordDO.java
  27. 100 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/message/OrgNoticeDO.java
  28. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java
  29. 10 4
      common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java
  30. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderRefundDO.java
  31. 1 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/PageEnvelop.java
  32. 27 2
      common/common-util/src/main/java/com/yihu/jw/util/common/GpsUtil.java
  33. 12 0
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  34. 73 0
      common/common-util/src/main/java/com/yihu/jw/util/tencent/TencentVODUtil.java
  35. 3 0
      gateway/ag-basic/src/main/java/com/yihu/AgBasicServer.java
  36. 28 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/DidiFilterProcessor.java
  37. 34 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/ErrorExtFilter.java
  38. 1 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java
  39. 2 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  40. 18 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseCatalogueDao.java
  41. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseDao.java
  42. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseSalesOrderRecordDao.java
  43. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CustomerServiceDao.java
  44. 21 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/PatientOrderRefundDao.java
  45. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/RecruitStudentsDao.java
  46. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/RecruitStudentsRecordDao.java
  47. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/BusinessSysDictDao.java
  48. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDietDao.java
  49. 99 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseCatalogueEndpoint.java
  50. 140 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseEndpoint.java
  51. 116 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseSalesOrderRecordEndpoint.java
  52. 112 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CustomerServiceEndpoint.java
  53. 117 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/PatientOrderRefundEndpoint.java
  54. 113 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/RecruitStudentsEndpoint.java
  55. 151 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/RecruitStudentsRecordEndpoint.java
  56. 109 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/BusinessSysDictEndpoint.java
  57. 109 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDietEndpoint.java
  58. 21 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java
  59. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  60. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseCatalogueService.java
  61. 49 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseSalesOrderRecordService.java
  62. 54 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseService.java
  63. 24 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CustomerServiceSerivce.java
  64. 67 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/PatientOrderRefundService.java
  65. 151 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsRecordService.java
  66. 39 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsService.java
  67. 218 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BusinessSysDictService.java
  68. 23 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictDietService.java
  69. 6 3
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  70. 5 0
      svr/svr-base/src/main/resources/application.yml
  71. 20 4
      svr/svr-cloud-care/pom.xml
  72. 152 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/SwaggerConfig.java
  73. 21 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseCatalogueDao.java
  74. 16 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseDao.java
  75. 17 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseSalesOrderRecordDao.java
  76. 20 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CustomerServiceDao.java
  77. 21 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/PatientOrderRefundDao.java
  78. 16 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/RecruitStudentsDao.java
  79. 20 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/RecruitStudentsRecordDao.java
  80. 5 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java
  81. 18 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachCancelLogDao.java
  82. 17 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachConclusionDao.java
  83. 33 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachDoctorStatusDao.java
  84. 39 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachFeeDetailDao.java
  85. 50 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachOrderDao.java
  86. 14 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachPatientConfirmLogDao.java
  87. 21 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachProcessLogDao.java
  88. 11 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/exam/ChildrenExaminationRecordDao.java
  89. 11 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/OrgNoticeDao.java
  90. 14 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/UserNoticeDao.java
  91. 4 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/assistance/EmergencyAssistanceEndpoint.java
  92. 20 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/CourseEndpoint.java
  93. 98 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/DoctorCourseEndpoint.java
  94. 99 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/PatientCourseEndpoint.java
  95. 10 12
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java
  96. 3 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java
  97. 61 8
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java
  98. 554 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/DoctorDoorCoachOrderController.java
  99. 250 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/PatientDoorCoachOrderController.java
  100. 0 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/exam/ChildrenExaminationEndpoint.java

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java

@ -19,6 +19,9 @@ public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyH
    WlyyHospitalSysDictDO findById(String id);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1  and  dictCode is null order by sort asc")
    List<WlyyHospitalSysDictDO> findByDictNameNotNull(String dictName);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
    @Query("from WlyyHospitalSysDictDO where 1=1")
    List<WlyyHospitalSysDictDO> findAlldict();

+ 29 - 0
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -20,6 +20,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientGroupDao;
import com.yihu.jw.patient.dao.BasePatientGroupDictDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyInspectionVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
@ -37,6 +38,7 @@ import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.repository.CrudRepository;
@ -247,6 +249,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        }
        BasePatientDO basePatientDO1 = basePatientDao.findById(basePatientDO.getId());
        if (null!=basePatientDO1){
            basePatientDO1.setName(basePatientDO.getName());
            basePatientDO1.setMobile(basePatientDO.getMobile());
            basePatientDO1.setIdcard(basePatientDO.getIdcard());
@ -642,4 +645,30 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        return null;
    }
    public PageEnvelop pageByCondition(String name, Integer archiveType, Integer archiveStatus,int page,int size){
        List<BasePatientVO> list = new ArrayList<>();
        if (page>0){
            page--;
        }else{
            page=0;
        }
        String sqlCount = "select count(*) from base_patient where 1=1 ";
        String sql = "select * from base_patient where 1=1 ";
        String sqlCondition = "";
        if (StringUtils.isNotBlank(name)){
            sqlCondition += " and (name like '%"+name+"%' or idcard like '%"+name+"%' or mobile like '%"+name+"%') ";
        }
        if (archiveType!=null){
            sqlCondition += " and archive_type ="+archiveType;
        }
        if (archiveStatus!=null){
            sqlCondition += " and archive_status ="+archiveStatus;
        }
        Long count = jdbcTemplate.queryForObject(sqlCount+sqlCondition,Long.class);
        sqlCondition +=" limit "+page*size+","+size;
        list = jdbcTemplate.query(sql+sqlCondition,new BeanPropertyRowMapper<>(BasePatientVO.class));
        return PageEnvelop.getSuccessListWithPage("success",list,page,size,count);
    }
}

+ 397 - 1
common/common-entity/sql记录

@ -487,4 +487,400 @@ CREATE TABLE `base_device_sos_log` (
  `sos_send_message` varchar(500) DEFAULT NULL COMMENT '紧急救助发起返回消息',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备紧急救助日志表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备紧急救助日志表';
-- 2021-05-10 lb
ALTER table base.base_emergency_assistance_order add column `order_source` tinyint(4) DEFAULT '1' COMMENT '工单发起来源状态 1APP 2手环3居家报警'
-- 2021-05-10 ysj
ALTER table base.base_business_order_refund add column `enclosure` VARCHAR(3000)  COMMENT '附件';
DROP TABLE IF EXISTS `base_course`;
CREATE TABLE `base_course` (
  `id` varchar(50) NOT NULL,
  `type` varchar(1) DEFAULT NULL COMMENT '课程类型',
  `name` varchar(50) DEFAULT NULL COMMENT '课程名称',
  `org_code` varchar(50) DEFAULT NULL COMMENT '机构id',
  `org_name` varchar(50) DEFAULT NULL COMMENT '机构名称',
  `doctor` varchar(50) DEFAULT NULL COMMENT '教师id',
  `doctor_name` varchar(50) DEFAULT NULL COMMENT '教师名称',
  `live_time` datetime DEFAULT NULL COMMENT '直播时间',
  `live_status` varchar(1) DEFAULT NULL COMMENT '直播状态',
  `live_duration` varchar(10) DEFAULT NULL COMMENT '直播时长',
  `course_cover` varchar(300) DEFAULT NULL COMMENT '课程封面',
  `status` varchar(1) DEFAULT NULL COMMENT '上架状态',
  `fee` decimal(10,2) DEFAULT NULL COMMENT '费用',
  `introduction` varchar(3000) DEFAULT NULL COMMENT '课程简介',
  `del` tinyint(1) DEFAULT NULL COMMENT '删除标志 1正常 0删除',
  `create_time` datetime DEFAULT NULL,
  `create_user` varchar(50) DEFAULT NULL,
  `create_user_name` varchar(50) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='课程表';
DROP TABLE IF EXISTS `base_course_catalogue`;
CREATE TABLE `base_course_catalogue` (
  `id` varchar(50) NOT NULL,
  `course_id` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL COMMENT '目录名称',
  `type` varchar(1) DEFAULT NULL COMMENT '目录类型',
  `content` varchar(3000) DEFAULT NULL COMMENT '小节内容',
  `video_url` varchar(300) DEFAULT NULL COMMENT '小节视频url',
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='课程目录表';
DROP TABLE IF EXISTS `base_patient_order_refund`;
CREATE TABLE `base_patient_order_refund` (
  `id` varchar(50) NOT NULL,
  `patient` varchar(50) DEFAULT NULL COMMENT '居民code',
  `patient_name` varchar(50) DEFAULT NULL COMMENT '居民名字',
  `order_price` varchar(0) DEFAULT NULL COMMENT '订单金额',
  `refund_price` varchar(0) DEFAULT NULL COMMENT '退款金额',
  `refund_desc` varchar(500) DEFAULT NULL COMMENT '退款原因',
  `status` tinyint(1) DEFAULT NULL COMMENT '1待退款2已退款',
  `refund_time` datetime DEFAULT NULL COMMENT '退款时间',
  `create_time` datetime DEFAULT NULL COMMENT '退款申请时间',
  `buy_time` datetime DEFAULT NULL COMMENT '购买时间',
  `enclosure` varchar(3000) DEFAULT NULL COMMENT '附件',
  `bussiness_order_refund_id` int(11) DEFAULT NULL COMMENT '退款表id',
  `order_id` varchar(50) DEFAULT NULL COMMENT '订单id',
  `type` varchar(1) DEFAULT NULL COMMENT '类型 1招生报名,2课程',
  `org_code` varchar(50) DEFAULT NULL,
  `org_name` varchar(50) DEFAULT NULL COMMENT '课程名称/招生标题',
  `title` varchar(255) DEFAULT NULL,
  `mobile` varchar(20) DEFAULT NULL COMMENT '联系电话',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民发起的退款记录表';
DROP TABLE IF EXISTS `base_recruit_students`;
CREATE TABLE `base_recruit_students` (
  `id` varchar(50) NOT NULL,
  `org_code` varchar(50) DEFAULT NULL COMMENT '招生机构',
  `org_name` varchar(50) DEFAULT NULL COMMENT '招生机构名称',
  `theme` varchar(100) DEFAULT NULL COMMENT '招生主题',
  `start_time` datetime DEFAULT NULL COMMENT '报名开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '报名结束时间',
  `num` int(11) DEFAULT NULL COMMENT '招生名额',
  `fee` decimal(10,2) DEFAULT NULL COMMENT '报名费用',
  `admitted_num` int(11) DEFAULT NULL COMMENT '已录取人数',
  `del` tinyint(1) DEFAULT NULL COMMENT '删除标志 1正常 0删除',
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='招生表';
DROP TABLE IF EXISTS `base_recruit_students_record`;
CREATE TABLE `base_recruit_students_record` (
  `id` varchar(50) NOT NULL,
  `recruit_students_id` varchar(50) DEFAULT NULL COMMENT '招生id',
  `recruit_name` varchar(100) DEFAULT NULL COMMENT '招生名称',
  `patient` varchar(50) DEFAULT NULL,
  `patient_name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `sex` varchar(1) DEFAULT NULL COMMENT '性别',
  `org_code` varchar(50) DEFAULT NULL COMMENT '机构code',
  `org_name` varchar(50) DEFAULT NULL COMMENT '机构名称',
  `mobile` varchar(20) DEFAULT NULL COMMENT '手机',
  `status` varchar(1) DEFAULT NULL COMMENT '状态(待审核、待支付、已支付、已退费、审核未通过)',
  `del` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='招生记录表';
DROP TABLE IF EXISTS `base_customer_service`;
CREATE TABLE `base_customer_service` (
  `id` varchar(50) NOT NULL,
  `org_code` varchar(50) DEFAULT NULL,
  `org_name` varchar(50) DEFAULT NULL,
  `team_id` varchar(50) DEFAULT NULL,
  `team_name` varchar(50) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构客服团队表';
DROP TABLE IF EXISTS `base_children_examination_record`;
CREATE TABLE `base_children_examination_record` (
  `id` varchar(50) NOT NULL,
  `type` varchar(1) DEFAULT NULL COMMENT '体检类型',
  `exam_time` datetime DEFAULT NULL COMMENT '体检时间',
  `org_code` varchar(50) DEFAULT NULL COMMENT '体检机构code',
  `org_name` varchar(50) DEFAULT NULL COMMENT '体检机构',
  `month_age` varchar(10) DEFAULT NULL COMMENT '月龄',
  `height` varchar(10) DEFAULT NULL COMMENT '身高',
  `weight` varchar(10) DEFAULT NULL COMMENT '体重',
  `head_circumference` varchar(10) DEFAULT NULL COMMENT '头围',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='儿童体检记录表';
-- 计算2点距离函数
CREATE FUNCTION funDistance(lat1 DOUBLE,lon1 DOUBLE,lat2 DOUBLE,lon2 DOUBLE) RETURNS DOUBLE
BEGIN DECLARE juli DOUBLE;
SET juli = acos(sin(lat1 * PI() / 180) * sin(lat2 * PI() / 180) + cos(lat1 * PI() / 180) * cos(lat2 * PI() / 180) * cos(lon1 * PI() / 180 - lon2 * PI() / 180)) * 6378.137;
RETURN juli;
END;
DROP TABLE IF EXISTS `base_business_sys_dict`;
CREATE TABLE `base_business_sys_dict` (
  `id` varchar(50) NOT NULL,
  `dict_name` varchar(50) DEFAULT NULL COMMENT '所属字典',
  `dict_code` varchar(300) DEFAULT NULL COMMENT '字典项代码',
  `dict_value` text COMMENT '字典项所属值',
  `py_code` varchar(50) DEFAULT NULL COMMENT '拼音缩写码',
  `sort` int(11) DEFAULT NULL COMMENT '排序',
  `create_time` varchar(50) DEFAULT NULL,
  `update_time` varchar(50) DEFAULT NULL,
  `img_url` varchar(1000) DEFAULT NULL COMMENT '图片地址',
  `model_name` varchar(50) DEFAULT NULL COMMENT '模块名称',
    `ext1` varchar(50) DEFAULT NULL COMMENT '备用字段1,托育字典服务项的时候表示费用',
    `ext2` varchar(50) DEFAULT NULL COMMENT '备用字段2 ',
  PRIMARY KEY (`id`),
  KEY `dict_name` (`dict_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='托育业务字典表';
CREATE TABLE `wlyy_devices` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `apply_date` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '申请日期',
  `org_name` varchar(255) DEFAULT NULL COMMENT '机构名称',
  `linkman` varchar(255) DEFAULT NULL COMMENT '联系人',
  `tel` varchar(255) DEFAULT NULL COMMENT '联系电话',
  `server_ip` varchar(255) DEFAULT NULL COMMENT '服务IP地址',
  `device_name` varchar(255) DEFAULT NULL COMMENT '设备名称',
  `device_model` varchar(255) DEFAULT NULL COMMENT '型号',
  `device_code` varchar(255) DEFAULT NULL COMMENT '设备唯一标识',
  `manufacturer_code` varchar(255) DEFAULT NULL COMMENT '厂商代码',
  `manufacturer` varchar(255) DEFAULT NULL COMMENT '厂家名称',
  `address` varchar(255) DEFAULT NULL COMMENT '厂家地址',
  `representative` varchar(255) DEFAULT NULL COMMENT '法人代表',
  `applicant_name` varchar(255) DEFAULT NULL COMMENT '申请注册人',
  `applicant_identity` varchar(255) DEFAULT NULL COMMENT '申请人身份证号',
  `applicant_tel` varchar(255) DEFAULT NULL COMMENT '申请人手机',
  `applicant_mail` varchar(255) DEFAULT NULL COMMENT '申请人邮箱',
  `sim` varchar(50) DEFAULT NULL COMMENT 'sim卡号',
  `manufacturer_id` varchar(50) DEFAULT NULL COMMENT '厂商id',
  `is_grant` int(2) DEFAULT '0' COMMENT '是否发放(0否1是)',
  `grant_admin_team` varchar(50) DEFAULT NULL COMMENT '发放的患者所在团队',
  `grant_org_code` varchar(50) DEFAULT NULL COMMENT '发放所在机构',
  `is_binding` int(2) DEFAULT '0' COMMENT '是否绑定(0否 1 是)',
  `binding_count` varchar(50) DEFAULT NULL COMMENT '绑定次数({"1":"0", "2":"0"})',
  `grant_time` datetime DEFAULT NULL COMMENT '发放时间',
  `grant_doctor` varchar(50) DEFAULT NULL COMMENT '发放医生code',
  `grant_doctor_name` varchar(50) DEFAULT NULL COMMENT '发放医生姓名',
  `neighborhood_committee_code` varchar(12) DEFAULT NULL COMMENT '居委会code',
  `neighborhood_committee_name` varchar(100) DEFAULT NULL COMMENT '居委会名称',
  PRIMARY KEY (`id`),
  KEY `idx_device_code` (`device_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='厦门设备信息表';
-- 2021-05-12 lb
alter table base.base_business_sys_dict add column org_code varchar(50) default null comment '归属机构';
-- 2021-05-13 lb
CREATE TABLE `base_door_coach_order` (
  `id` varchar(50) NOT NULL DEFAULT '',
  `number` varchar(50) DEFAULT NULL COMMENT '服务编号',
  `proxy_patient` varchar(50) DEFAULT NULL COMMENT '代理发起工单的居民code,替父母,孩子等发起工单',
  `proxy_patient_name` varchar(10) DEFAULT NULL COMMENT '代理发起工单的居民code,替父母,孩子等发起工单',
  `proxy_patient_phone` varchar(15) DEFAULT NULL COMMENT '代理发起工单的居民联系电话',
  `patient` varchar(50) DEFAULT NULL COMMENT '被服务的居民code,发起工单的居民的亲属',
  `patient_name` varchar(10) DEFAULT NULL COMMENT '被服务的居民姓名,发起工单的居民的亲属',
  `patient_phone` varchar(15) DEFAULT NULL COMMENT '被服务的居民联系电话',
  `patient_relation` varchar(10) DEFAULT NULL COMMENT '发起人与被服务人的关系:自己,父亲,母亲,儿子等',
  `dispatcher` varchar(50) DEFAULT NULL COMMENT '调度员code',
  `dispatcher_name` varchar(50) DEFAULT NULL COMMENT '调度员name',
  `patient_expected_serve_time` varchar(200) DEFAULT NULL COMMENT '居民期望服务时间',
  `serve_desc` varchar(200) DEFAULT NULL COMMENT '居民自己服务描述',
  `serve_town` varchar(100) DEFAULT NULL COMMENT '上门服务的区',
  `serve_address` varchar(100) DEFAULT NULL COMMENT '上门服务详细地址',
  `serve_lat` varchar(100) DEFAULT NULL COMMENT '上门服务地址纬度',
  `serve_lon` varchar(100) DEFAULT NULL COMMENT '上门服务地址经度',
  `remark` varchar(200) DEFAULT NULL COMMENT '调度员备注',
  `is_patient_confirm` int(1) DEFAULT NULL COMMENT '居民对工单需要服务情况是否已确认,0-未确认,1-已确认 2-不同意',
  `patient_confirm_time` timestamp NULL DEFAULT NULL COMMENT '居民对工单需要服务情况确认时间',
  `is_trans_other_org` int(1) DEFAULT NULL COMMENT '工单是否转给其他机构,0-不转,1-已转',
  `transed_org_code` varchar(50) DEFAULT NULL COMMENT '最后转接的机构code',
  `transed_dispatcher` varchar(50) DEFAULT NULL COMMENT '最后转接的机构调度员code',
  `transed_dispatcher_name` varchar(50) DEFAULT NULL COMMENT '最后转接的机构调度员name',
  `total_fee` decimal(10,2) DEFAULT NULL COMMENT '服务总的支付费用',
  `doctor` varchar(50) DEFAULT NULL COMMENT '接单的医生code',
  `doctor_name` varchar(50) DEFAULT NULL COMMENT '接单的医生name',
  `doctor_type` varchar(50) DEFAULT NULL COMMENT '接单的医生类型:医生,健管师,护士等',
  `doctor_arriving_time` varchar(200) DEFAULT NULL COMMENT '医生预计到达时间',
  `doctor_sign_time` timestamp NULL DEFAULT NULL COMMENT '医生签到时间',
  `doctor_sign_way` int(1) DEFAULT NULL COMMENT '医生签到方式:1-定位,2-扫码,3-拍照',
  `doctor_sign_location` varchar(50) DEFAULT NULL COMMENT '医生签到位置,记录详细地址',
  `doctor_sign_img` varchar(3000) DEFAULT NULL COMMENT '医生签到照片',
  `patient_confirm_finish_way` int(1) DEFAULT NULL COMMENT '居民确认结束服务方式:1-电子签名,2-手持身份证拍照',
  `patient_confirm_finish_img` varchar(200) DEFAULT NULL COMMENT '居民确认结束服务照片',
  `patient_confirm_finish_time` timestamp NULL DEFAULT NULL COMMENT '居民确认医生结束服务时间',
  `present_imgs` varchar(3000) DEFAULT NULL COMMENT '医生诊疗现场照片,最多9张,逗号分隔',
  `exam_paper_status` int(1) DEFAULT NULL COMMENT '是否需要上传补录报告:0-不需要,1-需要,待补录;2-需要,已补录',
  `exam_paper_imgs` varchar(3000) DEFAULT NULL COMMENT '医生上传居民的化验检查报告照片',
  `exam_paper_upload_time` timestamp NULL DEFAULT NULL COMMENT '化验检查报告补录时间',
  `exam_paper_upload_way` int(1) DEFAULT NULL COMMENT '化验检查报告补录方式,1-拍照补录,2-接口数据',
  `status` int(1) DEFAULT NULL COMMENT '工单状态:-1-已取消,1-待(调度员)派单,2-待(医生)接单,3-已接单,4-签到,5-登记服务小结,6-已完成',
  `complete_time` timestamp NULL DEFAULT NULL COMMENT '工单完成时间(对工单评价完即工单完成)',
  `cancel_type` int(1) DEFAULT NULL COMMENT '取消类型:1-调度员取消,2-居民取消,3-医生取消',
  `cancel_reason` varchar(200) DEFAULT NULL COMMENT '取消理由',
  `cancel_time` timestamp NULL DEFAULT NULL COMMENT '取消时间',
  `pay_way` int(1) DEFAULT NULL COMMENT '付款方式:1-微信支付,2-线下支付(居民自己向医院支付,具体怎么支付由医院来定)',
  `pay_number` varchar(100) DEFAULT NULL COMMENT '支付流水号',
  `pay_time` timestamp NULL DEFAULT NULL COMMENT '支付时间',
  `dispatcher_response_time` timestamp NULL DEFAULT NULL COMMENT '调度员响应时间(派单时间或取消时间)',
  `service_response_time` timestamp NULL DEFAULT NULL COMMENT '服务医生响应时间(第一条咨询或者接单时间)',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者名称',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  `expected_doctor_name` varchar(10) DEFAULT '' COMMENT '居民期望服务的医生姓名',
  `hospital` varchar(50) DEFAULT NULL COMMENT '服务机构',
  `conclusion_status` int(1) DEFAULT NULL COMMENT '服务小结登记状态:1待补录;2-已补录',
  `prescription_status` int(1) DEFAULT NULL COMMENT '开方状态:1已完成,0未开方',
  `prescription_code` varchar(100) DEFAULT NULL COMMENT '处方单号,多个用逗号隔开',
  `prescription_time` timestamp NULL DEFAULT NULL COMMENT '开方完成时间',
  `outpatient_id` varchar(50) DEFAULT NULL COMMENT '关联门诊记录',
  `type` tinyint(2) DEFAULT '1' COMMENT '发起类型(1本人发起 2家人待预约 3医生代预约)',
  `authorize_image` varchar(500) DEFAULT NULL COMMENT '电子健康卡授权图片',
  `relation_code` varchar(50) DEFAULT NULL COMMENT '业务关联',
  `service_status` varchar(15) DEFAULT NULL COMMENT '服务类型 1-预约项目 2-即时项目',
  `order_info` varchar(15) DEFAULT NULL COMMENT '工单详情 0-未推送 1-未确认 2-已确认',
  `shortcut_type` char(1) DEFAULT NULL COMMENT '快捷类型,1是快捷类型,其他值不是',
  `followup_date` varchar(50) DEFAULT NULL COMMENT '随访时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导服务工单';
CREATE TABLE `base_door_coach_fee_detail` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) DEFAULT NULL COMMENT '工单id',
  `type` int(1) NOT NULL COMMENT '费用类型,1-服务项费用,2-医生出诊费用',
  `code` varchar(50) DEFAULT NULL COMMENT '居民请求的服务项code,医生出诊费用code',
  `name` varchar(50) DEFAULT NULL COMMENT '居民请求的服务项名称,医生出诊费用名称',
  `fee` decimal(10,2) DEFAULT NULL COMMENT '费用',
  `fee_discount` decimal(10,2) DEFAULT NULL COMMENT '折扣费用',
  `number` int(1) DEFAULT NULL COMMENT '数量',
  `status` int(1) NOT NULL COMMENT '状态,1-居民新增(预约),2-医生新增,3-医生删除',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者名称',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  `pay_status` tinyint(1) DEFAULT NULL COMMENT '付款状态:0未付款 1已付款',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导服务工单价格明细(服务项价格,医生出诊费用)';
CREATE TABLE `base_door_coach_doctor_status` (
  `id` varchar(50) NOT NULL,
  `doctor` varchar(50) NOT NULL COMMENT '医生code',
  `status` int(1) NOT NULL DEFAULT '1' COMMENT '医生状态:1-待派单,2-待接单,3-待服务,4-服务中,5-停止接单',
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '转接时间',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医生上门辅导服务工单状态情况';
CREATE TABLE `base_door_coach_process_log` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `status` int(1) NOT NULL COMMENT '工单处理状态',
  `dispatcher` varchar(50) DEFAULT NULL COMMENT '变更状态的调度员',
  `dispatcher_name` varchar(50) DEFAULT NULL COMMENT '变更状态的调度员姓名',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导工单状态变更记录(调度员操作记录)';
CREATE TABLE `base_door_coach_conclusion` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `patient` varchar(50) DEFAULT NULL COMMENT '工单服务的居民',
  `patient_name` varchar(50) DEFAULT NULL COMMENT '居民姓名',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生',
  `doctor_name` varchar(50) DEFAULT NULL COMMENT '医生姓名',
  `conclusion` varchar(2000) DEFAULT NULL COMMENT '处置小结',
  `conclusion_img` varchar(1000) DEFAULT NULL COMMENT '服务相关附件',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orderId` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导工单服务小结';
CREATE TABLE `base_door_coach_patient_confirm_log` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `patient` varchar(50) NOT NULL COMMENT '居民',
  `patient_name` varchar(50) NOT NULL COMMENT '居民姓名',
  `type` int(1) NOT NULL COMMENT '确认操作类型:1-确认基础信息无误或变更,2-确认上门医生变更上门信息,3-同意工单转接',
  `description` varchar(200) DEFAULT NULL COMMENT '操作描述',
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '转接时间',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导服务工单居民确认操作日志记录';
CREATE TABLE `base_door_coach_cancel_log` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `patient` varchar(50) NOT NULL COMMENT '居民code',
  `cancel_type` int(1) NOT NULL COMMENT '取消类型:1-调度员取消,2-居民取消',
  `cancel_reason` varchar(50) DEFAULT NULL COMMENT '取消理由',
  `time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '取消时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='上门辅导工单取消记录';
-- 2021-05-17 ysj
DROP TABLE IF EXISTS `base_course_sales_order_record`;
CREATE TABLE `base_course_sales_order_record` (
  `id` varchar(50) NOT NULL,
  `patient` varchar(50) DEFAULT NULL,
  `patient_name` varchar(5) DEFAULT NULL,
  `org_code` varchar(50) DEFAULT NULL,
  `org_name` varchar(50) DEFAULT NULL,
  `course_id` varchar(50) DEFAULT NULL COMMENT '课程id',
  `course_name` varchar(100) DEFAULT NULL COMMENT '课程名称',
  `buy_time` datetime DEFAULT NULL COMMENT '购买时间',
  `status` varchar(1) DEFAULT NULL COMMENT '状态',
  `price` decimal(10,2) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='课程销售订单记录表';
-- 2021-05-18
create table base_org_notice(
	id varchar(50) not null,
	org_code varchar(50) default null COMMENT '机构code',
	org_name varchar(50) default null COMMENT '机构名称',
	status tinyint(1) DEFAULT NULL COMMENT '状态(1待发布,2已发布)',
	del tinyint(1) DEFAULT '1' COMMENT '删除标志(1正常,0删除)',
	title VARCHAR(50) default null comment '通知标题',
	content text default null comment '通知内容',
	img VARCHAR(1000) default null COMMENT '附件',
	notice_time datetime default null COMMENT '通知时间',
	create_time datetime default null,
	PRIMARY KEY(id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='机构通知表';
ALTER table base_org_notice add column create_user varchar(50) DEFAULT NULL

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -284,7 +284,7 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    private String visitTime;
    /**
     * 类型 1社区医生,2助老员
     * 类型 1社区医生,2助老员, 3教师
     */
    private Integer level;
    private String doctorLat;//医生当前定位地址纬度

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultTeamDo.java

@ -23,7 +23,7 @@ public class ConsultTeamDo extends UuidIdentityEntity {
	private Integer type;           //  1、15三师咨询,2、家庭医生咨询,
	// 6、患者名医咨询 7医生名医咨询 8续方咨询 9、16在线复诊咨询(居民直接咨询专家)
	// 10医生发起的求助 11思明区上门服务在线咨询
	// 13、互联网医院专家咨询, 20紧急救助咨询
	// 13、互联网医院专家咨询, 20紧急救助咨询, 21上门辅导咨询
	private String patient;         // 提问者标识
	private String name;            // 患者姓名
	private Integer sex;            // 患者性别

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -279,6 +279,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String bloodName;
    private String marriageName;
    public String getCardType() {
        return cardType;
    }

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/assistance/EmergencyAssistanceDO.java

@ -38,6 +38,7 @@ public class EmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
    private Date completeTime;//完成时间
    private String teamCode;
    private Integer type; //发起类型(1本人发起 2家人待预约 3医生代预约)
    private Integer orderSource;//工单发起来源状态 1APP 2手环 3居家报警
    private String sendMessage;//
    private Integer patientAge;
@ -290,4 +291,12 @@ public class EmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
    public void setOtherDoctorDistance(String otherDoctorDistance) {
        this.otherDoctorDistance = otherDoctorDistance;
    }
    public Integer getOrderSource() {
        return orderSource;
    }
    public void setOrderSource(Integer orderSource) {
        this.orderSource = orderSource;
    }
}

+ 144 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/common/BusinessSysDictDO.java

@ -0,0 +1,144 @@
package com.yihu.jw.entity.care.common;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description:
 */
@Entity
@Table(name = "base_business_sys_dict")
public class BusinessSysDictDO extends UuidIdentityEntityWithTime {
    /**
     * 所属字典
     */
    private String dictName;
    /**
     * 字典项代码
     */
    private String dictCode;
    /**
     * 字典项所属值
     */
    private String dictValue;
    /**
     * 拼音缩写码
     */
    private String pyCode;
    /**
     * 排序
     */
    private Integer sort;
    private String imgUrl;
    private String modelName;
    /**
     * 备用字段1,托育字典服务项的时候表示费用
     */
    private String ext1;
    /**
     * 备用字段2
     */
    private String ext2;
    /**
     * 归属机构
     */
    private String orgCode;
    @Column(name = "model_name")
    public String getModelName() {
        return modelName;
    }
    public void setModelName(String modelName) {
        this.modelName = modelName;
    }
    @Column(name = "img_url")
    public String getImgUrl() {
        return imgUrl;
    }
    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }
    @Column(name = "dict_name")
    public String getDictName() {
        return dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    @Column(name = "dict_code")
    public String getDictCode() {
        return dictCode;
    }
    public void setDictCode(String dictCode) {
        this.dictCode = dictCode;
    }
    @Column(name = "dict_value")
    public String getDictValue() {
        return dictValue;
    }
    public void setDictValue(String dictValue) {
        this.dictValue = dictValue;
    }
    @Column(name = "py_code")
    public String getPyCode() {
        return pyCode;
    }
    public void setPyCode(String pyCode) {
        this.pyCode = pyCode;
    }
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    @Column(name = "ext1")
    public String getExt1() {
        return ext1;
    }
    public void setExt1(String ext1) {
        this.ext1 = ext1;
    }
    @Column(name = "ext2")
    public String getExt2() {
        return ext2;
    }
    public void setExt2(String ext2) {
        this.ext2 = ext2;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
}

+ 83 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/common/DictDietDO.java

@ -0,0 +1,83 @@
package com.yihu.jw.entity.care.common;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description: 饮食字典
 */
@Entity
@Table(name="dict_diet")
public class DictDietDO extends UuidIdentityEntity {
    /**
     * '食物名称'
     */
    private String name;
    /**
     * '食物分类'
     */
    private String type;
    private String typeName;
    /**
     *'热量(千卡)'
     */
    private String heat;
    /**
     *'可食部分(克)'
     */
    private String ediblePart;
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "heat")
    public String getHeat() {
        return heat;
    }
    public void setHeat(String heat) {
        this.heat = heat;
    }
    @Column(name = "edible_part")
    public String getEdiblePart() {
        return ediblePart;
    }
    public void setEdiblePart(String ediblePart) {
        this.ediblePart = ediblePart;
    }
}

+ 92 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseCatalogueDO.java

@ -0,0 +1,92 @@
package com.yihu.jw.entity.care.course;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description: 课程目录表
 */
@Entity
@Table(name="base_course_catalogue")
public class CourseCatalogueDO extends UuidIdentityEntityWithTime {
    /**
     * 课程id
     */
    private String courserId;
    /**
     * 目录名称
     */
    private String name;
    /**
     * 小结类型 2视频 3文本
     */
    private String type;
    private String typeName;
    /**
     * 小结内容
     */
    private String content;
    /**
     * 视频url
     */
    private String videoUrl;
    @Column(name = "course_id")
    public String getCourserId() {
        return courserId;
    }
    public void setCourserId(String courserId) {
        this.courserId = courserId;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "content")
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    @Column(name = "video_url")
    public String getVideoUrl() {
        return videoUrl;
    }
    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }
}

+ 254 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseDO.java

@ -0,0 +1,254 @@
package com.yihu.jw.entity.care.course;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description: 课程表
 */
@Entity
@Table(name="base_course")
public class CourseDO extends UuidIdentityEntityWithOperator {
    /**
     * '课程类型'
     */
    private String type;
    private String typeName;
    /**
     * '课程名称'
     */
    private String name;
    /**
     * 机构id
     */
    private String orgCode;
    /**
     * 机构名称
     */
    private String orgName;
    /**
     *'教师id'
     */
    private String doctor;
    /**
     *'教师名称'
     */
    private String doctorName;
    /**
     * '直播时间'
     */
    private Date liveTime;
    /**
     * 直播状态
     */
    private String liveStatus;
    private String liveStatusName;
    /**
     * 直播时长
     */
    private String liveDuration;
    /**
     * 上架状态
     */
    private String status;
    private String statusName;
    /**
     * '课程封面'
     */
    private String courseCover;
    /**
     * '费用'
     */
    private String fee;
    /**
     * '课程简介'
     */
    private String introduction;
    /**
     * `删除标志 1正常 0删除',
     */
    private Integer del;
    /**
     * 小节
     */
    List<CourseCatalogueDO> catalogueDOList;
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "live_time")
    public Date getLiveTime() {
        return liveTime;
    }
    public void setLiveTime(Date liveTime) {
        this.liveTime = liveTime;
    }
    @Column(name = "course_cover")
    public String getCourseCover() {
        return courseCover;
    }
    public void setCourseCover(String courseCover) {
        this.courseCover = courseCover;
    }
    @Column(name = "fee")
    public String getFee() {
        return fee;
    }
    public void setFee(String fee) {
        this.fee = fee;
    }
    @Column(name = "introduction")
    public String getIntroduction() {
        return introduction;
    }
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    @Column(name = "live_status")
    public String getLiveStatus() {
        return liveStatus;
    }
    public void setLiveStatus(String liveStatus) {
        this.liveStatus = liveStatus;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Transient
    public String getLiveStatusName() {
        return liveStatusName;
    }
    public void setLiveStatusName(String liveStatusName) {
        this.liveStatusName = liveStatusName;
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
    @Column(name = "live_duration")
    public String getLiveDuration() {
        return liveDuration;
    }
    public void setLiveDuration(String liveDuration) {
        this.liveDuration = liveDuration;
    }
    @Transient
    public List<CourseCatalogueDO> getCatalogueDOList() {
        return catalogueDOList;
    }
    public void setCatalogueDOList(List<CourseCatalogueDO> catalogueDOList) {
        this.catalogueDOList = catalogueDOList;
    }
}

+ 155 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CourseSalesOrderRecordDO.java

@ -0,0 +1,155 @@
package com.yihu.jw.entity.care.course;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description: 课程销售订单记录表
 */
@Entity
@Table(name="base_course_sales_order_record")
public class CourseSalesOrderRecordDO extends UuidIdentityEntityWithTime{
    private String patient;
    private String patientName;
    private String orgCode;
    private String orgName;
    /**
     * '课程id'
     */
    private String courseId;
    /**
     * '课程名称'
     */
    private String courseName;
    /**
     * '购买时间'
     */
    private Date buyTime;
    /**
     * 支付方式 1微信 2支付宝
     */
    private String payType;
    /**
     * '状态'
     */
    private String status;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 支付价格
     */
    private BigDecimal price;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "course_id")
    public String getCourseId() {
        return courseId;
    }
    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }
    @Column(name = "course_name")
    public String getCourseName() {
        return courseName;
    }
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    @Column(name = "buy_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getBuyTime() {
        return buyTime;
    }
    public void setBuyTime(Date buyTime) {
        this.buyTime = buyTime;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "price")
    public BigDecimal getPrice() {
        return price;
    }
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    @Column(name = "pay_type")
    public String getPayType() {
        return payType;
    }
    public void setPayType(String payType) {
        this.payType = payType;
    }
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
}

+ 60 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/CustomerServiceDO.java

@ -0,0 +1,60 @@
package com.yihu.jw.entity.care.course;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description: 机构客服团队表
 */
@Entity
@Table(name="base_customer_service")
public class CustomerServiceDO  extends UuidIdentityEntityWithTime {
    private String orgCode;
    private String orgName;
    private String teamId;
    private String teamName;
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "team_id")
    public String getTeamId() {
        return teamId;
    }
    public void setTeamId(String teamId) {
        this.teamId = teamId;
    }
    @Column(name = "team_name")
    public String getTeamName() {
        return teamName;
    }
    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }
}

+ 248 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/PatientOrderRefundDO.java

@ -0,0 +1,248 @@
package com.yihu.jw.entity.care.course;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/13
 * @Description: 居民发起的退款记录表
 */
@Entity
@Table(name="base_patient_order_refund")
public class PatientOrderRefundDO extends UuidIdentityEntity{
    /**
     * 居民code
     */
    private String patient;
    /**
     * 居民名字
     */
    private String patientName;
    /**
     * 订单金额
     */
    private BigDecimal orderPrice;
    /**
     *'退款金额'
     */
    private BigDecimal refundPrice;
    /**
     *'退款原因'
     */
    private String refundDesc;
    /**
     * 状态
     * '1待退款2退款完成3退款失败'
     */
    private String status;
    /**
     * '退款时间'
     */
    private Date refundTime;
    /**
     * '退款申请时间'
     */
    private Date createTime;
    /**
     * '购买时间'
     */
    private Date buyTime;
    /**
     * '附件'
     */
    private String enclosure;
    /**
     * '退款表id'
     */
    private String bussinessOrderRefundId;
    /**
     * 类型 1招生报名,2课程
     */
    private String type;
    /**
     * 订单id
     */
    private String orderId;
    /**
     * 机构代码
     */
    private String orgCode;
    /**
     * 机构名称
     */
    private String orgName;
    /**
     * 课程名称/招生标题
     */
    private String title;
    /**
     * '联系电话'
     */
    private String mobile;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "order_price")
    public BigDecimal getOrderPrice() {
        return orderPrice;
    }
    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }
    @Column(name = "refund_price")
    public BigDecimal getRefundPrice() {
        return refundPrice;
    }
    public void setRefundPrice(BigDecimal refundPrice) {
        this.refundPrice = refundPrice;
    }
    @Column(name = "refund_desc")
    public String getRefundDesc() {
        return refundDesc;
    }
    public void setRefundDesc(String refundDesc) {
        this.refundDesc = refundDesc;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "refund_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getRefundTime() {
        return refundTime;
    }
    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "buy_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getBuyTime() {
        return buyTime;
    }
    public void setBuyTime(Date buyTime) {
        this.buyTime = buyTime;
    }
    @Column(name = "enclosure")
    public String getEnclosure() {
        return enclosure;
    }
    public void setEnclosure(String enclosure) {
        this.enclosure = enclosure;
    }
    @Column(name = "bussiness_order_refund_id")
    public String getBussinessOrderRefundId() {
        return bussinessOrderRefundId;
    }
    public void setBussinessOrderRefundId(String bussinessOrderRefundId) {
        this.bussinessOrderRefundId = bussinessOrderRefundId;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "title")
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
}

+ 142 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/RecruitStudentsDO.java

@ -0,0 +1,142 @@
package com.yihu.jw.entity.care.course;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description: 招生表
 */
@Entity
@Table(name="base_recruit_students")
public class RecruitStudentsDO  extends UuidIdentityEntityWithTime {
    /**
     * '招生机构'
     */
    private String orgCode;
    /**
     *'招生机构名称'
     */
    private String orgName;
    /**
     *'招生主题'
     */
    private String theme;
    /**
     *'报名开始时间'
     */
    private Date startTime;
    /**
     *'报名结束时间'
     */
    private Date endTime;
    /**
     *'招生名额'
     */
    private Integer num;
    /**
     *'报名费用'
     */
    private BigDecimal fee;
    /**
     *'已录取人数'
     */
    private Integer admittedNum;
    /**
     * '删除标志 1正常 0删除'
     */
    private Integer del;
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "theme")
    public String getTheme() {
        return theme;
    }
    public void setTheme(String theme) {
        this.theme = theme;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "start_time")
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "end_time")
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    @Column(name = "num")
    public Integer getNum() {
        return num;
    }
    public void setNum(Integer num) {
        this.num = num;
    }
    @Column(name = "fee")
    public BigDecimal getFee() {
        return fee;
    }
    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }
    @Column(name = "admitted_num")
    public Integer getAdmittedNum() {
        return admittedNum;
    }
    public void setAdmittedNum(Integer admittedNum) {
        this.admittedNum = admittedNum;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 198 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/RecruitStudentsRecordDO.java

@ -0,0 +1,198 @@
package com.yihu.jw.entity.care.course;
import com.yihu.jw.entity.UuidIdentityEntityWithTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description: 招生记录表
 */
@Entity
@Table(name="base_recruit_students_record")
public class RecruitStudentsRecordDO  extends UuidIdentityEntityWithTime {
    /**
     * '招生id'
     */
    private String recruitStudentsId;
    /**
     * 招生名称
     */
    private String recruitName;
    /**
     *
     */
    private String patient;
    /**
     * '姓名'
     */
    private String patientName;
    /**
     * '性别'
     */
    private String sex;
    /**
     * '手机'
     */
    private String mobile;
    /**
     * '状态'  (待审核、待支付、已支付、已退费、审核未通过)
     */
    private String status;
    private String statusName;
    /**
     * 支付方式 1微信 2支付宝
     */
    private String payType;
    /**
     * 价格
     */
    private BigDecimal price;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 机构code
     */
    private String orgCode;
    /**
     * 机构名称
     */
    private String orgName;
    /**
     * 删除标志 1正常 0删除
     */
    private Integer del;
    @Column(name = "recruit_students_id")
    public String getRecruitStudentsId() {
        return recruitStudentsId;
    }
    public void setRecruitStudentsId(String recruitStudentsId) {
        this.recruitStudentsId = recruitStudentsId;
    }
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "sex")
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "recruit_name")
    public String getRecruitName() {
        return recruitName;
    }
    public void setRecruitName(String recruitName) {
        this.recruitName = recruitName;
    }
    @Column(name = "pay_type")
    public String getPayType() {
        return payType;
    }
    public void setPayType(String payType) {
        this.payType = payType;
    }
    @Column(name = "price")
    public BigDecimal getPrice() {
        return price;
    }
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
}

+ 13 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientDevice.java

@ -71,7 +71,10 @@ public class DevicePatientDevice extends IdEntity {
  //========================非表字段======================
    //患者居住地址
    private String address;
    /**
     * 设备图片
     */
    private String deviceImgUrl;
    @Column(name = "device_id")
    public Long getDeviceId() {
@ -306,4 +309,13 @@ public class DevicePatientDevice extends IdEntity {
    public void setRefuseReason(String refuseReason) {
        this.refuseReason = refuseReason;
    }
    @Transient
    public String getDeviceImgUrl() {
        return deviceImgUrl;
    }
    public void setDeviceImgUrl(String deviceImgUrl) {
        this.deviceImgUrl = deviceImgUrl;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java

@ -35,7 +35,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String value6;
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温)
	private Integer type;
	// 记录时间

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachCancelLogDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.entity.care.doorCoach;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 上门辅导工单取消记录实体
*/
@Entity
@Table(name = "base_door_coach_cancel_log")
public class BaseDoorCoachCancelLogDO extends UuidIdentityEntity {
    /**
	 * 工单id
	 */
	private String orderId;
    /**
	 * 居民code
	 */
	private String patient;
    /**
	 * 取消类型:1-调度员取消,2-居民取消
	 */
	private Integer cancelType;
    /**
	 * 取消理由
	 */
	private String cancelReason;
    /**
	 * 取消时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date time;
	@Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
	@Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
	@Column(name = "cancel_type")
    public Integer getCancelType() {
        return cancelType;
    }
    public void setCancelType(Integer cancelType) {
        this.cancelType = cancelType;
    }
	@Column(name = "cancel_reason")
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
	@Column(name = "time")
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
}

+ 80 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachConclusionDO.java

@ -0,0 +1,80 @@
package com.yihu.jw.entity.care.doorCoach;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 上门辅导工单服务小结
 *
 */
@Entity
@Table(name = "base_door_coach_conclusion")
public class BaseDoorCoachConclusionDO extends UuidIdentityEntityWithOperator {
    private String orderId;//工单id
    private String patient;//工单服务的居民
    private String patientName;//居民姓名
    private String doctor;//医生
    private String doctorName;//医生姓名
    private String conclusion;//处置小结
    private String conclusionImg;//附件
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getConclusion() {
        return conclusion;
    }
    public void setConclusion(String conclusion) {
        this.conclusion = conclusion;
    }
    public String getConclusionImg() {
        return conclusionImg;
    }
    public void setConclusionImg(String conclusionImg) {
        this.conclusionImg = conclusionImg;
    }
}

+ 79 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachDoctorStatusDO.java

@ -0,0 +1,79 @@
package com.yihu.jw.entity.care.doorCoach;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* 上门辅导服务工单实体
*
* @author Administrator on  2019年03月19日
*
*/
@Entity
@Table(name = "base_door_coach_doctor_status")
public class BaseDoorCoachDoctorStatusDO extends UuidIdentityEntityWithOperator {
    /**
     * 医生派单状态
     */
    public enum Status {
        waitForSend(1, "待派单"),
        waitForAccept(2, "待接单"),
        waitForServe(3, "待服务"),
        serving(4, "服务中"),
        stopped(5, "停止接单");
        private Integer type;
        private String desc;
        Status(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * wlyy_doctor中医生code
     */
    private String doctor;
    /**
     * 医生状态:1-待派单,2-待接单,3-待服务,4-服务中,5-停止接单
     */
    private Integer status;
	@Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
	@Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 193 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachFeeDetailDO.java

@ -0,0 +1,193 @@
package com.yihu.jw.entity.care.doorCoach;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
* 上门辅导服务工单价格明细(服务项价格,医生出诊费用)实体
*
* @author Administrator on  2019年03月19日
*
*/
@Entity
@Table(name = "base_door_coach_fee_detail")
public class BaseDoorCoachFeeDetailDO extends UuidIdentityEntityWithOperator {
    /**
     * 支付方式
     */
    public enum Type {
        servicePackageItem(1, "服务包的服务项费用"),
        doctor(2,"医生出诊费用");
        private Integer type;
        private String desc;
        Type(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 状态
     */
    public enum Status {
        patient(1, "居民新增(预约)"),
        doctorAdd(2,"医生新增"),
        doctorDel(3,"医生删除");
        private Integer type;
        private String desc;
        Status(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
	 * 工单id
	 */
	private String orderId;
    /**
	 * 费用类型,1-服务项费用,2-医生出诊费用
	 */
	private Integer type;
    /**
	 * 居民请求的服务项code,医生出诊费用code
	 */
	private String code;
    /**
	 * 居民请求的服务项名称,医生出诊费用名称
	 */
	private String name;
    /**
	 * 费用
	 */
	private BigDecimal fee;
    /**
	 * 折扣费用
	 */
	private BigDecimal feeDiscount;
    /**
	 * 数量
	 */
	private Integer number;
    /**
	 * 状态,1-居民新增(预约),2-医生新增,3-医生删除
	 */
	private Integer status;
    /**
     * 付款状态:0未付款 1已付款
     */
    private Integer payStatus;
	@Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
	@Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "fee")
    public BigDecimal getFee() {
        return fee;
    }
    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }
	@Column(name = "fee_discount")
    public BigDecimal getFeeDiscount() {
        return feeDiscount;
    }
    public void setFeeDiscount(BigDecimal feeDiscount) {
        this.feeDiscount = feeDiscount;
    }
	@Column(name = "number")
    public Integer getNumber() {
        return number;
    }
    public void setNumber(Integer number) {
        this.number = number;
    }
	@Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "pay_status")
    public Integer getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
}

+ 1195 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachOrderDO.java

@ -0,0 +1,1195 @@
package com.yihu.jw.entity.care.doorCoach;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.door.WlyyDoorConclusionDO;
import com.yihu.jw.entity.door.WlyyDoorDoctorDO;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 上门辅导服务工单实体
 *
 * @author Administrator on  2019年03月19日
 *
 */
@Entity
@Table(name = "base_door_coach_order")
public class BaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
    /**
     * 工单状态
     */
    public enum Status {
        cancel(-1, "已取消"),
        waitForSend(1, "待(调度员)派单"),
        waitForAccept(2, "待(医生)接单"),
        accept(3, "已接单"),
        waitForServe(4, "签到(待服务)"),
        waitForCommnet(5, "登记服务小结"),
        complete(6,"已完成");
        private Integer type;
        private String desc;
        Status(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 支付方式
     */
    public enum PayWay {
        wechat(1, "微信支付"),
        offLine(2,"线下支付");
        private Integer type;
        private String desc;
        PayWay(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 取消类型
     */
    public enum CancelType {
        dispatcher(1, "调度员取消"),
        patient(2,"居民取消"),
        doctor(3, "医生取消");
        private Integer type;
        private String desc;
        CancelType(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 化验检查报告补录方式
     */
    public enum ExamPaperUploadWay {
        photo(1, "拍照补录"),
        interfaceData(2,"接口数据");
        private Integer type;
        private String desc;
        ExamPaperUploadWay(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 医生签到方式
     */
    public enum DoctorSignWay {
        locate(1, "定位"),
        sacn(2,"扫码");
        private Integer type;
        private String desc;
        DoctorSignWay(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 居民对工单需要服务情况是否已确认
     */
    public enum IsPatientConfirm {
        no(0, "未确认"),
        yes(1,"已确认");
        private Integer type;
        private String desc;
        IsPatientConfirm(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }  /**
     * 居民对工单需要服务情况是否已确认
     */
    public enum IsTransOtherOrg {
        no(0, "不转"),
        yes(1,"已转");
        private Integer type;
        private String desc;
        IsTransOtherOrg(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public Integer getType() {
            return type;
        }
        public void setType(Integer type) {
            this.type = type;
        }
    }
    /**
     * 服务编号
     */
    private String number;
    /**
     * 代理发起工单的居民code,替父母,孩子等发起工单
     */
    private String proxyPatient;
    /**
     * 代理发起工单的居民code,替父母,孩子等发起工单
     */
    private String proxyPatientName;
    /**
     * 代理发起工单的居民联系电话
     */
    private String proxyPatientPhone;
    /**
     * 被服务的居民code,发起工单的居民的亲属
     */
    private String patient;
    /**
     * 被服务的居民姓名,发起工单的居民的亲属
     */
    private String patientName;
    /**
     * 被服务的居民联系电话
     */
    private String patientPhone;
    /**
     * 发起人与被服务人的关系:自己,父亲,母亲,儿子等
     */
    private String patientRelation;
    /**
     * 调度员code
     */
    private String dispatcher;
    /**
     * 调度员name
     */
    private String dispatcherName;
    /**
     * 居民期望服务时间
     */
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private String patientExpectedServeTime;
    /**
     * 居民自己服务描述
     */
    private String serveDesc;
    /**
     * 上门服务的区
     */
    private String serveTown;
    /**
     * 上门服务详细地址
     */
    private String serveAddress;
    /**
     * 上门服务地址纬度
     */
    private String serveLat;
    /**
     * 上门服务地址经度
     */
    private String serveLon;
    /**
     * 调度员备注
     */
    private String remark;
    /**
     * 居民对工单需要服务情况是否已确认,0-未确认,1-已确认, 2-不同意
     */
    private Integer isPatientConfirm;
    /**
     * 居民对工单需要服务情况确认时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date patientConfirmTime;
    /**
     * 工单是否转给其他机构,0-不转,1-已转
     */
    private Integer isTransOtherOrg;
    /**
     * 最后转接的机构code
     */
    private String transedOrgCode;
    /**
     * 最后转接的机构调度员code
     */
    private String transedDispatcher;
    /**
     * 最后转接的机构调度员name
     */
    private String transedDispatcherName;
    /**
     * 服务总费用
     */
    private BigDecimal totalFee;
    /**
     * 居民期望服务的医生姓名
     */
    private String expectedDoctorName;
    /**
     * 接单的医生code
     */
    private String doctor;
    /**
     * 接单的医生name
     */
    private String doctorName;
    /**
     * 接单的医生类型:医生,健管师,护士等
     */
    private String doctorType;
    /**
     * 医生预计到达时间
     */
    private String doctorArrivingTime;
    /**
     * 医生签到时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date doctorSignTime;
    /**
     * 医生签到方式:1-定位,2-扫码
     */
    private Integer doctorSignWay;
    /**
     * 医生签到位置,记录详细地址
     */
    private String doctorSignLocation;
    /**
     * 医生签到照片
     */
    private String doctorSignImg;
    /**
     * 居民确认结束服务方式:1-电子签名,2-手持身份证拍照
     */
    private Integer patientConfirmFinishWay;
    /**
     * 居民确认结束服务照片
     */
    private String patientConfirmFinishImg;
    /**
     * 居民确认医生结束服务时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date patientConfirmFinishTime;
    /**
     * 医生诊疗现场照片,最多9张,逗号分隔
     */
    private String presentImgs;
    /**
     * 是否需要上传补录报告:0-不需要,1-需要,待补录;2-需要,已补录
     */
    private Integer examPaperStatus;
    /**
     * 医生上传居民的化验检查报告照片
     */
    private String examPaperImgs;
    /**
     * 化验检查报告补录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date examPaperUploadTime;
    /**
     * 化验检查报告补录方式,1-拍照补录,2-接口数据
     */
    private Integer examPaperUploadWay;
    /**
     * 工单状态:-1-已取消,1-待(调度员)派单,2-待(医生)接单,3-已接单,4-签到,5-登记服务小结,6-已完成
     */
    private Integer status;
    /**
     * 工单完成时间(对工单评价完即工单完成)
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date completeTime;
    /**
     * 取消类型:1-调度员取消,2-居民取消
     */
    private Integer cancelType;
    /**
     * 取消理由
     */
    private String cancelReason;
    /**
     * 取消时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date cancelTime;
    /**
     * 付款方式:1-微信支付,2-线下支付(居民自己向医院支付,具体怎么支付由医院来定)
     */
    private Integer payWay;
    /**
     * 支付流水号
     */
    private String payNumber;
    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date payTime;
    /**
     * 工单对应的服务项
     */
    private List<Map<String, Object>> doorFeeDetailList;
    /**
     * 工单对应的出诊费
     */
    private List<WlyyDoorDoctorDO> djDetailList;
    /**
     * 工单服务医生
     */
    private List<Map<String, Object>> doctors;
    /**
     * 服务小结
     */
    private BaseDoorCoachConclusionDO doorConclusion;
    /**
     * 调度员响应时间(派单时间或取消时间)
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date dispatcherResponseTime;
    /**
     * 服务医生响应时间(第一条咨询或者接单时间)
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date serviceResponseTime;
    /**
     * 出诊费用
     */
    private List<Map<String, Object>> visitCost;
    /**
     * 服务费用 服务包支付、待支付
     */
    private Map<String, Object> serviceCost;
    /**
     * 患者性别
     */
    private String sex;
    /**
     * 患者年龄
     */
    private Integer age;
    /**
     * 患者头像
     */
    private String photo;
    /**
     * 人群类型名称
     */
    private String typeValue;
    /**
     * 会话id
     */
    private String sessionId;
    /**
     * 服务机构
     */
    private String hospital;
    private Integer conclusionStatus;//服务小结登记状态:1待补录;2-已补录
    private Integer prescriptionStatus;//开方状态:1开方完成,0未开方
    private String prescriptionCode;//处方单号,多个用逗号隔开
    private String outpatientId;//复诊id
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date prescriptionTime;//开方完成时间
    private Integer type;//发起工单类型(1本人发起 2家人待预约 3医生代预约)
    private String authorizeImage;//电子健康卡授权图片
    private String relationCode;//业务关联
    private String serviceStatus;//服务类型 1-预约项目 2-即时项目
    private String orderInfo;//工单详情 0-未推送 1-未确认 2-已确认
    private List<WlyyPrescriptionDO> prescriptionDOList;//上门前开的方
    private List<WlyyPrescriptionDO> afterPrescriptionList;//上门后开的方
    private List<Followup> followupList;//上门随访
    private String followupDate;//随访时间
    /**
     * 快捷类型,1是快捷类型,其他值不是
     */
    private String shortcutType;
    @Column(name = "number")
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    @Column(name = "proxy_patient")
    public String getProxyPatient() {
        return proxyPatient;
    }
    public void setProxyPatient(String proxyPatient) {
        this.proxyPatient = proxyPatient;
    }
    @Column(name = "proxy_patient_name")
    public String getProxyPatientName() {
        return proxyPatientName;
    }
    public void setProxyPatientName(String proxyPatientName) {
        this.proxyPatientName = proxyPatientName;
    }
    @Column(name = "proxy_patient_phone")
    public String getProxyPatientPhone() {
        return proxyPatientPhone;
    }
    public void setProxyPatientPhone(String proxyPatientPhone) {
        this.proxyPatientPhone = proxyPatientPhone;
    }
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "patient_phone")
    public String getPatientPhone() {
        return patientPhone;
    }
    public void setPatientPhone(String patientPhone) {
        this.patientPhone = patientPhone;
    }
    @Column(name = "patient_relation")
    public String getPatientRelation() {
        return patientRelation;
    }
    public void setPatientRelation(String patientRelation) {
        this.patientRelation = patientRelation;
    }
    @Column(name = "dispatcher")
    public String getDispatcher() {
        return dispatcher;
    }
    public void setDispatcher(String dispatcher) {
        this.dispatcher = dispatcher;
    }
    @Column(name = "dispatcher_name")
    public String getDispatcherName() {
        return dispatcherName;
    }
    public void setDispatcherName(String dispatcherName) {
        this.dispatcherName = dispatcherName;
    }
    @Column(name = "patient_expected_serve_time")
    public String getPatientExpectedServeTime() {
        return patientExpectedServeTime;
    }
    public void setPatientExpectedServeTime(String patientExpectedServeTime) {
        this.patientExpectedServeTime = patientExpectedServeTime;
    }
    @Column(name = "serve_desc")
    public String getServeDesc() {
        return serveDesc;
    }
    public void setServeDesc(String serveDesc) {
        this.serveDesc = serveDesc;
    }
    @Column(name = "serve_town")
    public String getServeTown() {
        return serveTown;
    }
    public void setServeTown(String serveTown) {
        this.serveTown = serveTown;
    }
    @Column(name = "serve_address")
    public String getServeAddress() {
        return serveAddress;
    }
    public void setServeAddress(String serveAddress) {
        this.serveAddress = serveAddress;
    }
    @Column(name = "serve_lat")
    public String getServeLat() {
        return serveLat;
    }
    public void setServeLat(String serveLat) {
        this.serveLat = serveLat;
    }
    @Column(name = "serve_lon")
    public String getServeLon() {
        return serveLon;
    }
    public void setServeLon(String serveLon) {
        this.serveLon = serveLon;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "is_patient_confirm")
    public Integer getIsPatientConfirm() {
        return isPatientConfirm;
    }
    public void setIsPatientConfirm(Integer isPatientConfirm) {
        this.isPatientConfirm = isPatientConfirm;
    }
    @Column(name = "patient_confirm_time")
    public Date getPatientConfirmTime() {
        return patientConfirmTime;
    }
    public void setPatientConfirmTime(Date patientConfirmTime) {
        this.patientConfirmTime = patientConfirmTime;
    }
    @Column(name = "is_trans_other_org")
    public Integer getIsTransOtherOrg() {
        return isTransOtherOrg;
    }
    public void setIsTransOtherOrg(Integer isTransOtherOrg) {
        this.isTransOtherOrg = isTransOtherOrg;
    }
    @Column(name = "transed_org_code")
    public String getTransedOrgCode() {
        return transedOrgCode;
    }
    @Column(name = "expected_doctor_name")
    public String getExpectedDoctorName() {
        return expectedDoctorName;
    }
    public void setExpectedDoctorName(String expectedDoctorName) {
        this.expectedDoctorName = expectedDoctorName;
    }
    public void setTransedOrgCode(String transedOrgCode) {
        this.transedOrgCode = transedOrgCode;
    }
    @Column(name = "transed_dispatcher")
    public String getTransedDispatcher() {
        return transedDispatcher;
    }
    public void setTransedDispatcher(String transedDispatcher) {
        this.transedDispatcher = transedDispatcher;
    }
    @Column(name = "transed_dispatcher_name")
    public String getTransedDispatcherName() {
        return transedDispatcherName;
    }
    public void setTransedDispatcherName(String transedDispatcherName) {
        this.transedDispatcherName = transedDispatcherName;
    }
    @Column(name = "total_fee")
    public BigDecimal getTotalFee() {
        return totalFee;
    }
    public void setTotalFee(BigDecimal totalFee) {
        this.totalFee = totalFee;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "doctor_type")
    public String getDoctorType() {
        return doctorType;
    }
    public void setDoctorType(String doctorType) {
        this.doctorType = doctorType;
    }
    @Column(name = "doctor_arriving_time")
    public String getDoctorArrivingTime() {
        return doctorArrivingTime;
    }
    public void setDoctorArrivingTime(String doctorArrivingTime) {
        this.doctorArrivingTime = doctorArrivingTime;
    }
    @Column(name = "doctor_sign_time")
    public Date getDoctorSignTime() {
        return doctorSignTime;
    }
    public void setDoctorSignTime(Date doctorSignTime) {
        this.doctorSignTime = doctorSignTime;
    }
    @Column(name = "doctor_sign_way")
    public Integer getDoctorSignWay() {
        return doctorSignWay;
    }
    public void setDoctorSignWay(Integer doctorSignWay) {
        this.doctorSignWay = doctorSignWay;
    }
    @Column(name = "doctor_sign_location")
    public String getDoctorSignLocation() {
        return doctorSignLocation;
    }
    public void setDoctorSignLocation(String doctorSignLocation) {
        this.doctorSignLocation = doctorSignLocation;
    }
    @Column(name = "doctor_sign_img")
    public String getDoctorSignImg() {
        return doctorSignImg;
    }
    public void setDoctorSignImg(String doctorSignImg) {
        this.doctorSignImg = doctorSignImg;
    }
    @Column(name = "patient_confirm_finish_way")
    public Integer getPatientConfirmFinishWay() {
        return patientConfirmFinishWay;
    }
    public void setPatientConfirmFinishWay(Integer patientConfirmFinishWay) {
        this.patientConfirmFinishWay = patientConfirmFinishWay;
    }
    @Column(name = "patient_confirm_finish_img")
    public String getPatientConfirmFinishImg() {
        return patientConfirmFinishImg;
    }
    public void setPatientConfirmFinishImg(String patientConfirmFinishImg) {
        this.patientConfirmFinishImg = patientConfirmFinishImg;
    }
    @Column(name = "patient_confirm_finish_time")
    public Date getPatientConfirmFinishTime() {
        return patientConfirmFinishTime;
    }
    public void setPatientConfirmFinishTime(Date patientConfirmFinishTime) {
        this.patientConfirmFinishTime = patientConfirmFinishTime;
    }
    @Column(name = "present_imgs")
    public String getPresentImgs() {
        return presentImgs;
    }
    public void setPresentImgs(String presentImgs) {
        this.presentImgs = presentImgs;
    }
    @Column(name = "exam_paper_status")
    public Integer getExamPaperStatus() {
        return examPaperStatus;
    }
    public void setExamPaperStatus(Integer examPaperStatus) {
        this.examPaperStatus = examPaperStatus;
    }
    @Column(name = "exam_paper_imgs")
    public String getExamPaperImgs() {
        return examPaperImgs;
    }
    public void setExamPaperImgs(String examPaperImgs) {
        this.examPaperImgs = examPaperImgs;
    }
    @Column(name = "exam_paper_upload_time")
    public Date getExamPaperUploadTime() {
        return examPaperUploadTime;
    }
    public void setExamPaperUploadTime(Date examPaperUploadTime) {
        this.examPaperUploadTime = examPaperUploadTime;
    }
    @Column(name = "exam_paper_upload_way")
    public Integer getExamPaperUploadWay() {
        return examPaperUploadWay;
    }
    public void setExamPaperUploadWay(Integer examPaperUploadWay) {
        this.examPaperUploadWay = examPaperUploadWay;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCompleteTime() {
        return completeTime;
    }
    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }
    @Column(name = "cancel_type")
    public Integer getCancelType() {
        return cancelType;
    }
    public void setCancelType(Integer cancelType) {
        this.cancelType = cancelType;
    }
    @Column(name = "cancel_reason")
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
    @Column(name = "cancel_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCancelTime() {
        return cancelTime;
    }
    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }
    @Column(name = "pay_way")
    public Integer getPayWay() {
        return payWay;
    }
    public void setPayWay(Integer payWay) {
        this.payWay = payWay;
    }
    @Column(name = "pay_number")
    public String getPayNumber() {
        return payNumber;
    }
    public void setPayNumber(String payNumber) {
        this.payNumber = payNumber;
    }
    @Column(name = "pay_time")
    public Date getPayTime() {
        return payTime;
    }
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Transient
    public List<Map<String, Object>> getDoorFeeDetailList() {
        return doorFeeDetailList;
    }
    public void setDoorFeeDetailList(List<Map<String, Object>> doorFeeDetailList) {
        this.doorFeeDetailList = doorFeeDetailList;
    }
    @Transient
    public List<Map<String, Object>> getDoctors() {
        return doctors;
    }
    public void setDoctors(List<Map<String, Object>> doctors) {
        this.doctors = doctors;
    }
    @Transient
    public BaseDoorCoachConclusionDO getDoorConclusion() {
        return doorConclusion;
    }
    public void setDoorConclusion(BaseDoorCoachConclusionDO doorConclusion) {
        this.doorConclusion = doorConclusion;
    }
    @Column(name = "dispatcher_response_time")
    public Date getDispatcherResponseTime() {
        return dispatcherResponseTime;
    }
    public void setDispatcherResponseTime(Date dispatcherResponseTime) {
        this.dispatcherResponseTime = dispatcherResponseTime;
    }
    @Column(name = "service_response_time")
    public Date getServiceResponseTime() {
        return serviceResponseTime;
    }
    public void setServiceResponseTime(Date serviceResponseTime) {
        this.serviceResponseTime = serviceResponseTime;
    }
    @Transient
    public List<Map<String, Object>> getVisitCost() {
        return visitCost;
    }
    public void setVisitCost(List<Map<String, Object>> visitCost) {
        this.visitCost = visitCost;
    }
    @Transient
    public Map<String, Object> getServiceCost() {
        return serviceCost;
    }
    public void setServiceCost(Map<String, Object> serviceCost) {
        this.serviceCost = serviceCost;
    }
    @Transient
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    @Transient
    public Integer getAge() {
        return age;
    }
    public void setAge(Integer age) {
        this.age = age;
    }
    @Transient
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    @Transient
    public String getTypeValue() {
        return typeValue;
    }
    public void setTypeValue(String typeValue) {
        this.typeValue = typeValue;
    }
    @Transient
    public String getSessionId() {
        return sessionId;
    }
    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }
    @Transient
    public List<Followup> getFollowupList() {
        return followupList;
    }
    public void setFollowupList(List<Followup> followupList) {
        this.followupList = followupList;
    }
    public Integer getConclusionStatus() {
        return conclusionStatus;
    }
    public void setConclusionStatus(Integer conclusionStatus) {
        this.conclusionStatus = conclusionStatus;
    }
    public Integer getPrescriptionStatus() {
        return prescriptionStatus;
    }
    public void setPrescriptionStatus(Integer prescriptionStatus) {
        this.prescriptionStatus = prescriptionStatus;
    }
    public String getPrescriptionCode() {
        return prescriptionCode;
    }
    public void setPrescriptionCode(String prescriptionCode) {
        this.prescriptionCode = prescriptionCode;
    }
    public Date getPrescriptionTime() {
        return prescriptionTime;
    }
    public void setPrescriptionTime(Date prescriptionTime) {
        this.prescriptionTime = prescriptionTime;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getAuthorizeImage() {
        return authorizeImage;
    }
    public void setAuthorizeImage(String authorizeImage) {
        this.authorizeImage = authorizeImage;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    @Column(name = "service_status")
    public String getServiceStatus() {
        return serviceStatus;
    }
    public void setServiceStatus(String serviceStatus) {
        this.serviceStatus = serviceStatus;
    }
    @Column(name = "order_info")
    public String getOrderInfo() {
        return orderInfo;
    }
    public void setOrderInfo(String orderInfo) {
        this.orderInfo = orderInfo;
    }
    @Column(name = "shortcut_type")
    public String getShortcutType() {
        return shortcutType;
    }
    public void setShortcutType(String shortcutType) {
        this.shortcutType = shortcutType;
    }
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
    @Column(name = "followup_date")
    public String getFollowupDate() {
        return followupDate;
    }
    public void setFollowupDate(String followupDate) {
        this.followupDate = followupDate;
    }
}

+ 89 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachPatientConfirmLogDO.java

@ -0,0 +1,89 @@
package com.yihu.jw.entity.care.doorCoach;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* 上门辅导服务工单居民确认操作日志记录实体
*
* @author Administrator on  2019年03月20日
*
*/
@Entity
@Table(name = "base_door_coach_patient_confirm_log")
public class BaseDoorCoachPatientConfirmLogDO extends UuidIdentityEntityWithOperator {
    /**
	 * 工单id
	 */
	private String orderId;
    /**
	 * 居民
	 */
	private String patient;
    /**
	 * 居民姓名
	 */
	private String patientName;
    /**
	 * 确认操作类型:1-确认基础信息无误或变更,2-确认上门医生变更上门信息,3-同意工单转接,4-同意取消工单
	 */
	private Integer type;
    /**
	 * 操作描述
	 */
	private String description;
	@Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
	@Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
	@Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
	@Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
	@Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}

+ 93 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachProcessLogDO.java

@ -0,0 +1,93 @@
package com.yihu.jw.entity.care.doorCoach;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
/**
* 工单状态变更记录(调度员操作记录)实体
*
* @author Administrator on  2019年04月09日
*
*/
@Entity
@Table(name = "base_door_coach_process_log")
@SequenceGenerator(name="id_generated", sequenceName="wlyy_door_process_log")
public class BaseDoorCoachProcessLogDO extends UuidIdentityEntity {
    /**
	 * 工单id
	 */
	private String orderId;
    /**
	 * 工单处理状态
	 */
	private Integer status;
    /**
	 * 变更状态的调度员
	 */
	private String dispatcher;
    /**
	 * 变更状态的调度员姓名
	 */
	private String dispatcherName;
    /**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date createTime;
	@Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
	@Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
	@Column(name = "dispatcher")
    public String getDispatcher() {
        return dispatcher;
    }
    public void setDispatcher(String dispatcher) {
        this.dispatcher = dispatcher;
    }
	@Column(name = "dispatcher_name")
    public String getDispatcherName() {
        return dispatcherName;
    }
    public void setDispatcherName(String dispatcherName) {
        this.dispatcherName = dispatcherName;
    }
	@Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 99 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/exam/ChildrenExaminationRecordDO.java

@ -0,0 +1,99 @@
package com.yihu.jw.entity.care.exam;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Bing on 2021/5/18.
 */
@Entity
@Table(name="base_children_examination_record")
public class ChildrenExaminationRecordDO extends UuidIdentityEntityWithCreateTime {
    private String patient;//居民id
    private String type; //1机构体检 2居家自检
    private Date examTime; //体检时间
    private String orgCode; //体检机构
    private String orgName; //机构名称
    private String monthAge;//月龄
    private String height;//身高
    private String weight;//体重
    private String headCircumference;//头围
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+08:00")
    public Date getExamTime() {
        return examTime;
    }
    public void setExamTime(Date examTime) {
        this.examTime = examTime;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getMonthAge() {
        return monthAge;
    }
    public void setMonthAge(String monthAge) {
        this.monthAge = monthAge;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public String getHeadCircumference() {
        return headCircumference;
    }
    public void setHeadCircumference(String headCircumference) {
        this.headCircumference = headCircumference;
    }
}

+ 100 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/message/OrgNoticeDO.java

@ -0,0 +1,100 @@
package com.yihu.jw.entity.care.message;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Bing on 2021/5/18.
 * 通知实体
 */
@Entity
@Table(name="base_org_notice")
public class OrgNoticeDO extends UuidIdentityEntityWithCreateTime {
    private String orgCode ;
    private String orgName ;
    private Integer status ;//
    private Integer del ;
    private String title ;//通知标题
    private String content;//通知内容
    private String img ; //附件
    private Date noticeTime ;//通知时间
    private String createUser;
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getNoticeTime() {
        return noticeTime;
    }
    public void setNoticeTime(Date noticeTime) {
        this.noticeTime = noticeTime;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java

@ -18,7 +18,7 @@ import java.util.Date;
public class SystemMessageDO extends UuidIdentityEntity {
    /**
     *消息类型 上门服务400开头,生活照料500开头 ,安防监控600开头
     *消息类型 上门服务400开头,生活照料500开头 ,安防监控600开头, 上门辅导700开头
     */
    private String type;
    /**

+ 10 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -3,13 +3,11 @@ package com.yihu.jw.entity.order;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -23,8 +21,16 @@ public class BusinessOrderDO extends IntegerIdentityEntity {
    private String patient;//居民code
    private String patientName;//居民名字
    private String orderNo;//订单号
    private Integer orderType;//订单类型订单类型:目前只能1表示图文,3表示视频大类细分如下:专家咨询:1图文咨询 |2电话咨询|3视频咨询|4免费义诊图文诊室:1图文复诊视频诊室:3视频复诊| 5社区协同
    private String orderCategory;//1:专家咨询|2:图文诊室|3:视频诊室|4处方结算|5就诊卡充值)
    /**
     *  互联网医院-订单类型订单类型:目前只能1表示图文,3表示视频大类细分如下:专家咨询:1图文咨询 |2电话咨询|3视频咨询|4免费义诊图文诊室:1图文复诊视频诊室:3视频复诊| 5社区协同
     *  医养项目 订单类型 1 新生儿托幼
     */
    private Integer orderType;
    /**
     * 互联网医院- 1:专家咨询|2:图文诊室|3:视频诊室|4处方结算|5就诊卡充值)
     * 医养项目 订单分类 orderType=1 时 1招生,2 课程,3 上门预约(托幼)
     */
    private String orderCategory;
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private String description;//支付备注

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderRefundDO.java

@ -29,6 +29,7 @@ public class BusinessOrderRefundDO extends IntegerIdentityEntity {
    private String refundDesc;//退款原因
    private Integer status;//状态1待退款2已退款
    private Date refundTime;//退款时间
    private String enclosure;//附件
    private Date createTime;
    private String createUser;
    private String createUserName;
@ -193,4 +194,13 @@ public class BusinessOrderRefundDO extends IntegerIdentityEntity {
    public void setRefundDesc(String refundDesc) {
        this.refundDesc = refundDesc;
    }
    @Column(name = "enclosure")
    public String getEnclosure() {
        return enclosure;
    }
    public void setEnclosure(String enclosure) {
        this.enclosure = enclosure;
    }
}

+ 1 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/PageEnvelop.java

@ -43,6 +43,7 @@ public class PageEnvelop<T> extends Envelop implements Serializable {
    @ApiModelProperty(value = "列表内容")
    private List<T> detailModelList = new ArrayList<>(0);
    public int getCurrPage() {
        return currPage;
    }

+ 27 - 2
common/common-util/src/main/java/com/yihu/jw/util/common/GpsUtil.java

@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
@Component
public class GpsUtil {
    public static final String BAIDU_LBS_TYPE = "bd09ll";
    public static double pi = 3.1415926535897932384626;
    public static double pi = Math.PI;
    public static double a = 6378245.0;
    public static double ee = 0.00669342162296594323;
@ -95,7 +95,7 @@ public class GpsUtil {
        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
        double gg_lon = z * Math.cos(theta);
        double gg_lat = z * Math.sin(theta);
        return bd_lon+","+bd_lat;
        return gg_lon+","+gg_lat;
    }
    /**
@ -170,4 +170,29 @@ public class GpsUtil {
        result.put("lon",lon);
        return result;
    }
//    /**
//     * 百度转火星
//     * @param bd_lat
//     * @param bd_lon
//     */
//    public static String  bd_decrypt(double bd_lat, double bd_lon)
//    {
//        double x = bd_lon - 0.0065, y = bd_lat - 0.006;
//        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
//        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
//        double gg_lon = z * Math.cos(theta);
//        double gg_lat = z * Math.sin(theta);
//        return gg_lat+","+gg_lon;
//    }
//
//    public static String bd_encrypt(double gg_lat, double gg_lon) {
//        double x = gg_lon, y = gg_lat;
//        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
//        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
//        double bd_lon = z * Math.cos(theta) + 0.0065;
//        double bd_lat = z * Math.sin(theta) + 0.006;
//        return bd_lat + "," + bd_lon;
//    }
}

+ 12 - 0
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -501,6 +501,18 @@ public class HttpClientUtil {
        return ret;
    }
    public String getBodyRawForm(String url, String params) throws IOException {
        CloseableHttpClient httpclient = HttpClients.createDefault();
        List<NameValuePair> pairs = new ArrayList<>(0);
        pairs.add(new BasicNameValuePair("object",params));
        String entityString = EntityUtils.toString(new UrlEncodedFormEntity(pairs,Consts.UTF_8));
        HttpGet httpGet = new HttpGet(url+"?"+entityString);
        CloseableHttpResponse response = httpclient.execute(httpGet);
        HttpEntity entity = response.getEntity();
        String ret = EntityUtils.toString(entity);
        return ret;
    }
    /**
     * 爱牵挂请求
     * @param url

+ 73 - 0
common/common-util/src/main/java/com/yihu/jw/util/tencent/TencentVODUtil.java

@ -0,0 +1,73 @@
package com.yihu.jw.util.tencent;
import sun.misc.BASE64Encoder;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.util.Random;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description: 腾讯视频云存储工具类
 */
public class TencentVODUtil {
    private String secretId;
    private String secretKey;
    //签名算法
    private static final String HMAC_ALGORITHM = "HmacSHA1";
    private static final String CONTENT_CHARSET = "UTF-8";
    public static byte[] byteMerger(byte[] byte1, byte[] byte2) {
        byte[] byte3 = new byte[byte1.length + byte2.length];
        System.arraycopy(byte1, 0, byte3, 0, byte1.length);
        System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length);
        return byte3;
    }
    // 获取签名
    public String getUploadSignature() throws Exception {
        String strSign = "";
        String contextStr = "";
        // 生成原始参数字符串
        long currentTime = System.currentTimeMillis() / 1000;
        int random = new Random().nextInt(Integer.MAX_VALUE);
        // 签名有效期:30 分钟
        int signValidDuration = 1800;
        long endTime = (currentTime + signValidDuration);
        contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8");
        contextStr += "&currentTimeStamp=" + currentTime;
        contextStr += "&expireTime=" + endTime;
        contextStr += "&random=" + random;
        try {
            Mac mac = Mac.getInstance(HMAC_ALGORITHM);
            SecretKeySpec secretKey = new SecretKeySpec(this.secretKey.getBytes(CONTENT_CHARSET), mac.getAlgorithm());
            mac.init(secretKey);
            byte[] hash = mac.doFinal(contextStr.getBytes(CONTENT_CHARSET));
            byte[] sigBuf = byteMerger(hash, contextStr.getBytes("utf8"));
            strSign = base64Encode(sigBuf);
            strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", "");
        } catch (Exception e) {
            throw e;
        }
        return strSign;
    }
    private String base64Encode(byte[] buffer) {
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encode(buffer);
    }
    public void setSecretId(String secretId) {
        this.secretId = secretId;
    }
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
}

+ 3 - 0
gateway/ag-basic/src/main/java/com/yihu/AgBasicServer.java

@ -1,5 +1,7 @@
package com.yihu;
import com.netflix.zuul.FilterProcessor;
import com.yihu.jw.gateway.filter.DidiFilterProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@ -16,6 +18,7 @@ import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
public class AgBasicServer extends SpringBootServletInitializer {
    public static void main(String [] args) {
        FilterProcessor.setProcessor(new DidiFilterProcessor());
        SpringApplication.run(AgBasicServer.class, args);
    }

+ 28 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/DidiFilterProcessor.java

@ -0,0 +1,28 @@
package com.yihu.jw.gateway.filter;
import com.netflix.zuul.FilterProcessor;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/19
 * @Description:
 */
public class DidiFilterProcessor extends FilterProcessor {
    @Override
    public Object processZuulFilter(ZuulFilter filter) throws ZuulException {
        try {
            return super.processZuulFilter(filter);
        } catch (ZuulException e) {
            ZuulException e1 = new ZuulException("123456",10085,"10000");
            RequestContext ctx = RequestContext.getCurrentContext();
            ctx.set("failed.exception", e1);
            ctx.set("failed.filter", filter);
            throw e1 ;
        }
    }
}

+ 34 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/ErrorExtFilter.java

@ -0,0 +1,34 @@
package com.yihu.jw.gateway.filter;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter;
import org.springframework.stereotype.Component;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/19
 * @Description:
 */
@Component
public class ErrorExtFilter extends SendErrorFilter{
    @Override
    public String filterType() {
        return "error";
    }
    @Override
    public int filterOrder() {
        return 30;
    }
    @Override
    public boolean shouldFilter() {
        RequestContext ctx = RequestContext.getCurrentContext();
        ZuulFilter failedFilter = (ZuulFilter) ctx.get("failed.filter");
        if(failedFilter != null && failedFilter.filterType().equals("post")) {
            return true;
        }
        return false;
    }
}

+ 1 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -764,6 +764,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
        loginTypeList.add("4");
        loginTypeList.add("5");
        loginTypeList.add("6");
        loginTypeList.add("7");
    }
    public boolean setRolePhth(String loginType, OAuth2AccessToken token, String id, StringRedisTemplate redisTemplate) {

+ 2 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -171,7 +171,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
     *                    username 用户名/手机/身份证号
     *                    key 图形验证码键值
     *                    text 用户输入的图形验证码
     *                    login_type 用户类型 1或默认为user,2:医生登录,3:患者登录,4:第三方同步账号登录,5.易联众居民健康卡授权登录 6医养项目家人登录
     *                    login_type 用户类型 1或默认为user,2:医生登录,3:患者登录,4:第三方同步账号登录,5.易联众居民健康卡授权登录
     *                    6医联康登录 7医养项目家人登录
     * @param httpSession
     * @return
     * @throws Exception

+ 18 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseCatalogueDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.CourseCatalogueDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
public interface CourseCatalogueDao extends PagingAndSortingRepository<CourseCatalogueDO, String>, JpaSpecificationExecutor<CourseCatalogueDO> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.CourseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
public interface CourseDao extends PagingAndSortingRepository<CourseDO, String>, JpaSpecificationExecutor<CourseDO> {
}

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CourseSalesOrderRecordDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.CourseSalesOrderRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
public interface CourseSalesOrderRecordDao extends PagingAndSortingRepository<CourseSalesOrderRecordDO, String>
        , JpaSpecificationExecutor<CourseSalesOrderRecordDO> {
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/CustomerServiceDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.CustomerServiceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
public interface CustomerServiceDao extends PagingAndSortingRepository<CustomerServiceDO, String>, JpaSpecificationExecutor<CustomerServiceDO> {
    List<CustomerServiceDO> findByOrgCode(String orgCode);
}

+ 21 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/PatientOrderRefundDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
public interface PatientOrderRefundDao extends PagingAndSortingRepository<PatientOrderRefundDO, String>
        , JpaSpecificationExecutor<PatientOrderRefundDO> {
    PatientOrderRefundDO findByTypeAndOrderId(String type,String orderId);
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/RecruitStudentsDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
public interface RecruitStudentsDao extends PagingAndSortingRepository<RecruitStudentsDO, String>, JpaSpecificationExecutor<RecruitStudentsDO> {
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/RecruitStudentsRecordDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.dao.course;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
public interface RecruitStudentsRecordDao extends PagingAndSortingRepository<RecruitStudentsRecordDO, String>,
        JpaSpecificationExecutor<RecruitStudentsRecordDO> {
    List<RecruitStudentsRecordDO> findByRecruitStudentsIdAndStatus(String recruitStudentsId,String status);
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/BusinessSysDictDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.dao.dict;
import com.yihu.jw.entity.care.common.BusinessSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description:
 */
public interface BusinessSysDictDao extends PagingAndSortingRepository<BusinessSysDictDO, String>, JpaSpecificationExecutor<BusinessSysDictDO> {
    List<BusinessSysDictDO> findByDictName(String dictName);
}

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDietDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.dao.dict;
import com.yihu.jw.entity.care.common.DictDietDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
public interface DictDietDao extends PagingAndSortingRepository<DictDietDO, String>, JpaSpecificationExecutor<DictDietDO> {
}

+ 99 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseCatalogueEndpoint.java

@ -0,0 +1,99 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.CourseCatalogueService;
import com.yihu.jw.entity.care.course.CourseCatalogueDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@RestController
@RequestMapping(value = "courseCatalogue", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "课程目录管理", description = "课程目录管理服务接口", tags = {"care基础服务 - 课程目录管理服务接口"})
public class CourseCatalogueEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CourseCatalogueService courseCatalogueService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<CourseCatalogueDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseCatalogueDO catalogueDO = toEntity(jsonData, CourseCatalogueDO.class);
        catalogueDO = courseCatalogueService.save(catalogueDO);
        return success(catalogueDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        courseCatalogueService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<CourseCatalogueDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseCatalogueDO catalogueDO = toEntity(jsonData, CourseCatalogueDO.class);
        if (null == catalogueDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        catalogueDO = courseCatalogueService.save(catalogueDO);
        return success(catalogueDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<CourseCatalogueDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<CourseCatalogueDO> catalogueDOs = courseCatalogueService.search(fields, filters, sorts, page, size);
        int count = (int)courseCatalogueService.getCount(filters);
        return success(catalogueDOs, count, page, size, CourseCatalogueDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<CourseCatalogueDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<CourseCatalogueDO> catalogueDOs = courseCatalogueService.search(fields, filters, sorts);
        return success(catalogueDOs, CourseCatalogueDO.class);
    }
}

+ 140 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseEndpoint.java

@ -0,0 +1,140 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.CourseService;
import com.yihu.jw.entity.care.course.CourseDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.tencent.TencentVODUtil;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@RestController
@RequestMapping(value = "course", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "课程管理", description = "课程管理服务接口", tags = {"care基础服务 - 课程管理服务接口"})
public class CourseEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CourseService courseService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${tencent.secretId}")
    private String secretId;
    @Value("${tencent.secretKey}")
    private String secretKey;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<CourseDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseDO courseDO = toEntity(jsonData, CourseDO.class);
        courseDO.setDel(1);
        courseDO.setLiveStatus("1");
        if(StringUtil.isBlank(courseDO.getStatus())){
            courseDO.setStatus("1");
        }
        courseDO = courseService.save(courseDO);
        return success(courseDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        courseService.deletes(ids);
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<CourseDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseDO courseDO = toEntity(jsonData, CourseDO.class);
        if (null == courseDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        courseDO = courseService.save(courseDO);
        return success(courseDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<CourseDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        if(StringUtil.isBlank(filters)){
            filters = "del=1";
        }else{
            filters += ";del=1";
        }
        List<CourseDO> courseDOs = courseService.search(fields, filters, sorts, page, size);
        int count = (int)courseService.getCount(filters);
        return success(courseDOs, count, page, size, CourseDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<CourseDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        if(StringUtil.isBlank(filters)){
            filters = "del=1";
        }else{
            filters += ";del=1";
        }
        List<CourseDO> courseDOs = courseService.search(fields, filters, sorts);
        return success(courseDOs, CourseDO.class);
    }
    @GetMapping(value = "findDoctorByOrg")
    @ApiOperation(value = "获取教师")
    public ListEnvelop findDoctorByOrg (
            @ApiParam(name = "orgCode", value = "机构code")
            @RequestParam(value = "orgCode", required = false) String orgCode) throws Exception {
        return success(courseService.findDoctorByOrg(orgCode));
    }
    @GetMapping(value = "getTXUploadSignature")
    @ApiOperation(value = "获取腾讯视频上传签名")
    public Envelop getTXUploadSignature() throws Exception {
        TencentVODUtil tencentVODUtil = new TencentVODUtil();
        tencentVODUtil.setSecretId(secretId);
        tencentVODUtil.setSecretKey(secretKey);
        return success(tencentVODUtil.getUploadSignature());
    }
}

+ 116 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CourseSalesOrderRecordEndpoint.java

@ -0,0 +1,116 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.CourseSalesOrderRecordService;
import com.yihu.jw.entity.care.course.CourseSalesOrderRecordDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
@RestController
@RequestMapping(value = "courseSalesOrderRecord", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "课程销售记录管理", description = "课程销售记录管理服务接口", tags = {"care基础服务 - 课程销售记录管理服务接口"})
public class CourseSalesOrderRecordEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CourseSalesOrderRecordService courseSalesOrderRecordService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<CourseSalesOrderRecordDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseSalesOrderRecordDO courseSalesOrderRecordDO = toEntity(jsonData, CourseSalesOrderRecordDO.class);
        courseSalesOrderRecordDO = courseSalesOrderRecordService.save(courseSalesOrderRecordDO);
        return success(courseSalesOrderRecordDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        courseSalesOrderRecordService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<CourseSalesOrderRecordDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CourseSalesOrderRecordDO courseSalesOrderRecordDO = toEntity(jsonData, CourseSalesOrderRecordDO.class);
        if (null == courseSalesOrderRecordDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        courseSalesOrderRecordDO = courseSalesOrderRecordService.save(courseSalesOrderRecordDO);
        return success(courseSalesOrderRecordDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<CourseSalesOrderRecordDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<CourseSalesOrderRecordDO> courseSalesOrderRecordDOs = courseSalesOrderRecordService.search(fields, filters, sorts, page, size);
        int count = (int)courseSalesOrderRecordService.getCount(filters);
        return success(courseSalesOrderRecordDOs, count, page, size, CourseSalesOrderRecordDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<CourseSalesOrderRecordDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<CourseSalesOrderRecordDO> courseSalesOrderRecordDOs = courseSalesOrderRecordService.search(fields, filters, sorts);
        return success(courseSalesOrderRecordDOs, CourseSalesOrderRecordDO.class);
    }
    @PostMapping(value = "refund")
    @ApiOperation(value = "退费")
    public Envelop refund(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id") String id) {
        try{
            courseSalesOrderRecordService.refund(id);
            return success("退费成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("退费失败",-1);
        }
    }
}

+ 112 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/CustomerServiceEndpoint.java

@ -0,0 +1,112 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.dao.course.CustomerServiceDao;
import com.yihu.jw.base.service.course.CustomerServiceSerivce;
import com.yihu.jw.entity.care.course.CustomerServiceDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@RestController
@RequestMapping(value = "customerService", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "客服管理", description = "客服管理服务接口", tags = {"care基础服务 - 客服管理服务接口"})
public class CustomerServiceEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CustomerServiceSerivce customerServiceSerivce;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private CustomerServiceDao customerServiceDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<CustomerServiceDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) {
        try {
            CustomerServiceDO customerServiceDO = toEntity(jsonData, CustomerServiceDO.class);
            List<CustomerServiceDO> customerServiceDOList = customerServiceDao.findByOrgCode(customerServiceDO.getOrgCode());
            if(customerServiceDOList.size()>0){
                return ObjEnvelop.getError("该机构已存在客服团队",-1);
            }
            customerServiceDO = customerServiceSerivce.save(customerServiceDO);
            return success(customerServiceDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("创建失败",-1);
        }
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        customerServiceSerivce.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<CustomerServiceDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        CustomerServiceDO customerServiceDO = toEntity(jsonData, CustomerServiceDO.class);
        if (null == customerServiceDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        customerServiceDO = customerServiceSerivce.save(customerServiceDO);
        return success(customerServiceDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<CustomerServiceDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<CustomerServiceDO> customerServiceDOs = customerServiceSerivce.search(fields, filters, sorts, page, size);
        int count = (int)customerServiceSerivce.getCount(filters);
        return success(customerServiceDOs, count, page, size, CustomerServiceDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<CustomerServiceDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<CustomerServiceDO> customerServiceDOs = customerServiceSerivce.search(fields, filters, sorts);
        return success(customerServiceDOs, CustomerServiceDO.class);
    }
}

+ 117 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/PatientOrderRefundEndpoint.java

@ -0,0 +1,117 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.PatientOrderRefundService;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
@RestController
@RequestMapping(value = "patientOrderRefund", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "居民售后管理", description = "居民售后管理服务接口", tags = {"care基础服务 - 居民售后管理服务接口"})
public class PatientOrderRefundEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientOrderRefundService patientOrderRefundService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<PatientOrderRefundDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        PatientOrderRefundDO patientOrderRefundDO = toEntity(jsonData, PatientOrderRefundDO.class);
        patientOrderRefundDO = patientOrderRefundService.save(patientOrderRefundDO);
        return success(patientOrderRefundDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        patientOrderRefundService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<PatientOrderRefundDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        PatientOrderRefundDO patientOrderRefundDO = toEntity(jsonData, PatientOrderRefundDO.class);
        if (null == patientOrderRefundDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        patientOrderRefundDO = patientOrderRefundService.save(patientOrderRefundDO);
        return success(patientOrderRefundDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<PatientOrderRefundDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<PatientOrderRefundDO> patientOrderRefundDOs = patientOrderRefundService.search(fields, filters, sorts, page, size);
        int count = (int)patientOrderRefundService.getCount(filters);
        return success(patientOrderRefundDOs, count, page, size, PatientOrderRefundDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<PatientOrderRefundDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<PatientOrderRefundDO> patientOrderRefundDOs = patientOrderRefundService.search(fields, filters, sorts);
        return success(patientOrderRefundDOs, PatientOrderRefundDO.class);
    }
    @PostMapping(value = "refund")
    @ApiOperation(value = "退费")
    public Envelop refund(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id") String id) {
        try{
            patientOrderRefundService.refund(id);
            return success("退费成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("退费失败",-1);
        }
    }
}

+ 113 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/RecruitStudentsEndpoint.java

@ -0,0 +1,113 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.RecruitStudentsService;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@RestController
@RequestMapping(value = "recruitStudents", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "招生管理", description = "招生管理服务接口", tags = {"care基础服务 - 招生管理服务接口"})
public class RecruitStudentsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private RecruitStudentsService recruitStudentsService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<RecruitStudentsDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        RecruitStudentsDO recruitStudentsDO = toEntity(jsonData, RecruitStudentsDO.class);
        recruitStudentsDO.setDel(1);
        recruitStudentsDO = recruitStudentsService.save(recruitStudentsDO);
        return success(recruitStudentsDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        recruitStudentsService.deletes(ids);
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<RecruitStudentsDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        RecruitStudentsDO recruitStudentsDO = toEntity(jsonData, RecruitStudentsDO.class);
        if (null == recruitStudentsDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        recruitStudentsDO = recruitStudentsService.save(recruitStudentsDO);
        return success(recruitStudentsDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<RecruitStudentsDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        if(StringUtil.isBlank(filters)){
            filters = "del=1";
        }else{
            filters += ";del=1";
        }
        List<RecruitStudentsDO> recruitStudentsDOs = recruitStudentsService.search(fields, filters, sorts, page, size);
        int count = (int)recruitStudentsService.getCount(filters);
        return success(recruitStudentsDOs, count, page, size, RecruitStudentsDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<RecruitStudentsDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        if(StringUtil.isBlank(filters)){
            filters = "del=1";
        }else{
            filters += ";del=1";
        }
        List<RecruitStudentsDO> recruitStudentsDOs = recruitStudentsService.search(fields, filters, sorts);
        return success(recruitStudentsDOs, RecruitStudentsDO.class);
    }
}

+ 151 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/course/RecruitStudentsRecordEndpoint.java

@ -0,0 +1,151 @@
package com.yihu.jw.base.endpoint.course;
import com.yihu.jw.base.service.course.RecruitStudentsRecordService;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@RestController
@RequestMapping(value = "recruitStudentsRecord", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "报名人员管理", description = "报名人员管理服务接口", tags = {"care基础服务 - 报名人员管理服务接口"})
public class RecruitStudentsRecordEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private RecruitStudentsRecordService recruitStudentsRecordService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<RecruitStudentsRecordDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        RecruitStudentsRecordDO recordDO = toEntity(jsonData, RecruitStudentsRecordDO.class);
        recordDO = recruitStudentsRecordService.save(recordDO);
        return success(recordDO);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        recruitStudentsRecordService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<RecruitStudentsRecordDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        RecruitStudentsRecordDO recordDO = toEntity(jsonData, RecruitStudentsRecordDO.class);
        if (null == recordDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        recordDO = recruitStudentsRecordService.save(recordDO);
        return success(recordDO);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<RecruitStudentsRecordDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<RecruitStudentsRecordDO> recordDOs = recruitStudentsRecordService.search(fields, filters, sorts, page, size);
        int count = (int)recruitStudentsRecordService.getCount(filters);
        return success(recordDOs, count, page, size, RecruitStudentsRecordDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<RecruitStudentsRecordDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<RecruitStudentsRecordDO> recordDOs = recruitStudentsRecordService.search(fields, filters, sorts);
        return success(recordDOs, RecruitStudentsRecordDO.class);
    }
    @PostMapping(value = "refund")
    @ApiOperation(value = "退费")
    public Envelop refund(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id") String id) {
        try{
            recruitStudentsRecordService.refund(id);
            return success("退费成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("退费失败",-1);
        }
    }
    @PostMapping(value = "admissions")
    @ApiOperation(value = "录取")
    public Envelop admissions(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids,
            @ApiParam(name = "recruitStudentsId", value = "招生记录id", required = true)
            @RequestParam(value = "recruitStudentsId") String recruitStudentsId) {
        try{
            String re =  recruitStudentsRecordService.admissions(ids,recruitStudentsId);
            if(re == null){
                return success("录取成功");
            }else {
                return Envelop.getError(re,-1);
            }
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("录取失败",-1);
        }
    }
    @PostMapping(value = "refuses")
    @ApiOperation(value = "批量拒绝")
    public Envelop refuses(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        try{
            recruitStudentsRecordService.refuses(ids);
            return success("拒绝成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("拒绝失败",-1);
        }
    }
}

+ 109 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/BusinessSysDictEndpoint.java

@ -0,0 +1,109 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.base.dao.dict.BusinessSysDictDao;
import com.yihu.jw.base.service.dict.BusinessSysDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description:
 */
@RestController
@RequestMapping(value = "businessSysDict")
@Api(value = "托育业务字典管理", description = "托育业务字典管理", tags = {"care基础服务 - 托育业务字典管理"})
public class BusinessSysDictEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BusinessSysDictService businessSysDictService;
    @Autowired
    private BusinessSysDictDao businessSysDictDao;
    @ApiOperation("查询字典")
    @GetMapping(value= "findDict")
    public MixEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
                               @RequestParam(value = "name", required = false)String name,
                               @ApiParam(name = "modelName", value = "modelName", required = false)
                               @RequestParam(value = "modelName", required = false)String modelName,
                               @ApiParam(name = "code", value = "code", required = false)
                               @RequestParam(value = "code", required = false)String code,
                               @ApiParam(name = "value", value = "value", required = false)
                               @RequestParam(value = "value", required = false)String value,
                               @ApiParam(name = "page", value = "page", required = false)
                               @RequestParam(value = "page", required = false) Integer page,
                               @ApiParam(name = "pageSize", value = "pageSize", required = false)
                               @RequestParam(value = "pageSize", required = false)Integer pageSize){
        return businessSysDictService.findDictsByNameCode(modelName,name,code,value,page,pageSize);
    }
    @ApiOperation("新增/修改字典")
    @GetMapping(value= "createOrUpdateDict")
    public Envelop createOrUpdateDict(@ApiParam(name = "json", value = "id", required = true)
                                      @RequestParam(value = "json", required = true)String json) throws Exception{
        return success(businessSysDictService.updateOrCreateDict(json));
    }
    @ApiOperation("删除字典")
    @GetMapping(value= "delDict")
    public Envelop delDict(@ApiParam(name = "id", value = "id", required = true)
                           @RequestParam(value = "id", required = true)String id){
        return success(businessSysDictService.deleteDictById(id));
    }
    @ApiOperation("查字典模块")
    @GetMapping(value= "findModelDict")
    public MixEnvelop findModelDict(@ApiParam(name = "modelName", value = "modelName", required = false)
                                    @RequestParam(value = "modelName", required = false)String modelName,
                                    @ApiParam(name = "dictName", value = "dictName", required = false)
                                    @RequestParam(value = "dictName", required = false)String dictName,
                                    @ApiParam(name = "page", value = "page", required = false)
                                    @RequestParam(value = "page", required = false) Integer page,
                                    @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                    @RequestParam(value = "pageSize", required = false)Integer pageSize) throws Exception{
        return businessSysDictService.findModel(modelName,dictName,page,pageSize);
    }
    @ApiOperation("批量修改字典")
    @GetMapping(value= "updateDictGroup")
    public Envelop updateDictGroup(@ApiParam(name = "json", value = "", required = true)
                                   @RequestParam(value = "json", required = true)String json) {
        try {
            return businessSysDictService.updateByModelName(json);
        } catch (Exception e) {
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @ApiOperation("批量删除字典")
    @GetMapping(value= "delDictGroup")
    public Envelop delDictGroup(@ApiParam(name = "preDictName", value = "", required = true)
                                @RequestParam(value = "preDictName", required = true)String preDictName) throws Exception{
        return businessSysDictService.deleteByModelName(preDictName);
    }
    @ApiOperation("查单条")
    @GetMapping(value= "findOneDict")
    public Envelop findOneDict(@ApiParam(name = "id", value = "id", required = true)
                               @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(businessSysDictDao.findOne(id));
    }
}

+ 109 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDietEndpoint.java

@ -0,0 +1,109 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.base.service.dict.DictDietService;
import com.yihu.jw.entity.care.common.DictDietDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
@RestController
@RequestMapping(value = "dictDiet", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "饮食字典管理", description = "饮食字典管理服务接口", tags = {"基础服务 - 饮食字典管理服务接口"})
public class DictDietEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DictDietService dictDietService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<DictDietDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DictDietDO dictDiet = toEntity(jsonData, DictDietDO.class);
        dictDiet = dictDietService.save(dictDiet);
        return success(dictDiet);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        dictDietService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<DictDietDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DictDietDO dictDiet = toEntity(jsonData, DictDietDO.class);
        if (null == dictDiet.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        dictDiet = dictDietService.save(dictDiet);
        return success(dictDiet);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<DictDietDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<DictDietDO> dictDiets = dictDietService.search(fields, filters, sorts, page, size);
        List<WlyyHospitalSysDictDO> foods =  wlyyHospitalSysDictDao.findByDictNameNotNull("foodClassification");
        Map<String,String> foodDict = foods.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
        dictDiets.stream().forEach(one->{
            one.setTypeName(foodDict.get(one.getType()));
        });
        int count = (int)dictDietService.getCount(filters);
        return success(dictDiets, count, page, size, DictDietDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<DictDietDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<DictDietDO> dictDiets = dictDietService.search(fields, filters, sorts);
        return success(dictDiets, DictDietDO.class);
    }
    
}

+ 21 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java

@ -102,6 +102,27 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
        return success(basePatients, count, page, size, BasePatientVO.class);
    }
    @GetMapping(value = "pageByCondition")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<BasePatientVO> pageByCondition(
            @ApiParam(name = "name", value = "手机号/姓名/身份证")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "archiveStatus", value = "档案状态")
            @RequestParam(value = "archiveStatus", required = false) Integer archiveStatus,
            @ApiParam(name = "archiveType", value = "档案类型")
            @RequestParam(value = "archiveType", required = false) Integer archiveType,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        try {
            return basePatientService.pageByCondition(name, archiveType , archiveStatus, page, size);
        }catch (Exception e){
            return PageEnvelop.getError(e.getMessage(),-1);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<BasePatientVO> list(

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -75,19 +75,21 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<ServicePackageDO> servicePackageDOS = servicePackageService.search(fields, filters, sorts, page, size);
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
        for (ServicePackageDO servicePackageDO:servicePackageDOS){
            List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByServicePackageId(servicePackageDO.getId());
            List<String> orgNames = itemDOList.stream().map(p -> p.getOrgName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
            servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS){
                if (servicePackageDO.getType().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setTypeName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS1){
                if (servicePackageDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setDelName(wlyyHospitalSysDictDO.getDictValue());

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseCatalogueService.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.CourseCatalogueDao;
import com.yihu.jw.entity.care.course.CourseCatalogueDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class CourseCatalogueService extends BaseJpaService<CourseCatalogueDO, CourseCatalogueDao> {
}

+ 49 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseSalesOrderRecordService.java

@ -0,0 +1,49 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.CourseSalesOrderRecordDao;
import com.yihu.jw.base.dao.course.PatientOrderRefundDao;
import com.yihu.jw.entity.care.course.CourseSalesOrderRecordDO;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
@Service
public class CourseSalesOrderRecordService extends BaseJpaService<CourseSalesOrderRecordDO, CourseSalesOrderRecordDao> {
    @Autowired
    private CourseSalesOrderRecordDao courseSalesOrderRecordDao;
    @Autowired
    private PatientOrderRefundDao patientOrderRefundDao;
    /**
     * 退费操作
     * @pa id
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized void refund(String id){
        CourseSalesOrderRecordDO courseSalesOrderRecordDO = courseSalesOrderRecordDao.findOne(id);
        PatientOrderRefundDO refundDO = patientOrderRefundDao.findByTypeAndOrderId("2",id);
        boolean flag = "3".equals(courseSalesOrderRecordDO.getStatus())&&
                (refundDO == null ||"1".equals(refundDO.getStatus()));
        if(flag){
            //待退费的状态才能操作
            refundDO.setStatus("2");
            patientOrderRefundDao.save(refundDO);
            courseSalesOrderRecordDO.setStatus("5");
            courseSalesOrderRecordDao.save(courseSalesOrderRecordDO);
            //微信退款操作
            //待开发
        }
    }
}

+ 54 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CourseService.java

@ -0,0 +1,54 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.CourseDao;
import com.yihu.jw.entity.care.course.CourseDO;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class CourseService extends BaseJpaService<CourseDO, CourseDao> {
    @Autowired
    private CourseDao courseDao;
    /**
     * 伪删除
     * @param ids
     */
    public void deletes(String ids){
        List<CourseDO> courseDOList = new ArrayList<>();
        for(String id:ids.split(",")){
            CourseDO courseDO = courseDao.findOne(id);
            courseDO.setDel(0);
            courseDOList.add(courseDO);
        }
        courseDao.save(courseDOList);
    }
    /**
     * 查找机构的老师
     * @param orgCode
     * @return
     */
    public List<Map<String,Object>> findDoctorByOrg(String orgCode){
        String sql ="SELECT d.id,d.name from base_doctor_hospital h,base_doctor d " +
                "WHERE h.doctor_code = d.id and h.del = '1' and d.del = '1' ";
        if(!StringUtil.isBlank(orgCode)){
            sql += " and h.org_code = '"+orgCode+"' ";
        }
        return jdbcTemplate.queryForList(sql);
    }
}

+ 24 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/CustomerServiceSerivce.java

@ -0,0 +1,24 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.CustomerServiceDao;
import com.yihu.jw.entity.care.course.CustomerServiceDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class CustomerServiceSerivce extends BaseJpaService<CustomerServiceDO, CustomerServiceDao> {
    @Autowired
    private CustomerServiceDao customerServiceDao;
}

+ 67 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/PatientOrderRefundService.java

@ -0,0 +1,67 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.CourseSalesOrderRecordDao;
import com.yihu.jw.base.dao.course.PatientOrderRefundDao;
import com.yihu.jw.base.dao.course.RecruitStudentsRecordDao;
import com.yihu.jw.entity.care.course.CourseSalesOrderRecordDO;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/17
 * @Description:
 */
@Service
public class PatientOrderRefundService extends BaseJpaService<PatientOrderRefundDO, PatientOrderRefundDao> {
    @Autowired
    private PatientOrderRefundDao patientOrderRefundDao;
    @Autowired
    private CourseSalesOrderRecordDao courseSalesOrderRecordDao;
    @Autowired
    private RecruitStudentsRecordDao recruitStudentsRecordDao;
    /**
     * 退费操作
     * @pa id
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized void refund(String id){
        PatientOrderRefundDO refundDO = patientOrderRefundDao.findOne(id);
        CourseSalesOrderRecordDO courseSalesOrderRecordDO = null;
        RecruitStudentsRecordDO recruitStudentsRecordDO = null;
        String orderType = refundDO.getType();
        String orderStatus = "";
        if("2".equals(orderType)){
            courseSalesOrderRecordDO = courseSalesOrderRecordDao.findOne(refundDO.getOrderId());
            orderStatus = courseSalesOrderRecordDO.getStatus();
        }else if("1".equals(orderType)){
            recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(refundDO.getOrderId());
            orderStatus = recruitStudentsRecordDO.getStatus();
        }
        if("1".equals(refundDO.getStatus())&&"3".equals(orderStatus)){
            //待退费的状态才能操作
            refundDO.setStatus("2");
            patientOrderRefundDao.save(refundDO);
            if("2".equals(orderType)){
                courseSalesOrderRecordDO.setStatus("5");
                courseSalesOrderRecordDao.save(courseSalesOrderRecordDO);
            }else if("1".equals(orderType)){
                recruitStudentsRecordDO.setStatus("5");
                recruitStudentsRecordDao.save(recruitStudentsRecordDO);
            }
            //微信退款操作
            //待开发
        }
    }
}

+ 151 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsRecordService.java

@ -0,0 +1,151 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.PatientOrderRefundDao;
import com.yihu.jw.base.dao.course.RecruitStudentsDao;
import com.yihu.jw.base.dao.course.RecruitStudentsRecordDao;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class RecruitStudentsRecordService extends BaseJpaService<RecruitStudentsRecordDO, RecruitStudentsRecordDao> {
    @Autowired
    private PatientOrderRefundDao patientOrderRefundDao;
    @Autowired
    private RecruitStudentsRecordDao recruitStudentsRecordDao;
    @Autowired
    private RecruitStudentsDao recruitStudentsDao;
    /**
     * 退费操作
     * @pa id
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized void refund(String id){
        RecruitStudentsRecordDO recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(id);
        PatientOrderRefundDO refundDO = patientOrderRefundDao.findByTypeAndOrderId("2",id);
        boolean flag = "3".equals(recruitStudentsRecordDO.getStatus())&&
                (refundDO == null ||"1".equals(refundDO.getStatus()));
        if(flag){
            recruitStudentsRecordDO.setStatus("5");
            recruitStudentsRecordDao.save(recruitStudentsRecordDO);
            //微信退款操作
            //待开发
        }
    }
    /**
     * 批量录取
     * @param ids
     * @param recruitStudentsId
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public synchronized String admissions(String ids,String recruitStudentsId){
        if(isAdmissionFull(recruitStudentsId)){
            return "超过录取名额,无法录取";
        }
        String idStr[] = ids.split(",");
        List<RecruitStudentsRecordDO> list = new ArrayList<>();
        String re = "";
        for(String id : idStr){
            RecruitStudentsRecordDO recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(id);
            if("1".equals(recruitStudentsRecordDO.getStatus())){
                recruitStudentsRecordDO.setStatus("2");
                list.add(recruitStudentsRecordDO);
            }else{
                re += recruitStudentsRecordDO.getPatientName()+",";
            }
        }
        recruitStudentsRecordDao.save(list);
//        if(re.length()>0){
//            re = re.substring(0,re.length()-2);
//            return "("+ re +")人员状态不是待录取,无法录取,其他人员录取成功";
//        }
        return null;
    }
    /**
     * 批量拒绝
     * @param ids
     */
    public synchronized void refuses(String ids){
        String idStr[] = ids.split(",");
        List<RecruitStudentsRecordDO> list = new ArrayList<>();
        for(String id : idStr){
            RecruitStudentsRecordDO recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(id);
            if("1".equals(recruitStudentsRecordDO.getStatus())){
                recruitStudentsRecordDO.setStatus("4");
                list.add(recruitStudentsRecordDO);
            }
        }
        recruitStudentsRecordDao.save(list);
    }
    /**
     * 是否录取满 true录取满了
     * @param id
     * @return
     */
    public synchronized boolean isAdmissionFull(String id){
        List<RecruitStudentsRecordDO> list = recruitStudentsRecordDao.findByRecruitStudentsIdAndStatus(id,"3");
        RecruitStudentsDO recruitStudentsDO = recruitStudentsDao.findOne(id);
        if(recruitStudentsDO.getNum()<=list.size()){
            return true;
        }
        return false;
    }
    /**
     * 录取单个
     * @param id
     * @return
     */
    public synchronized String admission(String id){
        RecruitStudentsRecordDO recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(id);
        if("1".equals(recruitStudentsRecordDO.getStatus())){
            return "只有待审核状态的人员才能录取";
        }
        if(isAdmissionFull(recruitStudentsRecordDO.getRecruitStudentsId())){
            return "超过录取名额,无法录取";
        }
        recruitStudentsRecordDO.setStatus("2");
        recruitStudentsRecordDao.save(recruitStudentsRecordDO);
        return null;
    }
    /**
     * 拒绝单个
     * @param id
     */
    public synchronized String refuse(String id){
        RecruitStudentsRecordDO recruitStudentsRecordDO = recruitStudentsRecordDao.findOne(id);
        if("1".equals(recruitStudentsRecordDO.getStatus())){
            return "只有待审核状态的人员才能拒绝";
        }
        recruitStudentsRecordDO.setStatus("4");
        recruitStudentsRecordDao.save(recruitStudentsRecordDO);
        return null;
    }
}

+ 39 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsService.java

@ -0,0 +1,39 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.RecruitStudentsDao;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class RecruitStudentsService extends BaseJpaService<RecruitStudentsDO, RecruitStudentsDao> {
    @Autowired
    private RecruitStudentsDao recruitStudentsDao;
    /**
     * 伪删除
     * @param ids
     */
    public void deletes(String ids){
        List<RecruitStudentsDO> recruitStudentsDOList = new ArrayList<>();
        for(String id:ids.split(",")){
            RecruitStudentsDO recruitStudentsDO = recruitStudentsDao.findOne(id);
            recruitStudentsDO.setDel(0);
            recruitStudentsDOList.add(recruitStudentsDO);
        }
        recruitStudentsDao.save(recruitStudentsDOList);
    }
}

+ 218 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BusinessSysDictService.java

@ -0,0 +1,218 @@
package com.yihu.jw.base.service.dict;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.BusinessSysDictDao;
import com.yihu.jw.entity.care.common.BusinessSysDictDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/10
 * @Description:
 */
@Service
public class BusinessSysDictService extends BaseJpaService<BusinessSysDictDO, BusinessSysDictDao> {
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private BusinessSysDictDao businessSysDictDao;
    //根据id修改或新增字典
    public BusinessSysDictDO updateOrCreateDict(String json) throws  Exception{
        BusinessSysDictDO  businessSysDictDO = objectMapper.readValue(json, BusinessSysDictDO.class);
        String modelName = "";
        if (StringUtils.isNoneBlank(businessSysDictDO.getDictName())){
            List<BusinessSysDictDO> modelNameList=businessSysDictDao.findByDictName(businessSysDictDO.getDictName());
            if (modelNameList!=null&&modelNameList.size()>0){
                modelName= modelNameList.get(0).getModelName();
            }
        }
        businessSysDictDO.setModelName(modelName);
        if(StringUtils.isNoneBlank(businessSysDictDO.getId())){
            BusinessSysDictDO businessSysDictDO1 = businessSysDictDao.findOne(businessSysDictDO.getId());
            if (businessSysDictDO1!=null){
                businessSysDictDO1.setDictValue(businessSysDictDO.getDictValue());
                businessSysDictDO1.setDictCode(businessSysDictDO.getDictCode());
                businessSysDictDO1.setDictName(businessSysDictDO.getDictName());
                businessSysDictDO1.setPyCode(businessSysDictDO.getPyCode());
                businessSysDictDO1.setImgUrl(businessSysDictDO.getImgUrl());
                businessSysDictDO1.setSort(businessSysDictDO.getSort());
                businessSysDictDO1.setModelName(modelName);
            }else {
                businessSysDictDO1 = new BusinessSysDictDO();
                businessSysDictDO1.setDictValue(businessSysDictDO.getDictValue());
                businessSysDictDO1.setDictCode(businessSysDictDO.getDictCode());
                businessSysDictDO1.setDictName(businessSysDictDO.getDictName());
                businessSysDictDO1.setPyCode(businessSysDictDO.getPyCode());
                businessSysDictDO1.setImgUrl(businessSysDictDO.getImgUrl());
                businessSysDictDO1.setSort(businessSysDictDO.getSort());
                businessSysDictDO1.setModelName(modelName);
            }
            return businessSysDictDao.save(businessSysDictDO1);
        }
        return businessSysDictDao.save(businessSysDictDO);
    }
    //根据id删除字典
    public String  deleteDictById(String id){
        String msg = "";
        if (StringUtils.isNoneBlank(id)){
            BusinessSysDictDO businessSysDictDO = businessSysDictDao.findOne(id);
            if (businessSysDictDO!=null) {
                businessSysDictDao.delete(id);
                msg = "删除成功";
            }else {
                msg = "没有这条记录";
            }
        }else{
            msg = "id为空";
        }
        return msg;
    }
    //查字典
    public MixEnvelop findDictsByNameCode(String modelName,String name,String code,String value,Integer page ,Integer pageSize){
        String  sql = "select t.id as \"id\"," +
                " t.dict_name  as \"dictName\","+
                " t.model_name  as \"modelName\","+
                " t.dict_code  as \"dictCode\","+
                " t.dict_value   as \"dictValue\","+
                " t.sort   as \"sort\","+
                " t.py_code  as \"pyCode\","+
                " t.img_url  as \"imgUrl\","+
                " t.create_time as \"createTime\""+
                " from base_business_sys_dict t where 1=1 ";
        if (StringUtils.isNoneBlank(name)){
            sql+=" and t.dict_name like '%"+name+"%'";
        }
        if (StringUtils.isNoneBlank(modelName)){
            sql+=" and t.model_name like '%"+modelName+"%'";
        }
        if (StringUtils.isNoneBlank(code)){
            sql+=" and t.dict_code like '%"+code+"%'";
        }
        if (StringUtils.isNoneBlank(value)){
            sql+=" and t.dict_value like '%"+value+"%'";
        }
        sql+=" and t.dict_code is not null and  t.dict_code != ''";
        if (page==null||page==null){
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setTotalCount(list==null?0:list.size());
            mixEnvelop.setDetailModelList(list);
            return  mixEnvelop;
        }else {
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
            List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
            mixEnvelop.setCurrPage(page);
            mixEnvelop.setPageSize(pageSize);
            mixEnvelop.setDetailModelList(list);
            return  mixEnvelop;
        }
    }
    //查字典
    public MixEnvelop findModel(String modelName, String name, Integer page , Integer pageSize){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String  sql = "select " +
                " t.dict_name  as \"dictName\","+
                " t.model_name  as \"modelName\""+
                " from base_business_sys_dict t where 1=1 ";
        if (StringUtils.isNoneBlank(name)){
            sql+=" and t.dict_name like '%"+name+"%'";
        }
        if (StringUtils.isNoneBlank(modelName)){
            sql+=" and t.model_name like '%"+modelName+"%'";
        }
        sql+=" group by t.dict_name,t.model_name ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
        if (listCount!=null){
            mixEnvelop.setTotalCount(listCount.size());
        }else {
            mixEnvelop.setTotalCount(0);
        }
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);
        return  mixEnvelop;
    }
    public Envelop updateByModelName(String jsonData) throws Exception{
        Envelop envelop = new Envelop();
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        if (StringUtils.isNoneBlank(jsonObject.getString("preDictName"))){
            String preDictName = jsonObject.get("preDictName").toString();
            List<BusinessSysDictDO> list  =  businessSysDictDao.findByDictName(preDictName);
            for (BusinessSysDictDO sysDictDO:list){
                if (jsonObject.get("dictName")!=null){
                    sysDictDO.setDictName(jsonObject.get("dictName").toString());
                }
                if (jsonObject.get("modelName")!=null){
                    sysDictDO.setModelName(jsonObject.get("modelName").toString());
                }
            }
            businessSysDictDao.save(list);
            envelop.setMessage("操作成功");
            envelop.setStatus(200);
        }else {
            if (jsonObject.get("dictName")!=null){
                List<BusinessSysDictDO> list  =  businessSysDictDao.findByDictName(jsonObject.get("dictName").toString());
                if (list!=null&&list.size()>0){
                    throw new Exception("该dictName已经存在");
                }else {
                    BusinessSysDictDO sysDictDO=new BusinessSysDictDO();
                    sysDictDO.setDictName(jsonObject.get("dictName").toString());
                    if (jsonObject.get("modelName")!=null){
                        sysDictDO.setModelName(jsonObject.get("modelName").toString());
                    }
                    businessSysDictDao.save(sysDictDO);
                }
                envelop.setMessage("操作成功");
                envelop.setStatus(200);
            }else {
                envelop.setMessage("dictName为空");
                envelop.setStatus(-1);
            }
        }
        return envelop;
    }
    public Envelop deleteByModelName(String preDictName){
        Envelop envelop = new Envelop();
        if (StringUtils.isNoneBlank(preDictName)){
            List<BusinessSysDictDO> list  =  businessSysDictDao.findByDictName(preDictName);
            for (BusinessSysDictDO sysDictDO:list){
                businessSysDictDao.delete(sysDictDO);
            }
            envelop.setMessage("操作成功");
            envelop.setStatus(200);
        }else {
            envelop.setMessage("preDictName为空");
            envelop.setStatus(-1);
        }
        return envelop;
    }
}

+ 23 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictDietService.java

@ -0,0 +1,23 @@
package com.yihu.jw.base.service.dict;
import com.yihu.jw.base.dao.dict.DictDietDao;
import com.yihu.jw.entity.care.common.DictDietDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
@Service
public class DictDietService  extends BaseJpaService<DictDietDO, DictDietDao> {
    @Autowired
    private DictDietDao dictDietDao;
}

+ 6 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -566,9 +566,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                        }
                    }
                }
                doctorMappingDO.setOrgCode(orgCode);
                doctorMappingDO.setOrgName(orgName);
                doctorMappingDao.save(doctorMappingDO);
                if(doctorMappingDO!=null){
                    doctorMappingDO.setOrgCode(orgCode);
                    doctorMappingDO.setOrgName(orgName);
                    doctorMappingDao.save(doctorMappingDO);
                }
            } catch (IOException e) {
                result.put("msg", "convert hospital jsonObject to baseDoctorHospitalDO failed," + e.getCause());
                result.put("response", ConstantUtils.FAIL);

+ 5 - 0
svr/svr-base/src/main/resources/application.yml

@ -75,6 +75,11 @@ fast-dfs:
configDefault: # 默认配置
  saasId: xmjkzl_saasId
tencent:
  secretId: AKIDa1C6k7D2astd6JGvKRJvFJ6dsrZ1C5h2
  secretKey: 7xWpsd7KGC3f16vUq0ucARRAcnhKfjX4
---
spring:
  profiles: jwdev

+ 20 - 4
svr/svr-cloud-care/pom.xml

@ -121,12 +121,28 @@
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
        </dependency>
        <!-- Jzkl Starter -->
        <!-- Swagger-ui library -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${version.swagger}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${version.swagger-ui}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>${version.springfox-staticdocs}</version>
        </dependency>
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>
            <version>${version.swagger2markup}</version>
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>

+ 152 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/SwaggerConfig.java

@ -0,0 +1,152 @@
package com.yihu.jw.care.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    public static final String API_VERSION = "v1.0";
    final String userAgentJson = "{\"id\":int,\"uid\":string,\"openid\":string,\"token\":string,\"lastUid\":string,\"platform\":int}";
    private List<Parameter> addUseragent() {
        ParameterBuilder tokenPar = new ParameterBuilder();
        List<Parameter> pars = new ArrayList<Parameter>();
        tokenPar.name("userAgent").description(userAgentJson).modelRef(new ModelRef("string")).parameterType("header").required(false).defaultValue("").build();
        pars.add(tokenPar.build());
        return pars;
    }
    @Bean
    public Docket publicAPI() {
        List<Parameter> pars = addUseragent();
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("Default")
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.yihu"))
                .paths(PathSelectors.any())
                .build()
                .globalOperationParameters(pars)
                .apiInfo(publicApiInfo());
    }
    @Bean
    public Docket privateAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("Private")
                .useDefaultResponseMessages(false)
                .forCodeGeneration(false)
                .pathMapping("/")
                .select()
                .paths(or(regex("/archaius"),
                        regex("/loggers*"),
                        regex("/mappings"),
                        regex("/pause"),
                        regex("/beans"),
                        regex("/health"),
                        regex("/resume"),
                        regex("/heapdump"),
                        regex("/env*"),
                        regex("/shutdown"),
                        regex("/configprops"),
                        regex("/auditevents"),
                        regex("/restart"),
                        regex("/trace"),
                        regex("/metrics*"),
                        regex("/refresh"),
                        regex("/dump"),
                        regex("/autoconfig"),
                        regex("/info"),
                        regex("/features")))
                .build()
                .apiInfo(privateAPIInfo());
    }
    @Bean
    public Docket legacyAPI(){
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("Legacy")
                .useDefaultResponseMessages(false)
                .forCodeGeneration(false)
                .pathMapping("/")
                .select()
                .paths(or(regex("/legacy/rest/v.*")))
                .build()
                .apiInfo(legacyApiInfo());
    }
    /**
     * 测试client信息。
     *
     * @return
     */
    /*@Bean
    SecurityConfiguration security() {
        return new SecurityConfiguration(
                "ehr-browser",
                "secret123",
                "ROLE_CLIENT",
                "test-app",
                "ac04-47ec-9a9a-7c47bbcbbbd1");
    }*/
    private ApiInfo publicApiInfo() {
        return new ApiInfoBuilder()
                .title("众健信联平台API")
                .description("众健信联平台API,提供后端基础数据接口")
                .version(API_VERSION)
                .termsOfServiceUrl("https://www.yihu.com")
                .contact(new Contact("Jkzl Xiamen R & D Center Platform Development.", "https://www.yihu.com", "jzkl@jkzl.com"))
                .license("The Apache License, Version 2.0")
                .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
                .build();
    }
    private ApiInfo privateAPIInfo() {
        return new ApiInfoBuilder()
                .title("众健信联平台API")
                .description("众健信联平台API,提供微服务监控接口")
                .version(API_VERSION)
                .termsOfServiceUrl("https://www.yihu.com")
                .contact(new Contact("Jkzl Xiamen R & D Center Platform Development.", "https://www.yihu.com", "jzkl@jkzl.com"))
                .license("The Apache License, Version 2.0")
                .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
                .build();
    }
    private ApiInfo legacyApiInfo() {
        return new ApiInfoBuilder()
                .title("众健信联平台API")
                .description("众健信联平台API,提供遗留版本后端基础数据接口")
                .version(API_VERSION)
                .termsOfServiceUrl("https://www.yihu.com")
                .contact(new Contact("Jkzl Xiamen R & D Center Platform Development.", "https://www.yihu.com", "jzkl@jkzl.com"))
                .license("The Apache License, Version 2.0")
                .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
                .build();
    }
}

+ 21 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseCatalogueDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.CourseCatalogueDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface CourseCatalogueDao extends PagingAndSortingRepository<CourseCatalogueDO, String>, JpaSpecificationExecutor<CourseCatalogueDO> {
    List<CourseCatalogueDO> findByCourserId(String courserId);
}

+ 16 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.CourseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface CourseDao extends PagingAndSortingRepository<CourseDO, String>, JpaSpecificationExecutor<CourseDO> {
}

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CourseSalesOrderRecordDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.CourseSalesOrderRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface CourseSalesOrderRecordDao extends PagingAndSortingRepository<CourseSalesOrderRecordDO, String>
        , JpaSpecificationExecutor<CourseSalesOrderRecordDO> {
}

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/CustomerServiceDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.CustomerServiceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface CustomerServiceDao extends PagingAndSortingRepository<CustomerServiceDO, String>, JpaSpecificationExecutor<CustomerServiceDO> {
    List<CustomerServiceDO> findByOrgCode(String orgCode);
}

+ 21 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/PatientOrderRefundDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface PatientOrderRefundDao extends PagingAndSortingRepository<PatientOrderRefundDO, String>
        , JpaSpecificationExecutor<PatientOrderRefundDO> {
    PatientOrderRefundDO findByTypeAndOrderId(String type, String orderId);
}

+ 16 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/RecruitStudentsDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface RecruitStudentsDao extends PagingAndSortingRepository<RecruitStudentsDO, String>, JpaSpecificationExecutor<RecruitStudentsDO> {
}

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/RecruitStudentsRecordDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
public interface RecruitStudentsRecordDao extends PagingAndSortingRepository<RecruitStudentsRecordDO, String>,
        JpaSpecificationExecutor<RecruitStudentsRecordDO> {
    List<RecruitStudentsRecordDO> findByRecruitStudentsIdAndStatus(String recruitStudentsId, String status);
}

+ 5 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java

@ -45,12 +45,16 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<DevicePatie
    //管理员解绑居民设备
    @Modifying
    @Query("update DevicePatientDevice t set t.del = 1  where t.deviceSn = ?1 ")
    @Query("update DevicePatientDevice t set t.del = 1  where t.deviceSn = ?1 and t.del =0  ")
    int updatePatientDevice(String deviceSN);
    @Query("select a from DevicePatientDevice a")
    List<DevicePatientDevice> findAll();
    @Modifying
    @Query("delete DevicePatientDevice a where a.deviceSn = ?1")
    int deleteByDeviceSn(String deviceSN);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.del=0")
    List<DevicePatientDevice> findAllByUser(String user);

+ 18 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachCancelLogDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachCancelLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 工单取消记录 数据库访问层
 *
 */
public interface BaseDoorCoachCancelLogDao extends PagingAndSortingRepository<BaseDoorCoachCancelLogDO, String>, JpaSpecificationExecutor<BaseDoorCoachCancelLogDO>  {
    @Query(value = "select count(cl.id) from base_door_coach_cancel_log cl where cl.patient = ?1 and cl.cancel_type = 2 and DATE(cl.time) BETWEEN DATE_SUB(DATE(NOW()),INTERVAL DAYOFMONTH(NOW())-1 DAY) and LAST_DAY(NOW())",nativeQuery = true)
    int countCancelTimes(String patient);
}

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachConclusionDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachConclusionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2021/4/7.
 */
public interface BaseDoorCoachConclusionDao extends PagingAndSortingRepository<BaseDoorCoachConclusionDO,String>,
        JpaSpecificationExecutor<BaseDoorCoachConclusionDO> {
    @Query("select c from BaseDoorCoachConclusionDO c where c.orderId = ?1")
    BaseDoorCoachConclusionDO findByOrderId(String orderId);
}

+ 33 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachDoctorStatusDao.java

@ -0,0 +1,33 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachDoctorStatusDO;;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 
 * 上门辅导服务工单 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2019年03月20日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoorCoachDoctorStatusDao extends PagingAndSortingRepository<BaseDoorCoachDoctorStatusDO, String>, JpaSpecificationExecutor<BaseDoorCoachDoctorStatusDO>  {
    BaseDoorCoachDoctorStatusDO findByDoctor(String doctor);
    BaseDoorCoachDoctorStatusDO queryByDoctorAndStatusIn(String doctor, Integer[] status);
    List<BaseDoorCoachDoctorStatusDO> queryByStatusIn(Integer[] status, Pageable pageable);
    Integer countByStatusIn(Integer[] status);
    boolean existsByDoctorAndStatusIn(String doctor, Integer[] status);
}

+ 39 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachFeeDetailDao.java

@ -0,0 +1,39 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachFeeDetailDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Map;
/**
 * 
 * 服务工单价格明细(服务项价格,医生出诊费用) 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2019年03月20日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoorCoachFeeDetailDao extends PagingAndSortingRepository<BaseDoorCoachFeeDetailDO, String>, JpaSpecificationExecutor<BaseDoorCoachFeeDetailDO>  {
    @Query("select d from BaseDoorCoachFeeDetailDO d where d.orderId = ?1 and d.type=?2 and d.status <> 3")
    List<BaseDoorCoachFeeDetailDO> findByOrderIdAndType(String orderId, Integer type);
    @Query("select d from BaseDoorCoachFeeDetailDO d where d.orderId = ?1 and d.payStatus=?2 and d.status <> 3")
    List<BaseDoorCoachFeeDetailDO> findByOrderIdAndPayStatus(String orderId, Integer payStatus);
    @Query("select d.id as id,d.fee as fee,d.orderId as orderId from BaseDoorCoachFeeDetailDO d where d.code in(:codes) and d.type = :type")
    List<Map<String,Object>> findIdByCodeAndType(@Param("codes") List<String> codes, @Param("type") Integer type);
    @Modifying
    @Query("update BaseDoorCoachFeeDetailDO  set payStatus = 1 where id in (?1) ")
    int updatePayStatusById(String[] ids);
}

+ 50 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachOrderDao.java

@ -0,0 +1,50 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
 * 
 * 上门辅导服务工单 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2019年03月20日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoorCoachOrderDao extends PagingAndSortingRepository<BaseDoorCoachOrderDO, String>, JpaSpecificationExecutor<BaseDoorCoachOrderDO>  {
    boolean existsByPatientAndStatusNot(String patient, int status);
    boolean existsByPatientAndStatusIn(String patient, Integer[] status);
    @Modifying
    @Transactional
    @Query("update BaseDoorCoachOrderDO o set o.conclusionStatus = 1 where o.id = ?1")
    void updateConclusionStatus(String orderId);
    @Query("select o from BaseDoorCoachOrderDO o where o.doctor = ?1 and o.status in (2,3)")
    List<BaseDoorCoachOrderDO> getNotFinishOrderByDoctor(String doctor);
    @Modifying
    @Transactional
    @Query("update BaseDoorCoachOrderDO o set o.prescriptionStatus = 1,o.status = 4, o.prescriptionCode = ?2, o.prescriptionTime = ?3 where o.id = ?1")
    void updatePrescriptionById(String orderId, String prescriptionCode, Date prescriptionTime);
    @Query("select o from BaseDoorCoachOrderDO o where o.prescriptionCode like ?1 and o.status <> -1 ")
    List<BaseDoorCoachOrderDO> findByPrescriptionCode(String prescriptionCode);
    @Query("select o from BaseDoorCoachOrderDO o where o.relationCode = ?1 order by o.createTime desc")
    List<BaseDoorCoachOrderDO> findByRelationCode(String relationCode);
}

+ 14 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachPatientConfirmLogDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachPatientConfirmLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 上门辅导服务工单居民确认操作日志记录
 *
 */
public interface BaseDoorCoachPatientConfirmLogDao extends PagingAndSortingRepository<BaseDoorCoachPatientConfirmLogDO, String>, JpaSpecificationExecutor<BaseDoorCoachPatientConfirmLogDO>  {
}

+ 21 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/doorCoach/BaseDoorCoachProcessLogDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.dao.doorCoach;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachDoctorStatusDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachProcessLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 工单状态变更记录(调度员操作记录) 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2019年04月09日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoorCoachProcessLogDao extends PagingAndSortingRepository<BaseDoorCoachProcessLogDO, String>, JpaSpecificationExecutor<BaseDoorCoachProcessLogDO>  {
}

+ 11 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/exam/ChildrenExaminationRecordDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.care.dao.exam;
import com.yihu.jw.entity.care.exam.ChildrenExaminationRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2021/5/18.
 */
public interface ChildrenExaminationRecordDao extends PagingAndSortingRepository<ChildrenExaminationRecordDO,String>,JpaSpecificationExecutor<ChildrenExaminationRecordDO> {
}

+ 11 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/OrgNoticeDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.care.dao.message;
import com.yihu.jw.entity.care.message.OrgNoticeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2021/5/18.
 */
public interface OrgNoticeDao extends PagingAndSortingRepository<OrgNoticeDO,String>, JpaSpecificationExecutor<OrgNoticeDO> {
}

+ 14 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/UserNoticeDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.care.dao.message;
import com.yihu.jw.entity.base.notice.UserNoticeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 用户公告通知
 * @author yeshijie on 2018/9/30.
 */
public interface UserNoticeDao extends PagingAndSortingRepository<UserNoticeDO, String>, JpaSpecificationExecutor<UserNoticeDO> {
    UserNoticeDO findByNoticeIdAndUserIdAndDel(String noticeId,String userId,Integer del);
}

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/assistance/EmergencyAssistanceEndpoint.java

@ -32,10 +32,12 @@ public class EmergencyAssistanceEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop newOrder(@ApiParam(name="patientId",value = "居民id")
                               @RequestParam(value = "patientId") String patientId,
                               @ApiParam(name="jsonData",value = "创建工单json")
                               @RequestParam(value = "jsonData") String jsonData
                               @RequestParam(value = "jsonData") String jsonData,
                               @ApiParam(name="orderSource",value = "工单来源工单发起来源状态 1APP 2手环 3居家报警")
                               @RequestParam(value = "orderSource",defaultValue = "1") Integer orderSource
                               ){
        try {
            JSONObject result = assistanceService.newOrder(patientId,jsonData,getUID());
            JSONObject result = assistanceService.newOrder(patientId,jsonData,getUID(),orderSource);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/CourseEndpoint.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.endpoint.course;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
@RestController
@RequestMapping("course" )
@Api(tags = "课程信息", description = "课程信息")
public class CourseEndpoint extends EnvelopRestEndpoint {
}

+ 98 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/DoctorCourseEndpoint.java

@ -0,0 +1,98 @@
package com.yihu.jw.care.endpoint.course;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.course.CourseService;
import com.yihu.jw.entity.care.course.CourseDO;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.tencent.TencentVODUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
@RestController
@RequestMapping("doctor/course" )
@Api(tags = "医生课程信息", description = "医生课程信息")
public class DoctorCourseEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CourseService courseService;
    @Value("${tencent.secretId}")
    private String secretId;
    @Value("${tencent.secretKey}")
    private String secretKey;
    @GetMapping(value = "myCourseList")
    @ApiOperation(value = "我的课程列表")
    public PageEnvelop myCourseList(
            @ApiParam(name = "doctor", value = "doctor") @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(name = "type", value = "课程类型 1直播 2视频 3文本") @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "3") @RequestParam(value = "size") int size) {
        try{
            JSONObject result = courseService.myCourseList(doctor, type, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return PageEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            Long count = result.getLongValue(ResponseContant.count);
            return PageEnvelop.getSuccessListWithPage("查询成功",(List<CourseDO>)result.get(ResponseContant.resultMsg),page,size,count);
        }catch (Exception e){
            e.printStackTrace();
        }
        return PageEnvelop.getError("查询失败");
    }
    @GetMapping(value = "courseDetail")
    @ApiOperation(value = "课程详情")
    public ObjEnvelop courseDetail(
            @ApiParam(name = "id", value = "id") @RequestParam(value = "id", required = true) String id) {
        try{
            JSONObject result = courseService.courseDetail(id);
            return ObjEnvelop.getSuccess("查询成功",result);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ObjEnvelop.getError("查询失败");
    }
    @PostMapping(value = "addCourse")
    @ApiOperation(value = "新增课程")
    public ObjEnvelop addCourse(
            @ApiParam(name = "doctorId", value = "doctorId") @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "jsonData", value = "jsonData") @RequestParam(value = "jsonData", required = true) String jsonData) {
        try{
            JSONObject result = courseService.addCourse(doctorId, jsonData);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("新增成功",result);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ObjEnvelop.getError("新增失败");
    }
    @GetMapping(value = "getTXUploadSignature")
    @ApiOperation(value = "获取腾讯视频上传签名")
    public Envelop getTXUploadSignature() throws Exception {
        TencentVODUtil tencentVODUtil = new TencentVODUtil();
        tencentVODUtil.setSecretId(secretId);
        tencentVODUtil.setSecretKey(secretKey);
        return success(tencentVODUtil.getUploadSignature());
    }
}

+ 99 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/PatientCourseEndpoint.java

@ -0,0 +1,99 @@
package com.yihu.jw.care.endpoint.course;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.course.CourseService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/18
 * @Description:
 */
@RestController
@RequestMapping("patient/course" )
@Api(tags = "居民课程信息", description = "居民课程信息")
public class PatientCourseEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private CourseService courseService;
    @GetMapping("topStatusBarNum")
    @ApiOperation(value = "顶部状态栏订单分类tab")
    public ObjEnvelop topStatusBarNum(
            @ApiParam(name = "patient", value = "居民code")
            @RequestParam(value = "patient", required = true) String patient) {
        try {
            Map<String, Integer> map = courseService.topStatusBarNum(patient);
            return ObjEnvelop.getSuccess("获取成功",map);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError( "获取失败!" ,-1);
        }
    }
    @GetMapping(value = "patientOrderList")
    @ApiOperation(value = "我的订单列表")
    public PageEnvelop patientOrderList(
            @ApiParam(name = "patient", value = "patient") @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "status", value = "工单状态") @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try{
            JSONObject result = courseService.patientOrderList(patient, status, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return PageEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            Long count = result.getLongValue(ResponseContant.count);
            return PageEnvelop.getSuccessListWithPage("查询成功",(List<Map<String,Object>>)result.get(ResponseContant.resultMsg),page,size,count);
        }catch (Exception e){
            e.printStackTrace();
        }
        return PageEnvelop.getError("查询失败");
    }
    @GetMapping("orderInfo")
    @ApiOperation(value = "订单详情")
    public ObjEnvelop orderInfo(
            @ApiParam(name = "type", value = "订单类型") @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "id", value = "订单id") @RequestParam(value = "id", required = true) String id) {
        try {
            JSONObject json = courseService.orderInfo(id,type);
            return ObjEnvelop.getSuccess("获取成功",json);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError( "获取失败!" ,-1);
        }
    }
    @PostMapping("cancalOrder")
    @ApiOperation(value = "取消订单")
    public Envelop cancalOrder(
            @ApiParam(name = "type", value = "订单类型") @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "id", value = "订单id") @RequestParam(value = "id", required = true) String id) {
        try {
            String res = courseService.cancalOrder(id,type);
            if(res == null){
                return success("取消成功");
            }
            return Envelop.getError(res, -1);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError( "获取失败!" ,-1);
        }
    }
}

+ 10 - 12
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -56,14 +56,12 @@ public class PadDeviceController extends BaseController {
    @RequestMapping(value = "PatientDeviceList", method = RequestMethod.GET)
    public String getDeviceByPatient(@ApiParam(name = "patientName", value = "居民姓名", defaultValue = "张")
                                     @RequestParam(value = "patientName", required = false) String patientName,
                                     @ApiParam(name = "idcard", value = "身份证号", defaultValue = "")
                                     @RequestParam(value = "idcard", required = false) String idcard,
                                     @ApiParam(name = "page", value = "分页起始id", defaultValue = "1")
                                     @RequestParam(value = "page", required = true) int page,
                                     @ApiParam(name = "pagesize", value = "每页条数", defaultValue = "10")
                                     @RequestParam(value = "pagesize", required = true) int pagesize) {
        try {
            List<Map<String , Object>> list = patientDeviceService.findDeviceFromAdmin(patientName, idcard, page, pagesize);
            List<Map<String , Object>> list = patientDeviceService.findDeviceFromAdmin(patientName, page, pagesize);
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {
@ -74,10 +72,9 @@ public class PadDeviceController extends BaseController {
    @ApiOperation("平板端,添加设备时获取设备类型(大类)")
    @RequestMapping(value = "getDeviceTypeBig", method = RequestMethod.GET)
    public String getDeviceTypeBig(@ApiParam(name = "pyCode", value = "获取设备类型(默认为null,获取大类)", defaultValue = "")
                                       @RequestParam(value = "pyCode", required = false) String pyCode) {
    public String getDeviceTypeBig() {
        try {
            List<Map<String , Object>> list = patientDeviceService.getDeviceType(1,pyCode);
            List<Map<String , Object>> list = patientDeviceService.getDeviceType();
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {
            error(ex);
@ -87,10 +84,10 @@ public class PadDeviceController extends BaseController {
    @ApiOperation("平板端,添加设备时获取设备类型(小类)")
    @RequestMapping(value = "getDeviceTypeSmall", method = RequestMethod.GET)
    public String getDeviceTypeSmall(@ApiParam(name = "pyCode", value = "获取设备类型(默认为 watch,获取小类(智能手表多类型))", defaultValue = "watch")
                                         @RequestParam(value = "pyCode", required = false) String pyCode) {
    public String getDeviceTypeSmall(@ApiParam(name = "category_code", value = "category_code", defaultValue = "4")
                                         @RequestParam(value = "category_code", required = false) String category_code) {
        try {
            List<Map<String , Object>> list = patientDeviceService.getDeviceType(0,pyCode);
            List<Map<String , Object>> list = patientDeviceService.getDeviceTypeSmall(category_code);
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {
            error(ex);
@ -102,7 +99,8 @@ public class PadDeviceController extends BaseController {
    @RequestMapping(value = "SavePatientDevice", method = RequestMethod.POST)
    public String saveDevice(@ApiParam(name = "json", value = "设备数据json", defaultValue = "{     \"deviceId\":\"3\",     \"deviceName\":\"血压计-优瑞恩\",     \"deviceSn\":\"7052169111\",     \"categoryCode\":\"7\",     \"userType\":\"-1\", \"sosAddress\":\"福建省厦门市思明区望海路55号之1\" }")
                             @RequestParam(value = "json", required = true) String json,
                             @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patientCode
                             @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patientCode,
                             @ApiParam(name = "doctorCode", value = "管理员code") @RequestParam(value = "doctorCode", required = false) String doctorCode
                             ) {
        try {
            DevicePatientDevice device = objectMapper.readValue(json, DevicePatientDevice.class);
@ -116,8 +114,8 @@ public class PadDeviceController extends BaseController {
                return write(-1,"设备不存在或者数据存在错误!");
            }
            BaseDoctorDO doctor = baseDoctorDao.findById(getUID());
            device.setAgent(getUID());
            BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
            device.setAgent(doctorCode);
            device.setAgentName(doctor.getName());
            String sn = device.getDeviceSn();
            synchronized (sn.intern()){

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -173,7 +173,7 @@ public class PatientDeviceController extends BaseController {
    @RequestMapping(value = "patientDeviceListByTopic", method = RequestMethod.GET)
    public ListEnvelop patientDeviceListByTopic(@ApiParam(name = "patient", value = "patient", defaultValue = "patient")
                                                @RequestParam(value = "patient", required = true) String patient,
                                                @ApiParam(name = "topic", value = "专题CODE;preventLost防走失", defaultValue = "topic")
                                                @ApiParam(name = "topic", value = "专题CODE;preventLost防走失", defaultValue = "preventLost")
                                                @RequestParam(value = "topic", required = true) String topic) {
        try {
            return ListEnvelop.getSuccess("查询成功",  patientDeviceService.patientDeviceListByTopic(patient,topic));
@ -285,9 +285,9 @@ public class PatientDeviceController extends BaseController {
                                        @ApiParam(name = "freq",value = "0,触发一天;1,每日触发 ")
                                        @RequestParam(value = "freq",required = false)String freq,
                                        @ApiParam(name = "time_begin",value = "目标时间与当日0点之间相差的秒数 ")
                                        @RequestParam(value = "time_begin",required = false)String time_begin,
                                        @RequestParam(value = "time_begin",defaultValue = "0",required = false)String time_begin,
                                        @ApiParam(name = "time_end",value = "同上 ")
                                        @RequestParam(value = "time_end",required = false)String time_end,
                                        @RequestParam(value = "time_end",defaultValue = "86400",required = false)String time_end,
                                        @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ")
                                        @RequestParam(value = "safe_area",required = false)String safe_area,
                                        @ApiParam(name = "clear",value = "删除标志,删除传1")

+ 61 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java

@ -6,6 +6,7 @@ import com.yihu.jw.care.service.doctor.CareDoctorService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -95,22 +96,74 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
        return success("保存成功");
    }
    @GetMapping(value = "getOrgDoctor")
    @ApiOperation(value = "医生通讯录机构详情查询")
    public ObjEnvelop getOrgDoctor(
    @GetMapping(value = "getOrgList")
    @ApiOperation(value = "医生通讯录机构科室列表")
    public ListEnvelop getOrgList(
            @ApiParam(name = "doctorId", value = "doctorId", required = false)
            @RequestParam(value = "doctorId",required = false) String doctorId,
            @ApiParam(name = "orgType", value = "1,2医疗机构 3养老机构,4托育机构")
            @RequestParam(value = "orgType") String orgType
            @RequestParam(value = "orgType",defaultValue = "1,2") String orgType
    ){
        try {
            if (orgType.equals("3")&&StringUtils.isBlank(doctorId)){
                return ObjEnvelop.getError("参数错误");
            }
            return ObjEnvelop.getSuccess("查询成功", doctorService.getOrgDoctor(doctorId,orgType));
            return ListEnvelop.getSuccess("查询成功", doctorService.getOrgList(doctorId,orgType));
        }catch (Exception e){
            e.printStackTrace();
            return ListEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "getOrgDoctor")
    @ApiOperation(value = "医生通讯录机构医生查询")
    public ObjEnvelop getOrgDoctor(
            @ApiParam(name = "orgCode", value = "orgCode")
            @RequestParam(value = "orgCode") String orgCode,
            @ApiParam(name = "deptCode", value = "deptCode")
            @RequestParam(value = "deptCode",required = false) String deptCode,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size
    ){
        try {
            return ObjEnvelop.getSuccess("查询成功", doctorService.getOrgDoctor(orgCode,deptCode,page,size));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "getTeacherChildren")
    @ApiOperation(value = "教师通讯录-我的儿童")
    public PageEnvelop getTeacherChildren(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",required = true) String doctor,
            @ApiParam(name = "searchType", value = "0未入学 1已入学")
            @RequestParam(value = "searchType",defaultValue = "0") int searchType,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size
    ){
        try {
            return doctorService.getTeacherChildren(doctor,searchType,page,size);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "getTeacherChildrenCount")
    @ApiOperation(value = "教师通讯录-我的儿童数量获取")
    public Object getTeacherChildrenCount(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",required = true) String doctor){
        try {
            return doctorService.getTeacherChildrenCount(doctor);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
}

+ 554 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/DoctorDoorCoachOrderController.java

@ -0,0 +1,554 @@
package com.yihu.jw.care.endpoint.doorCoach;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.endpoint.BaseController;
import com.yihu.jw.care.service.doorCoach.DoctorDoorCoachOrderService;
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachConclusionDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.restmodel.ResponseContant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 上门辅导
 *
 */
@RestController
@RequestMapping(value = "/doctor/doorCoach/serviceOrder", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-上门辅导")
public class DoctorDoorCoachOrderController extends BaseController {
    @Autowired
    private PatientDoorCoachOrderService patientDoorCoachOrderService;
    @Autowired
    private DoctorDoorCoachOrderService doctorDoorCoachOrderService;
    @PostMapping(value = "proxyCreate")
    @ApiOperation(value = "创建上门服务咨询--医生代预约")
    public String create(@ApiParam(name = "jsonData", value = "Json数据", required = true) @RequestParam String jsonData) {
        try{
            JSONObject result = patientDoorCoachOrderService.proxyCreate(jsonData,getUID());
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error(-1, result.getString(ResponseContant.resultMsg));
            }
            return write(200, "提交成功!","orderId",result.getString("orderId"));
        }catch (Exception e){
            e.printStackTrace();
            return error(-1, e.getMessage());
        }
    }
    @GetMapping("/getDoorOrderNum")
    @ApiOperation(value = "获取医生待服务工单数量")
    public String getDoorOrderNum(
            @ApiParam(name = "doctor", value = "医生codedoctor")
            @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            return write(200, "获取成功", "data",doctorDoorCoachOrderService.getDoorOrderNum(doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @GetMapping(value = "queryDoctorListNotStopped")
    @ApiOperation(value = "服务人员列表(可接单状态的医生列表)")
    public String queryDoctorListWithNotStopped(
            @ApiParam(name = "hospital", value = "机构code", required = true) @RequestParam(value = "hospital") String hospital,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try{
            JSONObject result = patientDoorCoachOrderService.queryDoctorListWithNotStopped(hospital,page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error(-1,result.getString(ResponseContant.resultMsg));
            }
            int count = result.getIntValue(ResponseContant.count);
            JSONObject object = new JSONObject();
            object.put("total",count);
            object.put("detailModelList",result.get(ResponseContant.resultMsg));
            object.put("currPage",page);
            object.put("pageSize",size);
            return write(200,"查询成功","data",object);
        }catch (Exception e){
            e.printStackTrace();
        }
        return error(-1,"查询失败");
    }
    @PostMapping(value = "sendOrderToDoctor")
    @ApiOperation(value = "调度员给医生派单")
    public String sendOrderToDoctor(
            @ApiParam(name = "orderId", value = "工单id") @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(name = "remark", value = "调度员备注") @RequestParam(value = "remark", required = false) String remark,
            @ApiParam(name = "dispatcher", value = "调度员code") @RequestParam(value = "dispatcher", required = true) String dispatcher,
            @ApiParam(name = "dispathcherName", value = "调度员姓名") @RequestParam(value = "dispathcherName", required = true) String dispathcherName,
            @ApiParam(name = "doctor", value = "医生code") @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(name = "doctorName", value = "医生姓名") @RequestParam(value = "doctorName", required = true) String doctorName,
            @ApiParam(name = "doctorJobName", value = "医生职称") @RequestParam(value = "doctorJobName", required = false) String doctorJobName) {
        try{
            JSONObject result = patientDoorCoachOrderService.sendOrderToDoctor(orderId, remark,dispatcher,dispathcherName, doctor, doctorName ,doctorJobName);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error( -1,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"派单成功","data",result.get(ResponseContant.resultMsg));
        }catch (Exception e){
            e.printStackTrace();
        }
        return error(-1,"派单失败");
    }
    @PostMapping(value = "transferOrder")
    @ApiOperation(value = "医生转派单")
    public String transferOrder(
            @ApiParam(name = "orderId", value = "工单id") @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(name = "remark", value = "当前医生备注") @RequestParam(value = "remark", required = false) String remark,
            @ApiParam(name = "dispatcher", value = "当前医生code") @RequestParam(value = "dispatcher", required = true) String dispatcher,
            @ApiParam(name = "dispathcherName", value = "当前医生姓名") @RequestParam(value = "dispathcherName", required = true) String dispathcherName,
            @ApiParam(name = "doctor", value = "医生code") @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(name = "doctorName", value = "医生姓名") @RequestParam(value = "doctorName", required = true) String doctorName,
            @ApiParam(name = "doctorJobName", value = "医生职称") @RequestParam(value = "doctorJobName", required = false) String doctorJobName) {
        try{
            JSONObject result = patientDoorCoachOrderService.transferOrder(orderId, remark,dispatcher,dispathcherName, doctor, doctorName ,doctorJobName);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error( -1,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"派单成功","data",result.get(ResponseContant.resultMsg));
        }catch (Exception e){
            e.printStackTrace();
            return error(-1, "派单失败!");
        }
    }
    @PostMapping("acceptOrder")
    @ApiOperation(value = "接单")
    public String acceptOrder(
            @ApiParam(value = "工单id", name = "orderId", required = true) @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "医生职称code", name = "jobCode", required = false) @RequestParam(value = "jobCode", required = false) String jobCode,
            @ApiParam(value = "医生职称", name = "jobCodeName", required = false) @RequestParam(value = "jobCodeName", required = false) String jobCodeName,
            @ApiParam(value = "医院级别", name = "hospitalLevel", required = false) @RequestParam(value = "hospitalLevel",defaultValue = "4",required = false) int hospitalLevel) {
        try {
            doctorDoorCoachOrderService.acceptOrder(orderId,jobCode,jobCodeName,hospitalLevel);
            return write(200, "操作成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "操作失败!" + e.getMessage());
        }
    }
    @PostMapping("refuse")
    @ApiOperation(value = "拒单")
    public String refuseOrder(
            @ApiParam(value = "工单id", name = "orderId", required = true)
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "拒绝原因", name = "reason", required = false)
            @RequestParam(value = "reason", required = false) String reason) {
        try {
            doctorDoorCoachOrderService.refuseOrder(getUID(),orderId, reason);
            return write(200, "操作成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "操作失败!" + e.getMessage());
        }
    }
    @PostMapping(value = "cancelOrder")
    @ApiOperation(value = "取消工单")
    public String cancelOrder(
            @ApiParam(name = "orderId", value = "工单id") @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(name = "type", value = "取消类型:1-调度员主动取消,2-居民取消, 3-医生取消") @RequestParam(value = "type", required = true) int type,
            @ApiParam(name = "reason", value = "取消理由") @RequestParam(value = "reason", required = false) String reason,
            @ApiParam(name = "dispatcher", value = "取消工单的调度员(只允许调度员来操作)") @RequestParam(value = "dispatcher", required = false) String dispatcher,
            @ApiParam(name = "dispathcherName", value = "调度员姓名") @RequestParam(value = "dispathcherName", required = false) String dispatcherName) {
        try{
            JSONObject result = patientDoorCoachOrderService.cancelOrder(orderId, type, reason,dispatcher,dispatcherName);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error(-1,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"取消成功","data",result.get(ResponseContant.resultMsg));
        }catch (Exception e){
            e.printStackTrace();
        }
        return error(-1,"取消失败");
    }
    @PostMapping("signIn")
    @ApiOperation(value = "上门服务签到")
    public String signIn(
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "签到时间", name = "signTime")
            @RequestParam(value = "signTime", required = false) String signTime,
            @ApiParam(value = "签到方式:1-定位,2-扫码,3-拍照,4-二维码", name = "signWay")
            @RequestParam(value = "signWay", required = false) Integer signWay,
            @ApiParam(value = "签到地址", name = "signLocation")
            @RequestParam(value = "signLocation", required = false) String signLocation,
            @ApiParam(value = "签到照片", name = "signImg")
            @RequestParam(value = "signImg", required = false) String signImg,
            @ApiParam(value = "二维码内容", name = "twoDimensionalCode")
            @RequestParam(value = "twoDimensionalCode", required = false) String twoDimensionalCode) {
        try {
            BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.signIn(orderId, signTime, signWay, signLocation, signImg,twoDimensionalCode,getUID());
            if (baseDoorCoachOrderDO != null){
                return write(200, "操作成功", "data", baseDoorCoachOrderDO);
            }else {
                return error(-1,"扫码签到失败");
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "操作失败!" + e.getMessage());
        }
    }
    @PostMapping("updateDoorConclusion")
    @ApiOperation("编辑保存服务工单小结")
    public String updateDoorConclusion(
            @ApiParam(value = "工单id", name = "orderId",required = true)
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "服务附件,至少一张,至多3张", name = "conclusionImg",required = false)
            @RequestParam(value = "conclusionImg", required = false) String conclusionImg,
            @ApiParam(value = "服务小结", name = "conclusion",required = false)
            @RequestParam(value = "conclusion", required = false) String conclusion,
            @ApiParam(value = "服务小结是否登记,1跳过登记;2-登记", name = "conclusionStatus")
            @RequestParam(value = "conclusionStatus", required = false,defaultValue = "2") Integer conclusionStatus) {
        try {
            BaseDoorCoachConclusionDO doorConclusion = doctorDoorCoachOrderService.updateDoorConclusion(orderId,conclusion,conclusionImg,conclusionStatus);
            return write(200, "保存成功", "data", doorConclusion);
        } catch (Exception e) {
            error(e);
            return error(-1, "保存失败!" + e.getMessage());
        }
    }
    @GetMapping("getDoorConclusion")
    @ApiOperation("获取服务工单小结")
    public String getDoorConclusion(
            @ApiParam(value = "医生code", name = "doctor")
            @RequestParam(value = "doctor", required = false) String doctor,
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = false) String orderId) {
        try {
            // 没有提供工单id的情况下,默认代入上一次服务信息记录
            if (StringUtils.isEmpty(orderId)) {
                orderId = doctorDoorCoachOrderService.getOrderIdByDoctor(doctor);
                if (StringUtils.isEmpty(orderId)) {
                    return error(204, "获取失败,该医生暂无工单" );
                }
            }
            // 根据orderId查询工单小结表
            BaseDoorCoachConclusionDO doorConclusion = doctorDoorCoachOrderService.getDoorConclusion(orderId);
            return write(200, "获取成功", "data", doorConclusion);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @PostMapping("saveOrderFinishByDoctor")
    @ApiOperation(value = "确认完成工单")
    public String saveOrderFinishByDoctor(
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "确认结束服务方式 1-电子签名,2-手持身份证拍照", name = "finishWay")
            @RequestParam(value = "finishWay", required = false) Integer finishWay,
            @ApiParam(value = "确认结束服务照片", name = "finishImg")
            @RequestParam(value = "finishImg", required = false) String finishImg) {
        try {
            return write(200, "获取成功", "data", doctorDoorCoachOrderService.saveOrderFinishByDoctor(orderId, finishWay, finishImg));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @PostMapping("updateArrivingTime")
    @ApiOperation(value = "修改预计到达时间")
    public String updateArrivingTime(
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "医生预计到达时间", name = "arrivingTime")
            @RequestParam(value = "arrivingTime", required = true) String arrivingTime) {
        try {
            BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.updateArrivingTime(orderId, arrivingTime);
            return write(200, "修改成功", "data", baseDoorCoachOrderDO);
        } catch (Exception e) {
            error(e);
            return error(-1, "修改失败!" + e.getMessage());
        }
    }
    @GetMapping("/topStatusBarNum")
    @ApiOperation(value = "顶部状态栏订单分类tab")
    public String topStatusBarNum(
            @ApiParam(name = "doctor", value = "医生code")
            @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            Map<String, Integer> map = doctorDoorCoachOrderService.getNumGroupByStatus(doctor);
            return write(200, "获取成功", "data", map);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @GetMapping("/getDoorOrderList")
    @ApiOperation(value = "服务工单列表")
    public String getDoorOrderList(
            @ApiParam(value = "工单服务编号", name = "orderId",required = false)
            @RequestParam(value = "orderId", required = false) String orderId,
            @ApiParam(value = "居民姓名", name = "patientName",required = false)
            @RequestParam(value = "patientName", required = false) String patientName,
            @ApiParam(value = "联系方式", name = "patientPhone",required = false)
            @RequestParam(value = "patientPhone", required = false) String patientPhone,
            @ApiParam(value = "服务机构", name = "hospitalCode",required = false)
            @RequestParam(value = "hospitalCode", required = false) String hospitalCode,
            @ApiParam(value = "工单状态", name = "status",required = false)
            @RequestParam(value = "status", required = false) Integer[] status,
            @ApiParam(value = "创建时间开始,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeStart",required = false)
            @RequestParam(value = "createTimeStart", required = false) String createTimeStart,
            @ApiParam(value = "创建时间结束,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeEnd",required = false)
            @RequestParam(value = "createTimeEnd", required = false) String createTimeEnd,
            @ApiParam(value = "服务医生的名称", name = "serverDoctorName",required = false)
            @RequestParam(value = "serverDoctorName", required = false) String serverDoctorName,
            @ApiParam(value = "医生的code", name = "doctorCode",required = false)
            @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(value = "角色0、医生,1、管理员", name = "isManage",required = false)
            @RequestParam(value = "isManage", required = false) String isManage,
            @ApiParam(value = "发起类型(1本人发起 2家人待预约 3医生代预约)", name = "type")
            @RequestParam(value = "type", required = false) Integer type,
            @ApiParam(value = "页码", name = "page",defaultValue = "1",required = true)
            @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(value = "每页数目", name = "pageSize",defaultValue = "10",required = true)
            @RequestParam(value = "pageSize", required = true) Integer pageSize) {
        try {
            if(StringUtils.isEmpty(isManage)){
                isManage = getCurrentRoleIsManange();
            }
            if("0".equals(isManage)){
                if(StringUtils.isEmpty(doctorCode)){
                    doctorCode=getUID();
                }
            }else if ("1".equals(isManage) && StringUtils.isBlank(hospitalCode)){
                //如果是管理员并且未筛选机构,就默认展示其管理下所有机构
                String level = getCurrentRoleLevel();
                String currentRoleCode = getCurrentRoleCode();
                if(level.equals("2")) {
                    //市管理员
                    hospitalCode = currentRoleCode.substring(0, currentRoleCode.length() - 2) + "%";
                }else if(level.equals("3")){
                    //区管理员
                    hospitalCode = currentRoleCode + "%";
                }else if (level.equals("4")){
                    //机构管理员
                    hospitalCode = currentRoleCode;
                }
            }else if(StringUtils.isNotBlank(hospitalCode) && hospitalCode.length() < 10 ){
                hospitalCode += "%";
            }
            StringBuffer ss = new StringBuffer();
            if (status != null && status.length > 0){
                int statusLength = status.length;
                for (int i =0 ; i < statusLength ; i++){
                    ss .append(status[i]);
                    if (i<statusLength-1){
                        ss.append(",");
                    }
                }
            }else {
                ss = null;
            }
            JSONObject result = doctorDoorCoachOrderService.getDoorOrderList(orderId,patientName,patientPhone,hospitalCode,
                    ss,createTimeStart,createTimeEnd,serverDoctorName,doctorCode,page,pageSize, type);
            return write(200, "获取成功","data",result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @GetMapping(value = "queryBriefList")
    @ApiOperation(value = "调度员查询工单列表")
    public String queryBriefList(
            @ApiParam(name = "dispatcher", value = "调度员code") @RequestParam(value = "dispatcher", required = true) String dispatcher,
            @ApiParam(name = "hospital", value = "调度员所在机构code") @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(name = "orderNumber", value = "工单号") @RequestParam(value = "orderNumber", required = false) String orderNumber,
            @ApiParam(name = "patientName", value = "工单服务对象姓名") @RequestParam(value = "patientName", required = false) String patientName,
            @ApiParam(name = "phone", value = "发起工单的居民的联系方式") @RequestParam(value = "phone", required = false) String phone,
            @ApiParam(name = "status", value = "工单状态") @RequestParam(value = "status", required = false) Integer status,
            @ApiParam(name = "patientType", value = "居民类型") @RequestParam(value = "patientType", required = false) String patientType,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try{
            JSONObject result = doctorDoorCoachOrderService.queryBriefList(dispatcher,hospital, orderNumber, patientName, phone, status,patientType, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error(-1,result.getString(ResponseContant.resultMsg));
            }
            int count = result.getIntValue(ResponseContant.count);
            JSONObject object = new JSONObject();
            object.put("total",count);
            object.put("detailModelList",result.get(ResponseContant.resultMsg));
            object.put("currPage",page);
            object.put("pageSize",size);
            return write(200,"查询成功","data",object);
        }catch (Exception e){
            e.printStackTrace();
        }
        return error(-1,"查询失败");
    }
    @GetMapping(value = "queryDoctorList")
    @ApiOperation(value = "服务人员列表(医生列表)")
    public String queryDoctorList(
            @ApiParam(name = "hospital", value = "调度员所在的机构code") @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "doctorName", value = "医生姓名") @RequestParam(value = "doctorName", required = false) String doctorName,
            @ApiParam(name = "status", value = "医生接单状态,状态为全部时不传") @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try{
            JSONObject result = doctorDoorCoachOrderService.queryDoctorList(patient,hospital, doctorName, status, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return error(-1,result.getString(ResponseContant.resultMsg));
            }
            int count = result.getIntValue(ResponseContant.count);
            JSONObject object = new JSONObject();
            object.put("total",count);
            if (count > 0){
                object.put("detailModelList",result.get(ResponseContant.resultMsg));
            }else {
                List list = new ArrayList();
                object.put("detailModelList",list);
            }
            object.put("currPage",page);
            object.put("pageSize",size);
            return write(200,"查询成功","data",object);
        }catch (Exception e){
            e.printStackTrace();
        }
        return error(-1,"查询失败");
    }
    @GetMapping("getByOrderId")
    @ApiOperation(value = "根据工单id获取相应的工单,如果为空,则获取该医生当前最新一条的工单")
    public String getByOrderId(
            @ApiParam(value = "医生code", name = "doctor")
            @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = false) String orderId) {
        try {
            // 没有提供工单id的情况下,则获取该医生当前最新一条的工单
            if (StringUtils.isEmpty(orderId)) {
                // 根据接单医生code获取最近一次服务orderId
                orderId = doctorDoorCoachOrderService.getOrderIdByDoctor(doctor);
                if (StringUtils.isEmpty(orderId)) {
                    return error(-1, "获取失败, 该医生暂无工单" );
                }
            }
            // 根据orderId获取工单信息
            BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.getDoorServiceOrderById(orderId);
            return write(200, "获取成功", "data", baseDoorCoachOrderDO);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败, 该医生暂无工单!" + e.getMessage());
        }
    }
    /**
     * 获取服务项目
     *
     * @param hospital
     * @return
     */
    @GetMapping("selectItemsByHospital")
    @ApiOperation(value = "获取服务项目")
    public String selectItemsByHospital(
            @ApiParam(value = "机构code", name = "hospital")
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(value = "服务项目名称", name = "serverItemName")
            @RequestParam(value = "serverItemName", required = false) String serverItemName) {
        try {
            return write(200, "获取成功","dara",patientDoorCoachOrderService.selectItemsByHospital(hospital,serverItemName));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @PostMapping("/initDoorStatus")
    @ApiOperation(value = "初始化医生分派订单开关状态")
    public String initDoorStatus() {
        try {
            doctorDoorCoachOrderService.initDoorStatus();
            return success("成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @GetMapping("/getDispatchOrderSwitch")
    @ApiOperation(value = "获取医生分派订单开关状态")
    public String getDispatchOrderSwitch(
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            String status = doctorDoorCoachOrderService.findDispatchStatusByDoctor(doctor);
            return write(200, "获取成功", "data", status);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @PostMapping("/dispatchOrderSwitch")
    @ApiOperation(value = "分派订单开关修改")
    public String dispatchOrderSwitch(
            @ApiParam(name = "doctor", value = "医生code")
            @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(value = "开关值,5关闭 1开启", name = "value")
            @RequestParam(value = "value", required = true) Integer value) {
        try {
            doctorDoorCoachOrderService.updateDispatchStatusByDoctor(doctor, value);
            return write(200, "修改成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "修改失败!" + e.getMessage());
        }
    }
    @RequestMapping(value = "/urlAnalysis",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("门牌解析上门地址")
    @ResponseBody
    public String urlAnalysis(@ApiParam(name = "url", value = "地址解析", defaultValue = "")
                              @RequestParam(value = "url", required = true)String url)throws Exception {
        try {
            return write(200, "操作成功!","data",doctorDoorCoachOrderService.urlAnalysis(url));
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "操作失败!");
        }
    }
}

+ 250 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doorCoach/PatientDoorCoachOrderController.java

@ -0,0 +1,250 @@
package com.yihu.jw.care.endpoint.doorCoach;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.doorCoach.DoctorDoorCoachOrderService;
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * 上门辅导服务工单控制器
 *
 */
@RestController
@RequestMapping(value = "/patient/doorCoach/serviceOrder")
@Api(value = "居民端-上门辅导", description = "居民端-上门辅导")
public class PatientDoorCoachOrderController extends EnvelopRestEndpoint {
    @Autowired
    private PatientDoorCoachOrderService patientDoorCoachOrderService;
    @Autowired
    private DoctorDoorCoachOrderService doctorDoorCoachOrderService;
    @PostMapping(value = "qucikSendIM")
    @ApiOperation(value = "通过IM向客户端推送消息")
    public Envelop qucikSendIM(
            @ApiParam(name = "orderId", value = "工单id", required = true) @RequestParam String orderId,
            @ApiParam(name = "sendId", value = "发送者code", required = false) @RequestParam String sendId,
            @ApiParam(name = "sendName", value = "发送者姓名", required = false) @RequestParam String sendName,
            @ApiParam(name = "contentType", value = "消息内容类型:1-文本信息,19-服务工单格式化消息", required = true) @RequestParam String contentType,
            @ApiParam(name = "content", value = "消息内容json", required = true) @RequestParam String content
    ) {
        int result = patientDoorCoachOrderService.qucikSendIM(orderId, sendId, sendName, contentType, content);
        if (result == -1) {
            return failed("发送失败!");
        }
        return success("发送成功");
    }
    @PostMapping(value = "create")
    @ApiOperation(value = "创建上门服务工单")
    public Envelop create(@ApiParam(name = "jsonData", value = "Json数据", required = true) @RequestParam String jsonData) {
        JSONObject result = new JSONObject();
        try{
            result = patientDoorCoachOrderService.create(jsonData);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return failed(result.getString(ResponseContant.resultMsg));
        }
        return success(result);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true) @RequestParam(value = "ids") String ids) {
        patientDoorCoachOrderService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public Envelop update(@ApiParam(name = "jsonData", value = "Json数据", required = true) @RequestParam String jsonData) {
        JSONObject result = patientDoorCoachOrderService.update(jsonData);
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return failed(result.getString(ResponseContant.resultMsg));
        }
        return success(result.get(ResponseContant.resultMsg));
    }
    @PostMapping(value = "cancelOrder")
    @ApiOperation(value = "取消工单")
    public Envelop cancelOrder(
            @ApiParam(name = "orderId", value = "工单id") @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(name = "reason", value = "取消理由") @RequestParam(value = "reason", required = true) String reason) {
        JSONObject result = new JSONObject();
        try{
            result = patientDoorCoachOrderService.cancelOrder(orderId, 2, reason,null,null);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return failed(result.getString(ResponseContant.resultMsg));
            }
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
        return success(result.get(ResponseContant.resultMsg));
    }
    @GetMapping(value = "queryDispatcherInfoByPatient")
    @ApiOperation(value = "获取居民所签约的机构的调度员信息")
    public Envelop queryDispatcherInfoByPatient(
            @ApiParam(name = "orgCode", value = "机构Code") @RequestParam(value = "orgCode", required = true) String orgCode) {
        JSONObject result = patientDoorCoachOrderService.queryDispatcherInfoByPatient(orgCode);
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return failed(result.getString(ResponseContant.resultMsg));
        }
        int count = result.getIntValue(ResponseContant.count);
        return success(result.get(ResponseContant.resultMsg));
    }
    @GetMapping("/topStatusBarNum")
    @ApiOperation(value = "顶部状态栏订单分类tab")
    public ObjEnvelop topStatusBarNum(
            @ApiParam(name = "patient", value = "患者ID")
            @RequestParam(value = "patient", required = true) String patient) {
        try {
            Map<String, Integer> map = patientDoorCoachOrderService.getNumGroupByStatus(patient);
            return ObjEnvelop.getSuccess( "获取成功", map);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError( "获取失败!" );
        }
    }
    @GetMapping("/getDoorOrderList")
    @ApiOperation(value = "服务工单列表")
    public ObjEnvelop getDoorOrderList(
            @ApiParam(value = "工单服务编号", name = "orderId",required = false)
            @RequestParam(value = "orderId", required = false) String orderId,
            @ApiParam(value = "居民姓名", name = "patientName",required = false)
            @RequestParam(value = "patientName", required = false) String patientName,
            @ApiParam(value = "联系方式", name = "patientPhone",required = false)
            @RequestParam(value = "patientPhone", required = false) String patientPhone,
            @ApiParam(value = "服务机构", name = "hospitalCode",required = false)
            @RequestParam(value = "hospitalCode", required = false) String hospitalCode,
            @ApiParam(value = "工单状态", name = "status",required = false)
            @RequestParam(value = "status", required = false) Integer[] status,
            @ApiParam(value = "创建时间开始,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeStart",required = false)
            @RequestParam(value = "createTimeStart", required = false) String createTimeStart,
            @ApiParam(value = "创建时间结束,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeEnd",required = false)
            @RequestParam(value = "createTimeEnd", required = false) String createTimeEnd,
            @ApiParam(value = "服务医生的名称", name = "serverDoctorName",required = false)
            @RequestParam(value = "serverDoctorName", required = false) String serverDoctorName,
            @ApiParam(value = "居民ID", name = "patient",required = false)
            @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(value = "发起类型(1本人发起 2家人待预约 3医生代预约)", name = "type")
            @RequestParam(value = "type", required = false) Integer type,
            @ApiParam(value = "页码", name = "page",defaultValue = "1",required = true)
            @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(value = "每页数目", name = "pageSize",defaultValue = "10",required = true)
            @RequestParam(value = "pageSize", required = true) Integer pageSize) {
        try {
            StringBuffer ss = new StringBuffer();
            if (status != null && status.length > 0){
                int statusLength = status.length;
                for (int i =0 ; i < statusLength ; i++){
                    ss .append(status[i]);
                    if (i<statusLength-1){
                        ss.append(",");
                    }
                }
            }else {
                ss = null;
            }
            JSONObject result = patientDoorCoachOrderService.getDoorOrderList(orderId,patientName,patientPhone,hospitalCode,
                    ss,createTimeStart,createTimeEnd,serverDoctorName,patient,page,pageSize, type);
            return ObjEnvelop.getSuccess( "获取成功",result);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError( "获取失败!" + e.getMessage());
        }
    }
    @GetMapping("getByOrderId")
    @ApiOperation(value = "根据工单id获取相应的工单,如果为空,则获取该患者当前最新一条的工单")
    public ObjEnvelop getByOrderId(
            @ApiParam(value = "patientCode", name = "patientCode")
            @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = false) String orderId) {
        try {
            // 没有提供工单id的情况下,则获取该医生当前最新一条的工单
            if (StringUtils.isEmpty(orderId)) {
                // 根据接单医生code获取最近一次服务orderId
                orderId = patientDoorCoachOrderService.getOrderIdByPatient(patientCode);
                if (StringUtils.isEmpty(orderId)) {
                    return ObjEnvelop.getError( "获取失败, 该医生暂无工单" );
                }
            }
            // 根据orderId获取工单信息
            BaseDoorCoachOrderDO baseDoorCoachOrderDO = doctorDoorCoachOrderService.getDoorServiceOrderById(orderId);
            return ObjEnvelop.getSuccess( "获取成功",  baseDoorCoachOrderDO);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("获取失败, 该医生暂无工单!" + e.getMessage());
        }
    }
    @PostMapping(value = "dispatcherIntoTopic")
    @ApiOperation(value = "调度员进入会话")
    public ObjEnvelop dispatcherIntoTopic(
            @ApiParam(name = "orderId", value = "工单id", required = true) @RequestParam String orderId,
            @ApiParam(name = "hospitalName", value = "机构名称", required = true) @RequestParam String hospitalName,
            @ApiParam(name = "dispatcher", value = "调度员code", required = true) @RequestParam String dispatcher,
            @ApiParam(name = "dispatcherName", value = "调度员姓名", required = true) @RequestParam  String dispatcherName
    ) {
        try{
            JSONObject result = patientDoorCoachOrderService.dispatcherIntoTopic(orderId,hospitalName,dispatcher,dispatcherName);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("转接成功",result.get(ResponseContant.resultMsg));
        }catch (Exception e){
            e.printStackTrace();
        }
        return ObjEnvelop.getError("转接失败");
    }
    /**
     * 获取服务项目
     *
     * @param hospital
     * @return
     */
    @GetMapping("selectItemsByHospital")
    @ApiOperation(value = "获取服务项目")
    public ListEnvelop selectItemsByHospital(
            @ApiParam(value = "机构code", name = "hospital")
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(value = "服务项目名称", name = "serverItemName")
            @RequestParam(value = "serverItemName", required = false) String serverItemName) {
        try {
            return ListEnvelop.getSuccess( "获取成功",patientDoorCoachOrderService.selectItemsByHospital(hospital,serverItemName));
        } catch (Exception e) {
            e.printStackTrace();
            return ListEnvelop.getError( "获取失败!");
        }
    }
}

+ 0 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/exam/ChildrenExaminationEndpoint.java


Неке датотеке нису приказане због велике количине промена