Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b7c94e7c3 | ||
|
|
03a4d4a8ff | ||
|
|
7d8172e063 | ||
|
|
e5a065fbaf | ||
|
|
470b586085 | ||
|
|
a8c04cf342 | ||
|
|
669118c0f8 | ||
|
|
3d0f9b9d1b | ||
|
|
b2cbe15d8b | ||
|
|
a5426ce894 |
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||
<artifactId>TimiServerAPI</artifactId>
|
||||
<version>1.0.65</version>
|
||||
<version>1.0.68</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>TimiServerAPI</name>
|
||||
<description>imyeyu.com API</description>
|
||||
|
||||
@@ -151,7 +151,7 @@ public class AppVersionService {
|
||||
/// @return 更新响应
|
||||
private AppUpdateCheckResponse buildResponse(AppRelease release, boolean mandatory) {
|
||||
String url = ServletUriComponentsBuilder.fromCurrentContextPath()
|
||||
.path("/attachment/download/")
|
||||
.path("/attach/download/")
|
||||
.path(release.getAttachmentId())
|
||||
.toUriString();
|
||||
return new AppUpdateCheckResponse(release.getVersionName(), url, release.getSha256(), mandatory);
|
||||
@@ -233,10 +233,8 @@ public class AppVersionService {
|
||||
}
|
||||
checkCompatibility(release);
|
||||
Long now = System.currentTimeMillis();
|
||||
String fromReleaseId = channel.getReleaseId();
|
||||
if (grayPermille != null) {
|
||||
release.setGrayPermille(grayPermille);
|
||||
}
|
||||
// 发布不指定灰度按全量处理:草稿默认是 0,直接沿用会让所有设备都拿不到包
|
||||
release.setGrayPermille(grayPermille == null ? (int) GRAY_BASE : grayPermille);
|
||||
release.setStatus(AppRelease.Status.PUBLISHED);
|
||||
if (release.getPublishedAt() == null) {
|
||||
release.setPublishedAt(now);
|
||||
@@ -266,8 +264,7 @@ public class AppVersionService {
|
||||
throw new IllegalArgumentException("目标发布不存在");
|
||||
}
|
||||
Long now = System.currentTimeMillis();
|
||||
String fromReleaseId = channel.getReleaseId();
|
||||
target.setGrayPermille(10000);
|
||||
target.setGrayPermille((int) GRAY_BASE);
|
||||
target.setStatus(AppRelease.Status.PUBLISHED);
|
||||
target.setUpdatedAt(now);
|
||||
releaseMapper.updateSelective(target);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.imyeyu.api.modules.common.controller;
|
||||
|
||||
import com.imyeyu.api.modules.common.entity.Attachment;
|
||||
import com.imyeyu.api.modules.common.bean.attachment.ThumbnailFitMode;
|
||||
import com.imyeyu.api.modules.common.entity.Attachment;
|
||||
import com.imyeyu.api.modules.common.service.AttachmentService;
|
||||
import com.imyeyu.api.modules.common.service.AttachmentVariantService;
|
||||
import com.imyeyu.api.modules.common.service.TempFileService;
|
||||
@@ -68,6 +68,8 @@ public class AttachmentController {
|
||||
@PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public Attachment create(Attachment attachment) {
|
||||
service.create(attachment);
|
||||
attachment.setFile(null);
|
||||
attachment.setInputStream(null);
|
||||
return attachment;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,9 @@ public class Attachment extends UUIDEntity {
|
||||
|
||||
TEMP_FILE,
|
||||
|
||||
MIRROR
|
||||
MIRROR,
|
||||
|
||||
APP_RELEASE
|
||||
}
|
||||
|
||||
protected BizType bizType;
|
||||
|
||||
+24
@@ -16,6 +16,7 @@ import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrderItem;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoStore;
|
||||
import com.imyeyu.api.modules.gao.mapper.GaoProductSkuUnitMapper;
|
||||
import com.imyeyu.api.modules.gao.mapper.GaoSalesOrderItemMapper;
|
||||
import com.imyeyu.api.modules.gao.mapper.GaoSalesOrderMapper;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||
@@ -92,6 +93,7 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
||||
|
||||
private final GaoSalesOrderMapper mapper;
|
||||
private final GaoSalesOrderItemMapper itemMapper;
|
||||
private final GaoProductSkuUnitMapper skuUnitMapper;
|
||||
private final GaoFundRecordService fundRecordService;
|
||||
private final ObjectProvider<GaoOrderFulfillmentService> fulfillmentServiceProvider;
|
||||
private final ObjectProvider<GaoOrderPaymentService> paymentServiceProvider;
|
||||
@@ -120,6 +122,7 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
||||
result.setTotal(mapper.countByQuery(page));
|
||||
List<GaoSalesOrder> list = mapper.selectByQuery(page);
|
||||
fillItemList(list);
|
||||
fillFilteredSkuBaseUnit(list, page.getFulfillableSkuId());
|
||||
fillCustomer(list);
|
||||
result.setList(list);
|
||||
return result;
|
||||
@@ -801,6 +804,27 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
||||
fillItemAttachments(itemList);
|
||||
}
|
||||
|
||||
/// 为筛选出的 SKU 填充基础单位,整页只查询一次
|
||||
///
|
||||
/// @param orderList 当前页订单
|
||||
/// @param skuId 筛选的 SKU ID
|
||||
private void fillFilteredSkuBaseUnit(List<GaoSalesOrder> orderList, String skuId) {
|
||||
if (orderList == null || orderList.isEmpty() || skuId == null || skuId.isBlank()) {
|
||||
return;
|
||||
}
|
||||
String baseUnitName = skuUnitMapper.selectBySkuId(skuId).stream()
|
||||
.filter(unit -> Boolean.TRUE.equals(unit.getIsBase()))
|
||||
.map(GaoProductSkuUnit::getName)
|
||||
.findFirst().orElse(null);
|
||||
for (GaoSalesOrder order : orderList) {
|
||||
for (GaoSalesOrderItem item : order.getItemList()) {
|
||||
if (skuId.equals(item.getSkuId())) {
|
||||
item.setBaseUnitName(baseUnitName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 填充订单项履约余额投影
|
||||
///
|
||||
/// @param item 订单项
|
||||
|
||||
@@ -24,6 +24,9 @@ public class GaoSalesOrderPage extends BasePage {
|
||||
/// 套餐配置 ID
|
||||
private String packageConfigId;
|
||||
|
||||
/// 筛选存在可履约明细的 SKU ID
|
||||
private String fulfillableSkuId;
|
||||
|
||||
/// 订单类型
|
||||
private GaoSalesOrder.OrderType orderType;
|
||||
|
||||
|
||||
@@ -23,6 +23,15 @@
|
||||
o.`deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">AND o.`store_id` = #{storeId}</if>
|
||||
<if test="customerId != null and customerId != ''">AND o.`customer_id` = #{customerId}</if>
|
||||
<if test="fulfillableSkuId != null and fulfillableSkuId != ''">
|
||||
AND o.`status` <> 'CANCELLED'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM `gao_sales_order_item` i
|
||||
WHERE i.`sales_order_id` = o.`id` AND i.`deleted_at` IS NULL
|
||||
AND i.`sku_id` = #{fulfillableSkuId}
|
||||
AND COALESCE(i.`fulfilled_base_quantity`, 0) + COALESCE(i.`reserved_base_quantity`, 0) < COALESCE(i.`base_quantity`, 0)
|
||||
)
|
||||
</if>
|
||||
<if test="packageConfigId != null and packageConfigId != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM `gao_customer_package` cp
|
||||
|
||||
Reference in New Issue
Block a user