Преглед на файлове

1.生成销售订单导出物流追踪 2.看课配置新增飞书答题配置 3.新增获取飞书答题页面数据

wjj преди 2 дни
родител
ревизия
a7987d21ee

+ 5 - 0
fs-admin/src/main/java/com/fs/his/controller/FsCourseReissueConfigController.java

@@ -131,4 +131,9 @@ public class FsCourseReissueConfigController extends BaseController
     public R reissueCourseSop(@RequestBody FsCourseReissueConfig config){
         return fsCourseReissueConfigService.reissueCourseSop(config.getId());
     }
+
+    @PostMapping("/generateAnswerShortLink")
+    public R generateAnswerShortLink(@RequestBody FsCourseReissueConfig config){
+        return fsCourseReissueConfigService.generateAnswerShortLink(config.getId());
+    }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/domain/FsCourseReissueConfig.java

@@ -31,5 +31,8 @@ public class FsCourseReissueConfig extends BaseEntity{
     @Excel(name = "可用状态 1-正常 2-禁用")
     private Integer status;
 
+    private Integer rate;
+
+    private String shortLink;
 
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/IFsCourseReissueConfigService.java

@@ -70,4 +70,11 @@ public interface IFsCourseReissueConfigService extends IService<FsCourseReissueC
     R reissueCourseSop(Long configId);
 
     FsCourseReissueConfig getConfigInfoRedis();
+
+    /**
+     * 生成答案短链
+     * @param configId 补发SOP配置id
+     * @return 短链
+     */
+    R generateAnswerShortLink(Long configId);
 }

+ 40 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsCourseReissueConfigServiceImpl.java

@@ -6,6 +6,7 @@ import java.time.ZoneId;
 import java.util.*;
 
 import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.urllink.GenerateUrlLinkRequest;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -100,6 +101,7 @@ public class FsCourseReissueConfigServiceImpl extends ServiceImpl<FsCourseReissu
 
     private static final String courseRealLink = "/pages_course/video.html?course=";
     private static final String feiShuMiniAppLink = "/pages_course/video?course=";
+    private static final String URLScheme = "weixin://dl/business/?t=";
     /**
      * 查询补发SOP配置
      * 
@@ -258,6 +260,44 @@ public class FsCourseReissueConfigServiceImpl extends ServiceImpl<FsCourseReissu
         return null;
     }
 
+    @Override
+    public R generateAnswerShortLink(Long configId) {
+        FsCourseReissueConfig fsCourseReissueConfig = fsCourseReissueConfigMapper.selectFsCourseReissueConfigById(configId);
+        if (fsCourseReissueConfig == null) {
+            return R.error("补发SOP配置不存在");
+        }
+        if (StringUtils.isNull(fsCourseReissueConfig.getAppId())) {
+            return R.error("小程序APPID不能为空");
+        }
+        final WxMaService wxMaService = WxMaConfiguration.getMaService(fsCourseReissueConfig.getAppId());
+        // 构建请求参数
+        GenerateUrlLinkRequest request = GenerateUrlLinkRequest.builder()
+                .path("pages_user/answerQues") // 小程序页面路径
+                .query("channel=api")      // 自定义参数
+                .envVersion("release")     // 版本: release/trial/develop
+                // .expireTime(System.currentTimeMillis() + 86400) // 可选: 失效时间戳
+                .build();
+        try {
+            String shortLink = wxMaService.getLinkService().generateUrlLink(request);
+            if (shortLink == null || shortLink.isEmpty()) {
+                return R.error("生成答题短链失败");
+            }
+            // 提取 ticket(路径最后一段)
+            String ticket = shortLink.substring(shortLink.lastIndexOf("/") + 1);
+            String URL = URLScheme + ticket;
+            fsCourseReissueConfig.setShortLink(URL);
+            int i = fsCourseReissueConfigMapper.updateFsCourseReissueConfig(fsCourseReissueConfig);
+            if (i > 0) {
+                redisCache.setCacheObject("fs_course_reissue_config:", fsCourseReissueConfig);
+                return R.ok("生成答题短链成功");
+            } else {
+                return R.error("生成答题短链失败");
+            }
+        } catch (WxErrorException e) {
+            return R.error(e.getMessage());
+        }
+    }
+
 
     private boolean checkAppId(String appId) {
         boolean result = false;

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderExportVO.java

@@ -243,10 +243,10 @@ public class FsStoreOrderExportVO implements Serializable
     @Excel(name = "物流结算费用")
     private BigDecimal deliveryPayMoney;
 
-    @Excel(name = "物流状态" , dictType = "store_order_delivery_status")
+    @Excel(name = "物流状态" , dictType = "sys_store_order_delivery_status")
     private String deliveryStatus;
 
-    @Excel(name = "物流跟踪状态" , dictType = "store_order_delivery_type")
+    @Excel(name = "物流跟踪状态" , dictType = "sys_delivery_type")
     private String deliveryType;
 
     @Excel(name = "客户编码")

+ 9 - 1
fs-service/src/main/resources/mapper/his/FsCourseReissueConfigMapper.xml

@@ -11,10 +11,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="status"    column="status"    />
+        <result property="rate" column="rate" />
+        <result property="shortLink" column="short_link" />
     </resultMap>
 
     <sql id="selectFsCourseReissueConfigVo">
-        select id, type, app_id, create_time, update_time, status from fs_course_reissue_config
+        select id, type, app_id, create_time, update_time, status, rate, short_link from fs_course_reissue_config
     </sql>
 
     <select id="selectFsCourseReissueConfigList" parameterType="FsCourseReissueConfig" resultMap="FsCourseReissueConfigResult">
@@ -39,6 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="status != null">status,</if>
+            <if test="rate != null">rate,</if>
+            <if test="shortLink != null">short_link,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="type != null">#{type},</if>
@@ -46,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="status != null">#{status},</if>
+            <if test="rate != null">#{rate},</if>
+            <if test="shortLink != null">#{shortLink},</if>
          </trim>
     </insert>
 
@@ -57,6 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="status != null">status = #{status},</if>
+            <if test="rate != null">rate = #{rate},</if>
+            <if test="shortLink != null">short_link = #{shortLink},</if>
         </trim>
         where id = #{id}
     </update>