From b70606bda176c711c1f2893764711611d12096b7 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 14 八月 2025 23:58:43 +0800 Subject: [PATCH] 修改bug --- ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java | 38 +++++++++++++++++++++----------------- 1 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java index 9ae4982..47d2b64 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java @@ -4,20 +4,20 @@ 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.log.LogObjectHolder; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TComplaint; +import com.stylefeng.guns.modular.system.model.TInvoice; +import com.stylefeng.guns.modular.system.service.ITCompanyService; +import com.stylefeng.guns.modular.system.service.ITInvoiceService; +import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TInvoice; -import com.stylefeng.guns.modular.system.service.ITInvoiceService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +29,18 @@ @Controller @RequestMapping("/tInvoice") public class TInvoiceController extends BaseController { - + private String PREFIX = "/system/tInvoice/"; - + @Autowired private ITInvoiceService tInvoiceService; + + @Autowired + private ShiroExtUtil shiroExtUtil; + @Autowired + private ITCompanyService tCompanyService; + /** * 跳转到开发票列表首页 */ @@ -42,7 +48,7 @@ public String index() { return PREFIX + "tInvoice.html"; } - + /** * 跳转到查看详情 */ @@ -86,19 +92,17 @@ String name, Integer type, Integer state) { + //获取当前用户的公司id + Integer companyId = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getId(); String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { - page.setRecords(null); - } else { - page.setRecords(tInvoiceService.getInvoiceList(page, beginTime, endTime, email, name, type, state)); - } + page.setRecords(tInvoiceService.getInvoiceList(page, beginTime, endTime, email, name, type, state,companyId)); return super.packForBT(page); } -- Gitblit v1.7.1