项目对标管理下的项目管理,项目评价部门管理功能开发
This commit is contained in:
parent
5421489e6a
commit
5f23a9e7b1
|
|
@ -0,0 +1,100 @@
|
|||
package com.bonus.system.basic.controller;
|
||||
|
||||
import com.bonus.common.annotation.Log;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.BusinessType;
|
||||
import com.bonus.system.basic.domain.ProDept;
|
||||
import com.bonus.system.basic.service.ProDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目评价部门管理
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("basic/pro/proDept")
|
||||
public class ProDeptController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ProDeptService proDeptService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proDept:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProDept o)
|
||||
{
|
||||
startPage();
|
||||
List<ProDept> list = proDeptService.selectProDeptList(o);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proDept:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return success(proDeptService.selectProDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proDept:add')")
|
||||
@Log(title = "项目事业部管理-新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody ProDept o)
|
||||
{
|
||||
if (!proDeptService.checkProDeptUnique(o))
|
||||
{
|
||||
return error("新增项目事业部管理'" + o.getDeptName() + "'失败,已存在");
|
||||
}
|
||||
if(!proDeptService.checkDeptSort(o)){
|
||||
return error("新增项目事业部管理排序'" + o.getDeptSort() + "'失败,已存在");
|
||||
}
|
||||
o.setCreateUser(getUserId());
|
||||
return toAjax(proDeptService.insertProDept(o));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proDept:edit')")
|
||||
@Log(title = "项目事业部管理-修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody ProDept o)
|
||||
{
|
||||
if (!proDeptService.checkProDeptUnique(o))
|
||||
{
|
||||
return error("修改项目事业部管理'" + o.getDeptName() + "'失败,已存在");
|
||||
}
|
||||
if(!proDeptService.checkDeptSort(o)){
|
||||
return error("修改项目事业部管理排序'" + o.getDeptSort() + "'失败,已存在");
|
||||
}
|
||||
o.setUpdateUser(getUserId());
|
||||
return toAjax(proDeptService.updateProDept(o));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proDept:remove')")
|
||||
@Log(title = "项目事业部管理-删除", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
// if(!proDeptService.checkPro(id)){
|
||||
// return error("删除项目事业部管理失败,已存在项目信息");
|
||||
// }
|
||||
proDeptService.deleteProDeptById(id);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
@ -20,13 +20,13 @@ import java.util.List;
|
|||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("basic/pro/proUint")
|
||||
@RequestMapping("basic/pro/proUnit")
|
||||
public class ProUintController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ProUintService proUintService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUint:list')")
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUnit:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProUint o)
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ public class ProUintController extends BaseController
|
|||
/**
|
||||
* 查询详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUint:query')")
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUnit:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ public class ProUintController extends BaseController
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUint:add')")
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUnit:add')")
|
||||
@Log(title = "项目事业部管理-新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody ProUint o)
|
||||
|
|
@ -67,7 +67,7 @@ public class ProUintController extends BaseController
|
|||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUint:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUnit:edit')")
|
||||
@Log(title = "项目事业部管理-修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody ProUint o)
|
||||
|
|
@ -86,7 +86,7 @@ public class ProUintController extends BaseController
|
|||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUint:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:proUnit:remove')")
|
||||
@Log(title = "项目事业部管理-删除", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package com.bonus.system.basic.controller;
|
||||
|
||||
import com.bonus.common.annotation.Log;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.BusinessType;
|
||||
import com.bonus.system.basic.domain.EvaluativeItems;
|
||||
import com.bonus.system.basic.domain.Project;
|
||||
import com.bonus.system.basic.service.ProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目管理
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("basic/pro/project")
|
||||
public class ProjectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ProjectService projectService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Project o)
|
||||
{
|
||||
startPage();
|
||||
List<Project> list = projectService.selectProjectList(o);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目列表的下拉选
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:list')")
|
||||
@GetMapping("/getSelectList")
|
||||
public AjaxResult getSelectList(Project o)
|
||||
{
|
||||
List<Project> bean = projectService.getSelectList(o);
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return success(projectService.selectProjectById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:add')")
|
||||
@Log(title = "项目管理-新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody Project o)
|
||||
{
|
||||
if (!projectService.checkProjectUnique(o))
|
||||
{
|
||||
return error("新增项目管理'" + o.getProName() + "'失败,已存在");
|
||||
}
|
||||
o.setCreateUser(getUserId());
|
||||
return toAjax(projectService.insertProject(o));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:edit')")
|
||||
@Log(title = "项目管理-修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody Project o)
|
||||
{
|
||||
if (!projectService.checkProjectUnique(o))
|
||||
{
|
||||
return error("修改项目管理'" + o.getProName() + "'失败,已存在");
|
||||
}
|
||||
o.setUpdateUser(getUserId());
|
||||
return toAjax(projectService.updateProject(o));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('basic:pro:project:remove')")
|
||||
@Log(title = "项目管理-删除", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
// if(!projectService.checkPro(id)){
|
||||
// return error("删除项目管理失败,已存在项目信息");
|
||||
// }
|
||||
projectService.deleteProjectById(id);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.bonus.system.basic.dao;
|
||||
|
||||
import com.bonus.system.basic.domain.ProDept;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目评价部门管理 数据层
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
public interface ProDeptMapper
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 集合信息
|
||||
*/
|
||||
public List<ProDept> selectProDeptList(ProDept o);
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return
|
||||
*/
|
||||
public ProDept selectProDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 通过ID删除信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProDeptById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProDept(ProDept o);
|
||||
|
||||
/**
|
||||
* 修改信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProDept(ProDept o);
|
||||
|
||||
/**
|
||||
* 校验称是否唯一
|
||||
*
|
||||
* @param unitName
|
||||
* @return 结果
|
||||
*/
|
||||
public ProDept checkProDeptUnique(String unitName);
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*
|
||||
* @param id
|
||||
* @return 结果
|
||||
*/
|
||||
ProDept checkPro(Long id);
|
||||
|
||||
/**
|
||||
* 校验部门排序是否唯一
|
||||
* @param deptSort
|
||||
* @return
|
||||
*/
|
||||
ProDept checkDeptSort(Integer deptSort);
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.system.basic.dao;
|
||||
|
||||
import com.bonus.system.basic.domain.Project;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目管理 数据层
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
public interface ProjectMapper
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 集合信息
|
||||
*/
|
||||
public List<Project> selectProjectList(Project o);
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return
|
||||
*/
|
||||
public Project selectProjectById(Long id);
|
||||
|
||||
/**
|
||||
* 通过ID删除信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProject(Project o);
|
||||
|
||||
/**
|
||||
* 修改信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProject(Project o);
|
||||
|
||||
/**
|
||||
* 校验称是否唯一
|
||||
*
|
||||
* @param unitName
|
||||
* @return 结果
|
||||
*/
|
||||
public Project checkProjectUnique(String unitName);
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*
|
||||
* @param id
|
||||
* @return 结果
|
||||
*/
|
||||
Project checkPro(Long id);
|
||||
|
||||
/**
|
||||
* 获取下拉列表
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
List<Project> getSelectList(Project o);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.system.basic.domain;
|
||||
|
||||
import com.bonus.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 项目评价部门管理 tb_project_dept
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class ProDept extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 创建者 */
|
||||
private Long createUser;
|
||||
/** 更新者 */
|
||||
private Long updateUser;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 排序 */
|
||||
private Integer deptSort;
|
||||
|
||||
/** 删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.system.basic.domain;
|
||||
|
||||
import com.bonus.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 项目管理 tb_project
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class Project extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 所属项目部 */
|
||||
private Long unitId;
|
||||
/** 创建者 */
|
||||
private Long createUser;
|
||||
/** 更新者 */
|
||||
private Long updateUser;
|
||||
|
||||
/** 项目名称 */
|
||||
private String proName;
|
||||
/** 所属事业部名称 */
|
||||
private String unitName;
|
||||
|
||||
/** 删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.system.basic.service;
|
||||
|
||||
import com.bonus.system.basic.domain.ProDept;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目评价部门管理 业务层
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
public interface ProDeptService
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 集合信息
|
||||
*/
|
||||
public List<ProDept> selectProDeptList(ProDept o);
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return
|
||||
*/
|
||||
public ProDept selectProDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除信息
|
||||
*
|
||||
* @param id 需要删除的ID
|
||||
*/
|
||||
public void deleteProDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 新增保存信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProDept(ProDept o);
|
||||
|
||||
/**
|
||||
* 修改保存信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProDept(ProDept o);
|
||||
|
||||
/**
|
||||
* 校验称是否唯一
|
||||
*
|
||||
* @param o
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkProDeptUnique(ProDept o);
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*/
|
||||
public boolean checkPro(Long id);
|
||||
|
||||
/**
|
||||
* 校验部门排序是否唯一
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
public boolean checkDeptSort(ProDept o);
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.system.basic.service;
|
||||
|
||||
import com.bonus.system.basic.domain.Project;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目管理 业务层
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
public interface ProjectService
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 集合信息
|
||||
*/
|
||||
public List<Project> selectProjectList(Project o);
|
||||
|
||||
/**
|
||||
* 根据ID查询信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return
|
||||
*/
|
||||
public Project selectProjectById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除信息
|
||||
*
|
||||
* @param id 需要删除的ID
|
||||
*/
|
||||
public void deleteProjectById(Long id);
|
||||
|
||||
/**
|
||||
* 新增保存信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProject(Project o);
|
||||
|
||||
/**
|
||||
* 修改保存信息
|
||||
*
|
||||
* @param o 信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProject(Project o);
|
||||
|
||||
/**
|
||||
* 校验称是否唯一
|
||||
*
|
||||
* @param o
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkProjectUnique(Project o);
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*/
|
||||
public boolean checkPro(Long id);
|
||||
|
||||
/**
|
||||
* 获取下拉列表
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
public List<Project> getSelectList(Project o);
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.bonus.system.basic.service.impl;
|
||||
|
||||
import com.bonus.common.constant.UserConstants;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
import com.bonus.system.basic.dao.ProDeptMapper;
|
||||
import com.bonus.system.basic.domain.ProDept;
|
||||
import com.bonus.system.basic.service.ProDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目评价部门管理 业务层处理
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Service
|
||||
public class ProDeptServiceImpl implements ProDeptService
|
||||
{
|
||||
@Autowired
|
||||
private ProDeptMapper proDeptMapper;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询类型
|
||||
*
|
||||
* @param dictType 类型信息
|
||||
* @return 类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<ProDept> selectProDeptList(ProDept dictType)
|
||||
{
|
||||
return proDeptMapper.selectProDeptList(dictType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型ID查询信息
|
||||
*
|
||||
* @param dictId 类型ID
|
||||
* @return 类型
|
||||
*/
|
||||
@Override
|
||||
public ProDept selectProDeptById(Long dictId)
|
||||
{
|
||||
return proDeptMapper.selectProDeptById(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除类型信息
|
||||
*
|
||||
* @param id 需要删除的ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteProDeptById(Long id)
|
||||
{
|
||||
proDeptMapper.deleteProDeptById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存类型信息
|
||||
*
|
||||
* @param o 类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProDept(ProDept o)
|
||||
{
|
||||
int row = proDeptMapper.insertProDept(o);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存类型信息
|
||||
*
|
||||
* @param o 类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateProDept(ProDept o)
|
||||
{
|
||||
int row = proDeptMapper.updateProDept(o);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验类型称是否唯一
|
||||
*
|
||||
* @param o 类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkProDeptUnique(ProDept o)
|
||||
{
|
||||
Long id = StringUtils.isNull(o.getId()) ? -1L : o.getId();
|
||||
ProDept unitName = proDeptMapper.checkProDeptUnique(o.getDeptName());
|
||||
if (StringUtils.isNotNull(unitName) && unitName.getId().longValue() != id.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPro(Long id)
|
||||
{
|
||||
ProDept o = proDeptMapper.checkPro(id);
|
||||
if (StringUtils.isNotNull(o))
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验部门排序是否唯一
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptSort(ProDept o) {
|
||||
Long id = StringUtils.isNull(o.getId()) ? -1L : o.getId();
|
||||
ProDept bean = proDeptMapper.checkDeptSort(o.getDeptSort());
|
||||
if (StringUtils.isNotNull(bean) && bean.getId().longValue() != id.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.bonus.system.basic.service.impl;
|
||||
|
||||
import com.bonus.common.constant.UserConstants;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
import com.bonus.system.basic.dao.ProjectMapper;
|
||||
import com.bonus.system.basic.domain.Project;
|
||||
import com.bonus.system.basic.service.ProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目事业部管理 业务层处理
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Service
|
||||
public class ProjectServiceImpl implements ProjectService
|
||||
{
|
||||
@Autowired
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询类型
|
||||
*
|
||||
* @param dictType 类型信息
|
||||
* @return 类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<Project> selectProjectList(Project dictType)
|
||||
{
|
||||
return projectMapper.selectProjectList(dictType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型ID查询信息
|
||||
*
|
||||
* @param dictId 类型ID
|
||||
* @return 类型
|
||||
*/
|
||||
@Override
|
||||
public Project selectProjectById(Long dictId)
|
||||
{
|
||||
return projectMapper.selectProjectById(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除类型信息
|
||||
*
|
||||
* @param id 需要删除的ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteProjectById(Long id)
|
||||
{
|
||||
projectMapper.deleteProjectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存类型信息
|
||||
*
|
||||
* @param o 类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProject(Project o)
|
||||
{
|
||||
int row = projectMapper.insertProject(o);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存类型信息
|
||||
*
|
||||
* @param o 类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateProject(Project o)
|
||||
{
|
||||
int row = projectMapper.updateProject(o);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验类型称是否唯一
|
||||
*
|
||||
* @param o 类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkProjectUnique(Project o)
|
||||
{
|
||||
Long id = StringUtils.isNull(o.getId()) ? -1L : o.getId();
|
||||
Project unitName = projectMapper.checkProjectUnique(o.getProName());
|
||||
if (StringUtils.isNotNull(unitName) && unitName.getId().longValue() != id.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验是否存在项目信息
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPro(Long id)
|
||||
{
|
||||
Project o = projectMapper.checkPro(id);
|
||||
if (StringUtils.isNotNull(o))
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下拉列表
|
||||
*/
|
||||
@Override
|
||||
public List<Project> getSelectList(Project o) {
|
||||
return projectMapper.getSelectList(o);
|
||||
}
|
||||
}
|
||||
|
|
@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="evalName != null and evalName != ''">
|
||||
and eval_name like concat('%',#{evalName},'%')
|
||||
</if>
|
||||
ORDER BY id desc
|
||||
</select>
|
||||
<select id="selectEvalItemById" resultType="com.bonus.system.basic.domain.EvaluativeItems">
|
||||
<include refid="selectEvaluativeItems"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
<?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.bonus.system.basic.dao.ProDeptMapper">
|
||||
|
||||
<sql id="selectProDeptLVo">
|
||||
SELECT id,
|
||||
dept_name as deptName,
|
||||
dept_sort as deptSort,
|
||||
create_time as createTime,
|
||||
create_user as createUser,
|
||||
update_time as updateTime,
|
||||
update_user as updateUser,
|
||||
del_flag as delFlag
|
||||
FROM tb_project_dept
|
||||
</sql>
|
||||
<insert id="insertProDept">
|
||||
insert into tb_project_dept(
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="deptSort != null">dept_sort,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
create_time,del_flag
|
||||
)values(
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="deptSort != null">#{deptSort},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
sysdate(),'0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateProDept">
|
||||
update tb_project_dept
|
||||
<set>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="deptSort != null">dept_sort = #{deptSort},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteProDeptById">
|
||||
update tb_project_dept set del_flag = '1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectProDeptList" resultType="com.bonus.system.basic.domain.ProDept">
|
||||
<include refid="selectProDeptLVo"/>
|
||||
where del_flag = '0'
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
ORDER BY dept_sort desc
|
||||
</select>
|
||||
|
||||
<select id="selectProDeptById" resultType="com.bonus.system.basic.domain.ProDept">
|
||||
<include refid="selectProDeptLVo"/>
|
||||
where del_flag = '0' and id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="checkProDeptUnique" resultType="com.bonus.system.basic.domain.ProDept">
|
||||
<include refid="selectProDeptLVo"/>
|
||||
where del_flag = '0' and dept_name = #{unitName}
|
||||
</select>
|
||||
|
||||
<select id="checkPro" resultType="com.bonus.system.basic.domain.ProDept">
|
||||
SELECT * FROM tb_project
|
||||
WHERE del_flag = '0' AND unit_id = #{id} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkDeptSort" resultType="com.bonus.system.basic.domain.ProDept">
|
||||
<include refid="selectProDeptLVo"/>
|
||||
where del_flag = '0' and dept_sort = #{deptSort}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<?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.bonus.system.basic.dao.ProjectMapper">
|
||||
|
||||
<sql id="selectProjectLVo">
|
||||
SELECT tp.id,
|
||||
tpu.id as unitId,
|
||||
tpu.unit_name as unitName,
|
||||
tpu.dept_sort as deptSort,
|
||||
tp.create_time as createTime,
|
||||
tp.create_user as createUser,
|
||||
tp.update_time as updateTime,
|
||||
tp.update_user as updateUser,
|
||||
tp.del_flag as delFlag,
|
||||
tp.pro_name as proName
|
||||
FROM tb_project tp
|
||||
LEFT JOIN tb_project_uint tpu ON tpu.id = tp.unit_id
|
||||
</sql>
|
||||
<insert id="insertProject">
|
||||
insert into tb_project(
|
||||
<if test="proName != null and proName != ''">pro_name,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
create_time,del_flag
|
||||
)values(
|
||||
<if test="proName != null and proName != ''">#{proName},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
sysdate(),'0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateProject">
|
||||
update tb_project
|
||||
<set>
|
||||
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteProjectById">
|
||||
update tb_project set del_flag = '1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectProjectList" resultType="com.bonus.system.basic.domain.Project">
|
||||
<include refid="selectProjectLVo"/>
|
||||
where tp.del_flag = '0'
|
||||
<if test="proName != null and proName != ''">
|
||||
AND tp.pro_name like concat('%', #{proName}, '%')
|
||||
</if>
|
||||
ORDER BY tp.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectProjectById" resultType="com.bonus.system.basic.domain.Project">
|
||||
<include refid="selectProjectLVo"/>
|
||||
where tp.del_flag = '0' and tp.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="checkProjectUnique" resultType="com.bonus.system.basic.domain.Project">
|
||||
<include refid="selectProjectLVo"/>
|
||||
where tp.del_flag = '0' and tp.pro_name = #{proName}
|
||||
</select>
|
||||
|
||||
<select id="checkPro" resultType="com.bonus.system.basic.domain.Project">
|
||||
SELECT * FROM tb_project
|
||||
WHERE del_flag = '0' AND unit_id = #{id} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkDeptSort" resultType="com.bonus.system.basic.domain.Project">
|
||||
<include refid="selectProjectLVo"/>
|
||||
where del_flag = '0' and dept_sort = #{deptSort}
|
||||
</select>
|
||||
|
||||
<select id="getSelectList" resultType="com.bonus.system.basic.domain.Project">
|
||||
SELECT id as unitId , unit_name AS unitName
|
||||
FROM tb_project_uint
|
||||
WHERE del_flag ='0'
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue