From afc82da726f341f6ce7855e5beb4846f9e1c2b65 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 11 六月 2026 15:00:20 +0800
Subject: [PATCH] 新增满意度功能
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java | 46 +++++++++++++++++++++++++++++-----------------
1 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java
index 97d4331..9738797 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java
@@ -2,10 +2,15 @@
import java.util.List;
+import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.AddOrgId;
+import com.ruoyi.common.utils.PageUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+
import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.collections4.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -34,8 +39,7 @@
@Api("浠诲姟鎵ц瑙勫垯")
@RestController
@RequestMapping("/smartor/taskrule")
-public class ServiceTaskRuleController extends BaseController
-{
+public class ServiceTaskRuleController extends BaseController {
@Autowired
private IServiceTaskRuleService serviceTaskRuleService;
@@ -46,11 +50,24 @@
//@PreAuthorize("@ss.hasPermi('smartor:rule:list')")
@AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
@PostMapping("/list")
- public TableDataInfo list(@RequestBody ServiceTaskRule serviceTaskRule)
- {
- startPage();
+ public TableDataInfo list(@RequestBody ServiceTaskRule serviceTaskRule) {
+ PageUtils.startPageByPost(serviceTaskRule.getPageNum(), serviceTaskRule.getPageSize());
List<ServiceTaskRule> list = serviceTaskRuleService.selectServiceTaskRuleList(serviceTaskRule);
- return getDataTable(list);
+
+ if (CollectionUtils.isNotEmpty(list)) {
+ //鑾峰彇total
+ long total = PageUtils.count(new ISelect() {
+ @Override
+ public void doSelect() {
+ serviceTaskRule.setPageNum(null);
+ serviceTaskRule.setPageSize(null);
+ serviceTaskRuleService.selectServiceTaskRuleList(serviceTaskRule);
+ }
+ });
+
+ return getDataTable2(total, list);
+ }
+ return getDataTable2(0, list);
}
/**
@@ -60,8 +77,7 @@
//@PreAuthorize("@ss.hasPermi('smartor:rule:export')")
@Log(title = "浠诲姟鎵ц瑙勫垯", businessType = BusinessType.EXPORT)
@PostMapping("/export")
- public void export(HttpServletResponse response, ServiceTaskRule serviceTaskRule)
- {
+ public void export(HttpServletResponse response, ServiceTaskRule serviceTaskRule) {
List<ServiceTaskRule> list = serviceTaskRuleService.selectServiceTaskRuleList(serviceTaskRule);
ExcelUtil<ServiceTaskRule> util = new ExcelUtil<ServiceTaskRule>(ServiceTaskRule.class);
util.exportExcel(response, list, "浠诲姟鎵ц瑙勫垯鏁版嵁");
@@ -73,8 +89,7 @@
@ApiOperation("鑾峰彇浠诲姟鎵ц瑙勫垯璇︾粏淇℃伅")
//@PreAuthorize("@ss.hasPermi('smartor:rule:query')")
@GetMapping(value = "/getInfo/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(serviceTaskRuleService.selectServiceTaskRuleById(id));
}
@@ -86,8 +101,7 @@
@Log(title = "浠诲姟鎵ц瑙勫垯", businessType = BusinessType.INSERT)
@AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
@PostMapping("/add")
- public AjaxResult add(@RequestBody ServiceTaskRule serviceTaskRule)
- {
+ public AjaxResult add(@RequestBody ServiceTaskRule serviceTaskRule) {
return toAjax(serviceTaskRuleService.insertServiceTaskRule(serviceTaskRule));
}
@@ -99,8 +113,7 @@
@Log(title = "浠诲姟鎵ц瑙勫垯", businessType = BusinessType.UPDATE)
@AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
@PostMapping("/edit")
- public AjaxResult edit(@RequestBody ServiceTaskRule serviceTaskRule)
- {
+ public AjaxResult edit(@RequestBody ServiceTaskRule serviceTaskRule) {
return toAjax(serviceTaskRuleService.updateServiceTaskRule(serviceTaskRule));
}
@@ -110,9 +123,8 @@
@ApiOperation("鍒犻櫎浠诲姟鎵ц瑙勫垯")
//@PreAuthorize("@ss.hasPermi('smartor:rule:remove')")
@Log(title = "浠诲姟鎵ц瑙勫垯", businessType = BusinessType.DELETE)
- @GetMapping("/remove/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
+ @GetMapping("/remove/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(serviceTaskRuleService.deleteServiceTaskRuleByIds(ids));
}
}
--
Gitblit v1.9.3