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 42a28fc..c40df66 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 @@ -96,7 +96,7 @@ public class BabyPatientExtendEarFollowUp extends AbstracUuidEntity{ /** * 是否结案 0-未结案,1-结案 */ - private Integer ifclose; + private int ifclose; /** * 是否结案 0-未结案,1-结案 */ @@ -370,14 +370,12 @@ public class BabyPatientExtendEarFollowUp extends AbstracUuidEntity{ } - public Integer getIfclose() { + public int getIfclose() { return ifclose; } - - public void setIfclose(Integer ifclose) { + public void setIfclose(int ifclose) { this.ifclose = ifclose; - } public String getHospitalId() { 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 acb8fe1..d078010 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 @@ -63,7 +63,7 @@ public class FollowUpController extends BaseController { /** * 根据babyId获取随访列表 * - * @param babyId 随访记录id + * @param babyId 随访记录id * @return */ @RequestMapping(method = RequestMethod.GET, value = "/getFollowUpList") @@ -71,7 +71,7 @@ public class FollowUpController extends BaseController { @TokenRequired public BaseResponse getFollowUpList(String babyId, HttpServletRequest request) { - if(StringUtils.isEmpty(babyId)){ + if (StringUtils.isEmpty(babyId)) { return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童ID"); } @@ -84,7 +84,7 @@ public class FollowUpController extends BaseController { String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); BabyPatientExtendEarFollowUpQuery query = new BabyPatientExtendEarFollowUpQuery(); - List babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId,hospitalId); + List babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId, hospitalId); query.setBabyIds((String[]) babyIds.toArray(new String[babyIds.size()])); query.setSort("follow_time"); @@ -92,12 +92,12 @@ public class FollowUpController extends BaseController { query.setCheckHospitalIds((String[]) hospitalIds.toArray(new String[hospitalIds.size()])); List followUpList = babyPatientExtendEarFollowUpService.queryBabyPatientExtendEarFollowUpByBaby(query); - List> list = new ArrayList<>(); - for(BabyPatientExtendEarFollowUp fu:followUpList){ - Map fuMap = new HashMap<>(); - fuMap.put("hospitalId",fu.getHospitalId()); - fuMap.put("id",fu.getId()); - fuMap.put("followTime",DateUtil.getyyyy_MM_dd(fu.getFollowTime())); + List> list = new ArrayList<>(); + for (BabyPatientExtendEarFollowUp fu : followUpList) { + Map fuMap = new HashMap<>(); + fuMap.put("hospitalId", fu.getHospitalId()); + fuMap.put("id", fu.getId()); + fuMap.put("followTime", DateUtil.getyyyy_MM_dd(fu.getFollowTime())); list.add(fuMap); } BaseResponse result = new BaseResponse(); @@ -110,7 +110,7 @@ public class FollowUpController extends BaseController { /** * 获取随访记录详情 * - * @param fuId 随访记录id + * @param fuId 随访记录id * @return */ @RequestMapping(method = RequestMethod.GET, value = "/queryBabyPatientExtendEarFollowUpOne") @@ -119,7 +119,7 @@ public class FollowUpController extends BaseController { BabyPatientExtendEarFollowUp followUp = babyPatientExtendEarFollowUpService.getBabyPatientExtendEarFollowUp(fuId); FollowUpOneResult fuResult = new FollowUpOneResult(); - if(followUp!=null){ + if (followUp != null) { fuResult.setBabyId(followUp.getBabyId()); fuResult.setId(followUp.getId()); fuResult.setFollowAddr(followUp.getFollowAddr()); @@ -130,7 +130,7 @@ public class FollowUpController extends BaseController { for (int b = 0; b < cr.length; b++) { if (StringUtils.isNotEmpty(cr[b])) { String title = ConfirmedEnums.getTitle(Integer.parseInt(cr[b])); - mrSb.append(title+"、"); + mrSb.append(title + "、"); JSONObject confiJo = new JSONObject(); confiJo.put("id", cr[b]); confiJo.put("name", title); @@ -160,29 +160,29 @@ public class FollowUpController extends BaseController { fuResult.setIsOperation(followUp.getIsOperation()); fuResult.setVerdict(followUp.getVerdict()); - StringBuffer interStrate = new StringBuffer(); + StringBuffer interStrate = new StringBuffer(); - if(followUp.getAudiphone()!=null){ + if (followUp.getAudiphone() != null) { //1-左耳,2-右耳,3-全部 - interStrate.append("助听器:"+(followUp.getAudiphone()==1?"左耳":followUp.getAudiphone()==2?"右耳":"全部")); + interStrate.append("助听器:" + (followUp.getAudiphone() == 1 ? "左耳" : followUp.getAudiphone() == 2 ? "右耳" : "全部")); } - if(followUp.getOperation()!=null){ + if (followUp.getOperation() != null) { //1-左耳,2-右耳,3-全部 - if(StringUtils.isNotEmpty(interStrate.toString())){//如果不为空 + if (StringUtils.isNotEmpty(interStrate.toString())) {//如果不为空 interStrate.append(","); } - interStrate.append("手术:"+(followUp.getOperation()==1?"左耳":followUp.getOperation()==2?"右耳":"全部")); + interStrate.append("手术:" + (followUp.getOperation() == 1 ? "左耳" : followUp.getOperation() == 2 ? "右耳" : "全部")); } - if(followUp.getArtifiCochlea()!=null){ + if (followUp.getArtifiCochlea() != null) { //1-左耳,2-右耳,3-全部 - if(StringUtils.isNotEmpty(interStrate.toString())){//如果不为空 + if (StringUtils.isNotEmpty(interStrate.toString())) {//如果不为空 interStrate.append(","); } - interStrate.append("人工耳蜗:"+(followUp.getArtifiCochlea()==1?"左耳":followUp.getArtifiCochlea()==2?"右耳":"全部")); + interStrate.append("人工耳蜗:" + (followUp.getArtifiCochlea() == 1 ? "左耳" : followUp.getArtifiCochlea() == 2 ? "右耳" : "全部")); } fuResult.setInterStrate(interStrate.toString()); - if(StringUtils.isNotEmpty(followUp.getFollowDoctorId())){ + if (StringUtils.isNotEmpty(followUp.getFollowDoctorId())) { fuResult.setFollowDoctorId(followUp.getFollowDoctorId()); String docotorId = followUp.getFollowDoctorId(); Users users = usersService.getUsers(Integer.parseInt(docotorId)); @@ -192,27 +192,25 @@ public class FollowUpController extends BaseController { } //随访时间 - if(followUp.getFollowTime()!=null){ + if (followUp.getFollowTime() != null) { fuResult.setFollowTime(DateUtil.getyyyy_MM_dd(followUp.getFollowTime())); BabyModel babyModel = babyService.getOneBabyById(followUp.getBabyId()); if (babyModel != null) { fuResult.setcMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), followUp.getFollowTime())); } } - if(followUp.getMarkTime()!=null){ + if (followUp.getMarkTime() != null) { fuResult.setMarkTime(DateUtil.getyyyy_MM_dd(followUp.getMarkTime())); } - if(followUp.getNextTime()!=null){ + if (followUp.getNextTime() != null) { fuResult.setNextTime(DateUtil.getyyyy_MM_dd(followUp.getNextTime())); //根据babyId查询档案信息 BabyModel babyModel = babyService.getOneBabyById(followUp.getBabyId()); fuResult.setNextTimeMouseAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), followUp.getNextTime())); } - if(followUp.getIfclose()!=null){ - fuResult.setIfclose(followUp.getIfclose()); - fuResult.setIfcloseStr(followUp.getIfclose()==0?"未结案":"已结案"); - } + fuResult.setIfclose(followUp.getIfclose()); + fuResult.setIfcloseStr(followUp.getIfclose() == 0 ? "未结案" : "已结案"); if (StringUtils.isNotEmpty(followUp.getHospitalId())) {//查询医院名称 fuResult.setHospitalId(followUp.getHospitalId()); //判断ID是否存在 @@ -236,7 +234,7 @@ public class FollowUpController extends BaseController { /** * 获取随访记录列表 * - * @param fur 随访记录对象 + * @param fur 随访记录对象 * @param request * @return */ @@ -265,20 +263,20 @@ public class FollowUpController extends BaseController { babyQuery.setHospitalId(hospitalId); List models = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); - if(CollectionUtils.isNotEmpty(models)){ + if (CollectionUtils.isNotEmpty(models)) { List babyIds = new ArrayList<>(); - for(BabyPatientExtendEarBaby babyModel:models){ + for (BabyPatientExtendEarBaby babyModel : models) { babyIds.add(babyModel.getBabyPatientId()); } query.setBabyIds(babyIds.toArray(new String[babyIds.size()])); - }else{ + } else { return new FrontEndResult().setData(new ArrayList()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); } } //确诊结果 if (fur.getMarkResult() != null) { - query.setMarkResult(","+fur.getMarkResult()+","); + query.setMarkResult("," + fur.getMarkResult() + ","); } //医院ID 集合。本院、外院、全部... @@ -300,17 +298,17 @@ public class FollowUpController extends BaseController { BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); babyQuery.setHospitalId(hospitalId); - babyQuery.setEnables(new String[]{"0","1","2"}); + babyQuery.setEnables(new String[]{"0", "1", "2"}); List earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); - for (BabyPatientExtendEarBaby eb:earBabies){ + for (BabyPatientExtendEarBaby eb : earBabies) { pids.add(eb.getPersonId()); } - }else if (fur.getSource() == 1) {//1.本院 + } else if (fur.getSource() == 1) {//1.本院 BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); babyQuery.setHospitalId(hospitalId); babyQuery.setIsEnable("1"); List earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); - for (BabyPatientExtendEarBaby eb:earBabies){ + for (BabyPatientExtendEarBaby eb : earBabies) { pids.add(eb.getPersonId()); } } @@ -323,23 +321,23 @@ public class FollowUpController extends BaseController { StringBuffer sqlStr = new StringBuffer(); - if(fur.getInterCure()!=null&&fur.getInterCure().length>0){ - for(int i =0;i 0) { + for (int i = 0; i < fur.getInterCure().length; i++) { String ic = fur.getInterCure()[i]; - if(i>0){ + if (i > 0) { sqlStr.append(" or "); } - if(StringUtils.isNotEmpty(ic)){ - if(ic.equals("2")){//0-未干预治疗,1-人工耳蜗,2-助听器,3-手术 + if (StringUtils.isNotEmpty(ic)) { + if (ic.equals("2")) {//0-未干预治疗,1-人工耳蜗,2-助听器,3-手术 query.setAudiphone(2); sqlStr.append(" audiphone is not null "); - }else if(ic.equals("3")){//0-未干预治疗,1-人工耳蜗,2-助听器,3-手术 + } else if (ic.equals("3")) {//0-未干预治疗,1-人工耳蜗,2-助听器,3-手术 query.setOperation(3); sqlStr.append(" operation is not null "); - }else if(ic.equals("1")){ + } else if (ic.equals("1")) { query.setArtifiCochlea(1); sqlStr.append(" artifi_cochlea is not null "); - }else{ + } else { query.setAudiphone(2); query.setOperation(3); query.setArtifiCochlea(3); @@ -347,7 +345,7 @@ public class FollowUpController extends BaseController { } } } - // System.out.println(sqlStr.toString()); + // System.out.println(sqlStr.toString()); query.setSqlStr(sqlStr.toString()); query.setNextStartTime(fur.getNextStartTime()); query.setNextEndTime(fur.getNextEndTime()); @@ -358,10 +356,10 @@ public class FollowUpController extends BaseController { query.setSort("create_time"); query.setLimit(fur.getLimit()); query.setPage(fur.getPage()); - if(CollectionUtils.isNotEmpty(pids)){ + if (CollectionUtils.isNotEmpty(pids)) { query.setPids((String[]) pids.toArray(new String[pids.size()])); } - if(CollectionUtils.isEmpty(pids)&&fur.getSource()!=null){ + if (CollectionUtils.isEmpty(pids) && fur.getSource() != null) { return new FrontEndResult().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); } List BabyPatientExtendEarFollowUpList = babyPatientExtendEarFollowUpService.queryBabyPatientExtendEarFollowUp(query); @@ -377,7 +375,7 @@ public class FollowUpController extends BaseController { if (mb != null) {//没有找到儿童档案信息 res.setBabyName(mb.getName()); res.setMommyName(mb.getMname()); - if(fu.getFollowTime()!=null){ + if (fu.getFollowTime() != null) { //根据诊断时间获取月龄 res.setcMonthAge(DateUtil.getBabyMonthAge(mb.getBirth(), fu.getFollowTime())); } @@ -402,13 +400,11 @@ public class FollowUpController extends BaseController { res.setDiagnResult(hdEnums); } //设置随访的时间 - if(fu.getFollowTime()!=null){ + if (fu.getFollowTime() != null) { res.setFollowTimeStr(DateUtil.getyyyy_MM_dd(fu.getFollowTime())); } - if(fu.getIfclose()!=null){ - res.setIsColse(fu.getIfclose() == 1 ? "结案" : "未结案"); - } + res.setIsColse(fu.getIfclose() == 1 ? "结案" : "未结案"); BabyModel babyModel = babyService.getOneBabyById(fu.getBabyId()); if (babyModel != null) { @@ -420,7 +416,7 @@ public class FollowUpController extends BaseController { res.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); res.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); } - if(StringUtils.isNotEmpty(fu.getFollowDoctorId())){ + if (StringUtils.isNotEmpty(fu.getFollowDoctorId())) { Users user = usersService.getUsers(Integer.parseInt(fu.getFollowDoctorId())); if (user != null) { //设置随访医生名称 @@ -518,7 +514,7 @@ public class FollowUpController extends BaseController { @ResponseBody @TokenRequired public BaseResponse addBabyPatientExtendEarFollowUp(@Valid BabyPatientExtendEarFollowUp obj, - HttpServletRequest request) { + HttpServletRequest request) { BaseResponse basResp = validata(obj); if (basResp.getErrorcode() != 0) return basResp; //获取当前登录用户ID @@ -531,8 +527,7 @@ public class FollowUpController extends BaseController { obj.setPid(pid); String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); obj.setId(UUID.randomUUID().toString().replace("-", "")); - obj.setIfdel(0); - //obj.setIfclose(0);//是否结案 + obj.setIfdel(0);//默认值,未删除 obj.setCreateTime(new Date()); obj.setCreateId(String.valueOf(loginState.getId())); obj.setHospitalId(hospitalId); @@ -540,7 +535,7 @@ public class FollowUpController extends BaseController { //听力筛查-当某个儿童在同一院组内某家医院完成了的听筛建档后去院组内其他医院做了听筛、听诊或随访,应该要在对应的医院下创建一个隐藏档案 //建立隐藏档案 - babyEarFacade.addhideBabyEar(obj.getBabyId(),hospitalId,"2"); + babyEarFacade.addhideBabyEar(obj.getBabyId(), hospitalId, "2"); babyPatientExtendEarFollowUpService.addBabyPatientExtendEarFollowUp(obj); BaseResponse result = new BaseResponse();