From 54bf2a7e4461aafabf9b1ab3f63296a84df497f9 Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 26 Jun 2023 15:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mixins/JeecgListMixin.js | 5 + .../requirementtype/RequirementTypeList.vue | 188 ++++++++++++++++ .../modules/RequirementTypeForm.vue | 154 +++++++++++++ .../modules/RequirementTypeModal.vue | 60 +++++ .../RequirementTypeModal__Style#Drawer.vue | 84 +++++++ .../controller/RequirementTypeController.java | 211 ++++++++++++++++++ .../entity/RequirementType.java | 71 ++++++ .../mapper/RequirementTypeMapper.java | 17 ++ .../mapper/xml/RequirementTypeMapper.xml | 5 + .../service/IRequirementTypeService.java | 14 ++ .../impl/RequirementTypeServiceImpl.java | 19 ++ 11 files changed, 828 insertions(+) create mode 100644 ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue create mode 100644 ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeForm.vue create mode 100644 ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal.vue create mode 100644 ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal__Style#Drawer.vue create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/RequirementTypeMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/xml/RequirementTypeMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/IRequirementTypeService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/impl/RequirementTypeServiceImpl.java diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index eb9e938..332046f 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -337,6 +337,11 @@ export const JeecgListMixin = { this.$refs.modalForm.title = "详情"; this.$refs.modalForm.disableSubmit = true; }, + handleAddxqlx: function (num,record) { + this.$refs.modalForm.add(num,record); + this.$refs.modalForm.title = "新增"; + this.$refs.modalForm.disableSubmit = false; + }, /* 导出 */ handleExportXls2() { let paramsStr = encodeURI(JSON.stringify(this.getQueryParams())); diff --git a/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue new file mode 100644 index 0000000..2577ae6 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue @@ -0,0 +1,188 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeForm.vue b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeForm.vue new file mode 100644 index 0000000..6450b88 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeForm.vue @@ -0,0 +1,154 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal.vue b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal.vue new file mode 100644 index 0000000..295af69 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal__Style#Drawer.vue new file mode 100644 index 0000000..7e565d9 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/requirementtype/modules/RequirementTypeModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java new file mode 100644 index 0000000..e4b755f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java @@ -0,0 +1,211 @@ +package org.jeecg.modules.demo.requirementtype.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.requirementtype.entity.RequirementType; +import org.jeecg.modules.demo.requirementtype.service.IRequirementTypeService; + +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; + + /** + * @Description: 需求类型 + * @Author: jeecg-boot + * @Date: 2023-06-25 + * @Version: V1.0 + */ +@Api(tags="需求类型") +@RestController +@RequestMapping("/requirementtype/requirementType") +@Slf4j +public class RequirementTypeController extends JeecgController { + @Autowired + private IRequirementTypeService requirementTypeService; + + /** + * 分页列表查询 + * + * @param requirementType + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "需求类型-分页列表查询") + @ApiOperation(value="需求类型-分页列表查询", notes="需求类型-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(RequirementType requirementType, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(requirementType, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = requirementTypeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param requirementType + * @return + */ + @AutoLog(value = "需求类型-添加") + @ApiOperation(value="需求类型-添加", notes="需求类型-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody RequirementType requirementType) { + requirementTypeService.save(requirementType); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param requirementType + * @return + */ + @AutoLog(value = "需求类型-编辑") + @ApiOperation(value="需求类型-编辑", notes="需求类型-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody RequirementType requirementType) { + requirementTypeService.updateById(requirementType); + 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) { + requirementTypeService.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.requirementTypeService.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) { + RequirementType requirementType = requirementTypeService.getById(id); + if(requirementType==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(requirementType); + } + + /** + * 导出excel + * + * @param request + * @param requirementType + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, RequirementType requirementType) { + return super.exportXls(request, requirementType, RequirementType.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, RequirementType.class); + } + + /** + * 需求类型名称重复校验 + * + * @param projectid,typename + * @return + */ + @AutoLog(value = "需求类型名称重复校验") + @ApiOperation(value="需求类型名称重复校验", notes="需求类型名称重复校验") + @GetMapping(value = "/checkname") + public Result checkname(@RequestParam(name="projectid",required=true) String projectid,@RequestParam(name="typename",required=true) String typename, + @RequestParam(name="id",required=true) String id,@RequestParam(name="upperId",required=true) String upperId,HttpServletRequest req) { + if(id==""){ + RequirementType requirementType = new RequirementType(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(requirementType, req.getParameterMap()); + queryWrapper.eq("project_id",projectid); + queryWrapper.eq("type_name",typename); + queryWrapper.eq("upper_id",upperId); + List list = requirementTypeService.list(queryWrapper); + if(list.size()>0) { + return Result.error("需求类型名称重复"); + } + }else { + RequirementType requirementTypecheck = requirementTypeService.getById(id); + if(!requirementTypecheck.getTypeName().equals(typename)){ + RequirementType requirementType = new RequirementType(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(requirementType, req.getParameterMap()); + queryWrapper.eq("project_id",projectid); + queryWrapper.eq("type_name",typename); + queryWrapper.eq("upper_id",upperId); + List list = requirementTypeService.list(queryWrapper); + if(list.size()>0) { + return Result.error("需求类型名称重复"); + } + } + + } + + return Result.OK(""); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java new file mode 100644 index 0000000..12c250e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java @@ -0,0 +1,71 @@ +package org.jeecg.modules.demo.requirementtype.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 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: 2023-06-25 + * @Version: V1.0 + */ +@Data +@TableName("requirement_type") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="requirement_type对象", description="需求类型") +public class RequirementType 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; + /**项目id*/ + @Excel(name = "项目id", width = 15, dictTable = "projectx", dicText = "project_name", dicCode = "id") + @Dict(dictTable = "projectx", dicText = "project_name", dicCode = "id") + @ApiModelProperty(value = "项目id") + private java.lang.String projectId; + /**上级类型id*/ + @Excel(name = "上级类型id", width = 15, dictTable = "requirement_type", dicText = "type_name", dicCode = "id") + @Dict(dictTable = "requirement_type", dicText = "type_name", dicCode = "id") + @ApiModelProperty(value = "上级类型id") + private java.lang.String upperId; + /**类型名称*/ + @Excel(name = "类型名称", width = 15) + @ApiModelProperty(value = "类型名称") + private java.lang.String typeName; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/RequirementTypeMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/RequirementTypeMapper.java new file mode 100644 index 0000000..b24503c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/RequirementTypeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.requirementtype.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.requirementtype.entity.RequirementType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 需求类型 + * @Author: jeecg-boot + * @Date: 2023-06-25 + * @Version: V1.0 + */ +public interface RequirementTypeMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/xml/RequirementTypeMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/xml/RequirementTypeMapper.xml new file mode 100644 index 0000000..911a428 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/mapper/xml/RequirementTypeMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/IRequirementTypeService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/IRequirementTypeService.java new file mode 100644 index 0000000..c40abbc --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/IRequirementTypeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.requirementtype.service; + +import org.jeecg.modules.demo.requirementtype.entity.RequirementType; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 需求类型 + * @Author: jeecg-boot + * @Date: 2023-06-25 + * @Version: V1.0 + */ +public interface IRequirementTypeService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/impl/RequirementTypeServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/impl/RequirementTypeServiceImpl.java new file mode 100644 index 0000000..05e05d4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/service/impl/RequirementTypeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.requirementtype.service.impl; + +import org.jeecg.modules.demo.requirementtype.entity.RequirementType; +import org.jeecg.modules.demo.requirementtype.mapper.RequirementTypeMapper; +import org.jeecg.modules.demo.requirementtype.service.IRequirementTypeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 需求类型 + * @Author: jeecg-boot + * @Date: 2023-06-25 + * @Version: V1.0 + */ +@Service +public class RequirementTypeServiceImpl extends ServiceImpl implements IRequirementTypeService { + +}