Commit 31b49141 authored by zhangyanduan's avatar zhangyanduan

fix: 修改数据哈

parent 53928c65
......@@ -8,6 +8,7 @@ import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.integration.jieLink.dto.JieLinkDoorRecordDto;
import org.rcisoft.integration.jieLink.dto.JieLinkResultDto;
import org.rcisoft.integration.jieLink.service.IJieLinkService;
import org.rcisoft.sys.sysuser.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -21,7 +22,7 @@ public class JieLinkInterController {
@CyOpeLogAnno(title = "jieLinkInter-捷顺道闸上传门禁记录", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="捷顺对接集成", notes="门禁数据上传")
@ApiOperation(value="捷顺对接集成-门禁数据上传", notes="门禁数据上传")
@PostMapping(value = "/doorrecord")
public JieLinkResultDto addDoorrecord(@RequestBody JieLinkDoorRecordDto recodeDto) {
JieLinkResultDto result = new JieLinkResultDto();
......@@ -53,7 +54,7 @@ public class JieLinkInterController {
}
@ApiOperation(value="捷顺对接集成", notes="同步设备信息")
@ApiOperation(value="捷顺对接集成-同步设备信息", notes="同步设备信息")
@GetMapping(value = "/syncDeviceData")
public JieLinkResultDto syncDeviceData() {
jieLinkService.syncDeviceInfo();
......@@ -63,5 +64,27 @@ public class JieLinkInterController {
return result;
}
@ApiOperation(value="捷顺对接集成-获取部门信息", notes="获取部门信息")
@GetMapping(value = "/getDeptList")
public JieLinkResultDto getDeptList() {
jieLinkService.getDeptList();
JieLinkResultDto result = new JieLinkResultDto();
result.setMsg("同步完成");
result.setCode("0");
return result;
}
@ApiOperation(value="捷顺对接集成-获取部门信息", notes="获取部门信息")
@GetMapping(value = "/delUser")
public JieLinkResultDto delUser(String personId) {
SysUser delUser = new SysUser();
delUser.setPersonId(personId);
jieLinkService.pushDelUserData(delUser);
JieLinkResultDto result = new JieLinkResultDto();
result.setMsg("删除完成");
result.setCode("0");
return result;
}
}
......@@ -73,4 +73,7 @@ public interface IJieLinkService {
public JieLinkResultDto saveDoorRecordInfo(JieLinkDoorRecordDto recordDto);
public void syncDeviceInfo();
public void getDeptList();
}
......@@ -31,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
......@@ -201,6 +200,8 @@ public class JieLinkServiceImpl implements IJieLinkService {
if(headers!=null){
JieLinkPersonDto pushData = this.convertUserBean(userData);
pushData.setPersonId(userData.getPersonId());
//此处写死部门
pushData.setDeptId("5a9dc528-e7ad-4952-9f21-a885b6564a1c");
HttpEntity<JieLinkPersonDto> httpEntity = new HttpEntity<>(pushData,headers);
StringBuffer uriAddr = new StringBuffer();
uriAddr.append(jieLinkUri).append(apiUri);
......@@ -734,6 +735,39 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}
@Override
public void getDeptList() {
String apiUri = "/api/base/depts";
HttpHeaders headers = this.loadHeaderHandle();
if(headers!=null){
JSONObject pushData = new JSONObject();
pushData.put("pageIndex",1);
pushData.put("pageSize",300);
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(pushData,headers);
StringBuffer uriAddr = new StringBuffer();
uriAddr.append(jieLinkUri).append(apiUri);
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, JSONObject.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.info("getDeptList接口返回信息:"+responseEntity.getBody().toJSONString());
JSONObject body = responseEntity.getBody();
if(StringUtils.equals(body.getString("code"),"0")){
}else{
log.error("syncDeviceInfo接口返回错误信息:"+body.getString("msg"));
}
}else{
log.error("syncDeviceInfo接口请求失败");
}
}catch (Exception ex){
log.error(ex.getMessage(),ex);
}
}else{
//认证信息获取失败
log.error("syncDeviceInfo接口获取认证参数失败");
}
}
/**
* 创建hander头信息
......
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