Commit a72f39c3 by lal Committed by chenzg

提交

parent 0d8dff2b
......@@ -592,25 +592,32 @@ public class TimeCardController {
kqglassokqj.setLusjTime(new Date().getTime());
kqglassokqj.setQyid(userBean.getOrgCode());
if(!kqglassokqj.insert())
return ResultUtil.error("操作失败--新增考勤机");
String url = mac_command+"/addDev";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("orgCode", kqglassokqj.getType());
params.add("devId", kqglassokqj.getCode());
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
KqglAssoKqj kqj = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, kqglassokqj.getCode()));
if(kqj == null) {
if(!kqglassokqj.insert())
return ResultUtil.error("操作失败--新增考勤机");
String url = mac_command+"/addDev";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("orgCode", kqglassokqj.getType());
params.add("devId", kqglassokqj.getCode());
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
}
return ResultUtil.data(kqglassokqj,"操作成功!");
}else {
return ResultUtil.error("考勤机已存在或已被使用");
}
return ResultUtil.data(kqglassokqj,"操作成功!");
}
/**
......@@ -2176,6 +2183,8 @@ public class TimeCardController {
}
}
// @GetMapping(value = "/summary_report")
// @ApiOperation(value = "考勤汇总报表(暂时不用)", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> attendance_summary_report() {
......
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