From 6b31ff9d953ce9160269b855f705ed7d5e799522 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Tue, 29 Oct 2024 17:18:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E4=B9=A6-=E4=B8=93=E9=A1=B9?= =?UTF-8?q?=E7=BB=8F=E8=B4=B9=E9=A2=84=E7=AE=97=20=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=2010.29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vxe/controller/VxeMockController.java | 41 ++++++++- .../demo/mock/vxe/json/projectFeeBudget.json | 16 ++++ .../ProjectFeeBudgetController.java | 24 ++++++ .../yusuanshu/ProjectFeeBudgetDemo.vue | 83 +++++++++---------- 4 files changed, 117 insertions(+), 47 deletions(-) create mode 100644 jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/json/projectFeeBudget.json diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/controller/VxeMockController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/controller/VxeMockController.java index e51b057..4d24e39 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/controller/VxeMockController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/controller/VxeMockController.java @@ -1,8 +1,10 @@ package org.jeecg.modules.demo.mock.vxe.controller; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -16,6 +18,9 @@ import org.jeecg.common.system.query.QueryCondition; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.mock.vxe.entity.MockEntity; import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket; +import org.jeecg.modules.demo.projectFeeBudget.entity.ProjectFeeBudget; +import org.jeecg.modules.demo.projectFeeBudget.service.IProjectFeeBudgetService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -33,6 +38,9 @@ import java.util.*; @Slf4j public class VxeMockController { + @Autowired + private IProjectFeeBudgetService projectFeeBudgetService; + /** * 模拟更改状态 * @@ -65,7 +73,7 @@ public class VxeMockController { */ @Deprecated @GetMapping("/change2") - public Result mockChange2(@RequestParam("id") String id,@RequestParam("tug_status") String tugStatus) { + public Result mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tugStatus) { /* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */ // 封装行数据 @@ -200,6 +208,37 @@ public class VxeMockController { return Result.ok(page); } + + /** + * @description: 获取项目经费预算填报项 + * @param: [pageNo, pageSize, parentId] + * @return: org.jeecg.common.api.vo.Result + * @author: z.h.c + * @date: 24/10/29 15:47 + */ + @GetMapping("/getProjectFeeBudgetList/{projectId}") + public Result getProjectFeeBudgetList(@PathVariable("projectId") String projectId, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + // 父级id,根据父级id查询子级,如果为空则查询顶级 + @RequestParam(name = "parentId", required = false) String parentId) { + + JSONArray dataList; + List feeBudgetList = projectFeeBudgetService.list(new LambdaQueryWrapper().eq(ProjectFeeBudget::getProjectId,projectId)); + if (ObjectUtil.isNotEmpty(feeBudgetList)) { + dataList = JSONArray.parseArray(JSON.toJSONString(feeBudgetList)); + } else { + String path = "classpath:org/jeecg/modules/demo/mock/vxe/json/projectFeeBudget.json"; + dataList = readJsonData(path); + /*// 读取JSON数据 + if (dataList == null) { + return Result.error("读取数据失败!"); + }*/ + } + IPage page = this.queryDataPage(dataList, parentId, pageNo, pageSize); + return Result.ok(page); + } + /** * 获取模拟“调度计划”页面的数据 * diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/json/projectFeeBudget.json b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/json/projectFeeBudget.json new file mode 100644 index 0000000..e9936b2 --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/mock/vxe/json/projectFeeBudget.json @@ -0,0 +1,16 @@ +[ +{"budgetSubject":"设备费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""}, +{"budgetSubject":"材料费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"测试化验加工费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"燃料动力费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"差旅费/会议费/国际合作与交流费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"出版/文献/信息传播/知识产权事务费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"劳务费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"专家咨询费","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"其他支出","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"本次申请省财政经费支持","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"本次申请省财政经费支持","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"其他财政拨款","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"单位自有货币资金","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +{"budgetSubject":"其他资金","totalFee":0.00,"specialFee":0.00,"selfFee":0.00,"specialFeeMark":""} +] diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/controller/ProjectFeeBudgetController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/controller/ProjectFeeBudgetController.java index f72784a..c0f9f5f 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/controller/ProjectFeeBudgetController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/controller/ProjectFeeBudgetController.java @@ -1,7 +1,10 @@ package org.jeecg.modules.demo.projectFeeBudget.controller; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.ddl.history.IDdlGenerator; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -11,6 +14,7 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.UUIDGenerator; import org.jeecg.modules.demo.projectFeeBudget.entity.ProjectFeeBudget; import org.jeecg.modules.demo.projectFeeBudget.service.IProjectFeeBudgetService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,6 +24,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.List; /** * @Description: 项目经费预算 @@ -35,6 +40,25 @@ public class ProjectFeeBudgetController extends JeecgController().eq(ProjectFeeBudget::getProjectId,projectId)); + List list = JSONArray.parseArray(tableData.toJSONString(), ProjectFeeBudget.class); + list.forEach(obj->{ + obj.setProjectId(projectId); + obj.setId(UUIDGenerator.generate()); + }); + projectFeeBudgetService.saveBatch(list); + return Result.ok(); + } + /** * 分页列表查询 * diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/yusuanshu/ProjectFeeBudgetDemo.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/yusuanshu/ProjectFeeBudgetDemo.vue index 520af7a..d2bb459 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/yusuanshu/ProjectFeeBudgetDemo.vue +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/yusuanshu/ProjectFeeBudgetDemo.vue @@ -1,5 +1,5 @@