Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
996830bec7 | ||
|
|
d029ba58c3 | ||
|
|
b0b623fa10 | ||
|
|
cd88f94277 | ||
|
|
4f1a5cbd9d | ||
|
|
9aac55a180 | ||
|
|
6fd765661d |
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||||
<artifactId>TimiServerAPI</artifactId>
|
<artifactId>TimiServerAPI</artifactId>
|
||||||
<version>1.0.62</version>
|
<version>1.0.64</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>TimiServerAPI</name>
|
<name>TimiServerAPI</name>
|
||||||
<description>imyeyu.com API</description>
|
<description>imyeyu.com API</description>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.imyeyu.api.modules.gao.entity.GaoProductSpecValue;
|
|||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
|
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
|
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
|
||||||
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
@@ -170,6 +171,18 @@ public class GaoProductController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 批量查询履约所需的 SKU 信息
|
||||||
|
///
|
||||||
|
/// @param idList SKU ID 列表
|
||||||
|
/// @return 履约所需的 SKU 信息
|
||||||
|
@AOPLog
|
||||||
|
@RequestRateLimit
|
||||||
|
@RequireGaoPermission(GaoPermissionCode.PRODUCT_READ)
|
||||||
|
@PostMapping("/sku/fulfillment-list")
|
||||||
|
public List<GaoProductSkuFulfillmentView> skuFulfillmentList(@RequestBody List<String> idList) {
|
||||||
|
return skuService.listFulfillmentByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
@AOPLog
|
@AOPLog
|
||||||
@RequestRateLimit
|
@RequestRateLimit
|
||||||
@RequireGaoPermission(GaoPermissionCode.PRODUCT_CREATE)
|
@RequireGaoPermission(GaoPermissionCode.PRODUCT_CREATE)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.imyeyu.api.modules.gao.entity.GaoProductSku;
|
import com.imyeyu.api.modules.gao.entity.GaoProductSku;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
|
import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSelection;
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSelection;
|
||||||
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -21,6 +22,12 @@ public interface GaoProductSkuService extends BaseService<GaoProductSku, String>
|
|||||||
/// @return SKU 列表,包含单位、规格和附件临时数据
|
/// @return SKU 列表,包含单位、规格和附件临时数据
|
||||||
List<GaoProductSku> listByIdList(Collection<String> idList);
|
List<GaoProductSku> listByIdList(Collection<String> idList);
|
||||||
|
|
||||||
|
/// 批量查询履约所需的 SKU 信息
|
||||||
|
///
|
||||||
|
/// @param idList SKU ID 集合
|
||||||
|
/// @return 履约所需的 SKU 信息
|
||||||
|
List<GaoProductSkuFulfillmentView> listFulfillmentByIdList(Collection<String> idList);
|
||||||
|
|
||||||
/// 查询 SKU 详情
|
/// 查询 SKU 详情
|
||||||
GaoProductSku detail(String id);
|
GaoProductSku detail(String id);
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -560,7 +560,8 @@ public class GaoOrderFulfillmentServiceImplement extends AbstractEntityService<G
|
|||||||
GaoOrderFulfillment fulfillment = mapper.selectById(request.getFulfillmentId());
|
GaoOrderFulfillment fulfillment = mapper.selectById(request.getFulfillmentId());
|
||||||
TimiException.required(fulfillment, "not found fulfillment");
|
TimiException.required(fulfillment, "not found fulfillment");
|
||||||
String loginUserId = userLoginService.getRequireLoginUserId();
|
String loginUserId = userLoginService.getRequireLoginUserId();
|
||||||
TimiException.requiredTrue(loginUserId.equals(fulfillment.getOperatorUserId()), "只能撤销自己提交的履约");
|
TimiException.requiredTrue(roleChecker.hasAny(ModuleCode.GAO, GaoRoleCode.STORE_MANAGER.name())
|
||||||
|
|| loginUserId.equals(fulfillment.getOperatorUserId()), "只能撤销自己提交的履约");
|
||||||
return releaseInternal(request, GaoOrderFulfillment.Status.CANCELLED);
|
return releaseInternal(request, GaoOrderFulfillment.Status.CANCELLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
@@ -23,8 +23,10 @@ import com.imyeyu.api.modules.gao.mapper.GaoProductSpecMapper;
|
|||||||
import com.imyeyu.api.modules.gao.mapper.GaoProductSpecValueMapper;
|
import com.imyeyu.api.modules.gao.mapper.GaoProductSpecValueMapper;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductService;
|
import com.imyeyu.api.modules.gao.service.GaoProductService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductSkuService;
|
import com.imyeyu.api.modules.gao.service.GaoProductSkuService;
|
||||||
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuBaseUnitMigrationRequest;
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuBaseUnitMigrationRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSelection;
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSelection;
|
||||||
|
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
|
||||||
import com.imyeyu.api.modules.system.audit.AuditOperation;
|
import com.imyeyu.api.modules.system.audit.AuditOperation;
|
||||||
import com.imyeyu.api.modules.system.audit.OperationAudit;
|
import com.imyeyu.api.modules.system.audit.OperationAudit;
|
||||||
import com.imyeyu.api.modules.system.entity.Logger;
|
import com.imyeyu.api.modules.system.entity.Logger;
|
||||||
@@ -63,6 +65,7 @@ public class GaoProductSkuServiceImplement extends AbstractEntityService<GaoProd
|
|||||||
private static final BigDecimal ONE = BigDecimal.ONE;
|
private static final BigDecimal ONE = BigDecimal.ONE;
|
||||||
|
|
||||||
private final GaoProductSkuMapper mapper;
|
private final GaoProductSkuMapper mapper;
|
||||||
|
private final GaoStoreScopeService storeScopeService;
|
||||||
private final GaoProductEditMapper editMapper;
|
private final GaoProductEditMapper editMapper;
|
||||||
private final GaoProductStockMapper stockMapper;
|
private final GaoProductStockMapper stockMapper;
|
||||||
private final GaoProductSkuUnitMapper unitMapper;
|
private final GaoProductSkuUnitMapper unitMapper;
|
||||||
@@ -97,6 +100,23 @@ public class GaoProductSkuServiceImplement extends AbstractEntityService<GaoProd
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GaoProductSkuFulfillmentView> listFulfillmentByIdList(Collection<String> idList) {
|
||||||
|
if (idList == null || idList.isEmpty()) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
List<GaoProductSku> skuList = mapper.selectByIdList(idList);
|
||||||
|
if (skuList.isEmpty()) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
skuList.forEach(sku -> storeScopeService.checkStoreId(sku.getStoreId()));
|
||||||
|
List<String> skuIdList = skuList.stream().map(GaoProductSku::getId).toList();
|
||||||
|
Map<String, List<GaoProductSkuUnit>> unitMap = unitMapper.selectBySkuIdList(skuIdList).stream()
|
||||||
|
.collect(Collectors.groupingBy(GaoProductSkuUnit::getSkuId));
|
||||||
|
return skuList.stream().map(sku -> new GaoProductSkuFulfillmentView(sku.getId(), sku.getStockEnabled(),
|
||||||
|
sku.getAllowDecimalQuantity(), unitMap.getOrDefault(sku.getId(), List.of()))).toList();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GaoProductSku> listByProductId(String productId) {
|
public List<GaoProductSku> listByProductId(String productId) {
|
||||||
TimiException.required(productId, "not found productId");
|
TimiException.required(productId, "not found productId");
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ public class GaoEventRecordRankPage extends BasePage {
|
|||||||
/// 客户 ID,为空查询全部客户
|
/// 客户 ID,为空查询全部客户
|
||||||
private String customerId;
|
private String customerId;
|
||||||
|
|
||||||
|
/// 客户搜索关键词
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
/// 客户 ID 列表,为空时不限制
|
||||||
|
private List<String> customerIdList;
|
||||||
|
|
||||||
/// 登记事件 ID 列表,为空查询全部登记事件
|
/// 登记事件 ID 列表,为空查询全部登记事件
|
||||||
private List<String> eventIdList;
|
private List<String> eventIdList;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.imyeyu.api.modules.gao.vo;
|
||||||
|
|
||||||
|
import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/// 履约所需的 SKU 信息
|
||||||
|
///
|
||||||
|
/// @param id SKU ID
|
||||||
|
/// @param stockEnabled true 为启用库存管理
|
||||||
|
/// @param allowDecimalQuantity true 为允许小数数量
|
||||||
|
/// @param unitList SKU 单位列表
|
||||||
|
public record GaoProductSkuFulfillmentView(String id, Boolean stockEnabled, Boolean allowDecimalQuantity, List<GaoProductSkuUnit> unitList) {
|
||||||
|
}
|
||||||
@@ -213,6 +213,22 @@
|
|||||||
<if test="customerId != null and customerId != ''">
|
<if test="customerId != null and customerId != ''">
|
||||||
AND r.`customer_id` = #{customerId}
|
AND r.`customer_id` = #{customerId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="keyword != null and keyword.trim() != ''">
|
||||||
|
AND (c.`code` LIKE CONCAT('%', #{keyword}, '%')
|
||||||
|
OR c.`name` LIKE CONCAT('%', #{keyword}, '%')
|
||||||
|
OR c.`name_pinyin_full` LIKE CONCAT(#{keyword}, '%')
|
||||||
|
OR c.`name_pinyin_initial` LIKE CONCAT(#{keyword}, '%')
|
||||||
|
OR c.`name_pinyin_mixed` LIKE CONCAT(#{keyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="customerIdList != null">
|
||||||
|
<choose>
|
||||||
|
<when test="customerIdList.size() > 0">
|
||||||
|
AND r.`customer_id` IN
|
||||||
|
<foreach collection="customerIdList" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||||
|
</when>
|
||||||
|
<otherwise>AND 1 = 0</otherwise>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
<if test="beginAt != null">
|
<if test="beginAt != null">
|
||||||
AND r.`registered_at` >= #{beginAt}
|
AND r.`registered_at` >= #{beginAt}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user