|
@@ -312,18 +312,20 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
|
|
|
position.setEndDate(sdf.parse(endDate));
|
|
position.setEndDate(sdf.parse(endDate));
|
|
|
positionMapper.save(position);
|
|
positionMapper.save(position);
|
|
|
String json = requestMap.get("json");//工作地址
|
|
String json = requestMap.get("json");//工作地址
|
|
|
- JSONArray jsonArray = JSONArray.fromObject(json);
|
|
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
- PositionAddress positionAddress = new PositionAddress();
|
|
|
|
|
- JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
- positionAddress.setPositionId(position.getId());
|
|
|
|
|
- positionAddress.setProvinceId(Integer.parseInt(jsonObject.getString("provinceId")));
|
|
|
|
|
- positionAddress.setCityId(Integer.parseInt(jsonObject.getString("cityId")));
|
|
|
|
|
- positionAddress.setCountryId(Integer.parseInt(jsonObject.getString("countryId")));
|
|
|
|
|
- positionAddress.setAdname(jsonObject.getString("adname"));
|
|
|
|
|
- positionAddress.setAdname(jsonObject.getString("address"));
|
|
|
|
|
- positionAddress.setIsThisAreaPublish(Integer.parseInt(jsonObject.getString("isThisAreaPublish")));
|
|
|
|
|
- positionAddressService.save(positionAddress);
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(json)) {
|
|
|
|
|
+ JSONArray jsonArray = JSONArray.fromObject(json);
|
|
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
+ PositionAddress positionAddress = new PositionAddress();
|
|
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
+ positionAddress.setPositionId(position.getId());
|
|
|
|
|
+ positionAddress.setProvinceId(Integer.parseInt(jsonObject.getString("provinceId")));
|
|
|
|
|
+ positionAddress.setCityId(Integer.parseInt(jsonObject.getString("cityId")));
|
|
|
|
|
+ positionAddress.setCountryId(Integer.parseInt(jsonObject.getString("countryId")));
|
|
|
|
|
+ positionAddress.setAdname(jsonObject.getString("adname"));
|
|
|
|
|
+ positionAddress.setAdname(jsonObject.getString("address"));
|
|
|
|
|
+ positionAddress.setIsThisAreaPublish(Integer.parseInt(jsonObject.getString("isThisAreaPublish")));
|
|
|
|
|
+ positionAddressService.save(positionAddress);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
returnMap.put("success", true);
|
|
returnMap.put("success", true);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -416,18 +418,20 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
|
|
|
position.setEndDate(sdf.parse(endDate));
|
|
position.setEndDate(sdf.parse(endDate));
|
|
|
positionMapper.save(position);
|
|
positionMapper.save(position);
|
|
|
String json = requestMap.get("json");
|
|
String json = requestMap.get("json");
|
|
|
- JSONArray jsonArray = JSONArray.fromObject(json);
|
|
|
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
- PositionAddress positionAddress = new PositionAddress();
|
|
|
|
|
- JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
- positionAddress.setPositionId(position.getId());
|
|
|
|
|
- positionAddress.setProvinceId(Integer.parseInt(jsonObject.getString("provinceId")));
|
|
|
|
|
- positionAddress.setCityId(Integer.parseInt(jsonObject.getString("cityId")));
|
|
|
|
|
- positionAddress.setCountryId(Integer.parseInt(jsonObject.getString("countryId")));
|
|
|
|
|
- positionAddress.setAdname(jsonObject.getString("adname"));
|
|
|
|
|
- positionAddress.setAdname(jsonObject.getString("address"));
|
|
|
|
|
- positionAddress.setIsThisAreaPublish(Integer.parseInt(jsonObject.getString("isThisAreaPublish")));
|
|
|
|
|
- positionAddressService.save(positionAddress);
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(json)) {
|
|
|
|
|
+ JSONArray jsonArray = JSONArray.fromObject(json);
|
|
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
+ PositionAddress positionAddress = new PositionAddress();
|
|
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
|
|
+ positionAddress.setPositionId(position.getId());
|
|
|
|
|
+ positionAddress.setProvinceId(Integer.parseInt(jsonObject.getString("provinceId")));
|
|
|
|
|
+ positionAddress.setCityId(Integer.parseInt(jsonObject.getString("cityId")));
|
|
|
|
|
+ positionAddress.setCountryId(Integer.parseInt(jsonObject.getString("countryId")));
|
|
|
|
|
+ positionAddress.setAdname(jsonObject.getString("adname"));
|
|
|
|
|
+ positionAddress.setAdname(jsonObject.getString("address"));
|
|
|
|
|
+ positionAddress.setIsThisAreaPublish(Integer.parseInt(jsonObject.getString("isThisAreaPublish")));
|
|
|
|
|
+ positionAddressService.save(positionAddress);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
returnMap.put("success", true);
|
|
returnMap.put("success", true);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|