Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

liyuan před 2 týdny
rodič
revize
b85e34f9a1

+ 1 - 1
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalRequestLogFilter.java

@@ -101,7 +101,7 @@ public class GlobalRequestLogFilter implements GlobalFilter, Ordered {
 
 		beforeReqLog.append("================  Gateway Request End  =================\n");
 		// 打印执行时间
-		log.info(beforeReqLog.toString(), beforeReqArgs.toArray());
+//		log.info(beforeReqLog.toString(), beforeReqArgs.toArray());
 		return chain.filter(exchange);
 	}
 

+ 1 - 1
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalResponseLogFilter.java

@@ -87,7 +87,7 @@ public class GlobalResponseLogFilter implements GlobalFilter, Ordered {
 
 				responseLog.append("================  Gateway Response End  =================\n");
 				// 打印执行时间
-				log.info(responseLog.toString(), responseArgs.toArray());
+//				log.info(responseLog.toString(), responseArgs.toArray());
 			})
 		);
 	}

+ 29 - 9
blade-service/blade-los/src/main/java/org/springblade/los/app/service/impl/IndexServiceImpl.java

@@ -67,7 +67,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -142,7 +144,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -175,7 +179,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -215,7 +221,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -271,7 +279,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 //				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -317,6 +327,8 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
+				}else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
 				} else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
@@ -442,7 +454,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -514,7 +528,9 @@ public class IndexServiceImpl implements IndexService {
 						lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 					} else if (AuthUtil.getUserRole().contains("业务员")) {
 						lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-					} else {
+					} else if (AuthUtil.getUserRole().contains("客服")) {
+						lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+					}else {
 						lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 					}
 					lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -618,7 +634,9 @@ public class IndexServiceImpl implements IndexService {
 						lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 					} else if (AuthUtil.getUserRole().contains("业务员")) {
 						lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-					} else {
+					} else if (AuthUtil.getUserRole().contains("客服")) {
+						lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+					}else {
 						lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 					}
 					lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -674,7 +692,9 @@ public class IndexServiceImpl implements IndexService {
 					lambdaQueryWrapper.like(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.like(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());

+ 11 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -356,6 +356,9 @@ public class BillsController extends BladeController {
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
+				}else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				} else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
@@ -802,7 +805,10 @@ public class BillsController extends BladeController {
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -1035,7 +1041,10 @@ public class BillsController extends BladeController {
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.and(i -> i.eq(Bills::getSrcId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.and(i -> i.eq(Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());

+ 12 - 4
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -297,7 +297,9 @@ public class StatisticAnalysisServiceImpl extends ServiceImpl<FinanceProfitMappe
 					lambdaQueryWrapper.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -331,7 +333,9 @@ public class StatisticAnalysisServiceImpl extends ServiceImpl<FinanceProfitMappe
 					lambdaQueryWrapperSI.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapperSI.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -464,7 +468,9 @@ public class StatisticAnalysisServiceImpl extends ServiceImpl<FinanceProfitMappe
 					lambdaQueryWrapper.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
@@ -499,7 +505,9 @@ public class StatisticAnalysisServiceImpl extends ServiceImpl<FinanceProfitMappe
 					lambdaQueryWrapperSI.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
 				} else if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
-				} else {
+				} else if (AuthUtil.getUserRole().contains("客服")) {
+					lambdaQueryWrapper.like(Bills::getCustomerServiceId, AuthUtil.getUserId());
+				}else {
 					lambdaQueryWrapperSI.eq(Bills::getCreateUser, AuthUtil.getUserId());
 				}
 				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());

+ 33 - 33
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderController.java

@@ -362,31 +362,35 @@ public class OrderController extends BladeController {
 		lambdaQueryWrapper.orderByDesc(Order::getId);
 		List<Order> list = orderService.list(lambdaQueryWrapper);
 
-		String corpIds = "";//客户拼接ids
-		String belongToCorpIds = "";//销售公司ids
-		String productionPlantIds = "";//生产工厂ids
-		String createUserIds = "";//创建人id拼接
-
+		StringBuilder ids = new StringBuilder();
+		StringBuilder createUserIds = new StringBuilder();//创建人id拼接
+		List<Long> corpIdList = list.stream().map(Order::getCorpId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
+		List<Long> belongToCorpIdList = list.stream().map(Order::getBelongToCorpId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
+		List<Long> productionPlantIdList = list.stream().map(Order::getProductionPlant).distinct().filter(Objects::nonNull).collect(Collectors.toList());
+		List<Long> idList = new ArrayList<>();
+		if (!corpIdList.isEmpty()) {
+			idList.addAll(corpIdList);
+		}
+		if (!belongToCorpIdList.isEmpty()) {
+			idList.addAll(belongToCorpIdList);
+		}
+		if (!productionPlantIdList.isEmpty()) {
+			idList.addAll(productionPlantIdList);
+		}
+		List<Long> idsList = idList.stream().distinct().collect(Collectors.toList());
+		for (Long id : idsList) {
+			ids.append(id).append(",");
+		}
 		for (Order orders : list) {
-			if (ObjectUtil.isNotEmpty(orders.getCorpId())) {
-				corpIds = corpIds + orders.getCorpId() + ",";
-			}
-			if (ObjectUtil.isNotEmpty(orders.getCorpId())) {
-				belongToCorpIds = belongToCorpIds + orders.getBelongToCorpId() + ",";
-			}
-			if (ObjectUtil.isNotEmpty(orders.getCorpId())) {
-				productionPlantIds = productionPlantIds + orders.getProductionPlant() + ",";
-			}
 			if (ObjectUtil.isNotEmpty(orders.getCreateUser())) {
-				createUserIds = createUserIds + orders.getCreateUser() + ",";
+				createUserIds.append(orders.getCreateUser()).append(",");
 			}
 		}
-
-		List<CorpsDesc> corpsDescList = corpsDescClient.selectByCorpIds(corpIds);
-		List<CorpsDesc> belongToCorpList = corpsDescClient.selectByCorpIds(belongToCorpIds);
-		List<CorpsDesc> productionPlantList = corpsDescClient.selectByCorpIds(productionPlantIds);
+		List<CorpsDesc> corpsDescList = corpsDescClient.selectByCorpIds(ids.toString());
+//		List<CorpsDesc> belongToCorpList = corpsDescClient.selectByCorpIds(belongToCorpIds);
+//		List<CorpsDesc> productionPlantList = corpsDescClient.selectByCorpIds(productionPlantIds);
 		//获得创建人信息
-		List<User> createUserList = userClient.selectUserIds(createUserIds);
+		List<User> createUserList = userClient.selectUserIds(createUserIds.toString());
 
 		if (CollectionUtils.isNotEmpty(list)) {
 			list.forEach(item -> {
@@ -405,19 +409,15 @@ public class OrderController extends BladeController {
 				} else if (item.getSpecialCheck() == 1) {
 					item.setSpecialCheckName("是");
 				}
-				if (item.getCorpId() != null) {
-					if (ObjectUtil.isNotEmpty(corpsDescList)) {
+				if (ObjectUtil.isNotEmpty(corpsDescList)) {
+					if (item.getCorpId() != null) {
 						item.setCorpsName(corpsDescList.stream().filter(e -> e.getId().equals(item.getCorpId())).findFirst().orElse(new CorpsDesc()).getCname());
 					}
-				}
-				if (item.getBelongToCorpId() != null) {
-					if (ObjectUtil.isNotEmpty(belongToCorpList)) {
-						item.setBelongToCorpName(belongToCorpList.stream().filter(e -> e.getId().equals(item.getBelongToCorpId())).findFirst().orElse(new CorpsDesc()).getCname());
+					if (item.getBelongToCorpId() != null) {
+						item.setBelongToCorpName(corpsDescList.stream().filter(e -> e.getId().equals(item.getBelongToCorpId())).findFirst().orElse(new CorpsDesc()).getCname());
 					}
-				}
-				if (item.getProductionPlant() != null) {
-					if (ObjectUtil.isNotEmpty(productionPlantList)) {
-						item.setProductionPlantName(productionPlantList.stream().filter(e -> e.getId().equals(item.getProductionPlant())).findFirst().get().getCname());
+					if (item.getProductionPlant() != null) {
+						item.setProductionPlantName(corpsDescList.stream().filter(e -> e.getId().equals(item.getProductionPlant())).findFirst().get().getCname());
 					}
 				}
 				//制单人
@@ -1170,16 +1170,16 @@ public class OrderController extends BladeController {
 	@ApiOperation(value = "详情", notes = "传入acc")
 	public R synchronization(@RequestParam("billId") Long billId, @RequestParam("ordNo") String ordNo
 		, @RequestParam("primaryOrdNo") String primaryOrdNo) {
-		return orderService.synchronization(billId,ordNo,primaryOrdNo);
+		return orderService.synchronization(billId, ordNo, primaryOrdNo);
 	}
 
 	/**
 	 * 生成账单
 	 */
 	@GetMapping("/generateBills")
-	public R generateBills(@RequestParam("ids") String ids,@RequestParam("billId") String billId) {
+	public R generateBills(@RequestParam("ids") String ids, @RequestParam("billId") String billId) {
 
-		return orderService.generateBills(ids,billId);
+		return orderService.generateBills(ids, billId);
 	}
 
 }