Merge pull request 'v1.0.68' (#80) from dev into master
Reviewed-on: #80
This commit was merged in pull request #80.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||
<artifactId>TimiServerAPI</artifactId>
|
||||
<version>1.0.67</version>
|
||||
<version>1.0.68</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>TimiServerAPI</name>
|
||||
<description>imyeyu.com API</description>
|
||||
|
||||
@@ -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);
|
||||
|
||||
+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