From 24417dad13f370cca36f6f52208daa0404de4dd6 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 03 四月 2024 14:26:02 +0800
Subject: [PATCH] 新核算
---
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java | 42 ++-
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java | 2
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java | 62 +++++
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java | 2
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java | 94 ++++++++
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java | 22 -
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java | 2
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java | 98 ++++++++
ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml | 83 +++++++
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java | 62 +++++
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java | 126 +++++++++++
document/任务排期表.xlsx | 0
ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml | 17 +
document/自贡项目任务分配.xlsx | 0
14 files changed, 572 insertions(+), 40 deletions(-)
diff --git "a/document/\344\273\273\345\212\241\346\216\222\346\234\237\350\241\250.xlsx" "b/document/\344\273\273\345\212\241\346\216\222\346\234\237\350\241\250.xlsx"
new file mode 100644
index 0000000..77c1957
--- /dev/null
+++ "b/document/\344\273\273\345\212\241\346\216\222\346\234\237\350\241\250.xlsx"
Binary files differ
diff --git "a/document/\350\207\252\350\264\241\351\241\271\347\233\256\344\273\273\345\212\241\345\210\206\351\205\215.xlsx" "b/document/\350\207\252\350\264\241\351\241\271\347\233\256\344\273\273\345\212\241\345\210\206\351\205\215.xlsx"
index 7bc42a2..e69de29 100644
--- "a/document/\350\207\252\350\264\241\351\241\271\347\233\256\344\273\273\345\212\241\345\210\206\351\205\215.xlsx"
+++ "b/document/\350\207\252\350\264\241\351\241\271\347\233\256\344\273\273\345\212\241\345\210\206\351\205\215.xlsx"
Binary files differ
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java
new file mode 100644
index 0000000..0431c81
--- /dev/null
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java
@@ -0,0 +1,126 @@
+package com.ycl.platform.domain.entity;
+
+import annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ycl.system.entity.BaseEntity;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 鏍哥畻璁板綍瀵硅薄 t_calculate_record
+ *
+ * @author ruoyi
+ * @date 2024-04-03
+ */
+public class CalculateRecord extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** $column.columnComment */
+ private Long id;
+
+ /** 鏍哥畻璁板綍鏃ユ湡 */
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ @Excel(name = "鏍哥畻璁板綍鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
+ private Date date;
+
+ /** 鏍哥畻瑙勫垯 */
+ @Excel(name = "鏍哥畻瑙勫垯")
+ private Long ruleId;
+
+ /** 鍗曚綅id */
+ @Excel(name = "鍗曚綅id")
+ private Long unitId;
+
+ /** 鎬绘湇鍔¤垂 */
+ @Excel(name = "鎬绘湇鍔¤垂")
+ private BigDecimal totalMount;
+
+ /** 鎵e噺鏈嶅姟璐� */
+ @Excel(name = "鎵e噺鏈嶅姟璐�")
+ private BigDecimal deductAmount;
+
+ /** 鑰冩牳鍒嗘暟 */
+ @Excel(name = "鑰冩牳鍒嗘暟")
+ private BigDecimal score;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+ public void setDate(Date date)
+ {
+ this.date = date;
+ }
+
+ public Date getDate()
+ {
+ return date;
+ }
+ public void setRuleId(Long ruleId)
+ {
+ this.ruleId = ruleId;
+ }
+
+ public Long getRuleId()
+ {
+ return ruleId;
+ }
+ public void setUnitId(Long unitId)
+ {
+ this.unitId = unitId;
+ }
+
+ public Long getUnitId()
+ {
+ return unitId;
+ }
+ public void setTotalMount(BigDecimal totalMount)
+ {
+ this.totalMount = totalMount;
+ }
+
+ public BigDecimal getTotalMount()
+ {
+ return totalMount;
+ }
+ public void setDeductAmount(BigDecimal deductAmount)
+ {
+ this.deductAmount = deductAmount;
+ }
+
+ public BigDecimal getDeductAmount()
+ {
+ return deductAmount;
+ }
+ public void setScore(BigDecimal score)
+ {
+ this.score = score;
+ }
+
+ public BigDecimal getScore()
+ {
+ return score;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("date", getDate())
+ .append("ruleId", getRuleId())
+ .append("unitId", getUnitId())
+ .append("totalMount", getTotalMount())
+ .append("deductAmount", getDeductAmount())
+ .append("score", getScore())
+ .toString();
+ }
+}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java
index 98a8a31..9a4b697 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java
@@ -1,7 +1,7 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
-import com.ycl.system.entity.BaseEntity;
+import com.ycl.system.domain.TreeEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
@@ -11,25 +11,22 @@
* 鏍哥畻瑙勫垯瀵硅薄 t_calculate_rule
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-03
*/
-public class CalculateRule extends BaseEntity
+public class CalculateRule extends TreeEntity
{
private static final long serialVersionUID = 1L;
- /** $column.columnComment */
+ /** */
private Long id;
- /** $column.columnComment */
- @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+ /** */
+ @Excel(name = "")
private String name;
- /** $column.columnComment */
- @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+ /** */
+ @Excel(name = "")
private Long templateId;
-
- /** $column.columnComment */
- private Long parentId;
/** 鍗曚綅id */
@Excel(name = "鍗曚綅id")
@@ -38,6 +35,10 @@
/** 姣忓皯1%鎵e綋鏈堟�绘湇鍔¤垂鐨勫灏� */
@Excel(name = "姣忓皯1%鎵e綋鏈堟�绘湇鍔¤垂鐨勫灏�")
private BigDecimal value;
+
+ /** $column.columnComment */
+ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+ private String description;
public void setId(Long id)
{
@@ -66,15 +67,6 @@
{
return templateId;
}
- public void setParentId(Long parentId)
- {
- this.parentId = parentId;
- }
-
- public Long getParentId()
- {
- return parentId;
- }
public void setUnitId(Long unitId)
{
this.unitId = unitId;
@@ -93,6 +85,15 @@
{
return value;
}
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
@Override
public String toString() {
@@ -103,6 +104,7 @@
.append("parentId", getParentId())
.append("unitId", getUnitId())
.append("value", getValue())
+ .append("description", getDescription())
.toString();
}
}
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java
new file mode 100644
index 0000000..7c3f9bc
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java
@@ -0,0 +1,98 @@
+package com.ycl.platform.controller;
+
+import annotation.Log;
+import com.ycl.platform.domain.entity.CalculateRecord;
+import com.ycl.platform.service.ICalculateRecordService;
+import com.ycl.system.AjaxResult;
+import com.ycl.system.controller.BaseController;
+import com.ycl.system.page.TableDataInfo;
+import com.ycl.utils.poi.ExcelUtil;
+import enumeration.BusinessType;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 鏍哥畻璁板綍Controller
+ *
+ * @author ruoyi
+ * @date 2024-04-03
+ */
+@RestController
+@RequestMapping("/calculate/record")
+public class CalculateRecordController extends BaseController
+{
+ @Autowired
+ private ICalculateRecordService calculateRecordService;
+
+ /**
+ * 鏌ヨ鏍哥畻璁板綍鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(CalculateRecord calculateRecord)
+ {
+ startPage();
+ List<CalculateRecord> list = calculateRecordService.selectCalculateRecordList(calculateRecord);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭鏍哥畻璁板綍鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:export')")
+ @Log(title = "鏍哥畻璁板綍", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, CalculateRecord calculateRecord)
+ {
+ List<CalculateRecord> list = calculateRecordService.selectCalculateRecordList(calculateRecord);
+ ExcelUtil<CalculateRecord> util = new ExcelUtil<CalculateRecord>(CalculateRecord.class);
+ util.exportExcel(response, list, "鏍哥畻璁板綍鏁版嵁");
+ }
+
+ /**
+ * 鑾峰彇鏍哥畻璁板綍璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return success(calculateRecordService.selectCalculateRecordById(id));
+ }
+
+ /**
+ * 鏂板鏍哥畻璁板綍
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:add')")
+ @Log(title = "鏍哥畻璁板綍", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody CalculateRecord calculateRecord)
+ {
+ return toAjax(calculateRecordService.insertCalculateRecord(calculateRecord));
+ }
+
+ /**
+ * 淇敼鏍哥畻璁板綍
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:edit')")
+ @Log(title = "鏍哥畻璁板綍", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody CalculateRecord calculateRecord)
+ {
+ return toAjax(calculateRecordService.updateCalculateRecord(calculateRecord));
+ }
+
+ /**
+ * 鍒犻櫎鏍哥畻璁板綍
+ */
+ @PreAuthorize("@ss.hasPermi('system:record:remove')")
+ @Log(title = "鏍哥畻璁板綍", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(calculateRecordService.deleteCalculateRecordByIds(ids));
+ }
+}
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 d72bc17..e4636ef 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
@@ -5,7 +5,6 @@
import com.ycl.platform.service.ICalculateRuleService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
-import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
@@ -19,10 +18,10 @@
* 鏍哥畻瑙勫垯Controller
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-03
*/
@RestController
-@RequestMapping("/check/calculateRule")
+@RequestMapping("/calculate/rule")
public class CalculateRuleController extends BaseController
{
@Autowired
@@ -31,19 +30,18 @@
/**
* 鏌ヨ鏍哥畻瑙勫垯鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('system:rule:list')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:list')")
@GetMapping("/list")
- public TableDataInfo list(CalculateRule calculateRule)
+ public AjaxResult list(CalculateRule calculateRule)
{
- startPage();
List<CalculateRule> list = calculateRuleService.selectCalculateRuleList(calculateRule);
- return getDataTable(list);
+ return success(list);
}
/**
* 瀵煎嚭鏍哥畻瑙勫垯鍒楄〃
*/
- @PreAuthorize("@ss.hasPermi('system:rule:export')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:export')")
@Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CalculateRule calculateRule)
@@ -56,7 +54,7 @@
/**
* 鑾峰彇鏍哥畻瑙勫垯璇︾粏淇℃伅
*/
- @PreAuthorize("@ss.hasPermi('system:rule:query')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@@ -66,7 +64,7 @@
/**
* 鏂板鏍哥畻瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('system:rule:add')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:add')")
@Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CalculateRule calculateRule)
@@ -77,7 +75,7 @@
/**
* 淇敼鏍哥畻瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('system:rule:edit')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:edit')")
@Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CalculateRule calculateRule)
@@ -88,7 +86,7 @@
/**
* 鍒犻櫎鏍哥畻瑙勫垯
*/
- @PreAuthorize("@ss.hasPermi('system:rule:remove')")
+ @PreAuthorize("@ss.hasPermi('calculate:rule:remove')")
@Log(title = "鏍哥畻瑙勫垯", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java
new file mode 100644
index 0000000..12376c3
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java
@@ -0,0 +1,62 @@
+package com.ycl.platform.mapper;
+
+import com.ycl.platform.domain.entity.CalculateRecord;
+
+import java.util.List;
+
+/**
+ * 鏍哥畻璁板綍Mapper鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2024-04-03
+ */
+public interface CalculateRecordMapper
+{
+ /**
+ * 鏌ヨ鏍哥畻璁板綍
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 鏍哥畻璁板綍
+ */
+ public CalculateRecord selectCalculateRecordById(Long id);
+
+ /**
+ * 鏌ヨ鏍哥畻璁板綍鍒楄〃
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 鏍哥畻璁板綍闆嗗悎
+ */
+ public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord);
+
+ /**
+ * 鏂板鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ public int insertCalculateRecord(CalculateRecord calculateRecord);
+
+ /**
+ * 淇敼鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ public int updateCalculateRecord(CalculateRecord calculateRecord);
+
+ /**
+ * 鍒犻櫎鏍哥畻璁板綍
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 缁撴灉
+ */
+ public int deleteCalculateRecordById(Long id);
+
+ /**
+ * 鎵归噺鍒犻櫎鏍哥畻璁板綍
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteCalculateRecordByIds(Long[] ids);
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java
index b09a678..7f31b72 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java
@@ -8,7 +8,7 @@
* 鏍哥畻瑙勫垯Mapper鎺ュ彛
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-03
*/
public interface CalculateRuleMapper
{
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java
new file mode 100644
index 0000000..f299715
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java
@@ -0,0 +1,62 @@
+package com.ycl.platform.service;
+
+import com.ycl.platform.domain.entity.CalculateRecord;
+
+import java.util.List;
+
+/**
+ * 鏍哥畻璁板綍Service鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2024-04-03
+ */
+public interface ICalculateRecordService
+{
+ /**
+ * 鏌ヨ鏍哥畻璁板綍
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 鏍哥畻璁板綍
+ */
+ public CalculateRecord selectCalculateRecordById(Long id);
+
+ /**
+ * 鏌ヨ鏍哥畻璁板綍鍒楄〃
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 鏍哥畻璁板綍闆嗗悎
+ */
+ public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord);
+
+ /**
+ * 鏂板鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ public int insertCalculateRecord(CalculateRecord calculateRecord);
+
+ /**
+ * 淇敼鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ public int updateCalculateRecord(CalculateRecord calculateRecord);
+
+ /**
+ * 鎵归噺鍒犻櫎鏍哥畻璁板綍
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏍哥畻璁板綍涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteCalculateRecordByIds(Long[] ids);
+
+ /**
+ * 鍒犻櫎鏍哥畻璁板綍淇℃伅
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 缁撴灉
+ */
+ public int deleteCalculateRecordById(Long id);
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java
index a6c3c03..5f66ec3 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java
@@ -8,7 +8,7 @@
* 鏍哥畻瑙勫垯Service鎺ュ彛
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-03
*/
public interface ICalculateRuleService
{
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java
new file mode 100644
index 0000000..868e647
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java
@@ -0,0 +1,94 @@
+package com.ycl.platform.service.impl;
+
+import com.ycl.platform.domain.entity.CalculateRecord;
+import com.ycl.platform.mapper.CalculateRecordMapper;
+import com.ycl.platform.service.ICalculateRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 鏍哥畻璁板綍Service涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ * @date 2024-04-03
+ */
+@Service
+public class CalculateRecordServiceImpl implements ICalculateRecordService
+{
+ @Autowired
+ private CalculateRecordMapper calculateRecordMapper;
+
+ /**
+ * 鏌ヨ鏍哥畻璁板綍
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 鏍哥畻璁板綍
+ */
+ @Override
+ public CalculateRecord selectCalculateRecordById(Long id)
+ {
+ return calculateRecordMapper.selectCalculateRecordById(id);
+ }
+
+ /**
+ * 鏌ヨ鏍哥畻璁板綍鍒楄〃
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 鏍哥畻璁板綍
+ */
+ @Override
+ public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord)
+ {
+ return calculateRecordMapper.selectCalculateRecordList(calculateRecord);
+ }
+
+ /**
+ * 鏂板鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertCalculateRecord(CalculateRecord calculateRecord)
+ {
+ return calculateRecordMapper.insertCalculateRecord(calculateRecord);
+ }
+
+ /**
+ * 淇敼鏍哥畻璁板綍
+ *
+ * @param calculateRecord 鏍哥畻璁板綍
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateCalculateRecord(CalculateRecord calculateRecord)
+ {
+ return calculateRecordMapper.updateCalculateRecord(calculateRecord);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎鏍哥畻璁板綍
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏍哥畻璁板綍涓婚敭
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteCalculateRecordByIds(Long[] ids)
+ {
+ return calculateRecordMapper.deleteCalculateRecordByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎鏍哥畻璁板綍淇℃伅
+ *
+ * @param id 鏍哥畻璁板綍涓婚敭
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteCalculateRecordById(Long id)
+ {
+ return calculateRecordMapper.deleteCalculateRecordById(id);
+ }
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java
index bd960bb..58e14ef 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java
@@ -12,7 +12,7 @@
* 鏍哥畻瑙勫垯Service涓氬姟灞傚鐞�
*
* @author ruoyi
- * @date 2024-04-01
+ * @date 2024-04-03
*/
@Service
public class CalculateRuleServiceImpl implements ICalculateRuleService
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
new file mode 100644
index 0000000..57b1fa4
--- /dev/null
+++ b/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ycl.platform.mapper.CalculateRecordMapper">
+
+ <resultMap type="com.ycl.platform.domain.entity.CalculateRecord" id="CalculateRecordResult">
+ <result property="id" column="id" />
+ <result property="date" column="date" />
+ <result property="ruleId" column="rule_id" />
+ <result property="unitId" column="unit_id" />
+ <result property="totalMount" column="totalMount" />
+ <result property="deductAmount" column="deduct_amount" />
+ <result property="score" column="score" />
+ </resultMap>
+
+ <sql id="selectCalculateRecordVo">
+ select id, date, rule_id, unit_id, totalMount, deduct_amount, score from t_calculate_record
+ </sql>
+
+ <select id="selectCalculateRecordList" resultMap="CalculateRecordResult">
+ <include refid="selectCalculateRecordVo"/>
+ <where>
+ <if test="date != null "> and date = #{date}</if>
+ <if test="ruleId != null "> and rule_id = #{ruleId}</if>
+ <if test="unitId != null "> and unit_id = #{unitId}</if>
+ <if test="totalMount != null "> and totalMount = #{totalMount}</if>
+ <if test="deductAmount != null "> and deduct_amount = #{deductAmount}</if>
+ <if test="score != null "> and score = #{score}</if>
+ </where>
+ </select>
+
+ <select id="selectCalculateRecordById" resultMap="CalculateRecordResult">
+ <include refid="selectCalculateRecordVo"/>
+ where id = #{id}
+ </select>
+
+ <insert id="insertCalculateRecord" parameterType="CalculateRecord">
+ insert into t_calculate_record
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">id,</if>
+ <if test="date != null">date,</if>
+ <if test="ruleId != null">rule_id,</if>
+ <if test="unitId != null">unit_id,</if>
+ <if test="totalMount != null">totalMount,</if>
+ <if test="deductAmount != null">deduct_amount,</if>
+ <if test="score != null">score,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">#{id},</if>
+ <if test="date != null">#{date},</if>
+ <if test="ruleId != null">#{ruleId},</if>
+ <if test="unitId != null">#{unitId},</if>
+ <if test="totalMount != null">#{totalMount},</if>
+ <if test="deductAmount != null">#{deductAmount},</if>
+ <if test="score != null">#{score},</if>
+ </trim>
+ </insert>
+
+ <update id="updateCalculateRecord">
+ update t_calculate_record
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="date != null">date = #{date},</if>
+ <if test="ruleId != null">rule_id = #{ruleId},</if>
+ <if test="unitId != null">unit_id = #{unitId},</if>
+ <if test="totalMount != null">totalMount = #{totalMount},</if>
+ <if test="deductAmount != null">deduct_amount = #{deductAmount},</if>
+ <if test="score != null">score = #{score},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteCalculateRecordById" >
+ delete from t_calculate_record where id = #{id}
+ </delete>
+
+ <delete id="deleteCalculateRecordByIds" >
+ delete from t_calculate_record where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+</mapper>
\ No newline at end of file
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
index a742e0d..ae065f9 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
@@ -11,10 +11,11 @@
<result property="parentId" column="parent_id" />
<result property="unitId" column="unit_id" />
<result property="value" column="value" />
+ <result property="description" column="description" />
</resultMap>
<sql id="selectCalculateRuleVo">
- select id, name, template_id, parent_id, unit_id, value from t_calculate_rule
+ select id, name, template_id, parent_id, unit_id, value, description from t_calculate_rule
</sql>
<select id="selectCalculateRuleList" resultMap="CalculateRuleResult">
@@ -22,16 +23,19 @@
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
+ <if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="unitId != null "> and unit_id = #{unitId}</if>
+ <if test="value != null "> and value = #{value}</if>
+ <if test="description != null and description != ''"> and description = #{description}</if>
</where>
</select>
- <select id="selectCalculateRuleById" resultMap="CalculateRuleResult">
+ <select id="selectCalculateRuleById" resultMap="CalculateRuleResult">
<include refid="selectCalculateRuleVo"/>
where id = #{id}
</select>
- <insert id="insertCalculateRule" useGeneratedKeys="true" keyProperty="id">
+ <insert id="insertCalculateRule" useGeneratedKeys="true" keyProperty="id">
insert into t_calculate_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
@@ -39,6 +43,7 @@
<if test="parentId != null">parent_id,</if>
<if test="unitId != null">unit_id,</if>
<if test="value != null">value,</if>
+ <if test="description != null">description,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
@@ -46,6 +51,7 @@
<if test="parentId != null">#{parentId},</if>
<if test="unitId != null">#{unitId},</if>
<if test="value != null">#{value},</if>
+ <if test="description != null">#{description},</if>
</trim>
</insert>
@@ -57,15 +63,16 @@
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="unitId != null">unit_id = #{unitId},</if>
<if test="value != null">value = #{value},</if>
+ <if test="description != null">description = #{description},</if>
</trim>
where id = #{id}
</update>
- <delete id="deleteCalculateRuleById">
+ <delete id="deleteCalculateRuleById" parameterType="Long">
delete from t_calculate_rule where id = #{id}
</delete>
- <delete id="deleteCalculateRuleByIds" >
+ <delete id="deleteCalculateRuleByIds" parameterType="String">
delete from t_calculate_rule where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
--
Gitblit v1.8.0