From 2a9fb076bd490bc9e53309cbb0a1f6ada8212e05 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Fri, 12 Dec 2025 23:25:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkToolCategoryController.java | 110 +++++++++++++ .../invest/controller/WorkToolController.java | 110 +++++++++++++ .../java/com/intc/invest/domain/WorkTool.java | 93 +++++++++++ .../intc/invest/domain/WorkToolCategory.java | 62 ++++++++ .../domain/dto/WorkToolCategoryDto.java | 29 ++++ .../intc/invest/domain/dto/WorkToolDto.java | 33 ++++ .../invest/domain/vo/WorkToolCategoryVo.java | 17 ++ .../com/intc/invest/domain/vo/WorkToolVo.java | 25 +++ .../invest/mapper/WorkToolCategoryMapper.java | 82 ++++++++++ .../intc/invest/mapper/WorkToolMapper.java | 82 ++++++++++ .../service/IWorkToolCategoryService.java | 63 ++++++++ .../intc/invest/service/IWorkToolService.java | 63 ++++++++ .../impl/WorkToolCategoryServiceImpl.java | 104 +++++++++++++ .../service/impl/WorkToolServiceImpl.java | 104 +++++++++++++ .../mapper/invest/WorkToolCategoryMapper.xml | 114 ++++++++++++++ .../mapper/invest/WorkToolMapper.xml | 145 ++++++++++++++++++ 16 files changed, 1236 insertions(+) create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolCategoryController.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolController.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkTool.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkToolCategory.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolCategoryDto.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolDto.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolCategoryVo.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolVo.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolCategoryMapper.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolMapper.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolCategoryService.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolService.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolCategoryServiceImpl.java create mode 100644 intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolServiceImpl.java create mode 100644 intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolCategoryMapper.xml create mode 100644 intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolMapper.xml diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolCategoryController.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolCategoryController.java new file mode 100644 index 0000000..d4702cd --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolCategoryController.java @@ -0,0 +1,110 @@ +package com.intc.invest.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import javax.annotation.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.intc.common.log.annotation.Log; +import com.intc.common.log.enums.BusinessType; + +import com.intc.invest.domain.WorkToolCategory; +import com.intc.invest.domain.vo.WorkToolCategoryVo; +import com.intc.invest.domain.dto.WorkToolCategoryDto; +import com.intc.invest.service.IWorkToolCategoryService; +import com.intc.common.core.web.controller.BaseController; +import com.intc.common.core.web.domain.AjaxResult; +import com.intc.common.core.utils.poi.ExcelUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.intc.common.core.web.page.TableDataInfo; + +/** + * 工具分类Controller + * + * @author intc + * @date 2024-12-12 + */ +@Api(tags="工具分类") +@RestController +@RequestMapping("/workToolCategory") +public class WorkToolCategoryController extends BaseController +{ + @Resource + private IWorkToolCategoryService workToolCategoryService; + + /** + * 查询工具分类列表 + */ + @ApiOperation(value="查询工具分类列表",response = WorkToolCategoryVo.class) + @GetMapping("/list") + public TableDataInfo list(WorkToolCategoryDto workToolCategoryDto) + { + startPage(); + List list = workToolCategoryService.selectWorkToolCategoryList(workToolCategoryDto); + return getDataTable(list); + } + + /** + * 导出工具分类列表 + */ + @ApiOperation(value="导出工具分类列表") + @Log(title = "工具分类", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WorkToolCategoryDto workToolCategoryDto) + { + List list = workToolCategoryService.selectWorkToolCategoryList(workToolCategoryDto); + ExcelUtil util = new ExcelUtil(WorkToolCategoryVo.class); + util.exportExcel(response, list, "工具分类数据"); + } + + /** + * 获取工具分类详细信息 + */ + @ApiOperation(value="获取工具分类详细信息") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(workToolCategoryService.selectWorkToolCategoryById(id)); + } + + /** + * 新增工具分类 + */ + @ApiOperation(value="新增工具分类") + @Log(title = "工具分类", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WorkToolCategory workToolCategory) + { + return toAjax(workToolCategoryService.insertWorkToolCategory(workToolCategory)); + } + + /** + * 修改工具分类 + */ + @ApiOperation(value="修改工具分类") + @Log(title = "工具分类", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WorkToolCategory workToolCategory) + { + return toAjax(workToolCategoryService.updateWorkToolCategory(workToolCategory)); + } + + /** + * 删除工具分类 + */ + @ApiOperation(value="删除工具分类") + @Log(title = "工具分类", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(workToolCategoryService.deleteWorkToolCategoryByIds(ids)); + } +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolController.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolController.java new file mode 100644 index 0000000..ac3a775 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/controller/WorkToolController.java @@ -0,0 +1,110 @@ +package com.intc.invest.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import javax.annotation.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.intc.common.log.annotation.Log; +import com.intc.common.log.enums.BusinessType; + +import com.intc.invest.domain.WorkTool; +import com.intc.invest.domain.vo.WorkToolVo; +import com.intc.invest.domain.dto.WorkToolDto; +import com.intc.invest.service.IWorkToolService; +import com.intc.common.core.web.controller.BaseController; +import com.intc.common.core.web.domain.AjaxResult; +import com.intc.common.core.utils.poi.ExcelUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.intc.common.core.web.page.TableDataInfo; + +/** + * 工具Controller + * + * @author intc + * @date 2024-12-12 + */ +@Api(tags="工具") +@RestController +@RequestMapping("/workTool") +public class WorkToolController extends BaseController +{ + @Resource + private IWorkToolService workToolService; + + /** + * 查询工具列表 + */ + @ApiOperation(value="查询工具列表",response = WorkToolVo.class) + @GetMapping("/list") + public TableDataInfo list(WorkToolDto workToolDto) + { + startPage(); + List list = workToolService.selectWorkToolList(workToolDto); + return getDataTable(list); + } + + /** + * 导出工具列表 + */ + @ApiOperation(value="导出工具列表") + @Log(title = "工具", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WorkToolDto workToolDto) + { + List list = workToolService.selectWorkToolList(workToolDto); + ExcelUtil util = new ExcelUtil(WorkToolVo.class); + util.exportExcel(response, list, "工具数据"); + } + + /** + * 获取工具详细信息 + */ + @ApiOperation(value="获取工具详细信息") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(workToolService.selectWorkToolById(id)); + } + + /** + * 新增工具 + */ + @ApiOperation(value="新增工具") + @Log(title = "工具", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WorkTool workTool) + { + return toAjax(workToolService.insertWorkTool(workTool)); + } + + /** + * 修改工具 + */ + @ApiOperation(value="修改工具") + @Log(title = "工具", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WorkTool workTool) + { + return toAjax(workToolService.updateWorkTool(workTool)); + } + + /** + * 删除工具 + */ + @ApiOperation(value="删除工具") + @Log(title = "工具", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(workToolService.deleteWorkToolByIds(ids)); + } +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkTool.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkTool.java new file mode 100644 index 0000000..bef835a --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkTool.java @@ -0,0 +1,93 @@ +package com.intc.invest.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.intc.common.core.annotation.Excel; +import com.intc.common.core.web.domain.BaseEntity; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + +/** + * 工具对象 work_tool + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具对象") +@Data +public class WorkTool extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 分类ID */ + @ApiModelProperty(value="分类ID") + @NotNull(message="分类ID不能为空") + @Excel(name = "分类ID") + private Long categoryId; + + /** 工具名称 */ + @ApiModelProperty(value="工具名称") + @NotBlank(message="工具名称不能为空") + @Excel(name = "工具名称") + private String name; + + /** 描述 */ + @ApiModelProperty(value="描述") + @Excel(name = "描述") + private String description; + + /** URL */ + @ApiModelProperty(value="URL") + @NotBlank(message="URL不能为空") + @Excel(name = "URL") + private String url; + + /** 显示URL */ + @ApiModelProperty(value="显示URL") + @Excel(name = "显示URL") + private String displayUrl; + + /** 图标 */ + @ApiModelProperty(value="图标") + @Excel(name = "图标") + private String icon; + + /** 颜色 */ + @ApiModelProperty(value="颜色") + @Excel(name = "颜色") + private String color; + + /** 排序 */ + @ApiModelProperty(value="排序") + @Excel(name = "排序") + private Integer sortOrder; + + /** 删除标志(0代表存在 1代表删除) */ + private String delFlag; + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("categoryId", getCategoryId()) + .append("name", getName()) + .append("description", getDescription()) + .append("url", getUrl()) + .append("displayUrl", getDisplayUrl()) + .append("icon", getIcon()) + .append("color", getColor()) + .append("sortOrder", getSortOrder()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkToolCategory.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkToolCategory.java new file mode 100644 index 0000000..7df2223 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/WorkToolCategory.java @@ -0,0 +1,62 @@ +package com.intc.invest.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.intc.common.core.annotation.Excel; +import com.intc.common.core.web.domain.BaseEntity; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + +/** + * 工具分类对象 work_tool_category + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具分类对象") +@Data +public class WorkToolCategory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 分类键 */ + @ApiModelProperty(value="分类键") + @NotBlank(message="分类键不能为空") + @Excel(name = "分类键") + private String categoryKey; + + /** 分类标题 */ + @ApiModelProperty(value="分类标题") + @NotBlank(message="分类标题不能为空") + @Excel(name = "分类标题") + private String categoryTitle; + + /** 排序 */ + @ApiModelProperty(value="排序") + @Excel(name = "排序") + private Integer sortOrder; + + /** 删除标志(0代表存在 1代表删除) */ + private String delFlag; + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("categoryKey", getCategoryKey()) + .append("categoryTitle", getCategoryTitle()) + .append("sortOrder", getSortOrder()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolCategoryDto.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolCategoryDto.java new file mode 100644 index 0000000..47a5e57 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolCategoryDto.java @@ -0,0 +1,29 @@ +package com.intc.invest.domain.dto; + +import com.intc.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 工具分类Dto对象 work_tool_category + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具分类Dto对象") +@Data +public class WorkToolCategoryDto extends BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 分类键 */ + @ApiModelProperty(value="分类键") + private String categoryKey; + + /** 分类标题 */ + @ApiModelProperty(value="分类标题") + private String categoryTitle; +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolDto.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolDto.java new file mode 100644 index 0000000..e8e5153 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/dto/WorkToolDto.java @@ -0,0 +1,33 @@ +package com.intc.invest.domain.dto; + +import com.intc.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 工具Dto对象 work_tool + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具Dto对象") +@Data +public class WorkToolDto extends BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 分类ID */ + @ApiModelProperty(value="分类ID") + private Long categoryId; + + /** 工具名称 */ + @ApiModelProperty(value="工具名称") + private String name; + + /** 分类键 */ + @ApiModelProperty(value="分类键") + private String categoryKey; +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolCategoryVo.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolCategoryVo.java new file mode 100644 index 0000000..f0a7840 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolCategoryVo.java @@ -0,0 +1,17 @@ +package com.intc.invest.domain.vo; + +import com.intc.invest.domain.WorkToolCategory; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * 工具分类Vo对象 work_tool_category + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具分类Vo对象") +@Data +public class WorkToolCategoryVo extends WorkToolCategory +{ +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolVo.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolVo.java new file mode 100644 index 0000000..5cbac4b --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/WorkToolVo.java @@ -0,0 +1,25 @@ +package com.intc.invest.domain.vo; + +import com.intc.invest.domain.WorkTool; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 工具Vo对象 work_tool + * + * @author intc + * @date 2024-12-12 + */ +@ApiModel("工具Vo对象") +@Data +public class WorkToolVo extends WorkTool +{ + /** 分类键 */ + @ApiModelProperty(value="分类键") + private String categoryKey; + + /** 分类标题 */ + @ApiModelProperty(value="分类标题") + private String categoryTitle; +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolCategoryMapper.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolCategoryMapper.java new file mode 100644 index 0000000..ea95c59 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolCategoryMapper.java @@ -0,0 +1,82 @@ +package com.intc.invest.mapper; + +import com.intc.common.datascope.annotation.DataScope; +import com.intc.invest.domain.WorkToolCategory; +import com.intc.invest.domain.dto.WorkToolCategoryDto; +import com.intc.invest.domain.vo.WorkToolCategoryVo; + +import java.util.List; + +/** + * 工具分类Mapper接口 + * + * @author intc + * @date 2024-12-12 + */ +public interface WorkToolCategoryMapper +{ + /** + * 查询工具分类 + * + * @param id 工具分类主键 + * @return 工具分类 + */ + public WorkToolCategoryVo selectWorkToolCategoryById(Long id); + + /** + * 查询工具分类列表 + * + * @param workToolCategoryDto 工具分类 + * @return 工具分类集合 + */ + @DataScope(businessAlias = "wtc") + public List selectWorkToolCategoryList(WorkToolCategoryDto workToolCategoryDto); + + /** + * 新增工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + public int insertWorkToolCategory(WorkToolCategory workToolCategory); + + /** + * 修改工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + public int updateWorkToolCategory(WorkToolCategory workToolCategory); + + /** + * 删除工具分类 + * + * @param id 工具分类主键 + * @return 结果 + */ + public int deleteWorkToolCategoryById(Long id); + + /** + * 批量删除工具分类 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWorkToolCategoryByIds(Long[] ids); + + /** + * 逻辑删除工具分类 + * + * @param id 工具分类主键 + * @return 结果 + */ + public int removeWorkToolCategoryById(Long id); + + /** + * 批量逻辑删除工具分类 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int removeWorkToolCategoryByIds(Long[] ids); +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolMapper.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolMapper.java new file mode 100644 index 0000000..9c05889 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/mapper/WorkToolMapper.java @@ -0,0 +1,82 @@ +package com.intc.invest.mapper; + +import com.intc.common.datascope.annotation.DataScope; +import com.intc.invest.domain.WorkTool; +import com.intc.invest.domain.dto.WorkToolDto; +import com.intc.invest.domain.vo.WorkToolVo; + +import java.util.List; + +/** + * 工具Mapper接口 + * + * @author intc + * @date 2024-12-12 + */ +public interface WorkToolMapper +{ + /** + * 查询工具 + * + * @param id 工具主键 + * @return 工具 + */ + public WorkToolVo selectWorkToolById(Long id); + + /** + * 查询工具列表 + * + * @param workToolDto 工具 + * @return 工具集合 + */ + @DataScope(businessAlias = "wt") + public List selectWorkToolList(WorkToolDto workToolDto); + + /** + * 新增工具 + * + * @param workTool 工具 + * @return 结果 + */ + public int insertWorkTool(WorkTool workTool); + + /** + * 修改工具 + * + * @param workTool 工具 + * @return 结果 + */ + public int updateWorkTool(WorkTool workTool); + + /** + * 删除工具 + * + * @param id 工具主键 + * @return 结果 + */ + public int deleteWorkToolById(Long id); + + /** + * 批量删除工具 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWorkToolByIds(Long[] ids); + + /** + * 逻辑删除工具 + * + * @param id 工具主键 + * @return 结果 + */ + public int removeWorkToolById(Long id); + + /** + * 批量逻辑删除工具 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int removeWorkToolByIds(Long[] ids); +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolCategoryService.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolCategoryService.java new file mode 100644 index 0000000..fc86730 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolCategoryService.java @@ -0,0 +1,63 @@ +package com.intc.invest.service; + +import java.util.List; +import com.intc.invest.domain.WorkToolCategory; +import com.intc.invest.domain.dto.WorkToolCategoryDto; +import com.intc.invest.domain.vo.WorkToolCategoryVo; + +/** + * 工具分类Service接口 + * + * @author intc + * @date 2024-12-12 + */ +public interface IWorkToolCategoryService +{ + /** + * 查询工具分类 + * + * @param id 工具分类主键 + * @return 工具分类 + */ + public WorkToolCategoryVo selectWorkToolCategoryById(Long id); + + /** + * 查询工具分类列表 + * + * @param workToolCategoryDto 工具分类 + * @return 工具分类集合 + */ + public List selectWorkToolCategoryList(WorkToolCategoryDto workToolCategoryDto); + + /** + * 新增工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + public int insertWorkToolCategory(WorkToolCategory workToolCategory); + + /** + * 修改工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + public int updateWorkToolCategory(WorkToolCategory workToolCategory); + + /** + * 批量删除工具分类 + * + * @param ids 需要删除的工具分类主键集合 + * @return 结果 + */ + public int deleteWorkToolCategoryByIds(Long[] ids); + + /** + * 删除工具分类信息 + * + * @param id 工具分类主键 + * @return 结果 + */ + public int deleteWorkToolCategoryById(Long id); +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolService.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolService.java new file mode 100644 index 0000000..df0431c --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/IWorkToolService.java @@ -0,0 +1,63 @@ +package com.intc.invest.service; + +import java.util.List; +import com.intc.invest.domain.WorkTool; +import com.intc.invest.domain.dto.WorkToolDto; +import com.intc.invest.domain.vo.WorkToolVo; + +/** + * 工具Service接口 + * + * @author intc + * @date 2024-12-12 + */ +public interface IWorkToolService +{ + /** + * 查询工具 + * + * @param id 工具主键 + * @return 工具 + */ + public WorkToolVo selectWorkToolById(Long id); + + /** + * 查询工具列表 + * + * @param workToolDto 工具 + * @return 工具集合 + */ + public List selectWorkToolList(WorkToolDto workToolDto); + + /** + * 新增工具 + * + * @param workTool 工具 + * @return 结果 + */ + public int insertWorkTool(WorkTool workTool); + + /** + * 修改工具 + * + * @param workTool 工具 + * @return 结果 + */ + public int updateWorkTool(WorkTool workTool); + + /** + * 批量删除工具 + * + * @param ids 需要删除的工具主键集合 + * @return 结果 + */ + public int deleteWorkToolByIds(Long[] ids); + + /** + * 删除工具信息 + * + * @param id 工具主键 + * @return 结果 + */ + public int deleteWorkToolById(Long id); +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolCategoryServiceImpl.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolCategoryServiceImpl.java new file mode 100644 index 0000000..cc536c5 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolCategoryServiceImpl.java @@ -0,0 +1,104 @@ +package com.intc.invest.service.impl; + +import com.intc.common.core.utils.DateUtils; +import com.intc.common.core.utils.IdWorker; +import com.intc.common.security.utils.SecurityUtils; +import com.intc.invest.domain.WorkToolCategory; +import com.intc.invest.domain.dto.WorkToolCategoryDto; +import com.intc.invest.domain.vo.WorkToolCategoryVo; +import com.intc.invest.mapper.WorkToolCategoryMapper; +import com.intc.invest.service.IWorkToolCategoryService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 工具分类Service业务层处理 + * + * @author intc + * @date 2024-12-12 + */ +@Service +public class WorkToolCategoryServiceImpl implements IWorkToolCategoryService +{ + @Resource + private WorkToolCategoryMapper workToolCategoryMapper; + + /** + * 查询工具分类 + * + * @param id 工具分类主键 + * @return 工具分类 + */ + @Override + public WorkToolCategoryVo selectWorkToolCategoryById(Long id) + { + return workToolCategoryMapper.selectWorkToolCategoryById(id); + } + + /** + * 查询工具分类列表 + * + * @param workToolCategoryDto 工具分类 + * @return 工具分类 + */ + @Override + public List selectWorkToolCategoryList(WorkToolCategoryDto workToolCategoryDto) + { + return workToolCategoryMapper.selectWorkToolCategoryList(workToolCategoryDto); + } + + /** + * 新增工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + @Override + public int insertWorkToolCategory(WorkToolCategory workToolCategory) + { + workToolCategory.setCreateBy(SecurityUtils.getUsername()); + workToolCategory.setCreateTime(DateUtils.getNowDate()); + workToolCategory.setId(IdWorker.getId()); + return workToolCategoryMapper.insertWorkToolCategory(workToolCategory); + } + + /** + * 修改工具分类 + * + * @param workToolCategory 工具分类 + * @return 结果 + */ + @Override + public int updateWorkToolCategory(WorkToolCategory workToolCategory) + { + workToolCategory.setUpdateBy(SecurityUtils.getUsername()); + workToolCategory.setUpdateTime(DateUtils.getNowDate()); + return workToolCategoryMapper.updateWorkToolCategory(workToolCategory); + } + + /** + * 批量删除工具分类 + * + * @param ids 需要删除的工具分类主键 + * @return 结果 + */ + @Override + public int deleteWorkToolCategoryByIds(Long[] ids) + { + return workToolCategoryMapper.removeWorkToolCategoryByIds(ids); + } + + /** + * 删除工具分类信息 + * + * @param id 工具分类主键 + * @return 结果 + */ + @Override + public int deleteWorkToolCategoryById(Long id) + { + return workToolCategoryMapper.removeWorkToolCategoryById(id); + } +} diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolServiceImpl.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolServiceImpl.java new file mode 100644 index 0000000..90cbfb1 --- /dev/null +++ b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/WorkToolServiceImpl.java @@ -0,0 +1,104 @@ +package com.intc.invest.service.impl; + +import com.intc.common.core.utils.DateUtils; +import com.intc.common.core.utils.IdWorker; +import com.intc.common.security.utils.SecurityUtils; +import com.intc.invest.domain.WorkTool; +import com.intc.invest.domain.dto.WorkToolDto; +import com.intc.invest.domain.vo.WorkToolVo; +import com.intc.invest.mapper.WorkToolMapper; +import com.intc.invest.service.IWorkToolService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 工具Service业务层处理 + * + * @author intc + * @date 2024-12-12 + */ +@Service +public class WorkToolServiceImpl implements IWorkToolService +{ + @Resource + private WorkToolMapper workToolMapper; + + /** + * 查询工具 + * + * @param id 工具主键 + * @return 工具 + */ + @Override + public WorkToolVo selectWorkToolById(Long id) + { + return workToolMapper.selectWorkToolById(id); + } + + /** + * 查询工具列表 + * + * @param workToolDto 工具 + * @return 工具 + */ + @Override + public List selectWorkToolList(WorkToolDto workToolDto) + { + return workToolMapper.selectWorkToolList(workToolDto); + } + + /** + * 新增工具 + * + * @param workTool 工具 + * @return 结果 + */ + @Override + public int insertWorkTool(WorkTool workTool) + { + workTool.setCreateBy(SecurityUtils.getUsername()); + workTool.setCreateTime(DateUtils.getNowDate()); + workTool.setId(IdWorker.getId()); + return workToolMapper.insertWorkTool(workTool); + } + + /** + * 修改工具 + * + * @param workTool 工具 + * @return 结果 + */ + @Override + public int updateWorkTool(WorkTool workTool) + { + workTool.setUpdateBy(SecurityUtils.getUsername()); + workTool.setUpdateTime(DateUtils.getNowDate()); + return workToolMapper.updateWorkTool(workTool); + } + + /** + * 批量删除工具 + * + * @param ids 需要删除的工具主键 + * @return 结果 + */ + @Override + public int deleteWorkToolByIds(Long[] ids) + { + return workToolMapper.removeWorkToolByIds(ids); + } + + /** + * 删除工具信息 + * + * @param id 工具主键 + * @return 结果 + */ + @Override + public int deleteWorkToolById(Long id) + { + return workToolMapper.removeWorkToolById(id); + } +} diff --git a/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolCategoryMapper.xml b/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolCategoryMapper.xml new file mode 100644 index 0000000..a935671 --- /dev/null +++ b/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolCategoryMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + select + wtc.id, + wtc.category_key, + wtc.category_title, + wtc.sort_order, + wtc.create_by, + wtc.create_time, + wtc.update_by, + wtc.update_time, + wtc.del_flag, + wtc.remark + from work_tool_category wtc + + + + + + + + insert into work_tool_category + + id, + category_key, + category_title, + sort_order, + create_by, + create_time, + update_by, + update_time, + del_flag, + remark, + + + #{id}, + #{categoryKey}, + #{categoryTitle}, + #{sortOrder}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + #{remark}, + + + + + update work_tool_category + + category_key = #{categoryKey}, + category_title = #{categoryTitle}, + sort_order = #{sortOrder}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from work_tool_category where id = #{id} + + + + delete from work_tool_category where id in + + #{id} + + + + + update work_tool_category set del_flag='1' where id = #{id} + + + + update work_tool_category set del_flag='1' where id in + + #{id} + + + diff --git a/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolMapper.xml b/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolMapper.xml new file mode 100644 index 0000000..d20840d --- /dev/null +++ b/intc-modules/intc-invest/src/main/resources/mapper/invest/WorkToolMapper.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select + wt.id, + wt.category_id, + wt.name, + wt.description, + wt.url, + wt.display_url, + wt.icon, + wt.color, + wt.sort_order, + wt.create_by, + wt.create_time, + wt.update_by, + wt.update_time, + wt.del_flag, + wt.remark, + wtc.category_key, + wtc.category_title + from work_tool wt + left join work_tool_category wtc on wt.category_id = wtc.id + + + + + + + + insert into work_tool + + id, + category_id, + name, + description, + url, + display_url, + icon, + color, + sort_order, + create_by, + create_time, + update_by, + update_time, + del_flag, + remark, + + + #{id}, + #{categoryId}, + #{name}, + #{description}, + #{url}, + #{displayUrl}, + #{icon}, + #{color}, + #{sortOrder}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + #{remark}, + + + + + update work_tool + + category_id = #{categoryId}, + name = #{name}, + description = #{description}, + url = #{url}, + display_url = #{displayUrl}, + icon = #{icon}, + color = #{color}, + sort_order = #{sortOrder}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from work_tool where id = #{id} + + + + delete from work_tool where id in + + #{id} + + + + + update work_tool set del_flag='1' where id = #{id} + + + + update work_tool set del_flag='1' where id in + + #{id} + + +