From 9872195a19dfffdc1bf46bb3adc43eca910c4de7 Mon Sep 17 00:00:00 2001 From: yangfei Date: Tue, 11 Jul 2017 18:09:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=A3=80=E5=8C=BB=E7=94=9F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/BabyPatientExtendEarFollowUp.java | 37 +++-- .../BabyPatientExtendEarMotherServiceImpl.java | 51 ++++--- .../master/BabyPatientExtendEarFollowUp.xml | 10 +- .../lyms/platform/common/utils/StringUtils.java | 12 ++ .../controller/AntexDoctorStatistController.java | 149 ++++++++++++++++++++- .../operate/web/controller/FollowUpController.java | 9 +- .../src/main/webapp/WEB-INF/web.xml | 4 +- 7 files changed, 220 insertions(+), 52 deletions(-) diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFollowUp.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFollowUp.java index a6fa6ee..08faa21 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFollowUp.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFollowUp.java @@ -2,11 +2,7 @@ package com.lyms.platform.permission.model; import java.util.Date; -public class BabyPatientExtendEarFollowUp { - /** - * 主键 - */ - private String id; +public class BabyPatientExtendEarFollowUp extends AbstracUuidEntity{ /** * 儿童档案ID */ @@ -44,20 +40,20 @@ public class BabyPatientExtendEarFollowUp { */ private String followInfo; /** - * 助听器(0-左耳,2-右耳,3-全部) + * 助听器(1-左耳,2-右耳,3-全部) */ private Integer audiphone; /** - * 手术(0-左耳,2-右耳,3-全部) + * 手术(1-左耳,2-右耳,3-全部) */ private Integer operation; /** - * 人工耳蜗(0-左耳,2-右耳,3-全部) + * 人工耳蜗(1-左耳,2-右耳,3-全部) */ private Integer artifiCochlea; /** - * 是否选择助听器 + * 是否选择助听器(0-未选择,1-选择) */ private Integer isAudiphone; /** @@ -65,7 +61,7 @@ public class BabyPatientExtendEarFollowUp { */ private Integer isOperation; /** - * 是否选择人工耳蜗(0-左耳,2-右耳,3-全部) + * 是否选择人工耳蜗(0-未选择,1-选择) */ private Integer isArtifiCochlea; @@ -90,6 +86,10 @@ public class BabyPatientExtendEarFollowUp { */ private String nextTimeStr; /** + * 月龄 + */ + private Integer monthAge; + /** * 是否删除 */ private Integer ifdel; @@ -194,15 +194,6 @@ public class BabyPatientExtendEarFollowUp { this.hospitalStr = hospitalStr; } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - - } - public String getBabyId() { return babyId; } @@ -220,6 +211,14 @@ public class BabyPatientExtendEarFollowUp { } + public Integer getMonthAge() { + return monthAge; + } + + public void setMonthAge(Integer monthAge) { + this.monthAge = monthAge; + } + public String getFollowAddr() { return followAddr; } diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/BabyPatientExtendEarMotherServiceImpl.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/BabyPatientExtendEarMotherServiceImpl.java index ae86987..4b7c40a 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/BabyPatientExtendEarMotherServiceImpl.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/BabyPatientExtendEarMotherServiceImpl.java @@ -7,26 +7,45 @@ import com.lyms.platform.permission.service.BabyPatientExtendEarMotherService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.List; @Service public class BabyPatientExtendEarMotherServiceImpl implements BabyPatientExtendEarMotherService { -@Autowired -private BabyPatientExtendEarMotherMapper babyPatientExtendEarMotherMapper; - -@Override -public void addBabyPatientExtendEarMother(BabyPatientExtendEarMother obj){babyPatientExtendEarMotherMapper.addBabyPatientExtendEarMother(obj);} -@Override -public void updateBabyPatientExtendEarMother(BabyPatientExtendEarMother obj){babyPatientExtendEarMotherMapper.updateBabyPatientExtendEarMother(obj);} -@Override -public void deleteBabyPatientExtendEarMother (String id){babyPatientExtendEarMotherMapper.deleteBabyPatientExtendEarMother(id);} -@Override -public BabyPatientExtendEarMother getBabyPatientExtendEarMother (String id){return babyPatientExtendEarMotherMapper.getBabyPatientExtendEarMother(id);} -@Override -public int queryBabyPatientExtendEarMotherCount (BabyPatientExtendEarMotherQuery query){return babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMotherCount(query);} -@Override -public List queryBabyPatientExtendEarMother (BabyPatientExtendEarMotherQuery query){if (query.getNeed() != null) {query.mysqlBuild(babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMotherCount(query));}return babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMother(query);} + @Autowired + private BabyPatientExtendEarMotherMapper babyPatientExtendEarMotherMapper; + + @Override + public void addBabyPatientExtendEarMother(BabyPatientExtendEarMother obj) { + babyPatientExtendEarMotherMapper.addBabyPatientExtendEarMother(obj); + } + + @Override + public void updateBabyPatientExtendEarMother(BabyPatientExtendEarMother obj) { + babyPatientExtendEarMotherMapper.updateBabyPatientExtendEarMother(obj); + } + + @Override + public void deleteBabyPatientExtendEarMother(String id) { + babyPatientExtendEarMotherMapper.deleteBabyPatientExtendEarMother(id); + } + + @Override + public BabyPatientExtendEarMother getBabyPatientExtendEarMother(String id) { + return babyPatientExtendEarMotherMapper.getBabyPatientExtendEarMother(id); + } + + @Override + public int queryBabyPatientExtendEarMotherCount(BabyPatientExtendEarMotherQuery query) { + return babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMotherCount(query); + } + + @Override + public List queryBabyPatientExtendEarMother(BabyPatientExtendEarMotherQuery query) { + if (query.getNeed() != null) { + query.mysqlBuild(babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMotherCount(query)); + } + return babyPatientExtendEarMotherMapper.queryBabyPatientExtendEarMother(query); + } } \ No newline at end of file diff --git a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml index f64499b..85beda1 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml @@ -22,6 +22,7 @@ + @@ -35,7 +36,7 @@ - insert into baby_patient_extend_ear_follow_up (id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,is_audiphone,is_operation,is_artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble) values (#{id},#{babyId},#{followTime},#{followAddr},#{markTime},#{markResult},#{markDetail},#{followInfo},#{audiphone},#{operation},#{artifiCochlea},#{isAudiphone},#{isOperation},#{isArtifiCochlea},#{guideOpinion},#{followDoctorName},#{followDoctorId},#{nextTime},#{ifdel},#{ifclose},#{hospitalId},#{modifyTime},#{modifyId},#{createTime},#{createId},#{enalble}) + insert into baby_patient_extend_ear_follow_up (id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,is_audiphone,is_operation,is_artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,month_age,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble) values (#{id},#{babyId},#{followTime},#{followAddr},#{markTime},#{markResult},#{markDetail},#{followInfo},#{audiphone},#{operation},#{artifiCochlea},#{isAudiphone},#{isOperation},#{isArtifiCochlea},#{guideOpinion},#{followDoctorName},#{followDoctorId},#{nextTime},#{monthAge},#{ifdel},#{ifclose},#{hospitalId},#{modifyTime},#{modifyId},#{createTime},#{createId},#{enalble}) @@ -94,6 +95,9 @@ next_time = #{nextTime,jdbcType=TIMESTAMP}, + + month_age = #{monthAge,jdbcType=INTEGER}, + ifdel = #{ifdel,jdbcType=INTEGER}, @@ -130,7 +134,7 @@ @@ -257,7 +261,7 @@ select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,foll parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUpQuery"> select id,baby_id,max(follow_time) as - follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble + follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,month_age,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble from baby_patient_extend_ear_follow_up GROUP BY baby_id diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java b/platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java index fbc4bc8..6237cb9 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java @@ -3,6 +3,7 @@ package com.lyms.platform.common.utils; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 添加类的一句话简单描述。 @@ -19,6 +20,17 @@ import java.util.List; * @since BME V100R001C40B104 */ public final class StringUtils { + /** + *
  • @Description: 生成32位全大写uuid + *
  • @return + *
  • 创建人:方承 + *
  • 创建时间:2016年1月5日 + *
  • 修改人: + *
  • 修改时间: + */ + public static String uuid() { + return UUID.randomUUID().toString().replace("-", "").toUpperCase(); + } public static String dueWeek(int days) { if (days >= 294) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java index 754eaeb..99d7649 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java @@ -12,6 +12,7 @@ import com.lyms.platform.common.base.PageInfo; import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.common.utils.BeanUtils; import com.lyms.platform.common.utils.DateUtil; +import com.lyms.platform.common.utils.ExcelUtil; import com.lyms.platform.operate.web.facade.AutoMatchFacade; import com.lyms.platform.operate.web.result.AntextDoctorPatient; import com.lyms.platform.operate.web.result.AntextDoctorResult; @@ -23,6 +24,8 @@ import com.lyms.platform.pojo.Patients; import com.lyms.platform.query.AntExChuQuery; import com.lyms.platform.query.AntExQuery; import com.lyms.platform.query.PatientsQuery; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang.StringUtils; @@ -33,6 +36,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.text.DecimalFormat; import java.util.*; @@ -70,11 +75,87 @@ public class AntexDoctorStatistController extends BaseController { * @param pageSize 每页显示的数量 * @return */ + @RequestMapping(method = RequestMethod.GET, value = "/doctorInfoExt") + @ResponseBody + @TokenRequired + public void doctorInfoExt(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId, + Integer currentPage, Integer pageSize, HttpServletRequest request, HttpServletResponse response) { + List resultData = (List) doctorInfoData(startDate, endDate, childBirth, number, doctorId, currentPage, pageSize, request, false).getData(); + List> data = new ArrayList<>(); + for (AntextDoctorPatient adp : resultData) { + Map map = new HashMap<>(); + map.put("doctorName", adp.getDoctorName()); + map.put("pName", adp.getpName()); + map.put("cjNum", adp.getCjNum()); + map.put("allCjNum", adp.getAllCjNum()); + List riskLeveList = new ArrayList(); + StringBuffer color = new StringBuffer(); + if (CollectionUtils.isNotEmpty(riskLeveList)) { + JSONArray jsonArray = JSONArray.fromObject(riskLeveList); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + String name = jsonObject.getString("name"); + color.append(name + "、"); + } + } + map.put("riskFactors", adp.getRiskFactors()); + map.put("riskLevelId", color.toString()); + map.put("cDueWeek", adp.getcDueWeek()); + map.put("dueFmDate", adp.getDueFmDateStr()); + map.put("checkTimeStr", adp.getCheckTimeStr()); + data.add(map); + } + Map columName = new HashMap<>(); + columName.put("doctorName", "最后产检医生"); + columName.put("pName", "患者姓名"); + columName.put("cjNum", "本院产检次数"); + columName.put("allCjNum", "产检总次数"); + columName.put("riskFactors", "高危风险"); + columName.put("riskLevelId", "风险等级颜色"); + columName.put("cDueWeek", "孕周"); + columName.put("dueFmDateStr", "预产期/分娩日期"); + columName.put("checkTimeStr", "最后产检时间"); + try { + ExcelUtil.toExcel(response.getOutputStream(), data, columName); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 产检医生统计详情 + * + * @param startDate 建档开始时间 + * @param endDate 建档结束时间 + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 + * @param number 产检次数 点的是产检人数的话就传1, 2次(含)以上就传2, 5次(含)以上就传5 + * @param doctorId 医生ID + * @param currentPage 当前页 + * @param pageSize 每页显示的数量 + * @return + */ @RequestMapping(method = RequestMethod.GET, value = "/doctorStatInfo") @ResponseBody @TokenRequired public BaseObjectResponse doctorInfo(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId, Integer currentPage, Integer pageSize, HttpServletRequest request) { + return doctorInfoData(startDate, endDate, childBirth, number, doctorId, currentPage, pageSize, request, true); + } + + /** + * 产检医生统计详情数据 + * + * @param startDate 建档开始时间 + * @param endDate 建档结束时间 + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 + * @param number 产检次数 点的是产检人数的话就传1, 2次(含)以上就传2, 5次(含)以上就传5 + * @param doctorId 医生ID + * @param currentPage 当前页 + * @param pageSize 每页显示的数量 + * @return + */ + public BaseObjectResponse doctorInfoData(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId, + Integer currentPage, Integer pageSize, HttpServletRequest request, boolean isPage) { LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); if (pageSize == null) { pageSize = 20; @@ -146,12 +227,25 @@ public class AntexDoctorStatistController extends BaseController { List resultData = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(antextDoctorPatients) && antextDoctorPatients.size() > startIndex) { - int size = startIndex + pageSize; - if (antextDoctorPatients.size() < size) { - size = antextDoctorPatients.size(); + if (isPage) {//分页 + if (CollectionUtils.isNotEmpty(antextDoctorPatients) && antextDoctorPatients.size() > startIndex) { + int size = startIndex + pageSize; + if (antextDoctorPatients.size() < size) { + size = antextDoctorPatients.size(); + } + for (int i = startIndex; i < size; i++) { + AntextDoctorPatient doctorPatient = antextDoctorPatients.get(i); + Users users = usersService.getUsers(Integer.parseInt(doctorPatient.getDoctorId())); + if (users != null) { + doctorPatient.setDoctorName(users.getName()); + } else { + doctorPatient.setDoctorName("产检医生"); + } + resultData.add(doctorPatient); + } } - for (int i = startIndex; i < size; i++) { + } else { + for (int i = 0; i < antextDoctorPatients.size(); i++) { AntextDoctorPatient doctorPatient = antextDoctorPatients.get(i); Users users = usersService.getUsers(Integer.parseInt(doctorPatient.getDoctorId())); if (users != null) { @@ -171,7 +265,6 @@ public class AntexDoctorStatistController extends BaseController { //获取患者全部检测数据 public void getAllPatientList(Date startDate, Date endDate, Integer childBirth, List patientId, Map resultInfo, Integer userId) { - PatientsQuery patientsQuery = new PatientsQuery(); patientsQuery.setIds(patientId); @@ -243,7 +336,7 @@ public class AntexDoctorStatistController extends BaseController { continue; } } - }else{ + } else { doctorPatient = resultInfo.get(ac.getParentId()); } @@ -412,10 +505,52 @@ public class AntexDoctorStatistController extends BaseController { * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 * @return */ + @RequestMapping(method = RequestMethod.GET, value = "/getDoctorStaticExt") + @ResponseBody + @TokenRequired + public void getDoctorStaticExt(Date startDate, Date endDate, Integer childBirth, HttpServletRequest request, HttpServletResponse response) { + ReportModel reportModel = (ReportModel) getDoctorStaticData(startDate, endDate, childBirth, request).getData(); + List> data = reportModel.getGrid(); + Map columName = new HashMap<>(); + columName.put("doctorName", "产检医生"); + columName.put("inspectTime", "产检人次"); + columName.put("inspectPeople", "产检人数"); + columName.put("twice", "两次"); + columName.put("twiceProportion", ""); + columName.put("fiveTimes", ""); + columName.put("fiveTimeProportion", ""); + + try { + ExcelUtil.toExcel(response.getOutputStream(), data, columName); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 产检医生统计 + * + * @param startDate 建档开始时间 + * @param endDate 建档结束时间 + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 + * @return + */ @RequestMapping(method = RequestMethod.GET, value = "/getDoctorStatic") @ResponseBody @TokenRequired public BaseObjectResponse getDoctorStatic(Date startDate, Date endDate, Integer childBirth, HttpServletRequest request) { + return getDoctorStaticData(startDate, endDate, childBirth, request); + } + + /** + * 产检医生统计 + * + * @param startDate 建档开始时间 + * @param endDate 建档结束时间 + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 + * @return + */ + public BaseObjectResponse getDoctorStaticData(Date startDate, Date endDate, Integer childBirth, HttpServletRequest request){ BaseObjectResponse rest = new BaseObjectResponse(); LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java index afb6356..3a320ad 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; import java.util.*; /** @@ -325,8 +326,6 @@ public class FollowUpController extends BaseController { res.setFollowTimeStr(DateUtil.getyyyy_MM_dd(fu.getFollowTime())); } - - if(fu.getIfclose()!=null){ res.setIsColse(fu.getIfclose() == 1 ? "结案" : "未结案"); } @@ -360,7 +359,7 @@ public class FollowUpController extends BaseController { * @param request * @return */ - @RequestMapping(method = RequestMethod.POST, value = "/delBabyPatientExtendEarFollowUp") + @RequestMapping(method = RequestMethod.DELETE, value = "/delBabyPatientExtendEarFollowUp") @ResponseBody @TokenRequired public BaseResponse delBabyPatientExtendEarFollowUp(BabyPatientExtendEarFollowUp obj, HttpServletRequest request) { @@ -433,7 +432,7 @@ public class FollowUpController extends BaseController { @RequestMapping(method = RequestMethod.POST, value = "/saveBabyPatientExtendEarFollowUp") @ResponseBody @TokenRequired - public BaseResponse addBabyPatientExtendEarFollowUp(BabyPatientExtendEarFollowUp obj, + public BaseResponse addBabyPatientExtendEarFollowUp(@Valid BabyPatientExtendEarFollowUp obj, HttpServletRequest request) { // BaseResponse basResp = validata(obj); // if (basResp.getErrorcode() != 0) return basResp; @@ -444,7 +443,7 @@ public class FollowUpController extends BaseController { } String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); - + obj.setId(UUID.randomUUID().toString().replace("-", "")); obj.setIfdel(0); obj.setIfclose(0);//是否结案 obj.setCreateTime(new Date()); diff --git a/platform-operate-api/src/main/webapp/WEB-INF/web.xml b/platform-operate-api/src/main/webapp/WEB-INF/web.xml index 3ce019c..b28fd19 100644 --- a/platform-operate-api/src/main/webapp/WEB-INF/web.xml +++ b/platform-operate-api/src/main/webapp/WEB-INF/web.xml @@ -13,7 +13,7 @@ version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - + -- 1.8.3.1