Browse Source

Merge remote-tracking branch 'origin/Payment-Configuration' into Payment-Configuration

xgb 1 week ago
parent
commit
34e2919feb

+ 5 - 0
fs-service/src/main/java/com/fs/company/domain/Company.java

@@ -115,6 +115,11 @@ public class Company extends BaseEntity
     */
     private String customMiniAppId;
 
+    /**
+     * 业务域名
+     */
+    private String businessDomain;
+
     /** 会员是否默认黑名单,1-是;0-否(用于销售分享成为会员的操作) */
     private Integer fsUserIsDefaultBlack;
     private Integer repeat;

+ 5 - 0
fs-service/src/main/resources/mapper/company/CompanyMapper.xml

@@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="maxPadNum"    column="max_pad_num"    />
         <result property="deptId"   column="dept_id" />
         <result property="isOpenStoredPay"   column="is_open_stored_pay" />
+        <result property="businessDomain"   column="business_domain" />
     </resultMap>
 
     <sql id="selectCompanyVo">
@@ -53,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCompanyVo"/>
         <where>
             <if test="companyId != null"> and company_id = #{companyId}</if>
+            <if test="businessDomain != null"> and business_domain = #{businessDomain}</if>
             <if test="companyName != null  and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
             <if test="companyMobile != null  and companyMobile != ''"> and company_mobile = #{companyMobile}</if>
             <if test="companyAddress != null  and companyAddress != ''"> and company_address = #{companyAddress}</if>
@@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into company
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="companyName != null">company_name,</if>
+            <if test="businessDomain != null">business_domain,</if>
             <if test="companyMobile != null">company_mobile,</if>
             <if test="companyAddress != null">company_address,</if>
             <if test="createTime != null">create_time,</if>
@@ -129,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="companyName != null">#{companyName},</if>
+            <if test="businessDomain != null">#{businessDomain},</if>
             <if test="companyMobile != null">#{companyMobile},</if>
             <if test="companyAddress != null">#{companyAddress},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -171,6 +175,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update company
         <trim prefix="SET" suffixOverrides=",">
             <if test="companyName != null">company_name = #{companyName},</if>
+            <if test="businessDomain != null">business_domain = #{businessDomain},</if>
             <if test="companyMobile != null">company_mobile = #{companyMobile},</if>
             <if test="companyAddress != null">company_address = #{companyAddress},</if>
             <if test="createTime != null">create_time = #{createTime},</if>

+ 31 - 3
fs-user-app/src/main/java/com/fs/app/controller/store/CommonScrmController.java

@@ -11,9 +11,11 @@ import com.fs.app.utils.JwtUtils;
 import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.file.OssException;
+import com.fs.company.domain.Company;
 import com.fs.company.service.ICompanyMoneyLogsService;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.course.config.CourseConfig;
 import com.fs.erp.service.IErpGoodsService;
 import com.fs.erp.service.IErpOrderService;
 import com.fs.erp.service.IErpShopService;
@@ -72,6 +74,9 @@ public class CommonScrmController extends AppBaseController {
     @Autowired
     private ISysConfigService configService;
 
+    @Autowired
+    private ICompanyService companyService;
+
     @Autowired
     IFsStoreOrderItemScrmService orderItemService;
     @Autowired
@@ -125,9 +130,6 @@ public class CommonScrmController extends AppBaseController {
     @Autowired
     private IFsExpressScrmService expressService;
 
-    @Autowired
-    private ICompanyService companyService;
-
     @Autowired
     ICompanyUserService companyUserService;
     @Autowired
@@ -521,6 +523,32 @@ public class CommonScrmController extends AppBaseController {
 
     }
 
+    @GetMapping(value = "/getBusinessDomain")
+    @ApiOperation("获取业务域名配置")
+    public R getBusinessDomain(@RequestParam(value = "companyId", required = false) Long companyId) {
+        try {
+            if (companyId != null) {
+                Company company = companyService.selectCompanyById(companyId);
+                if (company != null && company.getBusinessDomain() != null) {
+                    return R.ok().put("data", company.getBusinessDomain());
+                }
+            }
+
+            String configJson = configService.selectConfigByKey("course.config");
+            if (configJson != null && !configJson.isEmpty()) {
+                CourseConfig config = JSONUtil.toBean(configJson, CourseConfig.class);
+                if (config != null && config.getUserCourseAuthDomain() != null) {
+                    return R.ok().put("data", config.getUserCourseAuthDomain());
+                }
+            }
+
+            return R.ok().put("data", "");
+        } catch (Exception e) {
+            logger.error("获取业务域名配置异常,companyId: {}", companyId, e);
+            return R.ok().put("data", "");
+        }
+    }
+
     //	private IErpOrderService getErpOrderService(){
 //		//判断是否开启erp
 //		IErpOrderService erpOrderService = null;