diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AppLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AppLoginController.java index 486473d..d538c6c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AppLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AppLoginController.java @@ -1,19 +1,15 @@ package com.ruoyi.web.controller.common; -import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Validator; import com.ruoyi.bgt.service.IBgtUserService; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.Area; import com.ruoyi.common.core.domain.entity.BgtUser; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.AreaNodeRespVO; import com.ruoyi.common.core.domain.model.BgtLoginBody; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.util.DataUtil; -import com.ruoyi.common.utils.AreaUtils; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.framework.web.service.AppLoginService; import com.ruoyi.framework.web.service.SysPermissionService; @@ -137,14 +133,6 @@ public class AppLoginController return AjaxResult.success(data); } - @GetMapping("/tree") - @ApiOperation("获得地区树") - public AjaxResult> getAreaTree() { - Area area = AreaUtils.getArea(Area.ID_CHINA); - Assert.notNull(area, "获取不到中国"); - return AjaxResult.success(AreaUtils.toBean(area.getChildren(), AreaNodeRespVO.class)); - } - // /** // * 获取用户信息 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysAreaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysAreaController.java new file mode 100644 index 0000000..fd3b7cd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysAreaController.java @@ -0,0 +1,38 @@ +package com.ruoyi.web.controller.system; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.vo.SysAreaVO; +import com.ruoyi.system.service.ISysAreaService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 区域Controller + * + * @author ruoyi + * @date 2025-03-10 + */ +@Api(value = "区域控制器", tags = {"区域管理"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/system/area") +public class SysAreaController extends BaseController { + + private final ISysAreaService iSysAreaService; + + + @GetMapping("/tree") + @ApiOperation("获得地区树") + public AjaxResult> getAreaTree() { + return AjaxResult.success(iSysAreaService.getAllArea()); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/AreaNodeRespVO.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AreaNode.java similarity index 73% rename from ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/AreaNodeRespVO.java rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AreaNode.java index 94dc358..c7f8cbf 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/AreaNodeRespVO.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AreaNode.java @@ -1,4 +1,4 @@ -package com.ruoyi.common.core.domain.model; +package com.ruoyi.common.core.domain; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -8,7 +8,7 @@ import java.util.List; @ApiModel("地区节点 Response VO") @Data -public class AreaNodeRespVO { +public class AreaNode { @ApiModelProperty("编号") private Integer id; @@ -19,6 +19,6 @@ public class AreaNodeRespVO { /** * 子节点 */ - private List children; + private List children; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/AreaUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/AreaUtils.java index 0468c73..85bd660 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/AreaUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/AreaUtils.java @@ -1,20 +1,8 @@ package com.ruoyi.common.utils; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.io.resource.ResourceUtil; -import cn.hutool.core.lang.Assert; -import cn.hutool.core.text.csv.CsvRow; -import cn.hutool.core.text.csv.CsvUtil; -import com.ruoyi.common.core.domain.Area; -import com.ruoyi.common.enums.AreaType; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - /** * 区域工具类 * @@ -24,167 +12,167 @@ import java.util.stream.Collectors; @Component public class AreaUtils { - /** - * 初始化 SEARCHER - */ - @SuppressWarnings("InstantiationOfUtilityClass") - private final static AreaUtils INSTANCE = new AreaUtils(); - - /** - * Area 内存缓存,提升访问速度 - */ - private static Map areas; - - private AreaUtils() { - long now = System.currentTimeMillis(); - areas = new HashMap<>(); - areas.put(Area.ID_GLOBAL, new Area(Area.ID_GLOBAL, "全球", 0, null, new ArrayList<>())); - - try { - List rows = CsvUtil.getReader().read(ResourceUtil.getUtf8Reader("area.csv")).getRows(); - if (!rows.isEmpty()) { - rows.remove(0); // 删除 header - for (CsvRow row : rows) { - // 创建 Area 对象 - Area area = new Area(Integer.valueOf(row.get(0)), row.get(1), Integer.valueOf(row.get(2)), - null, new ArrayList<>()); - // 添加到 areas 中 - areas.put(area.getId(), area); - - // 构建父子关系 - int parentId = Integer.valueOf(row.get(3)); - Area parent = areas.get(parentId); - if (parent != null) { - Assert.isTrue(area != parent, "{}:父子节点相同", area.getName()); - area.setParent(parent); - parent.getChildren().add(area); - } else { - log.warn("区域 {} 的父区域 ID {} 无效", area.getName(), parentId); - } - } - } - } catch (Exception e) { - log.error("加载区域数据时发生错误", e); - } - - log.info("启动加载 AreaUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now); - } - - /** - * 获得指定编号对应的区域 - * - * @param id 区域编号 - * @return 区域 - */ - public static Area getArea(Integer id) { - return areas.get(id); - } - - - - /** - * 获取所有节点的全路径名称如:河南省/石家庄市/新华区 - * - * @param areas 地区树 - * @return 所有节点的全路径名称 - */ - public static List getAreaNodePathList(List areas) { - List paths = new ArrayList<>(); - areas.forEach(area -> getAreaNodePathList(area, "", paths)); - return paths; - } - - /** - * 构建一棵树的所有节点的全路径名称,并将其存储为 "祖先/父级/子级" 的形式 - * - * @param node 父节点 - * @param path 全路径名称 - * @param paths 全路径名称列表,省份/城市/地区 - */ - private static void getAreaNodePathList(Area node, String path, List paths) { - if (node == null) { - return; - } - // 构建当前节点的路径 - String currentPath = path.isEmpty() ? node.getName() : path + "/" + node.getName(); - paths.add(currentPath); - // 递归遍历子节点 - for (Area child : node.getChildren()) { - getAreaNodePathList(child, currentPath, paths); - } - } - - /** - * 格式化区域 - * - * @param id 区域编号 - * @return 格式化后的区域 - */ - public static String format(Integer id) { - return format(id, " "); - } - - /** - * 格式化区域 - * - * 例如说: - * 1. id = “静安区”时:上海 上海市 静安区 - * 2. id = “上海市”时:上海 上海市 - * 3. id = “上海”时:上海 - * 4. id = “美国”时:美国 - * 当区域在中国时,默认不显示中国 - * - * @param id 区域编号 - * @param separator 分隔符 - * @return 格式化后的区域 - */ - public static String format(Integer id, String separator) { - // 获得区域 - Area area = areas.get(id); - if (area == null) { - return null; - } - - // 格式化 - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < AreaType.values().length; i++) { // 避免死循环 - sb.insert(0, area.getName()); - // “递归”父节点 - area = area.getParent(); - if (area == null - || - AreaType.getSkipType().contains(area.getId())) { // 跳过父节点为中国的情况 - break; - } - sb.insert(0, separator); - } - return sb.toString(); - } - - - - public static AreaUtils getInstance() { - return INSTANCE; - } - - public static List toBean(List source, Class targetType) { - if (source == null) { - return null; - } - return convertList(source, s -> toBean(s, targetType)); - } - - public static T toBean(Object source, Class targetClass) { - return BeanUtil.toBean(source, targetClass); - } - - public static List convertList(Collection from, Function func) { - if (CollUtil.isEmpty(from)) { - return new ArrayList<>(); - } - return from.stream().map(func).filter(Objects::nonNull).collect(Collectors.toList()); - } - +// /** +// * 初始化 SEARCHER +// */ +// @SuppressWarnings("InstantiationOfUtilityClass") +// private final static AreaUtils INSTANCE = new AreaUtils(); +// +// /** +// * Area 内存缓存,提升访问速度 +// */ +// private static Map areas; +// +// private AreaUtils() { +// long now = System.currentTimeMillis(); +// areas = new HashMap<>(); +// areas.put(Area.ID_GLOBAL, new Area(Area.ID_GLOBAL, "全球", 0, null, new ArrayList<>())); +// +// try { +// List rows = CsvUtil.getReader().read(ResourceUtil.getUtf8Reader("area.csv")).getRows(); +// if (!rows.isEmpty()) { +// rows.remove(0); // 删除 header +// for (CsvRow row : rows) { +// // 创建 Area 对象 +// Area area = new Area(Integer.valueOf(row.get(0)), row.get(1), Integer.valueOf(row.get(2)), +// null, new ArrayList<>()); +// // 添加到 areas 中 +// areas.put(area.getId(), area); +// +// // 构建父子关系 +// int parentId = Integer.valueOf(row.get(3)); +// Area parent = areas.get(parentId); +// if (parent != null) { +// Assert.isTrue(area != parent, "{}:父子节点相同", area.getName()); +// area.setParent(parent); +// parent.getChildren().add(area); +// } else { +// log.warn("区域 {} 的父区域 ID {} 无效", area.getName(), parentId); +// } +// } +// } +// } catch (Exception e) { +// log.error("加载区域数据时发生错误", e); +// } +// +// log.info("启动加载 AreaUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now); +// } +// +// /** +// * 获得指定编号对应的区域 +// * +// * @param id 区域编号 +// * @return 区域 +// */ +// public static Area getArea(Integer id) { +// return areas.get(id); +// } +// +// +// +// /** +// * 获取所有节点的全路径名称如:河南省/石家庄市/新华区 +// * +// * @param areas 地区树 +// * @return 所有节点的全路径名称 +// */ +// public static List getAreaNodePathList(List areas) { +// List paths = new ArrayList<>(); +// areas.forEach(area -> getAreaNodePathList(area, "", paths)); +// return paths; +// } +// +// /** +// * 构建一棵树的所有节点的全路径名称,并将其存储为 "祖先/父级/子级" 的形式 +// * +// * @param node 父节点 +// * @param path 全路径名称 +// * @param paths 全路径名称列表,省份/城市/地区 +// */ +// private static void getAreaNodePathList(Area node, String path, List paths) { +// if (node == null) { +// return; +// } +// // 构建当前节点的路径 +// String currentPath = path.isEmpty() ? node.getName() : path + "/" + node.getName(); +// paths.add(currentPath); +// // 递归遍历子节点 +// for (Area child : node.getChildren()) { +// getAreaNodePathList(child, currentPath, paths); +// } +// } +// +// /** +// * 格式化区域 +// * +// * @param id 区域编号 +// * @return 格式化后的区域 +// */ +// public static String format(Integer id) { +// return format(id, " "); +// } +// +// /** +// * 格式化区域 +// * +// * 例如说: +// * 1. id = “静安区”时:上海 上海市 静安区 +// * 2. id = “上海市”时:上海 上海市 +// * 3. id = “上海”时:上海 +// * 4. id = “美国”时:美国 +// * 当区域在中国时,默认不显示中国 +// * +// * @param id 区域编号 +// * @param separator 分隔符 +// * @return 格式化后的区域 +// */ +// public static String format(Integer id, String separator) { +// // 获得区域 +// Area area = areas.get(id); +// if (area == null) { +// return null; +// } +// +// // 格式化 +// StringBuilder sb = new StringBuilder(); +// for (int i = 0; i < AreaType.values().length; i++) { // 避免死循环 +// sb.insert(0, area.getName()); +// // “递归”父节点 +// area = area.getParent(); +// if (area == null +// || +// AreaType.getSkipType().contains(area.getId())) { // 跳过父节点为中国的情况 +// break; +// } +// sb.insert(0, separator); +// } +// return sb.toString(); +// } +// +// +// +// public static AreaUtils getInstance() { +// return INSTANCE; +// } +// +// public static List toBean(List source, Class targetType) { +// if (source == null) { +// return null; +// } +// return convertList(source, s -> toBean(s, targetType)); +// } +// +// public static T toBean(Object source, Class targetClass) { +// return BeanUtil.toBean(source, targetClass); +// } +// +// public static List convertList(Collection from, Function func) { +// if (CollUtil.isEmpty(from)) { +// return new ArrayList<>(); +// } +// return from.stream().map(func).filter(Objects::nonNull).collect(Collectors.toList()); +// } +// } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 01e2a14..2caa253 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -101,7 +101,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/app/login", "/captchaImage","/demo/tress/all","/test","/testGet").anonymous() + .antMatchers("/login", "/app/login", "/captchaImage","/demo/tress/all").anonymous() .antMatchers("/app/login","/wgz/app/wgzRegister").permitAll() .antMatchers( HttpMethod.GET, diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtProjectRecruitApplyVO.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtProjectRecruitApplyVO.java index 4a93127..022be1a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtProjectRecruitApplyVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtProjectRecruitApplyVO.java @@ -54,6 +54,9 @@ public class BgtProjectRecruitApplyVO implements Serializable { @ApiModelProperty("工种") private String typeOfWork; + @ApiModelProperty("身份证号") + private String identityCard; + @ApiModelProperty("招工ID") private Long recruitId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java index 04319ce..a139ee8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java @@ -36,7 +36,6 @@ import com.ruoyi.wgz.domain.WgzUser; import com.ruoyi.wgz.service.IWgzMessageService; import com.ruoyi.wgz.service.IWgzScoreRecordService; import com.ruoyi.wgz.service.IWgzUserService; -import com.ruoyi.wgz.service.impl.WgzMessageServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; @@ -224,6 +223,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_SIGN_UP, true); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(recruitApply.getUserId()) .setHeadline(map.get(HEADLINE)) @@ -367,6 +367,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_EXIT, true); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(recruitApply.getUserId()) .setHeadline(map.get(HEADLINE)) @@ -395,6 +396,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_CANSEL, true); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(recruitApply.getUserId()) .setHeadline(map.get(HEADLINE)) @@ -432,6 +434,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_EXIT, false); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(vo.getUserId()) .setHeadline(map.get(HEADLINE)) diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/AppTaskVO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/AppTaskVO.java index 389219e..2171002 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/AppTaskVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/AppTaskVO.java @@ -50,6 +50,9 @@ public class AppTaskVO { @ApiModelProperty("项目名") private String projectName; + @ApiModelProperty("任务图片") + private String taskImg; + @ApiModelProperty("任务开始时间") private String taskBeginTime; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysArea.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysArea.java new file mode 100644 index 0000000..33a4401 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysArea.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 区域对象 sys_area + * + * @author ruoyi + * @date 2025-03-10 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@TableName("sys_area") +@ApiModel("区域视图对象") +public class SysArea implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty("编码") + private Integer adCode; + + @ApiModelProperty("父编码") + private Integer parentId; + + @ApiModelProperty("城市代码") + private String cityCode; + + @ApiModelProperty("级别") + private String level; + + @ApiModelProperty("名字") + private String name; + + @ApiModelProperty("坐标") + private String center; + + @ApiModelProperty("是否最后") + private String isLast; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysAreaVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysAreaVO.java new file mode 100644 index 0000000..8877573 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysAreaVO.java @@ -0,0 +1,44 @@ +package com.ruoyi.system.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 区域对象 sys_area + * + * @author ruoyi + * @date 2025-03-10 + */ +@Data +public class SysAreaVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty("编码") + private Integer adCode; + + @ApiModelProperty("父编码") + private Integer parentId; + + @ApiModelProperty("城市代码") + private String cityCode; + + @ApiModelProperty("级别") + private String level; + + @ApiModelProperty("名字") + private String name; + + @ApiModelProperty("坐标") + private String center; + + @ApiModelProperty("是否最后") + private String isLast; + + @ApiModelProperty("子集") + private List children; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysAreaMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysAreaMapper.java new file mode 100644 index 0000000..34da041 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysAreaMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.SysArea; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; +import org.apache.ibatis.annotations.CacheNamespace; + +/** + * 区域Mapper接口 + * + * @author ruoyi + * @date 2025-03-10 + */ +// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象 +@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) +public interface SysAreaMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysAreaService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysAreaService.java new file mode 100644 index 0000000..0ca1570 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysAreaService.java @@ -0,0 +1,20 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.system.domain.SysArea; +import com.ruoyi.system.domain.vo.SysAreaVO; + +import java.util.List; + +/** + * 区域Service接口 + * + * @author ruoyi + * @date 2025-03-10 + */ +public interface ISysAreaService extends IServicePlus { + + + List getAllArea(); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysAreaServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysAreaServiceImpl.java new file mode 100644 index 0000000..a9c5aae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysAreaServiceImpl.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.ruoyi.system.domain.SysArea; +import com.ruoyi.system.domain.vo.SysAreaVO; +import com.ruoyi.system.mapper.SysAreaMapper; +import com.ruoyi.system.service.ISysAreaService; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 区域Service业务层处理 + * + * @author ruoyi + * @date 2025-03-10 + */ +@Service +public class SysAreaServiceImpl extends ServicePlusImpl implements ISysAreaService { + + @Override + public List getAllArea() { + List list = list(Wrappers.lambdaQuery().ne(SysArea::getAdCode, 10000).orderByAsc(SysArea::getAdCode)); + return buildTree(list); + } + + + // 构建树形结构 + public static List buildTree(List areas) { + // 用于快速查找每个节点 + Map areaMap = new HashMap<>(); + List rootNodes = new ArrayList<>(); + + // 先将所有 SysArea 转换为 SysAreaVO 并存储到 map 中 + for (SysArea area : areas) { + SysAreaVO vo = BeanUtil.copyProperties(area, SysAreaVO.class); + areaMap.put(vo.getAdCode(), vo); + } + + // 构建树形结构 + for (SysArea area : areas) { + Integer adCode = area.getAdCode(); + Integer parentId = area.getParentId(); + SysAreaVO currentVO = areaMap.get(adCode); + + if (parentId == 100000) { + // 顶级节点 + rootNodes.add(currentVO); + } else { + // 非顶级节点,找到其父节点并添加到父节点的 children 列表中 + SysAreaVO parentVO = areaMap.get(parentId); + if (parentVO != null) { + if (parentVO.getChildren() == null) { + parentVO.setChildren(new ArrayList<>()); + } + parentVO.getChildren().add(currentVO); + } + } + } + + return rootNodes; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzLeaveServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzLeaveServiceImpl.java index 753a7da..b689127 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzLeaveServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzLeaveServiceImpl.java @@ -224,6 +224,7 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_LEAVE, AuditStatus.PASS.getCode().equals(dto.getAuditorType())); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(wgzLeave.getUserId()) .setHeadline(map.get(HEADLINE)) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java index 5576098..0e41a72 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java @@ -290,6 +290,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_PAY, AuditStatus.PASS.getCode().equals(dto.getAuditorType())); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(payCalculation.getUserId()) .setHeadline(map.get(HEADLINE)) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java index 74ec327..d0b2fcc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java @@ -274,6 +274,7 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl map = bgtMessage(mp, BGT_TYPE_MAKE_UP, true); WgzMessage wgzMessage = new WgzMessage() .setSenderType(USERTYPE_BGT) + .setSenderId(SecurityUtils.getAppUserId()) .setRecipientType(USERTYPE_WGZ) .setRecipientId(byId.getUserId()) .setHeadline(map.get(HEADLINE)) diff --git a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml index 3f6e0b8..dc5128a 100644 --- a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml @@ -208,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wu.score, wu.avatar_name, wu.username, + wu.identity_card, bpra.status, wu.type_of_work, bpr.recruit_name, diff --git a/ruoyi-system/src/main/resources/mapper/fbs/FbsProjectTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/fbs/FbsProjectTaskMapper.xml index aa8fde1..1adb5b4 100644 --- a/ruoyi-system/src/main/resources/mapper/fbs/FbsProjectTaskMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/fbs/FbsProjectTaskMapper.xml @@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" fpt.section_id, fpt.sub_id, fpt.task_name, + fpt.task_img, fpt.task_staff_num, fpt.task_amount, fpt.task_begin_time, diff --git a/ruoyi/uploadPath/appResource/taskDefault.png b/ruoyi/uploadPath/appResource/taskDefault.png new file mode 100644 index 0000000..c5a7a96 Binary files /dev/null and b/ruoyi/uploadPath/appResource/taskDefault.png differ