From 0d243e7f5dc593cdc6e0608bb52cd635f8fc6982 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 19 九月 2025 11:59:44 +0800
Subject: [PATCH] 新需求
---
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java | 86 ++++++++++++++++++++++++++----------------
1 files changed, 53 insertions(+), 33 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java
index 90367a5..30d5dc4 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java
@@ -1,7 +1,7 @@
package com.ycl.platform.controller;
import annotation.Log;
-import com.ycl.platform.domain.entity.CalculateMoneyRule;
+import com.ycl.platform.domain.entity.CalculateRule;
import com.ycl.platform.service.ICalculateRuleService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
@@ -15,82 +15,102 @@
import java.util.List;
/**
- * 鏍哥畻瑙勫垯Controller
+ * 鏍哥畻瑙勫垯(鍒�)Controller
*
* @author ruoyi
- * @date 2024-04-03
+ * @date 2024-04-01
*/
@RestController
@RequestMapping("/calculate/rule")
public class CalculateRuleController extends BaseController
{
@Autowired
- private ICalculateRuleService calculateRuleService;
+ private ICalculateRuleService defaultRuleService;
/**
- * 鏌ヨ鏍哥畻瑙勫垯鍒楄〃
+ * 鏌ヨ杩濈害瑙勫垯鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:list')")
+ @PreAuthorize("@ss.hasPermi('system:rule:list')")
@GetMapping("/list")
- public AjaxResult list(CalculateMoneyRule calculateMoneyRule)
+ public AjaxResult list(CalculateRule calculateRule)
{
- List<CalculateMoneyRule> list = calculateRuleService.selectCalculateRuleList(calculateMoneyRule);
+ List<CalculateRule> list = defaultRuleService.selectDefaultRuleList(calculateRule);
return success(list);
}
/**
- * 瀵煎嚭鏍哥畻瑙勫垯鍒楄〃
+ * 鏍规嵁鍚堝悓id鏌ヨ杩濈害瑙勫垯鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:export')")
- @Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CalculateMoneyRule calculateMoneyRule)
+ @PreAuthorize("@ss.hasPermi('system:rule:query')")
+ @GetMapping("/getRuleListByContractId")
+ public AjaxResult getRuleListByContractId(Integer contractId)
{
- List<CalculateMoneyRule> list = calculateRuleService.selectCalculateRuleList(calculateMoneyRule);
- ExcelUtil<CalculateMoneyRule> util = new ExcelUtil<CalculateMoneyRule>(CalculateMoneyRule.class);
- util.exportExcel(response, list, "鏍哥畻瑙勫垯鏁版嵁");
+ return success(defaultRuleService.getRuleListByContractId(contractId));
}
/**
- * 鑾峰彇鏍哥畻瑙勫垯璇︾粏淇℃伅
+ * 鏍规嵁杩愮淮鍗曚綅鏌ヨ杩濈害瑙勫垯鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:query')")
+ @PreAuthorize("@ss.hasPermi('system:rule:query')")
+ @GetMapping("/getRuleListByUnitId")
+ public AjaxResult getRuleListByUnitId(Integer unitId)
+ {
+ return success(defaultRuleService.getRuleListByUnitId(unitId));
+ }
+
+ /**
+ * 瀵煎嚭杩濈害瑙勫垯鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:export')")
+ @Log(title = "杩濈害瑙勫垯", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, CalculateRule calculateRule)
+ {
+ List<CalculateRule> list = defaultRuleService.selectDefaultRuleList(calculateRule);
+ ExcelUtil<CalculateRule> util = new ExcelUtil<CalculateRule>(CalculateRule.class);
+ util.exportExcel(response, list, "杩濈害瑙勫垯鏁版嵁");
+ }
+
+ /**
+ * 鑾峰彇杩濈害瑙勫垯璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
- return success(calculateRuleService.selectCalculateRuleById(id));
+ return success(defaultRuleService.selectDefaultRuleById(id));
}
/**
- * 鏂板鏍哥畻瑙勫垯
+ * 鏂板杩濈害瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:add')")
- @Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.INSERT)
+ @PreAuthorize("@ss.hasPermi('system:rule:add')")
+ @Log(title = "杩濈害瑙勫垯", businessType = BusinessType.INSERT)
@PostMapping
- public AjaxResult add(@RequestBody CalculateMoneyRule calculateMoneyRule)
+ public AjaxResult add(@RequestBody CalculateRule calculateRule)
{
- return toAjax(calculateRuleService.insertCalculateRule(calculateMoneyRule));
+ return toAjax(defaultRuleService.insertDefaultRule(calculateRule));
}
/**
- * 淇敼鏍哥畻瑙勫垯
+ * 淇敼杩濈害瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:edit')")
- @Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.UPDATE)
+ @PreAuthorize("@ss.hasPermi('system:rule:edit')")
+ @Log(title = "杩濈害瑙勫垯", businessType = BusinessType.UPDATE)
@PutMapping
- public AjaxResult edit(@RequestBody CalculateMoneyRule calculateMoneyRule)
+ public AjaxResult edit(@RequestBody CalculateRule calculateRule)
{
- return toAjax(calculateRuleService.updateCalculateRule(calculateMoneyRule));
+ return toAjax(defaultRuleService.updateDefaultRule(calculateRule));
}
/**
- * 鍒犻櫎鏍哥畻瑙勫垯
+ * 鍒犻櫎杩濈害瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('calculate:rule:remove')")
- @Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.DELETE)
+ @PreAuthorize("@ss.hasPermi('system:rule:remove')")
+ @Log(title = "杩濈害瑙勫垯", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
- return toAjax(calculateRuleService.deleteCalculateRuleByIds(ids));
+ return toAjax(defaultRuleService.deleteDefaultRuleByIds(ids));
}
}
--
Gitblit v1.8.0