Compare commits
19 Commits
8e984eb283
...
9f7987306c
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f7987306c | |||
|
|
d3fc70fbf2 | ||
|
|
17645d17e5 | ||
|
|
258eea5277 | ||
|
|
bb1d3bd359 | ||
|
|
6a8c87ed95 | ||
|
|
eb3826927d | ||
|
|
7720c8c771 | ||
|
|
b459148d58 | ||
|
|
eadda18d1e | ||
|
|
d403df51ec | ||
| 6903b98b60 | |||
| 81bf65515c | |||
|
|
afc6041570 | ||
| bce368248c | |||
|
|
9a206f9979 | ||
|
|
eb7a46c7e8 | ||
|
|
95ef68a784 | ||
|
|
6429288fd9 |
@@ -636,26 +636,26 @@ public class GenerateConsumer {
|
|||||||
public void getPoseTransformationResult(Message msg, Channel channel) {
|
public void getPoseTransformationResult(Message msg, Channel channel) {
|
||||||
processPoseTransformResult(msg, channel);
|
processPoseTransformResult(msg, channel);
|
||||||
}
|
}
|
||||||
@RabbitListener(queues = "#{rabbitMQProperties.queues.designBatch}")
|
// @RabbitListener(queues = "#{rabbitMQProperties.queues.designBatch}")
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void getDesignBatchResult(Message msg, Channel channel) {
|
// public void getDesignBatchResult(Message msg, Channel channel) {
|
||||||
processDesignBatchResult(msg, channel);
|
// processDesignBatchResult(msg, channel);
|
||||||
}
|
// }
|
||||||
@RabbitListener(queues = "#{rabbitMQProperties.queues.toProductImageBatch}")
|
// @RabbitListener(queues = "#{rabbitMQProperties.queues.toProductImageBatch}")
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void getToProductImageBatchResult(Message msg, Channel channel) {
|
// public void getToProductImageBatchResult(Message msg, Channel channel) {
|
||||||
processToProductImageBatchResult(msg, channel);
|
// processToProductImageBatchResult(msg, channel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = "#{rabbitMQProperties.queues.relightBatch}")
|
// @RabbitListener(queues = "#{rabbitMQProperties.queues.relightBatch}")
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void getRelightBatchResult(Message msg, Channel channel) {
|
// public void getRelightBatchResult(Message msg, Channel channel) {
|
||||||
processRelightBatchResult(msg, channel);
|
// processRelightBatchResult(msg, channel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = "#{rabbitMQProperties.queues.poseTransformBatch}")
|
// @RabbitListener(queues = "#{rabbitMQProperties.queues.poseTransformBatch}")
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void getPoseTransformBatchResult(Message msg, Channel channel) {
|
// public void getPoseTransformBatchResult(Message msg, Channel channel) {
|
||||||
processPoseTransformBatchResult(msg, channel);
|
// processPoseTransformBatchResult(msg, channel);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ public class PythonService {
|
|||||||
@Value("${access.python.generate_sr_port}")
|
@Value("${access.python.generate_sr_port}")
|
||||||
private String srServicePort;
|
private String srServicePort;
|
||||||
|
|
||||||
|
@Value("${design.callback.url}")
|
||||||
|
private String callbackUrl;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PythonTAllInfoService pythonTAllInfoService;
|
private PythonTAllInfoService pythonTAllInfoService;
|
||||||
|
|
||||||
@@ -231,6 +234,7 @@ public class PythonService {
|
|||||||
List<DesignPythonObject> objects = new ArrayList<>();
|
List<DesignPythonObject> objects = new ArrayList<>();
|
||||||
designPythonObjects.setObjects(objects);
|
designPythonObjects.setObjects(objects);
|
||||||
designPythonObjects.setProcess_id(processId);
|
designPythonObjects.setProcess_id(processId);
|
||||||
|
designPythonObjects.setCallback_url(callbackUrl);
|
||||||
|
|
||||||
long pinPrintNum = calculateDesignPinPrintNum(elementVO.getPrintBoardElements());
|
long pinPrintNum = calculateDesignPinPrintNum(elementVO.getPrintBoardElements());
|
||||||
long noPinPrintNum = calculateDesignNoPinPrintNum(elementVO.getPrintBoardElements(), elementVO.getDesignNum());
|
long noPinPrintNum = calculateDesignNoPinPrintNum(elementVO.getPrintBoardElements(), elementVO.getDesignNum());
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ public class DesignPythonObjects {
|
|||||||
List<Library> addLibrary;
|
List<Library> addLibrary;
|
||||||
|
|
||||||
private String requestId;
|
private String requestId;
|
||||||
|
|
||||||
|
private String callback_url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ public class SubscriptionPlanServiceImpl extends ServiceImpl<SubscriptionPlanMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
baseMapper.insert(subscriptionPlan);
|
baseMapper.insert(subscriptionPlan);
|
||||||
|
if (subscriptionPlanDTO.getStatus().equals(SubscriptionPlan.SubscriptionStatus.ACTIVE.name())) {
|
||||||
|
// 执行一次激活扫描器
|
||||||
|
activeSubscriptionPlan();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateCreatePlanParams(SubscriptionPlanDTO subscriptionPlanDTO) {
|
private void validateCreatePlanParams(SubscriptionPlanDTO subscriptionPlanDTO) {
|
||||||
@@ -487,7 +491,7 @@ public class SubscriptionPlanServiceImpl extends ServiceImpl<SubscriptionPlanMap
|
|||||||
*/
|
*/
|
||||||
private void updateAccount(Account account, SubscriptionPlan plan, boolean isAdmin) {
|
private void updateAccount(Account account, SubscriptionPlan plan, boolean isAdmin) {
|
||||||
// 如果是管理员的切换,先再次记录一下已使用的积分
|
// 如果是管理员的切换,先再次记录一下已使用的积分
|
||||||
if (isAdmin) {
|
if (isAdmin && Objects.nonNull(account.getSubscriptionPlanId())) {
|
||||||
SubscriptionPlan currentPlan = baseMapper.selectById(account.getSubscriptionPlanId());
|
SubscriptionPlan currentPlan = baseMapper.selectById(account.getSubscriptionPlanId());
|
||||||
if (currentPlan.getCreditUsage().compareTo(account.getCreditsUsage()) < 0) {
|
if (currentPlan.getCreditUsage().compareTo(account.getCreditsUsage()) < 0) {
|
||||||
updateSubscriptionPlanUsage(currentPlan, account.getCreditsUsage());
|
updateSubscriptionPlanUsage(currentPlan, account.getCreditsUsage());
|
||||||
|
|||||||
@@ -1461,10 +1461,12 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (StringUtil.isNullOrEmpty(fluxResult)) {
|
if (StringUtil.isNullOrEmpty(fluxResult)) {
|
||||||
toProductImageResult.setStatus("Fail");
|
toProductImageResult.setStatus("Fail");
|
||||||
toProductImageResultMapper.updateById(toProductImageResult);
|
toProductImageResultMapper.updateById(toProductImageResult);
|
||||||
|
sortRank(toProductImageResult);
|
||||||
results.add(new MagicToolResultVO(taskId, "Fail"));
|
results.add(new MagicToolResultVO(taskId, "Fail"));
|
||||||
} else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) {
|
} else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) {
|
||||||
toProductImageResult.setStatus(fluxResult);
|
toProductImageResult.setStatus(fluxResult);
|
||||||
toProductImageResultMapper.updateById(toProductImageResult);
|
toProductImageResultMapper.updateById(toProductImageResult);
|
||||||
|
sortRank(toProductImageResult);
|
||||||
results.add(new MagicToolResultVO(taskId, fluxResult));
|
results.add(new MagicToolResultVO(taskId, fluxResult));
|
||||||
} else {
|
} else {
|
||||||
results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt()));
|
results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt()));
|
||||||
@@ -1515,6 +1517,28 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
重排Relight失败sort
|
||||||
|
*/
|
||||||
|
private void sortRank(ToProductImageResult toProductImageResult) {
|
||||||
|
LambdaQueryWrapper<CollectionSort> collectionSortLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
collectionSortLambdaQueryWrapper.eq(CollectionSort::getRelationId, toProductImageResult.getId()).orderByDesc(CollectionSort::getCreateTime).last("LIMIT 1");
|
||||||
|
|
||||||
|
List<CollectionSort> collectionSorts = collectionSortMapper.selectList(collectionSortLambdaQueryWrapper);
|
||||||
|
|
||||||
|
if (!collectionSorts.isEmpty()) {
|
||||||
|
|
||||||
|
collectionSortMapper.deleteById(collectionSorts.get(0));
|
||||||
|
List<CollectionSort> collectionSorts1 = collectionSortMapper.selectList(new LambdaQueryWrapper<CollectionSort>().eq(CollectionSort::getParentId, collectionSorts.get(0).getParentId()).gt(CollectionSort::getSort, collectionSorts.get(0).getSort()));
|
||||||
|
if (!collectionSorts1.isEmpty()) {
|
||||||
|
for (CollectionSort collectionSort : collectionSorts1) {
|
||||||
|
collectionSort.setSort(collectionSort.getSort() - 1);
|
||||||
|
collectionSortMapper.updateById(collectionSort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String convert(InputStream inputStream) {
|
public static String convert(InputStream inputStream) {
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
|
||||||
return reader.lines().collect(Collectors.joining("\n"));
|
return reader.lines().collect(Collectors.joining("\n"));
|
||||||
|
|||||||
@@ -157,4 +157,5 @@ ollama.url=http://localhost:11434/api/chat
|
|||||||
google.client.id=157095842121-kdd1fdf8m8nudvj9sprstb2k2prnf9e4.apps.googleusercontent.com
|
google.client.id=157095842121-kdd1fdf8m8nudvj9sprstb2k2prnf9e4.apps.googleusercontent.com
|
||||||
#google.client.secret=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
|
#google.client.secret=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
|
||||||
google.client.secret=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
|
google.client.secret=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
|
||||||
google.redirect.uri=https://develop.api.aida.com.hk/api/third/party/auth/google_callback
|
google.redirect.uri=https://develop.api.aida.com.hk/api/third/party/auth/google_callback
|
||||||
|
design.callback.url=https://develop.api.aida.com.hk/api/third/party/receiveDesignResults
|
||||||
@@ -155,4 +155,5 @@ FREEPIK_API_KEY=FPSX94e5917d376a4facb87dabbaa0319c72
|
|||||||
|
|
||||||
google.client.id=29310152396-nnsd3h533fld665oguu8ovrt1nukmt46.apps.googleusercontent.com
|
google.client.id=29310152396-nnsd3h533fld665oguu8ovrt1nukmt46.apps.googleusercontent.com
|
||||||
google.client.secret=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
|
google.client.secret=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
|
||||||
google.redirect.uri=https://www.api.aida.com.hk/api/third/party/auth/google_callback
|
google.redirect.uri=https://www.api.aida.com.hk/api/third/party/auth/google_callback
|
||||||
|
design.callback.url=https://api.aida.com.hk/api/third/party/receiveDesignResults
|
||||||
Reference in New Issue
Block a user