Commit a23a0388 by ilal Committed by chenzg

提交

parent e702a93d
......@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
......@@ -40,6 +41,7 @@ import cn.timer.api.bean.kqgl.AttendanceMachine;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqgl.UserAttendanceRel;
import cn.timer.api.bean.kqgl.UserEquiRelation;
import cn.timer.api.bean.kqmk.KqglAssOvertimeVice;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkdz;
......@@ -86,6 +88,7 @@ import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper;
import cn.timer.api.dao.kqmk.KqglAssoYhsbMapper;
import cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqgl.AttemacDto;
import cn.timer.api.dto.kqmk.AttSchedulingDto;
import cn.timer.api.dto.kqmk.AttendanceAssistantDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
......@@ -467,7 +470,6 @@ public class TimeCardController {
@GetMapping(value="/synchrotime/{code}")
@ApiOperation(value = "考勤机一键同步", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 54)
public Result<Object> SynchronizationTime(@CurrentUser UserBean userBean,@PathVariable("code") String code) {
JSONObject vResultJson = new JSONObject();
......@@ -490,6 +492,80 @@ public class TimeCardController {
}
/**
* 移除考勤机管理员
*/
@PostMapping(value = "/removeadministrator/{kqjid}/{id}")
@ApiOperation(value = "移除考勤机管理员", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> RemoveAdministrator(@PathVariable int kqjid,@PathVariable int id, @RequestBody Map<String,String> mmd) {
String[] xgyh = mmd.get("a").split(",");
if(xgyh.length > 0){
KqglAssoKqj kqj = KqglAssoKqj.builder().id(kqjid).build().selectById();//查询考勤机“序列号”
for(int a=0;a<xgyh.length;a++){
JSONObject vResultJson = new JSONObject();
vResultJson.put("devId", kqj.getCode());
vResultJson.put("userId", xgyh[a]);
vResultJson.put("privilege", 1);
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command+"/addUserPrivilege";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("json", sFinal);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
}
KqglAssoYhsb.builder().id(id).isGly(0).build().updateById();
}
}
return ResultUtil.success("成功");
}
@PostMapping(value = "/modifyauthority/{kqjid}/{id}")
@ApiOperation(value = "添加考勤机管理员", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> ModifyAuthority(@CurrentUser UserBean userBean,@PathVariable int kqjid,@PathVariable int id, @RequestBody Map<String,String> mmd) {
String[] xgyh = mmd.get("a").split(",");
if(xgyh.length > 0){
KqglAssoKqj kqj = KqglAssoKqj.builder().id(kqjid).build().selectById();//查询考勤机“序列号”
for(int a=0;a<xgyh.length;a++){
JSONObject vResultJson = new JSONObject();
vResultJson.put("devId", kqj.getCode());
vResultJson.put("userId", xgyh[a]);
vResultJson.put("privilege", 2);
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command+"/addUserPrivilege";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("json", sFinal);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
}
UserEquiRelation kqjry = new UserEquiRelation();
kqjry.setId(id);
kqjry.setIsGly(1);
userequirelationmapper.updateByPrimaryKeySelective(kqjry);
}
}
return ResultUtil.success("成功");
}
/**
* 新增考勤机
*/
@PostMapping(value = "/Attendance_machine")
......@@ -499,7 +575,29 @@ public class TimeCardController {
kqglassokqj.setLuryid(userBean.getEmpNum());
kqglassokqj.setLusjTime(new Date().getTime());
kqglassokqj.setQyid(userBean.getOrgCode());
return kqglassokqj.insert() ? ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
if(!kqglassokqj.insert())
return ResultUtil.error("操作失败--新增考勤机");
JSONObject vResultJson = new JSONObject();
vResultJson.put("devId", kqglassokqj.getCode());
vResultJson.put("orgCode", userBean.getOrgCode());
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command+"/addDev";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("json", sFinal);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
}
return ResultUtil.success("操作成功!");
}
/**
......@@ -1754,7 +1852,6 @@ public class TimeCardController {
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
/**************************/
/**
* 查询列表-加班补偿方式
......
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