Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b7c94e7c3 | ||
|
|
03a4d4a8ff | ||
|
|
7d8172e063 | ||
|
|
e5a065fbaf | ||
|
|
470b586085 | ||
|
|
a8c04cf342 | ||
|
|
669118c0f8 |
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||||
<artifactId>TimiServerAPI</artifactId>
|
<artifactId>TimiServerAPI</artifactId>
|
||||||
<version>1.0.66</version>
|
<version>1.0.68</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>TimiServerAPI</name>
|
<name>TimiServerAPI</name>
|
||||||
<description>imyeyu.com API</description>
|
<description>imyeyu.com API</description>
|
||||||
|
|||||||
@@ -233,10 +233,8 @@ public class AppVersionService {
|
|||||||
}
|
}
|
||||||
checkCompatibility(release);
|
checkCompatibility(release);
|
||||||
Long now = System.currentTimeMillis();
|
Long now = System.currentTimeMillis();
|
||||||
String fromReleaseId = channel.getReleaseId();
|
// 发布不指定灰度按全量处理:草稿默认是 0,直接沿用会让所有设备都拿不到包
|
||||||
if (grayPermille != null) {
|
release.setGrayPermille(grayPermille == null ? (int) GRAY_BASE : grayPermille);
|
||||||
release.setGrayPermille(grayPermille);
|
|
||||||
}
|
|
||||||
release.setStatus(AppRelease.Status.PUBLISHED);
|
release.setStatus(AppRelease.Status.PUBLISHED);
|
||||||
if (release.getPublishedAt() == null) {
|
if (release.getPublishedAt() == null) {
|
||||||
release.setPublishedAt(now);
|
release.setPublishedAt(now);
|
||||||
@@ -266,8 +264,7 @@ public class AppVersionService {
|
|||||||
throw new IllegalArgumentException("目标发布不存在");
|
throw new IllegalArgumentException("目标发布不存在");
|
||||||
}
|
}
|
||||||
Long now = System.currentTimeMillis();
|
Long now = System.currentTimeMillis();
|
||||||
String fromReleaseId = channel.getReleaseId();
|
target.setGrayPermille((int) GRAY_BASE);
|
||||||
target.setGrayPermille(10000);
|
|
||||||
target.setStatus(AppRelease.Status.PUBLISHED);
|
target.setStatus(AppRelease.Status.PUBLISHED);
|
||||||
target.setUpdatedAt(now);
|
target.setUpdatedAt(now);
|
||||||
releaseMapper.updateSelective(target);
|
releaseMapper.updateSelective(target);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.common.controller;
|
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.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.AttachmentService;
|
||||||
import com.imyeyu.api.modules.common.service.AttachmentVariantService;
|
import com.imyeyu.api.modules.common.service.AttachmentVariantService;
|
||||||
import com.imyeyu.api.modules.common.service.TempFileService;
|
import com.imyeyu.api.modules.common.service.TempFileService;
|
||||||
@@ -68,6 +68,8 @@ public class AttachmentController {
|
|||||||
@PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public Attachment create(Attachment attachment) {
|
public Attachment create(Attachment attachment) {
|
||||||
service.create(attachment);
|
service.create(attachment);
|
||||||
|
attachment.setFile(null);
|
||||||
|
attachment.setInputStream(null);
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.GaoSalesOrder;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrderItem;
|
import com.imyeyu.api.modules.gao.entity.GaoSalesOrderItem;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoStore;
|
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.GaoSalesOrderItemMapper;
|
||||||
import com.imyeyu.api.modules.gao.mapper.GaoSalesOrderMapper;
|
import com.imyeyu.api.modules.gao.mapper.GaoSalesOrderMapper;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||||
@@ -92,6 +93,7 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
|||||||
|
|
||||||
private final GaoSalesOrderMapper mapper;
|
private final GaoSalesOrderMapper mapper;
|
||||||
private final GaoSalesOrderItemMapper itemMapper;
|
private final GaoSalesOrderItemMapper itemMapper;
|
||||||
|
private final GaoProductSkuUnitMapper skuUnitMapper;
|
||||||
private final GaoFundRecordService fundRecordService;
|
private final GaoFundRecordService fundRecordService;
|
||||||
private final ObjectProvider<GaoOrderFulfillmentService> fulfillmentServiceProvider;
|
private final ObjectProvider<GaoOrderFulfillmentService> fulfillmentServiceProvider;
|
||||||
private final ObjectProvider<GaoOrderPaymentService> paymentServiceProvider;
|
private final ObjectProvider<GaoOrderPaymentService> paymentServiceProvider;
|
||||||
@@ -120,6 +122,7 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
|||||||
result.setTotal(mapper.countByQuery(page));
|
result.setTotal(mapper.countByQuery(page));
|
||||||
List<GaoSalesOrder> list = mapper.selectByQuery(page);
|
List<GaoSalesOrder> list = mapper.selectByQuery(page);
|
||||||
fillItemList(list);
|
fillItemList(list);
|
||||||
|
fillFilteredSkuBaseUnit(list, page.getFulfillableSkuId());
|
||||||
fillCustomer(list);
|
fillCustomer(list);
|
||||||
result.setList(list);
|
result.setList(list);
|
||||||
return result;
|
return result;
|
||||||
@@ -801,6 +804,27 @@ public class GaoSalesOrderServiceImplement extends AbstractEntityService<GaoSale
|
|||||||
fillItemAttachments(itemList);
|
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 订单项
|
/// @param item 订单项
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class GaoSalesOrderPage extends BasePage {
|
|||||||
/// 套餐配置 ID
|
/// 套餐配置 ID
|
||||||
private String packageConfigId;
|
private String packageConfigId;
|
||||||
|
|
||||||
|
/// 筛选存在可履约明细的 SKU ID
|
||||||
|
private String fulfillableSkuId;
|
||||||
|
|
||||||
/// 订单类型
|
/// 订单类型
|
||||||
private GaoSalesOrder.OrderType orderType;
|
private GaoSalesOrder.OrderType orderType;
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,15 @@
|
|||||||
o.`deleted_at` IS NULL
|
o.`deleted_at` IS NULL
|
||||||
<if test="storeId != null and storeId != ''">AND o.`store_id` = #{storeId}</if>
|
<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="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 != ''">
|
<if test="packageConfigId != null and packageConfigId != ''">
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1 FROM `gao_customer_package` cp
|
SELECT 1 FROM `gao_customer_package` cp
|
||||||
|
|||||||
Reference in New Issue
Block a user