浏览代码

新增核算单价表

lamphua 3 周前
父节点
当前提交
8f3f8a77b1

+ 28
- 28
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarController.java 查看文件

@@ -146,20 +146,20 @@ public class CmcCarController extends BaseController
146 146
     public AjaxResult add(@RequestBody CmcCar cmcCar)
147 147
     {
148 148
         cmcCar.setStatus("1");
149
-        if (cmcCar.getAcquisitionTime() != null && cmcCar.getCost() != null && cmcCar.getDayCost() == null) {
150
-            // 年数总和法折旧
151
-            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcCar.getAcquisitionTime()));
152
-            int life = cmcCar.getExpectLife() == null ? 0 : cmcCar.getExpectLife();
153
-            int total = 0;
154
-            for (int i = 0; i < life + 1; i++)
155
-                total += i;
156
-            if (total > 0) {
157
-                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
158
-                int num = life - (currentYear - acquisitionYear) + 1;
159
-                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcCar.getCost());
160
-                cmcCar.setDayCost(estimateCost);
161
-            }
162
-        }
149
+//        if (cmcCar.getAcquisitionTime() != null && cmcCar.getCost() != null && cmcCar.getDayCost() == null) {
150
+//            // 年数总和法折旧
151
+//            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcCar.getAcquisitionTime()));
152
+//            int life = cmcCar.getExpectLife() == null ? 0 : cmcCar.getExpectLife();
153
+//            int total = 0;
154
+//            for (int i = 0; i < life + 1; i++)
155
+//                total += i;
156
+//            if (total > 0) {
157
+//                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
158
+//                int num = life - (currentYear - acquisitionYear) + 1;
159
+//                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcCar.getCost());
160
+//                cmcCar.setDayCost(estimateCost);
161
+//            }
162
+//        }
163 163
         return toAjax(cmcCarService.insertCmcCar(cmcCar));
164 164
     }
165 165
 
@@ -170,20 +170,20 @@ public class CmcCarController extends BaseController
170 170
     @PutMapping
171 171
     public AjaxResult edit(@RequestBody CmcCar cmcCar)
172 172
     {
173
-        if (cmcCar.getAcquisitionTime() != null && cmcCar.getCost() != null && cmcCar.getDayCost() == null) {
174
-            // 年数总和法折旧
175
-            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcCar.getAcquisitionTime()));
176
-            int life = cmcCar.getExpectLife() == null ? 0 : cmcCar.getExpectLife();
177
-            int total = 0;
178
-            for (int i = 0; i < life + 1; i++)
179
-                total += i;
180
-            if (total > 0) {
181
-                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
182
-                int num = life - (currentYear - acquisitionYear) + 1;
183
-                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcCar.getCost());
184
-                cmcCar.setDayCost(estimateCost);
185
-            }
186
-        }
173
+//        if (cmcCar.getAcquisitionTime() != null && cmcCar.getCost() != null && cmcCar.getDayCost() == null) {
174
+//            // 年数总和法折旧
175
+//            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcCar.getAcquisitionTime()));
176
+//            int life = cmcCar.getExpectLife() == null ? 0 : cmcCar.getExpectLife();
177
+//            int total = 0;
178
+//            for (int i = 0; i < life + 1; i++)
179
+//                total += i;
180
+//            if (total > 0) {
181
+//                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
182
+//                int num = life - (currentYear - acquisitionYear) + 1;
183
+//                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcCar.getCost());
184
+//                cmcCar.setDayCost(estimateCost);
185
+//            }
186
+//        }
187 187
         return toAjax(cmcCarService.updateCmcCar(cmcCar));
188 188
     }
189 189
 

+ 170
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCheckPriceController.java 查看文件

@@ -0,0 +1,170 @@
1
+package com.ruoyi.web.controller.oa;
2
+
3
+import java.util.ArrayList;
4
+import java.util.List;
5
+import javax.servlet.http.HttpServletResponse;
6
+
7
+import com.alibaba.fastjson2.JSONObject;
8
+import com.ruoyi.oa.domain.CmcCheckPrice;
9
+import org.apache.ibatis.annotations.Param;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.GetMapping;
12
+import org.springframework.web.bind.annotation.PostMapping;
13
+import org.springframework.web.bind.annotation.PutMapping;
14
+import org.springframework.web.bind.annotation.DeleteMapping;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestBody;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RestController;
19
+import com.ruoyi.common.annotation.Log;
20
+import com.ruoyi.common.core.controller.BaseController;
21
+import com.ruoyi.common.core.domain.AjaxResult;
22
+import com.ruoyi.common.enums.BusinessType;
23
+import com.ruoyi.oa.service.ICmcCheckPriceService;
24
+import com.ruoyi.common.utils.poi.ExcelUtil;
25
+import com.ruoyi.common.core.page.TableDataInfo;
26
+
27
+/**
28
+ * cmc核算单价Controller
29
+ * 
30
+ * @author cmc
31
+ * @date 2025-05-14
32
+ */
33
+@RestController
34
+@RequestMapping("/oa/checkPrice")
35
+public class CmcCheckPriceController extends BaseController
36
+{
37
+    @Autowired
38
+    private ICmcCheckPriceService cmcCheckPriceService;
39
+
40
+    /**
41
+     * 查询cmc核算单价列表
42
+     */
43
+    @GetMapping("/list")
44
+    public TableDataInfo list(CmcCheckPrice cmcCheckPrice)
45
+    {
46
+        startPage();
47
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceList(cmcCheckPrice);
48
+        return getDataTable(list);
49
+    }
50
+
51
+    /**
52
+     * 导出cmc核算单价列表
53
+     */
54
+    @Log(title = "cmc核算单价", businessType = BusinessType.EXPORT)
55
+    @PostMapping("/export")
56
+    public void export(HttpServletResponse response, CmcCheckPrice cmcCheckPrice)
57
+    {
58
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceList(cmcCheckPrice);
59
+        ExcelUtil<CmcCheckPrice> util = new ExcelUtil<CmcCheckPrice>(CmcCheckPrice.class);
60
+        util.exportExcel(response, list, "cmc核算单价数据");
61
+    }
62
+
63
+    /**
64
+     * 获取cmc核算单价详细信息
65
+     */
66
+    @GetMapping(value = "/{id}")
67
+    public AjaxResult getInfo(@PathVariable("id") Long id)
68
+    {
69
+        return success(cmcCheckPriceService.selectCmcCheckPriceById(id));
70
+    }
71
+
72
+    /**
73
+     * 查询工作类别列表
74
+     */
75
+    @GetMapping("/workTypeList")
76
+    public List<String> getWorkTypeList()
77
+    {
78
+        List<String> workTypeList = new ArrayList<>();
79
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceList(new CmcCheckPrice());
80
+        for (CmcCheckPrice cmcCheckPrice : list)
81
+            workTypeList.add(cmcCheckPrice.getWorkType());
82
+        return workTypeList;
83
+    }
84
+
85
+    /**
86
+     * 根据工作类别查询工作内容
87
+     */
88
+    @GetMapping("/workItem")
89
+    public List<String> getWorkItemInfo(String workType)
90
+    {
91
+        List<String> workItemList = new ArrayList<>();
92
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceByWorkType(workType);
93
+        for (CmcCheckPrice cmcCheckPrice : list)
94
+            workItemList.add(cmcCheckPrice.getWorkItem());
95
+        return workItemList;
96
+    }
97
+
98
+    /**
99
+     * 根据工作内容查询内容细项
100
+     */
101
+    @GetMapping("/subItem")
102
+    public List<String> getSubItemInfo(String workItem)
103
+    {
104
+        List<String> subItemList = new ArrayList<>();
105
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceByWorkItem(workItem);
106
+        for (CmcCheckPrice cmcCheckPrice : list)
107
+            subItemList.add(cmcCheckPrice.getSubItem());
108
+        return subItemList;
109
+    }
110
+
111
+    /**
112
+     * 根据工作内容查询比例等级
113
+     */
114
+    @GetMapping( "/scaleGrade")
115
+    public List<String> getScaleGradeInfo(String workItem)
116
+    {
117
+        List<String> scaleGradeList = new ArrayList<>();
118
+        List<CmcCheckPrice> list = cmcCheckPriceService.selectCmcCheckPriceByWorkItem(workItem);
119
+        for (CmcCheckPrice cmcCheckPrice : list)
120
+            scaleGradeList.add(cmcCheckPrice.getScaleGrade());
121
+        return scaleGradeList;
122
+    }
123
+
124
+    /**
125
+     * 根据比例等级查询出单位、一般地类、复杂地类
126
+     */
127
+    @GetMapping( "/price")
128
+    public AjaxResult getPriceInfo(@Param("workItem")String workItem, @Param("subItem")String subItem, @Param("scaleGrade")String scaleGrade, @Param("groundType")String groundType)
129
+    {
130
+        List<CmcCheckPrice> cmcCheckPriceList = cmcCheckPriceService.selectCmcCheckPriceByScaleGrade(workItem, subItem, scaleGrade);
131
+        JSONObject price = new JSONObject();
132
+        price.put("id", cmcCheckPriceList.get(0).getId());
133
+        price.put("unit", cmcCheckPriceList.get(0).getUnit());
134
+        if (groundType.equals("0"))
135
+            price.put("price", cmcCheckPriceList.get(0).getCommonPrice());
136
+        else
137
+            price.put("price", cmcCheckPriceList.get(0).getComplexPrice());
138
+        return success(price);
139
+    }
140
+
141
+    /**
142
+     * 新增cmc核算单价
143
+     */
144
+    @Log(title = "cmc核算单价", businessType = BusinessType.INSERT)
145
+    @PostMapping
146
+    public AjaxResult add(@RequestBody CmcCheckPrice cmcCheckPrice)
147
+    {
148
+        return toAjax(cmcCheckPriceService.insertCmcCheckPrice(cmcCheckPrice));
149
+    }
150
+
151
+    /**
152
+     * 修改cmc核算单价
153
+     */
154
+    @Log(title = "cmc核算单价", businessType = BusinessType.UPDATE)
155
+    @PutMapping
156
+    public AjaxResult edit(@RequestBody CmcCheckPrice cmcCheckPrice)
157
+    {
158
+        return toAjax(cmcCheckPriceService.updateCmcCheckPrice(cmcCheckPrice));
159
+    }
160
+
161
+    /**
162
+     * 删除cmc核算单价
163
+     */
164
+    @Log(title = "cmc核算单价", businessType = BusinessType.DELETE)
165
+	@DeleteMapping("/{ids}")
166
+    public AjaxResult remove(@PathVariable Long[] ids)
167
+    {
168
+        return success(cmcCheckPriceService.deleteCmcCheckPriceByIds(ids));
169
+    }
170
+}

+ 28
- 28
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceController.java 查看文件

@@ -144,20 +144,20 @@ public class CmcDeviceController extends BaseController
144 144
     @PostMapping
145 145
     public AjaxResult add(@RequestBody CmcDevice cmcDevice)
146 146
     {
147
-        if (cmcDevice.getAcquisitionTime() != null && cmcDevice.getCost() != null && cmcDevice.getDayCost() == null) {
148
-            // 年数总和法折旧
149
-            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcDevice.getAcquisitionTime()));
150
-            int life = cmcDevice.getExpectLife() == null ? 0 : cmcDevice.getExpectLife();
151
-            int total = 0;
152
-            for (int i = 0; i < life + 1; i++)
153
-                total += i;
154
-            if (total > 0) {
155
-                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
156
-                int num = life - (currentYear - acquisitionYear) + 1;
157
-                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcDevice.getCost());
158
-                cmcDevice.setDayCost(estimateCost);
159
-            }
160
-        }
147
+//        if (cmcDevice.getAcquisitionTime() != null && cmcDevice.getCost() != null && cmcDevice.getDayCost() == null) {
148
+//            // 年数总和法折旧
149
+//            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcDevice.getAcquisitionTime()));
150
+//            int life = cmcDevice.getExpectLife() == null ? 0 : cmcDevice.getExpectLife();
151
+//            int total = 0;
152
+//            for (int i = 0; i < life + 1; i++)
153
+//                total += i;
154
+//            if (total > 0) {
155
+//                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
156
+//                int num = life - (currentYear - acquisitionYear) + 1;
157
+//                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcDevice.getCost());
158
+//                cmcDevice.setDayCost(estimateCost);
159
+//            }
160
+//        }
161 161
         return toAjax(cmcDeviceService.insertCmcDevice(cmcDevice));
162 162
     }
163 163
 
@@ -168,20 +168,20 @@ public class CmcDeviceController extends BaseController
168 168
     @PutMapping
169 169
     public AjaxResult edit(@RequestBody CmcDevice cmcDevice)
170 170
     {
171
-        if (cmcDevice.getAcquisitionTime() != null && cmcDevice.getCost() != null && cmcDevice.getDayCost() == null) {
172
-            // 年数总和法折旧
173
-            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcDevice.getAcquisitionTime()));
174
-            int life = cmcDevice.getExpectLife() == null ? 0 : cmcDevice.getExpectLife();
175
-            int total = 0;
176
-            for (int i = 0; i < life + 1; i++)
177
-                total += i;
178
-            if (total > 0) {
179
-                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
180
-                int num = life - (currentYear - acquisitionYear) + 1;
181
-                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcDevice.getCost());
182
-                cmcDevice.setDayCost(estimateCost);
183
-            }
184
-        }
171
+//        if (cmcDevice.getAcquisitionTime() != null && cmcDevice.getCost() != null && cmcDevice.getDayCost() == null) {
172
+//            // 年数总和法折旧
173
+//            int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcDevice.getAcquisitionTime()));
174
+//            int life = cmcDevice.getExpectLife() == null ? 0 : cmcDevice.getExpectLife();
175
+//            int total = 0;
176
+//            for (int i = 0; i < life + 1; i++)
177
+//                total += i;
178
+//            if (total > 0) {
179
+//                int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
180
+//                int num = life - (currentYear - acquisitionYear) + 1;
181
+//                BigDecimal estimateCost = new BigDecimal(num  * 0.95 / total / 365).multiply(cmcDevice.getCost());
182
+//                cmcDevice.setDayCost(estimateCost);
183
+//            }
184
+//        }
185 185
         return toAjax(cmcDeviceService.updateCmcDevice(cmcDevice));
186 186
     }
187 187
 

+ 6
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java 查看文件

@@ -144,6 +144,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
144 144
     @Resource
145 145
     private ICmcBudgetService cmcBudgetService;
146 146
     @Resource
147
+    private ICmcCheckService cmcCheckService;
148
+    @Resource
147 149
     private FlowVarInstMapper flowVarInstMapper;
148 150
     @Resource
149 151
     private FlowDeployMapper flowDeployMapper;
@@ -1738,6 +1740,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
1738 1740
             CmcSettle cmcSettle = cmcSettleService.selectCmcSettleBySettleId(formId);
1739 1741
             projectId = cmcSettle != null ? cmcSettle.getProjectId() : "";
1740 1742
         }
1743
+        if (flowTaskDto.getProcDefName().equals("项目核算")) {
1744
+            CmcCheck cmcCheck = cmcCheckService.selectCmcCheckByCheckId(formId);
1745
+            projectId = cmcCheck != null ? cmcCheck.getProjectId() : "";
1746
+        }
1741 1747
         if (flowTaskDto.getProcDefName().equals("项目变更")) {
1742 1748
             CmcProjectChange cmcProjectChange = cmcProjectChangeService.selectCmcProjectChangeByChangeId(formId);
1743 1749
             projectId = cmcProjectChange != null ? cmcProjectChange.getProjectId() : "";

+ 151
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCheckPrice.java 查看文件

@@ -0,0 +1,151 @@
1
+package com.ruoyi.oa.domain;
2
+
3
+import java.math.BigDecimal;
4
+import org.apache.commons.lang3.builder.ToStringBuilder;
5
+import org.apache.commons.lang3.builder.ToStringStyle;
6
+import com.ruoyi.common.annotation.Excel;
7
+import com.ruoyi.common.core.domain.BaseEntity;
8
+
9
+/**
10
+ * cmc核算单价对象 cmc_check_price
11
+ * 
12
+ * @author cmc
13
+ * @date 2025-05-14
14
+ */
15
+public class CmcCheckPrice extends BaseEntity
16
+{
17
+    private static final long serialVersionUID = 1L;
18
+
19
+    /** 核算单价id */
20
+    private Long id;
21
+
22
+    /** 工作类别 */
23
+    @Excel(name = "工作类别")
24
+    private String workType;
25
+
26
+    /** 工作内容 */
27
+    @Excel(name = "工作内容")
28
+    private String workItem;
29
+
30
+    /** 内容细项 */
31
+    @Excel(name = "内容细项")
32
+    private String subItem;
33
+
34
+    /** 单价比例 */
35
+    @Excel(name = "单价比例")
36
+    private Double pricePercentage;
37
+
38
+    /** 等级或比例尺 */
39
+    @Excel(name = "等级或比例尺")
40
+    private String scaleGrade;
41
+
42
+    /** 单位 */
43
+    @Excel(name = "单位")
44
+    private String unit;
45
+
46
+    /** 一般地类单价 */
47
+    @Excel(name = "一般地类单价")
48
+    private BigDecimal commonPrice;
49
+
50
+    /** 复杂地类单价 */
51
+    @Excel(name = "复杂地类单价")
52
+    private BigDecimal complexPrice;
53
+
54
+    public void setId(Long id) 
55
+    {
56
+        this.id = id;
57
+    }
58
+
59
+    public Long getId() 
60
+    {
61
+        return id;
62
+    }
63
+    public void setWorkType(String workType) 
64
+    {
65
+        this.workType = workType;
66
+    }
67
+
68
+    public String getWorkType() 
69
+    {
70
+        return workType;
71
+    }
72
+    public void setWorkItem(String workItem) 
73
+    {
74
+        this.workItem = workItem;
75
+    }
76
+
77
+    public String getWorkItem() 
78
+    {
79
+        return workItem;
80
+    }
81
+    public void setSubItem(String subItem) 
82
+    {
83
+        this.subItem = subItem;
84
+    }
85
+
86
+    public String getSubItem() 
87
+    {
88
+        return subItem;
89
+    }
90
+    public void setPricePercentage(Double pricePercentage) 
91
+    {
92
+        this.pricePercentage = pricePercentage;
93
+    }
94
+
95
+    public Double getPricePercentage() 
96
+    {
97
+        return pricePercentage;
98
+    }
99
+    public void setScaleGrade(String scaleGrade) 
100
+    {
101
+        this.scaleGrade = scaleGrade;
102
+    }
103
+
104
+    public String getScaleGrade() 
105
+    {
106
+        return scaleGrade;
107
+    }
108
+    public void setUnit(String unit) 
109
+    {
110
+        this.unit = unit;
111
+    }
112
+
113
+    public String getUnit() 
114
+    {
115
+        return unit;
116
+    }
117
+    public void setCommonPrice(BigDecimal commonPrice) 
118
+    {
119
+        this.commonPrice = commonPrice;
120
+    }
121
+
122
+    public BigDecimal getCommonPrice() 
123
+    {
124
+        return commonPrice;
125
+    }
126
+    public void setComplexPrice(BigDecimal complexPrice) 
127
+    {
128
+        this.complexPrice = complexPrice;
129
+    }
130
+
131
+    public BigDecimal getComplexPrice() 
132
+    {
133
+        return complexPrice;
134
+    }
135
+
136
+    @Override
137
+    public String toString() {
138
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
139
+            .append("id", getId())
140
+            .append("workType", getWorkType())
141
+            .append("workItem", getWorkItem())
142
+            .append("subItem", getSubItem())
143
+            .append("pricePercentage", getPricePercentage())
144
+            .append("scaleGrade", getScaleGrade())
145
+            .append("unit", getUnit())
146
+            .append("commonPrice", getCommonPrice())
147
+            .append("complexPrice", getComplexPrice())
148
+            .append("remark", getRemark())
149
+            .toString();
150
+    }
151
+}

+ 88
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcCheckPriceMapper.java 查看文件

@@ -0,0 +1,88 @@
1
+package com.ruoyi.oa.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcCheckPrice;
5
+import com.ruoyi.oa.domain.CmcCheckPrice;
6
+
7
+/**
8
+ * cmc核算单价Mapper接口
9
+ * 
10
+ * @author cmc
11
+ * @date 2025-05-14
12
+ */
13
+public interface CmcCheckPriceMapper 
14
+{
15
+    /**
16
+     * 查询cmc核算单价
17
+     * 
18
+     * @param id cmc核算单价主键
19
+     * @return cmc核算单价
20
+     */
21
+    public CmcCheckPrice selectCmcCheckPriceById(Long id);
22
+
23
+    /**
24
+     * 查询cmc核算单价列表
25
+     * 
26
+     * @param cmcCheckPrice cmc核算单价
27
+     * @return cmc核算单价集合
28
+     */
29
+    public List<CmcCheckPrice> selectCmcCheckPriceList(CmcCheckPrice cmcCheckPrice);
30
+
31
+    /**
32
+     * 根据工作类别查询单价表
33
+     *
34
+     * @param workType 工作类别
35
+     * @return 单价表
36
+     */
37
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkType(String workType);
38
+
39
+    /**
40
+     * 根据工作内容查询单价表
41
+     *
42
+     * @param workItem 工作内容目
43
+     * @return 单价表
44
+     */
45
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkItem(String workItem);
46
+
47
+    /**
48
+     * 根据比例等级查询出单位、一般地类、复杂地类
49
+     *
50
+     * @param workItem 工作内容
51
+     * @param subItem 内容细项
52
+     * @param scaleGrade 比例等级
53
+     * @return 单价表
54
+     */
55
+    public List<CmcCheckPrice> selectCmcCheckPriceByScaleGrade(String workItem, String subItem, String scaleGrade);
56
+
57
+    /**
58
+     * 新增cmc核算单价
59
+     * 
60
+     * @param cmcCheckPrice cmc核算单价
61
+     * @return 结果
62
+     */
63
+    public int insertCmcCheckPrice(CmcCheckPrice cmcCheckPrice);
64
+
65
+    /**
66
+     * 修改cmc核算单价
67
+     * 
68
+     * @param cmcCheckPrice cmc核算单价
69
+     * @return 结果
70
+     */
71
+    public int updateCmcCheckPrice(CmcCheckPrice cmcCheckPrice);
72
+
73
+    /**
74
+     * 删除cmc核算单价
75
+     * 
76
+     * @param id cmc核算单价主键
77
+     * @return 结果
78
+     */
79
+    public int deleteCmcCheckPriceById(Long id);
80
+
81
+    /**
82
+     * 批量删除cmc核算单价
83
+     * 
84
+     * @param ids 需要删除的数据主键集合
85
+     * @return 结果
86
+     */
87
+    public int deleteCmcCheckPriceByIds(Long[] ids);
88
+}

+ 87
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcCheckPriceService.java 查看文件

@@ -0,0 +1,87 @@
1
+package com.ruoyi.oa.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcCheckPrice;
5
+
6
+/**
7
+ * cmc核算单价Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-05-14
11
+ */
12
+public interface ICmcCheckPriceService 
13
+{
14
+    /**
15
+     * 查询cmc核算单价
16
+     * 
17
+     * @param id cmc核算单价主键
18
+     * @return cmc核算单价
19
+     */
20
+    public CmcCheckPrice selectCmcCheckPriceById(Long id);
21
+
22
+    /**
23
+     * 查询cmc核算单价列表
24
+     * 
25
+     * @param cmcCheckPrice cmc核算单价
26
+     * @return cmc核算单价集合
27
+     */
28
+    public List<CmcCheckPrice> selectCmcCheckPriceList(CmcCheckPrice cmcCheckPrice);
29
+
30
+    /**
31
+     * 根据工作类别查询单价表
32
+     *
33
+     * @param workType 工作类别
34
+     * @return 单价表
35
+     */
36
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkType(String workType);
37
+
38
+    /**
39
+     * 根据工作内容查询单价表
40
+     *
41
+     * @param workItem 工作内容
42
+     * @return 单价表
43
+     */
44
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkItem(String workItem);
45
+
46
+    /**
47
+     * 根据比例等级查询出单位、一般地类、复杂地类
48
+     *
49
+     * @param workItem 工作内容
50
+     * @param subItem 内容细项
51
+     * @param scaleGrade 比例等级
52
+     * @return 单价表
53
+     */
54
+    public List<CmcCheckPrice> selectCmcCheckPriceByScaleGrade(String workItem, String subItem, String scaleGrade);
55
+
56
+    /**
57
+     * 新增cmc核算单价
58
+     * 
59
+     * @param cmcCheckPrice cmc核算单价
60
+     * @return 结果
61
+     */
62
+    public int insertCmcCheckPrice(CmcCheckPrice cmcCheckPrice);
63
+
64
+    /**
65
+     * 修改cmc核算单价
66
+     * 
67
+     * @param cmcCheckPrice cmc核算单价
68
+     * @return 结果
69
+     */
70
+    public int updateCmcCheckPrice(CmcCheckPrice cmcCheckPrice);
71
+
72
+    /**
73
+     * 批量删除cmc核算单价
74
+     * 
75
+     * @param ids 需要删除的cmc核算单价主键集合
76
+     * @return 结果
77
+     */
78
+    public int deleteCmcCheckPriceByIds(Long[] ids);
79
+
80
+    /**
81
+     * 删除cmc核算单价信息
82
+     * 
83
+     * @param id cmc核算单价主键
84
+     * @return 结果
85
+     */
86
+    public int deleteCmcCheckPriceById(Long id);
87
+}

+ 123
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcCheckPriceServiceImpl.java 查看文件

@@ -0,0 +1,123 @@
1
+package com.ruoyi.oa.service.impl;
2
+
3
+import java.util.List;
4
+
5
+import com.ruoyi.oa.domain.CmcCheckPrice;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+import com.ruoyi.oa.mapper.CmcCheckPriceMapper;
9
+import com.ruoyi.oa.service.ICmcCheckPriceService;
10
+
11
+/**
12
+ * cmc核算单价Service业务层处理
13
+ * 
14
+ * @author cmc
15
+ * @date 2025-05-14
16
+ */
17
+@Service
18
+public class CmcCheckPriceServiceImpl implements ICmcCheckPriceService 
19
+{
20
+    @Autowired
21
+    private CmcCheckPriceMapper cmcCheckPriceMapper;
22
+
23
+    /**
24
+     * 查询cmc核算单价
25
+     * 
26
+     * @param id cmc核算单价主键
27
+     * @return cmc核算单价
28
+     */
29
+    @Override
30
+    public CmcCheckPrice selectCmcCheckPriceById(Long id)
31
+    {
32
+        return cmcCheckPriceMapper.selectCmcCheckPriceById(id);
33
+    }
34
+
35
+    /**
36
+     * 查询cmc核算单价列表
37
+     * 
38
+     * @param cmcCheckPrice cmc核算单价
39
+     * @return cmc核算单价
40
+     */
41
+    @Override
42
+    public List<CmcCheckPrice> selectCmcCheckPriceList(CmcCheckPrice cmcCheckPrice)
43
+    {
44
+        return cmcCheckPriceMapper.selectCmcCheckPriceList(cmcCheckPrice);
45
+    }
46
+
47
+    /**
48
+     * 根据工作类别查询单价表
49
+     *
50
+     * @param workType 工作类别
51
+     * @return 单价表
52
+     */
53
+    @Override
54
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkType(String workType) { return cmcCheckPriceMapper.selectCmcCheckPriceByWorkType(workType); }
55
+
56
+    /**
57
+     * 根据工作内容查询单价表
58
+     *
59
+     * @param workItem 工作内容
60
+     * @return 单价表
61
+     */
62
+    @Override
63
+    public List<CmcCheckPrice> selectCmcCheckPriceByWorkItem(String workItem) { return cmcCheckPriceMapper.selectCmcCheckPriceByWorkItem(workItem); }
64
+
65
+    /**
66
+     * 根据比例等级查询出单位、一般地类、复杂地类
67
+     *
68
+     * @param workItem 工作内容
69
+     * @param subItem 内容细项
70
+     * @param scaleGrade 比例等级
71
+     * @return 单价表
72
+     */
73
+    @Override
74
+    public List<CmcCheckPrice> selectCmcCheckPriceByScaleGrade(String workItem, String subItem, String scaleGrade) { return cmcCheckPriceMapper.selectCmcCheckPriceByScaleGrade(workItem, subItem, scaleGrade); }
75
+
76
+    /**
77
+     * 新增cmc核算单价
78
+     * 
79
+     * @param cmcCheckPrice cmc核算单价
80
+     * @return 结果
81
+     */
82
+    @Override
83
+    public int insertCmcCheckPrice(CmcCheckPrice cmcCheckPrice)
84
+    {
85
+        return cmcCheckPriceMapper.insertCmcCheckPrice(cmcCheckPrice);
86
+    }
87
+
88
+    /**
89
+     * 修改cmc核算单价
90
+     * 
91
+     * @param cmcCheckPrice cmc核算单价
92
+     * @return 结果
93
+     */
94
+    @Override
95
+    public int updateCmcCheckPrice(CmcCheckPrice cmcCheckPrice)
96
+    {
97
+        return cmcCheckPriceMapper.updateCmcCheckPrice(cmcCheckPrice);
98
+    }
99
+
100
+    /**
101
+     * 批量删除cmc核算单价
102
+     * 
103
+     * @param ids 需要删除的cmc核算单价主键
104
+     * @return 结果
105
+     */
106
+    @Override
107
+    public int deleteCmcCheckPriceByIds(Long[] ids)
108
+    {
109
+        return cmcCheckPriceMapper.deleteCmcCheckPriceByIds(ids);
110
+    }
111
+
112
+    /**
113
+     * 删除cmc核算单价信息
114
+     * 
115
+     * @param id cmc核算单价主键
116
+     * @return 结果
117
+     */
118
+    @Override
119
+    public int deleteCmcCheckPriceById(Long id)
120
+    {
121
+        return cmcCheckPriceMapper.deleteCmcCheckPriceById(id);
122
+    }
123
+}

+ 114
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCheckPriceMapper.xml 查看文件

@@ -0,0 +1,114 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.oa.mapper.CmcCheckPriceMapper">
6
+    
7
+    <resultMap type="CmcCheckPrice" id="CmcCheckPriceResult">
8
+        <result property="id"    column="id"    />
9
+        <result property="workType"    column="work_type"    />
10
+        <result property="workItem"    column="work_item"    />
11
+        <result property="subItem"    column="sub_item"    />
12
+        <result property="pricePercentage"    column="price_percentage"    />
13
+        <result property="scaleGrade"    column="scale_grade"    />
14
+        <result property="unit"    column="unit"    />
15
+        <result property="commonPrice"    column="common_price"    />
16
+        <result property="complexPrice"    column="complex_price"    />
17
+        <result property="remark"    column="remark"    />
18
+    </resultMap>
19
+
20
+    <sql id="selectCmcCheckPriceVo">
21
+        select id, work_type, work_item, sub_item, price_percentage, scale_grade, unit, common_price, complex_price, remark from cmc_check_price
22
+    </sql>
23
+
24
+    <select id="selectCmcCheckPriceList" parameterType="CmcCheckPrice" resultMap="CmcCheckPriceResult">
25
+        <include refid="selectCmcCheckPriceVo"/>
26
+        <where>  
27
+            <if test="workType != null  and workType != ''"> and work_type = #{workType}</if>
28
+            <if test="workItem != null  and workItem != ''"> and work_item = #{workItem}</if>
29
+            <if test="subItem != null  and subItem != ''"> and sub_item = #{subItem}</if>
30
+            <if test="pricePercentage != null "> and price_percentage = #{pricePercentage}</if>
31
+            <if test="scaleGrade != null  and scaleGrade != ''"> and scale_grade = #{scaleGrade}</if>
32
+            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
33
+            <if test="commonPrice != null "> and common_price = #{commonPrice}</if>
34
+            <if test="complexPrice != null "> and complex_price = #{complexPrice}</if>
35
+        </where>
36
+    </select>
37
+    
38
+    <select id="selectCmcCheckPriceById" parameterType="Long" resultMap="CmcCheckPriceResult">
39
+        <include refid="selectCmcCheckPriceVo"/>
40
+        where id = #{id}
41
+    </select>
42
+
43
+    <select id="selectCmcCheckPriceByWorkType" parameterType="String" resultMap="CmcCheckPriceResult">
44
+        <include refid="selectCmcCheckPriceVo"/>
45
+        where work_type = #{workType}
46
+    </select>
47
+
48
+    <select id="selectCmcCheckPriceByWorkItem" parameterType="String" resultMap="CmcCheckPriceResult">
49
+        <include refid="selectCmcCheckPriceVo"/>
50
+        where work_item = #{workItem}
51
+    </select>
52
+
53
+    <select id="selectCmcCheckPriceByScaleGrade" parameterType="String" resultMap="CmcCheckPriceResult">
54
+        <include refid="selectCmcCheckPriceVo"/>
55
+        <where>
56
+            <if test="param1 != null  and param1 != ''"> and work_item = #{param1}</if>
57
+            <if test="param2 != null  and param2 != ''"> and sub_item = #{param2}</if>
58
+            <if test="param3 != null  and param3 != ''"> and scale_grade = #{param3}</if>
59
+        </where>
60
+    </select>
61
+
62
+    <insert id="insertCmcCheckPrice" parameterType="CmcCheckPrice" useGeneratedKeys="true" keyProperty="id">
63
+        insert into cmc_check_price
64
+        <trim prefix="(" suffix=")" suffixOverrides=",">
65
+            <if test="workType != null">work_type,</if>
66
+            <if test="workItem != null">work_item,</if>
67
+            <if test="subItem != null">sub_item,</if>
68
+            <if test="pricePercentage != null">price_percentage,</if>
69
+            <if test="scaleGrade != null">scale_grade,</if>
70
+            <if test="unit != null">unit,</if>
71
+            <if test="commonPrice != null">common_price,</if>
72
+            <if test="complexPrice != null">complex_price,</if>
73
+            <if test="remark != null">remark,</if>
74
+         </trim>
75
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
76
+            <if test="workType != null">#{workType},</if>
77
+            <if test="workItem != null">#{workItem},</if>
78
+            <if test="subItem != null">#{subItem},</if>
79
+            <if test="pricePercentage != null">#{pricePercentage},</if>
80
+            <if test="scaleGrade != null">#{scaleGrade},</if>
81
+            <if test="unit != null">#{unit},</if>
82
+            <if test="commonPrice != null">#{commonPrice},</if>
83
+            <if test="complexPrice != null">#{complexPrice},</if>
84
+            <if test="remark != null">#{remark},</if>
85
+         </trim>
86
+    </insert>
87
+
88
+    <update id="updateCmcCheckPrice" parameterType="CmcCheckPrice">
89
+        update cmc_check_price
90
+        <trim prefix="SET" suffixOverrides=",">
91
+            <if test="workType != null">work_type = #{workType},</if>
92
+            <if test="workItem != null">work_item = #{workItem},</if>
93
+            <if test="subItem != null">sub_item = #{subItem},</if>
94
+            <if test="pricePercentage != null">price_percentage = #{pricePercentage},</if>
95
+            <if test="scaleGrade != null">scale_grade = #{scaleGrade},</if>
96
+            <if test="unit != null">unit = #{unit},</if>
97
+            <if test="commonPrice != null">common_price = #{commonPrice},</if>
98
+            <if test="complexPrice != null">complex_price = #{complexPrice},</if>
99
+            <if test="remark != null">remark = #{remark},</if>
100
+        </trim>
101
+        where id = #{id}
102
+    </update>
103
+
104
+    <delete id="deleteCmcCheckPriceById" parameterType="Long">
105
+        delete from cmc_check_price where id = #{id}
106
+    </delete>
107
+
108
+    <delete id="deleteCmcCheckPriceByIds" parameterType="String">
109
+        delete from cmc_check_price where id in 
110
+        <foreach item="id" collection="array" open="(" separator="," close=")">
111
+            #{id}
112
+        </foreach>
113
+    </delete>
114
+</mapper>

+ 121
- 1
oa-back/sql/sq.sql
文件差异内容过多而无法显示
查看文件


正在加载...
取消
保存