Browse Source

替换封禁账号新账号已存在错误提示

zoujiajian 2 năm trước cách đây
mục cha
commit
315f8a6cd4

+ 4 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -912,7 +912,8 @@ public class CmsAccountController {
 	 * 替换封禁账号
 	 */
 	@PostMapping("/replace/banned")
-	public Result<String> replaceBannedAccount(Long goodsId, MultipartFile file) throws IOException {
+	public Result<List<String>> replaceBannedAccount(Long goodsId, MultipartFile file) throws IOException {
+		List<String> repeat = new ArrayList<>();
 		EasyExcel.read(file.getInputStream(), ExcelBannedAccountData.class, new AnalysisEventListener<ExcelBannedAccountData>() {
 			@Override
 			public void invoke(ExcelBannedAccountData data, AnalysisContext analysisContext) {
@@ -932,6 +933,7 @@ public class CmsAccountController {
 				account = account.trim();
 				password = password.trim();
 				if (accountCommonService.checkIsDupAccount(goodsId, account)) {
+					repeat.add(oldAccount);
 					return;
 				}
 				dbAccount.setAccount(account);
@@ -946,7 +948,6 @@ public class CmsAccountController {
 
 			}
 		}).sheet().doRead();
-		return GatewayResponse.SUCCESS.newBuilder().toResult();
+		return GatewayResponse.SUCCESS.newBuilder().toResult(repeat);
 	}
-
 }