| 
					
				 | 
			
			
				@ -225,11 +225,13 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List listNum = new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int count = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (SignPatientLabel label : s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map map = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String labelName = label.getLabelName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONArray jsonArray = list.getJSONArray(label.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List codes = new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (int i = 0 ;i<jsonArray.length();i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONObject json = jsonArray.getJSONObject(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Map info = new HashMap(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -239,11 +241,17 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    info.put("name",name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    codes.add(info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                int length = codes.size(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("label", labelName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("codes", codes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("number", length); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                listNum.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                count+=length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(200, "查询成功", "data", listNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map map = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("count",count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("patients",listNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(200, "查询成功", "data", map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return error(-1, "查询失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -358,24 +366,24 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "agent") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String agent( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false) String name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String idcard, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String idcard, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false) String ssc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false) String mobile, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String healthLabel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String healthLabel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false, defaultValue = "") String customLabel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false, defaultValue = "") String disease, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false) String emerMobile, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String healthDoctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String healthDoctorName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String images, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String healthDoctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String healthDoctorName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String images, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false, defaultValue = "0") String expenses, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String doctor,//全科医生code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String doctorName,//全科医生名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String signDoctorCode,//簽約人code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String signDoctorName,//簽約人銘 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)String signDoctorLevel,//簽約人等级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false)long adminTeamCode //行政团队 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String doctor,//全科医生code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String doctorName,//全科医生名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String signDoctorCode,//簽約人code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String signDoctorName,//簽約人銘 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String signDoctorLevel,//簽約人等级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            long adminTeamCode //行政团队 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isEmpty(idcard)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -967,30 +975,45 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false) String patientName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Long teamCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            labelType = "4"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            teamCode = (long)646; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List listNum = new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map patients = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(), labelType, patientName, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray jsonAr = new JSONArray(list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String str = "jj"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (SignPatientLabel label : s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map map = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String labelName = label.getLabelName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONArray jsonArray = list.getJSONArray(label.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!"4".equals(labelType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (SignPatientLabel label : s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Map map = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String labelName = label.getLabelName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONArray jsonArray = list.getJSONArray(label.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               /* List codes = new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (Object patient:jsonArray) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONObject jsonObject = new JSONObject(patient.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String code = jsonObject.get("code").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    codes.add(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                int length = jsonArray.length(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("label", labelName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("number", length); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    int length = jsonArray.length(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("label", labelName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("number", length); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                map.put("codes", codes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    listNum.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONArray jsonArray = list.getJSONArray("孕产妇"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map map = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("label", "孕产妇"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("number", jsonArray.length()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                listNum.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONArray jsonArray1 = list.getJSONArray("未标注"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map map1 = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map1.put("label", "未标注"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map1.put("number", jsonArray1.length()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                listNum.add(map1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONArray jsonArray2 = list.getJSONArray("儿童"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map map2 = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map2.put("label", "儿童"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map2.put("number", jsonArray2.length()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                listNum.add(map2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patients.put("count",list.length()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patients.put("count",signFamily.size()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1111,7 +1134,6 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotEmpty(patient)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject result = patientRemindService.remindPatientExpenses(patient, getUID()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //JSONObject result = patientRemindService.remindPatientExpenses(patient, "test00000000005"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                redisTemplate.opsForValue().set("expenses:remind:doctor:" + getUID(), "0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                redisTemplate.expire("expenses:remind:doctor:" + getUID(), 10, TimeUnit.MINUTES); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return write(result.getInt("status"), result.getString("msg")); 
			 |