瀏覽代碼

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

liubing 3 年之前
父節點
當前提交
5e6250988c
共有 82 個文件被更改,包括 4863 次插入760 次删除
  1. 5 2
      business/base-service/src/main/java/com/yihu/jw/file_upload/FileManageService.java
  2. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/HospitalDao.java
  3. 19 1
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  4. 6 24
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  6. 6 2
      business/base-service/src/main/java/com/yihu/jw/hospital/team/service/WlyyAdminTeamService.java
  7. 0 1
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  8. 0 27
      business/base-service/src/main/java/com/yihu/jw/internet/service/YKYKCommonService.java
  9. 1178 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/YkyyCommonService.java
  10. 558 558
      business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java
  11. 7 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/AchnsDoctorRecordDao.java
  12. 15 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsOlineMedDao.java
  13. 13 1
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsOnlineAskDao.java
  14. 14 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsPrescriptionDao.java
  15. 16 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsPrescriptionDrugDao.java
  16. 12 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpAppointmentOnlineDao.java
  17. 9 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpMedicalOnlineDao.java
  18. 16 3
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsDoctorRecordDao.java
  19. 11 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsDoctorScoreDao.java
  20. 9 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsOrganBaseDao.java
  21. 13 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/AchnsDoctorRecordService.java
  22. 20 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsOlineMedService.java
  23. 16 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsOnlineAskService.java
  24. 19 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsPrescriptionAService.java
  25. 19 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsPrescriptionDrugService.java
  26. 18 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpAppointmentOnlineService.java
  27. 16 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpMedicalOnlineService.java
  28. 18 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsDoctorRecordService.java
  29. 18 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsDoctorScoreService.java
  30. 14 0
      business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsOrganBaseService.java
  31. 7 7
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  32. 127 0
      common/common-entity/src/main/java/com/yihu/jw/entity/equipment/BaseHospitalEquipmentDO.java
  33. 88 0
      common/common-entity/src/main/java/com/yihu/jw/entity/equipment/WlyyUserAreaDO.java
  34. 52 0
      common/common-entity/src/main/java/com/yihu/jw/entity/equipment/WlyyUserEquipmentDO.java
  35. 6 14
      common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsOnlineAskDO.java
  36. 7 14
      common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsOnlineMedDO.java
  37. 10 14
      common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsPrescriptionDO.java
  38. 4 7
      common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsPrescriptionDrugDO.java
  39. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/UpAppointmentOnlineDO.java
  40. 22 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  41. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  42. 3 0
      gateway/ag-basic/src/main/resources/application.yml
  43. 0 37
      svr/svr-base/src/main/java/com/yihu/jw/base/aop/ClientSearchRequestAspect.java
  44. 0 18
      svr/svr-base/src/main/java/com/yihu/jw/base/aop/ClientSearchRequestLimit.java
  45. 9 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/BaseHospitalEquipmentDao.java
  46. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/WlyyUserAreaDao.java
  47. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/WlyyUserEquipmentDao.java
  48. 55 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/area/BaseEquipmentEndpoint.java
  49. 58 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/area/BaseHospitalEndpoint.java
  50. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/FileUploadController.java
  51. 49 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/equipment/EquipmentEndpoint.java
  52. 34 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/equipment/UserEquipmentEndpoint.java
  53. 64 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/BaseHospitalEquipmentService.java
  54. 23 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/WlyyUserAreaService.java
  55. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/WlyyUserEquipmentService.java
  56. 48 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  57. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java
  58. 15 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java
  59. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/file_upload/FileUploadEndpoint.java
  60. 14 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java
  61. 14 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java
  62. 5 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java
  63. 12 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java
  64. 15 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java
  65. 5 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java
  66. 12 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java
  67. 359 0
      svr/svr-cloud-medicine/pom.xml
  68. 4 0
      svr/svr-cloud-medicine/readme.MD
  69. 24 0
      svr/svr-cloud-medicine/src/main/java/com/yihu/SvrCloudMedicineApplication.java
  70. 1214 0
      svr/svr-cloud-medicine/src/main/resources/application.yml
  71. 6 0
      svr/svr-cloud-medicine/src/main/resources/banner.txt
  72. 123 0
      svr/svr-cloud-medicine/src/main/resources/bootstrap.yml
  73. 120 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/yk/YKYYDataUploadJob.java
  74. 78 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  75. 3 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  76. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/MvcConfig.java
  77. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java
  78. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyAdminTeamController.java
  79. 11 5
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  80. 21 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  81. 3 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/thirdUpload/ThirdUploadEndpoint.java
  82. 1 0
      wlyy-parent-pom/pom.xml

+ 5 - 2
business/base-service/src/main/java/com/yihu/jw/file_upload/FileManageService.java

@ -41,12 +41,15 @@ public class FileManageService {
     * @return
     * @throws IOException
     */
    public String chunkUploadByMappedByteBuffer(MutilFileInfo param) throws IOException {
    public String chunkUploadByMappedByteBuffer(MutilFileInfo param,Integer chunkSize) throws IOException {
        if(param.getTaskId() == null || "".equals(param.getTaskId())){
            param.setTaskId(UUID.randomUUID().toString());
        }
        boolean copflag =false;
        long chunkFileSize = 5 * 1024 * 1024;
        if (chunkSize==null){
            chunkSize=2;
        }
        long chunkFileSize = chunkSize * 1024 * 1024;
        /**
         * basePath是我的路径,可以替换为你的
         * 1:原文件名改为UUID

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/HospitalDao.java

@ -15,6 +15,8 @@ import java.util.List;
public interface HospitalDao extends PagingAndSortingRepository<DmHospitalDO, Integer>, JpaSpecificationExecutor<DmHospitalDO> {
    @Query("from DmHospitalDO t where t.town=?1 and t.del='1'")
    List<DmHospitalDO> findByTownCode(String town, Pageable pageRequest);
    @Query("from DmHospitalDO t where t.town=?1 and t.name like ?2 and t.del='1'")
    List<DmHospitalDO> findByTownCodeAndName(String town,String name,Pageable pageRequest);
    @Query("from DmHospitalDO t where t.code=?1 and t.del='1'")
    DmHospitalDO findByCode(String code);

+ 19 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -25,6 +25,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -398,10 +399,26 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                }else {
                                    patientDO= basePatientDao.findByIdcard(jsonObject1.getString("IDCARD"));
                                }
                                patientDO.setMobile(jsonObject1.getString("TEL"));
                                if (patientDO==null){
                                    patientDO = new BasePatientDO();
                                }
                                if (StringUtils.isNotBlank(jsonObject1.getString("TEL"))){
                                    patientDO.setMobile(jsonObject1.getString("TEL"));
                                }
                                if(StringUtils.isNotBlank(jsonObject1.getString("BIRTHDAY"))){
                                    patientDO.setBirthday(DateUtil.strToDate(jsonObject1.getString("BIRTHDAY")));
                                }
                                String pw = null;
                                String salt = UUID.randomUUID().toString().substring(0,5);
                                String mobile = jsonObject1.getString("TEL");
                                String idcard = jsonObject1.getString("IDCARD");
                                if(org.apache.commons.lang3.StringUtils.isNotBlank(mobile)){
                                    pw = mobile.substring(mobile.length()-6);
                                }else{
                                    pw = idcard.substring(idcard.length()-6);
                                }
                                patientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                patientDO.setSalt(salt);
                                patientDO.setIdcard(jsonObject1.getString("IDCARD"));
                                patientDO.setName(jsonObject1.getString("NAME"));
                                if(jsonObject1.getInteger("SEX")!=null){
@ -417,6 +434,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                patientDO.setEnabled(1);
                                patientDO.setLocked(0);
                                patientDO.setCreateTime(new Date());
                                patientDO.setUpdateTime(new Date());
                                patientDO = basePatientDao.save(patientDO);
                                //取his中的病人code
                                JSONArray hisArray = ykyyEntranceService.findHisPatientBymMedicare(jsonObject1.getString("MEDICALCARD"),jsonObject1.getString("CLINICID"),false);

+ 6 - 24
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -573,7 +573,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                condition +
                /*  " o.register_date AS \"registerDate\"," +*/
                " o.evaluate_status AS \"evaluateStatus\"," +
                " o.pay_status as \"payStatus\" " +
                " o.pay_status as \"payStatus\"," +
                " o.his_status as \"hisStatus\"  " +
                " FROM " +
                " wlyy_outpatient o " +
                " WHERE " +
@ -664,6 +665,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("operator",outpatientDO.getOperator());
        rs.put("status",outpatientDO.getStatus());
        rs.put("fee",outpatientDO.getFee());
        rs.put("hisStatus",outpatientDO.getHisStatus());
        rs.put("icd10Name",outpatientDO.getIcd10Name());
        rs.put("createTime",DateUtil.dateToStrLong(outpatientDO.getCreateTime()));
        //居民详情
@ -11383,32 +11385,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return null;
    }
    public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType,String consumer,String preNo) throws Exception {
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer,
                                  String checkPart,String chargeFlag,String chargeCode,String icdCode) throws Exception {
        Map returnMap = new HashMap();
        List<WlyyHospitalSysDictDO> natConfigList = wlyyHospitalSysDictDao.findByDictName("natConfigList");
        String checkPart = "鼻/咽拭子";
        String chargeFlag = "2";
        String chargeCode = "361322";
        String icdCode = "Z00.000";
        Integer winNo = 6;
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:natConfigList){
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"checkPart".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                checkPart = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"chargeFlag".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                chargeFlag = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"chargeCode".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                chargeCode = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"icdCode".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                icdCode = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"winNo".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                winNo = Integer.parseInt(wlyyHospitalSysDictDO.getDictValue());
            }
        }
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            net.sf.json.JSONObject jsondate = new JSONObject();
            jsondate.put("checkPart",checkPart);

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -333,8 +333,10 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     */
    public WlyyOutpatientDO appointmentRevisit(String outpatientJson, String expressageJson, String registerJson, String chargeType) throws Exception {
        System.out.print("outpatientJson::"+outpatientJson);
        //1.保存就诊实体
        WlyyOutpatientDO outpatientDO = objectMapper.readValue(outpatientJson, WlyyOutpatientDO.class);
        System.out.print("getDescription::"+outpatientDO.getDescription());
        BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        outpatientDO.setMjz("mz");

+ 6 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/team/service/WlyyAdminTeamService.java

@ -38,11 +38,15 @@ public class WlyyAdminTeamService {
    @Autowired
    private BaseTownDao baseTownDao;
    //查询机构
    public MixEnvelop findHospitalByTown(String townCode,Integer page,Integer pageSize){
    public MixEnvelop findHospitalByTown(String townCode,String name,Integer page,Integer pageSize){
        PageRequest pageRequest = new PageRequest(page-1,pageSize);
        MixEnvelop mixEnvelop = new MixEnvelop();
        List<DmHospitalDO> list =null;
        list = hospitalDao.findByTownCode(townCode,pageRequest);
        if (StringUtils.isNoneBlank(name)){
            list=hospitalDao.findByTownCodeAndName(townCode,name,pageRequest);
        }else {
            list = hospitalDao.findByTownCode(townCode,pageRequest);
        }
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setDetailModelList(list);

+ 0 - 1
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -417,7 +417,6 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    }
    // 4 获取监管平台医师唯一标识	micc.achNsDoctorRecord  --- 完成
    public String achNsDoctorRecord(String idCardNo) throws Exception {
        getBaseSurperviseDict();

+ 0 - 27
business/base-service/src/main/java/com/yihu/jw/internet/service/YKYKCommonService.java

@ -1,27 +0,0 @@
package com.yihu.jw.internet.service;
import com.yihu.jw.internet.dao.InternetUpLogDao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import com.yihu.mysql.query.BaseJpaService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
/**
 * Created by wsy on 2021/9/7.
 */
public class YKYKCommonService extends BaseJpaService<InternetUpErrorLogDO, InternetUpLogDao> {
    private org.slf4j.Logger logger = LoggerFactory.getLogger(YKYKCommonService.class);
    @Autowired
    private InternetUpErrorLogService internetUpErrorLogService;
    @Autowired
    private InternetUpLogDao internetUpLogDao;
    @Value("{fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
}

+ 1178 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/YkyyCommonService.java

@ -0,0 +1,1178 @@
package com.yihu.jw.internet.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseSuperviseDataDictDao;
import com.yihu.jw.dict.dao.BaseSuperviseDictDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.hospital.dict.BaseSuperviseDataDict;
import com.yihu.jw.entity.hospital.dict.BaseSuperviseDict;
import com.yihu.jw.entity.thirdUpload.*;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.internet.dao.HospitalImgDao;
import com.yihu.jw.internet.dao.InternetUpLogDao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import com.yihu.jw.internet.entity.InternetUpLogDO;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.internet.wsapi.Wsapi;
import com.yihu.jw.internet.wsapi.WsapiProxy;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.thirdUpload.UpMedicalOnlineDao;
import com.yihu.jw.thirdUpload.service.*;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.ImgUtils;
import com.yihu.jw.utils.JSONUtils;
import com.yihu.jw.utils.encode.AESUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by wsy on 2021/9/7.
 */
@Service
public class YkyyCommonService extends BaseJpaService<InternetUpErrorLogDO, InternetUpLogDao> {
    private org.slf4j.Logger logger = LoggerFactory.getLogger(YkyyInternetService.class);
    @Autowired
    private InternetUpErrorLogService internetUpErrorLogService;
    @Autowired
    private InternetUpLogDao internetUpLogDao;
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    private WlyyHospitalSysDictDao dictDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseSuperviseDataDictDao superviseDataDictDao;
    @Autowired
    private BaseSuperviseDictDao superviseDictDao;
    @Autowired
    private UpnsDoctorRecordService upnsDoctorRecordService;
    @Autowired
    private UpAppointmentOnlineService upAppointmentOnlineService;
    @Autowired
    private UpMedicalOnlineService upMedicalOnlineService;
    @Autowired
    private UpnsDoctorScoreService upnsDoctorScoreService;
    @Autowired
    private BaseNsOnlineAskService baseNsOnlineAskService;
    @Autowired
    private BaseNsOlineMedService baseNsOlineMedService;
    @Autowired
    private BaseNsPrescriptionAService baseNsPrescriptionAService;
    @Autowired
    private BaseNsPrescriptionDrugService baseNsPrescriptionDrugService;
    static String userName = "xmykzx";
    static String psw = "7j39c7";
    static String appId = "ws022";
    static String AesEncodeKey = "834irjf3jd39rh2m";
    //static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
    static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
    static String method = "execute";
    static String token = "";
    static String orgCode = "350211A5004";
    static String orgName = "厦门大学附属厦门眼科中心";
    static String orgArea = "350203000";
    static String orgSub = "350200000";
    static String imgPath =File.separator+"usr"+File.separator+"local"+File.separator+"hospital"+File.separator+"svr-internet-hospital-job"+File.separator+"img"+File.separator;
    public String imgUrl;
    public ObjectMapper objectMapper;
    public void getBaseSurperviseDict(){
        BaseSuperviseDict superviseDict = superviseDictDao.selectByDictName();
        userName=superviseDict.getUserName();
        psw=superviseDict.getPsw();
        appId=superviseDict.getAppId();
        AesEncodeKey = superviseDict.getAesEncodeKey();
        method = superviseDict.getMethod();
        token = superviseDict.getToken();
        orgArea=superviseDict.getOrgArea();
        orgCode = superviseDict.getOrgCode();
        orgName=superviseDict.getOrgName();
        orgSub=superviseDict.getOrgSub();
        imgUrl=superviseDict.getImgUrl();
    }
    public String getDate(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        return simpleDateFormat.format(new Date());
    }
    /**
     * 监管平台上传地址
     * @return
     */
    public String getUrl(){
        return dictDao.findByDictName("dataUpload").get(0).getDictCode();
        //return urlString;
    }
    // 0 调用省监管平台接口
    public String postToInter(String token, String api, JSONArray params,String url) throws Exception {
        getBaseSurperviseDict();
        WsapiProxy proxy = new WsapiProxy();
        proxy.setEndpoint(url);
        JSONObject jsonObject= new JSONObject();
        if (params!=null&&params.size()>0){
            jsonObject= params.getJSONObject(0);
            jsonObject.put("docimg","");
            jsonObject.put("doc_cert","");
            jsonObject.put("cert_doc_prac","");
        }
        logger.info("入参:"+jsonObject.toString());
        Wsapi wsapi = proxy.getWsapi();
//        logger.info("postToInter:"+JSONUtils.toString(new String[] {token, params.toString()}));
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] {token, params.toString()}), AesEncodeKey);
        String result = wsapi.invoke(appId, "", api, method, encryptParams);
        String deResult = AESUtils.decrypt(result, AesEncodeKey);
        logger.info("postToInter:"+JSONUtils.toString(deResult));
        return deResult;
    }
    // 1  接口用户信息,获取TOKEN值	 micc.upNsUserToken   --- 完成
    public String upNsUserToken(String url) throws Exception {
        getBaseSurperviseDict();
        WsapiProxy proxy = new WsapiProxy();
        proxy.setEndpoint(url);
        Wsapi wsapi = proxy.getWsapi();
        String api = "micc.upNsUserToken";
        JSONObject jb = new JSONObject();
        jb.put("cd_user", userName);
        jb.put("pwd_user", psw);
        logger.info("url :"+url);
        logger.info("jb :"+jb.toString());
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] { jb.toString() }), AesEncodeKey);
        String res = wsapi.invoke(appId, "", api, method, encryptParams);
        logger.info("appId :"+appId);
        logger.info("method :"+method);
        logger.info("encryptParams :"+encryptParams);
        String deResult = AESUtils.decrypt(res, AesEncodeKey);
        logger.info("AesEncodeKey :"+AesEncodeKey);
        JSONObject resJson = (JSONObject) JSONObject.parse(deResult);
        if("200".equals(resJson.get("msg").toString())) {
            token = resJson.get("token").toString();
        }
        logger.info("upNsUserToken : "+token);
        return token;
    }
    // 2  医院基本信息	micc.upNsOrganBas     --- 完成
    public String upNsOrganBas() throws Exception {
        getBaseSurperviseDict();
        BaseSuperviseDataDict superviseDataDict = superviseDataDictDao.selectByDictName();
        String url = getUrl();
        String api = "micc.upNsOrganBase";
        JSONObject jb = new JSONObject();
        jb.put("organ_code", orgCode);
        jb.put("organ_name",orgName);
        jb.put("corporation", superviseDataDict.getCorporation());
        jb.put("no_pra_lic", superviseDataDict.getNoPraLic());
        jb.put("second_organ_name", superviseDataDict.getSecondOrganName());
        jb.put("charge_person", superviseDataDict.getChargePerson());
        jb.put("level", superviseDataDict.getLevelCode());
        jb.put("economic_type", superviseDataDict.getEconomicType());
        jb.put("organ_type", superviseDataDict.getOrganType());
        jb.put("organ_sub", orgSub);
        jb.put("hospital_district",orgArea);
        jb.put("hospital_address", superviseDataDict.getHospitalAddress());
        jb.put("hospital_phone", superviseDataDict.getHospitalPhone());
        jb.put("hospital_img","");
//        jb.put("bus_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"yyzz.jpg"));
//        jb.put("corp_idcord_head", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"a.jpg"));
//        jb.put("corp_idcord_tail", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"b.jpg"));
//        jb.put("pra_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"zyxkz.jpg"));
        jb.put("bus_lic", null);
        jb.put("corp_idcord_head", null);
        jb.put("corp_idcord_tail", null);
        jb.put("pra_lic", null);
        jb.put("secu_level",superviseDataDict.getSecuLevel());
        jb.put("secu_level_cert","");
        jb.put("net_service", superviseDataDict.getNetService());
        jb.put("net_service_ot", "");
        jb.put("service_dept", superviseDataDict.getServiceDept());
        jb.put("txt_introduction", superviseDataDict.getTxtIntroduction());
        //用户协议
        jb.put("protocol_type", superviseDataDict.getProtocolType());
        jb.put("protocol_content", superviseDataDict.getProtocolContent());
        jb.put("publish_date", superviseDataDict.getPublishDate());
        jb.put("protocol_name", superviseDataDict.getProtocolName());
        //其他建设信息
        jb.put("quai_mang_dept", "");
        jb.put("info_mang_dept", "");
        jb.put("medi_service_dept", "");
        jb.put("server_type", "");
        jb.put("server_total", "");
        jb.put("server_ip", "");
        jb.put("mp_system_type", "");
        jb.put("mp_system_total", "");
        jb.put("tran_link", "");
        jb.put("tran_link_band", "");
        jb.put("server_system_name", "");
        jb.put("server_system_ip", "");
        jb.put("tech_manual", "");
        jb.put("server_manual", "");
        jb.put("emr_level", "");
        jb.put("emr_level_cert", "");
        jb.put("zone_record_share", "");
        jb.put("prov_monitor", "");
        jb.put("prov_service", "");
        jb.put("server_func", "");
        jb.put("third_compeny_name", "");
        jb.put("third_compeny_code", "");
        jb.put("third_compeny_cert", "");
        jb.put("third_compeny_corp", "");
        jb.put("third_compeny_corp_id", "");
        jb.put("third_compeny_prot", "");
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jb);
        String token = upNsUserToken(url);
        String res = postToInter(token, api, jsonArray,url);
        return res;
    }
    // 3 医师基本信息	micc.upNsDoctorRecord   --- 完成
    public String upNsDoctorRecord(String startDate, String endDate,String keyId) throws Exception {
        getBaseSurperviseDict();
        BaseSuperviseDataDict superviseDataDict = superviseDataDictDao.selectByDictName();
        String url = getUrl();
        String api = "micc.upNsDoctorRecord";
        String upid = getCode();
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        String token = upNsUserToken(url);
        //取数据
        UpnsDoctorRecordDO upnsDoctorRecordDO;
        List<UpnsDoctorRecordDO> list = upnsDoctorRecordService.findAllByDate(startDate,endDate);
        total = list.size();
        for(int i=0; i<total; i++){
            upnsDoctorRecordDO = list.get(i);
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
            try {
                //监管平台  职务字典强转
                jb.put("organ_code", orgCode);
                jb.put("organ_name", orgName);
                jb.put("doc_name", upnsDoctorRecordDO.getDoc_name());
                jb.put("docimg", upnsDoctorRecordDO.getDocimg());
                jb.put("id_card", upnsDoctorRecordDO.getId_card());
                jb.put("sex", upnsDoctorRecordDO.getSex());
                jb.put("birthday", upnsDoctorRecordDO.getBirthday());
                jb.put("subject", upnsDoctorRecordDO.getSubject());
                jb.put("subject_name", upnsDoctorRecordDO.getSubject_name());
                jb.put("belong_dept", upnsDoctorRecordDO.getBelong_dept());
                jb.put("belong_dept_name", upnsDoctorRecordDO.getBelong_dept_name());
                jb.put("doo_tel", upnsDoctorRecordDO.getDoo_tel());
                jb.put("title_rec_date", upnsDoctorRecordDO.getTitle_rec_date());
                jb.put("prac_type", upnsDoctorRecordDO.getPrac_type());
                jb.put("title_code", upnsDoctorRecordDO.getTitle_code());
                jb.put("first_compeny_code", upnsDoctorRecordDO.getFirst_compeny_code());
                jb.put("first_compeny_name", upnsDoctorRecordDO.getFirst_compeny_name());
                jb.put("secd_compeny_code", upnsDoctorRecordDO.getSecd_compeny_code());
                jb.put("secd_compeny_name", upnsDoctorRecordDO.getSecd_compeny_name());
                jb.put("net_service", upnsDoctorRecordDO.getNet_service());
                jb.put("cert_no", upnsDoctorRecordDO.getCert_no());
                jb.put("prac_no", upnsDoctorRecordDO.getPrac_no());
                jb.put("doc_cert", upnsDoctorRecordDO.getDoc_cert());
                jb.put("cert_doc_prac", upnsDoctorRecordDO.getCert_doc_prac());
                jb.put("txt_introduction", upnsDoctorRecordDO.getTxt_introduction());
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"3",upnsDoctorRecordDO.getId(),"数据格式错误",1);
                error++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                //上传监管平台
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token, api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"3",upnsDoctorRecordDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"3",new Date(),new Date(),success,error,dataError,resInfo);
        return resInfo;
    }
    // 4 获取监管平台医师唯一标识	micc.achNsDoctorRecord  --- 完成
    public String achNsDoctorRecord(String idCardNo) throws Exception {
        String url = getUrl();
        String api = "micc.achNsDoctorRecord";
        JSONObject jb = new JSONObject();
        jb.put("organ_code", orgCode);
        jb.put("organ_name", orgName);
        jb.put("id_card", idCardNo);
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jb);
        String token = upNsUserToken(url);
        String res = postToInter(token, api, jsonArray,url);
        JSONObject rs = (JSONObject) JSONObject.parse(res);
        String msg = rs.getString("msg");
        if("200".equals(msg)){
            JSONArray reqContent = rs.getJSONArray("reqContent");
            JSONObject req = (JSONObject)reqContent.get(0);
            return req.getString("miccId");
        }
        return "";
    }
    // 5 网上预约挂号	micc.upAppointmentOnline  ----完成
    public String upAppointmentOnline(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upAppointmentOnline";
        String upid = getCode();
        String res = "";
        int total = 0;
        int success = 0;
        int dataError = 0;
        int error = 0;
        String token = upNsUserToken(url);
        UpAppointmentOnlineDO upAppointmentOnlineDO;
        List<UpAppointmentOnlineDO> list = upAppointmentOnlineService.findAllByDate(startDate,endDate);
        total = list.size();
        for(int i=0; i< total; i++){
            JSONObject jb = new JSONObject();
            upAppointmentOnlineDO = list.get(i);
            Boolean errorFlag = false;
            try{
                String[] dept = depToSubject(upAppointmentOnlineDO.getReg_subject_code());
                jb.put("id", orgCode +"_"+ upAppointmentOnlineDO.getId());
                jb.put("cd_org", orgCode);
                jb.put("cd_area", orgArea);
                jb.put("cd_orgSub", orgSub);
                jb.put("reg_time", upAppointmentOnlineDO.getReg_time());
                jb.put("fg_visit",  upAppointmentOnlineDO.getFg_visit() == null?"1" : upAppointmentOnlineDO.getFg_visit());
                jb.put("reg_dep_code",  upAppointmentOnlineDO.getReg_dep_code() == null?"0":upAppointmentOnlineDO.getReg_dep_code());
                jb.put("reg_dep_name",  upAppointmentOnlineDO.getReg_dep_name() == null?"0":upAppointmentOnlineDO.getReg_dep_name());
                jb.put("reg_subject_code",  dept.length>=1?dept[0]:"");
                jb.put("reg_subject_name", dept.length>=2?dept[1]:"");
                jb.put("reg_price",  upAppointmentOnlineDO.getReg_price());
                jb.put("pt_name", upAppointmentOnlineDO.getPt_name() == null?"0":upAppointmentOnlineDO.getPt_name());
                jb.put("ge_code", upAppointmentOnlineDO.getGe_code());
                jb.put("pt_age", upAppointmentOnlineDO.getPt_age());
                jb.put("card_type", upAppointmentOnlineDO.getCard_type());
                jb.put("id_no",  upAppointmentOnlineDO.getId_no() == null?"0": upAppointmentOnlineDO.getId_no());
                jb.put("pt_tel",  upAppointmentOnlineDO.getPt_tel());
                jb.put("crt_date",DateUtil.dateToStrLong(DateUtil.getNow()));
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"5",upAppointmentOnlineDO.getId(),"网上预约挂号数据格式错误",1);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"5",upAppointmentOnlineDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"5",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 6 在线医技预约 	micc.upMedicalOnline --- 完成
    public String upMedicalOnline(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upMedicalOnline";
        String upid = getCode();
        //挂号String token = upNsUserToken(url);
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        UpMedicalOnlineDO upMedicalOnlineDO;
        List<UpMedicalOnlineDO> list = upMedicalOnlineService.findAllByDate(startDate,endDate);
        if(list != null && list.size() > 0){
            total = list.size();
            for(int i = 0; i<total; i++){
                JSONObject jb = new JSONObject();
                upMedicalOnlineDO = list.get(i);
                Boolean errorFlag = false;
                try {
                    String docInterId = achNsDoctorRecord(upMedicalOnlineDO.getId_doctor());
                    jb.put("id",orgCode +"_"+ upMedicalOnlineDO.getId());
                    jb.put("cd_org", orgCode);
                    jb.put("cd_area", orgArea);
                    jb.put("cd_orgSub", orgSub);
                    jb.put("app_time",upMedicalOnlineDO.getApp_time());
                    jb.put("app_dep_code", upMedicalOnlineDO.getApp_dep_code());
                    jb.put("app_class_code", upMedicalOnlineDO.getApp_class_code());
                    jb.put("id_doctor", docInterId);
                    jb.put("fg_handle", upMedicalOnlineDO.getFg_handle());
                    jb.put("handle_time", upMedicalOnlineDO.getHandle_time());
                    jb.put("pt_name",upMedicalOnlineDO.getPt_name());
                    jb.put("ge_code", upMedicalOnlineDO.getGe_code());
                    jb.put("card_type", upMedicalOnlineDO.getCard_type());
                    jb.put("id_no", upMedicalOnlineDO.getId_no());
                    jb.put("pt_tel", upMedicalOnlineDO.getPt_tel());
                    jb.put("crt_date",DateUtil.dateToStrLong(DateUtil.getNow()));
                }catch (Exception e){
                    errorFlag = true;
                    saveErrorLog(upid,"6",upMedicalOnlineDO.getId(),"在线医技预约格式错误",1);
                    dataError++;
                    logger.error(e.toString());
                }
                if(!errorFlag){
                    JSONArray jsonArray = new JSONArray();
                    jsonArray.add(jb);
                    res = postToInter(token,api, jsonArray,url);
                    JSONObject resJson = (JSONObject) JSONObject.parse(res);
                    if("200".equals(resJson.get("msg").toString())){
                        success++;
                    }else{
                        saveErrorLog(upid,"6",upMedicalOnlineDO.getId(),res,2);
                        error++;
                    }
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"6",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 7 医生评价信息	micc.upNsDoctorScore  --- 完成
    public String upNsDoctorScore(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upNsDoctorScore";
        String upid = getCode();
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        String token = upNsUserToken(url);
        List<UpnsDoctorScoreDO> list = upnsDoctorScoreService.findAllByDate(startDate,endDate);
        UpnsDoctorScoreDO upnsDoctorScoreDO = new UpnsDoctorScoreDO();
        total = list.size();
        Boolean errorFlag = false;
        JSONObject jb = new JSONObject();
        for(int i=0; i<list.size(); i++) {
            try{
            upnsDoctorScoreDO = list.get(i);
            String docInterId = achNsDoctorRecord(upnsDoctorScoreDO.getId_doctor());
            jb.put("id",orgCode +"_"+ upnsDoctorScoreDO.getId());
            jb.put("id_doctor",docInterId);
            jb.put("organ_code",orgCode);
            jb.put("organ_name", orgName);
            jb.put("net_service", upnsDoctorScoreDO.getNet_service());
            jb.put("net_service_name", upnsDoctorScoreDO.getNet_service_name());
            jb.put("val_score", upnsDoctorScoreDO.getVal_score() ==null ? "0": upnsDoctorScoreDO.getVal_score());
            jb.put("grader", upnsDoctorScoreDO.getGrader() == null ? "0":  upnsDoctorScoreDO.getGrader());
            jb.put("dt_grade", upnsDoctorScoreDO.getDt_grade());
            jb.put("grade_content", upnsDoctorScoreDO.getGrade_content() == null ? "0": upnsDoctorScoreDO.getGrade_content());
            jb.put("crt_date", DateUtil.dateToStrLong(DateUtil.getNow()));
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"7",upnsDoctorScoreDO.getId(),"医生评价信息格式错误",2);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"7",upnsDoctorScoreDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"7",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 8 网络咨询服务信息	micc.upNsOnlineAsk  --- 完成
    public String upNsOnlineAsk(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upNsOnlineAsk";
        String upid = getCode();
        String token = upNsUserToken(url);
        String res = "";
        int success = 0;
        int error = 0;
        int dataError = 0;
        int total;
        List<BaseNsOnlineAskDO> list = baseNsOnlineAskService.findAllByDate(startDate,endDate);
        BaseNsOnlineAskDO baseNsOnlineAskDO;
        total = list.size();
        for(int i=0; i<total; i++) {
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            baseNsOnlineAskDO = list.get(i);
            try {
                //基于科室转换成国家诊疗科目代码
                String[] dept = depToSubject(baseNsOnlineAskDO.getVisitDeptCode());
                String visitDocCode = achNsDoctorRecord(baseNsOnlineAskDO.getVisitDocCode());
                jb.put("id_online_ask", orgCode+"_"+ baseNsOnlineAskDO.getIdOnlineAsk());
                jb.put("net_service_code", baseNsOnlineAskDO.getNetServiceCode());
                jb.put("med_class_code", baseNsOnlineAskDO.getMedClassCode());
                jb.put("med_pop_code", baseNsOnlineAskDO.getMedClassCode());
                jb.put("org_name",orgName);
                jb.put("org_code", orgCode);
                jb.put("cd_orgSub", orgSub);
                jb.put("cd_area", orgArea);
                jb.put("visit_doc_name",  baseNsOnlineAskDO.getVisitDocName() == null? "0": baseNsOnlineAskDO.getVisitDocName());
                jb.put("visit_doc_id_no", baseNsOnlineAskDO.getVisitDocIdNo() == null? "0":baseNsOnlineAskDO.getVisitDocIdNo());
                jb.put("visit_doc_code", visitDocCode);
                jb.put("visit_dept_code", dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name", dept.length>=2?dept[1]:"");
                jb.put("pt_no", baseNsOnlineAskDO.getPtNo() == null? "0": baseNsOnlineAskDO.getPtNo());
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(baseNsOnlineAskDO.getPtAge()));
                jb.put("cost_type", baseNsOnlineAskDO.getCostType());
                jb.put("pt_birthdate", baseNsOnlineAskDO.getPtBirthdate() == null? "":baseNsOnlineAskDO.getPtBirthdate());
                jb.put("ge_code", baseNsOnlineAskDO.getGeCode() == null? "0": baseNsOnlineAskDO.getGeCode());
                jb.put("pt_tel", baseNsOnlineAskDO.getPtTel() == null ? "0": baseNsOnlineAskDO.getPtTel());
                jb.put("card_type", baseNsOnlineAskDO.getCardType());
                jb.put("id_no", baseNsOnlineAskDO.getIdNo() == null? "0": baseNsOnlineAskDO.getIdNo());
                jb.put("pt_district", baseNsOnlineAskDO.getPtDistrict() == null?"": baseNsOnlineAskDO.getPtDistrict());
                jb.put("apply_time", baseNsOnlineAskDO.getApplyTime() ==null?"1900-01-01": baseNsOnlineAskDO.getApplyTime());
                jb.put("visit_time", baseNsOnlineAskDO.getVisitTime() ==null?"1900-01-01": baseNsOnlineAskDO.getVisitTime());
                jb.put("visit_finish_time", baseNsOnlineAskDO.getVisitFinishTime() ==null?"1900-01-01": baseNsOnlineAskDO.getVisitFinishTime());
                jb.put("complaint_content", baseNsOnlineAskDO.getComplaintContent());
                jb.put("proc_file", baseNsOnlineAskDO.getProcFile());
                jb.put("price", baseNsOnlineAskDO.getPrice());
                jb.put("fg_reply", baseNsOnlineAskDO.getFgReply());
                jb.put("crt_time", DateUtil.dateToStrLong(DateUtil.getNow()));
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"8",baseNsOnlineAskDO.getId(),"网络咨询服务信息格式错误",2);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                String str = jb.toJSONString();
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"8",baseNsOnlineAskDO.getId().toString(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"8",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 9 网络诊疗服务信息 	micc.upNsOnlineMed
    public String upNsOnlineMed(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upNsOnlineMed";
        String upid = getCode();
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        String token = upNsUserToken(url);
        BaseNsOnlineMedDO baseNsOnlineMedDO;
        List<BaseNsOnlineMedDO> list = baseNsOlineMedService.findAllByDate(startDate,endDate);
        total = list.size();
        for(int i=0; i<list.size(); i++) {
            baseNsOnlineMedDO = list.get(i);
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            try {
                //基于科室转换成国家诊疗科目代码
                String[] dept = depToSubject(baseNsOnlineMedDO.getVisitDeptCode());
                String visitDocCode = achNsDoctorRecord(baseNsOnlineMedDO.getVisitDocCode());
                jb.put("id_online_med", orgCode +"_"+ baseNsOnlineMedDO.getIdOnlineMed());
                jb.put("net_service_code", baseNsOnlineMedDO.getNetServiceCode());
                jb.put("med_class_code", baseNsOnlineMedDO.getMedClassCode() == ""?"1": baseNsOnlineMedDO.getMedClassCode());
                jb.put("org_name", orgName);
                jb.put("org_code", orgCode);
                jb.put("cd_orgSub",orgSub);
                jb.put("cd_area",orgArea);
                jb.put("visit_doc_name",  baseNsOnlineMedDO.getVisitDocName());
                jb.put("visit_doc_id_no", baseNsOnlineMedDO.getVisitDocIdNo());
                jb.put("visit_doc_code", visitDocCode);
                jb.put("visit_subject_code", dept.length>=1?dept[0]:"");
                jb.put("visit_ subject _name",dept.length>=2?dept[1]:"");
                jb.put("visit_dept_code", dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name", dept.length>=2?dept[1]:"");
                jb.put("pt_no", baseNsOnlineMedDO.getPtNo());
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(baseNsOnlineMedDO.getPtAge()));
                jb.put("cost_type", baseNsOnlineMedDO.getCostType());
                jb.put("pt_birthdate", baseNsOnlineMedDO.getPtBirthdate());
                String sex = IdCardUtil.getSexForIdcard_new(baseNsOnlineMedDO.getGeCode());
                jb.put("ge_code", sex=="3"?"9":sex);
                jb.put("pt_tel", baseNsOnlineMedDO.getPtTel() ==null?"00000000000": baseNsOnlineMedDO.getPtTel());
                jb.put("card_type", baseNsOnlineMedDO.getCardType());
                jb.put("id_no", baseNsOnlineMedDO.getIdNo());
                jb.put("pt_district", baseNsOnlineMedDO.getPtDistrict());
                jb.put("pt_card_type", baseNsOnlineMedDO.getPtCardType());
                jb.put("pt_card_no", baseNsOnlineMedDO.getPtCardNo());
                jb.put("apply_time", baseNsOnlineMedDO.getApplyTime());
                jb.put("visit_time", baseNsOnlineMedDO.getVisitTime());
                jb.put("visit_finish_time", baseNsOnlineMedDO.getVisitFinishTime());
                jb.put("old_diag_code", baseNsOnlineMedDO.getOldDiagCode());
                jb.put("old_diag_name", baseNsOnlineMedDO.getOldDiagName());
                jb.put("diag_code", baseNsOnlineMedDO.getDiagCode());
                jb.put("diag_name", baseNsOnlineMedDO.getDiagName());
                jb.put("diseases_type", baseNsOnlineMedDO.getDiseasesType() == null ? "1": baseNsOnlineMedDO.getDiseasesType());
                jb.put("complaint_content", baseNsOnlineMedDO.getComplaintContent());
                jb.put("proc_file", baseNsOnlineMedDO.getProcFile());
                jb.put("price", baseNsOnlineMedDO.getPrice());
                jb.put("fg_reply", baseNsOnlineMedDO.getFgReply());
                jb.put("crt_time", DateUtil.dateToStrLong(DateUtil.getNow()));
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"9", baseNsOnlineMedDO.getId(),"网络诊疗服务信息格式错误",1);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"9", baseNsOnlineMedDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"9",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 10 电子处方表 micc.upPrescription    --- 完成
    public String upPrescription(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upPrescription";
        String upid =getCode();
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        String token = upNsUserToken(url);
        BaseNsPrescriptionDO baseNsPrescriptionDO;
        List<BaseNsPrescriptionDO> list = baseNsPrescriptionAService.findAllByDate(startDate,endDate);
        total = list.size();
        for(int i=0; i<total; i++) {
            baseNsPrescriptionDO = list.get(i);
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            try {
                //基于科室转换成国家诊疗科目代码
                String[] dept = depToSubject(baseNsPrescriptionDO.getPresDeptCode());
                String visitDocCode = achNsDoctorRecord(baseNsPrescriptionDO.getPresDocCode());
                String trialDocCode =  achNsDoctorRecord(baseNsPrescriptionDO.getTrialDocCode());
                jb.put("id_prescription", orgCode +"_"+ baseNsPrescriptionDO.getIdPrescription());
                jb.put("pres_no", baseNsPrescriptionDO.getPresNo() == null?"0": baseNsPrescriptionDO.getPresNo());
                jb.put("pres_class_code", baseNsPrescriptionDO.getPresClassCode());
                jb.put("pres_class_name", baseNsPrescriptionDO.getPresClassName());
                jb.put("pt_id", baseNsPrescriptionDO.getPtId());
                jb.put("med_rd_no", baseNsPrescriptionDO.getMedRdNo());
                jb.put("med_class_code", baseNsPrescriptionDO.getMedClassCode());
                jb.put("med_class_name", baseNsPrescriptionDO.getMedClassName());
                jb.put("pt_no", baseNsPrescriptionDO.getPtNo());
                jb.put("ge_code", baseNsPrescriptionDO.getGeCode());
                jb.put("pt_age",baseNsPrescriptionDO.getPtAge());
                jb.put("birthday", baseNsPrescriptionDO.getBirthday() == null?"": baseNsPrescriptionDO.getBirthday());
                jb.put("card_type", baseNsPrescriptionDO.getCardType());
                jb.put("id_no", baseNsPrescriptionDO.getIdNo());
                jb.put("guarder_name", baseNsPrescriptionDO.getGuarderName());
                jb.put("guarder_no", baseNsPrescriptionDO.getGuarderNo());
                jb.put("pt_tel", baseNsPrescriptionDO.getPtDistrict() == null?"": baseNsPrescriptionDO.getPtDistrict());
                jb.put("pt_district", baseNsPrescriptionDO.getPtDistrict() == null?"": baseNsPrescriptionDO.getPtDistrict());
                jb.put("allergic_history", baseNsPrescriptionDO.getAllergicHistory());
                jb.put("cost_type", baseNsPrescriptionDO.getCostType());
                jb.put("ins_class_code", baseNsPrescriptionDO.getInsClassCode());
                jb.put("ins_class_name", baseNsPrescriptionDO.getMedClassName());
                jb.put("org_code", orgCode);
                jb.put("org_name",orgName);
                jb.put("pres_subject_code", dept.length>=1?dept[0]:"");
                jb.put("pres_subject_name", dept.length>=2?dept[1]:"");
                jb.put("pres_dept_code", baseNsPrescriptionDO.getPresDeptCode() == null?"0": baseNsPrescriptionDO.getPresDeptCode());
                jb.put("pres_dept_name", baseNsPrescriptionDO.getPresDeptName() == null?"0": baseNsPrescriptionDO.getPresDeptName());
                jb.put("pres_time", baseNsPrescriptionDO.getPresTime() == null?"1900-01-01 00:00:00":baseNsPrescriptionDO.getPresTime());
                jb.put("pres_doc_code", visitDocCode);
                jb.put("pres_doc_name", baseNsPrescriptionDO.getPresDocName() == null?"0": baseNsPrescriptionDO.getPresDocName());
                jb.put("pres_doc_id_no", baseNsPrescriptionDO.getPresDocIdNo() == null?"0": baseNsPrescriptionDO.getPresDocIdNo());
                jb.put("trial_doc_code", trialDocCode);
                jb.put("trial_doc_name", baseNsPrescriptionDO.getTrialDocName() == null?"0": baseNsPrescriptionDO.getTrialDocName());
                jb.put("trial_doc_id_no", baseNsPrescriptionDO.getTrialDocIdNo() == null?"0": baseNsPrescriptionDO.getTrialDocIdNo());
                jb.put("diag_code", baseNsPrescriptionDO.getDiagCode());
                jb.put("diag_name", baseNsPrescriptionDO.getDiagName());
                jb.put("diseases_type", baseNsPrescriptionDO.getDiseasesType());
                jb.put("mobility_flag", baseNsPrescriptionDO.getMobilityFlag());
                jb.put("long_medical_flag", baseNsPrescriptionDO.getLongMedicalFlag());
                jb.put("pres_effec_days", baseNsPrescriptionDO.getPresEffecDays());
                jb.put("total_price", baseNsPrescriptionDO.getTotalPrice() == null?  0 : baseNsPrescriptionDO.getTotalPrice());
                jb.put("upload_time", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
                jb.put("pres_photo","");
                jb.put("pres_photos_list", "");
                jb.put("pres_photos", "");
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"10",baseNsPrescriptionDO.getId(),"电子处方表格式错误",1);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"10",baseNsPrescriptionDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条";
        saveUpLog(upid,"10",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 11 电子处方_药品明细表	micc.upPrescriptionDrug     --- 完成
    public String upPrescriptionDrug(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upPrescriptionDrug";
        String upid = getCode();
        String token = upNsUserToken(url);
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        BaseNsPrescriptionDrugDO baseNsPrescriptionDrugDO;
        List<BaseNsPrescriptionDrugDO> list = baseNsPrescriptionDrugService.findAllByDate(startDate,endDate);
        total = list.size();
        for(int i=0; i<total; i++) {
            baseNsPrescriptionDrugDO = list.get(i);
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            try {
                jb.put("id_prescription_drug",orgCode +"_"+ baseNsPrescriptionDrugDO.getIdPrescriptionDrug());
                jb.put("pres_no", baseNsPrescriptionDrugDO.getPresNo() == null? "0": baseNsPrescriptionDrugDO.getPresNo());
                jb.put("org_code",orgCode);
                jb.put("appr_drug_code", baseNsPrescriptionDrugDO.getApprDrugCode() == null? "0": baseNsPrescriptionDrugDO.getApprDrugCode());
                jb.put("appr_drug_name", baseNsPrescriptionDrugDO.getApprDrugName() == null? "0": baseNsPrescriptionDrugDO.getApprDrugName());
                jb.put("drug_code", baseNsPrescriptionDrugDO.getApprDrugCode());
                jb.put("drug_name", baseNsPrescriptionDrugDO.getApprDrugName());
                jb.put("drug_form", baseNsPrescriptionDrugDO.getDrugForm());
                jb.put("dosage", baseNsPrescriptionDrugDO.getDosage() == null? 0: baseNsPrescriptionDrugDO.getDosage());
                jb.put("dosage_unit", baseNsPrescriptionDrugDO.getDosageUnit() == null? "0": baseNsPrescriptionDrugDO.getDosageUnit());
                jb.put("total_dosage", baseNsPrescriptionDrugDO.getTotalDosage() == null? 0: baseNsPrescriptionDrugDO.getTotalDosage());
                jb.put("total_dosage_unit", baseNsPrescriptionDrugDO.getTotalDosageUnit() == null? "0": baseNsPrescriptionDrugDO.getTotalDosageUnit());
                jb.put("medicine_freq", baseNsPrescriptionDrugDO.getMedicineFreq() == null? "0": baseNsPrescriptionDrugDO.getMedicineFreq());
                jb.put("drug_use", baseNsPrescriptionDrugDO.getDrugUse() == null? "0": baseNsPrescriptionDrugDO.getDrugUse());
                jb.put("standard_desc", baseNsPrescriptionDrugDO.getStandardDesc() == null? "0": baseNsPrescriptionDrugDO.getStandardDesc());
                jb.put("single_price", baseNsPrescriptionDrugDO.getSinglePrice() == null? 0: baseNsPrescriptionDrugDO.getSinglePrice());
                jb.put("drug_total_price",baseNsPrescriptionDrugDO.getDrugTotalPrice());
                jb.put("comments", baseNsPrescriptionDrugDO.getComments());
                jb.put("anti_comments", baseNsPrescriptionDrugDO.getAntiComments());
                jb.put("dec_meth_name", baseNsPrescriptionDrugDO.getDecMethName());
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"11",baseNsPrescriptionDrugDO.getId(),res,1);
                dataError++;
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"11",baseNsPrescriptionDrugDO.getId(),res,2);
                    error++;
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"11",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    //14.数据上传汇总信息
    public String upNsInvokeTotal(String startDate, String endDate) throws Exception {
        String url = getUrl();
        String api = "micc.upNsInvokeTotal";
        String upid = getCode();
        String token = upNsUserToken(url);
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        String upAppointCount = upAppointmentOnlineService.findCount(startDate,endDate);
        String upMedicalCount = upMedicalOnlineService.findCount(startDate,endDate);
        String upnsDoctorRecordCount = upnsDoctorRecordService.findCount(startDate,endDate);
        String upnsDoctorScoreCount = upnsDoctorScoreService.findCount(startDate,endDate);
        String baseNsOnlineAskCount = baseNsOnlineAskService.findCount(startDate,endDate);
        String baseNsPrescriptionDrugCount = baseNsPrescriptionDrugService.findCount(startDate,endDate);
        String baseNsPrescriptionCount = baseNsPrescriptionAService.findCount(startDate,endDate);
        String baseNsOlineMedCount = baseNsOlineMedService.findCount(startDate,endDate);
        JSONObject jb = new JSONObject();
        Boolean errorFlag = false;
        try {
            jb.put("id_ws_invoke_total",upid);
            jb.put("org_code", orgCode);
            jb.put("org_name",orgName);
            jb.put("upAppoint_upload_count", upAppointCount);
            jb.put("upMedical_upload_count", upMedicalCount);
            jb.put("upnsDoctorRecord_upload_count", upnsDoctorRecordCount);
            jb.put("upnsDoctorScore_upload_count", upnsDoctorScoreCount);
            jb.put("NsOnlineAsk_upload_count", baseNsOnlineAskCount);
            jb.put("NsPrescriptionDrug_upload_count", baseNsPrescriptionDrugCount);
            jb.put("NsPrescription_upload_count",baseNsPrescriptionCount);
            jb.put("NsOlineMed_upload_count",baseNsOlineMedCount);
            jb.put("ywsj", DateUtil.dateToStr(new Date(),"yyyy-MM-dd"));
            jb.put("crt_time", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
        }catch (Exception e){
            errorFlag = true;
            saveErrorLog(upid,"14",upid,res,1);
            dataError++;
            logger.error(e.toString());
        }
        logger.info(jb.toString());
        if(!errorFlag){
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(jb);
            res = postToInter(token,api, jsonArray,url);
            JSONObject resJson = (JSONObject) JSONObject.parse(res);
            if("200".equals(resJson.get("msg").toString())){
                success++;
            }else{
                saveErrorLog(upid,"14",upid,res,2);
                error++;
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"14",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 基于医生所在科室,转换成国家诊疗科目代码(中山医院专用)
    // 当科室信息在列表中不存在的情况,全部配置为预防保健科
    public static  String[]  depToSubject(String dep){
        String[] res = new String[2];
        res[0] = "10";
        res[1] = "眼科";
        if(StringUtils.isNotBlank(dep)){
            if("1010".equals(dep)){
                res[0] = "3";
                res[1] = "内科";
            }else if("1154".equals(dep)){
                res[0] = "3";
                res[1] = "内科";
            }
        }
        return  res;
    }
    //2.5 预约,是否到诊字典转换
    public static String fgConvent(String status){
        String res ="";
        switch (status) {
            case "-1":
                res = "0";
                break;
            case "0":
                res = "1";
                break;
            case "1":
                res = "1";
                break;
            case "2":
                res = "1";
                break;
            default:
                res = "";
        }
        return res;
    }
    // 将上传失败的数据存储到LOG 中,便于后续补传
    public void saveErrorLog(String upId,String type, String id, String errorInfo,Integer errorType){
        InternetUpErrorLogDO internetUpErrorLogDO = new InternetUpErrorLogDO();
        internetUpErrorLogDO.setUpId(upId);
        internetUpErrorLogDO.setType(type);
        internetUpErrorLogDO.setKeyId(id);
        internetUpErrorLogDO.setErrorInfo(errorInfo);
        internetUpErrorLogDO.setErrorType(errorType);
        internetUpErrorLogService.save(internetUpErrorLogDO);
    }
    public void saveUpLog(String upid,String code,Date startDate,Date endDate,Integer suc,Integer err,Integer dataErr,String remark){
        InternetUpLogDO internetUpLogDO = new InternetUpLogDO();
        internetUpLogDO.setId(upid);
        internetUpLogDO.setCode(code);
        internetUpLogDO.setStartDate(startDate);
        internetUpLogDO.setEndDate(endDate);
        internetUpLogDO.setCreateDate(new Date());
        internetUpLogDO.setSuc(suc);
        internetUpLogDO.setErr(err);
        internetUpLogDO.setDataErr(dataErr);
        internetUpLogDO.setRemark(remark);
        internetUpLogDao.save(internetUpLogDO);
    }
    // 基于中山医院的职务字典,强转为监管平台的字典(该部分过滤掉字典与监管理无法匹配的部分)
    public static  String[]  classToduty(String duty){
        String[] res = new String[2];
        switch (duty) {
            case "1":
                res[0] = "231";
                res[1] = "主任医师";
                break;
            case "2":
                res[0] = "232";
                res[1] = "副主任医师";
                break;
            case "3":
                res[0] = "233";
                res[1] = "主治医师";
                break;
            default:
                res[0] = "234";
                res[1] = "医师";
        }
        return  res;
    }
    /**
     * 网络图片地址
     * @param path
     * @return
     * @throws Exception
     */
    public String getImg(String path)throws Exception{
        try{
            if(path.contains("http")){
                URL url = new URL(path);
                DataInputStream dataInputStream = new DataInputStream(url.openStream());
                return getBase64FromInputStream(dataInputStream);
            }
            URL url = new URL(fastdfs_file_url+path);
            DataInputStream dataInputStream = new DataInputStream(url.openStream());
            return getBase64FromInputStream(dataInputStream);
        }catch (Exception e){
            logger.error("getImg:"+e.toString());
        }
        return "";
    }
    public String getDateString(String date){
        String dates[] = date.split("-");
        if(dates!=null&&dates.length>0){
            if(dates[1].length()<2){
                dates[1] = "0"+dates[1];
            }
            if(dates[2].length()<2){
                dates[2] = "0"+dates[2];
            }
            return dates[0]+"-"+dates[1]+"-"+dates[2];
        }
        return date;
    }
    private String getBase64FromInputStream(InputStream is) throws Exception {
        // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
        byte[] data = null;
        // 读取图片字节数组
        try {
            ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
            byte[] buff = new byte[100];
            int rc = 0;
            while ((rc = is.read(buff, 0, 100)) > 0) {
                swapStream.write(buff, 0, rc);
            }
            data = swapStream.toByteArray();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    throw new Exception("输入流关闭异常");
                }
            }
        }
        //转化方法1
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encodeBuffer(data).trim();
        //转化方法2
//        return new String(Base64.encodeBase64(data));
    }
    public String testImg(String path){
        return ImgUtils.getImageStr(path);
    }
}

文件差異過大導致無法顯示
+ 558 - 558
business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java


+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/AchnsDoctorRecordDao.java

@ -1,6 +1,7 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@ -13,4 +14,10 @@ public interface AchnsDoctorRecordDao extends PagingAndSortingRepository<AchnsDo
    @Query("from AchnsDoctorRecordDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<AchnsDoctorRecordDO> findAchnsDoctorRecordDOByCreateTime(Date startTime, Date endTime);
    @Query("from AchnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    List<AchnsDoctorRecordDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from AchnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsOlineMedDao.java

@ -1,9 +1,24 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNsOlineMedDao extends PagingAndSortingRepository<BaseNsOnlineMedDO,String>, JpaSpecificationExecutor<BaseNsOnlineMedDO> {
    @Query("from BaseNsOnlineMedDO")
    List<BaseNsOnlineMedDO> findAll();
    @Query("from BaseNsOnlineMedDO t where t.createTime>=?1 and t.createTime<=?2")
    List<BaseNsOnlineMedDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from BaseNsOnlineMedDO t where t.createTime>=?1 and t.createTime<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 13 - 1
business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsOnlineAskDao.java

@ -1,10 +1,22 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNsOnlineAskDao extends PagingAndSortingRepository<BaseNsOnlineAskDO, String>, JpaSpecificationExecutor<BaseNsOnlineAskDO> {
    //待写查询
    @Query("from BaseNsOnlineAskDO")
    List<BaseNsOnlineAskDO> findAll();
    @Query("from BaseNsOnlineAskDO t where t.createTime>=?1 and t.createTime<=?2")
    List<BaseNsOnlineAskDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from BaseNsOnlineAskDO t where t.createTime>=?1 and t.createTime<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsPrescriptionDao.java

@ -1,9 +1,23 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNsPrescriptionDao extends PagingAndSortingRepository<BaseNsPrescriptionDO, String>, JpaSpecificationExecutor<BaseNsPrescriptionDO> {
    @Query("from BaseNsPrescriptionDO")
    List<BaseNsPrescriptionDO> findAll();
    @Query("from BaseNsPrescriptionDO t where t.createTime>=?1 and t.createTime<=?2")
    List<BaseNsPrescriptionDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from BaseNsPrescriptionDO t where t.createTime>=?1 and t.createTime<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/BaseNsPrescriptionDrugDao.java

@ -1,9 +1,25 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import feign.Param;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNsPrescriptionDrugDao extends PagingAndSortingRepository<BaseNsPrescriptionDrugDO, String>, JpaSpecificationExecutor<BaseNsPrescriptionDrugDO> {
    @Query("from BaseNsPrescriptionDrugDO")
    List<BaseNsPrescriptionDrugDO> findAll();
    @Query("from BaseNsPrescriptionDrugDO t where t.createTime>=?1 and t.createTime<=?2")
    List<BaseNsPrescriptionDrugDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from BaseNsPrescriptionDrugDO t where t.createTime>=?1 and t.createTime<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpAppointmentOnlineDao.java

@ -1,6 +1,8 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -13,4 +15,14 @@ import java.util.List;
public interface UpAppointmentOnlineDao extends PagingAndSortingRepository<UpAppointmentOnlineDO, String>, JpaSpecificationExecutor<UpAppointmentOnlineDO> {
    @Query("from UpAppointmentOnlineDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpAppointmentOnlineDO> findByCreateTime(Date startTime, Date endTime);
    @Query("from UpAppointmentOnlineDO")
    List<UpAppointmentOnlineDO> findAll();
    @Query("from UpAppointmentOnlineDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpAppointmentOnlineDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from UpAppointmentOnlineDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpMedicalOnlineDao.java

@ -12,4 +12,13 @@ import java.util.List;
public interface UpMedicalOnlineDao extends PagingAndSortingRepository<UpMedicalOnlineDO, String>, JpaSpecificationExecutor<UpMedicalOnlineDO> {
    @Query("from UpMedicalOnlineDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpMedicalOnlineDO> findByCreateTime(Date startTime, Date endTime);
    @Query("from UpMedicalOnlineDO")
    List<UpMedicalOnlineDO> findAll();
    @Query("from UpMedicalOnlineDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpMedicalOnlineDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from UpMedicalOnlineDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 16 - 3
business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsDoctorRecordDao.java

@ -1,8 +1,8 @@
package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.thirdUpload.*;
import feign.Param;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -13,4 +13,17 @@ import java.util.List;
public interface UpnsDoctorRecordDao extends PagingAndSortingRepository<UpnsDoctorRecordDO, String>, JpaSpecificationExecutor<UpnsDoctorRecordDO> {
    @Query("from UpnsDoctorRecordDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorRecordDO> findByCreateTime(Date startTime, Date endTime);
    @Query("from UpnsDoctorRecordDO d where d.id = ?1 AND d.is_del ='1'")
    UpnsDoctorRecordDO findById(String id);
    @Query("from UpnsDoctorRecordDO")
    List<UpnsDoctorRecordDO> findAll();
    @Query("from UpnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorRecordDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from UpnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsDoctorScoreDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpMedicalOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@ -13,4 +14,14 @@ import java.util.List;
public interface UpnsDoctorScoreDao extends PagingAndSortingRepository<UpnsDoctorScoreDO, String>, JpaSpecificationExecutor<UpnsDoctorScoreDO> {
    @Query("from UpnsDoctorScoreDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorScoreDO> findByCreateTime(Date startTime, Date endTime);
    @Query("from UpnsDoctorScoreDO")
    List<UpnsDoctorScoreDO> findAll();
    @Query("from UpnsDoctorScoreDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorScoreDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from UpnsDoctorScoreDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/UpnsOrganBaseDao.java

@ -3,6 +3,7 @@ package com.yihu.jw.thirdUpload;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -11,6 +12,14 @@ import java.util.Date;
import java.util.List;
public interface UpnsOrganBaseDao extends PagingAndSortingRepository<UpNsOrganBaseDO, String>, JpaSpecificationExecutor<UpNsOrganBaseDO> {
    @Query("from UpNsOrganBaseDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpNsOrganBaseDO> findByCreateTime(Date startTime, Date endTime);
    @Query("from UpNsOrganBaseDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpNsOrganBaseDO> finAllByDate(Date startTime, Date endTime);
    @Query("select count(1) from UpNsOrganBaseDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);
}

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/AchnsDoctorRecordService.java

@ -6,6 +6,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.dict.BaseFrequencyDictDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO;
import com.yihu.jw.thirdUpload.AchnsDoctorRecordDao;
import com.yihu.jw.util.date.DateUtil;
@ -58,4 +59,16 @@ public class AchnsDoctorRecordService extends BaseJpaService<AchnsDoctorRecordDO
        return achnsDoctorRecordDao.findAchnsDoctorRecordDOByCreateTime(startTime,endTime);
    }
    public List<AchnsDoctorRecordDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return achnsDoctorRecordDao.finAllByDate(startTime,endTime);}
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return achnsDoctorRecordDao.findCount(startTime, endTime);
    }
}

+ 20 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsOlineMedService.java

@ -1,13 +1,16 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.thirdUpload.BaseNsOlineMedDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
@ -36,4 +39,21 @@ public class BaseNsOlineMedService extends BaseJpaService<BaseNsOnlineMedDO, Bas
            baseNsOlineMedDao.delete(id);
        }
    }
    public List<BaseNsOnlineMedDO> findAll(){
        return baseNsOlineMedDao.findAll();
    }
    public List<BaseNsOnlineMedDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsOlineMedDao.finAllByDate(startTime,endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsOlineMedDao.findCount(startTime, endTime);
    }
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsOnlineAskService.java

@ -1,7 +1,9 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.thirdUpload.BaseNsOnlineAskDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -43,7 +45,21 @@ public class BaseNsOnlineAskService extends BaseJpaService<BaseNsOnlineAskDO, Ba
            //baseNsOnlineAskDO.setIs_del("0");
            //baseNsOnlineAskDO.save(baseNsOnlineAskDO);
        }
    }
    public List<BaseNsOnlineAskDO> findAll(){
        return baseNsOnlineAskDao.findAll();
    }
    public List<BaseNsOnlineAskDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsOnlineAskDao.finAllByDate(startTime,endTime);}
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsOnlineAskDao.findCount(startTime, endTime);
    }
}

+ 19 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsPrescriptionAService.java

@ -1,15 +1,18 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import com.yihu.jw.thirdUpload.BaseNsPrescriptionDao;
import com.yihu.jw.thirdUpload.BaseNsPrescriptionDrugDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
@ -43,4 +46,20 @@ public class BaseNsPrescriptionAService extends BaseJpaService<BaseNsPrescriptio
            baseNsPrescriptionDao.delete(id);
        }
    }
    public List<BaseNsPrescriptionDO> findAll(){
        return baseNsPrescriptionDao.findAll();
    }
    public List<BaseNsPrescriptionDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsPrescriptionDao.finAllByDate(startTime, endTime);}
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsPrescriptionDao.findCount(startTime, endTime);
    }
}

+ 19 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/BaseNsPrescriptionDrugService.java

@ -1,13 +1,16 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import com.yihu.jw.thirdUpload.BaseNsPrescriptionDrugDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
@ -38,4 +41,20 @@ public class BaseNsPrescriptionDrugService extends BaseJpaService<BaseNsPrescrip
            baseNsPrescriptionDrugDao.delete(id);
        }
    }
    public List<BaseNsPrescriptionDrugDO> findAll(){
        return baseNsPrescriptionDrugDao.findAll();
    }
    public List<BaseNsPrescriptionDrugDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsPrescriptionDrugDao.finAllByDate(startTime, endTime);}
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return baseNsPrescriptionDrugDao.findCount(startTime, endTime);
    }
}

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpAppointmentOnlineService.java

@ -1,6 +1,8 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpMedicalOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import com.yihu.jw.thirdUpload.UpAppointmentOnlineDao;
import com.yihu.jw.thirdUpload.UpnsDoctorRecordDao;
@ -54,4 +56,20 @@ public class UpAppointmentOnlineService extends BaseJpaService<UpAppointmentOnli
        return upAppointmentOnlineDao.findByCreateTime(startTime,endTime);
    }
    public List<UpAppointmentOnlineDO> findAll(){
        return upAppointmentOnlineDao.findAll();
    }
    public List<UpAppointmentOnlineDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upAppointmentOnlineDao.finAllByDate(startTime, endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upAppointmentOnlineDao.findCount(startTime, endTime);
    }
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpMedicalOnlineService.java

@ -54,4 +54,20 @@ public class UpMedicalOnlineService extends BaseJpaService<UpMedicalOnlineDO, Up
        return upMedicalOnlineDao.findByCreateTime(startTime,endTime);
    }
    public List<UpMedicalOnlineDO> findAll(){
        return upMedicalOnlineDao.findAll();
    }
    public List<UpMedicalOnlineDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upMedicalOnlineDao.finAllByDate(startTime, endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upMedicalOnlineDao.findCount(startTime, endTime);
    }
}

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsDoctorRecordService.java

@ -1,7 +1,9 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import com.yihu.jw.thirdUpload.UpnsDoctorRecordDao;
import com.yihu.jw.thirdUpload.UpnsOrganBaseDao;
import com.yihu.jw.util.date.DateUtil;
@ -54,4 +56,20 @@ public class UpnsDoctorRecordService extends BaseJpaService<UpnsDoctorRecordDO,
        return upnsDoctorRecordDao.findByCreateTime(startTime,endTime);
    }
    public List<UpnsDoctorRecordDO> findAll(){
        return upnsDoctorRecordDao.findAll();
    }
    public List<UpnsDoctorRecordDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsDoctorRecordDao.finAllByDate(startTime, endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsDoctorRecordDao.findCount(startTime, endTime);
    }
}

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsDoctorScoreService.java

@ -1,6 +1,8 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import com.yihu.jw.thirdUpload.AchnsDoctorRecordDao;
import com.yihu.jw.thirdUpload.UpnsDoctorScoreDao;
@ -54,4 +56,20 @@ public class UpnsDoctorScoreService extends BaseJpaService<UpnsDoctorScoreDO, Up
        return upnsDoctorScoreDao.findByCreateTime(startTime,endTime);
    }
    public List<UpnsDoctorScoreDO> findAll(){
        return upnsDoctorScoreDao.findAll();
    }
    public List<UpnsDoctorScoreDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsDoctorScoreDao.finAllByDate(startTime, endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsDoctorScoreDao.findCount(startTime, endTime);
    }
}

+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/thirdUpload/service/UpnsOrganBaseService.java

@ -1,7 +1,9 @@
package com.yihu.jw.thirdUpload.service;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorScoreDO;
import com.yihu.jw.thirdUpload.AchnsDoctorRecordDao;
import com.yihu.jw.thirdUpload.UpnsOrganBaseDao;
import com.yihu.jw.util.date.DateUtil;
@ -54,4 +56,16 @@ public class UpnsOrganBaseService extends BaseJpaService<UpNsOrganBaseDO, UpnsOr
        return upnsOrganBaseDao.findByCreateTime(startTime,endTime);
    }
    public List<UpNsOrganBaseDO> findAllByDate(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsOrganBaseDao.finAllByDate(startTime, endTime);
    }
    public String findCount(String startDate, String endDate){
        Date startTime= DateUtil.strToDate(startDate+" 00:00:00");
        Date endTime= DateUtil.strToDate(endDate+" 23:59:59");
        return upnsOrganBaseDao.findCount(startTime, endTime);
    }
}

+ 7 - 7
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -3763,7 +3763,7 @@ public class ImService {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else{}*/
			if("xm_ykyy_wx".equals(wxId)){
			/*if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
				}else {
@ -3772,7 +3772,7 @@ public class ImService {
			}else {
				sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
			}
			}*/
			sql =sql +" AND op.type in ('1','2') AND op.outpatient_type = 3 ";
			sql =sql +" ORDER BY op.create_time DESC";
@ -3827,7 +3827,7 @@ public class ImService {
			}else if("16".equals(type)){
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
				/*if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
@ -3836,11 +3836,11 @@ public class ImService {
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
				}*/
			}else if("12".equals(type)){
				//视频复诊
				sql =sql +"AND op.outpatient_type=2";
				if("xm_ykyy_wx".equals(wxId)){
				/*if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else  {
@ -3848,7 +3848,7 @@ public class ImService {
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
				}*/
			}else{}
			sql =sql +" ORDER BY op.create_time DESC";
@ -3936,7 +3936,7 @@ public class ImService {
	public void doctorReplyUpdateYktState(String consult,String doctor,String wxId){
		if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
			String sql ="SELECT * FROM im_internet_hospital.topics t where " +
			String sql ="SELECT * FROM topics t where " +
					"t.id='"+consult+"' and t.reply_user='"+doctor+"' and t.reply=1 and t.status IN(0,1) ";
			List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
			logger.info("sql======"+sql);

+ 127 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/equipment/BaseHospitalEquipmentDO.java

@ -0,0 +1,127 @@
package com.yihu.jw.entity.equipment;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wangzhinan on 2021/09/16.
 * 设备表
 */
@Entity
@Table(name = "base_hospital_equipment")
public class BaseHospitalEquipmentDO extends UuidIdentityEntityWithOperator {
    private String name;//设备名称
    private String code;//设备编码
    private String networkStatus;//设备状态(1在线、0离线)
    private String sellingStatus;//售卖状态(1、在售,2、闲置,3、故障)
    private String type;//设备分类code;
    private String typeName;//设备分类名称
    private String info;//设备信号强度
    private String hospital;//医院code
    private String hospitalName;//所属医院名称
    private Integer bindingStatus;//绑定状态(1、解绑、2、绑定)
    private Integer status;//设备上架状态(1、上架,2、下架)
    private String address;//分配地址
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getNetworkStatus() {
        return networkStatus;
    }
    public void setNetworkStatus(String networkStatus) {
        this.networkStatus = networkStatus;
    }
    public String getSellingStatus() {
        return sellingStatus;
    }
    public void setSellingStatus(String sellingStatus) {
        this.sellingStatus = sellingStatus;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    public String getInfo() {
        return info;
    }
    public void setInfo(String info) {
        this.info = info;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public Integer getBindingStatus() {
        return bindingStatus;
    }
    public void setBindingStatus(Integer bindingStatus) {
        this.bindingStatus = bindingStatus;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
}

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/equipment/WlyyUserAreaDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.entity.equipment;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by wangzhinan on 2021/09/16.
 * 用户所属区域
 */
@Entity
@Table(name = "wlyy_user_area")
public class WlyyUserAreaDO extends UuidIdentityEntityWithOperator {
    private String userId;//用户id
    private String city;//城市code
    private String cityName;//城市名称
    private String town;//区域code
    private String townName;//区域名称
    private String hospital;//医院或者社区code
    private String hospitalName;//医院或者社区名称
    private Integer del;//删除标识(0删除1正常)
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 52 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/equipment/WlyyUserEquipmentDO.java

@ -0,0 +1,52 @@
package com.yihu.jw.entity.equipment;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by wangzhinan on 2021/09/16.
 * 用户管理的设备
 */
@Entity
@Table(name = "wlyy_user_equipment")
public class WlyyUserEquipmentDO extends UuidIdentityEntityWithOperator {
    private String userId;//用户id
    private String equipmentId;//设备id
    private String equipmentName;//设备名称
    private Integer del;//删除标识(0删除1正常)
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public String getEquipmentId() {
        return equipmentId;
    }
    public void setEquipmentId(String equipmentId) {
        this.equipmentId = equipmentId;
    }
    public String getEquipmentName() {
        return equipmentName;
    }
    public void setEquipmentName(String equipmentName) {
        this.equipmentName = equipmentName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 6 - 14
common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsOnlineAskDO.java

@ -44,8 +44,8 @@ public class BaseNsOnlineAskDO extends UuidIdentityEntity {
    private String procFile;            //诊疗过程文件
    private String price;               //咨询服务价格
    private String fgReply;             //医师是否回复
    private String crtTime;             //数据上传时间
    private String createTime;          //生成时间
    private Date crtTime;             //数据上传时间
    private Date createTime;          //生成时间
    private String upload;              //上传时间
    @Column(name = "id_online_ask")
@ -309,22 +309,14 @@ public class BaseNsOnlineAskDO extends UuidIdentityEntity {
    }
    @Column(name = "crt_time")
    public String getCrtTime() {
        return crtTime;
    }
    public Date getCrtTime() {return crtTime;}
    public void setCrtTime(String crtTime) {
        this.crtTime = crtTime;
    }
    public void setCrtTime(Date crtTime) {this.crtTime = crtTime;}
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }
    public Date getCreateTime() {return createTime;}
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public void setCreateTime(Date createTime) {this.createTime = createTime;}
    @Column(name = "upload")
    public String getUpload() {

+ 7 - 14
common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsOnlineMedDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wsy on 2021/8/31.
@ -50,8 +51,8 @@ public class BaseNsOnlineMedDO extends UuidIdentityEntity {
    private String procFile;            //诊疗过程文件
    private String price;               //咨询服务价格
    private String fgReply;             //医师是否回复
    private String crtTime;             //数据上传时间
    private String createTime;          //生成时间
    private Date crtTime;             //数据上传时间
    private Date createTime;          //生成时间
    private String upload;               //上传时间
    @Column(name = "id_online_med")
@ -351,21 +352,13 @@ public class BaseNsOnlineMedDO extends UuidIdentityEntity {
        this.fgReply = fgReply;
    }
    @Column(name = "crt_time")
    public String getCrtTime() {
        return crtTime;
    }
    public void setCrtTime(Date crtTime) {this.crtTime = crtTime;}
    public void setCrtTime(String crtTime) {
        this.crtTime = crtTime;
    }
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }
    public Date getCreateTime() {return createTime;}
    public void setCreateTime(Date createTime) {this.createTime = createTime;}
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    @Column(name = "upload")
    public String getUpload() {
        return upload;

+ 10 - 14
common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsPrescriptionDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wsy on 2021/9/1.
@ -57,8 +58,8 @@ public class BaseNsPrescriptionDO extends UuidIdentityEntity {
    private String longMedicalFlag;     //病情稳定需长期服药标志
    private String presEffecDays;       //处方有效期(单位天)
    private String totalPrice;          //总金额
    private String uploadTime;          //上传时间
    private String createTime;          //生成时间
    private Date uploadTime;          //上传时间
    private Date createTime;          //生成时间
    private String upload;              //上传时间
    @Column(name = "id_prescription")
@ -405,22 +406,17 @@ public class BaseNsPrescriptionDO extends UuidIdentityEntity {
    public void setTotalPrice(String totalPrice) {
        this.totalPrice = totalPrice;
    }
    @Column(name = "upload_time")
    public String getUploadTime() {
        return uploadTime;
    }
    public Date getUploadTime() {return uploadTime;}
    public void setUploadTime(Date uploadTime) {this.uploadTime = uploadTime;}
    public void setUploadTime(String uploadTime) {
        this.uploadTime = uploadTime;
    }
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }
    public Date getCreateTime() {return createTime;}
    public void setCreateTime(Date createTime) {this.createTime = createTime;}
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    @Column(name = "upload")
    public String getUpload() {
        return upload;

+ 4 - 7
common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/BaseNsPrescriptionDrugDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wsy on 2021/9/1.
@ -36,7 +37,7 @@ public class BaseNsPrescriptionDrugDO extends UuidIdentityEntity {
    private String comments;                //嘱托
    private String antiComments;            //抗菌药说明
    private String decMethName;             //中药煎煮法名称
    private String createTime;              //生成时间
    private Date createTime;              //生成时间
    private String upload;                  //上传时间
@ -246,13 +247,9 @@ public class BaseNsPrescriptionDrugDO extends UuidIdentityEntity {
    }
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }
    public Date getCreateTime() {return createTime;}
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public void setCreateTime(Date createTime) {this.createTime = createTime;}
    @Column(name = "upload")
    public String getUpload() {

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/thirdUpload/UpAppointmentOnlineDO.java

@ -199,6 +199,7 @@ public class UpAppointmentOnlineDO extends UuidIdentityEntity {
    public void setPt_tel(String pt_tel) {
        this.pt_tel = pt_tel;
    }
    @Column(name = "crt_date")
    public String getCrt_date() {
        return crt_date;

+ 22 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -169,6 +169,21 @@ public class BaseRequestMapping {
        public static final String orgChoiceInfo = "/orgChoiceInfo";
    }
    /**
     * 用户设备管理
     */
    public static class UserEquipment extends Basic {
        public static final String PREFIX  = "/userEquipment";
    }
    /**
     * 设备管理
     */
    public static class Equipment extends Basic {
        public static final String PREFIX  = "/equipment";
        public static final String selectByHospitalOrTown  = "/selectByHospitalOrTown";
    }
    /**
     * 用户角色
     */
@ -689,6 +704,13 @@ public class BaseRequestMapping {
        public static final String PREFIX  = "/baseTown";
    }
    /**
     * 区县字典
     */
    public static class BaseHospital extends Basic {
        public static final String PREFIX  = "/BaseHospital";
    }
    /**
     * 健康问题字典

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -552,6 +552,7 @@ public class BaseHospitalRequestMapping {
        public static final String findPatNoByPatient = "/findPatNoByPatient";
        public static final String appletSign= "/appletSign";
        public static final String yxToken20= "/yxToken2.0";
        public static final String doorServiceTest= "/doorServiceTest";
        public static final String saveNationalDrug = "/saveNationalDrug";//保存药品字典
        public static final String getNationalDrugList = "/getNationalDrugList";//获取药品字典

+ 3 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -89,6 +89,9 @@ zuul:
    svr-cloud-care:
      path: /cloudCare/**
      serviceId: svr-cloud-care
    svr-cloud-medicine:
      path: /cloudMedicine/**
      serviceId: svr-cloud-care
    svr-rehabilitation:
      path: /rehabilitation/**
      serviceId: svr-rehabilitation

+ 0 - 37
svr/svr-base/src/main/java/com/yihu/jw/base/aop/ClientSearchRequestAspect.java

@ -1,37 +0,0 @@
package com.yihu.jw.base.aop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.lang.reflect.Method;
/**
 * Created by wsy on 2021/9/7.
 */
@Order(5)
@Aspect
@Component
public class ClientSearchRequestAspect {
    private static final String REQ_LIMIT = "req_limit";
    public static int RESPONSE_STATUS_CODE = 1000;
    @Around("execution(* com.yihu.jw.base.endpoint.searchClient.ClientSearchEndpoint.saveBaseSearchNoveltyRepeat(..))"
            +"&& @annotation(com.yihu.jw.base.aop.ClientSearchRequestLimit)")
    public Object method(ProceedingJoinPoint pjp) throws Throwable{
        MethodSignature signature = (MethodSignature) pjp.getSignature();
        Method method = signature.getMethod();//获取被拦截的方法
        ClientSearchRequestLimit limit = method.getAnnotation(ClientSearchRequestLimit.class);
        if ( limit == null ){
            return pjp.proceed();
        }
        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        return requestAttributes;
    }
}

+ 0 - 18
svr/svr-base/src/main/java/com/yihu/jw/base/aop/ClientSearchRequestLimit.java

@ -1,18 +0,0 @@
package com.yihu.jw.base.aop;
import java.lang.annotation.*;
/**
 * Created by wsy on 2021/9/7.
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ClientSearchRequestLimit {
    int time() default 60;
    int count() default 2;
    int waits() default 300;
}

+ 9 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/BaseHospitalEquipmentDao.java

@ -0,0 +1,9 @@
package com.yihu.jw.base.dao.equipment;
import com.yihu.jw.entity.equipment.BaseHospitalEquipmentDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseHospitalEquipmentDao extends PagingAndSortingRepository<BaseHospitalEquipmentDO, String>, JpaSpecificationExecutor<BaseHospitalEquipmentDO> {
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/WlyyUserAreaDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.dao.equipment;
import com.yihu.jw.entity.base.doctor.BaseModuleRoleDO;
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
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 java.util.List;
public interface WlyyUserAreaDao extends PagingAndSortingRepository<WlyyUserAreaDO, String>, JpaSpecificationExecutor<WlyyUserAreaDO> {
    @Query("select id from WlyyUserAreaDO where userId = ?1")
    List<WlyyUserAreaDO> findAllByUserId(String userId);
    @Modifying
    @Query("delete from WlyyUserAreaDO p where p.userId=?1 ")
    void deleteByUserId(String userId);
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/equipment/WlyyUserEquipmentDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.dao.equipment;
import com.yihu.jw.entity.equipment.WlyyUserEquipmentDO;
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 java.util.List;
public interface WlyyUserEquipmentDao extends PagingAndSortingRepository<WlyyUserEquipmentDO, String>, JpaSpecificationExecutor<WlyyUserEquipmentDO> {
    @Modifying
    @Query("delete from WlyyUserEquipmentDO p where p.userId=?1 ")
    void deleteByUserId(String userId);
}

+ 55 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/area/BaseEquipmentEndpoint.java

@ -0,0 +1,55 @@
package com.yihu.jw.base.endpoint.area;
import com.yihu.jw.hospital.team.service.WlyyAdminTeamService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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;
/**
*
* 社区/医院字典控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.BaseHospital.PREFIX)
@Api(value = "社区/医院字典控制器", description = "社区/医院字典接口", tags = {"wlyy基础服务 - 社区/医院字典接口"})
public class BaseEquipmentEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private WlyyAdminTeamService wlyyAdminTeamService;
    @ApiOperation("查询社区")
    @GetMapping("/findOrgList")
    public MixEnvelop findOrgList(@ApiParam(name = "code", value = "区code", required = false)
                                  @RequestParam(value = "code", required = false)String code,
                                  @ApiParam(name = "name", value = "社区名称", required = false)
                                  @RequestParam(value = "name", required = false)String name,
                                  @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                                  @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                                  @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                  @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            return wlyyAdminTeamService.findHospitalByTown(code,name,page,pageSize);
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedMixEnvelopException(e);
        }
    }
 }

+ 58 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/area/BaseHospitalEndpoint.java

@ -0,0 +1,58 @@
package com.yihu.jw.base.endpoint.area;
import com.yihu.jw.area.service.BaseTownService;
import com.yihu.jw.entity.base.area.BaseTownDO;
import com.yihu.jw.hospital.team.service.WlyyAdminTeamService;
import com.yihu.jw.restmodel.base.area.BaseTownVO;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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;
/**
*
* 社区/医院字典控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.BaseHospital.PREFIX)
@Api(value = "社区/医院字典控制器", description = "社区/医院字典接口", tags = {"wlyy基础服务 - 社区/医院字典接口"})
public class BaseHospitalEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private WlyyAdminTeamService wlyyAdminTeamService;
    @ApiOperation("查询社区")
    @GetMapping("/findOrgList")
    public MixEnvelop findOrgList(@ApiParam(name = "code", value = "区code", required = false)
                                  @RequestParam(value = "code", required = false)String code,
                                  @ApiParam(name = "name", value = "社区名称", required = false)
                                  @RequestParam(value = "name", required = false)String name,
                                  @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                                  @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                                  @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                  @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            return wlyyAdminTeamService.findHospitalByTown(code,name,page,pageSize);
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedMixEnvelopException(e);
        }
    }
 }

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/FileUploadController.java

@ -193,7 +193,9 @@ public class FileUploadController extends EnvelopRestEndpoint {
                                                  @ApiParam(value = "chunkTotal", required = false)
                                                  @RequestParam(value = "chunkTotal", required = false) Integer chunkTotal,
                                                  @ApiParam(value = "objectType", required = false)
                                                  @RequestParam(value = "objectType", required = false) Integer objectType
                                                  @RequestParam(value = "objectType", required = false) Integer objectType,
                                                  @ApiParam(value = "chunkSize", required = false)
                                                      @RequestParam(value = "chunkSize", required = false) Integer  chunkSize
    ) throws Exception{
        UploadVO uploadVO = new UploadVO();
        MutilFileInfo files = new MutilFileInfo();
@ -204,7 +206,7 @@ public class FileUploadController extends EnvelopRestEndpoint {
        files.setSize(file.getSize());
        logger.info("file size"+file.getSize());
        files.setTaskId(taskId);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files,chunkSize);
        logger.info("taskid"+taskid);
        if ("unCompelete".equalsIgnoreCase(taskid)){
            System.out.println("第"+files.getChunk());

+ 49 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/equipment/EquipmentEndpoint.java

@ -0,0 +1,49 @@
package com.yihu.jw.base.endpoint.equipment;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.equipment.BaseHospitalEquipmentService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * Created by wangzhinan on 2021/09/16.
 * 设备管理
 */
@RestController
@RequestMapping(value = BaseRequestMapping.Equipment.PREFIX)
@Api(value = "设备管理", description = "设备管理接口", tags = {"设备管理接口"})
public class EquipmentEndpoint extends EnvelopRestEndpoint {
    @Autowired
    public BaseHospitalEquipmentService hospitalEquipmentService;
    @PostMapping(value = BaseRequestMapping.Equipment.selectByHospitalOrTown)
    @ApiOperation(value = "根据医院code/区域code查找设备")
    public ListEnvelop selectByHospitalOrTown (
            @ApiParam(name = "town", value = "区code", required = false)
            @RequestParam(value = "town", required = false) String town,
            @ApiParam(name = "hospital", value = "医院code或者区域code", required = false)
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "name", value = "设备名称", required = false)
            @RequestParam(value = "name", required = false) String name) throws Exception {
        List<Map<String,Object>> mapList =  hospitalEquipmentService.selectByHospitalOrTown(town,hospital,name);
        ListEnvelop listEnvelop = new ListEnvelop();
        listEnvelop.setDetailModelList(mapList);
        return listEnvelop;
    }
}

+ 34 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/equipment/UserEquipmentEndpoint.java

@ -0,0 +1,34 @@
package com.yihu.jw.base.endpoint.equipment;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.user.UserService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.base.user.UserVO;
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.rm.base.BaseRequestMapping;
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;
import java.util.Map;
/**
 * Created by wangzhinan on 2021/09/16.
 * 设备管理
 */
@RestController
@RequestMapping(value = BaseRequestMapping.UserEquipment.PREFIX)
@Api(value = "用户设备管理", description = "用户设备管理接口", tags = {"用户设备管理接口"})
public class UserEquipmentEndpoint extends EnvelopRestEndpoint {
}

+ 64 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/BaseHospitalEquipmentService.java

@ -0,0 +1,64 @@
package com.yihu.jw.base.service.equipment;
import com.yihu.jw.base.dao.equipment.BaseHospitalEquipmentDao;
import com.yihu.jw.base.dao.equipment.WlyyUserAreaDao;
import com.yihu.jw.entity.equipment.BaseHospitalEquipmentDO;
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by wangzhinan on 2021/09/16.
 * 设备管理
 */
@Service
public class BaseHospitalEquipmentService extends BaseJpaService<BaseHospitalEquipmentDO, BaseHospitalEquipmentDao> {
    @Autowired
    private BaseHospitalEquipmentDao baseHospitalEquipmentDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<Map<String,Object>> selectByHospitalOrTown(String town,String hospital,String name){
        String sql ="SELECT\n" +
                "\tid AS \"id\",\n" +
                "\tCODE AS \"code\",\n" +
                "\tNAME AS \"name\",\n" +
                "\tnetwork_status AS \"networkStatus\",\n" +
                "\tselling_status AS \"sellingStatus\",\n" +
                "\ttype as \"type\",\n" +
                "\ttype_name as \"typeName\",\n" +
                "\tinfo as \"info\",\n" +
                "\thospital as \"hospital\",\n" +
                "\thospital_name as \"hospitalName\",\n" +
                "\tbinding_status as \"bindingStatus\",\n" +
                "\tstatus as \"status\",\n" +
                "\taddress as \"address\"\n" +
                "FROM\n" +
                "\tbase_hospital_equipment\n" +
                "WHERE\n" +
                "\t1 = 1 ";
        if (town!=null&&town!=""){
            sql +=" and hospital IN(select * from dm_hospital dm where dm.town ='"+town+"') ";
        }
        if (hospital!=null&&hospital!=""){
            sql +=" and hospital ='"+hospital+"' ";
        }
        if (name!=null&&name!=""){
            sql +=" and name like'%"+hospital+"%' ";
        }
        List<Map<String,Object>> map = jdbcTemplate.queryForList(sql);
        return map;
    }
}

+ 23 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/WlyyUserAreaService.java

@ -0,0 +1,23 @@
package com.yihu.jw.base.service.equipment;
import com.yihu.jw.base.dao.equipment.WlyyUserAreaDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.*;
/**
 * Created by wangzhinan on 2021/09/16.
 * 用户所属区域
 */
@Service
public class WlyyUserAreaService extends BaseJpaService<WlyyUserAreaDO, WlyyUserAreaDao> {
}

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/equipment/WlyyUserEquipmentService.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.service.equipment;
import com.yihu.jw.base.dao.equipment.WlyyUserEquipmentDao;
import com.yihu.jw.entity.equipment.WlyyUserEquipmentDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created by wangzhinan on 2021/09/16.
 * 用户管理的设备
 */
@Service
public class WlyyUserEquipmentService extends BaseJpaService<WlyyUserEquipmentDO, WlyyUserEquipmentDao> {
}

+ 48 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.equipment.WlyyUserAreaDao;
import com.yihu.jw.base.dao.equipment.WlyyUserEquipmentDao;
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasDao;
@ -15,6 +17,8 @@ import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
import com.yihu.jw.entity.equipment.WlyyUserEquipmentDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
@ -68,7 +72,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    private OrgTreeService orgTreeService;
    @Autowired
    private BaseOrgSaasService baseOrgSaasService;
    private WlyyUserAreaDao userAreaDao;
    @Autowired
    private WlyyUserEquipmentDao userEquipmentDao;
    
    @Autowired
    private StringRedisTemplate redisTemplate;
@ -320,6 +326,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject user = jsonObject.getJSONObject("user");
        JSONArray org = jsonObject.getJSONArray("org");
        JSONArray area = jsonObject.getJSONArray("area");
        JSONArray equipment = jsonObject.getJSONArray("equipment");
        //归属租户为默认租户,表示用户为超级管理员,不需要机构
        if (null == user || CollectionUtils.isEmpty(org) && !user.getString("saasId").equalsIgnoreCase(defaultSaasId)) {
            result.put("msg", "请点击机构管理选择所在机构");
@ -354,6 +363,44 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
            }
            baseOrgUserService.batchInsert(orgList);
        }
        //area:[{"city":"","cityName":"","town":"","townName":"","hospital":"","hospitalName":""}]
        //用户所属区域添加
        if (area!=null&&area.size()!=0){
            userAreaDao.deleteByUserId(userDO.getId());
            for (int i=0;i<area.size();i++){
                JSONObject object = area.getJSONObject(i);
                WlyyUserAreaDO userAreaDO = new WlyyUserAreaDO();
                userAreaDO.setUserId(userDO.getId());
                userAreaDO.setCity(object.getString("city"));
                userAreaDO.setCityName(object.getString("cityName"));
                userAreaDO.setTown(object.getString("town"));
                userAreaDO.setTownName(object.getString("townName"));
                if (!StringUtils.isEmpty(object.getString("hospital"))){
                    userAreaDO.setHospital(object.getString("hospital"));
                    userAreaDO.setHospitalName(object.getString("hospitalName"));
                }
                userAreaDO.setCreateTime(new Date());
                userAreaDO.setUpdateTime(new Date());
                userAreaDO.setDel(1);
                userAreaDao.save(userAreaDO);
            }
        }
        //用户所管设备添加
        //equipment:[{"equipmentId":"","equipmentName":""}]
        if (equipment!=null&&equipment.size()!=0){
            userEquipmentDao.deleteByUserId(userDO.getId());
            for (int i=0;i<equipment.size();i++){
                JSONObject object = equipment.getJSONObject(i);
                WlyyUserEquipmentDO userEquipmentDO = new WlyyUserEquipmentDO();
                userEquipmentDO.setDel(1);
                userEquipmentDO.setUserId(userDO.getId());
                userEquipmentDO.setEquipmentId(object.getString("equipmentId"));
                userEquipmentDO.setEquipmentName(object.getString("equipmentName"));
                userEquipmentDO.setCreateTime(new Date());
                userEquipmentDO.setUpdateTime(new Date());
                userEquipmentDao.save(userEquipmentDO);
            }
        }
        JSONObject returnMsg = new JSONObject();
        returnMsg.put("username",userDO.getUsername());
        returnMsg.put("password",userDO.getIdcard().substring(userDO.getIdcard().length()-6,userDO.getIdcard().length()));

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

@ -88,7 +88,7 @@ public class PatientDeviceController extends BaseController {
    public String envMessage(@ApiParam(name = "patientId", value = "居民id", defaultValue = "1")
                                    @RequestParam(value = "patientId", required = true) String patientId){
        try {
            JSONObject json = patientDeviceService.envMessage(patientId);
            com.alibaba.fastjson.JSONObject json = patientDeviceService.envMessage(patientId);
            return write(200,"获取成功","data",json);
        } catch (Exception ex) {
            return errorResult(ex);

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

@ -43,6 +43,21 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DoctorServicePermissionsService doctorServicePermissionsService;
    @GetMapping(value = "updOnline")
    @ApiOperation(value = "更新在线状态")
    public Envelop updOnline(@ApiParam(name = "doctorId", value = "医生id", required = true)
                                 @RequestParam(value = "doctorId",required = true) String doctorId,
                             @ApiParam(name = "online", value = "在线状态 1在线 0离线")
                             @RequestParam(value = "online", required = true)String online){
        try{
            doctorService.updOnline(doctorId,online);
            return success("成功");
        }catch (Exception e){
            return failedException2(e);
        }
    }
    @GetMapping(value = "doctorPage")
    @ApiOperation(value = "获取医生记录分页")
    public PageEnvelop<List<Map<String,Object>>> doctorPage (

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/file_upload/FileUploadEndpoint.java

@ -159,7 +159,7 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
        files.setObjectType(objectType);
        files.setSize(file.getSize());
        files.setTaskId(taskId);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files,null);
        if ("unCompelete".equalsIgnoreCase(taskid)){
            System.out.println("第"+files.getChunk());
            return success("未传完",uploadVO);

+ 14 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -202,6 +202,20 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = "updOnline")
    @ApiOperation(value = "更新在线状态")
    public Envelop updOnline(@ApiParam(name = "patientId", value = "居民id")
                                 @RequestParam(value = "patientId", required = true)String patientId,
                             @ApiParam(name = "online", value = "在线状态 1在线 0离线")
                             @RequestParam(value = "online", required = true)String online){
        try{
            patientService.updOnline(patientId,online);
            return success("成功");
        }catch (Exception e){
            return failedException2(e);
        }
    }
    @PostMapping(value = "updPatientLabel")

+ 14 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -18,6 +18,8 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/***
 * @ClassName: DetectionPlatformEndpoint
 * @Description: 社区云照护平台--物联网健康监测展示平台 v1.0.0
@ -35,6 +37,18 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientDeviceService patientDeviceService;
    @ApiOperation("环境信息")
    @RequestMapping(value = "envMessage", method = RequestMethod.GET)
    public ObjEnvelop envMessage(@ApiParam(name = "patientId", value = "居民id", defaultValue = "1")
                             @RequestParam(value = "patientId", required = true) String patientId){
        try {
            return success(patientDeviceService.envMessage(patientId));
        } catch (Exception ex) {
            return failedObjEnvelopException(ex);
        }
    }
    /**************************v1.1.0新增 设备异常动态************************************/
    @GetMapping(value = "getHealthMonitoringListNew")
    @ApiOperation(value = "体征监测/安防监护")

+ 5 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -133,8 +133,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     * 获取烟雾 燃气浓度
     * @param patient
     */
    public JSONObject concentrationMessage(String patient){
        JSONObject result = new JSONObject();
    public com.alibaba.fastjson.JSONObject concentrationMessage(String patient){
        com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
        String sql = "SELECT CONCAT(r.value,r.unit) value from wlyy_patient_device pd,base_device_health_index r " +
                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' ";
@ -162,13 +162,14 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     * 环境信息
     * @return
     */
    public JSONObject envMessage(String patient){
        JSONObject jsonObject = new JSONObject();
    public com.alibaba.fastjson.JSONObject envMessage(String patient){
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("concentration",concentrationMessage(patient));
        jsonObject.put("weather",emergencyAssistanceService.getBaiduWeather());
        return jsonObject;
    }
    /**
     * 燃气浓度
     * @param patient

+ 12 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -10,6 +10,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.im.service.ImService;
@ -63,6 +64,17 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    @Autowired
    private BirthdayWishesService birthdayWishesService;
    /**
     * 更新在线状态
     * @param doctorId
     * @param online
     */
    public void updOnline(String doctorId,String online){
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
        doctorDO.setOnline(online);
        baseDoctorDao.save(doctorDO);
    }
    /**
     * 获取医生简单详情
     * @return

+ 15 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -127,6 +127,17 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return res;
    }
    /**
     * 更新在线状态
     * @param patientId
     * @param online
     */
    public void updOnline(String patientId,String online){
        BasePatientDO patientDO = patientDao.findById(patientId);
        patientDO.setOnline(online);
        patientDao.save(patientDO);
    }
    /**
     * 居民id
     * @param agent 代理人id
@ -522,7 +533,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     */
    public List<Map<String,Object>> findChild(String name,String residentialArea,String limit,String filter1){
        String sql = "SELECT id,name,photo,idcard,CAST(IFNULL(birthday,'') AS char ) birthday,residential_area residentialArea" +
                ",sex,IFNULL(on_line,0) online  from base_patient WHERE archive_type = 2 and del = '1' ";
                ",sex,if(openid is null,0,1) online  from base_patient WHERE archive_type = 2 and del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
        }
@ -570,7 +581,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     */
    public List<Map<String,Object>> findOld(String name,String residentialArea,String limit,JSONObject json,String filter1){
        String sql = "SELECT a.id,a.name,a.photo,a.idcard,CAST(IFNULL(a.birthday,'') AS char ) birthday,a.residential_area residentialArea,a.sex " +
                ", GROUP_CONCAT(DISTINCT d.category_code) deviceFlag,IFNULL(on_line,0) online,IFNULL(sign_status,0) signStatus from base_patient a " +
                ", GROUP_CONCAT(DISTINCT d.category_code) deviceFlag,case 1 WHEN openid is not null then 1 " +
                " WHEN a.on_line = '1' then 1 ELSE 0 end as online,IFNULL(sign_status,0) signStatus from base_patient a " +
                " LEFT JOIN wlyy_patient_device d on d.`user`=a.id  WHERE a.archive_type = 1 and a.del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " and name like '%"+name+"%' ";
@ -624,7 +636,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * @return
     */
    public List<Map<String,Object>> findHelper(String name,String limit,String fileter){
        String sql = "SELECT a.id,a.name,a.photo,a.sex,IFNULL(a.on_line,0) online from base_doctor a,base_doctor_hospital h" +
        String sql = "SELECT a.id,a.name,a.photo,a.sex,if(openid is null,0,1) online from base_doctor a,base_doctor_hospital h" +
                "  WHERE a.id=h.doctor_code and a.doctor_level = 2 and a.del = '1' and h.del = '1' ";
        if(!StringUtil.isBlank(name)){
            sql+= " a.and name like '%"+name+"%' ";

+ 5 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java

@ -88,8 +88,12 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findByPatient(patient,assessmentTime);
        if(recordDO!=null){
            recordDO.setLevelConclusionName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLevelConclusion())));
            recordDO.setLivingAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLivingAbility())));
            recordDO.setCognitiveAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getCognitiveAbility())));
            recordDO.setSocialAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getSocialAbility())));
            recordDO.setComprehensiveAbilityName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getComprehensiveAbility())));
        }
         return recordDO;
        return recordDO;
    }
    /**

+ 12 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -8,9 +8,11 @@ import com.yihu.jw.care.service.device.PatientHealthIndexService;
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
import com.yihu.jw.care.service.lifeCare.LifeCareOrderService;
import com.yihu.jw.care.service.security.SecurityMonitoringOrderService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.care.service.sign.ServicePackageService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
@ -51,6 +53,8 @@ public class PatientInfoPlatFormService {
    private PatientDoorCoachOrderService patientDoorCoachOrderService;
    @Autowired
    private PatientHealthIndexService healthIndexService;
    @Autowired
    private CapacityAssessmentRecordService capacityAssessmentRecordService;
    /**
@ -95,6 +99,14 @@ public class PatientInfoPlatFormService {
                result.put("entranceOrgList",getEntranceOrgList(patient));//入园机构列表(报名且录取机构)
                result.put("MonitoringInfo",getMonitoringInfo(patient)); //新生儿入院信息
            }
            //能力评估
            try{
                CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patient);
                result.put("capAssRecordDO",recordDO);
            }catch (Exception e){
                e.printStackTrace();
            }
            return result;
        }
        return null;

+ 359 - 0
svr/svr-cloud-medicine/pom.xml

@ -0,0 +1,359 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>wlyy-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-cloud-medicine</artifactId>
    <packaging>jar</packaging>
    <version>${parent.version}</version>
    <dependencies>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.ylz.loginsdk</groupId>-->
            <!--<artifactId>ehcsdk</artifactId>-->
            <!--<version>1.0</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.ylz.dmrh</groupId>
            <artifactId>ehcsdk-java-sdk-base</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>wxpay-sdk</artifactId>
            <version>3.0.9</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-web</artifactId>
        </dependency>
        <!-- 文件服务器 -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <!-- <scope>runtime</scope> -->
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu</groupId>-->
            <!--<artifactId>elasticsearch-starter</artifactId>-->
            <!--<version>2.0.0</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>
            <version>1.3.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>mailapi</artifactId>
                    <groupId>javax.mail</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- 发送邮件 -->
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <!--   poi xml导入导出工具 end -->
        <!--基础业务组件-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
            <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu.jw</groupId>-->
            <!--<artifactId>sms-service</artifactId>-->
            <!--<version>2.0.0</version>-->
            <!--<scope>compile</scope>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <version>1.3.2</version>
        </dependency>
        <!--缩略图-->
        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>0.4.8</version>
        </dependency>
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>im-service</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>sms-service</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>es-service</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!--oracle驱动-->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>svr-internet-hospital</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- 生成的jar中,不要包含pom.xml和pom.properties这两个文件 -->
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <!-- 是否要把第三方jar加入到类构建路径 -->
                            <addClasspath>true</addClasspath>
                            <!-- 外部依赖jar包的最终位置 -->
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.yihu.SvrInternetHospitalApplication</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <!--拷贝依赖到jar外面的lib目录-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-lib</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- 依赖包输出目录,将来不打进jar包里 -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--指定配置文件,将resources打成外部resource-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
                        <manifestEntries>
                            <Class-Path>resources/</Class-Path>
                        </manifestEntries>
                    </archive>
                    <!-- 打包时忽略的文件(也就是不打进jar包里的文件) -->
                    <excludes>
                        <exclude>**/*.yml</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!-- 拷贝资源文件 外面的resource目录-->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <!-- 资源文件输出目录 -->
                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

+ 4 - 0
svr/svr-cloud-medicine/readme.MD

@ -0,0 +1,4 @@
云药柜微服务
    每个模块有自己独立的文件夹,这样做的好处是以后如果哪个模块需要独立成微服务,代码直接剪切到新的微服务即可。
    每个模块下面有独立的Endpoint,service,model和dao
  

+ 24 - 0
svr/svr-cloud-medicine/src/main/java/com/yihu/SvrCloudMedicineApplication.java

@ -0,0 +1,24 @@
package com.yihu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
/**
 * Created by Trick on 2019/5/13.
 */
@SpringBootApplication
@EnableJpaAuditing
public class SvrCloudMedicineApplication extends SpringBootServletInitializer {
    public static void main(String[] args)  {
        SpringApplication.run(SvrCloudMedicineApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SvrCloudMedicineApplication.class);
    }
}

+ 1214 - 0
svr/svr-cloud-medicine/src/main/resources/application.yml

@ -0,0 +1,1214 @@
#通用的配置不用区分环境变量
server:
  port: ${server.svr-internet-hospital-port}
spring:
  aop:
    proxy-target-class: true
  datasource:
    max-active: 200
    max-idle: 200 #最大空闲连接
    min-idle: 10 #最小空闲连接
    validation-query-timeout: 20
    log-validation-errors: true
    validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
    validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    idle-timeout: 20000
    connection-test-query: SELECT 1
    num-tests-per-eviction-run: 200 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  http:
    multipart:
      max-file-size: 30MB
      max-request-size: 100MB
#      location: D:/work/soft_dev/IdeaWorkSpace/wlyy2.0/svr/svr-patient/temp_file/
#      resolve-lazily: true
  redis:
    database: 0 # Database index used by the connection factory.
    password: # Login password of the redis server.
    timeout: 120000 # 连接超时时间(毫秒) 60秒
    pool:
      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
      max-wait: -1  # 连接池最大阻塞等待时间(使用负值表示没有限制)
      max-idle: 20  # 连接池中的最大空闲连接
      min-idle: 5  # 连接池中的最小空闲连接
  mail:
    default-encoding: UTF-8
#端口
    port: 25
#协议
    protocol: smtp
    properties.mail.smtp.auth: true
    properties.mail.smtp.starttls.enable: true
    properties.mail.smtp.starttls.required: true
    host: smtp.163.com
#发送者的邮箱密码
    password: xmijk181016jkzl
#发送者的邮箱账号
    username: i_jiankang@163.com
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
fast-dfs:
  connect-timeout: 2 #链接超时时间
  network-timeout: 30
  charset: ISO8859-1 #编码
  http:
    tracker-http-port: 80
    anti-steal-token: no
    secret-key: FastDFS1234567890
  pool: #连接池大小
    init-size: 5
    max-size: 20
    wait-time: 500
configDefault: # 默认配置
  saasId: xmjkzl_saasId
##拦截器开关
interceptor:
  accesstoken:
    status: 1 ###  1开启 0 关闭
    time: 2 ##对外接的accesstoken生命周期 2小时
---
spring:
  profiles: jwdev
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.104/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
# 短信发送地址
jw:
  smsUrl: http://svr-base:10020/sms_gateway/send
myFamily:
  qrCodeFailurTime: 2
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.112:9200
  tHost: 172.26.0.112:9300
  clusterName: jkzl
  securityUser: elastic:elastic
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
qywx:
  url: 2
  id: 2
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: jwtest
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.104/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 1
express:
  sf_url: http://mrds-admin-ci.sit.sf-express.com:45478
  sf_code: HD000001
  sf_check_word: AAAABBBBCCCCDDDD
---
spring:
  profiles: jwprod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.16.1.42:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: im
    password: 2oEq3Kf7
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 192.0.33.26 # Redis server host.
    port: 6390 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 192.0.33.26:22122 #服务器地址
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage # 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2 # mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true #支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.16.1.42:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://192.0.33.26:9200
  tHost: 192.0.33.26:9300
  clusterName: jkzl
  user: lion
  password: jkzlehr
FileTempPath: # 上传文件临时路径配置
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
qywx:
  url: https://hlwyy.xmzsh.com/hlwyy
  id: zsyy
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: jwOracleTest
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@172.26.0.141:1521:helowin
    username: normal
    password: normal
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
#    username: root
#    password: 123456
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.55:9200
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: elastic:changeme
  user: lion
  password: jkzlehr
#文件服务器上传配置 1本地,3.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 1
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000091
  sf_check_word: SFAHKAOFAAITyjt7890
---
spring:
  profiles: jwOracleProd
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@10.10.10.16:1521/rac
    username: HLWYY
    password: Xmykzxhlwyy963
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 192.168.33.198 # Redis server host.
    port: 6380 # Redis server port.
fastDFS:
  fastdfs_file_url: http://192.168.33.198:8888/
fast-dfs:
  tracker-server: 192.168.33.198:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://192.168.33.198:9200
  tHost: 192.168.33.198:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 1
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000091
  sf_check_word: SFAHKAOFAAITyjt7890
---
##==心脏中心 ===============================================================================
spring:
  profiles: xzprod_in
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://192.168.103.155:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: jkzl
    password: jkzl@2020
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 192.168.103.153:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://192.168.103.153:9300
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 192.168.103.158 # Redis server host.
    port: 6380 # Redis server port.
    password: q4YaQemf
fastDFS:
  fastdfs_file_url: http://192.168.103.159:8888/
fast-dfs:
  tracker-server: 192.168.103.159:22122 #服务器地址
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://192.168.118.240:3000/
  data_base_name: im
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://192.168.103.153:9200
  tHost: 192.168.103.153:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: https://ih.xmheart.com/hlwyy/
  id: xm_xzzx_wx
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000101
  sf_check_word: EDSAFWFAQWyjt8099
---
##==心脏中心外 ===============================================================================
spring:
  profiles: xzprod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.16.100.240:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: jkzl
    password: jkzl@2020
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.16.100.240:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.16.100.240:9300
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 172.16.100.240 # Redis server host.
    port: 6380 # Redis server port.
    password: q4YaQemf
fastDFS:
  fastdfs_file_url: http://172.16.100.240:8888/
fast-dfs:
  tracker-server: 172.16.100.240:22122 #服务器地址
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.16.100.65:3000/
  data_base_name: im
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://172.16.100.240:9200
  tHost: 172.16.100.240:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 2
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: https://ih.xmheart.com/hlwyy/
  id: xm_xzzx_wx
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000101
  sf_check_word: EDSAFWFAQWyjt8099
---
##==厦门卫计委 ===============================================================================
spring:
  profiles: xmjwprod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://59.61.92.90:9409/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: qY#j2n5O
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 10.95.22.155:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://10.95.22.155:9300
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
fastDFS:
  fastdfs_file_url: http://192.168.103.159:8888/
fast-dfs:
  tracker-server: 192.168.103.159:22122 #服务器地址
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.16.1.42:3000/
  data_base_name: im
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 1
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
es:
  pwflag: 0 # 1需要密码,0不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://172.16.100.240:9200
  tHost: 172.16.100.240:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
qywx:
  url: 1
  id: 2
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code:
  sf_check_word:
---
spring:
  profiles: jwystest
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.195/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
#    host: 172.26.0.253 # Redis server host.
    host: 172.26.0.190 # Redis server host
    port: 6379 # Redis server port
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.193:3000/
  data_base_name: im_internet_hospital
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.190:9200
  tHost: 172.26.0.190:9300
  clusterName: jkzl
  securityUser: elastic:changeme
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 1
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: tnJwprod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://10.9.1.247:3310/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: qY#j2n5O
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 192.0.33.26:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://192.0.33.26:9300
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 10.9.1.247 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 10.9.1.247:22122 #服务器地址
wechat:
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: true #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://10.9.1.247:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://10.9.1.247:9200
  tHost: 10.9.1.247:9300
  clusterName: jkzl
  user: lion
  password: jkzlehr
  securityUser: lion:jkzlehr
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
qywx:
  url: https://hlwyy.xmzsh.com/hlwyy
  id: zsyy
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: dsyy
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
demo:
  flag: true
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 1
express:
  sf_url: http://mrds-admin-ci.sit.sf-express.com:45478
  sf_code: HD000001
  sf_check_word: AAAABBBBCCCCDDDD
---
spring:
  profiles: hcyyProd
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://192.168.120.103:6001/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 192.168.120.103 # Redis server host.
    port: 6007 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 192.168.120.103:6002 #服务器地址
wechat:
  id: xm_hcyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: true #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage # 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2 # mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true #支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://127.0.0.1:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://192.168.120.103:6005
  tHost: 192.168.120.103:6006
  securityUser: elastic:elastic
  clusterName: jkzl
  user: lion
  password: jkzlehr
FileTempPath: # 上传文件临时路径配置
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
qywx:
  url: https://hlwyy.xmzsh.com/hlwyy
  id: zsyy
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: yqfk
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://10.90.32.3:22042/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: jkzl_root
    password: jkzlehr@2020%
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 192.168.120.103:6002 #服务器地址
wechat:
  id: xm_hcyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: true #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage # 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2 # mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true #支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://127.0.0.1:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://192.168.120.103:6005
  tHost: 192.168.120.103:6006
  securityUser: elastic:elastic
  clusterName: jkzl
  user: lion
  password: jkzlehr
FileTempPath: # 上传文件临时路径配置
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
qywx:
  url: https://hlwyy.xmzsh.com/hlwyy
  id: zsyy
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112

+ 6 - 0
svr/svr-cloud-medicine/src/main/resources/banner.txt

@ -0,0 +1,6 @@
                               _           _                                  _             _                             _   _             _ 
  ___  __   __  _ __          (_)  _ __   | |_    ___   _ __   _ __     ___  | |_          | |__     ___    ___   _ __   (_) | |_    __ _  | |
 / __| \ \ / / | '__|  _____  | | | '_ \  | __|  / _ \ | '__| | '_ \   / _ \ | __|  _____  | '_ \   / _ \  / __| | '_ \  | | | __|  / _` | | |
 \__ \  \ V /  | |    |_____| | | | | | | | |_  |  __/ | |    | | | | |  __/ | |_  |_____| | | | | | (_) | \__ \ | |_) | | | | |_  | (_| | | |
 |___/   \_/   |_|            |_| |_| |_|  \__|  \___| |_|    |_| |_|  \___|  \__|         |_| |_|  \___/  |___/ | .__/  |_|  \__|  \__,_| |_|
                                                                                                                 |_|                          

+ 123 - 0
svr/svr-cloud-medicine/src/main/resources/bootstrap.yml

@ -0,0 +1,123 @@
spring:
  application:
    name:  svr-internet-hospital
  cloud:
    config:
      failFast: true
      username: jw
      password: jkzl
---
spring:
  profiles: jwdev
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: qytest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: local
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      label: ${wlyy.spring.config.label:local}
---
spring:
  profiles: jwprod70
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.16.1.70:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: jwOracleTest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwOracleProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: xzprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://172.16.100.63:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: xmjwprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.120.210:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: jwystest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.194:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: tnJwprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: dsyy
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: hcyyProd
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: yqfk
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}

+ 120 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/yk/YKYYDataUploadJob.java

@ -0,0 +1,120 @@
package com.yihu.jw.job.yk;
import com.yihu.jw.internet.service.YkyyCommonService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.util.date.DateUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by wsy on 2021/9/13.
 */
public class YKYYDataUploadJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DataUploadJob.class);
    @Autowired
    private YkyyCommonService ykykcommonService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========DataUploadJob========");
        try {
            //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 02:00:00 执行,同步前一天的数据
            /*String endDate = DateUtil.dateToStr(DateUtil.getNow(),"yyyy-MM-dd")+" 00:00:00";
            String startDate = DateUtil.dateToStr(DateUtil.getPreDays(DateUtil.getNow(),-1),"yyyy-MM-dd")+" 00:00:00";*/
            String endDate = DateUtil.dateToStr(DateUtil.getNow(),"yyyy-MM-dd");
            String startDate = DateUtil.dateToStr(DateUtil.getPreDays(DateUtil.getNow(),-1),"yyyy-MM-dd");
            String res = "";
            //2、分步执行需要JOB执行的服务
            logger.info("START========2.5 网上预约挂号上传开始========");
            try {
                res = ykykcommonService.upAppointmentOnline(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
           logger.info("START========2.6 网上医技预约上传开始========");
           try {
               res = ykykcommonService.upMedicalOnline(startDate,endDate,null);
           }catch (Exception e){
               e.printStackTrace();
               logger.error(e.toString());
           }
           logger.info("END==========2.6 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            try {
                res = ykykcommonService.upNsDoctorScore(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.7 医生评价信息结束========" + res);
            logger.info("START========2.8 网络咨询服务信息开始========");
            try {
                res = ykykcommonService.upNsOnlineAsk(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.8 网络咨询服务信息结束========" + res);
            logger.info("START========2.9 网络诊疗服务信息========");
            try {
                res = ykykcommonService.upNsOnlineMed(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.9 网络诊疗服务信息========" + res);
            logger.info("START========2.10 电子处方表开始========");
            try {
                res = ykykcommonService.upPrescription(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.10 电子处方表结束========" + res);
            logger.info("START========2.11 电子处方_药品明细表开始 ========");
            try {
                res = ykykcommonService.upPrescriptionDrug(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
            logger.info("END========DataUploadJob 执行结束========");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===DataUploadJob,message:"+e.getMessage());
        }
    }
}

+ 78 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -7,8 +7,10 @@ import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetCommonService;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.internet.service.YkyyCommonService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.yk.YKYYDataUploadJob;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
import com.yihu.jw.job.ykyy.UpdateStatusByPayTimeJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
@ -68,6 +70,9 @@ public class JobController extends BaseController {
    @Autowired
    private YkyyInternetService ykyyInternetService;
    @Autowired
    private YkyyCommonService ykyyCommonService;
    @Autowired
    private InternetCommonService internetCommonService;
    @Autowired
@ -224,6 +229,17 @@ public class JobController extends BaseController {
                        logger.info("prescription_auto_delete_job  job exist");
                    }
                    break;
                case "data_ykupload_job_2" :
                    //互联网医院 监管平台上报
                    if (!quartzHelper.isExistJob("data_ykupload_job_2")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_ykupload_job_2");
                        quartzHelper.addJob(YKYYDataUploadJob.class, trigger, "data_ykupload_job_2", new HashMap<String, Object>());
                        logger.info("data_ykupload_job_2  job success");
                    } else {
                        logger.info("data_ykupload_job_2  job exist");
                    }
                    break;
                default :
            }
@ -769,4 +785,66 @@ public class JobController extends BaseController {
        return success("操作成功");
    }
    @RequestMapping(value = "/ykinternetUpload", method = RequestMethod.GET)
    @ApiOperation("眼科监管平台测试")
    public String ykinternetUpload(String taskId,String endDate,String startDate,String keyId) {
        try {
            String res = "";
            switch(taskId){
                case "2.2":
                    logger.info("START========2.2 医院基本信息========");
                    res =  ykyyCommonService.upNsOrganBas();
                    logger.info("END==========2.2 医院基本信息 ========" + res);
                    break;
                case "2.3" :
                    // 2、分步执行需要JOB执行的服务
                    logger.info("START========2.3 医师基本信息========");
                    res = ykyyCommonService.upNsDoctorRecord(startDate,endDate,keyId);
                    logger.info("END==========2.3 医师基本信息 ========" + res);
                    break;
                case "2.5" :
                    logger.info("START========2.5 网上预约挂号上传开始========");
                    res = ykyyCommonService.upAppointmentOnline(startDate,endDate,keyId);
                    logger.info("END==========2.5 网上预约挂号上传结束========" + res);
                    break;
                case "2.6" :
                    logger.info("START========2.6 网上医技预约上传开始========");
                    res = ykyyCommonService.upMedicalOnline(startDate,endDate,keyId);
                    logger.info("END==========2.6 网上医技预约上传结束========" + res);
                    break;
                case "2.7" :
                    logger.info("START========2.7 医生评价信息开始========");
                    res = ykyyCommonService.upNsDoctorScore(startDate,endDate,keyId);
                    logger.info("END==========2.7 医生评价信息结束========" + res);
                    break;
                case "2.8" :
                    logger.info("START========2.8 网络咨询服务信息开始========");
                    res = ykyyCommonService.upNsOnlineAsk(startDate,endDate,keyId);
                    logger.info("END==========2.8 网络咨询服务信息结束========" + res);
                    break;
                case "2.9" :
                    logger.info("START========2.9 网络咨询服务信息开始========");
                    res = ykyyCommonService.upNsOnlineMed(startDate,endDate,keyId);
                    logger.info("END==========2.9 网络咨询服务信息结束========" + res);
                    break;
                case "2.10" :
                    logger.info("START========2.10 电子处方表开始========");
                    res = ykyyCommonService.upPrescription(startDate,endDate,keyId);
                    logger.info("END==========2.10 电子处方表结束========" + res);
                    break;
                case "2.11" :
                    logger.info("START========2.11 电子处方_药品明细表开始 ========");
                    res = ykyyCommonService.upPrescriptionDrug(startDate,endDate,keyId);
                    logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
                    break;
                default :
            }
            return success("success");
        } catch (Exception e) {
            error(e);
            return error(-1, "启动失败");
        }
    }
}

+ 3 - 0
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -21,3 +21,6 @@ CSTXJOB=0 */1 * * * ?
#-------------------------眼科医院end-----------------------------#
#-------------------------监管平台通用医院-----------------------------#
data_common_upload_job=0 0 0 * * ?
#-------------------------眼科医院-----------------------------#
data_ykupload_job_2=0 0 0 * * ?

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/MvcConfig.java

@ -39,7 +39,7 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
    public FilterRegistrationBean testFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new CrosXssFilter());
        registration.addUrlPatterns("/*");
        registration.addUrlPatterns("/open/gc/**");
        registration.setName("CrosXssFilter");
        registration.setOrder(1);
        return registration;

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java

@ -150,7 +150,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
                                                  @ApiParam(value = "chunkTotal", required = false)
                                                      @RequestParam(value = "chunkTotal", required = false) Integer chunkTotal,
                                                  @ApiParam(value = "objectType", required = false)
                                                      @RequestParam(value = "objectType", required = false) Integer objectType
                                                      @RequestParam(value = "objectType", required = false) Integer objectType,
                                                  @ApiParam(value = "chunkSize", required = false)
                                                      @RequestParam(value = "chunkSize", required = false) Integer  chunkSize
                                             ) throws Exception{
        UploadVO uploadVO = new UploadVO();
        MutilFileInfo files = new MutilFileInfo();
@ -160,7 +162,7 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
        files.setObjectType(objectType);
        files.setSize(file.getSize());
        files.setTaskId(taskId);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files);
        String taskid = fileManageService.chunkUploadByMappedByteBuffer(files,chunkSize);
        if ("unCompelete".equalsIgnoreCase(taskid)){
            System.out.println("第"+files.getChunk());
            return success("未传完",uploadVO);

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyAdminTeamController.java

@ -27,6 +27,8 @@ public class WlyyAdminTeamController extends EnvelopRestEndpoint {
    @GetMapping("/findOrgList")
    public MixEnvelop findOrgList(@ApiParam(name = "code", value = "code", required = false)
                                           @RequestParam(value = "code", required = false)String code,
                                  @ApiParam(name = "name", value = "name", required = false)
                                        @RequestParam(value = "name", required = false)String name,
                                           @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                                           @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                                           @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
@ -34,7 +36,7 @@ public class WlyyAdminTeamController extends EnvelopRestEndpoint {
        try {
            return wlyyAdminTeamService.findHospitalByTown(code,page,pageSize);
            return wlyyAdminTeamService.findHospitalByTown(code,name,page,pageSize);
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedMixEnvelopException(e);

+ 11 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -2431,16 +2431,22 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "streetName",required = false)String streetName,
                                      @ApiParam(name = "pm", value = "pm")
                                      @RequestParam(value = "pm",required = false)String pm,
                                      @ApiParam(name = "pushChannel", value = "pushChannel")
                                      @RequestParam(value = "pushChannel",required = false)String pushChannel,
                                      @ApiParam(name = "checkPart", value = "checkPart")
                                      @RequestParam(value = "checkPart",required = false)String checkPart,
                                      @ApiParam(name = "pushFlag", value = "pushFlag")
                                      @RequestParam(value = "pushFlag",required = false)String pushFlag,
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                      @RequestParam(value = "cardNoType",required = false)String cardNoType,
                                      @ApiParam(name = "preNo", value = "preNo")
                                      @RequestParam(value = "preNo",required = false)String preNo){
                                      @ApiParam(name = "chargeFlag", value = "chargeFlag")
                                      @RequestParam(value = "chargeFlag",required = false)String chargeFlag,
                                      @ApiParam(name = "chargeCode", value = "chargeCode")
                                          @RequestParam(value = "chargeCode",required = false)String chargeCode,
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                          @RequestParam(value = "icdCode",required = false)String icdCode){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID(),preNo));
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

+ 21 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2796,6 +2796,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.yxToken20)
    @ApiOperation(value = "云信token2.0")
    public Envelop yxToken20(
            @ApiParam(name = "userId", value = "userId")
            @RequestParam(value = "userId",defaultValue = "",required = true) String userId,
            @ApiParam(name = "channelName", value = "channelName")
            @RequestParam(value = "channelName",defaultValue = "",required = false) String channelName) throws Exception {
        return success(prescriptionService.yxToken(userId,channelName));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.doorServiceTest)
    @ApiOperation(value = "测试上门复诊数据同步")
    public Envelop doorServiceTest(
@ -3041,16 +3051,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "streetName",required = false)String streetName,
                                      @ApiParam(name = "pm", value = "pm")
                                          @RequestParam(value = "pm",required = false)String pm,
                                      @ApiParam(name = "pushChannel", value = "pushChannel")
                                          @RequestParam(value = "pushChannel",required = false)String pushChannel,
                                      @ApiParam(name = "checkPart", value = "checkPart")
                                          @RequestParam(value = "checkPart",required = false)String checkPart,
                                      @ApiParam(name = "pushFlag", value = "pushFlag")
                                          @RequestParam(value = "pushFlag",required = false)String pushFlag,
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType,
                                      @ApiParam(name = "preNo", value = "preNo")
                                          @RequestParam(value = "preNo",required = false)String preNo){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID(),preNo));
                                      @ApiParam(name = "chargeFlag", value = "chargeFlag")
                                          @RequestParam(value = "chargeFlag",required = false)String chargeFlag,
                                      @ApiParam(name = "chargeCode", value = "chargeCode")
                                          @RequestParam(value = "chargeCode",required = false)String chargeCode,
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                          @RequestParam(value = "icdCode",required = false)String icdCode){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/thirdUpload/ThirdUploadEndpoint.java

@ -14,6 +14,7 @@ import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.thirdUpload.UpnsOrganBaseDao;
import com.yihu.jw.thirdUpload.service.*;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -21,7 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yihu.jw.rm.regulatory.BaseRegulatoryRequestMapping;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController
@ -519,6 +522,4 @@ public class ThirdUploadEndpoint extends EnvelopRestEndpoint {
            return failedObjEnvelopException(e);
        }
    }
}

+ 1 - 0
wlyy-parent-pom/pom.xml

@ -73,6 +73,7 @@
        <module>../svr/svr-wlyy-specialist</module> <!-- 专科医生 -->
        <!--<module>../svr/svr-manage</module>--> <!-- 后台管理系统 -->
        <module>../svr/svr-rehabilitation</module> <!--专科医生康复计划-->
        <module>../svr/svr-cloud-medicine</module> <!--专科医生康复计划-->
        <!-- 应用 -->
        <module>../app/app-iot-server</module>