|
@@ -81,7 +81,7 @@ public class KwaiXiaoDianReportController {
|
|
|
}
|
|
|
List<Long> itemIds = kwaixiaodianItemGetService.getItemIdsByUserIds(userIds);
|
|
|
requestMap.put("itemIds", itemIds);
|
|
|
- } else if ("industry_courtship_manager".equals(roleId) ) { // 招商、采购经理角色查看部门下所有成员数据
|
|
|
+ } else if ("industry_courtship_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
|
|
|
List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
|
|
|
if (Check.isNull(courtshipPurchaseIds)) {
|
|
|
throw new Exception("此用户未查询到部门成员信息");
|
|
@@ -858,15 +858,22 @@ public class KwaiXiaoDianReportController {
|
|
|
|
|
|
|
|
|
@GetMapping("/getSaleDetail")
|
|
|
- public TableDataInfo getSaleDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize) {
|
|
|
+ public TableDataInfo getSaleDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId) {
|
|
|
TableDataInfo rspData = new TableDataInfo();
|
|
|
try {
|
|
|
- if (Check.isNull(userId)) {
|
|
|
- throw new Exception("请传入用户ID");
|
|
|
- }
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- requestMap.put("userId", userId);
|
|
|
-
|
|
|
+ if (!Check.isNull(userId)) {
|
|
|
+ requestMap.put("userId", userId);
|
|
|
+ } else {
|
|
|
+ requestMap.put("userId", null);
|
|
|
+ String roleId = sysRoleService.getRoleBYUserId(loginUserId);
|
|
|
+ if ("admin".equals(roleId)) {
|
|
|
+ requestMap.put("companyId", null);
|
|
|
+ } else {
|
|
|
+ Long companyId = kwaixiaodianItemGetService.getCompanyId(loginUserId);
|
|
|
+ requestMap.put("companyId", companyId);
|
|
|
+ }
|
|
|
+ }
|
|
|
Long start = DateUtils.strDateToInt(startDate);
|
|
|
Long end = DateUtils.strDateToInt(endDate);
|
|
|
requestMap.put("start", start);
|
|
@@ -889,11 +896,8 @@ public class KwaiXiaoDianReportController {
|
|
|
|
|
|
|
|
|
@GetMapping("/exportSaleDetail")
|
|
|
- public void exportSaleDetail(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate) throws IOException, ParseException {
|
|
|
+ public void exportSaleDetail(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate, Long loginUserId) throws IOException, ParseException {
|
|
|
|
|
|
- if (Check.isNull(userId)) {
|
|
|
- return;
|
|
|
- }
|
|
|
if (Check.isNull(startDate)) {
|
|
|
return;
|
|
|
}
|
|
@@ -902,8 +906,18 @@ public class KwaiXiaoDianReportController {
|
|
|
}
|
|
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- requestMap.put("userId", userId);
|
|
|
-
|
|
|
+ if (!Check.isNull(userId)) {
|
|
|
+ requestMap.put("userId", userId);
|
|
|
+ } else {
|
|
|
+ requestMap.put("userId", null);
|
|
|
+ String roleId = sysRoleService.getRoleBYUserId(loginUserId);
|
|
|
+ if ("admin".equals(roleId)) {
|
|
|
+ requestMap.put("companyId", null);
|
|
|
+ } else {
|
|
|
+ Long companyId = kwaixiaodianItemGetService.getCompanyId(loginUserId);
|
|
|
+ requestMap.put("companyId", companyId);
|
|
|
+ }
|
|
|
+ }
|
|
|
Long start = DateUtils.strDateToInt(startDate);
|
|
|
Long end = DateUtils.strDateToInt(endDate);
|
|
|
requestMap.put("start", start);
|
|
@@ -1054,15 +1068,23 @@ public class KwaiXiaoDianReportController {
|
|
|
|
|
|
|
|
|
@GetMapping("/getPurchaseDetail")
|
|
|
- public TableDataInfo getPurchaseDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize) {
|
|
|
+ public TableDataInfo getPurchaseDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId) {
|
|
|
TableDataInfo rspData = new TableDataInfo();
|
|
|
try {
|
|
|
- if (Check.isNull(userId)) {
|
|
|
- throw new Exception("请传入用户ID");
|
|
|
- }
|
|
|
- Map<String, Object> requestMap = new HashMap<>();
|
|
|
- requestMap.put("userId", userId);
|
|
|
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(userId)) {
|
|
|
+ requestMap.put("userId", userId);
|
|
|
+ } else {
|
|
|
+ requestMap.put("userId", null);
|
|
|
+ String roleId = sysRoleService.getRoleBYUserId(loginUserId);
|
|
|
+ if ("admin".equals(roleId)) {
|
|
|
+ requestMap.put("companyId", null);
|
|
|
+ } else {
|
|
|
+ Long companyId = kwaixiaodianItemGetService.getCompanyId(loginUserId);
|
|
|
+ requestMap.put("companyId", companyId);
|
|
|
+ }
|
|
|
+ }
|
|
|
Long start = DateUtils.strDateToInt(startDate);
|
|
|
Long end = DateUtils.strDateToInt(endDate);
|
|
|
requestMap.put("start", start);
|
|
@@ -1085,11 +1107,8 @@ public class KwaiXiaoDianReportController {
|
|
|
|
|
|
|
|
|
@GetMapping("/exportPurchaseDetail")
|
|
|
- public void exportPurchaseDetail(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate) throws IOException, ParseException {
|
|
|
+ public void exportPurchaseDetail(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate, Long loginUserId) throws IOException, ParseException {
|
|
|
|
|
|
- if (Check.isNull(userId)) {
|
|
|
- return;
|
|
|
- }
|
|
|
if (Check.isNull(startDate)) {
|
|
|
return;
|
|
|
}
|
|
@@ -1098,8 +1117,18 @@ public class KwaiXiaoDianReportController {
|
|
|
}
|
|
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- requestMap.put("userId", userId);
|
|
|
-
|
|
|
+ if (!Check.isNull(userId)) {
|
|
|
+ requestMap.put("userId", userId);
|
|
|
+ } else {
|
|
|
+ requestMap.put("userId", null);
|
|
|
+ String roleId = sysRoleService.getRoleBYUserId(loginUserId);
|
|
|
+ if ("admin".equals(roleId)) {
|
|
|
+ requestMap.put("companyId", null);
|
|
|
+ } else {
|
|
|
+ Long companyId = kwaixiaodianItemGetService.getCompanyId(loginUserId);
|
|
|
+ requestMap.put("companyId", companyId);
|
|
|
+ }
|
|
|
+ }
|
|
|
Long start = DateUtils.strDateToInt(startDate);
|
|
|
Long end = DateUtils.strDateToInt(endDate);
|
|
|
requestMap.put("start", start);
|