Ver código fonte

招聘信息,求职信息增加经纬度,地址名称等

yanliming 4 dias atrás
pai
commit
691221677c

+ 14 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/RecruitInformationInfo.java

@@ -94,6 +94,20 @@ public class RecruitInformationInfo {
 	@ApiModelProperty(value = "图片")
 	private String images;
 
+	@ApiModelProperty(value = "经度")
+	private BigDecimal longitude;
+
+	@ApiModelProperty(value = "纬度")
+	private BigDecimal latitude;
+
+	@ApiModelProperty(value = "定位地址名称")
+	private String addressName;
+
+
+	@Transient
+	@ApiModelProperty(value = "经纬度显示")
+	private String location;
+
 	@Transient
 	@ApiModelProperty(value = "薪资形式翻译")
 	private String salaryFormN;

+ 19 - 1
common/src/main/resources/mapper/base/RecruitInformationInfo.xml

@@ -28,6 +28,10 @@
         <result property="ageRequirement" column="age_requirement"/>
         <result property="isTopping" column="is_topping"/>
         <result property="images" column="images_"/>
+
+        <result property="longitude" column="longitude_"/>
+        <result property="latitude" column="latitude_"/>
+        <result property="addressName" column="address_name"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.RecruitInformationInfo">
         <!--
@@ -39,7 +43,7 @@
 		insert into base_recruit_information_info
 	    (id_,enterprise_id,position_name,salary_,settlement_method,industry_,recruiting_numbers,desc_,contacts,contacts_phone,
 	    work_area,address_,browse_number,status_,create_by,create_time,update_by,update_time,del_flag,
-	    salary_form,is_online,age_requirement,is_topping,images_)
+	    salary_form,is_online,age_requirement,is_topping,images_,longitude_,latitude_,address_name)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -66,6 +70,9 @@
 ,#{ageRequirement,jdbcType=VARCHAR}
 ,#{isTopping,jdbcType= NUMERIC }
 ,#{images,jdbcType=VARCHAR}
+,#{longitude,jdbcType= NUMERIC }
+,#{latitude,jdbcType= NUMERIC }
+,#{addressName,jdbcType= VARCHAR }
 		)
 	]]>
     </insert>
@@ -144,6 +151,17 @@
             <if test="images!=null">
                 images_=#{images,jdbcType= VARCHAR },
             </if>
+
+            <if test="longitude!=null">
+                longitude_=#{longitude,jdbcType= NUMERIC },
+            </if>
+
+            <if test="latitude!=null">
+                latitude_=#{latitude,jdbcType= NUMERIC },
+            </if>
+            <if test="addressName!=null">
+                address_name=#{addressName,jdbcType= VARCHAR },
+            </if>
         </set>
         where id_=#{id}
     </update>

+ 20 - 1
web/src/main/java/com/jpsoft/employment/modules/base/controller/RecruitInformationInfoController.java

@@ -34,6 +34,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -89,6 +90,12 @@ public class RecruitInformationInfoController {
             recruitInformationInfo.setIsOnline(true);
             recruitInformationInfo.setIsTopping(false);
 
+            if (StringUtils.isNotEmpty(recruitInformationInfo.getLocation())) {
+                String[] locationArr = recruitInformationInfo.getLocation().split(",");
+                recruitInformationInfo.setLongitude(new BigDecimal(locationArr[0]));
+                recruitInformationInfo.setLatitude(new BigDecimal(locationArr[1]));
+            }
+
             if (recruitInformationInfo.getFileList() != null) {
                 JSONArray jsonArray = new JSONArray();
 
@@ -153,6 +160,11 @@ public class RecruitInformationInfoController {
 
                 recruitInformationInfo.setFileList(imageDTOList);
 
+                if (recruitInformationInfo.getLongitude() != null && recruitInformationInfo.getLatitude() != null) {
+                    String location = recruitInformationInfo.getLongitude() + "," + recruitInformationInfo.getLatitude();
+                    recruitInformationInfo.setLocation(location);
+                }
+
                 msgResult.setResult(true);
                 msgResult.setData(recruitInformationInfo);
             } else {
@@ -192,6 +204,13 @@ public class RecruitInformationInfoController {
                 if (jsonArray.size() > 0) {
                     recruitInformationInfo.setImages(jsonArray.toString());
                 }
+
+
+                if (StringUtils.isNotEmpty(recruitInformationInfo.getLocation())) {
+                    String[] locationArr = recruitInformationInfo.getLocation().split(",");
+                    recruitInformationInfo.setLongitude(new BigDecimal(locationArr[0]));
+                    recruitInformationInfo.setLatitude(new BigDecimal(locationArr[1]));
+                }
             }
 
             int affectCount = recruitInformationInfoService.update(recruitInformationInfo);
@@ -347,7 +366,7 @@ public class RecruitInformationInfoController {
 
             List<Map> mapList = new ArrayList<>();
 
-            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 
             for (RecruitInformationInfo recruitInformationInfo : page) {
                 Map map = new HashMap();

+ 24 - 1
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitApiController.java

@@ -315,6 +315,8 @@ public class RecruitApiController {
             @ApiImplicitParam(name = "salaryForm", value = "薪资形式(字典:计件,计时,定额)", required = false, paramType = "form"),
             @ApiImplicitParam(name = "isOnline", value = "是否上架", required = false, paramType = "form"),
             @ApiImplicitParam(name = "ageRequirement", value = "年龄要求", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "location", value = "经纬度", required = false, paramType = "form"),
+            @ApiImplicitParam(name = "addressName", value = "定位地址名称", required = false, paramType = "form"),
     })
     public MessageResult<Map> createRecruit(
             @RequestParam(value="id",defaultValue="") String id,
@@ -332,6 +334,8 @@ public class RecruitApiController {
             @RequestParam(value="isOnline",defaultValue="true") Boolean isOnline,
             @RequestParam(value="ageRequirement",defaultValue="") String ageRequirement,
             @RequestParam(value="images",defaultValue="") String images,
+            @RequestParam(value="location",defaultValue="") String location,
+            @RequestParam(value="addressName",defaultValue="") String addressName,
             @RequestAttribute String subject){
 
         MessageResult<Map> msgResult = new MessageResult<>();
@@ -368,6 +372,14 @@ public class RecruitApiController {
                 recruitInformationInfo.setImages(images);
                 recruitInformationInfo.setAgeRequirement(ageRequirement);
 
+                if (StringUtils.isNotEmpty(location)) {
+                    String[] locationArr = location.split(",");
+                    recruitInformationInfo.setLongitude(new BigDecimal(locationArr[0]));
+                    recruitInformationInfo.setLatitude(new BigDecimal(locationArr[1]));
+                }
+
+                recruitInformationInfo.setAddressName(addressName);
+
                 recruitInformationInfoService.update(recruitInformationInfo);
             } else {
                 RecruitInformationInfo recruitInformationInfo = new RecruitInformationInfo();
@@ -395,6 +407,14 @@ public class RecruitApiController {
                 recruitInformationInfo.setImages(images);
                 recruitInformationInfo.setIsTopping(false);
 
+                if (StringUtils.isNotEmpty(location)) {
+                    String[] locationArr = location.split(",");
+                    recruitInformationInfo.setLongitude(new BigDecimal(locationArr[0]));
+                    recruitInformationInfo.setLatitude(new BigDecimal(locationArr[1]));
+                }
+
+                recruitInformationInfo.setAddressName(addressName);
+
                 recruitInformationInfoService.insert(recruitInformationInfo);
             }
 
@@ -520,7 +540,10 @@ public class RecruitApiController {
             recruitInformationInfo.setSettlementMethodN(dataDictionaryService.findNameByCatalogNameAndValue("结算方式",recruitInformationInfo.getSettlementMethod()));
             recruitInformationInfo.setSalaryFormN(dataDictionaryService.findNameByCatalogNameAndValue("薪资形式",recruitInformationInfo.getSalaryForm()));
 
-
+            if (recruitInformationInfo.getLongitude() != null && recruitInformationInfo.getLatitude() != null) {
+                String location = recruitInformationInfo.getLongitude() + "," + recruitInformationInfo.getLatitude();
+                recruitInformationInfo.setLocation(location);
+            }
 
             returnMap.put("recruitInformationInfo",recruitInformationInfo);
             returnMap.put("enterpriseInfo",enterpriseInfo);