zoujiajian 3 жил өмнө
parent
commit
3d094d3b3c

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mange/CmsAccountService.java

@@ -44,5 +44,5 @@ public interface CmsAccountService extends IService<Account> {
 	/**
 	 * 解析ChatGPT独立账号
 	 */
-	void analysisChatGPTAccount(List<Object> accountList);
+	void analysisChatGPTAccount(Long goodsId, Long skuId, List<Object> accountList);
 }

+ 4 - 4
netflix-service/src/main/java/com/cyksj/service/mange/account/CmsAccountServiceImpl.java

@@ -164,7 +164,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 
 	@Override
 	@Transactional(rollbackFor = Throwable.class)
-	public void analysisChatGPTAccount(List<Object> accountList) {
+	public void analysisChatGPTAccount(Long goodsId, Long skuId, List<Object> accountList) {
 		if (CollUtil.isEmpty(accountList)) {
 			throw BusinessRuntimeException.getInstance("文件数据为空");
 		}
@@ -177,7 +177,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 				String apiKey = part[2];
 				int count = this.count(Wrappers.lambdaQuery(Account.class)
 						.eq(Account::getAccount, account)
-						.eq(Account::getGoodsId, 18));
+						.eq(Account::getGoodsId, goodsId));
 				if (count > 0) {
 					return;
 				}
@@ -185,12 +185,12 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 				insert.setAccount(account);
 				insert.setPassword(password);
 				insert.setApiKey(apiKey);
-				insert.setGoodsId(18l);
+				insert.setGoodsId(goodsId);
 				this.save(insert);
 
 				//自动配置车队
 				GroupsTrips groupsTrips = new GroupsTrips();
-				groupsTrips.setSkuId(176l);
+				groupsTrips.setSkuId(skuId);
 				groupsTrips.setAccountId(insert.getId());
 				cmsGroupService.issuance(groupsTrips);
 			}

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

@@ -235,10 +235,10 @@ public class CmsAccountController {
 	/**
 	 * 解析chatGpt独立账号excel
 	 */
-	@GetMapping("/analysis/chatGPT/account")
-	public Result<String> analysisChatGPTAccount(MultipartFile file) throws IOException {
+	@PostMapping("/analysis/chatGPT/account")
+	public Result<String> analysisChatGPTAccount(@RequestParam(required = false, defaultValue = "18") Long goodsId, @RequestParam(required = false, defaultValue = "176") Long skuId, MultipartFile file) throws IOException {
 		List<Object> accountList = EasyExcel.read(file.getInputStream()).sheet().headRowNumber(0).doReadSync();
-		accountService.analysisChatGPTAccount(accountList);
+		accountService.analysisChatGPTAccount(goodsId, skuId, accountList);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}