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

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into test

zouxuan 1 год назад
Родитель
Сommit
f6ea9134e7

+ 3 - 2
mec-application/src/main/java/com/ym/mec/student/controller/SmsCodeController.java

@@ -44,9 +44,10 @@ public class SmsCodeController extends BaseController {
 
     @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
+            @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "验证码类型(register  login)", required = true, dataType = "String")})
     @PostMapping(value = "/sendSmsCode")
-    public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code) throws Exception {
+    public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code,String type) throws Exception {
         if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(code)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }

+ 21 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrderPayOpsServiceImpl.java

@@ -18,6 +18,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 
 import com.huifu.adapay.core.util.StringUtil;
+import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
@@ -42,12 +43,6 @@ import com.ym.mec.biz.dal.entity.TenantOrderRecord;
 import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
-import com.ym.mec.biz.service.HfMerchantConfigService;
-import com.ym.mec.biz.service.OrderPayOpsService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.TenantConfigService;
-import com.ym.mec.biz.service.TenantOrderRecordService;
-import com.ym.mec.biz.service.TenantPaymentOrderService;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
@@ -58,6 +53,8 @@ import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.json.JsonUtil;
 
+import static com.ym.mec.biz.dal.enums.OrderTypeEnum.MALL_BUY;
+
 /**
  * @author hgw
  * Created by 2021-12-22
@@ -116,7 +113,24 @@ public class OrderPayOpsServiceImpl implements OrderPayOpsService {
             //签名验证
             checkSing(payParam);
             String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
-            payParam.setNotifyUrl(baseApiUrl + "/api-student/studentOrder/callback/" + payParam.getOrderNo());
+            if(studentPaymentOrder.getType() == MALL_BUY){
+                String paymentChannelStr = sysConfigDao.findConfigValue(SysConfigService.PAYMENT_CHANNEL);
+                if(StringUtils.isBlank(paymentChannelStr)) {
+                    paymentChannelStr = PaymentChannelEnum.ADAPAY.getCode();
+                }
+                PaymentChannelEnum paymentChannel = PaymentChannelEnum.codeOf(paymentChannelStr);
+                String notifyUrl = "";
+                if (PaymentChannelEnum.YEEPAY == paymentChannel){
+                    notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback_yee/" + studentPaymentOrder.getTenantId();
+                }else if (PaymentChannelEnum.ADAPAY == paymentChannel){
+                    notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback";
+                }else {
+                    throw new BizException("支付渠道错误");
+                }
+                payParam.setNotifyUrl(notifyUrl);
+            }else {
+                payParam.setNotifyUrl(baseApiUrl + "/api-student/studentOrder/callback/" + payParam.getOrderNo());
+            }
 
             //如果以上操作都没有 则应该是这一个,因为老代码就是这样写的。
             payment = student(payParam);

+ 6 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SmsCodeServiceImpl.java

@@ -41,13 +41,13 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 	@Override
 	public boolean sendValidCode(String mobile) {
 		SysUser sysUser = sysUserFeignService.queryUserByMobile(mobile);
-		if (sysUser == null) {
-			throw new BizException("账号不存在!");
+		Integer userId = null;
+		if (sysUser != null) {
+			if(sysUser.getLockFlag() == 9 || sysUser.getLockFlag() == 1 || sysUser.getDelFlag() == YesOrNoEnum.YES) {
+				throw new BizException("账号已冻结,请联系管理员");
+			}
+			userId = sysUser.getId();
 		}
-		if(sysUser.getLockFlag() == 9 || sysUser.getLockFlag() == 1 || sysUser.getDelFlag() == YesOrNoEnum.YES) {
-			throw new BizException("账号已冻结,请联系管理员");
-		}
-		Integer userId = sysUser.getId();
 		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.SMS_MAX_TIMES);
 		int times = 3;
 		if (sysConfig != null) {

+ 2 - 2
mec-mall/mall-portal/src/main/resources/logback-spring.xml

@@ -63,7 +63,7 @@
 	</springProfile>
 
 	<springProfile name="pre">
-		<root level="WARN">
+		<root level="INFO">
 			<appender-ref ref="plumelog" />
 			<appender-ref ref="file" />
 		</root>
@@ -71,7 +71,7 @@
 
 	<!--生产环境:输出到文件 -->
 	<springProfile name="prod">
-		<root level="WARN">
+		<root level="INFO">
 			<appender-ref ref="file" />
 			<appender-ref ref="plumelog" />
 		</root>