浏览代码

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 年之前
父节点
当前提交
04c840d92f

+ 10 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -350,4 +350,14 @@ public class CustomerController extends BaseController {
        }
    }
    @RequestMapping(value = "/delCallService", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "删除协同服务")
    public String delCallService(@ApiParam(name="code",value="协同服务编号")@RequestParam(required = true)String code){
        try {
            return write(200,"操作成功","data",customerService.delCallService(code));
        }catch (Exception e){
            error(e);
            return error(-1,"操作成功");
        }
    }
}

+ 6 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -20,6 +20,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.aspectj.weaver.ast.Call;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -567,7 +568,11 @@ public class CustomerService extends BaseService{
		return rs;
	}
	public String delCallService(String code){
		CallService c = callServiceDao.findByCode(code);
		callServiceDao.delete(c);
		return "1";
	}

+ 32 - 32
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/util/NoticeImUtill.java

@ -150,23 +150,23 @@ public class NoticeImUtill {
        return messages;
    }
    public static JSONObject getTopicMessage(String baseUrl,String topicId,String startMsgId,String endMsgId,int page,int pagesize,String uid){
        String url = baseUrl
                + "api/v2/sessions/topic/"+topicId+"/messages?topic_id="+topicId+"&end="+startMsgId
                +"&start="+(endMsgId==null?"":endMsgId)+"&page="+page+"&pagesize="+pagesize+"&user="+uid;
        try{
            String ret = HttpClientUtil.get(url, "UTF-8");
            JSONObject obj = new JSONObject(ret);
            if(obj.getInt("status")==-1){
                throw new RuntimeException(obj.getString("message"));
            }else{
                return  obj.getJSONObject("data");
            }
        }catch (Exception e){
            return null;
        }
    }
//    public static JSONObject getTopicMessage(String baseUrl,String topicId,String startMsgId,String endMsgId,int page,int pagesize,String uid){
//        String url = baseUrl
//                + "api/v2/sessions/topic/"+topicId+"/messages?topic_id="+topicId+"&end="+startMsgId
//                +"&start="+(endMsgId==null?"":endMsgId)+"&page="+page+"&pagesize="+pagesize+"&user="+uid;
//        try{
//            String ret = HttpClientUtil.get(url, "UTF-8");
//            JSONObject obj = new JSONObject(ret);
//            if(obj.getInt("status")==-1){
//                throw new RuntimeException(obj.getString("message"));
//            }else{
//                return  obj.getJSONObject("data");
//            }
//        }catch (Exception e){
//            return null;
//        }
//
//    }
    /**
     * 删除对应的成员信息在MUC模式中
@ -201,21 +201,21 @@ public class NoticeImUtill {
     * @param topicId
     * @return
     */
    public static JSONObject getTopic(String baseUrl,String topicId) throws  Exception{
        String url =baseUrl
                + "api/v2/sessions/topics/"+topicId+"?topic_id="+topicId;
        try{
            String ret = HttpClientUtil.get(url,"utf-8");
            JSONObject obj = new JSONObject(ret);
            if(obj.getInt("status")==-1){
                throw new RuntimeException("获取议题失败!");
            }else{
                return obj;
            }
        }catch (Exception e){
            throw new RuntimeException("获取议题失败!");
        }
    }
//    public static JSONObject getTopic(String baseUrl,String topicId) throws  Exception{
//        String url =baseUrl
//                + "api/v2/sessions/topics/"+topicId+"?topic_id="+topicId;
//        try{
//            String ret = HttpClientUtil.get(url,"utf-8");
//            JSONObject obj = new JSONObject(ret);
//            if(obj.getInt("status")==-1){
//                throw new RuntimeException("获取议题失败!");
//            }else{
//                return obj;
//            }
//        }catch (Exception e){
//            throw new RuntimeException("获取议题失败!");
//        }
//    }
}

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -100,4 +100,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("from Message a where a.type = 12 and a.state=0 and a.del='1' and a.over='0' and receiver = ?1  ")
    List<Message> findByReceiverCallService(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 ")
    List<Message> getMessageByType(String doctor, Integer type, Pageable pageRequest);
}

+ 13 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -3475,15 +3475,23 @@ public class StatisticsESService {
            if ("1".equals(type)) {
                //总数
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel2NoSlaveKey2(startTime, endTime, area, level, index58, SaveModel.timeLevel_ZL, SaveModel.interval_month, disease);
            } else {
            }  else if ("2".equals(type) || "3".equals(type) || "4".equals(type))  {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, index58, SaveModel.timeLevel_ZL,  SaveModel.interval_month, disease,type);
            }else if ("5".equals(type))  {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, index58, SaveModel.timeLevel_ZL,  SaveModel.interval_month, disease,"1");
            }else if ("6".equals(type))  {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, index58, SaveModel.timeLevel_ZL,  SaveModel.interval_month, disease,"5");
            }
        } else {
            if ("1".equals(type)) {
                //总数
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel1NoSlaveKey1(startTime, endTime, area, level, index64, SaveModel.timeLevel_ZL,  SaveModel.interval_month);
            } else {
            } else if ("2".equals(type) || "3".equals(type) || "4".equals(type)) {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, index64, SaveModel.timeLevel_ZL,  SaveModel.interval_month,type);
            }else if ("5".equals(type)) {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, index64, SaveModel.timeLevel_ZL,  SaveModel.interval_month,"1");
            } else if ("6".equals(type)) {
                resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, index64, SaveModel.timeLevel_ZL,  SaveModel.interval_month,"5");
            }
        }
        //把数据设置到初始化的Map里面去
@ -3572,7 +3580,6 @@ public class StatisticsESService {
                rs.add(map);
            }
        } else {
            //统计数据为空时,自建结果集
            List<Town> townList = null;
            List<Hospital> hospitalList = null;
@ -3593,6 +3600,7 @@ public class StatisticsESService {
                    map.put("code", one.getCode());
                    map.put("name", one.getName());
                    map.put("val", 0);
                    rs.add(map);
                }
            } else if (SaveModel.OrgLevel.equals(lowlevel)) {
                for (Hospital one : hospitalList) {
@ -3600,6 +3608,7 @@ public class StatisticsESService {
                    map.put("code", one.getCode());
                    map.put("name", one.getName());
                    map.put("val", 0);
                    rs.add(map);
                }
            } else if (SaveModel.teamLevel.equals(lowlevel)) {
                for (AdminTeam one : adminTeams) {
@ -3607,10 +3616,10 @@ public class StatisticsESService {
                    map.put("code", one.getLeaderCode());
                    map.put("name", one.getName());
                    map.put("val", 0);
                    rs.add(map);
                }
            }
            rs.add(map);
        }
        Collections.sort(rs, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {

+ 18 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/call/CustomerService.java

@ -11,6 +11,9 @@ import com.yihu.wlyy.service.BaseService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -92,9 +95,21 @@ public class CustomerService extends BaseService{
		return list;
	}
	public List<Message> getCallServiceMes(String doctor){
		List<Message> mes =  messageDao.findByReceiverCallService(doctor);
		return mes;
//	public List<Message> getCallServiceMes(String doctor,Integer page, Integer pagesize){
//		Sort sort = new Sort(Sort.Direction.DESC, "createTime");
//		// 分页信息
//		Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
//
//		List<Message> mes =  messageDao.findByReceiverCallService(doctor);
//		return mes;
//	}
	public List<Message> getCallServiceMes(String doctor,Integer page, Integer pagesize) throws Exception {
		// 排序
		Sort sort = new Sort(Sort.Direction.DESC, "createTime");
		// 分页信息
		Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
		return messageDao.getMessageByType(doctor,12, pageRequest);
	}
	public Map<String,Object> getCallServiceInfo(String code){

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -384,7 +384,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey1,slaveKey1Name");
            }
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2),quotaDate result2 from " + esIndex + " where ");
            sql.append("select hospital,hospitalName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2,quotaDate from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/call/CallRecordController.java

@ -49,9 +49,10 @@ public class CallRecordController extends BaseController {
    @RequestMapping(value = "/getCallServiceMes", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务消息")
    public String getCallServiceMes(){
    public String getCallServiceMes(@ApiParam(name="page",value="第几页")@RequestParam(required = false)Integer page,
                                    @ApiParam(name="pagesize",value="每页几条记录")@RequestParam(required = false)Integer pagesize){
        try {
            return write(200,"保存成功","data",customerService.getCallServiceMes(getUID()));
            return write(200,"保存成功","data",customerService.getCallServiceMes(getUID(),page,pagesize));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");