@ -0,0 +1,59 @@ | |||||
package org.jeecg.modules.userCode.controller; | |||||
import com.alibaba.fastjson.JSONObject; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.common.exception.JeecgBootException; | |||||
import org.jeecg.modules.bean.LoginReq; | |||||
import org.jeecg.modules.postBean.ReqUserRole; | |||||
import org.jeecg.modules.postBean.ReqUserRole2; | |||||
import org.jeecg.modules.tbTask.entity.TbTask; | |||||
import org.jeecg.modules.tbTask.service.ITbTaskService; | |||||
import org.jeecg.modules.userCode.model.req.TaskReq; | |||||
import org.jeecg.modules.userCode.model.req.TaskReq2; | |||||
import org.jeecg.modules.userCode.service.AppletLoginService; | |||||
import org.jeecg.modules.userCode.service.UserService; | |||||
import org.jeecg.modules.utils.ValidateTool; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import javax.annotation.Resource; | |||||
/** | |||||
* 服务化 system模块 对外接口请求类 | |||||
* | |||||
* @author: jeecg-boot | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/order") | |||||
@Api(tags = "订单相关接口") | |||||
public class OrderController { | |||||
@Resource | |||||
private AppletLoginService appletLoginService; | |||||
@Resource | |||||
private UserService userService; | |||||
@Resource | |||||
private ITbTaskService tbTaskService; | |||||
@ApiOperation(value = "公司发布任务", notes = "发布任务") | |||||
@PostMapping(value = "/addTask") | |||||
public Result<String> addTask(@RequestBody TaskReq tbTask, @RequestHeader("X-Access-Token") String token) { | |||||
if (ValidateTool.isNull(tbTask)) { | |||||
throw new JeecgBootException("请填写资料"); | |||||
} | |||||
userService.addTask(tbTask, token); | |||||
return Result.OK("添加成功!"); | |||||
} | |||||
} |
@ -0,0 +1,25 @@ | |||||
package org.jeecg.modules.userCode.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.jeecg.modules.tbTask.entity.TbTask; | |||||
import org.jeecg.modules.userCode.model.vo.TbTaskVo; | |||||
import java.util.List; | |||||
/** | |||||
* @Description: merchant_info | |||||
* @Author: jeecg-boot | |||||
* @Date: 2021-03-15 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface TaskMapper extends BaseMapper<TbTask> { | |||||
IPage<TbTaskVo> tasks(@Param("lon") String lon, @Param("lat") String lat | |||||
, @Param("distance") String distance, @Param("search") String search, Page page); | |||||
} |
@ -0,0 +1,57 @@ | |||||
<?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="org.jeecg.modules.userCode.mapper.TaskMapper"> | |||||
<!-- 通过字典code获取字典数据 --> | |||||
<select id="tasks" parameterType="String" | |||||
resultType="org.jeecg.modules.userCode.model.vo.TbTaskVo"> | |||||
<!-- SELECT *,--> | |||||
<!-- (6371 * acos (--> | |||||
<!-- cos (RADIANS(${lat}))--> | |||||
<!-- * cos(RADIANS(SUBSTRING_INDEX(longit_lat,',',-1) ) )--> | |||||
<!-- * cos(RADIANS(SUBSTRING_INDEX(longit_lat,',',1)) - RADIANS(${lon}) )--> | |||||
<!-- + sin (RADIANS(${lat}))--> | |||||
<!-- * sin(RADIANS(SUBSTRING_INDEX(longit_lat,',',-1) ) )--> | |||||
<!-- )) AS distances--> | |||||
<!-- FROM merchant_info HAVING <![CDATA[ distances <= 5 ]]> and <![CDATA[ del_flag = 0 ]]> ORDER BY distances--> | |||||
select * | |||||
from ( | |||||
SELECT *,ROUND( | |||||
6378.138 * 2 * ASIN( | |||||
SQRT( | |||||
POW( | |||||
SIN( | |||||
( | |||||
#{lat,jdbcType=VARCHAR} * PI() / 180 - SUBSTRING_INDEX(longitude,',',-1) * PI() / 180 | |||||
) / 2 | |||||
), | |||||
2 | |||||
) + COS(#{lat,jdbcType=VARCHAR} * PI() / 180) * COS(SUBSTRING_INDEX(longitude,',',-1) * PI() / 180) * POW( | |||||
SIN( | |||||
( | |||||
#{lon,jdbcType=VARCHAR} * PI() / 180 - SUBSTRING_INDEX(longitude,',',1) * PI() / 180 | |||||
) / 2 | |||||
), | |||||
2 | |||||
) | |||||
) | |||||
) * 1000 | |||||
) AS distances | |||||
FROM | |||||
tb_task | |||||
where del_flag =0 and audit_status =1 and role in (0,1) | |||||
ORDER BY distances ASC) | |||||
as a | |||||
<where> | |||||
del_flag =0 | |||||
<if test="search!=null and search!='' "> | |||||
and a.name like '%${search}%' | |||||
</if> | |||||
<if test="distance!=null and distance!='' "> | |||||
and a.distances <![CDATA[ <=]]> #{distance} | |||||
</if> | |||||
</where> | |||||
</select> | |||||
</mapper> |
@ -0,0 +1,99 @@ | |||||
package org.jeecg.modules.userCode.model.req; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* @Description: tb_task | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("tb_task") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="tb_task对象", description="tb_task") | |||||
public class TaskReq implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**工作标题*/ | |||||
@Excel(name = "工作标题", width = 15) | |||||
@ApiModelProperty(value = "工作标题") | |||||
private String title; | |||||
/**上班地址*/ | |||||
@Excel(name = "上班地址", width = 15) | |||||
@ApiModelProperty(value = "上班地址") | |||||
private String workAddress; | |||||
/**上班地址经度*/ | |||||
@Excel(name = "上班地址经度", width = 15) | |||||
@ApiModelProperty(value = "上班地址经度") | |||||
private String latitude; | |||||
/**上班地址纬度*/ | |||||
@Excel(name = "上班地址纬度", width = 15) | |||||
@ApiModelProperty(value = "上班地址纬度") | |||||
private String longitude; | |||||
/**行业/工种*/ | |||||
@Excel(name = "行业/工种", width = 15) | |||||
@ApiModelProperty(value = "行业/工种") | |||||
private String industryName; | |||||
/**行业/工种id*/ | |||||
@Excel(name = "行业/工种id", width = 15) | |||||
@ApiModelProperty(value = "行业/工种id") | |||||
private String industryId; | |||||
/**工作内容*/ | |||||
@Excel(name = "工作内容", width = 15) | |||||
@ApiModelProperty(value = "工作内容") | |||||
private String workDetail; | |||||
/**图片上传*/ | |||||
@Excel(name = "图片上传", width = 15) | |||||
@ApiModelProperty(value = "图片上传") | |||||
private String workPic; | |||||
/**招聘方联系方式*/ | |||||
@Excel(name = "招聘方联系方式", width = 15) | |||||
@ApiModelProperty(value = "招聘方联系方式") | |||||
private String bossPhone; | |||||
/**期望日薪*/ | |||||
@Excel(name = "期望日薪", width = 15) | |||||
@ApiModelProperty(value = "期望日薪") | |||||
private Integer dayMoney; | |||||
/**时间范围*/ | |||||
@Excel(name = "时间范围", width = 20, format = "yyyy-MM-dd HH:mm:ss") | |||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | |||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | |||||
@ApiModelProperty(value = "时间范围") | |||||
private Date startTime; | |||||
/**时间范围*/ | |||||
@Excel(name = "时间范围", width = 20, format = "yyyy-MM-dd HH:mm:ss") | |||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | |||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | |||||
@ApiModelProperty(value = "时间范围") | |||||
private Date endTime; | |||||
/**期望薪资最小值*/ | |||||
@Excel(name = "期望薪资最小值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最小值") | |||||
private Integer moneymin; | |||||
/**期望薪资最大值*/ | |||||
@Excel(name = "期望薪资最大值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最大值") | |||||
private Integer moneymax; | |||||
/**结算方式 0提前支付 1 试用后支付*/ | |||||
@Excel(name = "结算方式 0提前支付 1 试用后支付", width = 15, dicCode = "pay_type") | |||||
@Dict(dicCode = "pay_type") | |||||
@ApiModelProperty(value = "结算方式 0提前支付 1 试用后支付") | |||||
private Integer payType; | |||||
} |
@ -0,0 +1,87 @@ | |||||
package org.jeecg.modules.userCode.model.req; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* @Description: tb_task | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("tb_task") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="tb_task对象", description="tb_task") | |||||
public class TaskReq2 implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**工人出发地址*/ | |||||
@Excel(name = "工人出发地址", width = 15) | |||||
@ApiModelProperty(value = "工人出发地址") | |||||
private String workerAddress; | |||||
/**出行方式 0出租车 1 网约车 2 公交地铁 3无*/ | |||||
@Excel(name = "出行方式 0出租车 1 网约车 2 公交地铁 3无", width = 15, dicCode = "travel_type") | |||||
@Dict(dicCode = "travel_type") | |||||
@ApiModelProperty(value = "出行方式 0出租车 1 网约车 2 公交地铁 3无") | |||||
private Integer travelType; | |||||
/**上班地址经度*/ | |||||
@Excel(name = "上班地址经度", width = 15) | |||||
@ApiModelProperty(value = "地址经度") | |||||
private String latitude; | |||||
/**上班地址纬度*/ | |||||
@Excel(name = "上班地址纬度", width = 15) | |||||
@ApiModelProperty(value = "地址纬度") | |||||
private String longitude; | |||||
/**行业/工种*/ | |||||
@Excel(name = "行业/工种", width = 15) | |||||
@ApiModelProperty(value = "行业/工种") | |||||
private String industryName; | |||||
/**行业/工种id*/ | |||||
@Excel(name = "行业/工种id", width = 15) | |||||
@ApiModelProperty(value = "行业/工种id") | |||||
private String industryId; | |||||
/**工作内容*/ | |||||
@Excel(name = "工作内容", width = 15) | |||||
@ApiModelProperty(value = "工作内容") | |||||
private String workDetail; | |||||
/**期望日薪*/ | |||||
@Excel(name = "期望日薪", width = 15) | |||||
@ApiModelProperty(value = "期望日薪") | |||||
private Integer dayMoney; | |||||
/**期望薪资最小值*/ | |||||
@Excel(name = "期望薪资最小值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最小值") | |||||
private Integer moneymin; | |||||
/**期望薪资最大值*/ | |||||
@Excel(name = "期望薪资最大值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最大值") | |||||
private Integer moneymax; | |||||
/**结算方式 0提前支付 1 试用后支付*/ | |||||
@Excel(name = "结算方式 0提前支付 1 试用后支付", width = 15, dicCode = "pay_type") | |||||
@Dict(dicCode = "pay_type") | |||||
@ApiModelProperty(value = "结算方式 0提前支付 1 试用后支付") | |||||
private Integer payType; | |||||
} |
@ -0,0 +1,98 @@ | |||||
package org.jeecg.modules.userCode.model.vo; | |||||
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 io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* @Description: tb_task | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-12 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("tb_task") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="tb_task对象", description="tb_task") | |||||
public class TbTaskVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**id*/ | |||||
@TableId(type = IdType.ASSIGN_ID) | |||||
@ApiModelProperty(value = "id") | |||||
private String id; | |||||
/**用户id*/ | |||||
@Excel(name = "用户id", width = 15) | |||||
@ApiModelProperty(value = "用户id") | |||||
private String userId; | |||||
/**工作标题*/ | |||||
@Excel(name = "工作标题", width = 15) | |||||
@ApiModelProperty(value = "工作标题") | |||||
private String title; | |||||
/**公司名称*/ | |||||
@Excel(name = "公司名称", width = 15) | |||||
@ApiModelProperty(value = "公司名称") | |||||
private String companyName; | |||||
/**上班地址*/ | |||||
@Excel(name = "上班地址", width = 15) | |||||
@ApiModelProperty(value = "上班地址") | |||||
private String workAddress; | |||||
/**行业/工种*/ | |||||
@Excel(name = "行业/工种", width = 15) | |||||
@ApiModelProperty(value = "行业/工种") | |||||
private String industryName; | |||||
/**行业/工种id*/ | |||||
@Excel(name = "行业/工种id", width = 15) | |||||
@ApiModelProperty(value = "行业/工种id") | |||||
private String industryId; | |||||
/**招聘方联系方式*/ | |||||
@Excel(name = "招聘方联系方式", width = 15) | |||||
@ApiModelProperty(value = "招聘方联系方式") | |||||
private String bossPhone; | |||||
/**时间范围*/ | |||||
@Excel(name = "时间范围", width = 20, format = "yyyy-MM-dd HH:mm:ss") | |||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | |||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | |||||
@ApiModelProperty(value = "时间范围") | |||||
private Date startTime; | |||||
/**时间范围*/ | |||||
@Excel(name = "时间范围", width = 20, format = "yyyy-MM-dd HH:mm:ss") | |||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | |||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | |||||
@ApiModelProperty(value = "时间范围") | |||||
private Date endTime; | |||||
/**工作时长*/ | |||||
@Excel(name = "工作时长", width = 15) | |||||
@ApiModelProperty(value = "工作时长") | |||||
private String workTime; | |||||
/**期望薪资最小值*/ | |||||
@Excel(name = "期望薪资最小值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最小值") | |||||
private Integer moneymin; | |||||
/**期望薪资最大值*/ | |||||
@Excel(name = "期望薪资最大值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最大值") | |||||
private Integer moneymax; | |||||
/**结算方式 0提前支付 1 试用后支付*/ | |||||
@Excel(name = "结算方式 0提前支付 1 试用后支付", width = 15, dicCode = "pay_type") | |||||
@Dict(dicCode = "pay_type") | |||||
@ApiModelProperty(value = "结算方式 0提前支付 1 试用后支付") | |||||
private Integer payType; | |||||
@ApiModelProperty(value = "距离(米)") | |||||
@TableField(exist = false) | |||||
private String distances; | |||||
} |
@ -0,0 +1,80 @@ | |||||
package org.jeecg.modules.userCode.model.vo; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* @Description: tb_user_role | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-07 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("tb_user_role") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="tb_user_role对象", description="tb_user_role") | |||||
public class UserRole1Vo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**用户id*/ | |||||
@Excel(name = "用户id", width = 15) | |||||
@ApiModelProperty(value = "用户id") | |||||
private String userId; | |||||
/**用户名*/ | |||||
@Excel(name = "用户名", width = 15) | |||||
@ApiModelProperty(value = "用户名") | |||||
private String userName; | |||||
/**行业/工种*/ | |||||
@Excel(name = "行业/工种", width = 15) | |||||
@ApiModelProperty(value = "行业/工种") | |||||
private String industryName; | |||||
/**行业/工种id*/ | |||||
@Excel(name = "行业/工种id", width = 15) | |||||
@ApiModelProperty(value = "行业/工种id") | |||||
private String industryId; | |||||
/**个人简介*/ | |||||
@Excel(name = "个人简介", width = 15) | |||||
@ApiModelProperty(value = "个人简介") | |||||
private String detail; | |||||
/**用户头像*/ | |||||
@Excel(name = "用户头像", width = 15) | |||||
@ApiModelProperty(value = "用户头像") | |||||
private java.lang.String headImage; | |||||
/**电话*/ | |||||
@Excel(name = "电话", width = 15) | |||||
@ApiModelProperty(value = "电话") | |||||
private String phone; | |||||
/**年龄*/ | |||||
@Excel(name = "年龄", width = 15) | |||||
@ApiModelProperty(value = "年龄") | |||||
private Integer age; | |||||
/**性别*/ | |||||
@Excel(name = "性别", width = 15, dicCode = "sex") | |||||
@Dict(dicCode = "sex") | |||||
@ApiModelProperty(value = "性别") | |||||
private Integer gender; | |||||
/**期望薪资最小值*/ | |||||
@Excel(name = "期望薪资最小值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最小值") | |||||
private Integer moneyMin; | |||||
/**期望薪资最大值*/ | |||||
@Excel(name = "期望薪资最大值", width = 15) | |||||
@ApiModelProperty(value = "期望薪资最大值") | |||||
private Integer moneyMax; | |||||
} |
@ -1,15 +1,13 @@ | |||||
package org.jeecg.modules.userCode.service; | package org.jeecg.modules.userCode.service; | ||||
import com.alibaba.fastjson.JSONObject; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.modules.postBean.ReqUserRole; | |||||
import org.jeecg.modules.userCode.model.req.TaskReq; | |||||
import org.jeecg.modules.userCode.model.req.TaskReq2; | |||||
public interface UserService { | public interface UserService { | ||||
void addTask(TaskReq tbTask, String token); | |||||
void addTask2(TaskReq2 tbTask, String token); | |||||
} | } |