yuhongqi преди 6 дни
родител
ревизия
0cb262da71

+ 42 - 24
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreHealthOrderScrmController.java

@@ -277,16 +277,10 @@ public class FsStoreHealthOrderScrmController extends BaseController {
     @Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
     @GetMapping("/healthExportItems")
     public AjaxResult exportItems1(FsStoreOrderParam param) {
-        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
-            param.setBeginTime(null);
-            param.setEndTime(null);
-        }
+        normalizeExportParam(param);
         if (fsStoreOrderService.isEntityNull(param)){
             return AjaxResult.error("请筛选数据导出");
         }
-        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
-            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
-        }
         if(!StringUtils.isEmpty(param.getPayTimeRange())){
             param.setPayTimeList(param.getPayTimeRange().split("--"));
         }
@@ -390,16 +384,10 @@ public class FsStoreHealthOrderScrmController extends BaseController {
     @Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
     @GetMapping("/healthExportItemsDetails")
     public AjaxResult healthExportItemsDetails(FsStoreOrderParam param) {
-        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
-            param.setBeginTime(null);
-            param.setEndTime(null);
-        }
+        normalizeExportParam(param);
         if (fsStoreOrderService.isEntityNull(param)){
             return AjaxResult.error("请筛选数据导出");
         }
-        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
-            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
-        }
         if(!StringUtils.isEmpty(param.getPayTimeRange())){
             param.setPayTimeList(param.getPayTimeRange().split("--"));
         }
@@ -428,6 +416,11 @@ public class FsStoreHealthOrderScrmController extends BaseController {
             if (zmvoList != null) {
                     LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
                     for (FsStoreOrderItemExportZMVO vo : zmvoList) {
+                        if ("2".equals(vo.getOrderType())) {
+                            vo.setOrderTypeStr("直播订单");
+                        }else {
+                            vo.setOrderTypeStr("商城订单");
+                        }
                         if (!StringUtils.isEmpty(vo.getJsonInfo())) {
                             try {
                                 StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
@@ -516,6 +509,23 @@ public class FsStoreHealthOrderScrmController extends BaseController {
         return util.importTemplateExcel("订单发货导入模板");
     }
 
+    /** 统一处理导出接口的 GET 参数,与 healthList 的 POST 参数逻辑一致 */
+    private void normalizeExportParam(FsStoreOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())) {
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (StringUtils.isNotEmpty(param.getCreateTimeRange())) {
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        // GET 请求时 orderCodes 可能无法正确绑定,用 orderCodeList(逗号分隔)转 orderCodes
+        if ((param.getOrderCodes() == null || param.getOrderCodes().isEmpty())
+                && StringUtils.isNotBlank(param.getOrderCodeList())) {
+            String[] arr = param.getOrderCodeList().split("[,,\\s]+");
+            param.setOrderCodes(new ArrayList<>(Arrays.asList(arr)));
+        }
+    }
+
     // 检查文件是否为有效的Excel文件
     private boolean isValidExcelFile(String fileName) {
         for (String ext : ALLOWED_EXCEL_EXTENSIONS) {
@@ -588,15 +598,23 @@ public class FsStoreHealthOrderScrmController extends BaseController {
             param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
         }
         param.setIsHealth("1");
-        List<FsStoreOrderDeliveryNoteExportVO> storeOrderDeliveryNoteExportVOList=fsStoreOrderService.getDeliveryNote(param);
-        ExcelUtil<FsStoreOrderDeliveryNoteExportVO> util = new ExcelUtil<>(FsStoreOrderDeliveryNoteExportVO.class);
-        //通过商品ID获取关键字
-        String firstKeyword = storeOrderDeliveryNoteExportVOList.stream()
-                .map(FsStoreOrderDeliveryNoteExportVO::getKeyword)
-                .filter(StringUtils::isNotEmpty)
-                .findFirst()
-                .orElse("无订单");
-        String fileName="077AC"+firstKeyword+new SimpleDateFormat("yyyyMMdd").format(new Date());
-        return util.exportExcel(storeOrderDeliveryNoteExportVOList, fileName);
+        try {
+            List<FsStoreOrderDeliveryNoteExportVO> storeOrderDeliveryNoteExportVOList=fsStoreOrderService.getDeliveryNote(param);
+            if(storeOrderDeliveryNoteExportVOList == null || storeOrderDeliveryNoteExportVOList.isEmpty()){
+                return AjaxResult.error("没有可导出的发货单数据");
+            }
+            ExcelUtil<FsStoreOrderDeliveryNoteExportVO> util = new ExcelUtil<>(FsStoreOrderDeliveryNoteExportVO.class);
+            //通过商品ID获取关键字
+            String firstKeyword = storeOrderDeliveryNoteExportVOList.stream()
+                    .map(FsStoreOrderDeliveryNoteExportVO::getKeyword)
+                    .filter(StringUtils::isNotEmpty)
+                    .findFirst()
+                    .orElse("无订单");
+            String fileName="077AC"+firstKeyword+new SimpleDateFormat("yyyyMMdd").format(new Date());
+            return util.exportExcel(storeOrderDeliveryNoteExportVOList, fileName);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("导出发货单失败:" + e.getMessage());
+        }
     }
 }

+ 276 - 2
fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java

@@ -1,5 +1,6 @@
 package com.fs.company.controller.store;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fs.common.annotation.DataScope;
 import com.fs.common.annotation.Log;
@@ -9,6 +10,7 @@ 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.common.utils.ParseUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.crm.service.ICrmCustomerService;
@@ -31,8 +33,14 @@ import com.fs.his.service.IFsStoreOrderService;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.FsStoreOrderListVO;
+import com.fs.his.vo.FsStoreOrderListAndStatisticsVo;
 import com.fs.his.vo.FsStoreOrderVO;
 import com.fs.his.vo.FsStoreProductDeliverExcelVO;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+import com.fs.hisStore.vo.FsStoreOrderErpExportVO;
+import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -40,8 +48,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.util.Date;
-import java.util.List;
+import com.github.pagehelper.PageHelper;
+
+import java.util.*;
 
 import static com.fs.his.utils.PhoneUtil.decryptPhone;
 import static com.fs.his.utils.PhoneUtil.encryptPhone;
@@ -67,6 +76,271 @@ public class FsStoreOrderController extends BaseController
     @Autowired
     @Qualifier("erpOrderServiceImpl")
     IErpOrderService erpOrderService;
+
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderScrmService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemScrmService;
+
+    /**
+     * 查询直播订单列表(仅 fs_store_order_scrm 中 order_type=2)
+     * 分公司负责人(userType=00)可查公司下所有直播订单,否则仅能查自己的直播订单
+     */
+    @PostMapping("/healthLiveList")
+    public FsStoreOrderListAndStatisticsVo healthLiveList(@RequestBody com.fs.hisStore.param.FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setOrderType(2);
+        if (!"00".equals(loginUser.getUser().getUserType())) {
+            param.setCompanyUserId(loginUser.getUser().getUserId());
+        } else {
+            param.setCompanyUserId(null);
+        }
+        if (StringUtils.isNotEmpty(param.getCreateTimeRange())) {
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getPayTimeRange())) {
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getDeliveryImportTimeRange())) {
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getDeliverySendTimeRange())) {
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        Map<String, java.math.BigDecimal> statistics = fsStoreOrderScrmService.selectFsStoreOrderStatistics(param);
+        String productInfoStr = fsStoreOrderScrmService.selectFsStoreOrderProductStatistics(param);
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        List<com.fs.hisStore.vo.FsStoreOrderVO> list = fsStoreOrderScrmService.selectFsStoreOrderListVO(param);
+        if (list != null) {
+            for (com.fs.hisStore.vo.FsStoreOrderVO vo : list) {
+                if (StringUtils.isNotEmpty(vo.getPhone())) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (StringUtils.isNotEmpty(vo.getUserPhone())) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            }
+        }
+        FsStoreOrderListAndStatisticsVo vo = new FsStoreOrderListAndStatisticsVo();
+        vo.setRows(list);
+        vo.setTotal(new com.github.pagehelper.PageInfo<>(list).getTotal());
+        vo.setCode(200);
+        vo.setMsg("查询成功");
+        if (list != null && !list.isEmpty()) {
+            if (statistics != null && statistics.size() >= 3) {
+                vo.setPayPriceTotal(statistics.get("pay_price") != null ? statistics.get("pay_price").toString() : "0");
+                vo.setPayMoneyTotal(statistics.get("pay_money") != null ? statistics.get("pay_money").toString() : "0");
+                vo.setPayRemainTotal(statistics.get("pay_remain") != null ? statistics.get("pay_remain").toString() : "0");
+            } else {
+                vo.setPayPriceTotal("0");
+                vo.setPayMoneyTotal("0");
+                vo.setPayRemainTotal("0");
+            }
+            vo.setProductInfo(StringUtils.isNotBlank(productInfoStr) ? productInfoStr : "");
+        } else {
+            vo.setPayPriceTotal("0");
+            vo.setPayMoneyTotal("0");
+            vo.setPayRemainTotal("0");
+            vo.setProductInfo("");
+        }
+        return vo;
+    }
+
+    /** 直播订单导出:筛选条件与 healthLiveList 一致(orderType=2 + 公司/负责人权限) */
+    private void applyHealthLiveFilter(com.fs.hisStore.param.FsStoreOrderParam param) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setOrderType(2);
+        if (!"00".equals(loginUser.getUser().getUserType())) {
+            param.setCompanyUserId(loginUser.getUser().getUserId());
+        } else {
+            param.setCompanyUserId(null);
+        }
+        if (StringUtils.isNotEmpty(param.getCreateTimeRange())) {
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getPayTimeRange())) {
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getDeliveryImportTimeRange())) {
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if (StringUtils.isNotEmpty(param.getDeliverySendTimeRange())) {
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+    }
+
+    private void normalizeExportParam(com.fs.hisStore.param.FsStoreOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())) {
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (StringUtils.isNotEmpty(param.getCreateTimeRange())) {
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if ((param.getOrderCodes() == null || param.getOrderCodes().isEmpty())
+                && StringUtils.isNotBlank(param.getOrderCodeList())) {
+            String[] arr = param.getOrderCodeList().split("[,,\\s]+");
+            param.setOrderCodes(new ArrayList<>(Arrays.asList(arr)));
+        }
+    }
+
+    /**
+     * 导出直播订单列表(脱敏)
+     */
+    @Log(title = "直播订单导出", businessType = BusinessType.EXPORT)
+    @PostMapping("/healthExport")
+    public AjaxResult healthExport(@RequestBody com.fs.hisStore.param.FsStoreOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())) {
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        applyHealthLiveFilter(param);
+        if (fsStoreOrderScrmService.isEntityNull(param)) {
+            return AjaxResult.error("请筛选数据导出");
+        }
+        List<FsStoreOrderErpExportVO> list = fsStoreOrderScrmService.selectFsStoreOrderListVOByExport(param);
+        if (list != null) {
+            for (FsStoreOrderErpExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserAddress() != null) {
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+            }
+        }
+        String filter = param.getFilter();
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        ExcelUtil<FsStoreOrderErpExportVO> util = new ExcelUtil<>(FsStoreOrderErpExportVO.class);
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            return util.exportExcel(list, "订单数据");
+        }
+    }
+
+    /**
+     * 导出直播订单列表(明文)
+     */
+    @Log(title = "直播订单导出(明文)", businessType = BusinessType.EXPORT)
+    @PostMapping("/healthExportDetails")
+    public AjaxResult healthExportDetails(@RequestBody com.fs.hisStore.param.FsStoreOrderParam param) {
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())) {
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        applyHealthLiveFilter(param);
+        if (fsStoreOrderScrmService.isEntityNull(param)) {
+            return AjaxResult.error("请筛选数据导出");
+        }
+        List<FsStoreOrderErpExportVO> list = fsStoreOrderScrmService.selectFsStoreOrderListVOByExport(param);
+        String filter = param.getFilter();
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        ExcelUtil<FsStoreOrderErpExportVO> util = new ExcelUtil<>(FsStoreOrderErpExportVO.class);
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            return util.exportExcel(list, "订单数据");
+        }
+    }
+
+    /**
+     * 导出直播订单明细(脱敏)
+     */
+    @Log(title = "直播订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExportItems")
+    public AjaxResult healthExportItems(com.fs.hisStore.param.FsStoreOrderParam param) {
+        normalizeExportParam(param);
+        applyHealthLiveFilter(param);
+        if (fsStoreOrderScrmService.isEntityNull(param)) {
+            return AjaxResult.error("请筛选数据导出");
+        }
+        List<FsStoreOrderItemExportVO> list = orderItemScrmService.selectFsStoreOrderItemListExportVO(param);
+        if (list != null) {
+            LoginUser loginUser = SecurityUtils.getLoginUser();
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2"));
+                }
+                if (StringUtils.isNotEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO dto = com.alibaba.fastjson.JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(dto, vo);
+                    } catch (Exception e) {
+                        // ignore
+                    }
+                }
+                if (vo.getUserAddress() != null) {
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) && vo.getCost() != null) {
+                    vo.setFPrice(vo.getCost().multiply(java.math.BigDecimal.valueOf(vo.getTotalNum())));
+                } else {
+                    vo.setPayPostage(java.math.BigDecimal.ZERO);
+                    vo.setCost(java.math.BigDecimal.ZERO);
+                    vo.setFPrice(java.math.BigDecimal.ZERO);
+                    vo.setBarCode("");
+                    vo.setCateName("");
+                    vo.setBankTransactionId("");
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+    /**
+     * 导出直播订单明细(明文)
+     */
+    @Log(title = "直播订单明细导出(明文)", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExportItemsDetails")
+    public AjaxResult healthExportItemsDetails(com.fs.hisStore.param.FsStoreOrderParam param) {
+        normalizeExportParam(param);
+        applyHealthLiveFilter(param);
+        if (fsStoreOrderScrmService.isEntityNull(param)) {
+            return AjaxResult.error("请筛选数据导出");
+        }
+        List<FsStoreOrderItemExportVO> list = orderItemScrmService.selectFsStoreOrderItemListExportVO(param);
+        if (list != null) {
+            LoginUser loginUser = SecurityUtils.getLoginUser();
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (StringUtils.isNotEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO dto = com.alibaba.fastjson.JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(dto, vo);
+                    } catch (Exception e) {
+                        // ignore
+                    }
+                }
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) && vo.getCost() != null) {
+                    vo.setFPrice(vo.getCost().multiply(java.math.BigDecimal.valueOf(vo.getTotalNum())));
+                } else {
+                    vo.setPayPostage(java.math.BigDecimal.ZERO);
+                    vo.setCost(java.math.BigDecimal.ZERO);
+                    vo.setFPrice(java.math.BigDecimal.ZERO);
+                    vo.setBarCode("");
+                    vo.setCateName("");
+                    vo.setBankTransactionId("");
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
     /**
      * 查询订单列表
      */

+ 3 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -4549,10 +4549,11 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
      * 小黄车商品和展示
      */
     private void getGoodsAndShow(Long videoId, FsUserCourseVideoDetailsVO vo) {
-        String show = fsDepVideoShowMapper.selectFsDepVideoShowByVideoId(videoId, null);
-        vo.setShowProduct(show);
+//        String show = fsDepVideoShowMapper.selectFsDepVideoShowByVideoId(videoId, null);
+//        vo.setShowProduct(show);
 
         FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
+        vo.setShowProduct(courseVideo.getIsProduct() == 1 ? "0" : "1");
         String packageJson = courseVideo.getPackageJson();
         if (StringUtils.isNotEmpty(packageJson)) {
             ObjectMapper objectMapper = new ObjectMapper();

+ 12 - 4
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderItemScrmMapper.java

@@ -75,12 +75,11 @@ public interface FsStoreOrderItemScrmMapper
     List<FsStoreOrderItemVO> selectFsStoreOrderItemListAndProductByOrderId(Long id);
 
     @Select({"<script> " +
-            "select i.*,o.user_id,psps.cost,o.pay_postage,o.total_num,o.status,fspcs.cate_name, o.real_name,o.user_phone,o.user_address,o.create_time,o.pay_time,o.delivery_sn,o.delivery_name,o.delivery_id, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber,o.upload_time ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload,p.title as package_name,cts.name as scheduleName,os.pay_money, os.bank_transaction_id as bankTransactionId, o.delivery_send_time," +
+            "select i.*,o.user_id,psps.cost,o.pay_postage,o.total_num,o.status,fspcs.cate_name, o.real_name,o.user_phone,o.user_address,o.create_time,o.pay_time,o.delivery_sn,o.delivery_name,o.delivery_id, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber,o.upload_time ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload,p.title as package_name,cts.name as scheduleName,sp_latest.pay_money, sp_latest.bank_transaction_id as bankTransactionId, o.delivery_send_time," +
             " o.order_code, o.pay_price, o.pay_money, o.deduction_price,o.pay_delivery, o.order_type,psps.price " +
             ", CASE o.is_audit WHEN 1 THEN '是' ELSE '否' END AS isAudit " +
             " from fs_store_order_item_scrm i " +
             " left join fs_store_order_scrm o on o.id=i.order_id" +
-            " left join fs_store_payment_scrm os on os.business_order_id = o.id " +
             " left join fs_user u on o.user_id=u.user_id  " +
             " left join fs_store_product_package_scrm p on o.package_id=p.package_id " +
             " left join company c on c.company_id=o.company_id " +
@@ -99,6 +98,12 @@ public interface FsStoreOrderItemScrmMapper
             "<if test=\"maps.bankTransactionId !=null and maps.bankTransactionId!=''\">" +
             " and sp_latest.bank_transaction_id = #{maps.bankTransactionId} " +
             "</if>" +
+            "<if test=\"maps.orderCodes != null  and maps.orderCodes.size > 0\">" +
+            " and o.order_code in" +
+            " <foreach collection=\"maps.orderCodes\" item=\"orderCode\" open=\"(\" close=\")\" separator=\",\">" +
+            "     #{orderCode}" +
+            " </foreach>" +
+            "</if>" +
             "<if test = 'maps.orderCode != null and  maps.orderCode !=\"\"    '> " +
             "and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
             "</if>" +
@@ -114,14 +119,17 @@ public interface FsStoreOrderItemScrmMapper
             "<if test = 'maps.userPhone != null and  maps.userPhone !=\"\"     '> " +
             "and o.user_phone like CONCAT('%',#{maps.userPhone},'%') " +
             "</if>" +
-            "<if test = 'maps.status != null    '> " +
+            "<if test = 'maps.status != null and maps.status != 6    '> " +
             "and o.status =#{maps.status} " +
             "</if>" +
+            "<if test = 'maps.status != null and maps.status == 6    '> " +
+            "and o.`status`= 1 and (o.extend_order_id is null or o.extend_order_id like '') " +
+            "</if>" +
             "<if test = 'maps.companyId != null    '> " +
             "and o.company_id =#{maps.companyId} " +
             "</if>" +
             "<if test = 'maps.isHealth != null and maps.isHealth !=  \"\"  '> " +
-            "and o.company_id is null " +
+            "and (o.company_id is null or o.order_type = 2 ) " +
             "</if>" +
             "<if test = 'maps.notHealth != null and maps.notHealth !=  \"\"  '> " +
             "and o.company_id is not null " +

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java

@@ -657,7 +657,7 @@ public interface FsStoreOrderScrmMapper
     List<FsStoreOrderScrm> selectFsStoreOrderListByFinish7Day();
 
     @Select({"<script> " +
-            "select o.*,cts.name as scheduleName,u.nickname,u.phone,cc.push_code,cc.create_time as customer_create_time,cc.source,cc.customer_code, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber ,p.title as package_title ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload  " +
+            "select o.*,cts.name as scheduleName,sp_latest.pay_code as hfshh,u.nickname,u.phone,cc.push_code,cc.create_time as customer_create_time,cc.source,cc.customer_code, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber ,p.title as package_title ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload  " +
             ", CASE o.is_audit WHEN 1 THEN '是' ELSE '否' END AS isAudit " +
             " from fs_store_order_scrm o  " +
             " left JOIN fs_store_product_package_scrm p on o.package_id=p.package_id " +

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -107,6 +107,9 @@ public interface FsStoreProductScrmMapper
             "<if test = 'maps.isAudit != null '> " +
             "and p.is_audit = #{maps.isAudit} " +
             "</if>" +
+            "<if test = 'maps.isDel != null '> " +
+            "and p.is_del = #{maps.isDel} " +
+            "</if>" +
             "<if test='maps.drugRegCertNo != null and maps.drugRegCertNo != \"\"'>" +
             "    AND p.drug_reg_cert_no LIKE CONCAT('%', #{maps.drugRegCertNo}, '%')" +
             "</if>" +
@@ -184,6 +187,12 @@ public interface FsStoreProductScrmMapper
             "<if test = 'maps.isShow != null    '> " +
             "and p.is_show =#{maps.isShow} " +
             "</if>" +
+            "<if test = 'maps.isAudit != null    '> " +
+            "and p.is_audit =#{maps.isAudit} " +
+            "</if>" +
+            "<if test = 'maps.isDel != null    '> " +
+            "and p.is_del =#{maps.isDel} " +
+            "</if>" +
             "<if test = 'maps.excludeProductIds != null '>" +
             "and p.product_id not in " +
             "<foreach collection='maps.excludeProductIds'  item='item' index='index'  open='(' separator=',' close=')'> " +

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderParam.java

@@ -16,6 +16,9 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable
     //多个订单号搜索
     private List<String> orderCodes;
 
+    /** 多个订单号搜索(逗号分隔字符串,用于GET请求) */
+    private String orderCodeList;
+
     private String nickname;
 
     private String phone;

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

@@ -271,6 +271,10 @@ public class FsStoreOrderExportVO implements Serializable
     @Excel(name = "归属档期")
     private String scheduleName;
 
+    /** 汇付商户订单号 */
+    @Excel(name = "汇付商户订单号")
+    private String hfshh;
+
     @Excel(name = "是否审核")
     private String isAudit;
 

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

@@ -58,7 +58,7 @@ public class FsStoreOrderItemExportZMVO implements Serializable {
     private BigDecimal FPrice;
 
     @Excel(name = "额外运费")
-    private BigDecimal payDelivery;
+    private BigDecimal payPostage;
 
     @Excel(name = "商品分类")
     private String cateName;
@@ -108,7 +108,7 @@ public class FsStoreOrderItemExportZMVO implements Serializable {
     /** 商品分类(与 MergedOrderVO 一致,不导出) */
 
     // 以下字段供内部使用,不参与导出
-    private BigDecimal payPostage;
+    private BigDecimal payDelivery;
     private Integer totalNum;
     private String jsonInfo;
     private String packageName;

+ 7 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java

@@ -133,6 +133,13 @@ public interface LiveOrderMapper {
     @Select("select * from live_order where order_code=#{orderCode} limit 1")
     LiveOrder selectLiveOrderByOrderCode(@Param("orderCode") String orderCode);
 
+    /**
+     * 根据订单号批量查询直播订单
+     * @param orderCodes 订单号列表
+     * @return 订单列表
+     */
+    List<LiveOrder> selectLiveOrderByOrderCodes(@Param("orderCodes") List<String> orderCodes);
+
     /**
      * 查询状态为6(被拆分)的订单
      */

+ 5 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -577,9 +577,14 @@ public class LiveDataServiceImpl implements ILiveDataService {
     @Override
     public List<LiveAppSimpleVO> listLivingLivesForApp() {
         List<LiveAppSimpleVO> list = liveDataMapper.selectLivingLivesForApp();
+
         if (list == null || list.isEmpty()) {
             return list;
         }
+        // 如果查询结果超过 3 条,进行截取
+        if (list.size() > 3) {
+            list = list.subList(0, 3);
+        }
         for (LiveAppSimpleVO vo : list) {
             if (vo.getLiveType() != null && vo.getLiveType() == 2 && vo.getLiveId() != null) {
                 try {

+ 3 - 3
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -4062,7 +4062,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         // 注意:bizOrderType 字段需要在 FsStoreOrderScrm 实体类中添加
         // storeOrder.setBizOrderType(1); // 设置为直播订单
 
-        BigDecimal payPrice = fsStoreProduct.getPrice().multiply(new BigDecimal(liveOrder.getTotalNum()));
+        BigDecimal totalPrice = fsStoreProduct.getPrice().multiply(new BigDecimal(liveOrder.getTotalNum()));
+        BigDecimal payPrice = totalPrice;
         if (attrValue != null) {
             payPrice = attrValue.getPrice().multiply(new BigDecimal(liveOrder.getTotalNum()));
         }
@@ -4097,7 +4098,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         // 设置商城订单字段(按照 createOrder 的逻辑)
         storeOrder.setUserId(Long.parseLong(liveOrder.getUserId()));
         storeOrder.setTotalNum(Long.parseLong(liveOrder.getTotalNum()));
-        storeOrder.setTotalPrice(payPrice);
+        storeOrder.setTotalPrice(totalPrice);
         storeOrder.setTotalPostage(deliveryMoney);
         storeOrder.setPayPostage(deliveryMoney);
         storeOrder.setPayDelivery(deliveryMoney);
@@ -4124,7 +4125,6 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 
         // 设置支付金额
         storeOrder.setPayPrice(payPrice.subtract(discountMoney));
-        storeOrder.setPayMoney(storeOrder.getPayPrice());
 
         // 设置订单状态
         storeOrder.setStatus(0); // 待支付

+ 8 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -173,6 +173,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </select>
 
+    <select id="selectFsStoreOrderByOrderCodes" resultMap="FsStoreOrderResult">
+        <include refid="selectFsStoreOrderVo"/>
+        where order_code IN
+        <foreach collection="orderCodes" item="code" open="(" separator="," close=")">
+            #{code}
+        </foreach>
+    </select>
+
     <insert id="insertFsStoreOrder" parameterType="FsStoreOrderScrm" useGeneratedKeys="true" keyProperty="id">
         insert into fs_store_order_scrm
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 8 - 0
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -654,6 +654,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </select>
 
+    <select id="selectLiveOrderByOrderCodes" resultMap="LiveOrderResult">
+        <include refid="selectLiveOrderVo"/>
+        where order_code IN
+        <foreach collection="orderCodes" item="code" open="(" separator="," close=")">
+            #{code}
+        </foreach>
+    </select>
+
     <select id="selectLiveOrderListVO" resultType="com.fs.live.vo.LiveOrderVO">
 
     select o.*,u.phone,u.register_code,u.register_date,u.source, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber