|
@@ -26,10 +26,12 @@ import org.fouram.dto.output.GetIngoreListOutput;
|
|
import org.fouram.dto.output.GetToBeConfirmedListOutput;
|
|
import org.fouram.dto.output.GetToBeConfirmedListOutput;
|
|
import org.fouram.dto.output.SyncWeixinUserOutput;
|
|
import org.fouram.dto.output.SyncWeixinUserOutput;
|
|
import org.fouram.entity.SapOrg;
|
|
import org.fouram.entity.SapOrg;
|
|
|
|
+import org.fouram.entity.SapReportAuth;
|
|
import org.fouram.entity.SapUser;
|
|
import org.fouram.entity.SapUser;
|
|
import org.fouram.enums.DelFlagEnum;
|
|
import org.fouram.enums.DelFlagEnum;
|
|
import org.fouram.service.SapCheckReportService;
|
|
import org.fouram.service.SapCheckReportService;
|
|
import org.fouram.service.SapOrgService;
|
|
import org.fouram.service.SapOrgService;
|
|
|
|
+import org.fouram.service.SapReportAuthService;
|
|
import org.fouram.service.SapUserService;
|
|
import org.fouram.service.SapUserService;
|
|
import org.fouram.service.SyncSapUserToWxService;
|
|
import org.fouram.service.SyncSapUserToWxService;
|
|
import org.fouram.service.WxDepartService;
|
|
import org.fouram.service.WxDepartService;
|
|
@@ -37,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestHeader;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
@@ -61,6 +64,8 @@ public class ApiController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private WxDepartService wxDepartService;
|
|
private WxDepartService wxDepartService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private SapReportAuthService authService;
|
|
|
|
+ @Autowired
|
|
private SapCheckReportService sapCheckReportService;
|
|
private SapCheckReportService sapCheckReportService;
|
|
@Autowired
|
|
@Autowired
|
|
private SyncSapUserToWxService syncSapUserToWxService;
|
|
private SyncSapUserToWxService syncSapUserToWxService;
|
|
@@ -296,13 +301,21 @@ public class ApiController extends BaseController {
|
|
public Object findDepartJSON(HttpServletRequest request) throws Exception {
|
|
public Object findDepartJSON(HttpServletRequest request) throws Exception {
|
|
return ResultUtil.success(wxDepartService.findDepartJSON(), "操作成功");
|
|
return ResultUtil.success(wxDepartService.findDepartJSON(), "操作成功");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@PostMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
@PostMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public Object findUsers(HttpServletRequest request, @RequestBody FindUsersDTO dto) throws Exception {
|
|
|
|
|
|
+ public Object findUserReports(HttpServletRequest request, @RequestBody FindUsersDTO dto, @RequestHeader("userId") String userId) throws Exception {
|
|
if (dto.getPageNumber() == null) {
|
|
if (dto.getPageNumber() == null) {
|
|
return ResultUtil.error("参数pageNumber为空");
|
|
return ResultUtil.error("参数pageNumber为空");
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isBlank(dto.getDepartId())) {
|
|
|
|
+ List<SapReportAuth> auths = authService.selectListByWxUserId(userId);
|
|
|
|
+ List<Long> departIds = Lists.newArrayList();
|
|
|
|
+ for (SapReportAuth auth : auths) {
|
|
|
|
+ departIds.add(auth.getWxDepartId());
|
|
|
|
+ }
|
|
|
|
+ dto.setDepartIds(departIds);
|
|
|
|
+ }
|
|
Object result = sapCheckReportService.findUserReportPage(dto);
|
|
Object result = sapCheckReportService.findUserReportPage(dto);
|
|
return ResultUtil.success(result, "操作成功");
|
|
return ResultUtil.success(result, "操作成功");
|
|
}
|
|
}
|