feat(项目聚合管理功能开发): 生成项目类型相关代码
关联Issue:https://www.gitlink.org.cn/Gitlink/forgeplus/issues/2894
This commit is contained in:
parent
4b9a90dfb4
commit
b5d14ccd94
|
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.zone.project.controller;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.zone.project.domain.ZoneProjectType;
|
||||
import com.ruoyi.zone.project.service.IZoneProjectTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特色专区项目分类Controller
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/projectType")
|
||||
public class ZoneProjectTypeController extends BaseController {
|
||||
@Autowired
|
||||
private IZoneProjectTypeService zoneProjectTypeService;
|
||||
|
||||
/**
|
||||
* 查询特色专区项目分类列表
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ZoneProjectType zoneProjectType) {
|
||||
startPage();
|
||||
List<ZoneProjectType> list = zoneProjectTypeService.selectZoneProjectTypeList(zoneProjectType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出特色专区项目分类列表
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:export")
|
||||
@Log(title = "特色专区项目分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ZoneProjectType zoneProjectType) {
|
||||
List<ZoneProjectType> list = zoneProjectTypeService.selectZoneProjectTypeList(zoneProjectType);
|
||||
ExcelUtil<ZoneProjectType> util = new ExcelUtil<ZoneProjectType>(ZoneProjectType.class);
|
||||
util.exportExcel(response, list, "特色专区项目分类数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特色专区项目分类详细信息
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(zoneProjectTypeService.selectZoneProjectTypeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特色专区项目分类
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:add")
|
||||
@Log(title = "特色专区项目分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ZoneProjectType zoneProjectType) {
|
||||
return toAjax(zoneProjectTypeService.insertZoneProjectType(zoneProjectType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特色专区项目分类
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:edit")
|
||||
@Log(title = "特色专区项目分类", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ZoneProjectType zoneProjectType) {
|
||||
return toAjax(zoneProjectTypeService.updateZoneProjectType(zoneProjectType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特色专区项目分类
|
||||
*/
|
||||
@RequiresPermissions("zone:projectType:remove")
|
||||
@Log(title = "特色专区项目分类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(zoneProjectTypeService.deleteZoneProjectTypeByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.ruoyi.zone.project.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 特色专区项目分类对象 zone_project_type
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
public class ZoneProjectType extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 项目分类主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目分类名称
|
||||
*/
|
||||
@Excel(name = "项目分类名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属组织Id
|
||||
*/
|
||||
@Excel(name = "所属组织Id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("deptId", getDeptId())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.zone.project.mapper;
|
||||
|
||||
import com.ruoyi.zone.project.domain.ZoneProjectType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特色专区项目分类Mapper接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
public interface ZoneProjectTypeMapper {
|
||||
/**
|
||||
* 查询特色专区项目分类
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 特色专区项目分类
|
||||
*/
|
||||
public ZoneProjectType selectZoneProjectTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询特色专区项目分类列表
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 特色专区项目分类集合
|
||||
*/
|
||||
public List<ZoneProjectType> selectZoneProjectTypeList(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 新增特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZoneProjectType(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 修改特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZoneProjectType(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 删除特色专区项目分类
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZoneProjectTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除特色专区项目分类
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZoneProjectTypeByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.zone.project.service;
|
||||
|
||||
import com.ruoyi.zone.project.domain.ZoneProjectType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特色专区项目分类Service接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
public interface IZoneProjectTypeService {
|
||||
/**
|
||||
* 查询特色专区项目分类
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 特色专区项目分类
|
||||
*/
|
||||
public ZoneProjectType selectZoneProjectTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询特色专区项目分类列表
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 特色专区项目分类集合
|
||||
*/
|
||||
public List<ZoneProjectType> selectZoneProjectTypeList(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 新增特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZoneProjectType(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 修改特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZoneProjectType(ZoneProjectType zoneProjectType);
|
||||
|
||||
/**
|
||||
* 批量删除特色专区项目分类
|
||||
*
|
||||
* @param ids 需要删除的特色专区项目分类主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZoneProjectTypeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除特色专区项目分类信息
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZoneProjectTypeById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.ruoyi.zone.project.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.zone.project.domain.ZoneProjectType;
|
||||
import com.ruoyi.zone.project.mapper.ZoneProjectTypeMapper;
|
||||
import com.ruoyi.zone.project.service.IZoneProjectTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特色专区项目分类Service业务层处理
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
@Service
|
||||
public class ZoneProjectTypeServiceImpl implements IZoneProjectTypeService {
|
||||
@Autowired
|
||||
private ZoneProjectTypeMapper zoneProjectTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询特色专区项目分类
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 特色专区项目分类
|
||||
*/
|
||||
@Override
|
||||
public ZoneProjectType selectZoneProjectTypeById(Long id) {
|
||||
return zoneProjectTypeMapper.selectZoneProjectTypeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询特色专区项目分类列表
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 特色专区项目分类
|
||||
*/
|
||||
@Override
|
||||
public List<ZoneProjectType> selectZoneProjectTypeList(ZoneProjectType zoneProjectType) {
|
||||
return zoneProjectTypeMapper.selectZoneProjectTypeList(zoneProjectType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZoneProjectType(ZoneProjectType zoneProjectType) {
|
||||
zoneProjectType.setCreateTime(DateUtils.getNowDate());
|
||||
return zoneProjectTypeMapper.insertZoneProjectType(zoneProjectType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特色专区项目分类
|
||||
*
|
||||
* @param zoneProjectType 特色专区项目分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZoneProjectType(ZoneProjectType zoneProjectType) {
|
||||
zoneProjectType.setUpdateTime(DateUtils.getNowDate());
|
||||
return zoneProjectTypeMapper.updateZoneProjectType(zoneProjectType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除特色专区项目分类
|
||||
*
|
||||
* @param ids 需要删除的特色专区项目分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZoneProjectTypeByIds(Long[] ids) {
|
||||
return zoneProjectTypeMapper.deleteZoneProjectTypeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特色专区项目分类信息
|
||||
*
|
||||
* @param id 特色专区项目分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZoneProjectTypeById(Long id) {
|
||||
return zoneProjectTypeMapper.deleteZoneProjectTypeById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.zone.project.mapper.ZoneProjectTypeMapper">
|
||||
|
||||
<resultMap type="ZoneProjectType" id="ZoneProjectTypeResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZoneProjectTypeVo">
|
||||
select id,
|
||||
name,
|
||||
dept_id,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from zone_project_type
|
||||
</sql>
|
||||
|
||||
<select id="selectZoneProjectTypeList" parameterType="ZoneProjectType" resultMap="ZoneProjectTypeResult">
|
||||
<include refid="selectZoneProjectTypeVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="deptId != null ">and dept_id = #{deptId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZoneProjectTypeById" parameterType="Long" resultMap="ZoneProjectTypeResult">
|
||||
<include refid="selectZoneProjectTypeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZoneProjectType" parameterType="ZoneProjectType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into zone_project_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZoneProjectType" parameterType="ZoneProjectType">
|
||||
update zone_project_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZoneProjectTypeById" parameterType="Long">
|
||||
delete
|
||||
from zone_project_type
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZoneProjectTypeByIds" parameterType="String">
|
||||
delete from zone_project_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue