chenweida преди 7 години
родител
ревизия
303d70d91b
променени са 21 файла, в които са добавени 109 реда и са изтрити 567 реда
  1. 8 79
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  2. 0 150
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/RegisterController.java
  3. 7 190
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java
  4. 0 33
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/advert/AdvertController.java
  5. 2 24
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/data/DataController.java
  6. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/device/DeviceController.java
  7. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/district/DistrictController.java
  8. 60 52
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/health/FoodCompController.java
  9. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/health/HealthEduArticlesController.java
  10. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalCommonController.java
  11. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java
  12. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java
  13. 12 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/qrcode/QrCodeController.java
  14. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/sms/SMSController.java
  15. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/system/SystemDictController.java
  16. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/url/CudUrlController.java
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/CaptchaController.java
  18. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java
  19. 0 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/WlyySerivceController.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/verified/VerifiedController.java
  21. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/version/VersionController.java

+ 8 - 79
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -45,7 +45,7 @@ import java.util.List;
 * @author calvin
 */
@Controller
@RequestMapping(value = "/login", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/login", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者、医生及管理员登录")
public class LoginController extends BaseController {
@ -74,7 +74,7 @@ public class LoginController extends BaseController {
     *
     * @return
     */
    @RequestMapping(value = "public_key")
    @RequestMapping(value = "public_key",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String publicKey() {
        try {
@ -93,38 +93,6 @@ public class LoginController extends BaseController {
        }
    }
    // @RequestMapping(value = "testPush")
    // @ResponseBody
    // public String testPush(String receiver, String type, String title, String msg, String data) throws JSONException, InterruptedException {
    // PushMsgTask.getInstance().put(receiver, type, title, msg, data);
    // return "OK";
    // }
    //
    // @RequestMapping(value = "test_public_key")
    // @ResponseBody
    // public String testPublicKey(String str) {
    // try {
    // String modulus = RSAUtils.getInstance(smsService).getModulus();
    // String exponent = RSAUtils.getInstance(smsService).getExponent();
    //
    // String temp = RSAUtils.getInstance(smsService).decryptStringByJs(str);
    // System.out.println(temp);
    // temp = URLDecoder.decode(temp, "UTF-8");
    // System.out.println(temp);
    //
    // if (StringUtils.isEmpty(modulus) || StringUtils.isEmpty(exponent)) {
    // return error(-1, "公钥获取失败!");
    // } else {
    // JSONObject json = new JSONObject();
    // json.put("modulus", modulus);
    // json.put("exponent", exponent);
    // return write(200, "公钥获取成功!", "data", json);
    // }
    // } catch (Exception e) {
    // return error(-1, "公钥获取失败!");
    // }
    // }
    /**
     * 医生登录接口
     *
@ -135,7 +103,7 @@ public class LoginController extends BaseController {
     * @param password 密码
     * @return
     */
    @RequestMapping(value = "doctor")
    @RequestMapping(value = "doctor",method = RequestMethod.POST)
    @ResponseBody
    public String doctor(@RequestParam(required = false) String mobile,
                         @RequestParam(required = false) String captcha,
@ -282,7 +250,7 @@ public class LoginController extends BaseController {
     * @param newpwd  新密码
     * @return
     */
    @RequestMapping(value = "forgetpwd")
    @RequestMapping(value = "forgetpwd",method = RequestMethod.POST)
    @ResponseBody
    public String forgetpwd(int type,
                            @RequestParam(required = false) String idcard,
@ -343,7 +311,7 @@ public class LoginController extends BaseController {
     * @param type 1患者,2医生,3微信公众号
     * @return
     */
    @RequestMapping(value = "exit")
    @RequestMapping(value = "exit",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String logout(int type) {
        try {
@ -355,7 +323,7 @@ public class LoginController extends BaseController {
        }
    }
    @RequestMapping(value = "/third/login")
    @RequestMapping(value = "/third/login",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String thirdLogin(
            @RequestParam(value = "id") int id,
@ -410,19 +378,6 @@ public class LoginController extends BaseController {
        }
    }
    // public String getLoginInfo()
    // {
    // try{
    // Token token = SystemData.doctorTokens.get(tokenStr);
    // return "";
    // }
    // catch(Exception ex)
    // {
    // error(ex);
    // return error(-1, "系统异常,操作失败");
    // }
    // }
    /**
     * 验证码地址
     *
@ -430,7 +385,7 @@ public class LoginController extends BaseController {
     * @param response
     * @throws IOException
     */
    @RequestMapping("pcrimg")
    @RequestMapping(value="pcrimg",method = {RequestMethod.POST,RequestMethod.GET})
    public void crimg(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ConfigurableCaptchaService cs = new ConfigurableCaptchaService();
        cs.setColorFactory(new SingleColorFactory(new Color(25, 60, 170)));
@ -471,39 +426,13 @@ public class LoginController extends BaseController {
        response.setDateHeader("Expires", time);
    }
    // @RequestMapping(value = "test_sms")
    // @ResponseBody
    // public String testSms() {
    // try {
    // JSONObject params = new JSONObject();
    // params.put("SpCode", SystemConf.SMS_SP_CODE);
    // params.put("LoginName", SystemConf.SMS_LOGIN_NAME);
    // params.put("Password", SystemConf.SMS_PASSWORD);
    // params.put("MessageContent", "您的找回密码验证码为:123456");
    // params.put("UserNumber", "18559687019");
    // params.put("SerialNumber", "");
    // params.put("ScheduleTime", "");
    // params.put("f", 1);
    // String result = HttpClientUtil.post(SystemConf.SMS_URL, SMSService.buildSmsParams("您的找回密码验证码为:123456", "18559687019"), "GBK");
    // JSONObject json = SMSService.toJson(result);
    // System.out.println(json.toString());
    // System.out.println(json.getInt("result"));
    // if (json.getInt("result") != 0) {
    // return error(-1, "短信发送失败!");
    // }
    // return success("短信发送成功!");
    // } catch (Exception e) {
    // error(e);
    // return error(-1, "短信发送失败!");
    // }
    // }
    /**
     * 患者,医生注册-验证手机号
     *
     * @param mobile 登录手机号
     * @return
     */
    @RequestMapping(value = "checkmobile")
    @RequestMapping(value = "checkmobile",method = RequestMethod.POST)
    @ResponseBody
    public String checkmobile(@RequestParam(required = true,value = "mobile",defaultValue = "0")String mobile,
                              @RequestParam(required = true,value = "type",defaultValue = "0") int type) {

+ 0 - 150
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/RegisterController.java

@ -1,150 +0,0 @@
package com.yihu.wlyy.web.common.account;
//import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.yihu.wlyy.web.BaseController;
import org.springframework.web.bind.annotation.RequestMethod;
/**
 * 用户注册的Controller.
 * 
 * @author calvin
 */
@Controller
@RequestMapping(value = "/register",method = {RequestMethod.GET,RequestMethod.POST})
//@Api(description = "用户注册")
public class RegisterController extends BaseController {
	// @Autowired
	// private DoctorService doctorService;
//	@Autowired
//	private PatientService patientService;
//	@Autowired
//	private SMSService smsService;
	// /**
	// * 医生注册
	// * @param name 医生姓名
	// * @param mobile 登录手机号
	// * @param password 登录密码
	// * @param captcha 手机验证码
	// * @return
	// */
	// @RequestMapping(value = "doctor")
	// @ResponseBody
	// public String doctor(String name, String mobile, String password, String captcha) {
	// try {
	// if (doctorService.findDoctorByMobile(mobile) != null) {
	// return error(-1, "该手机号已被注册!");
	// }
	// Doctor doctor = new Doctor();
	// doctor.setName(name);
	// doctor.setMobile(mobile);
	// doctor.setPassword(password);
	// JSONObject json = doctorService.registerDoctor(doctor, getIMEI());
	// if (json != null) {
	// // 注册成功
	// return write(200, "注册成功!", "data", json);
	// } else {
	// // 注册失败
	// return error(-1, "注册失败!");
	// }
	// } catch (Exception e) {
	// error(e);
	// return error(-1, "注册失败!");
	// }
	// }
//	/**
//	 * 患者注册
//	 * @param name 姓名
//	 * @param idcard 身份證號
//	 * @param ssc 社保卡号
//	 * @param mobile 登录手机号
//	 * @param captcha 手机验证码
//	 * @param type 1校验,2保存
//	 * @return
//	 */
//	@RequestMapping(value = "patient")
//	@ResponseBody
//	public String patient(String name, String idcard, String ssc, String mobile, String captcha, int type) {
//		try {
//			if (type != 1 && type != 2) {
//				return error(-1, "无效请求!");
//			}
//			if (StringUtils.isEmpty(name)) {
//				return error(-1, "姓名不允许为空!");
//			}
//			if (StringUtils.isEmpty(idcard)) {
//				return error(-1, "身份证号码不允许为空!");
//			}
//			if (StringUtils.isEmpty(ssc)) {
//				return error(-1, "社保卡号不允许为空!");
//			}
//			if (StringUtils.isEmpty(mobile)) {
//				return error(-1, "手机号码不允许为空!");
//			}
//			if (StringUtils.isEmpty(captcha)) {
//				return error(-1, "验证码不允许为空!");
//			}
//			if (StringUtils.isNotEmpty(getOpenid())) {
//				Patient patient = patientService.findByOpenid(getOpenid());
//				if (patient != null) {
//					return error(-1, "当前微信号已绑定身份证:" + CommonUtil.getIdcardEncode(patient.getIdcard()) + " !");
//				}
//			}
//			// 对验证码进行校验
//			int res = smsService.check(mobile, 1, captcha);
//			switch (res) {
//			case -2:
//				return error(-1, "验证码已过期!");
//			case -1:
//				return error(-1, "请输入正确的验证码!");
//			case 0:
//				return error(-1, "验证码无效!");
//			}
//			// 解密身份证号
//			idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
//			idcard = URLDecoder.decode(idcard, "UTF-8");
//			idcard = StringUtils.reverse(idcard);
//			// 判断用户是否已注册
//			Patient patient = patientService.findByIdcard(idcard);
//			if (patient != null) {
//				return error(-1, "该帐号已绑定手机号" + CommonUtil.getMobileEncode(patient.getMobile()) + ",请直接使用此手机号登录");
//			}
//			patient = patientService.findBySsc(ssc);
//			if (patient != null) {
//				return error(-1, "该帐号已绑定手机号" + CommonUtil.getMobileEncode(patient.getMobile()) + ",请直接使用此手机号登录");
//			}
//			patient = patientService.findByMobile(mobile);
//			if (patient != null) {
//				return error(-1, "该手机号码已绑定其他身份证和医保卡,建议您重新输入新手机号码");
//			}
//			if (type == 2) {
//				patient = new Patient();
//				patient.setIdcard(idcard);
//				patient.setMobile(mobile);
//				patient.setName(name);
//				patient.setSsc(ssc);
//				patient.setOpenid(getOpenid());
//				JSONObject json = patientService.register(patient, getIMEI(), 1);
//				if (json != null) {
//					// 注册成功
//					return write(200, "注册成功!", "data", json);
//				} else {
//					// 注册失败
//					return error(-1, "注册失败!");
//				}
//			} else {
//				return success("验证通过!");
//			}
//		} catch (Exception e) {
//			error(e);
//			return error(-1, "注册失败!");
//		}
//	}
}

+ 7 - 190
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -39,7 +39,7 @@ import java.util.*;
 * @author calvin
 */
@Controller
@RequestMapping(value = "/weixin", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/weixin", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "微信端用户注册")
public class WechatController extends WeixinBaseController {
@ -68,28 +68,6 @@ public class WechatController extends WeixinBaseController {
    @Autowired
    private PushMsgTask pushMsgTask;
    /**
     * 患者注册-验证手机号
     *
     * @param phone 登录手机号
     * @return
     */
    @RequestMapping(value = "checkmobile")
    @ResponseBody
    public String checkmobile(String phone) {
        try {
            /**modify by linz 2017年2月28日10:11:49 校验手机号码的时候返回使用此号码的所有人员**/
            List<Patient> temp = patientService.findByMobile(phone);
            if (temp != null && temp.size() > 0) {
                // 设置身份证号
                return write(200, "患者信息查询成功!", "data", temp);
            }
            return error(1, "该手机号未被注册");
        } catch (Exception e) {
            error(e);
            return error(-1, "手机号验证失败");
        }
    }
    /**
     * 获取验证码发送的手机号码
@ -97,7 +75,7 @@ public class WechatController extends WeixinBaseController {
     * @param idCard
     * @return
     */
    @RequestMapping(value = "getMobile")
    @RequestMapping(value = "getMobile",method = RequestMethod.POST)
    @ResponseBody
    public String getPatientInfoByIdCard(@RequestParam(value = "idCard", required = true) String idCard) {
        Patient temp = patientService.findByIdcard(idCard);
@ -117,51 +95,6 @@ public class WechatController extends WeixinBaseController {
    }
    /**
     * 患者注册-验证身份证
     *
     * @param idcard 身份證號
     * @param mobile 登录手机号
     * @return
     */
    @RequestMapping(value = "checkidcard")
    @ResponseBody
    public String checkidcard(String idcard, String mobile) {
        try {
            // 解密身份证号
            idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = StringUtils.reverse(idcard);
            Patient temp = patientService.findByIdcard(idcard);
            if (temp != null) {
                JSONObject json = new JSONObject();
                // 设置患者标识
                json.put("code", temp.getCode());
                // 设置手机号码
                json.put("mobile", temp.getMobile());
                // 设置身份证号
                json.put("idcard", temp.getIdcard());
                return write(1, "患者信息查询成功!", "data", json);
            } else {
                List<Patient> temp1 = patientService.findByMobile(mobile);
                if (temp1 != null && temp1.size() > 0) {
                    //JSONObject json = new JSONObject();
                    // 设置患者标识
                    //json.put("code", temp1.getCode());
                    //// 设置手机号码
                    //json.put("mobile", temp1.getMobile());
                    //// 设置身份证号
                    //json.put("idcard", temp1.getIdcard());
                    return write(2, "患者信息查询成功!", "data", temp1);
                }
            }
            return success("该身份证和手机号未被注册");
        } catch (Exception e) {
            error(e);
            return error(-1, "身份证验证失败");
        }
    }
    /**
     * 注册信息验证
     *
@ -171,7 +104,7 @@ public class WechatController extends WeixinBaseController {
     * @param mobile 手机号
     * @return
     */
    @RequestMapping(value = "/check_regist_info")
    @RequestMapping(value = "/check_regist_info",method = RequestMethod.POST)
    @ResponseBody
    public String checkRegistInfo(String name, String idcard, String ssc, String mobile) {
        try {
@ -241,7 +174,7 @@ public class WechatController extends WeixinBaseController {
     * @param captcha 手机验证码
     * @return
     */
    @RequestMapping(value = "regist")
    @RequestMapping(value = "regist",method = RequestMethod.POST)
    @ResponseBody
    public String regist(@RequestParam(value = "name", required = true) String name,
                         @RequestParam(value = "idcard", required = true) String idcard,
@ -366,7 +299,7 @@ public class WechatController extends WeixinBaseController {
     * @param password 登录密码
     * @return
     */
    @RequestMapping(value = "login")
    @RequestMapping(value = "login",method = RequestMethod.POST)
    @ResponseBody
    public String login(
            @RequestParam(required = false) String mobile,
@ -563,7 +496,7 @@ public class WechatController extends WeixinBaseController {
     * @param pageUrl 需要签名的页面全地址(?后的也需要除了#后的不需要)
     * @return
     */
    @RequestMapping(value = "getSign")
    @RequestMapping(value = "getSign",method = RequestMethod.POST)
    @ResponseBody
    public String getSign(String pageUrl) {
        try {
@ -590,98 +523,6 @@ public class WechatController extends WeixinBaseController {
        return error(-1, "获取签名失败");
    }
    /**
     * 发送微信签约成功的消息
     *
     * @param code 患者编号
     * @return
     */
    @RequestMapping(value = "sendSign")
    @ResponseBody
    public String sendSignSucess(String code) {
        try {
            Patient patient = patientService.findByCode(code);
            JSONObject json = new JSONObject();
            json.put("first", "开始");
            json.put("remark", "指导备注");
            json.put("date", "2016-06-08");
            json.put("doctorName", "徐小鹏");
            json.put("orgName", "厦门第一医院");
            //判断是否判定openId,有没有发则查找家人发送
            if (StringUtils.isNotBlank(patient.getOpenid())) {
                // 添加到发送队列
                pushMsgTask.putWxMsg(getAccessToken(), 5, patient.getOpenid(), patient.getName(), json);
            } else {
                JSONObject j = weiXinOpenIdUtils.getFamilyOpenId(patient.getCode());
                Patient member = (Patient) j.get("member");
                if (StringUtils.isNotBlank(member.getOpenid())) {
                    String first = (String) json.get("first");
                    json.remove("first");
                    json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.getInt("relation"), patient.getName()) + first);
                    pushMsgTask.putWxMsg(getAccessToken(), 5, member.getOpenid(), patient.getName(), json);
                }
            }
            return write(200, "发送成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "发送失败");
        }
    }
    /**
     * 获取微信用户身份
     * @param code
     * @return
     */
    // @RequestMapping(value = "identity")
    // @ResponseBody
    // public String identity(String code) {
    // try {
    // String openid = getOpenid();
    // if(StringUtils.isEmpty(openid)){
    // openid = getOpenidByCode(code);
    // }
    // if (StringUtils.isEmpty(openid)) {
    // return error(-1, "获取openid异常!");
    // }
    // JSONObject userAgent = new JSONObject();
    // Patient patient = patientService.findByOpenid(openid);
    // long id = 0;
    // String uid = "";
    // String name = "";
    // String photo = "";
    // String tokenStr = "";
    // if (patient != null) {
    // id = patient.getId();
    // uid = patient.getCode();
    // name = patient.getName();
    // photo = patient.getPhoto();
    // // 查询token
    // Token token = SystemData.wxPatientTokens.get(patient.getCode());
    // if (token == null) {
    // // 从数据库加载
    // token = tokenService.findWxToken(patient.getCode());
    // }
    // if (token == null) {
    // // 生成新的token
    // token = tokenService.newTxToken(patient.getCode(), openid);
    // }
    // tokenStr = token.getToken();
    // }
    // userAgent.put("id", id);
    // userAgent.put("uid", uid);
    // userAgent.put("openid", openid);
    // userAgent.put("name", name);
    // userAgent.put("photo", photo);
    // userAgent.put("token", tokenStr);
    // return write(200, "获取身份信息成功!", "data", userAgent);
    // } catch (Exception e) {
    // error(e);
    // return error(-1, "获取身份信息失败!");
    // }
    // }
    /**
     * 获取微信openid
@ -689,7 +530,7 @@ public class WechatController extends WeixinBaseController {
     * @param code
     * @return
     */
    @RequestMapping(value = "getOpenidByCode")
    @RequestMapping(value = "getOpenidByCode",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String getOpenidByCode(String code) {
        try {
@ -705,29 +546,5 @@ public class WechatController extends WeixinBaseController {
        }
    }
    /**
     * 判断是否关注
     *
     * @param openid
     * @return
     */
    @RequestMapping(value = "/is_subscribe")
    @ResponseBody
    public String getIsSubscribe(String openid) {
        try {
            String userInfo_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + getAccessToken() + "&openid=" + openid + "&lang=zh_CN";
            String params = "";
            String result = HttpUtil.sendGet(userInfo_url, params);
            JSONObject json = new JSONObject(result);
            if (json.has("subscribe")) {
                return write(200, "查询成功", "subsribe", json.get("subscribe").toString());
            } else {
                return error(-1, json.getString("errmsg"));
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 0 - 33
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/advert/AdvertController.java

@ -1,33 +0,0 @@
package com.yihu.wlyy.web.common.advert;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.service.common.advert.AdvertService;
import com.yihu.wlyy.web.BaseController;
@Controller
@RequestMapping(value = "common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@Api(description = "广告")
public class AdvertController extends BaseController {
	
	@Autowired
	private AdvertService advertService;
	@RequestMapping(value = "advert")
	@ResponseBody
	public String list(int type) {
		try {
			return write(200, "查询成功", "list" , advertService.findByType(type));
		} catch (Exception e) {
			error(e);
			return error(-1, "查询失败");
		}
	}
}

+ 2 - 24
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/data/DataController.java

@ -16,7 +16,7 @@ import com.yihu.wlyy.entity.dict.Disease;
import com.yihu.wlyy.service.common.data.DataService;
import com.yihu.wlyy.web.BaseController;
@RequestMapping(value = "/common/data", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common/data", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Controller
@Api(description = "疾病与社区")
public class DataController extends BaseController {
@ -24,7 +24,7 @@ public class DataController extends BaseController {
	@Autowired
	private DataService dataService;
	@RequestMapping(value = "diseases")
	@RequestMapping(value = "diseases",method = RequestMethod.POST)
	@ResponseBody
	public String diseases() {
		try {
@ -46,26 +46,4 @@ public class DataController extends BaseController {
		}
	}
	@RequestMapping(value = "diseases_community")
	@ResponseBody
	public String diseasesCommunity() {
		try {
			JSONArray array = new JSONArray();
			List<Disease> list = dataService.findAllDisease();
			for (Disease temp : list) {
				if (temp == null) {
					continue;
				}
				JSONObject json = new JSONObject();
				json.put("code", temp.getCode());
				json.put("name", temp.getName() + "社区");
				array.put(json);
			}
			return write(200, "获取疾病社区成功!", "list", array);
		} catch (Exception e) {
			error(e);
			return error(-1, "获取疾病社区失败!");
		}
	}
}

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/device/DeviceController.java

@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(value = "/common/device", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common/device", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "设备管理")
public class DeviceController extends BaseController {
	
@ -24,7 +24,7 @@ public class DeviceController extends BaseController {
	@ApiOperation("获取设备分类")
	@RequestMapping(value = "DeviceCategory")
	@RequestMapping(value = "DeviceCategory",method = RequestMethod.POST)
	@ResponseBody
	public String getDeviceCategory() {
		try {
@ -37,7 +37,7 @@ public class DeviceController extends BaseController {
	}
	@ApiOperation("获取设备列表")
	@RequestMapping(value = "DeviceList")
	@RequestMapping(value = "DeviceList",method = RequestMethod.POST)
	@ResponseBody
	public String getDeviceList(@ApiParam(name="category_code",value="设备类型代码",defaultValue = "1")
								 @RequestParam(value="category_code",required = true) String categoryCode) {
@ -51,7 +51,7 @@ public class DeviceController extends BaseController {
	}
	@ApiOperation("获取设备信息")
	@RequestMapping(value = "DeviceInfo")
	@RequestMapping(value = "DeviceInfo",method = RequestMethod.POST)
	@ResponseBody
	public String getDeviceInfo(@ApiParam(name="id",value="设备ID",defaultValue = "19")
									   @RequestParam(value="id",required = true) String id) {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/district/DistrictController.java

@ -19,7 +19,7 @@ import com.yihu.wlyy.web.BaseController;
 *
 */
@Controller
@RequestMapping(value = "common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "省市区三级地址")
public class DistrictController extends BaseController {
@ -32,7 +32,7 @@ public class DistrictController extends BaseController {
	 * @param code 省或市标识
	 * @return
	 */
	@RequestMapping(value = "district")
	@RequestMapping(value = "district",method = RequestMethod.POST)
	@ResponseBody
	public String district(int type, String code) {
		try {

+ 60 - 52
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/health/FoodCompController.java

@ -4,6 +4,7 @@ import com.yihu.wlyy.entity.education.FoodComp;
import com.yihu.wlyy.service.app.health.FoodCompService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -16,65 +17,72 @@ import java.util.List;
/**
 * 患者端:食物热量查询
 * @author George
 *
 * @author George
 */
@Controller
@RequestMapping(value = "/common/health/food", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common/health/food", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-食物热量查询")
public class FoodCompController extends BaseController {
	@Autowired
	private FoodCompService foodCompService;
    @Autowired
    private FoodCompService foodCompService;
    /**
     * 查询食物热量列表
     *
     * @param pid 父id
     * @return 列表
     */
    @ApiOperation("查询食物热量列表")
    @RequestMapping(value = "list", method = RequestMethod.POST)
    @ResponseBody
    public String list(@RequestParam("pid") long pid) {
        try {
            List<FoodComp> foodComps = foodCompService.getByPid(pid);
            return write(200, "查询成功", "list", foodComps);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, "查询失败!");
        }
    }
	/**
	 * 查询食物热量列表
	 * @param pid 父id
	 * @return 列表
	 */
	@RequestMapping(value = "list")
	@ResponseBody
	public String list(@RequestParam("pid")long pid) {
		try {
			List<FoodComp> foodComps = foodCompService.getByPid(pid);
			return write(200, "查询成功", "list", foodComps);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
    /**
     * 查询食物热量查询
     *
     * @param name 查询名称
     * @return 列表
     */
    @ApiOperation("查询食物热量查询")
    @RequestMapping(value = "search", method = RequestMethod.POST)
    @ResponseBody
    public String list(@RequestParam("name") String name) {
        try {
            List<FoodComp> foodComps = foodCompService.getByName(name);
            return write(200, "查询成功", "list", foodComps);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, "查询失败!");
        }
    }
	/**
	 * 查询食物热量查询
	 * @param name 查询名称
	 * @return 列表
	 */
	@RequestMapping(value = "search")
	@ResponseBody
	public String list(@RequestParam("name")String name) {
		try {
			List<FoodComp> foodComps = foodCompService.getByName(name);
			return write(200, "查询成功", "list", foodComps);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
	/**
	 * 查询食物热量详情
	 * @param id 查询名称
	 * @return 列表
	 */
	@RequestMapping(value = "detail")
	@ResponseBody
	public String list(@RequestParam("id")Long id) {
		try {
			FoodComp foodComp = foodCompService.getById(id);
			return write(200, "查询成功", "list", foodComp);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
    /**
     * 查询食物热量详情
     *
     * @param id 查询名称
     * @return 列表
     */
    @ApiOperation("查询食物热量详情")
    @RequestMapping(value = "detail", method = RequestMethod.POST)
    @ResponseBody
    public String list(@RequestParam("id") Long id) {
        try {
            FoodComp foodComp = foodCompService.getById(id);
            return write(200, "查询成功", "list", foodComp);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, "查询失败!");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/health/HealthEduArticlesController.java

@ -17,7 +17,7 @@ import java.util.Map;
 * Created by Reece on 2017/2/13.
 */
@Controller
@RequestMapping(value = "/common",method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common")
@Api(description = "获取福州健康教育文章并保存")
public class HealthEduArticlesController extends BaseController{

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalCommonController.java

@ -15,7 +15,7 @@ import java.util.List;
 * Created by lyr-pc on 2016/11/22.
 */
@RestController
@RequestMapping(value = "/hospitals",method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/hospitals")
@Api(description = "医院管理")
public class HospitalCommonController extends BaseController {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java

@ -21,7 +21,7 @@ import java.text.SimpleDateFormat;
import java.util.*;
@RestController
@RequestMapping(value = "im_new", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "im_new", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "IM-即时消息")
public class imController extends BaseController {
    @Autowired
@ -41,7 +41,7 @@ public class imController extends BaseController {
     * @param consult
     * @return
     */
    @RequestMapping(value = "/getTopic")
    @RequestMapping(value = "/getTopic",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String getTopic(String consult) {
        try {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java

@ -23,14 +23,14 @@ import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/im/common/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/im/common/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-消息")
public class ImMessageController extends BaseController {
    @Autowired
    private MessageService messageService;
    @RequestMapping(value = "messages")
    @RequestMapping(value = "messages",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages() {

+ 12 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/qrcode/QrCodeController.java

@ -23,7 +23,7 @@ import java.io.OutputStream;
 * Created by lyr on 2016/08/10.
 */
@Controller
@RequestMapping(value = "/qrcode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/qrcode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "二维码")
public class QrCodeController extends WeixinBaseController {
@ -32,7 +32,7 @@ public class QrCodeController extends WeixinBaseController {
    @Autowired
    private DoctorService doctorService;
    @RequestMapping(value = "/doctors")
    @RequestMapping(value = "/doctors",method = RequestMethod.POST)
    @ResponseBody
    public String makeDoctorQrcodes(String hospital) {
        try {
@ -52,7 +52,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor")
    @RequestMapping(value = "/doctor",method = RequestMethod.POST)
    @ResponseBody
    public String makeDoctorQrcode(String doctor) {
        try {
@ -72,7 +72,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @return
     */
    @RequestMapping(value = "/hospital")
    @RequestMapping(value = "/hospital",method = RequestMethod.POST)
    @ResponseBody
    public String makeHospitalQrcode(String hospital) {
        try {
@ -92,7 +92,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param town
     * @return
     */
    @RequestMapping(value = "/town")
    @RequestMapping(value = "/town",method = RequestMethod.POST)
    @ResponseBody
    public String makeTownQrcode(String town) {
        try {
@ -113,7 +113,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @param response
     */
    @RequestMapping(value = "/hospital_img")
    @RequestMapping(value = "/hospital_img",method = RequestMethod.POST)
    public void downloadSqQrcode(String hospital, HttpServletResponse response) {
        try {
            File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
@ -155,7 +155,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param town
     * @param response
     */
    @RequestMapping(value = "/town_img")
    @RequestMapping(value = "/town_img",method = RequestMethod.POST)
    public void downloadTownQrcode(String town, HttpServletResponse response) {
        try {
            File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
@ -197,7 +197,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @param response
     */
    @RequestMapping(value = "/download")
    @RequestMapping(value = "/download",method = RequestMethod.POST)
    public void downloadQrcode(String doctor, HttpServletResponse response) {
        try {
            Doctor doc = doctorService.findDoctorByCode(doctor);
@ -248,7 +248,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @param response
     */
    @RequestMapping(value = "/doctor_img")
    @RequestMapping(value = "/doctor_img",method = RequestMethod.POST)
    public void downloadQrcodeImage(String doctor, HttpServletResponse response) {
        try {
            System.out.println("------------------doctor:" + doctor);
@ -297,7 +297,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @param response
     */
    @RequestMapping(value = "/download/doctors")
    @RequestMapping(value = "/download/doctors",method = RequestMethod.POST)
    public void downloadQrcodes(String hospital, HttpServletResponse response) {
        try {
            File file = qrcodeService.downloadDoctorQrCodes(hospital, getAccessToken());
@ -332,7 +332,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param area
     * @param response
     */
    @RequestMapping(value = "/download/hospitals")
    @RequestMapping(value = "/download/hospitals",method = RequestMethod.POST)
    public void downloadSqQrcodes(String area, HttpServletResponse response) {
        try {
            File file = qrcodeService.downloadHospitalQrCodes(area, getAccessToken());
@ -367,7 +367,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param city
     * @param response
     */
    @RequestMapping(value = "/download/towns")
    @RequestMapping(value = "/download/towns",method = RequestMethod.POST)
    public void downloadTownQrcodes(String city, HttpServletResponse response) {
        try {
            File file = qrcodeService.downLoadTownQrcodes(city, getAccessToken());

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/sms/SMSController.java

@ -20,7 +20,7 @@ import com.yihu.wlyy.web.BaseController;
import java.util.List;
@Controller
@RequestMapping(value = "/common",method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common")
@Api(description = "短信")
public class SMSController extends BaseController {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/system/SystemDictController.java

@ -23,7 +23,7 @@ import java.util.List;
 */
@Controller
@RequestMapping(value = "/common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "系统字典")
public class SystemDictController extends BaseController {
    @Autowired

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/url/CudUrlController.java

@ -16,7 +16,7 @@ import java.util.Map;
 * Created by lyr-pc on 2017/1/17.
 */
@RestController
@RequestMapping(value = "/common/cud_url",method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/common/cud_url")
@Api("增删改路径查询")
public class CudUrlController extends BaseController {

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

@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentHashMap;
 */
@Api(description = "验证码")
@RestController
@RequestMapping(value = "/patient/captcha", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/patient/captcha", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class CaptchaController extends BaseController {
    private Map<String, String> captchaCache = new ConcurrentHashMap<>();
    private DefaultKaptcha captchaProducer = new DefaultKaptcha();

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

@ -26,7 +26,7 @@ import java.util.Date;
 * Created by lyr on 2016/09/13.
 */
@RestController
@RequestMapping(value = "/manage_util", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/manage_util", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "管理工具及后台任务控制")
public class ManagerUtilController extends BaseController {

+ 0 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/WlyySerivceController.java

@ -323,11 +323,4 @@ public class WlyySerivceController extends BaseController{
            return  re;
        }
        public static Date getDateAfter(Date d, int day) {
            Calendar now = Calendar.getInstance();
            now.setTime(d);
            now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
            return now.getTime();
      }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/verified/VerifiedController.java

@ -25,7 +25,7 @@ import java.text.SimpleDateFormat;
import java.util.*;
@Controller
@RequestMapping(value = "/verified", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/verified", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "实名认证")
public class VerifiedController extends BaseController {

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/version/VersionController.java

@ -19,7 +19,7 @@ import com.yihu.wlyy.web.BaseController;
 *
 */
@Controller
@RequestMapping(value = "/version", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/version", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "版本")
public class VersionController extends BaseController {
@ -32,7 +32,7 @@ public class VersionController extends BaseController {
	 * @param version 当前版本号
	 * @return
	 */
	@RequestMapping(value = "app")
	@RequestMapping(value = "app",method = RequestMethod.POST)
	@ResponseBody
	public String appVersion(String code, double version) {
		try {