Commit f60f5e71aa0016469cd26634915e9751f20a4007

Authored by jiangjiazhi
1 parent 009874cca2

增加统计

Showing 6 changed files with 223 additions and 15 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java View file @ f60f5e7
... ... @@ -48,6 +48,47 @@
48 48 //操纵者
49 49 private String operator;
50 50  
  51 + //户籍地
  52 + private String registerAddr;
  53 + //居住地
  54 + private String addr;
  55 + //首次建档医院
  56 + private String firstBH;
  57 + //分娩医院
  58 + private String fCh;
  59 +
  60 + public String getRegisterAddr() {
  61 + return registerAddr;
  62 + }
  63 +
  64 + public void setRegisterAddr(String registerAddr) {
  65 + this.registerAddr = registerAddr;
  66 + }
  67 +
  68 + public String getAddr() {
  69 + return addr;
  70 + }
  71 +
  72 + public void setAddr(String addr) {
  73 + this.addr = addr;
  74 + }
  75 +
  76 + public String getFirstBH() {
  77 + return firstBH;
  78 + }
  79 +
  80 + public void setFirstBH(String firstBH) {
  81 + this.firstBH = firstBH;
  82 + }
  83 +
  84 + public String getfCh() {
  85 + return fCh;
  86 + }
  87 +
  88 + public void setfCh(String fCh) {
  89 + this.fCh = fCh;
  90 + }
  91 +
51 92 public String getOperator() {
52 93 return operator;
53 94 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java View file @ f60f5e7
... ... @@ -59,6 +59,47 @@
59 59 //操纵者
60 60 private String operator;
61 61  
  62 + //户籍地
  63 + private String registerAddr;
  64 + //居住地
  65 + private String addr;
  66 + //首次建档医院
  67 + private String firstBH;
  68 + //当前产检医院
  69 + private String currentCh;
  70 +
  71 + public String getRegisterAddr() {
  72 + return registerAddr;
  73 + }
  74 +
  75 + public void setRegisterAddr(String registerAddr) {
  76 + this.registerAddr = registerAddr;
  77 + }
  78 +
  79 + public String getAddr() {
  80 + return addr;
  81 + }
  82 +
  83 + public void setAddr(String addr) {
  84 + this.addr = addr;
  85 + }
  86 +
  87 + public String getFirstBH() {
  88 + return firstBH;
  89 + }
  90 +
  91 + public void setFirstBH(String firstBH) {
  92 + this.firstBH = firstBH;
  93 + }
  94 +
  95 + public String getCurrentCh() {
  96 + return currentCh;
  97 + }
  98 +
  99 + public void setCurrentCh(String currentCh) {
  100 + this.currentCh = currentCh;
  101 + }
  102 +
62 103 public String getOperator() {
63 104 return operator;
64 105 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java View file @ f60f5e7
... ... @@ -69,6 +69,47 @@
69 69 //服务状态
70 70 private String serviceStatus;
71 71  
  72 + //户籍地
  73 + private String registerAddr;
  74 + //居住地
  75 + private String addr;
  76 + //首次建档医院
  77 + private String firstBH;
  78 + //当前产检医院
  79 + private String currentCh;
  80 +
  81 + public String getRegisterAddr() {
  82 + return registerAddr;
  83 + }
  84 +
  85 + public void setRegisterAddr(String registerAddr) {
  86 + this.registerAddr = registerAddr;
  87 + }
  88 +
  89 + public String getAddr() {
  90 + return addr;
  91 + }
  92 +
  93 + public void setAddr(String addr) {
  94 + this.addr = addr;
  95 + }
  96 +
  97 + public String getFirstBH() {
  98 + return firstBH;
  99 + }
  100 +
  101 + public void setFirstBH(String firstBH) {
  102 + this.firstBH = firstBH;
  103 + }
  104 +
  105 + public String getCurrentCh() {
  106 + return currentCh;
  107 + }
  108 +
  109 + public void setCurrentCh(String currentCh) {
  110 + this.currentCh = currentCh;
  111 + }
  112 +
72 113 public String getServiceType() {
73 114 return serviceType;
74 115 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java View file @ f60f5e7
... ... @@ -8,7 +8,9 @@
8 8 import com.lyms.platform.operate.web.facade.PatientFacade;
9 9 import com.lyms.platform.operate.web.facade.SmsConfigFacade;
10 10 import com.lyms.platform.operate.web.result.QuanChanResult;
  11 +import com.lyms.platform.operate.web.utils.CommonsHelper;
11 12 import com.lyms.platform.permission.model.Users;
  13 +import com.lyms.platform.permission.service.OrganizationService;
12 14 import com.lyms.platform.permission.service.UsersService;
13 15 import com.lyms.platform.pojo.MaternalDeliverModel;
14 16 import com.lyms.platform.pojo.Patients;
15 17  
16 18  
... ... @@ -46,18 +48,22 @@
46 48  
47 49 private MatDeliverService matDeliverService;
48 50 private String hospital;
  51 + private OrganizationService organizationService;
  52 + private BasicConfigService basicConfigService;
49 53  
50 54 public QuanChanPatientWorker(List<Patients> patientses,
51 55 String hospital,
52 56 UsersService usersService,
53 57 PostReviewService postReviewService,
54   - MatDeliverService matDeliverService,PatientsService patientsService) {
  58 + MatDeliverService matDeliverService,PatientsService patientsService,OrganizationService organizationService,BasicConfigService basicConfigService) {
55 59 this.patientses = patientses;
56 60 this.matDeliverService = matDeliverService;
57 61 this.postReviewService = postReviewService;
58 62 this.patientsService=patientsService;
59 63 this.hospital = hospital;
60 64 this.usersService = usersService;
  65 + this.organizationService=organizationService;
  66 + this.basicConfigService=basicConfigService;
61 67 }
62 68  
63 69  
... ... @@ -83,6 +89,15 @@
83 89 chanResult.setlName(patients.getBookbuildingDoctor());
84 90 }
85 91 }
  92 +
  93 + //注册地址
  94 + chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
  95 + chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  96 + try {
  97 + chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
  98 + } catch (Exception e) {
  99 + chanResult.setFirstBH("");
  100 + }
86 101 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
87 102 matDeliverQuery.setPid(patients.getPid());
88 103 matDeliverQuery.setCreatedStart(patients.getLastMenses());
... ... @@ -91,6 +106,12 @@
91 106 List<MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery);
92 107 if (CollectionUtils.isNotEmpty(maternalDeliverModels)) {
93 108 chanResult.setDueWeek(maternalDeliverModels.get(0).getDueDate());
  109 +
  110 + try {
  111 + chanResult.setfCh(organizationService.getOrganization(Integer.valueOf(maternalDeliverModels.get(0).getHospitalId())).getName());
  112 + } catch (Exception e) {
  113 + chanResult.setfCh("");
  114 + }
94 115 }
95 116 stopWatch.stop();
96 117 //复查次数
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ f60f5e7
... ... @@ -13,7 +13,10 @@
13 13 import com.lyms.platform.operate.web.facade.PatientFacade;
14 14 import com.lyms.platform.operate.web.result.HighScoreResult;
15 15 import com.lyms.platform.operate.web.result.QuanPatientsResult;
  16 +import com.lyms.platform.operate.web.utils.CommonsHelper;
  17 +import com.lyms.platform.permission.model.Organization;
16 18 import com.lyms.platform.permission.model.Users;
  19 +import com.lyms.platform.permission.service.OrganizationService;
17 20 import com.lyms.platform.permission.service.UsersService;
18 21 import com.lyms.platform.pojo.AntExChuModel;
19 22 import com.lyms.platform.pojo.AntenatalExaminationModel;
20 23  
21 24  
... ... @@ -46,18 +49,20 @@
46 49 private AntenatalExaminationService antExService;
47 50 private BasicConfigService basicConfigService;
48 51 private PatientsService patientsService;
  52 + private OrganizationService organizationService;
49 53  
50 54 public QuanPatientWorker(List<Patients> patientses,
51 55 UsersService usersService,
52 56 String hospital,
53 57 AntenatalExaminationService antExService,
54   - BasicConfigService basicConfigService,PatientsService patientsService) {
  58 + BasicConfigService basicConfigService,PatientsService patientsService,OrganizationService organizationService) {
55 59 this.patientses = patientses;
56 60 this.usersService = usersService;
57 61 this.antExService = antExService;
58 62 this.hospital = hospital;
59 63 this.basicConfigService = basicConfigService;
60 64 this.patientsService=patientsService;
  65 + this.organizationService=organizationService;
61 66 }
62 67  
63 68 @Override
... ... @@ -87,7 +92,25 @@
87 92 antExQuery.setHospitalId(null);
88 93 stopWatch.start("query ant count");
89 94 //复诊次数
90   - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery());
  95 + List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
  96 + int i = 0;
  97 + if (CollectionUtils.isNotEmpty(ant)) {
  98 + //复诊次数
  99 + i = ant.size();
  100 + for (AntenatalExaminationModel a : ant) {
  101 + try {
  102 + if(StringUtils.isNotEmpty(a.getHospitalId())){
  103 + Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId()));
  104 + if(null!=og){
  105 + quanPatientsResult.setCurrentCh(og.getName());
  106 + break;
  107 + }
  108 + }
  109 + } catch (Exception e) {
  110 + quanPatientsResult.setCurrentCh("");
  111 + }
  112 + }
  113 + }
91 114 antExChuQuery.setPid(patients.getPid());
92 115 antExChuQuery.setYn(YnEnums.YES.getId());
93 116 antExChuQuery.setHospitalId(null);
... ... @@ -173,6 +196,15 @@
173 196 }
174 197 }
175 198 stopWatch.stop();
  199 + //注册地址
  200 + quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
  201 + quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  202 + try {
  203 + quanPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
  204 + } catch (Exception e) {
  205 + quanPatientsResult.setFirstBH("");
  206 + }
  207 +
176 208 quanPatientsResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType()));
177 209 quanPatientsResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus()));
178 210 //修改获取建档里面的高危等级不用在重新去算
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java View file @ f60f5e7
... ... @@ -13,7 +13,10 @@
13 13 import com.lyms.platform.operate.web.facade.PatientFacade;
14 14 import com.lyms.platform.operate.web.result.HighScoreResult;
15 15 import com.lyms.platform.operate.web.result.RiskPatientsResult;
  16 +import com.lyms.platform.operate.web.utils.CommonsHelper;
  17 +import com.lyms.platform.permission.model.Organization;
16 18 import com.lyms.platform.permission.model.Users;
  19 +import com.lyms.platform.permission.service.OrganizationService;
17 20 import com.lyms.platform.permission.service.UsersService;
18 21 import com.lyms.platform.pojo.AntExChuModel;
19 22 import com.lyms.platform.pojo.AntenatalExaminationModel;
20 23  
... ... @@ -33,9 +36,7 @@
33 36 import java.util.concurrent.Callable;
34 37  
35 38 /**
36   - *
37 39 * 高危孕妇列表线程处理
38   - *
39 40 */
40 41 public class WorkHR implements Callable<List<RiskPatientsResult>> {
41 42  
42 43  
43 44  
... ... @@ -48,15 +49,18 @@
48 49 private String hospital;
49 50 private PatientsService patientsService;
50 51  
  52 + private OrganizationService organizationService;
  53 +
51 54 public WorkHR(List<Patients> patientses, UsersService usersService, String hospital,
52 55 BasicConfigService basicConfigService,
53   - AntenatalExaminationService antExService,PatientsService patientsService) {
  56 + AntenatalExaminationService antExService, PatientsService patientsService,OrganizationService organizationService) {
54 57 this.patientses = patientses;
55 58 this.usersService = usersService;
56 59 this.hospital = hospital;
57 60 this.basicConfigService = basicConfigService;
58 61 this.antExService = antExService;
59   - this.patientsService=patientsService;
  62 + this.patientsService = patientsService;
  63 + this.organizationService=organizationService;
60 64 }
61 65  
62 66 public List<RiskPatientsResult> call() {
... ... @@ -85,8 +89,26 @@
85 89 antExQuery.setYn(YnEnums.YES.getId());
86 90 antExQuery.setHospitalId(null);
87 91 stopWatch.start("cap antex count");
88   - //复诊次数
89   - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery());
  92 + List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
  93 + int i = 0;
  94 + if (CollectionUtils.isNotEmpty(ant)) {
  95 + //复诊次数
  96 + i = ant.size();
  97 + for (AntenatalExaminationModel a : ant) {
  98 + try {
  99 + if(StringUtils.isNotEmpty(a.getHospitalId())){
  100 + Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId()));
  101 + if(null!=og){
  102 + riskPatientsResult.setCurrentCh(og.getName());
  103 + break;
  104 + }
  105 + }
  106 + } catch (Exception e) {
  107 + riskPatientsResult.setCurrentCh("");
  108 + }
  109 + }
  110 + }
  111 +
90 112 antExChuQuery.setPid(patients.getPid());
91 113 antExChuQuery.setYn(YnEnums.YES.getId());
92 114 //初诊次数
... ... @@ -126,7 +148,7 @@
126 148 return 0;
127 149 }
128 150 });
129   - Patients patients1=new Patients();
  151 + Patients patients1 = new Patients();
130 152 patients1.setId(patients.getId());
131 153 patients1.setLastCTime(list.get(0));
132 154 patientsService.updatePatient(patients1);
133 155  
134 156  
... ... @@ -153,14 +175,23 @@
153 175 riskPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
154 176 }
155 177 }
156   - Patients patients1=new Patients();
  178 + Patients patients1 = new Patients();
157 179 patients1.setId(patients.getId());
158 180 patients1.setLastCTime(list.get(0).getCheckTime());
159 181 patientsService.updatePatient(patients1);
160 182 }
161 183 }
162 184 stopWatch.stop();
  185 + //注册地址
  186 + riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
  187 + riskPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  188 + try {
  189 + riskPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
  190 + } catch (Exception e) {
  191 + riskPatientsResult.setFirstBH("");
  192 + }
163 193  
  194 +
164 195 riskPatientsResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType()));
165 196 riskPatientsResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus()));
166 197 riskPatientsResult.setcTime(nextCheckTime);
... ... @@ -200,7 +231,7 @@
200 231 if (name.indexOf("预警") > -1) {
201 232 name = name.replace("预警", "");
202 233 }
203   - map.put("name",name);
  234 + map.put("name", name);
204 235 map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
205 236 level.add(map);
206 237 }
207 238  
... ... @@ -218,14 +249,15 @@
218 249 }
219 250 return dataList;
220 251 }
221   - public static void main(String[] args){
  252 +
  253 + public static void main(String[] args) {
222 254 List level = new ArrayList();
223 255 Map map = new HashMap();
224 256 String name = "黄色预警";
225 257 if (name.indexOf("预警") > -1) {
226 258 name = name.replace("预警", "");
227 259 }
228   - map.put("name",name);
  260 + map.put("name", name);
229 261 map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
230 262  
231 263 Map map1 = new HashMap();
... ... @@ -233,7 +265,7 @@
233 265 if (name.indexOf("预警") > -1) {
234 266 name1 = name1.replace("预警", "");
235 267 }
236   - map1.put("name",name1);
  268 + map1.put("name", name1);
237 269 map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name1));
238 270 level.add(map1);
239 271