diff --git a/.gitignore b/.gitignore index ec29fd53..b022aa04 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,11 @@ nbdist/ *.xml.versionsBackup *.swp + !*/build/*.java !*/build/*.html !*/build/*.xml + + +**/pom.xml +**/bootstrap.yml \ No newline at end of file diff --git a/bin/run-auth.bat b/bin/run-auth.bat index 0d0952af..050c48c3 100644 --- a/bin/run-auth.bat +++ b/bin/run-auth.bat @@ -1,14 +1,14 @@ @echo off echo. -echo [信息] 使用Jar命令运行Auth工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Auth锟斤拷锟教★拷 echo. cd %~dp0 -cd ../ruoyi-auth/target +cd ../yanzhu-auth/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-auth.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-auth.jar cd bin pause \ No newline at end of file diff --git a/bin/run-gateway.bat b/bin/run-gateway.bat index e43d60bc..bb58985f 100644 --- a/bin/run-gateway.bat +++ b/bin/run-gateway.bat @@ -1,14 +1,14 @@ @echo off echo. -echo [信息] 使用Jar命令运行Gateway工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Gateway锟斤拷锟教★拷 echo. cd %~dp0 -cd ../ruoyi-gateway/target +cd ../yanzhu-gateway/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-gateway.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-gateway.jar cd bin pause \ No newline at end of file diff --git a/bin/run-modules-file.bat b/bin/run-modules-file.bat index 6d89c905..4db62b7a 100644 --- a/bin/run-modules-file.bat +++ b/bin/run-modules-file.bat @@ -1,14 +1,14 @@ @echo off echo. -echo [信息] 使用Jar命令运行Modules-File工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Modules-File锟斤拷锟教★拷 echo. cd %~dp0 -cd ../ruoyi-modules/ruoyi-file/target +cd ../yanzhu-modules/yanzhu-file/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-file.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-modules-file.jar cd bin pause \ No newline at end of file diff --git a/bin/run-modules-gen.bat b/bin/run-modules-gen.bat index 0a4c3905..7b9cea1b 100644 --- a/bin/run-modules-gen.bat +++ b/bin/run-modules-gen.bat @@ -1,6 +1,6 @@ @echo off echo. -echo [信息] 使用Jar命令运行Modules-Gen工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Modules-Gen锟斤拷锟教★拷 echo. cd %~dp0 @@ -8,7 +8,7 @@ cd ../ruoyi-modules/ruoyi-gen/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-gen.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-modules-gen.jar cd bin pause \ No newline at end of file diff --git a/bin/run-modules-job.bat b/bin/run-modules-job.bat index 443e59d0..fa88e955 100644 --- a/bin/run-modules-job.bat +++ b/bin/run-modules-job.bat @@ -1,6 +1,6 @@ @echo off echo. -echo [信息] 使用Jar命令运行Modules-Job工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Modules-Job锟斤拷锟教★拷 echo. cd %~dp0 @@ -8,7 +8,7 @@ cd ../ruoyi-modules/ruoyi-job/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-job.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-modules-job.jar cd bin pause \ No newline at end of file diff --git a/bin/run-modules-system.bat b/bin/run-modules-system.bat index 26db55e4..652a3aa2 100644 --- a/bin/run-modules-system.bat +++ b/bin/run-modules-system.bat @@ -1,14 +1,14 @@ @echo off echo. -echo [信息] 使用Jar命令运行Modules-System工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Modules-System锟斤拷锟教★拷 echo. cd %~dp0 -cd ../ruoyi-modules/ruoyi-system/target +cd ../yanzhu-modules/yanzhu-system/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-system.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-modules-system.jar cd bin pause \ No newline at end of file diff --git a/bin/run-monitor.bat b/bin/run-monitor.bat index 3e8e322b..17c42ffc 100644 --- a/bin/run-monitor.bat +++ b/bin/run-monitor.bat @@ -1,6 +1,6 @@ @echo off echo. -echo [信息] 使用Jar命令运行Monitor工程。 +echo [锟斤拷息] 使锟斤拷Jar锟斤拷锟斤拷锟斤拷锟斤拷Monitor锟斤拷锟教★拷 echo. cd %~dp0 @@ -8,7 +8,7 @@ cd ../ruoyi-visual/ruoyi-monitor/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-visual-monitor.jar +java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar yanzhu-visual-monitor.jar cd bin pause \ No newline at end of file diff --git a/bin/run.bat b/bin/run.bat new file mode 100644 index 00000000..dd01cd34 --- /dev/null +++ b/bin/run.bat @@ -0,0 +1,3 @@ +start bin\run-auth.bat +start bin\run-gateway.bat +start bin\run-modules-system.bat \ No newline at end of file diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java index b1719c19..58b7d625 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java @@ -109,6 +109,15 @@ public class SysUser extends BaseEntity }) private SysDept dept; + public SysDept getComp() { + return comp; + } + + public void setComp(SysDept comp) { + this.comp = comp; + } + + private SysDept comp; /** 瑙掕壊瀵硅薄 */ private List roles; diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BusTrainingVideo.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BusTrainingVideo.java index 2b870d11..8ab6e604 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BusTrainingVideo.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/BusTrainingVideo.java @@ -22,6 +22,16 @@ public class BusTrainingVideo extends BaseEntity @Excel(name = "閮ㄩ棬涓婚敭") private Long deptId; + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + private String deptName; + /** 椤圭洰涓婚敭 */ @Excel(name = "椤圭洰涓婚敭") private Long projectId; diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoMapper.xml index 46f211ab..a13ec1d8 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/BusTrainingVideoMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -27,7 +28,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, dept_id, project_id, train_title, train_type, train_level, craft_type, craft_post, train_file_type,ord, train_file_path, train_file_image, train_file_times, is_del, create_by, create_time, update_by, update_time, remark from bus_training_video + select bus_training_video.*,sys_dept.dept_name + from bus_training_video + left join sys_dept on bus_training_video.dept_id=sys_dept.dept_id diff --git a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/utils/FileUploadUtils.java b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/utils/FileUploadUtils.java index 742ac23e..0dd1649e 100644 --- a/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/utils/FileUploadUtils.java +++ b/yanzhu-modules/yanzhu-file/src/main/java/com/yanzhu/file/utils/FileUploadUtils.java @@ -4,6 +4,8 @@ import java.io.File; import java.io.IOException; import java.nio.file.Paths; import java.util.Objects; + +import com.yanzhu.common.core.utils.file.ImageUtils; import org.apache.commons.io.FilenameUtils; import org.springframework.web.multipart.MultipartFile; import com.yanzhu.common.core.exception.file.FileNameLengthLimitExceededException; @@ -80,6 +82,7 @@ public class FileUploadUtils String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath(); file.transferTo(Paths.get(absPath)); + return getPathFileName(fileName); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java index bbbd7b68..c86a8182 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java @@ -2,6 +2,10 @@ package com.yanzhu.manage.service.impl; import java.util.List; import com.yanzhu.common.core.utils.DateUtils; +import com.yanzhu.manage.domain.ProProjectInfoDepts; +import com.yanzhu.manage.domain.ProProjectInfoSetting; +import com.yanzhu.manage.mapper.ProProjectInfoDeptsMapper; +import com.yanzhu.manage.mapper.ProProjectInfoSettingMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.yanzhu.manage.mapper.ProProjectInfoMapper; @@ -19,7 +23,10 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService { @Autowired private ProProjectInfoMapper proProjectInfoMapper; - + @Autowired + private ProProjectInfoDeptsMapper deptsMapper; + @Autowired + private ProProjectInfoSettingMapper settingMapper; /** * 鏌ヨ椤圭洰淇℃伅 * @@ -67,6 +74,26 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService public int updateProProjectInfo(ProProjectInfo proProjectInfo) { proProjectInfo.setUpdateTime(DateUtils.getNowDate()); + List depts= proProjectInfo.getProjectDeptsList(); + if(depts!=null){ + depts.forEach(dept->{ + dept.setProjectId(proProjectInfo.getId()); + if(dept.getId()!=null){ + deptsMapper.updateProProjectInfoDepts(dept); + }else{ + deptsMapper.insertProProjectInfoDepts(dept); + } + }); + } + ProProjectInfoSetting setting= proProjectInfo.getSetting(); + if(setting!=null){ + setting.setProjectId(proProjectInfo.getId()); + if(setting.getId()!=null){ + settingMapper.updateProProjectInfoSetting(setting); + }else{ + settingMapper.insertProProjectInfoSetting(setting); + } + } return proProjectInfoMapper.updateProProjectInfo(proProjectInfo); } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysDeptController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysDeptController.java index 447f4215..85503c06 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysDeptController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysDeptController.java @@ -1,5 +1,6 @@ package com.yanzhu.system.controller; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -7,6 +8,7 @@ import com.yanzhu.common.core.constant.CacheConstants; import com.yanzhu.common.core.constant.Constants; import com.yanzhu.common.core.enums.IsDelEnums; import com.yanzhu.common.redis.service.RedisService; +import com.yanzhu.system.domain.vo.TreeSelect; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -159,4 +161,14 @@ public class SysDeptController extends BaseController redisService.setCacheObject(key,depts, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); return success(depts); } + @RequiresPermissions("system:dept:list") + @GetMapping("/deptTree") + public AjaxResult userDeptTree(){ + SysDept comp= SecurityUtils.getLoginUser().getSysUser().getComp(); + if(comp==null){ + return success(deptService.buildDeptTreeSelect(new ArrayList<>())); + } + List treeList = deptService.buildDeptTreeSelect(deptService.selectDeptListForComp(comp)); + return success(treeList); + } } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java index 8ae6ee78..5e6d664d 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java @@ -275,7 +275,7 @@ public class SysRoleController extends BaseController * @param deptId * @return */ - @GetMapping("/deptRole/{deptId}") + @GetMapping("/deptRole/{roleId}") public AjaxResult list(@PathVariable("roleId") Long deptId) { List list = roleService.findDeptRoleList(deptId); diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/vo/TreeSelect.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/vo/TreeSelect.java index ca1059b3..1e48bdf4 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/vo/TreeSelect.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/vo/TreeSelect.java @@ -23,6 +23,16 @@ public class TreeSelect implements Serializable /** 鑺傜偣鍚嶇О */ private String label; + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + private Object data; + /** 瀛愯妭鐐 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private List children; @@ -37,6 +47,7 @@ public class TreeSelect implements Serializable this.id = dept.getDeptId(); this.label = dept.getDeptName(); this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + this.data=dept; } public TreeSelect(SysMenu menu) @@ -44,6 +55,7 @@ public class TreeSelect implements Serializable this.id = menu.getMenuId(); this.label = menu.getMenuName(); this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + this.data=menu; } public TreeSelect(SysArea area) @@ -51,6 +63,7 @@ public class TreeSelect implements Serializable this.id = area.getId(); this.label = area.getCname(); this.children = area.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + this.data=area; } public Long getId() diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysDeptMapper.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysDeptMapper.java index 6c7dc7f0..fc2a45c7 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysDeptMapper.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysDeptMapper.java @@ -19,6 +19,11 @@ public interface SysDeptMapper */ public List selectDeptList(SysDept dept); + + /** + * 鏍规嵁deptId鏌ヨ姝D鍙婁笅闈㈢殑瀛愰」锛岀敤浜庢瀯寤烘爲 + */ + public List selectDeptListForComp(SysDept dept); /** * 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭 * diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysDeptService.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysDeptService.java index bb036296..a972d88e 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysDeptService.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysDeptService.java @@ -121,4 +121,8 @@ public interface ISysDeptService * @return 缁撴灉 */ public int deleteDeptById(Long deptId); + /** + * 鏍规嵁deptId鏌ヨ姝D鍙婁笅闈㈢殑瀛愰」锛岀敤浜庢瀯寤烘爲 + */ + List selectDeptListForComp(SysDept comp); } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysDeptServiceImpl.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysDeptServiceImpl.java index cd9000eb..cbbdb1fa 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysDeptServiceImpl.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysDeptServiceImpl.java @@ -293,6 +293,13 @@ public class SysDeptServiceImpl implements ISysDeptService { return deptMapper.deleteDeptById(deptId); } + /** + * 鏍规嵁deptId鏌ヨ姝D鍙婁笅闈㈢殑瀛愰」锛岀敤浜庢瀯寤烘爲 + */ + @Override + public List selectDeptListForComp(SysDept comp) { + return deptMapper.selectDeptListForComp(comp); + } /** * 閫掑綊鍒楄〃 diff --git a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml index 0f7e0c31..16d20708 100644 --- a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -56,7 +56,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ${params.dataScope} order by d.parent_id, d.order_num - +