Commit 10522ed2 by ilal Committed by chenzg

提交

parent 40dd6715
...@@ -1428,6 +1428,19 @@ public class AttController { ...@@ -1428,6 +1428,19 @@ public class AttController {
for(AttGroupBinPunchMode abp:kqjs) { for(AttGroupBinPunchMode abp:kqjs) {
AttendanceMachine kqj = attendancemachineservice.selectByPrimaryKey(abp.getDkfsid());//查询考勤机“序列号” AttendanceMachine kqj = attendancemachineservice.selectByPrimaryKey(abp.getDkfsid());//查询考勤机“序列号”
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
params.add("userId", attser[u]);
params.add("userName", yggluser.getName());
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
UserEquiRelation kqjry = userequirelationmapper.selectByuserIdkqjid(Integer.valueOf(attser[u]), kqj.getId()); UserEquiRelation kqjry = userequirelationmapper.selectByuserIdkqjid(Integer.valueOf(attser[u]), kqj.getId());
if(kqjry == null) { if(kqjry == null) {
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, attser[u]).eq(KqglAssoYhsb::getKqjid, kqj.getId())); KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, attser[u]).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
...@@ -1444,21 +1457,6 @@ public class AttController { ...@@ -1444,21 +1457,6 @@ public class AttController {
} }
userequirelationmapper.insert(uskqj); userequirelationmapper.insert(uskqj);
} }
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
params.add("userId", attser[u]);
params.add("userName", yggluser.getName());
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
} }
/*****************************************************************************/ /*****************************************************************************/
} }
......
...@@ -1342,21 +1342,7 @@ public class TimeCardController { ...@@ -1342,21 +1342,7 @@ public class TimeCardController {
KqglAssoYhsb kqjry = KqglAssoYhsb.builder().build().selectOne(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, Integer.valueOf(attser[u])).eq(KqglAssoYhsb::getKqjid, kqj.getId())); KqglAssoYhsb kqjry = KqglAssoYhsb.builder().build().selectOne(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, Integer.valueOf(attser[u])).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
if(kqjry == null) { if(kqjry == null) {
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, attser[u]).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(Integer.valueOf(attser[u])).kqjid(kqj.getId()).type(1).build();
UserEquiRelation isgly = userequirelationmapper.selectByuserId(Integer.valueOf(attser[u]));
if(isgly != null) {
uskqj.setIsGly(isgly.getIsGly());
}else {
uskqj.setIsGly(0);
}
if (!uskqj.insert())
return ResultUtil.error("操作失败--新增用户与设备关系");
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u])); YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = mac_command+"/addUserName"; String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
...@@ -1367,6 +1353,19 @@ public class TimeCardController { ...@@ -1367,6 +1353,19 @@ public class TimeCardController {
HttpEntity httpEntity = new HttpEntity(params, headers); HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class); ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody()); System.err.print(request.getBody());
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, attser[u]).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(Integer.valueOf(attser[u])).kqjid(kqj.getId()).type(1).build();
UserEquiRelation isgly = userequirelationmapper.selectByuserId(Integer.valueOf(attser[u]));
if(isgly != null) {
uskqj.setIsGly(isgly.getIsGly());
}else {
uskqj.setIsGly(0);
}
if (!uskqj.insert())
return ResultUtil.error("操作失败--新增用户与设备关系");
} }
} }
} }
......
...@@ -268,9 +268,9 @@ public class YgglController { ...@@ -268,9 +268,9 @@ public class YgglController {
default: default:
break; break;
} }
if (!isvalid) { // if (!isvalid) {
return ResultUtil.error("证件格式不对!"); // return ResultUtil.error("证件格式不对!");
} // }
Integer jobType = addygdaDto.getJobType(); Integer jobType = addygdaDto.getJobType();
Date rzTime = addygdaDto.getRzTime() == null ? new Date() : addygdaDto.getRzTime(); Date rzTime = addygdaDto.getRzTime() == null ? new Date() : addygdaDto.getRzTime();
...@@ -1846,7 +1846,7 @@ public class YgglController { ...@@ -1846,7 +1846,7 @@ public class YgglController {
@ApiOperationSupport(order = 71) @ApiOperationSupport(order = 71)
public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) { public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) {
if (empNumList == null || empNumList.size() == 0) { if (empNumList == null || empNumList.size() == 0) {
return ResultUtil.error("请输入empNum数组"); return ResultUtil.error("存在未设置的审批人");
} }
List<YgglMainEmp> yglList = YgglMainEmp.builder().build() List<YgglMainEmp> yglList = YgglMainEmp.builder().build()
.selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()) .selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
......
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