Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-09-28 12:22:38 +08:00
93 changed files with 1214 additions and 2032 deletions

View File

@@ -7,7 +7,7 @@ JAR_PATH=${DES_PATH}/ruoyi-admin/target/ruoyi-admin.jar
LOG_PATH=${DES_PATH}/logs
LOG_FILE=${LOG_PATH}/backend.log
BACK_LOG=${LOG_PATH}/back/backend-info.log
MODEL_NAME=backend
MODEL_NAME=${JAR_PATH}
PROFILE=dev
# JVM配置
@@ -32,37 +32,77 @@ __red() {
}
__kill() {
local process_name=$1
PID=$(ps -ef | grep "${process_name}.jar" | grep -v grep | awk '{print $2}' | xargs)
local jar_path="$1"
local sleep_seconds=10
local cur_sleep_second=1
local pids=()
if [[ -z "$PID" ]]; then
__green "进程 ${process_name} 未运行"
# 使用临时文件或直接遍历 jps 输出(避免进程替换)
jps -l 2>/dev/null | while read -r pid main_class; do
if [ "$main_class" = "$jar_path" ]; then
echo "$pid"
fi
done > /tmp/ruoyi_pids.$$
# 读取匹配的 PID 到数组(在当前 shell 中)
while IFS= read -r pid; do
[ -n "$pid" ] && pids+=("$pid")
done < /tmp/ruoyi_pids.$$
# 清理临时文件
rm -f /tmp/ruoyi_pids.$$
if [ ${#pids[@]} -eq 0 ]; then
__green "未找到运行中的进程: $jar_path"
return 0
fi
while [[ -n "$PID" && "$sleep_seconds" -ge "$cur_sleep_second" ]]; do
__green "尝试kill PID: ${PID}"
__green "找到 ${#pids[@]} 个匹配进程: ${pids[*]}"
if [ "$sleep_seconds" -eq "$cur_sleep_second" ]; then
__red "强制关闭: ${cur_sleep_second}"
kill -9 $PID >> /dev/null 2>&1
else
kill $PID >> /dev/null 2>&1
fi
__green "停止程序计时: ${cur_sleep_second}"
sleep 1
cur_sleep_second="$(_math "$cur_sleep_second" + 1)"
PID=$(ps -ef | grep "${process_name}.jar" | grep -v grep | awk '{print $2}' | xargs)
# 发送 SIGTERM
for pid in "${pids[@]}"; do
__green "发送 SIGTERM 到 PID: $pid"
kill "$pid" >/dev/null 2>&1
done
if [[ -n "$PID" ]]; then
__red "无法停止进程 ${process_name}, PID: ${PID}"
# 等待退出
while [ $cur_sleep_second -le $sleep_seconds ]; do
remaining=()
for pid in "${pids[@]}"; do
if kill -0 "$pid" 2>/dev/null; then
remaining+=("$pid")
fi
done
if [ ${#remaining[@]} -eq 0 ]; then
__green "所有进程已成功停止"
return 0
fi
__green "等待进程退出... (${cur_sleep_second}/${sleep_seconds} 秒)"
sleep 1
cur_sleep_second=$((cur_sleep_second + 1))
done
# 强制 kill -9
__red "优雅关闭超时,强制终止剩余进程: ${remaining[*]}"
for pid in "${remaining[@]}"; do
kill -9 "$pid" 2>/dev/null
done
# 检查是否还有存活
still_alive=()
for pid in "${remaining[@]}"; do
if kill -0 "$pid" 2>/dev/null; then
still_alive+=("$pid")
fi
done
if [ ${#still_alive[@]} -gt 0 ]; then
__red "无法终止进程: ${still_alive[*]}"
return 1
else
__green "进程 ${process_name} 已成功停止"
__green "所有进程已强制终止"
return 0
fi
}

View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-abuwx</artifactId>
<description>微信小程序</description>
<dependencies>
<!-- 通用工具 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<!-- 通用工具 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.31</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,104 +0,0 @@
package com.ruoyi.abuwx.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.abuwx.domain.AbucoderWxuser;
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 微信用户Controller
*
* @author 阿卜Coder QQ932696181
* @date 2022-06-26
*/
@RestController
@RequestMapping("/abuwx/wxuser")
public class AbucoderWxuserController extends BaseController
{
@Autowired
private IAbucoderWxuserService abucoderWxuserService;
/**
* 查询微信用户列表
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:list')")
@GetMapping("/list")
public TableDataInfo list(AbucoderWxuser abucoderWxuser)
{
startPage();
List<AbucoderWxuser> list = abucoderWxuserService.selectAbucoderWxuserList(abucoderWxuser);
return getDataTable(list);
}
/**
* 导出微信用户列表
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:export')")
@Log(title = "微信用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AbucoderWxuser abucoderWxuser)
{
List<AbucoderWxuser> list = abucoderWxuserService.selectAbucoderWxuserList(abucoderWxuser);
ExcelUtil<AbucoderWxuser> util = new ExcelUtil<AbucoderWxuser>(AbucoderWxuser.class);
util.exportExcel(response, list, "微信用户数据");
}
/**
* 获取微信用户详细信息
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(abucoderWxuserService.selectAbucoderWxuserById(id));
}
/**
* 新增微信用户
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:add')")
@Log(title = "微信用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AbucoderWxuser abucoderWxuser)
{
return toAjax(abucoderWxuserService.insertAbucoderWxuser(abucoderWxuser));
}
/**
* 修改微信用户
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:edit')")
@Log(title = "微信用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AbucoderWxuser abucoderWxuser)
{
return toAjax(abucoderWxuserService.updateAbucoderWxuser(abucoderWxuser));
}
/**
* 删除微信用户
*/
@PreAuthorize("@ss.hasPermi('abuwx:wxuser:remove')")
@Log(title = "微信用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(abucoderWxuserService.deleteAbucoderWxuserByIds(ids));
}
}

View File

@@ -1,30 +0,0 @@
package com.ruoyi.abuwx.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@Data
public class AbucoderWxuser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 微信名称 */
@Excel(name = "微信名称")
private String nickname;
/** 头像 */
@Excel(name = "头像")
private String avatar;
/** OpenID */
@Excel(name = "OpenID")
private String openid;
/** 性别 */
@Excel(name = "性别")
private Integer gender;
}

View File

@@ -1,68 +0,0 @@
package com.ruoyi.abuwx.mapper;
import java.util.List;
import com.ruoyi.abuwx.domain.AbucoderWxuser;
/**
* 微信用户Mapper接口
*
* @author 阿卜Coder QQ932696181
* @date 2022-06-26
*/
public interface AbucoderWxuserMapper
{
/**
* 查询微信用户
*
* @param id 微信用户主键
* @return 微信用户
*/
public AbucoderWxuser selectAbucoderWxuserById(Long id);
/**
* 查询微信用户列表
*
* @param abucoderWxuser 微信用户
* @return 微信用户集合
*/
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser);
/**
* 新增微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser);
/**
* 修改微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser);
/**
* 删除微信用户
*
* @param id 微信用户主键
* @return 结果
*/
public int deleteAbucoderWxuserById(Long id);
/**
* 批量删除微信用户
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAbucoderWxuserByIds(Long[] ids);
/**
* 通过OpenID查询微信用户信息
* @param openid
* @return
*/
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid);
}

View File

@@ -1,68 +0,0 @@
package com.ruoyi.abuwx.service;
import java.util.List;
import com.ruoyi.abuwx.domain.AbucoderWxuser;
/**
* 微信用户Service接口
*
* @author 阿卜Coder QQ932696181
* @date 2022-06-26
*/
public interface IAbucoderWxuserService
{
/**
* 查询微信用户
*
* @param id 微信用户主键
* @return 微信用户
*/
public AbucoderWxuser selectAbucoderWxuserById(Long id);
/**
* 查询微信用户列表
*
* @param abucoderWxuser 微信用户
* @return 微信用户集合
*/
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser);
/**
* 新增微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser);
/**
* 修改微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser);
/**
* 批量删除微信用户
*
* @param ids 需要删除的微信用户主键集合
* @return 结果
*/
public int deleteAbucoderWxuserByIds(Long[] ids);
/**
* 删除微信用户信息
*
* @param id 微信用户主键
* @return 结果
*/
public int deleteAbucoderWxuserById(Long id);
/**
* 通过OpenID查询微信用户信息
* @param openid
* @return
*/
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid);
}

View File

@@ -1,106 +0,0 @@
package com.ruoyi.abuwx.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.abuwx.mapper.AbucoderWxuserMapper;
import com.ruoyi.abuwx.domain.AbucoderWxuser;
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
/**
* 微信用户Service业务层处理
*
* @author 阿卜Coder QQ932696181
* @date 2022-06-26
*/
@Service
public class AbucoderWxuserServiceImpl implements IAbucoderWxuserService
{
@Autowired
private AbucoderWxuserMapper abucoderWxuserMapper;
/**
* 查询微信用户
*
* @param id 微信用户主键
* @return 微信用户
*/
@Override
public AbucoderWxuser selectAbucoderWxuserById(Long id)
{
return abucoderWxuserMapper.selectAbucoderWxuserById(id);
}
/**
* 查询微信用户列表
*
* @param abucoderWxuser 微信用户
* @return 微信用户
*/
@Override
public List<AbucoderWxuser> selectAbucoderWxuserList(AbucoderWxuser abucoderWxuser)
{
return abucoderWxuserMapper.selectAbucoderWxuserList(abucoderWxuser);
}
/**
* 新增微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
@Override
public int insertAbucoderWxuser(AbucoderWxuser abucoderWxuser)
{
abucoderWxuser.setCreateTime(DateUtils.getNowDate());
return abucoderWxuserMapper.insertAbucoderWxuser(abucoderWxuser);
}
/**
* 修改微信用户
*
* @param abucoderWxuser 微信用户
* @return 结果
*/
@Override
public int updateAbucoderWxuser(AbucoderWxuser abucoderWxuser)
{
abucoderWxuser.setUpdateTime(DateUtils.getNowDate());
return abucoderWxuserMapper.updateAbucoderWxuser(abucoderWxuser);
}
/**
* 批量删除微信用户
*
* @param ids 需要删除的微信用户主键
* @return 结果
*/
@Override
public int deleteAbucoderWxuserByIds(Long[] ids)
{
return abucoderWxuserMapper.deleteAbucoderWxuserByIds(ids);
}
/**
* 删除微信用户信息
*
* @param id 微信用户主键
* @return 结果
*/
@Override
public int deleteAbucoderWxuserById(Long id)
{
return abucoderWxuserMapper.deleteAbucoderWxuserById(id);
}
/**
* 通过OpenID查询微信用户信息
* @param openid
* @return
*/
@Override
public AbucoderWxuser selectAbucoderWxuserOpenID(String openid) {
return abucoderWxuserMapper.selectAbucoderWxuserOpenID(openid);
}
}

View File

@@ -1,129 +0,0 @@
package com.ruoyi.abuwxapi;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.abuwx.domain.AbucoderWxuser;
import com.ruoyi.abuwx.service.IAbucoderWxuserService;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/wxapi/")
public class WxLoginController {
private static final Logger log = LoggerFactory.getLogger(WxLoginController.class);
@Autowired
private IAbucoderWxuserService iAbucoderWxuserService;
@Autowired
private ServerConfig serverConfig;
/**
* 你自己的微信小程序APPID
*/
private final static String AppID = "你自己的微信小程序APPID";
/**
* 你自己的微信APP密钥
*/
private final static String AppSecret = "你自己的微信APP密钥";
/**
* 登录时获取的 code微信官方提供的临时凭证
* @param object
* @return
*/
@PostMapping("/wxlogin")
public AjaxResult wxLogin(@RequestBody JSONObject object){
//微信官方提供的微信小程序登录授权时使用的URL地址
String url = "https://api.weixin.qq.com/sns/jscode2session";
log.info("微信登录,传入参数:"+object);
/**
* 拼接需要的参数
* appid = AppID 你自己的微信小程序APPID
* js_code = AppSecret 你自己的微信APP密钥
* grant_type=authorization_code = code 微信官方提供的临时凭证
*/
String params = StrUtil.format("appid={}&secret={}&js_code={}&grant_type=authorization_code", AppID, AppSecret, object.get("code"));
//开始发起网络请求,若依管理系统自带网络请求工具,直接使用即可
String res = HttpUtils.sendGet(url,params);
JSONObject jsonObject = JSON.parseObject(res);
String openid = (String) jsonObject.get("openid");
if (StrUtil.isEmpty(openid)) {
return AjaxResult.error("未获取到openid");
}
/**先通过openid来查询是否存在*/
AbucoderWxuser abucoderWxuser = iAbucoderWxuserService.selectAbucoderWxuserOpenID(openid);
if (abucoderWxuser == null){
/**如果不存在就插入到我们的数据库里*/
AbucoderWxuser wxuser = new AbucoderWxuser();
wxuser.setOpenid(openid);
wxuser.setCreateTime(DateUtils.getNowDate());
iAbucoderWxuserService.insertAbucoderWxuser(wxuser);
/**返回结果集到前段*/
return AjaxResult.success(wxuser);
}else {
/**返回结果集到前段*/
return AjaxResult.success(abucoderWxuser);
}
}
@PostMapping("/upload")
@ResponseBody
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
System.out.println(file);
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
* 保存昵称与头像信息到用户信息里
* @param object
* @return
*/
@PostMapping("/saveUserInfo")
@ResponseBody
public AjaxResult saveUserInfo(@RequestBody JSONObject object){
System.out.println(object);
AbucoderWxuser abucoderWxuser = iAbucoderWxuserService.selectAbucoderWxuserOpenID(String.valueOf(object.get("openid")));
if (StringUtils.hasLength(String.valueOf(object.get("nickName")))){
abucoderWxuser.setNickname(String.valueOf(object.get("nickName")));
abucoderWxuser.setCreateBy(String.valueOf(object.get("nickName")));
}
if (StringUtils.hasLength(String.valueOf(object.get("avatarUrl")))){
abucoderWxuser.setAvatar(String.valueOf(object.get("avatarUrl")));
}
abucoderWxuser.setUpdateTime(DateUtils.getNowDate());
iAbucoderWxuserService.updateAbucoderWxuser(abucoderWxuser);
//返回前段需要的数据
return AjaxResult.success(abucoderWxuser);
}
}

View File

@@ -1,83 +0,0 @@
<?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.ruoyi.abuwx.mapper.AbucoderBannersMapper">
<resultMap type="AbucoderBanners" id="AbucoderBannersResult">
<result property="id" column="id" />
<result property="bannerTitle" column="banner_title" />
<result property="bannerUrl" column="banner_url" />
<result property="bannerImg" column="banner_img" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAbucoderBannersVo">
select id, banner_title, banner_url, banner_img, create_by, create_time, update_by, update_time, remark from abucoder_banners
</sql>
<select id="selectAbucoderBannersList" parameterType="AbucoderBanners" resultMap="AbucoderBannersResult">
<include refid="selectAbucoderBannersVo"/>
<where>
</where>
</select>
<select id="selectAbucoderBannersById" parameterType="Long" resultMap="AbucoderBannersResult">
<include refid="selectAbucoderBannersVo"/>
where id = #{id}
</select>
<insert id="insertAbucoderBanners" parameterType="AbucoderBanners" useGeneratedKeys="true" keyProperty="id">
insert into abucoder_banners
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bannerTitle != null">banner_title,</if>
<if test="bannerUrl != null">banner_url,</if>
<if test="bannerImg != null">banner_img,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bannerTitle != null">#{bannerTitle},</if>
<if test="bannerUrl != null">#{bannerUrl},</if>
<if test="bannerImg != null">#{bannerImg},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAbucoderBanners" parameterType="AbucoderBanners">
update abucoder_banners
<trim prefix="SET" suffixOverrides=",">
<if test="bannerTitle != null">banner_title = #{bannerTitle},</if>
<if test="bannerUrl != null">banner_url = #{bannerUrl},</if>
<if test="bannerImg != null">banner_img = #{bannerImg},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAbucoderBannersById" parameterType="Long">
delete from abucoder_banners where id = #{id}
</delete>
<delete id="deleteAbucoderBannersByIds" parameterType="String">
delete from abucoder_banners where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -1,84 +0,0 @@
<?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.ruoyi.abuwx.mapper.AbucoderItemsMapper">
<resultMap type="AbucoderItems" id="AbucoderItemsResult">
<result property="id" column="id" />
<result property="itemName" column="item_name" />
<result property="itemDesc" column="item_desc" />
<result property="itemContent" column="item_content" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAbucoderItemsVo">
select id, item_name, item_desc, item_content, create_by, create_time, update_by, update_time, remark from abucoder_items
</sql>
<select id="selectAbucoderItemsList" parameterType="AbucoderItems" resultMap="AbucoderItemsResult">
<include refid="selectAbucoderItemsVo"/>
<where>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
</where>
</select>
<select id="selectAbucoderItemsById" parameterType="Long" resultMap="AbucoderItemsResult">
<include refid="selectAbucoderItemsVo"/>
where id = #{id}
</select>
<insert id="insertAbucoderItems" parameterType="AbucoderItems" useGeneratedKeys="true" keyProperty="id">
insert into abucoder_items
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemName != null">item_name,</if>
<if test="itemDesc != null">item_desc,</if>
<if test="itemContent != null">item_content,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemName != null">#{itemName},</if>
<if test="itemDesc != null">#{itemDesc},</if>
<if test="itemContent != null">#{itemContent},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAbucoderItems" parameterType="AbucoderItems">
update abucoder_items
<trim prefix="SET" suffixOverrides=",">
<if test="itemName != null">item_name = #{itemName},</if>
<if test="itemDesc != null">item_desc = #{itemDesc},</if>
<if test="itemContent != null">item_content = #{itemContent},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAbucoderItemsById" parameterType="Long">
delete from abucoder_items where id = #{id}
</delete>
<delete id="deleteAbucoderItemsByIds" parameterType="String">
delete from abucoder_items where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -1,88 +0,0 @@
<?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.ruoyi.abuwx.mapper.AbucoderProgramsMapper">
<resultMap type="AbucoderPrograms" id="AbucoderProgramsResult">
<result property="id" column="id" />
<result property="programName" column="program_name" />
<result property="programTag" column="program_tag" />
<result property="programImg" column="program_img" />
<result property="programContent" column="program_content" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAbucoderProgramsVo">
select id, program_name, program_tag, program_img, program_content, create_by, create_time, update_by, update_time, remark from abucoder_programs
</sql>
<select id="selectAbucoderProgramsList" parameterType="AbucoderPrograms" resultMap="AbucoderProgramsResult">
<include refid="selectAbucoderProgramsVo"/>
<where>
<if test="programName != null and programName != ''"> and program_name like concat('%', #{programName}, '%')</if>
</where>
</select>
<select id="selectAbucoderProgramsById" parameterType="Long" resultMap="AbucoderProgramsResult">
<include refid="selectAbucoderProgramsVo"/>
where id = #{id}
</select>
<insert id="insertAbucoderPrograms" parameterType="AbucoderPrograms" useGeneratedKeys="true" keyProperty="id">
insert into abucoder_programs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="programName != null">program_name,</if>
<if test="programTag != null">program_tag,</if>
<if test="programImg != null">program_img,</if>
<if test="programContent != null">program_content,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="programName != null">#{programName},</if>
<if test="programTag != null">#{programTag},</if>
<if test="programImg != null">#{programImg},</if>
<if test="programContent != null">#{programContent},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAbucoderPrograms" parameterType="AbucoderPrograms">
update abucoder_programs
<trim prefix="SET" suffixOverrides=",">
<if test="programName != null">program_name = #{programName},</if>
<if test="programTag != null">program_tag = #{programTag},</if>
<if test="programImg != null">program_img = #{programImg},</if>
<if test="programContent != null">program_content = #{programContent},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAbucoderProgramsById" parameterType="Long">
delete from abucoder_programs where id = #{id}
</delete>
<delete id="deleteAbucoderProgramsByIds" parameterType="String">
delete from abucoder_programs where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -1,90 +0,0 @@
<?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.ruoyi.abuwx.mapper.AbucoderWxappConfigMapper">
<resultMap type="AbucoderWxappConfig" id="AbucoderWxappConfigResult">
<result property="id" column="id" />
<result property="appid" column="appid" />
<result property="appSecret" column="app_secret" />
<result property="state" column="state" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAbucoderWxappConfigVo">
select id, appid, app_secret, state, create_by, create_time, update_by, update_time, remark from abucoder_wxapp_config
</sql>
<select id="selectAbucoderWxappConfigList" parameterType="AbucoderWxappConfig" resultMap="AbucoderWxappConfigResult">
<include refid="selectAbucoderWxappConfigVo"/>
<where>
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret}</if>
<if test="state != null "> and state = #{state}</if>
</where>
</select>
<select id="selectAbucoderWxappConfigById" parameterType="Long" resultMap="AbucoderWxappConfigResult">
<include refid="selectAbucoderWxappConfigVo"/>
where id = #{id}
</select>
<select id="selectAbucoderWxappConfig" resultMap="AbucoderWxappConfigResult">
<include refid="selectAbucoderWxappConfigVo"/>
where state = 0
</select>
<insert id="insertAbucoderWxappConfig" parameterType="AbucoderWxappConfig" useGeneratedKeys="true" keyProperty="id">
insert into abucoder_wxapp_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="appid != null">appid,</if>
<if test="appSecret != null">app_secret,</if>
<if test="state != null">state,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="appid != null">#{appid},</if>
<if test="appSecret != null">#{appSecret},</if>
<if test="state != null">#{state},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAbucoderWxappConfig" parameterType="AbucoderWxappConfig">
update abucoder_wxapp_config
<trim prefix="SET" suffixOverrides=",">
<if test="appid != null">appid = #{appid},</if>
<if test="appSecret != null">app_secret = #{appSecret},</if>
<if test="state != null">state = #{state},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAbucoderWxappConfigById" parameterType="Long">
delete from abucoder_wxapp_config where id = #{id}
</delete>
<delete id="deleteAbucoderWxappConfigByIds" parameterType="String">
delete from abucoder_wxapp_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -1,93 +0,0 @@
<?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.ruoyi.abuwx.mapper.AbucoderWxuserMapper">
<resultMap type="AbucoderWxuser" id="AbucoderWxuserResult">
<result property="id" column="id" />
<result property="nickname" column="nickname" />
<result property="avatar" column="avatar" />
<result property="openid" column="openid" />
<result property="gender" column="gender" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAbucoderWxuserVo">
select id, nickname, avatar, openid, gender, create_by, create_time, update_by, update_time, remark from abucoder_wxuser
</sql>
<select id="selectAbucoderWxuserList" parameterType="AbucoderWxuser" resultMap="AbucoderWxuserResult">
<include refid="selectAbucoderWxuserVo"/>
<where>
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
<if test="gender != null "> and gender = #{gender}</if>
</where>
</select>
<select id="selectAbucoderWxuserById" parameterType="Long" resultMap="AbucoderWxuserResult">
<include refid="selectAbucoderWxuserVo"/>
where id = #{id}
</select>
<select id="selectAbucoderWxuserOpenID" resultMap="AbucoderWxuserResult">
<include refid="selectAbucoderWxuserVo"/>
where openid = #{openid}
</select>
<insert id="insertAbucoderWxuser" parameterType="AbucoderWxuser" useGeneratedKeys="true" keyProperty="id">
insert into abucoder_wxuser
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nickname != null">nickname,</if>
<if test="avatar != null">avatar,</if>
<if test="openid != null">openid,</if>
<if test="gender != null">gender,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nickname != null">#{nickname},</if>
<if test="avatar != null">#{avatar},</if>
<if test="openid != null">#{openid},</if>
<if test="gender != null">#{gender},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAbucoderWxuser" parameterType="AbucoderWxuser">
update abucoder_wxuser
<trim prefix="SET" suffixOverrides=",">
<if test="nickname != null">nickname = #{nickname},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="openid != null">openid = #{openid},</if>
<if test="gender != null">gender = #{gender},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAbucoderWxuserById" parameterType="Long">
delete from abucoder_wxuser where id = #{id}
</delete>
<delete id="deleteAbucoderWxuserByIds" parameterType="String">
delete from abucoder_wxuser where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -16,6 +16,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
@@ -33,6 +35,8 @@ public class SysOssController extends BaseController
@PostMapping("/upload")
public AjaxResult upload(@RequestParam("file") MultipartFile file) throws Exception
{
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
if (file.isEmpty())
{
throw new OssException("上传文件不能为空");
@@ -48,7 +52,7 @@ public class SysOssController extends BaseController
ossEntity.setFileSuffix(suffix);
ossEntity.setCreateBy(SecurityUtils.getUsername());
ossEntity.setFileName(fileName);
ossEntity.setCreateTime(new Date());
ossEntity.setCreateTime(formattedDate);
ossEntity.setService(storage.getService());
return toAjax(sysOssService.save(ossEntity)).put("url", ossEntity.getUrl()).put("fileName",ossEntity.getFileName());
}

View File

@@ -59,11 +59,32 @@ spring:
wall:
config:
multi-statement-allow: true
redis:
# 地址
host: 124.243.245.42
# 端口默认为6379
port: 5379
# 数据库索引
database: 5
# 密码
password: ZKR2024@@.com
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# easy-es
easy-es:
enable: true
banner: false
address: 127.0.0.1
address: 124.243.245.42:9200
global-config:
process-index-mode: manual
db-config:

View File

@@ -52,7 +52,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: dev
active: local
# 文件上传
servlet:
multipart:

View File

@@ -1,6 +1,5 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.AppUser;
import com.ruoyi.cms.domain.BussinessDictData;
import com.ruoyi.cms.domain.CommercialArea;
import com.ruoyi.cms.domain.SubwayLine;
@@ -8,22 +7,17 @@ import com.ruoyi.cms.service.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.JobTitle;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.ruoyi.common.utils.PageUtils.startPage;
@RestController
@RequestMapping("/app/common")
@Api(tags = "移动端:常用参数查询")
@@ -73,6 +67,7 @@ public class AppCommonController extends BaseController {
List<BussinessDictData> dictData = iBussinessDictTypeService.selectDictDataByType(dictType);
return success(dictData);
}
@ApiOperation("字段标准")
@GetMapping("/standar/filed")
public AjaxResult standarFiled()
{

View File

@@ -1,7 +1,6 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.BussinessDictData;
import com.ruoyi.cms.domain.Company;
import com.ruoyi.cms.domain.CompanyCard;
import com.ruoyi.cms.domain.query.LabelQuery;
@@ -9,16 +8,14 @@ import com.ruoyi.cms.mapper.CompanyCardMapper;
import com.ruoyi.cms.service.ICompanyCardService;
import com.ruoyi.cms.service.ICompanyCollectionService;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -46,7 +43,6 @@ public class AppCompanyController extends BaseController
* 获取公司详细信息
*/
@ApiOperation("获取公司详细信息")
@PreAuthorize("@ss.hasPermi('bussiness:company:query')")
@GetMapping(value = "/{companyId}")
public AjaxResult getInfo(@PathVariable("companyId") Long companyId)
{
@@ -55,7 +51,7 @@ public class AppCompanyController extends BaseController
/**
* 用户收藏公司
*/
@Log(title = "用户收藏公司")
@BussinessLog(title = "用户收藏公司")
@PostMapping("/collection/{companyId}")
@ApiOperation("用户收藏公司")
public AjaxResult companyCollection(@PathVariable("companyId") Long companyId)
@@ -66,7 +62,7 @@ public class AppCompanyController extends BaseController
/**
* 用户取消收藏公司
*/
@Log(title = "用户取消收藏公司")
@BussinessLog(title = "用户取消收藏公司")
@DeleteMapping("/collection/{companyId}")
@ApiOperation("用户取消收藏公司")
public AjaxResult companyCancel(@PathVariable("companyId") Long companyId)
@@ -76,7 +72,6 @@ public class AppCompanyController extends BaseController
/**
* 公司下的岗位
*/
@Log(title = "公司下的岗位")
@GetMapping("/job/{companyId}")
@ApiOperation("公司下的岗位")
public TableDataInfo jobCompany(@ApiParam("公司id") @PathVariable Long companyId)
@@ -84,7 +79,6 @@ public class AppCompanyController extends BaseController
startPage();
return getDataTable(companyCollectionService.jobCompany(companyId));
}
@Log(title = "查看企业卡片")
@GetMapping("/card")
@ApiOperation("查看企业卡片")
public TableDataInfo card()
@@ -92,7 +86,7 @@ public class AppCompanyController extends BaseController
startPage();
return getDataTable(companyCardService.cardApp());
}
@Log(title = "收藏企业卡片")
@BussinessLog(title = "收藏企业卡片")
@PutMapping("/card/collection/{companyCardId}")
@ApiOperation("收藏企业卡片")
public AjaxResult cardCollection(@PathVariable Long companyCardId)
@@ -100,7 +94,7 @@ public class AppCompanyController extends BaseController
companyCardService.cardCollection(companyCardId);
return success();
}
@Log(title = "取消收藏企业卡片")
@BussinessLog(title = "取消收藏企业卡片")
@DeleteMapping("/card/collection/{companyCardId}")
@ApiOperation("取消收藏公司卡片")
public AjaxResult cardCancel(@PathVariable Long companyCardId)
@@ -108,7 +102,6 @@ public class AppCompanyController extends BaseController
companyCardService.cardCancel(companyCardId);
return success();
}
@Log(title = "公司招聘的岗位数量")
@GetMapping("/count/{companyId}")
@ApiOperation("公司招聘的岗位数量")
public AjaxResult count(@PathVariable Long companyId)
@@ -116,24 +109,28 @@ public class AppCompanyController extends BaseController
Integer count = companyService.count(companyId);
return success(count);
}
@Log(title = "公司标签下的公司")
@GetMapping("/label")
@ApiOperation("公司标签下的公司")
public TableDataInfo label(LabelQuery labelQuery)
public TableDataInfo label(@RequestBody LabelQuery labelQuery)
{
CompanyCard companyCard = companyCardMapper.selectById(labelQuery.getCardId());
startPage();
List<Company> companyList = companyService.label(companyCard,labelQuery);
return getDataTable(companyList);
}
@GetMapping("/importLabel500")
public void importLabel()
@PostMapping("/register")
@ApiOperation("招聘企业登记")
@BussinessLog(title = "招聘企业登记")
public AjaxResult register(Company company)
{
companyService.importLabel();
companyService.register(company);
return AjaxResult.success();
}
@GetMapping("/importLabelBank")
public void importLabelBank()
@GetMapping("/register/status")
@ApiOperation("招聘企业登记进度查询")
public AjaxResult registerStatus()
{
companyService.importLabelBank();
Company status = companyService.registerStatus();
return AjaxResult.success(status);
}
}

View File

@@ -4,7 +4,7 @@ package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.JobFair;
import com.ruoyi.cms.service.IFairCollectionService;
import com.ruoyi.cms.service.IJobFairService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -33,7 +33,7 @@ public class AppFairController extends BaseController
/**
* 招聘会列表
*/
@Log(title = "招聘会列表")
@BussinessLog(title = "招聘会列表")
@GetMapping
public TableDataInfo list(JobFair jobFair)
{
@@ -45,7 +45,7 @@ public class AppFairController extends BaseController
/**
* 招聘会详情
*/
@Log(title = "招聘会详情")
@BussinessLog(title = "招聘会详情")
@GetMapping("/{fairId}")
public AjaxResult appDetail(@ApiParam("招聘会id") @PathVariable Long fairId)
{
@@ -55,7 +55,7 @@ public class AppFairController extends BaseController
/**
* 用户收藏招聘会
*/
@Log(title = "用户收藏招聘会")
@BussinessLog(title = "用户收藏招聘会")
@PostMapping("/collection/{fairId}")
public AjaxResult companyCollection(@ApiParam("招聘会id") @PathVariable Long fairId)
{
@@ -65,7 +65,7 @@ public class AppFairController extends BaseController
/**
* 用户取消收藏招聘会
*/
@Log(title = "用户取消收藏招聘会")
@BussinessLog(title = "用户取消收藏招聘会")
@DeleteMapping("/collection/{fairId}")
public AjaxResult companyCancel(@ApiParam("招聘会id") @PathVariable Long fairId)
{

View File

@@ -1,6 +1,7 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.service.IFileService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -14,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
public class AppFileController {
@Autowired
private IFileService fileService;
@BussinessLog(title = "上传文件")
@PostMapping("/upload")
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "bussinessId",required = false) Long bussinessId) {
return fileService.uploadFile(file,bussinessId);

View File

@@ -3,12 +3,10 @@ package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.ESJobDocument;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.query.ESJobSearch;
import com.ruoyi.cms.domain.vo.CompetitivenessResponse;
import com.ruoyi.cms.domain.vo.RadarChart;
import com.ruoyi.cms.service.IESJobSearchService;
import com.ruoyi.cms.service.IJobCollectionService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -18,8 +16,8 @@ import io.swagger.annotations.ApiParam;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.List;
/**
* 岗位Controller
@@ -39,37 +37,28 @@ public class AppJobController extends BaseController
@Autowired
private IESJobSearchService esJobSearchService;
private Calendar calendar = Calendar.getInstance();
private Date date = new Date();
{
calendar.set(Calendar.YEAR, 2025); // 设置年份
calendar.set(Calendar.MONTH, Calendar.JULY); // 设置月份7月
calendar.set(Calendar.DAY_OF_MONTH, 12); // 设置日期
date = calendar.getTime(); // 转换为Date对象
}
/**
* 查询岗位列表
*/
@ApiOperation("查询岗位列表")
@GetMapping("/list")
public TableDataInfo list(ESJobSearch job, HttpServletRequest request)
public TableDataInfo list(ESJobSearch job)
{
// 打印请求参数
System.out.println("Request Parameters:");
request.getParameterMap().forEach((key, value) -> {
System.out.println(key + " = " + String.join(", ", value));
});
// 打印请求头
System.out.println("Request Headers:");
Enumeration<String> headerNames = request.getHeaderNames();
Iterator<String> iterator = Collections.list(headerNames).iterator();
iterator.forEachRemaining(headerName -> {
System.out.println(headerName + " = " + request.getHeader(headerName));
});
EsPageInfo<ESJobDocument> list = jobService.appList(job);
return getTableDataInfo(list);
return getTableDataInfo2(list,job);
}
private TableDataInfo getTableDataInfo2(EsPageInfo<ESJobDocument> list, ESJobSearch job) {
long total = list.getTotal();
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(200);
rspData.setRows(list.getList());
rspData.setTotal(total > 200 ? 200 : total);
job.setCompany(null);
rspData.setData(job);
return rspData;
}
/**
* 获取5条推荐岗位
*/
@@ -78,12 +67,9 @@ public class AppJobController extends BaseController
public AjaxResult recommend(ESJobSearch esJobSearch)
{
List<ESJobDocument> jobList = jobService.recommend(esJobSearch);
for (ESJobDocument esJobDocument:jobList){
esJobDocument.setPostingDate(date);
}
return success(jobList);
}
@ApiOperation("获取littleVideo")
@ApiOperation("获取短视频")
@GetMapping("/littleVideo")
public AjaxResult littleVideo(ESJobSearch esJobSearch)
{
@@ -91,21 +77,13 @@ public class AppJobController extends BaseController
return success(jobList);
}
@ApiOperation("获取littleVideo")
@ApiOperation("随机获取短视频")
@GetMapping("/littleVideo/random")
public AjaxResult littleVideo(@RequestParam(required = true) String uuid,@RequestParam(required = false) Integer count,@RequestParam(required = false) String jobTitle)
{
List<ESJobDocument> jobList = jobService.littleVideoRandom(uuid,count,jobTitle);
return success(jobList);
}
/**
* 获取5条推荐岗位
*/
@GetMapping("/updateLon")
public void updateLon()
{
jobService.updateLon();
}
/**
* 附件工作
*/
@@ -115,9 +93,6 @@ public class AppJobController extends BaseController
{
EsPageInfo<ESJobDocument> list = esJobSearchService.nearJob(jobQuery);
List<ESJobDocument> jobList = list.getList();
for (ESJobDocument esJobDocument:jobList){
esJobDocument.setPostingDate(date);
}
list.setList(jobList);
return getTableDataInfo(list);
}
@@ -130,9 +105,6 @@ public class AppJobController extends BaseController
{
EsPageInfo<ESJobDocument> list = jobService.countyJobList(job);
List<ESJobDocument> jobList = list.getList();
for (ESJobDocument esJobDocument:jobList){
esJobDocument.setPostingDate(date);
}
list.setList(jobList);
return getTableDataInfo(list);
}
@@ -145,9 +117,6 @@ public class AppJobController extends BaseController
{
EsPageInfo<ESJobDocument> list = jobService.subway(jobQuery);
List<ESJobDocument> jobList = list.getList();
for (ESJobDocument esJobDocument:jobList){
esJobDocument.setPostingDate(date);
}
list.setList(jobList);
return getTableDataInfo(list);
}
@@ -161,9 +130,6 @@ public class AppJobController extends BaseController
{
EsPageInfo<ESJobDocument> list = jobService.commercialArea(jobQuery);
List<ESJobDocument> jobList = list.getList();
for (ESJobDocument esJobDocument:jobList){
esJobDocument.setPostingDate(date);
}
list.setList(jobList);
return getTableDataInfo(list);
}
@@ -175,14 +141,13 @@ public class AppJobController extends BaseController
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
{
Job job = jobService.selectJobByJobIdApp(jobId);
job.setPostingDate(date);
return success(job);
}
/**
* 用户收藏岗位
*/
@Log(title = "用户收藏岗位")
@BussinessLog(title = "用户收藏岗位")
@PostMapping("/collection/{jobId}")
@ApiOperation("用户收藏")
public AjaxResult jobCollection(@ApiParam("岗位id") @PathVariable Long jobId)
@@ -193,7 +158,7 @@ public class AppJobController extends BaseController
/**
* 用户取消收藏岗位
*/
@Log(title = "用户取消收藏岗位")
@BussinessLog(title = "用户取消收藏岗位")
@DeleteMapping("/collection/{jobId}")
@ApiOperation("用户取消收藏岗位")
public AjaxResult cancel(@ApiParam("岗位id") @PathVariable Long jobId)
@@ -203,38 +168,17 @@ public class AppJobController extends BaseController
/**
* 用户申请岗位
*/
@Log(title = "用户申请岗位")
@BussinessLog(title = "用户申请岗位")
@GetMapping("/apply/{jobId}")
@ApiOperation("用户申请岗位")
public AjaxResult apply(@ApiParam("岗位id") @PathVariable Long jobId)
{
return toAjax(jobCollectionService.apply(jobId));
}
@Log(title = "竞争力分析")
@GetMapping("/competitiveness/{jobId}")
@ApiOperation("竞争力分析")
public AjaxResult competitiveness(@ApiParam("岗位id") @PathVariable Long jobId) {
// Generate random values for the response
Random random = new Random();
// Build radar chart with random values between 60-95
RadarChart radarChart = new RadarChart();
radarChart.setAge(60 + random.nextInt(36)); // 60-95
radarChart.setExperience(60 + random.nextInt(36));
radarChart.setEducation(60 + random.nextInt(36));
radarChart.setSkill(60 + random.nextInt(36));
radarChart.setSalary(60 + random.nextInt(36));
radarChart.setLocation(60 + random.nextInt(36));
// Build response with random values
CompetitivenessResponse response = new CompetitivenessResponse();
response.setTotalApplicants(0); // Always 0 as requested
response.setMatchScore(60 + random.nextInt(41)); // 60-100
response.setRank(1 + random.nextInt(10)); // 1-10
response.setPercentile(random.nextInt(101)); // 0-100
response.setRadarChart(radarChart);
return success(response);
return success(jobCollectionService.competitiveness(jobId));
}
private TableDataInfo getTableDataInfo(EsPageInfo<ESJobDocument> result){
long total = result.getTotal();
@@ -244,45 +188,11 @@ public class AppJobController extends BaseController
rspData.setTotal(total > 200 ? 200 : total);
return rspData;
}
@GetMapping("/import")
public AjaxResult importData()
@BussinessLog(title = "移动端发布岗位")
@PostMapping("/publishJob")
public AjaxResult fix(@RequestBody Job job)
{
jobService.importData();
jobService.publishJob(job);
return success();
}
@GetMapping("/importRow")
public AjaxResult importRow()
{
jobService.importRow();
return success();
}
@GetMapping("/update")
public AjaxResult update()
{
jobService.updateEs();
return success();
}
@PostMapping("/getWechatUrl")
public AjaxResult getWechatUrl(@RequestBody HashMap<String,String> url)
{
String s = url.get("imgUrl");
return AjaxResult.success(jobService.getWechatUrl(s));
}
@PostMapping("/insert")
public AjaxResult insertTemp(@RequestBody Job job)
{
return AjaxResult.success(jobService.insertTemp(job));
}
@ApiOperation("生成分享的html")
@GetMapping("/htmlGen/{id}")
public AjaxResult htmlGen(@PathVariable(required = true) Long id)
{
String result = jobService.htmlGen(id);
return AjaxResult.success(result);
}
@GetMapping("/fix")
public void fix()
{
jobService.fix();
}
}

View File

@@ -1,15 +1,12 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.AppUser;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.Notice;
import com.ruoyi.cms.domain.vo.AppNoticeVO;
import com.ruoyi.cms.service.IAppNoticeService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,8 +14,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.ruoyi.common.utils.PageUtils.startPage;
@RestController
@RequestMapping("/app/notice")
@Api(tags = "移动端:消息")
@@ -43,6 +38,7 @@ public class AppNoticeInfoController extends BaseController {
}
@ApiOperation("系统通知已读")
@PostMapping("/read/sysNotice")
@BussinessLog(title = "系统通知标记已读")
public AjaxResult sysNotice(@RequestParam String id)
{
appNoticeService.sysNotice(id);
@@ -50,6 +46,7 @@ public class AppNoticeInfoController extends BaseController {
}
@ApiOperation("岗位推荐、招聘会已读")
@PostMapping("/read")
@BussinessLog(title = "岗位推荐、招聘会已读标记已读")
public AjaxResult read(@RequestParam String id)
{
appNoticeService.read(id);

View File

@@ -0,0 +1,61 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 岗位Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/script")
@Api(tags = "移动端:脚本")
public class AppScriptController extends BaseController
{
@Autowired
private IJobService jobService;
@Autowired
private ICompanyService companyService;
//更新经纬度
@GetMapping("/updateLon")
public void updateLon()
{
jobService.updateLon();
}
//导入数据
@GetMapping("/import")
public AjaxResult importData()
{
jobService.importData();
return success();
}
//导入原始数据
@GetMapping("/importRow")
public AjaxResult importRow(@RequestParam String path)
{
jobService.importRow(path);
return success();
}
// 导入500强
@GetMapping("/importLabel500")
public void importLabel()
{
companyService.importLabel();
}
// 随机导入3个公司到银行标签
@GetMapping("/importLabelBank")
public void importLabelBank()
{
companyService.importLabelBank();
}
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.cms.controller.app;
import com.alibaba.nls.client.AccessToken;
import com.ruoyi.cms.handler.SpeechRecognizerAI;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* app语音Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/speech")
@Api(tags = "移动端:用户相关")
public class AppSpeechController extends BaseController
{
private String appKey = "4lFYn2yPsQymwGu8";
private String id = "LTAI5t9hhSqdDHqwH3RjgyYj";
private String secret = "ni5aW3vxrWouMwcGqJPfh9Uu56PBuv";
private String url = System.getenv().getOrDefault("NLS_GATEWAY_URL", "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1");
@ApiOperation("统计")
@GetMapping("/getToken")
public AjaxResult getToken()
{
SpeechRecognizerAI recognizerDemo = new SpeechRecognizerAI(appKey, id, secret, url);
AccessToken accessToken = recognizerDemo.getAccessToken();
String token = "wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1?appkey="+appKey+"&token="+accessToken.getToken();
return AjaxResult.success(token);
}
}

View File

@@ -6,6 +6,7 @@ import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobFair;
import com.ruoyi.cms.domain.query.MineJobQuery;
import com.ruoyi.cms.service.*;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -46,6 +47,7 @@ public class AppUserController extends BaseController
*/
@ApiOperation("保存简历")
@PostMapping("/resume")
@BussinessLog(title = "保存简历")
public AjaxResult saveResume(@RequestBody AppUser appUser)
{
appUser.setUserId(SecurityUtils.getUserId());

View File

@@ -24,7 +24,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/cms/operlog")
@Api(tags = "后台App用户日志")
@Api(tags = "后台App用户操作日志")
public class BussinessOperlogController extends BaseController
{
@Autowired

View File

@@ -61,7 +61,7 @@ public class CmsJobController extends BaseController
* 导出岗位列表
*/
@ApiOperation("导出岗位列表")
@PreAuthorize("@ss.hasPermi('app:job:export')")
@PreAuthorize("@ss.hasPermi('bussiness:job:export')")
@Log(title = "岗位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Job job)
@@ -74,7 +74,7 @@ public class CmsJobController extends BaseController
* 新增岗位
*/
@ApiOperation("新增岗位")
@PreAuthorize("@ss.hasPermi('app:job:add')")
@PreAuthorize("@ss.hasPermi('bussiness:job:add')")
@Log(title = "岗位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Job job)
@@ -86,7 +86,7 @@ public class CmsJobController extends BaseController
* 修改岗位
*/
@ApiOperation("修改岗位")
@PreAuthorize("@ss.hasPermi('app:job:edit')")
@PreAuthorize("@ss.hasPermi('bussiness:job:edit')")
@Log(title = "岗位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Job job)
@@ -98,32 +98,22 @@ public class CmsJobController extends BaseController
* 删除岗位
*/
@ApiOperation("删除岗位")
@PreAuthorize("@ss.hasPermi('app:job:remove')")
@PreAuthorize("@ss.hasPermi('bussiness:job:remove')")
@Log(title = "岗位", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobIds}")
public AjaxResult remove(@PathVariable Long[] jobIds)
{
return toAjax(jobService.deleteJobByJobIds(jobIds));
}
@ApiOperation("候选人查询")
@Log(title = "岗位", businessType = BusinessType.DELETE)
@GetMapping("/candidates")
@PreAuthorize("@ss.hasPermi('bussiness:job:candidates')")
public TableDataInfo candidates(Long jobId)
{
startPage();
List<CandidateVO> list = jobService.candidates(jobId);
return getDataTable(list);
}
@GetMapping("/import")
public AjaxResult importData()
{
jobService.importData();
return success();
}
@GetMapping("/importRow")
public AjaxResult importRow()
{
jobService.importRow();
return success();
}
}

View File

@@ -1,103 +1,42 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 通知公告表 sys_notice
*
* @author ruoyi
*/
@Data
@ApiModel("APP通知")
@TableName(value = "app_notice")
public class AppNotice extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 公告ID */
@TableId(value = "notice_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
private Long noticeId;
/** 公告标题 */
@Xss(message = "消息标题不能包含脚本字符")
@NotBlank(message = "消息标题不能为空")
@Size(min = 0, max = 50, message = "消息标题不能超过50个字符")
private String noticeTitle;
/** 公告类型1通知 2公告 */
@ApiModelProperty("消息类型")
private String noticeType;
/** 公告内容 */
@ApiModelProperty("消息内容")
private String noticeContent;
/** 公告状态0正常 1关闭 */
@ApiModelProperty("消息状态 0正常 1关闭")
private String status;
public Long getNoticeId()
{
return noticeId;
}
public void setNoticeId(Long noticeId)
{
this.noticeId = noticeId;
}
public void setNoticeTitle(String noticeTitle)
{
this.noticeTitle = noticeTitle;
}
@Xss(message = "公告标题不能包含脚本字符")
@NotBlank(message = "公告标题不能为空")
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
public String getNoticeTitle()
{
return noticeTitle;
}
public void setNoticeType(String noticeType)
{
this.noticeType = noticeType;
}
public String getNoticeType()
{
return noticeType;
}
public void setNoticeContent(String noticeContent)
{
this.noticeContent = noticeContent;
}
public String getNoticeContent()
{
return noticeContent;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -1,16 +1,15 @@
package com.ruoyi.cms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 用户岗位浏览记录对象 app_review_job
* @author ${author}
@@ -26,14 +25,15 @@ public class AppReviewJob extends BaseEntity
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("岗位id")
private Long jobId;
/** 浏览日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "浏览日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("浏览日期")
private Date reviewDate;
private String reviewDate;
}

View File

@@ -26,78 +26,63 @@ public class AppUser extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 用户ID */
@TableId(value = "user_id",type = IdType.AUTO)
@ApiModelProperty("用户ID")
private Long userId;
/** 用户名称 */
@Excel(name = "用户名称")
@ApiModelProperty("用户名称")
private String name;
/** 年龄段 对应字典age */
@Excel(name = "年龄段 对应字典age")
@ApiModelProperty("年龄段 对应字典age")
private String age;
/** 用户性别0男 1女对应字典sex */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女")
@ApiModelProperty("用户性别0男 1女对应字典sex")
private String sex;
/** 生日 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("生日")
private Date birthDate;
/** 学历 对应字典education */
@Excel(name = "学历 对应字典education")
@ApiModelProperty("学历 对应字典education")
private String education;
/** 政治面貌 */
@Excel(name = "政治面貌")
@ApiModelProperty("政治面貌")
private String politicalAffiliation;
/** 手机号码 */
@Excel(name = "手机号码")
@ApiModelProperty("手机号码")
private String phone;
/** 头像地址 */
@Excel(name = "头像地址")
@ApiModelProperty("头像地址")
private String avatar;
/** 最低工资 */
@Excel(name = "最低工资")
@ApiModelProperty("最低工资")
private String salaryMin;
/** 最高工资 */
@Excel(name = "最高工资")
@ApiModelProperty("最高工资")
private String salaryMax;
/** 期望工作地 对应字典area */
@Excel(name = "期望工作地 对应字典area")
@ApiModelProperty("期望工作地 对应字典area")
private String area;
/** 帐号状态0正常 1停用 */
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
@ApiModelProperty("帐号状态0正常 1停用")
private String status;
/** 最后登录IP */
@Excel(name = "最后登录IP")
@ApiModelProperty("最后登录IP")
private String loginIp;
/** 最后登录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("最后登录时间")
@@ -105,10 +90,14 @@ public class AppUser extends BaseEntity
@ApiModelProperty("期望岗位,逗号分隔")
private String jobTitleId;
@ApiModelProperty("期望薪资")
private String experience;
@ApiModelProperty("是否开启推荐0不推荐 1推荐")
private Integer isRecommend;
@TableField(exist = false)
@ApiModelProperty("期望岗位列表")
private List<String> jobTitle;
}

View File

@@ -1,177 +1,69 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 字典数据表 sys_dict_data
*
* @author ruoyi
*/
@Data
@ApiModel("业务数据表")
@TableName(value = "bussiness_dict_data")
public class BussinessDictData extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 字典编码 */
@ApiModelProperty("字典编码")
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
@TableId(value = "dict_code",type = IdType.AUTO)
private Long dictCode;
/** 字典排序 */
@ApiModelProperty("字典排序")
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
private Long dictSort;
/** 字典标签 */
@Excel(name = "字典标签")
@ApiModelProperty("字典标签")
@NotBlank(message = "字典标签不能为空")
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
private String dictLabel;
/** 字典键值 */
@Excel(name = "字典键值")
@ApiModelProperty("字典键值")
@NotBlank(message = "字典键值不能为空")
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
private String dictValue;
/** 字典类型 */
@ApiModelProperty("字典类型")
@Excel(name = "字典类型")
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
private String dictType;
/** 样式属性(其他样式扩展 */
@ApiModelProperty("样式属性(其他样式扩展)")
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
private String cssClass;
/** 表格字典样式 */
@ApiModelProperty("表格字典样式")
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
private String listClass;
/** 是否默认Y是 N否 */
@ApiModelProperty("是否默认Y是 N否")
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
private String isDefault;
/** 状态0正常 1停用 */
@ApiModelProperty("状态 0=正常,1=停用 ")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public Long getDictCode()
{
return dictCode;
}
public void setDictCode(Long dictCode)
{
this.dictCode = dictCode;
}
public Long getDictSort()
{
return dictSort;
}
public void setDictSort(Long dictSort)
{
this.dictSort = dictSort;
}
@NotBlank(message = "字典标签不能为空")
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
public String getDictLabel()
{
return dictLabel;
}
public void setDictLabel(String dictLabel)
{
this.dictLabel = dictLabel;
}
@NotBlank(message = "字典键值不能为空")
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
public String getDictValue()
{
return dictValue;
}
public void setDictValue(String dictValue)
{
this.dictValue = dictValue;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
public String getDictType()
{
return dictType;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
public String getCssClass()
{
return cssClass;
}
public void setCssClass(String cssClass)
{
this.cssClass = cssClass;
}
public String getListClass()
{
return listClass;
}
public void setListClass(String listClass)
{
this.listClass = listClass;
}
public boolean getDefault()
{
return UserConstants.YES.equals(this.isDefault);
}
public String getIsDefault()
{
return isDefault;
}
public void setIsDefault(String isDefault)
{
this.isDefault = isDefault;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dictCode", getDictCode())
.append("dictSort", getDictSort())
.append("dictLabel", getDictLabel())
.append("dictValue", getDictValue())
.append("dictType", getDictType())
.append("cssClass", getCssClass())
.append("listClass", getListClass())
.append("isDefault", getIsDefault())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -1,20 +1,20 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
/**
* 字典类型表 sys_dict_type
*
* @author ruoyi
*/
@Data
@ApiModel("字典类型表")
@TableName(value = "bussiness_dict_type")
public class BussinessDictType extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -25,73 +25,19 @@ public class BussinessDictType extends BaseEntity
/** 字典名称 */
@Excel(name = "字典名称")
@NotBlank(message = "字典名称不能为空")
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
private String dictName;
/** 字典类型 */
@Excel(name = "字典类型")
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
private String dictType;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public Long getDictId()
{
return dictId;
}
public void setDictId(Long dictId)
{
this.dictId = dictId;
}
@NotBlank(message = "字典名称不能为空")
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
public String getDictName()
{
return dictName;
}
public void setDictName(String dictName)
{
this.dictName = dictName;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
public String getDictType()
{
return dictType;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dictId", getDictId())
.append("dictName", getDictName())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -24,92 +24,75 @@ public class BussinessOperLog extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 日志主键 */
@TableId(value = "oper_id",type = IdType.AUTO)
@ApiModelProperty("日志主键")
private Long operId;
/** 模块标题 */
@Excel(name = "模块标题")
@ApiModelProperty("模块标题")
private String title;
/** 业务类型0其它 1新增 2修改 3删除 */
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除")
@ApiModelProperty("业务类型0其它 1新增 2修改 3删除")
private Integer businessType;
/** 方法名称 */
@Excel(name = "方法名称")
@ApiModelProperty("方法名称")
private String method;
/** 请求方式 */
@Excel(name = "请求方式")
@ApiModelProperty("请求方式")
private String requestMethod;
/** 操作类别0其它 1后台用户 2手机端用户 */
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
@ApiModelProperty("操作类别0其它 1后台用户 2手机端用户")
private Integer operatorType;
/** 操作人员 */
@Excel(name = "操作人员")
@ApiModelProperty("操作人员")
private String operName;
/** 部门名称 */
@Excel(name = "部门名称")
@ApiModelProperty("部门名称")
private String deptName;
/** 请求URL */
@Excel(name = "请求URL")
@ApiModelProperty("请求URL")
private String operUrl;
/** 主机地址 */
@Excel(name = "主机地址")
@ApiModelProperty("主机地址")
private String operIp;
/** 操作地点 */
@Excel(name = "操作地点")
@ApiModelProperty("操作地点")
private String operLocation;
/** 请求参数 */
@Excel(name = "请求参数")
@ApiModelProperty("请求参数")
private String operParam;
/** 返回参数 */
@Excel(name = "返回参数")
@ApiModelProperty("返回参数")
private String jsonResult;
/** 操作状态0正常 1异常 */
@Excel(name = "操作状态", readConverterExp = "0=正常,1=异常")
@ApiModelProperty("操作状态0正常 1异常")
private Integer status;
/** 错误消息 */
@Excel(name = "错误消息")
@ApiModelProperty("错误消息")
private String errorMsg;
/** 操作时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("操作时间")
private Date operTime;
/** 消耗时间 */
@Excel(name = "消耗时间")
@ApiModelProperty("消耗时间")
private Long costTime;
/** 业务类型数组 */
@ApiModelProperty("业务类型数组")
private Integer[] businessTypes;
}

View File

@@ -23,26 +23,24 @@ public class CommercialArea extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "commercial_area_id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long commercialAreaId;
/** 商圈名称 */
@Excel(name = "商圈名称")
@ApiModelProperty("商圈名称")
private String commercialAreaName;
/** 纬度 */
@Excel(name = "纬度")
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** 经度 */
@Excel(name = "经度")
@ApiModelProperty("经度")
private BigDecimal longitude;
@Excel(name = "地址")
@ApiModelProperty("地址")
private String address;
}

View File

@@ -22,42 +22,69 @@ public class Company extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 公司id */
@TableId(value = "company_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
private Long companyId;
/** 单位名称 */
@Excel(name = "单位名称")
@ApiModelProperty("单位名称")
private String name;
/** 单位地点 */
@Excel(name = "单位地点")
@ApiModelProperty("单位地点")
private String location;
/** 主要行业 */
@Excel(name = "主要行业")
@ApiModelProperty("主要行业")
private String industry;
/** 单位规模 对应字典scale */
@Excel(name = "单位规模 对应字典scale")
@ApiModelProperty("单位规模 对应字典scale")
private String scale;
@Excel(name = "信用代码")
@ApiModelProperty("信用代码")
private String code;
@Excel(name = "单位介绍")
@ApiModelProperty("单位介绍")
private String description;
@Excel(name = "性质")
@ApiModelProperty("性质")
private String nature;
@ApiModelProperty("招聘数量")
private Integer totalRecruitment;
@TableField(exist = false)
@ApiModelProperty("是否收藏")
private Integer isCollection;
@ApiModelProperty("所属用户id")
private Long userId;
@ApiModelProperty("营业执照Url")
private String businessLicenseUrl;
@ApiModelProperty("法人身份证复印件-正面")
private String idCardPictureUrl;
@ApiModelProperty("法人身份证复印件-反面")
private String idCardPictureBackUrl;
@ApiModelProperty("授权代理书")
private String powerOfAttorneyUrl;
@ApiModelProperty("联系人")
private String contactPerson;
@ApiModelProperty("联系人电话")
private String contactPersonPhone;
@ApiModelProperty("审核状态 0审核中 1审核通过 2审核未通过")
private Integer status;
@ApiModelProperty("审核未通过原因")
private String notPassReason;
}

View File

@@ -22,29 +22,33 @@ public class CompanyCard extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 公司id */
@TableId(value = "company_card_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
@ApiModelProperty("公司卡片id")
private Long companyCardId;
/** 卡片名称 */
@Excel(name = "卡片名称")
@ApiModelProperty("卡片名称")
private String name;
/** 标签,逗号分开 */
@Excel(name = "标签,逗号分开")
@ApiModelProperty("标签,逗号分开")
private String targ;
@Excel(name = "企业性质")
@ApiModelProperty("企业性质,逗号分开")
private String companyNature;
/** 背景色 */
@Excel(name = "背景色")
@ApiModelProperty("背景色")
private String backgroudColor;
@ApiModelProperty("状态 0未发布 1发布")
private Integer status;
@ApiModelProperty("排序")
private Integer cardOrder;
@ApiModelProperty("描述")
private String description;
private String icon;
}

View File

@@ -22,16 +22,16 @@ public class CompanyCardCollection extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 公司id */
@TableId(value = "company_card_collection_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
private Long companyCardCollectionId;
/** 用户id */
@Excel(name = "用户id")
@ApiModelProperty("用户id")
private Long userId;
@Excel(name = "用户id")
@ApiModelProperty("用户id")
@Excel(name = "公司卡片id")
@ApiModelProperty("公司卡片id")
private Long companyCardId;
}

View File

@@ -22,17 +22,14 @@ public class CompanyCollection extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 公司id */
@Excel(name = "公司id")
@ApiModelProperty("公司id")
private Long companyId;
/** App用户id */
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;

View File

@@ -26,8 +26,10 @@ public class CompanyLabel extends BaseEntity
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ApiModelProperty("公司标签")
private String dictValue;
@ApiModelProperty("公司id")
private Long companyId;
}

View File

@@ -2,6 +2,7 @@ package com.ruoyi.cms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
@@ -16,104 +17,126 @@ import java.util.Date;
/**
* 全文索引 ES数据模型
**/
@IndexName("job_document_gt")
@IndexName("job_document")
@Data
public class ESJobDocument
{
/**
* es中的唯一id
*/
@ApiModelProperty("es中的唯一id")
@IndexId(type = IdType.NONE)
@JsonIgnore
private String id;
/** 公告ID */
@ApiModelProperty("岗位id")
private Long jobId;
/** 公告标题 */
@ApiModelProperty("公告标题")
@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
private String jobTitle;
/** 内容 */
@ApiModelProperty("内容")
@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
private String description;
/** 公告状态 */
@JsonIgnore
private String status;
@ApiModelProperty("最小薪资(元)")
private Long minSalary;
/** 最大薪资(元) */
@ApiModelProperty("最大薪资(元)")
private Long maxSalary;
/** 学历要求 对应字典education */
@ApiModelProperty("学历要求 对应字典education")
private String education;
/** 工作经验要求 对应字典experience */
@ApiModelProperty("工作经验要求 对应字典experience")
private String experience;
/** 用人单位名称 */
@ApiModelProperty("用人单位名称")
private String companyName;
/** 工作地点 */
@ApiModelProperty("工作地点")
private String jobLocation;
@ApiModelProperty("工作地点区县字典代码")
private Integer jobLocationAreaCode;
/** 发布时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("发布时间")
private Date postingDate;
/** 招聘人数 */
@ApiModelProperty("招聘人数")
private Long vacancies;
/** 纬度 */
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** 经度 */
@ApiModelProperty("经度")
private BigDecimal longitude;
/** 浏览量 */
@ApiModelProperty("浏览量")
private Long view;
/** 公司id */
@ApiModelProperty("公司id")
private Long companyId;
@ApiModelProperty("是否火")
private Integer isHot;
@ApiModelProperty("申请次数")
private Integer applyNum;
@JsonIgnore
@ApiModelProperty("公司")
private Company company;
@ApiModelProperty("是否申请 0为否 1为是")
private Integer isApply;
@ApiModelProperty("是否收藏 0为否 1为是")
private Integer isCollection;
@ApiModelProperty("数据来源")
private String dataSource;
@ApiModelProperty("岗位链接")
private String jobUrl;
@JsonIgnore
@IndexField(fieldType = FieldType.GEO_POINT)
@ApiModelProperty("经纬度")
private String latAndLon;
@JsonIgnore
@ApiModelProperty("公司规模")
private String scaleDictCode;
@ApiModelProperty("行业分类")
private String industry;
@ApiModelProperty("岗位分类")
private String jobCategory;
@JsonIgnore
@ApiModelProperty("学历要求 对应字典education int类型 es方便查询")
private Integer education_int;
@JsonIgnore
@ApiModelProperty("工作经验要求 对应字典experience int类型 es方便查询")
private Integer experience_int;
// @JsonIgnore
@ApiModelProperty("公司规模 int类型 es方便查询")
private Integer scale;
@ApiModelProperty("岗位链接 APP内")
private String appJobUrl;
@ApiModelProperty("公司性质")
private String companyNature;
@ApiModelProperty("是否有视频介绍")
private Integer isExplain;
@ApiModelProperty("视频介绍URL")
private String explainUrl;
@ApiModelProperty("视频封面URL")
private String cover;
}

View File

@@ -23,17 +23,14 @@ public class FairCollection extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 岗位id */
@Excel(name = "招聘会id")
@ApiModelProperty("招聘会id")
private Long fairId;
/** App用户id */
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;

View File

@@ -22,17 +22,14 @@ public class FairCompany extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 公司id */
@Excel(name = "公司id")
@ApiModelProperty("公司id")
private Long companyId;
/** 招聘会id */
@Excel(name = "招聘会id")
@ApiModelProperty("招聘会id")
private Long jobFairId;

View File

@@ -22,17 +22,14 @@ public class File extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** url */
@Excel(name = "url")
@ApiModelProperty("url")
private String fileUrl;
/** 业务id */
@Excel(name = "业务id")
@ApiModelProperty("业务id")
private Long bussinessId;

View File

@@ -1,18 +1,18 @@
package com.ruoyi.cms.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 岗位对象 job
* @author lishundong
@@ -26,42 +26,34 @@ public class Job extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 工作id */
@TableId(value = "job_id",type = IdType.AUTO)
@ApiModelProperty("工作id")
private Long jobId;
/** 职位名称 */
@Excel(name = "职位名称")
@ApiModelProperty("职位名称")
private String jobTitle;
/** 最小薪资(元) */
@Excel(name = "最小薪资", readConverterExp = "元=")
@ApiModelProperty("最小薪资(元)")
private Long minSalary;
/** 最大薪资(元) */
@Excel(name = "最大薪资", readConverterExp = "元=")
@ApiModelProperty("最大薪资(元)")
private Long maxSalary;
/** 学历要求 对应字典education */
@Excel(name = "学历要求 对应字典education")
@ApiModelProperty("学历要求 对应字典education")
private String education;
/** 工作经验要求 对应字典experience */
@Excel(name = "工作经验要求 对应字典experience")
@ApiModelProperty("工作经验要求 对应字典experience")
private String experience;
/** 用人单位名称 */
@Excel(name = "用人单位名称")
@ApiModelProperty("用人单位名称")
private String companyName;
/** 工作地点 */
@Excel(name = "工作地点")
@ApiModelProperty("工作地点")
private String jobLocation;
@@ -69,34 +61,28 @@ public class Job extends BaseEntity
@ApiModelProperty("工作地点区县字典代码")
private Integer jobLocationAreaCode;
/** 发布时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("发布时间")
private Date postingDate;
private String postingDate;
/** 招聘人数 */
@Excel(name = "招聘人数")
@ApiModelProperty("招聘人数")
private Long vacancies;
/** 纬度 */
@Excel(name = "纬度")
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** 经度 */
@Excel(name = "经度")
@ApiModelProperty("经度")
private BigDecimal longitude;
/** 浏览量 */
@Excel(name = "浏览量")
@ApiModelProperty("浏览量")
@TableField("\"VIEW\"")
@TableField("\"view\"")
private Long view;
/** 公司id */
@Excel(name = "公司id")
@ApiModelProperty("公司id")
private Long companyId;
@@ -125,24 +111,41 @@ public class Job extends BaseEntity
@ApiModelProperty("是否发布 0未发布 1发布")
private Integer isPublish;
@ApiModelProperty("数据来源")
private String dataSource;
@ApiModelProperty("数据来源")
@ApiModelProperty("岗位链接")
private String jobUrl;
@ApiModelProperty("jobRow对应id")
private Long rowId;
@TableField(exist = false)
@ApiModelProperty("公司规模")
private String scale;
@TableField(exist = false)
@ApiModelProperty("行业分类")
private String industry;
@ApiModelProperty("岗位分类")
private String jobCategory;
@TableField(exist = false)
@ApiModelProperty("公司性质")
private String companyNature;
@TableField(exist = false)
@ApiModelProperty("申请时间")
private String applyTime;
@ApiModelProperty("是否有视频介绍")
private Integer isExplain;
@ApiModelProperty("视频介绍URL")
private String explainUrl;
@ApiModelProperty("视频封面URL")
private String cover;
}

View File

@@ -22,22 +22,18 @@ public class JobApply extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 岗位id */
@Excel(name = "岗位id")
@ApiModelProperty("岗位id")
private Long jobId;
/** App用户id */
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;
/** 匹配度 */
@Excel(name = "匹配度")
@ApiModelProperty("匹配度")
private Long matchingDegree;

View File

@@ -1,15 +1,14 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import lombok.Data;
/**
* 用户岗位收藏对象 job_collection
@@ -24,17 +23,14 @@ public class JobCollection extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 岗位id */
@Excel(name = "岗位id")
@ApiModelProperty("岗位id")
private Long jobId;
/** App用户id */
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;

View File

@@ -27,56 +27,56 @@ public class JobFair extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 招聘会id */
@TableId(value = "job_fair_id",type = IdType.AUTO)
@ApiModelProperty("招聘会id")
private Long jobFairId;
/** 招聘会名称 */
@Excel(name = "招聘会名称")
@ApiModelProperty("招聘会名称")
private String name;
/** 招聘会类型 对应字典 job_fair_type */
@Excel(name = "招聘会类型 对应字典 job_fair_type")
@ApiModelProperty("招聘会类型 对应字典 job_fair_type")
private String jobFairType;
/** 地点 */
@Excel(name = "地点")
@ApiModelProperty("地点")
private String location;
/** 纬度 */
@Excel(name = "纬度")
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** 经度 */
@Excel(name = "经度")
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("描述")
private String description;
@ApiModelProperty("地点")
private String address;
/** 招聘会开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "招聘会开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("招聘会开始时间")
private Date startTime;
/** 招聘会结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "招聘会结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("招聘会结束时间")
private Date endTime;
@TableField(exist = false)
@ApiModelProperty("公司列表")
private List<Company> companyList;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("程序时间")
private Date queryDate;
@TableField(exist = false)
@ApiModelProperty("是否收藏")
public Integer isCollection;
}

View File

@@ -23,17 +23,14 @@ public class JobRecomment extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/** 岗位id */
@Excel(name = "岗位id")
@ApiModelProperty("岗位id")
private Long jobId;
/** App用户id */
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;

View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@@ -17,19 +18,34 @@ public class Notice extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** ID */
@TableId(value = "notice_id",type = IdType.AUTO)
private Long noticeId;
/** 公告标题 */
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("副标题")
private String subTitle;
@ApiModelProperty("未读数量")
private Integer notReadCount;
@ApiModelProperty("是否阅读")
private Integer isRead;
@JsonFormat(pattern = "MM-dd")
@ApiModelProperty("日期")
private Date date;
@ApiModelProperty("通知类型")
private String noticeType;
/** 公告内容 */
@ApiModelProperty("公告内容")
private String noticeContent;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("业务id")
private Long bussinessId;
}

View File

@@ -1,9 +1,11 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName(value = "row_work")
public class RowWork {
private String Id;

View File

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -24,8 +22,12 @@ public class Statics extends BaseEntity
/** id */
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ApiModelProperty("时间")
private String time;
@ApiModelProperty("类型")
private String type;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("数据")
private String data;
}

View File

@@ -25,12 +25,10 @@ public class SubwayLine extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "line_id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long lineId;
/** 线路名称 */
@Excel(name = "线路名称")
@ApiModelProperty("线路名称")
private String lineName;

View File

@@ -23,37 +23,34 @@ public class SubwayStation extends BaseEntity
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** id */
@TableId(value = "station_id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long stationId;
/** 地铁名称 */
@Excel(name = "地铁名称")
@ApiModelProperty("地铁名称")
private String stationName;
/** 所属线路名称 */
@Excel(name = "所属线路名称")
@ApiModelProperty("所属线路名称")
private String lineName;
/** 线路id */
@Excel(name = "线路id")
@ApiModelProperty("线路id")
private Long lineId;
/** 纬度 */
@Excel(name = "纬度")
@ApiModelProperty("纬度")
private BigDecimal latitude;
/** 经度 */
@Excel(name = "经度")
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("排序")
private Integer stationOrder;
@ApiModelProperty("地址")
private String address;
}

View File

@@ -51,4 +51,7 @@ public class ESJobSearch extends Job
private String salaryDictCode;
private String scaleDictCode;
private String area;
}

View File

@@ -194,29 +194,5 @@ public class Staticsquery {
return Integer.compare(this.quarter, other.quarter);
}
}
// public static void main(String[] args) {
// // Month example
// Staticsquery monthQuery = new Staticsquery();
// monthQuery.setTimeDimension("月");
// monthQuery.setStartTime("2024-01");
// monthQuery.setEndTime("2024-04");
// System.out.println(monthQuery.generateTimeRange());
// // Output: [2024-01, 2024-02, 2024-03, 2024-04]
//
// // Quarter example
// Staticsquery quarterQuery = new Staticsquery();
// quarterQuery.setTimeDimension("季度");
// quarterQuery.setStartTime("2023-第四季度");
// quarterQuery.setEndTime("2024-第二季度");
// System.out.println(quarterQuery.generateTimeRange());
// // Output: [2023-第4季度, 2024-第1季度, 2024-第2季度]
//
// // Year example
// Staticsquery yearQuery = new Staticsquery();
// yearQuery.setTimeDimension("年");
// yearQuery.setStartTime("2020");
// yearQuery.setEndTime("2024");
// System.out.println(yearQuery.generateTimeRange());
// // Output: [2020, 2021, 2022, 2023, 2024]
// }
}

View File

@@ -17,9 +17,9 @@ public class SpeechRecognitionWebSocketHandler {
public SpeechRecognitionWebSocketHandler() {
// 初始化语音识别器
String appKey = "LuvNcrddU3PH8Tau";
String id = "LTAI5tRBahK93vPNF1JDVEPA";
String secret = "x95OWb4cV6ccQVtbEJ2Gxm2Uwl2thJ";
String appKey = "4lFYn2yPsQymwGu8";
String id = "LTAI5t9hhSqdDHqwH3RjgyYj";
String secret = "ni5aW3vxrWouMwcGqJPfh9Uu56PBuv";
String url = System.getenv().getOrDefault("NLS_GATEWAY_URL", "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1");
recognizerDemo = new SpeechRecognizerAI(appKey, id, secret, url);
}
@@ -44,6 +44,7 @@ public class SpeechRecognitionWebSocketHandler {
recognizerDemo.processStream(session, new ByteArrayInputStream(audioData), 16000);
}
/**
* 连接关闭调用的方法
*/

View File

@@ -7,23 +7,24 @@ import com.alibaba.nls.client.protocol.SampleRateEnum;
import com.alibaba.nls.client.protocol.asr.SpeechRecognizer;
import com.alibaba.nls.client.protocol.asr.SpeechRecognizerListener;
import com.alibaba.nls.client.protocol.asr.SpeechRecognizerResponse;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.websocket.Session;
import java.io.IOException;
import java.io.InputStream;
@Data
public class SpeechRecognizerAI {
private static final Logger logger = LoggerFactory.getLogger(SpeechRecognizerAI.class);
private String appKey;
private NlsClient client;
private AccessToken accessToken;
public SpeechRecognizerAI(String appKey, String id, String secret, String url) {
this.appKey = appKey;
// 获取 AccessToken
AccessToken accessToken = new AccessToken(id, secret);
accessToken = new AccessToken(id, secret);
try {
accessToken.apply(); // 申请 Token
logger.info("Token: {}, Expire Time: {}", accessToken.getToken(), accessToken.getExpireTime());
@@ -114,4 +115,28 @@ public class SpeechRecognizerAI {
client.shutdown();
}
}
/**
* 获取当前有效的 AccessToken
*
* @param id 阿里云 AccessKey ID
* @param secret 阿里云 AccessKey Secret
* @return 返回申请到的 AccessToken 字符串,失败时返回 null
*/
public static String getAccessToken(String id, String secret) {
try {
AccessToken accessToken = new AccessToken(id, secret);
accessToken.apply(); // 申请 token
if (accessToken.getToken() != null) {
logger.info("成功获取 Token: {}, 过期时间: {}", accessToken.getToken(), accessToken.getExpireTime());
return accessToken.getToken();
} else {
logger.error("get token fail:"+accessToken.getToken());
return null;
}
} catch (IOException e) {
logger.error("申请 Token 时发生网络错误: {}", e.getMessage());
return null;
}
}
}

View File

@@ -18,4 +18,6 @@ public interface AppUserMapper extends BaseMapper<AppUser>
* @return APP用户集合
*/
public List<AppUser> selectAppUserList(AppUser appUser);
List<AppUser> selectByJobId(Long jobId);
}

View File

@@ -22,7 +22,7 @@ public interface JobApplyMapper extends BaseMapper<JobApply>
*/
public List<JobApply> selectJobApplyList(JobApply jobApply);
//todo
List<Job> applyJob(Long userId);
List<CandidateVO> candidates(Long jobId);

View File

@@ -1,5 +1,6 @@
package com.ruoyi.cms.service;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.cms.domain.Company;
import com.ruoyi.cms.domain.CompanyCard;
@@ -68,4 +69,8 @@ public interface ICompanyService
void importLabel();
void importLabelBank();
void register(Company company);
Company registerStatus();
}

View File

@@ -63,4 +63,8 @@ public interface IESJobSearchService
ESJobDocument selectById(Long jobId);
void fix();
void updateJob(Long jobId);
void deleteJob(Long jobId);
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobCollection;
import com.ruoyi.cms.domain.vo.CompetitivenessResponse;
/**
* 用户岗位收藏Service接口
@@ -70,5 +71,5 @@ public interface IJobCollectionService
List<Job> collectionJob();
String competitiveness(Long jobId);
CompetitivenessResponse competitiveness(Long jobId);
}

View File

@@ -78,7 +78,7 @@ public interface IJobService
Job selectJobByJobIdApp(Long jobId);
void importRow();
void importRow(String path);
List<CandidateVO> candidates(Long jobId);
@@ -88,13 +88,5 @@ public interface IJobService
List<ESJobDocument> littleVideoRandom(String uuid, Integer count,String jobTitle);
void updateEs();
AppWechatEntity getWechatUrl(String wechatUrl);
String insertTemp(Job job);
String htmlGen(Long id);
void fix();
void publishJob(Job job);
}

View File

@@ -1,25 +1,20 @@
package com.ruoyi.cms.service.impl;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.cms.domain.AppReviewJob;
import com.ruoyi.cms.domain.Company;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.query.MineJobQuery;
import com.ruoyi.cms.mapper.AppReviewJobMapper;
import com.ruoyi.cms.service.IAppReviewJobService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户岗位浏览记录Service业务层处理
@@ -32,8 +27,7 @@ public class AppReviewJobServiceImpl extends ServiceImpl<AppReviewJobMapper, App
{
@Autowired
private AppReviewJobMapper appReviewJobMapper;
@Autowired
private IJobService jobService;
private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
/**
* 查询用户岗位浏览记录

View File

@@ -168,7 +168,7 @@ public class BussinessDictDataServiceImpl implements IBussinessDictDataService
type.replace("学历","");
}
if(Objects.equals(type, "不限学历")||Objects.equals(type, "学历不限")){
return "11";
return "-1";
}
if(Objects.equals(type, "中专")){
return "1";

View File

@@ -3,10 +3,7 @@ package com.ruoyi.cms.service.impl;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
import java.util.*;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
@@ -215,4 +212,21 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper,Company> imple
companyLabelMapper.insert(label);
});
}
@Override
public void register(Company company) {
Long userId = SecurityUtils.getUserId();
company.setUserId(userId);
if(companyMapper.selectCount(Wrappers.<Company>lambdaQuery().eq(Company::getName, company.getName()).in(Company::getStatus,Arrays.asList(0,1)))>0){
throw new ServiceException(company.getName()+"已经存在");
}
company.setStatus(0);
}
@Override
public Company registerStatus() {
Long userId = SecurityUtils.getUserId();
Company company = companyMapper.selectOne(Wrappers.<Company>lambdaQuery().eq(Company::getUserId, userId).orderByDesc(Company::getUpdateTime));
return company;
}
}

View File

@@ -75,7 +75,7 @@ public class ESJobSearchImpl implements IESJobSearchService
public void resetTextCache() {
logger.info("正在重新刷新es");
// 删除并重新创建索引
esJobDocumentMapper.deleteIndex("job_document_gt");
esJobDocumentMapper.deleteIndex("job_document");
esJobDocumentMapper.createIndex();
// 分批次处理数据
@@ -107,14 +107,14 @@ public class ESJobSearchImpl implements IESJobSearchService
if(!StringUtil.isEmptyOrNull(job.getExperience())){
esJobDocument.setExperience_int(Integer.valueOf(job.getExperience()));
}else {
esJobDocument.setExperience("8");
esJobDocument.setEducation_int(8);
esJobDocument.setExperience("0");
esJobDocument.setEducation_int(0);
}
if(!StringUtil.isEmptyOrNull(job.getEducation())){
esJobDocument.setEducation_int(Integer.valueOf(job.getEducation()));
}else {
esJobDocument.setEducation("11");
esJobDocument.setExperience_int(11);
esJobDocument.setEducation("-1");
esJobDocument.setExperience_int(-1);
}
if (esJobDocument.getLatitude() != null) {
esJobDocument.setLatAndLon(esJobDocument.getLatitude().toString() + "," + esJobDocument.getLongitude().toString());
@@ -137,37 +137,97 @@ public class ESJobSearchImpl implements IESJobSearchService
@Override
public List<ESJobDocument> selectTextListExceptJobId(ESJobSearch esJobSearch, List<Long> jobIds) {
ESJobSearch newSearch = new ESJobSearch();
BeanUtils.copyProperties(esJobSearch,newSearch);
//查询
if(SecurityUtils.isLogin()){
AppUser appUser = appUserService.selectAppUserByUserId(SecurityUtils.getUserId());
if(!ListUtil.isEmptyOrNull(appUser.getJobTitle())&&!StringUtil.isEmptyOrNull(esJobSearch.getJobTitle())){
esJobSearch.setJobTitle(String.join(",", appUser.getJobTitle()));
if(!ListUtil.isEmptyOrNull(appUser.getJobTitle())){
List<String> jobTitle = appUser.getJobTitle();
newSearch.setJobTitle(String.join(",", jobTitle));
}
if(!StringUtil.isEmptyOrNull(appUser.getEducation())&&!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
esJobSearch.setEducation(appUser.getEducation());
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobTitle())){
newSearch.setJobTitle(esJobSearch.getJobTitle());
}
if(!StringUtil.isEmptyOrNull(appUser.getEducation())){
newSearch.setEducation(appUser.getEducation());
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
newSearch.setEducation(esJobSearch.getEducation());
}
if(!StringUtil.isEmptyOrNull(appUser.getArea())){
esJobSearch.setJobLocationAreaCode(Integer.valueOf(appUser.getArea()));
newSearch.setArea(appUser.getArea());
}
if(!StringUtil.isEmptyOrNull(appUser.getExperience())&&!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
esJobSearch.setExperience(appUser.getExperience());
if(!StringUtil.isEmptyOrNull(esJobSearch.getArea())){
newSearch.setArea(esJobSearch.getArea());
}
if(!StringUtil.isEmptyOrNull(appUser.getExperience())){
newSearch.setExperience(appUser.getExperience());
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
newSearch.setExperience(esJobSearch.getExperience());
}
if(!StringUtil.isEmptyOrNull(appUser.getSalaryMax())){
esJobSearch.setMaxSalary(Long.valueOf(appUser.getSalaryMax()));
newSearch.setMaxSalary(Long.valueOf(appUser.getSalaryMax()));
}
if(!StringUtil.isEmptyOrNull(appUser.getSalaryMin())){
esJobSearch.setMaxSalary(Long.valueOf(appUser.getSalaryMin()));
newSearch.setMinSalary(Long.valueOf(appUser.getSalaryMin()));
}
}
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(esJobSearch);
if(!ListUtil.isListEmptyOrNull(jobIds)){
wrapper.in(ESJobDocument::getJobId, jobIds);
}
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(newSearch,jobIds);
//todo 暂时
wrapper.limit(esJobSearch.getPageSize());
wrapper.orderByDesc(ESJobDocument::getCompanyId);
return esJobDocumentMapper.selectList(wrapper);
List<ESJobDocument> esJobDocuments = esJobDocumentMapper.selectList(wrapper);
if (esJobDocuments.size() < esJobSearch.getPageSize()) {
// 定义要逐步放宽的搜索条件字段
List<Runnable> relaxConditions = new ArrayList<>();
relaxConditions.add(() -> newSearch.setArea(null));
relaxConditions.add(() -> newSearch.setExperience(null));
relaxConditions.add(() -> newSearch.setMaxSalary(null));
relaxConditions.add(() -> newSearch.setMinSalary(null));
relaxConditions.add(() -> newSearch.setEducation(null));
relaxConditions.add(()-> newSearch.setJobTitle(null));
// 保存所有查询到的文档
List<ESJobDocument> allDocuments = new ArrayList<>(esJobDocuments);
// 记录已经放宽的条件数量
int relaxedConditions = 0;
// 继续放宽条件直到满足分页或所有条件都已放宽
while (allDocuments.size() < esJobSearch.getPageSize()
&& relaxedConditions < relaxConditions.size()) {
// 放宽下一个条件
relaxConditions.get(relaxedConditions).run();
relaxedConditions++;
// 查询新增的文档(不包含之前已经查询到的)
wrapper = getWrapper(newSearch, jobIds);
wrapper.limit(esJobSearch.getPageSize() - allDocuments.size());
if (!allDocuments.isEmpty()) {
// 排除已经查询到的文档ID
Set<String> existingIds = allDocuments.stream()
.map(ESJobDocument::getId)
.collect(Collectors.toSet());
wrapper.not().in(ESJobDocument::getId, existingIds);
}
List<ESJobDocument> newDocuments = esJobDocumentMapper.selectList(wrapper);
allDocuments.addAll(newDocuments);
}
// 如果总数超过分页大小,截取所需数量
if (allDocuments.size() > esJobSearch.getPageSize()) {
esJobDocuments = allDocuments.subList(0, esJobSearch.getPageSize());
} else {
esJobDocuments = allDocuments;
}
}
return esJobDocuments;
}
@@ -221,7 +281,7 @@ public class ESJobSearchImpl implements IESJobSearchService
public EsPageInfo<ESJobDocument> nearJob(ESJobSearch jobQuery) {
Integer pageNum = jobQuery.getCurrent();
Integer pageSize = jobQuery.getPageSize();
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery);
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery,null);
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = esJobDocumentMapper.pageQuery(wrapper, pageNum, pageSize);
return esJobDocumentEsPageInfo;
}
@@ -230,7 +290,7 @@ public class ESJobSearchImpl implements IESJobSearchService
public EsPageInfo<ESJobDocument> countyJobList(ESJobSearch jobQuery) {
Integer pageNum = jobQuery.getCurrent();
Integer pageSize = jobQuery.getPageSize();
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery);
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery, null);
if(jobQuery.getCountyIds()!=null){
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,jobQuery.getCountyIds()));
}
@@ -242,7 +302,7 @@ public class ESJobSearchImpl implements IESJobSearchService
public EsPageInfo<ESJobDocument> subway(ESJobSearch jobQuery) {
Integer pageNum = jobQuery.getCurrent();
Integer pageSize = jobQuery.getPageSize();
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery);
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery,null);
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = esJobDocumentMapper.pageQuery(wrapper, pageNum, pageSize);
return esJobDocumentEsPageInfo;
}
@@ -251,7 +311,7 @@ public class ESJobSearchImpl implements IESJobSearchService
public EsPageInfo<ESJobDocument> commercialArea(ESJobSearch jobQuery) {
Integer pageNum = jobQuery.getCurrent();
Integer pageSize = jobQuery.getPageSize();
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery);
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(jobQuery,null);
if(jobQuery.getLongitude()!=null){
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(jobQuery.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(jobQuery.getLatitude().toString()), Double.parseDouble(jobQuery.getLongitude().toString())));
}
@@ -263,7 +323,6 @@ public class ESJobSearchImpl implements IESJobSearchService
public List<ESJobDocument> littleVideo(ESJobSearch esJobSearch) {
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
wrapper.eq(ESJobDocument::getIsExplain, 1);
wrapper.orderByDesc(ESJobDocument::getIsExplain);
wrapper.limit(esJobSearch.getPageSize());
return esJobDocumentMapper.selectList(wrapper);
}
@@ -297,29 +356,17 @@ public class ESJobSearchImpl implements IESJobSearchService
return esJobDocumentMapper.selectList(wrapper);
}
private LambdaEsQueryWrapper<ESJobDocument> getWrapper(ESJobSearch esJobSearch){
List<String> searchList = new ArrayList<>();
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobTitle())){
searchList.add(esJobSearch.getJobTitle());
}else {
if(SecurityUtils.isLogin()){
AppUser appUser = appUserService.selectAppUserByUserId(SecurityUtils.getUserId());
List<String> jobTitleList = appUser.getJobTitle();
if(!jobTitleList.isEmpty()){
searchList.addAll(jobTitleList);
}
}
}
private LambdaEsQueryWrapper<ESJobDocument> getWrapper(ESJobSearch esJobSearch,List<Long> jobIds){
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
if (!searchList.isEmpty())
{
for (String keyWords:searchList){
wrapper.or(a -> a.like(ESJobDocument::getJobTitle, keyWords, 5.0f)
.or()
.like(ESJobDocument::getDescription, keyWords, 1.0f)
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobTitle())){
for (String keyWord:esJobSearch.getJobTitle().split(",")) {
wrapper.and(a -> a.match(ESJobDocument::getJobTitle, keyWord, 5.0f)
);
}
}
if(esJobSearch.getLongitude()!=null){
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(esJobSearch.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(esJobSearch.getLatitude().toString()), Double.parseDouble(esJobSearch.getLongitude().toString())));
}
@@ -344,6 +391,10 @@ public class ESJobSearchImpl implements IESJobSearchService
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getArea())){
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getArea());
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
}
if(Objects.nonNull(esJobSearch.getOrder())){
if(esJobSearch.getOrder()==1){
wrapper.orderByDesc(ESJobDocument::getIsHot);
@@ -352,7 +403,9 @@ public class ESJobSearchImpl implements IESJobSearchService
wrapper.orderByDesc(ESJobDocument::getPostingDate);
}
}
//TODO LIST
if(!ListUtil.isListEmptyOrNull(jobIds)){
wrapper.not().in(ESJobDocument::getJobId, jobIds);
}
return wrapper;
}
@@ -362,6 +415,13 @@ public class ESJobSearchImpl implements IESJobSearchService
Integer pageNum = jobQuery.getCurrent();
Integer pageSize = jobQuery.getPageSize();
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
// if(SecurityUtils.isLogin()){
// AppUser appUser = appUserService.selectAppUserByUserId(SecurityUtils.getUserId());
// if(!ListUtil.isEmptyOrNull(appUser.getJobTitle())){
// List<String> jobTitle = appUser.getJobTitle();
// jobQuery.setJobTitle(String.join(",", jobTitle));
// }
// }
if(!StringUtil.isEmptyOrNull(jobQuery.getJobTitle())){
wrapper.and(a->a.match(ESJobDocument::getJobTitle,jobQuery.getJobTitle(),5.0f)
.or()
@@ -370,7 +430,10 @@ public class ESJobSearchImpl implements IESJobSearchService
if(!StringUtil.isEmptyOrNull(jobQuery.getEducation())){
wrapper.and(a->a.le(ESJobDocument::getEducation,jobQuery.getEducation()));
}
if(!StringUtil.isEmptyOrNull(jobQuery.getArea())){
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getArea());
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
}
if(!StringUtil.isEmptyOrNull(jobQuery.getExperience())){
wrapper.and(a->a.le(ESJobDocument::getExperience,jobQuery.getExperience()));
}
@@ -430,7 +493,51 @@ public class ESJobSearchImpl implements IESJobSearchService
for (ESJobDocument esJobDocument : esJobDocuments) {
Job job = new Job();
BeanUtils.copyProperties(esJobDocument,job);
job.setJobId(null);
jobMapper.insert(job);
}
}
@Override
public void deleteJob(Long jobId) {
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,jobId);
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
}
@Override
public void updateJob(Long jobId) {
ESJobDocument esJobDocument = new ESJobDocument();
Job job = jobMapper.selectById(jobId);
BeanUtils.copyBeanProp(esJobDocument, job);
esJobDocument.setAppJobUrl("https://ks.zhaopinzao8dian.com/app#/packageA/pages/post/post?jobId="+ Base64.getEncoder().encodeToString(String.valueOf(job.getJobId()).getBytes()));
if(!StringUtil.isEmptyOrNull(job.getScale())){
esJobDocument.setScale(Integer.valueOf(job.getScale()));
}else {
esJobDocument.setScale(0);
}
if(!StringUtil.isEmptyOrNull(job.getExperience())){
esJobDocument.setExperience_int(Integer.valueOf(job.getExperience()));
}else {
esJobDocument.setExperience("0");
esJobDocument.setExperience_int(0);
}
if(!StringUtil.isEmptyOrNull(job.getEducation())){
esJobDocument.setEducation_int(Integer.valueOf(job.getEducation()));
}else {
esJobDocument.setEducation("-1");
esJobDocument.setEducation_int(-1);
}
if (esJobDocument.getLatitude() != null) {
esJobDocument.setLatAndLon(esJobDocument.getLatitude().toString() + "," + esJobDocument.getLongitude().toString());
}
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
esJobDocument.setCompanyNature("6");
}
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,job.getJobId());
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
esJobDocumentMapper.insert(esJobDocument);
}
}

View File

@@ -1,21 +1,24 @@
package com.ruoyi.cms.service.impl;
import java.util.List;
import java.util.Arrays;
import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.cms.domain.AppUser;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.domain.vo.CompetitivenessResponse;
import com.ruoyi.cms.domain.vo.RadarChart;
import com.ruoyi.cms.mapper.AppUserMapper;
import com.ruoyi.cms.mapper.JobApplyMapper;
import com.ruoyi.cms.mapper.JobMapper;
import com.ruoyi.cms.service.IBussinessDictTypeService;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.JobCollectionMapper;
import com.ruoyi.cms.domain.JobCollection;
import com.ruoyi.cms.service.IJobCollectionService;
import org.springframework.transaction.annotation.Transactional;
@@ -34,6 +37,10 @@ public class JobCollectionServiceImpl extends ServiceImpl<JobCollectionMapper,Jo
private JobApplyMapper jobApplyMapper;
@Autowired
private AppUserMapper appUserMapper;
@Autowired
private JobMapper jobMapper;
@Autowired
private IBussinessDictTypeService iBussinessDictTypeService;
/**
* 查询用户岗位收藏
*
@@ -147,9 +154,237 @@ public class JobCollectionServiceImpl extends ServiceImpl<JobCollectionMapper,Jo
}
@Override
public String competitiveness(Long jobId) {
AppUser appUser = appUserMapper.selectById(SecurityUtils.getUserId());
String education = appUser.getEducation();
return "90.5";
public CompetitivenessResponse competitiveness(Long jobId) {
// 查询岗位信息
Job job = jobMapper.selectById(jobId);
if (job == null) {
throw new RuntimeException("岗位不存在");
}
// 获取所有申请该岗位的用户
List<AppUser> appUsers = appUserMapper.selectByJobId(jobId);
Long applyCount = (long) appUsers.size();
if (appUsers.isEmpty()) {
// 没有人申请返回默认值或0
CompetitivenessResponse emptyResponse = new CompetitivenessResponse();
emptyResponse.setTotalApplicants(0);
emptyResponse.setMatchScore(0);
emptyResponse.setRank(0);
emptyResponse.setPercentile(0);
RadarChart radarChart = new RadarChart();
emptyResponse.setRadarChart(radarChart);
return emptyResponse;
}
// ================== 数据字典映射(用于排序比较)==================
// 假设你有字典工具类,如 DictUtils.getSort("education", value) 返回排序值
// 这里我们用 Map 模拟字典排序(越小要求越低)
// 获取字典数据
List<BussinessDictData> educationDict = iBussinessDictTypeService.selectDictDataByType("education");
List<BussinessDictData> experienceDict = iBussinessDictTypeService.selectDictDataByType("experience");
// 构建学历排序映射dictLabel -> dictSort越小要求越低
Map<String, Integer> educationRank = educationDict.stream()
.collect(Collectors.toMap(
BussinessDictData::getDictLabel,
data -> Math.toIntExact(data.getDictSort()),
(a, b) -> a // 若有重复 key保留第一个
));
Map<String, Integer> experienceRank = experienceDict.stream()
.collect(Collectors.toMap(
BussinessDictData::getDictLabel,
data -> Math.toIntExact(data.getDictSort()),
(a, b) -> a
));
// ================== 提取岗位要求 ==================
Integer jobEducationRank = educationRank.getOrDefault(job.getEducation(), 999);
Integer jobExperienceRank = experienceRank.getOrDefault(job.getExperience(), 999);
Integer jobMinSalary = job.getMinSalary() != null ? job.getMinSalary().intValue() : 0;
String jobLocation = job.getJobLocation();
// ================== 聚合用户数据用于分析 ==================
List<UserCompetitiveness> userScores = new ArrayList<>();
for (AppUser user : appUsers) {
int matchScore = 0;
int totalFactors = 6; // 年龄、经验、学历、技能(暂用期望岗位匹配)、薪资、地点
// 1. 学历匹配(越接近越好)
Integer userEduRank = educationRank.getOrDefault(user.getEducation(), 999);
if (userEduRank <= jobEducationRank) {
matchScore += 1; // 达标
} else if (userEduRank == jobEducationRank + 1) {
matchScore += 0.5; // 略高也算匹配
}
// 2. 经验匹配
Integer userExpRank = experienceRank.getOrDefault(user.getExperience(), 999);
if (userExpRank >= jobExperienceRank) {
matchScore += 1; // 满足经验要求
}
// 3. 薪资匹配(用户期望 <= 岗位最大薪资,且不低于最小太多)
Integer userMinSalary = parseSalary(user.getSalaryMin());
if (userMinSalary != null && userMinSalary <= job.getMaxSalary()) {
if (userMinSalary >= job.getMinSalary()) {
matchScore += 1;
} else if (userMinSalary >= job.getMinSalary() * 0.8) {
matchScore += 0.5;
}
}
// 4. 地点匹配
if (user.getArea() != null && user.getArea().contains(jobLocation) || jobLocation.contains(user.getArea())) {
matchScore += 1;
}
// 5. 年龄估算(从生日计算)
int userAge = getUserAge(user.getBirthDate());
// 假设最佳年龄区间为 22-35越接近越匹配
if (userAge >= 22 && userAge <= 35) {
matchScore += 1;
} else if (userAge >= 18 && userAge <= 45) {
matchScore += 0.5;
}
// 6. 技能/岗位匹配(简化:期望岗位是否包含该岗位关键词)
boolean jobMatch = user.getJobTitle() != null &&
user.getJobTitle().stream().anyMatch(title -> title.contains(job.getJobTitle()) || job.getJobTitle().contains(title));
if (jobMatch) {
matchScore += 1;
}
// 匹配度0-6 → 映射为 0-100 分
int finalScore = (int) Math.round((matchScore / (double) totalFactors) * 100);
userScores.add(new UserCompetitiveness(user, finalScore));
}
// 按匹配度降序
userScores.sort((a, b) -> Integer.compare(b.getScore(), a.getScore()));
// ================== 计算雷达图数据(取平均值)==================
RadarChart radarChart = new RadarChart();
double avgAgeScore = userScores.stream().mapToInt(u -> getAgeScore(u.getUser().getBirthDate())).average().orElse(0);
double avgExperienceScore = userScores.stream().mapToInt(u -> getExperienceScore(u.getUser().getExperience(), job.getExperience(), experienceRank)).average().orElse(0);
double avgEducationScore = userScores.stream().mapToInt(u -> getEducationScore(u.getUser().getEducation(), job.getEducation(), educationRank)).average().orElse(0);
double avgSkillScore = userScores.stream().mapToInt(u -> getSkillScore(u.getUser(), job)).average().orElse(0);
double avgSalaryScore = userScores.stream().mapToInt(u -> getSalaryScore(u.getUser(), job)).average().orElse(0);
double avgLocationScore = userScores.stream().mapToInt(u -> getLocationScore(u.getUser(), job)).average().orElse(0);
radarChart.setAge((int) avgAgeScore);
radarChart.setExperience((int) avgExperienceScore);
radarChart.setEducation((int) avgEducationScore);
radarChart.setSkill((int) avgSkillScore);
radarChart.setSalary((int) avgSalaryScore);
radarChart.setLocation((int) avgLocationScore);
// ================== 返回响应 ==================
CompetitivenessResponse response = new CompetitivenessResponse();
response.setTotalApplicants(Math.toIntExact(applyCount));
// Top 用户的匹配分
int topMatchScore = userScores.get(0).getScore();
response.setMatchScore(topMatchScore);
// 排名Top1
response.setRank(1);
// 百分位top用户超过多少人100%
response.setPercentile(100);
response.setRadarChart(radarChart);
return response;
}
private int getUserAge(Date birthDate) {
if (birthDate == null) return 0;
try {
LocalDate birth = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
return Period.between(birth, LocalDate.now()).getYears();
} catch (Exception e) {
return 0;
}
}
private int getEducationScore(String userEdu, String jobEdu, Map<String, Integer> rankMap) {
if (userEdu == null || jobEdu == null) return 60;
Integer u = rankMap.getOrDefault(userEdu, 999);
Integer j = rankMap.getOrDefault(jobEdu, 999);
if (u <= j) return 90;
if (u == j + 1) return 75;
return 60;
}
private int getExperienceScore(String userExp, String jobExp, Map<String, Integer> rankMap) {
if (userExp == null || jobExp == null) return 60;
Integer u = rankMap.getOrDefault(userExp, 999);
Integer j = rankMap.getOrDefault(jobExp, 999);
if (u >= j) return 90;
if (u >= j - 1) return 75; // 容忍略低一年
return 60;
}
private int getSalaryScore(AppUser user, Job job) {
Integer min = parseSalary(user.getSalaryMin());
if (min == null) return 60;
if (job.getMinSalary() == null || job.getMaxSalary() == null) return 60;
long jobMin = job.getMinSalary();
long jobMax = job.getMaxSalary();
if (min >= jobMin && min <= jobMax) return 90;
if (min >= jobMin * 0.8 && min <= jobMax * 1.2) return 75;
return 60;
}
private int getLocationScore(AppUser user, Job job) {
String area = user.getArea();
String loc = job.getJobLocation();
if (area != null && (area.contains(loc) || loc.contains(area))) return 90;
return 60;
}
private int getSkillScore(AppUser user, Job job) {
String jobTitle = job.getJobTitle();
List<String> userTitles = user.getJobTitle();
if (jobTitle == null || userTitles == null || userTitles.isEmpty()) return 60;
boolean match = userTitles.stream()
.anyMatch(title -> title != null &&
(title.contains(jobTitle) || jobTitle.contains(title)));
return match ? 90 : 60;
}
private Integer parseSalary(String salaryStr) {
if (salaryStr == null || salaryStr.trim().isEmpty()) return null;
try {
// 提取第一个连续数字
String numberStr = salaryStr.replaceAll("[^0-9]", "");
return numberStr.isEmpty() ? null : Integer.parseInt(numberStr);
} catch (Exception e) {
return null;
}
}
private int getAgeScore(Date birthDate) {
int age = getUserAge(birthDate);
if (age == 0) return 60; // 无法获取年龄,默认低分
if (age >= 22 && age <= 35) return 90;
if (age >= 18 && age <= 45) return 75;
return 60;
}
private static class UserCompetitiveness {
private final AppUser user;
private final int score;
public UserCompetitiveness(AppUser user, int score) {
this.user = user;
this.score = score;
}
public AppUser getUser() {
return user;
}
public int getScore() {
return score;
}
}
}

View File

@@ -33,6 +33,8 @@ import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -253,12 +255,17 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Override
public int updateJob(Job job)
{
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//修改岗位状态
//修改岗位状态
if(job.getIsPublish()!=null) {
if(job.getIsPublish()==1){
job.setPostingDate(new Date());
job.setPostingDate(formattedDate);
iesJobSearchService.updateJob(job.getJobId());
}else {
job.setPostingDate(null);
iesJobSearchService.deleteJob(job.getJobId());
}
}
return jobMapper.updateById(job);
@@ -295,7 +302,6 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
}else {
jobList = cacheObject.toList(Long.class);
}
//从kafka中消费 bert模型跑出来的结果
//从es中查询
List<ESJobDocument> jobListResult = iesJobSearchService.selectTextListExceptJobId(esJobSearch,jobList);
//存入当前session中查看的岗位 避免重复 todo 定时删除 key上保存用户信息
@@ -331,41 +337,36 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Override
public Job selectJobByJobIdApp(Long jobId) {
try {
Job job = new Job();
ESJobDocument esJobDocument = iesJobSearchService.selectById(jobId);
BeanUtils.copyProperties(esJobDocument,job);
Job job = jobMapper.selectById(jobId);
//查询公司信息
if(Objects.nonNull(job.getCompanyId())){
Company company = companyMapper.selectById(job.getCompanyId());
job.setCompany(company);
}
// if(SecurityUtils.isLogin()){
// //查询申请信息
// Long applyCount = jobApplyMapper.selectCount(Wrappers.<JobApply>lambdaQuery().eq(JobApply::getJobId, jobId).eq(JobApply::getUserId, SecurityUtils.getUserId()));
// job.setIsApply(applyCount>0?1:0);
// //查询收藏信息
// Long collectionCount = jobCollectionMapper.selectCount(Wrappers.<JobCollection>lambdaQuery().eq(JobCollection::getJobId, jobId).eq(JobCollection::getUserId, SecurityUtils.getUserId()));
// job.setIsCollection(collectionCount>0?1:0);
// //todo asyn
// //保存浏览记录
// List<AppReviewJob> appReviewJobs = appReviewJobMapper.selectList(Wrappers.<AppReviewJob>lambdaQuery().eq(AppReviewJob::getUserId, SecurityUtils.getUserId()).eq(AppReviewJob::getJobId, jobId));
// //之前相同岗位的记录删除 保存最新的浏览记录
// if(!appReviewJobs.isEmpty()){
// appReviewJobMapper.deleteBatchIds(appReviewJobs.stream().map(AppReviewJob::getId).collect(Collectors.toList()));
// }
// AppReviewJob appReviewJob = new AppReviewJob();
// appReviewJob.setUserId(SecurityUtils.getUserId());
// appReviewJob.setReviewDate(new Date());
// appReviewJob.setJobId(jobId);
// appReviewJobMapper.insert(appReviewJob);
// }
//浏览量+1
// this.view(jobId);
if(SecurityUtils.isLogin()){
//查询申请信息
Long applyCount = jobApplyMapper.selectCount(Wrappers.<JobApply>lambdaQuery().eq(JobApply::getJobId, jobId).eq(JobApply::getUserId, SecurityUtils.getUserId()));
job.setIsApply(applyCount>0?1:0);
//查询收藏信息
Long collectionCount = jobCollectionMapper.selectCount(Wrappers.<JobCollection>lambdaQuery().eq(JobCollection::getJobId, jobId).eq(JobCollection::getUserId, SecurityUtils.getUserId()));
job.setIsCollection(collectionCount>0?1:0);
//todo asyn
//保存浏览记录
List<AppReviewJob> appReviewJobs = appReviewJobMapper.selectList(Wrappers.<AppReviewJob>lambdaQuery().eq(AppReviewJob::getUserId, SecurityUtils.getUserId()).eq(AppReviewJob::getJobId, jobId));
//之前相同岗位的记录删除 保存最新的浏览记录
if(!appReviewJobs.isEmpty()){
appReviewJobMapper.deleteBatchIds(appReviewJobs.stream().map(AppReviewJob::getId).collect(Collectors.toList()));
}
AppReviewJob appReviewJob = new AppReviewJob();
appReviewJob.setUserId(SecurityUtils.getUserId());
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
appReviewJob.setReviewDate(formattedDate);
appReviewJob.setJobId(jobId);
appReviewJobMapper.insert(appReviewJob);
}
this.view(jobId);
return job;
}catch (Exception e){
return this.selectJobByJobId(jobId);
}
}
@@ -398,12 +399,9 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Override
public List<ESJobDocument> littleVideo(ESJobSearch esJobSearch) {
return iesJobSearchService.littleVideo(esJobSearch);
}
@Override
public void updateEs() {
iesJobSearchService.updateEs();
return iesJobSearchService.littleVideo(esJobSearch);
}
@Override
@@ -450,77 +448,12 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
return esJobDocuments;
}
// @Override
// public void importRow() {
//
//
// try {
// logger.info("开始导入Excel数据...");
//
// // 读取Excel文件中的数据
// List<RowWork> rowWorks = ExcelToObject.readExcelToObjects("D:\\QD\\青岛市近一个月数据.xlsx", RowWork.class);
// logger.info("从Excel中读取到 {} 条数据", rowWorks.size());
//
// // 从数据库中获取已有的数据
// List<RowWork> rowWorksInMysql = jobMapper.selectAllRowWork();
// logger.info("从数据库中查询到 {} 条已有数据", rowWorksInMysql.size());
//
// // 创建一个Set来存储数据库中已有的记录的唯一标识
// Set<String> existingRecords = new HashSet<>();
// for (RowWork rowWork : rowWorksInMysql) {
// String uniqueKey = rowWork.getJobCategory() + "_" + rowWork.getAca112() + "_" + rowWork.getAcb202();
// existingRecords.add(uniqueKey);
// }
// logger.info("已加载 {} 条唯一标识到内存", existingRecords.size());
//
// // 创建一个列表来收集待插入的数据
// List<RowWork> batchList = new ArrayList<>();
// int batchSize = 100; // 每批次插入的数量
// int totalInserted = 0; // 记录总共插入的数据量
//
// // 遍历Excel中的数据进行去重并收集待插入的数据
// for (RowWork rowWork : rowWorks) {
// String uniqueKey = rowWork.getStd_class() + "_" + rowWork.getAca112() + "_" + rowWork.getAcb202();
// if (!existingRecords.contains(uniqueKey)) {
// batchList.add(rowWork); // 添加到待插入列表
// existingRecords.add(uniqueKey); // 添加到已存在集合,避免重复
// // 当待插入列表达到批次大小时,执行批量插入
// if (batchList.size() >= batchSize) {
// try {
// jobMapper.insertBatchRowWork(batchList); // 批量插入
// totalInserted += batchList.size();
// logger.info("成功插入 {} 条数据,当前总共插入 {} 条数据", batchList.size(), totalInserted);
// batchList.clear(); // 清空列表,准备下一批次
// } catch (Exception e) {
// logger.error("批量插入失败: " + e.getMessage(), e);
// }
// }
// }
// }
//
// // 插入剩余的数据如果不足100条
// if (!batchList.isEmpty()) {
// try {
// jobMapper.insertBatchRowWork(batchList); // 插入剩余数据
// totalInserted += batchList.size();
// logger.info("成功插入剩余的 {} 条数据,当前总共插入 {} 条数据", batchList.size(), totalInserted);
// } catch (Exception e) {
// logger.error("批量插入剩余数据失败: " + e.getMessage(), e);
// }
// }
//
// logger.info("数据导入完成,总共插入 {} 条数据", totalInserted);
// } catch (Exception e) {
// logger.error("导入数据过程中发生异常: " + e.getMessage(), e);
// throw new RuntimeException(e);
// }
// }
@Override
public void importRow() {
public void importRow(String path) {
try {
logger.info("开始导入Excel数据...");
// 读取Excel文件中的数据
List<RowWork> rowWorks = ExcelToObject.readExcelToObjects("/home/lapuda/Desktop/import.xlsx", RowWork.class);
List<RowWork> rowWorks = ExcelToObject.readExcelToObjects(path, RowWork.class);
logger.info("从Excel中读取到 {} 条数据", rowWorks.size());
// 按ORG分类存储数据
@@ -647,18 +580,30 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
int totalJobInserted = 0;
String string = UUID.randomUUID().toString();
logger.info("生成唯一标识符: {}", string);
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
for (RowWork rowWork : rowWorks) {
try {
Job job = new Job();
if(StringUtil.isEmptyOrNull(rowWork.getAca112())){
continue;
}
job.setJobTitle(rowWork.getAca112());
job.setMinSalary(Long.valueOf(rowWork.getSalaryLow()));
job.setMaxSalary(Long.valueOf(rowWork.getSalaryHight()));
job.setEducation(iBussinessDictDataService.findCode(dictData, rowWork.getAac011()));
job.setExperience(iBussinessDictDataService.findCode(expData, rowWork.getExperience()));
if(Objects.isNull(rowWork.getAac011())){
job.setEducation("-1");
}else {
job.setEducation(iBussinessDictDataService.findCode(dictData, rowWork.getAac011()));
}
if(Objects.isNull(rowWork.getExperience())){
job.setExperience("0");
}else {
job.setExperience(iBussinessDictDataService.findCode(expData, rowWork.getExperience()));
}
job.setCompanyName(rowWork.getAAB004());
job.setJobLocation(rowWork.getAAE006());
job.setPostingDate(new Date());
job.setPostingDate(formattedDate);
job.setJobCategory(rowWork.getJobCategory());
if (rowWork.getAcb240() == null) {
job.setVacancies(-1L);
@@ -673,7 +618,11 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
job.setCompanyId(getCompanyId(allCompany, rowWork.getAAB004()));
job.setIsHot(0);
job.setApplyNum(0);
job.setJobLocationAreaCode(Integer.valueOf(Objects.requireNonNull(iBussinessDictDataService.findCode(areaData, rowWork.getCounty()))));
if(Objects.isNull(rowWork.getCounty())){
job.setJobLocationAreaCode(null);
}else {
job.setJobLocationAreaCode(Integer.valueOf(Objects.requireNonNull(iBussinessDictDataService.findCode(areaData, rowWork.getCounty()))));
}
job.setDescription(rowWork.getAcb22a());
job.setIsPublish(1);
job.setDataSource(rowWork.getORG());
@@ -681,7 +630,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
job.setRemark(string);
job.setDelFlag("0");
job.setCreateBy(string);
job.setCreateTime(new Date());
job.setCreateTime(formattedDate);
job.setRowId(Long.valueOf(rowWork.getId()));
jobBatch.add(job);
@@ -726,23 +675,34 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
List<BussinessDictData> natureData = iBussinessDictTypeService.selectDictDataByType("company_nature");
List<TreeSelect> treeSelects = industryService.appIndustry();
List<Company> companyList = new ArrayList<>();
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
for(Company company:companyRowList){
Company companyNew = new Company();
companyNew.setName(company.getName());
companyNew.setLocation(company.getLocation());
companyNew.setScale(iBussinessDictDataService.findCode(scaleData,company.getScale()));
if(Objects.isNull(company.getScale())){
companyNew.setScale("0");
}else {
companyNew.setScale(iBussinessDictDataService.findCode(scaleData,company.getScale()));
}
companyNew.setDelFlag("0");
companyNew.setCreateBy("system");
companyNew.setCreateTime(new Date());
companyNew.setCreateTime(formattedDate);
companyNew.setRemark("add");
companyNew.setDescription(company.getDescription());
companyNew.setIndustry(findIndustry(treeSelects,company));
companyNew.setNature(iBussinessDictDataService.findCode(natureData,company.getNature()));
if(Objects.isNull(company.getNature())){
companyNew.setNature("8");
}else {
companyNew.setNature(iBussinessDictDataService.findCode(natureData,company.getNature()));
}
companyList.add(companyNew);
}
return companyList;
}
private String findIndustry(List<TreeSelect> treeSelects, Company company) {
if(company.getRemark()==null){return "";}
if(Objects.equals(company.getRemark(), "")){return "";}
@@ -776,108 +736,16 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
}
return jobs;
}
@Autowired
private WechatUtil wechatUtil;
@Override
public AppWechatEntity getWechatUrl(String weChatUrl) {
return wechatUtil.sign(weChatUrl);
}
@Override
public String insertTemp(Job job) {
String companyName = job.getCompanyName();
Company company = new Company();
company.setName(companyName);
companyMapper.insert(company);
public void publishJob(Job job) {
job.setIsPublish(0);
Long userId = SecurityUtils.getUserId();
Company company = companyMapper.selectOne(Wrappers.<Company>lambdaQuery().eq(Company::getUserId, userId).eq(Company::getStatus, 1));
if(Objects.isNull(company)){
throw new ServiceException("请先完成招聘企业登记");
}
job.setCompanyId(company.getCompanyId());
this.insertJob(job);
System.out.println(job.getJobId());
String url = "https://qd.zhaopinzao8dian.com/app#/packageA/pages/post/post?jobId="+Base64.getEncoder().encodeToString(String.valueOf(job.getJobId()).getBytes());
return url;
}
@Override
public String htmlGen(Long id) {
ESJobDocument esJobDocument = iesJobSearchService.selectById(id);
String jobTitle = esJobDocument.getJobTitle();
Long maxSalary = esJobDocument.getMaxSalary();
Long minSalary = esJobDocument.getMinSalary();
String companyName = esJobDocument.getCompanyName();
Long vacancies = esJobDocument.getVacancies();
// 1. 从服务器获取模板文件内容
String templateContent = fetchTemplateFromServer();
if (templateContent == null || templateContent.isEmpty()) {
return "";
}
// 2. 替换模板中的动态变量
String htmlContent = templateContent
.replace("${jobTitle}", jobTitle)
.replace("${companyName}", companyName)
.replace("${minSalary}", String.valueOf(minSalary))
.replace("${maxSalary}", String.valueOf(maxSalary))
.replace("${vacancies}", String.valueOf(vacancies))
.replace("${jobId}", String.valueOf(id));
// 3. 检查并创建目录
String directoryPath = "/data/file/share";
String directoryPath_domain = "/file/share";
File directory = new File(directoryPath);
if (!directory.exists()) {
directory.mkdirs();
}
// 4. 生成HTML文件
String fileName = "share_" + id + ".html";
String filePath = directoryPath + "/" + fileName;
File htmlFile = new File(filePath);
try {
// 如果文件已存在,先删除
if (htmlFile.exists()) {
return "https://qd.zhaopinzao8dian.com/file/share/"+fileName;
}
// 写入新内容
FileWriter writer = new FileWriter(htmlFile);
writer.write(htmlContent);
writer.close();
return "https://qd.zhaopinzao8dian.com/file/share/"+fileName;
} catch (IOException e) {
e.printStackTrace();
return "";
}
}
private String fetchTemplateFromServer() {
String templateUrl = "https://qd.zhaopinzao8dian.com/file/share/template.html";
try {
URL url = new URL(templateUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
BufferedReader reader = new BufferedReader(
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line).append("\n");
}
reader.close();
return response.toString();
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public void fix() {
iesJobSearchService.fix();
jobMapper.insert(job);
}
}

View File

@@ -1,5 +1,7 @@
package com.ruoyi.cms.util;
import com.ruoyi.cms.domain.query.ESJobSearch;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -47,4 +49,13 @@ public class StringUtil {
}
public static List<String> convertStringToStringList(String input) {
if (isEmptyOrNull(input)) {
return new ArrayList<>();
}
return Arrays.stream(input.split(",")) // 按逗号分割字符串
.map(String::trim) // 去除每个部分的前后空格
.collect(Collectors.toList()); // 收集为List
}
}

View File

@@ -17,7 +17,7 @@
<select id="selectAppReviewJobList" parameterType="AppReviewJob" resultMap="AppReviewJobResult">
<include refid="selectAppReviewJobVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="userId != null "> and user_id = #{userId}</if>
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="reviewDate != null "> and review_date = #{reviewDate}</if>
@@ -27,8 +27,8 @@
select j.*,r.review_date
from job as j
inner join app_review_job as r on r.job_id = j.job_id and user_id = #{userId}
where j.del_flag = 0
and r.del_flag = 0
where j.del_flag = '0'
and r.del_flag = '0'
<if test="jobQuery.startDate != null "> and r.review_date &gt; concat(#{jobQuery.startDate},' 23:59:59')</if>
<if test="jobQuery.endDate != null "> and r.review_date &lt; concat(#{jobQuery.endDate},' 23:59:59')</if>
<if test="jobQuery.jobTitle != null and jobQuery.jobTitle!=''"> and j.job_title like concat('%',#{jobQuery.jobTitle},'%') </if>
@@ -38,8 +38,8 @@
select r.review_date
from job as j
inner join app_review_job as r on r.job_id = j.job_id and user_id = #{userId}
where j.del_flag = 0
and r.del_flag = 0
where j.del_flag = '0'
and r.del_flag = '0'
group by r.review_date
</select>
</mapper>

View File

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAppUserList" parameterType="AppUser" resultMap="AppUserResult">
<include refid="selectAppUserVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="age != null and age != ''"> and age = #{age}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
@@ -54,4 +54,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="experience != null "> and experience = #{experience}</if>
</where>
</select>
<select id="selectByJobId" resultType="com.ruoyi.cms.domain.AppUser" parameterType="java.lang.Long">
SELECT * FROM app_user WHERE user_id IN (
select DISTINCT au.USER_ID from APP_USER au
INNER JOIN JOB_APPLY ja ON ja.USER_ID = au.USER_ID
WHERE au.DEL_FLAG = '0' AND ja.DEL_FLAG = '0' AND ja.JOB_Id = #{jobId})
</select>
</mapper>

View File

@@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCommercialAreaList" parameterType="CommercialArea" resultMap="CommercialAreaResult">
<include refid="selectCommercialAreaVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="commercialAreaName != null and commercialAreaName != ''"> and commercial_area_name like concat('%', #{commercialAreaName}, '%')</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="latitude != null "> and latitude = #{latitude}</if>

View File

@@ -22,7 +22,7 @@
<select id="selectCompanyCardCollectionList" parameterType="CompanyCardCollection" resultMap="CompanyCardCollectionResult">
<include refid="selectCompanyCardCollectionVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="userId != null "> and user_id = #{userId}</if>
<if test="companyCardId != null "> and company_card_id = #{companyCardId}</if>
</where>

View File

@@ -19,11 +19,10 @@
<result property="companyNature" column="company_nature" />
<result property="cardOrder" column="card_order" />
<result property="description" column="description" />
<result property="icon" column="icon" />
</resultMap>
<sql id="selectCompanyCardVo">
select company_card_id, name, targ, backgroud_color, del_flag, create_by, create_time, update_by, update_time, remark,status,company_nature,card_order,description,icon from company_card
select company_card_id, name, targ, backgroud_color, del_flag, create_by, create_time, update_by, update_time, remark,status,company_nature,card_order,description from company_card
</sql>
<select id="selectCompanyCardList" parameterType="CompanyCard" resultMap="CompanyCardResult">

View File

@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCompanyCollectionList" parameterType="CompanyCollection" resultMap="CompanyCollectionResult">
<include refid="selectCompanyCollectionVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
@@ -30,10 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="collectionJob" resultType="com.ruoyi.cms.domain.Company">
select *
from company
where del_flag = 0
where del_flag = '0'
and company_id in (SELECT DISTINCT (company_id)
FROM qd.company_collection
where del_flag = 0 and user_id = #{userId}
FROM company_collection
where del_flag = '0' and user_id = #{userId}
order by create_time desc)
</select>
</mapper>

View File

@@ -20,6 +20,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="description" column="description" />
<result property="nature" column="nature" />
<result property="totalRecruitment" column="total_recruitment" />
<result property="userId" column="user_id" />
<result property="businessLicenseUrl" column="business_license_url" />
<result property="idCardPictureUrl" column="id_card_picture_url" />
<result property="idCardPictureBackUrl" column="id_card_picture_back_url" />
<result property="powerOfAttorneyUrl" column="power_of_attorneyUrl" />
<result property="contactPerson" column="contact_person" />
<result property="contactPersonPhone" column="contact_person_phone" />
<result property="status" column="status" />
<result property="notPassReason" column="not_pass_reason" />
</resultMap>
<sql id="selectCompanyVo">
@@ -49,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCompanyList" parameterType="Company" resultMap="CompanyResult">
<include refid="selectCompanyVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="location != null and location != ''"> and location = #{location}</if>
<if test="industry != null and industry != ''"> and industry = #{industry}</if>

View File

@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFairCompanyList" parameterType="FairCompany" resultMap="FairCompanyResult">
<include refid="selectFairCompanyVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="jobFairId != null "> and job_fair_id = #{jobFairId}</if>
</where>

View File

@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFileList" parameterType="File" resultMap="FileResult">
<include refid="selectFileVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="bussinessId != null "> and bussinessId = #{bussinessId}</if>
</where>

View File

@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectIndustryList" parameterType="Industry" resultMap="IndustryResult">
<include refid="selectIndustryVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="industryName != null and industryName != ''"> and industry_name like concat('%', #{industryName}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>

View File

@@ -23,27 +23,27 @@
<select id="selectJobApplyList" parameterType="JobApply" resultMap="JobApplyResult">
<include refid="selectJobApplyVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="matchingDegree != null "> and matching_degree = #{matchingDegree}</if>
</where>
</select>
<select id="applyJob" resultType="com.ruoyi.cms.domain.Job">
select '2025-4-1' as applyTime,*
from job
where del_flag = 0
and is_publish = 1
and job_id in (SELECT DISTINCT (job_id)
FROM qd.job_apply
where del_flag = 0 and user_id = #{userId}
order by create_time desc)
SELECT ja.create_time AS applyTime, j.*
FROM job j
INNER JOIN job_apply ja ON j.job_id = ja.job_id
WHERE j.del_flag = '0'
AND j.is_publish = 1
AND ja.del_flag = '0'
AND ja.user_id = #{userId}
ORDER BY ja.create_time DESC
</select>
<select id="candidates" resultType="com.ruoyi.cms.domain.vo.CandidateVO">
SELECT au.*,jc.create_time as apply_date,jc.matching_degree
from job_apply as jc
inner join app_user as au on jc.user_id = au.user_id
where jc.job_id = #{jobId} and jc.del_flag = 0 and au.del_flag =0
where jc.job_id = #{jobId} and jc.del_flag = '0' and au.del_flag ='0'
</select>
</mapper>

View File

@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectJobCollectionList" parameterType="JobCollection" resultMap="JobCollectionResult">
<include refid="selectJobCollectionVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
@@ -30,11 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="collectionJob" resultType="com.ruoyi.cms.domain.Job">
select *
from job
where del_flag = 0
where del_flag = '0'
and is_publish = 1
and job_id in (SELECT DISTINCT (job_id)
FROM qd.job_collection
where del_flag = 0 and user_id = #{userId}
FROM job_collection
where del_flag = '0' and user_id = #{userId}
order by create_time desc)
</select>
</mapper>

View File

@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectJobFairList" parameterType="JobFair" resultMap="JobFairResult">
<include refid="selectJobFairVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
<if test="location != null and location != ''"> and location = #{location}</if>
@@ -41,16 +41,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="appList" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
<include refid="selectJobFairVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
<if test="queryDate != null "> and start_time &gt;= #{queryDate} and end_time &lt;= #{queryDate}</if>
</where>
</select>
<select id="selectAppList" resultType="com.ruoyi.cms.domain.JobFair">
select j.*
from qd.job_fair as j
inner join qd.fair_collection as f on f.fair_id = j.job_fair_id and f.USER_ID = #{userId}
where j.DEL_FLAG = 0 and f.DEL_FLAG = 0
from job_fair as j
inner join fair_collection as f on f.fair_id = j.job_fair_id and f.USER_ID = #{userId}
where j.DEL_FLAG = '0' and f.DEL_FLAG = '0'
<if test="type!=null and type==1">
-- 未开始
and j.START_TIME &gt; now()

View File

@@ -36,7 +36,7 @@
</resultMap>
<sql id="selectJobVo">
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "VIEW", company_id , is_hot ,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover from job
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover from job
</sql>
<insert id="insertBatchRowWork">
INSERT INTO row_work (
@@ -64,7 +64,7 @@
<insert id="batchInsert">
INSERT INTO job (
job_title, min_salary, max_salary, education, experience, company_name, job_location,
job_location_area_code, posting_date, vacancies, latitude, longitude, "VIEW", company_id,
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
is_hot, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
create_by, create_time, row_id, job_category
) VALUES
@@ -110,7 +110,7 @@
from(
SELECT job_id
FROM job
ORDER BY "VIEW" DESC
ORDER BY "view" DESC
LIMIT 10)
as b
);
@@ -118,7 +118,7 @@
<select id="selectJobList" parameterType="Job" resultMap="JobResult">
<include refid="selectJobVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="jobTitle != null and jobTitle != ''"> and job_title = #{jobTitle}</if>
<if test="minSalary != null "> and min_salary = #{minSalary}</if>
<if test="maxSalary != null "> and max_salary = #{maxSalary}</if>
@@ -126,11 +126,11 @@
<if test="experience != null and experience != ''"> and experience = #{experience}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="jobLocation != null and jobLocation != ''"> and job_location = #{jobLocation}</if>
<if test="postingDate != null "> and posting_date = #{postingDate}</if>
<if test="postingDate != null and postingDate!=''"> and posting_date = #{postingDate}</if>
<if test="vacancies != null "> and vacancies = #{vacancies}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="view != null "> and "VIEW" = #{view}</if>
<if test="view != null "> and "view" = #{view}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="isHot != null "> and is_hot = #{isHot}</if>
<if test="applyNum != null "> and apply_num = #{applyNum}</if>
@@ -139,7 +139,7 @@
</select>
<select id="selectAppJobList" resultType="com.ruoyi.cms.domain.query.ESJobSearch">
<include refid="selectJobVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="jobTitle != null and jobTitle != ''"> and job_title = #{jobTitle}</if>
<if test="minSalary != null "> and min_salary = #{minSalary}</if>
<if test="maxSalary != null "> and max_salary = #{maxSalary}</if>
@@ -147,11 +147,11 @@
<if test="experience != null and experience != ''"> and experience = #{experience}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="jobLocation != null and jobLocation != ''"> and job_location = #{jobLocation}</if>
<if test="postingDate != null "> and posting_date = #{postingDate}</if>
<if test="postingDate != null and postingDate!='' "> and posting_date = #{postingDate}</if>
<if test="vacancies != null "> and vacancies = #{vacancies}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="view != null "> and "VIEW" = #{view}</if>
<if test="view != null "> and "view" = #{view}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="isHot != null "> and is_hot = #{isHot}</if>
<if test="applyNum != null "> and apply_num = #{applyNum}</if>

View File

@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectJobTitleList" parameterType="JobTitle" resultMap="JobTitleResult">
<include refid="selectJobTitleVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="jobName != null and jobName != ''"> and job_name like concat('%', #{jobName}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>

View File

@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSubwayLineList" parameterType="SubwayLine" resultMap="SubwayLineResult">
<include refid="selectSubwayLineVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
</where>
</select>
@@ -41,6 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select l.line_id, l.line_name,s.station_id, s.station_name, s.line_name,s.latitude, s.longitude,s.station_order
from subway_line as l
inner join subway_station as s on s.line_id = l.line_id
where l.del_flag = 0 and s.del_flag = 0
where l.del_flag = '0' and s.del_flag = '0'
</select>
</mapper>

View File

@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSubwayStationList" parameterType="SubwayStation" resultMap="SubwayStationResult">
<include refid="selectSubwayStationVo"/>
<where> del_flag = 0
<where> del_flag = '0'
<if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="lineName != null "> and line_name like concat('%', #{lineName}, '%')</if>

View File

@@ -39,7 +39,7 @@ public class BaseEntity implements Serializable
@TableField(fill = FieldFill.INSERT)
// @JsonIgnore
@ApiModelProperty(hidden = true)
private Date createTime;
private String createTime;
/** 更新者 */
@TableField(fill = FieldFill.INSERT_UPDATE)
@@ -52,7 +52,7 @@ public class BaseEntity implements Serializable
@TableField(fill = FieldFill.INSERT_UPDATE)
@JsonIgnore
@ApiModelProperty(hidden = true)
private Date updateTime;
private String updateTime;
/** 删除标志0代表存在 2代表删除 */
@TableLogic(value = "0",delval = "2")
@@ -93,12 +93,12 @@ public class BaseEntity implements Serializable
this.createBy = createBy;
}
public Date getCreateTime()
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}
@@ -113,12 +113,12 @@ public class BaseEntity implements Serializable
this.updateBy = updateBy;
}
public Date getUpdateTime()
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(Date updateTime)
public void setUpdateTime(String updateTime)
{
this.updateTime = updateTime;
}

View File

@@ -23,7 +23,7 @@ public class TableDataInfo implements Serializable
/** 消息内容 */
private String msg;
private Object data;
/**
* 表格数据对象
*/
@@ -82,4 +82,13 @@ public class TableDataInfo implements Serializable
{
this.msg = msg;
}
public Object getData()
{
return data;
}
public void setData(Object data)
{
this.data = data;
}
}

View File

@@ -8,6 +8,8 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Objects;
@@ -30,19 +32,20 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
Date date = new Date();
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
if(SecurityUtils.isLogin()) {
LoginUser loginUser = SecurityUtils.getLoginUser();
// 创建者
strictInsertFill(metaObject, CREATE_BY, String.class, loginUser.getUsername());
strictInsertFill(metaObject, CREATE_BY_ID, Long.class, loginUser.getUserId());
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
strictInsertFill(metaObject, CREATE_TIME, String.class, formattedDate);
// 更新者
strictInsertFill(metaObject, UPDATE_BY, String.class, loginUser.getUsername());
strictInsertFill(metaObject, UPDATE_BY_ID, Long.class, loginUser.getUserId());
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
strictInsertFill(metaObject, UPDATE_TIME, String.class, formattedDate);
// 删除标识
strictInsertFill(metaObject, DEL_FLAG, String.class, "0");
}else {
@@ -50,12 +53,12 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
strictInsertFill(metaObject, CREATE_BY, String.class, "匿名登录");
strictInsertFill(metaObject, CREATE_BY_ID, Long.class, 0l);
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
strictInsertFill(metaObject, CREATE_TIME, String.class, formattedDate);
// 更新者
strictInsertFill(metaObject, UPDATE_BY, String.class, "匿名登录");
strictInsertFill(metaObject, UPDATE_BY_ID, Long.class, 0l);
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
strictInsertFill(metaObject, UPDATE_TIME, String.class, formattedDate);
// 删除标识
strictInsertFill(metaObject, DEL_FLAG, String.class, "0");
}
@@ -64,9 +67,10 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
@Override
public void updateFill(MetaObject metaObject) {
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
if(!SecurityUtils.isLogin()){
strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
strictUpdateFill(metaObject, UPDATE_TIME, String.class, formattedDate);
return;
}
LoginUser loginUser = SecurityUtils.getLoginUser();
@@ -77,6 +81,6 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
strictUpdateFill(metaObject, UPDATE_BY, String.class, loginUser.getUsername());
strictUpdateFill(metaObject, UPDATE_BY_ID, Long.class, loginUser.getUserId());
// 更新时间
strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
strictUpdateFill(metaObject, UPDATE_TIME, String.class, formattedDate);
}
}

View File

@@ -137,8 +137,7 @@ public class SysMenuServiceImpl implements ISysMenuService
}
else
{
//todo 用户权限bug修改
menus = menuMapper.selectMenuTreeAll();
menus = menuMapper.selectMenuTreeByUserId(userId);
}
return getChildPerms(menus, 0);
}

View File

@@ -29,7 +29,7 @@
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, COALESCE(perms,'') as perms, icon, create_time
from sys_menu
</sql>
@@ -50,13 +50,13 @@
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = '0'
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
@@ -75,13 +75,13 @@
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = '0' AND ro.status = '0'
order by m.parent_id, m.order_num
</select>

53
sql/highgo_function.sql Normal file
View File

@@ -0,0 +1,53 @@
CREATE OR replace function ks_db4.generate_subscripts(anyarray,int)
RETURNS SETOF int AS $$
begin
SELECT generate_series(array_lower($1,$2), array_upper($1,$2));
end
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION ks_db4.find_in_set(str integer, strlist text)
RETURNS boolean AS $$
SELECT i > 0
FROM generate_subscripts(string_to_array($2,','),1) g(i)
WHERE (string_to_array($2, ','))[i] = $1::text
$$ LANGUAGE sql STRICT;
CREATE OR REPLACE FUNCTION ks_db4.find_in_set(str bigint, strlist text)
RETURNS boolean AS $$
SELECT i > 0
FROM generate_subscripts(string_to_array($2,','),1) g(i)
WHERE (string_to_array($2, ','))[i] = $1::text
$$ LANGUAGE sql STRICT;
CREATE OR REPLACE FUNCTION ks_db4.find_in_set(str text, strlist text)
RETURNS boolean AS $$
SELECT i > 0
FROM generate_subscripts(string_to_array($2,','),1) g(i)
WHERE (string_to_array($2, ','))[i] = $1
$$ LANGUAGE sql STRICT;