|  | @ -410,7 +410,7 @@ public class RehabilitationManageService {
 | 
												
													
														
															|  |                 sql+="and d.doctor='"+doctorCode+"' ";
 |  |                 sql+="and d.doctor='"+doctorCode+"' ";
 | 
												
													
														
															|  |             }else if(searchTask==2||searchTask==4||searchTask==3){
 |  |             }else if(searchTask==2||searchTask==4||searchTask==3){
 | 
												
													
														
															|  |                 sql+=" and i.type="+searchTask+" " ;
 |  |                 sql+=" and i.type="+searchTask+" " ;
 | 
												
													
														
															|  |             }else if(searchTask==3){
 |  | 
 | 
												
													
														
															|  | 
 |  |             }else if(searchTask==5){
 | 
												
													
														
															|  |                 sql+=" and i.reserve=1 " ;
 |  |                 sql+=" and i.reserve=1 " ;
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -492,9 +492,10 @@ public class RehabilitationManageService {
 | 
												
													
														
															|  |                 map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
 |  |                 map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
 | 
												
													
														
															|  |                 messageMapList.add(map);
 |  |                 messageMapList.add(map);
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  | 
 |  |             Integer itemType = (Integer) one.get("itemType");
 | 
												
													
														
															|  |             resultMap.put("messageList",messageMapList);//指导与汇报记录
 |  |             resultMap.put("messageList",messageMapList);//指导与汇报记录
 | 
												
													
														
															|  |             resultMap.put("patient",one.get("patient"));
 |  |             resultMap.put("patient",one.get("patient"));
 | 
												
													
														
															|  |             resultMap.put("itemType",one.get("itemType"));
 |  | 
 | 
												
													
														
															|  | 
 |  |             resultMap.put("itemType",itemType);
 | 
												
													
														
															|  |             resultMap.put("detaiType",one.get("detaiType"));
 |  |             resultMap.put("detaiType",one.get("detaiType"));
 | 
												
													
														
															|  |             resultMap.put("status",status);//状态
 |  |             resultMap.put("status",status);//状态
 | 
												
													
														
															|  |             //是否完成任务
 |  |             //是否完成任务
 | 
												
											
												
													
														
															|  | @ -502,6 +503,18 @@ public class RehabilitationManageService {
 | 
												
													
														
															|  |             Integer operate = 0;
 |  |             Integer operate = 0;
 | 
												
													
														
															|  |             if(operateList.size()>0){
 |  |             if(operateList.size()>0){
 | 
												
													
														
															|  |                 operate =1;
 |  |                 operate =1;
 | 
												
													
														
															|  | 
 |  |                 RehabilitationOperateRecordsDO temp = operateList.get(0);
 | 
												
													
														
															|  | 
 |  |                 operate =1;
 | 
												
													
														
															|  | 
 |  |                 Date completeTime = temp.getCompleteTime();
 | 
												
													
														
															|  | 
 |  |                 String completeTimeStr = DateUtil.dateToStr(completeTime,DateUtil.YYYY_MM_DD_HH_MM);
 | 
												
													
														
															|  | 
 |  |                 resultMap.put("completeTime",completeTimeStr);//完成时间
 | 
												
													
														
															|  | 
 |  |                 resultMap.put("operatorDoctorName",temp.getDoctorName());//执行医生名称
 | 
												
													
														
															|  | 
 |  |                 resultMap.put("node",temp.getNode());
 | 
												
													
														
															|  | 
 |  |                 resultMap.put("relationRecordImg",(temp.getRelationRecordImg()!=null&&StringUtils.isNotEmpty(temp.getRelationRecordImg()))?(new JSONArray(temp.getRelationRecordImg())):null);//json格式
 | 
												
													
														
															|  | 
 |  |                 if(itemType!=1&&itemType!=0){
 | 
												
													
														
															|  | 
 |  |                     resultMap.put("relationRecordCode",temp.getRelationRecordCode());
 | 
												
													
														
															|  | 
 |  |                     resultMap.put("completeTimeShort",DateUtil.dateToStr(completeTime,"yyyy/MM/dd"));
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |             resultMap.put("operate",operate);//是否完成任务(默认0:未完成,1:已完成)
 |  |             resultMap.put("operate",operate);//是否完成任务(默认0:未完成,1:已完成)
 | 
												
													
														
															|  |             resultList.add(resultMap);
 |  |             resultList.add(resultMap);
 | 
												
											
												
													
														
															|  | @ -1023,27 +1036,32 @@ public class RehabilitationManageService {
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public Map<String,Object> updateNodeAndRelationRecordImg(String node,String image,String planDeatilId)throws Exception{
 |  |     public Map<String,Object> updateNodeAndRelationRecordImg(String node,String image,String planDeatilId)throws Exception{
 | 
												
													
														
															|  |         Map<String,Object> resultMap = new HashedMap();
 |  |         Map<String,Object> resultMap = new HashedMap();
 | 
												
													
														
															|  |         int i = rehabilitationDetailDao.updateStatusById(1,planDeatilId);
 |  | 
 | 
												
													
														
															|  |         int j = rehabilitationOperateRecordsDao.updateNodeAndRelationRecordImg(node,image,planDeatilId);
 |  | 
 | 
												
													
														
															|  |         //如果整个计划的服务项都完成了,整个计划也完成了
 |  | 
 | 
												
													
														
															|  |         String allSql ="SELECT * FROM wlyy_rehabilitation_plan_detail where plan_id = (SELECT plan_id FROM `wlyy_rehabilitation_plan_detail` WHERE id='"+planDeatilId+"')";
 |  | 
 | 
												
													
														
															|  |         List<RehabilitationDetailDO> rehabilitationDetailDOList = jdbcTemplate.query(allSql,new BeanPropertyRowMapper<>(RehabilitationDetailDO.class));
 |  | 
 | 
												
													
														
															|  |         int allCount=0;
 |  | 
 | 
												
													
														
															|  |         String planId="";
 |  | 
 | 
												
													
														
															|  |         for (RehabilitationDetailDO rehabilitationDetailDO : rehabilitationDetailDOList){
 |  | 
 | 
												
													
														
															|  |             if (rehabilitationDetailDO.getStatus()==1){
 |  | 
 | 
												
													
														
															|  |                 allCount++;
 |  | 
 | 
												
													
														
															|  | 
 |  |         try{
 | 
												
													
														
															|  | 
 |  |             int i = rehabilitationDetailDao.updateStatusById(1,planDeatilId);
 | 
												
													
														
															|  | 
 |  |             int j = rehabilitationOperateRecordsDao.updateNodeAndRelationRecordImg(node,image,planDeatilId);
 | 
												
													
														
															|  | 
 |  |             //如果整个计划的服务项都完成了,整个计划也完成了
 | 
												
													
														
															|  | 
 |  |             String allSql ="SELECT * FROM wlyy_rehabilitation_plan_detail where plan_id = (SELECT plan_id FROM `wlyy_rehabilitation_plan_detail` WHERE id='"+planDeatilId+"')";
 | 
												
													
														
															|  | 
 |  |             List<RehabilitationDetailDO> rehabilitationDetailDOList = jdbcTemplate.query(allSql,new BeanPropertyRowMapper<>(RehabilitationDetailDO.class));
 | 
												
													
														
															|  | 
 |  |             int allCount=0;
 | 
												
													
														
															|  | 
 |  |             String planId="";
 | 
												
													
														
															|  | 
 |  |             for (RehabilitationDetailDO rehabilitationDetailDO : rehabilitationDetailDOList){
 | 
												
													
														
															|  | 
 |  |                 if (rehabilitationDetailDO.getStatus()==1){
 | 
												
													
														
															|  | 
 |  |                     allCount++;
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  | 
 | 
												
													
														
															|  |         if (rehabilitationDetailDOList.size()>0 && rehabilitationDetailDOList.size()==allCount){
 |  | 
 | 
												
													
														
															|  |             planId = rehabilitationDetailDOList.get(0).getPlanId();
 |  | 
 | 
												
													
														
															|  |             patientRehabilitationPlanDao.updateStatusById(2,planId);
 |  | 
 | 
												
													
														
															|  | 
 |  |             if (rehabilitationDetailDOList.size()>0 && rehabilitationDetailDOList.size()==allCount){
 | 
												
													
														
															|  | 
 |  |                 planId = rehabilitationDetailDOList.get(0).getPlanId();
 | 
												
													
														
															|  | 
 |  |                 patientRehabilitationPlanDao.updateStatusById(2,planId);
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }catch (Exception e){
 | 
												
													
														
															|  | 
 |  |             throw  new Exception("更新服务状态失败!");
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         //更新返回数据提供发送消息使用
 |  |         //更新返回数据提供发送消息使用
 | 
												
													
														
															|  |         String sql ="SELECT" +
 |  |         String sql ="SELECT" +
 | 
												
													
														
															|  |                 " i.service_item_id," +
 |  |                 " i.service_item_id," +
 | 
												
													
														
															|  |                 " r.doctor_code," +
 |  |                 " r.doctor_code," +
 | 
												
													
														
															|  |                 " r.patient_code" +
 |  | 
 | 
												
													
														
															|  | 
 |  |                 " r.patient_code," +
 | 
												
													
														
															|  | 
 |  |                 " pd.hospital" +
 | 
												
													
														
															|  |                 " FROM" +
 |  |                 " FROM" +
 | 
												
													
														
															|  |                 " wlyy_rehabilitation_plan_detail pd" +
 |  |                 " wlyy_rehabilitation_plan_detail pd" +
 | 
												
													
														
															|  |                 " LEFT JOIN wlyy_hospital_service_item i ON pd.hospital_service_item_id = i.id" +
 |  |                 " LEFT JOIN wlyy_hospital_service_item i ON pd.hospital_service_item_id = i.id" +
 | 
												
											
												
													
														
															|  | @ -1060,7 +1078,6 @@ public class RehabilitationManageService {
 | 
												
													
														
															|  |             resultMap.put("evaluation",itemList.get(0).get("evaluation"));
 |  |             resultMap.put("evaluation",itemList.get(0).get("evaluation"));
 | 
												
													
														
															|  |             resultMap.put("title",itemList.get(0).get("title"));
 |  |             resultMap.put("title",itemList.get(0).get("title"));
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         resultMap.put("count",i+j);
 |  | 
 | 
												
													
														
															|  |         return resultMap;
 |  |         return resultMap;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 |