Przeglądaj źródła

修复批量发货的Bug

suntg 7 lat temu
rodzic
commit
64448c00ba

+ 7 - 5
src/main/java/com/uas/platform/b2b/support/TokenService.java

@@ -18,11 +18,13 @@ public class TokenService {
 	private TokenDao tokenDao;
 
 	public Token saveToken(Token token) {
-		List<Token> tokens = tokenDao.findByUuAndUserType(token.getUu(), token.getUserType());
-		if (!tokens.isEmpty())
-			tokenDao.delete(tokens);
-		token.setTime(new Date());
-		return tokenDao.save(token);
+		synchronized (token.getUu()) {
+			List<Token> tokens = tokenDao.findByUuAndUserType(token.getUu(), token.getUserType());
+			if (!tokens.isEmpty())
+				tokenDao.delete(tokens);
+			token.setTime(new Date());
+			return tokenDao.save(token);
+		}
 	}
 
 	/**

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/notice.html

@@ -318,7 +318,7 @@
                     <label><input type="checkbox" class="selector select_all"
                                   ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a
                         href="javascript:void(0)"
-                        ng-disabled="active!='todo'" ng-click="getToken(); sendByBatch()" class="btn btn-default btn-xs">批量发货</a>
+                        ng-disabled="active!='todo'" ng-click="sendByBatch()" class="btn btn-default btn-xs">批量发货</a>
                     <span class="text-muted">
 						&nbsp;&nbsp;<i class="fa fa-exclamation-triangle"></i>批量发货要求对应订单的客户相同、币别相同、收款方式相同。