Prechádzať zdrojové kódy

订单财务审核需求

wangxy 6 dní pred
rodič
commit
70c0e24f8f

+ 37 - 8
fs-company/src/main/java/com/fs/company/controller/store/FsFinanceOrderController.java

@@ -58,14 +58,13 @@ public class FsFinanceOrderController extends BaseController {
      * 下载回款导入模板
      */
     @GetMapping("/importTemplate")
-    @PreAuthorize("@ss.hasPermi('store:financeOrder:import')")
     public AjaxResult importTemplate() {
         ExcelUtil<FsFinanceOrderImportDTO> util = new ExcelUtil<>(FsFinanceOrderImportDTO.class);
         return util.importTemplateExcel("回款导入模板");
     }
 
     /**
-     * 导入回款数据(以快递单号或订单编号匹配)
+     * 导入回款数据(以快递单号匹配)
      */
     @Log(title = "财务回款导入", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('store:financeOrder:import')")
@@ -80,11 +79,20 @@ public class FsFinanceOrderController extends BaseController {
         List<FsFinanceOrderImportFailDTO> failList = new ArrayList<>();
 
         for (FsFinanceOrderImportDTO dto : importList) {
-            // 匹配订单
+            // 字段校验
+            String validateMsg = validateImportDto(dto);
+            if (validateMsg != null) {
+                failList.add(new FsFinanceOrderImportFailDTO(
+                        dto.getOrderCode(), dto.getDeliverySn(), null, null, dto.getReturnPrice(), validateMsg));
+                continue;
+            }
+
+            // 匹配订单(按快递单号)
             FsExternalOrder order = matchOrder(dto);
             if (order == null) {
                 failList.add(new FsFinanceOrderImportFailDTO(
-                        dto.getOrderCode(), dto.getDeliverySn(), null, null, dto.getReturnPrice(), "订单不存在"));
+                        dto.getOrderCode(), dto.getDeliverySn(), null, null, dto.getReturnPrice(),
+                        "快递单号未匹配到订单"));
                 continue;
             }
 
@@ -128,14 +136,35 @@ public class FsFinanceOrderController extends BaseController {
         return AjaxResult.success("导入成功 " + successCount + " 条,失败 0 条");
     }
 
-    /** 根据订单编号匹配订单 */
-    private FsExternalOrder matchOrder(FsFinanceOrderImportDTO dto) {
-        if (dto.getOrderCode() != null && !dto.getOrderCode().isEmpty()) {
-            return fsExternalOrderMapper.selectFsExternalOrderByOrderCode(dto.getOrderCode());
+    /** 导入字段校验,返回 null 表示通过,否则返回失败原因 */
+    private String validateImportDto(FsFinanceOrderImportDTO dto) {
+        if (dto.getDeliverySn() == null || dto.getDeliverySn().trim().isEmpty()) {
+            return "快递单号不能为空";
+        }
+        if (dto.getReturnPrice() == null) {
+            return "回款金额不能为空";
+        }
+        if (dto.getReturnPrice().compareTo(BigDecimal.ZERO) <= 0) {
+            return "回款金额必须大于0";
         }
         return null;
     }
 
+    /** 根据快递单号匹配订单 */
+    private FsExternalOrder matchOrder(FsFinanceOrderImportDTO dto) {
+        if (dto.getDeliverySn() == null || dto.getDeliverySn().isEmpty()) {
+            return null;
+        }
+        List<FsExternalOrder> list = fsExternalOrderMapper.selectFsExternalOrderListByDeliverySn(dto.getDeliverySn());
+        if (list == null || list.isEmpty()) {
+            return null;
+        }
+        if (list.size() > 1) {
+            logger.warn("快递单号 {} 对应多条订单,取第一条", dto.getDeliverySn());
+        }
+        return list.get(0);
+    }
+
     @Log(title = "修改回款金额", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('store:financeOrder:edit')")
     @PostMapping("/edit")

+ 33 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsRejectNoReturnController.java

@@ -11,6 +11,8 @@ import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.his.domain.FsExternalOrder;
 import com.fs.his.domain.vo.FsRejectNoReturnReportVO;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.service.IFsExternalOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -30,6 +32,9 @@ public class FsRejectNoReturnController extends BaseController {
     @Autowired
     private IFsExternalOrderService fsExternalOrderService;
 
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
     /**
      * 拒收未还货列表
      */
@@ -57,4 +62,32 @@ public class FsRejectNoReturnController extends BaseController {
         ExcelUtil<FsRejectNoReturnReportVO> util = new ExcelUtil<>(FsRejectNoReturnReportVO.class);
         return util.exportExcel(list, "拒收未还货报表");
     }
+
+    /**
+     * 拒收未还货列表(药品订单)
+     */
+    @GetMapping("/storeList")
+    @Log(title = "拒收未还货查询列表(药品)", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:rejectNoReturn:list')")
+    public TableDataInfo storeList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectNoReturnReportVO> list = fsStoreOrderMapper.selectStoreRejectNoReturnReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 拒收未还货导出(药品订单)
+     */
+    @GetMapping("/storeExport")
+    @Log(title = "拒收未还货查询导出(药品)", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:rejectNoReturn:list')")
+    public AjaxResult storeExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectNoReturnReportVO> list = fsStoreOrderMapper.selectStoreRejectNoReturnReport(param);
+        ExcelUtil<FsRejectNoReturnReportVO> util = new ExcelUtil<>(FsRejectNoReturnReportVO.class);
+        return util.exportExcel(list, "拒收未还货报表(药品)");
+    }
 }

+ 61 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsRejectReportController.java

@@ -12,6 +12,8 @@ import com.fs.framework.security.SecurityUtils;
 import com.fs.his.domain.FsExternalOrder;
 import com.fs.his.domain.vo.FsRejectOrderReportVO;
 import com.fs.his.domain.vo.FsRejectProductReportVO;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.service.IFsExternalOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -31,6 +33,9 @@ public class FsRejectReportController extends BaseController {
     @Autowired
     private IFsExternalOrderService fsExternalOrderService;
 
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
     /**
      * 拒收明细 - 订单维度列表
      */
@@ -86,4 +91,60 @@ public class FsRejectReportController extends BaseController {
         ExcelUtil<FsRejectProductReportVO> util = new ExcelUtil<>(FsRejectProductReportVO.class);
         return util.exportExcel(list, "拒收明细产品报表");
     }
+
+    /**
+     * 拒收明细(药品订单) - 订单维度列表
+     */
+    @GetMapping("/storeOrderList")
+    @Log(title = "拒收明细报表(药品)订单维度", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:rejectReport:list')")
+    public TableDataInfo storeOrderList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectOrderReportVO> list = fsStoreOrderMapper.selectStoreRejectOrderReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 拒收明细(药品订单) - 订单维度导出
+     */
+    @GetMapping("/storeOrderExport")
+    @Log(title = "拒收明细报表(药品)订单维度导出", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:rejectReport:list')")
+    public AjaxResult storeOrderExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectOrderReportVO> list = fsStoreOrderMapper.selectStoreRejectOrderReport(param);
+        ExcelUtil<FsRejectOrderReportVO> util = new ExcelUtil<>(FsRejectOrderReportVO.class);
+        return util.exportExcel(list, "拒收明细订单报表(药品)");
+    }
+
+    /**
+     * 拒收明细(药品订单) - 产品维度列表
+     */
+    @GetMapping("/storeProductList")
+    @Log(title = "拒收明细报表(药品)产品维度", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:rejectReport:list')")
+    public TableDataInfo storeProductList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectProductReportVO> list = fsStoreOrderMapper.selectStoreRejectProductReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 拒收明细(药品订单) - 产品维度导出
+     */
+    @GetMapping("/storeProductExport")
+    @Log(title = "拒收明细报表(药品)产品维度导出", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:rejectReport:list')")
+    public AjaxResult storeProductExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsRejectProductReportVO> list = fsStoreOrderMapper.selectStoreRejectProductReport(param);
+        ExcelUtil<FsRejectProductReportVO> util = new ExcelUtil<>(FsRejectProductReportVO.class);
+        return util.exportExcel(list, "拒收明细产品报表(药品)");
+    }
 }

+ 61 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsReturnReportController.java

@@ -13,6 +13,8 @@ import com.fs.his.domain.FsExternalOrder;
 import com.fs.his.domain.vo.FsReturnOrderReportVO;
 import com.fs.his.domain.vo.FsReturnProductReportVO;
 import com.fs.his.mapper.FsExternalOrderMapper;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,6 +33,9 @@ public class FsReturnReportController extends BaseController {
     @Autowired
     private FsExternalOrderMapper fsExternalOrderMapper;
 
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
     /**
      * 回款明细 - 订单维度列表
      */
@@ -86,4 +91,60 @@ public class FsReturnReportController extends BaseController {
         ExcelUtil<FsReturnProductReportVO> util = new ExcelUtil<>(FsReturnProductReportVO.class);
         return util.exportExcel(list, "回款明细产品报表");
     }
+
+    /**
+     * 回款明细(药品订单) - 订单维度列表
+     */
+    @GetMapping("/storeOrderList")
+    @Log(title = "回款明细报表(药品)订单维度", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:returnReport:list')")
+    public TableDataInfo storeOrderList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsReturnOrderReportVO> list = fsStoreOrderMapper.selectStoreReturnOrderReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 回款明细(药品订单) - 订单维度导出
+     */
+    @GetMapping("/storeOrderExport")
+    @Log(title = "回款明细报表(药品)订单维度导出", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:returnReport:list')")
+    public AjaxResult storeOrderExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsReturnOrderReportVO> list = fsStoreOrderMapper.selectStoreReturnOrderReport(param);
+        ExcelUtil<FsReturnOrderReportVO> util = new ExcelUtil<>(FsReturnOrderReportVO.class);
+        return util.exportExcel(list, "回款明细订单报表(药品)");
+    }
+
+    /**
+     * 回款明细(药品订单) - 产品维度列表
+     */
+    @GetMapping("/storeProductList")
+    @Log(title = "回款明细报表(药品)产品维度", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:returnReport:list')")
+    public TableDataInfo storeProductList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsReturnProductReportVO> list = fsStoreOrderMapper.selectStoreReturnProductReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 回款明细(药品订单) - 产品维度导出
+     */
+    @GetMapping("/storeProductExport")
+    @Log(title = "回款明细报表(药品)产品维度导出", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:returnReport:list')")
+    public AjaxResult storeProductExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsReturnProductReportVO> list = fsStoreOrderMapper.selectStoreReturnProductReport(param);
+        ExcelUtil<FsReturnProductReportVO> util = new ExcelUtil<>(FsReturnProductReportVO.class);
+        return util.exportExcel(list, "回款明细产品报表(药品)");
+    }
 }

+ 29 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsSignDetailReportController.java

@@ -8,6 +8,8 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsExternalOrder;
 import com.fs.his.domain.vo.FsSignDetailReportVO;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.service.IFsExternalOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -27,6 +29,9 @@ public class FsSignDetailReportController extends BaseController {
     @Autowired
     private IFsExternalOrderService fsExternalOrderService;
 
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
     /**
      * 签收情况明细列表(所有公司、部门维度统计)
      */
@@ -50,4 +55,28 @@ public class FsSignDetailReportController extends BaseController {
         ExcelUtil<FsSignDetailReportVO> util = new ExcelUtil<>(FsSignDetailReportVO.class);
         return util.exportExcel(list, "签收情况明细表");
     }
+
+    /**
+     * 签收情况明细列表(药品订单)
+     */
+    @GetMapping("/storeList")
+    @Log(title = "签收情况明细表查询(药品)", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:signDetailReport:list')")
+    public TableDataInfo storeList(FsStoreOrderParam param) {
+        startPage();
+        List<FsSignDetailReportVO> list = fsStoreOrderMapper.selectStoreSignDetailReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 签收情况明细导出(药品订单)
+     */
+    @GetMapping("/storeExport")
+    @Log(title = "签收情况明细表导出(药品)", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:signDetailReport:list')")
+    public AjaxResult storeExport(FsStoreOrderParam param) {
+        List<FsSignDetailReportVO> list = fsStoreOrderMapper.selectStoreSignDetailReport(param);
+        ExcelUtil<FsSignDetailReportVO> util = new ExcelUtil<>(FsSignDetailReportVO.class);
+        return util.exportExcel(list, "签收情况明细表(药品)");
+    }
 }

+ 33 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsSignReportController.java

@@ -11,6 +11,8 @@ import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.his.domain.FsExternalOrder;
 import com.fs.his.domain.vo.FsSignOrderReportVO;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.service.IFsExternalOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -30,6 +32,9 @@ public class FsSignReportController extends BaseController {
     @Autowired
     private IFsExternalOrderService fsExternalOrderService;
 
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
     /**
      * 签收未回款列表
      */
@@ -57,4 +62,32 @@ public class FsSignReportController extends BaseController {
         ExcelUtil<FsSignOrderReportVO> util = new ExcelUtil<>(FsSignOrderReportVO.class);
         return util.exportExcel(list, "签收未回款报表");
     }
+
+    /**
+     * 签收未回款列表(药品订单)
+     */
+    @GetMapping("/storeList")
+    @Log(title = "签收未回款查询列表(药品)", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:signReport:list')")
+    public TableDataInfo storeList(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsSignOrderReportVO> list = fsStoreOrderMapper.selectStoreSignOrderReport(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 签收未回款导出(药品订单)
+     */
+    @GetMapping("/storeExport")
+    @Log(title = "签收未回款查询导出(药品)", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:signReport:list')")
+    public AjaxResult storeExport(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsSignOrderReportVO> list = fsStoreOrderMapper.selectStoreSignOrderReport(param);
+        ExcelUtil<FsSignOrderReportVO> util = new ExcelUtil<>(FsSignOrderReportVO.class);
+        return util.exportExcel(list, "签收未回款报表(药品)");
+    }
 }

+ 150 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsStoreFinanceOrderController.java

@@ -0,0 +1,150 @@
+package com.fs.company.controller.store;
+
+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.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.his.domain.FsStoreOrder;
+import com.fs.his.domain.vo.FsStoreFinanceOrderListVO;
+import com.fs.his.dto.FsFinanceOrderImportDTO;
+import com.fs.his.dto.FsFinanceOrderImportFailDTO;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.param.FsStoreOrderParam;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/storeFinanceOrder")
+public class FsStoreFinanceOrderController extends BaseController {
+
+    @Autowired
+    private FsStoreOrderMapper fsStoreOrderMapper;
+
+    @GetMapping("/list")
+    @Log(title = "财务店铺订单列表", businessType = BusinessType.OTHER)
+    @PreAuthorize("@ss.hasPermi('store:storeFinanceOrder:list')")
+    public TableDataInfo list(FsStoreOrderParam param) {
+        startPage();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStoreFinanceOrderListVO> list = fsStoreOrderMapper.selectStoreFinanceOrderListVO(param);
+        return getDataTable(list);
+    }
+
+    @Log(title = "导出财务店铺订单", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('store:storeFinanceOrder:export')")
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStoreFinanceOrderListVO> list = fsStoreOrderMapper.selectStoreFinanceOrderListVO(param);
+        ExcelUtil<FsStoreFinanceOrderListVO> util = new ExcelUtil<>(FsStoreFinanceOrderListVO.class);
+        return util.exportExcel(list, "财务店铺订单数据");
+    }
+
+    @Log(title = "修改回款金额", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeFinanceOrder:edit')")
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody FsStoreOrder fsStoreOrder) {
+        if (fsStoreOrder.getOrderId() == null) {
+            return AjaxResult.error("订单ID不能为空");
+        }
+        if (fsStoreOrder.getReturnPrice() == null) {
+            return AjaxResult.error("回款金额不能为空");
+        }
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        fsStoreOrder.setUpdateBy(loginUser.getUser().getUserName());
+        int rows = fsStoreOrderMapper.updateFsStoreOrder(fsStoreOrder);
+        return toAjax(rows);
+    }
+
+    /**
+     * 下载回款导入模板
+     */
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<FsFinanceOrderImportDTO> util = new ExcelUtil<>(FsFinanceOrderImportDTO.class);
+        return util.importTemplateExcel("回款导入模板");
+    }
+
+    /**
+     * 导入回款数据(以订单编号匹配)
+     */
+    @Log(title = "财务店铺订单回款导入", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('store:storeFinanceOrder:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws Exception {
+        ExcelUtil<FsFinanceOrderImportDTO> util = new ExcelUtil<>(FsFinanceOrderImportDTO.class);
+        List<FsFinanceOrderImportDTO> importList = util.importExcel(file.getInputStream());
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String updateBy = loginUser.getUser().getUserName();
+
+        int successCount = 0;
+        List<FsFinanceOrderImportFailDTO> failList = new ArrayList<>();
+
+        for (FsFinanceOrderImportDTO dto : importList) {
+            // 根据订单编号匹配 fs_store_order
+            FsStoreOrder order = matchStoreOrder(dto);
+            if (order == null) {
+                failList.add(new FsFinanceOrderImportFailDTO(
+                        dto.getOrderCode(), dto.getDeliverySn(), null, null, dto.getReturnPrice(), "订单不存在"));
+                continue;
+            }
+
+            BigDecimal totalPrice = order.getTotalPrice() != null ? order.getTotalPrice() : BigDecimal.ZERO;
+            BigDecimal collectionPrice = order.getCollectionPrice();
+            BigDecimal importReturnPrice = dto.getReturnPrice() != null ? dto.getReturnPrice() : BigDecimal.ZERO;
+
+            // 回款金额与代收金额一致性校验
+            if (collectionPrice != null && collectionPrice.compareTo(importReturnPrice) != 0) {
+                failList.add(new FsFinanceOrderImportFailDTO(
+                        order.getOrderCode(), order.getDeliverySn(),
+                        totalPrice, collectionPrice, importReturnPrice,
+                        "回款金额与代收金额不一致"));
+                continue;
+            }
+
+            // 更新回款信息
+            FsStoreOrder update = new FsStoreOrder();
+            update.setOrderId(order.getOrderId());
+            update.setReturnPrice(importReturnPrice);
+            update.setUpdateBy(updateBy);
+            if (dto.getReturnTime() != null) {
+                update.setDepositReturnTime(dto.getReturnTime());
+            }
+            // 如果状态不是已回款,更新为已回款
+            if (order.getStatus() == null || order.getStatus() != 4) {
+                update.setStatus(4);
+            }
+            fsStoreOrderMapper.updateFsStoreOrder(update);
+            successCount++;
+        }
+
+        if (CollectionUtils.isNotEmpty(failList)) {
+            ExcelUtil<FsFinanceOrderImportFailDTO> failUtil = new ExcelUtil<>(FsFinanceOrderImportFailDTO.class);
+            AjaxResult failResult = failUtil.exportExcel(failList, "回款导入失败记录");
+            String msg = "导入成功 " + successCount + " 条,失败 " + failList.size() + " 条";
+            return AjaxResult.success(msg, failResult.get("msg"));
+        }
+        return AjaxResult.success("导入成功 " + successCount + " 条,失败 0 条");
+    }
+
+    /** 根据订单编号匹配店铺订单 */
+    private FsStoreOrder matchStoreOrder(FsFinanceOrderImportDTO dto) {
+        if (dto.getOrderCode() != null && !dto.getOrderCode().isEmpty()) {
+            return fsStoreOrderMapper.selectFsStoreOrderByOrderCode(dto.getOrderCode());
+        }
+        return null;
+    }
+}

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

@@ -229,6 +229,14 @@ public class FsExternalOrder extends BaseEntity
     @TableField(exist = false)
     private Integer memberBuyCountMin;
 
+    /** 复购次数-精确匹配(列头筛选用) */
+    @TableField(exist = false)
+    private Integer memberBuyCount;
+
+    /** 应收金额-精确匹配(列头筛选用,HAVING) */
+    @TableField(exist = false)
+    private BigDecimal receivablePrice;
+
 
 
     // 时间范围搜索

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

@@ -0,0 +1,74 @@
+package com.fs.his.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsStoreFinanceOrderListVO {
+
+    private Long orderId;
+
+    @Excel(name = "订单编号")
+    private String orderCode;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "订单日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date externalCreateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "回款日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date returnTime;
+
+    @Excel(name = "回款人")
+    private String returnUser;
+
+    @Excel(name = "会员姓名")
+    private String userName;
+
+    @Excel(name = "快递公司")
+    private String deliveryName;
+
+    @Excel(name = "运单号")
+    private String deliverySn;
+
+    @Excel(name = "订单金额")
+    private BigDecimal totalPrice;
+
+    @Excel(name = "代收金额")
+    private BigDecimal collectionPrice;
+
+    @Excel(name = "回款金额")
+    private BigDecimal returnPrice;
+
+    @Excel(name = "收件人电话")
+    private String receiverPhone;
+
+    @Excel(name = "订购产品")
+    private String productNames;
+
+    @Excel(name = "备注")
+    private String remark;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "发货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryTime;
+
+    @Excel(name = "销售姓名")
+    private String companyUserName;
+
+    @Excel(name = "公司")
+    private String companyName;
+
+    @Excel(name = "部门")
+    private String deptName;
+
+    @Excel(name = "付款方式", readConverterExp = "1=微信,2=支付宝,3=货到付款")
+    private Integer payType;
+
+    @Excel(name = "回款状态", readConverterExp = "0=未回款,1=已回款")
+    private Integer returnStatus;
+}

+ 52 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -14,6 +14,14 @@ import com.fs.his.domain.FsInquiryOrderMsg;
 import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.domain.FsStoreOrderItem;
 import com.fs.his.domain.FsStoreOrderLogs;
+import com.fs.his.domain.vo.FsRejectNoReturnReportVO;
+import com.fs.his.domain.vo.FsRejectOrderReportVO;
+import com.fs.his.domain.vo.FsRejectProductReportVO;
+import com.fs.his.domain.vo.FsReturnOrderReportVO;
+import com.fs.his.domain.vo.FsReturnProductReportVO;
+import com.fs.his.domain.vo.FsSignDetailReportVO;
+import com.fs.his.domain.vo.FsSignOrderReportVO;
+import com.fs.his.domain.vo.FsStoreFinanceOrderListVO;
 import com.fs.his.dto.FsStoreOrderAmountStatsQueryDto;
 import com.fs.his.param.*;
 import com.fs.his.vo.*;
@@ -664,6 +672,50 @@ public interface FsStoreOrderMapper
     List<Long> selectFsStoreOrderNoCreateOms();
     @Select("select order_id from fs_store_order WHERE `status`= 2 and order_type=2 and store_id in(select store_id from fs_store where delivery_type=1) and  extend_order_id is null ")
     List<Long> selectFsStoreOrderNoTuiOrder();
+
+    /**
+     * 查询财务店铺订单列表(财务回款视图)
+     *
+     * @param param 查询参数
+     * @return 财务店铺订单集合
+     */
+    List<FsStoreFinanceOrderListVO> selectStoreFinanceOrderListVO(FsStoreOrderParam param);
+
+    /**
+     * 回款明细报表(药品订单) - 订单维度查询
+     */
+    List<FsReturnOrderReportVO> selectStoreReturnOrderReport(FsStoreOrderParam param);
+
+    /**
+     * 回款明细报表(药品订单) - 产品维度查询
+     */
+    List<FsReturnProductReportVO> selectStoreReturnProductReport(FsStoreOrderParam param);
+
+    /**
+     * 拒收明细报表(药品订单) - 订单维度查询
+     */
+    List<FsRejectOrderReportVO> selectStoreRejectOrderReport(FsStoreOrderParam param);
+
+    /**
+     * 拒收明细报表(药品订单) - 产品维度查询
+     */
+    List<FsRejectProductReportVO> selectStoreRejectProductReport(FsStoreOrderParam param);
+
+    /**
+     * 签收未回款报表(药品订单)
+     */
+    List<FsSignOrderReportVO> selectStoreSignOrderReport(FsStoreOrderParam param);
+
+    /**
+     * 签收情况明细报表(药品订单)
+     */
+    List<FsSignDetailReportVO> selectStoreSignDetailReport(FsStoreOrderParam param);
+
+    /**
+     * 拒收未还货报表(药品订单)
+     */
+    List<FsRejectNoReturnReportVO> selectStoreRejectNoReturnReport(FsStoreOrderParam param);
+
     @Select("select * from fs_store_order o where o.delivery_sn=#{deliverySn}")
     List<FsStoreOrder> selectFsStoreOrderListByDeliverySn( @Param("deliverySn") String deliverySn);
 

+ 66 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java

@@ -248,4 +248,70 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     private Long coursePlaySourceConfigId;
     //erp账户
     private String erpAccount;
+
+    /** 跟单时间(列头筛选精确匹配) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date followTime;
+    /** 备注 */
+    private String remark;
+    /** 定金回款时间(列头筛选精确匹配) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date depositReturnTime;
+    /** 代收金额 */
+    private BigDecimal collectionPrice;
+    /** 退款金额 */
+    private BigDecimal refundPrice;
+    /** 审核人 */
+    private String auditor;
+    /** 审核时间(列头筛选精确匹配) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+    /** 病名 */
+    private String diseaseName;
+    /** 回款金额 */
+    private BigDecimal returnPrice;
+    /** 签收状态更新时间(列头筛选精确匹配) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryStatusUpdateTime;
+    /** 签收状态更新人 */
+    private String deliveryStatusUpdateBy;
+    /** 拒收回退时间(列头筛选精确匹配) */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date rejectReturnTime;
+    /** 是否还货 */
+    private Integer isReturnGoods;
+
+    // ========== 时间范围筛选字段 ==========
+    /** 发货时间范围 */
+    private Date deliveryStartTime;
+    private Date deliveryEndTime;
+    /** 跟单时间范围 */
+    private Date followTimeStart;
+    private Date followTimeEnd;
+    /** 定金回款时间范围 */
+    private Date depositReturnTimeStart;
+    private Date depositReturnTimeEnd;
+    /** 审核时间范围 */
+    private Date auditTimeStart;
+    private Date auditTimeEnd;
+    /** 拒收回退时间范围 */
+    private Date rejectReturnTimeStart;
+    private Date rejectReturnTimeEnd;
+    /** 签收状态更新时间范围 */
+    private Date deliveryStatusUpdateTimeStart;
+    private Date deliveryStatusUpdateTimeEnd;
+
+    // ========== 财务订单查询专用字段 ==========
+    /** 回款状态 0=未回款,1=已回款 */
+    private Integer returnStatus;
+    /** 回款人 */
+    private String returnUser;
+    /** 回款时间范围开始 */
+    private String returnTimeStart;
+    /** 回款时间范围结束 */
+    private String returnTimeEnd;
+    /** 收件人电话 */
+    private String receiverPhone;
+    /** 产品名称(HAVING 筛选) */
+    private String productName;
 }

+ 39 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListVO.java

@@ -77,4 +77,43 @@ public class FsStoreOrderListVO {
      * 快递单号
      */
     private String deliverySn;
+    /** 快递公司编号 */
+    private String deliveryCode;
+    /** 快递名称 */
+    private String deliveryName;
+    /** 发货时间 */
+    private String deliveryTime;
+    /** 订单总价 */
+    private BigDecimal totalPrice;
+    /** 跟单时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date followTime;
+    /** 备注 */
+    private String remark;
+    /** 定金回款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date depositReturnTime;
+    /** 代收金额 */
+    private BigDecimal collectionPrice;
+    /** 退款金额 */
+    private BigDecimal refundPrice;
+    /** 审核人 */
+    private String auditor;
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+    /** 病名 */
+    private String diseaseName;
+    /** 回款金额 */
+    private BigDecimal returnPrice;
+    /** 签收状态更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryStatusUpdateTime;
+    /** 签收状态更新人 */
+    private String deliveryStatusUpdateBy;
+    /** 拒收回退时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date rejectReturnTime;
+    /** 是否还货 1=是,2=否 */
+    private Integer isReturnGoods;
 }

+ 14 - 2
fs-service/src/main/resources/mapper/his/FsExternalOrderMapper.xml

@@ -389,9 +389,15 @@
             <if test="memberBuyCountMin != null">
                 AND (SELECT COUNT(DISTINCT o2.order_id) FROM fs_external_order o2 WHERE o2.user_id = o.user_id AND o2.company_id = o.company_id AND o2.status != -3) &gt;= #{memberBuyCountMin}
             </if>
+            <if test="memberBuyCount != null">
+                AND (SELECT COUNT(DISTINCT o2.order_id) FROM fs_external_order o2 WHERE o2.user_id = o.user_id AND o2.company_id = o.company_id AND o2.status != -3) = #{memberBuyCount}
+            </if>
             ${params.dataScope}
         </where>
         GROUP BY o.order_id
+        <if test="receivablePrice != null">
+            HAVING IFNULL(o.total_price, SUM(oi.price * oi.num)) = #{receivablePrice}
+        </if>
         ORDER BY o.create_time DESC
     </select>
 
@@ -504,6 +510,7 @@
         LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
         LEFT JOIN fs_external_order_item oi ON o.order_id = oi.order_id
         <where>
+             o.delivery_sn is not null and  o.delivery_sn !=''
             <if test="orderCode != null and orderCode != ''"> AND o.order_code = #{orderCode}</if>
             <if test="userName != null and userName != ''"> AND o.user_name LIKE CONCAT('%', #{userName}, '%')</if>
             <if test="userPhone != null and userPhone != ''"> AND o.user_phone LIKE CONCAT('%', #{userPhone}, '%')</if>
@@ -529,10 +536,15 @@
             <if test="eTime != null and eTime != ''"> AND o.external_create_time &lt;= #{eTime}</if>
             <if test="deliveryStartTime != null and deliveryStartTime != ''"> AND o.delivery_time >= #{deliveryStartTime}</if>
             <if test="deliveryEndTime != null and deliveryEndTime != ''"> AND o.delivery_time &lt;= #{deliveryEndTime}</if>
+            <if test="memberBuyCount != null">
+                AND (SELECT COUNT(DISTINCT o2.order_id) FROM fs_external_order o2 WHERE o2.user_id = o.user_id AND o2.company_id = o.company_id AND o2.status != -3) = #{memberBuyCount}
+            </if>
         </where>
         GROUP BY o.order_id
-        <if test="productName != null and productName != ''">
-            HAVING GROUP_CONCAT(oi.product_name SEPARATOR ',') LIKE CONCAT('%', #{productName}, '%')
+        <if test="productName != null and productName != '' or receivablePrice != null">
+            HAVING 1=1
+            <if test="productName != null and productName != ''"> AND GROUP_CONCAT(oi.product_name SEPARATOR ',') LIKE CONCAT('%', #{productName}, '%')</if>
+            <if test="receivablePrice != null"> AND IFNULL(o.total_price, SUM(oi.price * oi.num)) = #{receivablePrice}</if>
         </if>
         ORDER BY o.create_time DESC
     </select>

+ 588 - 0
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -90,6 +90,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="source"    column="source"    />
         <result property="billPrice"    column="bill_price"    />
         <result property="erpPhone"    column="erp_phone"    />
+        <result property="depositReturnTime"    column="deposit_return_time"    />
+        <result property="collectionPrice"    column="collection_price"    />
+        <result property="refundPrice"    column="refund_price"    />
+        <result property="auditor"    column="auditor"    />
+        <result property="auditTime"    column="audit_time"    />
+        <result property="diseaseName"    column="disease_name"    />
+        <result property="returnPrice"    column="return_price"    />
+        <result property="deliveryStatusUpdateTime"    column="delivery_status_update_time"    />
+        <result property="deliveryStatusUpdateBy"    column="delivery_status_update_by"    />
+        <result property="rejectReturnTime"    column="reject_return_time"    />
+        <result property="isReturnGoods"    column="is_return_goods"    />
     </resultMap>
 
     <sql id="selectFsStoreOrderVo">
@@ -721,6 +732,93 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
             and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
         </if>
+        <if test="maps.deliveryCode != null and maps.deliveryCode != ''">
+            and so.delivery_code = #{maps.deliveryCode}
+        </if>
+        <if test="maps.deliveryName != null and maps.deliveryName != ''">
+            and so.delivery_name like concat('%', #{maps.deliveryName}, '%')
+        </if>
+        <if test="maps.deliveryTime != null and maps.deliveryTime != ''">
+            and so.delivery_time = #{maps.deliveryTime}
+        </if>
+        <if test="maps.totalPrice != null">
+            and so.total_price = #{maps.totalPrice}
+        </if>
+        <if test="maps.followTime != null">
+            and DATE(so.follow_time) = DATE(#{maps.followTime})
+        </if>
+        <if test="maps.followTimeStart != null">
+            and DATE(so.follow_time) &gt;= DATE(#{maps.followTimeStart})
+        </if>
+        <if test="maps.followTimeEnd != null">
+            and DATE(so.follow_time) &lt;= DATE(#{maps.followTimeEnd})
+        </if>
+        <if test="maps.remark != null and maps.remark != ''">
+            and so.remark like concat('%', #{maps.remark}, '%')
+        </if>
+        <if test="maps.depositReturnTime != null">
+            and DATE(so.deposit_return_time) = DATE(#{maps.depositReturnTime})
+        </if>
+        <if test="maps.depositReturnTimeStart != null">
+            and DATE(so.deposit_return_time) &gt;= DATE(#{maps.depositReturnTimeStart})
+        </if>
+        <if test="maps.depositReturnTimeEnd != null">
+            and DATE(so.deposit_return_time) &lt;= DATE(#{maps.depositReturnTimeEnd})
+        </if>
+        <if test="maps.collectionPrice != null">
+            and so.collection_price = #{maps.collectionPrice}
+        </if>
+        <if test="maps.refundPrice != null">
+            and so.refund_price = #{maps.refundPrice}
+        </if>
+        <if test="maps.auditor != null and maps.auditor != ''">
+            and so.auditor = #{maps.auditor}
+        </if>
+        <if test="maps.auditTime != null">
+            and DATE(so.audit_time) = DATE(#{maps.auditTime})
+        </if>
+        <if test="maps.auditTimeStart != null">
+            and DATE(so.audit_time) &gt;= DATE(#{maps.auditTimeStart})
+        </if>
+        <if test="maps.auditTimeEnd != null">
+            and DATE(so.audit_time) &lt;= DATE(#{maps.auditTimeEnd})
+        </if>
+        <if test="maps.diseaseName != null and maps.diseaseName != ''">
+            and so.disease_name like concat('%', #{maps.diseaseName}, '%')
+        </if>
+        <if test="maps.returnPrice != null">
+            and so.return_price = #{maps.returnPrice}
+        </if>
+        <if test="maps.deliveryStatusUpdateTime != null">
+            and DATE(so.delivery_status_update_time) = DATE(#{maps.deliveryStatusUpdateTime})
+        </if>
+        <if test="maps.deliveryStatusUpdateTimeStart != null">
+            and DATE(so.delivery_status_update_time) &gt;= DATE(#{maps.deliveryStatusUpdateTimeStart})
+        </if>
+        <if test="maps.deliveryStatusUpdateTimeEnd != null">
+            and DATE(so.delivery_status_update_time) &lt;= DATE(#{maps.deliveryStatusUpdateTimeEnd})
+        </if>
+        <if test="maps.deliveryStatusUpdateBy != null and maps.deliveryStatusUpdateBy != ''">
+            and so.delivery_status_update_by = #{maps.deliveryStatusUpdateBy}
+        </if>
+        <if test="maps.rejectReturnTime != null">
+            and DATE(so.reject_return_time) = DATE(#{maps.rejectReturnTime})
+        </if>
+        <if test="maps.rejectReturnTimeStart != null">
+            and DATE(so.reject_return_time) &gt;= DATE(#{maps.rejectReturnTimeStart})
+        </if>
+        <if test="maps.rejectReturnTimeEnd != null">
+            and DATE(so.reject_return_time) &lt;= DATE(#{maps.rejectReturnTimeEnd})
+        </if>
+        <if test="maps.isReturnGoods != null">
+            and so.is_return_goods = #{maps.isReturnGoods}
+        </if>
+        <if test="maps.deliveryStartTime != null">
+            and DATE(so.delivery_time) &gt;= DATE(#{maps.deliveryStartTime})
+        </if>
+        <if test="maps.deliveryEndTime != null">
+            and DATE(so.delivery_time) &lt;= DATE(#{maps.deliveryEndTime})
+        </if>
         ${maps.params.dataScope}
     </select>
     <select id="selectFsStoreOrderByOrderIdIn" resultType="com.fs.his.domain.FsStoreOrder">
@@ -932,6 +1030,93 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.isPay != null">
                 and so.is_pay = #{maps.isPay}
             </if>
+            <if test="maps.deliveryCode != null and maps.deliveryCode != ''">
+                and so.delivery_code = #{maps.deliveryCode}
+            </if>
+            <if test="maps.deliveryName != null and maps.deliveryName != ''">
+                and so.delivery_name like concat('%', #{maps.deliveryName}, '%')
+            </if>
+            <if test="maps.deliveryTime != null and maps.deliveryTime != ''">
+                and so.delivery_time = #{maps.deliveryTime}
+            </if>
+            <if test="maps.totalPrice != null">
+                and so.total_price = #{maps.totalPrice}
+            </if>
+            <if test="maps.followTime != null">
+                and DATE(so.follow_time) = DATE(#{maps.followTime})
+            </if>
+            <if test="maps.followTimeStart != null">
+                and DATE(so.follow_time) &gt;= DATE(#{maps.followTimeStart})
+            </if>
+            <if test="maps.followTimeEnd != null">
+                and DATE(so.follow_time) &lt;= DATE(#{maps.followTimeEnd})
+            </if>
+            <if test="maps.remark != null and maps.remark != ''">
+                and so.remark like concat('%', #{maps.remark}, '%')
+            </if>
+            <if test="maps.depositReturnTime != null">
+                and DATE(so.deposit_return_time) = DATE(#{maps.depositReturnTime})
+            </if>
+            <if test="maps.depositReturnTimeStart != null">
+                and DATE(so.deposit_return_time) &gt;= DATE(#{maps.depositReturnTimeStart})
+            </if>
+            <if test="maps.depositReturnTimeEnd != null">
+                and DATE(so.deposit_return_time) &lt;= DATE(#{maps.depositReturnTimeEnd})
+            </if>
+            <if test="maps.collectionPrice != null">
+                and so.collection_price = #{maps.collectionPrice}
+            </if>
+            <if test="maps.refundPrice != null">
+                and so.refund_price = #{maps.refundPrice}
+            </if>
+            <if test="maps.auditor != null and maps.auditor != ''">
+                and so.auditor = #{maps.auditor}
+            </if>
+            <if test="maps.auditTime != null">
+                and DATE(so.audit_time) = DATE(#{maps.auditTime})
+            </if>
+            <if test="maps.auditTimeStart != null">
+                and DATE(so.audit_time) &gt;= DATE(#{maps.auditTimeStart})
+            </if>
+            <if test="maps.auditTimeEnd != null">
+                and DATE(so.audit_time) &lt;= DATE(#{maps.auditTimeEnd})
+            </if>
+            <if test="maps.diseaseName != null and maps.diseaseName != ''">
+                and so.disease_name like concat('%', #{maps.diseaseName}, '%')
+            </if>
+            <if test="maps.returnPrice != null">
+                and so.return_price = #{maps.returnPrice}
+            </if>
+            <if test="maps.deliveryStatusUpdateTime != null">
+                and DATE(so.delivery_status_update_time) = DATE(#{maps.deliveryStatusUpdateTime})
+            </if>
+            <if test="maps.deliveryStatusUpdateTimeStart != null">
+                and DATE(so.delivery_status_update_time) &gt;= DATE(#{maps.deliveryStatusUpdateTimeStart})
+            </if>
+            <if test="maps.deliveryStatusUpdateTimeEnd != null">
+                and DATE(so.delivery_status_update_time) &lt;= DATE(#{maps.deliveryStatusUpdateTimeEnd})
+            </if>
+            <if test="maps.deliveryStatusUpdateBy != null and maps.deliveryStatusUpdateBy != ''">
+                and so.delivery_status_update_by = #{maps.deliveryStatusUpdateBy}
+            </if>
+            <if test="maps.rejectReturnTime != null">
+                and DATE(so.reject_return_time) = DATE(#{maps.rejectReturnTime})
+            </if>
+            <if test="maps.rejectReturnTimeStart != null">
+                and DATE(so.reject_return_time) &gt;= DATE(#{maps.rejectReturnTimeStart})
+            </if>
+            <if test="maps.rejectReturnTimeEnd != null">
+                and DATE(so.reject_return_time) &lt;= DATE(#{maps.rejectReturnTimeEnd})
+            </if>
+            <if test="maps.isReturnGoods != null">
+                and so.is_return_goods = #{maps.isReturnGoods}
+            </if>
+            <if test="maps.deliveryStartTime != null">
+                and DATE(so.delivery_time) &gt;= DATE(#{maps.deliveryStartTime})
+            </if>
+            <if test="maps.deliveryEndTime != null">
+                and DATE(so.delivery_time) &lt;= DATE(#{maps.deliveryEndTime})
+            </if>
 
         </where>
         ${maps.params.dataScope}
@@ -2348,6 +2533,93 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.isPay != null">
                 and so.is_pay = #{maps.isPay}
             </if>
+            <if test="maps.deliveryCode != null and maps.deliveryCode != ''">
+                and so.delivery_code = #{maps.deliveryCode}
+            </if>
+            <if test="maps.deliveryName != null and maps.deliveryName != ''">
+                and so.delivery_name like concat('%', #{maps.deliveryName}, '%')
+            </if>
+            <if test="maps.deliveryTime != null and maps.deliveryTime != ''">
+                and so.delivery_time = #{maps.deliveryTime}
+            </if>
+            <if test="maps.totalPrice != null">
+                and so.total_price = #{maps.totalPrice}
+            </if>
+            <if test="maps.followTime != null">
+                and DATE(so.follow_time) = DATE(#{maps.followTime})
+            </if>
+            <if test="maps.followTimeStart != null">
+                and DATE(so.follow_time) &gt;= DATE(#{maps.followTimeStart})
+            </if>
+            <if test="maps.followTimeEnd != null">
+                and DATE(so.follow_time) &lt;= DATE(#{maps.followTimeEnd})
+            </if>
+            <if test="maps.remark != null and maps.remark != ''">
+                and so.remark like concat('%', #{maps.remark}, '%')
+            </if>
+            <if test="maps.depositReturnTime != null">
+                and DATE(so.deposit_return_time) = DATE(#{maps.depositReturnTime})
+            </if>
+            <if test="maps.depositReturnTimeStart != null">
+                and DATE(so.deposit_return_time) &gt;= DATE(#{maps.depositReturnTimeStart})
+            </if>
+            <if test="maps.depositReturnTimeEnd != null">
+                and DATE(so.deposit_return_time) &lt;= DATE(#{maps.depositReturnTimeEnd})
+            </if>
+            <if test="maps.collectionPrice != null">
+                and so.collection_price = #{maps.collectionPrice}
+            </if>
+            <if test="maps.refundPrice != null">
+                and so.refund_price = #{maps.refundPrice}
+            </if>
+            <if test="maps.auditor != null and maps.auditor != ''">
+                and so.auditor = #{maps.auditor}
+            </if>
+            <if test="maps.auditTime != null">
+                and DATE(so.audit_time) = DATE(#{maps.auditTime})
+            </if>
+            <if test="maps.auditTimeStart != null">
+                and DATE(so.audit_time) &gt;= DATE(#{maps.auditTimeStart})
+            </if>
+            <if test="maps.auditTimeEnd != null">
+                and DATE(so.audit_time) &lt;= DATE(#{maps.auditTimeEnd})
+            </if>
+            <if test="maps.diseaseName != null and maps.diseaseName != ''">
+                and so.disease_name like concat('%', #{maps.diseaseName}, '%')
+            </if>
+            <if test="maps.returnPrice != null">
+                and so.return_price = #{maps.returnPrice}
+            </if>
+            <if test="maps.deliveryStatusUpdateTime != null">
+                and DATE(so.delivery_status_update_time) = DATE(#{maps.deliveryStatusUpdateTime})
+            </if>
+            <if test="maps.deliveryStatusUpdateTimeStart != null">
+                and DATE(so.delivery_status_update_time) &gt;= DATE(#{maps.deliveryStatusUpdateTimeStart})
+            </if>
+            <if test="maps.deliveryStatusUpdateTimeEnd != null">
+                and DATE(so.delivery_status_update_time) &lt;= DATE(#{maps.deliveryStatusUpdateTimeEnd})
+            </if>
+            <if test="maps.deliveryStatusUpdateBy != null and maps.deliveryStatusUpdateBy != ''">
+                and so.delivery_status_update_by = #{maps.deliveryStatusUpdateBy}
+            </if>
+            <if test="maps.rejectReturnTime != null">
+                and DATE(so.reject_return_time) = DATE(#{maps.rejectReturnTime})
+            </if>
+            <if test="maps.rejectReturnTimeStart != null">
+                and DATE(so.reject_return_time) &gt;= DATE(#{maps.rejectReturnTimeStart})
+            </if>
+            <if test="maps.rejectReturnTimeEnd != null">
+                and DATE(so.reject_return_time) &lt;= DATE(#{maps.rejectReturnTimeEnd})
+            </if>
+            <if test="maps.isReturnGoods != null">
+                and so.is_return_goods = #{maps.isReturnGoods}
+            </if>
+            <if test="maps.deliveryStartTime != null">
+                and DATE(so.delivery_time) &gt;= DATE(#{maps.deliveryStartTime})
+            </if>
+            <if test="maps.deliveryEndTime != null">
+                and DATE(so.delivery_time) &lt;= DATE(#{maps.deliveryEndTime})
+            </if>
 
         </where>
         ORDER BY
@@ -2382,4 +2654,320 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
     </select>
 
+    <select id="selectStoreFinanceOrderListVO" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsStoreFinanceOrderListVO">
+        SELECT
+            so.order_id AS orderId,
+            so.order_code AS orderCode,
+            so.create_time AS externalCreateTime,
+            so.deposit_return_time AS returnTime,
+            so.update_by AS returnUser,
+            so.user_name AS userName,
+            so.delivery_name AS deliveryName,
+            so.delivery_sn AS deliverySn,
+            so.total_price AS totalPrice,
+            so.collection_price AS collectionPrice,
+            so.return_price AS returnPrice,
+            so.user_phone AS receiverPhone,
+            GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') AS productNames,
+            so.remark,
+            so.delivery_time AS deliveryTime,
+            cu.user_name AS companyUserName,
+            c.company_name AS companyName,
+            d.dept_name AS deptName,
+            so.pay_type AS payType,
+            CASE WHEN so.status = 4 THEN 1 ELSE 0 END AS returnStatus
+        FROM fs_store_order so
+        LEFT JOIN company c ON so.company_id = c.company_id
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        LEFT JOIN fs_store_order_item soi ON so.order_id = soi.order_id
+        <where>
+            <if test="orderCode != null and orderCode != ''"> AND so.order_code = #{orderCode}</if>
+            <if test="userName != null and userName != ''"> AND so.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userPhone != null and userPhone != ''"> AND so.user_phone LIKE CONCAT('%', #{userPhone}, '%')</if>
+            <if test="deliverySn != null and deliverySn != ''"> AND so.delivery_sn = #{deliverySn}</if>
+            <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+            <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+            <if test="returnStatus != null">
+                <if test="returnStatus == 1"> AND so.status = 4</if>
+                <if test="returnStatus == 0"> AND so.status != 4</if>
+            </if>
+            <if test="returnUser != null and returnUser != ''"> AND so.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
+            <if test="returnTimeStart != null and returnTimeStart != ''"> AND so.deposit_return_time &gt;= #{returnTimeStart}</if>
+            <if test="returnTimeEnd != null and returnTimeEnd != ''"> AND so.deposit_return_time &lt;= #{returnTimeEnd}</if>
+            <if test="totalPrice != null"> AND so.total_price = #{totalPrice}</if>
+            <if test="collectionPrice != null"> AND so.collection_price = #{collectionPrice}</if>
+            <if test="receiverPhone != null and receiverPhone != ''"> AND so.user_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
+            <if test="remark != null and remark != ''"> AND so.remark LIKE CONCAT('%', #{remark}, '%')</if>
+            <if test="payType != null"> AND so.pay_type = #{payType}</if>
+            <if test="companyUserName != null and companyUserName != ''"> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</if>
+            <if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
+            <if test="sTime != null"> AND so.create_time &gt;= #{sTime}</if>
+            <if test="eTime != null"> AND so.create_time &lt;= #{eTime}</if>
+            <if test="deliveryStartTime != null"> AND so.delivery_time &gt;= #{deliveryStartTime}</if>
+            <if test="deliveryEndTime != null"> AND so.delivery_time &lt;= #{deliveryEndTime}</if>
+        </where>
+        GROUP BY so.order_id
+        <if test="productName != null and productName != ''">
+            HAVING GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') LIKE CONCAT('%', #{productName}, '%')
+        </if>
+        ORDER BY so.create_time DESC
+    </select>
+
+    <select id="selectStoreReturnOrderReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsReturnOrderReportVO">
+        SELECT
+            so.order_code AS orderCode,
+            so.delivery_sn AS deliverySn,
+            so.user_name AS userName,
+            so.user_address AS userAddress,
+            so.create_time AS externalCreateTime,
+            so.pay_money AS payPrice,
+            so.total_price AS totalPrice,
+            so.delivery_name AS deliveryName,
+            so.update_by AS returnUser,
+            so.deposit_return_time AS returnTime,
+            so.user_phone AS userPhone,
+            so.user_phone AS memberPhone,
+            cu.user_name AS companyUserName,
+            d.dept_name AS deptName,
+            GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') AS productNames,
+            so.delivery_time AS deliveryTime
+        FROM fs_store_order so
+        LEFT JOIN company c ON so.company_id = c.company_id
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        LEFT JOIN fs_store_order_item soi ON so.order_id = soi.order_id
+        WHERE so.status = 4
+        <if test="orderCode != null and orderCode != ''"> AND so.order_code = #{orderCode}</if>
+        <if test="deliverySn != null and deliverySn != ''"> AND so.delivery_sn = #{deliverySn}</if>
+        <if test="userName != null and userName != ''"> AND so.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+        <if test="userAddress != null and userAddress != ''"> AND so.user_address LIKE CONCAT('%', #{userAddress}, '%')</if>
+        <if test="sTime != null"> AND so.create_time &gt;= #{sTime}</if>
+        <if test="eTime != null"> AND so.create_time &lt;= #{eTime}</if>
+        <if test="payPrice != null"> AND so.pay_money = #{payPrice}</if>
+        <if test="totalPrice != null"> AND so.total_price = #{totalPrice}</if>
+        <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+        <if test="returnUser != null and returnUser != ''"> AND so.update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
+        <if test="returnTimeStart != null and returnTimeStart != ''"> AND so.deposit_return_time &gt;= #{returnTimeStart}</if>
+        <if test="returnTimeEnd != null and returnTimeEnd != ''"> AND so.deposit_return_time &lt;= #{returnTimeEnd}</if>
+        <if test="userPhone != null and userPhone != ''"> AND so.user_phone LIKE CONCAT('%', #{userPhone}, '%')</if>
+        <if test="receiverPhone != null and receiverPhone != ''"> AND so.user_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
+        <if test="companyUserName != null and companyUserName != ''"> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</if>
+        <if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
+        <if test="deliveryStartTime != null"> AND so.delivery_time &gt;= #{deliveryStartTime}</if>
+        <if test="deliveryEndTime != null"> AND so.delivery_time &lt;= #{deliveryEndTime}</if>
+        <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        GROUP BY so.order_id
+        <if test="productName != null and productName != ''">
+            HAVING GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') LIKE CONCAT('%', #{productName}, '%')
+        </if>
+        ORDER BY so.order_id DESC
+    </select>
+
+    <select id="selectStoreReturnProductReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsReturnProductReportVO">
+        SELECT
+            d.dept_name AS deptName,
+            so.delivery_name AS deliveryName,
+            soi.json_info->>'$.productName' AS productName,
+            soi.product_id AS productId,
+            SUM(CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) AS num,
+            SUM(CAST(soi.json_info->>'$.price' AS DECIMAL(10,2)) * CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) AS totalPrice
+        FROM fs_store_order so
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        INNER JOIN fs_store_order_item soi ON so.order_id = soi.order_id
+        WHERE so.status = 4
+        <if test="productName != null and productName != ''"> AND soi.json_info->>'$.productName' LIKE CONCAT('%', #{productName}, '%')</if>
+        <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+        <if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
+        <if test="returnTimeStart != null and returnTimeStart != ''"> AND so.deposit_return_time &gt;= #{returnTimeStart}</if>
+        <if test="returnTimeEnd != null and returnTimeEnd != ''"> AND so.deposit_return_time &lt;= #{returnTimeEnd}</if>
+        <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        GROUP BY d.dept_name, so.delivery_name, soi.product_id, soi.json_info->>'$.productName'
+        ORDER BY d.dept_name, so.delivery_name, soi.json_info->>'$.productName'
+    </select>
+
+    <select id="selectStoreRejectOrderReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsRejectOrderReportVO">
+        SELECT
+            so.order_code AS orderCode,
+            so.delivery_sn AS deliverySn,
+            so.user_name AS userName,
+            so.create_time AS externalCreateTime,
+            so.delivery_time AS deliveryTime,
+            so.total_price AS totalPrice,
+            so.delivery_name AS deliveryName,
+            so.follow_time AS followTime,
+            so.reject_return_time AS rejectReturnTime,
+            so.delivery_status_update_by AS rejectUser,
+            so.user_phone AS userPhone,
+            so.user_phone AS memberPhone,
+            cu.user_name AS companyUserName,
+            GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') AS productNames,
+            so.user_address AS userAddress
+        FROM fs_store_order so
+        LEFT JOIN company c ON so.company_id = c.company_id
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        LEFT JOIN fs_store_order_item soi ON so.order_id = soi.order_id
+        <where>
+            so.delivery_status IN (4, 5, 6)
+            <if test="orderCode != null and orderCode != ''"> AND so.order_code = #{orderCode}</if>
+            <if test="deliverySn != null and deliverySn != ''"> AND so.delivery_sn = #{deliverySn}</if>
+            <if test="userName != null and userName != ''"> AND so.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userAddress != null and userAddress != ''"> AND so.user_address LIKE CONCAT('%', #{userAddress}, '%')</if>
+            <if test="sTime != null"> AND so.create_time &gt;= #{sTime}</if>
+            <if test="eTime != null"> AND so.create_time &lt;= #{eTime}</if>
+            <if test="totalPrice != null"> AND so.total_price = #{totalPrice}</if>
+            <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+            <if test="rejectReturnTimeStart != null and rejectReturnTimeStart != ''"> AND so.reject_return_time &gt;= #{rejectReturnTimeStart}</if>
+            <if test="rejectReturnTimeEnd != null and rejectReturnTimeEnd != ''"> AND so.reject_return_time &lt;= #{rejectReturnTimeEnd}</if>
+            <if test="returnUser != null and returnUser != ''"> AND so.delivery_status_update_by LIKE CONCAT('%', #{returnUser}, '%')</if>
+            <if test="userPhone != null and userPhone != ''"> AND so.user_phone LIKE CONCAT('%', #{userPhone}, '%')</if>
+            <if test="receiverPhone != null and receiverPhone != ''"> AND so.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')</if>
+            <if test="companyUserName != null and companyUserName != ''"> AND cu.user_name LIKE CONCAT('%', #{companyUserName}, '%')</if>
+            <if test="deliveryStartTime != null"> AND so.delivery_time &gt;= #{deliveryStartTime}</if>
+            <if test="deliveryEndTime != null"> AND so.delivery_time &lt;= #{deliveryEndTime}</if>
+            <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        </where>
+        GROUP BY so.order_id
+        <if test="productName != null and productName != ''">
+            HAVING GROUP_CONCAT(soi.json_info->>'$.productName' SEPARATOR ',') LIKE CONCAT('%', #{productName}, '%')
+        </if>
+        ORDER BY so.order_id DESC
+    </select>
+
+    <select id="selectStoreRejectProductReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsRejectProductReportVO">
+        SELECT
+            soi.json_info->>'$.productName' AS productName,
+            so.delivery_name AS deliveryName,
+            SUM(CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) AS num,
+            SUM(CAST(soi.json_info->>'$.price' AS DECIMAL(10,2)) * CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) AS totalPrice
+        FROM fs_store_order so
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        INNER JOIN fs_store_order_item soi ON so.order_id = soi.order_id
+        <where>
+            so.delivery_status IN (4, 5, 6)
+            <if test="productName != null and productName != ''"> AND soi.json_info->>'$.productName' LIKE CONCAT('%', #{productName}, '%')</if>
+            <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+            <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        </where>
+        GROUP BY so.delivery_name, soi.json_info->>'$.productName'
+        <if test="totalNum != null or totalPrice != null">
+            HAVING 1=1
+            <if test="totalNum != null"> AND SUM(CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) = #{totalNum}</if>
+            <if test="totalPrice != null"> AND SUM(CAST(soi.json_info->>'$.price' AS DECIMAL(10,2)) * CAST(soi.json_info->>'$.num' AS DECIMAL(10,0))) = #{totalPrice}</if>
+        </if>
+        ORDER BY so.delivery_name, soi.json_info->>'$.productName'
+    </select>
+
+    <select id="selectStoreSignOrderReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsSignOrderReportVO">
+        SELECT
+            so.order_code AS orderCode,
+            so.delivery_sn AS deliverySn,
+            so.user_name AS userName,
+            so.user_address AS userAddress,
+            so.delivery_time AS deliveryTime,
+            so.pay_money AS payPrice,
+            so.collection_price AS collectionPrice,
+            so.total_price AS totalPrice,
+            so.follow_time AS followTime,
+            so.delivery_name AS deliveryName,
+            d.dept_name AS deptName,
+            c.company_name AS companyName
+        FROM fs_store_order so
+        LEFT JOIN company c ON so.company_id = c.company_id
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        <where>
+            so.delivery_status = 3 AND so.status != 4
+            <if test="orderCode != null and orderCode != ''"> AND so.order_code = #{orderCode}</if>
+            <if test="deliverySn != null and deliverySn != ''"> AND so.delivery_sn = #{deliverySn}</if>
+            <if test="userName != null and userName != ''"> AND so.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userAddress != null and userAddress != ''"> AND so.user_address LIKE CONCAT('%', #{userAddress}, '%')</if>
+            <if test="payPrice != null"> AND so.pay_money = #{payPrice}</if>
+            <if test="collectionPrice != null"> AND so.collection_price = #{collectionPrice}</if>
+            <if test="totalPrice != null"> AND so.total_price = #{totalPrice}</if>
+            <if test="followTimeStart != null and followTimeStart != ''"> AND so.follow_time &gt;= #{followTimeStart}</if>
+            <if test="followTimeEnd != null and followTimeEnd != ''"> AND so.follow_time &lt;= #{followTimeEnd}</if>
+            <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+            <if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
+            <if test="deliveryStartTime != null"> AND so.delivery_time &gt;= #{deliveryStartTime}</if>
+            <if test="deliveryEndTime != null"> AND so.delivery_time &lt;= #{deliveryEndTime}</if>
+            <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        </where>
+        ORDER BY so.order_id DESC
+    </select>
+
+    <select id="selectStoreRejectNoReturnReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsRejectNoReturnReportVO">
+        SELECT
+            so.order_code AS orderCode,
+            so.delivery_sn AS deliverySn,
+            so.user_name AS userName,
+            so.user_address AS userAddress,
+            so.delivery_time AS deliveryTime,
+            so.total_price AS totalPrice,
+            so.follow_time AS followTime,
+            so.delivery_name AS deliveryName
+        FROM fs_store_order so
+        LEFT JOIN company c ON so.company_id = c.company_id
+        LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+        LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+        <where>
+            so.delivery_status = 4 AND (so.is_return_goods IS NULL OR so.is_return_goods = 2)
+            <if test="orderCode != null and orderCode != ''"> AND so.order_code = #{orderCode}</if>
+            <if test="deliverySn != null and deliverySn != ''"> AND so.delivery_sn = #{deliverySn}</if>
+            <if test="userName != null and userName != ''"> AND so.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userAddress != null and userAddress != ''"> AND so.user_address LIKE CONCAT('%', #{userAddress}, '%')</if>
+            <if test="totalPrice != null"> AND so.total_price = #{totalPrice}</if>
+            <if test="followTimeStart != null and followTimeStart != ''"> AND so.follow_time &gt;= #{followTimeStart}</if>
+            <if test="followTimeEnd != null and followTimeEnd != ''"> AND so.follow_time &lt;= #{followTimeEnd}</if>
+            <if test="deliveryName != null and deliveryName != ''"> AND so.delivery_name LIKE CONCAT('%', #{deliveryName}, '%')</if>
+            <if test="deliveryStartTime != null"> AND so.delivery_time &gt;= #{deliveryStartTime}</if>
+            <if test="deliveryEndTime != null"> AND so.delivery_time &lt;= #{deliveryEndTime}</if>
+            <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+        </where>
+        ORDER BY so.order_id DESC
+    </select>
+
+    <select id="selectStoreSignDetailReport" parameterType="com.fs.his.param.FsStoreOrderParam" resultType="com.fs.his.domain.vo.FsSignDetailReportVO">
+        SELECT
+            t.order_type AS orderType,
+            t.delivery_count AS deliveryCount,
+            t.delivery_amount AS deliveryAmount,
+            t.sign_count AS signCount,
+            t.sign_amount AS signAmount,
+            CASE WHEN t.delivery_count &gt; 0
+                 THEN CONCAT(ROUND(t.sign_count * 100.0 / t.delivery_count, 2), '%')
+                 ELSE '0%' END AS orderSignRate,
+            CASE WHEN t.delivery_amount &gt; 0
+                 THEN CONCAT(ROUND(t.sign_amount * 100.0 / t.delivery_amount, 2), '%')
+                 ELSE '0%' END AS amountSignRate,
+            t.dept_name AS deptName,
+            t.company_name AS companyName
+        FROM (
+            SELECT
+                2 AS order_type,
+                COUNT(so.order_id) AS delivery_count,
+                COALESCE(SUM(so.total_price), 0) AS delivery_amount,
+                COUNT(CASE WHEN so.delivery_status = 3 THEN 1 END) AS sign_count,
+                COALESCE(SUM(CASE WHEN so.delivery_status = 3 THEN so.total_price ELSE 0 END), 0) AS sign_amount,
+                d.dept_name AS dept_name,
+                c.company_name AS company_name
+            FROM fs_store_order so
+            LEFT JOIN company c ON so.company_id = c.company_id
+            LEFT JOIN company_user cu ON so.company_user_id = cu.user_id
+            LEFT JOIN company_dept d ON cu.dept_id = d.dept_id
+            <where>
+                so.status &gt;= 3
+                <if test="companyId != null"> AND so.company_id = #{companyId}</if>
+                <if test="deptId != null"> AND cu.dept_id = #{deptId}</if>
+                <if test="sTime != null and sTime != ''"> AND so.create_time &gt;= #{sTime}</if>
+                <if test="eTime != null and eTime != ''"> AND so.create_time &lt;= #{eTime}</if>
+            </where>
+            GROUP BY d.dept_id, d.dept_name, c.company_id, c.company_name
+        ) t
+        ORDER BY t.company_name, t.dept_name
+    </select>
+
 </mapper>