فهرست منبع

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 8 سال پیش
والد
کامیت
2ab38ec93f
45فایلهای تغییر یافته به همراه782 افزوده شده و 352 حذف شده
  1. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/SignDataFilter.java
  2. 2 2
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java
  3. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/RenewSignInJob.java
  4. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/RenewSignOutJob.java
  5. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SwitchSignJob.java
  6. 9 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/signfamily/SignFamily.java
  7. 90 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/ObserverRequiredAOP.java
  8. 14 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/observerRequired.java
  9. 106 106
      patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java
  10. 85 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/ObserverRequiredInterceptor.java
  11. 26 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/util/SignTeamAndGroupRunnable.java
  12. 63 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SpringUtil.java
  13. 4 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java
  14. 13 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  15. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/archives/DoctorArchivesController.java
  16. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/booking/DoctorBookingController.java
  17. 8 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java
  18. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultMoviController.java
  19. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultPublicController.java
  20. 6 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java
  21. 7 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/discussion/DoctorDiscussionGroupController.java
  22. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java
  23. 9 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java
  24. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowupDrugsController.java
  25. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java
  26. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  27. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java
  28. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/intervene/DoctorInterveneController.java
  29. 7 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/medical/DoctorMedicalRecordController.java
  30. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  31. 6 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/DoctorPatientGroupController.java
  32. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientDiseaseController.java
  33. 5 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelController.java
  34. 5 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  35. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java
  36. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/scheduling/DoctorWorkTimeController.java
  37. 8 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  38. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java
  39. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java
  40. 7 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java
  41. 4 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java
  42. 5 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  43. 12 10
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java
  44. 219 217
      patient-co-wlyy/src/main/resources/applicationContext.xml
  45. 13 12
      patient-co-wlyy/src/main/webapp/WEB-INF/spring-mvc.xml

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/dataFilter/SignDataFilter.java

@ -347,7 +347,7 @@ public class SignDataFilter {
                    return returnLevel2Key;
                }
                case "8": {
                    return signFamily.getSignType();
                    return signFamily.getServerType();
                }
            }

+ 2 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -1232,7 +1232,7 @@ public class CurrentDayAllQuotaJob implements Job {
    private void computequota_34() {
        String quotaId = "34";
        try {
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+tomorrow+"' and fr.admin_team_id!=fr.old_admin_team_id ";
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+tomorrow+"' and fr.admin_team_id!=fr.old_admin_team_id and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10";
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
            //清洗數據
@ -1252,7 +1252,7 @@ public class CurrentDayAllQuotaJob implements Job {
    private void computequota_35() {
        String quotaId = "35";
        try {
            String sql=" select fr.sign_code code,fr.old_hospital,fr.old_admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+ tomorrow+"' and fr.admin_team_id!=fr.old_admin_team_id  ";
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+ tomorrow+"' and fr.admin_team_id!=fr.old_admin_team_id  and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
            //清洗數據

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/RenewSignInJob.java

@ -86,7 +86,7 @@ public class RenewSignInJob implements Job {
            quartzJobLog.setJobStartTime(new Date());
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+yesterday+Constant.quota_date_last+"' and fr.admin_team_id!=fr.old_admin_team_id ";
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+yesterday+Constant.quota_date_last+"' and fr.admin_team_id!=fr.old_admin_team_id and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10";
            //抽取數據
            List<SignFamilyRenew> signFamilies= dbExtract.extract(SignFamilyRenew.class,sql);
            //清洗數據

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/RenewSignOutJob.java

@ -86,7 +86,7 @@ public class RenewSignOutJob implements Job {
            quartzJobLog.setJobStartTime(new Date());
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            String sql=" select fr.sign_code code,fr.old_hospital,fr.old_admin_team_id from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+ yesterday + Constant.quota_date_last+"' and fr.admin_team_id!=fr.old_admin_team_id  ";
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_code from wlyy_sign_family_renew_log fr where  fr.`status`>0  and  fr.apply_date<'"+ yesterday + Constant.quota_date_last+"' and fr.admin_team_id!=fr.old_admin_team_id and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
            //抽取數據
            List<SignFamilyRenew> signFamilies= dbExtract.extract(SignFamilyRenew.class,sql);
            //清洗數據

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SwitchSignJob.java

@ -83,7 +83,7 @@ public class SwitchSignJob implements Job {
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where fr.`status`>0  and fr.old_admin_team_id!=fr.admin_team_id and fr.apply_date<'"+yesterday+Constant.quota_date_last+"'";
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where fr.`status`>0  and fr.old_admin_team_id!=fr.admin_team_id and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 and fr.apply_date<'"+yesterday+Constant.quota_date_last+"'";
            //抽取數據
            List<SignFamilyRenew> signFamilies= dbExtract.extract(SignFamilyRenew.class,sql);
            //清洗數據

+ 9 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/signfamily/SignFamily.java

@ -61,6 +61,7 @@ public class SignFamily extends IdEntity {
	private String agentDoctorLevel;//代理簽約人等级
	private Long adminTeamCode;//行政团队ID
	private Date expensesTime;//缴费时间
	private String serverType;
	public String getCode() {
		return code;
@ -442,4 +443,12 @@ public class SignFamily extends IdEntity {
	public void setExpensesTime(Date expensesTime) {
		this.expensesTime = expensesTime;
	}
	public String getServerType() {
		return serverType;
	}
	public void setServerType(String serverType) {
		this.serverType = serverType;
	}
}

+ 90 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/ObserverRequiredAOP.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.aop;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.json.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
 * Created by Trick on 2017/6/24.
 */
@Aspect
@Component
public class ObserverRequiredAOP {
    //Controller层切点
    @Pointcut("execution(* com.yihu.wlyy.web..*.*(..))")
    public void controllerAspect() {
    }
    public ObserverRequiredAOP() {
        //System.out.println("Observer---------------------------------------");
    }
    @Around("controllerAspect() && @annotation(com.yihu.wlyy.aop.ObserverRequired)")
    public Object checkToken(ProceedingJoinPoint point) throws Throwable {
        Object o = null;
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
        String error = "";
        try {
            response.setCharacterEncoding("UTF-8");
            JSONObject json = getAgent(request);
            String observer = json.has("observer") ? json.getString("observer") : "";
            if(StringUtils.isNotBlank(observer)&&"1".equals(observer)){
                PrintWriter writer=response.getWriter();
                writer.write(error(403, "该操作没有权限"));
                writer.flush();
                return o;
            }
        }catch (Exception e){
            //return o;
        }
         o = point.proceed();
        return o;
    }
    public String write(int code, String msg) {
        try {
            JSONObject json = new JSONObject();
            json.put("status", code);
            json.put("msg", msg);
            return json.toString();
        } catch (Exception e) {
            return null;
        }
    }
    public String error(int code, String msg) {
        try {
            JSONObject json = new JSONObject();
            json.put("status", code);
            json.put("msg", msg);
            return json.toString();
        } catch (Exception e) {
            return null;
        }
    }
    public JSONObject getAgent(HttpServletRequest request) {
        try {
            String userAgent = request.getHeader("userAgent");
            if (StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            System.out.println("userAgent:" + userAgent);
            return new JSONObject(userAgent);
        } catch (Exception e) {
            return null;
        }
    }
}

+ 14 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/observerRequired.java

@ -0,0 +1,14 @@
package com.yihu.wlyy.aop;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
 * Created by Trick on 2017/6/24.
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ObserverRequired {
}

+ 106 - 106
patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java

@ -27,112 +27,112 @@ public class DoctorInterceptor extends BaseInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
//        try {
//            request.setCharacterEncoding("UTF-8");
//            request.setAttribute("log-start", new Date().getTime());
//            response.setCharacterEncoding("UTF-8");
//            JSONObject json = getAgent(request);
//
//            if (json == null) {
//                // 未登录
//                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
//                return false;
//            }
//
//            if (json.has("uid") && json.has("admin_token") && StringUtils.isNotEmpty(json.getString("admin_token"))) {
//                String adminToken = SystemConf.getInstance().getSystemProperties().getProperty("admin_token");
//                String adminUid = SystemConf.getInstance().getSystemProperties().getProperty("admin_uid");
//                if (json.getString("uid").equals(adminUid) && json.getString("admin_token").equals(adminToken)) {
//                    return true;
//                }
//            }
//
//            String tokenStr = json.has("token") ? json.getString("token") : "";
//            String uid = json.has("uid") ? json.getString("uid") : "";
//            String imei = json.has("imei") ? json.getString("imei") : "";
//            String observer = json.has("observer") ? json.getString("observer") : "";
//            //如果是观察者直接返回true
//            if (!org.springframework.util.StringUtils.isEmpty(observer) && observer.equals("1")) {
//                Class cls = ((HandlerMethod) handler).getBeanType();
//                RequestMapping clsRm = (RequestMapping) cls.getAnnotation(RequestMapping.class);
//                Method method = ((HandlerMethod) handler).getMethod();
//                RequestMapping mthRm = method.getAnnotation(RequestMapping.class);
//                String url = "";
//                String urlCls = "";
//                String urlMth = "";
//                if (clsRm.value() != null && clsRm.value().length > 0) {
//                    urlCls = clsRm.value()[0];
//                }
//                if (mthRm.value() != null && mthRm.value().length > 0) {
//                    urlMth = mthRm.value()[0];
//                }
//                if (StringUtils.isNotEmpty(urlCls)) {
//                    url += urlCls.startsWith("/") ? urlCls : ("/" + urlCls);
//                }
//                if (StringUtils.isNotEmpty(urlMth)) {
//                    url += urlMth.startsWith("/") ? urlMth : ("/" + urlMth);
//                }
//                url = url.replace("\\", "/").replace("//", "/");
//                CudUrl cudUrl = cudUrlDao.findByUrl(url);
//
//                if (url.equals("/doctor/consult/readed")) {
//                    response.getOutputStream().write(write(200, "操作成功").getBytes());
//                    return false;
//                }
//
//                if (cudUrl != null) {
//                    if (StringUtils.isNotEmpty(cudUrl.getMethod()) &&
//                            request.getMethod().toUpperCase().compareTo(cudUrl.getMethod()) != 0) {
//                        return true;
//                    } else {
//                        response.getOutputStream().write(error(403, "该操作没有权限").getBytes());
//                        return false;
//                    }
//                }
//
//                return true;
//            }
//            if (StringUtils.isEmpty(tokenStr) || StringUtils.isEmpty(imei) || StringUtils.isEmpty(uid)) {
//                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
//                return false;
//            }
//
//            Token token = SystemData.doctorTokens.get(uid);
//            if (token == null) {
//                token = tokenDao.findByPatient(uid, 2);
//                if (token != null) {
//                    // 加入缓存
//                    SystemData.doctorTokens.put(uid, token);
//                }
//            }
//            if (token == null || token.getPlatform() != 2) {
//                // 未登录
//                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
//                flag = false;
//            } else {
//                if (token.getTimeout().getTime() < new Date().getTime()) {
//                    // 登录超时
//                    response.getOutputStream().write(error(SystemConf.LOGIN_TIMEOUT, "登录超时,请重新登录").getBytes());
//                    flag = false;
//                } else if (!StringUtils.equals(tokenStr, token.getToken()) || !StringUtils.equals(uid, token.getUser()) || !StringUtils.equals(imei, token.getImei())) {
//                    // 别处登录
//                    response.getOutputStream().write(error(SystemConf.LOGIN_OTHER, "帐号在别处登录,请重新登录").getBytes());
//                    flag = false;
//                } else {
//                    // 一天只更新一次
//                    if (DateUtil.getDays(token.getCzrq(), DateUtil.getNowDateShort()) != 0) {
//                        // 今天未更新,则更新缓存
//                        token.setCzrq(new Date());
//                        // 更新内存
//                        SystemData.doctorTokens.put(uid, token);
//                        // 更新数据库
//                        tokenDao.save(token);
//                    }
//                }
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        try {
            request.setCharacterEncoding("UTF-8");
            request.setAttribute("log-start", new Date().getTime());
            response.setCharacterEncoding("UTF-8");
            JSONObject json = getAgent(request);
            if (json == null) {
                // 未登录
                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
                return false;
            }
            if (json.has("uid") && json.has("admin_token") && StringUtils.isNotEmpty(json.getString("admin_token"))) {
                String adminToken = SystemConf.getInstance().getSystemProperties().getProperty("admin_token");
                String adminUid = SystemConf.getInstance().getSystemProperties().getProperty("admin_uid");
                if (json.getString("uid").equals(adminUid) && json.getString("admin_token").equals(adminToken)) {
                    return true;
                }
            }
            String tokenStr = json.has("token") ? json.getString("token") : "";
            String uid = json.has("uid") ? json.getString("uid") : "";
            String imei = json.has("imei") ? json.getString("imei") : "";
            String observer = json.has("observer") ? json.getString("observer") : "";
            //如果是观察者直接返回true
            if (!org.springframework.util.StringUtils.isEmpty(observer) && observer.equals("1")) {
                Class cls = ((HandlerMethod) handler).getBeanType();
                RequestMapping clsRm = (RequestMapping) cls.getAnnotation(RequestMapping.class);
                Method method = ((HandlerMethod) handler).getMethod();
                RequestMapping mthRm = method.getAnnotation(RequestMapping.class);
                String url = "";
                String urlCls = "";
                String urlMth = "";
                if (clsRm.value() != null && clsRm.value().length > 0) {
                    urlCls = clsRm.value()[0];
                }
                if (mthRm.value() != null && mthRm.value().length > 0) {
                    urlMth = mthRm.value()[0];
                }
                if (StringUtils.isNotEmpty(urlCls)) {
                    url += urlCls.startsWith("/") ? urlCls : ("/" + urlCls);
                }
                if (StringUtils.isNotEmpty(urlMth)) {
                    url += urlMth.startsWith("/") ? urlMth : ("/" + urlMth);
                }
                url = url.replace("\\", "/").replace("//", "/");
                CudUrl cudUrl = cudUrlDao.findByUrl(url);
                if (url.equals("/doctor/consult/readed")) {
                    response.getOutputStream().write(write(200, "操作成功").getBytes());
                    return false;
                }
                if (cudUrl != null) {
                    if (StringUtils.isNotEmpty(cudUrl.getMethod()) &&
                            request.getMethod().toUpperCase().compareTo(cudUrl.getMethod()) != 0) {
                        return true;
                    } else {
                        response.getOutputStream().write(error(403, "该操作没有权限").getBytes());
                        return false;
                    }
                }
                return true;
            }
            if (StringUtils.isEmpty(tokenStr) || StringUtils.isEmpty(imei) || StringUtils.isEmpty(uid)) {
                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
                return false;
            }
            Token token = SystemData.doctorTokens.get(uid);
            if (token == null) {
                token = tokenDao.findByPatient(uid, 2);
                if (token != null) {
                    // 加入缓存
                    SystemData.doctorTokens.put(uid, token);
                }
            }
            if (token == null || token.getPlatform() != 2) {
                // 未登录
                response.getOutputStream().write(error(SystemConf.NOT_LOGIN, "请登录后再操作!").getBytes());
                flag = false;
            } else {
                if (token.getTimeout().getTime() < new Date().getTime()) {
                    // 登录超时
                    response.getOutputStream().write(error(SystemConf.LOGIN_TIMEOUT, "登录超时,请重新登录").getBytes());
                    flag = false;
                } else if (!StringUtils.equals(tokenStr, token.getToken()) || !StringUtils.equals(uid, token.getUser()) || !StringUtils.equals(imei, token.getImei())) {
                    // 别处登录
                    response.getOutputStream().write(error(SystemConf.LOGIN_OTHER, "帐号在别处登录,请重新登录").getBytes());
                    flag = false;
                } else {
                    // 一天只更新一次
                    if (DateUtil.getDays(token.getCzrq(), DateUtil.getNowDateShort()) != 0) {
                        // 今天未更新,则更新缓存
                        token.setCzrq(new Date());
                        // 更新内存
                        SystemData.doctorTokens.put(uid, token);
                        // 更新数据库
                        tokenDao.save(token);
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }

+ 85 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/ObserverRequiredInterceptor.java

@ -0,0 +1,85 @@
package com.yihu.wlyy.interceptors;
import com.yihu.wlyy.aop.ObserverRequired;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/**
 * Created by Trick on 2017/6/24.
 */
public class ObserverRequiredInterceptor  implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation mi) throws Throwable {
        Object[] ars = mi.getArguments();
        HttpServletRequest request =null;
        HttpServletResponse response = null;
        for(Object o :ars){
            if(o instanceof HttpServletRequest){
                request = (HttpServletRequest) o;
            }
            if(o instanceof HttpServletResponse){
                response = (HttpServletResponse) o;
            }
        }
        if(request!=null&&response!=null){
            JSONObject json = getAgent(request);
            String tokenStr = json.has("token") ? json.getString("token") : "";
            String uid = json.has("uid") ? json.getString("uid") : "";
            String imei = json.has("imei") ? json.getString("imei") : "";
            String observer = json.has("observer") ? json.getString("observer") : "";
            //if(StringUtils.isNotBlank(observer)&&"1".equals(observer)){
                if(mi.getMethod().isAnnotationPresent(ObserverRequired.class)){
                    System.out.println("----------this method is added @ObserverRequired-------------------------");
                    response.getOutputStream().write(error(403, "该操作没有权限").getBytes());
                    return null;
                }
            //}
        }
        //执行被拦截的方法,切记,如果此方法不调用,则被拦截的方法不会被执行。
        return mi.proceed();
    }
    public JSONObject getAgent(HttpServletRequest request) {
        try {
            String userAgent = request.getHeader("userAgent");
            if (StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            System.out.println("userAgent:" + userAgent);
            return new JSONObject(userAgent);
        } catch (Exception e) {
            return null;
        }
    }
    public String write(int code, String msg) {
        try {
            JSONObject json = new JSONObject();
            json.put("status", code);
            json.put("msg", msg);
            return json.toString();
        } catch (Exception e) {
            return null;
        }
    }
    public String error(int code, String msg) {
        try {
            JSONObject json = new JSONObject();
            json.put("status", code);
            json.put("msg", msg);
            return json.toString();
        } catch (Exception e) {
            return null;
        }
    }
}

+ 26 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/util/SignTeamAndGroupRunnable.java

@ -12,6 +12,8 @@ import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.orm.jpa.JpaTransactionManager;
@ -22,6 +24,7 @@ import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.text.SimpleDateFormat;
@ -33,6 +36,7 @@ import java.util.UUID;
/**
 * Created by lyr-pc on 2016/10/11.
 */
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Service
public class SignTeamAndGroupRunnable implements Runnable {
@ -55,6 +59,28 @@ public class SignTeamAndGroupRunnable implements Runnable {
        this.end = end;
    }
    public SignTeamAndGroupRunnable() {
    }
    public long getStart() {
        return start;
    }
    public SignTeamAndGroupRunnable setStart(long start) {
        this.start = start;
        return this;
    }
    public long getEnd() {
        return end;
    }
    public SignTeamAndGroupRunnable setEnd(long end) {
        this.end = end;
        return this;
    }
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

+ 63 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SpringUtil.java

@ -0,0 +1,63 @@
package com.yihu.wlyy.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class SpringUtil implements ApplicationContextAware {
    private static ApplicationContext applicationContext = null;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (SpringUtil.applicationContext == null) {
            SpringUtil.applicationContext = applicationContext;
        }
    }
    //获取applicationContext
    public static ApplicationContext
    getApplicationContext() {
        return applicationContext;
    }
    //通过name获取 Bean.
    public static Object
    getBean(String name) {
        return getApplicationContext().getBean(name);
    }
    //通过class获取Bean.
    public static<T> T getBean(Class<T> clazz) {
        return getApplicationContext().getBean(clazz);
    }
    //通过name,以及Clazz返回指定的Bean
    public static<T> T getBean(String name, Class<T> clazz) {
        return getApplicationContext().getBean(name, clazz);
    }
}

+ 4 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -9,8 +9,10 @@ import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.service.common.util.ManageUtilService;
import com.yihu.wlyy.service.common.util.SignTeamAndGroupRunnable;
import com.yihu.wlyy.util.SpringUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.MediaType;
@ -219,7 +221,8 @@ public class ManagerUtilController extends BaseController {
    @RequestMapping(value = "/sign_team_group_thread")
    public String getErrorPage(long start, long end) {
        try {
            new Thread(new SignTeamAndGroupRunnable(start, end)).start();
            new Thread(SpringUtil.getBean(SignTeamAndGroupRunnable.class)
                    .setEnd(end).setStart(start)).start();
            return write(200, "启动成功");
        } catch (Exception e) {
            return error(-1, "启动失败");

+ 13 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.entity.organization.Hospital;
@ -506,6 +507,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "updatepwd")
    @ResponseBody
    @ObserverRequired
    public String updatepwd(String oldpwd, String newpwd) {
        try {
            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
@ -669,6 +671,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "save")
    @ResponseBody
    @ObserverRequired
    public String save(
            @RequestParam(required = false) String photo,
            @RequestParam(required = false) Integer sex,
@ -1224,6 +1227,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/doctor_1_Toteam")
    @ResponseBody
    @ObserverRequired
    public String doctor_1_Toteam(
            @RequestParam(required = false) String teamCode, //没用
            @RequestParam(required = true) String parientCode,
@ -1465,6 +1469,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/idcard_update")
    @ResponseBody
    @ObserverRequired
    public String updateIdcard(String idcard) {
        try {
            if (StringUtils.isEmpty(idcard)) {
@ -1490,6 +1495,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/sex_update")
    @ResponseBody
    @ObserverRequired
    public String updateSex(int sex) {
        try {
            if (doctorInfoService.updateSex(sex, getUID())) {
@ -1510,6 +1516,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/introduce_update")
    @ResponseBody
    @ObserverRequired
    public String updateIntroduce(String introduce) {
        try {
            if (StringUtils.isEmpty(introduce)) {
@ -1534,6 +1541,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/expertise_update")
    @ResponseBody
    @ObserverRequired
    public String updateExpertise(String expertise) {
        try {
            if (StringUtils.isEmpty(expertise)) {
@ -1558,6 +1566,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/setFamous")
    @ResponseBody
    @ObserverRequired
    public String setFamous(String doctorCode, Integer status) {
        try {
            doctorInfoService.setFamous(doctorCode, status);
@ -1578,6 +1587,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/updateTeamHealthDoctors")
    @ResponseBody
    @ObserverRequired
    public String updateTeamHealthDoctors(String newDoctorCode,
                                          @RequestParam(required = false) String oldDoctorCode,
                                          @RequestParam(required = false) String patients,
@ -1632,6 +1642,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/updateTeamDoctors")
    @ResponseBody
    @ObserverRequired
    public String updateTeamDoctors(String newDoctorCode,
                                    String oldDoctorCode,
                                    String patients) {
@ -1668,6 +1679,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/mobile_update", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String changeDoctorMobile(String mobile, String captcha, int type) {
        try {
            if (StringUtils.isEmpty(mobile)) {
@ -1733,6 +1745,7 @@ public class DoctorController extends BaseController {
     */
    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String updatePassword(String newPassword1,
                                 String newPassword2,
                                 String oldPassword,

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/archives/DoctorArchivesController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.archives;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.archives.PatientEventService;
import com.yihu.wlyy.service.app.archives.PatientRecordService;
import com.yihu.wlyy.web.BaseController;
@ -201,6 +202,7 @@ public class DoctorArchivesController extends BaseController {
    @RequestMapping(value = "/event/save", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("保存就诊事件详情")
    @ObserverRequired
    public String saveEventDetail(@ApiParam(name="data",value="就诊事件json数据",defaultValue = "")
                                 @RequestParam(value="data",required = true) String data)
    {

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/booking/DoctorBookingController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.booking;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.PatientReservation;
import com.yihu.wlyy.repository.patient.PatientReservationDao;
import com.yihu.wlyy.service.app.reservation.PatientReservationService;
@ -63,6 +64,7 @@ public class DoctorBookingController extends BaseController{
    @RequestMapping(value = "CancelOrder", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("取消挂号单")
    @ObserverRequired
    public String CancelOrder(@ApiParam(name = "orderId", value = "订单id", defaultValue = "48")
                              @RequestParam(value = "orderId", required = true) Long orderId) {
        try {

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.consult;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamLog;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
@ -368,6 +369,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "finish")
    @ResponseBody
    @ObserverRequired
    public String finish(String consult) {
        try {
            int flag = consultTeamService.finish(consult, getUID(), 2);
@ -390,6 +392,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "/readed")
    @ResponseBody
    @ObserverRequired
    public String readMessage(String consult) {
        try {
            int result = consultTeamService.readMessage(consult);
@ -633,6 +636,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "famousAdd")
    @ResponseBody
    @ObserverRequired
    public String famousAdd(
            @RequestParam(required = false) String when,
            String symptoms,
@ -747,6 +751,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "transfer")
    @ResponseBody
    @ObserverRequired
    public String transfer(
            String consult,
            String doctor,
@ -810,6 +815,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "forHelpAdd")
    @ResponseBody
    @ObserverRequired
    public String forHelpAdd(
            @RequestParam(required = false) String when,
            String symptoms,
@ -946,6 +952,7 @@ public class DoctorConsultController extends WeixinBaseController {
    @RequestMapping(value = "seekHelp")
    @ResponseBody
    @ObserverRequired
    public String seekHelp(
            @RequestParam(required = true) String symptoms,
            @RequestParam(required = false) String oldConsultCode,
@ -990,6 +997,7 @@ public class DoctorConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "finish_consult")
    @ResponseBody
    @ObserverRequired
    public String finishConsult(@RequestParam(required = false) String consult) {
        try {
            int flag = consultTeamService.finishConsult(consult, getUID(), 2);

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultMoviController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.consult;
import java.sql.Time;
import java.util.Date;
import com.yihu.wlyy.aop.ObserverRequired;
import io.swagger.annotations.Api;
import org.json.JSONArray;
import org.json.JSONObject;
@ -149,6 +150,7 @@ public class DoctorConsultMoviController extends BaseController {
	 */
	@RequestMapping(value = "movi_finish")
	@ResponseBody
	@ObserverRequired
	public String finish(String code) {
		try {
			int row = consultMoviService.finish(code);
@ -210,6 +212,7 @@ public class DoctorConsultMoviController extends BaseController {
	 */
	@ResponseBody
	@RequestMapping(value = "referral")
	@ObserverRequired
	public String referral(String doctor, String consult, String scheduling, String appo_date, int appo_week, String hour_begin, String hour_end, String content) {
		try {
			// 查询医生信息
@ -264,6 +267,7 @@ public class DoctorConsultMoviController extends BaseController {
	 */
	@ResponseBody
	@RequestMapping(value = "inspect")
	@ObserverRequired
	public String addInspect(String patient, String items) {
		try {
			return success("保存成功!");

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultPublicController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.consult;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.ConsultPublic;
import com.yihu.wlyy.entity.consult.ConsultPublicReply;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -200,6 +201,7 @@ public class DoctorConsultPublicController extends BaseController {
	 */
	@RequestMapping(value = "reply")
	@ResponseBody
	@ObserverRequired
	public String reply(String consult, String content, @RequestParam(required = false) String images) {
		try {
			ConsultPublic cp = consultPublicService.findByConsult(consult);

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.device;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeamMember;
@ -45,6 +46,7 @@ public class DoctorDeviceController extends BaseController {
	@ApiOperation("设备保存接口--医生端")
	@RequestMapping(value = "SavePatientDevice",method = RequestMethod.POST)
	@ResponseBody
	@ObserverRequired
	public String saveDevice(@ApiParam(name="data",value="设备数据json",defaultValue = "{\"user\":\"915cca0a-5b1d-11e6-8344-fa163e8aee56\",\"deviceId\": \"3\",\"deviceName\": \"血压计-优瑞恩\",\"deviceSn\": \"16C000337\",\"categoryCode\": \"1\",\"userType\": \"-1\"}")
							  @RequestParam(value="data",required = true) String data) {
		try {
@ -86,6 +88,7 @@ public class DoctorDeviceController extends BaseController {
	@ApiOperation("设备删除--医生端")
	@RequestMapping(value = "DeletePatientDevice")
	@ResponseBody
	@ObserverRequired
	public String delete(@ApiParam(name="id",value="删除设备关联ID")
						 @RequestParam(value="id",required = true) String id) {
		try {
@ -127,6 +130,7 @@ public class DoctorDeviceController extends BaseController {
	@ApiOperation("设备删除--管理端")
	@RequestMapping(value = "unbindDevice")
	@ResponseBody
	@ObserverRequired
	public String deleteByAdmin(@ApiParam(name="deviceSn",value="设备SN")
						 @RequestParam(value="deviceSn",required = true) String deviceSn,
						@ApiParam(name="type",value="设备类型")
@ -161,6 +165,7 @@ public class DoctorDeviceController extends BaseController {
	@ApiOperation("批量注册接口")
	@RequestMapping(value = "registerSnInit",method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	public String registerSnInit(){
		try{
			String re = patientDeviceService.registerSnInit();
@ -177,6 +182,7 @@ public class DoctorDeviceController extends BaseController {
	@ApiOperation("单个注册接口")
	@RequestMapping(value = "registerSn",method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	public String registerSn(@ApiParam(name="deviceSn",value="设备SN码",defaultValue = "15L000002")
							@RequestParam(value="deviceSn",required = true) String deviceSn){
		try{

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/discussion/DoctorDiscussionGroupController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.doctor.discussion;
import java.util.*;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
@ -60,6 +61,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "/create", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String createTalkGroup(
            @RequestParam(required = true) String name,
            @RequestParam(required = true) int type,
@ -219,6 +221,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "/create/members", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String createTalkGroupMany(@RequestParam(required = true) String name,
                                      @RequestParam(required = true) int type,
                                      @RequestParam(required = true) String members,
@ -433,6 +436,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "addmember", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String addTalkMember(
            @RequestParam(required = true) String groupCode,
            @RequestParam(required = false) String groupName,
@ -497,6 +501,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "/addmembers", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String addMembers(@RequestParam(required = true) String groupCode,
                             @RequestParam(required = false) String groupName,
                             @RequestParam(required = true) String members) {
@ -573,6 +578,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "removemember", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String removeTalkMember(
            @RequestParam(required = true) String groupCode,
            @RequestParam(required = true) String memberCode) {
@ -593,6 +599,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
    @RequestMapping(value = "/removemembers", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String removeMembers(String groupCode, String members) {
        try {
            String[] memberArray = members.split(",");

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.feedback;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.service.app.feedback.FeedbackService;
import com.yihu.wlyy.util.CommonUtil;
@ -38,6 +39,7 @@ public class DoctorFeedbackController extends BaseController {
    @RequestMapping(value = "/saveFeedback", method = RequestMethod.POST)
    @ApiOperation(value = "医生端保存反馈")
    @ResponseBody
    @ObserverRequired
    public String saveFeedback(
            @RequestParam String description,
            @RequestParam int type,
@ -69,6 +71,7 @@ public class DoctorFeedbackController extends BaseController {
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.POST)
    @ApiOperation(value = "医生端保存申诉")
    @ResponseBody
    @ObserverRequired
    public String saveAppeal(
            @RequestParam String description,
            @RequestParam int type,

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.followup;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.logs.BusinessLogs;
import com.yihu.wlyy.service.app.followup.FollowUpService;
@ -87,6 +88,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("获取随访列表(创建者)")
    @RequestMapping(value = "/createrList", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public String getCreaterList(@ApiParam(name = "startTime", value = "开始时间", defaultValue = "2016-12-07 00:00:00")
                                 @RequestParam(value = "startTime", required = true) String startTime,
                                 @ApiParam(name = "endTime", value = "结束时间", defaultValue = "2016-12-14 00:00:00")
@ -107,6 +109,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("新增随访计划(批量)")
    @RequestMapping(value = "/addFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String addFollowupPlan(@ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                                  @RequestParam(value = "patient", required = true) String patient,
                                  @ApiParam(name = "data", value = "随访计划列表json", defaultValue = "[{\"date\":\"2016-12-16 20:00:00\",\"type\":\"10\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"},{\"date\":\"2016-12-17 15:00:00\",\"type\":\"3\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"}]")
@ -129,6 +132,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("编辑随访计划")
    @RequestMapping(value = "/editFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String editFollowupPlan(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                   @RequestParam(value = "id", required = true) String id,
                                   @ApiParam(name = "planDate", value = "随访计划时间", defaultValue = "2016-12-14 20:00:00")
@ -147,6 +151,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("开始随访记录")
    @RequestMapping(value = "/startFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String startFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                @RequestParam(value = "id", required = true) String id,
                                @ApiParam(name = "date", value = "随访时间", defaultValue = "2016-12-14 20:00:00")
@ -169,6 +174,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("新增临时随访记录(返回ID)")
    @RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String addFollowup(@ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                              @RequestParam(value = "patient", required = true) String patient,
                              @ApiParam(name = "date", value = "下次随访时间", defaultValue = "2016-12-15 20:00:00")
@ -191,6 +197,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("取消随访计划")
    @RequestMapping(value = "/cancelFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String cancelFollowupPlan(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                     @RequestParam(value = "id", required = true) String id) {
        try {
@ -205,6 +212,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("完成随访记录")
    @RequestMapping(value = "/finishFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String finishFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                 @RequestParam(value = "id", required = true) String id) {
        try {
@ -264,6 +272,7 @@ public class DoctorFollowUpController extends BaseController {
    @ApiOperation("保存随访项目数据")
    @RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String saveFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                                          @RequestParam(value = "id", required = true) String id,
                                          @ApiParam(name = "followupProject", value = "随访项目", defaultValue = "2")

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowupDrugsController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.followup;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.dict.DmDrugsGroupItem;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.followup.FollowupDrugs;
@ -55,6 +56,7 @@ public class DoctorFollowupDrugsController extends BaseController {
	@ApiOperation("保存面访用药数据")
	@RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	@ObserverRequired
	public String saveFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
										  @RequestParam(value="id",required = true) String id,
									      @ApiParam(name="drugsData",value="面访用药数据",defaultValue = "[]")

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.health;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
@ -196,6 +197,7 @@ public class DoctorHealthController extends BaseController {
	@RequestMapping(value = "standard_save",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("保存患者健康指标预警值")
	@ObserverRequired
	public String standardSave(@ApiParam("患者代码") @RequestParam String patient,
							    @ApiParam("预警值Json") @RequestParam String json) {
		try {

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.health;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.*;
import com.yihu.wlyy.entity.patient.Patient;
@ -315,6 +316,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
     */
    @RequestMapping(value = "send")
    @ResponseBody
    @ObserverRequired
    public String send(@RequestParam(value = "code") String code,
                       @RequestParam(value = "patient", required = false) String patient,
                       @RequestParam(value = "group", required = false, defaultValue = "") String group,
@ -520,6 +522,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
     */
    @RequestMapping(value = "collectionArticle")
    @ResponseBody
    @ObserverRequired
    public String collectionArticle(@RequestParam(value = "article", required = true) String article) {
        HealthEduArticleDoctor healthEduArticleDoctor = healthEduArticleDoctorService.findByArticle(article, getUID());
        if (healthEduArticleDoctor != null) {
@ -549,6 +552,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
     */
    @RequestMapping(value = "uncollectionArticle")
    @ResponseBody
    @ObserverRequired
    public String uncollectionArticle(@RequestParam(value = "article", required = true) String article) {
        try {
            healthEduArticleDoctorService.delete(article, getUID());

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.health;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
@ -124,6 +125,7 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
	 */
	@RequestMapping(value = "add")
	@ResponseBody
	@ObserverRequired
	public String add(@RequestParam String patient,
					  @RequestParam String content,
					  @RequestParam(required = false) String modelCode,

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/intervene/DoctorInterveneController.java

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
import com.yihu.wlyy.aop.ObserverRequired;
import io.swagger.annotations.Api;
import org.json.JSONArray;
import org.json.JSONObject;
@ -87,6 +88,7 @@ public class DoctorInterveneController extends BaseController {
	 */
	@RequestMapping(value = "self_exam")
	@ResponseBody
	@ObserverRequired
	public String selfExam(@RequestParam(required = false) Integer type, @RequestParam(required = false) String consult, String patient, String devices) {
		try {
			Doctor doctor = doctorService.findDoctorByCode(getUID());
@ -161,6 +163,7 @@ public class DoctorInterveneController extends BaseController {
	 */
	@RequestMapping(value = "inspection")
	@ResponseBody
	@ObserverRequired
	public String inspection(int type, String consult, String patient, String suggest) {
		try {
			// 查询医生信息

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/medical/DoctorMedicalRecordController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.medical;
import java.util.Date;
import java.util.List;
import com.yihu.wlyy.aop.ObserverRequired;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -224,6 +225,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "add_part")
	@ResponseBody
	@ObserverRequired
	public String addPart(String name) {
		try {
			DoctorMedicalRecordsPart part = medicalRecordsService.addPart(getUID(), name);
@ -246,6 +248,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "add_part_item")
	@ResponseBody
	@ObserverRequired
	public String addPartItem(String part, String content) {
		try {
			DoctorMedicalRecordsPartItem item = medicalRecordsService.addPartItem(getUID(), part, content);
@ -269,6 +272,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "add_part_record")
	@ResponseBody
	@ObserverRequired
	public String addPartRecord(String patient, String part, String content) {
		try {
			medicalRecordsService.addPartRecord(getUID(), patient, part, content);
@ -288,6 +292,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "modify_part_record")
	@ResponseBody
	@ObserverRequired
	public String modifyPartRecord(String record, String content) {
		try {
			// 查询片段记录内容
@ -314,6 +319,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "del_part_record")
	@ResponseBody
	@ObserverRequired
	public String delPartRecord(String record) {
		try {
			PatientMedicalRecords temp = medicalRecordsService.findRecordByCode(record);
@ -344,6 +350,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "add_record")
	@ResponseBody
	@ObserverRequired
	public String addRecord(String patient, String consult, String title, String parts) {
		try {
			PatientMedicalRecords temp = medicalRecordsService.addRecord(getUID(), patient, consult, title, parts);

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.message;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.message.Message;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -119,6 +120,7 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "read_health")
    @ResponseBody
    @ApiOperation("消息设置成已读")
    @ObserverRequired
    public String readHealth(long msgid) {
        try {
            messageService.readHealth(msgid);
@ -330,6 +332,7 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "setMessageReaded")
    @ResponseBody
    @ApiOperation("设置某类消息已读")
    @ObserverRequired
    public String setMessageReaded(@RequestParam @ApiParam(value = "消息类型") Integer type) {
        try {
            messageService.setMessageReaded(getUID(), type);

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/DoctorPatientGroupController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatientGroup;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatientGroupInfo;
@ -734,6 +735,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "add_group")
    @ResponseBody
    @ObserverRequired
    public String addGroup(String name) {
        try {
            if (doctorPatientGroupService.addGroup(getUID(), name) != null) {
@ -755,6 +757,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "del_group")
    @ResponseBody
    @ObserverRequired
    public String deleteGroup(String group) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -787,6 +790,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "modify_group")
    @ResponseBody
    @ObserverRequired
    public String modifyGroup(String group, String name) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -937,6 +941,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "add_patients")
    @ResponseBody
    @ObserverRequired
    public String addGroupPatients(String group, String patients) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -1142,6 +1147,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "sign_doctors")
    @ResponseBody
    @ObserverRequired
    public String signDoctors(String patient) {
        try {
            JSONObject data = new JSONObject();

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientDiseaseController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.PatientDisease;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.web.BaseController;
@ -85,6 +86,7 @@ public class PatientDiseaseController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/disease_update")
    @ObserverRequired
    public String updatePatientDisease(String patient, String disease) {
        try {
            List<PatientDisease> diseases = patientDiseaseService.getPatientDiseaseSs(patient);

+ 5 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.sign.SignLabel;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.repository.doctor.SignLabelDao;
@ -57,6 +58,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/add")
    @ObserverRequired
    public String addPatientLabel(String labelName, Long teamCode) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -96,6 +98,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/add/teams")
    @ObserverRequired
    public String addTeamsLabel(@RequestParam String labelName, @RequestParam String teamCode) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -130,6 +133,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/modify")
    @ObserverRequired
    public String modifyPatientLabel(String labelCode, String newName) {
        try {
            if (StringUtils.isEmpty(labelCode)) {
@ -160,6 +164,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/delete")
    @ObserverRequired
    public String deletePatientLabel(String labelCode) {
        try {
            if (StringUtils.isEmpty(labelCode)) {

+ 5 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.sign.SignWebService;
import com.yihu.wlyy.service.common.account.PatientService;
@ -348,6 +349,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_label_update")
    @ObserverRequired
    public String setPatientLabels(@RequestParam(required = false) String patient,
                                   @RequestParam(required = false) String health,
                                   @RequestParam(required = false) String disease,
@ -546,6 +548,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_label_add")
    @ObserverRequired
    public String addPatientLabel(String patient, String labelCode, String labelType) {
        try {
            if (StringUtils.isEmpty(String.valueOf(patient))) {
@ -585,6 +588,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/label_and_patients_add")
    @ObserverRequired
    public String addLabelAndPatient(String labelName, Long teamCode, @RequestParam(required = false) String patients) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -620,6 +624,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_label_delete")
    @ObserverRequired
    public String deletePatientLabel(String patient, String labelCode, String labelType) {
        try {
            if (StringUtils.isEmpty(String.valueOf(patient))) {

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.reply;
import com.fasterxml.jackson.databind.deser.Deserializers;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.reply.DoctorQuickReply;
import com.yihu.wlyy.service.app.reply.DoctorQuickReplyService;
import com.yihu.wlyy.web.BaseController;
@ -48,6 +49,7 @@ public class DoctorQuickReplyController extends BaseController {
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    @ApiOperation(value = "修改快捷回复")
    @ObserverRequired
    public String modifyReply(@RequestParam @ApiParam(value = "快捷回复ID") Long id,
                              @RequestParam @ApiParam(value = "快捷回复内容") String content) {
        try {
@ -73,6 +75,7 @@ public class DoctorQuickReplyController extends BaseController {
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ApiOperation(value = "删除快捷回复")
    @ObserverRequired
    public String delReply(@RequestParam @ApiParam(value = "快捷回复ID") Long id) {
        try {
            if (id == null || id < 1) {

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/scheduling/DoctorWorkTimeController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.scheduling;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
@ -75,6 +76,7 @@ public class DoctorWorkTimeController extends BaseController {
     */
    @RequestMapping(value = "/save")
    @ResponseBody
    @ObserverRequired
    public String saveDoctorWorkTime(String workScheduling) {
        try {
            if (StringUtils.isEmpty(workScheduling)) {
@ -127,6 +129,7 @@ public class DoctorWorkTimeController extends BaseController {
     */
    @RequestMapping(value = "/receive_consult_setting")
    @ResponseBody
    @ObserverRequired
    public String setDoctorReceiveConsult(String receiveConsult) {
        try {
            if (StringUtils.isEmpty(receiveConsult)) {
@ -151,6 +154,7 @@ public class DoctorWorkTimeController extends BaseController {
     */
    @RequestMapping(value = "/consult_times_setting")
    @ResponseBody
    @ObserverRequired
    public String setFamousDoctorConsultTime(int consultTimes) {
        try {
            Doctor doc = doctorInfoService.findDoctorByCode(getUID());

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -5,6 +5,7 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.entity.message.Message;
@ -397,6 +398,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "agent")
    @ResponseBody
    @ObserverRequired
    public String agent(
            @RequestParam(required = false) String name,
            @RequestParam(required = false) String idcard,
@ -508,6 +510,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "sign")
    @ResponseBody
    @ObserverRequired
    public String sign(
            @RequestParam(required = true, defaultValue = "1") String signType,
            @RequestParam(required = false, defaultValue = "") String healthDoctor,
@ -617,6 +620,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "surrender")
    @ResponseBody
    @ObserverRequired
    public String surrender(
            long msgid,
            String patient,
@ -804,6 +808,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/expenses_type_update")
    @ResponseBody
    @ObserverRequired
    public String updateExpensesType(String expensesType, String patient) {
        try {
            if (StringUtils.isEmpty(expensesType)) {
@ -1108,6 +1113,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/sign_info_update")
    @ResponseBody
    @ObserverRequired
    public String updateSignInfo(String patient, @RequestParam(required = false) String healthDoctor,
                                 @RequestParam(required = false) String doctor,
                                 @RequestParam(required = false) String expensesType) {
@ -1334,6 +1340,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/expenses_remind")
    @ResponseBody
    @ObserverRequired
    public String remindPatientExpenses(@RequestParam(required = false) String patient
            , @RequestParam(required = false) String isAll) {
        try {
@ -1560,6 +1567,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    @RequestMapping(value = "/wechat_focus_remind", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation(value = "微信关注提醒")
    @ObserverRequired
    public String wechatFocusRemind(@RequestParam(defaultValue = "") @ApiParam(value = "居民") String patient,
                                    @RequestParam(defaultValue = "") @ApiParam(value = "是否全部(1:全部  0:非全部)") String isAll) {
        try {

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.sign;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
@ -422,6 +423,7 @@ public class DoctorSignController extends WeixinBaseController {
     */
    @RequestMapping("/sendRenewToPatients")
    @ApiOperation(value = "提醒用户签约接口")
    @ObserverRequired
    public String sendRenewToPatients(){
        try{
            int rs ;
@ -450,6 +452,7 @@ public class DoctorSignController extends WeixinBaseController {
     */
    @RequestMapping("/agreeRenew")
    @ApiOperation(value = "医生处理签约")
    @ObserverRequired
    public String agreeRenew(@RequestParam(required = true)String state,
                             @RequestParam(required = true)String patient,
                             @RequestParam(required = false) Long mesId,
@ -557,6 +560,7 @@ public class DoctorSignController extends WeixinBaseController {
    @RequestMapping("/remindPatientRenew")
    @ApiOperation(value = "提醒居民续签")
    @ObserverRequired
    public String remindPatientRenew(@RequestParam(required = true)String patient){
        try{
            int rs =signWebService.remainPatientRenew(getAccessToken(),patient,getUID());

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java


+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.team;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
@ -76,6 +77,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(method = RequestMethod.POST)
    @ApiOperation(value = "创建团队")
    @ObserverRequired
    public String createTeam(@RequestParam("team_name") String teamName,
                             @RequestParam("leader_id") String leaderCode,
                             @RequestParam("org_code") String orgCode) {
@ -93,6 +95,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    @ApiOperation(value = "删除团队信息")
    @ObserverRequired
    public String deleteTeam(@RequestParam("teamId") long teamId) {
        try {
            teamService.deleteTeam(teamId);
@ -106,6 +109,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/{team_id}/name", method = RequestMethod.POST)
    @ApiOperation(value = "更新团队名称")
    @ObserverRequired
    public String updateTeamName(@PathVariable("team_id") long teamId,
                                 @RequestParam("team_name") String teamName) {
        try {
@ -120,6 +124,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/{team_id}/leader", method = RequestMethod.POST)
    @ApiOperation(value = "更新团队领导")
    @ObserverRequired
    public String updateTeamLeader(@PathVariable("team_id") long teamId,
                                   @RequestParam("doctor_code") String doctorCode) {
        try {
@ -147,6 +152,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/{team_id}/members", method = RequestMethod.POST)
    @ApiOperation(value = "添加团队成员,批量添加使用逗号分隔列表")
    @ObserverRequired
    public String addMember(@PathVariable("team_id") long teamId,
                            @RequestParam("doctor_code") String doctorCodeList) {
        try {
@ -211,6 +217,7 @@ public class AdminTeamController extends BaseController {
    @RequestMapping(value = "/{team_id}/members/{doctor_code}/remove", method = RequestMethod.POST)
    @ApiOperation(value = "移除成员")
    @ObserverRequired
    public String removeMember(@PathVariable("team_id") long teamId,
                               @PathVariable("doctor_code") String doctorCode) {

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.template;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.service.template.DoctorGuidanceTempService;
import com.yihu.wlyy.web.BaseController;
@ -77,6 +78,7 @@ public class DoctorGuidanceTempController extends BaseController {
//  =====================
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加指导模板")
    @ObserverRequired
    public String add(@RequestParam @ApiParam(value = "指导内容") String content,
                      @RequestParam @ApiParam(value = "模板名称") String modelName,
                      @RequestParam(required = false) @ApiParam(value = "图片内容") String imagesUrl) {
@ -111,6 +113,7 @@ public class DoctorGuidanceTempController extends BaseController {
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    @ApiOperation(value = "修改指导模板")
    @ObserverRequired
    public String modify(@RequestParam @ApiParam(value = "指导编码") String code,
                         @RequestParam @ApiParam(value = "模板标题") String modelName,
                         @RequestParam @ApiParam(value = "指导内容") String content,
@ -150,6 +153,7 @@ public class DoctorGuidanceTempController extends BaseController {
     */
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ApiOperation(value = "删除指导模板")
    @ObserverRequired
    public String delete(@RequestParam @ApiParam(value = "指导编码") String code) {
        try {
            if (StringUtils.isEmpty(code)) {

+ 5 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.template;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceDetail;
@ -124,6 +125,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
    @RequestMapping(value = "/saveTeamGuidance", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("新增团队模板")
    @ObserverRequired
    public String saveTeamGuidance(
            @ApiParam(value = "团队模板标题")
            @RequestParam String title,
@ -157,6 +159,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
     */
    @RequestMapping(value = "/modifyTeamGuidance", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    @ApiOperation("修改团队模板")
    public String modifyTeamGuidance(
            @ApiParam(value = "团队模板团队模板是否保存为个人模板", defaultValue = "0")
@ -193,6 +196,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
    @RequestMapping(value = "/deleteTeamGuidance", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("删除团队所属的团队模板")
    @ObserverRequired
    public String deleteTeamGuidance(
            @ApiParam(value = "是否删除存在该模板的所有团队")
            @RequestParam int deleteAll,
@ -221,6 +225,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
    @RequestMapping(value = "/sendTeamGuidance", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("发送团队模板给居民")
    @ObserverRequired
    public String sendTeamGuidance(
            @ApiParam(value = "要发送的居民code")
            @RequestParam String patient,

+ 12 - 10
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.statistic;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.statistics.PopulationBase;
import com.yihu.wlyy.service.app.statistics.StatisticsAllService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
@ -127,7 +128,7 @@ public class StatisticsController extends BaseController {
     * @param level2_type 指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @return
     */
        @RequestMapping("/total")
    @RequestMapping("/total")
    @ResponseBody
    public String getIndexTotal(@RequestParam(required = true) String endDate,
                                @RequestParam(required = true) String area,
@ -818,7 +819,7 @@ public class StatisticsController extends BaseController {
                             @RequestParam(required = true)String type){
        try {
            return write(200, "查询成功", "data", statisticsService.getAvgLine(getUID(),startDate,endDate,type));
           // return write(200, "查询成功", "data", statisticsService.getAvgLine("xh1D201703150222",startDate,endDate,type));
            // return write(200, "查询成功", "data", statisticsService.getAvgLine("xh1D201703150222",startDate,endDate,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -874,10 +875,10 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getTeamDoctorConsultCount")
    @ResponseBody
    public String getTeamDoctorConsultCount(@RequestParam(required = true)String teamCode,
                                             @RequestParam(required = true)String startDate,
                                             @RequestParam(required = true)String endDate,
                                             @RequestParam(required = true)String type,
                                             @RequestParam(required = true)String doctor){
                                            @RequestParam(required = true)String startDate,
                                            @RequestParam(required = true)String endDate,
                                            @RequestParam(required = true)String type,
                                            @RequestParam(required = true)String doctor){
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorConsultCount(teamCode,startDate,endDate,type,doctor));
        } catch (Exception e) {
@ -1231,10 +1232,10 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getTeamDoctorEduLine")
    @ResponseBody
    public String getTeamDoctorEduLine(@RequestParam(required = true)String teamCode,
                                 @RequestParam(required = true)String startDate,
                                 @RequestParam(required = true)String endDate,
                                 @RequestParam(required = true)String type,
                                 @RequestParam(required = true)String doctor){
                                       @RequestParam(required = true)String startDate,
                                       @RequestParam(required = true)String endDate,
                                       @RequestParam(required = true)String type,
                                       @RequestParam(required = true)String doctor){
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorEduLine(teamCode,startDate,endDate,type,doctor));
        } catch (Exception e) {
@ -1283,6 +1284,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getDotorInfo")
    @ResponseBody
    @ObserverRequired
    public String getDotorInfo(@RequestParam(required = true)String code){
        try {
            return write(200, "查询成功", "data", statisticsService.getDoctorInfo(code));

+ 219 - 217
patient-co-wlyy/src/main/resources/applicationContext.xml

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:task="http://www.springframework.org/schema/task"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
	   xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	   xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
       xmlns:task="http://www.springframework.org/schema/task"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
@ -15,222 +15,224 @@
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
	   default-lazy-init="true">
	<description>Spring公共配置 </description>
	<!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
	<context:component-scan base-package="com.yihu.wlyy">
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
		<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/>
	</context:component-scan>
	
	<task:annotation-driven />
	<!-- aop:aspectj-autoproxy proxy-target-class="true" / -->
	
	<!-- 此处对于定时时间的配置会被注解中的时间配置覆盖,因此,以注解配置为准 -->  
       default-lazy-init="true">
    <description>Spring公共配置</description>
    <!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
    <context:component-scan base-package="com.yihu.wlyy">
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>
    <task:annotation-driven/>
    <!-- 此处对于定时时间的配置会被注解中的时间配置覆盖,因此,以注解配置为准 -->
    <!-- task:scheduled-tasks scheduler="followUpScheduler">
        <task:scheduled ref="followUpTask" method="push" cron="0 0 6 * * *"/>  
    </task:scheduled-tasks>
    <task:scheduler id="followUpScheduler" pool-size="10"/ -->
	<!-- Jpa Entity Manager 配置 -->
	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" autowire-candidate="default">
		<property name="dataSource" ref="dataSource"/>
		<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
		<property name="packagesToScan" value="com.yihu.wlyy.entity"/>
		<property name="jpaProperties">
			<props>
				<!-- 命名规则 My_NAME->MyName -->
				<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
	</bean>
	<bean id="entityManagerFactoryHealth" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSourceHealth"/>
		<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapterHealth"/>
		<property name="packagesToScan" value="com.yihu.wlyy.health.entity"/>
		<property name="jpaProperties">
			<props>
				<!-- 命名规则 My_NAME->MyName -->
				<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
	</bean>
	
	<bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
		<property name="databasePlatform">
			<bean factory-method="getDialect" class="org.springside.modules.persistence.Hibernates">
				<constructor-arg ref="dataSource"/>
			</bean>
		</property>
	</bean>
	<bean id="hibernateJpaVendorAdapterHealth" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
		<property name="databasePlatform">
			<bean factory-method="getDialect" class="org.springside.modules.persistence.Hibernates">
				<constructor-arg ref="dataSourceHealth"/>
			</bean>
		</property>
	</bean>
	<!-- Spring Data Jpa配置 -->
 	<jpa:repositories base-package="com.yihu.wlyy.repository"  transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory"/>
	<jpa:repositories base-package="com.yihu.wlyy.health.repository"  transaction-manager-ref="transactionManagerHealth" entity-manager-factory-ref="entityManagerFactoryHealth"/>
	<!-- Jpa 事务配置 -->
	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory"/>
	</bean>
	<!-- Jpa 事务配置 -->
	<bean id="transactionManagerHealth" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactoryHealth"/>
	</bean>
	<!-- 使用annotation定义事务 -->
	<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
	<tx:annotation-driven transaction-manager="transactionManagerHealth" proxy-target-class="true" />
	<!-- JSR303 Validator定义 -->
 	<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
 	
 	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
		<property name="dataSource" ref="dataSource" />
	</bean>
	<bean id="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper" />
    <!-- Jpa Entity Manager 配置 -->
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
          autowire-candidate="default">
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
        <property name="packagesToScan" value="com.yihu.wlyy.entity"/>
        <property name="jpaProperties">
            <props>
                <!-- 命名规则 My_NAME->MyName -->
                <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>
    <bean id="entityManagerFactoryHealth" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSourceHealth"/>
        <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapterHealth"/>
        <property name="packagesToScan" value="com.yihu.wlyy.health.entity"/>
        <property name="jpaProperties">
            <props>
                <!-- 命名规则 My_NAME->MyName -->
                <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>
    <bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="databasePlatform">
            <bean factory-method="getDialect" class="org.springside.modules.persistence.Hibernates">
                <constructor-arg ref="dataSource"/>
            </bean>
        </property>
    </bean>
    <bean id="hibernateJpaVendorAdapterHealth" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="databasePlatform">
            <bean factory-method="getDialect" class="org.springside.modules.persistence.Hibernates">
                <constructor-arg ref="dataSourceHealth"/>
            </bean>
        </property>
    </bean>
    <!-- Spring Data Jpa配置 -->
    <jpa:repositories base-package="com.yihu.wlyy.repository" transaction-manager-ref="transactionManager"
                      entity-manager-factory-ref="entityManagerFactory"/>
    <jpa:repositories base-package="com.yihu.wlyy.health.repository" transaction-manager-ref="transactionManagerHealth"
                      entity-manager-factory-ref="entityManagerFactoryHealth"/>
    <!-- Jpa 事务配置 -->
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>
    <!-- Jpa 事务配置 -->
    <bean id="transactionManagerHealth" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactoryHealth"/>
    </bean>
    <!-- 使用annotation定义事务 -->
    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
    <tx:annotation-driven transaction-manager="transactionManagerHealth" proxy-target-class="true"/>
    <!-- JSR303 Validator定义 -->
    <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <bean id="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper"/>
    <!--quartz任务调度器名称,调度器只能加载与名称相同的任务-->
	<!--<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" scope="singleton">-->
		<!--<property name="dataSource" ref="dataSource"/>-->
		<!--<property name="configLocation" value="classpath:/quartz.properties" />-->
		<!--<property name="autoStartup" value="true"/>-->
	<!--</bean>-->
	<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
		<property name="maxIdle" value="${redis.maxIdle}"/>
		<property name="maxTotal" value="${redis.maxActive}"/>
		<property name="maxWaitMillis" value="${redis.maxWait}"/>
		<property name="testOnBorrow" value="${redis.testOnBorrow}"/>
	</bean>
	<bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
		<property name="hostName" value="${redis.host}"></property>
		<property name="port" value="${redis.port}"></property>
		<property name="password" value="${redis.password}"></property>
		<property name="database" value="0"></property>
		<property name="poolConfig" ref="poolConfig"></property>
	</bean>
	<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
		<property name="connectionFactory" ref="connectionFactory"/>
	</bean>
	<util:properties id="sys" location="classpath*:/system.properties"/>
	<beans>
		<context:property-placeholder ignore-unresolvable="true"
									  location="classpath*:/application.properties" />
		<!-- 数据源配置, 使用Tomcat JDBC连接池 -->
		<bean id="dataSourceHealth" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
			<!-- Connection Info -->
			<property name="driverClassName" value="${jdbc.driver}" />
			<property name="url" value="${health.jdbc.url}" />
			<property name="username" value="${health.jdbc.username}" />
			<property name="password" value="${health.jdbc.password}" />
			<!-- Connection Pooling Info -->
			<property name="maxActive" value="${jdbc.pool.maxActive}" />
			<property name="maxIdle" value="${jdbc.pool.maxIdle}" />
			<property name="minIdle" value="0" />
			<property name="defaultAutoCommit" value="false" />
		</bean>
	</beans>
	<!-- production环境 -->
 	<beans profile="production">
 		<context:property-placeholder ignore-unresolvable="true"
			location="classpath*:/application.properties" />
		
		<!-- 数据源配置, 使用Tomcat JDBC连接池 -->
		<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
			<!-- Connection Info -->
			<property name="driverClassName" value="${jdbc.driver}" />
			<property name="url" value="${jdbc.url}" />
			<property name="username" value="${jdbc.username}" />
			<property name="password" value="${jdbc.password}" />
		
			<!-- Connection Pooling Info -->
			<property name="maxActive" value="${jdbc.pool.maxActive}" />
			<property name="maxIdle" value="${jdbc.pool.maxIdle}" />
			<property name="minIdle" value="0" />
			<property name="defaultAutoCommit" value="false" />
		</bean>
		<!-- 数据源配置,使用应用服务器的数据库连接池 -->
		<!--<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/ExampleDB" />-->
	</beans>
	
	<!-- local development环境 -->
	<beans profile="development">
		<context:property-placeholder ignore-resource-not-found="true"
			location="classpath*:/application.properties,
          			  classpath*:/application.development.properties" />
		<!-- Tomcat JDBC连接池 -->
		<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
			<property name="driverClassName" value="${jdbc.driver}" />
			<property name="url" value="${jdbc.url}" />
			<property name="username" value="${jdbc.username}" />
			<property name="password" value="${jdbc.password}" />
			<property name="defaultAutoCommit" value="false" />
		</bean>
	</beans>
	<!-- functional test 环境 -->
	<beans profile="functional">
		<context:property-placeholder ignore-resource-not-found="true"
			location="classpath*:/application.properties,
    <!--<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" scope="singleton">-->
    <!--<property name="dataSource" ref="dataSource"/>-->
    <!--<property name="configLocation" value="classpath:/quartz.properties" />-->
    <!--<property name="autoStartup" value="true"/>-->
    <!--</bean>-->
    <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
        <property name="maxIdle" value="${redis.maxIdle}"/>
        <property name="maxTotal" value="${redis.maxActive}"/>
        <property name="maxWaitMillis" value="${redis.maxWait}"/>
        <property name="testOnBorrow" value="${redis.testOnBorrow}"/>
    </bean>
    <bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
        <property name="hostName" value="${redis.host}"></property>
        <property name="port" value="${redis.port}"></property>
        <property name="password" value="${redis.password}"></property>
        <property name="database" value="0"></property>
        <property name="poolConfig" ref="poolConfig"></property>
    </bean>
    <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
        <property name="connectionFactory" ref="connectionFactory"/>
    </bean>
    <util:properties id="sys" location="classpath*:/system.properties"/>
    <beans>
        <context:property-placeholder ignore-unresolvable="true"
                                      location="classpath*:/application.properties"/>
        <!-- 数据源配置, 使用Tomcat JDBC连接池 -->
        <bean id="dataSourceHealth" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
            <!-- Connection Info -->
            <property name="driverClassName" value="${jdbc.driver}"/>
            <property name="url" value="${health.jdbc.url}"/>
            <property name="username" value="${health.jdbc.username}"/>
            <property name="password" value="${health.jdbc.password}"/>
            <!-- Connection Pooling Info -->
            <property name="maxActive" value="${jdbc.pool.maxActive}"/>
            <property name="maxIdle" value="${jdbc.pool.maxIdle}"/>
            <property name="minIdle" value="0"/>
            <property name="defaultAutoCommit" value="false"/>
        </bean>
    </beans>
    <!-- production环境 -->
    <beans profile="production">
        <context:property-placeholder ignore-unresolvable="true"
                                      location="classpath*:/application.properties"/>
        <!-- 数据源配置, 使用Tomcat JDBC连接池 -->
        <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
            <!-- Connection Info -->
            <property name="driverClassName" value="${jdbc.driver}"/>
            <property name="url" value="${jdbc.url}"/>
            <property name="username" value="${jdbc.username}"/>
            <property name="password" value="${jdbc.password}"/>
            <!-- Connection Pooling Info -->
            <property name="maxActive" value="${jdbc.pool.maxActive}"/>
            <property name="maxIdle" value="${jdbc.pool.maxIdle}"/>
            <property name="minIdle" value="0"/>
            <property name="defaultAutoCommit" value="false"/>
        </bean>
        <!-- 数据源配置,使用应用服务器的数据库连接池 -->
        <!--<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/ExampleDB" />-->
    </beans>
    <!-- local development环境 -->
    <beans profile="development">
        <context:property-placeholder ignore-resource-not-found="true"
                                      location="classpath*:/application.properties,
          			  classpath*:/application.development.properties"/>
        <!-- Tomcat JDBC连接池 -->
        <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
            <property name="driverClassName" value="${jdbc.driver}"/>
            <property name="url" value="${jdbc.url}"/>
            <property name="username" value="${jdbc.username}"/>
            <property name="password" value="${jdbc.password}"/>
            <property name="defaultAutoCommit" value="false"/>
        </bean>
    </beans>
    <!-- functional test 环境 -->
    <beans profile="functional">
        <context:property-placeholder ignore-resource-not-found="true"
                                      location="classpath*:/application.properties,
          			  classpath*:/application.functional.properties,
          			  classpath*:/application.functional-local.properties" />
		<!-- Tomcat JDBC连接池 -->
		<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
			<property name="driverClassName" value="${jdbc.driver}" />
			<property name="url" value="${jdbc.url}" />
			<property name="username" value="${jdbc.username}" />
			<property name="password" value="${jdbc.password}" />
			<property name="defaultAutoCommit" value="false" />
		</bean>
		<!-- 初始化数据表结构 -->
		<jdbc:initialize-database data-source="dataSource" ignore-failures="ALL">
			<jdbc:script location="classpath:sql/${db.type}/schema.sql" />
		</jdbc:initialize-database>
	</beans>
	<!-- unit test环境 -->
	<beans profile="test">
	 	<context:property-placeholder ignore-resource-not-found="true"
			location="classpath*:/application.properties,
          			  classpath*:/application.test.properties" />
		<!-- Spring Simple连接池 -->
		<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
			<property name="driverClass" value="${jdbc.driver}" />
			<property name="url" value="${jdbc.url}" />
			<property name="username" value="${jdbc.username}" />
			<property name="password" value="${jdbc.password}" />
		</bean>
		<!-- 初始化数据表结构 与默认数据-->
		<jdbc:initialize-database data-source="dataSource" ignore-failures="ALL">
			<jdbc:script location="classpath:sql/mysql/schema.sql" />
			<!-- jdbc:script location="classpath:data/h2/import-data.sql" encoding="UTF-8"/ -->
		</jdbc:initialize-database>
	</beans>
          			  classpath*:/application.functional-local.properties"/>
        <!-- Tomcat JDBC连接池 -->
        <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
            <property name="driverClassName" value="${jdbc.driver}"/>
            <property name="url" value="${jdbc.url}"/>
            <property name="username" value="${jdbc.username}"/>
            <property name="password" value="${jdbc.password}"/>
            <property name="defaultAutoCommit" value="false"/>
        </bean>
        <!-- 初始化数据表结构 -->
        <jdbc:initialize-database data-source="dataSource" ignore-failures="ALL">
            <jdbc:script location="classpath:sql/${db.type}/schema.sql"/>
        </jdbc:initialize-database>
    </beans>
    <!-- unit test环境 -->
    <beans profile="test">
        <context:property-placeholder ignore-resource-not-found="true"
                                      location="classpath*:/application.properties,
          			  classpath*:/application.test.properties"/>
        <!-- Spring Simple连接池 -->
        <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
            <property name="driverClass" value="${jdbc.driver}"/>
            <property name="url" value="${jdbc.url}"/>
            <property name="username" value="${jdbc.username}"/>
            <property name="password" value="${jdbc.password}"/>
        </bean>
        <!-- 初始化数据表结构 与默认数据-->
        <jdbc:initialize-database data-source="dataSource" ignore-failures="ALL">
            <jdbc:script location="classpath:sql/mysql/schema.sql"/>
            <!-- jdbc:script location="classpath:data/h2/import-data.sql" encoding="UTF-8"/ -->
        </jdbc:initialize-database>
    </beans>
</beans>

+ 13 - 12
patient-co-wlyy/src/main/webapp/WEB-INF/spring-mvc.xml

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:task="http://www.springframework.org/schema/task"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd">
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:task="http://www.springframework.org/schema/task"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
	   xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
		 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
		 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
	<!-- 自动扫描且只扫描@Controller -->
	<context:component-scan base-package="com.yihu.wlyy" use-default-filters="false">
	<context:component-scan base-package="com.yihu.wlyy" >
		<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
		<context:include-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/>
	</context:component-scan>
	<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"> </aop:aspectj-autoproxy>
	<task:annotation-driven />
    <mvc:resources mapping="swagger-ui.html" location="classpath:/META-INF/resources/"/>
@ -75,7 +76,7 @@
			<value>4096</value>
		</property>
	</bean>
	
	<mvc:interceptors>
		<mvc:interceptor>
	        <mvc:mapping path="/patient/**"/>
@ -90,5 +91,5 @@
	        <bean class="com.yihu.wlyy.interceptors.UserInterceptor"/>
	    </mvc:interceptor>
	</mvc:interceptors>
    
</beans>