Commit 27a0453a83fbf88d393289cb69609d55bd97de02
Exists in
dev
Merge branch 'dev' of https://git.healthbaby.com.cn/jiangjiazhi/regional-platform into dev
Showing 11 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/MsgDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/CourseEvalDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/MygDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CourseEvalService.java
- platform-common/src/main/java/com/lyms/platform/common/enums/PatientSerEnums.java
- platform-dal/src/main/java/com/lyms/platform/pojo/CourseModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/MsgModel.java
- platform-dal/src/main/java/com/lyms/platform/query/MsgQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CourseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/MsgDao.java
View file @
27a0453
1 | +package com.lyms.platform.biz.dal; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
4 | +import com.lyms.platform.pojo.CourseModel; | |
5 | +import com.lyms.platform.pojo.MsgModel; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +public interface MsgDao { | |
10 | + public int queryMsgListCount(MongoQuery mongoQuery); | |
11 | + | |
12 | + public List<MsgModel> queryMsgList(MongoQuery query); | |
13 | + | |
14 | + public void addMsg(MsgModel model); | |
15 | + | |
16 | + public void updateMsg(MongoQuery mongoQuery, MsgModel model); | |
17 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/CourseEvalDaoImpl.java
View file @
27a0453
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.lyms.platform.common.dao.BaseMongoDAOImpl; |
5 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
6 | 6 | import com.lyms.platform.pojo.CourseEvaluateModel; |
7 | +import com.lyms.platform.pojo.MsgModel; | |
7 | 8 | import org.springframework.stereotype.Repository; |
8 | 9 | |
9 | 10 | import java.util.List; |
... | ... | @@ -32,5 +33,7 @@ |
32 | 33 | public void updateCourseEval(MongoQuery mongoQuery,CourseEvaluateModel model) { |
33 | 34 | update(mongoQuery.convertToMongoQuery(),model); |
34 | 35 | } |
36 | + | |
37 | + | |
35 | 38 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/MygDaoImpl.java
View file @
27a0453
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.ICourseEvalDao; | |
4 | +import com.lyms.platform.biz.dal.MsgDao; | |
5 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
6 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
7 | +import com.lyms.platform.pojo.CourseEvaluateModel; | |
8 | +import com.lyms.platform.pojo.CourseModel; | |
9 | +import com.lyms.platform.pojo.MsgModel; | |
10 | +import org.springframework.stereotype.Repository; | |
11 | + | |
12 | +import java.util.List; | |
13 | +@Repository("msgDao") | |
14 | + | |
15 | +public class MygDaoImpl extends BaseMongoDAOImpl<MsgModel> implements MsgDao { | |
16 | + | |
17 | + @Override | |
18 | + public int queryMsgListCount(MongoQuery mongoQuery) { | |
19 | + return (int)count(mongoQuery.convertToMongoQuery()); | |
20 | + } | |
21 | + | |
22 | + @Override | |
23 | + public List<MsgModel> queryMsgList(MongoQuery query) { | |
24 | + return find(query.convertToMongoQuery()); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public void addMsg(MsgModel model) { | |
29 | + save(model); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public void updateMsg(MongoQuery mongoQuery, MsgModel model) { | |
34 | + update(mongoQuery.convertToMongoQuery(),model); | |
35 | + } | |
36 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CourseEvalService.java
View file @
27a0453
... | ... | @@ -2,12 +2,15 @@ |
2 | 2 | |
3 | 3 | |
4 | 4 | import com.lyms.platform.biz.dal.ICourseEvalDao; |
5 | +import com.lyms.platform.biz.dal.MsgDao; | |
5 | 6 | import com.lyms.platform.common.dao.operator.MongoCondition; |
6 | 7 | import com.lyms.platform.common.dao.operator.MongoOper; |
7 | 8 | import com.lyms.platform.common.dao.operator.MongoQuery; |
8 | 9 | import com.lyms.platform.common.enums.YnEnums; |
9 | 10 | import com.lyms.platform.pojo.CourseEvaluateModel; |
11 | +import com.lyms.platform.pojo.MsgModel; | |
10 | 12 | import com.lyms.platform.query.CourseEvalQuery; |
13 | +import com.lyms.platform.query.MsgQuery; | |
11 | 14 | import org.apache.commons.collections.CollectionUtils; |
12 | 15 | import org.apache.commons.lang.StringUtils; |
13 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -23,6 +26,8 @@ |
23 | 26 | @Autowired |
24 | 27 | private ICourseEvalDao courseEvalDao; |
25 | 28 | |
29 | + @Autowired | |
30 | + private MsgDao msgDao; | |
26 | 31 | public List<CourseEvaluateModel> queryCourseEvalList(CourseEvalQuery courseEvalQuery) { |
27 | 32 | |
28 | 33 | MongoQuery query = courseEvalQuery.convertToQuery(); |
... | ... | @@ -59,5 +64,21 @@ |
59 | 64 | return null; |
60 | 65 | } |
61 | 66 | |
67 | + public List<MsgModel> queryMsgList(MsgQuery msgQuery) { | |
68 | + MongoQuery query = msgQuery.convertToQuery(); | |
69 | + if (StringUtils.isNotEmpty(msgQuery.getNeed())) { | |
70 | + msgQuery.mysqlBuild(msgDao.queryMsgListCount(msgQuery.convertToQuery())); | |
71 | + query.start(msgQuery.getOffset()).end(msgQuery.getLimit()); | |
72 | + } | |
73 | + return msgDao.queryMsgList(query.addOrder(Sort.Direction.DESC, "created")); | |
74 | + } | |
75 | + | |
76 | + public void addMsg(MsgModel model) { | |
77 | + msgDao.addMsg(model); | |
78 | + } | |
79 | + | |
80 | + public void updateMsg(MsgModel model) { | |
81 | + msgDao.updateMsg(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)), model); | |
82 | + } | |
62 | 83 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/PatientSerEnums.java
View file @
27a0453
... | ... | @@ -223,7 +223,7 @@ |
223 | 223 | else |
224 | 224 | { |
225 | 225 | for (SerTypeEnums enums : SerTypeEnums.values()) { |
226 | - if (enums.getId() < 10) { | |
226 | + if (enums.getId() < 10 || enums.getId() == 20) { | |
227 | 227 | Map<String, Object> resultMap = new HashMap<>(); |
228 | 228 | resultMap.put("id", enums.getId()); |
229 | 229 | resultMap.put("name", enums.getTitle()); |
platform-dal/src/main/java/com/lyms/platform/pojo/CourseModel.java
View file @
27a0453
... | ... | @@ -79,6 +79,26 @@ |
79 | 79 | //发布时间 |
80 | 80 | private Date publishTime; |
81 | 81 | |
82 | + //视频 | |
83 | + private String courseVideo; | |
84 | + | |
85 | + private byte[][] chunks; | |
86 | + | |
87 | + public byte[][] getChunks() { | |
88 | + return chunks; | |
89 | + } | |
90 | + | |
91 | + public void setChunks(byte[][] chunks) { | |
92 | + this.chunks = chunks; | |
93 | + } | |
94 | + | |
95 | + public String getCourseVideo() { | |
96 | + return courseVideo; | |
97 | + } | |
98 | + | |
99 | + public void setCourseVideo(String courseVideo) { | |
100 | + this.courseVideo = courseVideo; | |
101 | + } | |
82 | 102 | |
83 | 103 | public Date getPublishTime() { |
84 | 104 | return publishTime; |
platform-dal/src/main/java/com/lyms/platform/pojo/MsgModel.java
View file @
27a0453
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
4 | +import com.lyms.platform.beans.SerialIdEnum; | |
5 | +import com.lyms.platform.common.result.BaseModel; | |
6 | +import org.springframework.data.mongodb.core.mapping.Document; | |
7 | +import org.springframework.format.annotation.DateTimeFormat; | |
8 | + | |
9 | +import java.util.Date; | |
10 | + | |
11 | +@Document(collection="lyms_msg") | |
12 | +public class MsgModel extends BaseModel { | |
13 | + private static final long serialVersionUID = SerialIdEnum.ModularFunctionConfigModel.getCid(); | |
14 | + | |
15 | + //消息id | |
16 | + private String id; | |
17 | + //1.用户端APP 2. 医生端APP | |
18 | + private Integer type; | |
19 | + //消息内容 | |
20 | + private String content; | |
21 | + //发布人id | |
22 | + private Integer publishId; | |
23 | + //发布人名称 | |
24 | + private String publishName; | |
25 | + //1.有效 2.无效 | |
26 | + private Integer yn; | |
27 | + //最后修改时间 | |
28 | + | |
29 | + private String modified; | |
30 | + //创建时间 | |
31 | + | |
32 | + private String created; | |
33 | + //状态 0.未读 1.已读 | |
34 | + private Integer state; | |
35 | + // | |
36 | + private Integer oarentId; | |
37 | + //标题0.医生停诊通知 1.检查停诊通知 2.医院放假通知 | |
38 | + private Integer title; | |
39 | + | |
40 | + private String hospitalId; | |
41 | + | |
42 | + private String readIds; | |
43 | + | |
44 | + private String readCount; | |
45 | + | |
46 | + public String getReadCount() { | |
47 | + return readCount; | |
48 | + } | |
49 | + | |
50 | + public void setReadCount(String readCount) { | |
51 | + this.readCount = readCount; | |
52 | + } | |
53 | + | |
54 | + public String getReadIds() { | |
55 | + return readIds; | |
56 | + } | |
57 | + | |
58 | + public void setReadIds(String readIds) { | |
59 | + this.readIds = readIds; | |
60 | + } | |
61 | + | |
62 | + public String getHospitalId() { | |
63 | + return hospitalId; | |
64 | + } | |
65 | + | |
66 | + public void setHospitalId(String hospitalId) { | |
67 | + this.hospitalId = hospitalId; | |
68 | + } | |
69 | + | |
70 | + public String getId() { | |
71 | + return id; | |
72 | + } | |
73 | + | |
74 | + public void setId(String id) { | |
75 | + this.id = id; | |
76 | + } | |
77 | + | |
78 | + public Integer getType() { | |
79 | + return type; | |
80 | + } | |
81 | + | |
82 | + public void setType(Integer type) { | |
83 | + this.type = type; | |
84 | + } | |
85 | + | |
86 | + public String getContent() { | |
87 | + return content; | |
88 | + } | |
89 | + | |
90 | + public void setContent(String content) { | |
91 | + this.content = content; | |
92 | + } | |
93 | + | |
94 | + public Integer getPublishId() { | |
95 | + return publishId; | |
96 | + } | |
97 | + | |
98 | + public void setPublishId(Integer publishId) { | |
99 | + this.publishId = publishId; | |
100 | + } | |
101 | + | |
102 | + public String getPublishName() { | |
103 | + return publishName; | |
104 | + } | |
105 | + | |
106 | + public void setPublishName(String publishName) { | |
107 | + this.publishName = publishName; | |
108 | + } | |
109 | + | |
110 | + public Integer getYn() { | |
111 | + return yn; | |
112 | + } | |
113 | + | |
114 | + public void setYn(Integer yn) { | |
115 | + this.yn = yn; | |
116 | + } | |
117 | + | |
118 | + public String getModified() { | |
119 | + return modified; | |
120 | + } | |
121 | + | |
122 | + public void setModified(String modified) { | |
123 | + this.modified = modified; | |
124 | + } | |
125 | + | |
126 | + public String getCreated() { | |
127 | + return created; | |
128 | + } | |
129 | + | |
130 | + public void setCreated(String created) { | |
131 | + this.created = created; | |
132 | + } | |
133 | + | |
134 | + public Integer getState() { | |
135 | + return state; | |
136 | + } | |
137 | + | |
138 | + public void setState(Integer state) { | |
139 | + this.state = state; | |
140 | + } | |
141 | + | |
142 | + public Integer getOarentId() { | |
143 | + return oarentId; | |
144 | + } | |
145 | + | |
146 | + public void setOarentId(Integer oarentId) { | |
147 | + this.oarentId = oarentId; | |
148 | + } | |
149 | + | |
150 | + public Integer getTitle() { | |
151 | + return title; | |
152 | + } | |
153 | + | |
154 | + public void setTitle(Integer title) { | |
155 | + this.title = title; | |
156 | + } | |
157 | +} |
platform-dal/src/main/java/com/lyms/platform/query/MsgQuery.java
View file @
27a0453
1 | +package com.lyms.platform.query; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
4 | +import com.lyms.platform.common.dao.BaseQuery; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | + | |
9 | +import java.util.Date; | |
10 | + | |
11 | +public class MsgQuery extends BaseQuery implements IConvertToNativeQuery { | |
12 | + | |
13 | + //消息id | |
14 | + private Integer id; | |
15 | + //1.用户端APP 2. 医生端APP | |
16 | + private Integer type; | |
17 | + //消息内容 | |
18 | + private String content; | |
19 | + //发布人id | |
20 | + private Integer publishId; | |
21 | + //发布人名称 | |
22 | + private String publishName; | |
23 | + //1.有效 2.无效 | |
24 | + private Integer yn; | |
25 | + //最后修改时间 | |
26 | + private Date modified; | |
27 | + //创建时间 | |
28 | + private Date created; | |
29 | + //状态 0.已读 1.未读 | |
30 | + private Integer state; | |
31 | + // | |
32 | + private Integer parentId; | |
33 | + //标题0.医生停诊通知 1.检查停诊通知 2.医院放假通知 | |
34 | + private Integer title; | |
35 | + | |
36 | + private String hospitalId; | |
37 | + | |
38 | + private String readIds; | |
39 | + | |
40 | + private String readCount; | |
41 | + | |
42 | + public String getReadCount() { | |
43 | + return readCount; | |
44 | + } | |
45 | + | |
46 | + public void setReadCount(String readCount) { | |
47 | + this.readCount = readCount; | |
48 | + } | |
49 | + | |
50 | + public String getReadIds() { | |
51 | + return readIds; | |
52 | + } | |
53 | + | |
54 | + public void setReadIds(String readIds) { | |
55 | + this.readIds = readIds; | |
56 | + } | |
57 | + | |
58 | + public String getHospitalId() { | |
59 | + return hospitalId; | |
60 | + } | |
61 | + | |
62 | + public void setHospitalId(String hospitalId) { | |
63 | + this.hospitalId = hospitalId; | |
64 | + } | |
65 | + | |
66 | + public Integer getId() { | |
67 | + return id; | |
68 | + } | |
69 | + | |
70 | + public void setId(Integer id) { | |
71 | + this.id = id; | |
72 | + } | |
73 | + | |
74 | + public Integer getType() { | |
75 | + return type; | |
76 | + } | |
77 | + | |
78 | + public void setType(Integer type) { | |
79 | + this.type = type; | |
80 | + } | |
81 | + | |
82 | + public String getContent() { | |
83 | + return content; | |
84 | + } | |
85 | + | |
86 | + public void setContent(String content) { | |
87 | + this.content = content; | |
88 | + } | |
89 | + | |
90 | + public Integer getPublishId() { | |
91 | + return publishId; | |
92 | + } | |
93 | + | |
94 | + public void setPublishId(Integer publishId) { | |
95 | + this.publishId = publishId; | |
96 | + } | |
97 | + | |
98 | + public String getPublishName() { | |
99 | + return publishName; | |
100 | + } | |
101 | + | |
102 | + public void setPublishName(String publishName) { | |
103 | + this.publishName = publishName; | |
104 | + } | |
105 | + | |
106 | + public Integer getYn() { | |
107 | + return yn; | |
108 | + } | |
109 | + | |
110 | + public void setYn(Integer yn) { | |
111 | + this.yn = yn; | |
112 | + } | |
113 | + | |
114 | + public Date getModified() { | |
115 | + return modified; | |
116 | + } | |
117 | + | |
118 | + public void setModified(Date modified) { | |
119 | + this.modified = modified; | |
120 | + } | |
121 | + | |
122 | + public Date getCreated() { | |
123 | + return created; | |
124 | + } | |
125 | + | |
126 | + public void setCreated(Date created) { | |
127 | + this.created = created; | |
128 | + } | |
129 | + | |
130 | + public Integer getState() { | |
131 | + return state; | |
132 | + } | |
133 | + | |
134 | + public void setState(Integer state) { | |
135 | + this.state = state; | |
136 | + } | |
137 | + | |
138 | + public Integer getParentId() { | |
139 | + return parentId; | |
140 | + } | |
141 | + | |
142 | + public void setParentId(Integer parentId) { | |
143 | + this.parentId = parentId; | |
144 | + } | |
145 | + | |
146 | + public Integer getTitle() { | |
147 | + return title; | |
148 | + } | |
149 | + | |
150 | + public void setTitle(Integer title) { | |
151 | + this.title = title; | |
152 | + } | |
153 | + | |
154 | + @Override | |
155 | + public MongoQuery convertToQuery() { | |
156 | + MongoCondition condition = MongoCondition.newInstance(); | |
157 | + if(null != id){ | |
158 | + condition = condition.and("id", id, MongoOper.IS); | |
159 | + } | |
160 | + if(null != type){ | |
161 | + condition = condition.and("type", type, MongoOper.IS); | |
162 | + } | |
163 | + if(null != content){ | |
164 | + condition = condition.and("content", content, MongoOper.IS); | |
165 | + }if(null != publishId){ | |
166 | + condition = condition.and("publishId", publishId, MongoOper.IS); | |
167 | + }if(null != publishName){ | |
168 | + condition = condition.and("publishName", publishName, MongoOper.IS); | |
169 | + }if(null != yn){ | |
170 | + condition = condition.and("yn", yn, MongoOper.IS); | |
171 | + }if(null != modified){ | |
172 | + condition = condition.and("modified", modified, MongoOper.IS); | |
173 | + }if(null != created){ | |
174 | + condition = condition.and("created", created, MongoOper.IS); | |
175 | + }if(null != state){ | |
176 | + condition = condition.and("state", state, MongoOper.IS); | |
177 | + }if(null != parentId){ | |
178 | + condition = condition.and("parentId", parentId, MongoOper.IS); | |
179 | + }if(null != title){ | |
180 | + condition = condition.and("title", title, MongoOper.IS); | |
181 | + } | |
182 | + return condition.toMongoQuery(); | |
183 | + } | |
184 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CourseController.java
View file @
27a0453
... | ... | @@ -9,11 +9,23 @@ |
9 | 9 | import com.lyms.platform.operate.web.facade.CourseFacade; |
10 | 10 | import com.lyms.platform.operate.web.request.CourseRequest; |
11 | 11 | import com.lyms.platform.pojo.CourseEvaluateModel; |
12 | +import com.lyms.platform.pojo.MsgModel; | |
12 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
14 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
15 | + | |
16 | +import org.springframework.data.mongodb.gridfs.GridFsOperations; | |
17 | +import org.springframework.http.HttpStatus; | |
13 | 18 | import org.springframework.stereotype.Controller; |
14 | 19 | import org.springframework.web.bind.annotation.*; |
15 | - | |
20 | +import org.springframework.web.multipart.MultipartFile; | |
21 | +import org.bson.types.ObjectId; | |
16 | 22 | import javax.servlet.http.HttpServletRequest; |
23 | +import javax.swing.text.Document; | |
24 | +import java.io.File; | |
25 | +import java.io.IOException; | |
26 | +import java.io.InputStream; | |
27 | +import org.springframework.http.ResponseEntity; | |
28 | +import org.springframework.web.servlet.mvc.support.RedirectAttributes; | |
17 | 29 | |
18 | 30 | |
19 | 31 | /** |
20 | 32 | |
... | ... | @@ -274,6 +286,86 @@ |
274 | 286 | return courseFacade.queryCourseEvalById(id); |
275 | 287 | } |
276 | 288 | |
289 | + /* | |
290 | + * 视频上传 | |
291 | + * | |
292 | + * */ | |
293 | + @RequestMapping(method = RequestMethod.POST, value = "/upload") | |
294 | + @ResponseBody | |
295 | + @TokenRequired | |
296 | + public String upload(@RequestParam("file") MultipartFile file) { | |
297 | + if (file.isEmpty()) { | |
298 | + return "Please select a file to upload."; | |
299 | + } | |
300 | + try { | |
301 | + byte[] bytes = file.getBytes(); | |
302 | + String uploadDir = "F:/"; | |
303 | + File uploadedFile = new File(uploadDir + file.getOriginalFilename()); | |
304 | + file.transferTo(uploadedFile); | |
305 | + return "File uploaded successfully!"; | |
306 | + } catch (IOException e) { | |
307 | + e.printStackTrace(); | |
308 | + return "File upload failed!"; | |
309 | + } | |
310 | + } | |
277 | 311 | |
312 | + | |
313 | + /* | |
314 | + * 消息通知列表 | |
315 | + * */ | |
316 | + @RequestMapping(method = RequestMethod.GET, value = "/msgList") | |
317 | + @ResponseBody | |
318 | + @TokenRequired | |
319 | + public BaseResponse msgList(@RequestParam Integer page, | |
320 | + @RequestParam Integer limit, | |
321 | + HttpServletRequest request) { | |
322 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
323 | + return courseFacade.msgList(page,limit,loginState.getId()); | |
324 | + } | |
325 | + | |
326 | + /* | |
327 | + * 发布消息 | |
328 | + * */ | |
329 | + @RequestMapping(method = RequestMethod.POST, value = "/msgAdd") | |
330 | + @ResponseBody | |
331 | + @TokenRequired | |
332 | + public BaseResponse msgAdd(@RequestBody MsgModel model, HttpServletRequest request) { | |
333 | + return courseFacade.msgAdd(model,getUserId(request)); | |
334 | + } | |
335 | + | |
336 | + /* | |
337 | + * 编辑消息 | |
338 | + * */ | |
339 | + @RequestMapping(method = RequestMethod.POST, value = "/msgUpdate") | |
340 | + @ResponseBody | |
341 | + @TokenRequired | |
342 | + public BaseResponse msgUpdate(@RequestBody MsgModel model, | |
343 | + HttpServletRequest request) { | |
344 | + return courseFacade.msgUpdate(model,getUserId(request)); | |
345 | + } | |
346 | + | |
347 | + /** | |
348 | + * 删除消息 | |
349 | + * @param request | |
350 | + * @param id | |
351 | + * @return | |
352 | + */ | |
353 | + @RequestMapping(method = RequestMethod.DELETE, value = "/deleteMsgById/{id}") | |
354 | + @ResponseBody | |
355 | + @TokenRequired | |
356 | + public BaseResponse deleteMsgById(HttpServletRequest request, @PathVariable(value = "id") String id) { | |
357 | + return courseFacade.deleteMsgById(id); | |
358 | + } | |
359 | + | |
360 | + | |
361 | + /* | |
362 | + * 消息通知列表 | |
363 | + * */ | |
364 | + @RequestMapping(method = RequestMethod.GET, value = "/getMsgList") | |
365 | + @ResponseBody | |
366 | + public BaseResponse msgList( | |
367 | + HttpServletRequest request) { | |
368 | + return courseFacade.getMsgList(); | |
369 | + } | |
278 | 370 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
View file @
27a0453
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.google.common.base.Strings; |
5 | 5 | import com.lyms.platform.beans.MsgRequest; |
6 | 6 | import com.lyms.platform.biz.service.*; |
7 | +import com.lyms.platform.common.base.LoginContext; | |
7 | 8 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
8 | 9 | import com.lyms.platform.common.enums.*; |
9 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
10 | 11 | |
11 | 12 | |
12 | 13 | |
13 | 14 | |
... | ... | @@ -20,16 +21,27 @@ |
20 | 21 | import com.lyms.platform.permission.service.UsersService; |
21 | 22 | import com.lyms.platform.pojo.*; |
22 | 23 | import com.lyms.platform.query.*; |
24 | +import com.mongodb.BasicDBObject; | |
25 | +import com.mongodb.DBObject; | |
23 | 26 | import org.apache.commons.collections.CollectionUtils; |
24 | 27 | import org.apache.commons.lang3.StringUtils; |
25 | 28 | import org.slf4j.Logger; |
26 | 29 | import org.slf4j.LoggerFactory; |
27 | 30 | import org.springframework.beans.factory.annotation.Autowired; |
28 | 31 | import org.springframework.beans.factory.annotation.Qualifier; |
32 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
33 | +import org.springframework.data.mongodb.core.query.Update; | |
34 | +import org.springframework.data.mongodb.core.query.Query; | |
35 | +import org.springframework.data.mongodb.core.query.Criteria; | |
36 | +import org.springframework.stereotype.Service; | |
37 | +import org.springframework.data.mongodb.gridfs.GridFsTemplate; | |
29 | 38 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
30 | 39 | import org.springframework.stereotype.Component; |
40 | +import org.springframework.web.multipart.MultipartFile; | |
31 | 41 | |
42 | +import java.io.IOException; | |
32 | 43 | import java.text.DecimalFormat; |
44 | +import java.text.SimpleDateFormat; | |
33 | 45 | import java.util.*; |
34 | 46 | import java.util.concurrent.Callable; |
35 | 47 | import java.util.concurrent.Future; |
36 | 48 | |
... | ... | @@ -72,7 +84,11 @@ |
72 | 84 | @Autowired |
73 | 85 | private PatientsService patientsService; |
74 | 86 | |
87 | + | |
75 | 88 | @Autowired |
89 | + private MongoTemplate mongoTemplate; | |
90 | + | |
91 | + @Autowired | |
76 | 92 | @Qualifier("commonThreadPool") |
77 | 93 | private ThreadPoolTaskExecutor commonThreadPool; |
78 | 94 | private static Logger logger = LoggerFactory.getLogger(CourseFacade.class); |
... | ... | @@ -1120,6 +1136,94 @@ |
1120 | 1136 | } |
1121 | 1137 | } |
1122 | 1138 | return new BaseObjectResponse().setData(results).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
1139 | + } | |
1140 | + | |
1141 | + public BaseResponse msgList(Integer page, Integer limit,Integer userId) { | |
1142 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
1143 | + MsgQuery msgQuery = new MsgQuery(); | |
1144 | + msgQuery.setYn(YnEnums.YES.getId()); | |
1145 | + msgQuery.setNeed("true"); | |
1146 | + msgQuery.setLimit(limit); | |
1147 | + msgQuery.setPage(page); | |
1148 | + msgQuery.setHospitalId(hospitalId); | |
1149 | + BaseListResponse objectResponse = new BaseListResponse(); | |
1150 | + List<MsgModel> models = courseEvalService.queryMsgList(msgQuery); | |
1151 | + objectResponse.setData(models); | |
1152 | + objectResponse.setPageInfo(msgQuery.getPageInfo()); | |
1153 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1154 | + objectResponse.setErrormsg("成功"); | |
1155 | + return objectResponse; | |
1156 | + } | |
1157 | + | |
1158 | + public BaseResponse msgAdd(MsgModel model,Integer userId) { | |
1159 | + | |
1160 | + | |
1161 | + BaseResponse objectResponse = new BaseResponse(); | |
1162 | + | |
1163 | + Date day=new Date(); | |
1164 | + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
1165 | + model.setCreated(df.format(day)); | |
1166 | + model.setState(0); | |
1167 | + model.setYn(YnEnums.YES.getId()); | |
1168 | + //发布人id | |
1169 | + model.setPublishId(userId); | |
1170 | + model.setHospitalId(model.getHospitalId()); | |
1171 | + courseEvalService.addMsg(model); | |
1172 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1173 | + objectResponse.setErrormsg("成功"); | |
1174 | + return objectResponse; | |
1175 | + } | |
1176 | + | |
1177 | + public BaseResponse msgUpdate(MsgModel model,Integer userId) { | |
1178 | + BaseResponse objectResponse = new BaseResponse(); | |
1179 | + Date day=new Date(); | |
1180 | + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
1181 | + String format = df.format(day); | |
1182 | + model.setModified(format); | |
1183 | + model.setState(0); | |
1184 | + model.setYn(YnEnums.YES.getId()); | |
1185 | + //操作人为当前用户id | |
1186 | + model.setPublishId(userId); | |
1187 | + model.setHospitalId(model.getHospitalId()); | |
1188 | + | |
1189 | + | |
1190 | + courseEvalService.updateMsg(model); | |
1191 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1192 | + objectResponse.setErrormsg("成功"); | |
1193 | + return objectResponse; | |
1194 | + } | |
1195 | + | |
1196 | + public BaseResponse deleteMsgById(String id) { | |
1197 | + BaseResponse objectResponse = new BaseResponse(); | |
1198 | + Date day=new Date(); | |
1199 | + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
1200 | + String format = df.format(day); | |
1201 | + | |
1202 | + if (StringUtils.isNotEmpty(id)) | |
1203 | + { | |
1204 | + MsgModel model = new MsgModel(); | |
1205 | + model.setYn(YnEnums.NO.getId()); | |
1206 | + model.setId(id); | |
1207 | + model.setModified(format); | |
1208 | + courseEvalService.updateMsg(model); | |
1209 | + } | |
1210 | + | |
1211 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1212 | + objectResponse.setErrormsg("成功"); | |
1213 | + return objectResponse; | |
1214 | + } | |
1215 | + | |
1216 | + public BaseResponse getMsgList() { | |
1217 | + MsgQuery msgQuery = new MsgQuery(); | |
1218 | + msgQuery.setYn(YnEnums.YES.getId()); | |
1219 | + msgQuery.setNeed("true"); | |
1220 | + BaseListResponse objectResponse = new BaseListResponse(); | |
1221 | + List<MsgModel> models = courseEvalService.queryMsgList(msgQuery); | |
1222 | + objectResponse.setData(models); | |
1223 | + objectResponse.setPageInfo(msgQuery.getPageInfo()); | |
1224 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
1225 | + objectResponse.setErrormsg("成功"); | |
1226 | + return objectResponse; | |
1123 | 1227 | } |
1124 | 1228 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
27a0453
... | ... | @@ -29,7 +29,6 @@ |
29 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
30 | 30 | import org.springframework.stereotype.Component; |
31 | 31 | |
32 | -import javax.annotation.Resource; | |
33 | 32 | import java.util.*; |
34 | 33 | |
35 | 34 | /** |
... | ... | @@ -489,8 +488,12 @@ |
489 | 488 | pser.setSerStatus(PatientSerEnums.SerStatusEnums.kt.getId()); |
490 | 489 | //服务类型 |
491 | 490 | pser.setSerType(Integer.parseInt(serInfo.get("serType"))); |
492 | - if (serInfo.containsKey("serDoct")) { | |
493 | - pser.setSerDoct(serInfo.get("serDoct")); | |
491 | + if("2100002419".equals(hospitalId)){ | |
492 | + pser.setSerDoct(userId.toString()); | |
493 | + }else{ | |
494 | + if (serInfo.containsKey("serDoct")) { | |
495 | + pser.setSerDoct(serInfo.get("serDoct")); | |
496 | + } | |
494 | 497 | } |
495 | 498 | //默认已经领取 |
496 | 499 | pser.setStatus(2); |