Просмотр исходного кода

修改实体类岗位,接口添加查询工作地址

LiFei 6 лет назад
Родитель
Сommit
1c9b834da1

+ 14 - 123
happy-boot-module-hppay/src/main/java/org/jeecg/modules/api/dpposition/entity/PositionAPI.java

@@ -60,31 +60,17 @@ public class PositionAPI {
     @Dict(dicCode="fulltime_position_type")
     @Excel(name = "全职职位类别(0:服务员 1:校园活动 2:实习 3:调研 4:送餐员 5:导购 6:网络编辑 7:普工 8:设计 9:文员助理 10:派单 11:销售 12:安保 13:礼仪 14:促销 15:翻译 16:客服 17:演出 18:家教导师 19:模特 20:快递分拣 21:厨师 22:物流仓储 23:贸易采购 24:技工 25:保洁 26:才艺技能 27:其它)", width = 15)
     @ApiModelProperty(value = "全职职位类别(0:服务员 1:校园活动 2:实习 3:调研 4:送餐员 5:导购 6:网络编辑 7:普工 8:设计 9:文员助理 10:派单 11:销售 12:安保 13:礼仪 14:促销 15:翻译 16:客服 17:演出 18:家教导师 19:模特 20:快递分拣 21:厨师 22:物流仓储 23:贸易采购 24:技工 25:保洁 26:才艺技能 27:其它)")
-    private java.lang.String fulltimePositionType;
+    private java.lang.Integer fulltimePositionType;
 
-    public String getFulltimePositionType() {
-        fulltimePositionType=DictUtils.getDictLabel(fulltimePositionType,"fulltime_position_type","");
-        return fulltimePositionType;
-    }
 
-    public void setFulltimePositionType(String fulltimePositionType) {
-        this.fulltimePositionType = fulltimePositionType;
-    }
 
     /**兼职职位类别(0:文员助理 1:市场推广 2:家教培训 3:餐饮服务 4:促销导购 5:物流仓储 6:展会演出 7:才艺技能 8:客服话务 9:代驾司机 10:app试玩 11:线上推广 12:编辑 13:模特 14:技工 15:保洁 16:其它)*/
     @Dict(dicCode="parttime_position_type")
     @Excel(name = "兼职职位类别(0:文员助理 1:市场推广 2:家教培训 3:餐饮服务 4:促销导购 5:物流仓储 6:展会演出 7:才艺技能 8:客服话务 9:代驾司机 10:app试玩 11:线上推广 12:编辑 13:模特 14:技工 15:保洁 16:其它)", width = 15)
     @ApiModelProperty(value = "兼职职位类别(0:文员助理 1:市场推广 2:家教培训 3:餐饮服务 4:促销导购 5:物流仓储 6:展会演出 7:才艺技能 8:客服话务 9:代驾司机 10:app试玩 11:线上推广 12:编辑 13:模特 14:技工 15:保洁 16:其它)")
-    private java.lang.String parttimePositionType;
+    private java.lang.Integer parttimePositionType;
 
-    public String getParttimePositionType() {
-        parttimePositionType=DictUtils.getDictLabel(parttimePositionType,"parttime_position_type","");
-        return parttimePositionType;
-    }
 
-    public void setParttimePositionType(String parttimePositionType) {
-        this.parttimePositionType = parttimePositionType;
-    }
 
     /**(兼职)招聘人数/(全职)接受报名人数(null或0视为若干)*/
     @Excel(name = "(兼职)招聘人数/(全职)接受报名人数(null或0视为若干)", width = 15)
@@ -94,30 +80,16 @@ public class PositionAPI {
     @Dict(dicCode="basic_salary")
     @Excel(name = "基础薪资(全职)(0:1000~2000 1:2001~3000 2:3001~4000 3:4001~5000 4:5001~6000 5:6001~7000 6:7001~8000 7:8001~9000 8:9001~10000 9:10000以上)", width = 15)
     @ApiModelProperty(value = "基础薪资(全职)(0:1000~2000 1:2001~3000 2:3001~4000 3:4001~5000 4:5001~6000 5:6001~7000 6:7001~8000 7:8001~9000 8:9001~10000 9:10000以上)")
-    private java.lang.String basicSalary;
+    private java.lang.Integer basicSalary;
 
-    public String getBasicSalary() {
-        basicSalary=DictUtils.getDictLabel(basicSalary,"basic_salary","");
-        return basicSalary;
-    }
 
-    public void setBasicSalary(String basicSalary) {
-        this.basicSalary = basicSalary;
-    }
 
     /**薪资周期(兼职)(0:天 1:周 2:月:3 次 4:时 5:其他)*/
     @Excel(name = "薪资周期(兼职)(0:天 1:周 2:月:3 次 4:时 5:其他)", width = 15)
     @ApiModelProperty(value = "薪资周期(兼职)(0:天 1:周 2:月:3 次 4:时 5:其他)")
-    private java.lang.String salaryPeriod;
+    private java.lang.Integer salaryPeriod;
 
-    public String getSalaryPeriod() {
-        salaryPeriod=DictUtils.getDictLabel(salaryPeriod,"salary_period","");
-        return salaryPeriod;
-    }
 
-    public void setSalaryPeriod(String salaryPeriod) {
-        this.salaryPeriod = salaryPeriod;
-    }
 
     /**基本薪资(兼职)*/
     @Excel(name = "基本薪资(兼职)", width = 15)
@@ -141,31 +113,15 @@ public class PositionAPI {
     @Dict(dicCode="has_regular_bus")
     @Excel(name = "班车(全职)(0:没有 1:有)", width = 15)
     @ApiModelProperty(value = "班车(全职)(0:没有 1:有)")
-    private java.lang.String hasRegularBus;
+    private java.lang.Integer hasRegularBus;
 
-    public String getHasRegularBus() {
-        hasRegularBus=DictUtils.getDictLabel(hasRegularBus,"has_regular_bus","");
-        return hasRegularBus;
-    }
-
-    public void setHasRegularBus(String hasRegularBus) {
-        this.hasRegularBus = hasRegularBus;
-    }
 
     /**学历要求(0:不限 1:小学 2:中学 3:高中 4:大专 5:本科 6:研究生 7:博士 8:博士后 15:其他)*/
     @Dict(dicCode="qualification")
     @Excel(name = "学历要求(0:不限 1:小学 2:中学 3:高中 4:大专 5:本科 6:研究生 7:博士 8:博士后 15:其他)", width = 15)
     @ApiModelProperty(value = "学历要求(0:不限 1:小学 2:中学 3:高中 4:大专 5:本科 6:研究生 7:博士 8:博士后 15:其他)")
-    private java.lang.String qualification;
-
-    public String getQualification() {
-        qualification=DictUtils.getDictLabel(qualification,"qualification","");
-        return qualification;
-    }
+    private java.lang.Integer qualification;
 
-    public void setQualification(String qualification) {
-        this.qualification = qualification;
-    }
 
     /**年龄要求(全职)*/
     @Excel(name = "年龄要求(全职)", width = 15)
@@ -175,46 +131,24 @@ public class PositionAPI {
     @Dict(dicCode="gender")
     @Excel(name = "性别要求(0:不限 1:男 2:女)", width = 15)
     @ApiModelProperty(value = "性别要求(0:不限 1:男 2:女)")
-    private java.lang.String gender;
+    private java.lang.Integer gender;
 
-    public String getGender() {
-        gender=DictUtils.getDictLabel(gender,"gender","");
-        return gender;
-    }
 
-    public void setGender(String gender) {
-        this.gender = gender;
-    }
 
     /**工作经验(全职)(0:不限 1:1~2年 2:2~3年 3:3~5年 4:5年以上)*/
     @Dict(dicCode="work_experience")
     @Excel(name = "工作经验(全职)(0:不限 1:1~2年 2:2~3年 3:3~5年 4:5年以上)", width = 15)
     @ApiModelProperty(value = "工作经验(全职)(0:不限 1:1~2年 2:2~3年 3:3~5年 4:5年以上)")
-    private java.lang.String workExperience;
+    private java.lang.Integer workExperience;
 
-    public String getWorkExperience() {
-        workExperience=DictUtils.getDictLabel(workExperience,"work_experience","");
-        return workExperience;
-    }
-
-    public void setWorkExperience(String workExperience) {
-        this.workExperience = workExperience;
-    }
 
     /**是否需要健康证(兼职)(0:不需要 1:需要)*/
     @Dict(dicCode="is_health_certification")
     @Excel(name = "是否需要健康证(兼职)(0:不需要 1:需要)", width = 15)
     @ApiModelProperty(value = "是否需要健康证(兼职)(0:不需要 1:需要)")
-    private java.lang.String isHealthCertification;
+    private java.lang.Integer isHealthCertification;
 
-    public String getIsHealthCertification() {
-        isHealthCertification=DictUtils.getDictLabel(isHealthCertification,"is_health_certification","");
-        return isHealthCertification;
-    }
 
-    public void setIsHealthCertification(String isHealthCertification) {
-        this.isHealthCertification = isHealthCertification;
-    }
 
     /**工作日期(兼职)(多天,数组存储)*/
     @Excel(name = "工作日期(兼职)(多天,数组存储)", width = 15)
@@ -232,16 +166,9 @@ public class PositionAPI {
     @Dict(dicCode="is_publish_nationwide")
     @Excel(name = "是否全国发布(0:不是 1:是)", width = 15)
     @ApiModelProperty(value = "是否全国发布(0:不是 1:是)")
-    private java.lang.String isPublishNationwide;
+    private java.lang.Integer isPublishNationwide;
 
-    public String getIsPublishNationwide() {
-        isPublishNationwide=DictUtils.getDictLabel(isPublishNationwide,"is_publish_nationwide","");
-        return isPublishNationwide;
-    }
 
-    public void setIsPublishNationwide(String isPublishNationwide) {
-        this.isPublishNationwide = isPublishNationwide;
-    }
 
     /**联系人*/
     @Excel(name = "联系人", width = 15)
@@ -267,16 +194,9 @@ public class PositionAPI {
     @Dict(dicCode="is_pause")
     @Excel(name = "是否暂停(0:不是 1:是)", width = 15)
     @ApiModelProperty(value = "是否暂停(0:不是 1:是)")
-    private java.lang.String isPause;
+    private java.lang.Integer isPause;
 
-    public String getIsPause() {
-        isPause=DictUtils.getDictLabel(isPause,"is_pause","");
-        return isPause;
-    }
 
-    public void setIsPause(String isPause) {
-        this.isPause = isPause;
-    }
 
     /**更新时间(默认可以为创建时间,编辑,刷新时更新这个时间,用于数据排序)*/
     @Excel(name = "更新时间(默认可以为创建时间,编辑,刷新时更新这个时间,用于数据排序)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@@ -290,14 +210,7 @@ public class PositionAPI {
     @ApiModelProperty(value = "是否删除(0:上架 1:下架)")
     private java.lang.String delFlag;
 
-    public String getDelFlag() {
-        delFlag=DictUtils.getDictLabel(delFlag,"del_flag","");
-        return delFlag;
-    }
 
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
 
     /**认证状态(1:等待认证 2:未通过 3:已认证)*/
     @Dict(dicCode="authenticationStatus")
@@ -309,43 +222,21 @@ public class PositionAPI {
     @Dict(dicCode="is_on")
     @Excel(name = "是否上架(0:下架 1:上架)", width = 15)
     @ApiModelProperty(value = "是否上架(0:下架 1:上架)")
-    private java.lang.String isOn;
+    private java.lang.Integer isOn;
 
-    public String getIsOn() {
-        isOn=DictUtils.getDictLabel(isOn,"is_on","");
-        return isOn;
-    }
 
-    public void setIsOn(String isOn) {
-        this.isOn = isOn;
-    }
 
     @Dict(dicCode="require_group")
     @Excel(name = "是否需要打工团队(0:不需要 1:需要)", width = 15)
     @ApiModelProperty(value = "是否需要打工团队(0:不需要 1:需要)")
-    private java.lang.String requireGroup;
+    private java.lang.Integer requireGroup;
 
-    public String getRequireGroup() {
-        requireGroup=DictUtils.getDictLabel(requireGroup,"require_group","");
-        return requireGroup;
-    }
 
-    public void setRequireGroup(String requireGroup) {
-        this.requireGroup = requireGroup;
-    }
 
     @Dict(dicCode="settlement_method")
     @Excel(name = "结算方式(0:月结 1:周结 2:日结 3:完工结 4:其他)", width = 15)
     @ApiModelProperty(value = "结算方式(0:月结 1:周结 2:日结 3:完工结 4:其他)")
-    private java.lang.String settlementMethod;
-
-    public String getSettlementMethod() {
-        settlementMethod=DictUtils.getDictLabel(settlementMethod,"settlement_method","");
-        return settlementMethod;
+    private java.lang.Integer settlementMethod;
 
-    }
 
-    public void setSettlementMethod(String settlementMethod) {
-        this.settlementMethod = settlementMethod;
-    }
 }

+ 1 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/mapper/PositionAddressMapper.java

@@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface PositionAddressMapper extends BaseMapper<PositionAddress> {
 
+    List<PositionAddress> getByPositionId(@Param("positionId") Integer id);
 }

+ 27 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/mapper/xml/PositionAddressMapper.xml

@@ -2,4 +2,31 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.hpposition.mapper.PositionAddressMapper">
 
+
+    <sql id="positionColumns">
+		a.id AS "id",
+		a.position_id AS "positionId",
+		a.province_id AS "provinceId",
+		a.city_id AS "cityId",
+		a.country_id AS "countryId",
+		a.adname AS "adname",
+		a.address as "address",
+		a.is_this_area_publish as "isThisAreaPublish"
+	</sql>
+
+    <sql id="positionJoins">
+
+    </sql>
+
+
+
+
+    <select id="getByPositionId" resultType="org.jeecg.modules.hpposition.entity.PositionAddress">
+        SELECT
+        <include refid="positionColumns"/>
+        FROM dp_position_address a
+        <where>
+            a.position_id = #{positionId}
+        </where>
+    </select>
 </mapper>

+ 3 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/IPositionAddressService.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.hpposition.service;
 import org.jeecg.modules.hpposition.entity.PositionAddress;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 岗位地址
  * @Author: jeecg-boot
@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IPositionAddressService extends IService<PositionAddress> {
 
+    List<PositionAddress> getByPositionId(Integer id);
 }

+ 9 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/impl/PositionAddressServiceImpl.java

@@ -7,6 +7,9 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import javax.annotation.Resource;
+import java.util.List;
+
 /**
  * @Description: 岗位地址
  * @Author: jeecg-boot
@@ -15,5 +18,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  */
 @Service
 public class PositionAddressServiceImpl extends ServiceImpl<PositionAddressMapper, PositionAddress> implements IPositionAddressService {
+    @Resource
+    private PositionAddressMapper positionAddressMapper;
 
+    @Override
+    public List<PositionAddress> getByPositionId(Integer id) {
+        return positionAddressMapper.getByPositionId(id);
+    }
 }

+ 14 - 6
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/impl/PositionServiceImpl.java

@@ -27,10 +27,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.net.URLEncoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: 职位审核
@@ -83,7 +80,17 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
             Result<Page<Position>> result = new Result<Page<Position>>();
             Page<Position> pageList = new Page<Position>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
             pageList = findPositionsList(pageList, positionAPI);//职位列表
-            returnMap.put("Positions", pageList.getRecords());
+            List list=new ArrayList();
+            if(pageList.getRecords().size()>0){
+                for (int i = 0; i <pageList.getRecords().size() ; i++) {
+                    List<PositionAddress> positionAddress= positionAddressService.getByPositionId(pageList.getRecords().get(i).getId());
+                    Map map=new HashMap();
+                    map.put("position",pageList.getRecords().get(i));
+                    map.put("address",positionAddress);
+                    list.add(map);
+                }
+            }
+            returnMap.put("Positions", list);
             returnMap.put("pageNo", pageList.getCurrent());
             //提示前端是否为最后一页
             if (Integer.parseInt(pageNo) == pageList.getCurrent()) {
@@ -220,7 +227,8 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
             String id = requestMap.get("id");
             PositionAPI position = positionMapper.getPosition(id);
             returnMap.put("positionDetail", position);
-
+            List<PositionAddress> positionAddress= positionAddressService.getByPositionId(position.getId());
+            returnMap.put("address",list());
         } else {
             returnMap.put("success", "1004");
         }