Commit dd107ff9 authored by 赵啸非's avatar 赵啸非

修改同步人员接口

parent 0a2b8d27
......@@ -100,12 +100,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
}
} else {
//todo 设备直连
deptService.syncDeptByDevice(null);
// deptService.syncDeptByDevice(null);
staffService.syncPersonsByDevices(null);
}
......
......@@ -33,6 +33,7 @@ import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -70,6 +71,9 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
@Autowired
private AttendanceLeaveRecordService leaveRecordService;
@Value("${hik.host:}")
protected String hikhost;
public StaffController() {
super.setModuleDesc("员工基本信息");
......@@ -227,11 +231,15 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
JSONObject jsonObject = new JSONObject();
String busiDesc = this.getModuleDesc() + "同步";
try {
//同步部门
deptService.syncDept(getContext());
Rest<Void> rest = this.service.syncPersons(getContext());
if (rest.getCode() == YesNoEnum.NO.getValue()) {
throw new AppException("同步异常!");
if (!ObjectUtils.isEmpty(hikhost)) {
//同步部门
deptService.syncDept(getContext());
Rest<Void> rest = this.service.syncPersons(getContext());
if (rest.getCode() == YesNoEnum.NO.getValue()) {
throw new AppException("同步异常!");
}
}else{
this.service.syncPersonsByDevices(null);
}
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
......
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