From 5421489e6aa7e008cd3d57be472a1277f1be087f Mon Sep 17 00:00:00 2001
From: lSun <15893999301@qq.com>
Date: Wed, 16 Jul 2025 17:37:58 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AF=B9=E6=A0=87=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E4=B8=8B=E7=9A=84=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7?=
=?UTF-8?q?=E9=A1=B9=E7=AE=A1=E7=90=86=EF=BC=8C=E4=BA=8B=E4=B8=9A=E9=83=A8?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/bonus/BusinessApplication.java | 2 +
bonus-system/pom.xml | 4 +
.../controller/EvaluativeItemsController.java | 115 ++++++++++++
.../basic/controller/ProUintController.java | 100 +++++++++++
.../basic/dao/EvaluativeItemsMapper.java | 81 +++++++++
.../bonus/system/basic/dao/ProUintMapper.java | 77 ++++++++
.../system/basic/domain/EvaluativeItems.java | 41 +++++
.../bonus/system/basic/domain/ProUint.java | 35 ++++
.../basic/service/EvaluativeItemsService.java | 78 ++++++++
.../system/basic/service/ProUintService.java | 72 ++++++++
.../impl/EvaluativeItemsServiceImpl.java | 167 ++++++++++++++++++
.../service/impl/ProUintServiceImpl.java | 134 ++++++++++++++
.../mapper/basic/EvaluativeItemsMapper.xml | 79 +++++++++
.../resources/mapper/basic/ProUintMapper.xml | 75 ++++++++
14 files changed, 1060 insertions(+)
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/controller/EvaluativeItemsController.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/controller/ProUintController.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/dao/EvaluativeItemsMapper.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/dao/ProUintMapper.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/domain/EvaluativeItems.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/domain/ProUint.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/service/EvaluativeItemsService.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/service/ProUintService.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/service/impl/EvaluativeItemsServiceImpl.java
create mode 100644 bonus-system/src/main/java/com/bonus/system/basic/service/impl/ProUintServiceImpl.java
create mode 100644 bonus-system/src/main/resources/mapper/basic/EvaluativeItemsMapper.xml
create mode 100644 bonus-system/src/main/resources/mapper/basic/ProUintMapper.xml
diff --git a/bonus-business/src/main/java/com/bonus/BusinessApplication.java b/bonus-business/src/main/java/com/bonus/BusinessApplication.java
index d119bf7..5aa6057 100644
--- a/bonus-business/src/main/java/com/bonus/BusinessApplication.java
+++ b/bonus-business/src/main/java/com/bonus/BusinessApplication.java
@@ -1,5 +1,6 @@
package com.bonus;
+import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@MapperScan("com.bonus.system.**.dao")
public class BusinessApplication
{
public static void main(String[] args)
diff --git a/bonus-system/pom.xml b/bonus-system/pom.xml
index adb720c..739be71 100644
--- a/bonus-system/pom.xml
+++ b/bonus-system/pom.xml
@@ -20,6 +20,10 @@
com.bonus
bonus-common
+
+ org.projectlombok
+ lombok
+
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/controller/EvaluativeItemsController.java b/bonus-system/src/main/java/com/bonus/system/basic/controller/EvaluativeItemsController.java
new file mode 100644
index 0000000..75b718f
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/controller/EvaluativeItemsController.java
@@ -0,0 +1,115 @@
+package com.bonus.system.basic.controller;
+
+import com.bonus.common.annotation.Log;
+import com.bonus.common.constant.UserConstants;
+import com.bonus.common.core.controller.BaseController;
+import com.bonus.common.core.domain.AjaxResult;
+import com.bonus.common.enums.BusinessType;
+import com.bonus.common.utils.StringUtils;
+import com.bonus.system.basic.domain.EvaluativeItems;
+import com.bonus.system.basic.service.EvaluativeItemsService;
+import org.apache.commons.lang3.ArrayUtils;
+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/evalItem")
+public class EvaluativeItemsController extends BaseController
+{
+ @Autowired
+ private EvaluativeItemsService evaluativeItemsService;
+
+ /**
+ * 获取项目评价项列表
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:list')")
+ @GetMapping("/list")
+ public AjaxResult list(EvaluativeItems o)
+ {
+ List bean = evaluativeItemsService.selectEvalItemList(o);
+ return success(bean);
+ }
+
+ /**
+ * 获取项目评价项列表的下拉选
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:list')")
+ @GetMapping("/getSelectList")
+ public AjaxResult getSelectList(EvaluativeItems o)
+ {
+ List bean = evaluativeItemsService.getSelectList(o);
+ return success(bean);
+ }
+
+
+ /**
+ * 根据项目评价项编号获取详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable Long id)
+ {
+ return success(evaluativeItemsService.selectEvalItemById(id));
+ }
+
+ /**
+ * 新增项目评价项
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:add')")
+ @Log(title = "项目评价项管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@Validated @RequestBody EvaluativeItems o)
+ {
+ if (!evaluativeItemsService.checkEvalItemNameUnique(o))
+ {
+ return error("新增项目评价项'" + o.getEvalName() + "'失败,项目评价项名称已存在");
+ }
+ o.setCreateUser(getUserId());
+ return toAjax(evaluativeItemsService.insertEvalItem(o));
+ }
+
+ /**
+ * 修改项目评价项
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:edit')")
+ @Log(title = "项目评价项管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@Validated @RequestBody EvaluativeItems o)
+ {
+ Long id = o.getId();
+ if (!evaluativeItemsService.checkEvalItemNameUnique(o))
+ {
+ return error("修改项目评价项'" + o.getEvalName() + "'失败,项目评价项名称已存在");
+ }
+ else if (o.getParentId().equals(id))
+ {
+ return error("修改项目评价项'" + o.getEvalName() + "'失败,上级项目评价项不能是自己");
+ }
+ o.setUpdateUser(getUserId());
+ return toAjax(evaluativeItemsService.updateEvalItem(o));
+ }
+
+ /**
+ * 删除项目评价项
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:evalItem:remove')")
+ @Log(title = "项目评价项管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{id}")
+ public AjaxResult remove(@PathVariable Long id)
+ {
+ if (evaluativeItemsService.hasChildByEvalItemId(id))
+ {
+ return warn("存在下级项目评价项,不允许删除");
+ }
+ return toAjax(evaluativeItemsService.deleteEvalItemById(id));
+ }
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/controller/ProUintController.java b/bonus-system/src/main/java/com/bonus/system/basic/controller/ProUintController.java
new file mode 100644
index 0000000..0627814
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/controller/ProUintController.java
@@ -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.ProUint;
+import com.bonus.system.basic.service.ProUintService;
+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/proUint")
+public class ProUintController extends BaseController
+{
+ @Autowired
+ private ProUintService proUintService;
+
+ @PreAuthorize("@ss.hasPermi('basic:pro:proUint:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(ProUint o)
+ {
+ startPage();
+ List list = proUintService.selectProUintList(o);
+ return getDataTable(list);
+ }
+
+ /**
+ * 查询详细
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:proUint:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable Long id)
+ {
+ return success(proUintService.selectProUintById(id));
+ }
+
+ /**
+ * 新增
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:proUint:add')")
+ @Log(title = "项目事业部管理-新增", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@Validated @RequestBody ProUint o)
+ {
+ if (!proUintService.checkProUintUnique(o))
+ {
+ return error("新增项目事业部管理'" + o.getUnitName() + "'失败,已存在");
+ }
+ if(!proUintService.checkDeptSort(o)){
+ return error("新增项目事业部管理排序'" + o.getDeptSort() + "'失败,已存在");
+ }
+ o.setCreateUser(getUserId());
+ return toAjax(proUintService.insertProUint(o));
+ }
+
+ /**
+ * 修改
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:proUint:edit')")
+ @Log(title = "项目事业部管理-修改", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@Validated @RequestBody ProUint o)
+ {
+ if (!proUintService.checkProUintUnique(o))
+ {
+ return error("修改项目事业部管理'" + o.getUnitName() + "'失败,已存在");
+ }
+ if(!proUintService.checkDeptSort(o)){
+ return error("修改项目事业部管理排序'" + o.getDeptSort() + "'失败,已存在");
+ }
+ o.setUpdateUser(getUserId());
+ return toAjax(proUintService.updateProUint(o));
+ }
+
+ /**
+ * 删除
+ */
+ @PreAuthorize("@ss.hasPermi('basic:pro:proUint:remove')")
+ @Log(title = "项目事业部管理-删除", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{id}")
+ public AjaxResult remove(@PathVariable Long id)
+ {
+ if(!proUintService.checkPro(id)){
+ return error("删除项目事业部管理失败,已存在项目信息");
+ }
+ proUintService.deleteProUintById(id);
+ return success();
+ }
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/dao/EvaluativeItemsMapper.java b/bonus-system/src/main/java/com/bonus/system/basic/dao/EvaluativeItemsMapper.java
new file mode 100644
index 0000000..903d3f0
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/dao/EvaluativeItemsMapper.java
@@ -0,0 +1,81 @@
+package com.bonus.system.basic.dao;
+
+import com.bonus.system.basic.domain.EvaluativeItems;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目评价项 数据层
+ *
+ * @author lsun
+ */
+
+@Mapper
+public interface EvaluativeItemsMapper
+{
+ /**
+ * 查询项目评价项数据
+ *
+ * @param o 项目评价项信息
+ * @return 项目评价项信息集合
+ */
+ public List selectEvalItemList(EvaluativeItems o);
+
+ /**
+ * 根据项目评价项ID查询信息
+ *
+ * @param id 项目评价项ID
+ * @return 项目评价项信息
+ */
+ public EvaluativeItems selectEvalItemById(Long id);
+
+ /**
+ * 是否存在子节点
+ *
+ * @param id 项目评价项ID
+ * @return 结果
+ */
+ public int hasChildByEvalItemId(Long id);
+
+ /**
+ * 校验项目评价项名称是否唯一
+ *
+ * @param evalName 项目评价项名称
+ * @param parentId 父项目评价项ID
+ * @return 结果
+ */
+ public EvaluativeItems checkEvalItemNameUnique(@Param("evalName") String evalName, @Param("parentId") Long parentId);
+
+ /**
+ * 新增项目评价项信息
+ *
+ * @param o 项目评价项信息
+ * @return 结果
+ */
+ public int insertEvalItem(EvaluativeItems o);
+
+ /**
+ * 修改项目评价项信息
+ *
+ * @param o 项目评价项信息
+ * @return 结果
+ */
+ public int updateEvalItem(EvaluativeItems o);
+
+ /**
+ * 删除项目评价项管理信息
+ *
+ * @param id 项目评价项ID
+ * @return 结果
+ */
+ public int deleteEvalItemById(Long id);
+
+ /**
+ * 获取项目评价项列表的下拉选
+ * @param o
+ * @return
+ */
+ List getSelectList(EvaluativeItems o);
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/dao/ProUintMapper.java b/bonus-system/src/main/java/com/bonus/system/basic/dao/ProUintMapper.java
new file mode 100644
index 0000000..b093fa7
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/dao/ProUintMapper.java
@@ -0,0 +1,77 @@
+package com.bonus.system.basic.dao;
+
+import com.bonus.system.basic.domain.ProUint;
+
+import java.util.List;
+
+/**
+ * 项目事业部管理 数据层
+ *
+ * @author lsun
+ */
+public interface ProUintMapper
+{
+ /**
+ * 根据条件分页查询
+ *
+ * @param o 信息
+ * @return 集合信息
+ */
+ public List selectProUintList(ProUint o);
+
+ /**
+ * 根据ID查询信息
+ *
+ * @param id ID
+ * @return
+ */
+ public ProUint selectProUintById(Long id);
+
+ /**
+ * 通过ID删除信息
+ *
+ * @param id ID
+ * @return 结果
+ */
+ public int deleteProUintById(Long id);
+
+
+ /**
+ * 新增信息
+ *
+ * @param o 信息
+ * @return 结果
+ */
+ public int insertProUint(ProUint o);
+
+ /**
+ * 修改信息
+ *
+ * @param o 信息
+ * @return 结果
+ */
+ public int updateProUint(ProUint o);
+
+ /**
+ * 校验称是否唯一
+ *
+ * @param unitName
+ * @return 结果
+ */
+ public ProUint checkProUintUnique(String unitName);
+
+ /**
+ * 校验是否存在项目信息
+ *
+ * @param id
+ * @return 结果
+ */
+ ProUint checkPro(Long id);
+
+ /**
+ * 校验部门排序是否唯一
+ * @param deptSort
+ * @return
+ */
+ ProUint checkDeptSort(Integer deptSort);
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/domain/EvaluativeItems.java b/bonus-system/src/main/java/com/bonus/system/basic/domain/EvaluativeItems.java
new file mode 100644
index 0000000..0b5abd5
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/domain/EvaluativeItems.java
@@ -0,0 +1,41 @@
+package com.bonus.system.basic.domain;
+
+import com.bonus.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 项目评价项表 tb_project_eval_item
+ *
+ * @author lsun
+ */
+@Data
+public class EvaluativeItems extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 主键 */
+ private Long id;
+ /** 创建者 */
+ private Long createUser;
+ /** 更新者 */
+ private Long updateUser;
+
+ /** 父部门ID */
+ private Long parentId;
+
+ /** 分值 */
+ private BigDecimal score;
+
+ /** 名称 */
+ private String evalName;
+
+ /** 节点等级 */
+ private Integer leve;
+
+ /** 删除标志(0代表存在 1代表删除) */
+ private String delFlag;
+
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/domain/ProUint.java b/bonus-system/src/main/java/com/bonus/system/basic/domain/ProUint.java
new file mode 100644
index 0000000..7306c31
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/domain/ProUint.java
@@ -0,0 +1,35 @@
+package com.bonus.system.basic.domain;
+
+import com.bonus.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+/**
+ * 项目事业部管理表 tb_project_uint
+ *
+ * @author lsun
+ */
+@Data
+public class ProUint extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 主键 */
+ private Long id;
+ /** 创建者 */
+ private Long createUser;
+ /** 更新者 */
+ private Long updateUser;
+
+ /** 事业部名称 */
+ private String unitName;
+
+ /** 排序 */
+ private Integer deptSort;
+
+ /** 删除标志(0代表存在 1代表删除) */
+ private String delFlag;
+
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/service/EvaluativeItemsService.java b/bonus-system/src/main/java/com/bonus/system/basic/service/EvaluativeItemsService.java
new file mode 100644
index 0000000..bd2e76a
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/service/EvaluativeItemsService.java
@@ -0,0 +1,78 @@
+package com.bonus.system.basic.service;
+
+import java.util.List;
+import com.bonus.common.core.domain.TreeSelect;
+import com.bonus.system.basic.domain.EvaluativeItems;
+
+/**
+ * 项目评价管理 服务层
+ *
+ * @author ruoyi
+ */
+public interface EvaluativeItemsService
+{
+ /**
+ * 查询项目评价管理数据
+ *
+ * @param o 项目评价信息
+ * @return 项目评价信息集合
+ */
+ public List selectEvalItemList(EvaluativeItems o);
+
+
+ /**
+ * 根据项目评价ID查询信息
+ *
+ * @param id 项目评价ID
+ * @return 项目评价信息
+ */
+ public EvaluativeItems selectEvalItemById(Long id);
+
+
+ /**
+ * 是否存在项目评价子节点
+ *
+ * @param id 项目评价ID
+ * @return 结果
+ */
+ public boolean hasChildByEvalItemId(Long id);
+
+ /**
+ * 校验项目评价名称是否唯一
+ *
+ * @param o 项目评价信息
+ * @return 结果
+ */
+ public boolean checkEvalItemNameUnique(EvaluativeItems o);
+
+ /**
+ * 新增保存项目评价信息
+ *
+ * @param o 项目评价信息
+ * @return 结果
+ */
+ public int insertEvalItem(EvaluativeItems o);
+
+ /**
+ * 修改保存项目评价信息
+ *
+ * @param o 项目评价信息
+ * @return 结果
+ */
+ public int updateEvalItem(EvaluativeItems o);
+
+ /**
+ * 删除项目评价管理信息
+ *
+ * @param id 项目评价ID
+ * @return 结果
+ */
+ public int deleteEvalItemById(Long id);
+
+ /**
+ * 获取项目评价项列表的下拉选
+ * @param o
+ * @return
+ */
+ List getSelectList(EvaluativeItems o);
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/service/ProUintService.java b/bonus-system/src/main/java/com/bonus/system/basic/service/ProUintService.java
new file mode 100644
index 0000000..d932b74
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/service/ProUintService.java
@@ -0,0 +1,72 @@
+package com.bonus.system.basic.service;
+
+import com.bonus.system.basic.domain.ProUint;
+
+import java.util.List;
+
+/**
+ * 项目事业部管理 业务层
+ *
+ * @author lsun
+ */
+public interface ProUintService
+{
+ /**
+ * 根据条件分页查询
+ *
+ * @param o 信息
+ * @return 集合信息
+ */
+ public List selectProUintList(ProUint o);
+
+ /**
+ * 根据ID查询信息
+ *
+ * @param id ID
+ * @return
+ */
+ public ProUint selectProUintById(Long id);
+
+ /**
+ * 批量删除信息
+ *
+ * @param id 需要删除的ID
+ */
+ public void deleteProUintById(Long id);
+
+ /**
+ * 新增保存信息
+ *
+ * @param o 信息
+ * @return 结果
+ */
+ public int insertProUint(ProUint o);
+
+ /**
+ * 修改保存信息
+ *
+ * @param o 信息
+ * @return 结果
+ */
+ public int updateProUint(ProUint o);
+
+ /**
+ * 校验称是否唯一
+ *
+ * @param o
+ * @return 结果
+ */
+ public boolean checkProUintUnique(ProUint o);
+
+ /**
+ * 校验是否存在项目信息
+ */
+ public boolean checkPro(Long id);
+
+ /**
+ * 校验部门排序是否唯一
+ * @param o
+ * @return
+ */
+ public boolean checkDeptSort(ProUint o);
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/service/impl/EvaluativeItemsServiceImpl.java b/bonus-system/src/main/java/com/bonus/system/basic/service/impl/EvaluativeItemsServiceImpl.java
new file mode 100644
index 0000000..728feb6
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/service/impl/EvaluativeItemsServiceImpl.java
@@ -0,0 +1,167 @@
+package com.bonus.system.basic.service.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.bonus.system.basic.dao.EvaluativeItemsMapper;
+import com.bonus.system.basic.domain.EvaluativeItems;
+import com.bonus.system.basic.service.EvaluativeItemsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.bonus.common.annotation.DataScope;
+import com.bonus.common.constant.UserConstants;
+import com.bonus.common.core.domain.entity.SysUser;
+import com.bonus.common.exception.ServiceException;
+import com.bonus.common.utils.SecurityUtils;
+import com.bonus.common.utils.StringUtils;
+import com.bonus.common.utils.spring.SpringUtils;
+import com.bonus.system.mapper.SysRoleMapper;
+
+/**
+ * 项目评价管理 服务实现
+ *
+ * @author ruoyi
+ */
+@Service
+public class EvaluativeItemsServiceImpl implements EvaluativeItemsService
+{
+ @Autowired
+ private EvaluativeItemsMapper evaluativeItemsMapper;
+
+ @Autowired
+ private SysRoleMapper roleMapper;
+
+ /**
+ * 查询项目评价管理数据
+ *
+ * @param dept 项目评价信息
+ * @return 项目评价信息集合
+ */
+ @Override
+ @DataScope(deptAlias = "d")
+ public List selectEvalItemList(EvaluativeItems dept)
+ {
+ return evaluativeItemsMapper.selectEvalItemList(dept);
+ }
+
+ /**
+ * 根据项目评价ID查询信息
+ *
+ * @param id 项目评价ID
+ * @return 项目评价信息
+ */
+ @Override
+ public EvaluativeItems selectEvalItemById(Long id)
+ {
+ return evaluativeItemsMapper.selectEvalItemById(id);
+ }
+
+
+ /**
+ * 是否存在子节点
+ *
+ * @param id 项目评价ID
+ * @return 结果
+ */
+ @Override
+ public boolean hasChildByEvalItemId(Long id)
+ {
+ int result = evaluativeItemsMapper.hasChildByEvalItemId(id);
+ return result > 0;
+ }
+
+ /**
+ * 校验项目评价名称是否唯一
+ *
+ * @param dept 项目评价信息
+ * @return 结果
+ */
+ @Override
+ public boolean checkEvalItemNameUnique(EvaluativeItems dept)
+ {
+ Long id = StringUtils.isNull(dept.getId()) ? -1L : dept.getId();
+ EvaluativeItems info = evaluativeItemsMapper.checkEvalItemNameUnique(dept.getEvalName(), dept.getParentId());
+ if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue())
+ {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 新增保存项目评价信息
+ *
+ * @param dept 项目评价信息
+ * @return 结果
+ */
+ @Override
+ public int insertEvalItem(EvaluativeItems dept)
+ {
+ return evaluativeItemsMapper.insertEvalItem(dept);
+ }
+
+ /**
+ * 修改保存项目评价信息
+ *
+ * @param dept 项目评价信息
+ * @return 结果
+ */
+ @Override
+ public int updateEvalItem(EvaluativeItems dept)
+ {
+ EvaluativeItems newParentDept = evaluativeItemsMapper.selectEvalItemById(dept.getParentId());
+ EvaluativeItems oldDept = evaluativeItemsMapper.selectEvalItemById(dept.getId());
+ int result = evaluativeItemsMapper.updateEvalItem(dept);
+ return result;
+ }
+
+ /**
+ * 删除项目评价管理信息
+ *
+ * @param id 项目评价ID
+ * @return 结果
+ */
+ @Override
+ public int deleteEvalItemById(Long id)
+ {
+ return evaluativeItemsMapper.deleteEvalItemById(id);
+ }
+
+ /**
+ * 获取项目评价项列表的下拉选
+ * @param o
+ * @return
+ */
+ @Override
+ public List getSelectList(EvaluativeItems o) {
+ return evaluativeItemsMapper.getSelectList( o);
+ }
+
+ /**
+ * 得到子节点列表
+ */
+ private List getChildList(List list, EvaluativeItems t)
+ {
+ List tlist = new ArrayList();
+ Iterator it = list.iterator();
+ while (it.hasNext())
+ {
+ EvaluativeItems n = (EvaluativeItems) it.next();
+ if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue())
+ {
+ tlist.add(n);
+ }
+ }
+ return tlist;
+ }
+
+ /**
+ * 判断是否有子节点
+ */
+ private boolean hasChild(List list, EvaluativeItems t)
+ {
+ return getChildList(list, t).size() > 0;
+ }
+}
diff --git a/bonus-system/src/main/java/com/bonus/system/basic/service/impl/ProUintServiceImpl.java b/bonus-system/src/main/java/com/bonus/system/basic/service/impl/ProUintServiceImpl.java
new file mode 100644
index 0000000..3bc9a40
--- /dev/null
+++ b/bonus-system/src/main/java/com/bonus/system/basic/service/impl/ProUintServiceImpl.java
@@ -0,0 +1,134 @@
+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.ProUintMapper;
+import com.bonus.system.basic.domain.ProUint;
+import com.bonus.system.basic.service.ProUintService;
+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 ProUintServiceImpl implements ProUintService
+{
+ @Autowired
+ private ProUintMapper proUintMapper;
+
+ /**
+ * 根据条件分页查询类型
+ *
+ * @param dictType 类型信息
+ * @return 类型集合信息
+ */
+ @Override
+ public List selectProUintList(ProUint dictType)
+ {
+ return proUintMapper.selectProUintList(dictType);
+ }
+
+ /**
+ * 根据类型ID查询信息
+ *
+ * @param dictId 类型ID
+ * @return 类型
+ */
+ @Override
+ public ProUint selectProUintById(Long dictId)
+ {
+ return proUintMapper.selectProUintById(dictId);
+ }
+
+ /**
+ * 批量删除类型信息
+ *
+ * @param id 需要删除的ID
+ */
+ @Override
+ public void deleteProUintById(Long id)
+ {
+ proUintMapper.deleteProUintById(id);
+ }
+
+ /**
+ * 新增保存类型信息
+ *
+ * @param o 类型信息
+ * @return 结果
+ */
+ @Override
+ public int insertProUint(ProUint o)
+ {
+ int row = proUintMapper.insertProUint(o);
+ return row;
+ }
+
+ /**
+ * 修改保存类型信息
+ *
+ * @param o 类型信息
+ * @return 结果
+ */
+ @Override
+ @Transactional
+ public int updateProUint(ProUint o)
+ {
+ int row = proUintMapper.updateProUint(o);
+ return row;
+ }
+
+ /**
+ * 校验类型称是否唯一
+ *
+ * @param o 类型
+ * @return 结果
+ */
+ @Override
+ public boolean checkProUintUnique(ProUint o)
+ {
+ Long id = StringUtils.isNull(o.getId()) ? -1L : o.getId();
+ ProUint unitName = proUintMapper.checkProUintUnique(o.getUnitName());
+ if (StringUtils.isNotNull(unitName) && unitName.getId().longValue() != id.longValue())
+ {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+
+ /**
+ * 校验是否存在项目信息
+ *
+ */
+ @Override
+ public boolean checkPro(Long id)
+ {
+ ProUint o = proUintMapper.checkPro(id);
+ if (StringUtils.isNotNull(o))
+ {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+
+ /**
+ * 校验部门排序是否唯一
+ *
+ */
+ @Override
+ public boolean checkDeptSort(ProUint o) {
+ Long id = StringUtils.isNull(o.getId()) ? -1L : o.getId();
+ ProUint bean = proUintMapper.checkDeptSort(o.getDeptSort());
+ if (StringUtils.isNotNull(bean) && bean.getId().longValue() != id.longValue())
+ {
+ return UserConstants.NOT_UNIQUE;
+ }
+ return UserConstants.UNIQUE;
+ }
+}
diff --git a/bonus-system/src/main/resources/mapper/basic/EvaluativeItemsMapper.xml b/bonus-system/src/main/resources/mapper/basic/EvaluativeItemsMapper.xml
new file mode 100644
index 0000000..173f441
--- /dev/null
+++ b/bonus-system/src/main/resources/mapper/basic/EvaluativeItemsMapper.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+ SELECT id,eval_name as evalName, parent_id as parentId,
+ score, leve,
+ create_time as createTime, create_user as createBy, update_time as updateTime,update_user as updateBy
+ FROM tb_project_eval_item
+
+
+
+ insert into tb_project_eval_item(
+ eval_name,
+ parent_id,
+ score,
+ leve,
+ create_user,
+ create_time,del_flag
+ )values(
+ #{evalName},
+ #{parentId},
+ #{score},
+ #{leve},
+ #{createUser},
+ sysdate(),'0'
+ )
+
+
+
+ update tb_project_eval_item
+
+ eval_name = #{evalName},
+ parent_id = #{parentId},
+ score = #{score},
+ leve = #{leve},
+ update_user = #{updateUser},
+ update_time = sysdate()
+
+ where id = #{id}
+
+
+
+ update tb_project_eval_item set del_flag = '1' where id = #{id}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bonus-system/src/main/resources/mapper/basic/ProUintMapper.xml b/bonus-system/src/main/resources/mapper/basic/ProUintMapper.xml
new file mode 100644
index 0000000..0c6c514
--- /dev/null
+++ b/bonus-system/src/main/resources/mapper/basic/ProUintMapper.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+ SELECT id,
+ unit_name as unitName,
+ 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_uint
+
+
+ insert into tb_project_uint(
+ unit_name,
+ dept_sort,
+ create_user,
+ create_time,del_flag
+ )values(
+ #{unitName},
+ #{deptSort},
+ #{createUser},
+ sysdate(),'0'
+ )
+
+
+
+ update tb_project_uint
+
+ unit_name = #{unitName},
+ dept_sort = #{deptSort},
+ update_user = #{updateUser},
+ update_time = sysdate()
+
+ where id = #{id}
+
+
+
+ update tb_project_uint set del_flag = '1' where id = #{id}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file