Commit 3f75d838c2ab4e3b7f26b70f03beb22ebb8d8db3

Authored by yangfei

Merge remote-tracking branch 'origin/master'

Showing 15 changed files

platform-dal/src/main/java/com/lyms/platform/pojo/CourseModel.java View file @ 3f75d83
... ... @@ -75,6 +75,18 @@
75 75 //是否发送过推送 字段不存在表示未推送,1已推送
76 76 private Integer isSend;
77 77  
  78 + //发布时间
  79 + private Date publishTime;
  80 +
  81 +
  82 + public Date getPublishTime() {
  83 + return publishTime;
  84 + }
  85 +
  86 + public void setPublishTime(Date publishTime) {
  87 + this.publishTime = publishTime;
  88 + }
  89 +
78 90 public Integer getIsSend() {
79 91 return isSend;
80 92 }
platform-dal/src/main/java/com/lyms/platform/query/CourseQuery.java View file @ 3f75d83
... ... @@ -32,6 +32,11 @@
32 32  
33 33 private Date courseTimeEnd;
34 34  
  35 + //课程发布时间
  36 + private Date publishTimeStart;
  37 +
  38 + private Date publishTimeEnd;
  39 +
35 40 //时长
36 41 private String timeLong;
37 42  
... ... @@ -116,7 +121,7 @@
116 121 condition = condition.and("status", status, MongoOper.IS);
117 122 }
118 123  
119   - if (!isSend) {
  124 + if (isSend) {
120 125 condition = condition.and("isSend", false, MongoOper.EXISTS);
121 126 }
122 127  
123 128  
... ... @@ -171,7 +176,22 @@
171 176 }
172 177  
173 178  
  179 + if (null != publishTimeStart) {
  180 + if (null != c1) {
  181 + c1 = c1.and("publishTime").gte(publishTimeStart);
  182 + } else {
  183 + c1 = Criteria.where("publishTime").gte(publishTimeStart);
  184 + }
  185 + }
174 186  
  187 + if (null != publishTimeEnd) {
  188 + if (null != c1) {
  189 + c1 = c1.lte(publishTimeEnd);
  190 + } else {
  191 + c1 = Criteria.where("publishTime").lte(publishTimeEnd);
  192 + }
  193 + }
  194 +
175 195 if (null != createdStart) {
176 196 if (null != c1) {
177 197 c1 = c1.and("created").gte(createdStart);
... ... @@ -192,6 +212,22 @@
192 212 condition = condition.andCondition(new MongoCondition(c1));
193 213 }
194 214 return condition.toMongoQuery();
  215 + }
  216 +
  217 + public Date getPublishTimeStart() {
  218 + return publishTimeStart;
  219 + }
  220 +
  221 + public void setPublishTimeStart(Date publishTimeStart) {
  222 + this.publishTimeStart = publishTimeStart;
  223 + }
  224 +
  225 + public Date getPublishTimeEnd() {
  226 + return publishTimeEnd;
  227 + }
  228 +
  229 + public void setPublishTimeEnd(Date publishTimeEnd) {
  230 + this.publishTimeEnd = publishTimeEnd;
195 231 }
196 232  
197 233 public boolean isSend() {
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 3f75d83
... ... @@ -1325,6 +1325,14 @@
1325 1325 c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd);
1326 1326 }
1327 1327 }
  1328 + else if (fmDateStart != null)
  1329 + {
  1330 + if (null != c1) {
  1331 + c1 = c1.and("fmDate").gte(fmDateStart);
  1332 + } else {
  1333 + c1 = Criteria.where("fmDate").gte(fmDateStart);
  1334 + }
  1335 + }
1328 1336  
1329 1337 if (null != serviceType) {
1330 1338 condition = condition.and("serviceType", serviceType, MongoOper.IS);
platform-msg-generate/src/main/java/com/lyms/platform/msg/controller/MsgGenerateController.java View file @ 3f75d83
... ... @@ -87,6 +87,22 @@
87 87  
88 88  
89 89 /**
  90 + * 孕妇课程
  91 + * @param hospitalId
  92 + * @return
  93 + */
  94 + @RequestMapping(method = RequestMethod.GET, value = "/generateCourseMsg")
  95 + @ResponseBody
  96 + public String generateCourseMsg(@RequestParam(required = false) String hospitalId)
  97 + {
  98 +
  99 + logger.info("The request hospital id is {} ", hospitalId);
  100 + msgGenerateService.generateCourseMsg(hospitalId);
  101 + return "";
  102 + }
  103 +
  104 +
  105 + /**
90 106 * 生成所有
91 107 * @return
92 108 */
platform-msg-generate/src/main/java/com/lyms/platform/msg/service/impl/MsgGenerateServiceImpl.java View file @ 3f75d83
... ... @@ -196,10 +196,10 @@
196 196 CourseQuery query = new CourseQuery();
197 197 query.setYn(YnEnums.YES.getId());
198 198 query.setStatus(CourseStatusEnums.YFB.getId());
199   - query.setIsSend(false);
  199 + query.setIsSend(true);//未发送过推送
200 200 String currentDate = DateUtil.getyyyy_MM_dd(new Date());
201   - query.setCreatedStart(DateUtil.parseYMD(currentDate));
202   - query.setCreatedEnd(DateUtil.parseYMDHMS(currentDate + " 23:59:59"));
  201 + query.setPublishTimeStart(DateUtil.parseYMD(currentDate));
  202 + query.setPublishTimeEnd(DateUtil.parseYMDHMS(currentDate + " 23:59:59"));
203 203  
204 204 if (StringUtils.isNotEmpty(generateHospitalId))
205 205 {
... ... @@ -220,8 +220,7 @@
220 220 CourseMsgGenerateWorker worker = new CourseMsgGenerateWorker(courseModels.subList(i,end),
221 221 baseService,
222 222 yunBookbuildingService,
223   - smsTemplateService,
224   - babyBookbuildingService
  223 + courseService
225 224 );
226 225 pool.execute(worker);
227 226 }
platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/HelperUtils.java View file @ 3f75d83
... ... @@ -62,6 +62,21 @@
62 62 Integer serviceType
63 63 )
64 64 {
  65 + return getMessageRequest( data, phone, serviceObj, msgType, hospitalId, tempId, pid, keyWord1, keyWord2,
  66 + remark, wxTempId, serviceType,SmsTimeTypeEnums.NO_ONTIME.getId());
  67 + }
  68 +
  69 +
  70 +
  71 + public static MsgRequest getMessageRequest(String data,String phone,Integer serviceObj,
  72 + Integer msgType,String hospitalId,
  73 + String tempId,String pid,
  74 + String keyWord1,String keyWord2,
  75 + String remark,String wxTempId,
  76 + Integer serviceType,
  77 + Integer timeType
  78 + )
  79 + {
65 80 MsgRequest request = new MsgRequest();
66 81  
67 82 //1 推送服务, 2 推送和短信服务,3短信服务
68 83  
... ... @@ -75,12 +90,19 @@
75 90 //服务对象 1孕妇 2儿童 3产妇
76 91 request.setObjType(serviceObj);
77 92 request.setPhone(phone);
78   - //计划发送时间
79   - request.setPlanTime(DateUtils.getDateStr(new Date(), DateUtils.Y_M_D)+ " " + ConfigInterface.SEND_TIME +":00");
  93 + if (SmsTimeTypeEnums.NO_ONTIME.getId() == timeType)
  94 + {
  95 + //计划发送时间
  96 + request.setPlanTime(DateUtils.getDateStr(new Date(), DateUtils.Y_M_D)+ " " + ConfigInterface.SEND_TIME +":00");
  97 + }
  98 + else
  99 + {
  100 + request.setPlanTime(DateUtils.getDateStr(new Date(),DateUtils.Y_M_D_H_M_S));
  101 + }
80 102  
81 103 request.setSubTypeId(msgType);
82 104 request.setStatus(MsgStatusEnums.NO_SEND.getId());
83   - request.setTimeType(SmsTimeTypeEnums.NO_ONTIME.getId());
  105 + request.setTimeType(timeType);
84 106 request.setHospitalId(hospitalId);
85 107 request.setPatientId(pid);
86 108 request.setTempId(tempId);
... ... @@ -93,7 +115,6 @@
93 115 request.setRemark(remark);
94 116 return request;
95 117 }
96   -
97 118  
98 119 /**
99 120 * 判断模板对应的服务是否启动
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/ChanAmsMsgGenerateWorker.java View file @ 3f75d83
... ... @@ -98,9 +98,7 @@
98 98 buildType.add(2);
99 99 patientsQuery.setSmsBuildTypeList(buildType);
100 100  
101   -// //末次月经必须大于当前时间减去42周视为为分娩孕妇
102   -// Date lastMensesMax = DateUtil.addDay(new Date(), -42);
103   -// patientsQuery.setLastMensesStart(lastMensesMax);
  101 +
104 102 //健康指导短信 只能是类型为 增值服务 开通状态 才发送
105 103 patientsQuery.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId());
106 104 patientsQuery.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId());
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/CourseMsgGenerateWorker.java View file @ 3f75d83
... ... @@ -45,21 +45,16 @@
45 45  
46 46 private YunBookbuildingService yunBookbuildingService;
47 47  
  48 + private CourseService courseService;
48 49  
49   - private SmsTemplateService smsTemplateService;
50 50  
51   - private BabyBookbuildingService babyBookbuildingService;
52   -
53 51 public CourseMsgGenerateWorker( List<CourseModel> courseModels, IBaseService baseService,
54   - YunBookbuildingService yunBookbuildingService,
55   - SmsTemplateService smsTemplateService,
56   - BabyBookbuildingService babyBookbuildingService)
  52 + YunBookbuildingService yunBookbuildingService,CourseService courseService)
57 53 {
58 54 this.courseModels = courseModels;
59 55 this.baseService = baseService;
60 56 this.yunBookbuildingService = yunBookbuildingService;
61   - this.smsTemplateService = smsTemplateService;
62   - this.babyBookbuildingService = babyBookbuildingService;
  57 + this.courseService = courseService;
63 58 }
64 59  
65 60  
66 61  
... ... @@ -96,13 +91,13 @@
96 91  
97 92 //判断消息服务是否启动
98 93 //0服务不提供,1 推送服务, 2 短信服务,3推送和短信服务
99   - int service = baseService.isStartService(SmsServiceEnums.YBZD.getId(), serviceStr,serviceType);
  94 + int service = baseService.isStartService(SmsServiceEnums.YFXXKCTX.getId(), serviceStr,serviceType);
100 95 if (service == 0)
101 96 {
102 97 continue;
103 98 }
104 99 //课程对象id 0全部/空 1孕期 2儿童 ,3产后 (儿童占时没有)
105   - if (course.getCourseObjId() == null || course.getCourseObjId() == 1)
  100 + if (course.getCourseObjId() == null || course.getCourseObjId() == 0)
106 101 {
107 102 generateYun(course,config,service);
108 103 generateChan(course,config,service);
109 104  
110 105  
111 106  
112 107  
113 108  
114 109  
115 110  
116 111  
117 112  
118 113  
119 114  
... ... @@ -121,71 +116,131 @@
121 116  
122 117 private void generateYun(CourseModel course,SmsConfigModel config,int service)
123 118 {
124   - //发送短信集合
125   - MsgListRequest list = new MsgListRequest();
126   - List<MsgRequest> messages = new ArrayList<>();
127   - PatientsQuery patientsQuery = new PatientsQuery();
128   - patientsQuery.setYn(YnEnums.YES.getId());
129   - patientsQuery.setHospitalId(course.getHospitalId());
130   - patientsQuery.setLimit(1000);
131   - int count = 1;
132   - while (true)
133   - {
134   - List buildType = new ArrayList();
135   - buildType.add(0);
136   - buildType.add(2);
137   - patientsQuery.setSmsBuildTypeList(buildType);
138   - //1孕妇 3 产妇
139   - patientsQuery.setType(1);
140   - //分娩状态
141   - patientsQuery.setDueStatus(0);
  119 + try {
  120 + //发送短信集合
  121 + MsgListRequest list = new MsgListRequest();
  122 + List<MsgRequest> messages = new ArrayList<>();
  123 + PatientsQuery patientsQuery = new PatientsQuery();
  124 + patientsQuery.setYn(YnEnums.YES.getId());
  125 + patientsQuery.setHospitalId(course.getHospitalId());
  126 + patientsQuery.setLimit(2);
  127 + int count = 1;
  128 + while (true)
  129 + {
  130 + logger.info("generateYun course page="+count+";courseName="+course.getCourseName()+";courseId="+course.getId());
  131 + List buildType = new ArrayList();
  132 + buildType.add(0);
  133 + buildType.add(2);
  134 + patientsQuery.setSmsBuildTypeList(buildType);
  135 + //1孕妇 3 产妇
  136 + patientsQuery.setType(1);
  137 + //分娩状态
  138 + patientsQuery.setDueStatus(0);
142 139  
143   - //末次月经必须大于当前时间减去42周视为未分娩孕妇
144   - Date lastMenses = DateUtils.getNewDate(new Date(),-42, "周", 0);
145   - Date lastMensesMax = DateUtils.formatDate(lastMenses,DateUtils.Y_M_D);
146   - patientsQuery.setLastMensesStart(lastMensesMax);
  140 + //末次月经必须大于当前时间减去42周视为未分娩孕妇
  141 + Date lastMenses = DateUtils.getNewDate(new Date(),-42, "周", 0);
  142 + Date lastMensesMax = DateUtils.formatDate(lastMenses,DateUtils.Y_M_D);
  143 + patientsQuery.setLastMensesStart(lastMensesMax);
147 144  
148   - patientsQuery.setNeed("true");
149   - patientsQuery.setPage(count);
  145 + patientsQuery.setNeed("true");
  146 + patientsQuery.setPage(count);
150 147  
151   - //查询符合条件的孕妇
152   - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
153   - if (CollectionUtils.isNotEmpty(patients))
154   - {
155   - for (Patients pat : patients)
  148 + //查询符合条件的孕妇
  149 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  150 + if (CollectionUtils.isNotEmpty(patients))
156 151 {
157   - //消息前缀
158   - String messagePrefix = baseService.getSmsPrefix(config, pat.getBookbuildingDoctor(), ServiceObjEnums.YUNOBJ.getId());
159   - String courseTime = DateUtils.getDateStr(course.getCourseTime(),DateUtils.Y_M_D_H_M)+" ("+DateUtils.getWeekOfDate(course.getCourseTime())+")";
  152 + for (Patients pat : patients)
  153 + {
  154 + //消息前缀
  155 + String messagePrefix = baseService.getSmsPrefix(config, pat.getBookbuildingDoctor(), ServiceObjEnums.YUNOBJ.getId());
  156 + String courseTime = DateUtils.getDateStr(course.getCourseTime(),DateUtils.Y_M_D_H_M)+" ("+DateUtils.getWeekOfDate(course.getCourseTime())+")";
160 157  
161   - String messageContent = "【"+messagePrefix+"】";
162   - MsgRequest request = HelperUtils.getMessageRequest(messageContent, pat.getPhone(),
163   - ServiceObjEnums.YUNOBJ.getId(), SmsServiceEnums.YFXXKCTX.getId(),
164   - course.getHospitalId(), course.getId(), pat.getId(), course.getCourseName(),
165   - course.getCourseSpeaker(), courseTime,
166   - WxTempleteIdEnums.YUN_XUE_KE_CHEN_TX.getId(),service);
  158 + String messageContent = "【"+messagePrefix+"】有新的孕妇学校课程发布啦,点击详情进一步了解和报名啦。";
  159 + MsgRequest request = HelperUtils.getMessageRequest(messageContent, pat.getPhone(),
  160 + ServiceObjEnums.YUNOBJ.getId(), SmsServiceEnums.YFXXKCTX.getId(),
  161 + course.getHospitalId(), course.getId(), pat.getId(), course.getCourseName(),
  162 + course.getCourseSpeaker(), courseTime,
  163 + WxTempleteIdEnums.YUN_XUE_KE_CHEN_TX.getId(),service,SmsTimeTypeEnums.ONTIME.getId());
167 164  
168   - messages.add(request);
  165 + messages.add(request);
  166 + }
169 167 }
  168 + else
  169 + {
  170 + break;
  171 + }
  172 + count++;
  173 + Thread.sleep(2000);
170 174 }
171   - else
172   - {
173   - break;
174   - }
175   - count++;
  175 + list.setMessages(messages);
  176 + HelperUtils.sendMsg(list);
  177 + course.setIsSend(1);
  178 + courseService.updateCourse(course);
  179 + } catch (InterruptedException e) {
  180 + logger.info("generateYun error." + course);
176 181 }
177   - list.setMessages(messages);
178   - HelperUtils.sendMsg(list);
179 182 }
180 183  
181 184 private void generateChan(CourseModel course,SmsConfigModel config,int service)
182 185 {
183   - //发送短信集合
184   - MsgListRequest list = new MsgListRequest();
185   - List<MsgRequest> messages = new ArrayList<>();
  186 + try {
  187 + //发送短信集合
  188 + MsgListRequest list = new MsgListRequest();
  189 + List<MsgRequest> messages = new ArrayList<>();
  190 + PatientsQuery patientsQuery = new PatientsQuery();
  191 + patientsQuery.setYn(YnEnums.YES.getId());
  192 + patientsQuery.setHospitalId(course.getHospitalId());
  193 + patientsQuery.setLimit(2);
  194 + int count = 1;
  195 + while (true)
  196 + {
  197 + logger.info("generateChan course page=" + count + ";courseName=" + course.getCourseName() + ";courseId=" + course.getId());
  198 + List buildType = new ArrayList();
  199 + buildType.add(0);
  200 + buildType.add(2);
  201 + patientsQuery.setSmsBuildTypeList(buildType);
  202 + //1孕妇 3 产妇
  203 + patientsQuery.setType(3);
  204 + //分娩状态
  205 + patientsQuery.setDueStatus(0);
186 206  
187   - list.setMessages(messages);
188   - HelperUtils.sendMsg(list);
  207 + patientsQuery.setNeed("true");
  208 + patientsQuery.setPage(count);
  209 +
  210 + //查询符合条件的孕妇
  211 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  212 + if (CollectionUtils.isNotEmpty(patients))
  213 + {
  214 + for (Patients pat : patients)
  215 + {
  216 + //消息前缀
  217 + String messagePrefix = baseService.getSmsPrefix(config, pat.getBookbuildingDoctor(), ServiceObjEnums.YUNOBJ.getId());
  218 + String courseTime = DateUtils.getDateStr(course.getCourseTime(),DateUtils.Y_M_D_H_M)+" ("+DateUtils.getWeekOfDate(course.getCourseTime())+")";
  219 +
  220 + String messageContent = "【"+messagePrefix+"】有新的孕妇学校课程发布啦,点击详情进一步了解和报名啦。";
  221 + MsgRequest request = HelperUtils.getMessageRequest(messageContent, pat.getPhone(),
  222 + ServiceObjEnums.YUNOBJ.getId(), SmsServiceEnums.YFXXKCTX.getId(),
  223 + course.getHospitalId(), course.getId(), pat.getId(), course.getCourseName(),
  224 + course.getCourseSpeaker(), courseTime,
  225 + WxTempleteIdEnums.YUN_XUE_KE_CHEN_TX.getId(),service,SmsTimeTypeEnums.ONTIME.getId());
  226 +
  227 + messages.add(request);
  228 + }
  229 + }
  230 + else
  231 + {
  232 + break;
  233 + }
  234 + count++;
  235 + Thread.sleep(2000);
  236 + }
  237 + list.setMessages(messages);
  238 + HelperUtils.sendMsg(list);
  239 + course.setIsSend(1);
  240 + courseService.updateCourse(course);
  241 + } catch (InterruptedException e) {
  242 + logger.info("generateChan error."+course);
  243 + }
189 244 }
190 245 }
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java View file @ 3f75d83
... ... @@ -219,6 +219,8 @@
219 219 Integer sendTimeType = template.getSendTimeType();
220 220  
221 221  
  222 + logger.info("generateChildTempMsg info : serviceType = "+serviceType +";templateId="+template.getId()+";smsType="+smsType);
  223 +
222 224 BabyModelQuery babyModelQuery = new BabyModelQuery();
223 225 babyModelQuery.setYn(YnEnums.YES.getId());
224 226 babyModelQuery.setHospitalId(template.getHospitalId());
... ... @@ -829,6 +831,7 @@
829 831 //发送时间 SendTimeEnums DT(0,"当天"),QYT(1,"前一天"),QLT(2,"前两天"),QST(3,"前三天");
830 832 Integer sendTimeType = template.getSendTimeType();
831 833  
  834 + logger.info("generateYunTempMsg info : serviceType = "+serviceType +";templateId="+template.getId()+";smsType="+smsType);
832 835  
833 836 PatientsQuery patientsQuery = new PatientsQuery();
834 837 patientsQuery.setYn(YnEnums.YES.getId());
... ... @@ -983,6 +986,7 @@
983 986 //发送时间 SendTimeEnums DT(0,"当天"),QYT(1,"前一天"),QLT(2,"前两天"),QST(3,"前三天");
984 987 Integer sendTimeType = template.getSendTimeType();
985 988  
  989 + logger.info("generateYunTempMsg info : serviceType = "+serviceType +";templateId="+template.getId()+";smsType="+smsType);
986 990  
987 991 PatientsQuery patientsQuery = new PatientsQuery();
988 992 patientsQuery.setYn(YnEnums.YES.getId());
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CdGwChoice.java View file @ 3f75d83
  1 +package com.lyms.hospitalapi.pojo;
  2 +
  3 +/**
  4 + * Created by Administrator on 2018/4/19.
  5 + */
  6 +public class CdGwChoice {
  7 +
  8 + private String codeType;//类型
  9 + private String code;//代码
  10 + private String name;//名称
  11 +
  12 + public String getCodeType() {
  13 + return codeType;
  14 + }
  15 +
  16 + public void setCodeType(String codeType) {
  17 + this.codeType = codeType;
  18 + }
  19 +
  20 + public String getName() {
  21 + return name;
  22 + }
  23 +
  24 + public void setName(String name) {
  25 + this.name = name;
  26 + }
  27 +
  28 + public String getCode() {
  29 + return code;
  30 + }
  31 +
  32 + public void setCode(String code) {
  33 + this.code = code;
  34 + }
  35 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CdGwDisease.java View file @ 3f75d83
  1 +package com.lyms.hospitalapi.pojo;
  2 +
  3 +/**
  4 + * Created by Administrator on 2018/4/19.
  5 + */
  6 +public class CdGwDisease {
  7 +
  8 + private String diseaseCode;//代码
  9 + private String diseaseName;//名称
  10 + private String confirmDate;//时间
  11 +
  12 + public String getDiseaseCode() {
  13 + return diseaseCode;
  14 + }
  15 +
  16 + public void setDiseaseCode(String diseaseCode) {
  17 + this.diseaseCode = diseaseCode;
  18 + }
  19 +
  20 + public String getDiseaseName() {
  21 + return diseaseName;
  22 + }
  23 +
  24 + public void setDiseaseName(String diseaseName) {
  25 + this.diseaseName = diseaseName;
  26 + }
  27 +
  28 + public String getConfirmDate() {
  29 + return confirmDate;
  30 + }
  31 +
  32 + public void setConfirmDate(String confirmDate) {
  33 + this.confirmDate = confirmDate;
  34 + }
  35 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CdGwPast.java View file @ 3f75d83
  1 +package com.lyms.hospitalapi.pojo;
  2 +
  3 +/**
  4 + * Created by Administrator on 2018/4/19.
  5 + */
  6 +public class CdGwPast {
  7 +
  8 + private String historyType;//手术类型
  9 + private String choiceStatus;//状态
  10 + private String orderNo;//编号
  11 + private String historyName;//名称
  12 + private String confirmDate;//时间
  13 +
  14 + public String getHistoryType() {
  15 + return historyType;
  16 + }
  17 +
  18 + public void setHistoryType(String historyType) {
  19 + this.historyType = historyType;
  20 + }
  21 +
  22 + public String getChoiceStatus() {
  23 + return choiceStatus;
  24 + }
  25 +
  26 + public void setChoiceStatus(String choiceStatus) {
  27 + this.choiceStatus = choiceStatus;
  28 + }
  29 +
  30 + public String getOrderNo() {
  31 + return orderNo;
  32 + }
  33 +
  34 + public void setOrderNo(String orderNo) {
  35 + this.orderNo = orderNo;
  36 + }
  37 +
  38 + public String getHistoryName() {
  39 + return historyName;
  40 + }
  41 +
  42 + public void setHistoryName(String historyName) {
  43 + this.historyName = historyName;
  44 + }
  45 +
  46 + public String getConfirmDate() {
  47 + return confirmDate;
  48 + }
  49 +
  50 + public void setConfirmDate(String confirmDate) {
  51 + this.confirmDate = confirmDate;
  52 + }
  53 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/HealthRecord.java View file @ 3f75d83
1 1 package com.lyms.hospitalapi.pojo;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
4 5  
5 6 /**
6 7 * Created by Administrator on 2018/4/18.
7 8  
... ... @@ -37,8 +38,454 @@
37 38 private String occupationCode;//职业代码
38 39 private String marriageCode;//婚姻状况
39 40 private String medicalPayWay;//医疗费用支付方式
40   - /*private String drugAllergy;//药物过敏史
41   - private String exposureHistory;//暴露史*/
  41 + private List<CdGwChoice> recordChoice;//类型
  42 + private List<CdGwDisease> personDisease;//病史
  43 + private List<CdGwPast> personPastHistory;//手术史
  44 + private String geneticDiseaseHistoryCode;//遗传病史代码
  45 + private String geneticDiseaseHistoryName;//遗传病史名称
  46 + private String isDisabilityEyesight;//是否视力残疾
  47 + private String isDisabilityHearing;//是否听力残疾
  48 + private String isDisabilityLanguage;//是否言语残疾
  49 + private String isDisabilityLimbs;//是否肢体残疾
  50 + private String isDisabilityBrain;//是否智力残疾
  51 + private String isDisabilityMind;//是否精神残疾
  52 + private String kitchenExhaustCode;//厨房排风设施
  53 + private String toiletCode;//厕所
  54 + private String livestockFenceCode;//禽畜栏
  55 + private String createOrgId;//录入机构ID
  56 + private String orgName;//录入机构名称
  57 + private String creatorId;//录入人ID
  58 + private String creator;//录入人名称
  59 + private String modifiedOrgId;//最后修改机构ID
  60 + private String modifiedOrgName;//最后修改机构名称
  61 + private String modifierId;//最后修改人ID
  62 + private String modifier;//最后修改人
  63 + private String remarks;//备注
  64 + private String isAppCreate="9";//上传标识
42 65  
  66 +
  67 + public String getPersonInfoId() {
  68 + return personInfoId;
  69 + }
  70 +
  71 + public void setPersonInfoId(String personInfoId) {
  72 + this.personInfoId = personInfoId;
  73 + }
  74 +
  75 + public String getName() {
  76 + return name;
  77 + }
  78 +
  79 + public void setName(String name) {
  80 + this.name = name;
  81 + }
  82 +
  83 + public String getPinYinStr() {
  84 + return pinYinStr;
  85 + }
  86 +
  87 + public void setPinYinStr(String pinYinStr) {
  88 + this.pinYinStr = pinYinStr;
  89 + }
  90 +
  91 + public String getFormerName() {
  92 + return formerName;
  93 + }
  94 +
  95 + public void setFormerName(String formerName) {
  96 + this.formerName = formerName;
  97 + }
  98 +
  99 + public String getIdNo() {
  100 + return idNo;
  101 + }
  102 +
  103 + public void setIdNo(String idNo) {
  104 + this.idNo = idNo;
  105 + }
  106 +
  107 + public String getTelNo() {
  108 + return telNo;
  109 + }
  110 +
  111 + public void setTelNo(String telNo) {
  112 + this.telNo = telNo;
  113 + }
  114 +
  115 + public Date getBirthday() {
  116 + return birthday;
  117 + }
  118 +
  119 + public void setBirthday(Date birthday) {
  120 + this.birthday = birthday;
  121 + }
  122 +
  123 + public String getAddress() {
  124 + return address;
  125 + }
  126 +
  127 + public void setAddress(String address) {
  128 + this.address = address;
  129 + }
  130 +
  131 + public String getHouseholdAddress() {
  132 + return householdAddress;
  133 + }
  134 +
  135 + public void setHouseholdAddress(String householdAddress) {
  136 + this.householdAddress = householdAddress;
  137 + }
  138 +
  139 + public String getCommittee() {
  140 + return committee;
  141 + }
  142 +
  143 + public void setCommittee(String committee) {
  144 + this.committee = committee;
  145 + }
  146 +
  147 + public String getResidential() {
  148 + return residential;
  149 + }
  150 +
  151 + public void setResidential(String residential) {
  152 + this.residential = residential;
  153 + }
  154 +
  155 + public String getBuilding() {
  156 + return building;
  157 + }
  158 +
  159 + public void setBuilding(String building) {
  160 + this.building = building;
  161 + }
  162 +
  163 + public String getUnit() {
  164 + return unit;
  165 + }
  166 +
  167 + public void setUnit(String unit) {
  168 + this.unit = unit;
  169 + }
  170 +
  171 + public String getRoomNumber() {
  172 + return roomNumber;
  173 + }
  174 +
  175 + public void setRoomNumber(String roomNumber) {
  176 + this.roomNumber = roomNumber;
  177 + }
  178 +
  179 + public String getFixedPhones() {
  180 + return fixedPhones;
  181 + }
  182 +
  183 + public void setFixedPhones(String fixedPhones) {
  184 + this.fixedPhones = fixedPhones;
  185 + }
  186 +
  187 + public String getContactName() {
  188 + return contactName;
  189 + }
  190 +
  191 + public void setContactName(String contactName) {
  192 + this.contactName = contactName;
  193 + }
  194 +
  195 + public String getContactTelNo() {
  196 + return contactTelNo;
  197 + }
  198 +
  199 + public void setContactTelNo(String contactTelNo) {
  200 + this.contactTelNo = contactTelNo;
  201 + }
  202 +
  203 + public String getWorkUnit() {
  204 + return workUnit;
  205 + }
  206 +
  207 + public void setWorkUnit(String workUnit) {
  208 + this.workUnit = workUnit;
  209 + }
  210 +
  211 + public String getResidenceTypeCode() {
  212 + return residenceTypeCode;
  213 + }
  214 +
  215 + public void setResidenceTypeCode(String residenceTypeCode) {
  216 + this.residenceTypeCode = residenceTypeCode;
  217 + }
  218 +
  219 + public String getHouseholdTypeCode() {
  220 + return householdTypeCode;
  221 + }
  222 +
  223 + public void setHouseholdTypeCode(String householdTypeCode) {
  224 + this.householdTypeCode = householdTypeCode;
  225 + }
  226 +
  227 + public String getNationalityCode() {
  228 + return nationalityCode;
  229 + }
  230 +
  231 + public void setNationalityCode(String nationalityCode) {
  232 + this.nationalityCode = nationalityCode;
  233 + }
  234 +
  235 + public String getNationalityValue() {
  236 + return nationalityValue;
  237 + }
  238 +
  239 + public void setNationalityValue(String nationalityValue) {
  240 + this.nationalityValue = nationalityValue;
  241 + }
  242 +
  243 + public String getPersonInfoSno() {
  244 + return personInfoSno;
  245 + }
  246 +
  247 + public void setPersonInfoSno(String personInfoSno) {
  248 + this.personInfoSno = personInfoSno;
  249 + }
  250 +
  251 + public String getAboCode() {
  252 + return aboCode;
  253 + }
  254 +
  255 + public void setAboCode(String aboCode) {
  256 + this.aboCode = aboCode;
  257 + }
  258 +
  259 + public String getRhCode() {
  260 + return rhCode;
  261 + }
  262 +
  263 + public void setRhCode(String rhCode) {
  264 + this.rhCode = rhCode;
  265 + }
  266 +
  267 + public String getEducationCode() {
  268 + return educationCode;
  269 + }
  270 +
  271 + public void setEducationCode(String educationCode) {
  272 + this.educationCode = educationCode;
  273 + }
  274 +
  275 + public String getOccupationCode() {
  276 + return occupationCode;
  277 + }
  278 +
  279 + public void setOccupationCode(String occupationCode) {
  280 + this.occupationCode = occupationCode;
  281 + }
  282 +
  283 + public String getMarriageCode() {
  284 + return marriageCode;
  285 + }
  286 +
  287 + public void setMarriageCode(String marriageCode) {
  288 + this.marriageCode = marriageCode;
  289 + }
  290 +
  291 + public String getMedicalPayWay() {
  292 + return medicalPayWay;
  293 + }
  294 +
  295 + public void setMedicalPayWay(String medicalPayWay) {
  296 + this.medicalPayWay = medicalPayWay;
  297 + }
  298 +
  299 + public List<CdGwChoice> getRecordChoice() {
  300 + return recordChoice;
  301 + }
  302 +
  303 + public void setRecordChoice(List<CdGwChoice> recordChoice) {
  304 + this.recordChoice = recordChoice;
  305 + }
  306 +
  307 + public List<CdGwDisease> getPersonDisease() {
  308 + return personDisease;
  309 + }
  310 +
  311 + public void setPersonDisease(List<CdGwDisease> personDisease) {
  312 + this.personDisease = personDisease;
  313 + }
  314 +
  315 + public List<CdGwPast> getPersonPastHistory() {
  316 + return personPastHistory;
  317 + }
  318 +
  319 + public void setPersonPastHistory(List<CdGwPast> personPastHistory) {
  320 + this.personPastHistory = personPastHistory;
  321 + }
  322 +
  323 + public String getGeneticDiseaseHistoryCode() {
  324 + return geneticDiseaseHistoryCode;
  325 + }
  326 +
  327 + public void setGeneticDiseaseHistoryCode(String geneticDiseaseHistoryCode) {
  328 + this.geneticDiseaseHistoryCode = geneticDiseaseHistoryCode;
  329 + }
  330 +
  331 + public String getGeneticDiseaseHistoryName() {
  332 + return geneticDiseaseHistoryName;
  333 + }
  334 +
  335 + public void setGeneticDiseaseHistoryName(String geneticDiseaseHistoryName) {
  336 + this.geneticDiseaseHistoryName = geneticDiseaseHistoryName;
  337 + }
  338 +
  339 + public String getIsDisabilityEyesight() {
  340 + return isDisabilityEyesight;
  341 + }
  342 +
  343 + public void setIsDisabilityEyesight(String isDisabilityEyesight) {
  344 + this.isDisabilityEyesight = isDisabilityEyesight;
  345 + }
  346 +
  347 + public String getIsDisabilityHearing() {
  348 + return isDisabilityHearing;
  349 + }
  350 +
  351 + public void setIsDisabilityHearing(String isDisabilityHearing) {
  352 + this.isDisabilityHearing = isDisabilityHearing;
  353 + }
  354 +
  355 + public String getIsDisabilityLanguage() {
  356 + return isDisabilityLanguage;
  357 + }
  358 +
  359 + public void setIsDisabilityLanguage(String isDisabilityLanguage) {
  360 + this.isDisabilityLanguage = isDisabilityLanguage;
  361 + }
  362 +
  363 + public String getIsDisabilityLimbs() {
  364 + return isDisabilityLimbs;
  365 + }
  366 +
  367 + public void setIsDisabilityLimbs(String isDisabilityLimbs) {
  368 + this.isDisabilityLimbs = isDisabilityLimbs;
  369 + }
  370 +
  371 + public String getIsDisabilityBrain() {
  372 + return isDisabilityBrain;
  373 + }
  374 +
  375 + public void setIsDisabilityBrain(String isDisabilityBrain) {
  376 + this.isDisabilityBrain = isDisabilityBrain;
  377 + }
  378 +
  379 + public String getIsDisabilityMind() {
  380 + return isDisabilityMind;
  381 + }
  382 +
  383 + public void setIsDisabilityMind(String isDisabilityMind) {
  384 + this.isDisabilityMind = isDisabilityMind;
  385 + }
  386 +
  387 + public String getKitchenExhaustCode() {
  388 + return kitchenExhaustCode;
  389 + }
  390 +
  391 + public void setKitchenExhaustCode(String kitchenExhaustCode) {
  392 + this.kitchenExhaustCode = kitchenExhaustCode;
  393 + }
  394 +
  395 + public String getToiletCode() {
  396 + return toiletCode;
  397 + }
  398 +
  399 + public void setToiletCode(String toiletCode) {
  400 + this.toiletCode = toiletCode;
  401 + }
  402 +
  403 + public String getLivestockFenceCode() {
  404 + return livestockFenceCode;
  405 + }
  406 +
  407 + public void setLivestockFenceCode(String livestockFenceCode) {
  408 + this.livestockFenceCode = livestockFenceCode;
  409 + }
  410 +
  411 + public String getCreateOrgId() {
  412 + return createOrgId;
  413 + }
  414 +
  415 + public void setCreateOrgId(String createOrgId) {
  416 + this.createOrgId = createOrgId;
  417 + }
  418 +
  419 + public String getOrgName() {
  420 + return orgName;
  421 + }
  422 +
  423 + public void setOrgName(String orgName) {
  424 + this.orgName = orgName;
  425 + }
  426 +
  427 + public String getCreatorId() {
  428 + return creatorId;
  429 + }
  430 +
  431 + public void setCreatorId(String creatorId) {
  432 + this.creatorId = creatorId;
  433 + }
  434 +
  435 + public String getCreator() {
  436 + return creator;
  437 + }
  438 +
  439 + public void setCreator(String creator) {
  440 + this.creator = creator;
  441 + }
  442 +
  443 + public String getModifiedOrgId() {
  444 + return modifiedOrgId;
  445 + }
  446 +
  447 + public void setModifiedOrgId(String modifiedOrgId) {
  448 + this.modifiedOrgId = modifiedOrgId;
  449 + }
  450 +
  451 + public String getModifiedOrgName() {
  452 + return modifiedOrgName;
  453 + }
  454 +
  455 + public void setModifiedOrgName(String modifiedOrgName) {
  456 + this.modifiedOrgName = modifiedOrgName;
  457 + }
  458 +
  459 + public String getModifierId() {
  460 + return modifierId;
  461 + }
  462 +
  463 + public void setModifierId(String modifierId) {
  464 + this.modifierId = modifierId;
  465 + }
  466 +
  467 + public String getModifier() {
  468 + return modifier;
  469 + }
  470 +
  471 + public void setModifier(String modifier) {
  472 + this.modifier = modifier;
  473 + }
  474 +
  475 + public String getRemarks() {
  476 + return remarks;
  477 + }
  478 +
  479 + public void setRemarks(String remarks) {
  480 + this.remarks = remarks;
  481 + }
  482 +
  483 + public String getIsAppCreate() {
  484 + return isAppCreate;
  485 + }
  486 +
  487 + public void setIsAppCreate(String isAppCreate) {
  488 + this.isAppCreate = isAppCreate;
  489 + }
43 490 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 3f75d83
... ... @@ -2763,66 +2763,104 @@
2763 2763  
2764 2764 public BaseResponse getGongGaoLine(String patientId, Integer id) {
2765 2765  
2766   - Map<String, Object> map = new HashMap<>();
  2766 + Map<String,Object> map = new HashMap<>();
2767 2767  
2768 2768 List<String> titles = new ArrayList<>();
2769 2769 List<String> values = new ArrayList<>();
2770 2770  
2771 2771  
2772   - List<Map<String, String>> tables = new LinkedList<>();
  2772 + Patients patients = patientsService.findOnePatientById(patientId);
2773 2773  
  2774 + List<String> patientIds = new ArrayList<>();
  2775 +
  2776 + if (patients != null)
  2777 + {
  2778 + PatientsQuery patientsQuery = new PatientsQuery();
  2779 + patientsQuery.setYn(YnEnums.YES.getId());
  2780 + patientsQuery.setPid(patients.getPid());
  2781 + List<Patients> patientses = patientsService.queryPatient(patientsQuery);
  2782 + if (CollectionUtils.isNotEmpty(patientses))
  2783 + {
  2784 + for (Patients pat : patientses)
  2785 + {
  2786 + patientIds.add(pat.getId());
  2787 + }
  2788 + }
  2789 + }
  2790 + else
  2791 + {
  2792 + patientIds.add(patientId);
  2793 + }
  2794 +
  2795 + List<Map<String,String>> tables = new LinkedList<>();
  2796 +
2774 2797 AntExChuQuery antExChuQuery = new AntExChuQuery();
2775 2798 antExChuQuery.setYn(YnEnums.YES.getId());
2776   - antExChuQuery.setParentId(patientId);
2777   - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
2778   - if (CollectionUtils.isNotEmpty(antExChuModels)) {
2779   - AntExChuModel chumodel = antExChuModels.get(0);
2780   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
2781   - Map<String, String> item = new HashMap<>();
2782   - String value = "";
2783   - if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
2784   - if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) {
2785   - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType());
2786   - } else {
2787   - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect());
  2799 + antExChuQuery.setParentIds(patientIds);
  2800 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery,Sort.Direction.ASC, "created");
  2801 + if (CollectionUtils.isNotEmpty(antExChuModels))
  2802 + {
  2803 + for (AntExChuModel chumodel : antExChuModels)
  2804 + {
  2805 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect()))
  2806 + {
  2807 + Map<String,String> item = new HashMap<>();
  2808 + String value = "";
  2809 + if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect()) )
  2810 + {
  2811 + if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) {
  2812 + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType());
  2813 + } else {
  2814 + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect());
  2815 + }
2788 2816 }
2789   - } else if (StringUtils.isNotEmpty(chumodel.getGonggao())) {
2790   - value = chumodel.getGonggao();
  2817 + else if (StringUtils.isNotEmpty(chumodel.getGonggao()))
  2818 + {
  2819 + value = chumodel.getGonggao();
  2820 + }
  2821 + item.put("value", value);
  2822 + item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
  2823 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches()))
  2824 + {
  2825 + titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
  2826 + values.add(chumodel.getGonggao());
  2827 + }
  2828 + tables.add(item);
2791 2829 }
2792   - item.put("value", value);
2793   - item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2794   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches())) {
2795   - titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2796   - values.add(chumodel.getGonggao());
2797   - }
2798   - tables.add(item);
2799 2830 }
2800 2831 }
2801 2832  
2802 2833  
2803 2834 AntExQuery antExQuery = new AntExQuery();
2804   - antExQuery.setParentId(patientId);
  2835 + antExQuery.setParentIds(patientIds);
2805 2836 antExQuery.setYn(YnEnums.YES.getId());
2806 2837 List<AntenatalExaminationModel> examinationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.ASC, "created"));
2807   - if (CollectionUtils.isNotEmpty(examinationModelList)) {
2808   - for (AntenatalExaminationModel anmodel : examinationModelList) {
2809   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
2810   - Map<String, String> item = new HashMap<>();
  2838 + if (CollectionUtils.isNotEmpty(examinationModelList))
  2839 + {
  2840 + for (AntenatalExaminationModel anmodel : examinationModelList)
  2841 + {
  2842 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect()))
  2843 + {
  2844 + Map<String,String> item = new HashMap<>();
2811 2845  
2812 2846 String value = "";
2813   - if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
  2847 + if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect()) )
  2848 + {
2814 2849 if (StringUtils.isNotEmpty(anmodel.getGongGaoType())) {
2815 2850 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(anmodel.getGongGaoType());
2816 2851 } else {
2817 2852 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect());
2818 2853 }
2819   - } else if (StringUtils.isNotEmpty(anmodel.getGongGao())) {
  2854 + }
  2855 + else if (StringUtils.isNotEmpty(anmodel.getGongGao()))
  2856 + {
2820 2857 value = anmodel.getGongGao();
2821 2858 }
2822 2859  
2823 2860 item.put("value", value);
2824 2861 item.put("time", DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2825   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches())) {
  2862 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches()))
  2863 + {
2826 2864 titles.add(DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2827 2865 values.add(anmodel.getGongGao());
2828 2866 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java View file @ 3f75d83
... ... @@ -7,11 +7,15 @@
7 7 import com.lyms.platform.common.constants.ErrorCodeConstants;
8 8 import com.lyms.platform.common.enums.CourseStatusEnums;
9 9 import com.lyms.platform.common.enums.OptActionEnums;
  10 +import com.lyms.platform.common.enums.SmsServiceEnums;
10 11 import com.lyms.platform.common.enums.YnEnums;
11 12 import com.lyms.platform.common.result.BaseListResponse;
12 13 import com.lyms.platform.common.result.BaseObjectResponse;
13 14 import com.lyms.platform.common.result.BaseResponse;
14 15 import com.lyms.platform.common.utils.DateUtil;
  16 +import com.lyms.platform.common.utils.HttpClientUtil;
  17 +import com.lyms.platform.common.utils.JsonUtil;
  18 +import com.lyms.platform.common.utils.PropertiesUtils;
15 19 import com.lyms.platform.operate.web.request.CourseRequest;
16 20 import com.lyms.platform.operate.web.result.CourseResult;
17 21 import com.lyms.platform.operate.web.result.CourseTypeResult;
... ... @@ -37,6 +41,8 @@
37 41 @Component
38 42 public class CourseFacade {
39 43  
  44 + public static final String CENTER_BASE_URL= PropertiesUtils.getPropertyValue("center_base_url");
  45 +
40 46 @Autowired
41 47 private CourseService courseService;
42 48  
... ... @@ -230,6 +236,7 @@
230 236 model.setStatus(CourseStatusEnums.YFB.getId());
231 237 model.setId(id);
232 238 model.setModified(new Date());
  239 + model.setPublishTime(new Date());
233 240 courseService.updateCourse(model);
234 241 }
235 242  
... ... @@ -369,7 +376,8 @@
369 376 query.setYn(YnEnums.YES.getId());
370 377 query.setHospitalId(hospitalId);
371 378  
372   - int allSends = 0; //TODO
  379 + int allSends = getCourseCountData(hospitalId, String.valueOf(SmsServiceEnums.YFXXKCTX.getId()), 3,
  380 + 1,null, null, null);
373 381  
374 382 PatientCourseQuery patientCourseQuery = new PatientCourseQuery();
375 383 patientCourseQuery.setYn(YnEnums.YES.getId());
376 384  
377 385  
378 386  
... ... @@ -394,19 +402,24 @@
394 402 resultData.put("allCourses",allCourses); //课程数
395 403 resultData.put("allSends",allSends); //总推送数
396 404 resultData.put("allOrders",allOrders); //总预约数
397   - resultData.put("allOrderRate",allCourses == 0 ? 0 : df.format((double) allOrders / allPatientCourses * 100) + "%"); //总预约率
398   - resultData.put("allSigns",allSigns);//总签到数
399   - resultData.put("allSignRate",allCourses == 0 ? 0 : df.format((double) allSigns / allPatientCourses * 100) + "%");//总签到率
  405 + resultData.put("allOrderRate", allCourses == 0 ? 0 : df.format((double) allOrders / allPatientCourses * 100) + "%"); //总预约率
  406 + resultData.put("allSigns", allSigns);//总签到数
  407 + resultData.put("allSignRate", allCourses == 0 ? 0 : df.format((double) allSigns / allPatientCourses * 100) + "%");//总签到率
400 408  
401 409 CourseTypeQuery courseTypeQuery = new CourseTypeQuery();
402 410 courseTypeQuery.setHospitalId(hospitalId);
403 411 courseTypeQuery.setYn(YnEnums.YES.getId());
404 412  
  413 + String start = null;
  414 + String end = null;
  415 +
405 416 if (StringUtils.isNotEmpty(time)) {
406 417 String[] dates = time.split(" - ");
407   - patientCourseQuery.setCreatedStart(DateUtil.parseYMD(dates[0]));
  418 + start = dates[0];
  419 + patientCourseQuery.setCreatedStart(DateUtil.parseYMD(start));
408 420 if (dates.length == 2) {
409   - patientCourseQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59"));
  421 + end = dates[1];
  422 + patientCourseQuery.setCreatedEnd(DateUtil.parseYMDHMS(end + " 23:59:59"));
410 423 }
411 424 }
412 425  
... ... @@ -435,7 +448,8 @@
435 448 int courseSigns = patientCourseService.queryPatientCourseCount(patientCourseQuery);
436 449 signs.add(courseSigns);
437 450  
438   - int courseSends = 0; //TODO
  451 + int courseSends = getCourseCountData(hospitalId, String.valueOf(SmsServiceEnums.YFXXKCTX.getId()), 3,
  452 + 1,courseModel.getId(), start, end);
439 453 sends.add(courseSends);
440 454  
441 455 courseTypeQuery.setId(courseModel.getCourseTypeId());
... ... @@ -447,7 +461,7 @@
447 461 tableMap.put("courseTypeName",CollectionUtils.isNotEmpty(typeModels) ? typeModels.get(0).getCourseTypeName() : "");
448 462 tableMap.put("courseName",courseModel.getCourseName());
449 463  
450   - tableMap.put("sends",0);//TODO
  464 + tableMap.put("sends",courseSends);
451 465 tableMap.put("orders",courseOrders);
452 466 tableMap.put("ordersRate",allCourses == 0 ? "0" : df.format((double) courseOrders / allPatientCourses * 100) + "%");
453 467 tableMap.put("signs",courseSigns);
... ... @@ -470,5 +484,35 @@
470 484 objectResponse.setErrormsg("成功");
471 485 return objectResponse;
472 486 }
  487 +
  488 +
  489 + private int getCourseCountData(String hospitalId,
  490 + String subTypeId,
  491 + Integer status,
  492 + Integer sendType,
  493 + String tempId,
  494 + String createTimeStart,
  495 + String createTimeEnd)
  496 + {
  497 + Map<String,String> param = new HashMap<>();
  498 +
  499 + param.put("hospitalId",hospitalId);
  500 + param.put("subTypeId",subTypeId);
  501 + param.put("tempId",tempId == null ? null : String.valueOf(tempId));
  502 + param.put("status",status == null ? null : String.valueOf(status));
  503 + param.put("sendType",sendType == null ? null : String.valueOf(sendType));
  504 + param.put("createTimeStart",createTimeStart);
  505 + param.put("createTimeEnd",createTimeEnd);
  506 +
  507 + String result = HttpClientUtil.doGet(CENTER_BASE_URL + "/biz-push-web/push", param, "utf-8", null);
  508 +
  509 + Map<String,String> map = JsonUtil.str2Obj(result, Map.class);
  510 + if ("0".equals(map.get("errorcode")))
  511 + {
  512 + return Integer.parseInt(map.get("object"));
  513 + }
  514 + return 0;
  515 + }
  516 +
473 517 }