Просмотр исходного кода

申诉,意见反馈接口开发

chenyongxing 8 лет назад
Родитель
Сommit
854d3b73e5

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

@ -44,18 +44,6 @@ public class DoctorFeedbackController extends BaseController {
            @RequestParam(required = false) String images,
            @RequestParam(required = false) String contact) {
        try {
            //if (StringUtils.isNotEmpty(contact)) {
            //    //        邮箱正则|QQ号|手机号正则
            //    String regexEmail = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
            //    String regexQQ = "^[1-9][0-9]{4,}$";
            //    String regexPhone = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
            //    Boolean emailFlag = Pattern.matches(regexEmail, contact);
            //    Boolean qqFlag = Pattern.matches(regexQQ, contact);
            //    Boolean phoneFlag = Pattern.matches(regexPhone, contact);
            //    if (emailFlag || qqFlag || phoneFlag) {
            //        return write(-1, "QQ/邮箱格式错误!");
            //    }
            //}
//        图片上传
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
@ -87,20 +75,13 @@ public class DoctorFeedbackController extends BaseController {
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
        try {
//        手机号正则
//            String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
//            if (Pattern.matches(regex, phone)) {
//        图片上传
                if (StringUtils.isNotEmpty(images)) {
                    images = CommonUtil.copyTempImage(images);
                }
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
            }
//             保存到数据库
                appealService.saveAppeal(getUID(),description,type,images,phone,2);
                return write(200, "保存成功!");
            //} else {
            //    return write(-1, "手机号码有误!");
            //}
            appealService.saveAppeal(getUID(),description,type,images,phone,2);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");

+ 5 - 23
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientFeedbackController.java

@ -44,18 +44,6 @@ public class PatientFeedbackController extends BaseController {
            @RequestParam(required = false) String images,
            @RequestParam(required = false) String contact) {
        try {
            //if (StringUtils.isNotEmpty(contact)) {
            //    //        邮箱正则|QQ号正则|手机号正则
            //    String regexEmail = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
            //    String regexQQ = "^[1-9][0-9]{4,}$";
            //    String regexPhone = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
            //    Boolean emailFlag = Pattern.matches(regexEmail, contact);
            //    Boolean qqFlag = Pattern.matches(regexQQ, contact);
            //    Boolean phoneFlag = Pattern.matches(regexPhone, contact);
            //    if (emailFlag || qqFlag || phoneFlag) {
            //        return write(-1, "QQ/邮箱/手机号格式错误!");
            //    }
            //}
//        图片上传
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
@ -88,19 +76,13 @@ public class PatientFeedbackController extends BaseController {
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
        try {
//        手机号正则
//            String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
//            if (Pattern.matches(regex, phone)) {
//        图片上传
                if (StringUtils.isNotEmpty(images)) {
                    images = CommonUtil.copyTempImage(images);
                }
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
            }
//             保存到数据库
                appealService.saveAppeal(getUID(),description,type,images,phone,1);
                return write(200, "保存成功!");
            //} else {
            //    return write(-1, "手机号码有误!");
            //}
            appealService.saveAppeal(getUID(),description,type,images,phone,1);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");