Browse Source

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

liubing 4 years ago
parent
commit
3c950cec35
66 changed files with 1490 additions and 457 deletions
  1. 45 18
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  2. 6 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java
  4. 5 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  5. 63 33
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 5 7
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  7. 4 4
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  8. 3 2
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  9. 397 27
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  10. 12 1
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  11. 9 6
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  12. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  13. 19 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/family/WlyyPatientFamilyMemberDO.java
  14. 73 2
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java
  15. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  16. 33 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyOutpatientVO.java
  17. 2 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  18. 3 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java
  19. 68 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  20. 8 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  21. 1 1
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  22. 34 22
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  23. 49 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  24. 48 19
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  25. 50 12
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  26. 7 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  27. 57 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  28. 14 14
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/BasePatientBusinessService.java
  29. 6 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java
  30. 10 2
      svr/svr-internet-hospital/src/main/resources/application.yml
  31. 6 0
      svr/svr-iot/pom.xml
  32. 13 0
      svr/svr-iot/src/main/java/com/yihu/iot/config/MvcConfig.java
  33. 15 16
      svr/svr-iot/src/main/java/com/yihu/iot/controller/common/BaseController.java
  34. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java
  35. 18 18
      svr/svr-iot/src/main/java/com/yihu/iot/controller/company/IotCompanyController.java
  36. 11 11
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java
  37. 7 7
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceInventoryController.java
  38. 11 11
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOrderController.java
  39. 4 4
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOverhaulController.java
  40. 8 8
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceQualityController.java
  41. 5 5
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceSimController.java
  42. 4 4
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceTransfersController.java
  43. 24 24
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java
  44. 3 3
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/WlyyDeviceController.java
  45. 3 3
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/HospitalController.java
  46. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java
  47. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/iotMessage/IotMessageController.java
  48. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/FigureLabelSearchController.java
  49. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelController.java
  50. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelInfoController.java
  51. 3 3
      svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java
  52. 7 7
      svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceAuditController.java
  53. 19 19
      svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java
  54. 7 7
      svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java
  55. 6 6
      svr/svr-iot/src/main/java/com/yihu/iot/controller/third/ThirdDataInputController.java
  56. 6 6
      svr/svr-iot/src/main/java/com/yihu/iot/controller/workType/IotWorkTypeController.java
  57. 4 4
      svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataInputController.java
  58. 10 10
      svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataSearchController.java
  59. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataStandardConvertController.java
  60. 38 0
      svr/svr-iot/src/main/java/com/yihu/iot/interceptor/CrosXssFilter.java
  61. 120 0
      svr/svr-iot/src/main/java/com/yihu/iot/interceptor/XssHttpServletRequestWrapper.java
  62. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/util/excel/EntityUtils.java
  63. 75 0
      svr/svr-iot/src/main/java/com/yihu/iot/util/jwt/JwtUtil.java
  64. 7 4
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java
  65. 2 1
      svr/svr-wlyy-health-bank/src/main/resources/application.yml
  66. 0 74
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/FileUploadService.java

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

@ -1,6 +1,5 @@
package com.yihu.jw.hospital.family.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
@ -12,24 +11,17 @@ import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.management.MXBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMemberDO, WlyyPatientFamilyMemberDao> {
@ -50,6 +42,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    public MixEnvelop addFamily(String id,String patientId, String familyName, String dictId, String cardType, String idCard, String phoneNum,boolean demo) throws Exception {
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        Map<String,Object> resultMap = new HashMap<>();
        if(null==basePatientDO){
           basePatientDO = new BasePatientDO();
        }
@ -67,17 +60,33 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
            dictName = basePatientMemberDictDO.getRelationName();
        }
        //获取his家属数据
        JSONArray jsonArray = entranceService.BS10008(idCard,familyName,phoneNum,null,null,null,demo);
        if(jsonArray.size()>0){
        JSONArray jsonArray = entranceService.BS10008(idCard,"","","","","",demo);
        if(jsonArray!=null&&jsonArray.size()>0){
            net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
            String familyId="";
            //如果病人id为空则没有就诊记录
            if (null!=jsonObject.get("Patient_Id")){
                familyId = jsonObject.getString("Patient_Id");
                String Pat_name = jsonObject.getString("Pat_Name");
                if (null!=jsonObject.get("Phone_Number_Home")){
                    String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Home").toString();
                    if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
                        return mixEnvelop;
                    }
                }
                if(!Pat_name.equalsIgnoreCase(familyName)){
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属的名称有误,无法添加");
                    return mixEnvelop;
                }
                result.setFamilyRelation(dictId);
                result.setFamilyRelationName(dictName);
                result.setIsDel(1);
                result.setPatient(patientId);
                result.setCardNo(idCard);
                result.setCardType(cardType);
                //保存到base_patient表中
                basePatientDO.setMobile(phoneNum);
                if(null!=jsonObject.get("Birth_Date")){
@ -105,8 +114,16 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                patientMappingDO.setPatient(patientNewId);
                patientMappingDO.setCreateTime(new Date());
                patientMappingDao.save(patientMappingDO);
                resultMap.put("patientId",patientId);
                resultMap.put("familyId",patientNewId);
                resultMap.put("idCard",idCard);
                resultMap.put("phoneNum",phoneNum);
                resultMap.put("relationName",dictName);
                List<Map<String,Object>> resultList = new ArrayList();
                resultList.add(resultMap);
                mixEnvelop.setStatus(200);
                mixEnvelop.setMessage("添加成功");
                mixEnvelop.setDetailModelList(resultList);
            }
        }
        else {
@ -118,15 +135,15 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    //根据患者id查询关联家属
    public List<Map<String,Object>> findFamilyByPatientId(String patientId) throws ParseException {
        String sql = "select t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
                "b.birthday as\"birthday\",b.idcard as \"idcard\" " +
        String sql = "select t.id as \"id\",t.card_type as \"cardType\", t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
                "b.birthday as\"birthday\",b.idcard as \"idcard\",t.family_member as \"familyMember\",c.relation_name as \"relationName\" " +
                " from wlyy_patient_family_member t left join base_patient b" +
                " on t.family_member = b.id where 1=1";
                " on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id where 1=1";
        if (StringUtils.isNotBlank(patientId)){
            sql += " and t.patient = '"+patientId+"'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if (list.size()>0){
        if (list!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                if (map.get("birthday")!=null){
                    SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
@ -174,16 +191,26 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        }
    }
    //获取单个亲属详细信息
    public List<Map<String,Object>>  findMemberById(String id){
        String sql="select t.id as \"id\",t.patient as \"patient\"," +
    public List<Map<String,Object>>  findMemberById(String id) throws ParseException {
        String sql="select t.id as \"id\",t.card_type as \"cardType\",t.family_member as \"familyMember\",t.patient as \"patient\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\"," +
                "c.relation_name \"relation_name\" from wlyy_patient_family_member t left join base_patient b" +
                "c.relation_name \"relationName\",b.birthday as\"birthday\",b.sex as\"sex\"" +
                " from wlyy_patient_family_member t left join base_patient b" +
                " on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id " +
                " where 1=1";
        if (StringUtils.isNotBlank(id)){
            sql+=" and t.id='"+id+"'";
        }
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if (list!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                if (map.get("birthday")!=null){
                    SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
                    int age = getAgeByBirth(sp.parse(map.get("birthday").toString()));
                    map.put("age",age);
                }
            }
        }
        return list;
    }
}

+ 6 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -18,14 +18,17 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientList(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus=1")
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus=1 and a.createTime>=?2 and a.createTime<=?3")
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient,Date startDate,Date endDate);
    List<WlyyOutpatientDO> findByDoctorAndStatus(String doctor,String status);
    @Query("from WlyyOutpatientDO a where a.doctor = ?1 and a.status in(2,3)")
    List<WlyyOutpatientDO> findByDoctorList(String doctor);
    @Query("from WlyyOutpatientDO a where a.realOrder = ?1 ")
    WlyyOutpatientDO findByRealOrder(String realOrder);
    Integer countByDoctorAndStatusAndOutpatientType(String doctor,String status,String outpatientType);
    List<WlyyOutpatientDO> findByDoctor(String doctor);
@ -42,7 +45,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1")
    List<WlyyOutpatientDO> findByStatus();
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-30 23:59:59' and a.createTime>'2020-08-30 00:00:00'")
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-31 23:59:59'")
    List<WlyyOutpatientDO> findPreviousByStatus();
    List<WlyyOutpatientDO> findByDoctorAndCreateTimeAndPatientCancelRemark(String doctor,Date createTime,String patientCancelRemark);

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -41,7 +41,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    @Query("update WlyyPrescriptionDO p set p.status=?1 ,p.finishTime =?2 where p.outpatientId=?3")
    void updateStatusByOutPatientId(Integer status, Date date,String id);
    @Query("select a from WlyyPrescriptionDO a where a.outpatientId = ?1 ")
    @Query("select a from WlyyPrescriptionDO a where a.outpatientId = ?1 and a.checkStatus <>4 ")
    List<WlyyPrescriptionDO> findByOutpatientId(String outpatientId);
    List<WlyyPrescriptionDO> findById(String id);

+ 5 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -18,14 +19,15 @@ public class PayInfoNoticeService {
    private BasePatientDao patientDao;
    public String pushPrescriptionPay(String patient,String doctorName,String orderNo,String outpatientId,String prescriptionId,String total){
    public String pushPrescriptionPay(String patient,String doctorName,String orderNo,String outpatientId,String prescriptionId,String total,String title,String url){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
            String userName = patientDO.getName();
            String idcard = patientDO.getIdcard();
            String phone = patientDO.getMobile();
            String title="您在厦门大学附属中山医院有一笔诊察/处方费用以支付完成!";
            String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+prescriptionId;
            if (!StringUtils.isNotBlank(url)){
                url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+prescriptionId;
            }
            String remark = "结算方式:微信结算" +
                    "点击查看取药\n物流信息";
            return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);

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

@ -442,7 +442,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " o.adm_date AS \"admDate\", " +
                " o.con_date AS \"conDate\", " +
                " o.description AS \"description\", " +
                " o.disease_img AS \"diseaseImg\", ";
                " o.disease_img AS \"diseaseImg\"," +
                " o.consumer as \"consumer\"," +
                " o.consumer_name as \"consumerName\"," +
                " o.consumer_mobile as \"consumerMobile\", ";
        if ("xm_ykyy_wx".equals(wechatId)) {
            if (flag){
                sql = sql + "date_format(o.create_time ,'%Y-%m-%d %H:%i:%S' ) AS createTime,";
@ -460,7 +463,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " wlyy_outpatient o " +
                " WHERE " +
                " o.patient =:patient ";
                " o.consumer =:patient ";
        Map<String, Object> params = new HashedMap();
        params.put("patient", patient);
        if (status != null) {
@ -609,7 +612,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " count(1) AS \"total\" " +
                " FROM " +
                " wlyy_prescription p ";
        totalSql += " WHERE 1=1 and p.check_status <>3 ";
        totalSql += " WHERE 1=1 and p.check_status <>3 and p.check_status <>4";
        if (StringUtils.isNotBlank(patient)) {
            totalSql += " AND p.patient_code ='" + patient + "'";
        }
@ -833,7 +836,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "复诊-诊查费", "2", "复诊-诊查费", patientDO.getId(), patientDO.getName(), outpatient.getDoctor(), price);
        BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "复诊-诊查费", "2", "复诊-诊查费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        WlyyPatientRegisterTimeDO registerTimeDO = null;
        WlyyPatientRegisterTimeDO wlyyPatientRegisterTimeDO =new WlyyPatientRegisterTimeDO();
@ -1675,6 +1678,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            outpatientDO.setRegisterNo(serialNo);
            String conNo = (String) res.get("@times");
            outpatientDO.setConNo(conNo);
            String xtgzh = (String) res.get("@xtgzh");
            String realOrder = (String) res.get("@real_order");
            outpatientDO.setXtgzh(xtgzh);
            outpatientDO.setRealOrder(realOrder);
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            outpatientDao.save(outpatientDO);
@ -1703,9 +1710,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else if ("-2".equals(rsCode)) {
            String serialNo = (String) res.get("@serial_no");
            String xtgzh = (String) res.get("@xtgzh");
            String realOrder = (String) res.get("@real_order");
            outpatientDO.setRegisterNo(serialNo);
            String conNo = (String) res.get("@times");
            outpatientDO.setConNo(conNo);
            outpatientDO.setXtgzh(xtgzh);
            outpatientDO.setRealOrder(realOrder);
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            outpatientDao.save(outpatientDO);
@ -2123,9 +2134,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyPrescriptionDO prescription = prescriptionDao.save(prescriptionDO);
        //========================处方操作结束=============================================================
        if(!StringUtils.isNotBlank(prescriptionId)){
            //加入处方状态变更流水日志
            prescriptionLogService.addPrescriptionLog(prescription.getId(), 10, 2, outpatientDO.getDoctor(), outpatientDO.getDoctorName(), "", new Date());
        }
        //加入处方状态变更流水日志
        prescriptionLogService.addPrescriptionLog(prescription.getId(), 10, 2, outpatientDO.getDoctor(), outpatientDO.getDoctorName(), "", new Date());
        //============================下诊断==============================================================
        //删除之前诊断
@ -3627,7 +3640,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        try {
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                businessOrderService.orderRefund(wxId, wlyyOutpatientDO.getPatient(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                businessOrderService.orderRefund(wxId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                //眼科接诊时更新眼科通状态
                if (!flag){
                    if (businessOrderDO!=null){
@ -3681,7 +3694,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (StringUtils.isNotEmpty(outpatientId)){
            outpatientDO = outpatientDao.findById(outpatientId);
            doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
            patientDO = basePatientDao.findById(outpatientDO.getPatient());
            patientDO = basePatientDao.findById(outpatientDO.getConsumer());
        }
        logger.info("titelType:"+titelType+"&&remindMsg:"+remindMsg+"&&type"+type);
@ -3693,30 +3706,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getPatientName() + ",您好!您的图文复诊已取消";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已取消";
            }
            if ("16".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getPatientName() + ",您好!您的视频复诊已取消";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已取消";
            }
            logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
            contentMsg = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
            first = outpatientDO.getPatientName() + ",您好!";
            first = outpatientDO.getConsumerName() + ",您好!";
            logger.info("outPatientTimeOutRemind:outpatientId="+outpatientId+"contentMsg"+contentMsg);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "请您先完成预交金充值发起在线问诊,点击详情进行预交金充值,如您已完成请忽略本条信息。";//您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息
                first = outpatientDO.getPatientName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个图文复诊订单待支付,请及时支付。
                first = outpatientDO.getConsumerName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个图文复诊订单待支付,请及时支付。
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                logger.info("图文复诊订单待支付微信消息模板推送开始");
            } else if ("16".equals(type)) {
                contentMsg = "请您先完成预交金充值发起在线问诊,点击详情进行预交金充值,如您已完成请忽略本条信息。";//您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息
                first = outpatientDO.getPatientName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个视频复诊订单待支付,请及时支付。
                first = outpatientDO.getConsumerName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个视频复诊订单待支付,请及时支付。
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                logger.info("视频复诊订单待支付微信消息模板推送开始");
            }
@ -3733,13 +3746,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
        } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
            first = outpatientDO.getConsumerName() + ",您好! 医生已为您开具处方,请及时支付。";
            contentMsg = "医生已为您开具处方,请及时支付。";
            remark = "点击完成支付,如您已支付请忽略本条信息";
            msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+remindMsg;
            logger.info("处方支付微信消息模板推送开始");
        } else if ("msgRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好!";
            first = outpatientDO.getConsumerName() + ",您好!";
            contentMsg = "" + remindMsg;
            remark = "请您尽快回复";
        } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
@ -3801,14 +3814,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getPatient());
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getConsumer());
            }
            if (consultTeam!=null){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, consultTeam.getPatient());
            }
            if (ps.isEmpty()) {
                logger.info("该用户" + outpatientDO.getPatientName() + "没有openid,无法推送模版消息,用户ID:" + outpatientDO.getPatient() + "wechatId:" + wxId);
                logger.info("该用户" + outpatientDO.getConsumerName() + "没有openid,无法推送模版消息,用户ID:" + outpatientDO.getPatient() + "wechatId:" + wxId);
                return;
            }
            String scene = "";
@ -3817,7 +3830,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                scene = "ysqxjz";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_doctor_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                } else if ("16".equals(type)) {
@ -3842,7 +3855,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_jz", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                    if ("9".equals(type)) {
                        newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                        newConfig.setKeyword1( "图文复诊支付");
@ -3880,7 +3893,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_prescription_pay_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                newConfig.setKeyword1( "处方支付");
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3( outpatientDO.getDoctorName());
@ -3891,7 +3904,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                scene = "zxxxtx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_msg_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                newConfig.setKeyword1( remindMsg);
                newConfig.setKeyword2( DateUtil.getStringDate());
                //发起微信消息模板推送
@ -3946,7 +3959,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    if ("16".equals(type)) {
                        newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
                    }
                    newConfig.setKeyword1( outpatientDO.getPatientName());
                    newConfig.setKeyword1( outpatientDO.getConsumerName());
                    newConfig.setKeyword2( outpatientDO.getDeptName());
                    newConfig.setKeyword3( outpatientDO.getDoctorName());
                    newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
@ -4004,7 +4017,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                wxPushLogDO.setOpenid(one.getOpenid());
                wxPushLogDO.setReceiver(outpatientDO.getPatient());
                wxPushLogDO.setWechatId(wechatId);
                wxPushLogDO.setReceiverName(outpatientDO.getPatientName());
                wxPushLogDO.setReceiverName(outpatientDO.getConsumerName());
                wxPushLogDO.setScene(scene);
                wxPushLogDao.save(wxPushLogDO);
            }
@ -4162,7 +4175,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "patient.photo AS \"photo\"," +
                "outpatient.mobile AS \"mobile\"," +
                "patient.birthday AS \"birthday\"," +
                "room.consult_type AS \"consult_type\",";
                "room.consult_type AS \"consult_type\"," +
                "outpatient.consumer as \"consumer\", " +
                "outpatient.consumer_name as \"consumerName\"," +
                "outpatient.consumer_mobile as \"consumerMobile\", ";
        if ("xm_ykyy_wx".equals(wechatId)) {
            if(flag){
                sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
@ -5535,7 +5551,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "room.reservation_type AS \"reservation_type\"," +
                "outpatient.disease_img AS \"disease_img\"," +
                "outpatient.description AS \"description\"," +
                "outpatient.origin_con_no AS \"origin_con_no\", " +
                "outpatient.origin_con_no AS \"origin_con_no\"," +
                "outpatient.consumer as \"consumer\"," +
                "outpatient.consumer_name as \"consumer_name\"," +
                "outpatient.consumer_mobile as \"consumerMobile\"," +
                "room.reservation_type AS \"reservation_type\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
@ -7056,7 +7075,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "FROM\n" +
                "\twlyy_prescription P\n" +
                "WHERE\n" +
                "\t1 = 1  ";
                "\t1 = 1 and  p.check_status not in (3,4) ";
        Map<String, Object> params = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)) {
            sql += " and p.hospital =:hospital";
@ -7085,7 +7104,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        sql += " order by p.create_time desc";
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql, params, page, pagesize);
        String sqlTotal = "select COUNT(1) AS \"total\" from wlyy_prescription p where 1=1  ";
        String sqlTotal = "select COUNT(1) AS \"total\" from wlyy_prescription p where 1=1 and  p.check_status not in (3,4)  ";
        Map<String, Object> params1 = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)) {
            sqlTotal += " and p.hospital =:hospital";
@ -7230,7 +7249,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    if (map.get("code").toString().equalsIgnoreCase("1")) {
                        //  * @param applyDepaName @param applyDoctorName
                        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
                        String patientCode = prescriptionDO.getPatientCode();
                        String patientCode = outpatientDO.getConsumer();
                        String realerOrder = prescriptionDO.getRealOrder();
                        String recipeTime = DateUtil.dateToStr(prescriptionDO.getCreateTime(), "yyyyMMddHHmmss");
@ -7259,12 +7278,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        logger.info("cardNo:" + cardNo);
                        Double total = 0.0;
                        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(prescriptionDO.getOutpatientId());
                        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(prescriptionDO.getOutpatientId());
                        for (WlyyPrescriptionDO wlyyPrescriptionDO1:wlyyPrescriptionDOS){
                            total +=wlyyPrescriptionDO1.getDrugFee();
                        }
                        String free = total + "";
                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(patientCode);
                        Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
                        Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(patientCode,startTime,endTime);
                        if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
                            free=(Double.parseDouble(free)+15)+"";
                        }
@ -8056,8 +8077,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size) {
        String uid = userAgent.getUID();
        StringBuffer sql = new StringBuffer(" SELECT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
        StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
        StringBuffer sql = new StringBuffer(" SELECT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        sql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
@ -8384,5 +8405,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            prescriptionDO.setSignFlag(1);
        }
    }
    //删除处方
    public WlyyPrescriptionDO deletePrescription(String id){
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(id);
        if (null!=wlyyPrescriptionDO){
            wlyyPrescriptionDO.setCheckStatus(4);
            wlyyPrescriptionDO.setStatus(-1);
        }
        wlyyPrescriptionDO =  prescriptionDao.save(wlyyPrescriptionDO);
        return wlyyPrescriptionDO;
    }
}

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

@ -4,7 +4,6 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
@ -17,7 +16,6 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.drugstore.service.BaseDrugStoreService;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
@ -35,7 +33,6 @@ import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -150,6 +147,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            outpatientVO.setIdcard(patientDO.getIdcard());
            return outpatientVO;
        }
       return null;
@ -192,8 +190,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        businessOrderDO.setRelationName("复诊-诊查费");
        businessOrderDO.setDescription("复诊-诊查费");
        businessOrderDO.setRematk(outpatient.getDescription());
        businessOrderDO.setPatient(outpatient.getPatient());
        businessOrderDO.setPatientName(outpatient.getPatientName());
        businessOrderDO.setPatient(outpatient.getConsumer());
        businessOrderDO.setPatientName(outpatient.getConsumerName());
        businessOrderDO.setDoctor(outpatient.getDoctor());
        if (outpatientDO.getType().equalsIgnoreCase("1")) {
            businessOrderDO.setOrderType(1);
@ -256,8 +254,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            waitingRoom.setGeneralDoctorName(outpatientDO.getGeneralDoctorName());
        }
        waitingRoom.setPatientId(outpatientDO.getPatient());
        waitingRoom.setPatientName(outpatientDO.getPatientName());
        waitingRoom.setPatientId(outpatientDO.getConsumer());
        waitingRoom.setPatientName(outpatientDO.getConsumerName());
        waitingRoom.setReservationTime(outpatientDO.getRegisterDate());
        waitingRoom.setVisitStatus(0);
        //设置复诊类型

File diff suppressed because it is too large
+ 4 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java


+ 3 - 2
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -140,6 +140,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        List<BusinessOrderDO> businessOrderDOS = new ArrayList<>();
        if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(wlyyPrescriptionDO.getId());
            if (businessOrderDO==null){
@ -155,8 +156,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                businessOrderDO.setOrderCategory("4");
                businessOrderDO.setOrderType(4);
                businessOrderDO.setDoctor(wlyyPrescriptionDO.getDoctor());
                businessOrderDO.setPatient(wlyyPrescriptionDO.getPatientCode());
                businessOrderDO.setPatientName(wlyyPrescriptionDO.getPatientName());
                businessOrderDO.setPatient(outpatientDO.getConsumer());
                businessOrderDO.setPatientName(outpatientDO.getConsumerName());
                BigDecimal b = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getDrugFee()));
                BigDecimal c = new BigDecimal(String.valueOf(100));
                BigDecimal bc = b.multiply(c);

+ 397 - 27
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -210,7 +210,7 @@ public class StatisticsEsService {
            List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"16",null,level2_type);
            JSONArray array = new JSONArray();
            List<String> list = new ArrayList<>();
            DecimalFormat decimalFormat = new DecimalFormat("#.00");
            for (SaveModel saveModel:syngySaveModels){
                if (level2_type.equals(SaveModel.OrgLevel)){
                    if (StringUtils.isNoneBlank(saveModel.getHospital())){
@ -244,7 +244,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getHospitalName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -252,7 +252,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getDeptName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -280,7 +280,7 @@ public class StatisticsEsService {
                                    jsonObject.put("doctorJob",null);
                                }
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -293,7 +293,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -301,7 +301,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -328,7 +328,7 @@ public class StatisticsEsService {
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -339,7 +339,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            topic = saveModel.getResult1();
                            break;
                        }
@ -347,7 +347,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            topic = saveModel.getResult1();
                            break;
                        }
@ -373,7 +373,7 @@ public class StatisticsEsService {
                            }
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            topic = saveModel.getResult1();
                            break;
                        }
@ -384,7 +384,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -392,7 +392,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -418,7 +418,7 @@ public class StatisticsEsService {
                                jsonObject.put("doctorJob",null);
                            }
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -426,8 +426,8 @@ public class StatisticsEsService {
                }
                Double total1 = topic+vedio ;//图文和视频总和
                Double total = topic+vedio+synegy+specialist;//总和
                jsonObject.put("total1",total1);//图文和视频总和
                jsonObject.put("total",total);//总和
                jsonObject.put("total1",decimalFormat.format(total1));//图文和视频总和
                jsonObject.put("total",decimalFormat.format(total));//总和
                array.add(jsonObject);
            }
            object.put("excelData",array);
@ -789,17 +789,17 @@ public class StatisticsEsService {
        Double topicCount = saveModel2.getResult1();//图文复诊数量
        Double videoCount = saveModel3.getResult1();//视频复诊数量
        Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        object.put("specialistCount",specialistCount);//专家咨询数
        object.put("specialistCount",decimalFormat.format(specialistCount));//专家咨询数
        object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
        object.put("synergyCount",synergyCount);//专家咨询数
        object.put("synergyCount",decimalFormat.format(synergyCount));//专家咨询数
        object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
        object.put("topicCount",topicCount);//图文复诊数量
        object.put("topicCount",decimalFormat.format(topicCount));//图文复诊数量
        object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
        object.put("videoCount",videoCount);//视频复诊数量
        object.put("videoCount",decimalFormat.format(videoCount));//视频复诊数量
        object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
        object.put("total",total);
        object.put("total",decimalFormat.format(total));
        return object;
    }
@ -1379,7 +1379,9 @@ public class StatisticsEsService {
            }else {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode);
            }
        } else {
        }else if(StringUtils.isNoneBlank(lowCode2)&&!StringUtils.isNoneBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day,lowCode2);
        }else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day);
        }
        List<JSONObject> result = new ArrayList<>();
@ -1394,6 +1396,7 @@ public class StatisticsEsService {
            json.put("num",0.0);
            result.add(json);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
//        }
        if (saveModels != null) {
@ -1409,7 +1412,7 @@ public class StatisticsEsService {
                for(JSONObject obj : result){
                    if((obj.get("range")+"").equals(range)){
                        obj.put("amount", amount);
                        obj.put("num",num);
                        obj.put("num",decimalFormat.format(num));
                    }
                }
@ -1589,7 +1592,7 @@ public class StatisticsEsService {
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
@ -1610,7 +1613,7 @@ public class StatisticsEsService {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                    json.put("num",decimalFormat.format(num));
                }
            }
@ -1752,7 +1755,10 @@ public class StatisticsEsService {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
            }
        } else {
        }else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week,lowCode2);
        }
        else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
@ -1895,9 +1901,13 @@ public class StatisticsEsService {
            }else {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
            }
        } else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,lowCode2);
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        if (saveModels != null) {
            // 计算结果
@ -1915,7 +1925,7 @@ public class StatisticsEsService {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                    json.put("num",decimalFormat.format(num));
                }
            }
@ -3445,8 +3455,368 @@ public class StatisticsEsService {
        return object;
    }
    /**
     * 按日期柱状图统计处方量
     *
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     */
    public JSONObject getPrescriptionLineBy(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            //图文
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
            object.put("data",array);
            //视频
            JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
            object.put("data2",array1);
            JSONArray arraytotal = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data3",arraytotal);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
            JSONArray arraytotal = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            object.put("data2",array1);
            object.put("data3",arraytotal);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
            JSONArray arraytotal = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            object.put("data2",array1);
            object.put("data3",arraytotal);
        }
        if (StringUtils.isNoneBlank(level2_type)){
            //问诊量表格
            List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"","",level2_type);
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            String prescriptionRate ="";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","",level2_type);
            if(SaveModel.OrgLevel.equals(level2_type)){
                for(SaveModel saveModel:precriptionList){
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("hospitalCode",saveModel.getHospital());
                    jsonObject.put("hospitalName",saveModel.getHospitalName());
                    jsonObject.put("specialist",saveModel.getResult1());
                    for(SaveModel saveModel1:outpatientList){
                        String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
                        String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                        if(out.equalsIgnoreCase(pre)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
                            jsonObject.put("prescriptionRate",prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getHospital()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
            if(SaveModel.doctorLevel.equals(level2_type)){
                for(SaveModel saveModel:precriptionList){
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    String doctorCode = saveModel.getDoctor();
                    BaseDoctorDO baseDoctorDO = doctorDao.findById(doctorCode);
                    if(null!=baseDoctorDO){
                        jsonObject.put("jobTitleCode",baseDoctorDO.getJobTitleCode());
                        jsonObject.put("jobTitleName",baseDoctorDO.getJobTitleName());
                    }
                    jsonObject.put("hospitalCode",saveModel.getHospital());
                    jsonObject.put("hospitalName",saveModel.getHospitalName());
                    jsonObject.put("deptNo",saveModel.getDept());
                    jsonObject.put("deptName",saveModel.getDeptName());
                    jsonObject.put("specialist",saveModel.getResult1());
                    jsonObject.put("doctorName",saveModel.getDoctorName());
                    jsonObject.put("doctorcode",saveModel.getDoctor());
                    for(SaveModel saveModel1:outpatientList){
                        String outdoc=saveModel1.getDoctor()==null?"":saveModel1.getDoctor();
                        String predoc=saveModel.getDoctor()==null?"":saveModel.getDoctor();
                        if(outdoc.equalsIgnoreCase(predoc)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
                            jsonObject.put("prescriptionRate",prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDoctor()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
            if(SaveModel.deptLevel.equals(level2_type)){
                for(SaveModel saveModel:precriptionList){
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("hospitalCode",saveModel.getHospital());
                    jsonObject.put("hospitalName",saveModel.getHospitalName());
                    jsonObject.put("deptNo",saveModel.getDept());
                    jsonObject.put("deptName",saveModel.getDeptName());
                    jsonObject.put("specialist",saveModel.getResult1());
                    for(SaveModel saveModel1:outpatientList){
                        String out=saveModel1.getDept()==null?"":saveModel1.getDept();
                        String pre=saveModel.getDept()==null?"":saveModel.getDept();
                        if(out.equalsIgnoreCase(pre)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
                            jsonObject.put("prescriptionRate",prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDept()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
        }else {
            //问诊量表格
            List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"","","4");
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            String prescriptionRate ="";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","","4");
            for(SaveModel saveModel:precriptionList){
                preNum = saveModel.getResult1();
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("hospitalCode",saveModel.getHospital());
                jsonObject.put("hospitalName",saveModel.getHospitalName());
                jsonObject.put("deptNo",saveModel.getDept());
                jsonObject.put("deptName",saveModel.getDeptName());
                jsonObject.put("specialist",saveModel.getResult1());
                jsonObject.put("doctorName",saveModel.getDoctorName());
                jsonObject.put("doctorcode",saveModel.getDoctor());
                for(SaveModel saveModel1:outpatientList){
                    String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
                    String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                    if(out.equalsIgnoreCase(pre)){
                        outNum = saveModel1.getResult1();
                        prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
                        jsonObject.put("prescriptionRate",prescriptionRate);
                        break;
                    }
                }
                if(null==saveModel.getHospital()){
                    resultArray =new JSONArray();
                }else {
                    resultArray.add(jsonObject);
                }
            }
        }
        object.put("excelData",resultArray);
        return object;
    }
    /**
     * 按日期柱状图 取药方式统计处方量
     *
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     */
    public JSONObject getPrescriptionLineByType(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            //自取
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,"");
            object.put("data",array);
            //快递
            JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,null);
            object.put("data2",array1);
            JSONArray arraytotal = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data3",arraytotal);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,"");
            JSONArray array1 = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,"");
            object.put("data",array);
            object.put("data2",array1);
            JSONArray arraytotal = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data3",arraytotal);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,"");
            JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,"");
            object.put("data",array);
            object.put("data2",array1);
            JSONArray arraytotal = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
            object.put("data3",arraytotal);
        }
        if (StringUtils.isNoneBlank(level2_type)) {
            List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", level2_type);
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            String prescriptionRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", level2_type);
            if (SaveModel.OrgLevel.equals(level2_type)) {
                //问诊量表格
                for (SaveModel saveModel : precriptionList) {
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("hospitalCode", saveModel.getHospital());
                    jsonObject.put("hospitalName", saveModel.getHospitalName());
                    jsonObject.put("specialist", saveModel.getResult1());
                    for (SaveModel saveModel1 : outpatientList) {
                        String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
                        String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                        if(out.equalsIgnoreCase(pre)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
                            jsonObject.put("prescriptionRate", prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getHospital()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
            if (SaveModel.doctorLevel.equals(level2_type)) {
                for (SaveModel saveModel : precriptionList) {
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("hospitalCode", saveModel.getHospital());
                    jsonObject.put("hospitalName", saveModel.getHospitalName());
                    jsonObject.put("deptNo", saveModel.getDept());
                    jsonObject.put("deptName", saveModel.getDeptName());
                    jsonObject.put("specialist", saveModel.getResult1());
                    jsonObject.put("doctorName", saveModel.getDoctorName());
                    jsonObject.put("doctorcode", saveModel.getDoctor());
                    for (SaveModel saveModel1 : outpatientList) {
                        String out=saveModel1.getDoctor()==null?"":saveModel1.getDoctor();
                        String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
                        if(out.equalsIgnoreCase(pre)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
                            jsonObject.put("prescriptionRate", prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDoctor()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
            if (SaveModel.deptLevel.equals(level2_type)) {
                for (SaveModel saveModel : precriptionList) {
                    preNum = saveModel.getResult1();
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("hospitalCode", saveModel.getHospital());
                    jsonObject.put("hospitalName", saveModel.getHospitalName());
                    jsonObject.put("deptNo", saveModel.getDept());
                    jsonObject.put("deptName", saveModel.getDeptName());
                    jsonObject.put("name", saveModel.getHospitalName());
                    jsonObject.put("specialist", saveModel.getResult1());
                    for (SaveModel saveModel1 : outpatientList) {
                        String out=saveModel1.getDept()==null?"":saveModel1.getDept();
                        String pre=saveModel.getDept()==null?"":saveModel.getDept();
                        if(out.equalsIgnoreCase(pre)){
                            outNum = saveModel1.getResult1();
                            prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
                            jsonObject.put("prescriptionRate", prescriptionRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDept()){
                        resultArray =new JSONArray();
                    }else {
                        resultArray.add(jsonObject);
                    }
                }
            }
        }else{
            List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", "4");
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            String prescriptionRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", "4");
            for (SaveModel saveModel : precriptionList) {
                preNum = saveModel.getResult1();
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("hospitalCode", saveModel.getHospital());
                jsonObject.put("hospitalName", saveModel.getHospitalName());
                jsonObject.put("deptNo", saveModel.getDept());
                jsonObject.put("deptName", saveModel.getDeptName());
                jsonObject.put("specialist", saveModel.getResult1());
                jsonObject.put("doctorName", saveModel.getDoctorName());
                jsonObject.put("doctorcode", saveModel.getDoctor());
                for (SaveModel saveModel1 : outpatientList) {
                    String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
                    String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                    if(out.equalsIgnoreCase(pre)){
                        outNum = saveModel1.getResult1();
                        prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
                        jsonObject.put("prescriptionRate", prescriptionRate);
                        break;
                    }
                }
                if(null==saveModel.getHospital()){
                    resultArray =new JSONArray();
                }else {
                    resultArray.add(jsonObject);
                }
            }
        }
        object.put("excelData",resultArray);
        return object;
    }
    /**
     * 日期柱状图处方变换
     *
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     *//*
public JSONObject changePrescriptionLineOnlyTop(String startDate, String endDate, String area, int level, String index,int interval, String level2_type,String key1,String key2) throws Exception {
    if(StringUtils.isNotBlank(key1)&&StringUtil.isBlank(key2)){
        List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "", "", level2_type);
    }
    return null;
}*/
}

+ 12 - 1
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -788,7 +788,7 @@ public class ElasticsearchUtil {
        }
        if (StringUtils.isNotEmpty(area)) {
            if (SaveModel.doctorLevel.equals(level + "")) {
                if (SaveModel.doctorLevel.equals(level + "")) {
                sql.append(" doctor='" + area + "'");
            }else if (SaveModel.deptLevel.equals(level + "")) {
                sql.append(" dept='" + area + "'");
@ -1363,6 +1363,13 @@ public class ElasticsearchUtil {
        List list = findDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, slaveKey1, slaveKey2, interval, null);
        return list;
    }
    public List<SaveModel> findLineChartDateQuotaLevel4(String startDate, String endDate, String area, int level, String index, String timelevel, String interval, String slaveKey1, String slaveKey2) throws Exception {
        if (org.springframework.util.StringUtils.isEmpty(slaveKey2)) {
            slaveKey2 = commonParams;
        }
        List list = findDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, slaveKey1, slaveKey2, interval,null);
        return list;
    }
    public List<SaveModel> findLineChartDateQuotaLevel3(String startDate, String endDate, String area, int level, String index, String timelevel, String interval, String slaveKey1, String slaveKey2) throws Exception {
        if (org.springframework.util.StringUtils.isEmpty(slaveKey1)) {
@ -1392,6 +1399,10 @@ public class ElasticsearchUtil {
        List list = findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, interval, null, slaveKey2);
        return list;
    }
    public List<SaveModel> findLineChartDateQuotaLevel2OnlySlaveKey2(String startDate, String endDate, String area, int level, String index, String timelevel, String interval, String slaveKey2) throws Exception {
        List list = findLineChartDateQuotaLevel4(startDate, endDate, area, level, index, timelevel, interval, null, slaveKey2);
        return list;
    }
    /**
     * 折线图

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

@ -1149,13 +1149,13 @@ public class ImService {
			if(!"0".equals(wlyyOutpatientDO.getStatus())){
				throw new RuntimeException("该就诊记录已被取消,无法接单!");
			}
			
			BasePatientDO patientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient());
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("title", p.getName() + "申请复诊");
			jsonObject.put("title", patientDO.getName() + "申请复诊");
			jsonObject.put("content",wlyyOutpatientDO.getDescription());
			jsonObject.put("age",DateUtil.getAgeForIdcard(p.getIdcard()));
			jsonObject.put("sex",p.getSex());
			jsonObject.put("name",p.getName());
			jsonObject.put("age",DateUtil.getAgeForIdcard(patientDO.getIdcard()));
			jsonObject.put("sex",patientDO.getSex());
			jsonObject.put("name",patientDO.getName());
			ConsultDo consultDo = consultDao.findByRelationCode(outpatientCode);
			if (consultDo==null){
@ -2173,6 +2173,9 @@ public class ImService {
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientSex\"," +
					"op.consumer as \"consumer\"," +
					"op.consumer_name as \"consumerName\"," +
					"op.consumer_mobile as \"consumerMobile\"," +
					"op.id as \"outpatientId\"," +
					"op.type as \"consultType\"," +
					"op.general_doctor as \"generalDoctor\"," +
@ -2184,7 +2187,7 @@ public class ImService {
					"wlyy_consult a   " +
					"left join wlyy_outpatient op on  a.relation_code = op.id " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id ";
					"AND op.patient=d.id ";
		}
		if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)){

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    /*@GeneratedValue(generator = "generator")
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)*/
    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
   /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 19 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/family/WlyyPatientFamilyMemberDO.java

@ -35,6 +35,25 @@ public class WlyyPatientFamilyMemberDO extends UuidIdentityEntityWithOperator {
     */
    private Integer isDel;
    private String cardType;
    private String cardNo;
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public String getPatient() {
        return patient;
    }

+ 73 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -84,12 +84,12 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
	private String deptName;
    /**
	 * 居民code
	 * 当前居民code
	 */
	private String patient;
    /**
	 * 居民名称
	 * 当前居民名称
	 */
	private String patientName;
@ -242,6 +242,32 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
     * 0未结算1已结算
     */
    private Integer hisStatus;
    /**
     * 代就诊人
     */
    private String consumer;
    /**
     * 代就诊人名字
     */
    private String consumerName;
    /**
     * 代就诊人手机号
     */
    private String consumerMobile;
    /**
     * his单据号
     */
    private String xtgzh;
    /**
     * 处方号
     */
    private String realOrder;
    @Column(name = "remind_count")
    public Integer getRemindCount() {
        return remindCount;
@ -634,4 +660,49 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    public void setHisStatus(Integer hisStatus) {
        this.hisStatus = hisStatus;
    }
    @Column(name = "consumer")
    public String getConsumer() {
        return consumer;
    }
    public void setConsumer(String consumer) {
        this.consumer = consumer;
    }
    @Column(name = "consumer_name")
    public String getConsumerName() {
        return consumerName;
    }
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
    @Column(name = "consumer_mobile")
    public String getConsumerMobile() {
        return consumerMobile;
    }
    public void setConsumerMobile(String consumerMobile) {
        this.consumerMobile = consumerMobile;
    }
    @Column(name = "xtgzh")
    public String getXtgzh() {
        return xtgzh;
    }
    public void setXtgzh(String xtgzh) {
        this.xtgzh = xtgzh;
    }
    @Column(name = "real_order")
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
}

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

@ -175,6 +175,10 @@ public class BaseHospitalRequestMapping {
         * 获取用药频次
         */
        public static final String getDrugFrequency="/getDrugFrequency";
        /**
         * 删除处方草稿
         */
        public static final String deletePrescriptionByid="/deletePrescriptionByid";
        /**
         * 下诊断
@ -1293,6 +1297,8 @@ public class BaseHospitalRequestMapping {
        public static final String total = "/total";
        public static final String outPatientLine="/outPatientLine";
        public static final String prescriptionLine="/prescriptionLine";
        public static final String prescriptionTj="/prescriptionTj";
        public static final String prescriptionByKd="/prescriptionByKd";
        public static final String outPatientCircular="/outPatientCircular";
        public static final String outPatientGrade = "/outPatientGrade";
        public static final String outPatientTypeLine= "/outPatientTypeLine";

+ 33 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyOutpatientVO.java

@ -220,6 +220,15 @@ public class WlyyOutpatientVO extends UuidIdentityVO {
    @ApiModelProperty(value = "来源", example = "来源")
    private String source;
    @ApiModelProperty(value = "代接诊人", example = "代接诊人")
    private String consumer;
    @ApiModelProperty(value = "代接诊人名字", example = "代接诊人名字")
    private String consumerName;
    @ApiModelProperty(value = "代接诊人手机号", example = "代接诊人手机号")
    private String consumerMobile;
    public String getAdmNo() {
@ -500,4 +509,28 @@ public class WlyyOutpatientVO extends UuidIdentityVO {
    public void setSource(String source) {
        this.source = source;
    }
    public String getConsumer() {
        return consumer;
    }
    public void setConsumer(String consumer) {
        this.consumer = consumer;
    }
    public String getConsumerName() {
        return consumerName;
    }
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
    public String getConsumerMobile() {
        return consumerMobile;
    }
    public void setConsumerMobile(String consumerMobile) {
        this.consumerMobile = consumerMobile;
    }
}

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -378,6 +378,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            return result.toJSONString();
        }
        baseDoctorDO.setSalt(randomString(5));
        baseDoctorDO.setEnabled(1);
        baseDoctorDO.setLocked(0);
        baseDoctorDO.setPassword(MD5.md5Hex(baseDoctorDO.getIdcard().substring(12, 18) + "{" + baseDoctorDO.getSalt() + "}"));
        this.save(baseDoctorDO);

+ 3 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java

@ -4,6 +4,7 @@ import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +21,8 @@ public class PrescriptionOverdueJob implements Job {
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========PrescriptionOverdueJob========");
        try {
            Trigger trigger =jobExecutionContext.getTrigger();
            System.out.println("执行时间为"+trigger.getNextFireTime());
            prescriptionStatusUpdateService.setOutPatientOver();
            logger.info("END========PrescriptionOverdueJob========");
        } catch (Exception e) {

+ 68 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -0,0 +1,68 @@
package com.yihu.jw.util;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Lazy(false)
@Component
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 0 1 * * ?";
    public OverdueJob(){
        cron="0 0 1 * * ?";
        System.out.println("初始化时的corn"+cron);
    }
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    public String change(String corIn) {
        if (StringUtils.isNotBlank(corIn)) {
            cron = corIn;
        }
        return cron;
    }
    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        taskRegistrar.addTriggerTask(new Runnable() {
            @Override
            public void run() {
                logger.info("START========OverdueJob========");
                try {
                    prescriptionStatusUpdateService.setOutPatientOver();
                    logger.info("END========OverdueJob========");
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("END===ERROE===OverdueJob,message:"+e.getMessage());
                }
            }
        }, new Trigger() {
            @Override
            public Date nextExecutionTime(TriggerContext triggerContext) {
                // 任务触发,可修改任务的执行周期
                CronTrigger trigger = new CronTrigger(cron);
                System.out.println("OverdueJob任务触发,可修改任务的执行周期"+cron);
                Date nextExec = trigger.nextExecutionTime(triggerContext);
                return nextExec;
            }
        });
    }
}

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

@ -1,6 +1,5 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.im.service.ImService;
@ -16,6 +15,7 @@ import com.yihu.jw.repository.job.QuartzJobConfigDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.AutoTimeOutRemind;
import com.yihu.jw.util.OverdueJob;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.web.BaseController;
import com.yihu.jw.wechat.service.WxTemplateService;
@ -28,7 +28,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.sound.midi.Soundbank;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@ -621,5 +620,12 @@ public class JobController extends BaseController {
        return autoTimeOutRemind.change(corn);
    }
    @RequestMapping(value = "changeOverDueTime", method = RequestMethod.GET)
    public String changeOverDueTime(String corn){
        OverdueJob autoTimeOutRemind = new OverdueJob();
        return autoTimeOutRemind.change(corn);
    }
}

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

@ -3,7 +3,7 @@
prescriptionStatus_update_job=0 */2 * * * ?
# 门诊记录过期job,每天1 点触发
prescription_overdue_job=0 0 1 * * ?
prescription_overdue_job=0 0 2 * * ?
#每天13 点触发
data_upload_job=0 0 2 * * ?

+ 34 - 22
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -9,11 +9,14 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
@ -102,6 +105,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private YlzPayService ylzPayService;
	@Autowired
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	
	@Value("${wechat.id}")
	private String wxId;
@ -413,33 +418,40 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		/*ConsultDo cons = consultDao.findOne(consult);
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient());
			//发送诊断消息
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = wlyyOutpatientDOList.get(0);
				BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
				String userName = null;
				String idcard = null;
				if (patientDO != null) {
					userName = patientDO.getName();
					idcard = patientDO.getIdcard();
				}
				PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
				String userNo = null;
				if (patientMappingDO != null) {
					userNo = patientMappingDO.getMappingCode();
				}
				String cardNo = null;
				if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
					cardNo = outpatientDO.getCardNo();
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
				}
				String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
				ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, null, outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
			}
		}
*/
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}

+ 49 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -11,10 +11,16 @@ import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
@ -22,6 +28,7 @@ import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.web.Envelop;
@ -112,6 +119,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@Autowired
	public ImUtil imUtil;
	@Autowired
	private OutpatientDao outpatientDao;
	@Autowired
	private YlzPayService ylzPayService;
	@Autowired
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Value("${fastDFS.fastdfs_file_url}")
@ -611,9 +626,41 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		JSONObject msgObj = new JSONObject();
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		
		String jsonStr = "";
		
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (org.apache.commons.lang3.StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
				}
			}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}

+ 48 - 19
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -1,6 +1,7 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
import com.sun.media.jfxmedia.logging.Logger;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.hospital.family.service.PatientMemberDictService;
import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
@ -9,12 +10,15 @@ import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -39,9 +43,13 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    private EntranceService entranceService;
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private YkyySMSService ykyySMSService;
    private final String KEY_SUFFIX = ":code";
    @Autowired
    private ZhongShanSMSService zhongShanSMSService;
    @Value("${wechat.id}")
    private String wxId;
    @ApiOperation("获取家人关系")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findRelationDict)
@ -59,7 +67,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        String username = obj.getString("phoneNum");
        String idCard = obj.getString("idCard");
        String familyName = obj.getString("familyName");
        JSONArray jsonArray = entranceService.BS10008(idCard, familyName, username, null, null, null, true);
        //JSONArray jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
        if (StringUtils.isEmpty(client_id)) {
            mixEnvelop.setStatus(468);
            mixEnvelop.setMessage("client_id不能为空");
@ -81,22 +89,43 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            //发送短信获取验证码
        }
        String captcha = this.getCodeNumber();
        int result = 1;
        if (jsonArray.size() > 0) {
            result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。");
        } else {
            result = 2;
        }
        if (0 == result) {
            this.store(client_id, username, captcha, 120);
            mixEnvelop.setMessage("验证码发送成功");
        } else if (2 == result) {
            mixEnvelop.setStatus(408);
            mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
        } else {
            mixEnvelop.setMessage("验证码发送失败");
            mixEnvelop.setStatus(500);
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            System.out.println("发送眼科验证码开始");
            ResultMsg result= null;
            /*if (jsonArray.size() > 0) {*/
                result = ykyySMSService.ykyySendSMS(username, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                if (result.isSuccess()){
                    this.store(client_id, username, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            /*}else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            }*/
        }else {
            System.out.println("发送中山验证码开始");
            int result = 1;
            /*if (jsonArray.size() > 0) {*/
                result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
           /* } else {
                result = 2;
            }*/
            if (0 == result) {
                this.store(client_id, username, captcha, 120);
                mixEnvelop.setMessage("验证码发送成功");
            } /*else if (2 == result) {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            }*/ else {
                mixEnvelop.setMessage("验证码发送失败");
                mixEnvelop.setStatus(500);
            }
        }
        return mixEnvelop;
    }
@ -154,7 +183,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            String username = jsonObject.getString("phoneNum");
            String code = jsonObject.getString("code");
            boolean checkCode = this.verification(client_id, username, code);
            if (true) {
            if (checkCode) {
                String patientId = jsonObject.getString("patientId");
                String familyName = jsonObject.getString("familyName");
                String dictId = jsonObject.getString("dictId");
@ -165,7 +194,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                    id = jsonObject.get("id").toString();
                }
                ;
                mixEnvelop = wlyyFamilyMemberService.addFamily(id, patientId, familyName, dictId, cardType, idCard, username, true);
                mixEnvelop = wlyyFamilyMemberService.addFamily(id, patientId, familyName, dictId, cardType, idCard, username, false);
            } else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("验证码不正确");
@ -199,7 +228,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @ApiOperation("获取单个亲属信息")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
                                    @RequestParam(value = "id", required = false) String id) {
                                    @RequestParam(value = "id", required = false) String id) throws ParseException {
        return success(wlyyFamilyMemberService.findMemberById(id));
    }
}

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

@ -14,16 +14,15 @@ import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionLogDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PayInfoNoticeService;
import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
@ -151,6 +150,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    private String successxml = "SUCCESS";
@ -851,19 +852,57 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
                                    String patient = prescriptionDO.getPatientCode();
                                    if (prescriptionDO.getStatus()!=30){
                                        String pushPayLog = payInfoNoticeService.pushPrescriptionPay(prescriptionDO.getPatientCode(),prescriptionDO.getDoctorName(),voucherNo,prescriptionDO.getOutpatientId(),prescriptionDO.getId(),prescriptionDO.getDrugFee().toString());
                                        String fee=null;
                                        String title = null;
                                        Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
                                        Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
                                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(prescriptionDO.getPatientCode(),startTime,endTime);
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                                        if (wlyyOutpatientDOList==null&&wlyyOutpatientDOList.size()==0){
                                            fee=(prescriptionDO.getDrugFee()+15)+"";
                                            title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!结算费用包含本次在线问诊的复诊诊查费:15元。";
                                        }else {
                                            fee=prescriptionDO.getDrugFee()+"";
                                            title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                        }
                                        String pushPayLog = payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),prescriptionDO.getDoctorName(),voucherNo,prescriptionDO.getOutpatientId(),prescriptionDO.getId(),fee,title,null);
                                        WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
                                        prescriptionLogDO.setCreateTime(new Date());
                                        prescriptionLogDO.setStatus(30);
                                        prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
                                        prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
                                        prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
                                        prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
                                        prescriptionLogDO.setUserType(1);
                                        prescriptionLogDO.setDatajson("处方结算");
                                        prescriptionLogDao.save(prescriptionLogDO);
                                        for (WaitPayDetailVO waitPayDetailVO1:listWPD){
                                            if (waitPayDetailVO1.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                                List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByRealOrderList(waitPayDetailVO1.getRecipeNo());
                                                if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                                    WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                                    outpatientDao.updateHisStatusById(wlyyPrescriptionDO.getOutpatientId(),1);
                                                    logger.info("更新门诊结算状态");
                                                }
                                            }
                                        }
                                        logger.info("处方结算成功"+pushPayLog+"====="+waitPayDetailVO.getRecipeNo());
                                    }
                                }
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                   List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                   if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                       WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                       outpatientDao.updateHisStatusById(wlyyPrescriptionDO.getOutpatientId(),1);
                                       logger.info("更新门诊结算状态");
                                   }
                                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                    if (wlyyOutpatientDO!=null){
                                        if (wlyyOutpatientDO.getHisStatus()==null&&wlyyOutpatientDO.getHisStatus()!=1){
                                            String fee="15";
                                            String title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                            String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId()+"";
                                            payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),null,null,fee,title,url);
                                            outpatientDao.updateHisStatusById(wlyyOutpatientDO.getId(),1);
                                            logger.info("更新门诊结算状态");
                                        }
                                    }
                                }
                                prescriptionDao.updateStatusByRealOrder(waitPayDetailVO.getRecipeNo(),30,new Date());
                            }
@ -895,7 +934,6 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "demoFlag", value = "是否demo", required = false)
                                      @RequestParam(value = "demoFlag", required = false)boolean demoFlag) throws Exception{
        JSONArray result = entranceService.BS10008(idcard,patientName,phoneNum,patientId,admitNum,ybcard,false);
        logger.info(result.toString());
        return success("操作成功",result.toString());
    }

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

@ -410,8 +410,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ListEnvelop getDrugFrequency()throws Exception {
        return success(prescriptionService.getDrugFrequency());
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.deletePrescriptionByid)
    @ApiOperation(value = "删除处方草稿", notes = "删除处方草稿")
    public Envelop deletePrescription(@ApiParam(name = "id", value = "处方id")
                                              @RequestParam(value = "id", required = true)String id)throws Exception {
        return success(prescriptionService.deletePrescription(id));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.makeDiagnosis)
    @ApiOperation(value = "下诊断", notes = "下诊断接口")

+ 57 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -105,7 +105,64 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        return success(result);
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.prescriptionTj)
    @ApiOperation(value = "开方量统计表格")
    public ObjEnvelop prescriptionTj(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false)int interval,
            @RequestParam(required = false) String level2_type) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getPrescriptionLineBy(startDate, endDate, area, level, index, interval,level2_type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.prescriptionByKd)
    @ApiOperation(value = "开方快递量统计表格")
    public ObjEnvelop prescriptionByKd(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false)int interval,
            @RequestParam(required = false) String level2_type) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getPrescriptionLineByType(startDate, endDate, area, level, index, interval,level2_type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.total)
    @ApiOperation(value = " 查询总数")

+ 14 - 14
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/BasePatientBusinessService.java

@ -57,7 +57,7 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
	 * @param status
	 * @return
	 */
	public KnowledgeArticleUserDO setCollectionById(String id,Integer flag,Integer status,String user,String userType){
	public KnowledgeArticleDO setCollectionById(String id,Integer flag,Integer status,String user,String userType){
		KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleDao.findByIdAndDel(id);
		KnowledgeArticleUserDO knowledgeArticleUserDO =knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(id,user);
		if (knowledgeArticleUserDO==null){
@ -96,15 +96,15 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
					if (knowledgeArticleDO.getCollection()!=null){
						if (status==1){
							knowledgeArticleDO.setCollection(knowledgeArticleDO.getCollection()+1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}else {
							knowledgeArticleDO.setCollection(knowledgeArticleDO.getCollection()-1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO =knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}else {
						if (status==1){
							knowledgeArticleDO.setCollection(1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO=	knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}
				}
@ -115,15 +115,15 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
					if (knowledgeArticleDO.getReadCount()!=null){
						if (status==1){
							knowledgeArticleDO.setReadCount(knowledgeArticleDO.getReadCount()+1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}else {
							knowledgeArticleDO.setReadCount(knowledgeArticleDO.getReadCount()-1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}else {
						if (status==1){
							knowledgeArticleDO.setReadCount(1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}
				}
@ -134,15 +134,15 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
					if (knowledgeArticleDO.getFabulous()!=null){
						if (status==1){
							knowledgeArticleDO.setFabulous(knowledgeArticleDO.getFabulous()+1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO=knowledgeArticleDao.save(knowledgeArticleDO);
						}else {
							knowledgeArticleDO.setFabulous(knowledgeArticleDO.getFabulous()-1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}else {
						if (status==1){
							knowledgeArticleDO.setFabulous(1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO= knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}
				}
@ -153,21 +153,21 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
					if (knowledgeArticleDO.getShare()!=null){
						if (status==1){
							knowledgeArticleDO.setShare(knowledgeArticleDO.getShare()+1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}else {
							knowledgeArticleDO.setShare(knowledgeArticleDO.getShare()-1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}else {
						if (status==1){
							knowledgeArticleDO.setShare(1);
							knowledgeArticleDao.save(knowledgeArticleDO);
							knowledgeArticleDO = knowledgeArticleDao.save(knowledgeArticleDO);
						}
					}
				}
			}
		}
		return knowledgeArticleUserDO;
		return knowledgeArticleDO;
	}
	public void setUsed(String id,Integer used,String doctor){
		WlyySurveyTemplateDO wlyySurveyTemplateDO = surveyTemplateDao.findOne(id);

+ 6 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -342,10 +342,13 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
                "t.content as \"content\",t.image as \"image\",t.create_user_name as \"createUserName\",c.job_title_name as \"jobTitleName\"," +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                " on a.article_id = t.id left join base_doctor_hospital b on b.doctor_code = t.create_user" +
				" left join base_doctor c on c.id = t.create_user where 1=1 and t.del = 1";
		if (StringUtils.isNotBlank(categoryFirst)&&StringUtils.isNotBlank(categorySecond)){
		    sql+=" and t.category_first = '"+categoryFirst+"' and t.category_second ='"+categorySecond+"'";
				" left join base_doctor c on c.id = t.create_user where 1=1 and t.del = 1 and t.status = 1";
		if (StringUtils.isNotBlank(categoryFirst)){
		    sql+=" and t.category_first = '"+categoryFirst+"'";
        }
		if (StringUtils.isNotBlank(categorySecond)){
			sql+=" and t.category_second ='"+categorySecond+"'";
		}
        if (StringUtils.isNotBlank(keyWords)){
            sql+=" and (t.create_user_name like '%"+keyWords+"%' or t.title like '%"+keyWords+"%' or t.content like '%"+keyWords+"%' or a.dept_name like '%"+keyWords+"%' )";
        }

+ 10 - 2
svr/svr-internet-hospital/src/main/resources/application.yml

@ -305,6 +305,8 @@ es:
  host:  http://192.0.33.26:9200
  tHost: 192.0.33.26:9300
  clusterName: jkzl
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:
@ -404,6 +406,8 @@ es:
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: elastic:changeme
  user: lion
  password: jkzlehr
#文件服务器上传配置 1本地,3.I健康,2.内网调用
testPattern:
  sign: 0
@ -493,7 +497,8 @@ es:
  tHost: 172.26.0.112:9300
  clusterName: jkzl
  securityUser: elastic:elastic
  user: lion
  password: jkzlehr
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
@ -756,7 +761,8 @@ es:
  tHost: 172.16.100.240:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
qywx:
  url: 1
  id: 2
@ -829,6 +835,8 @@ es:
  tHost: 172.26.0.190:9300
  clusterName: jkzl
  securityUser: elastic:changeme
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:

+ 6 - 0
svr/svr-iot/pom.xml

@ -66,6 +66,12 @@
            <version>3.15-beta1</version>
        </dependency>
        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>java-jwt</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>

+ 13 - 0
svr/svr-iot/src/main/java/com/yihu/iot/config/MvcConfig.java

@ -1,10 +1,13 @@
package com.yihu.iot.config;
import com.yihu.iot.interceptor.CrosXssFilter;
import com.yihu.iot.interceptor.GateWayInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@ -31,4 +34,14 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
        super.addInterceptors(registry);
        logger.info("init gateWayInterceptor");
    }
    @Bean
    public FilterRegistrationBean testFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new CrosXssFilter());
        registration.addUrlPatterns("/*");
        registration.setName("CrosXssFilter");
        registration.setOrder(1);
        return registration;
    }
}

+ 15 - 16
svr/svr-iot/src/main/java/com/yihu/iot/controller/common/BaseController.java

@ -1,7 +1,6 @@
package com.yihu.iot.controller.common;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -515,19 +514,19 @@ public class BaseController {
	 * 获取被代理人code,若没有则返回当前登录者
	 * @return
	 */
	public String getRepUID(){
		try {
			String userAgent = request.getHeader("userAgent");
			if (StringUtils.isEmpty(userAgent)) {
				userAgent = request.getHeader("User-Agent");
			}
			JSONObject json = new JSONObject(userAgent);
			if(json.isNull("represented")){
				return json.getString("uid");
			}
			return json.getString("represented");
		} catch (Exception e) {
			return null;
		}
	}
//	public String getRepUID(){
//		try {
//			String userAgent = request.getHeader("userAgent");
//			if (StringUtils.isEmpty(userAgent)) {
//				userAgent = request.getHeader("User-Agent");
//			}
//			JSONObject json = new JSONObject(userAgent);
//			if(json.isNull("represented")){
//				return json.getString("uid");
//			}
//			return json.getString("represented");
//		} catch (Exception e) {
//			return null;
//		}
//	}
}

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java

@ -53,7 +53,7 @@ public class IotSystemDictController extends EnvelopRestEndpoint {
            return iotSystemDictService.create(dictDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -67,7 +67,7 @@ public class IotSystemDictController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,systemDictVOS);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }

+ 18 - 18
svr/svr-iot/src/main/java/com/yihu/iot/controller/company/IotCompanyController.java

@ -67,7 +67,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -98,7 +98,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -114,7 +114,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return iotCompanyService.create(iotCompany);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -128,7 +128,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return  iotCompanyService.auditCompany(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("审核失败");
        }
    }
@ -141,7 +141,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("审核失败");
        }
    }
@ -159,7 +159,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_enterType,iotCompanyVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -180,7 +180,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_find, iotCompanyVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -195,7 +195,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -211,7 +211,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -223,7 +223,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return  iotCompanyService.delCompany(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -240,7 +240,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_update);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("修改失败");
        }
    }
@ -265,7 +265,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return iotCompanyCertificateService.queryPage(page,size,name,companyId);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -285,7 +285,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -300,7 +300,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Common.message_success_find, voList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -320,7 +320,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, iotCompanyCertificateService.create(iotCompanyCertificate));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -332,7 +332,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return iotCompanyCertificateService.delCompanyCert(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -347,7 +347,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return  iotCompanyService.findCompanyByAccount();
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -373,7 +373,7 @@ public class IotCompanyController extends EnvelopRestEndpoint {
            return iotCompanyService.addCompany(iotCompany);
        } catch (IOException e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("新增失败");
        }

+ 11 - 11
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java

@ -62,7 +62,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -80,7 +80,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -93,7 +93,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return iotDeviceService.updDevice(iotDevice);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return Envelop.getError("修改失败");
        }
    }
@ -109,7 +109,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_find, iotDeviceVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -124,7 +124,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_find, existVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -139,7 +139,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_find, existVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -153,7 +153,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return iotDeviceService.updSim(sim,id);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return Envelop.getError("查询失败");
        }
    }
@ -205,7 +205,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -220,7 +220,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_find, existVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("导入失败");
        }
    }
@ -267,7 +267,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return iotDeviceService.queryImportRecordPage(page,size,purcharseId);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -291,7 +291,7 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_find, iotDeviceVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }

+ 7 - 7
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceInventoryController.java

@ -49,7 +49,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return deviceInventoryService.getDeviceInventoryList(name, categoryCode, hospitalName, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -62,7 +62,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_updateInventory, count);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -86,7 +86,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return deviceInventoryService.getDeviceInventoryLog(name, categoryCode,hospital, productId, type, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -99,7 +99,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, deviceInventoryLogVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -110,7 +110,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return deviceInventoryService.getInventoryWarningHospital();
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -122,7 +122,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return deviceInventoryService.getInventoryWarningName(hospital);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -143,7 +143,7 @@ public class IotDeviceInventoryController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Common.message_success_import, correctLs);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError("导入异常,请检查导入文件格式" + e.getMessage());
            return MixEnvelop.getError("导入异常,请检查导入文件格式");
        }
    }

+ 11 - 11
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOrderController.java

@ -45,7 +45,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(deviceOrderDO.getOrderNo());
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -69,7 +69,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceOrder.message_success_find,deviceOrderVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -97,7 +97,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -114,7 +114,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -131,7 +131,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -145,7 +145,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceOrder.message_success_find);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("修改失败");
        }
    }
@ -168,7 +168,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return iotDeviceOrderService.queryPurcharsePage(page,size,orderId,"1");
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -197,7 +197,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return iotDeviceOrderService.queryPurcharsePage(page, size, qualityStatus, orderNo, startTime, endTime);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -215,7 +215,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceOrder.message_success_find,orderPurchaseVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -227,7 +227,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceOrder.message_success_find,list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -251,7 +251,7 @@ public class IotDeviceOrderController extends EnvelopRestEndpoint {
            return iotDeviceOrderService.findAllOrderBySupplierName(page, size,supplierName);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }

+ 4 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOverhaulController.java

@ -42,7 +42,7 @@ public class IotDeviceOverhaulController extends EnvelopRestEndpoint {
            return patientDeviceService.getOverhaulDeviceList(deviceSn, patientName, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -56,7 +56,7 @@ public class IotDeviceOverhaulController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Common.message_success_find, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -74,7 +74,7 @@ public class IotDeviceOverhaulController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update, deviceOverhaulDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -88,7 +88,7 @@ public class IotDeviceOverhaulController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
}

+ 8 - 8
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceQualityController.java

@ -42,7 +42,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, iotDeviceQualityInspectionPlanService.create(planDO));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("创建失败");
        }
    }
@ -57,7 +57,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, planVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -84,7 +84,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -114,7 +114,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return iotDeviceQualityInspectionPlanService.queryPage(status, orderNo, startTime, endTime, page, size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -127,7 +127,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -146,7 +146,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -165,7 +165,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
//            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find);
//        } catch (Exception e) {
//            e.printStackTrace();
//            return MixEnvelop.getError(e.getMessage());
//            return MixEnvelop.getError("查询失败");
//        }
//    }
@ -180,7 +180,7 @@ public class IotDeviceQualityController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }

+ 5 - 5
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceSimController.java

@ -50,7 +50,7 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceSim.message_success_add);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("编辑失败");
        }
    }
@ -64,7 +64,7 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
            return iotDeviceSimService.addSIM(jsonData);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("添加失败");
        }
    }
@ -93,7 +93,7 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -114,7 +114,7 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
            return iotDeviceSimService.findAllSim(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -134,7 +134,7 @@ public class IotDeviceSimController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceSim.message_success_remind);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }

+ 4 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceTransfersController.java

@ -37,7 +37,7 @@ public class IotDeviceTransfersController extends EnvelopRestEndpoint {
            return deviceTransfersService.getDeviceTransfersList(name, categoryCode, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -50,7 +50,7 @@ public class IotDeviceTransfersController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update, deviceTransfersDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("新增失败");
        }
    }
@ -63,7 +63,7 @@ public class IotDeviceTransfersController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -78,7 +78,7 @@ public class IotDeviceTransfersController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update, deviceTransfersDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("更新失败");
        }
    }
}

+ 24 - 24
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java

@ -47,7 +47,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("绑定失败");
        }
    }
@ -64,7 +64,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,patientDeviceVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -80,7 +80,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,iotPatientDeviceVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -98,7 +98,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_create,iotPatientDeviceVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -120,7 +120,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_find_functions,iotPatientDeviceVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -138,7 +138,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,iotPatientDeviceVOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -158,7 +158,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,patientDeviceVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -181,7 +181,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("更换失败");
        }
    }
@ -194,7 +194,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -239,7 +239,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_create,list2,iotPatientDeviceService.getESCount(jsonData));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -253,7 +253,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -266,11 +266,11 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            if(bool){
                return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,"device delete success");
            }
            return MixEnvelop.getError("delete fail,not exist");
            return MixEnvelop.getError("操作失败");
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -283,11 +283,11 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            if(bool){
                return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create,"device update success");
            }
            return MixEnvelop.getError("delete fail,not exist");
            return MixEnvelop.getError("操作失败");
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("修改失败");
        }
    }
@ -302,7 +302,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -318,7 +318,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -335,7 +335,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_update, patientDevice);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("更换失败");
        }
    }
@ -356,7 +356,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_update, patientDeviceDOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("新增失败");
        }
    }
@ -369,7 +369,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
@ -383,7 +383,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_find, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -404,7 +404,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return iotPatientDeviceService.getRepairDeviceList(deviceSn, status, manufacturerId, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -431,7 +431,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return iotPatientDeviceService.getPatientDeviceList(deviceSn, deviceName, categoryCode, patientName,hospitalName, isDel, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -444,7 +444,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("删除失败");
        }
    }
}

+ 3 - 3
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/WlyyDeviceController.java

@ -55,7 +55,7 @@ public class WlyyDeviceController extends BaseController {
            return wlyyDeviceService.searchDeviceList(deviceName, deviceCode, orgName, linkman, page, size);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -66,7 +66,7 @@ public class WlyyDeviceController extends BaseController {
            return  wlyyDeviceService.findById(id);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("查询失败");
        }
    }
@ -197,7 +197,7 @@ public class WlyyDeviceController extends BaseController {
            return write(200,"解绑成功!");
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
            return write(-1,"操作失败");
        }
    }
}

+ 3 - 3
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/HospitalController.java

@ -31,7 +31,7 @@ public class HospitalController extends EnvelopRestEndpoint {
            return hospitalService.create(hospitalDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -50,7 +50,7 @@ public class HospitalController extends EnvelopRestEndpoint {
            return hospitalService.getListByName(name, level, page, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -64,7 +64,7 @@ public class HospitalController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -55,7 +55,7 @@ public class IotDeviceDictController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create, iotDeviceDictService.create(dictDO));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/iotMessage/IotMessageController.java

@ -43,7 +43,7 @@ public class IotMessageController extends EnvelopRestEndpoint {
            return iotMessageService.findAll(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -56,7 +56,7 @@ public class IotMessageController extends EnvelopRestEndpoint {
            return iotMessageService.markRead(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/FigureLabelSearchController.java

@ -35,7 +35,7 @@ public class FigureLabelSearchController extends EnvelopRestEndpoint {
        try {
            return MixEnvelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByIdcard(jsonData));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -46,7 +46,7 @@ public class FigureLabelSearchController extends EnvelopRestEndpoint {
        try {
            return MixEnvelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByLabel(jsonData));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelController.java

@ -36,7 +36,7 @@ public class IotDeviceLabelController extends EnvelopRestEndpoint {
            IotDeviceLabelDO iotDevice = toEntity(jsonData, IotDeviceLabelDO.class);
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_create, iotDeviceLabelService.create(iotDevice));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -49,7 +49,7 @@ public class IotDeviceLabelController extends EnvelopRestEndpoint {
        try {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_find, iotDeviceLabelService.findById(id));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelInfoController.java

@ -36,7 +36,7 @@ public class IotDeviceLabelInfoController extends EnvelopRestEndpoint {
            IotDeviceLabelInfoDO iotDeviceLabelInfo = toEntity(jsonData, IotDeviceLabelInfoDO.class);
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_create, iotDeviceLabelInfoService.create(iotDeviceLabelInfo));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -49,7 +49,7 @@ public class IotDeviceLabelInfoController extends EnvelopRestEndpoint {
        try {
            return MixEnvelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_find, iotDeviceLabelInfoService.findById(id));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 3 - 3
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -64,7 +64,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Device.message_success_create);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -95,7 +95,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            }
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -461,7 +461,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            return monitorPlatformService.findDeviceLocations(diseaseCondition,page,pageSize,type);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 7 - 7
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceAuditController.java

@ -42,7 +42,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.InterfaceAudit.message_success_apply_for);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -58,7 +58,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.InterfaceAudit.message_success_find,iotInterfaceAuditVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -82,7 +82,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return iotInterfaceAuditService.findAllApplyFor(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -107,7 +107,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return iotInterfaceAuditService.conditionQueryPage(companyName,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -122,7 +122,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return iotInterfaceAuditService.auditPass(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -137,7 +137,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return iotInterfaceAuditService.auditNoPass(id,msg);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -162,7 +162,7 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
            return iotInterfaceAuditService.queryCompanyAppPage(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 19 - 19
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -55,7 +55,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_add);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -69,7 +69,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_edit);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -84,7 +84,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find,iotShareInterfaceDO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -97,7 +97,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess("获取成功",iotShareInterfaceDO.getDocUrl());
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -120,7 +120,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotShareInterfaceService.findAll(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -137,7 +137,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -164,7 +164,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotShareInterfaceService.conditionQueryPage(page,size,type,name);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -188,7 +188,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotShareInterfaceService.findCompanyShareInterface(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -215,7 +215,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotInterfaceLogService.findAll(page,size,interfaceName);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -240,7 +240,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotInterfaceLogService.dataConsumption(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -255,7 +255,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -272,7 +272,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_edit);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -286,7 +286,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_delete);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -302,7 +302,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_add);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -318,7 +318,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotCompanyAppInterfaceService.delAppInterface(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -335,7 +335,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, iotCompanyAppInterfaceService.findAppInterface(appId));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -363,7 +363,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotInterfaceLogService.findInterfaceLog(page,size,interfaceName,addressIp);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -388,7 +388,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, iotShareInterfaceService.findAllApp(page,size,name));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -407,7 +407,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
            return iotCompanyService.addPlatformApp(iotCompany);
        } catch (IOException e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 7 - 7
svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java

@ -88,7 +88,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,iotCompanyVOList, page, size,count);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -129,7 +129,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,iotCompanyVOList, page, size,count);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -143,7 +143,7 @@ public class IotProductController extends EnvelopRestEndpoint {
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -157,7 +157,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -188,7 +188,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -201,7 +201,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            return iotProductBaseInfoService.updProduct(iotProductVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -216,7 +216,7 @@ public class IotProductController extends EnvelopRestEndpoint {
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update, voList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 6 - 6
svr/svr-iot/src/main/java/com/yihu/iot/controller/third/ThirdDataInputController.java

@ -35,7 +35,7 @@ public class ThirdDataInputController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success,dataInputService.bindUser(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -46,11 +46,11 @@ public class ThirdDataInputController {
        try{
            return MixEnvelop.getSuccess("success");
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.ThirdOpen.searchList)
    @PostMapping(value = IotRequestMapping.ThirdOpen.searchList)
    @ApiOperation(value = "查询数据,分页", notes = "根据条件查询数据,分页")
    @IntefaceLogRequired
    public MixEnvelop searchList(
@ -79,7 +79,7 @@ public class ThirdDataInputController {
            }
            return dataSearchService.getDataToBean(startTime,endTime,sn,ext_code,idcard,page,size,itemCode);
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -97,7 +97,7 @@ public class ThirdDataInputController {
                return MixEnvelop.getError(result.getString("msg"));
            }
        } catch (ApiException e) {
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
        return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success, result);
    }
@ -113,7 +113,7 @@ public class ThirdDataInputController {
                return MixEnvelop.getError(result.getString("msg"));
            }
        } catch (ApiException e) {
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
        return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success, result.getString("msg"));
    }

+ 6 - 6
svr/svr-iot/src/main/java/com/yihu/iot/controller/workType/IotWorkTypeController.java

@ -36,7 +36,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
            return iotWorkTypeService.addType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -51,7 +51,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
           return iotWorkTypeService.editType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -66,7 +66,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
            return  iotWorkTypeService.deleteType(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -81,7 +81,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
            return  iotWorkTypeService.findType(id);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -103,7 +103,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
            return iotWorkTypeService.findAll(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -130,7 +130,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
            return iotWorkTypeService.conditionQueryPage(page,size,type,explanation);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }

+ 4 - 4
svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataInputController.java

@ -31,7 +31,7 @@ public class DataInputController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success,dataInputService.deleteEsByCondition(jsonData));
        } catch (Exception e){
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError("操作失败");
        }
    }
@ -50,7 +50,7 @@ public class DataInputController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success,dataInputService.bindUser(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -67,7 +67,7 @@ public class DataInputController {
                return MixEnvelop.getError(result.getString("msg"));
            }
        } catch (ApiException e) {
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
        return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success, result);
    }
@ -83,7 +83,7 @@ public class DataInputController {
                return MixEnvelop.getError(result.getString("msg"));
            }
        } catch (ApiException e) {
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
        return MixEnvelop.getSuccess(DataRequestMapping.DataInput.message_success, result.getString("msg"));
    }

+ 10 - 10
svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataSearchController.java

@ -33,7 +33,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success,dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -46,7 +46,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success,dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -58,7 +58,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success, dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -72,7 +72,7 @@ public class DataSearchController {
            jsonObject.put("size", 5);
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success, dataSearchService.getDataToBean(jsonObject.toJSONString()));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -84,7 +84,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success,dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -98,7 +98,7 @@ public class DataSearchController {
            jsonObject.put("size",1);
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success, dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e) {
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -110,7 +110,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success,dataSearchService.getDataToBean(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -126,7 +126,7 @@ public class DataSearchController {
            }
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.delete_success,str);
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -142,7 +142,7 @@ public class DataSearchController {
            }
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.update_success,str);
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
@ -154,7 +154,7 @@ public class DataSearchController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.search_success,dataSearchService.getWeRunDataList(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/datainput/controller/DataStandardConvertController.java

@ -28,7 +28,7 @@ public class DataStandardConvertController {
        try{
            return MixEnvelop.getSuccess(DataRequestMapping.DataStandardConvert.message_success_convert,dataStandardConvertService.iconvert(jsonData));
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }

+ 38 - 0
svr/svr-iot/src/main/java/com/yihu/iot/interceptor/CrosXssFilter.java

@ -0,0 +1,38 @@
package com.yihu.iot.interceptor;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
 * Created by yeshijie on 2020/9/2.
 */
//@WebFilter(filterName = "CrosXssFilter", urlPatterns = { "/*" })
public class CrosXssFilter implements Filter {
    private static final Logger logger = LoggerFactory.getLogger(CrosXssFilter.class);
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }
    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        //sql,xss过滤
        HttpServletRequest httpServletRequest=(HttpServletRequest)request;
        logger.info("CrosXssFilter.......orignal url:{},ParameterMap:{}",httpServletRequest.getRequestURI(), JSONObject.toJSONString(httpServletRequest.getParameterMap()));
        XssHttpServletRequestWrapper xssHttpServletRequestWrapper=new XssHttpServletRequestWrapper(
                httpServletRequest);
        chain.doFilter(xssHttpServletRequestWrapper, response);
        logger.info("CrosXssFilter..........doFilter url:{},ParameterMap:{}",xssHttpServletRequestWrapper.getRequestURI(), JSONObject.toJSONString(xssHttpServletRequestWrapper.getParameterMap()));
    }
    @Override
    public void destroy() {
    }
}

+ 120 - 0
svr/svr-iot/src/main/java/com/yihu/iot/interceptor/XssHttpServletRequestWrapper.java

@ -0,0 +1,120 @@
package com.yihu.iot.interceptor;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
 * Created by yeshijie on 2020/9/1.
 */
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
    private final Logger log = LoggerFactory.getLogger(getClass());
    private static String key = "select|update|and|or|delete|insert|trancate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute|*|%";
    private static Set<String> notAllowedKeyWords = new HashSet<String>(0);
    private static String replacedString="INVALID";
    static {
        String keyStr[] = key.split("\\|");
        for (String str : keyStr) {
            notAllowedKeyWords.add(str);
        }
    }
    private String currentUrl;
    public XssHttpServletRequestWrapper(HttpServletRequest servletRequest) {
        super(servletRequest);
        currentUrl = servletRequest.getRequestURI();
    }
    /**覆盖getParameter方法,将参数名和参数值都做xss过滤。
     * 如果需要获得原始的值,则通过super.getParameterValues(name)来获取
     * getParameterNames,getParameterValues和getParameterMap也可能需要覆盖
     */
    @Override
    public String getParameter(String parameter) {
        String value = super.getParameter(parameter);
        if (value == null) {
            return null;
        }
        return cleanXSS(value);
    }
    @Override
    public String[] getParameterValues(String parameter) {
        String[] values = super.getParameterValues(parameter);
        if (values == null) {
            return null;
        }
        int count = values.length;
        String[] encodedValues = new String[count];
        for (int i = 0; i < count; i++) {
            encodedValues[i] = cleanXSS(values[i]);
        }
        return encodedValues;
    }
    @Override
    public Map<String, String[]> getParameterMap(){
        Map<String, String[]> values=super.getParameterMap();
        if (values == null) {
            return null;
        }
        Map<String, String[]> result=new HashMap<>();
        for(String key:values.keySet()){
            String encodedKey=cleanXSS(key);
            int count=values.get(key).length;
            String[] encodedValues = new String[count];
            for (int i = 0; i < count; i++){
                encodedValues[i]=cleanXSS(values.get(key)[i]);
            }
            result.put(encodedKey,encodedValues);
        }
        return result;
    }
    /**
     * 覆盖getHeader方法,将参数名和参数值都做xss过滤。
     * 如果需要获得原始的值,则通过super.getHeaders(name)来获取
     * getHeaderNames 也可能需要覆盖
     */
    @Override
    public String getHeader(String name) {
//        String value = super.getHeader(name);
//        if (value == null) {
//            return null;
//        }
//        return cleanXSS(value);
        return super.getHeader(name);
    }
    private String cleanXSS(String valueP) {
        // You'll need to remove the spaces from the html entities below
        String value = valueP.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
        value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;");
        value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
        value = value.replaceAll("'", "& #39;");
        value = value.replaceAll("eval\\((.*)\\)", "");
        value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
        value = value.replaceAll("script", "");
        value = cleanSqlKeyWords(value);
        return value;
    }
    private String cleanSqlKeyWords(String value) {
        String paramValue = value;
        for (String keyword : notAllowedKeyWords) {
            if (paramValue.length() > keyword.length() + 4
                    && (paramValue.contains(" "+keyword)||paramValue.contains(keyword+" ")||paramValue.contains(" "+keyword+" "))) {
                paramValue = StringUtils.replace(paramValue, keyword, replacedString);
                log.error(this.currentUrl + "已被过滤,因为参数中包含不允许sql的关键词(" + keyword
                        + ")"+";参数:"+value+";过滤后的参数:"+paramValue);
            }
        }
        return paramValue;
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/util/excel/EntityUtils.java

@ -16,7 +16,7 @@ public class EntityUtils {
        try {
            entity  = objectMapper.readValue(json,target);
        } catch (Exception e) {
           throw new RuntimeException("Json字符串转换成【"+target.getName()+"】实体类异常:" + e.getMessage());
           throw new RuntimeException("Json字符串转换成【"+target.getName()+"】实体类异常:");
        }
        return entity;
    }

+ 75 - 0
svr/svr-iot/src/main/java/com/yihu/iot/util/jwt/JwtUtil.java

@ -0,0 +1,75 @@
package com.yihu.iot.util.jwt;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTCreator;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.Claim;
import com.auth0.jwt.interfaces.DecodedJWT;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by yeshijie on 2020/9/2.
 */
public class JwtUtil {
    private static final String SECRET = "9a96349e2345_*#%4e0f4254dee";
    private static String ISSUER = "sys_user";
    /**
     * 生成token
     * @param claims
     * @param expireDatePoint  过期时间点
     * @return
     */
    public static String genToken(Map<String, String> claims, Date expireDatePoint){
        try {
            //使用HMAC256进行加密
            Algorithm algorithm = Algorithm.HMAC256(SECRET);
            //创建jwt
            JWTCreator.Builder builder = JWT.create().
                    withIssuer(ISSUER). //发行人
                    withExpiresAt(expireDatePoint); //过期时间点
            //传入参数
            claims.forEach((key,value)-> {
                builder.withClaim(key, value);
            });
            //签名加密
            return builder.sign(algorithm);
        } catch (IllegalArgumentException | UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
    /**
     * 解密jwt
     * @param token
     * @return
     * @throws RuntimeException
     */
    public static Map<String,String> verifyToken(String token) throws RuntimeException{
        Algorithm algorithm = null;
        try {
            //使用HMAC256进行加密
            algorithm = Algorithm.HMAC256(SECRET);
        } catch (IllegalArgumentException | UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        //解密
        JWTVerifier verifier = JWT.require(algorithm).withIssuer(ISSUER).build();
        DecodedJWT jwt =  verifier.verify(token);
        Map<String, Claim> map = jwt.getClaims();
        Map<String, String> resultMap = new HashMap<>();
        map.forEach((k,v) -> resultMap.put(k, v.asString()));
        return resultMap;
    }
}

+ 7 - 4
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

@ -16,6 +16,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
@ -68,6 +69,8 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    private ExchangeGoodsDao exchangeGoodsDao;
    @Autowired
    private TaskGoodsDao taskGoodsDao;
    @Value("${account.initPassword}")
    private String initPassword;
   /**
     *  find creditsLogInfo
@ -225,7 +228,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                accountDO1.setCardNumber(cardNumber+Integer.toString(random));
            }
            accountDO1.setHospital(creditsDetailDO.getHospital());
            accountDO1.setPassword("123456");
            accountDO1.setPassword(initPassword);
            accountDO1.setHospitalName(creditsDetailDO.getHospitalName());
            accountDO1.setStatus(1);
            accountDO1.setSaasId("dev");
@ -359,7 +362,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                        accountDO1.setCardNumber(cardNumber+Integer.toString(random));
                    }
                    accountDO1.setHospital(creditsDetailDO.getHospital());
                    accountDO1.setPassword("123456");
                    accountDO1.setPassword(initPassword);
                    accountDO1.setHospitalName(creditsDetailDO.getHospitalName());
                    accountDO1.setStatus(1);
                    accountDO1.setCreateTime(new Date());
@ -903,7 +906,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                        accountDO1.setCardNumber(cardNumber+Integer.toString(random));
                    }
                    accountDO1.setHospital(creditsDetailDO.getHospital());
                    accountDO1.setPassword("123456");
                    accountDO1.setPassword(initPassword);
                    accountDO1.setHospitalName(creditsDetailDO.getHospitalName());
                    accountDO1.setStatus(1);
                    accountDO1.setCreateTime(new Date());
@ -1119,7 +1122,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                int random = (int)((Math.random()*9+1)*100000);
                accountDO.setCardNumber(cardNumber+Integer.toString(random));
            }
            accountDO.setPassword("123456");
            accountDO.setPassword(initPassword);
            accountDO.setSaasId("dev");
            accountDO.setStatus(1);
            accountDO.setCreateTime(new Date());

+ 2 - 1
svr/svr-wlyy-health-bank/src/main/resources/application.yml

@ -48,7 +48,8 @@ fast-dfs:
    init-size: 5
    max-size: 20
    wait-time: 500
account:
  initPassword: 123456
---
spring:
  profiles: jwdev

+ 0 - 74
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/FileUploadService.java

@ -1,25 +1,7 @@
package com.yihu.jw.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
/**
 * @author zhangdan on 2018/08/22.
@ -31,61 +13,5 @@ public class FileUploadService{
    private String neiwangWlyy;  //内网的项目地址
    /**
     * 通用的文件上传
     * @param request
     * @param in
     * @param fileName
     * @return
     */
    public UploadVO request(HttpServletRequest request, InputStream in, String fileName) {
        String url = neiwangWlyy + "/fileUpload/commonUpload";//uri请求路径 http://172.19.103.88/wlyy/upload/chat
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        String result = "";
        UploadVO uploadVO = null;
        try {
            HttpPost httpPost = new HttpPost(url);
            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
            builder.addBinaryBody("file", in, ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
            builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
            if (!org.springframework.util.StringUtils.isEmpty(request.getParameter("type"))) {
                builder.addTextBody("type", request.getParameter("type")); //发送类型
            }
            HttpEntity entity = builder.build();
            httpPost.setEntity(entity);
            HttpResponse response = httpClient.execute(httpPost);// 执行提交
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null) {
                // 将响应内容转换为字符串
                result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
            }
            JSONObject jsonObject = JSONObject.parseObject(result);
            if(jsonObject.getInteger("status")==200){
                JSONObject obj = jsonObject.getJSONObject("obj");
                uploadVO = new UploadVO();
                uploadVO.setFileName(obj.getString("groupName"));
                uploadVO.setFileType(obj.getString("remoteFileName"));
                uploadVO.setFullUri(obj.getString("fileId"));
                uploadVO.setFullUrl(obj.getString("fileUrl"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                httpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return uploadVO;
    }
}