| @@ -118,7 +118,7 @@ public class WxCarController extends BaseController | |||||
| if (StringUtils.isBlank(merchantIdStr)) { | if (StringUtils.isBlank(merchantIdStr)) { | ||||
| // 优先从从商户表里取 | // 优先从从商户表里取 | ||||
| logger.error("quanTemplate failed, merchantId为空"); | logger.error("quanTemplate failed, merchantId为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -85,15 +85,15 @@ public class WxMerchantBUserController extends BaseController | |||||
| String pwd=params.get("pwd"); | String pwd=params.get("pwd"); | ||||
| boolean blank = StringUtils.isBlank(phone); | boolean blank = StringUtils.isBlank(phone); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(code); | blank = StringUtils.isBlank(code); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(pwd); | blank = StringUtils.isBlank(pwd); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| } | } | ||||
| return wxMerchantBUserService.updatepwd(phone,code,pwd); | return wxMerchantBUserService.updatepwd(phone,code,pwd); | ||||
| @@ -35,7 +35,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | logger.error("couponOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| Long couponOrderId = 0L; | Long couponOrderId = 0L; | ||||
| try { | try { | ||||
| @@ -43,7 +43,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| couponOrderId = 0L; | couponOrderId = 0L; | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| try { | try { | ||||
| ResultData rd = wxCouponOrderService.verify(couponOrderId, getUser().getId()); | ResultData rd = wxCouponOrderService.verify(couponOrderId, getUser().getId()); | ||||
| @@ -64,14 +64,14 @@ public class WxCouponOrderController extends BaseController { | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | logger.error("couponOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| Long couponOrderId = 0L; | Long couponOrderId = 0L; | ||||
| try { | try { | ||||
| couponOrderId = Long.valueOf(couponOrderIdStr); | couponOrderId = Long.valueOf(couponOrderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| try { | try { | ||||
| ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId()); | ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId()); | ||||
| @@ -110,7 +110,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | logger.error("couponOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| Long couponOrderId = 0L; | Long couponOrderId = 0L; | ||||
| try { | try { | ||||
| @@ -118,7 +118,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| couponOrderId = 0L; | couponOrderId = 0L; | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId)); | return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId)); | ||||
| } | } | ||||
| @@ -95,10 +95,10 @@ public class WxMerchantBUserController extends BaseController | |||||
| String longitude = map.get("longitude"); | String longitude = map.get("longitude"); | ||||
| //登录凭证不能为空 | //登录凭证不能为空 | ||||
| if (StringUtils.isBlank(phone)) { | if (StringUtils.isBlank(phone)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "手机号不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(password)) { | if (StringUtils.isBlank(password)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "密码不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空"); | |||||
| } | } | ||||
| String token = null; | String token = null; | ||||
| @@ -113,11 +113,24 @@ public class WxMerchantBUserController extends BaseController | |||||
| user.setAppId(appId); | user.setAppId(appId); | ||||
| user.setPhone(phone); | user.setPhone(phone); | ||||
| Date currentDate = new Date(); | |||||
| try { | try { | ||||
| WxMerchantBUser user1 = wxMerchantBUserService.getBUserByAppId(user); | WxMerchantBUser user1 = wxMerchantBUserService.getBUserByAppId(user); | ||||
| if (user1 != null) { | if (user1 != null) { | ||||
| // check merchant 状态 | |||||
| WxMerchant merchant = wxMerchantService.getById(user1.getMerchantId()); | |||||
| if (merchant == null) { | |||||
| logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage( ) + ": " + user1.getMerchantId()); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| } | |||||
| if (!merchant.isValid()) { | |||||
| logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage( ) + ": " + user1.getMerchantId()); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); | |||||
| } | |||||
| // check password | |||||
| if (user1.getBUserPwd().equalsIgnoreCase(password)) { | if (user1.getBUserPwd().equalsIgnoreCase(password)) { | ||||
| user1.createToken(new Date()); | |||||
| user1.createToken(currentDate); | |||||
| token = user1.getToken(); | token = user1.getToken(); | ||||
| wxMerchantBUserService.saveOrUpdate(user1); | wxMerchantBUserService.saveOrUpdate(user1); | ||||
| resultMap.put("token", token); | resultMap.put("token", token); | ||||
| @@ -145,15 +158,15 @@ public class WxMerchantBUserController extends BaseController | |||||
| String pwd=params.get("pwd"); | String pwd=params.get("pwd"); | ||||
| boolean blank = StringUtils.isBlank(phone); | boolean blank = StringUtils.isBlank(phone); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(code); | blank = StringUtils.isBlank(code); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(pwd); | blank = StringUtils.isBlank(pwd); | ||||
| if(blank){ | if(blank){ | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| } | } | ||||
| return wxMerchantBUserService.updatepwd(phone,code,pwd); | return wxMerchantBUserService.updatepwd(phone,code,pwd); | ||||
| @@ -62,13 +62,13 @@ public class WxOrderController extends BaseController { | |||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(couponIdStr)) { | if (StringUtils.isBlank(couponIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| } | } | ||||
| Long couponOrderId = 0L, orderId = 0L, couponId = 0L; | Long couponOrderId = 0L, orderId = 0L, couponId = 0L; | ||||
| try { | try { | ||||
| @@ -94,7 +94,7 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| try { | try { | ||||
| @@ -40,18 +40,18 @@ public class WxRefundOrderController extends BaseController { | |||||
| String payOrderIdStr = paramMap.get("payOrderId"); | String payOrderIdStr = paramMap.get("payOrderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| logger.error("orderId不能为空: " + paramMap.toString()); | logger.error("orderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| if (StringUtils.isBlank(payOrderIdStr)) { | if (StringUtils.isBlank(payOrderIdStr)) { | ||||
| logger.error("payOrderId不能为空: " + paramMap.toString()); | logger.error("payOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("orderId参数不正确: " + paramMap.toString()); | logger.error("orderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| WxRefundOrder refundOrder = new WxRefundOrder(); | WxRefundOrder refundOrder = new WxRefundOrder(); | ||||
| refundOrder.setPayOrderNo(payOrderIdStr); | refundOrder.setPayOrderNo(payOrderIdStr); | ||||
| @@ -3,10 +3,8 @@ package com.simple.interceptor; | |||||
| import com.simple.annotation.AuthIgnore; | import com.simple.annotation.AuthIgnore; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.domain.po.WxCUser; | |||||
| import com.simple.domain.po.WxMerchantBUser; | import com.simple.domain.po.WxMerchantBUser; | ||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.service.WxCUserService; | |||||
| import com.simple.service.WxMerchantBUserService; | import com.simple.service.WxMerchantBUserService; | ||||
| import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -53,14 +51,14 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| //token为空 | //token为空 | ||||
| if(StringUtils.isBlank(token)){ | if(StringUtils.isBlank(token)){ | ||||
| throw new MallinkException(ErrorCode.TOKEN_EMPTY); | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY); | |||||
| } | } | ||||
| ///// TODO use b端用户表 | ///// TODO use b端用户表 | ||||
| // 查询token信息 | // 查询token信息 | ||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getByToken(token); | WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getByToken(token); | ||||
| if(wxMerchantBUser == null || wxMerchantBUser.getExpireTime().getTime() < System.currentTimeMillis()){ | if(wxMerchantBUser == null || wxMerchantBUser.getExpireTime().getTime() < System.currentTimeMillis()){ | ||||
| throw new MallinkException(ErrorCode.TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| } | } | ||||
| //设置userId到request里,后续根据userId,获取用户信息 | //设置userId到request里,后续根据userId,获取用户信息 | ||||
| @@ -81,7 +81,7 @@ public class WxCarController extends BaseController | |||||
| String phone = paramMap.get("phone"); | String phone = paramMap.get("phone"); | ||||
| if (StringUtils.isBlank(phone)) { | if (StringUtils.isBlank(phone)) { | ||||
| logger.error("手机号为空"); | logger.error("手机号为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "phone为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "phone为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -205,12 +205,12 @@ public class WxCarController extends BaseController | |||||
| String etcpToken = paramMap.get("etcpToken"); | String etcpToken = paramMap.get("etcpToken"); | ||||
| if (StringUtils.isBlank(etcpToken)) { | if (StringUtils.isBlank(etcpToken)) { | ||||
| logger.error("etcpToken为空"); | logger.error("etcpToken为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | } | ||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| logger.error("carNumber为空"); | logger.error("carNumber为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -244,17 +244,17 @@ public class WxCarController extends BaseController | |||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| logger.error("carNumber为空"); | logger.error("carNumber为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| String carNumColor = paramMap.get("carNumColor"); | String carNumColor = paramMap.get("carNumColor"); | ||||
| if (StringUtils.isBlank(carNumColor)) { | if (StringUtils.isBlank(carNumColor)) { | ||||
| logger.error("carNumColor为空"); | logger.error("carNumColor为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumColor为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumColor为空"); | |||||
| } | } | ||||
| String outCarId = paramMap.get("outCarId"); | String outCarId = paramMap.get("outCarId"); | ||||
| if (StringUtils.isBlank(outCarId)) { | if (StringUtils.isBlank(outCarId)) { | ||||
| logger.error("outCarId为空"); | logger.error("outCarId为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "outCarId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "outCarId为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -316,12 +316,12 @@ public class WxCarController extends BaseController | |||||
| String etcpToken = paramMap.get("etcpToken"); | String etcpToken = paramMap.get("etcpToken"); | ||||
| if (StringUtils.isBlank(etcpToken)) { | if (StringUtils.isBlank(etcpToken)) { | ||||
| logger.error("etcpToken为空"); | logger.error("etcpToken为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | } | ||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| logger.error("carNumber为空"); | logger.error("carNumber为空"); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -347,7 +347,7 @@ public class WxCarController extends BaseController | |||||
| else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | ||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| WxCUserCar queryOne = new WxCUserCar(); | WxCUserCar queryOne = new WxCUserCar(); | ||||
| queryOne.setCarNumber(carNumber); | queryOne.setCarNumber(carNumber); | ||||
| @@ -427,10 +427,10 @@ public class WxCarController extends BaseController | |||||
| String etcpToken = paramMap.get("etcpToken"); | String etcpToken = paramMap.get("etcpToken"); | ||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(etcpToken)) { | if (StringUtils.isBlank(etcpToken)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -453,7 +453,7 @@ public class WxCarController extends BaseController | |||||
| else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | ||||
| String carNumber = paramMap.get("carNumber"); | String carNumber = paramMap.get("carNumber"); | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -495,16 +495,16 @@ public class WxCarController extends BaseController | |||||
| String accountId = paramMap.get("accountId"); | String accountId = paramMap.get("accountId"); | ||||
| String outTradeNo = paramMap.get("orderId"); | String outTradeNo = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(tradeId)) { | if (StringUtils.isBlank(tradeId)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "tradeId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tradeId为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(deductionAmount)) { | if (StringUtils.isBlank(deductionAmount)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "deductionAmount为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "deductionAmount为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(accountId)) { | if (StringUtils.isBlank(accountId)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "accountId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "accountId为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(outTradeNo)) { | if (StringUtils.isBlank(outTradeNo)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -554,19 +554,19 @@ public class WxCarController extends BaseController | |||||
| String couponFreeId = paramMap.get("couponFreeId"); | String couponFreeId = paramMap.get("couponFreeId"); | ||||
| String merchantIdStr = paramMap.get("merchantId"); | String merchantIdStr = paramMap.get("merchantId"); | ||||
| if (StringUtils.isBlank(etcpToken)) { | if (StringUtils.isBlank(etcpToken)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(carNumber)) { | if (StringUtils.isBlank(carNumber)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(couponFreeId)) { | if (StringUtils.isBlank(couponFreeId)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponFreeId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponFreeId为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(merchantIdStr)) { | if (StringUtils.isBlank(merchantIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||||
| } | } | ||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| @@ -35,14 +35,14 @@ public class WxCouponOrderController extends BaseController { | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | logger.error("couponOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| } | } | ||||
| Long couponOrderId = 0L; | Long couponOrderId = 0L; | ||||
| try { | try { | ||||
| couponOrderId = Long.valueOf(couponOrderIdStr); | couponOrderId = Long.valueOf(couponOrderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | |||||
| } | } | ||||
| try { | try { | ||||
| ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId()); | ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId()); | ||||
| @@ -80,7 +80,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | if (StringUtils.isBlank(couponOrderIdStr)) { | ||||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | logger.error("couponOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| } | } | ||||
| Long couponOrderId = 0L; | Long couponOrderId = 0L; | ||||
| try { | try { | ||||
| @@ -88,7 +88,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| couponOrderId = 0L; | couponOrderId = 0L; | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | logger.error("couponOrderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId)); | return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId)); | ||||
| } | } | ||||
| @@ -4,11 +4,9 @@ import com.simple.common.ErrorCode; | |||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.enums.EnumOrderStatus; | import com.simple.enums.EnumOrderStatus; | ||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import io.swagger.models.auth.In; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| @@ -38,14 +36,14 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| if (StringUtils.isBlank(couponIdStr)) { | if (StringUtils.isBlank(couponIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| } | } | ||||
| Long couponId = 0L; | Long couponId = 0L; | ||||
| try { | try { | ||||
| couponId = Long.valueOf(couponIdStr); | couponId = Long.valueOf(couponIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | ||||
| return new ResultData(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| } | } | ||||
| Long cUserId = getUserId(); | Long cUserId = getUserId(); | ||||
| @@ -69,14 +67,14 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| if (StringUtils.isBlank(couponIdStr)) { | if (StringUtils.isBlank(couponIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| } | } | ||||
| Long couponId = 0L; | Long couponId = 0L; | ||||
| try { | try { | ||||
| couponId = Long.valueOf(couponIdStr); | couponId = Long.valueOf(couponIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | ||||
| return new ResultData(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -99,7 +97,7 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -107,7 +105,7 @@ public class WxOrderController extends BaseController { | |||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL, "orderId: " + orderIdStr + ", e: " + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "orderId: " + orderIdStr + ", e: " + e.getMessage()); | |||||
| } | } | ||||
| wxOrderService.updateOrderStatus(orderId, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | wxOrderService.updateOrderStatus(orderId, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -120,7 +118,7 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -155,7 +153,7 @@ public class WxOrderController extends BaseController { | |||||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | public ResultData findById(@RequestBody Map<String, String> paramMap) { | ||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| try { | try { | ||||
| @@ -49,7 +49,7 @@ public class WxPayOrderController extends BaseController { | |||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| logger.info("orderId不能为空: " + paramMap.toString()); | logger.info("orderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -59,7 +59,7 @@ public class WxPayOrderController extends BaseController { | |||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| } | } | ||||
| WxPayOrder record = new WxPayOrder(); | WxPayOrder record = new WxPayOrder(); | ||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| @@ -86,7 +86,7 @@ public class WxPayOrderController extends BaseController { | |||||
| Integer status = (Integer)paramMap.get("status"); | Integer status = (Integer)paramMap.get("status"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| logger.info("orderId不能为空: " + paramMap.toString()); | logger.info("orderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| Long payOrderId = 0L, orderId = 0L; | Long payOrderId = 0L, orderId = 0L; | ||||
| try { | try { | ||||
| @@ -94,14 +94,14 @@ public class WxPayOrderController extends BaseController { | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| orderId = 0L; | orderId = 0L; | ||||
| logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); | logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| } | } | ||||
| if (!StringUtils.isBlank(payOrderIdStr)) { | if (!StringUtils.isBlank(payOrderIdStr)) { | ||||
| try { | try { | ||||
| payOrderId = Long.valueOf(payOrderIdStr); | payOrderId = Long.valueOf(payOrderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("payOrderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); | logger.error("payOrderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "payOrderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId参数不正确"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -40,18 +40,18 @@ public class WxRefundOrderController extends BaseController | |||||
| String payOrderIdStr = paramMap.get("payOrderId"); | String payOrderIdStr = paramMap.get("payOrderId"); | ||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| logger.error("orderId不能为空: " + paramMap.toString()); | logger.error("orderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(payOrderIdStr)) { | if (StringUtils.isBlank(payOrderIdStr)) { | ||||
| logger.error("payOrderId不能为空: " + paramMap.toString()); | logger.error("payOrderId不能为空: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空"); | |||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("orderId参数不正确: " + paramMap.toString()); | logger.error("orderId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||||
| } | } | ||||
| WxRefundOrder refundOrder = new WxRefundOrder(); | WxRefundOrder refundOrder = new WxRefundOrder(); | ||||
| refundOrder.setPayOrderNo(payOrderIdStr); | refundOrder.setPayOrderNo(payOrderIdStr); | ||||
| @@ -65,10 +65,10 @@ public class WxUserGrantController extends BaseController { | |||||
| String sceneAddress = map.get("sceneAddress"); | String sceneAddress = map.get("sceneAddress"); | ||||
| //登录凭证不能为空 | //登录凭证不能为空 | ||||
| if (StringUtils.isBlank(appId)) { | if (StringUtils.isBlank(appId)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "appId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(code)) { | if (StringUtils.isBlank(code)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "code不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "code不能为空"); | |||||
| } | } | ||||
| // 通过appinfo得到tenant_id | // 通过appinfo得到tenant_id | ||||
| @@ -142,10 +142,10 @@ public class WxUserGrantController extends BaseController { | |||||
| String iv = map.get("iv"); | String iv = map.get("iv"); | ||||
| if (StringUtils.isBlank(encryptedData)) { | if (StringUtils.isBlank(encryptedData)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "encryptedData不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "encryptedData不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(iv)) { | if (StringUtils.isBlank(iv)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "iv不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv不能为空"); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -201,10 +201,10 @@ public class WxUserGrantController extends BaseController { | |||||
| //登录凭证不能为空 | //登录凭证不能为空 | ||||
| if (StringUtils.isBlank(encryptedData)) { | if (StringUtils.isBlank(encryptedData)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "encryptedData 不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "encryptedData 不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(iv)) { | if (StringUtils.isBlank(iv)) { | ||||
| return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -8,7 +8,6 @@ import com.simple.exception.MallinkException; | |||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.mail.MailException; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.web.method.HandlerMethod; | import org.springframework.web.method.HandlerMethod; | ||||
| import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | ||||
| @@ -52,13 +51,13 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| //token为空 | //token为空 | ||||
| if(StringUtils.isBlank(token)){ | if(StringUtils.isBlank(token)){ | ||||
| throw new MallinkException(ErrorCode.TOKEN_EMPTY); | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY); | |||||
| } | } | ||||
| // 查询token信息 | // 查询token信息 | ||||
| WxCUser wxCUser = wxCUserService.getByToken(token); | WxCUser wxCUser = wxCUserService.getByToken(token); | ||||
| if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){ | if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){ | ||||
| throw new MallinkException(ErrorCode.TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| } | } | ||||
| //设置userId到request里,后续根据userId,获取用户信息 | //设置userId到request里,后续根据userId,获取用户信息 | ||||
| @@ -12,29 +12,35 @@ public enum ErrorCode{ | |||||
| * 系统级别 | * 系统级别 | ||||
| * 1000-1999 | * 1000-1999 | ||||
| */ | */ | ||||
| SERVER_ERROR(1000, "服务器请求异常"), | |||||
| PARAMETER_ERROR(1001, "参数不合法"), | |||||
| PARAMETER_NOT_NULL(1002, "参数不能为空"), | |||||
| PARAMETER_TYPE_ERROR(1003, "参数类型异常"), | |||||
| PARAMETER_CAST_ERROR(1004, "参数转换异常"), | |||||
| PARAMETER_EMPTY_ERROR(1005, "参数转换异常"), | |||||
| BEAN_EMPTY_PROPERTY_ERROR(1006, "实体转换异常"), | |||||
| MEDIATYPE_NOT_SUPPORT(1007, "不支持的媒体类型"), | |||||
| NULLPOINTER_ERROR(1008, "空指针异常"), | |||||
| METHOD_NOT_SUPPORT(1009, "不支持的请求类型"), | |||||
| CLASSCAST_ERROR(1010, "类型转换异常"), | |||||
| NUMBER_FORMAT_ERROR(1011, "数字转化异常"), | |||||
| EXTEND_JSON_ERROR(1012, "JSON格式异常"), | |||||
| REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), | |||||
| LOGIN_DENIED(1014, "登录失败"), | |||||
| TOKEN_INVALID(1015, "TOKEN无效"), | |||||
| TOKEN_EMPTY(1016, "token不能为空"), | |||||
| SYS_SERVER_ERROR(1000, "服务器请求异常"), | |||||
| SYS_PARAMETER_ERROR(1001, "参数不合法"), | |||||
| SYS_PARAMETER_NOT_NULL(1002, "参数不能为空"), | |||||
| SYS_PARAMETER_TYPE_ERROR(1003, "参数类型异常"), | |||||
| SYS_PARAMETER_CAST_ERROR(1004, "参数转换异常"), | |||||
| SYS_PARAMETER_EMPTY_ERROR(1005, "参数转换异常"), | |||||
| SYS_BEAN_EMPTY_PROPERTY_ERROR(1006, "实体转换异常"), | |||||
| SYS_MEDIATYPE_NOT_SUPPORT(1007, "不支持的媒体类型"), | |||||
| SYS_NULLPOINTER_ERROR(1008, "空指针异常"), | |||||
| SYS_METHOD_NOT_SUPPORT(1009, "不支持的请求类型"), | |||||
| SYS_CLASSCAST_ERROR(1010, "类型转换异常"), | |||||
| SYS_NUMBER_FORMAT_ERROR(1011, "数字转化异常"), | |||||
| SYS_EXTEND_JSON_ERROR(1012, "JSON格式异常"), | |||||
| SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), | |||||
| /** | |||||
| * 数据库 | |||||
| */ | |||||
| DB_FAIL(1045, "数据库访问出错"), | DB_FAIL(1045, "数据库访问出错"), | ||||
| /** | |||||
| * 网络 | |||||
| */ | |||||
| TOO_MANY_REQUEST(1050, "太多的请求访问"), | TOO_MANY_REQUEST(1050, "太多的请求访问"), | ||||
| LOGIN_DENIED(1051, "登录失败"), | |||||
| NET_TOKEN_INVALID(1052, "TOKEN无效"), | |||||
| NET_TOKEN_EMPTY(1053, "TOKEN不能为空"), | |||||
| /** | /** | ||||
| * 业务级别 | * 业务级别 | ||||
| @@ -48,9 +54,20 @@ public enum ErrorCode{ | |||||
| USER_IS_LOCKED(2003, "用户已经被锁定不能登录,请与管理员联系"), | USER_IS_LOCKED(2003, "用户已经被锁定不能登录,请与管理员联系"), | ||||
| NEW_USER_FAILD(2004, "创建新用户失败"), | NEW_USER_FAILD(2004, "创建新用户失败"), | ||||
| /** | |||||
| * 商场/商户 | |||||
| */ | |||||
| MALL_INFO_NOT_FOUND(2010, "商场信息没找到"), | |||||
| MERCHANT_INFO_NOT_FOUND(2011, "商户信息没找到"), | |||||
| MERCHANT_INFO_NOT_EQUAL(2012, "商户信息不对应"), | |||||
| MERCHANT_INFO_NOT_VALID(2013, "商户信息禁用"), | |||||
| /** | |||||
| * 券 | |||||
| */ | |||||
| COUPON_IS_EMPTY(2020, "券不存在"), | COUPON_IS_EMPTY(2020, "券不存在"), | ||||
| COUPON_IS_NOT_FREE(2021, "券不存在"), | |||||
| COUPON_IS_NOT_FREE(2021, "券不免费"), | |||||
| /** | /** | ||||
| * 车流 2040 | * 车流 2040 | ||||
| @@ -117,11 +134,10 @@ public enum ErrorCode{ | |||||
| REFUND_ORDER_NOTIFY_CHECK_SIGN_ERROR(12014, "退款验签失败"), | REFUND_ORDER_NOTIFY_CHECK_SIGN_ERROR(12014, "退款验签失败"), | ||||
| APP_ID_NOT_FOUND(12020, "APPID没找到"), | APP_ID_NOT_FOUND(12020, "APPID没找到"), | ||||
| MCH_INFO_NOT_FOUND(12021, "商户信息没找到"), | |||||
| MCH_INFO_NOT_EQUAL(12022, "商户信息不对应"), | |||||
| MCH_INFO_NOT_FOUND(12021, "微信商户平台信息没找到"), | |||||
| MCH_INFO_NOT_EQUAL(12022, "微信商户平台信息不对应"), | |||||
| API_KEY_NOT_FOUND(12023, "支付密钥未配置"), | API_KEY_NOT_FOUND(12023, "支付密钥未配置"), | ||||
| CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), | CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), | ||||
| MALL_INFO_NOT_FOUND(12025, "商场信息没找到"), | |||||
| PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), | PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), | ||||
| PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), | PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), | ||||
| @@ -160,6 +160,10 @@ public class WxMerchant implements Serializable { | |||||
| return status; | return status; | ||||
| } | } | ||||
| public boolean isValid() { | |||||
| return status == 1; | |||||
| } | |||||
| public void setStatus(Integer status) { | public void setStatus(Integer status) { | ||||
| this.status = status; | this.status = status; | ||||
| } | } | ||||
| @@ -75,11 +75,11 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||||
| WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | ||||
| if (merchant==null) | if (merchant==null) | ||||
| return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | ||||
| if (mall==null) | if (mall==null) | ||||
| return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | ||||
| @@ -124,11 +124,11 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||||
| WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | ||||
| if (merchant==null) | if (merchant==null) | ||||
| return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | ||||
| if (mall==null) | if (mall==null) | ||||
| return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | ||||
| @@ -234,7 +234,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| payOrderId = Long.valueOf(record.getPayOrderNo()); | payOrderId = Long.valueOf(record.getPayOrderNo()); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("参数转换异常: payOrderId-" + record.getPayOrderNo()); | logger.error("参数转换异常: payOrderId-" + record.getPayOrderNo()); | ||||
| throw new MallinkException(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "参数转换异常: payOrderId-" + record.getPayOrderNo()); | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "参数转换异常: payOrderId-" + record.getPayOrderNo()); | |||||
| } | } | ||||
| try { | try { | ||||
| WxPayOrder payOrderQ = new WxPayOrder(); | WxPayOrder payOrderQ = new WxPayOrder(); | ||||
| @@ -305,7 +305,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| signMap = BeanUtils.toStringMap(wxRefundOrderP); | signMap = BeanUtils.toStringMap(wxRefundOrderP); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("退款签名异常"); | logger.error("退款签名异常"); | ||||
| throw new MallinkException(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "退款签名异常"); | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "退款签名异常"); | |||||
| } | } | ||||
| String signAgent = WxPayment.createSign(signMap, payAccount.getApiKey()); | String signAgent = WxPayment.createSign(signMap, payAccount.getApiKey()); | ||||
| signMap.put("sign", signAgent); | signMap.put("sign", signAgent); | ||||
| @@ -215,17 +215,20 @@ public class ETCPUtil { | |||||
| ETCPUtil caller = new ETCPUtil(); | ETCPUtil caller = new ETCPUtil(); | ||||
| String ret = ""; | String ret = ""; | ||||
| JSONObject objret = null; | JSONObject objret = null; | ||||
| String etcpToken = "0f4dfc72-e7cc-4bec-8878-7b08f02998ec"; | |||||
| String etcpToken = "899e94d7-a3a5-46d4-87a3-288b18d0b189"; | |||||
| String carNumber = "京D12345"; | String carNumber = "京D12345"; | ||||
| String parkId = "Wj7YdvqyiYM="; | String parkId = "Wj7YdvqyiYM="; | ||||
| String businessId = "fmtest1234"; | |||||
| //caller.carSimulation(appId, merchantNo, merchantKey, version, carNumber); | |||||
| String businessId = "IgWGUtpAX68="; | |||||
| caller.getBCouponList(domain, merchantNo, merchantKey, version, parkId, businessId); | |||||
| //caller.carSimulation(domain, appId, merchantNo, merchantKey, version, carNumber); | |||||
| /* {"code":0,"message":"ok","data":{"isInPark":0}} */ | |||||
| //caller.getBCouponList(domain, merchantNo, merchantKey, version, parkId, businessId); | |||||
| // {"code":0,"message":"查询成功","data":{"count":1,"couponPlatformModels":[{"id":5627,"parkId":"Wj7YdvqyiYM=","businessId":"IgWGUtpAX68=","businessName":"fmtest5678","name":"优免现金1元","category":"2","categoryValue":"1.00","amount":100,"status":"1","effectiveStart":"2018-08-20","effectiveEnd":"2018-08-25","couponType":"0","avaliavleNum":100}]}} | |||||
| // 联合登录测试 | // 联合登录测试 | ||||
| /* | |||||
| ret = caller.userSignin(domain, appId, merchantNo, merchantKey, version, "13910154397"); | |||||
| /*ret = caller.userSignin(domain, appId, merchantNo, merchantKey, version, "13910154397"); | |||||
| objret = JSON.parseObject(ret); | objret = JSON.parseObject(ret); | ||||
| if (objret.getIntValue("code") != 0) | if (objret.getIntValue("code") != 0) | ||||