yaoyi 1 mesiac pred
rodič
commit
a5dc9d176d

+ 3 - 3
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysDeptController.java

@@ -81,9 +81,9 @@ public class SysDeptController extends BaseController
         {
             return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
         }
-        if(dept.getDepType() ==null || dept.getDepType().isEmpty()){
-            return error("新增部门'" + dept.getDeptName() + "'失败,部门业务类型不能为空");
-        }
+//        if(dept.getDepType() ==null || dept.getDepType().isEmpty()){
+//            return error("新增部门'" + dept.getDeptName() + "'失败,部门业务类型不能为空");
+//        }
         dept.setCreateBy(SecurityUtils.getUsername());
         return toAjax(deptService.insertDept(dept));
     }

+ 77 - 0
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysSystemController.java

@@ -0,0 +1,77 @@
+package com.hr.system.controller;
+
+import com.hr.common.core.constant.UserConstants;
+import com.hr.common.core.utils.StringUtils;
+import com.hr.common.core.web.controller.BaseController;
+import com.hr.common.core.web.domain.AjaxResult;
+import com.hr.system.api.domain.SysDept;
+import com.hr.system.domain.SysBusinessSystem;
+import com.hr.system.service.ISysSystemService;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author yaoy
+ * @createTime 2025/9/26 10:53
+ **/
+@RestController
+@RequestMapping("/businessSystem")
+public class SysSystemController extends BaseController{
+
+    @Autowired
+    private ISysSystemService iSysSystemService;
+
+    /**
+     * 获取部门列表
+     */
+
+    @GetMapping("/list")
+    public AjaxResult list(SysDept dept)
+    {
+        List<SysBusinessSystem> sysBusinessSyslist = iSysSystemService.selectBusinessSystemList();
+        return success(sysBusinessSyslist);
+    }
+
+
+    /**
+     * 新增部门
+     */
+//    @RequiresPermissions("system:dept:add")
+    @Log(title = "业务系统管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody SysBusinessSystem dept)
+    {
+        return toAjax(iSysSystemService.insertBusinessSystem(dept));
+    }
+
+    /**
+     * 修改部门
+     */
+//    @RequiresPermissions("system:dept:edit")
+    @Log(title = "业务系统管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody SysBusinessSystem dept)
+    {
+        return toAjax( iSysSystemService.updateBusinessSystem(dept));
+    }
+
+    /**
+     * 删除部门
+     */
+//    @RequiresPermissions("system:dept:remove")
+    @Log(title = "业务系统管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{sysid}")
+    public AjaxResult remove(@PathVariable Long sysid)
+    {
+
+        return toAjax(iSysSystemService.deleteBusinessSystemById(sysid));
+    }
+}

+ 5 - 5
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysUserController.java

@@ -187,11 +187,11 @@ public class SysUserController extends BaseController
             d1.setDeptId(_d.getDeptId());
             d1.setDeptcode(_d.getAncestors()+","+d1.getDeptId());
 
-            d1.setDepType(_d.getDepType());
+//            d1.setDepType(_d.getDepType());
             deptlist.add(d1);
-            if(_d.getDepType().equals("base")){
-                userorgdept=_d;
-            }
+//            if(_d.getDepType().equals("base")){
+//                userorgdept=_d;
+//            }
             sysUserVo.setUserDeptList(deptlist);
         }
 
@@ -199,7 +199,7 @@ public class SysUserController extends BaseController
         if(userorgdept!=null) {
             sysUserVo.setDepCode(userorgdept.getAncestors());
             sysUserVo.setDepId(userorgdept.getDeptId());
-            sysUserVo.setOrgCode(userorgdept.getOrgCode());
+//            sysUserVo.setOrgCode(userorgdept.getOrgCode());
         }
 
         Map<String, List<SysDeptDto>> groupedByDepTypemap = deptlist.stream()

+ 62 - 0
hr-modules/hr-system/src/main/java/com/hr/system/domain/SysBusinessSystem.java

@@ -0,0 +1,62 @@
+package com.hr.system.domain;
+
+import com.hr.common.core.annotation.Excel;
+import com.hr.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author yaoy
+ * @createTime 2025/9/26 10:43
+ **/
+public class SysBusinessSystem
+    extends BaseEntity
+    {
+        /** 菜单ID */
+        private Long sysId;
+
+        /** 菜单名称 */
+        private String sysName;
+
+        /** 系统编码 */
+        private String sysCode;
+
+        public Long getSysId() {
+            return sysId;
+        }
+
+        public void setSysId(Long sysId) {
+            this.sysId = sysId;
+        }
+
+        public String getSysName() {
+            return sysName;
+        }
+
+        public void setSysName(String sysName) {
+            this.sysName = sysName;
+        }
+
+        public String getSysCode() {
+            return sysCode;
+        }
+
+        public void setSysCode(String sysCode) {
+            this.sysCode = sysCode;
+        }
+
+        @Override
+        public String toString() {
+            return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                    .append("sysId", getSysId())
+                    .append("sysName", getSysName())
+                    .append("sysCode", getSysCode())
+                    .toString();
+        }
+}

+ 49 - 0
hr-modules/hr-system/src/main/java/com/hr/system/mapper/SysBusinessSystemMapper.java

@@ -0,0 +1,49 @@
+package com.hr.system.mapper;
+
+import com.hr.system.domain.SysBusinessSystem;
+import com.hr.system.domain.SysConfig;
+
+import java.util.List;
+
+/**
+ * 参数配置 数据层
+ * 
+ * @author ruoyi
+ */
+public interface SysBusinessSystemMapper
+{
+
+
+    /**
+     * 查询参数配置列表
+     * 
+     *
+     * @return 参数配置集合
+     */
+    public List<SysBusinessSystem> selectBusinessSystemList();
+
+    /**
+     * 新增参数配置
+     * 
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int insertBusinessSystem(SysBusinessSystem config);
+
+    /**
+     * 修改参数配置
+     * 
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int updateBusinessSystem(SysBusinessSystem config);
+
+    /**
+     * 删除参数配置
+     * 
+     * @param sysId 参数ID
+     * @return 结果
+     */
+    public int deleteBusinessSystem(Long sysId);
+
+}

+ 45 - 0
hr-modules/hr-system/src/main/java/com/hr/system/service/ISysSystemService.java

@@ -0,0 +1,45 @@
+package com.hr.system.service;
+
+import com.hr.system.api.domain.SysDept;
+import com.hr.system.domain.SysBusinessSystem;
+
+import java.util.List;
+
+/**
+ * @author yaoy
+ * @createTime 2025/9/26 10:53
+ **/
+public interface ISysSystemService {
+
+    /**
+     * 查询部门管理数据
+     *
+     *
+     * @return 系统信息集合
+     */
+    public List<SysBusinessSystem> selectBusinessSystemList();
+
+    /**
+     * 新增保存部门信息
+     *
+     * @param dept 部门信息
+     * @return 结果
+     */
+    public int insertBusinessSystem(SysBusinessSystem dept);
+
+    /**
+     * 修改保存部门信息
+     *
+     * @param dept 部门信息
+     * @return 结果
+     */
+    public int updateBusinessSystem(SysBusinessSystem dept);
+
+    /**
+     * 删除部门管理信息
+     *
+     * @param sysId 部门ID
+     * @return 结果
+     */
+    public int deleteBusinessSystemById(Long sysId);
+}

+ 24 - 24
hr-modules/hr-system/src/main/java/com/hr/system/service/impl/SysDeptServiceImpl.java

@@ -244,18 +244,18 @@ public class SysDeptServiceImpl implements ISysDeptService
         }
         dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
 
-        if(info!=null && info.getDeptId()!=0L
-                && info.getDepType()!=null && dept.getDepType()!=null
-                && !info.getDepType().equals(dept.getDepType())){
-            dept.setDepType(info.getDepType());
-//            throw new ServiceException("下级部门业务类型必须和上级保持一致");
-        }
-        if(info!=null && info.getDeptId()!=0L
-                && info.getOrgCode()!=null && dept.getOrgCode()!=null
-                && !info.getOrgCode().equals(dept.getOrgCode())){
-            dept.setOrgCode(info.getOrgCode());
-//            throw new ServiceException("下级部门业务组织编码必须和上级保持一致");
-        }
+//        if(info!=null && info.getDeptId()!=0L
+//                && info.getDepType()!=null && dept.getDepType()!=null
+//                && !info.getDepType().equals(dept.getDepType())){
+//            dept.setDepType(info.getDepType());
+////            throw new ServiceException("下级部门业务类型必须和上级保持一致");
+//        }
+//        if(info!=null && info.getDeptId()!=0L
+//                && info.getOrgCode()!=null && dept.getOrgCode()!=null
+//                && !info.getOrgCode().equals(dept.getOrgCode())){
+//            dept.setOrgCode(info.getOrgCode());
+////            throw new ServiceException("下级部门业务组织编码必须和上级保持一致");
+//        }
 
 
         return deptMapper.insertDept(dept);
@@ -280,18 +280,18 @@ public class SysDeptServiceImpl implements ISysDeptService
             updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
         }
 
-        if(newParentDept!=null && newParentDept.getDeptId()!=0L
-                && newParentDept.getDepType()!=null && dept.getDepType()!=null
-                && !newParentDept.getDepType().equals(dept.getDepType())){
-            dept.setDepType(newParentDept.getDepType());
-//            throw new ServiceException("下级部门业务类型必须和上级保持一致");
-        }
-        if(newParentDept!=null && newParentDept.getDeptId()!=0L
-                && dept.getOrgCode()!=null && dept.getOrgCode()!=null
-                && !newParentDept.getOrgCode().equals(dept.getOrgCode())){
-            dept.setOrgCode(newParentDept.getOrgCode());
-//            throw new ServiceException("下级部门业务组织编码必须和上级保持一致");
-        }
+//        if(newParentDept!=null && newParentDept.getDeptId()!=0L
+//                && newParentDept.getDepType()!=null && dept.getDepType()!=null
+//                && !newParentDept.getDepType().equals(dept.getDepType())){
+//            dept.setDepType(newParentDept.getDepType());
+////            throw new ServiceException("下级部门业务类型必须和上级保持一致");
+//        }
+//        if(newParentDept!=null && newParentDept.getDeptId()!=0L
+//                && dept.getOrgCode()!=null && dept.getOrgCode()!=null
+//                && !newParentDept.getOrgCode().equals(dept.getOrgCode())){
+//            dept.setOrgCode(newParentDept.getOrgCode());
+////            throw new ServiceException("下级部门业务组织编码必须和上级保持一致");
+//        }
 
         int result = deptMapper.updateDept(dept);
         if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())

+ 7 - 5
hr-modules/hr-system/src/main/java/com/hr/system/service/impl/SysSystemServiceImpl.java

@@ -4,6 +4,7 @@ import com.hr.system.domain.SysBusinessSystem;
 import com.hr.system.mapper.SysBusinessSystemMapper;
 import com.hr.system.service.ISysSystemService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 import java.util.Collections;
 import java.util.List;
@@ -12,28 +13,29 @@ import java.util.List;
  * @author yaoy
  * @createTime 2025/9/26 10:56
  **/
-public class ISysSystemServiceImpl implements ISysSystemService {
+@Service
+public class SysSystemServiceImpl implements ISysSystemService {
 
     @Autowired
     private SysBusinessSystemMapper sysBusinessSystemMapper;
 
     @Override
     public List<SysBusinessSystem> selectBusinessSystemList() {
-        return Collections.emptyList();
+        return sysBusinessSystemMapper.selectBusinessSystemList();
     }
 
     @Override
     public int insertBusinessSystem(SysBusinessSystem dept) {
-        return 0;
+        return sysBusinessSystemMapper.insertBusinessSystem(dept);
     }
 
     @Override
     public int updateBusinessSystem(SysBusinessSystem dept) {
-        return 0;
+        return sysBusinessSystemMapper.updateBusinessSystem(dept);
     }
 
     @Override
     public int deleteBusinessSystemById(Long sysId) {
-        return 0;
+        return sysBusinessSystemMapper.deleteBusinessSystem(sysId);
     }
 }

+ 6 - 6
hr-modules/hr-system/src/main/java/com/hr/system/service/impl/SysUserServiceImpl.java

@@ -470,12 +470,12 @@ public class SysUserServiceImpl implements ISysUserService
             for (Long depId : depIds)
             {
                 SysDept dept=deptService.selectDeptById(depId);
-                if(map.containsKey(dept.getDepType())){
-                    throw new ServiceException("类型为["+dept.getDepType()+"的组织机构],不能同时关联多个!");
-                }
-               if(!map.containsKey(dept.getDepType())){
-                   map.put(dept.getDepType(),1);
-               }
+//                if(map.containsKey(dept.getDepType())){
+//                    throw new ServiceException("类型为["+dept.getDepType()+"的组织机构],不能同时关联多个!");
+//                }
+//               if(!map.containsKey(dept.getDepType())){
+//                   map.put(dept.getDepType(),1);
+//               }
 
 
                 SysUserDep ur = new SysUserDep();

+ 64 - 0
hr-modules/hr-system/src/main/resources/mapper/system/SysBusinessSystemMapper.xml

@@ -0,0 +1,64 @@
+<?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.hr.system.mapper.SysBusinessSystemMapper">
+
+	<resultMap type="SysBusinessSystem" id="SysBusinessSystemResult">
+		<id     property="sysId"     column="sys_id"     />
+		<result property="sysName"   column="sys_name"   />
+		<result property="sysCode"  column="sys_code"   />
+
+		<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="selectBusinessSystemVo">
+        select d.sys_id ,d.sys_name, d.sys_code, d.create_by, d.create_time
+        from sys_business_system d
+    </sql>
+    
+	<select id="selectBusinessSystemList"  resultMap="SysBusinessSystemResult">
+        <include refid="selectBusinessSystemVo"/>
+        where 1=1
+
+    </select>
+
+    
+    <insert id="insertBusinessSystem" parameterType="SysBusinessSystem">
+ 		insert into sys_business_system(
+ 			<if test="sysId != null and sysId != 0">sys_id,</if>
+ 			<if test="sysName != null and sysName != 0">sys_name,</if>
+ 			<if test="sysCode != null and sysCode != ''">sys_code,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			<if test="createTime != null and createTime != ''">create_time,</if>
+ 			create_time
+ 		)values(
+ 			<if test="sysId != null and sysId != 0">#{sysId},</if>
+ 			<if test="sysName != null and sysName != 0">#{sysName},</if>
+ 			<if test="sysCode != null and sysCode != ''">#{sysCode},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+	
+	<update id="updateBusinessSystem" parameterType="SysBusinessSystem">
+ 		update sys_business_system
+ 		<set>
+			<if test="sysName != null and sysName != 0">sys_name= #{sysName},</if>
+			<if test="sysCode != null and sysCode != ''">sys_code = #{sysCode},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where sys_id = #{sysId}
+	</update>
+
+	
+	<delete id="deleteBusinessSystem" parameterType="Long">
+		delete from sys_business_system  where sys_id = #{sysId}
+	</delete>
+
+
+
+</mapper>