瀏覽代碼

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 年之前
父節點
當前提交
e0569c6625
共有 16 個文件被更改,包括 198 次插入76 次删除
  1. 4 10
      business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseBannerDao.java
  2. 1 2
      business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseBannerDoctorDao.java
  3. 3 12
      business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseUserMessageDao.java
  4. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseUserMsgContentDao.java
  5. 51 7
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java
  6. 32 4
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerService.java
  7. 1 34
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java
  8. 10 3
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/UserMsgContentService.java
  9. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 3 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java
  11. 2 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java
  12. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java
  13. 19 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/equipment/IotEquipmentController.java
  14. 33 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java
  15. 29 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  16. 6 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

+ 4 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseBannerDao.java

@ -18,17 +18,11 @@ import java.util.Map;
 * Created at 2020.07.08
 */
public interface BaseBannerDao extends PagingAndSortingRepository<BaseBannerDO, String>, JpaSpecificationExecutor<BaseBannerDO> {
    @Query(value = "select * from base_banner p where p.name like %?1% and p.status = ?2 order by  p.sort desc limit ?3,?4 ",nativeQuery = true)
    List<BaseBannerDO> queryByNameAndStatus(String name,Integer status,Integer pageNo,Integer pageSize);
    @Query(value = "select * from base_banner p where p.name like %?1% order by  p.sort desc limit ?2,?3 ",nativeQuery = true)
    List<BaseBannerDO> queryByName(String name,Integer pageNo,Integer pageSize);
    @Query( value = "select max(t.sort) from base_banner t",nativeQuery = true)
    @Query( value = "select max(t.sort) AS \"zuida\" from base_banner t",nativeQuery = true)
    Integer getMaxSort();
    @Query( value = "select min(t.sort) from base_banner t",nativeQuery = true)
    @Query( value = "select min(t.sort) AS \"zuixiao\" from base_banner t",nativeQuery = true)
    Integer getMinSort();
    @Query(value = "select * from base_banner where id = ( select id from base_banner where sort > ?1 order by sort desc limit 0,1)",nativeQuery = true)
    BaseBannerDO upBanner(Integer sort);
    @Query(value = "select * from base_banner where id = ( select id from base_banner where sort < ?1 order by sort desc limit 0,1)",nativeQuery = true)
    BaseBannerDO downBanner(Integer sort);
}

+ 1 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseBannerDoctorDao.java

@ -20,6 +20,5 @@ public interface BaseBannerDoctorDao extends PagingAndSortingRepository<BaseBann
    Integer getTotalBannerCount(String doctor);
    @Query( value = "SELECT * from base_banner_doctor t where t.doctor = ?1 and t.patient_id =?2 and t.relation_code =?3" ,nativeQuery = true)
    List<BaseBannerDoctorDO> getBanners(String doctor,String patientId,String relationCode);
    @Query( value = "SELECT * from base_banner_doctor t where t.banner_id = ?1 limit 0,1" ,nativeQuery = true)
    BaseBannerDoctorDO getBannerById(String id);
}

+ 3 - 12
business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/BaseUserMessageDao.java

@ -14,20 +14,11 @@ import java.util.List;
 * Created at 2020.07.08
 */
public interface BaseUserMessageDao extends PagingAndSortingRepository<BaseUserMessageDO, String>, JpaSpecificationExecutor<BaseUserMessageDO> {
    @Query(value = "select * from base_user_message t where  t.status = 1 and t.id = ?1 order by t.update_time desc limit 0,1",nativeQuery = true)
    List<BaseUserMessageDO> getMessageByCode(String Id);
    @Query(value = "select * from base_user_message t where t.relation_code = ?1 order by t.update_time desc ",nativeQuery = true)
    List<BaseUserMessageDO> getAllMessageByCode(String relationCode);
    @Query(value = "select * from base_user_message t where t.receiver = ?1 order by t.update_time desc limit ?2,?3 ",nativeQuery = true)
    List<BaseUserMessageDO> getAllMessageByDoctor(String doctor,Integer page,Integer pageSize);
    @Query(value = "select count(1) from base_user_message t where t.receiver = ?1 order by t.update_time desc ",nativeQuery = true)
    @Query(value = "select count(1) AS \"all\" from base_user_message t where t.receiver = ?1 order by t.update_time desc ",nativeQuery = true)
    Integer getAllMessageTotalCount(String doctor);
    @Query(value = "select count(1) from base_user_message t where t.receiver = ?1 and t.is_read = 0 order by t.update_time desc ",nativeQuery = true)
    @Query(value = "select count(1) AS \"notRead\" from base_user_message t where t.receiver = ?1 and t.is_read = 0 order by t.update_time desc ",nativeQuery = true)
    Integer getMessageNotReadCount(String doctor);
    @Query(value = "select * from base_user_message t where t.receiver = ?1 and t.is_read = 0 order by t.update_time desc limit ?2,?3",nativeQuery = true)
    List<BaseUserMessageDO> getMessageNotRead(String doctor,Integer page ,Integer pageSize);
    @Query(value = "select * from base_user_message t where t.receiver = ?1 and t.is_read = 0 order by t.update_time desc",nativeQuery = true)
    @Query(value = "select *  from base_user_message t where t.receiver = ?1 and t.is_read = 0 order by t.update_time desc",nativeQuery = true)
    List<BaseUserMessageDO> getMessageNotReadNotPage(String doctor);

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

@ -9,6 +9,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseUserMsgContentDao extends PagingAndSortingRepository<BaseUserMsgContentDO, String>, JpaSpecificationExecutor<BaseUserMsgContentDO> {
    @Query(value = "select * from base_user_msg_content t where t.base_user_msg_id = ?1 order by t.update_time desc ",nativeQuery = true)
    @Query(value = "select *  from base_user_msg_content t where t.base_user_msg_id = ?1 order by t.update_time desc ",nativeQuery = true)
    List<BaseUserMsgContentDO> getContentListByID(String base_user_msg_id);
}

+ 51 - 7
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java

@ -11,6 +11,7 @@ import com.yihu.jw.hospital.message.dao.BaseUserMessageDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
@ -23,10 +24,7 @@ import org.springframework.stereotype.Service;
import javax.swing.plaf.PanelUI;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
@Service
public class BaseBannerDoctorService extends BaseJpaService<BaseBannerDoctorDO, BaseBannerDoctorDao> {
@ -38,6 +36,9 @@ public class BaseBannerDoctorService extends BaseJpaService<BaseBannerDoctorDO,
    private BaseUserMessageDao baseUserMessageDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    //批量新增锦旗
    @Transactional
    public List<BaseBannerDoctorDO> bannerGive(String patientId, List<String> list,String content,
@ -84,7 +85,7 @@ public class BaseBannerDoctorService extends BaseJpaService<BaseBannerDoctorDO,
    //获取医生锦旗数量接口
    public JSONObject getDoctorBanners(String doctorID){
        StringBuffer sql = new StringBuffer();
        sql.append("SELECT COUNT(1) AS \"total\",b.name,b.img FROM base_banner_doctor a LEFT JOIN base_banner b on a.banner_id= b.id\n" +
        sql.append("SELECT COUNT(1) AS \"total\",b.name AS \"name\",b.img AS \"img\" FROM base_banner_doctor a LEFT JOIN base_banner b on a.banner_id= b.id\n" +
                "where 1=1 ");
        sql.append("and a.doctor = '"+doctorID+"'");
        sql.append( " GROUP BY a.banner_id");
@ -120,9 +121,52 @@ public class BaseBannerDoctorService extends BaseJpaService<BaseBannerDoctorDO,
    }
    //获取未读消息
    public JSONObject getMessageNotRead(String doctor,Integer page,Integer pageSize){
        Integer pagecount = (page-1)*pageSize;
        int count = baseUserMessageDao.getMessageNotReadCount(doctor);
        List<BaseUserMessageDO> list = baseUserMessageDao.getMessageNotRead(doctor,pagecount,pageSize);
        Map mapSql = new HashMap();
        String sqlId ="select t.id as \"id\",t.content as \"content\"," +
                "t.saas_id as \"saas_id\",t.is_read as \"is_read\",t.type as \"type\"," +
                "t.sender as \"sender\",t.sender_name as \"sender_name\",t.receiver as \"receiver\"," +
                "t.receiver_name as \"receiver_name\",t.relation_type as \"relation_type\",t.relation_code as \"relation_code\"," +
                "t.relation_name as \"relation_name\",t.status as \"status\",t.del as \"del\"," +
                "t.create_user as \"create_user\",t.create_user_name as \"create_user_name\",t.create_time as \"create_time\"," +
                "t.update_user as \"update_user\",t.update_user_name as \"update_user_name\",t.update_time as \"update_time\" from base_user_message t where t.is_read = 0 ";
        if(StringUtils.isNotEmpty(doctor)){
            sqlId = sqlId +" and t.receiver = :doctor order by t.update_time desc";
            mapSql.put("doctor",doctor);
        }
        List<Map<String,Object>> listALl=hibenateUtils.createSQLQuery(sqlId,mapSql,page,pageSize);
        List<BaseUserMessageDO> list = new ArrayList<>();
        for (Map<String,Object> map:listALl){
            BaseUserMessageDO baseUserMessageDO = new BaseUserMessageDO();
            baseUserMessageDO.setContent(null==map.get("content")?"":map.get("content").toString());
            baseUserMessageDO.setSender(map.get("sender").toString());
            baseUserMessageDO.setSenderName(map.get("sender").toString());
            baseUserMessageDO.setReceiver(map.get("sender_name").toString());
            baseUserMessageDO.setReceiverName(map.get("receiver_name").toString());
            baseUserMessageDO.setRelationCode(map.get("relation_code").toString());
            baseUserMessageDO.setRelationName(map.get("relation_name").toString());
            baseUserMessageDO.setRelationType(Integer.valueOf(map.get("relation_type").toString()));
            baseUserMessageDO.setStatus(Integer.valueOf(map.get("status").toString()));
            baseUserMessageDO.setDel(Integer.valueOf(map.get("del").toString()));
            baseUserMessageDO.setType(Integer.valueOf(map.get("type").toString()));
            baseUserMessageDO.setIsRead(Integer.valueOf(map.get("is_read").toString()));
            if (null!=map.get("create_time")){
                String createTime= map.get("create_time").toString();
                map.put("create_time",DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
                baseUserMessageDO.setCreateTime(DateUtil.strToDateLong(createTime));
            }
            if (null!=map.get("update_time")){
                String updateTime = map.get("update_time").toString();
                baseUserMessageDO.setUpdateTime(DateUtil.strToDateLong(updateTime));
            }if(null!=map.get("create_user")){
                baseUserMessageDO.setCreateUser(map.get("create_user").toString());
            }
            if(null!=map.get("update_user")){
                baseUserMessageDO.setUpdateUser(map.get("update_user").toString());
            }
            list.add(baseUserMessageDO);
        }
        //List<BaseUserMessageDO> list = baseUserMessageDao.getMessageNotRead(doctor,pagecount,pageSize);
        JSONObject jsonObject = new JSONObject();
        if (list.size()>0){
            jsonObject.put("messageNotRead",list);

+ 32 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerService.java

@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;
@ -81,7 +82,13 @@ public class BaseBannerService extends BaseJpaService<BaseBannerDO, BaseBannerDa
            map.put("create_time",DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
            map.put("update_time",DateUtil.dateToStrLong(DateUtil.strToDateLong(updateTime)));
            String bannerId = map.get("id").toString();
            BaseBannerDoctorDO baseBannerDoctorDO = baseBannerDoctorDao.getBannerById(bannerId);
            String sqlId = "select t.id AS \"id\" from base_banner_doctor t where t.banner_id = '"+bannerId+"'";
            List<Map<String,Object>> listID=hibenateUtils.createSQLQuery(sqlId,0,1);
            String bannerGiveId ="";
            if (listID.size()>0){
                bannerGiveId = listID.get(0).get("id").toString();
            }
            BaseBannerDoctorDO baseBannerDoctorDO = baseBannerDoctorDao.findOne(bannerGiveId);
            if (null!=baseBannerDoctorDO){
                //1不能删除
                map.put("deleteFlag",1);
@ -98,7 +105,14 @@ public class BaseBannerService extends BaseJpaService<BaseBannerDO, BaseBannerDa
        if (isCount) {
            sql.append("SELECT COUNT(1) AS \"total\" FROM (");
        }
        sql.append("select * from base_banner p where 1=1");
        sql.append("select p.id as \"id\"," +
                "p.saas_id as \"saas_id\"," +
                "p.name as \"name\"," +
                "p.description as \"description\"," +
                "p.img as \"img\", p.sort as \"sort\",p.status as \"status\",p.create_time as \"create_time\",p.create_user as \"create_user\"," +
                "p.create_user_name as \"create_user_name\"," +
                "p.update_time as \"update_time\"," +
                "p.update_user as \"update_user\",p.update_user_name as \"update_user_name\" from base_banner p where 1=1");
        if(StringUtils.isNotEmpty(name)){
            sql.append(" and p.name like '%"+name+"%'");
        }if (StringUtils.isNotEmpty(status)){
@ -194,7 +208,14 @@ public class BaseBannerService extends BaseJpaService<BaseBannerDO, BaseBannerDa
        if(null!=bannerDO){
            sort = bannerDO.getSort();
        }
        BaseBannerDO upPrevious = baseBannerDao.upBanner(sort);
        String sql = "select id AS \"id\" from base_banner where sort > "+sort+" order by sort asc ";
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,0,1);
        BaseBannerDO upPrevious = new BaseBannerDO();
        if (list.size()>0){
            String prviousBannerId = list.get(0).get("id").toString();
            upPrevious =baseBannerDao.findOne(prviousBannerId);
        }
        //BaseBannerDO upPrevious = baseBannerDao.upBanner(sort);
        if (maxSort==sort){
            throw new Exception("不能上移");
        }
@ -219,8 +240,15 @@ public class BaseBannerService extends BaseJpaService<BaseBannerDO, BaseBannerDa
        if(null!=bannerDO){
            sort = bannerDO.getSort();
        }
        String sql = " select id AS \"id\" from base_banner where sort < "+sort+" order by sort desc ";
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,0,1);
        BaseBannerDO downPrevious = new BaseBannerDO();
        if (list.size()>0){
            String prviousBannerId = list.get(0).get("id").toString();
            downPrevious =baseBannerDao.findOne(prviousBannerId);
        }
        //获取的下一条banner
        BaseBannerDO downPrevious = baseBannerDao.downBanner(sort);
        //BaseBannerDO downPrevious = baseBannerDao.downBanner(sort);
        if (minSort==sort){
            throw new Exception("不能下移");
        }

+ 1 - 34
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java

@ -195,7 +195,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
                sql.append( " AND t.update_time <='" + endTime + " 00:00:00'");
            }
        }
        sql.append(" GROUP BY t.relation_code ORDER BY t.update_time Desc");
        sql.append(" ORDER BY t.update_time Desc");
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql.toString()+") q";
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount,params);
@ -301,40 +301,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        }
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, returnList, page, pageSize, count);
    }
    public List<Map<String,Object>> getListByRelationCode(String relationCode){
        //查询评价明细
        String sqlScoreList = "SELECT " +
                "a.score as \"score\"," +
                "a.score_type as \"score_type\"," +
                "a.content as \"content\",";
        if("xm_ykyy_wx".equals(wxId)){
            if (flag){
                sqlScoreList +=  "date_format(b.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"create_time\",";
            }else {
                sqlScoreList +=  "to_char(b.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"create_time\",";
            }
        }else{
            sqlScoreList +=  "date_format(b.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"create_time\",";
        }
        sqlScoreList +=	"c.type as \"type\"," +
                "c.name as \"patientname\"," +
                "b.id as \"id\"," +
                "c.photo as \"patientphoto\"," +
                "b.type as \"niming\" " +
                "FROM " +
                "base_evaluate a " +
                "LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
                "LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code " +
                "WHERE a.relation_code=b.id "+
                "AND c.consult='"+relationCode+"'";
        System.out.println(sqlScoreList);
        List<Map<String,Object>> scoreList = hibenateUtils.createSQLQuery(sqlScoreList);
        if(scoreList.isEmpty()){
            return null;
        }
        return scoreList;
    }
    //获取单条评论详细信息
    public List<Map<String,Object>> getSingle(String id){
        BaseUserMessageDO baseUserMessageDO=baseUserMessageDao.findOne(id);

+ 10 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/UserMsgContentService.java

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -32,6 +33,8 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseBannerDoctorService bannerDoctorService;
    @Autowired
    private BaseUserMsgService baseUserMsgService;
    //获取评论
    public List getAllMessage(String relationCode){
        List<BaseUserMessageDO> list = msgContentDao.findByRelationCode(relationCode);
@ -111,7 +114,7 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
    }
    private String dealSql(String doctor,Boolean countExpert){
        StringBuffer sqlForExpert = new StringBuffer();
        sqlForExpert.append("select b.consult ,c.id from  wlyy_consult_team b \n" +
        sqlForExpert.append("select b.consult AS \"consult\" ,c.id AS \"id\" from  wlyy_consult_team b \n" +
                "left join base_evaluate_score c on b.consult = c.relation_code  \n" +
                "where 1=1");
        if(StringUtils.isNotEmpty(doctor)){
@ -125,7 +128,7 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
        return sqlForExpert.toString();
    }
    //医生主页展示的医生信息
    public JSONObject showContentByDoctor(String doctor,Integer page,Integer pageSize){
    public JSONObject showContentByDoctor(String doctor,Integer page,Integer pageSize) throws ParseException {
        //锦旗总数和各个锦旗数量
        JSONObject jsonObject = bannerDoctorService.getDoctorBanners(doctor);
        //留言总数
@ -158,7 +161,11 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
            jsonObject.put("scoreDoctor", null);
        }
        Integer curPage = (page-1)*pageSize;
        List<BaseUserMessageDO> messageList= userMessageDao.getAllMessageByDoctor(doctor,curPage,pageSize);
        String filters = "receiver="+doctor;
        String fields ="";
        String sorts = "";
        List<BaseUserMessageDO> messageList=baseUserMsgService.search(fields,filters,sorts,page,pageSize);
        //List<BaseUserMessageDO> messageList= userMessageDao.getAllMessageByDoctor(doctor,curPage,pageSize);
        if (null!=messageList){
            for (BaseUserMessageDO baseUserMessageDO:messageList){
                String id = baseUserMessageDO.getId();

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

@ -1027,6 +1027,8 @@ public class BaseHospitalRequestMapping {
        public static final String deleteEquipment  = "/deleteEquipment";
        public static final String getEquipment  = "/getEquipment";
        public static final String getEquipmentAndCount  = "/getEquipmentAndCount";
        public static final String getHospital  = "/getHospital";
        public static final String getTest  = "/getTest";
    }
    

+ 3 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -30,6 +30,8 @@ public class IotRequestMapping {
        public static final String monitorPlatform = api_iot_common + "/open/monitorPlatform";//免登录加上open
        public static final String sim = api_iot_common + "/sim";
        public static final String openThird = api_iot_common + "/open/gc"; //第三方调用 需要accesstoken
        public static final String getHospital = "/getHospital";
        public static final String getEquipmentAndCount = "getEquipmentAndCount";
        public static final String message_success_update = "update success";
@ -46,6 +48,7 @@ public class IotRequestMapping {
        public static final String message_fail_id_is_null = "id is null";
        public static final String message_fail_id_exist = "id exist";
        public static final String message_fail_saasId_is_null = "saasId is null";
    }
    public static class System{

+ 2 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.print.Doc;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
@ -142,7 +143,7 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                               @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                               @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize) throws ParseException {
        JSONObject jsonObject=userMsgContentService.showContentByDoctor(doctor,page,pageSize);
        return success(jsonObject);
    }

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

@ -201,7 +201,7 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
    @GetMapping(value = IotRequestMapping.PatientDevice.findLocationByIdCard)
    @ApiOperation(value = "根据idCard查询设备地址", notes = "根据idCard查询设备地址")
    public MixEnvelop<List<LocationDataVO>, List<LocationDataVO>> findDeviceLocationsByIdCard(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
                                                                     @RequestParam(value = "jsonData",required = true) String jsonData) {
                                                                     @RequestParam(value = "jsonData",required = false) String jsonData) {
        try {
            List<LocationDataVO> list = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonData);
            figureLabelSerachService.getFigureLabelByList(list);

+ 19 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/equipment/IotEquipmentController.java

@ -12,6 +12,8 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -20,6 +22,9 @@ import java.util.List;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.IotEquipmentManage.equipmentManage)
public class IotEquipmentController extends EnvelopRestEndpoint {
    private static Logger logger = LoggerFactory.getLogger(IotEquipmentController.class);
    @Autowired
    private IotEqtDetailService iotEqtDetailService;
@ -73,4 +78,18 @@ public class IotEquipmentController extends EnvelopRestEndpoint {
        JSONObject jsonObject =iotEqtDetailService.showJKXW(startTime,endTime,area);
        return success(jsonObject);
    }
    @GetMapping(value = BaseHospitalRequestMapping.IotEquipmentManage.getHospital)
    @ApiOperation(value = "查询医院")
    public Envelop getHospital(
            @ApiParam(name = "name", value = "name", required = false)
            @RequestParam(value = "name", required = false)String name,
            @ApiParam(name = "code", value = "code", required = false)
            @RequestParam(value = "code", required = false)String code,
            @ApiParam(name = "town", value = "town", required = false)
            @RequestParam(value = "town", required = false)String town,
            @ApiParam(name = "city", value = "city", required = false)
            @RequestParam(value = "city", required = false)String city) throws Exception{
        return success( iotEqtDetailService.getHosptital(name, code, town,city));
    }
}

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

@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.iot.service.device.IotPatientDeviceService;
import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.iot.service.equipment.IotEqtDetailService;
import com.yihu.iot.service.monitorPlatform.MonitorPlatformService;
import com.yihu.iot.service.product.IotProductBaseInfoService;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
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.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -40,6 +43,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
    private IotProductBaseInfoService iotProductBaseInfoService;
    @Autowired
    private IotPatientDeviceService iotPatientDeviceService;
    @Autowired
    private IotEqtDetailService iotEqtDetailService;
    @PostMapping(value = IotRequestMapping.PatientDevice.addPatientDevice)
@ -629,4 +634,32 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            return null;
        }
    }
    @GetMapping(value = IotRequestMapping.Common.getEquipmentAndCount)
    @ApiOperation(value = "查询设备和数量")
    public Envelop getCountAndEquipment(
            @ApiParam(name = "startTime", value = "startTime", required = false)
            @RequestParam(value = "startTime", required = false)String startTime,
            @ApiParam(name = "endTime", value = "endTime", required = false)
            @RequestParam(value = "endTime", required = false)String endTime,
            @ApiParam(name = "area", value = "area", required = false)
            @RequestParam(value = "area", required = false)String area) throws Exception{
        JSONObject jsonObject =iotEqtDetailService.showJKXW(startTime,endTime,area);
        return success(jsonObject);
    }
    @GetMapping(value = IotRequestMapping.Common.getHospital)
    @ApiOperation(value = "查询医院")
    public Envelop getHospital(
            @ApiParam(name = "name", value = "name", required = false)
            @RequestParam(value = "name", required = false)String name,
            @ApiParam(name = "code", value = "code", required = false)
            @RequestParam(value = "code", required = false)String code,
            @ApiParam(name = "town", value = "town", required = false)
            @RequestParam(value = "town", required = false)String town,
            @ApiParam(name = "city", value = "city", required = false)
            @RequestParam(value = "city", required = false)String city) throws Exception{
        return success( iotEqtDetailService.getHosptital(name, code, town,city));
    }
}

+ 29 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -10,6 +10,7 @@ import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
@ -25,6 +26,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
    private HibenateUtils hibenateUtils;
    public void updateEquipment(String jsonData){
        IotEquipmentDetailDO iotEquipmentDetailDO = EntityUtils.jsonToEntity(jsonData, IotEquipmentDetailDO.class);
        if(null==iotEquipmentDetailDO.getId()){
@ -92,6 +94,13 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            params.put("area", area);
        }
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sql,params);
        for (Map<String,Object> map:total){
            if(null!=map.get("create_time")){
                String createTime= map.get("create_time").toString();
                map.put("create_time",DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
            }
        }
        result.put("equipmentDetails",total);
        List<Map<String, Object>> areCount = hibenateUtils.createSQLQuery(areCountSql.toString(),params);
        if (areCount.size()>=0){
@ -129,5 +138,25 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
        }
        return count;
    }
    public List<Map<String,Object>> getHosptital(String name,String code,String town,String city){
        StringBuffer sql = new StringBuffer();
        Map<String,Object> params = new HashedMap();
        sql.append("select * from wlyy.dm_hospital t where 1=1");
       if (StringUtils.isNotEmpty(name)){
           sql.append(" and t.name like '%"+name+"%'");
       }if (StringUtils.isNotEmpty(code)){
            sql.append(" and t.code =:code");
            params.put("code",code);
        }if (StringUtils.isNotEmpty(town)){
            sql.append(" and t.town =:town");
            params.put("town",town);
        }
        if (StringUtils.isNotEmpty(city)){
            sql.append(" and t.city =:city");
            params.put("city",city);
        }
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql.toString(),params);
       return list;
    }
}

+ 6 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -185,7 +185,12 @@ public class MonitorPlatformService  {
            }
            return jsonObject.toString();
        }else if (list.size()==1&&list.contains(iotSystemDictDO.getCode())){
            jsonObject.replace("data",iotEquip.toString());
            List list1 = new ArrayList();
            for (Map<String,Object> mao:iotEquip){
               JSONObject jo = new JSONObject(mao);
               list1.add(jo);
            }
            jsonObject.replace("data",JSONArray.parse(list1.toString()));
            return jsonObject.toString();
        }else {
           return anotherResult;