Commit b9e0efa2 by zlr

志愿者接口

parent 8cb5b69d
......@@ -4,6 +4,7 @@ import com.zq.common.utils.AssertUtils;
import com.zq.common.vo.ResultVo;
import com.zq.sync.service.VolunteerService;
import com.zq.sync.vo.GroupProSearchVo;
import com.zq.sync.vo.VolunteerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -21,9 +22,9 @@ public class VolunteerController {
* @return
*/
@GetMapping(value = "/zyz")
public ResultVo volunteer() {
volunteerService.volunteer();
return ResultVo.success("成功");
public VolunteerVo volunteer(String id) {
VolunteerVo VolunteerVo = volunteerService.volunteer(id);
return VolunteerVo;
}
/**
......
package com.zq.sync.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.sync.entity.Volunteer;
public interface VolunteerDao extends BaseMapper<Volunteer> {
}
package com.zq.sync.entity;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
public class Volunteer {
/**
* ID
*/
@ApiModelProperty("ID")
private String id;
/**
* 上级机构id
*/
@ApiModelProperty("上级机构id")
private String parentId;
/**
* 机构(部门)名称
*/
@ApiModelProperty("机构(部门)名称")
private String deptName;
/**
* 机构类型:1 业务处室 2二层机构 3 二层机构业务科室
*/
@ApiModelProperty("机构类型:1 业务处室 2二层机构 3 二层机构业务科室")
private Integer deptType;
/**
* 部门的统一信用代码
*/
@ApiModelProperty("部门的统一信用代码")
private String creditCode;
/**
* 行政区域编号
*/
@ApiModelProperty("行政区域编号")
private String areaCode;
/**
* 地址
*/
@ApiModelProperty("地址")
private String address;
/**
* 联系电话
*/
@ApiModelProperty("联系电话")
private String tel;
/**
* 编制(人员数量)
*/
@ApiModelProperty("编制(人员数量)")
private Integer totalOrgStaff;
/**
* 在编(人员数量)
*/
@ApiModelProperty("在编(人员数量)")
private Integer currOrgStaff;
/**
* 主要职责
*/
@ApiModelProperty("主要职责")
private String responsibility;
/**
* 排序编号,默认为0
*/
@ApiModelProperty("排序编号,默认为0")
private Integer orderNum;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 上级机构名称
*/
@ApiModelProperty("上级机构名称")
private String parentName;
}
package com.zq.sync.service;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zq.common.utils.AssertUtils;
import com.zq.sync.dao.GroupProSearchDao;
import com.zq.sync.dao.VolunteerDao;
import com.zq.sync.entity.GroupProject;
import com.zq.sync.entity.ReportError;
import com.zq.sync.entity.Volunteer;
import com.zq.sync.vo.GroupProSearchVo;
import com.zq.sync.vo.GroupProVo;
import com.zq.sync.vo.VolunteerVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
......@@ -19,10 +31,44 @@ import java.util.List;
public class VolunteerService {
private final GroupProSearchDao groupProSearchDao;
private final VolunteerDao volunteerDao;
public void volunteer() {
private void reportCommon(HttpRequest request) {
HttpResponse response = request.execute();
if (response.getStatus() != 200) {
log.error("接口请求失败 => {}", request);
}
String body = response.body();
JSONObject obj = JSONUtil.parseObj(body);
String code = obj.getStr("code");
if (code == null || !"0".equals(code)) {
log.warn("校验错误:{}, => {}", request.getUrl(), body);
}
String msg = obj.getStr("msg");
if (msg != null && !"成功".equals(msg)) {
log.warn("校验错误:{}, => {}", request.getUrl(), body);
}
log.warn("成功!:{}, => {}",request.getUrl(), body);
}
public VolunteerVo volunteer(String id) {
//Map<String, VolunteerVo> str = new HashMap<>();
// VolunteerVo VolunteerVo = volunteerDao.selectById(Wrappers.lambdaQuery(Volunteer.builder().id("id").build()));
//str.put("bean",VolunteerVo);
// HttpRequest request = HttpRequest.post("https://wuhan.yxybb.com/NVSI/restservices/api/nvsi_VolunteerInfoWeb/")
// .contentType("application/json;charset=UTF-8")
// .form("bean", JSONUtil.toJsonStr(VolunteerVo));
// reportCommon(request);
//
// return VolunteerVo;
return null;
}
public void zyteam() {
}
......
package com.zq.sync.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 机构表(OrgDept)实体类
*
* @author makejava
* @since 2021-08-19 11:28:38
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class VolunteerVo {
/**
* ID
*/
@ApiModelProperty("ID")
private String id;
/**
* 上级机构id
*/
@ApiModelProperty("上级机构id")
private String parentId;
/**
* 机构(部门)名称
*/
@ApiModelProperty("机构(部门)名称")
private String deptName;
/**
* 机构类型:1 业务处室 2二层机构 3 二层机构业务科室
*/
@ApiModelProperty("机构类型:1 业务处室 2二层机构 3 二层机构业务科室")
private Integer deptType;
/**
* 部门的统一信用代码
*/
@ApiModelProperty("部门的统一信用代码")
private String creditCode;
/**
* 行政区域编号
*/
@ApiModelProperty("行政区域编号")
private String areaCode;
/**
* 地址
*/
@ApiModelProperty("地址")
private String address;
/**
* 联系电话
*/
@ApiModelProperty("联系电话")
private String tel;
/**
* 编制(人员数量)
*/
@ApiModelProperty("编制(人员数量)")
private Integer totalOrgStaff;
/**
* 在编(人员数量)
*/
@ApiModelProperty("在编(人员数量)")
private Integer currOrgStaff;
/**
* 主要职责
*/
@ApiModelProperty("主要职责")
private String responsibility;
/**
* 排序编号,默认为0
*/
@ApiModelProperty("排序编号,默认为0")
private Integer orderNum;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 上级机构名称
*/
@ApiModelProperty("上级机构名称")
private String parentName;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment