|
@@ -28,7 +28,6 @@ import org.fouram.dto.output.SyncWeixinUserOutput;
|
|
|
import org.fouram.entity.SapOrg;
|
|
|
import org.fouram.entity.SapUser;
|
|
|
import org.fouram.enums.DelFlagEnum;
|
|
|
-import org.fouram.enums.SapUserResultEnum;
|
|
|
import org.fouram.input.FindUsersDTO;
|
|
|
import org.fouram.service.SapCheckReportService;
|
|
|
import org.fouram.service.SapOrgService;
|
|
@@ -42,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -65,7 +65,7 @@ public class ApiController extends BaseController {
|
|
|
private SapCheckReportService sapCheckReportService;
|
|
|
@Autowired
|
|
|
private SyncSapUserToWxService syncSapUserToWxService;
|
|
|
-
|
|
|
+
|
|
|
private static final String TOKEN = "UserId";
|
|
|
|
|
|
/**
|
|
@@ -206,7 +206,7 @@ public class ApiController extends BaseController {
|
|
|
return ResultUtil.error(ResultConstant.TOKEN_ERR_MSG);
|
|
|
}
|
|
|
try {
|
|
|
- if(WebConstants.CACHE.containsKey(WebConstants.CACHE_SYNC_SAP)) {
|
|
|
+ if (WebConstants.CACHE.containsKey(WebConstants.CACHE_SYNC_SAP)) {
|
|
|
return ResultUtil.error("数据正在同步,请稍等");
|
|
|
}
|
|
|
return ResultUtil.success(sapUserService.selectToBeConfirmedPrimaryList(dto), null);
|
|
@@ -224,14 +224,18 @@ public class ApiController extends BaseController {
|
|
|
return ResultUtil.error(ResultConstant.TOKEN_ERR_MSG);
|
|
|
}
|
|
|
try {
|
|
|
- sapUserService.updateIngore(dto.getUserId());
|
|
|
+ List<String> userIds = dto.getUserIds();
|
|
|
+ if (StringUtils.isNotBlank(dto.getUserId())) {
|
|
|
+ userIds = Lists.newArrayList(dto.getUserId());
|
|
|
+ }
|
|
|
+ sapUserService.updateIngore(userIds);
|
|
|
return ResultUtil.success(null, "操作成功");
|
|
|
} catch (Exception e) {
|
|
|
LoggerUtil.error(e);
|
|
|
return ResultUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "更新同步")
|
|
|
@PostMapping(value = "/updateSync", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
@@ -240,20 +244,18 @@ public class ApiController extends BaseController {
|
|
|
return ResultUtil.error(ResultConstant.TOKEN_ERR_MSG);
|
|
|
}
|
|
|
try {
|
|
|
- SapUser sapUser = sapUserService.selectByUserId(dto.getUserId());
|
|
|
- if(SapUserResultEnum.LEAVE.getCode().equals(sapUser.getResult())) {
|
|
|
-// String oprUserId = request.getSession().getAttribute(TOKEN).toString();
|
|
|
- sapUserService.deleteQuitUserByUserId(dto.getUserId(), null);
|
|
|
- }else {
|
|
|
- sapUserService.updateSyncWxResult(dto.getUserId());
|
|
|
+ List<String> userIds = dto.getUserIds();
|
|
|
+ if (StringUtils.isNotBlank(dto.getUserId())) {
|
|
|
+ userIds = Lists.newArrayList(dto.getUserId());
|
|
|
}
|
|
|
+ sapUserService.updateSync(userIds);
|
|
|
return ResultUtil.success(null, "操作成功");
|
|
|
} catch (Exception e) {
|
|
|
LoggerUtil.error(e);
|
|
|
return ResultUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "手动同步SAP用户数据")
|
|
|
@ApiResponses(@ApiResponse(response = SyncWeixinUserOutput.class, code = 200, message = "success"))
|
|
|
@PostMapping(value = "/syncWeixinUser", produces = "application/json;charset=utf-8")
|
|
@@ -267,7 +269,7 @@ public class ApiController extends BaseController {
|
|
|
return ResultUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiResponses(@ApiResponse(response = GetIngoreListOutput.class, code = 200, message = "success"))
|
|
|
@ApiOperation(value = "查询忽略列表")
|
|
|
@PostMapping(value = "/getIngoreList", produces = "application/json;charset=utf-8")
|
|
@@ -283,7 +285,7 @@ public class ApiController extends BaseController {
|
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "取消忽略")
|
|
|
@PostMapping(value = "/cancelIngore", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|