diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/controller/ProjectlevelController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/controller/ProjectlevelController.java new file mode 100644 index 00000000..aedceb73 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/controller/ProjectlevelController.java @@ -0,0 +1,187 @@ +package org.jeecg.modules.demo.projectlevel.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.comptype.entity.CompType; +import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; +import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 项目层次 + * @Author: jeecg-boot + * @Date: 2024-07-04 + * @Version: V1.0 + */ +@Api(tags="项目层次") +@RestController +@RequestMapping("/projectlevel/projectlevel") +@Slf4j +public class ProjectlevelController extends JeecgController { + @Autowired + private IProjectlevelService projectlevelService; + + /** + * 分页列表查询 + * + * @param projectlevel + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "项目层次-分页列表查询") + @ApiOperation(value="项目层次-分页列表查询", notes="项目层次-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Projectlevel projectlevel, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(projectlevel, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = projectlevelService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param projectlevel + * @return + */ + @AutoLog(value = "项目层次-添加") + @ApiOperation(value="项目层次-添加", notes="项目层次-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody Projectlevel projectlevel) { + projectlevelService.save(projectlevel); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param projectlevel + * @return + */ + @AutoLog(value = "项目层次-编辑") + @ApiOperation(value="项目层次-编辑", notes="项目层次-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Projectlevel projectlevel) { + projectlevelService.updateById(projectlevel); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "项目层次-通过id删除") + @ApiOperation(value="项目层次-通过id删除", notes="项目层次-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + projectlevelService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "项目层次-批量删除") + @ApiOperation(value="项目层次-批量删除", notes="项目层次-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.projectlevelService.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) { + Projectlevel projectlevel = projectlevelService.getById(id); + if(projectlevel==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(projectlevel); + } + + /** + * 导出excel + * + * @param request + * @param projectlevel + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Projectlevel projectlevel) { + return super.exportXls(request, projectlevel, Projectlevel.class, "项目层次"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Projectlevel.class); + } + + /** + * 获取全部数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/getProjectlevel", method = RequestMethod.GET) + public Result> getProjectlevel() { + + List list = projectlevelService.list(); + return Result.OK(list); + } + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/entity/Projectlevel.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/entity/Projectlevel.java new file mode 100644 index 00000000..d62f38aa --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/entity/Projectlevel.java @@ -0,0 +1,70 @@ +package org.jeecg.modules.demo.projectlevel.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 项目层次 + * @Author: jeecg-boot + * @Date: 2024-07-04 + * @Version: V1.0 + */ +@Data +@TableName("projectlevel") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="projectlevel对象", description="项目层次") +public class Projectlevel implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**名称*/ + @Excel(name = "名称", width = 15) + @ApiModelProperty(value = "名称") + private java.lang.String name; + /**级别排序*/ + @Excel(name = "级别排序", width = 15) + @ApiModelProperty(value = "级别排序") + private java.lang.Integer leavelvalue; + /**比例系数*/ + @Excel(name = "比例系数", width = 15) + @ApiModelProperty(value = "比例系数") + private java.lang.Integer scale; +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/ProjectlevelMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/ProjectlevelMapper.java new file mode 100644 index 00000000..3026da33 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/ProjectlevelMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.projectlevel.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 项目层次 + * @Author: jeecg-boot + * @Date: 2024-07-04 + * @Version: V1.0 + */ +public interface ProjectlevelMapper extends BaseMapper { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/xml/ProjectlevelMapper.xml b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/xml/ProjectlevelMapper.xml new file mode 100644 index 00000000..1f6a7b00 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/mapper/xml/ProjectlevelMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/IProjectlevelService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/IProjectlevelService.java new file mode 100644 index 00000000..4b71e346 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/IProjectlevelService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.projectlevel.service; + +import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 项目层次 + * @Author: jeecg-boot + * @Date: 2024-07-04 + * @Version: V1.0 + */ +public interface IProjectlevelService extends IService { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/impl/ProjectlevelServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/impl/ProjectlevelServiceImpl.java new file mode 100644 index 00000000..95c4c870 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectlevel/service/impl/ProjectlevelServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.projectlevel.service.impl; + +import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; +import org.jeecg.modules.demo.projectlevel.mapper.ProjectlevelMapper; +import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 项目层次 + * @Author: jeecg-boot + * @Date: 2024-07-04 + * @Version: V1.0 + */ +@Service +public class ProjectlevelServiceImpl extends ServiceImpl implements IProjectlevelService { + +} diff --git a/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.api.ts b/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.api.ts new file mode 100644 index 00000000..44e5773e --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/projectlevel/projectlevel/list', + save='/projectlevel/projectlevel/add', + edit='/projectlevel/projectlevel/edit', + deleteOne = '/projectlevel/projectlevel/delete', + deleteBatch = '/projectlevel/projectlevel/deleteBatch', + importExcel = '/projectlevel/projectlevel/importExcel', + exportXls = '/projectlevel/projectlevel/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 }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +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 + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +} diff --git a/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.data.ts b/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.data.ts new file mode 100644 index 00000000..425dec81 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/Projectlevel.data.ts @@ -0,0 +1,71 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '名称', + align: "center", + dataIndex: 'name' + }, + { + title: '级别排序', + align: "center", + dataIndex: 'leavelvalue' + }, + { + title: '比例系数', + align: "center", + dataIndex: 'scale' + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '名称', + field: 'name', + component: 'Input', + }, + { + label: '级别排序', + field: 'leavelvalue', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + {...rules.duplicateCheckRule('projectlevel', 'leavelvalue',model,schema)[0]}, + ]; + }, + }, + { + label: '比例系数', + field: 'scale', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + { pattern: /^-?\d+$/, message: '请输入整数!'}, + ]; + }, + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + name: {title: '名称',order: 0,view: 'text', type: 'string',}, + leavelvalue: {title: '级别排序',order: 1,view: 'number', type: 'number',}, + scale: {title: '比例系数',order: 2,view: 'text', type: 'string',}, +}; diff --git a/jeecgboot-vue3-master/src/views/projectlevel/ProjectlevelList.vue b/jeecgboot-vue3-master/src/views/projectlevel/ProjectlevelList.vue new file mode 100644 index 00000000..1b0bd37f --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/ProjectlevelList.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/projectlevel/V20240705_1__menu_insert_Projectlevel.sql b/jeecgboot-vue3-master/src/views/projectlevel/V20240705_1__menu_insert_Projectlevel.sql new file mode 100644 index 00000000..199f98ce --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/V20240705_1__menu_insert_Projectlevel.sql @@ -0,0 +1,26 @@ +-- 注意:该页面对应的前台目录为views/projectlevel文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('2024070502583570550', NULL, '项目级别', '/projectlevel/projectlevelList', 'projectlevel/ProjectlevelList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0); + +-- 权限控制sql +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570551', '2024070502583570550', '添加项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570552', '2024070502583570550', '编辑项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570553', '2024070502583570550', '删除项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570554', '2024070502583570550', '批量删除项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570555', '2024070502583570550', '导出excel_项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024070502583570556', '2024070502583570550', '导入excel_项目级别', NULL, NULL, 0, NULL, NULL, 2, 'projectlevel:projectlevel:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-07-05 14:58:55', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelForm.vue b/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelForm.vue new file mode 100644 index 00000000..86a7ad01 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelForm.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelModal.vue b/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelModal.vue new file mode 100644 index 00000000..e1da9a49 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/projectlevel/components/ProjectlevelModal.vue @@ -0,0 +1,75 @@ + + + + +