From ac459f56154c17b78e06f0f71a5f24c07081b126 Mon Sep 17 00:00:00 2001 From: gengxiaokai Date: Mon, 18 Jun 2018 18:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B8=E5=9F=8E=E5=A4=8D=E8=AF=8A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyms/hospitalapi/zcfy/ZcPrenatalService.java | 104 ++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java index 8039df7..a605725 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java @@ -6,6 +6,7 @@ import com.lyms.platform.common.result.BaseListResponse; import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.operate.web.facade.ViewFacade; import com.lyms.platform.pojo.AntExChuModel; +import com.lyms.platform.pojo.AntenatalExaminationModel; import com.lyms.platform.pojo.Patients; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -96,7 +97,8 @@ public class ZcPrenatalService { "bloodSugar,xqgbzam,xqgczam,albumin,totalBilirubin,\n" + "jhBilirubin,ygbmky,ygbmkt,ygeky,ygekt,\n" + "yghxkt,xqjq,xnsd,hivkt,ydfmw,ydqjd,\n" + - "bChao,heartRate,fetalPosition,fetalPresentation,join1) " + + "bChao,heartRate,fetalPosition,fetalPresentation,join1,checkDate,\n" + + "cDueWeek,checkDoctor,hospital) " + "values("+antExChuModel.getId()+","+patients.getUsername()+","+patients.getCardNo()+","+patients.getVcCardNo()+",\n" + ""+patients.getPhone()+","+map.get("genRemark")+","+map.get("gynRemark")+","+map.get("treatmentOpinion3")+",\n" + ""+map.get("quicken")+","+map.get("quickenRemark")+","+map.get("resultSupple")+","+map.get("syjgSelect")+",\n" + @@ -114,7 +116,8 @@ public class ZcPrenatalService { ""+map.get("bloodSugar")+","+map.get("xqgbzam")+","+map.get("xqgczam")+","+map.get("albumin")+","+map.get("totalBilirubin")+",\n" + ""+map.get("jhBilirubin")+","+map.get("ygbmky")+","+map.get("ygbmkt")+","+map.get("ygeky")+","+map.get("ygekt")+",\n" + ""+map.get("yghxkt")+","+map.get("xqjq")+","+map.get("xnsd")+","+map.get("hivkt")+","+map.get("ydfmw")+","+map.get("ydqjd")+",\n" + - ""+map.get("bChao")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+")"; + ""+map.get("bChao")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+","+map.get("checkDate")+",\n" + + ""+map.get("cDueWeek")+","+map.get("checkDoctor")+","+map.get("hospital")+")"; ps=conn.prepareStatement(inSql); int result = ps.executeUpdate(); @@ -150,4 +153,101 @@ public class ZcPrenatalService { + //复诊 + public BaseObjectResponse saveAntexFu(AntenatalExaminationModel antenatalExaminationModel) { + + PreparedStatement ps = null; + ResultSet rs = null; + Connection conn = ConnTools.makeCzConnection(); + int count = 0; + + try{ + //首先查询孕妇基本信息 + Patients patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId()); + + BaseObjectResponse br = viewFacade.findAntenatalExamination(antenatalExaminationModel.getId()); + + if(br.getData() != null && patients != null){ + + String slSql = "select count(*) from lyms_zcfz where id = " + antenatalExaminationModel.getId() + ""; + ps = conn.prepareStatement(slSql); + rs = ps.executeQuery(); + while(rs.next()){ + count = rs.getInt(1); + } + + if(count > 0){//更新数据 + String delSql = "delete from lyms_zcfz where id="+antenatalExaminationModel.getId()+""; + ps = conn.prepareStatement(delSql); + int delCount = ps.executeUpdate(); + if(delCount == 1){ + System.out.print("旧数据删除成功!"); + } + + } + + + //新增数据 + Map map = (Map)br.getData(); + List> list = (List)map.get("tireData"); + String fetalPosition = null; + String heartRate = null; + String fetalPresentation = null; + String join1 = null; + + if(list != null && list.size()>0){ + fetalPosition = list.get(0).get("fetalPosition").toString();//胎方位 + heartRate = list.get(0).get("heartRate").toString();//心率 + fetalPresentation = list.get(0).get("fetalPresentation").toString();//胎先露 + join1 = list.get(0).get("join").toString();//衔接 + + } + + String inSql = "insert into lyms_zcfz(id,name,idcard,vccardno,\n" + + "phone,checkDate,currentDueDate,checkDoctor,\n" + + "hospital,chiefComplaint,bp,weight,gongGao,\n" + + "abdominalCircumference,edema,tireNumber,quicken,\n" + + "quickenRemark,heartRate,FetalPosition,fetalPresentation,join1,\n" + + "hemoglobin,urineProtein,bloodSugar,bloodSugar2,\n" + + "bloodSugar3,bloodSugar4,bChao,diagnosis,\n" + + "diagnosisOther,treatmentOpinion,guide) " + + "values("+antenatalExaminationModel.getId()+","+patients.getUsername()+","+patients.getCardNo()+","+patients.getVcCardNo()+",\n" + + ""+patients.getPhone()+","+map.get("checkDate")+","+map.get("currentDueDate")+","+map.get("checkDoctor")+",\n" + + ""+map.get("hospital")+","+map.get("chiefComplaint")+","+map.get("bp")+","+map.get("weight")+","+map.get("gongGao")+",\n" + + ""+map.get("abdominalCircumference")+","+map.get("edema")+","+map.get("tireNumber")+","+map.get("quicken")+",\n" + + ""+map.get("quickenRemark")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+",\n" + + ""+map.get("hemoglobin")+","+map.get("urineProtein")+","+map.get("bloodSugar")+","+map.get("bloodSugar2")+",\n" + + ""+map.get("bloodSugar3")+","+map.get("bloodSugar4")+","+map.get("bChao")+","+map.get("diagnosis")+",\n" + + ""+map.get("diagnosisOther")+","+map.get("treatmentOpinion")+","+map.get("guide")+")"; + + ps = conn.prepareStatement(inSql); + int result = ps.executeUpdate(); + if(result > 0){ + br.setErrorcode(ErrorCodeConstants.SUCCESS); + br.setErrormsg("成功"); + return br; + } + + } + + }catch (Exception e){ + + e.printStackTrace(); + + }finally { + try{ + ps.close(); + rs.close(); + conn.close(); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + return null; + } + + + } -- 1.8.3.1