Commit e82c33394dd0f5177f421fbdd34d95b9f2c72821

Authored by zhangchao
1 parent 402a38d4ed
Exists in dev

#fix:新增大同一键跳转逻辑、预约挂号页面开发等逻辑接口

Showing 9 changed files with 908 additions and 29 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.biz.service.*;
  4 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  5 +import com.lyms.platform.common.dao.operator.MongoQuery;
  6 +import com.lyms.platform.common.result.BaseObjectResponse;
  7 +import com.lyms.platform.common.result.BaseResponse;
  8 +import com.lyms.platform.common.result.CommonResult;
  9 +import com.lyms.platform.common.utils.*;
  10 +import com.lyms.platform.operate.web.facade.*;
  11 +import com.lyms.platform.operate.web.request.AntExAddRequest;
  12 +import com.lyms.platform.operate.web.request.AntExQueryRequest;
  13 +import com.lyms.platform.operate.web.request.AntenatalExaminationQueryRequest;
  14 +import com.lyms.platform.operate.web.request.PatientQueryRequest;
  15 +import com.lyms.platform.operate.web.utils.CollectionUtils;
  16 +import com.lyms.platform.operate.web.utils.FunvCommonUtil;
  17 +import com.lyms.platform.operate.web.vo.PatientNiptDTO;
  18 +import com.lyms.platform.permission.service.AppointmentService;
  19 +import com.lyms.platform.permission.service.CouponService;
  20 +import com.lyms.platform.pojo.*;
  21 +import com.lyms.platform.query.*;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.data.domain.Sort;
  24 +import org.springframework.stereotype.Controller;
  25 +import org.springframework.web.bind.annotation.*;
  26 +
  27 +import javax.servlet.http.HttpServletResponse;
  28 +import javax.validation.Valid;
  29 +import java.util.*;
  30 +
  31 +/**
  32 + * 大同市第一人民医院
  33 + */
  34 +@Controller
  35 +@RequestMapping
  36 +public class PatientDtController {
  37 + @Autowired
  38 + private PatientsService patientsService;
  39 + @Autowired
  40 + private PatientWeightService2 patientWeightService;
  41 + @Autowired
  42 + private BloodPressureService bloodPressureService;
  43 + @Autowired
  44 + private AntenatalExaminationService antExService;
  45 + @Autowired
  46 + private BasicConfigService basicConfigService;
  47 + @Autowired
  48 + private AntenatalExaminationFacade antenatalExaminationFacade;
  49 + @Autowired
  50 + private ViewFacade viewFacade;
  51 + @Autowired
  52 + private StopPregnancyFacade stopPregnancyFacade;
  53 + @Autowired
  54 + private LisCrisisItemService lisCrisisItemService;
  55 + @Autowired
  56 + private PatientFacade patientFacade;
  57 + @Autowired
  58 + private CouponService couponService;
  59 + @Autowired
  60 + private AppointmentService appointmentService;
  61 +
  62 + final static Integer userId=2100013059;//默认为客服ID
  63 + final static String hospitalId="2100002419";//大同医院ID
  64 + final static String Authorization="492$2&Y34sl0adJLTsbm4aim78";
  65 +
  66 + /**
  67 + * 大同his获取孕妇小程序预建档信息——末次月经、血压、体重、既往史、个人史、家族史、传染病史、手术史数据
  68 + * @param idCard
  69 + * @param name
  70 + * @param phone
  71 + * @return
  72 + */
  73 + @RequestMapping(method = RequestMethod.GET, value = "/getDTPatient/Bookbuilding")
  74 + @ResponseBody
  75 + public BaseResponse getPatients(@RequestHeader("Authorization")String authorization, String idCard, String name, String phone){
  76 + BaseResponse baseResponse=new BaseResponse();
  77 +
  78 + if (!Authorization.equals(authorization)){
  79 + return baseResponse.setErrormsg("权限异常").setErrorcode(-1);
  80 + }
  81 +
  82 + PatientsQuery patientsQuery =new PatientsQuery();
  83 + patientsQuery.setYn(1);
  84 + patientsQuery.setHospitalId(hospitalId);
  85 + if (StringUtils.isNotEmpty(idCard)){
  86 + patientsQuery.setCardNo(idCard);
  87 + }else {
  88 + if (StringUtils.isNotEmpty(name)&&StringUtils.isNotEmpty(phone)){
  89 + patientsQuery.setName(name);
  90 + patientsQuery.setPhone(phone);
  91 + }else {
  92 + return baseResponse.setErrormsg("参数异常").setErrorcode(-1);
  93 + }
  94 + }
  95 + List<Patients> patientsList= patientsService.queryPatient(patientsQuery);
  96 + Map<String,Object> params=new HashMap<>();
  97 + if (CollectionUtils.isNotEmpty(patientsList)){
  98 + //处理预建档信息 末次月经、血压、体重、既往史、个人史、家族史、传染病史、手术史数据
  99 + Patients patients= patientsList.get(0);
  100 + String id=patients.getId();
  101 + params.put("lastMenses",patients.getLastMenses());
  102 + PatientWeightQuery patientWeightQuery=new PatientWeightQuery();
  103 + patientWeightQuery.setYn(1);
  104 + patientWeightQuery.setParentId(id);
  105 + MongoQuery mongoQuery=patientWeightQuery.convertToQuery().addOrder(Sort.Direction.DESC, "id");
  106 + List<PatientWeight> patientWeightList= patientWeightService.queryPatientWeight(mongoQuery.convertToMongoQuery());
  107 + if (CollectionUtils.isNotEmpty(patientWeightList)){
  108 + //体重
  109 + params.put("yqweight",patientWeightList.get(0).getNowWeight());
  110 + }
  111 + BloodPressureQuery bloodPressureQuery=new BloodPressureQuery();
  112 + bloodPressureQuery.setParentId(id);
  113 + bloodPressureQuery.setYn(1);
  114 + List<BloodPressure> list= bloodPressureService.getList(bloodPressureQuery);
  115 + if (CollectionUtils.isNotEmpty(list)){
  116 + BloodPressure bloodPressure= list.get(0);
  117 + //血压
  118 + params.put("bp", bloodPressure.getSsy() + "/" + bloodPressure.getSzy() + "mmHg");
  119 + }
  120 + AntExChuQuery antExChuQuery=new AntExChuQuery();
  121 + antExChuQuery.setYn(1);
  122 + antExChuQuery.setParentId(id);
  123 + List<AntExChuModel> antExChuModelList= antExService.queryAntExChu(antExChuQuery);
  124 + if (CollectionUtils.isNotEmpty(antExChuModelList)){
  125 + AntExChuModel data= antExChuModelList.get(0);
  126 + //既往史
  127 + String pastHistory = "";
  128 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPastHistory())) {
  129 + Map map1 = JsonUtil.jkstr2Obj(data.getPastHistory(), Map.class);
  130 + pastHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService);
  131 + }
  132 + params.put("pastHistory", pastHistory);
  133 + //家族史
  134 + String familyHistory = "";
  135 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFamilyHistory())) {
  136 + Map map1 = JsonUtil.jkstr2Obj(data.getFamilyHistory(), Map.class);
  137 + familyHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService);
  138 + }
  139 + params.put("familyHistory", familyHistory);
  140 + //个人史
  141 + String personalHistory = "";
  142 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPersonalHistory())) {
  143 + Map map1 = JsonUtil.jkstr2Obj(data.getPersonalHistory(), Map.class);
  144 + personalHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService);
  145 + }
  146 + params.put("personalHistory", personalHistory);
  147 + //妇科手术史
  148 + String fksxHistory = "";
  149 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getFksxHistory())) {
  150 + Map map1 = JsonUtil.jkstr2Obj(data.getFksxHistory(), Map.class);
  151 + fksxHistory = FunvCommonUtil.replace(map1, new StringBuilder(), basicConfigService);
  152 + }
  153 + params.put("fksxHistory", fksxHistory);
  154 + //传染病史
  155 + String infectDiseases="";
  156 + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getInfectDiseases())) {
  157 + Map map1 = JsonUtil.jkstr2Obj(data.getInfectDiseases(), Map.class);
  158 + infectDiseases=FunvCommonUtil.reslove(map1, new StringBuilder());
  159 + }
  160 + params.put("infectDiseases", infectDiseases);
  161 +
  162 + }
  163 + }else {
  164 + return new BaseResponse().setErrormsg("当前用户未有建档信息").setErrorcode(41001);
  165 + }
  166 + baseResponse.setObject(params);
  167 + return baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  168 + }
  169 +
  170 + /**
  171 + * 建档基础信息大同
  172 + * @param idCard
  173 + * @param name
  174 + * @param phone
  175 + * @return
  176 + */
  177 + @RequestMapping(method = RequestMethod.GET, value = "/dt/antexmanage")
  178 + @ResponseBody
  179 + public BaseResponse queryAntenatalExamination(@RequestHeader("Authorization")String authorization,String idCard,String name,String phone,String vcCardNo){
  180 + if (!Authorization.equals(authorization)){
  181 + return new BaseResponse().setErrormsg("权限异常").setErrorcode(-1);
  182 + }
  183 + String cardNo=idCard;
  184 + if (!StringUtils.isNotEmpty(idCard)){
  185 + if (StringUtils.isNotEmpty(name)&&StringUtils.isNotEmpty(phone)){
  186 + PatientsQuery patientsQuery =new PatientsQuery();
  187 + patientsQuery.setYn(1);
  188 + patientsQuery.setHospitalId(hospitalId);
  189 + patientsQuery.setName(name);
  190 + patientsQuery.setPhone(phone);
  191 + List<Patients> patientsList= patientsService.queryPatient(patientsQuery);
  192 + if (CollectionUtils.isNotEmpty(patientsList)){
  193 + cardNo=patientsList.get(0).getCardNo();
  194 + }else {
  195 + return new BaseResponse().setErrormsg("当前用户未有建档信息").setErrorcode(41001);
  196 + }
  197 + }
  198 +
  199 + if (StringUtils.isEmpty(cardNo)&&StringUtils.isEmpty(vcCardNo)){
  200 + return new BaseResponse().setErrormsg("参数异常").setErrorcode(-1);
  201 + }
  202 +
  203 + }
  204 + AntenatalExaminationQueryRequest queryRequest=new AntenatalExaminationQueryRequest();
  205 + queryRequest.setCardNo(cardNo);
  206 + queryRequest.setVcCardNo(vcCardNo);
  207 + return antenatalExaminationFacade.queryAntenatalExamination(queryRequest,userId);
  208 + }
  209 +
  210 + /**
  211 + * 高危大同
  212 + * @param patientId
  213 + * @return
  214 + */
  215 + @RequestMapping(method = RequestMethod.GET, value = "/dt/getLastRisk")
  216 + @ResponseBody
  217 + public BaseResponse getLastRisk(@RequestHeader("Authorization")String authorization,String patientId) {
  218 + if (!Authorization.equals(authorization)){
  219 + return new BaseResponse().setErrormsg("权限异常").setErrorcode(-1);
  220 + }
  221 + return antenatalExaminationFacade.getLastRisk(patientId, null);
  222 + }
  223 +
  224 + /**
  225 + * 检查报表
  226 + *
  227 + * @param antex
  228 + * @return
  229 + */
  230 + @RequestMapping(value = "/dt/checkReport", method = RequestMethod.GET)
  231 + @ResponseBody
  232 + public BaseResponse checkReport(@RequestHeader("Authorization")String authorization,@RequestParam(required = false) List<String> antex, @RequestParam(required = false) String antexc) {
  233 + if (!Authorization.equals(authorization)){
  234 + return new BaseResponse().setErrormsg("权限异常").setErrorcode(-1);
  235 + }
  236 + return viewFacade.checkReport(antex, antexc, userId);
  237 + }
  238 +
  239 + /**
  240 + * 查询复诊接口
  241 + *
  242 + * @param id
  243 + * @return
  244 + */
  245 + @RequestMapping(value = "/dt/findAntenatalExaminationData", method = RequestMethod.GET)
  246 + @ResponseBody
  247 + public BaseObjectResponse findAntenatalExaminationData(@RequestHeader("Authorization")String authorization,@RequestParam("id") String id) {
  248 + if (!Authorization.equals(authorization)){
  249 + return new BaseObjectResponse().setErrormsg("权限异常").setErrorcode(-1);
  250 + }
  251 + return viewFacade.findAntenatalExamination(id);
  252 + }
  253 +
  254 +
  255 + /**
  256 + * 返回该医院可选择的录入人
  257 + * 默认为大同客服号
  258 + * @return
  259 + */
  260 + @RequestMapping(method = RequestMethod.GET, value = "/dt/queryInPerson")
  261 + @ResponseBody
  262 + public BaseResponse queryInPerson(@RequestHeader("Authorization")String authorization) {
  263 + if (!Authorization.equals(authorization)){
  264 + return new BaseResponse().setErrormsg("权限异常").setErrorcode(-1);
  265 + }
  266 + return stopPregnancyFacade.queryInPerson(userId);
  267 + }
  268 +
  269 + /**
  270 + * 返回该医院可选择的录入人
  271 + * 默认为大同客服号
  272 + * @return
  273 + */
  274 + @RequestMapping(method = RequestMethod.GET, value = "/dt/queryInPerson2")
  275 + @ResponseBody
  276 + public BaseResponse queryInPerson2(@RequestHeader("Authorization")String authorization) {
  277 + if (!Authorization.equals(authorization)){
  278 + return new BaseResponse().setErrormsg("权限异常").setErrorcode(-1);
  279 + }
  280 + return stopPregnancyFacade.queryInPerson2(userId);
  281 + }
  282 +
  283 + /**
  284 + * 危急列表
  285 + * @param response
  286 + * @param page
  287 + * @param limit
  288 + * @param cardNo
  289 + * @param phone
  290 +
  291 + */
  292 + @RequestMapping(value = "/dt/lisCrisisItems", method = RequestMethod.GET)
  293 + public void getEmergenceTreatments(HttpServletResponse response,
  294 + @RequestHeader("Authorization")String authorization,
  295 + @RequestParam("page") int page,
  296 + @RequestParam("limit") int limit,
  297 + @RequestParam(value = "cardNo", required = false) String cardNo,
  298 + @RequestParam(value = "phone", required = false) String phone,
  299 + @RequestParam(value = "name", required = false) String name)
  300 + {
  301 + if (!Authorization.equals(authorization)){
  302 + ResultUtils.buildParameterErrorResultAndWrite(response, "权限异常");
  303 + return ;
  304 + }
  305 + LisCrisisItemQuery query = new LisCrisisItemQuery();
  306 + query.setPage(page);
  307 + query.setLimit(limit);
  308 + query.setNeed("y");
  309 + Boolean b=false;
  310 + if (StringUtils.isNotEmpty(cardNo)){
  311 + query.setCardNo(cardNo);
  312 + b=true;
  313 + }
  314 + if (StringUtils.isNotEmpty(phone)&&StringUtils.isNotEmpty(name)){
  315 + query.setPhone(phone);
  316 + query.setName(name);
  317 + b=true;
  318 + }
  319 + if (!b){
  320 + ResultUtils.buildParameterErrorResultAndWrite(response, "参数异常");
  321 + return;
  322 + }
  323 + query.setHospitalId(hospitalId);
  324 +
  325 +
  326 + List<LisCrisisItem> lisCrisisItemList = lisCrisisItemService.query(query, Sort.Direction.DESC, "publishTime");
  327 + List<Map> list = new ArrayList<>();
  328 +
  329 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(lisCrisisItemList)) {
  330 + for (LisCrisisItem data : lisCrisisItemList) {
  331 + Map<String, Object> map = new HashMap<>();
  332 + map.put("id", data.getId());
  333 + map.put("hospitalId", data.getHospitalId());
  334 + map.put("name", data.getName());
  335 + map.put("age", data.getAge());
  336 + map.put("itemCode", data.getItemCode());
  337 + map.put("itemName", data.getItemName());
  338 + map.put("classify", data.getClassify());
  339 + map.put("classifyName", data.getClassifyName());
  340 + map.put("flag", data.getFlag());
  341 + map.put("ref", data.getRef());
  342 + map.put("result", data.getResult());
  343 + map.put("unit", data.getUnit());
  344 + map.put("applyDoctorCode", data.getApplyDoctorCode());
  345 + map.put("applyDoctorName", data.getApplyDoctorName());
  346 + map.put("publishTime", DateUtil.getyyyy_MM_dd(data.getPublishTime()));
  347 + map.put("status", data.getStatus());
  348 + map.put("statusName", data.getStatusName());
  349 +
  350 + map.put("patientName", data.getPatientName());
  351 + map.put("cardNo", data.getCardNo());
  352 + map.put("phone", data.getPhone());
  353 + map.put("serviceType", data.getServiceType());
  354 + map.put("serviceStatus", data.getServiceStatus());
  355 + map.put("lastMenses", data.getLastMenses() == null ? 0 : data.getLastMenses().getTime());
  356 +
  357 + if (data.getWeek() >= 42) {
  358 + map.put("week", "已分娩");
  359 + } else {
  360 + map.put("week", data.getWeek() + "周");
  361 + }
  362 + map.put("pId", data.getPid());
  363 + map.put("pid", data.getPid());
  364 + map.put("patientId", data.getPatientId());
  365 +
  366 + list.add(map);
  367 + }
  368 + }
  369 + CommonResult result = new CommonResult();
  370 + result.setList(list);
  371 + result.setPageInfo(query.getPageInfo());
  372 +
  373 + ResultUtils.buildSuccessResultAndWrite(response, result);
  374 + }
  375 +
  376 + @RequestMapping(value = "/dt/findp2", method = RequestMethod.GET)
  377 + @ResponseBody
  378 + public BaseResponse getPatent2(@Valid PatientQueryRequest request,
  379 + @RequestHeader("Authorization")String authorization) {
  380 + if (!Authorization.equals(authorization)){
  381 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  382 + }
  383 + return patientFacade.findPatient2(request, userId);
  384 + }
  385 +
  386 + @RequestMapping(method = RequestMethod.GET, value = "/dt/getGongGaoCurve")
  387 + @ResponseBody
  388 + public BaseResponse getGongGaoLine(@RequestParam(required = true) String patientId,@RequestHeader("Authorization")String authorization) {
  389 + if (!Authorization.equals(authorization)){
  390 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  391 + }
  392 + return antenatalExaminationFacade.getGongGaoLine(patientId, userId);
  393 + }
  394 +
  395 + @RequestMapping(method = RequestMethod.GET, value = "/dt/antex")
  396 + @ResponseBody
  397 + public BaseResponse findOneAntById(@RequestHeader("Authorization")String authorization,@Valid AntExQueryRequest antExQueryRequest) {
  398 + if (!Authorization.equals(authorization)){
  399 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  400 + }
  401 + antExQueryRequest.setUserId(userId);
  402 + return antenatalExaminationFacade.findOneAntExById(antExQueryRequest);
  403 + }
  404 +
  405 + @RequestMapping(method = RequestMethod.POST, value = "/dt/antexmanage")
  406 + @ResponseBody
  407 + public BaseResponse addOneAntenatalExamination(@RequestHeader("Authorization")String authorization,@Valid @RequestBody AntExAddRequest antExAddRequest) {
  408 + if (!Authorization.equals(authorization)){
  409 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  410 + }
  411 + BaseResponse baseResponse = antenatalExaminationFacade.addOneAntEx(antExAddRequest, userId);
  412 + baseResponse.setObject(couponService.getPatientsInfoByCode(antExAddRequest.getCouponCode()));
  413 + return baseResponse;
  414 + }
  415 +
  416 + /**
  417 + * 查询初诊接口
  418 + *
  419 + * @param id
  420 + * @return
  421 + */
  422 + @RequestMapping(value = "/dt/findAntExChuData", method = RequestMethod.GET)
  423 + @ResponseBody
  424 + public BaseObjectResponse findAntExChuData(@RequestParam("id") String id,
  425 + @RequestHeader("Authorization")String authorization) {
  426 + if (!Authorization.equals(authorization)){
  427 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  428 + }
  429 + BaseObjectResponse br = viewFacade.findAntExChu(id);
  430 + return br;
  431 + }
  432 +
  433 + @Autowired
  434 + private LisFacade lisFacade;
  435 +
  436 + @RequestMapping(method = RequestMethod.GET, value = "/dt/getLisAndRisData")
  437 + @ResponseBody
  438 + public BaseResponse getLisAndRisData(@RequestHeader("Authorization")String authorization,
  439 + @RequestParam(required = false) String vcCardNo,
  440 + @RequestParam(required = false) String sINCard,
  441 + @RequestParam("sortType") Integer sortType,
  442 + @RequestParam(required = false) String phone,
  443 + @RequestParam(required = false) String cardNo,
  444 + @RequestParam(required = false) String userName,
  445 + @RequestParam(defaultValue = "1") Integer perType//默认孕妇
  446 + ) {
  447 + if (!Authorization.equals(authorization)){
  448 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  449 + }
  450 + return lisFacade.getLisAndRisData(vcCardNo,sINCard, phone,cardNo, sortType,perType, userName,userId);
  451 + }
  452 +
  453 + /**
  454 + * 增加产检高危手册(大同)
  455 + * @param antExHighRiskModel
  456 + * @return
  457 + */
  458 + @RequestMapping(method = RequestMethod.POST, value = "/dt/addAntexHighRisk")
  459 + @ResponseBody
  460 + public BaseResponse addAntexHighRisk(@RequestHeader("Authorization")String authorization,@RequestBody AntExHighRiskModel antExHighRiskModel){
  461 + if (!Authorization.equals(authorization)){
  462 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  463 + }
  464 + return antenatalExaminationFacade.addAntexHighRisk(antExHighRiskModel,userId);
  465 + }
  466 +
  467 + /**
  468 + * 查询产检高危手册(大同)
  469 + * @param parentId
  470 + * @return
  471 + */
  472 + @RequestMapping(method = RequestMethod.GET, value = "/dt/queryAntexHighRisk")
  473 + @ResponseBody
  474 + public BaseResponse queryAntexHighRisk(@RequestHeader("Authorization")String authorization,@RequestParam String parentId){
  475 + if (!Authorization.equals(authorization)){
  476 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  477 + }
  478 + return antenatalExaminationFacade.queryAntexHighRisk(parentId,userId);
  479 + }
  480 +
  481 + @RequestMapping(method = RequestMethod.POST, value = "/dt/addPatientNipt")
  482 + @ResponseBody
  483 + public BaseResponse addPatientNipt(@RequestHeader("Authorization")String authorization,@RequestBody PatientNiptDTO patientNiptDTO){
  484 + if (!Authorization.equals(authorization)){
  485 + return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
  486 + }
  487 + return antenatalExaminationFacade.addPatientNipt(patientNiptDTO,userId);
  488 + }
  489 +
  490 + @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment")
  491 + @ResponseBody
  492 + public BaseResponse getAppointment(@RequestHeader("Authorization")String authorization,
  493 + @RequestParam(required = true) String doctor,
  494 + @RequestParam(required = true) String startTime,
  495 + @RequestParam(required = true) String endTime,
  496 + @RequestParam(required = false) String name
  497 +
  498 + ) {
  499 + if (!Authorization.equals(authorization)){
  500 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  501 + }
  502 + BaseResponse baseResponse=new BaseResponse();
  503 + startTime=startTime+" 00:00:00";
  504 + endTime=endTime+" 23:59:59";
  505 + baseResponse.setObject(appointmentService.queryAppointment(doctor,startTime,endTime,name));
  506 + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  507 + return baseResponse;
  508 + }
  509 + @RequestMapping(method = RequestMethod.GET, value = "/dt/sync/appointment")
  510 + @ResponseBody
  511 + public BaseResponse syncAppointmentList(@RequestHeader("Authorization")String authorization,
  512 + @RequestParam(required = true) String doctor,
  513 + @RequestParam(required = true) String date){
  514 + if (!Authorization.equals(authorization)){
  515 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  516 + }
  517 + Map<String,String> params=new HashMap<>();
  518 + params.put("doctor",doctor);
  519 + params.put("ksrq",date+" 00:00:00");
  520 + params.put("jsrq",date+" 23:59:59");
  521 + String str= HttpClientUtil.doGet("/dtdyrm/getdtAppointment" ,params,"utf-8",null);
  522 + System.out.println(str);
  523 + return new BaseResponse();
  524 + }
  525 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java View file @ e82c333
... ... @@ -165,7 +165,6 @@
165 165 String bookbuildingDoctor = patients.getBookbuildingDoctor();
166 166 //续期,增加
167 167 if(yxzhVO.getRenew() == 1){
168   - System.out.println("111111111111111111111111");
169 168 //1孕妇 2儿童 3 产妇
170 169 PatientServiceQuery patientServiceQuery = new PatientServiceQuery();
171 170 List<PatientService> patientServices=new ArrayList<>();
... ... @@ -182,6 +181,7 @@
182 181 ps.setSerStatus(1);
183 182 ps.setServiceWeek(yxzhVO.getWeeks());
184 183 ps.setSerType(1);
  184 +
185 185 patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor));
186 186  
187 187 }
... ... @@ -228,7 +228,6 @@
228 228 }
229 229 return baseResponse;
230 230 }else{
231   - System.out.println("2222222");
232 231 List<Map<String,String>> list = new ArrayList<>();
233 232 PatientService ps = new PatientService();
234 233 ps.setSerStatus(1);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PostpartumReportController.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.common.annotation.TokenRequired;
  4 +import com.lyms.platform.common.base.BaseController;
  5 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  6 +import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.common.utils.StringUtils;
  8 +import com.lyms.platform.operate.web.facade.PostpartumReportFacade;
  9 +import com.lyms.platform.pojo.PostpartumReport;
  10 +import com.lyms.platform.query.PostpartumReportQuery;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.stereotype.Controller;
  13 +import org.springframework.web.bind.annotation.*;
  14 +
  15 +import javax.servlet.http.HttpServletRequest;
  16 +
  17 +@Controller
  18 +@RequestMapping("/postpartumReport")
  19 +public class PostpartumReportController extends BaseController {
  20 + @Autowired
  21 + private PostpartumReportFacade postpartumReportFacade;
  22 +
  23 + /**
  24 + * 模板报告列表
  25 + * @param request
  26 + * @return
  27 + */
  28 + @RequestMapping(method = RequestMethod.GET, value = "/getList")
  29 + @ResponseBody
  30 + @TokenRequired
  31 + public BaseResponse getPostpartumReportList(@RequestParam(required = false) String rFactor,
  32 + @RequestParam("page") Integer page,
  33 + @RequestParam("limit") Integer limit,
  34 + HttpServletRequest request) {
  35 +
  36 + PostpartumReportQuery postpartumReportQuery=new PostpartumReportQuery();
  37 + postpartumReportQuery.setrFactor(rFactor);
  38 + postpartumReportQuery.setPage(page);
  39 + postpartumReportQuery.setLimit(limit);
  40 + return postpartumReportFacade.queryPatient(postpartumReportQuery,getUserId(request));
  41 + }
  42 + /**
  43 + * 新增模板报告
  44 + * @param postpartumReport
  45 + * @return
  46 + */
  47 + @RequestMapping(method = RequestMethod.POST, value = "/add")
  48 + @ResponseBody
  49 + @TokenRequired
  50 + public BaseResponse addPostpartumReport(@RequestBody PostpartumReport postpartumReport){
  51 + postpartumReportFacade.add(postpartumReport);
  52 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  53 + }
  54 +
  55 + /**
  56 + * 获取报告详情
  57 + * @return
  58 + */
  59 + @RequestMapping(method = RequestMethod.GET, value = "/getInfo")
  60 + @ResponseBody
  61 + @TokenRequired
  62 + public BaseResponse getInfo(@RequestParam(required = true)String id){
  63 + BaseResponse baseResponse= new BaseResponse();
  64 + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setObject(postpartumReportFacade.getPatient(id));
  65 + return baseResponse;
  66 + }
  67 + @RequestMapping(method = RequestMethod.POST, value = "/update")
  68 + @ResponseBody
  69 + @TokenRequired
  70 + public BaseResponse updateById(@RequestBody PostpartumReport postpartumReport){
  71 + if (StringUtils.isEmpty(postpartumReport.getId())){
  72 + return new BaseResponse().setErrorcode(-1).setErrormsg("参数异常");
  73 + }
  74 + postpartumReportFacade.updateById(postpartumReport,postpartumReport.getId());
  75 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  76 + }
  77 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnancyReportController.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.common.annotation.TokenRequired;
  4 +import com.lyms.platform.common.base.BaseController;
  5 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  6 +import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.common.utils.StringUtils;
  8 +import com.lyms.platform.operate.web.facade.PregnancyReportFacade;
  9 +import com.lyms.platform.operate.web.facade.PregnancyReportMattersServiceFacade;
  10 +import com.lyms.platform.pojo.PregnancyReport;
  11 +import com.lyms.platform.pojo.PregnancyReportMatters;
  12 +import com.lyms.platform.query.PregnancyReportMattersQuery;
  13 +import com.lyms.platform.query.PregnancyReportQuery;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Controller;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.servlet.http.HttpServletRequest;
  19 +
  20 +/**
  21 + * 孕期营养报告模版
  22 + */
  23 +@Controller
  24 +@RequestMapping("/pregnancyReport")
  25 +public class PregnancyReportController extends BaseController {
  26 + @Autowired
  27 + private PregnancyReportFacade pregnancyReportFacade;
  28 + @Autowired
  29 + private PregnancyReportMattersServiceFacade pregnancyReportMattersServiceFacade;
  30 +
  31 + /**
  32 + * 新增模板报告
  33 + * @return
  34 + */
  35 + @RequestMapping(method = RequestMethod.POST, value = "/add")
  36 + @ResponseBody
  37 + @TokenRequired
  38 + public BaseResponse addPostpartumReport(@RequestBody PregnancyReport pregnancyReport){
  39 + pregnancyReportFacade.add(pregnancyReport);
  40 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  41 + }
  42 +
  43 + @RequestMapping(method = RequestMethod.POST, value = "/update")
  44 + @ResponseBody
  45 + @TokenRequired
  46 + public BaseResponse updateById(@RequestBody PregnancyReport postpartumReport){
  47 + if (StringUtils.isEmpty(postpartumReport.getId())){
  48 + return new BaseResponse().setErrorcode(-1).setErrormsg("参数异常");
  49 + }
  50 + pregnancyReportFacade.update(postpartumReport);
  51 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  52 + }
  53 +
  54 + /**
  55 + * 获取报告详情
  56 + * @return
  57 + */
  58 + @RequestMapping(method = RequestMethod.GET, value = "/getList")
  59 + @ResponseBody
  60 + @TokenRequired
  61 + public BaseResponse getList(@RequestParam(required = false) String rFactor,
  62 + @RequestParam(required = false) Integer week,
  63 + @RequestParam(required = false) Integer weightType
  64 + ,HttpServletRequest request){
  65 + PregnancyReportQuery pregnancyReportQuery=new PregnancyReportQuery();
  66 + pregnancyReportQuery.setWeek(week);
  67 + pregnancyReportQuery.setWeightType(weightType);
  68 + pregnancyReportQuery.setrFactor(rFactor);
  69 + return pregnancyReportFacade.getInfo(pregnancyReportQuery,getUserId(request));
  70 + }
  71 +
  72 + /**
  73 + * 新增模板报告
  74 + * @return
  75 + */
  76 + @RequestMapping(method = RequestMethod.POST, value = "/matters/add")
  77 + @ResponseBody
  78 + @TokenRequired
  79 + public BaseResponse addPostpartumReportMatters(@RequestBody PregnancyReportMatters pregnancyReport){
  80 + pregnancyReportMattersServiceFacade.add(pregnancyReport);
  81 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  82 + }
  83 +
  84 + @RequestMapping(method = RequestMethod.POST, value = "/matters/update")
  85 + @ResponseBody
  86 + @TokenRequired
  87 + public BaseResponse updateMattersById(@RequestBody PregnancyReportMatters postpartumReport){
  88 + if (StringUtils.isEmpty(postpartumReport.getId())){
  89 + return new BaseResponse().setErrorcode(-1).setErrormsg("参数异常");
  90 + }
  91 + pregnancyReportMattersServiceFacade.updateById(postpartumReport);
  92 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  93 + }
  94 +
  95 + /**
  96 + * 获取报告详情
  97 + * @return
  98 + */
  99 + @RequestMapping(method = RequestMethod.GET, value = "/matters/getList")
  100 + @ResponseBody
  101 + @TokenRequired
  102 + public BaseResponse getMattersList(
  103 + @RequestParam(required = false) Integer week,
  104 + @RequestParam(required = false) Integer riskType,
  105 + @RequestParam("page") Integer page,
  106 + @RequestParam("limit") Integer limit
  107 + ,HttpServletRequest request){
  108 + PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery();
  109 + postpartumReportQuery.setWeek(week);
  110 + postpartumReportQuery.setRiskType(riskType);
  111 + postpartumReportQuery.setPage(page);
  112 + postpartumReportQuery.setLimit(limit);
  113 + return pregnancyReportMattersServiceFacade.getList(postpartumReportQuery,getUserId(request));
  114 + }
  115 +
  116 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ e82c333
... ... @@ -1491,6 +1491,7 @@
1491 1491 Date twenty = DateUtil.addDay(day, -21);
1492 1492 Date twentyEight = DateUtil.addDay(day, -28);
1493 1493 Map<String, Date> params = new HashMap<>();
  1494 + /* params.put("day",day);*/
1494 1495 params.put("seven", seven);
1495 1496 params.put("fourteen", fourteen);
1496 1497 params.put("twenty", twenty);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java View file @ e82c333
... ... @@ -558,7 +558,6 @@
558 558 }
559 559 } else if (ps.getPerType() != null && ps.getPerType() == 1) {//孕妇建档服务数据处理
560 560 if (PatientSerEnums.SerTypeEnums.yqjzzd.getId() == Integer.parseInt(serInfo.get("serType"))) {//孕期精准指导同步到建档
561   - System.out.println("333333333333333333333");
562 561 Patients patient = new Patients();
563 562 patient.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId());
564 563 patient.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId());
... ... @@ -567,7 +566,7 @@
567 566 sendServiceMsg(patients, SmsServiceEnums.FWKT.getId(), "您好,请点击此处查看开通服务内容详情。", "大同市第一人民医院", ServiceObjEnums.YUNOBJ.getId(), 1);
568 567  
569 568 } else if (PatientSerEnums.SerTypeEnums.bzfw.getId().intValue() == Integer.parseInt(serInfo.get("serType"))) {
570   - System.out.println("555555555555555555555555");
  569 +
571 570 PatientServiceQuery query = new PatientServiceQuery();
572 571 query.setParentid(ps.getParentid());
573 572 query.setSerType(PatientSerEnums.SerTypeEnums.yqjzzd.getId());
... ... @@ -582,7 +581,6 @@
582 581 }
583 582 } else {//产妇建档服务数据处理
584 583 if (PatientSerEnums.SerTypeEnums.chkf.getId() == Integer.parseInt(serInfo.get("serType"))) {//产后康复同步到建档
585   - System.out.println("66666666666666666");
586 584 Patients patient = new Patients();
587 585 patient.setServiceType(ServiceTypeEnums.ADD_MAT_DELIVER_SERVICE.getId());
588 586 patient.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId());
... ... @@ -608,28 +606,6 @@
608 606 //Thread.sleep(5000);
609 607 logger.info("sendServiceMsg startup");
610 608 List<MsgRequest> messages = new ArrayList<>();
611   - MsgRequest mr = new MsgRequest();
612   - mr.setPhone(patient.getPhone());
613   - mr.setMemberId(null);
614   - mr.setTypeId(ProjectTypeEnums.YNXT.getId());
615   - mr.setStatus(SmsStatusEnums.WFS.getId());
616   - mr.setHospitalId(patient.getHospitalId());
617   - mr.setTempId(patient.getId());
618   - mr.setPatientId(patient.getId());
619   - mr.setSmsStatus(SmsStatusEnums.WFS.getId());
620   - mr.setServiceType(1); //判断发送类型
621   - mr.setFirst(first);//
622   - mr.setObjType(objType);
623   - mr.setSubTypeId(subTypeId);
624   - mr.setKeyword1(keyWord1);//
625   - //planTime 和 timeType为必填 否则推送中心会推送异常
626   - mr.setTimeType(SmsTimeTypeEnums.ONTIME.getId());
627   - mr.setPlanTime(DateUtil.getyyyy_MM_dd_hms(new Date()));
628   - mr.setKeyword2("产科");
629   - mr.setRemark(patient.getUsername());
630   - mr.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date()));
631   - mr.setWxTempId(WxTempleteIdEnums.YUX_XUE_KE_CHEN_FB.getId());
632   - messages.add(mr);
633 609 if (type != null) {
634 610 String title = "服务提醒短信";
635 611 String messageContent = "【大同市第一人民医院】" + "欢迎加入我院健康咨询服务:请微信-添加朋友-公众号-搜索“美生孕育”关注;点击开通成功提醒,手机号获取验证码成功登录宝贝孕程小程序。请确保登录成功并持续关注“美生孕育”公众号,正常接收产检提醒,享受个性化指导文章推送、孕期随访及营养指导等服务。";
636 612  
... ... @@ -649,13 +625,35 @@
649 625 request.setTimeType(SmsTimeTypeEnums.ONTIME.getId());
650 626 request.setHospitalId("2100002419");
651 627 request.setPatientId(patient.getId());
652   - request.setTempId(patient.getId());
653   - mr.setWxTempId(WxTempleteIdEnums.YUX_XUE_KE_CHEN_FB.getId());
  628 + request.setTempId(patient.getPid());
  629 + request.setWxTempId("tx-UmDE3YMqYgAeFccXB7HIlTuG_tiP9LMdX2bvBpus");
654 630 request.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date()));
655 631 request.setFirst(messageContent);
656 632 request.setKeyword1(title);
657 633 request.setKeyword2(DateUtil.getyyyy_MM_dd(DateUtil.addDay(new Date(), 0)));
658 634 messages.add(request);
  635 + }else {
  636 + MsgRequest mr = new MsgRequest();
  637 + mr.setPhone(patient.getPhone());
  638 + mr.setTypeId(ProjectTypeEnums.YNXT.getId());
  639 + mr.setStatus(SmsStatusEnums.WFS.getId());
  640 + mr.setHospitalId(patient.getHospitalId());
  641 + mr.setTempId(patient.getId());
  642 + mr.setPatientId(patient.getId());
  643 + mr.setSmsStatus(SmsStatusEnums.WFS.getId());
  644 + mr.setServiceType(1); //判断发送类型
  645 + mr.setFirst(first);//
  646 + mr.setObjType(objType);
  647 + mr.setSubTypeId(subTypeId);
  648 + mr.setKeyword1(keyWord1);//
  649 + //planTime 和 timeType为必填 否则推送中心会推送异常
  650 + mr.setTimeType(SmsTimeTypeEnums.ONTIME.getId());
  651 + mr.setPlanTime(DateUtil.getyyyy_MM_dd_hms(new Date()));
  652 + mr.setKeyword2("产科");
  653 + mr.setRemark(patient.getUsername());
  654 + mr.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date()));
  655 + mr.setWxTempId("tx-UmDE3YMqYgAeFccXB7HIlTuG_tiP9LMdX2bvBpus");
  656 + messages.add(mr);
659 657 }
660 658  
661 659 smsConfigFacade.saveMsg(messages, patient.getHospitalId());
... ... @@ -877,6 +875,7 @@
877 875 patient.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId());
878 876 if (ps.getSerStatus().intValue() == PatientSerEnums.SerStatusEnums.kt.getId().intValue()) {
879 877 patient.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId());
  878 + //sendServiceMsg(patient, SmsServiceEnums.FWKT.getId(), "您好,请点击此处查看开通服务内容详情。", "大同市第一人民医院", ServiceObjEnums.YUNOBJ.getId(), 1);
880 879 } else if (ps.getSerStatus().intValue() == PatientSerEnums.SerStatusEnums.td.getId().intValue()) {
881 880 patient.setServiceStatus(ServiceStatusEnums.UNSUBSCRIBE.getId());
882 881 } else if (ps.getSerStatus().intValue() == PatientSerEnums.SerStatusEnums.gq.getId().intValue()) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostpartumReportFacade.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.PostpartumReportService;
  4 +import com.lyms.platform.common.result.BaseResponse;
  5 +import com.lyms.platform.pojo.PostpartumReport;
  6 +import com.lyms.platform.query.PostpartumReportQuery;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +@Component
  11 +public class PostpartumReportFacade {
  12 + @Autowired
  13 + private PostpartumReportService postpartumReportService;
  14 +
  15 + @Autowired
  16 + private AutoMatchFacade autoMatchFacade;
  17 +
  18 + public BaseResponse queryPatient(PostpartumReportQuery postpartumReportQuery, Integer userId) {
  19 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  20 + postpartumReportQuery.setHospitalId(hospitalId);
  21 + postpartumReportQuery.setYn(1);
  22 + return postpartumReportService.queryPatient(postpartumReportQuery);
  23 + }
  24 +
  25 + public PostpartumReport add(PostpartumReport postpartumReport){
  26 + return postpartumReportService.add(postpartumReport);
  27 + }
  28 +
  29 + public void updateById(PostpartumReport postpartumReport,String id){
  30 + postpartumReportService.updateById(postpartumReport,id);
  31 + }
  32 +
  33 + public PostpartumReport getPatient(String id){
  34 + return postpartumReportService.getPatient(id);
  35 + }
  36 +
  37 +
  38 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.PregnancyReportMattersService;
  4 +import com.lyms.platform.biz.service.PregnancyReportService;
  5 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  6 +import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.operate.web.utils.CollectionUtils;
  8 +import com.lyms.platform.pojo.PregnancyReport;
  9 +import com.lyms.platform.pojo.PregnancyReportMatters;
  10 +import com.lyms.platform.query.PregnancyReportMattersQuery;
  11 +import com.lyms.platform.query.PregnancyReportQuery;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import java.util.List;
  16 +
  17 +@Component
  18 +public class PregnancyReportFacade {
  19 + @Autowired
  20 + private AutoMatchFacade autoMatchFacade;
  21 + @Autowired
  22 + private PregnancyReportService pregnancyReportService;
  23 + @Autowired
  24 + private PregnancyReportMattersService pregnancyReportMattersService;
  25 +
  26 + public BaseResponse add(PregnancyReport postpartumReport){
  27 + postpartumReport.setWeek(getWeek(postpartumReport.getWeek()));
  28 + pregnancyReportService.add(postpartumReport);
  29 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  30 + }
  31 +
  32 + public BaseResponse update(PregnancyReport postpartumReport){
  33 + postpartumReport.setWeek(getWeek(postpartumReport.getWeek()));
  34 + pregnancyReportService.updateById(postpartumReport,postpartumReport.getId());
  35 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  36 + }
  37 +
  38 + public BaseResponse getInfo(PregnancyReportQuery pregnancyReportQuery,Integer userId){
  39 + String hospitalId= autoMatchFacade.getHospitalId(userId);
  40 + pregnancyReportQuery.setHospitalId(hospitalId);
  41 + pregnancyReportQuery.setYn(1);
  42 + Integer week= pregnancyReportQuery.getWeek();
  43 + pregnancyReportQuery.setWeek(getWeek(week));
  44 + List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery);
  45 + if (CollectionUtils.isNotEmpty(list)){
  46 + for (PregnancyReport pregnancyReport:list){
  47 + PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery();
  48 + postpartumReportQuery.setYn(1);
  49 + postpartumReportQuery.setHospitalId(hospitalId);
  50 + postpartumReportQuery.setWeek(week);
  51 + Integer riskType=1;
  52 + if (pregnancyReport.getRiskFactorName().contains("健康")){
  53 + riskType=0;
  54 + }
  55 + postpartumReportQuery.setRiskType(riskType);
  56 + List<PregnancyReportMatters> mattersList= pregnancyReportMattersService.queryPregnancyReport(postpartumReportQuery);
  57 + if (CollectionUtils.isNotEmpty(mattersList)){
  58 + pregnancyReport.setMatters(mattersList.get(0).getMatters());
  59 + }
  60 + }
  61 + }
  62 + BaseResponse baseResponse=new BaseResponse();
  63 + baseResponse.setObject(list);
  64 + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  65 + baseResponse.setErrormsg("成功");
  66 + return baseResponse;
  67 + }
  68 +
  69 + //1是孕早期 14周之前 2是孕中期 14-27周+6 3是孕晚期28周及以后
  70 + private Integer getWeek(Integer week){
  71 + Integer num=0;
  72 + if (week>=14&&week<=27){
  73 + num=2;
  74 + }else if (week>=28){
  75 + num=3;
  76 + }else {
  77 + num=1;
  78 + }
  79 + return num;
  80 + }
  81 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportMattersServiceFacade.java View file @ e82c333
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.PregnancyReportMattersService;
  4 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  5 +import com.lyms.platform.common.result.BaseListResponse;
  6 +import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.pojo.PregnancyReportMatters;
  8 +import com.lyms.platform.query.PregnancyReportMattersQuery;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import java.util.List;
  13 +
  14 +@Component
  15 +public class PregnancyReportMattersServiceFacade {
  16 + @Autowired
  17 + private PregnancyReportMattersService pregnancyReportMattersService;
  18 + @Autowired
  19 + private AutoMatchFacade autoMatchFacade;
  20 +
  21 + public BaseResponse add(PregnancyReportMatters postpartumReport){
  22 + pregnancyReportMattersService.add(postpartumReport);
  23 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  24 + }
  25 +
  26 + public BaseResponse getList(PregnancyReportMattersQuery postpartumReportQuery,Integer userId){
  27 + String hospitalId= autoMatchFacade.getHospitalId(userId);
  28 + postpartumReportQuery.setHospitalId(hospitalId);
  29 + postpartumReportQuery.setYn(1);
  30 + List<PregnancyReportMatters> list= pregnancyReportMattersService.queryPregnancyReport(postpartumReportQuery);
  31 + BaseListResponse objectResponse = new BaseListResponse();
  32 + objectResponse.setData(list);
  33 + objectResponse.setPageInfo(postpartumReportQuery.getPageInfo());
  34 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  35 + objectResponse.setErrormsg("成功");
  36 + return objectResponse;
  37 + }
  38 +
  39 + public BaseResponse updateById(PregnancyReportMatters postpartumReport){
  40 + pregnancyReportMattersService.updateById(postpartumReport,postpartumReport.getId());
  41 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  42 + }
  43 +}