From 4e85cf00c3a77b7165f4d349da21e94b2b528909 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 11 四月 2025 10:05:41 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0

---
 cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js                         |   15 
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminAgreement/tHuiminAgreement_add.html            |  290 ++++++++++----
 cloud-server-activity/src/main/java/com/dsh/activity/controller/HuiminAgreementController.java                    |   70 +-
 cloud-server-activity/src/main/java/com/dsh/activity/model/response/SalesDetailVO.java                            |    5 
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/HuiminPayQuery.java               |    5 
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminCardController.java      |  177 ++++++--
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TPayHuiminController.java       |   68 ++
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard.html                          |   51 +
 cloud-server-management/src/main/webapp/static/modular/system/tPayHuimin/tPayHuimin.js                            |   50 ++
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminAgreementController.java |   12 
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreementSetting.java      |    2 
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PayHuiminClient.java                    |    6 
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SalesDetailVO.java                        |    5 
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_detail.html                   |   93 ++-
 cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminAgreement.java                                 |    3 
 cloud-server-activity/src/main/resources/mapper/PayHuiminMapper.xml                                               |    4 
 cloud-server-activity/src/main/java/com/dsh/activity/entity/HuiminPayQuery.java                                   |    5 
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreement.java             |    2 
 cloud-server-activity/src/main/java/com/dsh/activity/controller/PayHuiminController.java                          |    9 
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_add.html                      |  155 ++++--
 cloud-server-activity/src/main/java/com/dsh/activity/controller/THuiminCardController.java                        |   59 ++
 cloud-server-activity/src/main/java/com/dsh/activity/service/impl/PayHuiminServiceImpl.java                       |   19 
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HuiminCardStoreVO.java                    |    2 
 cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminCard.java                                      |   37 +
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/HuiminCardClient.java                   |    5 
 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminCard.java                  |   18 
 26 files changed, 812 insertions(+), 355 deletions(-)

diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/HuiminAgreementController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/HuiminAgreementController.java
index f835ca2..9ce9182 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/HuiminAgreementController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/HuiminAgreementController.java
@@ -55,7 +55,7 @@
             //查询协议配置
             List<THuiminAgreementSetting> tHuiminAgreementSettingList = huiminAgreementSettingService.list(new LambdaQueryWrapper<THuiminAgreementSetting>()
                     .eq(THuiminAgreementSetting::getAgreementId, huiminAgreement.getId()));
-            huiminAgreement.setTHuiminAgreementSettingList(tHuiminAgreementSettingList);
+            huiminAgreement.setSettingList(tHuiminAgreementSettingList);
         }
         return huiminAgreement;
     }
@@ -67,40 +67,42 @@
     @Transactional(rollbackFor = Exception.class)
     public void insert(@RequestBody THuiminAgreement tHuiminAgreement){
         Integer operatorId = tHuiminAgreement.getOperatorId();
-        if (tHuiminAgreement.getObjectType().equals(1)) {
-            tHuiminAgreement.setOperatorId(null);
-        }
-        huiminAgreementService.saveOrUpdate(tHuiminAgreement);
-        List<THuiminAgreementSetting> tHuiminAgreementSettingList = tHuiminAgreement.getTHuiminAgreementSettingList();
-        if (CollUtil.isNotEmpty(tHuiminAgreementSettingList)) {
-            if (tHuiminAgreement.getObjectType().equals(2) || tHuiminAgreement.getObjectType().equals(1) && Objects.isNull(operatorId)) {
-                //删除之前的协议配置
-                huiminAgreementSettingService.remove(new LambdaQueryWrapper<THuiminAgreementSetting>().eq(THuiminAgreementSetting::getAgreementId, tHuiminAgreement.getId()));
-                //保存协议配置
-                tHuiminAgreementSettingList.forEach(t -> {
-                    t.setAgreementId(tHuiminAgreement.getId());
-                });
-                huiminAgreementSettingService.saveBatch(tHuiminAgreementSettingList);
-            } else {
-                THuiminAgreement agreement = huiminAgreementService.lambdaQuery()
-                        .eq(THuiminAgreement::getOperatorId, operatorId)
-                        .last("LIMIT 1").one();
-                if (Objects.isNull(agreement)) {
-                    agreement = new THuiminAgreement();
-                    agreement.setOperatorId(operatorId);
-                    huiminAgreementService.save(agreement);
-                }
-                //删除之前的协议配置
-                huiminAgreementSettingService.remove(new LambdaQueryWrapper<THuiminAgreementSetting>()
-                        .eq(THuiminAgreementSetting::getAgreementId, agreement.getId()));
-                //保存协议配置
-                THuiminAgreement finalAgreement = agreement;
-                tHuiminAgreementSettingList.forEach(t -> {
-                    t.setAgreementId(finalAgreement.getId());
-                });
-                huiminAgreementSettingService.saveBatch(tHuiminAgreementSettingList);
+        //如果是平台账号,需要设置operatorId为null
+        List<THuiminAgreementSetting> tHuiminAgreementSettingList = tHuiminAgreement.getSettingList();
+        //如果是运营商账号或平台账号默认配置
+        if (tHuiminAgreement.getObjectType().equals(2) || tHuiminAgreement.getObjectType().equals(1) && Objects.isNull(operatorId)) {
+            if (tHuiminAgreement.getObjectType().equals(1)) {
+                tHuiminAgreement.setOperatorId(null);
             }
-
+            huiminAgreementService.saveOrUpdate(tHuiminAgreement);
+            //删除之前的协议配置
+            huiminAgreementSettingService.remove(new LambdaQueryWrapper<THuiminAgreementSetting>().eq(THuiminAgreementSetting::getAgreementId, tHuiminAgreement.getId()));
+            //保存协议配置
+            tHuiminAgreementSettingList.forEach(t -> {
+                t.setAgreementId(tHuiminAgreement.getId());
+            });
+        } else {
+            //平台配置运营商的协议配置
+            THuiminAgreement agreement = huiminAgreementService.lambdaQuery()
+                    .eq(THuiminAgreement::getOperatorId, operatorId)
+                    .last("LIMIT 1").one();
+            if (Objects.isNull(agreement)) {
+                agreement = new THuiminAgreement();
+                agreement.setOperatorId(operatorId);
+            }
+            agreement.setStoreNoHuiminCardIntro(tHuiminAgreement.getStoreNoHuiminCardIntro());
+            huiminAgreementService.saveOrUpdate(agreement);
+            //删除之前的协议配置
+            huiminAgreementSettingService.remove(new LambdaQueryWrapper<THuiminAgreementSetting>()
+                    .eq(THuiminAgreementSetting::getAgreementId, agreement.getId()));
+            //保存协议配置
+            THuiminAgreement finalAgreement = agreement;
+            tHuiminAgreementSettingList.forEach(t -> {
+                t.setAgreementId(finalAgreement.getId());
+            });
+        }
+        if (CollUtil.isNotEmpty(tHuiminAgreementSettingList)) {
+            huiminAgreementSettingService.saveBatch(tHuiminAgreementSettingList);
         }
     }
 }
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PayHuiminController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PayHuiminController.java
index 80722a6..5b0759b 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PayHuiminController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PayHuiminController.java
@@ -5,9 +5,6 @@
 import com.dsh.activity.entity.HuiminPayQuery;
 import com.dsh.activity.model.response.SalesDetailVO;
 import com.dsh.activity.service.PayHuiminService;
-import com.dsh.activity.util.ResultUtil;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -52,10 +49,10 @@
      * 退款惠民卡
      * @param id
      */
-    @GetMapping("/base/tPayHuimin/refund/{id}")
-    public ResultUtil<?> refund(@PathVariable("id") Integer id){
+    @PostMapping("/base/tPayHuimin/refund")
+    public void refund(Integer id){
         try {
-            return payHuiminService.refund(id);
+            payHuiminService.refund(id);
         } catch (AlipayApiException e) {
             throw new RuntimeException(e);
         }
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/THuiminCardController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/THuiminCardController.java
index b227540..e41cc81 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/THuiminCardController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/THuiminCardController.java
@@ -27,9 +27,20 @@
     private PayHuiminService payHuiminService;
 
 
-    @GetMapping("/queryPage")
-    public Page<THuiminCard> queryPage(Page<THuiminCard> page, THuiminCard tHuiminCard) {
+    @PostMapping("/queryPage")
+    public Page<THuiminCard> queryPage(@RequestBody THuiminCard tHuiminCard) {
         QueryWrapper<THuiminCard> queryWrapper = new QueryWrapper<>();
+
+
+        Integer objectType = tHuiminCard.getObjectType();
+        Integer objectId = tHuiminCard.getObjectId();
+        if (objectType == 2){
+            queryWrapper.eq("operatorId",objectId);
+        }
+        if (objectType == 3){
+            queryWrapper.apply("FIND_IN_SET("+objectId+",storeIds)");
+        }
+
         if (!StringUtils.isEmpty(tHuiminCard.getHuiMinName())){
             queryWrapper.like("huiMinName",tHuiminCard.getHuiMinName());
         }
@@ -40,19 +51,19 @@
             queryWrapper.ge("startTime",tHuiminCard.getStartTime());
             queryWrapper.le("endTime",tHuiminCard.getEndTime());
         }
-        Integer flag = tHuiminCard.getFlag();
-        if (flag != null){
+        Integer huiMinStatus = tHuiminCard.getHuiMinStatus();
+        // 惠民卡状态:1未开始 2已开始 3已结束
+        if (huiMinStatus != null){
             Date now = new Date();
-            switch (flag) {
+            switch (huiMinStatus) {
                 case 1:
-                    queryWrapper.le("startTime", now);
+                    queryWrapper.gt("startTime", now);
                     break;
-                    case 2:
-                    queryWrapper.ge("startTime", now);
+                case 2:
+                    queryWrapper.apply("(startTime <= now() AND endTime >= now()) OR(startTime IS NULL AND endTime IS NULL)");
+                    break;
+                case 3:
                     queryWrapper.le("endTime", now);
-                    break;
-                    case 3:
-                    queryWrapper.lt("endTime", now);
                     break;
             }
         }
@@ -60,8 +71,14 @@
         if (tHuiminCard.getStatus() != null){
             queryWrapper.eq("status",tHuiminCard.getStatus());
         }
+        Page<THuiminCard> page = new Page<>();
+        page.setCurrent(tHuiminCard.getCurrent());
+        page.setSize(tHuiminCard.getSize());
         Page<THuiminCard> page1 = tHuiminCardService.page(page, queryWrapper);
         List<THuiminCard> records = page1.getRecords();
+        if (records.isEmpty()){
+            return page1;
+        }
         List<Integer> cardIds = records.stream().map(THuiminCard::getId).collect(Collectors.toList());
         List<TPayHuimin> list = payHuiminService.list(new LambdaQueryWrapper<TPayHuimin>()
                 .in(TPayHuimin::getCardId, cardIds));
@@ -75,6 +92,25 @@
 
         records.forEach(item -> {
             item.setBuyCount(cardIdCountMap.getOrDefault(item.getId(), 0L).intValue());
+
+            // 惠民卡状态计算逻辑
+            Date startTime = item.getStartTime();
+            Date endTime = item.getEndTime();
+
+            Date now = new Date();
+            if (startTime == null || endTime == null) {
+                // 时间字段未填写时默认状态为「已开始」
+                item.setHuiMinStatus(2);
+            } else {
+                if (startTime.after(now)) {
+                    item.setHuiMinStatus(1); // 未开始
+                } else if (endTime.before(now)) {
+                    item.setHuiMinStatus(3); // 已结束
+                } else {
+                    item.setHuiMinStatus(2); // 已开始
+                }
+            }
+
         });
         return page1;
     }
@@ -92,7 +128,6 @@
 
     @PostMapping("/updateById")
     public R<?> updateById(@RequestBody THuiminCard tHuiminCard) {
-        String unUseTimes = tHuiminCard.getUnUseTimes();
         tHuiminCardService.updateById(tHuiminCard);
         return R.ok("");
     }
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/HuiminPayQuery.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/HuiminPayQuery.java
index 3cae174..891715d 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/HuiminPayQuery.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/HuiminPayQuery.java
@@ -1,5 +1,6 @@
 package com.dsh.activity.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -20,12 +21,16 @@
     
     // 时间范围
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTimeStart; // 支付时间-开始
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTimeEnd; // 支付时间-结束
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTimeStart;     // 结束时间-开始
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTimeEnd;     // 结束时间-结束
 
     // 状态查询
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminAgreement.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminAgreement.java
index 6a11d14..bdc037f 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminAgreement.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminAgreement.java
@@ -57,14 +57,13 @@
      */
     @TableField("storeNoHuiminCardIntro")
     @ApiModelProperty("门店无惠民卡介绍页")
-
     private String storeNoHuiminCardIntro;
 
     @TableField(exist = false)
     private Integer objectType;
 
     @TableField(exist = false)
-    private List<THuiminAgreementSetting> tHuiminAgreementSettingList;
+    private List<THuiminAgreementSetting> settingList;
     @Override
     protected Serializable pkVal() {
         return this.id;
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminCard.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminCard.java
index 3c49174..0628825 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminCard.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/THuiminCard.java
@@ -103,18 +103,20 @@
     @TableField("banner")
     private String banner;
 
-    /**
-     *有效期开始时间 不填表示永久
-     */
-    @TableField("endTime")
-    @ApiModelProperty(value = "有效期开始时间 不填表示永久")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date endTime;
+
     /**
      *有效期结束时间 不填表示永久
      */
-    @TableField("startTime")
+    @TableField("endTime")
     @ApiModelProperty(value = "有效期结束时间 不填表示永久")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    /**
+     *有效期开始时间 不填表示永久
+     */
+    @TableField("startTime")
+    @ApiModelProperty(value = "有效期开始时间 不填表示永久")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startTime;
     /**
@@ -140,7 +142,6 @@
      */
     @TableField("useScope")
     @ApiModelProperty(value = "使用范围1门店2场地")
-
     private Integer useScope;
     /**
      *根据适用范围,存储门店id或场地id,多个逗号分隔
@@ -196,6 +197,24 @@
      */
     @TableField(exist = false)
     private Integer buyCount;
+    @TableField(exist = false)
+    private Long current;
+    @TableField(exist = false)
+    private Long size;
+    /**
+     * 惠民卡状态:1未开始 2已开始 3已结束
+     */
+    @TableField(exist = false)
+    private Integer huiMinStatus;
+
+    /**
+     * 1=平台,2=城市管理员,3=门店
+     */
+    @TableField(exist = false)
+    private Integer objectType;
+
+    @TableField(exist = false)
+    private Integer objectId;
 
 
     @Override
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/response/SalesDetailVO.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/response/SalesDetailVO.java
index c614538..85233cc 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/model/response/SalesDetailVO.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/response/SalesDetailVO.java
@@ -1,5 +1,6 @@
 package com.dsh.activity.model.response;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -17,7 +18,7 @@
     // 关联信息
     private Integer operatorId;
     private String operatorName;        // 所属运营商
-    private Integer storeId;
+    private String storeIds;
     private String storeName;           // 可用门店
     private Integer appUserId;           // 购买用户ID
     private String userName;            // 购买用户
@@ -26,8 +27,10 @@
 
     // 时间信息
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTime;  // 购买时间[1,8](@ref)
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;      // 有效期
 
     // 使用信息
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/PayHuiminServiceImpl.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/PayHuiminServiceImpl.java
index 575bf76..fdc0890 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/PayHuiminServiceImpl.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/PayHuiminServiceImpl.java
@@ -123,6 +123,23 @@
      */
     @Override
     public List<SalesDetailVO> exportData(HuiminPayQuery query) {
-        return baseMapper.exportData(query);
+        List<SalesDetailVO> records = baseMapper.exportData(query);
+        if (CollUtil.isNotEmpty(records)){
+            List<Integer> appUserIdList = records.stream().map(SalesDetailVO::getAppUserId).collect(Collectors.toList());
+            List<AppUser> appUserList = appUserClient.queryAppUserBatch(appUserIdList);
+            Map<Integer, AppUser> appUserMap = appUserList.stream().collect(Collectors.toMap(AppUser::getId, appUser -> appUser));
+            records.forEach(item->{
+                AppUser appUser = appUserMap.get(item.getAppUserId());
+                if (Objects.nonNull(appUser)){
+                    item.setUserName(appUser.getName());
+                    item.setPhone(appUser.getPhone());
+                }
+                List<TStudent> studentList = studentClient.getStudentByIds(item.getStudentId());
+                if (CollUtil.isNotEmpty(studentList)){
+                    item.setStudentName(studentList.stream().map(TStudent::getName).collect(Collectors.joining(",")));
+                }
+            });
+        }
+        return records;
     }
 }
diff --git a/cloud-server-activity/src/main/resources/mapper/PayHuiminMapper.xml b/cloud-server-activity/src/main/resources/mapper/PayHuiminMapper.xml
index 2506461..51ad938 100644
--- a/cloud-server-activity/src/main/resources/mapper/PayHuiminMapper.xml
+++ b/cloud-server-activity/src/main/resources/mapper/PayHuiminMapper.xml
@@ -121,7 +121,7 @@
         thc.huiMinType,
         thc.salesMoney,
         thc.operatorId,
-        thc.storeId,
+        thc.storeIds,
         tph.appUserId,
         tph.paymentTime,
         thc.endTime,
@@ -136,7 +136,6 @@
         LEFT JOIN t_huimin_card thc ON tph.cardId = thc.id
         LEFT JOIN t_huimin_record thr ON tph.appUserId= thr.appUserId AND tph.cardId= thr.huiminCardId
         <where>
-             tph.id IS NOT NULL
             <if test="query.huiMinName !=null and query.huiMinName != ''">
                 AND thc.huiMinName LIKE CONCAT('%',#{query.huiMinName},'%')
             </if>
@@ -175,6 +174,7 @@
                 </choose>
             </if>
         </where>
+        GROUP BY tph.id
         ORDER BY tph.insertTime DESC
     </select>
 </mapper>
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/HuiminCardClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/HuiminCardClient.java
index 6445fae..05b3831 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/HuiminCardClient.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/HuiminCardClient.java
@@ -21,9 +21,8 @@
     @PostMapping(value = "/tHuiminCard/save")
     void save(@RequestBody THuiminCard tHuiminCard);
 
-    @GetMapping(value = "/tHuiminCard/queryPage")
-    Page<THuiminCard> queryPage(@RequestParam("page") Page<THuiminCard>page,
-                                 @RequestParam("tHuiminCard") THuiminCard tHuiminCard);
+    @PostMapping(value = "/tHuiminCard/queryPage")
+    Page<THuiminCard> queryPage(@RequestBody THuiminCard tHuiminCard);
 
     @GetMapping(value = "/tHuiminCard/getById")
     THuiminCard getById(@RequestParam("id") Integer id);
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PayHuiminClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PayHuiminClient.java
index 2a96015..c121f7a 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PayHuiminClient.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PayHuiminClient.java
@@ -3,9 +3,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dsh.course.feignClient.activity.model.HuiminPayQuery;
 import com.dsh.guns.modular.system.model.SalesDetailVO;
-import com.dsh.guns.modular.system.util.ResultUtil;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
@@ -39,8 +37,8 @@
      * 退款惠民卡
      * @param id
      */
-    @GetMapping("/base/tPayHuimin/refund/{id}")
-    ResultUtil<?> refund(Integer id);
+    @PostMapping("/base/tPayHuimin/refund")
+    void refund(Integer id);
 
     @PostMapping("/base/tPayHuimin/export-data")
     List<SalesDetailVO> exportData(@RequestBody HuiminPayQuery query);
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/HuiminPayQuery.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/HuiminPayQuery.java
index 1b04018..1a36b0a 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/HuiminPayQuery.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/HuiminPayQuery.java
@@ -1,5 +1,6 @@
 package com.dsh.course.feignClient.activity.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -20,12 +21,16 @@
     
     // 时间范围
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTimeStart; // 支付时间-开始
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTimeEnd; // 支付时间-结束
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTimeStart;     // 结束时间-开始
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTimeEnd;     // 结束时间-结束
 
     // 状态查询
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreement.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreement.java
index c0fd57a..e747aa1 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreement.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreement.java
@@ -45,7 +45,7 @@
 
     private String agreementSettings;
 
-    private List<THuiminAgreementSetting> tHuiminAgreementSettingList;
+    private List<THuiminAgreementSetting> settingList;
     private Integer objectType;
     @Override
     protected Serializable pkVal() {
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreementSetting.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreementSetting.java
index c04ba86..ab59caf 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreementSetting.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminAgreementSetting.java
@@ -37,13 +37,11 @@
      * 协议名称
      */
     @TableField("agreementName")
-    @JSONField(name = "title")
     private String agreementName;
     /**
      *协议内容
      */
     @TableField("agreementContent")
-    @JSONField(name = "content")
     private String agreementContent;
 
     @Override
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminCard.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminCard.java
index dc31ff8..39c3612 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminCard.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/THuiminCard.java
@@ -167,6 +167,24 @@
     private String startTimeStr;
     @TableField(exist = false)
     private String endTimeStr;
+    @TableField(exist = false)
+    private Long current;
+    @TableField(exist = false)
+    private Long size;
+    /**
+     * 惠民卡状态:1未开始 2已开始 3已结束
+     */
+    @TableField(exist = false)
+    private Integer huiMinStatus;
+
+    /**
+     * 1=平台,2=城市管理员,3=门店
+     */
+    @TableField(exist = false)
+    private Integer objectType;
+
+    @TableField(exist = false)
+    private Integer objectId;
 
     @Override
     protected Serializable pkVal() {
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminAgreementController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminAgreementController.java
index b4a0ba7..904c18b 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminAgreementController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminAgreementController.java
@@ -60,7 +60,6 @@
         THuiminAgreement huiminAgreement = huiminAgreementClient.selectByObjectType(huiminAgreementQuery);
         model.addAttribute("objectType", objectType);
         model.addAttribute("item", huiminAgreement);
-        model.addAttribute("tHuiminAgreementSettingList", Objects.nonNull(huiminAgreement) ? JSONArray.toJSONString(huiminAgreement.getTHuiminAgreementSettingList()) : "");
         //查询运营商列表
         model.addAttribute("operatorList", operatorService.list(new QueryWrapper<TOperator>().eq("state", 1)));
         model.addAttribute("operatorId", operatorId);
@@ -72,23 +71,18 @@
         tHuiminAgreement.setObjectType(UserExt.getUser().getObjectType());
         String agreementSettings = tHuiminAgreement.getAgreementSettings();
         List<THuiminAgreementSetting> tHuiminAgreementSettings = JSONArray.parseArray(agreementSettings, THuiminAgreementSetting.class);
-        tHuiminAgreement.setTHuiminAgreementSettingList(tHuiminAgreementSettings);
+        tHuiminAgreement.setSettingList(tHuiminAgreementSettings);
         huiminAgreementClient.insert(tHuiminAgreement);
         return SUCCESS_TIP;
     }
     @RequestMapping(value = "/selectAgreementByOperationId")
     @ResponseBody
-    public ResultUtil<String> selectAgreementByOperationId(Integer operatorId) {
-        String tHuiminAgreementSettings = "";
+    public ResultUtil<THuiminAgreement> selectAgreementByOperationId(Integer operatorId) {
         HuiminAgreementQuery huiminAgreementQuery = new HuiminAgreementQuery();
         huiminAgreementQuery.setOperatorId(operatorId);
         huiminAgreementQuery.setObjectType(Objects.isNull(operatorId) ? 1 : 2);
         THuiminAgreement huiminAgreement = huiminAgreementClient.selectByObjectType(huiminAgreementQuery);
-        if (Objects.nonNull(huiminAgreement)) {
-            //查询协议配置
-            tHuiminAgreementSettings = JSONArray.toJSONString(huiminAgreement.getTHuiminAgreementSettingList());
-        }
-        return ResultUtil.success(tHuiminAgreementSettings);
+        return ResultUtil.success(huiminAgreement);
     }
 /*
     *//**
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminCardController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminCardController.java
index d65ffc3..98cb2b2 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminCardController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/THuiminCardController.java
@@ -8,6 +8,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dsh.course.feignClient.activity.HuiminCardClient;
 import com.dsh.course.feignClient.activity.model.THuiminCard;
+import com.dsh.guns.config.UserExt;
 import com.dsh.guns.core.base.controller.BaseController;
 import com.dsh.guns.core.page.PageInfoBT;
 import com.dsh.guns.modular.system.model.*;
@@ -16,13 +17,13 @@
 import com.dsh.guns.modular.system.service.TOperatorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * 惠民卡控制器
@@ -57,8 +58,9 @@
      * 跳转到添加惠民卡
      */
     @RequestMapping("/tHuiminCard_add")
-    public String tHuiminCardAdd() {
-
+    public String tHuiminCardAdd(Model model) {
+        User user = UserExt.getUser();
+        model.addAttribute("objectType", user.getObjectType());
         return PREFIX + "tHuiminCard_add.html";
     }
 
@@ -66,7 +68,9 @@
      * 跳转到详情页面
      */
     @RequestMapping("/tHuiminCard_detail/{id}")
-    public String tHuiminCardDetail(@PathVariable("id") Integer id) {
+    public String tHuiminCardDetail(@PathVariable("id") Integer id,Model model) {
+        User user = UserExt.getUser();
+        model.addAttribute("objectType", user.getObjectType());
         return PREFIX + "tHuiminCard_detail.html";
     }
 
@@ -75,7 +79,9 @@
      */
     @RequestMapping("/getDetail")
     @ResponseBody
-    public THuiminCard getDetail(Integer id) {
+    public THuiminCard getDetail(Integer id,Model model) {
+        User user = UserExt.getUser();
+        model.addAttribute("objectType", user.getObjectType());
         return huiminCardClient.getById(id);
     }
 
@@ -86,8 +92,16 @@
      */
     @RequestMapping(value = "/list")
     @ResponseBody
-    public PageInfoBT<THuiminCard> list(Page<THuiminCard> page,THuiminCard tHuiminCard) {
-        return super.packForBT(huiminCardClient.queryPage(page, tHuiminCard));
+    public PageInfoBT<THuiminCard> list(THuiminCard tHuiminCard) {
+        User user = UserExt.getUser();
+        if(user == null){
+            return null;
+        }
+        Integer objectType = user.getObjectType();
+        tHuiminCard.setObjectType(objectType);
+        Integer objectId = user.getObjectId();
+        tHuiminCard.setObjectId(objectId);
+        return super.packForBT(huiminCardClient.queryPage(tHuiminCard));
     }
 
     /**
@@ -101,8 +115,19 @@
         if (!StringUtils.isEmpty(storeIds)){
              ids = storeIds.split(",");
         }
-
+        User user = UserExt.getUser();
+        if(user == null){
+            return null;
+        }
+        Integer objectType = user.getObjectType();
+        if (objectType != 1 && objectType != 2){
+            throw new RuntimeException("权限不足");
+        }
+        if (objectType == 2){
+            query.setOperatorId(user.getObjectId());
+        }
         Page<TStore> storePage = storeService.page(page, new LambdaQueryWrapper<TStore>()
+                .eq(TStore::getState, 1)
                 .in(ids.length > 0, TStore::getId, Arrays.asList(ids))
                 .eq(!StringUtils.isEmpty(query.getProvinceCode()), TStore::getProvinceCode, query.getProvinceCode())
                 .eq(!StringUtils.isEmpty(query.getCityCode()), TStore::getCityCode, query.getCityCode())
@@ -118,6 +143,7 @@
             TOperator operator = operatorService.getById(tStore.getOperatorId());
             if (operator != null){
                 huiminCardStoreVO.setOperatorName(operator.getName());
+                huiminCardStoreVO.setOperatorId(tStore.getOperatorId());
             }
             return huiminCardStoreVO;
         });
@@ -131,65 +157,115 @@
     public Object siteList(Page<TSite> page, HuiminCardStoreQuery query) {
         String storeName = query.getStoreName();
         List<String> storeIds = new ArrayList<>();
-        if (!StringUtils.isEmpty(storeName)){
-            List<String> storeIdsByName = storeService.listObjs(new LambdaQueryWrapper<TStore>()
-                    .select(TStore::getId)
-                    .eq(TStore::getName, storeName), String::valueOf);
-            if (storeIdsByName != null && !storeIdsByName.isEmpty()){
-                storeIds.addAll(storeIdsByName);
-            }else {
-                return null;
-            }
+
+        // 收集storeName条件的storeIds(不提前返回null)
+        if (!StringUtils.isEmpty(storeName)) {
+            List<String> storeIdsByName = storeService.listObjs(
+                    new LambdaQueryWrapper<TStore>()
+                            .select(TStore::getId)
+                            .eq(TStore::getName, storeName),
+                    String::valueOf);
+            storeIds.addAll(storeIdsByName);
         }
+
+        // 收集operatorId条件的storeIds(不提前返回null)
         Integer operatorId = query.getOperatorId();
-        if (operatorId != null){
-            List<String> storeIdsByOperatorId = storeService.listObjs(new LambdaQueryWrapper<TStore>()
-                    .select(TStore::getId)
-                    .eq(TStore::getOperatorId, operatorId), String::valueOf);
-            if (storeIdsByOperatorId != null && !storeIdsByOperatorId.isEmpty()){
-                storeIds.addAll(storeIdsByOperatorId);
-            }else {
-                return null;
-            }
+        if (operatorId != null) {
+            List<String> storeIdsByOperatorId = storeService.listObjs(
+                    new LambdaQueryWrapper<TStore>()
+                            .select(TStore::getId)
+                            .eq(TStore::getOperatorId, operatorId),
+                    String::valueOf);
+            storeIds.addAll(storeIdsByOperatorId);
         }
 
-        Page<TSite> sitePage = tSiteService.page(page, new LambdaQueryWrapper<TSite>()
-                .eq(!StringUtils.isEmpty(query.getProvinceCode()), TSite::getProvinceCode, query.getProvinceCode())
-                .eq(!StringUtils.isEmpty(query.getCityCode()), TSite::getCityCode, query.getCityCode())
-                .in(!storeIds.isEmpty(), TSite::getStoreId, storeIds));
+        // 处理用户权限过滤(objectType为2)
+        User user = UserExt.getUser();
+        if (user != null && user.getObjectType() == 2) {
+            List<String> authorizedStoreIds = storeService.listObjs(
+                    new LambdaQueryWrapper<TStore>()
+                            .select(TStore::getId)
+                            .eq(TStore::getOperatorId, user.getObjectId()),
+                    String::valueOf);
+            if (authorizedStoreIds.isEmpty()) {
+                new Page();
+            }
+            if (storeIds.isEmpty()){
+                storeIds.addAll(authorizedStoreIds);
+            }else {
+                storeIds.retainAll(new HashSet<>(authorizedStoreIds));
+            }
+
+        }else if (user != null && user.getObjectType() == 3){
+            storeIds = new ArrayList<>();
+            storeIds.add(String.valueOf(user.getObjectId()));
+        }
 
 
+
+        // 最终查询条件:storeIds为空时会返回空Page
+        Page<TSite> sitePage = tSiteService.page(page,
+                new LambdaQueryWrapper<TSite>()
+                        .eq(!StringUtils.isEmpty(query.getProvinceCode()), TSite::getProvinceCode, query.getProvinceCode())
+                        .eq(!StringUtils.isEmpty(query.getCityCode()), TSite::getCityCode, query.getCityCode())
+                        .in(!storeIds.isEmpty(), TSite::getStoreId, storeIds));
+
+        // 批量查询store和operator,避免N+1问题
+        List<TSite> sites = sitePage.getRecords();
+        if (sites.isEmpty()) {
+            return sitePage.convert(t -> null); // 返回空Page
+        }
+
+        // 收集需要的storeId和operatorId
+        List<Integer> storeIdsForVO = sites.stream().map(TSite::getStoreId).distinct().collect(Collectors.toList());
+        List<Integer> operatorIdsForVO = sites.stream().map(TSite::getOperatorId).distinct().collect(Collectors.toList());
+
+        // 批量查询并缓存结果
+        Map<Integer, TStore> storeMap = storeService.listByIds(storeIdsForVO)
+                .stream()
+                .collect(Collectors.toMap(TStore::getId, Function.identity()));
+
+        Map<Integer, TOperator> operatorMap = operatorService.listByIds(operatorIdsForVO)
+                .stream()
+                .collect(Collectors.toMap(TOperator::getId, Function.identity()));
+
+        // 转换VO时直接使用缓存结果
         return sitePage.convert(tSite -> {
-            HuiminCardSiteVO huiminCardSiteVO = new HuiminCardSiteVO();
-            huiminCardSiteVO.setSiteId(tSite.getId());
-            huiminCardSiteVO.setProvince(tSite.getProvince());
-            huiminCardSiteVO.setSiteName(tSite.getName());
-            huiminCardSiteVO.setIds(tSite.getIds());
+            HuiminCardSiteVO vo = new HuiminCardSiteVO();
+            vo.setSiteId(tSite.getId());
+            vo.setProvince(tSite.getProvince());
+            vo.setSiteName(tSite.getName());
+            vo.setIds(tSite.getIds());
 
-            TStore store = storeService.getById(tSite.getStoreId());
-            if (store != null){
-                huiminCardSiteVO.setStoreName(store.getName());
+            TStore store = storeMap.get(tSite.getStoreId());
+            if (store != null) {
+                vo.setStoreName(store.getName());
             }
 
-            TOperator operator = operatorService.getById(tSite.getOperatorId());
-            if (operator != null){
-                huiminCardSiteVO.setOperatorName(operator.getName());
+            TOperator operator = operatorMap.get(tSite.getOperatorId());
+            if (operator != null) {
+                vo.setOperatorName(operator.getName());
             }
-            return huiminCardSiteVO;
-
+            return vo;
         });
     }
+
 
 
     @PostMapping(value = "/add")
     @ResponseBody
     public Object add(THuiminCard tHuiminCard) {
         int a = 0;
+        String useIds = tHuiminCard.getUseIds();
+        String[] useIdArr = useIds.split(",");
         if (tHuiminCard.getUseScope()==1){
-            tHuiminCard.setStoreIds(tHuiminCard.getUseIds());
+            tHuiminCard.setStoreIds(useIds);
+            String useId = useIdArr[0];
+            TStore store = storeService.getById(useId);
+            tHuiminCard.setOperatorId(store.getOperatorId());
         }else{
             StringBuilder storeIds = new StringBuilder();
-            for (String s : tHuiminCard.getUseIds().split(",")) {
+            for (String s : useIdArr) {
                 TSite site = tSiteService.getById(s);
                 if (site!=null){
                     storeIds.append(site.getStoreId()).append(",");
@@ -197,7 +273,12 @@
             }
             StringBuilder stringBuilder = storeIds.deleteCharAt(storeIds.length() - 1);
             tHuiminCard.setStoreIds(stringBuilder.toString());
+
+            String useId = useIdArr[0];
+            TSite site = tSiteService.getById(useId);
+            tHuiminCard.setOperatorId(site.getOperatorId());
         }
+
         huiminCardClient.save(tHuiminCard);
         return SUCCESS_TIP;
     }
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TPayHuiminController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TPayHuiminController.java
index 0d2f20b..736dc83 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TPayHuiminController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TPayHuiminController.java
@@ -8,6 +8,7 @@
 import com.dsh.course.feignClient.activity.PayHuiminClient;
 import com.dsh.course.feignClient.activity.model.HuiminPayQuery;
 import com.dsh.course.feignClient.activity.model.TPayHuimin;
+import com.dsh.guns.config.UserExt;
 import com.dsh.guns.core.base.controller.BaseController;
 import com.dsh.guns.core.common.constant.factory.PageFactory;
 import com.dsh.guns.modular.system.model.AppUserByNameAndPhoneDTO;
@@ -25,7 +26,7 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -33,6 +34,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -67,8 +69,20 @@
      */
     @RequestMapping("")
     public String index(Model model) {
+        Integer objectType = UserExt.getUser().getObjectType();
+        Integer operatorId = null;
+        if (objectType.equals(2)){
+            //查询运营商
+            TOperator operator = operatorService.getOne(new QueryWrapper<TOperator>()
+                    .eq("userId", UserExt.getUser().getId())
+                    .ne("state", 3)
+                    .last("LIMIT 1"));
+            if (Objects.nonNull(operator)) {
+                operatorId = operator.getId();
+            }
+        }
         //查询运营商列表
-        model.addAttribute("operatorList", operatorService.list(new QueryWrapper<TOperator>().eq("state", 1)));
+        model.addAttribute("operatorList", operatorService.list(new QueryWrapper<TOperator>().eq(Objects.nonNull(operatorId), "id",operatorId).eq("state", 1)));
         model.addAttribute("storeList", storeService.list(new QueryWrapper<TStore>().eq("state", 1)));
         return PREFIX + "tPayHuimin.html";
     }
@@ -87,6 +101,17 @@
     @RequestMapping(value = "/list")
     @ResponseBody
     public Object list(HuiminPayQuery query) {
+        Integer objectType = UserExt.getUser().getObjectType();
+        if (objectType.equals(2)){
+            //查询运营商
+            TOperator operator = operatorService.getOne(new QueryWrapper<TOperator>()
+                    .eq("userId", UserExt.getUser().getId())
+                    .ne("state", 3)
+                    .last("LIMIT 1"));
+            if (Objects.nonNull(operator)) {
+                query.setOperatorId(Long.valueOf(operator.getId()));
+            }
+        }
         Page<TPayHuimin> tPayHuiminPage = new PageFactory<TPayHuimin>().defaultPage();
         query.setCurrent(tPayHuiminPage.getCurrent());
         query.setSize(tPayHuiminPage.getSize());
@@ -110,16 +135,20 @@
             List<Integer> operatorIdList = records.stream()
                     .map(SalesDetailVO::getOperatorId)
                     .collect(Collectors.toList());
-            List<Integer> storeIdList = records.stream()
-                    .map(SalesDetailVO::getStoreId)
-                    .collect(Collectors.toList());
             Map<Integer, String> operatorMap = operatorService.listByIds(operatorIdList).stream()
                     .collect(Collectors.toMap(TOperator::getId, TOperator::getName));
-            Map<Integer, String> storeMap = storeService.listByIds(storeIdList).stream()
+            Map<Integer, String> storeMap = storeService.list().stream()
                     .collect(Collectors.toMap(TStore::getId, TStore::getName));
             records.forEach(item->{
                 item.setOperatorName(operatorMap.getOrDefault(item.getOperatorId(),""));
-                item.setStoreName(storeMap.getOrDefault(item.getStoreId(),""));
+                StringBuilder sb = new StringBuilder();
+                Arrays.stream(item.getStoreIds().split(",")).map(Integer::parseInt).forEach(s->{
+                    sb.append( storeMap.getOrDefault(s, ""));
+                    sb.append(",");
+                });
+                //sb去除最后一个逗号
+                sb.deleteCharAt(sb.length() - 1);
+                item.setStoreName(sb.toString());
             });
         }
         return super.packForBT(salesDetailVOPage);
@@ -159,10 +188,11 @@
      * @param id
      * @return
      */
-    @GetMapping("/refund/{id}")
+    @PostMapping("/refund")
     @ResponseBody
-    public ResultUtil<?> refund(@PathVariable("id") Integer id) {
-        return payHuiminClient.refund(id);
+    public ResultUtil<?> refund(Integer id) {
+         payHuiminClient.refund(id);
+        return ResultUtil.success();
     }
 
     /**
@@ -177,16 +207,20 @@
             List<Integer> operatorIdList = records.stream()
                     .map(SalesDetailVO::getOperatorId)
                     .collect(Collectors.toList());
-            List<Integer> storeIdList = records.stream()
-                    .map(SalesDetailVO::getStoreId)
-                    .collect(Collectors.toList());
             Map<Integer, String> operatorMap = operatorService.listByIds(operatorIdList).stream()
                     .collect(Collectors.toMap(TOperator::getId, TOperator::getName));
-            Map<Integer, String> storeMap = storeService.listByIds(storeIdList).stream()
+            Map<Integer, String> storeMap = storeService.list().stream()
                     .collect(Collectors.toMap(TStore::getId, TStore::getName));
-            records.forEach(item -> {
-                item.setOperatorName(operatorMap.getOrDefault(item.getOperatorId(), ""));
-                item.setStoreName(storeMap.getOrDefault(item.getStoreId(), ""));
+            records.forEach(item->{
+                item.setOperatorName(operatorMap.getOrDefault(item.getOperatorId(),""));
+                StringBuilder sb = new StringBuilder();
+                Arrays.stream(item.getStoreIds().split(",")).map(Integer::parseInt).forEach(s->{
+                    sb.append( storeMap.getOrDefault(s, ""));
+                    sb.append(",");
+                });
+                //sb去除最后一个逗号
+                sb.deleteCharAt(sb.length() - 1);
+                item.setStoreName(sb.toString());
             });
         }
         String[] titleArr = {"惠民卡名称", "惠民卡类型", "售卖金额", "所属运营商", "可用门店", "购买用户", "联系电话", "购买时间", "绑定人员", "已用次数", "有效期", "状态"};
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HuiminCardStoreVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HuiminCardStoreVO.java
index d22e09c..2e87066 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HuiminCardStoreVO.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HuiminCardStoreVO.java
@@ -10,6 +10,8 @@
 
     private String operatorName;
 
+    private Integer operatorId;
+
     private String storeName;
 
     private String ids;
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SalesDetailVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SalesDetailVO.java
index ecfc282..99674b7 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SalesDetailVO.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SalesDetailVO.java
@@ -1,5 +1,6 @@
 package com.dsh.guns.modular.system.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -17,7 +18,7 @@
     // 关联信息
     private Integer operatorId;
     private String operatorName;        // 所属运营商
-    private Integer storeId;
+    private String storeIds;
     private String storeName;           // 可用门店
     private Integer appUserId;           // 购买用户ID
     private String userName;            // 购买用户
@@ -25,8 +26,10 @@
     
     // 时间信息
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date paymentTime;  // 购买时间[1,8](@ref)
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;      // 有效期
     
     // 使用信息
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminAgreement/tHuiminAgreement_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminAgreement/tHuiminAgreement_add.html
index 1e5c68c..669951c 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminAgreement/tHuiminAgreement_add.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminAgreement/tHuiminAgreement_add.html
@@ -14,21 +14,11 @@
                             <div id="tab-1" class="tab-pane active">
                                 <div class="panel-body">
                                     <textarea id="editor_1" type="text/plain" style="width:1200px;height:400px;">${item.addUserRemark!}</textarea>
-                                    <!--<div class="row btn-group-m-t">
-                                        <div class="col-sm-10 col-sm-offset-5">
-                                            <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun=""/>
-                                        </div>
-                                    </div>-->
                                 </div>
                             </div>
                             <div id="tab-2" class="tab-pane">
                                 <div class="panel-body">
                                     <textarea type="text/plain" id="editor_2" style="width:1200px;height:400px;"${item.selectUserRemark!}</textarea>
-                                    <!--<div class="row btn-group-m-t">
-                                        <div class="col-sm-10">
-                                            <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun=""/>
-                                        </div>
-                                    </div>-->
                                 </div>
                             </div>
                         </div>
@@ -108,6 +98,12 @@
         editor_2 = UE.getEditor('editor_2');
         editor_3 = UE.getEditor('editor_3');
 
+        // 改用全局方法处理删除
+        window.deleteTab = function(counter) {
+            console.log("全局删除方法被调用,counter =", counter);
+            deleteEditor(parseInt(counter));
+        };
+
         // 绑定添加按钮的点击事件
         $("#agreementAdd").click(function() {
             var title = $("#agreement").val().trim();
@@ -123,27 +119,91 @@
             $("#agreement").val("");
         });
         
-        //协议配置回显
-        let settingList = '${tHuiminAgreementSettingList}';
-        if (settingList != "" && typeof settingList != "undefined"){
-            let settingArr = JSON.parse(settingList);
-            review(settingArr);
-        }
-
+        // 确保编辑器初始化完成后再获取数据
+        editor_3.ready(function() {
+            console.log("编辑器初始化完成,准备加载数据");
+            
+            // 页面初始化时通过AJAX请求获取协议配置数据
+            var operatorId = $("#operator").val();
+            console.log("页面初始化,当前运营商ID:", operatorId);
+            
+            // 调用接口获取协议配置数据(只回显协议配置,不回显门店无惠民卡介绍页)
+            var ajax = new $ax(Feng.ctxPath + "/tHuiminAgreement/selectAgreementByOperationId", function(data){
+                console.log("获取到的惠民卡数据:", data);
+                if (data.data != null){
+                    // 只更新协议配置
+                    if (data.data.settingList && data.data.settingList.length > 0) {
+                        console.log("协议配置数据:", data.data.settingList);
+                        review(data.data.settingList);
+                    }
+                }
+            },function(data){
+                console.error("获取惠民卡数据失败:", data);
+                Feng.error("获取惠民卡数据失败!");
+            });
+            ajax.set("operatorId", operatorId);
+            ajax.start();
+        });
         
         //经营商切换事件
         $("#operator").change(function() {
+            console.log("运营商切换事件触发,选择的运营商ID:", $("#operator").val());
+            
+            // 先主动清空编辑器内容
+            if(editor_3 && editor_3.body) {
+                editor_3.setContent("");
+                console.log("主动清空门店无惠民卡介绍页内容");
+            }
+            
             //清空协议配置
-            removeAll()
+            removeAll();
             //调用接口获取协议配置数据
             //提交信息
             var ajax = new $ax(Feng.ctxPath + "/tHuiminAgreement/selectAgreementByOperationId", function(data){
-                if (data.data != "" && data.data != null){
-                    console.log("协议配置数据:"+data.data);
-                    let settingArr = JSON.parse(data.data);
-                    review(settingArr);
+                console.log("获取到的惠民卡数据:", data);
+                if (data.data != null){
+                    // 更新门店无惠民卡介绍页内容
+                    try {
+                        var introContent = "";
+                        // 严格判断内容是否存在且非空
+                        if(data.data.storeNoHuiminCardIntro !== null && 
+                           data.data.storeNoHuiminCardIntro !== undefined && 
+                           data.data.storeNoHuiminCardIntro !== "") {
+                            introContent = data.data.storeNoHuiminCardIntro;
+                        }
+                        
+                        // 确保编辑器实例存在且已初始化
+                        if(editor_3 && editor_3.body) {
+                            // 设置编辑器内容(空内容会清空编辑器)
+                            editor_3.setContent(introContent);
+                            console.log("已更新门店无惠民卡介绍页内容:", introContent ? "有内容" : "内容为空");
+                        } else {
+                            console.error("编辑器未准备好,无法设置内容");
+                            // 延迟设置内容
+                            setTimeout(function() {
+                                try {
+                                    if(editor_3) {
+                                        editor_3.setContent(introContent);
+                                        console.log("延迟更新门店无惠民卡介绍页内容成功");
+                                    }
+                                } catch(e) {
+                                    console.error("延迟设置编辑器内容出错:", e);
+                                }
+                            }, 1000);
+                        }
+                    } catch(e) {
+                        console.error("设置编辑器内容出错:", e);
+                    }
+                    
+                    // 更新协议配置
+                    if (data.data.settingList && data.data.settingList.length > 0) {
+                        console.log("协议配置数据:", data.data.settingList);
+                        review(data.data.settingList);
+                    }
                 }
             },function(data){
+                console.error("获取惠民卡数据失败:", data);
+                Feng.error("获取惠民卡数据失败!");
             });
             ajax.set("operatorId",$("#operator").val());
             ajax.start();
@@ -180,7 +240,15 @@
     function review(settingArr){
         if (typeof settingArr !== 'undefined' && settingArr.length > 0) {
             settingArr.forEach(function(item) {
-                addNewEditor(item.title, item.content || "");
+                // 详细记录每个配置项
+                console.log("处理协议配置项:", item);
+                
+                // 获取标题和内容,兼容不同字段名
+                var title = item.agreementName || item.title || "";
+                var content = item.agreementContent || item.content || "";
+                
+                console.log("使用标题:", title, "内容长度:", content.length, "内容前20字符:", content.substring(0, 20));
+                addNewEditor(title, content);
             });
         }
     }
@@ -188,8 +256,11 @@
     // 添加新的编辑器函数 - 修改为接受内容参数
     function addNewEditor(title, content) {
         editorCounter++;
-        var editorId = "dynamic-editor-" + editorCounter;
-        var tabId = "agreement-tab-" + editorCounter;
+        // 立即捕获当前counter值,防止闭包问题
+        var currentCounter = editorCounter;
+        
+        var editorId = "dynamic-editor-" + currentCounter;
+        var tabId = "agreement-tab-" + currentCounter;
         var isFirstTab = (dynamicEditors.length === 0);
         
         // 如果是第一个编辑器,显示tabs容器
@@ -202,10 +273,15 @@
         $("#agreement-content .tab-pane").removeClass("active");
         
         // 创建新的Tab - 始终设置为激活状态
-        var tabHtml = '<li class="active" id="tab-li-' + editorCounter + '">' +
-                      '<a data-toggle="tab" href="#' + tabId + '" aria-expanded="true">' + title + 
-                      ' <i class="fa fa-times-circle delete-tab" data-editor-id="' + editorId + '" ' +
-                      'data-tab-id="' + tabId + '" data-counter="' + editorCounter + '"></i></a></li>';
+        // 修改删除按钮DOM结构,确保按钮在标题右侧
+        var tabHtml = '<li class="active" id="tab-li-' + currentCounter + '" style="position:relative;">' +
+                      '<a data-toggle="tab" href="#' + tabId + '" aria-expanded="true" style="padding-right:25px;">' + title + '</a>' + 
+                      '<span onclick="deleteTab(' + currentCounter + ')" ' +
+                      'style="position:absolute;right:5px;top:10px;cursor:pointer;color:#f00;z-index:100;">' +
+                      '<i class="fa fa-times-circle"></i></span></li>';
+        
+        // 记录创建的按钮信息,辅助调试
+        console.log("创建删除按钮, counter =", currentCounter, "title =", title);
         
         // 创建Tab内容 - 始终设置为激活状态
         var contentHtml = '<div id="' + tabId + '" class="tab-pane active">' +
@@ -226,90 +302,134 @@
             autoFloatEnabled: false
         });
         
-        // 确保编辑器已准备好
-        editor.ready(function() {
-            try {
-                // 检查编辑器是否已准备好接收内容
-                if(editor.body) {
-                    // 初始化内容
-                    editor.setContent(content || "");
-                } else {
-                    // 如果编辑器body未准备好,延迟设置内容
-                    setTimeout(function() {
-                        try {
-                            editor.setContent(content || "");
-                        } catch(e) {
-                            console.error("延迟设置编辑器内容出错:", e);
-                        }
-                    }, 500);
+        // 确保编辑器已准备好,使用立即执行函数捕获当前counter值
+        (function(capturedCounter, editorId, tabId, titleText, contentText) {
+            editor.ready(function() {
+                try {
+                    // 检查编辑器是否已准备好接收内容
+                    if(editor.body) {
+                        // 初始化内容
+                        editor.setContent(contentText || "");
+                    } else {
+                        // 如果编辑器body未准备好,延迟设置内容
+                        setTimeout(function() {
+                            try {
+                                editor.setContent(contentText || "");
+                            } catch(e) {
+                                console.error("延迟设置编辑器内容出错:", e);
+                            }
+                        }, 500);
+                    }
+                    
+                    // 存储编辑器实例和标题信息,使用捕获的counter
+                    dynamicEditors.push({
+                        id: editorId,
+                        tabId: tabId,
+                        counter: capturedCounter,  // 使用捕获的值,而不是外部变量
+                        title: titleText,
+                        editor: editor,
+                        content: contentText || ""
+                    });
+                    
+                    console.log("编辑器准备完成,添加到dynamicEditors,counter =", capturedCounter);
+                    
+                    // 不再需要在这里绑定事件,因为已经使用事件委托
+                } catch(e) {
+                    console.error("编辑器初始化出错:", e);
                 }
-                
-                // 存储编辑器实例和标题信息
-                dynamicEditors.push({
-                    id: editorId,
-                    tabId: tabId,
-                    counter: editorCounter,
-                    title: title,
-                    editor: editor,
-                    content: content || ""
-                });
-                
-                // 绑定删除按钮事件
-                $(".delete-tab[data-editor-id='" + editorId + "']").click(function(e) {
-                    e.preventDefault();
-                    e.stopPropagation();
-                    deleteEditor($(this).data("counter"));
-                });
-            } catch(e) {
-                console.error("编辑器初始化出错:", e);
-            }
-        });
+            });
+        })(currentCounter, editorId, tabId, title, content);
         
         // 手动激活新添加的标签页
         $('#agreement-tabs a[href="#' + tabId + '"]').tab('show');
     }
 
-    // 删除编辑器函数
+    // 删除编辑器函数 - 优化标签页激活逻辑
     function deleteEditor(counter) {
+        // 确保counter是整数
+        counter = parseInt(counter);
+        
         var index = -1;
         var isActive = $("#tab-li-" + counter).hasClass("active");
         var nextActive = null;
         
+        // 输出当前所有编辑器的counter值,辅助调试
+        console.log("当前所有编辑器的counter值:", dynamicEditors.map(function(item) { return item.counter; }));
+        console.log("完整的dynamicEditors数组:", JSON.stringify(dynamicEditors.map(function(item) { 
+            return {
+                counter: item.counter,
+                title: item.title,
+                tabId: item.tabId,
+                id: item.id
+            }; 
+        })));
+        
         // 查找编辑器索引
         for(var i = 0; i < dynamicEditors.length; i++) {
-            if(dynamicEditors[i].counter == counter) {
+            console.log("检查编辑器", i, "counter =", dynamicEditors[i].counter, "要删除的counter =", counter);
+            // 使用严格的整数比较
+            if(parseInt(dynamicEditors[i].counter) === counter) {
                 index = i;
                 break;
             }
         }
         
-        if(index === -1) return;
-        
-        // 销毁编辑器实例
-        if(dynamicEditors[index].editor) {
-            dynamicEditors[index].editor.destroy();
+        if(index === -1) {
+            console.error("找不到要删除的编辑器:", counter);
+            // 尝试遍历DOM查找是否存在该元素
+            console.log("尝试检查DOM元素是否存在:", "#tab-li-" + counter);
+            console.log("DOM元素存在:", $("#tab-li-" + counter).length > 0);
+            return;
         }
         
-        // 如果删除的是当前活跃tab,需要激活另一个tab
+        console.log("删除编辑器", counter, "索引:", index, "是否当前活跃:", isActive);
+        
+        // 确定删除后需要激活哪个标签页
         if(isActive && dynamicEditors.length > 1) {
             // 优先选择下一个,如果没有则选择上一个
             if(index < dynamicEditors.length - 1) {
                 nextActive = dynamicEditors[index + 1].tabId;
+                console.log("将激活下一个标签页:", nextActive);
             } else {
                 nextActive = dynamicEditors[index - 1].tabId;
+                console.log("将激活上一个标签页:", nextActive);
             }
         }
         
-        // 完全清理DOM元素
-        $("#tab-li-" + counter).remove();
-        $("#" + dynamicEditors[index].tabId).remove();
+        // 如果是当前活跃标签,先激活另一个标签,再删除当前标签
+        if(isActive && nextActive) {
+            try {
+                console.log("先激活其他标签页:", nextActive);
+                $('a[href="#' + nextActive + '"]').tab('show');
+            } catch(e) {
+                console.error("激活其他标签页失败:", e);
+            }
+        }
         
-        // 确保UEditor容器被完全移除
-        $("#" + dynamicEditors[index].id).parents(".edui-default").remove();
-        $("#" + dynamicEditors[index].id).remove();
+        // 销毁编辑器实例
+        try {
+            if(dynamicEditors[index].editor) {
+                dynamicEditors[index].editor.destroy();
+            }
+        } catch(e) {
+            console.error("销毁编辑器出错:", e);
+        }
+        
+        // 完全清理DOM元素
+        try {
+            $("#tab-li-" + counter).remove();
+            $("#" + dynamicEditors[index].tabId).remove();
+            
+            // 确保UEditor容器被完全移除
+            $("#" + dynamicEditors[index].id).parents(".edui-default").remove();
+            $("#" + dynamicEditors[index].id).remove();
+        } catch(e) {
+            console.error("清理DOM元素出错:", e);
+        }
         
         // 从数组中移除
         dynamicEditors.splice(index, 1);
+        console.log("删除后的编辑器列表:", dynamicEditors.map(function(item) { return item.title; }));
         
         // 如果没有编辑器了,清空并隐藏tabs容器
         if(dynamicEditors.length === 0) {
@@ -317,10 +437,8 @@
             // 彻底清空容器内容,确保没有残留
             $("#agreement-tabs").empty();
             $("#agreement-content").empty();
-        } else if(nextActive) {
-            // 激活下一个tab
-            $('a[href="#' + nextActive + '"]').tab('show');
         }
+        // 不再需要这个逻辑,因为我们在删除前已经激活了其他标签
     }
     
     //收集动态编辑器内容
@@ -340,11 +458,13 @@
                 content = dynamicEditors[i].content || "";
             }
             
+            // 使用与后端一致的字段名
             agreements.push({
-                title: dynamicEditors[i].title,
-                content: content
+                agreementName: dynamicEditors[i].title,
+                agreementContent: content
             });
         }
+        console.log("收集到的协议配置数据:", agreements);
         return agreements;
     };
 
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard.html
index 7a6b43f..b4492dd 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard.html
@@ -8,11 +8,11 @@
             <div class="ibox-content">
                 <el-form :inline="true" :model="query">
                     <el-form-item label="惠民卡名称:">
-                        <el-input v-model="query.name" placeholder="请输入"></el-input>
+                        <el-input v-model="query.huiMinName" placeholder="请输入"></el-input>
                     </el-form-item>
 
                     <el-form-item label="惠民卡类型:">
-                        <el-select v-model="query.type" placeholder="全部">
+                        <el-select v-model="query.huiMinType" placeholder="全部">
                             <el-option label="全部" value=""></el-option>
                             <el-option label="年度卡" value="year"></el-option>
                             <el-option label="季度卡" value="quarter"></el-option>
@@ -22,11 +22,21 @@
                     <el-form-item label="有效期:">
                         <el-date-picker
                                 v-model="query.dateRange"
+                                value-format="yyyy-MM-dd HH:mm:ss"
                                 type="daterange"
                                 range-separator="至"
                                 start-placeholder="开始日期"
                                 end-placeholder="结束日期">
                         </el-date-picker>
+                    </el-form-item>
+
+                    <el-form-item label="惠民卡状态:">
+                        <el-select v-model="query.huiMinStatus" placeholder="全部">
+                            <el-option label="全部" value=""></el-option>
+                            <el-option label="未开始" value="1"></el-option>
+                            <el-option label="已开始" value="2"></el-option>
+                            <el-option label="已结束" value="3"></el-option>
+                        </el-select>
                     </el-form-item>
 
                     <el-form-item label="可售状态:">
@@ -39,13 +49,30 @@
                 </el-form>
                 <div class="row">
                     <div class="col-sm-12">
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;" v-on:click="handleSearch" icon="el-icon-search">搜索</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;" v-on:click="handleAdd" icon="el-icon-circle-plus-outline">添加</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;"  v-on:click="handleEdit" icon="el-icon-edit">编辑</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;"  v-on:click="handleDelete" icon="el-icon-delete">删除</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;"  v-on:click="handleShelves(1)" icon="el-icon-upload2">上架</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;"  v-on:click="handleShelves(2)" icon="el-icon-download">下架</el-button>
-                        <el-button type="primary" size="medium" style="background-color:#1ab394;color: #ffffff;border:#1ab394;"  v-on:click="handleViewDetail" icon="el-icon-tickets">查看详情</el-button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleSearch">
+                            <i class="fa fa-search"></i>
+                            搜索
+                        </button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleAdd">
+                            <i class="fa fa-plus"></i>
+                            添加
+                        </button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleEdit">
+                            <i class="fa fa-edit"></i>
+                            编辑
+                        </button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleDelete">
+                            <i class="fa fa-remove"></i>
+                            删除
+                        </button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleShelves(1)">
+                            <i class="fa fa-check"></i>
+                            上架
+                        </button>
+                        <button type="button" class="btn btn-primary" v-on:click="handleShelves(2)">
+                            <i class="fa fa-remove"></i>
+                            下架
+                        </button>
                     </div>
                 </div>
                 <el-table
@@ -91,9 +118,9 @@
                     <el-table-column prop="sort" label="排序"></el-table-column>
                     <el-table-column prop="flag" label="活动状态" >
                         <template slot-scope="scope">
-                            <span v-if="scope.row.flag === 1">未开始</span>
-                            <span v-else-if="scope.row.flag === 2">已开始</span>
-                            <span v-else-if="scope.row.flag === 3">已结束</span>
+                            <span v-if="scope.row.huiMinStatus === 1">未开始</span>
+                            <span v-else-if="scope.row.huiMinStatus === 2">已开始</span>
+                            <span v-else-if="scope.row.huiMinStatus === 3">已结束</span>
                             <span v-else>未知类型</span>
                         </template>
                     </el-table-column>
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_add.html
index 39eaf75..5eb8e8e 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_add.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_add.html
@@ -167,24 +167,18 @@
                 <!-- 时间输入和删除按钮 -->
                 <div class="row g-3">
                     <div class="col-md-6" style="display: flex">
-                        <el-time-select
-                                placeholder="起始时间"
+                        <el-time-picker
                                 v-model="weekGroup.startTime"
-                                :picker-options="{
-                                                start: '00:00',
-                                                step: '01:00',
-                                                end: '23:00'}"
-                        >
-                        </el-time-select>
-                        <el-time-select
-                                placeholder="结束时间"
+                                format="HH:mm"
+                                value-format="HH:mm"
+                                placeholder="开始时间">
+                        </el-time-picker>
+                        <el-time-picker
+                                format="HH:mm"
+                                value-format="HH:mm"
                                 v-model="weekGroup.endTime"
-                                :picker-options="{
-                                              start: '00:00',
-                                              step: '01:00',
-                                              end: '23:00',
-                                              minTime: weekGroup.startTime}">
-                        </el-time-select>
+                                placeholder="结束时间">
+                        </el-time-picker>
                     </div>
                     <div class="col-md-6">
                         <button
@@ -223,13 +217,13 @@
         </el-form-item>
 
         <!-- 适用范围 -->
-        <el-form-item label="适用范围" prop="useScope">
-            <el-radio v-model="huiminCard.useScope" label="1">指定门店</el-radio>
-            <el-radio v-model="huiminCard.useScope" label="2">指定场地</el-radio>
+        <el-form-item label="适用范围" prop="useScope" >
+            <el-radio v-if="objectType !=='3'" v-model="huiminCard.useScope" v-on:change="useScopeChange()" label="1">指定门店</el-radio>
+            <el-radio v-model="huiminCard.useScope" v-on:change="useScopeChange()" label="2">指定场地</el-radio>
         </el-form-item>
 
         <!-- 指定门店 -->
-        <el-form-item label="指定门店" v-if="huiminCard.useScope === '1'" prop="storeIds">
+        <el-form-item label="指定门店" v-if="huiminCard.useScope === '1' && objectType !=='3'" prop="storeIds">
             <el-button type="text" v-on:click="handleSelectStore()">选择门店</el-button>
             <el-table
                     :data="tableData"
@@ -302,6 +296,7 @@
             </el-table>
         </el-form-item>
 
+
         <!-- 惠民卡介绍 -->
         <el-form-item label="惠民卡介绍" prop="introduce">
             <textarea type="text/plain" v-model="introduces" id="editor_1"></textarea>
@@ -332,7 +327,6 @@
                             <el-select v-model="storeForm.provinceCode" size="mini" clearable filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in provinces"
-                                        :key="item.code"
                                         :label="item.name"
                                         :value="item.code">
                                 </el-option>
@@ -344,7 +338,6 @@
                             <el-select v-model="storeForm.cityCode" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in cities"
-                                        :key="item.citycode"
                                         :label="item.name"
                                         :value="item.citycode">
                                 </el-option>
@@ -352,11 +345,10 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
-                        <el-form-item label="所属运营商">
+                        <el-form-item label="所属运营商" label-width="100px">
                             <el-select v-model="storeForm.operatorId" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in operations"
-                                        :key="item.id"
                                         :label="item.name"
                                         :value="item.id">
                                 </el-option>
@@ -405,12 +397,13 @@
                 </el-table-column>
             </el-table>
             <el-pagination
-                    background
-                    layout="prev, pager, next"
-                    v-on:pagination="storeList"
-                    :page.sync="queryParams.pageNum"
-                    :limit.sync="queryParams.pageSize"
-                    :total="tableStoreTotal">
+                    v-on:size-change="handleStoreSizeChange"
+                    v-on:current-change="handleStoreCurrentChange"
+                    :current-page="currentStorePage"
+                    :page-sizes="[10, 50, 100, 200]"
+                    :page-size="pageStoreSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="storeTotal">
             </el-pagination>
             <span slot="footer" class="dialog-footer">
                 <el-button v-on:click="dialogVisible2 = false">取 消</el-button>
@@ -432,7 +425,6 @@
                             <el-select v-model="siteForm.provinceCode" size="mini" clearable filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in provinces"
-                                        :key="item.code"
                                         :label="item.name"
                                         :value="item.code">
                                 </el-option>
@@ -444,7 +436,6 @@
                             <el-select v-model="siteForm.cityCode" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in cities"
-                                        :key="item.citycode"
                                         :label="item.name"
                                         :value="item.citycode">
                                 </el-option>
@@ -452,11 +443,10 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
-                        <el-form-item label="所属运营商">
+                        <el-form-item label="所属运营商" label-width="100px">
                             <el-select v-model="siteForm.operatorId" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in operations"
-                                        :key="item.id"
                                         :label="item.name"
                                         :value="item.id">
                                 </el-option>
@@ -511,12 +501,16 @@
                 </el-table-column>
             </el-table>
 
-            <pagination
-                    v-show="tableSiteTotal>0"
-                    :total="tableSiteTotal"
-                    :page.sync="queryParams.pageNum"
-                    :limit.sync="queryParams.pageSize"
-                    v-on:pagination="siteList"></pagination>
+
+            <el-pagination
+                    v-on:size-change="handleSiteSizeChange"
+                    v-on:current-change="handleSiteCurrentChange"
+                    :current-page="currentSitePage"
+                    :page-sizes="[10, 50, 100, 200]"
+                    :page-size="pageSiteSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="siteTotal">
+            </el-pagination>
 
             <span slot="footer" class="dialog-footer">
                 <el-button v-on:click="dialogVisible3 = false">取 消</el-button>
@@ -647,6 +641,13 @@
                 introduces: null,
                 multipleSelection1: [],
                 multipleSelection2: [],
+                currentSitePage: 1,
+                pageSiteSize: 10,
+                currentStorePage: 1,
+                pageStoreSize: 10,
+                siteTotal: 0,
+                storeTotal: 0,
+                objectType: null,
                 unUseTimes: [
                     {}
                 ],
@@ -673,7 +674,6 @@
                 },
                 tableData: [],
                 tableStoreData: [],
-                tableStoreTotal: 0,
                 tableStoreLoading: false,
                 tableSiteData: [],
                 tableSiteTotal: 0,
@@ -798,7 +798,7 @@
                 return isLt2M;
             },
             handleRemove(file, fileList) {
-                const fileUrl = file.response;
+                const fileUrl = file.url;
                 this.banners.forEach((item, index) => {
                     if (item === fileUrl) {
                         this.banners.splice(index, 1);
@@ -864,7 +864,7 @@
                 let ajax = new $ax(Feng.ctxPath + "/tHuiminCard/storeList",
                     (data) => {
                         vm.tableStoreData = data.records; // 使用 vm 替代 this
-                        vm.tableStoreTotal = data.total;
+                        vm.storeTotal = data.total;
                         vm.tableStoreLoading = false;
                         console.log('成功获取数据:', vm.tableStoreData); // 验证数据
                     },
@@ -873,8 +873,8 @@
                         Feng.error("请求失败: " + data.responseJSON.message);
                     }
                 );
-                this.storeForm.pageNum = vm.queryParams.pageNum;
-                this.storeForm.pageSize = vm.queryParams.pageSize
+                this.storeForm.pageNum = vm.currentStorePage;
+                this.storeForm.pageSize = vm.pageStoreSize
                 ajax.set(this.storeForm);
 
                 ajax.start();
@@ -887,6 +887,9 @@
                         vm.tableSiteData = data.records; // 使用 vm 替代 this
                         vm.tableSiteTotal = data.total;
                         vm.tableSiteLoading = false;
+                        vm.currentStorePage = data.current;
+                        vm.pageStoreSize = data.size;
+                        vm.siteTotal = data.total;
                         console.log('成功获取数据:', vm.tableSiteData); // 验证数据
                     },
                     (data) => {
@@ -894,8 +897,8 @@
                         Feng.error("请求失败: " + data.responseJSON.message);
                     }
                 );
-                this.siteForm.pageNum = vm.queryParams.pageNum;
-                this.siteForm.pageSize = vm.queryParams.pageSize
+                this.siteForm.current = vm.currentSitePage;
+                this.siteForm.size = vm.pageSiteSize
                 ajax.set(this.siteForm);
                 ajax.start();
             },
@@ -903,14 +906,10 @@
                 this.dialogVisible2 = false;
             },
             handleSiteClose() {
-                this.$confirm('确认关闭?1')
-                    .then(_ => {
-                        this.dialogVisible3 = false;
-                    })
-                    .catch(_ => {
-                    });
+                this.dialogVisible3 = false;
             },
             handleSelectionChange(val) {
+
                 if (this.huiminCard.useScope === '1') {
                     this.multipleSelection1 = val;
                 } else if (this.huiminCard.useScope === '2') {
@@ -937,8 +936,30 @@
                     Feng.info('请选择数据');
                     return;
                 }
-                this.dialogVisible2 = false
-                this.tableData = this.multipleSelection1;
+
+                // 新增:检查所有新选中的门店是否属于同一运营商
+                const firstOperator = this.multipleSelection1[0].operatorId;
+                if (this.multipleSelection1.some(item => item.operatorId !== firstOperator)) {
+                    Feng.info('请选择同一运营商');
+                    return;
+                }
+
+                // 检查新选门店与已有门店的运营商是否一致(如果需要)
+                if (this.tableData.length > 0) {
+                    const existingOperator = this.tableData[0].operatorId;
+                    if (firstOperator !== existingOperator) {
+                        Feng.info('新选门店的运营商需与已有门店一致');
+                        return;
+                    }
+                }
+
+                this.multipleSelection1.forEach((item) => {
+                    if (!this.tableData.some(item1 => item1.storeId === item.storeId)) {
+                        this.tableData.push(item);
+                    }
+                });
+
+                this.dialogVisible2 = false;
                 this.huiminCard.useIds = this.tableData.map(item => item.storeId).join(',');
             },
             handleSite() {
@@ -949,6 +970,9 @@
                 this.dialogVisible3 = false
                 this.tableData = this.multipleSelection2;
                 this.huiminCard.useIds = this.tableData.map(item => item.siteId).join(',');
+            },
+            useScopeChange() {
+                this.tableData = [];
             },
             submitForm(formName) {
                 this.$refs[formName].validate(valid => {
@@ -984,10 +1008,29 @@
                     }
                 });
             },
+            handleSiteSizeChange(val){
+                this.pageSiteSize = val;
+                this.siteList();
+            },
+            handleSiteCurrentChange(val){
+                this.currentSitePage = val;
+                this.siteList();
+            },
+            handleStoreSizeChange(val){
+                this.pageSiteSize = val;
+                this.storeList();
+            },
+            handleStoreCurrentChange(val){
+                this.currentSitePage = val;
+                this.storeList();
+            },
         },
         created() {
             let editor_1 = UE.getEditor('editor_1');
-
+            this.objectType = `${objectType}`
+            if (this.objectType === '3'){
+                this.huiminCard.useScope = '2'
+            }
 
             let ajax = new $ax(Feng.ctxPath + "/base/region/getProvince",
                 (data) => {
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_detail.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_detail.html
index 55ca096..e70122c 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_detail.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHuiminCard/tHuiminCard_detail.html
@@ -206,7 +206,7 @@
 
         <!-- 不可用时间 -->
         <el-form-item label="不可用时间" prop="unUseTimes">
-            <el-button type="text" v-on:click="addUnUseTime()">添加</el-button>
+            <el-button typ  e="text" v-on:click="addUnUseTime()">添加</el-button>
             <div v-for="(item, dayIndex) in unUseTimes"
                  :key="dayIndex"
                  class="date-picker-item mb-2">
@@ -228,12 +228,12 @@
 
         <!-- 适用范围 -->
         <el-form-item label="适用范围" prop="useScope">
-            <el-radio v-model="huiminCard.useScope" label="1">指定门店</el-radio>
+            <el-radio v-if="objectType !=='3'" v-model="huiminCard.useScope" label="1">指定门店</el-radio>
             <el-radio v-model="huiminCard.useScope" label="2">指定场地</el-radio>
         </el-form-item>
 
         <!-- 指定门店 -->
-        <el-form-item label="指定门店" v-if="huiminCard.useScope === '1'" prop="storeIds">
+        <el-form-item label="指定门店" v-if="huiminCard.useScope === '1' && objectType !=='3'" prop="storeIds">
             <el-button type="text" v-on:click="handleSelectStore()">选择门店</el-button>
             <el-table
                     :data="tableData"
@@ -438,11 +438,9 @@
                 <el-row :gutter="10">
                     <el-col :span="6">
                         <el-form-item label="所在省">
-                            <el-select v-model="siteForm.provinceCode" size="mini" clearable filterable
-                                       placeholder="请选择">
+                            <el-select v-model="siteForm.provinceCode" size="mini" clearable filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in provinces"
-                                        :key="item.code"
                                         :label="item.name"
                                         :value="item.code">
                                 </el-option>
@@ -451,11 +449,9 @@
                     </el-col>
                     <el-col :span="6">
                         <el-form-item label="所在市">
-                            <el-select v-model="siteForm.cityCode" clearable size="mini" filterable
-                                       placeholder="请选择">
+                            <el-select v-model="siteForm.cityCode" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in cities"
-                                        :key="item.citycode"
                                         :label="item.name"
                                         :value="item.citycode">
                                 </el-option>
@@ -463,12 +459,10 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
-                        <el-form-item label="所属运营商">
-                            <el-select v-model="siteForm.operatorId" clearable size="mini" filterable
-                                       placeholder="请选择">
+                        <el-form-item label="所属运营商" label-width="100px">
+                            <el-select v-model="siteForm.operatorId" clearable size="mini" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in operations"
-                                        :key="item.id"
                                         :label="item.name"
                                         :value="item.id">
                                 </el-option>
@@ -483,8 +477,7 @@
                 </el-row>
                 <el-row>
                     <el-col :span="24">
-                        <el-button v-on:click="siteList" style="background-color:#1ab394;color: #ffffff" size="mini"
-                                   icon="el-icon-search">
+                        <el-button v-on:click="siteList" style="background-color:#1ab394;color: #ffffff" size="mini" icon="el-icon-search">
                             搜索
                         </el-button>
                     </el-col>
@@ -524,12 +517,16 @@
                 </el-table-column>
             </el-table>
 
-            <pagination
-                    v-show="tableSiteTotal>0"
-                    :total="tableSiteTotal"
-                    :page.sync="queryParams.pageNum"
-                    :limit.sync="queryParams.pageSize"
-                    v-on:pagination="siteList"></pagination>
+
+            <el-pagination
+                    v-on:size-change="handleSiteSizeChange"
+                    v-on:current-change="handleSiteCurrentChange"
+                    :current-page="currentSitePage"
+                    :page-sizes="[10, 50, 100, 200]"
+                    :page-size="pageSiteSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="siteTotal">
+            </el-pagination>
 
             <span slot="footer" class="dialog-footer">
                 <el-button v-on:click="dialogVisible3 = false">取 消</el-button>
@@ -605,6 +602,13 @@
                     operatorId: null,
                     storeName: '',
                 },
+                objectType: null,
+                currentSitePage: 1,
+                pageSiteSize: 10,
+                currentStorePage: 1,
+                pageStoreSize: 10,
+                siteTotal: 0,
+                storeTotal: 0,
                 unBuyCoverFileList: [],
                 buyCoverFileList: [],
                 bannerFileList: [],
@@ -814,7 +818,8 @@
                 return isLt2M;
             },
             handleRemove(file, fileList) {
-                const fileUrl = file.response;
+
+                const fileUrl = file.url;
                 this.banners.forEach((item, index) => {
                     if (item === fileUrl) {
                         this.banners.splice(index, 1);
@@ -880,7 +885,7 @@
                 let ajax = new $ax(Feng.ctxPath + "/tHuiminCard/storeList",
                     (data) => {
                         vm.tableStoreData = data.records; // 使用 vm 替代 this
-                        vm.tableStoreTotal = data.total;
+                        vm.storeTotal = data.total;
                         vm.tableStoreLoading = false;
                         console.log('成功获取数据:', vm.tableStoreData); // 验证数据
                     },
@@ -889,8 +894,8 @@
                         Feng.error("请求失败: " + data.responseJSON.message);
                     }
                 );
-                this.storeForm.pageNum = vm.queryParams.pageNum;
-                this.storeForm.pageSize = vm.queryParams.pageSize
+                this.storeForm.pageNum = vm.currentStorePage;
+                this.storeForm.pageSize = vm.pageStoreSize
                 ajax.set(this.storeForm);
 
                 ajax.start();
@@ -903,6 +908,9 @@
                         vm.tableSiteData = data.records; // 使用 vm 替代 this
                         vm.tableSiteTotal = data.total;
                         vm.tableSiteLoading = false;
+                        vm.currentStorePage = data.current;
+                        vm.pageStoreSize = data.size;
+                        vm.siteTotal = data.total;
                         console.log('成功获取数据:', vm.tableSiteData); // 验证数据
                     },
                     (data) => {
@@ -910,8 +918,8 @@
                         Feng.error("请求失败: " + data.responseJSON.message);
                     }
                 );
-                this.siteForm.pageNum = vm.queryParams.pageNum;
-                this.siteForm.pageSize = vm.queryParams.pageSize
+                this.siteForm.current = vm.currentSitePage;
+                this.siteForm.size = vm.pageSiteSize
                 ajax.set(this.siteForm);
                 ajax.start();
             },
@@ -919,12 +927,7 @@
                 this.dialogVisible2 = false;
             },
             handleSiteClose() {
-                this.$confirm('确认关闭?1')
-                    .then(_ => {
-                        this.dialogVisible3 = false;
-                    })
-                    .catch(_ => {
-                    });
+                this.dialogVisible3 = false;
             },
             handleSelectionChange(val) {
                 if (this.huiminCard.useScope === '1') {
@@ -1001,10 +1004,27 @@
             },
             cancelForm(){
                 parent.layer.close(window.parent.THuiminCard.layerIndex);
-            }
+            },
+            handleSiteSizeChange(val){
+                this.pageSiteSize = val;
+                this.siteList();
+            },
+            handleSiteCurrentChange(val){
+                this.currentSitePage = val;
+                this.siteList();
+            },
+            handleStoreSizeChange(val){
+                this.pageSiteSize = val;
+                this.storeList();
+            },
+            handleStoreCurrentChange(val){
+                this.currentSitePage = val;
+                this.storeList();
+            },
         },
         created() {
             let editor_1 = UE.getEditor('editor_1');
+            this.objectType = `${objectType}`
 
             const urlParams = new URLSearchParams(window.location.search);
             this.pageType = urlParams.get('pageType');
@@ -1023,13 +1043,16 @@
 
                         this.periodOfValidity = [data.startTime, data.endTime]
 
+                        console.log("data.useScope",data.useScope)
+
                         this.huiminCard = {
                             ...data,
-                            unUseTimes: data.unUseTimes == null? {}: JSON.parse(data.unUseTimes),
                             huiMinType: Number(data.huiMinType),
                             startTime: data.startTimeStr,
                             endTime: data.endTimeStr,
+                            useScope: data.useScope+"",
                         }
+                        this.unUseTimes = data.unUseTimes == null? {}: JSON.parse(data.unUseTimes),
                         // 设置内容(需在编辑器就绪后调用)
                         editor_1.ready(() => {
                             editor_1.setContent(this.huiminCard.introduce);
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js b/cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js
index fcde6a0..597ae5b 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tHuiminCard/tHuiminCard2.js
@@ -3,10 +3,11 @@
     data() {
         return {
             query: {
-                name: '',
-                type: '',
+                huiMinName: '',
+                huiMinType: '',
                 dateRange: [],
-                status: ''
+                status: '',
+                huiMinStatus: '',
             },
             loading: false,
             currentPage: 1,
@@ -41,8 +42,10 @@
 
             // 添加请求参数
             ajax.set({
-                pageNum: this.currentPage,
-                pageSize: this.pageSize,
+                current: this.currentPage,
+                size: this.pageSize,
+                startTime: this.query.dateRange.length > 0 ? this.query.dateRange[0] : null,
+                endTime: this.query.dateRange.length > 0 ? this.query.dateRange[1] : null,
                 ...this.query
             });
             ajax.start();
@@ -111,9 +114,11 @@
         },
         handleSizeChange(val) {
             this.pageSize = val
+            this.handleSearch()
         },
         handleCurrentChange(val) {
             this.currentPage = val
+            this.handleSearch()
         },
         handleSelectionChange(selection) {
             // 多选处理
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tPayHuimin/tPayHuimin.js b/cloud-server-management/src/main/webapp/static/modular/system/tPayHuimin/tPayHuimin.js
index 191b051..c3cce67 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tPayHuimin/tPayHuimin.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tPayHuimin/tPayHuimin.js
@@ -22,20 +22,46 @@
                 }},
             {title: '售卖金额', field: 'salesMoney', visible: true, align: 'center', valign: 'middle'},
             {title: '所属运营商', field: 'operatorName', visible: true, align: 'center', valign: 'middle'},
-            {title: '可用门店', field: 'storeName', visible: true, align: 'center', valign: 'middle'},
+            {title: '可用门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',
+                cellStyle:formatTableUnit,
+                formatter :paramsMatter
+            },
             {title: '购买用户', field: 'userName', visible: true, align: 'center', valign: 'middle'},
             {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle'},
             {title: '购买时间', field: 'paymentTime', visible: true, align: 'center', valign: 'middle'},
             {title: '绑定人员', field: 'studentName', visible: true, align: 'center', valign: 'middle'},
             {title: '已用次数', field: 'useTimes', visible: true, align: 'center', valign: 'middle'},
-            {title: '有效期', field: 'endTime', visible: true, align: 'center', valign: 'middle'},
+            {title: '有效期', field: 'endTime', visible: true, align: 'center', valign: 'middle',formatter:function(value,row,index){
+                if (!value){
+                    return "永久";
+                }else {
+                    return value;
+                }
+                }},
             {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',
                 formatter:function(value,row,index){
                     return {2: '使用中', 3: '已退款'}[value];
                 }}
     ];
 };
-
+//表格超出宽度鼠标悬停显示td内容
+function paramsMatter(value,row,index) {
+    var span=document.createElement("span");
+    span.setAttribute("title",value);
+    span.innerHTML = value;
+    return span.outerHTML;
+}
+//td宽度以及内容超过宽度隐藏
+function formatTableUnit(value, row, index) {
+    return {
+        css: {
+            "white-space": "nowrap",
+            "text-overflow": "ellipsis",
+            "overflow": "hidden",
+            "max-width":"150px"
+        }
+    }
+}
 /**
  * 检查是否选中
  */
@@ -113,7 +139,7 @@
 }
 TPayHuimin.refund = function (){
     if (this.check()) {
-        if (TPayHuimin.seItem.refundStatus != 1){
+        if (TPayHuimin.seItem.status == 3){
             Feng.error("该商品已退款");
             return;
         }
@@ -150,12 +176,12 @@
     queryData['phone'] = $("#phone").val();
     let paymentTimeStr = $("#paymentTimeStr").val();
     if (paymentTimeStr){
-        queryData['paymentTimeStart'] = paymentTimeStr.split('~')[0]+' 00:00:00';
+        queryData['paymentTimeStart'] = paymentTimeStr.split('~')[0]+'00:00:00';
         queryData['paymentTimeEnd'] = paymentTimeStr.split('~')[1]+' 23:59:59';
     }
     let endTimeStr = $("#endTimeStr").val();
     if (endTimeStr){
-        queryData['endTimeStart'] = endTimeStr.split('~')[0]+' 00:00:00';
+        queryData['endTimeStart'] = endTimeStr.split('~')[0]+'00:00:00';
         queryData['endTimeEnd'] = endTimeStr.split('~')[1]+' 23:59:59';
     }
     queryData['status'] = $("#status").val();
@@ -176,22 +202,26 @@
     TPayHuimin.getStaticsData();
 };
 TPayHuimin.resetSearch = function () {
-    var queryData = {};
     $("#huiMinName").val('');
     $("#huiMinType option:first").prop("selected", true);
     $("#operatorId option:first").prop("selected", true);
     $("#useId option:first").prop("selected", true);
+    $("#status option:first").prop("selected", true);
     $("#userName").val('');
     $("#phone").val('');
     $("#paymentTimeStr").val('');
     $("#endTimeStr").val('');
-    $("#status option:first").prop("selected", true);
-    TPayHuimin.search();
+    $('#TPayHuiminTable').bootstrapTable('destroy');
+    TPayHuimin.initTable();
+    TPayHuimin.getStaticsData();
 };
-$(function () {
+TPayHuimin.initTable = function () {
     var defaultColunms = TPayHuimin.initColumn();
     var table = new BSTable(TPayHuimin.id, "/tPayHuimin/list", defaultColunms);
     table.setPaginationType("server");
     TPayHuimin.table = table.init();
     TPayHuimin.getStaticsData();
+};
+$(function () {
+    TPayHuimin.initTable();
 });

--
Gitblit v1.7.1