Commit c3f30c889e09d872778ec0f6d97c9c8a016aabf0

Authored by changpengfei
1 parent 08f71e7b9b
Exists in master

获取专家组\客服人员信息

Showing 6 changed files with 38 additions and 5 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java View file @ c3f30c8
... ... @@ -129,5 +129,20 @@
129 129 return baseResponse;
130 130 }
131 131  
  132 + /**
  133 + * 首页科室占比统计
  134 + * @param hid
  135 + * @return
  136 + */
  137 + @GetMapping("getDepartStat")
  138 + public BaseResponse getDepartStat(Integer hid){
  139 + BaseResponse baseResponse=new BaseResponse();
  140 + Map<String,Object> param=new HashMap<>();
  141 + param.put("hid",hid);
  142 + Map<String,Object> rs=indexService.getDepartStat(param);
  143 + baseResponse.setObject(rs);
  144 + return baseResponse;
  145 + }
  146 +
132 147 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/IndexMapper.java View file @ c3f30c8
1 1 package com.lyms.talkonlineweb.mapper;
2 2  
  3 +import org.apache.ibatis.annotations.Param;
3 4 import org.apache.ibatis.annotations.Select;
4 5  
5 6 import java.util.List;
... ... @@ -49,8 +50,8 @@
49 50 Map<String,Object> getSearchSum();
50 51  
51 52 // 科室类别占比
52   - @Select("SELECT hd.`dname`,COUNT(1) cnt FROM lyms_tkrecord tk,lyms_doctor d,lyms_hdepart hd WHERE tk.`did`=d.`did` AND d.`dpid`=hd.`did` GROUP BY hd.`dname`")
53   - List<Map<String,Object>> getDepart();
  53 + @Select("SELECT hd.`dname`,COUNT(1) cnt FROM lyms_tkrecord tk,lyms_doctor d,lyms_hdepart hd WHERE tk.`did`=d.`did` AND d.`dpid`=hd.`did` ${hSql} GROUP BY hd.`dname`")
  54 + List<Map<String,Object>> getDepart(@Param("hSql") String hSql);
54 55  
55 56 @Select("SELECT DATE(s.`createdtime`) dt,COUNT(1) cnt FROM lyms_searchlogs s GROUP BY DATE(s.`createdtime`) ORDER BY cnt DESC LIMIT 7")
56 57 List<Map<String,Object>> getSearchByDay();
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/IndexService.java View file @ c3f30c8
... ... @@ -4,5 +4,7 @@
4 4  
5 5 public interface IndexService {
6 6 Map<String, Object> getVsStat();
  7 +
  8 + Map<String, Object> getDepartStat(Map<String, Object> param);
7 9 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/IndexServiceImpl.java View file @ c3f30c8
... ... @@ -8,6 +8,7 @@
8 8 import java.util.HashMap;
9 9 import java.util.List;
10 10 import java.util.Map;
  11 +import java.util.Objects;
11 12  
12 13 @Service
13 14 public class IndexServiceImpl implements IndexService {
14 15  
... ... @@ -38,10 +39,24 @@
38 39 rs.put("serchSum",indexMapper.getSearchSum());
39 40  
40 41 // 科室类别占比
41   - List<Map<String,Object>> dLst=indexMapper.getDepart();
  42 + List<Map<String,Object>> dLst=indexMapper.getDepart("");
42 43 rs.put("depart",dLst);
43 44 rs.put("departCnt",dLst.stream().mapToInt(m-> Math.toIntExact((long) m.get("cnt"))).sum());
44 45  
  46 + return rs;
  47 + }
  48 +
  49 + @Override
  50 + public Map<String, Object> getDepartStat(Map<String, Object> param) {
  51 + Map<String, Object> rs=new HashMap<>();
  52 + String hSql="";
  53 + if(Objects.nonNull(param.get("hid"))){
  54 + hSql=" AND hd.`hid`= "+param.get("hid");
  55 + }
  56 + // 科室类别占比
  57 + List<Map<String,Object>> dLst=indexMapper.getDepart(hSql);
  58 + rs.put("depart",dLst);
  59 + rs.put("departCnt",dLst.stream().mapToInt(m-> Math.toIntExact((long) m.get("cnt"))).sum());
45 60 return rs;
46 61 }
47 62 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/HXTask.java View file @ c3f30c8
... ... @@ -27,7 +27,7 @@
27 27 @Autowired
28 28 private LymsDictService lymsDictService;
29 29  
30   - @Scheduled(initialDelay=1000, fixedRate=5000)
  30 +// @Scheduled(initialDelay=1000, fixedRate=5000)
31 31 public void checkDoctorStat(){
32 32 Map<String,Object> param=new HashMap<>();
33 33  
talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java View file @ c3f30c8
... ... @@ -37,7 +37,7 @@
37 37 @Autowired
38 38 private LymsDictService lymsDictService;
39 39  
40   - @Scheduled(initialDelay=1000, fixedRate=5000)
  40 +// @Scheduled(initialDelay=1000, fixedRate=5000)
41 41 public void pushArtcle(){
42 42  
43 43 Map<String,Object> param=new HashMap<>();