Przeglądaj źródła

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java

15376779826 1 miesiąc temu
rodzic
commit
6c37f0a738

+ 11 - 1
fs-framework/src/main/java/com/fs/framework/web/exception/GlobalExceptionHandler.java

@@ -1,6 +1,8 @@
 package com.fs.framework.web.exception;
 
 import javax.servlet.http.HttpServletRequest;
+
+import com.fs.common.exception.CustomException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.security.access.AccessDeniedException;
@@ -17,7 +19,7 @@ import com.fs.common.utils.StringUtils;
 
 /**
  * 全局异常处理器
- * 
+ *
 
  */
 @RestControllerAdvice
@@ -70,6 +72,14 @@ public class GlobalExceptionHandler
         return AjaxResult.error(e.getMessage());
     }
 
+    @ExceptionHandler(CustomException.class)
+    public AjaxResult handleCustomException(CustomException e, HttpServletRequest request)
+    {
+        String requestURI = request.getRequestURI();
+        log.error("请求地址'{}',发生未知异常.", requestURI, e);
+        return AjaxResult.error(e.getMessage());
+    }
+
     /**
      * 系统异常
      */

+ 4 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fs.common.core.redis.RedisCache;
+import com.fs.common.exception.CustomException;
 import com.fs.common.exception.ServiceException;
 import com.fs.course.domain.FsUserCoursePeriod;
 import com.fs.course.domain.FsUserCoursePeriodDays;
@@ -114,6 +115,9 @@ public class FsUserCoursePeriodServiceImpl implements IFsUserCoursePeriodService
         }
 
         FsUserCoursePeriod fsUserCoursePeriod1 = fsUserCoursePeriodMapper.selectFsUserCoursePeriodById(fsUserCoursePeriod.getPeriodId());
+        if (!fsUserCoursePeriod1.getTrainingCampId().equals(fsUserCoursePeriod.getTrainingCampId())){
+            throw new CustomException("参数错误,请刷新后重试!");
+        }
         int flag = fsUserCoursePeriodMapper.updateFsUserCoursePeriod(fsUserCoursePeriod);
 
         // 2. 判定是否变更过开始时间(periodStartingTime)

+ 5 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -22,6 +22,7 @@ import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.mapper.CompanyMoneyLogsMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.company.service.ICompanyService;
+import com.fs.config.cloud.CloudHostProper;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.*;
 import com.fs.course.dto.CoursePackageDTO;
@@ -212,6 +213,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     @Autowired
     private FsCourseAnswerLogsMapper courseAnswerLogsMapper;
 
+    @Autowired
+    private CloudHostProper cloudHostProper;
+
 
     /**
      * 查询课堂视频
@@ -2157,6 +2161,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         }else {
             link.setLinkType(3);
         }
+        link.setProjectCode(cloudHostProper.getProjectCode());
 
         String randomString = generateRandomStringWithLock();
         if (StringUtil.strIsNullOrEmpty(randomString)){

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderPayParam.java

@@ -16,4 +16,9 @@ public class FsStoreOrderPayParam implements Serializable
     @ApiModelProperty(value = "payType")
     @NotNull(message = "支付类型不能为空")
     private Integer payType;
+
+    /**
+     * 小程序多商城
+     * **/
+    private String appId;
 }

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStorePaymentPayParam.java

@@ -20,4 +20,5 @@ public class FsStorePaymentPayParam implements Serializable
     private Long companyUserId;
 
     private String code;
+    private String appId;
 }

+ 8 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/PaymentScrmController.java

@@ -44,7 +44,14 @@ public class PaymentScrmController extends AppBaseController {
     @PostMapping("/payment")
     @RepeatSubmit
     public R payment(@Validated @RequestBody FsStorePaymentPayParam payment, HttpServletRequest request){
-        final WxMaService wxService = WxMaConfiguration.getMaService(properties.getConfigs().get(0).getAppid());
+        String appId = null;
+        if (payment.getAppId()!=null && !"".equals(payment.getAppId())){
+            appId= payment.getAppId();
+        }else {
+            appId=properties.getConfigs().get(0).getAppid();
+        }
+
+        final WxMaService wxService = WxMaConfiguration.getMaService(appId);
         try {
             String ip = IpUtil.getRequestIp();
             WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(payment.getCode());

+ 3 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -360,6 +360,9 @@ public class StoreOrderScrmController extends AppBaseController {
                     o.setReqSeqId("store-"+storePayment.getPayCode());
                     o.setTransAmt(storePayment.getPayMoney().toString());
                     o.setGoodsDesc("商城订单支付");
+                    if (param != null && StringUtils.isNotBlank(param.getAppId())) {
+                        o.setAppId(param.getAppId());
+                    }
                     HuifuCreateOrderResult result = huiFuService.createOrder(o);
                     if(result.getResp_code()!=null&&(result.getResp_code().equals("00000000")||result.getResp_code().equals("00000100"))){
                         FsStorePaymentScrm mt=new FsStorePaymentScrm();