优化
This commit is contained in:
@ -54,6 +54,9 @@ public class BgtProjectRecruitApplyVO implements Serializable {
|
||||
@ApiModelProperty("工种")
|
||||
private String typeOfWork;
|
||||
|
||||
@ApiModelProperty("身份证号")
|
||||
private String identityCard;
|
||||
|
||||
@ApiModelProperty("招工ID")
|
||||
private Long recruitId;
|
||||
|
||||
|
@ -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<BgtProjec
|
||||
Map<String, String> 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<BgtProjec
|
||||
Map<String, String> 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<BgtProjec
|
||||
Map<String, String> 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<BgtProjec
|
||||
Map<String, String> 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))
|
||||
|
@ -50,6 +50,9 @@ public class AppTaskVO {
|
||||
@ApiModelProperty("项目名")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("任务图片")
|
||||
private String taskImg;
|
||||
|
||||
@ApiModelProperty("任务开始时间")
|
||||
private String taskBeginTime;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -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<SysAreaVO> children;
|
||||
|
||||
}
|
@ -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<SysArea> {
|
||||
|
||||
}
|
@ -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<SysArea> {
|
||||
|
||||
|
||||
List<SysAreaVO> getAllArea();
|
||||
|
||||
}
|
@ -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<SysAreaMapper, SysArea> implements ISysAreaService {
|
||||
|
||||
@Override
|
||||
public List<SysAreaVO> getAllArea() {
|
||||
List<SysArea> list = list(Wrappers.<SysArea>lambdaQuery().ne(SysArea::getAdCode, 10000).orderByAsc(SysArea::getAdCode));
|
||||
return buildTree(list);
|
||||
}
|
||||
|
||||
|
||||
// 构建树形结构
|
||||
public static List<SysAreaVO> buildTree(List<SysArea> areas) {
|
||||
// 用于快速查找每个节点
|
||||
Map<Integer, SysAreaVO> areaMap = new HashMap<>();
|
||||
List<SysAreaVO> 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;
|
||||
}
|
||||
}
|
@ -224,6 +224,7 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
||||
Map<String, String> 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))
|
||||
|
@ -290,6 +290,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
Map<String, String> 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))
|
||||
|
@ -274,6 +274,7 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
|
||||
Map<String, String> 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))
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user