Browse Source

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

# Conflicts:
#	blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/service/impl/BCorpsServiceImpl.java
wfg 5 months ago
parent
commit
65646a86ac

+ 4 - 5
blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/service/impl/BCorpsServiceImpl.java

@@ -120,11 +120,11 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 			.eq(BCorps::getBranchId, deptUtils.getDeptPid())
 			.eq(BCorps::getIsDeleted, 0));
 		//首字母为空
-		if (null == bCorps.getInitials() || bCorps.getInitials().isEmpty()) {
+	/*	if (null == bCorps.getInitials() || bCorps.getInitials().isEmpty()) {
 			//获得名称首字母
 			String initials = getSpells(bCorps.getCnName());
-			bCorps.setInitials(initials.length() > 0 ? initials.substring(0, 1) : "");
-		}
+			bCorps.setInitials(initials.substring(0, 1));
+		}*/
 		if (bCorps.getId() == null) {
 			if (!cname.isEmpty()) {
 				throw new RuntimeException("中文名称不允许重复");
@@ -441,7 +441,7 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 				if (null == bCorps.getInitials() || "".equals(bCorps.getInitials())) {
 					//获得名称首字母
 					String initials = getSpells(bCorps.getCnName());
-					bCorps.setInitials(initials.length() > 0 ? initials.substring(0, 1) : "");
+					bCorps.setInitials(initials.substring(0, 1));
 				}
 				/*if (cname > 0) {
 					throw new RuntimeException("中文名称" + bCorps.getCnName() + "不允许重复");
@@ -536,7 +536,6 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 	public static String getSpells(String characters) {
 		StringBuffer buffer = new StringBuffer();
 		characters = characters.replaceAll("[^a-zA-Z0-9]", "");
-
 		for (int i = 0; i < characters.length(); i++) {
 			char ch = characters.charAt(i);
 			if ((ch >> 7) == 0) {

+ 1 - 1
blade-service/trade-purchase/src/main/java/com/trade/purchase/order/service/impl/OrderServiceImpl.java

@@ -1394,7 +1394,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 						.eq(OrderItems::getIsDeleted, 0);
 					orderItemsBillNo = orderItemsMapper.selectList(orderItemsLambdaQueryWrapper);
 					if (ObjectUtils.isNotNull(orderItems.getId())) {
-						if (orderItemsBillNo.size() > 1) {
+						if (!orderItemsBillNo.isEmpty() && orderItemsBillNo.stream().anyMatch(e -> !e.getId().equals(orderItems.getId()))) {
 							throw new Error("捆包号:" + orderItems.getBillNo() + "不允许重复");
 						}
 					} else {