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 new file mode 100644 index 0000000..f72784a --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/controller/ProjectFeeBudgetController.java @@ -0,0 +1,162 @@ +package org.jeecg.modules.demo.projectFeeBudget.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +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.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 org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: 项目经费预算 + * @Author: jeecg-boot + * @Date: 2024-10-29 + * @Version: V1.0 + */ +@Api(tags = "项目经费预算") +@RestController +@RequestMapping("/projectFeeBudget/projectFeeBudget") +@Slf4j +public class ProjectFeeBudgetController extends JeecgController { + @Autowired + private IProjectFeeBudgetService projectFeeBudgetService; + + /** + * 分页列表查询 + * + * @param projectFeeBudget + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "项目经费预算-分页列表查询") + @ApiOperation(value = "项目经费预算-分页列表查询", notes = "项目经费预算-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ProjectFeeBudget projectFeeBudget, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(projectFeeBudget, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = projectFeeBudgetService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param projectFeeBudget + * @return + */ + @AutoLog(value = "项目经费预算-添加") + @ApiOperation(value = "项目经费预算-添加", notes = "项目经费预算-添加") +// @RequiresPermissions("projectFeeBudget:project_fee_budget:add") + @PostMapping(value = "/add") + public Result add(@RequestBody ProjectFeeBudget projectFeeBudget) { + projectFeeBudgetService.save(projectFeeBudget); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param projectFeeBudget + * @return + */ + @AutoLog(value = "项目经费预算-编辑") + @ApiOperation(value = "项目经费预算-编辑", notes = "项目经费预算-编辑") +// @RequiresPermissions("projectFeeBudget:project_fee_budget:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody ProjectFeeBudget projectFeeBudget) { + projectFeeBudgetService.updateById(projectFeeBudget); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "项目经费预算-通过id删除") + @ApiOperation(value = "项目经费预算-通过id删除", notes = "项目经费预算-通过id删除") +// @RequiresPermissions("projectFeeBudget:project_fee_budget:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + projectFeeBudgetService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "项目经费预算-批量删除") + @ApiOperation(value = "项目经费预算-批量删除", notes = "项目经费预算-批量删除") +// @RequiresPermissions("projectFeeBudget:project_fee_budget:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.projectFeeBudgetService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "项目经费预算-通过id查询") + @ApiOperation(value = "项目经费预算-通过id查询", notes = "项目经费预算-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + ProjectFeeBudget projectFeeBudget = projectFeeBudgetService.getById(id); + if (projectFeeBudget == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(projectFeeBudget); + } + + /** + * 导出excel + * + * @param request + * @param projectFeeBudget + */ +// @RequiresPermissions("projectFeeBudget:project_fee_budget:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ProjectFeeBudget projectFeeBudget) { + return super.exportXls(request, projectFeeBudget, ProjectFeeBudget.class, "项目经费预算"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("projectFeeBudget:project_fee_budget:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ProjectFeeBudget.class); + } + +} diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/entity/ProjectFeeBudget.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/entity/ProjectFeeBudget.java new file mode 100644 index 0000000..b03433b --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/entity/ProjectFeeBudget.java @@ -0,0 +1,104 @@ +package org.jeecg.modules.demo.projectFeeBudget.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: 项目经费预算 + * @Author: jeecg-boot + * @Date: 2024-10-29 + * @Version: V1.0 + */ +@Data +@TableName("project_fee_budget") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "project_fee_budget对象", description = "项目经费预算") +public class ProjectFeeBudget implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + /** + * 所属部门 + */ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + /** + * 项目id + */ + @Excel(name = "项目id", width = 15) + @ApiModelProperty(value = "项目id") + private String projectId; + /** + * 预算科目 + */ + @Excel(name = "预算科目", width = 15) + @ApiModelProperty(value = "预算科目") + private String budgetSubject; + /** + * 合计 + */ + @Excel(name = "合计", width = 15) + @ApiModelProperty(value = "合计") + private BigDecimal totalFee; + /** + * 专项经费 + */ + @Excel(name = "专项经费", width = 15) + @ApiModelProperty(value = "专项经费") + private BigDecimal specialFee; + /** + * 自筹经费 + */ + @Excel(name = "自筹经费", width = 15) + @ApiModelProperty(value = "自筹经费") + private BigDecimal selfFee; + /** + * 专项经费说明 + */ + @Excel(name = "专项经费说明", width = 15) + @ApiModelProperty(value = "专项经费说明") + private String specialFeeMark; +} diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/ProjectFeeBudgetMapper.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/ProjectFeeBudgetMapper.java new file mode 100644 index 0000000..95db8a8 --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/ProjectFeeBudgetMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.projectFeeBudget.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.projectFeeBudget.entity.ProjectFeeBudget; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 项目经费预算 + * @Author: jeecg-boot + * @Date: 2024-10-29 + * @Version: V1.0 + */ +public interface ProjectFeeBudgetMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/xml/ProjectFeeBudgetMapper.xml b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/xml/ProjectFeeBudgetMapper.xml new file mode 100644 index 0000000..a26d9e2 --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/mapper/xml/ProjectFeeBudgetMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/IProjectFeeBudgetService.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/IProjectFeeBudgetService.java new file mode 100644 index 0000000..374af4d --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/IProjectFeeBudgetService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.projectFeeBudget.service; + +import org.jeecg.modules.demo.projectFeeBudget.entity.ProjectFeeBudget; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 项目经费预算 + * @Author: jeecg-boot + * @Date: 2024-10-29 + * @Version: V1.0 + */ +public interface IProjectFeeBudgetService extends IService { + +} diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/impl/ProjectFeeBudgetServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/impl/ProjectFeeBudgetServiceImpl.java new file mode 100644 index 0000000..0516b20 --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectFeeBudget/service/impl/ProjectFeeBudgetServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.projectFeeBudget.service.impl; + +import org.jeecg.modules.demo.projectFeeBudget.entity.ProjectFeeBudget; +import org.jeecg.modules.demo.projectFeeBudget.mapper.ProjectFeeBudgetMapper; +import org.jeecg.modules.demo.projectFeeBudget.service.IProjectFeeBudgetService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 项目经费预算 + * @Author: jeecg-boot + * @Date: 2024-10-29 + * @Version: V1.0 + */ +@Service +public class ProjectFeeBudgetServiceImpl extends ServiceImpl implements IProjectFeeBudgetService { + +} diff --git a/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.api.ts b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.api.ts new file mode 100644 index 0000000..d8e9fab --- /dev/null +++ b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/projectFeeBudget/projectFeeBudget/list', + save='/projectFeeBudget/projectFeeBudget/add', + edit='/projectFeeBudget/projectFeeBudget/edit', + deleteOne = '/projectFeeBudget/projectFeeBudget/delete', + deleteBatch = '/projectFeeBudget/projectFeeBudget/deleteBatch', + importExcel = '/projectFeeBudget/projectFeeBudget/importExcel', + exportXls = '/projectFeeBudget/projectFeeBudget/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.data.ts b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.data.ts new file mode 100644 index 0000000..8d77919 --- /dev/null +++ b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudget.data.ts @@ -0,0 +1,118 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '项目id', + align:"center", + dataIndex: 'projectId' + }, + { + title: '预算科目', + align:"center", + dataIndex: 'budgetSubject' + }, + { + title: '合计', + align:"center", + dataIndex: 'totalFee' + }, + { + title: '专项经费', + align:"center", + dataIndex: 'specialFee' + }, + { + title: '自筹经费', + align:"center", + dataIndex: 'selfFee' + }, + { + title: '专项经费说明', + align:"center", + dataIndex: 'specialFeeMark' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '项目id', + field: 'projectId', + component: 'Input', + }, + { + label: '预算科目', + field: 'budgetSubject', + component: 'Input', + }, + { + label: '合计', + field: 'totalFee', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, + ]; + }, + }, + { + label: '专项经费', + field: 'specialFee', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, + ]; + }, + }, + { + label: '自筹经费', + field: 'selfFee', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'}, + ]; + }, + }, + { + label: '专项经费说明', + field: 'specialFeeMark', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + projectId: {title: '项目id',order: 0,view: 'text', type: 'string',}, + budgetSubject: {title: '预算科目',order: 1,view: 'text', type: 'string',}, + totalFee: {title: '合计',order: 2,view: 'number', type: 'number',}, + specialFee: {title: '专项经费',order: 3,view: 'number', type: 'number',}, + selfFee: {title: '自筹经费',order: 4,view: 'number', type: 'number',}, + specialFeeMark: {title: '专项经费说明',order: 5,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudgetList.vue b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudgetList.vue new file mode 100644 index 0000000..bd6c168 --- /dev/null +++ b/jeecgboot-vue3/src/views/projectFeeBudget/ProjectFeeBudgetList.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetForm.vue b/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetForm.vue new file mode 100644 index 0000000..1d07b63 --- /dev/null +++ b/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetModal.vue b/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetModal.vue new file mode 100644 index 0000000..38e3a88 --- /dev/null +++ b/jeecgboot-vue3/src/views/projectFeeBudget/components/ProjectFeeBudgetModal.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file