Bladeren bron

文章视频上传/多商户配置/聚水潭同步发货中状态

wangxy 4 dagen geleden
bovenliggende
commit
0cbc4b017f
29 gewijzigde bestanden met toevoegingen van 958 en 12 verwijderingen
  1. 110 0
      fs-admin/src/main/java/com/fs/company/controller/SysRedpacketConfigMoreController.java
  2. 60 0
      fs-admin/src/main/java/com/fs/course/controller/FsMiniappTrafficLogController.java
  3. 1 1
      fs-admin/src/main/java/com/fs/his/task/Task.java
  4. 9 0
      fs-admin/src/main/java/com/fs/task/FsCompanyTask.java
  5. 6 0
      fs-service/src/main/java/com/fs/course/mapper/FsCourseTrafficLogMapper.java
  6. 5 0
      fs-service/src/main/java/com/fs/course/param/FsCourseTrafficLogParam.java
  7. 6 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseTrafficLogService.java
  8. 9 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseTrafficLogServiceImpl.java
  9. 33 0
      fs-service/src/main/java/com/fs/course/vo/FsMiniappDailyTrafficVO.java
  10. 2 0
      fs-service/src/main/java/com/fs/erp/domain/ErpOrderQuery.java
  11. 13 0
      fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java
  12. 14 0
      fs-service/src/main/java/com/fs/his/domain/FsArticle.java
  13. 1 1
      fs-service/src/main/java/com/fs/his/domain/FsExternalOrder.java
  14. 74 0
      fs-service/src/main/java/com/fs/his/domain/SysRedpacketConfigMore.java
  15. 1 1
      fs-service/src/main/java/com/fs/his/domain/vo/FsExternalOrderListVO.java
  16. 1 1
      fs-service/src/main/java/com/fs/his/mapper/FsExternalOrderMapper.java
  17. 71 0
      fs-service/src/main/java/com/fs/his/mapper/SysRedpacketConfigMoreMapper.java
  18. 9 0
      fs-service/src/main/java/com/fs/his/param/updateChangeMchIdParam.java
  19. 69 0
      fs-service/src/main/java/com/fs/his/service/ISysRedpacketConfigMoreService.java
  20. 84 6
      fs-service/src/main/java/com/fs/his/service/impl/FsExternalOrderServiceImpl.java
  21. 205 0
      fs-service/src/main/java/com/fs/his/service/impl/SysRedpacketConfigMoreServiceImpl.java
  22. 3 0
      fs-service/src/main/java/com/fs/his/vo/FsArticleVO.java
  23. 14 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsArticleScrm.java
  24. 3 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsArticleVO.java
  25. 21 0
      fs-service/src/main/resources/mapper/course/FsCourseTrafficLogMapper.xml
  26. 5 1
      fs-service/src/main/resources/mapper/his/FsArticleMapper.xml
  27. 1 0
      fs-service/src/main/resources/mapper/his/FsExternalOrderMapper.xml
  28. 123 0
      fs-service/src/main/resources/mapper/his/SysRedpacketConfigMoreMapper.xml
  29. 5 1
      fs-service/src/main/resources/mapper/hisStore/FsArticleScrmMapper.xml

+ 110 - 0
fs-admin/src/main/java/com/fs/company/controller/SysRedpacketConfigMoreController.java

@@ -0,0 +1,110 @@
+package com.fs.company.controller;
+
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.SysRedpacketConfigMore;
+import com.fs.his.param.updateChangeMchIdParam;
+import com.fs.his.service.ISysRedpacketConfigMoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 多商户配置Controller
+ *
+ * @author fs
+ * @date 2025-11-27
+ */
+@RestController
+@RequestMapping("/redPacket/more")
+public class SysRedpacketConfigMoreController extends BaseController
+{
+    @Autowired
+    private ISysRedpacketConfigMoreService sysRedpacketConfigMoreService;
+
+    /**
+     * 查询多商户配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        startPage();
+        List<SysRedpacketConfigMore> list = sysRedpacketConfigMoreService.selectSysRedpacketConfigMoreList(sysRedpacketConfigMore);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取多商户配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(sysRedpacketConfigMoreService.selectSysRedpacketConfigMoreById(id));
+    }
+
+    /**
+     * 获取当前发红包的商户号
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:editConfig')")
+    @GetMapping(value = "/getRedPacketConfig")
+    public AjaxResult getRedPacketConFig()
+    {
+        return AjaxResult.success(sysRedpacketConfigMoreService.getRedPacketConFig());
+    }
+
+
+
+
+    /**
+     * 新增多商户配置
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:add')")
+    @Log(title = "多商户配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        return toAjax(sysRedpacketConfigMoreService.insertSysRedpacketConfigMore(sysRedpacketConfigMore));
+    }
+
+    /**
+     * 修改发商户号的商户
+     */
+    @Log(title = "修改发商户号的商户", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateChangeMchId")
+    public R updateChangeMchId(@RequestBody updateChangeMchIdParam param)
+    {
+        return sysRedpacketConfigMoreService.updateChangeMchId(param);
+    }
+
+    /**
+     * 修改多商户配置
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:edit')")
+    @Log(title = "多商户配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        return toAjax(sysRedpacketConfigMoreService.updateSysRedpacketConfigMore(sysRedpacketConfigMore));
+    }
+
+    /**
+     * 删除多商户配置
+     */
+    @PreAuthorize("@ss.hasPermi('redPacket:more:remove')")
+    @Log(title = "多商户配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(sysRedpacketConfigMoreService.deleteSysRedpacketConfigMoreByIds(ids));
+    }
+}

+ 60 - 0
fs-admin/src/main/java/com/fs/course/controller/FsMiniappTrafficLogController.java

@@ -0,0 +1,60 @@
+package com.fs.course.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.param.FsCourseTrafficLogParam;
+import com.fs.course.service.IFsCourseTrafficLogService;
+import com.fs.course.vo.FsMiniappDailyTrafficVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 指定小程序每日流量明细(不含项目/课程维度)
+ */
+@RestController
+@RequestMapping("/course/miniappTraffic")
+public class FsMiniappTrafficLogController extends BaseController {
+
+    /** 仅统计该小程序 */
+    private static final String TARGET_APP_ID = "wx1b6db2bf134034df";
+
+    @Autowired
+    private IFsCourseTrafficLogService fsCourseTrafficLogService;
+
+    /**
+     * 按日汇总流量列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:miniappTraffic:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsCourseTrafficLogParam param) {
+        param.setAppId(TARGET_APP_ID);
+        startPage();
+        List<FsMiniappDailyTrafficVO> list = fsCourseTrafficLogService.selectDailyTrafficByAppId(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出按日汇总流量
+     */
+    @PreAuthorize("@ss.hasPermi('course:miniappTraffic:export')")
+    @Log(title = "小程序每日流量明细", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsCourseTrafficLogParam param) {
+        param.setAppId(TARGET_APP_ID);
+        List<FsMiniappDailyTrafficVO> list = fsCourseTrafficLogService.selectDailyTrafficByAppId(param);
+        for (FsMiniappDailyTrafficVO vo : list) {
+            vo.formatTraffic();
+        }
+        ExcelUtil<FsMiniappDailyTrafficVO> util = new ExcelUtil<>(FsMiniappDailyTrafficVO.class);
+        return util.exportExcel(list, "小程序每日流量明细");
+    }
+}

+ 1 - 1
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -1998,7 +1998,7 @@ public class Task {
     }
 
     /**
-     * 同步外部订单状态(从聚水潭)
+     * 同步外部订单状态(从聚水潭:发货中、已发货
      */
     public void syncExternalOrderStatusFromJst() throws Exception {
         log.info("开始同步外部订单状态");

+ 9 - 0
fs-admin/src/main/java/com/fs/task/FsCompanyTask.java

@@ -18,6 +18,7 @@ import com.fs.course.config.RedPacketConfig;
 import com.fs.course.domain.FsCourseRedPacketLog;
 import com.fs.course.mapper.FsCourseRedPacketLogMapper;
 import com.fs.course.service.IFsCourseRedPacketLogService;
+import com.fs.his.service.ISysRedpacketConfigMoreService;
 import com.fs.system.service.ISysConfigService;
 import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesRequest;
 import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesResult;
@@ -53,6 +54,14 @@ public class FsCompanyTask {
     private final RedisTemplate<String, Object> redisTemplate;
     private final IFsCourseRedPacketLogService redPacketLogService;
     private final CompanyRedPacketBalanceUtil redPacketBalanceUtil;
+    private final ISysRedpacketConfigMoreService sysRedpacketConfigMoreService;
+
+    /**
+     * 红包商户号自动轮换(调用目标:companyTask.changeRedPacketConfig)
+     */
+    public void changeRedPacketConfig() {
+        sysRedpacketConfigMoreService.changeRedPacketConfig();
+    }
 
     public void refreshCompanyMoney() {
         // 使用红包余额

+ 6 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseTrafficLogMapper.java

@@ -9,6 +9,7 @@ import com.fs.course.domain.FsCourseTrafficLog;
 import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.param.TrafficRecord;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.course.vo.FsMiniappDailyTrafficVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -114,6 +115,11 @@ public interface FsCourseTrafficLogMapper
 
     List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);
 
+    /**
+     * 按小程序 AppId 汇总每日流量
+     */
+    List<FsMiniappDailyTrafficVO> selectDailyTrafficByAppId(FsCourseTrafficLogParam param);
+
     @Select("<script>" +
             "SELECT log_id FROM fs_course_traffic_log " +
             "WHERE status = 0 " +

+ 5 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseTrafficLogParam.java

@@ -51,4 +51,9 @@ public class FsCourseTrafficLogParam {
      */
     private List<Integer> typeFlag;
 
+    /**
+     * 小程序 AppId
+     */
+    private String appId;
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseTrafficLogService.java

@@ -5,6 +5,7 @@ import com.fs.course.domain.FsCourseTrafficLog;
 import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.param.InternetTrafficParam;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.course.vo.FsMiniappDailyTrafficVO;
 
 /**
  * 短链课程流量记录Service接口
@@ -72,6 +73,11 @@ public interface IFsCourseTrafficLogService
 
     List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);
 
+    /**
+     * 按小程序 AppId 汇总每日流量(不含项目/课程维度)
+     */
+    List<FsMiniappDailyTrafficVO> selectDailyTrafficByAppId(FsCourseTrafficLogParam param);
+
 
     void updateTrafficStatus(InternetTrafficParam internetTrafficParam);
 

+ 9 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseTrafficLogServiceImpl.java

@@ -17,6 +17,7 @@ import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.param.InternetTrafficParam;
 import com.fs.course.param.TrafficRecord;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.course.vo.FsMiniappDailyTrafficVO;
 import com.fs.store.service.cache.IFsUserCourseCacheService;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.service.ISysConfigService;
@@ -222,6 +223,14 @@ public class FsCourseTrafficLogServiceImpl implements IFsCourseTrafficLogService
         return fsCourseTrafficLogListVOS;
     }
 
+    @Override
+    public List<FsMiniappDailyTrafficVO> selectDailyTrafficByAppId(FsCourseTrafficLogParam param) {
+        if (StringUtils.isBlank(param.getStartDate()) && StringUtils.isBlank(param.getEndDate())) {
+            throw new CustomException("搜索必须要一个时间范围!");
+        }
+        return fsCourseTrafficLogMapper.selectDailyTrafficByAppId(param);
+    }
+
     @Override
     public void updateTrafficStatus(InternetTrafficParam internetTrafficParam) {
         System.out.println("开始处理流量充值...");

+ 33 - 0
fs-service/src/main/java/com/fs/course/vo/FsMiniappDailyTrafficVO.java

@@ -0,0 +1,33 @@
+package com.fs.course.vo;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 指定小程序每日流量汇总
+ */
+@Data
+public class FsMiniappDailyTrafficVO implements Serializable {
+
+    @Excel(name = "日期")
+    private String statDate;
+
+    @Excel(name = "小程序AppId")
+    private String appId;
+
+    private Long totalInternetTraffic;
+
+    @Excel(name = "使用流量")
+    private String formattedTotalTraffic;
+
+    public void formatTraffic() {
+        if (this.totalInternetTraffic == null) {
+            this.formattedTotalTraffic = "0.0000 GB";
+        } else {
+            double gb = this.totalInternetTraffic.doubleValue() / (1024 * 1024 * 1024);
+            this.formattedTotalTraffic = String.format("%.4f GB", gb);
+        }
+    }
+}

+ 2 - 0
fs-service/src/main/java/com/fs/erp/domain/ErpOrderQuery.java

@@ -29,6 +29,8 @@ public class ErpOrderQuery {
     Integer delivery_state;
     Integer o_id;
     String so_id;
+    /** 聚水潭订单状态,如 Delivering/Sent */
+    String status;
 
 
 

+ 13 - 0
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java

@@ -1010,6 +1010,8 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
             erpOrder.setReceiver_address(fsStoreOrder.getUserAddress());
         }
 
+        erpOrder.setStatus(order.getStatus());
+
         // 如果是已发货
         if(ObjectUtil.equal(order.getStatus(), ErpQueryOrderStatusEnum.SENT.getCode())){
             List<ErpDeliverys> deliverysList = new ArrayList<>();
@@ -1028,6 +1030,17 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
             erpOrder.setDelivery_state(1);
         } else {
             erpOrder.setDelivery_state(0);
+            if (ObjectUtil.equal(order.getStatus(), ErpQueryOrderStatusEnum.DELIVERING.getCode())) {
+                List<ErpDeliverys> deliverysList = new ArrayList<>();
+                ErpDeliverys delivery = new ErpDeliverys();
+                delivery.setMail_no(order.getLId());
+                delivery.setExpress_code(order.getLcId());
+                delivery.setExpress_name(order.getLogisticsCompany());
+                delivery.setDelivery(false);
+                delivery.setCode(order.getSoId());
+                deliverysList.add(delivery);
+                erpOrder.setDeliverys(deliverysList);
+            }
         }
 
         return erpOrder;

+ 14 - 0
fs-service/src/main/java/com/fs/his/domain/FsArticle.java

@@ -32,6 +32,10 @@ public class FsArticle extends BaseEntity
     @Excel(name = "封面图片")
     private String imageUrl;
 
+    /** 视频地址 */
+    @Excel(name = "视频地址")
+    private String videoUrl;
+
     /** 是否推荐 */
     @Excel(name = "是否推荐")
     private Integer isTui;
@@ -93,6 +97,15 @@ public class FsArticle extends BaseEntity
     {
         return imageUrl;
     }
+    public void setVideoUrl(String videoUrl)
+    {
+        this.videoUrl = videoUrl;
+    }
+
+    public String getVideoUrl()
+    {
+        return videoUrl;
+    }
     public void setIsTui(Integer isTui) 
     {
         this.isTui = isTui;
@@ -155,6 +168,7 @@ public class FsArticle extends BaseEntity
             .append("cateId", getCateId())
             .append("title", getTitle())
             .append("imageUrl", getImageUrl())
+            .append("videoUrl", getVideoUrl())
             .append("isTui", getIsTui())
             .append("isNews", getIsNews())
             .append("contents", getContents())

+ 1 - 1
fs-service/src/main/java/com/fs/his/domain/FsExternalOrder.java

@@ -70,7 +70,7 @@ public class FsExternalOrder extends BaseEntity
 
     private Integer payType;
 
-    @Excel(name = "订单状态", readConverterExp = "-3=已取消,1=未审核,2=审核通过,3=已发货,4=已回款")
+    @Excel(name = "订单状态", readConverterExp = "-3=已取消,1=未审核,2=审核通过,5=发货中,3=已发货,4=已回款")
     private Integer status;
 
     @Excel(name = "快递公司编号")

+ 74 - 0
fs-service/src/main/java/com/fs/his/domain/SysRedpacketConfigMore.java

@@ -0,0 +1,74 @@
+package com.fs.his.domain;
+
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 多商户配置对象 sys_redpacket_config_more
+ *
+ * @author fs
+ * @date 2025-11-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SysRedpacketConfigMore  {
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 0:老商户 商家转账到零钱 1:新商户 商家转账 */
+    @Excel(name = "0:老商户 商家转账到零钱 1:新商户 商家转账")
+    private Integer isNew;
+
+    /** 公众号appId */
+    @Excel(name = "公众号appId")
+    private String appId;
+
+    /** 小程序appId */
+    @Excel(name = "小程序appId")
+    private String miniappId;
+
+    /** 商户号 */
+    @Excel(name = "商户号")
+    private String mchId;
+
+    /** 商户密钥 */
+    @Excel(name = "商户密钥")
+    private String mchKey;
+
+    /** p12证书文件的绝对路径或者以classpath:开头的类路径. */
+    @Excel(name = "p12证书文件的绝对路径或者以classpath:开头的类路径.")
+    private String keyPath;
+
+    /** apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径. */
+    @Excel(name = "apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径.")
+    private String privateKeyPath;
+
+    /** apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径. */
+    @Excel(name = "apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径.")
+    private String privateCertPath;
+
+    /** apiV3 秘钥值. */
+    @Excel(name = "apiV3 秘钥值.")
+    private String apiV3Key;
+
+    /** 公钥ID */
+    @Excel(name = "公钥ID")
+    private String publicKeyId;
+
+    /** pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径. */
+    @Excel(name = "pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径.")
+    private String publicKeyPath;
+
+    /** 回调地址 */
+    @Excel(name = "回调地址")
+    private String notifyUrl;
+
+    /** $column.columnComment */
+    @Excel(name = "回调地址")
+    private String notifyUrlScrm;
+
+
+}

+ 1 - 1
fs-service/src/main/java/com/fs/his/domain/vo/FsExternalOrderListVO.java

@@ -19,7 +19,7 @@ public class FsExternalOrderListVO {
     @Excel(name = "会员ID", sort = 2)
     private Long userId;
 
-    @Excel(name = "订单状态", readConverterExp = "-4=订单拒收,-3=已取消,1=未审核,2=审核通过,3=已发货,4=已回款", sort = 3)
+    @Excel(name = "订单状态", readConverterExp = "-4=订单拒收,-3=已取消,1=未审核,2=审核通过,5=发货中,3=已发货,4=已回款", sort = 3)
     private Integer status;
 
     @Excel(name = "订单类型", readConverterExp = "1=外部订单,2=套餐包,3=问诊,4=积分", sort = 4)

+ 1 - 1
fs-service/src/main/java/com/fs/his/mapper/FsExternalOrderMapper.java

@@ -45,7 +45,7 @@ public interface FsExternalOrderMapper {
     @Select("SELECT order_id FROM fs_external_order WHERE extend_order_id is null AND status =2")
     List<Long> selectUnsyncedOrderIds();
 
-    @Select("SELECT * FROM fs_external_order WHERE extend_order_id IS NOT NULL AND status =2")
+    @Select("SELECT * FROM fs_external_order WHERE extend_order_id IS NOT NULL AND status IN (2, 5)")
     List<FsExternalOrder> selectSyncedOrders();
 
     List<FsExternalOrder> selectSignedOrdersWithoutAudit();

+ 71 - 0
fs-service/src/main/java/com/fs/his/mapper/SysRedpacketConfigMoreMapper.java

@@ -0,0 +1,71 @@
+package com.fs.his.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.SysRedpacketConfigMore;
+
+import java.util.List;
+
+/**
+ * 多商户配置Mapper接口
+ *
+ * @author fs
+ * @date 2025-11-27
+ */
+public interface SysRedpacketConfigMoreMapper extends BaseMapper<SysRedpacketConfigMore> {
+    /**
+     * 查询多商户配置
+     *
+     * @param id 多商户配置主键
+     * @return 多商户配置
+     */
+    SysRedpacketConfigMore selectSysRedpacketConfigMoreById(Long id);
+
+    /**
+     * 查询多商户配置列表
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 多商户配置集合
+     */
+    List<SysRedpacketConfigMore> selectSysRedpacketConfigMoreList(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 新增多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    int insertSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 修改多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    int updateSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 删除多商户配置
+     *
+     * @param id 多商户配置主键
+     * @return 结果
+     */
+    int deleteSysRedpacketConfigMoreById(Long id);
+
+    /**
+     * 批量删除多商户配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteSysRedpacketConfigMoreByIds(Long[] ids);
+
+    /**
+     * 通过商户号查询多商户配置
+     *
+     * @param mchId 商户号
+     * @return 多商户配置
+     */
+    SysRedpacketConfigMore selectSysRedpacketConfigMoreByMchId(String mchId);
+}

+ 9 - 0
fs-service/src/main/java/com/fs/his/param/updateChangeMchIdParam.java

@@ -0,0 +1,9 @@
+package com.fs.his.param;
+
+import lombok.Data;
+
+@Data
+public class updateChangeMchIdParam {
+    private Long oldChangeMchId;
+    private Long newChangeMchId;
+}

+ 69 - 0
fs-service/src/main/java/com/fs/his/service/ISysRedpacketConfigMoreService.java

@@ -0,0 +1,69 @@
+package com.fs.his.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.SysRedpacketConfigMore;
+import com.fs.his.param.updateChangeMchIdParam;
+
+import java.util.List;
+
+/**
+ * 多商户配置Service接口
+ *
+ * @author fs
+ * @date 2025-11-27
+ */
+public interface ISysRedpacketConfigMoreService extends IService<SysRedpacketConfigMore> {
+    /**
+     * 查询多商户配置
+     *
+     * @param id 多商户配置主键
+     * @return 多商户配置
+     */
+    SysRedpacketConfigMore selectSysRedpacketConfigMoreById(Long id);
+    Long getRedPacketConFig();
+    R updateChangeMchId(updateChangeMchIdParam param);
+    void changeRedPacketConfig();
+
+
+    /**
+     * 查询多商户配置列表
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 多商户配置集合
+     */
+    List<SysRedpacketConfigMore> selectSysRedpacketConfigMoreList(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 新增多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    int insertSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 修改多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    int updateSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore);
+
+    /**
+     * 批量删除多商户配置
+     *
+     * @param ids 需要删除的多商户配置主键集合
+     * @return 结果
+     */
+    int deleteSysRedpacketConfigMoreByIds(Long[] ids);
+
+    /**
+     * 删除多商户配置信息
+     *
+     * @param id 多商户配置主键
+     * @return 结果
+     */
+    int deleteSysRedpacketConfigMoreById(Long id);
+}

+ 84 - 6
fs-service/src/main/java/com/fs/his/service/impl/FsExternalOrderServiceImpl.java

@@ -18,6 +18,7 @@ import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.common.core.domain.R;
 import com.fs.core.utils.OrderCodeUtils;
+import com.fs.erp.constant.ErpQueryOrderStatusEnum;
 import com.fs.erp.domain.ErpDeliverys;
 import com.fs.erp.domain.ErpOrder;
 import com.fs.erp.domain.ErpOrderItem;
@@ -701,16 +702,28 @@ public class FsExternalOrderServiceImpl implements IFsExternalOrderService {
                     continue;
                 }
 
+                // 按聚水潭订单状态回写本地:Sent=已发货(3),Delivering=发货中(5)
                 for (ErpOrderQuery orderQuery : response.getOrders()) {
-                    log.info("同步外部订单 {} 发货信息:  deliverys={}",
+                    log.info("同步外部订单 {} 聚水潭状态: {}, deliverys={}",
                             order.getOrderCode(),
+                            orderQuery.getStatus(),
                             JSON.toJSONString(orderQuery.getDeliverys()));
-                    if (orderQuery.getDeliverys() != null && !orderQuery.getDeliverys().isEmpty()) {
+                    // 已发货:有快递单号才更新为 status=3,并订阅物流
+                    if (ErpQueryOrderStatusEnum.SENT.getCode().equals(orderQuery.getStatus())) {
+                        ErpDeliverys shipped = firstDelivery(orderQuery);
+                        if (shipped != null && StringUtils.isNotEmpty(shipped.getMail_no())) {
+                            updateOrderDelivery(order, shipped);
+                        }
+                    // 发货中:更新为 status=5,不订阅物流、不置为已发货
+                    } else if (ErpQueryOrderStatusEnum.DELIVERING.getCode().equals(orderQuery.getStatus())) {
+                        updateOrderDelivering(order, firstDelivery(orderQuery));
+                    // 状态未识别时:若发货明细已标记发出且有单号,仍按已发货处理
+                    } else if (orderQuery.getDeliverys() != null && !orderQuery.getDeliverys().isEmpty()) {
                         for (ErpDeliverys delivery : orderQuery.getDeliverys()) {
                             log.info("发货明细: delivery={}, mail_no={}, express_code={}, express_name={}",
                                     delivery.getDelivery(), delivery.getMail_no(),
                                     delivery.getExpress_code(), delivery.getExpress_name());
-                            if (delivery.getDelivery() && StringUtils.isNotEmpty(delivery.getMail_no())) {
+                            if (Boolean.TRUE.equals(delivery.getDelivery()) && StringUtils.isNotEmpty(delivery.getMail_no())) {
                                 updateOrderDelivery(order, delivery);
                             }
                         }
@@ -774,10 +787,11 @@ public class FsExternalOrderServiceImpl implements IFsExternalOrderService {
         }
 
         String mailNo = delivery.getMail_no();
-        boolean hasSubscribed = currentOrder.getStatus() != null
-                && currentOrder.getStatus() != 2
+        Integer currentStatus = currentOrder.getStatus();
+        boolean alreadyShipped = currentStatus != null
+                && (currentStatus == 3 || currentStatus == 4)
                 && StringUtils.equals(currentOrder.getDeliverySn(), mailNo);
-        if (hasSubscribed) {
+        if (alreadyShipped) {
             return;
         }
 
@@ -815,6 +829,70 @@ public class FsExternalOrderServiceImpl implements IFsExternalOrderService {
         log.info("外部订单已发货: {}, 快递: {}, 单号: {}", localOrder.getOrderCode(), deliveryCode, mailNo);
     }
 
+    private ErpDeliverys firstDelivery(ErpOrderQuery orderQuery) {
+        if (orderQuery == null || CollectionUtils.isEmpty(orderQuery.getDeliverys())) {
+            return null;
+        }
+        return orderQuery.getDeliverys().get(0);
+    }
+
+    /**
+     * 聚水潭「发货中」同步为本地 status=5,不订阅物流、不置为已发货
+     */
+    private void updateOrderDelivering(FsExternalOrder localOrder, ErpDeliverys delivery) {
+        FsExternalOrder currentOrder = fsExternalOrderMapper.selectFsExternalOrderByOrderId(localOrder.getOrderId());
+        if (currentOrder == null) {
+            return;
+        }
+        Integer currentStatus = currentOrder.getStatus();
+        if (currentStatus != null && (currentStatus == 3 || currentStatus == 4 || currentStatus == -3 || currentStatus == -4)) {
+            return;
+        }
+
+        FsExternalOrder updateOrder = new FsExternalOrder();
+        updateOrder.setOrderId(localOrder.getOrderId());
+        updateOrder.setStatus(5);
+        fillDeliveryCompany(updateOrder, delivery);
+        if (delivery != null && StringUtils.isNotBlank(delivery.getMail_no())) {
+            updateOrder.setDeliverySn(delivery.getMail_no());
+        }
+        fsExternalOrderMapper.updateFsExternalOrder(updateOrder);
+        log.info("外部订单发货中: {}, 快递: {}, 单号: {}",
+                localOrder.getOrderCode(),
+                updateOrder.getDeliveryCode(),
+                updateOrder.getDeliverySn());
+    }
+
+    private void fillDeliveryCompany(FsExternalOrder updateOrder, ErpDeliverys delivery) {
+        if (delivery == null) {
+            return;
+        }
+        String deliveryCode = delivery.getExpress_code();
+        String deliveryName = delivery.getExpress_name();
+        if (StringUtils.isBlank(deliveryCode)) {
+            if (StringUtils.isNotBlank(deliveryName)) {
+                updateOrder.setDeliveryName(deliveryName);
+            }
+            return;
+        }
+        FsExpress express = expressService.selectFsExpressByOmsCode(deliveryCode);
+        if (express == null) {
+            express = expressService.selectFsExpressByCode(deliveryCode);
+        }
+        if (express == null && StringUtils.isNotBlank(deliveryName)) {
+            express = expressService.selectFsExpressByName(deliveryName);
+        }
+        if (express != null) {
+            updateOrder.setDeliveryName(express.getName());
+            updateOrder.setDeliveryCode(express.getCode());
+        } else {
+            updateOrder.setDeliveryCode(deliveryCode);
+            if (StringUtils.isNotBlank(deliveryName)) {
+                updateOrder.setDeliveryName(deliveryName);
+            }
+        }
+    }
+
     private void subscribeExternalOrderExpress(FsExternalOrder order, String deliveryCode, String deliverySn) {
         if (order == null || StringUtils.isBlank(deliveryCode) || StringUtils.isBlank(deliverySn)) {
             return;

+ 205 - 0
fs-service/src/main/java/com/fs/his/service/impl/SysRedpacketConfigMoreServiceImpl.java

@@ -0,0 +1,205 @@
+package com.fs.his.service.impl;
+
+
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.BeanCopyUtils;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.course.config.RedPacketConfig;
+import com.fs.his.domain.SysRedpacketConfigMore;
+import com.fs.his.mapper.SysRedpacketConfigMoreMapper;
+import com.fs.his.param.updateChangeMchIdParam;
+import com.fs.his.service.ISysRedpacketConfigMoreService;
+import com.fs.system.service.ISysConfigService;
+import io.netty.util.internal.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 多商户配置Service业务层处理
+ *
+ * @author fs
+ * @date 2025-11-27
+ */
+@Slf4j
+@Service
+public class SysRedpacketConfigMoreServiceImpl extends ServiceImpl<SysRedpacketConfigMoreMapper, SysRedpacketConfigMore> implements ISysRedpacketConfigMoreService {
+
+
+    @Autowired
+    private ISysConfigService configService;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 查询多商户配置
+     *
+     * @param id 多商户配置主键
+     * @return 多商户配置
+     */
+    @Override
+    public SysRedpacketConfigMore selectSysRedpacketConfigMoreById(Long id)
+    {
+        return baseMapper.selectSysRedpacketConfigMoreById(id);
+    }
+
+    @Override
+    public Long getRedPacketConFig() {
+
+        String json = redisCache.getCacheObject("sys_config:redPacket.config.new");
+        if (StringUtil.isNullOrEmpty(json) || json.isEmpty()) {
+            json = configService.selectConfigByKey("redPacket.config");
+        }
+
+        RedPacketConfig config   = JSONUtil.toBean(json, RedPacketConfig.class);
+
+        return Long.valueOf(config.getMchId());
+
+    }
+
+    @Override
+    public R updateChangeMchId(updateChangeMchIdParam param) {
+
+        SysRedpacketConfigMore configMore = baseMapper.selectOne(new QueryWrapper<SysRedpacketConfigMore>().eq("mch_id", param.getNewChangeMchId()));
+
+        if (configMore == null || configMore.getMchId() == null) {
+            return R.error("商户号不存在");
+        }
+
+        RedPacketConfig config = new RedPacketConfig();
+        BeanCopyUtils.copy(configMore,config);
+
+        if (config.getMchId()!=null){
+            redisCache.setCacheObject("sys_config:redPacket.config.new", JSONUtil.toJsonStr(config));
+            redisCache.deleteObject("sys_config:redPacket.config.newCount");
+        }
+
+        return R.ok();
+    }
+
+    @Override
+    public void changeRedPacketConfig() {
+        Integer count = redisCache.getCacheObject("sys_config:redPacket.config.newCount");
+        if (count != null && count >= 1000) {
+            String json = redisCache.getCacheObject("sys_config:redPacket.config.new");
+            if (StringUtil.isNullOrEmpty(json) || json.isEmpty()) {
+                json = configService.selectConfigByKey("redPacket.config");
+            }
+
+            RedPacketConfig config   = JSONUtil.toBean(json, RedPacketConfig.class);
+
+            SysRedpacketConfigMore configMore = baseMapper.selectOne(new QueryWrapper<SysRedpacketConfigMore>().eq("mch_id", config.getMchId()));
+
+            if (configMore == null) {
+                log.error("获取不到商户号");
+                return;
+            }
+
+            List<SysRedpacketConfigMore> configMoreList = baseMapper.selectList(
+                    new QueryWrapper<SysRedpacketConfigMore>().orderByAsc("id")
+            );
+
+            // 空列表处理
+            if (configMoreList.isEmpty()) {
+                log.error("商户号列表为空");
+                return;
+            }
+
+
+            // 查找当前元素的索引
+            int currentIndex = -1;
+            Long currentId = configMore.getId();
+
+            for (int i = 0; i < configMoreList.size(); i++) {
+                if (configMoreList.get(i).getId().equals(currentId)) {
+                    currentIndex = i;
+                    break;
+                }
+            }
+
+            // 计算下一个索引(使用取模实现循环)
+            int nextIndex = (currentIndex + 1) % configMoreList.size();
+
+            SysRedpacketConfigMore configMoreNew = configMoreList.get(nextIndex);
+
+
+            RedPacketConfig configNew = new RedPacketConfig();
+            BeanCopyUtils.copy(configMoreNew,configNew);
+
+            if (configNew.getMchId()!=null){
+                log.info("自动切换商户号-原:"+configMore.getMchId()+"-新:"+configNew.getMchId());
+                redisCache.setCacheObject("sys_config:redPacket.config.new", JSONUtil.toJsonStr(configNew));
+                redisCache.deleteObject("sys_config:redPacket.config.newCount");
+            }
+        }
+    }
+
+
+
+
+    /**
+     * 查询多商户配置列表
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 多商户配置
+     */
+    @Override
+    public List<SysRedpacketConfigMore> selectSysRedpacketConfigMoreList(SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        return baseMapper.selectSysRedpacketConfigMoreList(sysRedpacketConfigMore);
+    }
+
+    /**
+     * 新增多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    @Override
+    public int insertSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        return baseMapper.insertSysRedpacketConfigMore(sysRedpacketConfigMore);
+    }
+
+    /**
+     * 修改多商户配置
+     *
+     * @param sysRedpacketConfigMore 多商户配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysRedpacketConfigMore(SysRedpacketConfigMore sysRedpacketConfigMore)
+    {
+        return baseMapper.updateSysRedpacketConfigMore(sysRedpacketConfigMore);
+    }
+
+    /**
+     * 批量删除多商户配置
+     *
+     * @param ids 需要删除的多商户配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysRedpacketConfigMoreByIds(Long[] ids)
+    {
+        return baseMapper.deleteSysRedpacketConfigMoreByIds(ids);
+    }
+
+    /**
+     * 删除多商户配置信息
+     *
+     * @param id 多商户配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysRedpacketConfigMoreById(Long id)
+    {
+        return baseMapper.deleteSysRedpacketConfigMoreById(id);
+    }
+}

+ 3 - 0
fs-service/src/main/java/com/fs/his/vo/FsArticleVO.java

@@ -28,6 +28,9 @@ public class FsArticleVO implements Serializable {
     @Excel(name = "封面图片")
     private String imageUrl;
 
+    /** 视频地址 */
+    private String videoUrl;
+
     /** 是否推荐 */
     @Excel(name = "是否推荐")
     private Integer isTui;

+ 14 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsArticleScrm.java

@@ -35,6 +35,10 @@ public class FsArticleScrm extends BaseEntity
     @Excel(name = "封面图片")
     private String imageUrl;
 
+    /** 视频地址 */
+    @Excel(name = "视频地址")
+    private String videoUrl;
+
     /** 是否推荐 */
     @Excel(name = "是否推荐")
     private Integer isTui;
@@ -96,6 +100,15 @@ public class FsArticleScrm extends BaseEntity
     {
         return imageUrl;
     }
+    public void setVideoUrl(String videoUrl)
+    {
+        this.videoUrl = videoUrl;
+    }
+
+    public String getVideoUrl()
+    {
+        return videoUrl;
+    }
     public void setIsTui(Integer isTui) 
     {
         this.isTui = isTui;
@@ -158,6 +171,7 @@ public class FsArticleScrm extends BaseEntity
             .append("cateId", getCateId())
             .append("title", getTitle())
             .append("imageUrl", getImageUrl())
+            .append("videoUrl", getVideoUrl())
             .append("isTui", getIsTui())
             .append("isNews", getIsNews())
             .append("contents", getContents())

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsArticleVO.java

@@ -26,6 +26,9 @@ public class FsArticleVO implements Serializable
     @Excel(name = "封面图片")
     private String imageUrl;
 
+    /** 视频地址 */
+    private String videoUrl;
+
     /** 是否推荐 */
     @Excel(name = "是否推荐")
     private Integer isTui;

+ 21 - 0
fs-service/src/main/resources/mapper/course/FsCourseTrafficLogMapper.xml

@@ -326,6 +326,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="selectDailyTrafficByAppId" resultType="com.fs.course.vo.FsMiniappDailyTrafficVO">
+        SELECT
+            DATE_FORMAT(log.create_time, '%Y-%m-%d') AS stat_date,
+            log.app_id AS app_id,
+            SUM(log.internet_traffic) AS total_internet_traffic
+        FROM fs_course_traffic_log log
+        <where>
+            <if test="appId != null and appId != ''">
+                AND log.app_id = #{appId}
+            </if>
+            <if test="startDate != null and startDate != ''">
+                AND log.create_time &gt;= CONCAT(#{startDate}, ' 00:00:00')
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND log.create_time &lt;= CONCAT(#{endDate}, ' 23:59:59')
+            </if>
+        </where>
+        GROUP BY DATE_FORMAT(log.create_time, '%Y-%m-%d'), log.app_id
+        ORDER BY stat_date DESC
+    </select>
+
     <select id="selectTrafficByCompany" parameterType="com.fs.course.param.FsCourseTrafficLogParam"
             resultType="com.fs.course.vo.FsCourseTrafficLogListVO">
         SELECT

+ 5 - 1
fs-service/src/main/resources/mapper/his/FsArticleMapper.xml

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="cateId"    column="cate_id"    />
         <result property="title"    column="title"    />
         <result property="imageUrl"    column="image_url"    />
+        <result property="videoUrl"    column="video_url"    />
         <result property="isTui"    column="is_tui"    />
         <result property="isNews"    column="is_news"    />
         <result property="contents"    column="contents"    />
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsArticleVo">
-        select article_id, cate_id, title, image_url, is_tui, is_news, contents, views, sort, create_time, update_time, publish_time from fs_article
+        select article_id, cate_id, title, image_url, video_url, is_tui, is_news, contents, views, sort, create_time, update_time, publish_time from fs_article
     </sql>
 
     <select id="selectFsArticleList" parameterType="FsArticle" resultMap="FsArticleResult">
@@ -68,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">cate_id,</if>
             <if test="title != null">title,</if>
             <if test="imageUrl != null">image_url,</if>
+            <if test="videoUrl != null">video_url,</if>
             <if test="isTui != null">is_tui,</if>
             <if test="isNews != null">is_news,</if>
             <if test="contents != null">contents,</if>
@@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">#{cateId},</if>
             <if test="title != null">#{title},</if>
             <if test="imageUrl != null">#{imageUrl},</if>
+            <if test="videoUrl != null">#{videoUrl},</if>
             <if test="isTui != null">#{isTui},</if>
             <if test="isNews != null">#{isNews},</if>
             <if test="contents != null">#{contents},</if>
@@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">cate_id = #{cateId},</if>
             <if test="title != null">title = #{title},</if>
             <if test="imageUrl != null">image_url = #{imageUrl},</if>
+            <if test="videoUrl != null">video_url = #{videoUrl},</if>
             <if test="isTui != null">is_tui = #{isTui},</if>
             <if test="isNews != null">is_news = #{isNews},</if>
             <if test="contents != null">contents = #{contents},</if>

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsExternalOrderMapper.xml

@@ -338,6 +338,7 @@
             CASE o.status
                 WHEN 1  THEN '未审核'
                 WHEN 2  THEN '审核通过'
+                WHEN 5  THEN '发货中'
                 WHEN 3  THEN '已发货'
                 WHEN 4  THEN '已回款'
                 WHEN -4 THEN '订单拒收'

+ 123 - 0
fs-service/src/main/resources/mapper/his/SysRedpacketConfigMoreMapper.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.SysRedpacketConfigMoreMapper">
+
+    <resultMap type="SysRedpacketConfigMore" id="SysRedpacketConfigMoreResult">
+        <result property="id"    column="id"    />
+        <result property="isNew"    column="is_new"    />
+        <result property="appId"    column="app_id"    />
+        <result property="miniappId"    column="miniapp_id"    />
+        <result property="mchId"    column="mch_id"    />
+        <result property="mchKey"    column="mch_key"    />
+        <result property="keyPath"    column="key_path"    />
+        <result property="privateKeyPath"    column="private_key_path"    />
+        <result property="privateCertPath"    column="private_cert_path"    />
+        <result property="apiV3Key"    column="api_v3_key"    />
+        <result property="publicKeyId"    column="public_key_id"    />
+        <result property="publicKeyPath"    column="public_key_path"    />
+        <result property="notifyUrl"    column="notify_url"    />
+        <result property="notifyUrlScrm"    column="notify_url_scrm"    />
+    </resultMap>
+
+    <sql id="selectSysRedpacketConfigMoreVo">
+        select id, is_new, app_id, miniapp_id, mch_id, mch_key, key_path, private_key_path, private_cert_path, api_v3_key, public_key_id, public_key_path, notify_url, notify_url_scrm from sys_redpacket_config_more
+    </sql>
+
+    <select id="selectSysRedpacketConfigMoreList" parameterType="SysRedpacketConfigMore" resultMap="SysRedpacketConfigMoreResult">
+        <include refid="selectSysRedpacketConfigMoreVo"/>
+        <where>
+            <if test="isNew != null "> and is_new = #{isNew}</if>
+            <if test="appId != null  and appId != ''"> and app_id = #{appId}</if>
+            <if test="miniappId != null  and miniappId != ''"> and miniapp_id = #{miniappId}</if>
+            <if test="mchId != null  and mchId != ''"> and mch_id = #{mchId}</if>
+            <if test="mchKey != null  and mchKey != ''"> and mch_key = #{mchKey}</if>
+            <if test="keyPath != null  and keyPath != ''"> and key_path = #{keyPath}</if>
+            <if test="privateKeyPath != null  and privateKeyPath != ''"> and private_key_path = #{privateKeyPath}</if>
+            <if test="privateCertPath != null  and privateCertPath != ''"> and private_cert_path = #{privateCertPath}</if>
+            <if test="apiV3Key != null  and apiV3Key != ''"> and api_v3_key = #{apiV3Key}</if>
+            <if test="publicKeyId != null  and publicKeyId != ''"> and public_key_id = #{publicKeyId}</if>
+            <if test="publicKeyPath != null  and publicKeyPath != ''"> and public_key_path = #{publicKeyPath}</if>
+            <if test="notifyUrl != null  and notifyUrl != ''"> and notify_url = #{notifyUrl}</if>
+            <if test="notifyUrlScrm != null  and notifyUrlScrm != ''"> and notify_url_scrm = #{notifyUrlScrm}</if>
+        </where>
+    </select>
+
+    <select id="selectSysRedpacketConfigMoreById" parameterType="Long" resultMap="SysRedpacketConfigMoreResult">
+        <include refid="selectSysRedpacketConfigMoreVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSysRedpacketConfigMore" parameterType="SysRedpacketConfigMore">
+        insert into sys_redpacket_config_more
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="isNew != null">is_new,</if>
+            <if test="appId != null">app_id,</if>
+            <if test="miniappId != null">miniapp_id,</if>
+            <if test="mchId != null">mch_id,</if>
+            <if test="mchKey != null">mch_key,</if>
+            <if test="keyPath != null">key_path,</if>
+            <if test="privateKeyPath != null">private_key_path,</if>
+            <if test="privateCertPath != null">private_cert_path,</if>
+            <if test="apiV3Key != null">api_v3_key,</if>
+            <if test="publicKeyId != null">public_key_id,</if>
+            <if test="publicKeyPath != null">public_key_path,</if>
+            <if test="notifyUrl != null">notify_url,</if>
+            <if test="notifyUrlScrm != null">notify_url_scrm,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="isNew != null">#{isNew},</if>
+            <if test="appId != null">#{appId},</if>
+            <if test="miniappId != null">#{miniappId},</if>
+            <if test="mchId != null">#{mchId},</if>
+            <if test="mchKey != null">#{mchKey},</if>
+            <if test="keyPath != null">#{keyPath},</if>
+            <if test="privateKeyPath != null">#{privateKeyPath},</if>
+            <if test="privateCertPath != null">#{privateCertPath},</if>
+            <if test="apiV3Key != null">#{apiV3Key},</if>
+            <if test="publicKeyId != null">#{publicKeyId},</if>
+            <if test="publicKeyPath != null">#{publicKeyPath},</if>
+            <if test="notifyUrl != null">#{notifyUrl},</if>
+            <if test="notifyUrlScrm != null">#{notifyUrlScrm},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysRedpacketConfigMore" parameterType="SysRedpacketConfigMore">
+        update sys_redpacket_config_more
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="isNew != null">is_new = #{isNew},</if>
+            <if test="appId != null">app_id = #{appId},</if>
+            <if test="miniappId != null">miniapp_id = #{miniappId},</if>
+            <if test="mchId != null">mch_id = #{mchId},</if>
+            <if test="mchKey != null">mch_key = #{mchKey},</if>
+            <if test="keyPath != null">key_path = #{keyPath},</if>
+            <if test="privateKeyPath != null">private_key_path = #{privateKeyPath},</if>
+            <if test="privateCertPath != null">private_cert_path = #{privateCertPath},</if>
+            <if test="apiV3Key != null">api_v3_key = #{apiV3Key},</if>
+            <if test="publicKeyId != null">public_key_id = #{publicKeyId},</if>
+            <if test="publicKeyPath != null">public_key_path = #{publicKeyPath},</if>
+            <if test="notifyUrl != null">notify_url = #{notifyUrl},</if>
+            <if test="notifyUrlScrm != null">notify_url_scrm = #{notifyUrlScrm},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysRedpacketConfigMoreById" parameterType="Long">
+        delete from sys_redpacket_config_more where id = #{id}
+    </delete>
+
+    <delete id="deleteSysRedpacketConfigMoreByIds" parameterType="String">
+        delete from sys_redpacket_config_more where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectSysRedpacketConfigMoreByMchId" parameterType="String" resultMap="SysRedpacketConfigMoreResult">
+        <include refid="selectSysRedpacketConfigMoreVo"/>
+        where mch_id = #{mchId}
+    </select>
+</mapper>

+ 5 - 1
fs-service/src/main/resources/mapper/hisStore/FsArticleScrmMapper.xml

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="cateId"    column="cate_id"    />
         <result property="title"    column="title"    />
         <result property="imageUrl"    column="image_url"    />
+        <result property="videoUrl"    column="video_url"    />
         <result property="isTui"    column="is_tui"    />
         <result property="isNews"    column="is_news"    />
         <result property="contents"    column="contents"    />
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsArticleVo">
-        select article_id, cate_id, title, image_url, is_tui, is_news, contents, views, sort, create_time, update_time, publish_time from fs_article
+        select article_id, cate_id, title, image_url, video_url, is_tui, is_news, contents, views, sort, create_time, update_time, publish_time from fs_article
     </sql>
 
     <select id="selectFsArticleList" parameterType="FsArticleScrm" resultMap="FsArticleResult">
@@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">cate_id,</if>
             <if test="title != null">title,</if>
             <if test="imageUrl != null">image_url,</if>
+            <if test="videoUrl != null">video_url,</if>
             <if test="isTui != null">is_tui,</if>
             <if test="isNews != null">is_news,</if>
             <if test="contents != null">contents,</if>
@@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">#{cateId},</if>
             <if test="title != null">#{title},</if>
             <if test="imageUrl != null">#{imageUrl},</if>
+            <if test="videoUrl != null">#{videoUrl},</if>
             <if test="isTui != null">#{isTui},</if>
             <if test="isNews != null">#{isNews},</if>
             <if test="contents != null">#{contents},</if>
@@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cateId != null">cate_id = #{cateId},</if>
             <if test="title != null">title = #{title},</if>
             <if test="imageUrl != null">image_url = #{imageUrl},</if>
+            <if test="videoUrl != null">video_url = #{videoUrl},</if>
             <if test="isTui != null">is_tui = #{isTui},</if>
             <if test="isNews != null">is_news = #{isNews},</if>
             <if test="contents != null">contents = #{contents},</if>