From 0a8d28436b2f7229ecdf40c6b003902002c8947f Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 16 十月 2025 17:37:08 +0800
Subject: [PATCH] 修改bug
---
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java | 113 ++++++++++++++++++++++++++++----------------------------
1 files changed, 57 insertions(+), 56 deletions(-)
diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java
index 083053a..3409867 100644
--- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java
+++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java
@@ -4,25 +4,23 @@
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.core.base.controller.BaseController;
+import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.common.constant.factory.PageFactory;
-import com.stylefeng.guns.core.shiro.ShiroKit;
-
-import com.stylefeng.guns.core.util.SinataUtil;
-import com.stylefeng.guns.modular.system.model.SysRedPacketRecord;
-import com.stylefeng.guns.modular.system.util.DateUtil;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
-import org.springframework.web.bind.annotation.RequestParam;
+import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.modular.system.model.SysCouponRecord;
import com.stylefeng.guns.modular.system.service.ISysCouponRecordService;
+import com.stylefeng.guns.modular.system.util.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import javax.annotation.Resource;
import java.util.Date;
-import java.util.Map;
/**
* 控制器
@@ -33,21 +31,24 @@
@Controller
@RequestMapping("/sysCouponRecord")
public class SysCouponRecordController extends BaseController {
-
- private String PREFIX = "/system/sysCouponRecord/";
-
- @Autowired
- private ISysCouponRecordService sysCouponRecordService;
-
- /**
- * 跳转到首页
- */
- @RequestMapping("")
- public String index(Model model) {
- model.addAttribute("jumpType",1);
- model.addAttribute("num",0);
- return PREFIX + "sysCouponRecord.html";
- }
+
+ private String PREFIX = "/system/sysCouponRecord/";
+
+ @Autowired
+ private ISysCouponRecordService sysCouponRecordService;
+
+ @Resource
+ private ShiroExtUtil shiroExtUtil;
+
+ /**
+ * 跳转到首页
+ */
+ @RequestMapping("")
+ public String index(Model model) {
+ model.addAttribute("jumpType", 1);
+ model.addAttribute("num", 0);
+ return PREFIX + "sysCouponRecord.html";
+ }
/**
* 跳转到添加
@@ -74,29 +75,29 @@
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String createTime,Integer couponUseType,Integer couponType) {
-
- Date startTimes = null;
- Date endTimes = null;
- if (SinataUtil.isNotEmpty(createTime)){
- String[] timeArray = createTime.split(" - ");
- startTimes = DateUtil.getDate_str3(timeArray[0]+" 00:00:00");
- endTimes = DateUtil.getDate_str3(timeArray[1]+" 23:59:59");
- }
- Page<SysCouponRecord> page = new PageFactory<SysCouponRecord>().defaultPage();
- Wrapper wrapper = new EntityWrapper<SysCouponRecord>();
- if(SinataUtil.isNotEmpty(createTime)){
- wrapper.between("insertTime",startTimes,endTimes);
- }
- if(SinataUtil.isNotEmpty(couponUseType)){
- wrapper.eq("couponUseType",couponUseType);
- }
- if(SinataUtil.isNotEmpty(couponType)){
- wrapper.eq("couponType",couponType);
- }
- wrapper.eq("companyId",ShiroKit.getUser().getObjectId());
- wrapper.eq("companyType",ShiroKit.getUser().getRoleType());
- wrapper.orderBy("id",false);
- return super.packForBT(sysCouponRecordService.selectPage(page,wrapper));
+
+ Date startTimes = null;
+ Date endTimes = null;
+ if (SinataUtil.isNotEmpty(createTime)) {
+ String[] timeArray = createTime.split(" - ");
+ startTimes = DateUtil.getDate_str3(timeArray[0] + " 00:00:00");
+ endTimes = DateUtil.getDate_str3(timeArray[1] + " 23:59:59");
+ }
+ Page<SysCouponRecord> page = new PageFactory<SysCouponRecord>().defaultPage();
+ Wrapper wrapper = new EntityWrapper<SysCouponRecord>();
+ if (SinataUtil.isNotEmpty(createTime)) {
+ wrapper.between("insertTime", startTimes, endTimes);
+ }
+ if (SinataUtil.isNotEmpty(couponUseType)) {
+ wrapper.eq("couponUseType", couponUseType);
+ }
+ if (SinataUtil.isNotEmpty(couponType)) {
+ wrapper.eq("couponType", couponType);
+ }
+ wrapper.eq("companyId", shiroExtUtil.getUser().getObjectId());
+ wrapper.eq("companyType", shiroExtUtil.getUser().getRoleType());
+ wrapper.orderBy("id", false);
+ return super.packForBT(sysCouponRecordService.selectPage(page, wrapper));
}
/**
@@ -105,11 +106,11 @@
@RequestMapping(value = "/add")
@ResponseBody
public Object add(SysCouponRecord sysCouponRecord) {
- sysCouponRecord.setInsertTime(new Date());
- sysCouponRecord.setCompanyId(ShiroKit.getUser().getObjectId());
- sysCouponRecord.setCompanyType(ShiroKit.getUser().getRoleType());
- sysCouponRecordService.insert(sysCouponRecord);
- return SUCCESS_TIP;
+ sysCouponRecord.setInsertTime(new Date());
+ sysCouponRecord.setCompanyId(shiroExtUtil.getUser().getObjectId());
+ sysCouponRecord.setCompanyType(shiroExtUtil.getUser().getRoleType());
+ sysCouponRecordService.insert(sysCouponRecord);
+ return SUCCESS_TIP;
}
/**
--
Gitblit v1.7.1