Commit 33206d3cd6d778a8baad940e6ac7cd5fdaf0abdc

Authored by liquanyu
1 parent 561fd02321

孕妇课程调查

Showing 9 changed files with 781 additions and 3 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ICourseEvalDao.java View file @ 33206d3
  1 +package com.lyms.platform.biz.dal;
  2 +
  3 +
  4 +import com.lyms.platform.common.dao.operator.MongoQuery;
  5 +import com.lyms.platform.pojo.CourseEvaluateModel;
  6 +import com.lyms.platform.pojo.CourseModel;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + */
  12 +public interface ICourseEvalDao {
  13 +
  14 + public List<CourseEvaluateModel> queryCourseEvalList(MongoQuery query);
  15 +
  16 + public int queryCourseEvalListCount(MongoQuery mongoQuery);
  17 +
  18 + public void addCourseEval(CourseEvaluateModel model);
  19 +
  20 + public void updateCourseEval(MongoQuery mongoQuery, CourseEvaluateModel model);
  21 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/CourseEvalDaoImpl.java View file @ 33206d3
  1 +package com.lyms.platform.biz.dal.impl;
  2 +
  3 +import com.lyms.platform.biz.dal.ICourseEvalDao;
  4 +import com.lyms.platform.common.dao.BaseMongoDAOImpl;
  5 +import com.lyms.platform.common.dao.operator.MongoQuery;
  6 +import com.lyms.platform.pojo.CourseEvaluateModel;
  7 +import org.springframework.stereotype.Repository;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * Created by Administrator on 2018-01-10.
  13 + */
  14 +@Repository("courseEvalDao")
  15 +public class CourseEvalDaoImpl extends BaseMongoDAOImpl<CourseEvaluateModel> implements ICourseEvalDao {
  16 + @Override
  17 + public List<CourseEvaluateModel> queryCourseEvalList(MongoQuery query) {
  18 + return find(query.convertToMongoQuery());
  19 + }
  20 +
  21 + @Override
  22 + public int queryCourseEvalListCount(MongoQuery mongoQuery) {
  23 + return (int)count(mongoQuery.convertToMongoQuery());
  24 + }
  25 +
  26 + @Override
  27 + public void addCourseEval(CourseEvaluateModel model) {
  28 + save(model);
  29 + }
  30 +
  31 + @Override
  32 + public void updateCourseEval(MongoQuery mongoQuery,CourseEvaluateModel model) {
  33 + update(mongoQuery.convertToMongoQuery(),model);
  34 + }
  35 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CourseEvalService.java View file @ 33206d3
  1 +package com.lyms.platform.biz.service;
  2 +
  3 +
  4 +import com.lyms.platform.biz.dal.ICourseEvalDao;
  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 +import com.lyms.platform.common.enums.YnEnums;
  9 +import com.lyms.platform.pojo.CourseEvaluateModel;
  10 +import com.lyms.platform.query.CourseEvalQuery;
  11 +import org.apache.commons.collections.CollectionUtils;
  12 +import org.apache.commons.lang.StringUtils;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.data.domain.Sort;
  15 +import org.springframework.stereotype.Service;
  16 +
  17 +import java.util.List;
  18 +
  19 +
  20 +@Service
  21 +public class CourseEvalService {
  22 +
  23 + @Autowired
  24 + private ICourseEvalDao courseEvalDao;
  25 +
  26 + public List<CourseEvaluateModel> queryCourseEvalList(CourseEvalQuery courseEvalQuery) {
  27 +
  28 + MongoQuery query = courseEvalQuery.convertToQuery();
  29 + if (StringUtils.isNotEmpty(courseEvalQuery.getNeed())) {
  30 + courseEvalQuery.mysqlBuild(courseEvalDao.queryCourseEvalListCount(courseEvalQuery.convertToQuery()));
  31 + query.start(courseEvalQuery.getOffset()).end(courseEvalQuery.getLimit());
  32 + }
  33 + return courseEvalDao.queryCourseEvalList(query.addOrder(Sort.Direction.DESC, "modified"));
  34 + }
  35 +
  36 +
  37 + public int queryCourseEvalCount(CourseEvalQuery courseEvalQuery) {
  38 + return courseEvalDao.queryCourseEvalListCount(courseEvalQuery.convertToQuery());
  39 + }
  40 +
  41 +
  42 + public void addCourseEval(CourseEvaluateModel model) {
  43 + courseEvalDao.addCourseEval(model);
  44 + }
  45 +
  46 + public void updateCourseEval(CourseEvaluateModel model) {
  47 + courseEvalDao.updateCourseEval(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)), model);
  48 + }
  49 +
  50 + public CourseEvaluateModel getCourseEvalById(String id) {
  51 + CourseEvalQuery query = new CourseEvalQuery();
  52 + query.setYn(YnEnums.YES.getId());
  53 + query.setId(id);
  54 + List<CourseEvaluateModel> list = queryCourseEvalList(query);
  55 + if (CollectionUtils.isNotEmpty(list))
  56 + {
  57 + return list.get(0);
  58 + }
  59 + return null;
  60 + }
  61 +
  62 +}
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java View file @ 33206d3
... ... @@ -71,6 +71,7 @@
71 71 CancerScreeningModel("CancerScreeningModel", 97531039591L),
72 72  
73 73 CourseModel("CourseModel", 97531029990L),
  74 + CourseEvaluateModel("CourseEvaluateModel", 97531059990L),
74 75 CourseTypeModel("CourseTypeModel", 97831039590L),
75 76 PatientCourseModel("PatientCourseModel", 92531039591L),
76 77 ModularFunctionConfigModel("ModularFunctionConfigModel", 97531039991L),
platform-dal/src/main/java/com/lyms/platform/pojo/CourseEvaluateModel.java View file @ 33206d3
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.beans.SerialIdEnum;
  4 +import com.lyms.platform.common.result.BaseModel;
  5 +import org.springframework.data.mongodb.core.mapping.Document;
  6 +
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * 课程评分
  13 + * Created by Administrator on 2018-10-18.
  14 + */
  15 +@Document(collection="lyms_course_eval")
  16 +public class CourseEvaluateModel extends BaseModel {
  17 +
  18 + private static final long serialVersionUID = SerialIdEnum.CourseModel.getCid();
  19 +
  20 + private String id;
  21 + //课程id
  22 + private String courseId;
  23 + //课程类型评价
  24 + private List<Map> courseTypeEvaluates;
  25 +
  26 + //课程医生评价
  27 + private List<Map> courseDocEvaluates;
  28 +
  29 + //课程类型评分
  30 + private Integer courseTypeSocre;
  31 + //课程医生评分
  32 + private Integer courseDocSocre;
  33 +
  34 + //评价日期
  35 + private Date evaluateDate;
  36 +
  37 + //孕妇id
  38 + private String patientId;
  39 + //医院id
  40 + private String hospitalId;
  41 +
  42 + //孕妇预约课程id
  43 + private String patientCourseId;
  44 +
  45 + private Integer yn;
  46 +
  47 + private Date modified;
  48 + private Date created;
  49 +
  50 + public Date getModified() {
  51 + return modified;
  52 + }
  53 +
  54 + public void setModified(Date modified) {
  55 + this.modified = modified;
  56 + }
  57 +
  58 + public Date getCreated() {
  59 + return created;
  60 + }
  61 +
  62 + public void setCreated(Date created) {
  63 + this.created = created;
  64 + }
  65 +
  66 + public Integer getYn() {
  67 + return yn;
  68 + }
  69 +
  70 + public void setYn(Integer yn) {
  71 + this.yn = yn;
  72 + }
  73 +
  74 + public String getHospitalId() {
  75 + return hospitalId;
  76 + }
  77 +
  78 + public void setHospitalId(String hospitalId) {
  79 + this.hospitalId = hospitalId;
  80 + }
  81 +
  82 + public String getPatientId() {
  83 + return patientId;
  84 + }
  85 +
  86 + public void setPatientId(String patientId) {
  87 + this.patientId = patientId;
  88 + }
  89 +
  90 + public String getId() {
  91 + return id;
  92 + }
  93 +
  94 + public void setId(String id) {
  95 + this.id = id;
  96 + }
  97 +
  98 + public String getCourseId() {
  99 + return courseId;
  100 + }
  101 +
  102 + public void setCourseId(String courseId) {
  103 + this.courseId = courseId;
  104 + }
  105 +
  106 + public List<Map> getCourseTypeEvaluates() {
  107 + return courseTypeEvaluates;
  108 + }
  109 +
  110 + public void setCourseTypeEvaluates(List<Map> courseTypeEvaluates) {
  111 + this.courseTypeEvaluates = courseTypeEvaluates;
  112 + }
  113 +
  114 + public List<Map> getCourseDocEvaluates() {
  115 + return courseDocEvaluates;
  116 + }
  117 +
  118 + public void setCourseDocEvaluates(List<Map> courseDocEvaluates) {
  119 + this.courseDocEvaluates = courseDocEvaluates;
  120 + }
  121 +
  122 + public Integer getCourseTypeSocre() {
  123 + return courseTypeSocre;
  124 + }
  125 +
  126 + public void setCourseTypeSocre(Integer courseTypeSocre) {
  127 + this.courseTypeSocre = courseTypeSocre;
  128 + }
  129 +
  130 + public Integer getCourseDocSocre() {
  131 + return courseDocSocre;
  132 + }
  133 +
  134 + public void setCourseDocSocre(Integer courseDocSocre) {
  135 + this.courseDocSocre = courseDocSocre;
  136 + }
  137 +
  138 + public Date getEvaluateDate() {
  139 + return evaluateDate;
  140 + }
  141 +
  142 + public void setEvaluateDate(Date evaluateDate) {
  143 + this.evaluateDate = evaluateDate;
  144 + }
  145 +
  146 + public String getPatientCourseId() {
  147 + return patientCourseId;
  148 + }
  149 +
  150 + public void setPatientCourseId(String patientCourseId) {
  151 + this.patientCourseId = patientCourseId;
  152 + }
  153 +}
platform-dal/src/main/java/com/lyms/platform/query/CourseEvalQuery.java View file @ 33206d3
  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 +import org.springframework.data.mongodb.core.query.Criteria;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * 孕妇课程评分查询
  15 + */
  16 +public class CourseEvalQuery extends BaseQuery implements IConvertToNativeQuery {
  17 +
  18 + private String id;
  19 +
  20 + //课程名称
  21 + private String courseName;
  22 +
  23 + //课程主讲
  24 + private String courseSpeaker;
  25 +
  26 + //课程地址
  27 + private String courseAddress;
  28 +
  29 + //课程时间
  30 + private Date courseTimeStart;
  31 +
  32 + private Date courseTimeEnd;
  33 +
  34 + //课程发布时间
  35 + private Date publishTimeStart;
  36 +
  37 + private Date publishTimeEnd;
  38 +
  39 + //时长
  40 + private String timeLong;
  41 +
  42 + //上线人数
  43 + private Integer limitNum;
  44 +
  45 + //报名人数
  46 + private Integer enrolmentNum;
  47 +
  48 + //签到人数
  49 + private Integer signNum;
  50 +
  51 + //状态 1待发布,2 已发布,3已结束
  52 + private Integer status;
  53 +
  54 + //课程描述
  55 + private String courseDesc;
  56 + //课程备注
  57 + private String courseRemark;
  58 +
  59 + //课程类别id
  60 + private String courseTypeId;
  61 +
  62 + //创建人id
  63 + private String createUserId;
  64 +
  65 + //发布人id
  66 + private String publishUserId;
  67 +
  68 + private Date createdStart;
  69 + private Date createdEnd;
  70 +
  71 + private Date modifiedStart;
  72 + private Date modifiedEnd;
  73 +
  74 + private Integer yn;
  75 +
  76 + private String hospitalId;
  77 + private List<String> hospitalIds;
  78 +
  79 + private Date courseEndTime;
  80 + private String keyword;
  81 +
  82 + private boolean isSend;
  83 +
  84 + @Override
  85 + public MongoQuery convertToQuery() {
  86 + MongoCondition condition = MongoCondition.newInstance();
  87 + if (null != id) {
  88 + condition = condition.and("id", id, MongoOper.IS);
  89 + }
  90 +
  91 + if (null != yn) {
  92 + condition = condition.and("yn", yn, MongoOper.IS);
  93 + }
  94 +
  95 + if (null != courseName) {
  96 + condition = condition.and("courseName", courseName, MongoOper.IS);
  97 + }
  98 +
  99 +
  100 + if (null != courseTypeId) {
  101 + condition = condition.and("courseTypeId", courseTypeId, MongoOper.IS);
  102 + }
  103 +
  104 +
  105 + if (null != courseSpeaker) {
  106 + condition = condition.and("courseSpeaker", courseSpeaker, MongoOper.IS);
  107 + }
  108 +
  109 +
  110 + if (null != hospitalId) {
  111 + condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
  112 + }
  113 +
  114 +
  115 + if (null != createUserId) {
  116 + condition = condition.and("createUserId", createUserId, MongoOper.IS);
  117 + }
  118 +
  119 + if (null != status) {
  120 + condition = condition.and("status", status, MongoOper.IS);
  121 + }
  122 +
  123 + if (isSend) {
  124 + condition = condition.and("isSend", false, MongoOper.EXISTS);
  125 + }
  126 +
  127 + if (null != courseEndTime) {
  128 + condition = condition.and("courseEndTime", courseEndTime, MongoOper.LTE);
  129 + }
  130 +
  131 + if (null != keyword)
  132 + {
  133 + MongoCondition con1 = MongoCondition.newInstance("courseSpeaker", keyword, MongoOper.LIKE);
  134 + MongoCondition con = MongoCondition.newInstance("courseName", keyword, MongoOper.LIKE);
  135 + condition = condition.orCondition(new MongoCondition[]{con1, con});
  136 + }
  137 +
  138 + if (null != hospitalIds && hospitalIds.size() > 0) {
  139 + condition = condition.and("hospitalId", hospitalIds, MongoOper.IN);
  140 + }
  141 +
  142 +
  143 +// if (null != keyword && null != hospitalIds && hospitalIds.size() > 0) {
  144 +// MongoCondition con1 = MongoCondition.newInstance("courseSpeaker", keyword, MongoOper.LIKE);
  145 +// MongoCondition con = MongoCondition.newInstance("courseName", keyword, MongoOper.LIKE);
  146 +// MongoCondition condition2 = MongoCondition.newInstance("hospitalId", hospitalIds, MongoOper.IN);
  147 +// condition = condition.orCondition(new MongoCondition[]{con1, con,condition2});
  148 +// }
  149 +// else if (null != keyword)
  150 +// {
  151 +// MongoCondition con1 = MongoCondition.newInstance("courseSpeaker", keyword, MongoOper.LIKE);
  152 +// MongoCondition con = MongoCondition.newInstance("courseName", keyword, MongoOper.LIKE);
  153 +// condition = condition.orCondition(new MongoCondition[]{con1, con});
  154 +// }
  155 +// else if (null != hospitalIds && hospitalIds.size() > 0) {
  156 +// condition = condition.and("hospitalId", hospitalIds, MongoOper.IN);
  157 +// }
  158 +
  159 + Criteria c1 = null;
  160 +
  161 + if (null != courseTimeStart) {
  162 + if (null != c1) {
  163 + c1 = c1.and("courseTime").gte(courseTimeStart);
  164 + } else {
  165 + c1 = Criteria.where("courseTime").gte(courseTimeStart);
  166 + }
  167 + }
  168 +
  169 + if (null != courseTimeEnd) {
  170 + if (null != c1) {
  171 + c1 = c1.lte(courseTimeEnd);
  172 + } else {
  173 + c1 = Criteria.where("courseTime").lte(courseTimeEnd);
  174 + }
  175 + }
  176 +
  177 +
  178 + if (null != publishTimeStart) {
  179 + if (null != c1) {
  180 + c1 = c1.and("publishTime").gte(publishTimeStart);
  181 + } else {
  182 + c1 = Criteria.where("publishTime").gte(publishTimeStart);
  183 + }
  184 + }
  185 +
  186 + if (null != publishTimeEnd) {
  187 + if (null != c1) {
  188 + c1 = c1.lte(publishTimeEnd);
  189 + } else {
  190 + c1 = Criteria.where("publishTime").lte(publishTimeEnd);
  191 + }
  192 + }
  193 +
  194 + if (null != createdStart) {
  195 + if (null != c1) {
  196 + c1 = c1.and("created").gte(createdStart);
  197 + } else {
  198 + c1 = Criteria.where("created").gte(createdStart);
  199 + }
  200 + }
  201 +
  202 + if (null != createdEnd) {
  203 + if (null != c1) {
  204 + c1 = c1.lte(createdEnd);
  205 + } else {
  206 + c1 = Criteria.where("created").lte(createdEnd);
  207 + }
  208 + }
  209 +
  210 + if (null != c1) {
  211 + condition = condition.andCondition(new MongoCondition(c1));
  212 + }
  213 + return condition.toMongoQuery();
  214 + }
  215 +
  216 + public Date getPublishTimeStart() {
  217 + return publishTimeStart;
  218 + }
  219 +
  220 + public void setPublishTimeStart(Date publishTimeStart) {
  221 + this.publishTimeStart = publishTimeStart;
  222 + }
  223 +
  224 + public Date getPublishTimeEnd() {
  225 + return publishTimeEnd;
  226 + }
  227 +
  228 + public void setPublishTimeEnd(Date publishTimeEnd) {
  229 + this.publishTimeEnd = publishTimeEnd;
  230 + }
  231 +
  232 + public boolean isSend() {
  233 + return isSend;
  234 + }
  235 +
  236 + public void setIsSend(boolean isSend) {
  237 + this.isSend = isSend;
  238 + }
  239 +
  240 + public String getKeyword() {
  241 + return keyword;
  242 + }
  243 +
  244 + public void setKeyword(String keyword) {
  245 + this.keyword = keyword;
  246 + }
  247 +
  248 + public List<String> getHospitalIds() {
  249 + return hospitalIds;
  250 + }
  251 +
  252 + public void setHospitalIds(List<String> hospitalIds) {
  253 + this.hospitalIds = hospitalIds;
  254 + }
  255 +
  256 + public Date getCourseEndTime() {
  257 + return courseEndTime;
  258 + }
  259 +
  260 + public void setCourseEndTime(Date courseEndTime) {
  261 + this.courseEndTime = courseEndTime;
  262 + }
  263 +
  264 + public String getId() {
  265 + return id;
  266 + }
  267 +
  268 + public void setId(String id) {
  269 + this.id = id;
  270 + }
  271 +
  272 + public String getCourseName() {
  273 + return courseName;
  274 + }
  275 +
  276 + public void setCourseName(String courseName) {
  277 + this.courseName = courseName;
  278 + }
  279 +
  280 + public String getCourseSpeaker() {
  281 + return courseSpeaker;
  282 + }
  283 +
  284 + public void setCourseSpeaker(String courseSpeaker) {
  285 + this.courseSpeaker = courseSpeaker;
  286 + }
  287 +
  288 + public String getCourseAddress() {
  289 + return courseAddress;
  290 + }
  291 +
  292 + public void setCourseAddress(String courseAddress) {
  293 + this.courseAddress = courseAddress;
  294 + }
  295 +
  296 + public Date getCourseTimeStart() {
  297 + return courseTimeStart;
  298 + }
  299 +
  300 + public void setCourseTimeStart(Date courseTimeStart) {
  301 + this.courseTimeStart = courseTimeStart;
  302 + }
  303 +
  304 + public Date getCourseTimeEnd() {
  305 + return courseTimeEnd;
  306 + }
  307 +
  308 + public void setCourseTimeEnd(Date courseTimeEnd) {
  309 + this.courseTimeEnd = courseTimeEnd;
  310 + }
  311 +
  312 + public String getTimeLong() {
  313 + return timeLong;
  314 + }
  315 +
  316 + public void setTimeLong(String timeLong) {
  317 + this.timeLong = timeLong;
  318 + }
  319 +
  320 + public Integer getLimitNum() {
  321 + return limitNum;
  322 + }
  323 +
  324 + public void setLimitNum(Integer limitNum) {
  325 + this.limitNum = limitNum;
  326 + }
  327 +
  328 + public Integer getEnrolmentNum() {
  329 + return enrolmentNum;
  330 + }
  331 +
  332 + public void setEnrolmentNum(Integer enrolmentNum) {
  333 + this.enrolmentNum = enrolmentNum;
  334 + }
  335 +
  336 + public Integer getSignNum() {
  337 + return signNum;
  338 + }
  339 +
  340 + public void setSignNum(Integer signNum) {
  341 + this.signNum = signNum;
  342 + }
  343 +
  344 + public Integer getStatus() {
  345 + return status;
  346 + }
  347 +
  348 + public void setStatus(Integer status) {
  349 + this.status = status;
  350 + }
  351 +
  352 + public String getCourseDesc() {
  353 + return courseDesc;
  354 + }
  355 +
  356 + public void setCourseDesc(String courseDesc) {
  357 + this.courseDesc = courseDesc;
  358 + }
  359 +
  360 + public String getCourseRemark() {
  361 + return courseRemark;
  362 + }
  363 +
  364 + public void setCourseRemark(String courseRemark) {
  365 + this.courseRemark = courseRemark;
  366 + }
  367 +
  368 + public String getCourseTypeId() {
  369 + return courseTypeId;
  370 + }
  371 +
  372 + public void setCourseTypeId(String courseTypeId) {
  373 + this.courseTypeId = courseTypeId;
  374 + }
  375 +
  376 + public String getCreateUserId() {
  377 + return createUserId;
  378 + }
  379 +
  380 + public void setCreateUserId(String createUserId) {
  381 + this.createUserId = createUserId;
  382 + }
  383 +
  384 + public String getPublishUserId() {
  385 + return publishUserId;
  386 + }
  387 +
  388 + public void setPublishUserId(String publishUserId) {
  389 + this.publishUserId = publishUserId;
  390 + }
  391 +
  392 + public Date getCreatedStart() {
  393 + return createdStart;
  394 + }
  395 +
  396 + public void setCreatedStart(Date createdStart) {
  397 + this.createdStart = createdStart;
  398 + }
  399 +
  400 + public Date getCreatedEnd() {
  401 + return createdEnd;
  402 + }
  403 +
  404 + public void setCreatedEnd(Date createdEnd) {
  405 + this.createdEnd = createdEnd;
  406 + }
  407 +
  408 + public Date getModifiedStart() {
  409 + return modifiedStart;
  410 + }
  411 +
  412 + public void setModifiedStart(Date modifiedStart) {
  413 + this.modifiedStart = modifiedStart;
  414 + }
  415 +
  416 + public Date getModifiedEnd() {
  417 + return modifiedEnd;
  418 + }
  419 +
  420 + public void setModifiedEnd(Date modifiedEnd) {
  421 + this.modifiedEnd = modifiedEnd;
  422 + }
  423 +
  424 + public Integer getYn() {
  425 + return yn;
  426 + }
  427 +
  428 + public void setYn(Integer yn) {
  429 + this.yn = yn;
  430 + }
  431 +
  432 + public String getHospitalId() {
  433 + return hospitalId;
  434 + }
  435 +
  436 + public void setHospitalId(String hospitalId) {
  437 + this.hospitalId = hospitalId;
  438 + }
  439 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CourseController.java View file @ 33206d3
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.result.BaseResponse;
8 8 import com.lyms.platform.operate.web.facade.CourseFacade;
9 9 import com.lyms.platform.operate.web.request.CourseRequest;
  10 +import com.lyms.platform.pojo.CourseEvaluateModel;
10 11 import org.springframework.beans.factory.annotation.Autowired;
11 12 import org.springframework.stereotype.Controller;
12 13 import org.springframework.web.bind.annotation.*;
... ... @@ -114,8 +115,8 @@
114 115 @RequestParam(required = false) String courseTime,
115 116 HttpServletRequest request) {
116 117  
117   - return courseFacade.getCoureseList(courseTypeId, status,courseName,courseSpeaker,
118   - createdTime, courseTime, page, limit, getUserId(request),"true");
  118 + return courseFacade.getCoureseList(courseTypeId, status, courseName, courseSpeaker,
  119 + createdTime, courseTime, page, limit, getUserId(request), "true");
119 120 }
120 121  
121 122  
... ... @@ -188,7 +189,22 @@
188 189 @TokenRequired
189 190 public BaseResponse getCourseCount(HttpServletRequest request, @RequestParam(required = false) String time) {
190 191 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
191   - return courseFacade.getCourseCount(time,loginState.getId());
  192 + return courseFacade.getCourseCount(time, loginState.getId());
  193 + }
  194 +
  195 +
  196 + /**
  197 + * 添加课程评价
  198 + * @param model
  199 + * @param request
  200 + * @return
  201 + */
  202 + @RequestMapping(method = RequestMethod.POST, value = "/addCoureseEval")
  203 + @ResponseBody
  204 + public BaseResponse addCoureseEval(@RequestBody CourseEvaluateModel model,
  205 + HttpServletRequest request) {
  206 +
  207 + return courseFacade.addCoureseEval(model);
192 208 }
193 209 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java View file @ 33206d3
... ... @@ -2,6 +2,7 @@
2 2  
3 3  
4 4 import com.lyms.platform.beans.MsgRequest;
  5 +import com.lyms.platform.biz.service.CourseEvalService;
5 6 import com.lyms.platform.biz.service.CourseService;
6 7 import com.lyms.platform.biz.service.CourseTypeService;
7 8 import com.lyms.platform.biz.service.PatientCourseService;
... ... @@ -66,6 +67,9 @@
66 67 private SmsConfigFacade smsConfigFacade;
67 68  
68 69 @Autowired
  70 + private CourseEvalService courseEvalService;
  71 +
  72 + @Autowired
69 73 @Qualifier("commonThreadPool")
70 74 private ThreadPoolTaskExecutor commonThreadPool;
71 75  
... ... @@ -664,6 +668,18 @@
664 668 resultData.put("tableData",tableData);
665 669  
666 670 objectResponse.setData(resultData);
  671 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  672 + objectResponse.setErrormsg("成功");
  673 + return objectResponse;
  674 + }
  675 +
  676 + public BaseResponse addCoureseEval(CourseEvaluateModel model) {
  677 + BaseResponse objectResponse = new BaseResponse();
  678 + model.setCreated(new Date());
  679 + model.setModified(new Date());
  680 + model.setEvaluateDate(new Date());
  681 + model.setYn(YnEnums.YES.getId());
  682 + courseEvalService.addCourseEval(model);
667 683 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
668 684 objectResponse.setErrormsg("成功");
669 685 return objectResponse;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CourseEvalRequest.java View file @ 33206d3
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * Created by Administrator on 2018-02-05.
  10 + */
  11 +public class CourseEvalRequest {
  12 +
  13 + private String id;
  14 + //课程id
  15 + private String courseId;
  16 + //课程类型评价
  17 + private List<Map> courseTypeEvaluates;
  18 +
  19 + //课程医生评价
  20 + private List<Map> courseDocEvaluates;
  21 +
  22 + //课程类型评分
  23 + private Integer courseTypeSocre;
  24 + //课程医生评分
  25 + private Integer courseDocSocre;
  26 +
  27 + //孕妇id
  28 + private String patientId;
  29 + //医院id
  30 + private String hospitalId;
  31 +
  32 + //孕妇预约课程id
  33 + private String patientCourseId;
  34 +
  35 +}