From 6200f9ddd60fd7c5b17543e30cd68c3f3d6a865b Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 19 Sep 2018 10:38:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/biz/dal/IQuestionDao.java | 10 ++ .../platform/biz/dal/impl/QuestionDaoImpl.java | 17 +++ .../lyms/platform/biz/service/QuestionService.java | 24 ++++ .../lyms/platform/common/enums/QuestionEnums.java | 29 +++++ .../platform/common/enums/RemoteServerEnmus.java | 6 +- .../java/com/lyms/platform/beans/SerialIdEnum.java | 1 + .../java/com/lyms/platform/pojo/QuestionModel.java | 131 +++++++++++++++++++++ .../lyms/platform/query/CancerScreeningQuery.java | 18 +-- .../operate/web/controller/QuestionController.java | 41 +++++++ .../operate/web/facade/CancerScreeningFacade.java | 6 +- .../operate/web/facade/QuestionFacade.java | 33 ++++++ 11 files changed, 305 insertions(+), 11 deletions(-) create mode 100644 platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IQuestionDao.java create mode 100644 platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/QuestionDaoImpl.java create mode 100644 platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/QuestionService.java create mode 100644 platform-common/src/main/java/com/lyms/platform/common/enums/QuestionEnums.java create mode 100644 platform-dal/src/main/java/com/lyms/platform/pojo/QuestionModel.java create mode 100644 platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QuestionController.java create mode 100644 platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/QuestionFacade.java diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IQuestionDao.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IQuestionDao.java new file mode 100644 index 0000000..fff1a86 --- /dev/null +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IQuestionDao.java @@ -0,0 +1,10 @@ +package com.lyms.platform.biz.dal; + +import com.lyms.platform.pojo.QuestionModel; + +/** + * Created by Administrator on 2018-09-19. + */ +public interface IQuestionDao { + QuestionModel addQuestions(QuestionModel questionModel); +} diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/QuestionDaoImpl.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/QuestionDaoImpl.java new file mode 100644 index 0000000..2a052c1 --- /dev/null +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/QuestionDaoImpl.java @@ -0,0 +1,17 @@ +package com.lyms.platform.biz.dal.impl; + +import com.lyms.platform.biz.dal.IQuestionDao; +import com.lyms.platform.common.dao.BaseMongoDAOImpl; +import com.lyms.platform.pojo.QuestionModel; +import org.springframework.stereotype.Repository; + +/** + * Created by Administrator on 2018-09-19. + */ +@Repository("questionDao") +public class QuestionDaoImpl extends BaseMongoDAOImpl implements IQuestionDao { + @Override + public QuestionModel addQuestions(QuestionModel questionModel) { + return save(questionModel); + } +} diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/QuestionService.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/QuestionService.java new file mode 100644 index 0000000..b69d411 --- /dev/null +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/QuestionService.java @@ -0,0 +1,24 @@ +package com.lyms.platform.biz.service; + +import com.lyms.platform.biz.dal.IQuestionDao; +import com.lyms.platform.pojo.QuestionModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + */ +@Service +public class QuestionService { + + private static final Logger logger = LoggerFactory.getLogger(QuestionService.class); + @Autowired + private IQuestionDao questionDao; + + + public QuestionModel addQuestions(QuestionModel questionModel) { + return questionDao.addQuestions(questionModel); + } +} \ No newline at end of file diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/QuestionEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/QuestionEnums.java new file mode 100644 index 0000000..cf6eb96 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/QuestionEnums.java @@ -0,0 +1,29 @@ +package com.lyms.platform.common.enums; + + + + +/** + * 发送日期 + * Created by lqy on 2016/06/27 + */ +public enum QuestionEnums { + + + Q1(1,"0-4(没有或极少)","在孕期,孕妇开始出现早孕反应(疲劳,乏力,嗜睡,食欲减退,恶心,呕吐等)。这些都属于怀孕期间正常的表现,通过PHQ-9的测量表的测量分数可看出您身心状体良好,请保持充足的休息,不要剧烈运动,做好孕期检查的工作。"), + Q2(2,"5-9(轻微抑郁)","孕妈妈在怀孕期间可能会出现担心胚胎的发育情况,害怕流产或没有准备好当妈妈的心理压力等情绪问题。这种担心表达了对未出生孩子的爱,但有研究表明长期的消极情绪会对胎儿造成不良影响,所以为了更好的给予爱和被孩子感受到爱,请保持良好的心情,积极乐观的看待事情,保持充足的休息,不要剧烈运动,遵医嘱来院做孕期检查。若自我调节无效果,建议及时来我院弘毅楼三楼围产医学科心理门诊预约心理咨询。"), + Q3(3,"10-14(中等程度)","孕期因体内激素分泌水平变化,身体不适的情况增加,患者的饮食及睡眠情况下降,情绪、认知也会随之受到影响。若出现这种情况,请孕妈妈明确这种情绪及认知是由身体的不适所致,此时需放松心情,及时调整心态,建议写感恩日记。若身体不适请及时来院孕检。若自我调节无效果,建议及时来我院弘毅楼三楼围产医学科心理门诊预约心理咨询。"), + Q4(4,"15-19(较严重抑郁)","亲爱的孕妈妈,根据您的测试,您目前可能会体验到高兴不起来、不愿意动、自觉脑子不好使,记不住事、思考问题困难,觉得脑子空空、变笨了等情况。建议多与家人沟通,调整心态,写感恩日记。若自我调节无效果,建议及时来我院弘毅楼三楼围产医学科心理门诊预约心理咨询。"), + Q5(5,"20-27(严重抑郁)","亲爱的孕妈妈,根据您的测试,您目前可能会有不能集中注意力,焦虑,极端易怒,睡眠不好,非常容易疲劳,或有持续的疲劳感,不停地想吃东西或者毫无食欲,对什么都不感兴趣,总是提不起精神,持续的情绪低落,想哭,情绪起伏很大,喜怒无常,经常想一些不太现实的东西等多种体验,建议您多与家人沟通,调整心态,写感恩日记。若自我调节无效果,建议及时来我院弘毅楼三楼围产医学科心理门诊预约心理咨询。"); + + QuestionEnums(int id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + } + + private int id; + private String title; + private String content; + +} diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/RemoteServerEnmus.java b/platform-common/src/main/java/com/lyms/platform/common/enums/RemoteServerEnmus.java index 30734ec..68d308d 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/enums/RemoteServerEnmus.java +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/RemoteServerEnmus.java @@ -14,7 +14,11 @@ public enum RemoteServerEnmus { HY("https://area-huaiyang.healthbaby.com.cn:12356", "淮阳"), ZC("https://area-zhucheng.healthbaby.com.cn:12356", "诸城"), WH("https://area-weihai.healthbaby.com.cn:12356", "威海"), - KF("https://area-kaifeng-api.healthbaby.com.cn:12356", "开封"); +// KF("https://area-kaifeng-api.healthbaby.com.cn:12356", "开封"), + CY("https://area-changyi-api.healthbaby.com.cn:12356", "昌邑"), + XT("https://area-xtrm-api.healthbaby.com.cn:12356", "邢台人民医院系统"), + RC("https://area-rongcheng-api.healthbaby.com.cn:12356", "荣成"); + private String address; private String remark; diff --git a/platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java b/platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java index 2dc74e2..ba99489 100644 --- a/platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java +++ b/platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java @@ -75,6 +75,7 @@ public enum SerialIdEnum { PatientCourseModel("PatientCourseModel", 92531039591L), ModularFunctionConfigModel("ModularFunctionConfigModel", 97531039991L), BabySieveModel("BabySieveModel", 97531049991L), + QuestionModel("QuestionModel", 97521049991L), BabyEyeCheck("BabyEyeCheck", 97521039591L); private String cname; diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/QuestionModel.java b/platform-dal/src/main/java/com/lyms/platform/pojo/QuestionModel.java new file mode 100644 index 0000000..1f3824b --- /dev/null +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/QuestionModel.java @@ -0,0 +1,131 @@ +package com.lyms.platform.pojo; + +import com.lyms.platform.beans.SerialIdEnum; +import com.lyms.platform.common.result.BaseModel; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 问卷调查 + * Created by Administrator on 2018-09-19. + */ +@Document(collection="lyms_question") +public class QuestionModel extends BaseModel { + + private static final long serialVersionUID = SerialIdEnum.PuerperaModel.getCid(); + + private String id; + + //问题答案和题号 + private List> questions; + + //分数 + private int score; + //困难 + private String trouble; + + //调查单位 + private String investHospitalId; + + //调查员 + private String investigator; + //调查日期 + private Date investDate; + + private String patientId; + private String pid; + + private Date created; + private Date modified; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public List> getQuestions() { + return questions; + } + + public void setQuestions(List> questions) { + this.questions = questions; + } + + public int getScore() { + return score; + } + + public void setScore(int score) { + this.score = score; + } + + public String getTrouble() { + return trouble; + } + + public void setTrouble(String trouble) { + this.trouble = trouble; + } + + public String getInvestHospitalId() { + return investHospitalId; + } + + public void setInvestHospitalId(String investHospitalId) { + this.investHospitalId = investHospitalId; + } + + public String getInvestigator() { + return investigator; + } + + public void setInvestigator(String investigator) { + this.investigator = investigator; + } + + public Date getInvestDate() { + return investDate; + } + + public void setInvestDate(Date investDate) { + this.investDate = investDate; + } + + public String getPatientId() { + return patientId; + } + + public void setPatientId(String patientId) { + this.patientId = patientId; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + public Date getModified() { + return modified; + } + + public void setModified(Date modified) { + this.modified = modified; + } +} diff --git a/platform-dal/src/main/java/com/lyms/platform/query/CancerScreeningQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/CancerScreeningQuery.java index 0ccad84..1e580f1 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/CancerScreeningQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/CancerScreeningQuery.java @@ -102,13 +102,6 @@ public class CancerScreeningQuery extends BaseQuery implements IConvertToNativeQ Criteria c = null; - if (null != createdStart && createdEnd != null) { - if (null != c) { - c = c.where("created").gte(createdStart).lte(createdEnd); - } else { - c = Criteria.where("created").gte(createdStart).lte(createdEnd); - } - } if (StringUtils.isNotEmpty(queryNo)) { MongoCondition c1 = MongoCondition.newInstance(); @@ -123,6 +116,17 @@ public class CancerScreeningQuery extends BaseQuery implements IConvertToNativeQ } } + + if (null != createdStart && createdEnd != null) { + if (null != c) { + c = c.and("created").gte(createdStart).lte(createdEnd); + } else { + c = Criteria.where("created").gte(createdStart).lte(createdEnd); + } + } + + + if (null != c) { condition = condition.andCondition(new MongoCondition(c)); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QuestionController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QuestionController.java new file mode 100644 index 0000000..856d7a5 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/QuestionController.java @@ -0,0 +1,41 @@ +package com.lyms.platform.operate.web.controller; + +import com.lyms.platform.common.base.BaseController; +import com.lyms.platform.common.result.BaseResponse; +import com.lyms.platform.operate.web.facade.AssistBuildFacade; +import com.lyms.platform.operate.web.facade.QuestionFacade; +import com.lyms.platform.pojo.AssistBuildUserModel; +import com.lyms.platform.pojo.QuestionModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +/** + * 问卷调查 + * Created by Administrator on 2018-08-06. + */ +@Controller +@RequestMapping("/assist") +public class QuestionController extends BaseController { + + @Autowired + private QuestionFacade questionFacade; + + /** + * 添加 + * @param questionModel + * @param httpServletRequest + * @return + */ + @RequestMapping(method = RequestMethod.POST, value = "/addQuestions") + @ResponseBody + public BaseResponse addQuestions(@Valid @RequestBody QuestionModel questionModel, + HttpServletRequest httpServletRequest) { + return questionFacade.addQuestions(questionModel); + } + + +} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java index d8cf2fe..ebf9e22 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java @@ -249,9 +249,9 @@ public class CancerScreeningFacade { result.put("birthday",DateUtil.getyyyy_MM_dd(model.getBirthday())); result.put("phone",model.getPhone()); - //户籍地址 - String addressRegister = CommonsHelper.getResidence(model.getProvinceRegisterId(), model.getCityRegisterId(), - model.getAreaRegisterId(), model.getStreetRegisterId(), model.getAddressRegister(), basicConfigService); + //居住地址 + String addressRegister = CommonsHelper.getResidence(model.getProvinceId(), model.getCityId(), + model.getAreaId(), model.getStreetId(), model.getAddress(), basicConfigService); result.put("registAddress",addressRegister); result.put("levelType",FunvCommonUtil.getBaseicConfigByid(model.getLevelTypeId(), basicConfigService)); result.put("residentId", model.getId()); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/QuestionFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/QuestionFacade.java new file mode 100644 index 0000000..2f99f40 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/QuestionFacade.java @@ -0,0 +1,33 @@ +package com.lyms.platform.operate.web.facade; + + +import com.lyms.platform.biz.service.QuestionService; +import com.lyms.platform.common.constants.ErrorCodeConstants; +import com.lyms.platform.common.result.BaseResponse; + +import com.lyms.platform.pojo.QuestionModel; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + + +/** + * 数据访问权限的门面 Created by Administrator on 2016/3/30 0030. + */ +@Component +public class QuestionFacade { + + @Autowired + private QuestionService questionService; + + public BaseResponse addQuestions(QuestionModel questionModel) { + + QuestionModel question = questionService.addQuestions(questionModel); + + BaseResponse response = new BaseResponse(); + response.setErrormsg("成功"); + response.setErrorcode(ErrorCodeConstants.SUCCESS); + return response; + } +} \ No newline at end of file -- 1.8.3.1