v1.0.79 #91

Merged
timi merged 9 commits from dev into master 2026-11-20 05:12:15 +00:00
303 changed files with 1511 additions and 1287 deletions
Showing only changes of commit 30e5888240 - Show all commits
@@ -38,17 +38,17 @@ import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
import com.imyeyu.api.modules.gao.service.GaoStoreBusinessDayService;
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
import com.imyeyu.api.modules.gao.service.GaoStoreService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.GaoStoreDiaryPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreDiaryPage;
import com.imyeyu.spring.bean.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -4,11 +4,11 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoCustomerChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordReq;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -8,8 +8,8 @@ import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
import com.imyeyu.api.modules.gao.service.GaoCustomerConsumptionRecordService;
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPageResult;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -8,10 +8,10 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerTrendStateReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerTrendStateReq;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.TimiJava;
import com.imyeyu.java.bean.timi.TimiException;
@@ -10,8 +10,8 @@ import com.imyeyu.api.modules.gao.entity.GaoCustomerFollowUpReminder;
import com.imyeyu.api.modules.gao.service.GaoCustomerFollowUpReminderService;
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPageResult;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPageResult;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.bean.timi.TimiException;
@@ -12,9 +12,9 @@ import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoOrderFulfillmentService;
import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackageCancelRequest;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePurchaseRequest;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackageCancelRequest;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePurchaseRequest;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.bean.timi.TimiException;
@@ -12,11 +12,11 @@ import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoEventRecordService;
import com.imyeyu.api.modules.gao.service.GaoEventService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPageResult;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPageResult;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.TimiJava;
import com.imyeyu.java.bean.timi.TimiException;
@@ -10,9 +10,9 @@ import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoFundRecordService;
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoFundRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRevokeRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserLoginService;
import com.imyeyu.api.modules.user.service.UserService;
@@ -14,17 +14,17 @@ import com.imyeyu.api.modules.gao.service.GaoOrderFulfillmentService;
import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentActionRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPage;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPrepareStockRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentReturnRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCustomerRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSkuView;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderListRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderView;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentActionRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPage;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPrepareStockRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentReturnRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCustomerRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSkuView;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderListRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderView;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.bean.timi.TimiException;
@@ -9,7 +9,7 @@ import com.imyeyu.api.modules.gao.service.GaoEventService;
import com.imyeyu.api.modules.gao.service.GaoPackageConfigService;
import com.imyeyu.api.modules.gao.service.GaoProductSkuService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoPackageConfigPage;
import com.imyeyu.api.modules.gao.vo.packageconfig.GaoPackageConfigPage;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.bean.timi.TimiException;
@@ -5,7 +5,7 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoPointAccount;
import com.imyeyu.api.modules.gao.service.GaoPointAccountService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoPointAccountPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAccountPage;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -6,8 +6,8 @@ import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
import com.imyeyu.api.modules.gao.service.GaoPointLedgerService;
import com.imyeyu.api.modules.gao.service.GaoPointTriggerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoPointAdjustRequest;
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAdjustRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -5,9 +5,9 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoPointRedeemSku;
import com.imyeyu.api.modules.gao.service.GaoPointRedeemSkuService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuRequest;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -6,9 +6,9 @@ import com.imyeyu.api.modules.gao.entity.GaoPointRedemption;
import com.imyeyu.api.modules.gao.entity.GaoPointRedemptionReturn;
import com.imyeyu.api.modules.gao.service.GaoPointRedemptionService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionReturnRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionCreateRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionReturnRequest;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -4,16 +4,16 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoProductChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -12,9 +12,9 @@ import com.imyeyu.api.modules.gao.service.GaoProductSpecService;
import com.imyeyu.api.modules.gao.entity.GaoProductSpec;
import com.imyeyu.api.modules.gao.entity.GaoProductSpecValue;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -4,14 +4,14 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoProductSkuChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -7,14 +7,14 @@ import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
import com.imyeyu.api.modules.gao.service.GaoProductStockService;
import com.imyeyu.api.modules.gao.service.GaoProductStockRecordService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoProductStockBatchRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockChangeRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualInBatchRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockProductView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPageResult;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockBatchRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockChangeRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualInBatchRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualRevokeRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockProductView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPageResult;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -6,138 +6,137 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleAccountMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleProductYieldMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleItemMapper;
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoRecycleAccountService;
import com.imyeyu.api.modules.gao.service.GaoRecycleLedgerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleAccountAdjustRequest;
import com.imyeyu.api.modules.gao.entity.GaoRecycleAccount;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.entity.GaoRecycleProductYield;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleAccountCustomerPage;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleAccountCustomerPageResult;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleAccountCustomerView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.utils.Time;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import com.imyeyu.utils.Time;
/// 客户回收物额度接口
@RestController
@RequiredArgsConstructor
@RequestMapping("/gao/recycle/account")
public class GaoRecycleAccountController {
private final GaoRecycleAccountMapper mapper;
private final GaoRecycleAccountService service;
private final GaoRecycleLedgerService ledgerService;
private final GaoStoreScopeService scope;
private final GaoCustomerService customerService;
private final AttachmentService attachmentService;
private final GaoRecycleAccountMapper mapper;
private final GaoRecycleProductYieldMapper yieldMapper;
private final GaoRecycleItemMapper itemMapper;
private final GaoStoreScopeService scope;
private final GaoCustomerService customerService;
private final AttachmentService attachmentService;
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/list")
public List<Map<String, Object>> yields(@RequestParam String storeId, @RequestParam String skuId) {
scope.checkStoreId(storeId);
List<Map<String, Object>> rows = mapper.yieldList(storeId, skuId);
List<String> itemIds = rows.stream().map(row -> (String) row.get("recycleItemId")).filter(java.util.Objects::nonNull).distinct().toList();
if (!itemIds.isEmpty()) {
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, itemIds);
rows.forEach(row -> row.put("attachmentList", attachments.getOrDefault(row.get("recycleItemId"), List.of())));
}
return rows;
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/list")
public List<GaoRecycleProductYield> yields(@RequestParam String storeId, @RequestParam String skuId) {
scope.checkStoreId(storeId);
List<GaoRecycleProductYield> rows = yieldMapper.yieldList(storeId, skuId);
List<String> ids = rows.stream().map(GaoRecycleProductYield::getRecycleItemId).filter(Objects::nonNull).distinct().toList();
if (!ids.isEmpty()) {
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, ids);
rows.forEach(row -> row.setAttachmentList(attachments.getOrDefault(row.getRecycleItemId(), List.of())));
}
return rows;
}
/// 产品详情里配置产出回收物用的批量查询,一次返回该产品所有 SKU 的产出行
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/product/list")
public List<Map<String, Object>> yieldsByProduct(@RequestParam String storeId, @RequestParam String productId) {
scope.checkStoreId(storeId);
return mapper.yieldListByProduct(storeId, productId);
}
/// 产品所有 SKU 的产出行
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/product/list")
public List<GaoRecycleProductYield> yieldsByProduct(@RequestParam String storeId, @RequestParam String productId) {
scope.checkStoreId(storeId);
return yieldMapper.yieldListByProduct(storeId, productId);
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/save")
public void saveYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId, @RequestParam BigDecimal quantityPerBase) {
scope.checkStoreId(storeId);
// 额度按三位小数记账,比例精度高于额度会让换算结果必然超出精度
TimiException.requiredTrue(0 < quantityPerBase.signum() && !(3 < quantityPerBase.stripTrailingZeros().scale())
&& !(12 < quantityPerBase.precision() - quantityPerBase.scale()), "产物数量比例最多保留三位小数");
TimiException.requiredTrue(mapper.validYield(storeId, skuId, recycleItemId) == 1, "商品或回收物不属于当前门店");
mapper.saveYield(UUID.randomUUID().toString(), storeId, skuId, recycleItemId, quantityPerBase, Time.now());
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/save")
public void saveYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId, @RequestParam BigDecimal quantityPerBase) {
scope.checkStoreId(storeId);
var quantity = quantityPerBase;
TimiException.requiredTrue(quantity != null && 0 < quantity.signum() && !(3 < quantity.stripTrailingZeros().scale())
&& !(12 < quantity.precision() - quantity.scale()), "产物数量比例最多保留三位小数");
TimiException.requiredTrue(yieldMapper.validYield(storeId, skuId, recycleItemId) == 1, "商品或回收物不属于当前门店");
yieldMapper.saveYield(UUID.randomUUID().toString(), storeId, skuId, recycleItemId, quantity, Time.now());
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/delete")
public void deleteYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId) {
scope.checkStoreId(storeId);
mapper.deleteYield(storeId, skuId, recycleItemId, Time.now());
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
@PostMapping("/yield/delete")
public void deleteYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId) {
scope.checkStoreId(storeId);
yieldMapper.deleteYield(storeId, skuId, recycleItemId, Time.now());
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/list")
public List<Map<String, Object>> list(@RequestParam String storeId, @RequestParam String customerId) {
checkCustomer(storeId, customerId);
return mapper.listAccounts(storeId, customerId);
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/list")
public List<GaoRecycleAccount> list(@RequestParam String storeId, @RequestParam String customerId) {
checkCustomer(storeId, customerId);
return mapper.listAccounts(storeId, customerId);
}
/// 按客户分页返回额度,汇总按回收物分别计算,避免混加不同单位。
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/customers")
public Map<String, Object> customers(@RequestParam String storeId, @RequestParam(required = false) String recycleItemId,
@RequestParam(required = false) String keyword, @RequestParam(required = false) List<String> customerIds, @RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "20") int limit) {
scope.checkStoreId(storeId);
int safeOffset = Math.max(0, offset);
int safeLimit = Math.max(1, Math.min(limit, 100));
List<String> ids = mapper.customerPage(storeId, recycleItemId, keyword, customerIds, safeOffset, safeLimit);
List<Map<String, Object>> rows = new java.util.ArrayList<>();
if (!ids.isEmpty()) {
Map<String, GaoCustomer> customers = customerService.mapByIdList(ids);
Map<String, List<Attachment>> photos = attachmentService.mapByBizIdList(Attachment.BizType.GAO_CUSTOMER, ids, GaoCustomer.AttachType.PHOTO.name());
List<Map<String, Object>> accounts = mapper.customerAccounts(storeId, ids, recycleItemId);
for (String id : ids) {
GaoCustomer customer = customers.get(id);
if (customer == null) continue;
customer.setAttachmentList(photos.getOrDefault(id, List.of()));
rows.add(Map.of("customer", customer, "accounts", accounts.stream().filter(account -> id.equals(account.get("customerId"))).toList()));
}
}
return Map.of("list", rows, "total", mapper.customerCount(storeId, recycleItemId, keyword, customerIds), "totals", mapper.accountTotals(storeId, keyword, customerIds));
}
/// 按客户分页返回额度,汇总按回收物分别计算
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/customers")
public GaoRecycleAccountCustomerPageResult customers(@RequestBody GaoRecycleAccountCustomerPage query) {
String storeId = query.getStoreId();
scope.checkStoreId(storeId);
long limit = Math.max(1, Math.min(query.getLimit(), 100));
long offset = (long) Math.max(0, query.getIndex()) * limit;
List<String> ids = mapper.customerPage(storeId, query.getRecycleItemId(), query.getKeyword(), query.getCustomerIds(), offset, limit);
List<GaoRecycleAccountCustomerView> rows = new ArrayList<>();
if (!ids.isEmpty()) {
Map<String, GaoCustomer> customers = customerService.mapByIdList(ids);
Map<String, List<Attachment>> photos = attachmentService.mapByBizIdList(Attachment.BizType.GAO_CUSTOMER, ids, GaoCustomer.AttachType.PHOTO.name());
List<GaoRecycleAccount> accounts = mapper.customerAccounts(storeId, ids, query.getRecycleItemId());
for (String id : ids) {
GaoCustomer customer = customers.get(id);
if (customer == null) continue;
customer.setAttachmentList(photos.getOrDefault(id, List.of()));
GaoRecycleAccountCustomerView row = new GaoRecycleAccountCustomerView();
row.setCustomer(customer);
row.setAccounts(accounts.stream().filter(account -> id.equals(account.getCustomerId())).toList());
rows.add(row);
}
}
GaoRecycleAccountCustomerPageResult result = new GaoRecycleAccountCustomerPageResult();
result.setList(rows);
result.setTotal(mapper.customerCount(storeId, query.getRecycleItemId(), query.getKeyword(), query.getCustomerIds()));
result.setTotals(mapper.accountTotals(storeId, query.getKeyword(), query.getCustomerIds()));
return result;
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/items")
public List<Map<String, Object>> accountItems(@RequestParam String storeId) {
scope.checkStoreId(storeId);
List<Map<String, Object>> items = mapper.accountItems(storeId);
List<String> ids = items.stream().map(item -> (String) item.get("id")).filter(java.util.Objects::nonNull).toList();
if (!ids.isEmpty()) {
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, ids);
items.forEach(item -> item.put("attachmentList", attachments.getOrDefault(item.get("id"), List.of())));
}
return items;
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/items")
public List<GaoRecycleItem> accountItems(@RequestParam String storeId) {
scope.checkStoreId(storeId);
List<GaoRecycleItem> items = itemMapper.accountItems(storeId);
List<String> ids = items.stream().map(GaoRecycleItem::getId).filter(Objects::nonNull).toList();
if (!ids.isEmpty()) {
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, ids);
items.forEach(item -> item.setAttachmentList(attachments.getOrDefault(item.getId(), List.of())));
}
return items;
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/ledger")
public List<Map<String, Object>> ledger(@RequestParam String storeId, @RequestParam String customerId) {
checkCustomer(storeId, customerId);
return ledgerService.listLedger(storeId, customerId);
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_ADJUST)
@PostMapping("/adjust")
public void adjust(@RequestBody GaoRecycleAccountAdjustRequest request) {
TimiException.required(request, "请求不能为空");
checkCustomer(request.getStoreId(), request.getCustomerId());
TimiException.requiredTrue(request.getReason() != null && !request.getReason().isBlank(), "调整原因不能为空");
TimiException.requiredTrue(request.getQuantity() != null && request.getQuantity().signum() != 0, "调整数量不能为零");
TimiException.requiredTrue(request.getRequestNo() != null && !request.getRequestNo().isBlank() && !(128 < request.getRequestNo().length()), "请求号无效");
TimiException.requiredTrue(mapper.validItem(request.getStoreId(), request.getRecycleItemId()) == 1, "回收物不属于当前门店");
String bizId = UUID.nameUUIDFromBytes(request.getRequestNo().getBytes(java.nio.charset.StandardCharsets.UTF_8)).toString();
service.change(request.getStoreId(), request.getCustomerId(), request.getRecycleItemId(), request.getQuantity(), BigDecimal.ZERO, "MANUAL", bizId, request.getRequestNo(), request.getReason());
}
private void checkCustomer(String storeId, String customerId) {
scope.checkStoreId(storeId);
GaoCustomer customer = customerService.get(customerId);
TimiException.requiredTrue(customer != null && storeId.equals(customer.getStoreId()), "客户不属于当前门店");
}
private void checkCustomer(String storeId, String customerId) {
scope.checkStoreId(storeId);
GaoCustomer customer = customerService.get(customerId);
TimiException.requiredTrue(customer != null && storeId.equals(customer.getStoreId()), "客户不属于当前门店");
}
}
@@ -5,8 +5,8 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.api.modules.gao.service.GaoRecycleConfigService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleItemRequest;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeRuleRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleItemRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeRuleRequest;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import lombok.RequiredArgsConstructor;
@@ -4,7 +4,7 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeQueryService;
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeViewService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeDetail;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeDetail;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import lombok.RequiredArgsConstructor;
@@ -5,7 +5,7 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchange;
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeWriteService;
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeViewService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeCreateRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeCreateRequest;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import lombok.RequiredArgsConstructor;
@@ -0,0 +1,58 @@
package com.imyeyu.api.modules.gao.controller;
import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger.BizType;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleItemMapper;
import com.imyeyu.api.modules.gao.service.GaoRecycleAccountService;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleAccountAdjustRequest;
import java.math.BigDecimal;
import java.util.UUID;
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
import com.imyeyu.api.modules.gao.service.GaoRecycleLedgerService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleLedgerPage;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.bean.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
/// 回收物额度流水接口
@RestController
@RequiredArgsConstructor
@RequestMapping("/gao/recycle/ledger")
public class GaoRecycleLedgerController {
private final GaoRecycleLedgerService service;
private final GaoRecycleAccountService accountService;
private final GaoRecycleItemMapper mapper;
private final GaoStoreScopeService scope;
private final GaoCustomerService customerService;
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
@PostMapping("/list")
public PageResult<GaoRecycleLedger> list(@RequestBody GaoRecycleLedgerPage page) {
TimiException.required(page, "请求不能为空");
checkCustomer(page.getStoreId(), page.getCustomerId());
return service.pageByQuery(page);
}
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_ADJUST)
@PostMapping("/adjust")
public void adjust(@RequestBody GaoRecycleAccountAdjustRequest request) {
TimiException.required(request, "请求不能为空");
checkCustomer(request.getStoreId(), request.getCustomerId());
TimiException.requiredTrue(request.getReason() != null && !request.getReason().isBlank(), "调整原因不能为空");
TimiException.requiredTrue(request.getQuantity() != null && request.getQuantity().signum() != 0, "调整数量不能为零");
TimiException.requiredTrue(request.getRequestNo() != null && !request.getRequestNo().isBlank() && !(128 < request.getRequestNo().length()), "请求号无效");
TimiException.requiredTrue(mapper.validItem(request.getStoreId(), request.getRecycleItemId()) == 1, "回收物不属于当前门店");
String bizId = UUID.nameUUIDFromBytes(request.getRequestNo().getBytes(java.nio.charset.StandardCharsets.UTF_8)).toString();
accountService.change(request.getStoreId(), request.getCustomerId(), request.getRecycleItemId(), request.getQuantity(), BigDecimal.ZERO, BizType.MANUAL, bizId, request.getRequestNo(), request.getReason());
}
private void checkCustomer(String storeId, String customerId) {
scope.checkStoreId(storeId);
GaoCustomer customer = customerService.get(customerId);
TimiException.requiredTrue(customer != null && storeId.equals(customer.getStoreId()), "客户不属于当前门店");
}
}
@@ -4,7 +4,7 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.entity.GaoRecyclePayment;
import com.imyeyu.api.modules.gao.service.GaoRecyclePaymentService;
import com.imyeyu.api.modules.gao.vo.GaoRecyclePaymentRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecyclePaymentRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestParam;
import com.imyeyu.api.bean.PermissionMatchMode;
import com.imyeyu.api.modules.gao.vo.GaoOrderTransactionView;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderTransactionView;
import com.imyeyu.api.modules.user.service.PermissionChecker;
import com.imyeyu.api.bean.ModuleCode;
import java.util.List;
@@ -3,8 +3,8 @@ package com.imyeyu.api.modules.gao.controller;
import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoRecycleStatService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleStatView;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeStatView;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleStatView;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeStatView;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import lombok.RequiredArgsConstructor;
@@ -4,19 +4,19 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoSalesOrderChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderProductRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderSkuRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatIntervalStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCalendarStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderConsumptionDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPaymentStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderStatusStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderTypeStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderProductRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderSkuRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatDailyStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatIntervalStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCalendarStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderConsumptionDailyStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderDailyStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPaymentStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderStatusStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderTypeStatView;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -9,21 +9,21 @@ import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeWriteService;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeActionRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeActionRequest;
import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoDirectProductOrderCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductCustomerView;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentActionRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentNoRefundRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentReceiveRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRefundRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCancelRequest;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderUpdateRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoDirectProductOrderCreateRequest;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductCustomerView;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentActionRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentNoRefundRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentReceiveRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRefundRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCancelRequest;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderUpdateRequest;
import com.imyeyu.api.modules.user.service.UserService;
import com.imyeyu.java.TimiJava;
import com.imyeyu.java.bean.timi.TimiException;
@@ -5,15 +5,15 @@ import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoPointChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreChartService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
@@ -8,7 +8,7 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.vo.GaoStoreDiaryPage;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreDiaryPage;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.UserLoginService;
import com.imyeyu.api.modules.user.service.UserService;
@@ -10,12 +10,12 @@ import com.imyeyu.api.modules.gao.entity.GaoUser;
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
import com.imyeyu.api.modules.gao.service.GaoUserInviteService;
import com.imyeyu.api.modules.gao.service.GaoUserService;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteCreateResponse;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteRegisterData;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteRegisterRequest;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteValidateRequest;
import com.imyeyu.api.modules.gao.vo.GaoUserInviteValidateResponse;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteCreateRequest;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteCreateResponse;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteRegisterData;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteRegisterRequest;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteValidateRequest;
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteValidateResponse;
import com.imyeyu.api.modules.user.entity.Role;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.api.modules.user.service.AuthorizationScopeService;
@@ -0,0 +1,24 @@
package com.imyeyu.api.modules.gao.entity;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.UUIDEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/// 客户回收物额度账户
@Data
@EqualsAndHashCode(callSuper = true)
public class GaoRecycleAccount extends UUIDEntity {
private String storeId;
private String customerId;
private String recycleItemId;
private BigDecimal balance;
private BigDecimal reserved;
@Transient
private String recycleName;
@Transient
private String recycleUnit;
}
@@ -2,15 +2,22 @@ package com.imyeyu.api.modules.gao.entity;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.UUIDEntity;
import com.imyeyu.spring.annotation.table.Id;
import com.imyeyu.spring.annotation.table.AutoUUID;
import com.imyeyu.spring.entity.IDEntity;
import com.imyeyu.spring.entity.Creatable;
import lombok.Data;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
/// 回收兑换操作记录
@Data
@EqualsAndHashCode(callSuper = true)
public class GaoRecycleExchangeAction extends UUIDEntity {
public class GaoRecycleExchangeAction implements IDEntity<String>, Creatable {
@Id
@AutoUUID
private String id;
private Long createdAt;
/// 撤销后门店最终保留的回收物数量
private BigDecimal retainedRecycleQuantity;
@@ -1,18 +1,27 @@
package com.imyeyu.api.modules.gao.entity;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.UUIDEntity;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.spring.annotation.table.AutoUUID;
import com.imyeyu.spring.annotation.table.Id;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.Creatable;
import com.imyeyu.spring.entity.IDEntity;
import com.imyeyu.spring.entity.Updatable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
/// 回收兑换规则
@Data
@EqualsAndHashCode(callSuper = true)
public class GaoRecycleExchangeRule extends UUIDEntity {
public class GaoRecycleExchangeRule implements IDEntity<String>, Creatable, Updatable {
@Id
@AutoUUID
private String id;
private Long createdAt;
private Long updatedAt;
/// 兑换模板明细
@Transient
private List<GaoRecycleExchangeRuleItem> itemList;
@@ -1,13 +1,20 @@
package com.imyeyu.api.modules.gao.entity;
import lombok.Data;
import com.imyeyu.spring.annotation.table.Id;
import com.imyeyu.spring.annotation.table.AutoUUID;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.IDEntity;
import com.imyeyu.spring.entity.Creatable;
import java.math.BigDecimal;
/// 回收兑换模板明细
@Data
public class GaoRecycleExchangeRuleItem {
public class GaoRecycleExchangeRuleItem implements IDEntity<String>, Creatable {
@Id
@AutoUUID
private String id;
private String ruleId;
private String skuId;
@@ -16,19 +23,27 @@ public class GaoRecycleExchangeRuleItem {
private Integer sort;
private Long createdAt;
/// 展示用产品名称
@Transient
private String productName;
/// 展示用 SKU 名称
@Transient
private String skuName;
/// 展示用规格摘要
@Transient
private String specSummary;
/// 展示用单位名称
@Transient
private String unitName;
/// 展示用 SKU 编码
@Transient
private String skuCode;
/// 展示用产品类型
@Transient
private String productType;
/// true 为启用库存管理
@Transient
private Boolean stockEnabled;
/// true 为允许小数数量
@Transient
private Boolean allowDecimalQuantity;
}
@@ -1,16 +1,25 @@
package com.imyeyu.api.modules.gao.entity;
import com.imyeyu.spring.entity.UUIDEntity;
import com.imyeyu.spring.annotation.table.Id;
import com.imyeyu.spring.annotation.table.AutoUUID;
import com.imyeyu.spring.entity.IDEntity;
import com.imyeyu.spring.entity.Creatable;
import com.imyeyu.spring.entity.Updatable;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.spring.annotation.table.Transient;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
/// 回收物类型
@Data
@EqualsAndHashCode(callSuper = true)
public class GaoRecycleItem extends UUIDEntity {
public class GaoRecycleItem implements IDEntity<String>, Creatable, Updatable {
@Id
@AutoUUID
private String id;
private Long createdAt;
private Long updatedAt;
/// 状态
public enum Status {
@@ -11,21 +11,42 @@ import java.math.BigDecimal;
/// 回收物额度流水
@Data
public class GaoRecycleLedger implements IDEntity<String>, Creatable {
@Id
@AutoUUID
private String id;
private String accountId;
private String storeId;
private String customerId;
private String recycleItemId;
private String bizType;
private String bizId;
private String requestNo;
private BigDecimal balanceDelta;
private BigDecimal reservedDelta;
private BigDecimal balanceAfter;
private BigDecimal reservedAfter;
private String operatorUserId;
private String reason;
private Long createdAt;
/// 流水业务类型;ADJUST 对应建表定义中的人工调整类型。
public enum BizType {
/// 履约产生回收物额度
FULFILLMENT_YIELD,
/// 履约冲正扣回回收物额度
FULFILLMENT_REVOKE,
/// 人工调整回收物额度
MANUAL,
/// 人工调整回收物额度(建表定义类型)
ADJUST,
/// 回收物支付预占额度
PAYMENT_RESERVE,
/// 撤销或拒绝支付时释放预占额度
PAYMENT_RELEASE,
/// 回收物支付核销额度
PAYMENT_VERIFY,
/// 回收物支付冲正返还额度
PAYMENT_REVOKE
}
@Id
@AutoUUID
private String id;
private String accountId;
private String storeId;
private String customerId;
private String recycleItemId;
private BizType bizType;
private String bizId;
private String requestNo;
private BigDecimal balanceDelta;
private BigDecimal reservedDelta;
private BigDecimal balanceAfter;
private BigDecimal reservedAfter;
private String operatorUserId;
private String reason;
private Long createdAt;
}
@@ -0,0 +1,33 @@
package com.imyeyu.api.modules.gao.entity;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.UUIDEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
/// 商品 SKU 的回收物产出配置
@Data
@EqualsAndHashCode(callSuper = true)
public class GaoRecycleProductYield extends UUIDEntity {
private String storeId;
private String skuId;
private String recycleItemId;
private BigDecimal quantityPerBase;
@Transient
private String skuName;
@Transient
private String skuSpecSummary;
@Transient
private String recycleName;
@Transient
private String recycleUnit;
@Transient
private Boolean allowDecimalQuantity;
@Transient
private List<Attachment> attachmentList;
}
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -2,7 +2,7 @@ package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.entity.GaoCustomerFollowUpReminder;
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,12 +1,12 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateCustomerView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseTextView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateCustomerView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseTextView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoCustomerPackage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,15 +1,15 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillment;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPage;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,6 +1,6 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoOrderReminderCustomer;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderReminderCustomer;
import java.util.List;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoPackageConfig;
import com.imyeyu.api.modules.gao.vo.GaoPackageConfigPage;
import com.imyeyu.api.modules.gao.vo.packageconfig.GaoPackageConfigPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoPointAccount;
import com.imyeyu.api.modules.gao.vo.GaoPointAccountPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAccountPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
import java.util.List;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoPointRedeemSku;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoPointRedemption;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoProductCategory;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,15 +1,15 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
import java.util.List;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoProduct;
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductPage;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,13 +1,13 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
import java.util.List;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoProductStock;
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockProductView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockProductView;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordSkuSummaryView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordSkuSummaryView;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,32 +1,17 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleAccount;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.Map;
import java.util.List;
/// 回收物额度账户与流水
public interface GaoRecycleAccountMapper {
public interface GaoRecycleAccountMapper extends BaseMapper<GaoRecycleAccount, String> {
@Select("SELECT COUNT(*) FROM gao_recycle_item WHERE store_id=#{store} AND id=#{item}")
int validItem(@Param("store") String store, @Param("item") String item);
int validYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item);
void saveYield(
@Param("id") String id,
@Param("store") String store,
@Param("sku") String sku,
@Param("item") String item,
@Param("quantity") BigDecimal quantity,
@Param("now") long now
);
void deleteYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item, @Param("now") long now);
List<Map<String, Object>> listAccounts(@Param("store") String store, @Param("customer") String customer);
List<GaoRecycleAccount> listAccounts(@Param("store") String store, @Param("customer") String customer);
/// 按客户分页,筛选条件与汇总使用相同的有效账户范围。
List<String> customerPage(
@@ -34,27 +19,15 @@ public interface GaoRecycleAccountMapper {
@Param("item") String item,
@Param("keyword") String keyword,
@Param("customers") List<String> customers,
@Param("offset") int offset,
@Param("limit") int limit
@Param("offset") long offset,
@Param("limit") long limit
);
long customerCount(@Param("store") String store, @Param("item") String item, @Param("keyword") String keyword, @Param("customers") List<String> customers);
List<Map<String, Object>> customerAccounts(@Param("store") String store, @Param("customers") List<String> customers, @Param("item") String item);
List<GaoRecycleAccount> customerAccounts(@Param("store") String store, @Param("customers") List<String> customers, @Param("item") String item);
List<Map<String, Object>> accountTotals(@Param("store") String store, @Param("keyword") String keyword, @Param("customers") List<String> customers);
/// 额度查询权限可用的回收物选项。
@Select("SELECT id, name, unit_name AS unitName, status FROM gao_recycle_item WHERE store_id=#{store} ORDER BY name, id")
List<Map<String, Object>> accountItems(@Param("store") String store);
List<Map<String, Object>> yields(@Param("store") String store, @Param("sku") String sku);
/// 配置页需要的字段用驼峰返回,同时带上回收物名称与单位
List<Map<String, Object>> yieldList(@Param("store") String store, @Param("sku") String sku);
/// 产品维度的产出配置:一个产品下所有 SKU 的产出行,按 SKU 排序返回
List<Map<String, Object>> yieldListByProduct(@Param("store") String store, @Param("product") String product);
List<GaoRecycleAccount> accountTotals(@Param("store") String store, @Param("keyword") String keyword, @Param("customers") List<String> customers);
void ensure(@Param("id") String id, @Param("store") String store, @Param("customer") String customer, @Param("item") String item, @Param("now") long now);
@@ -1,166 +0,0 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRuleItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Collection;
import java.util.List;
/// 回收配置数据访问
public interface GaoRecycleConfigMapper {
/// 查询模板明细
///
/// @param ruleId 模板 ID
/// @return 模板明细
@Select("SELECT * FROM gao_recycle_exchange_rule_item WHERE rule_id=#{ruleId} ORDER BY sort, id")
List<GaoRecycleExchangeRuleItem> ruleItems(@Param("ruleId") String ruleId);
/// 批量查询模板明细
///
/// @param ids 模板 ID 列表
/// @return 模板明细
List<GaoRecycleExchangeRuleItem> ruleItemsByIds(@Param("ids") Collection<String> ids);
/// 新增模板明细
///
/// @param item 模板明细
void insertRuleItem(GaoRecycleExchangeRuleItem item);
/// 删除模板明细
///
/// @param ruleId 模板 ID
@Delete("DELETE FROM gao_recycle_exchange_rule_item WHERE rule_id=#{ruleId}")
void deleteRuleItems(@Param("ruleId") String ruleId);
/// 删除模板
///
/// @param storeId 门店 ID
/// @param id 模板 ID
/// @return 删除数量
@Delete("DELETE FROM gao_recycle_exchange_rule WHERE store_id=#{storeId} AND id=#{id}")
int deleteRule(@Param("storeId") String storeId, @Param("id") String id);
/// 分页查询回收物
///
/// @param storeId 门店 ID
/// @param status 状态,为空不过滤
/// @param keyword 名称关键字,为空不过滤
/// @param offset 分页偏移量
/// @param limit 分页数量
/// @return 回收物结果
List<GaoRecycleItem> items(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("keyword") String keyword,
@Param("offset") int offset,
@Param("limit") int limit
);
/// 统计回收物
///
/// @param storeId 门店 ID
/// @param status 状态,为空不过滤
/// @param keyword 名称关键字,为空不过滤
/// @return 统计回收物结果
long countItems(@Param("storeId") String storeId, @Param("status") String status, @Param("keyword") String keyword);
/// 按 ID 批量查询回收物
///
/// @param storeId 门店 ID
/// @param idList 回收物 ID 列表
/// @return 回收物结果
List<GaoRecycleItem> itemsByIdList(@Param("storeId") String storeId, @Param("idList") Collection<String> idList);
/// 查询回收物
///
/// @param storeId 门店 ID
/// @param id 记录 ID
/// @return 回收物结果
@Select("SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} AND id = #{id}")
GaoRecycleItem itemById(@Param("storeId") String storeId, @Param("id") String id);
/// 锁定回收物
///
/// @param storeId 门店 ID
/// @param id 记录 ID
/// @return 锁定回收物结果
@Select("SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} AND id = #{id} FOR UPDATE")
GaoRecycleItem item(@Param("storeId") String storeId, @Param("id") String id);
/// 创建回收物
///
/// @param item 回收物
void insertItem(GaoRecycleItem item);
/// 更新回收物
///
/// @param item 回收物
void updateItem(GaoRecycleItem item);
/// 分页查询兑换规则
///
/// @param storeId 门店 ID
/// @param status 规则状态,为空不过滤
/// @param recycleItemId 回收物 ID,为空不过滤
/// @param skuId 兑换 SKU ID,为空不过滤
/// @param keyword 回收物名称关键字,为空不过滤
/// @param offset 分页偏移量
/// @param limit 分页数量
/// @return 兑换规则结果
List<GaoRecycleExchangeRule> rules(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("recycleItemId") String recycleItemId,
@Param("skuId") String skuId,
@Param("keyword") String keyword,
@Param("offset") int offset,
@Param("limit") int limit
);
/// 统计兑换规则
///
/// @param storeId 门店 ID
/// @param status 规则状态,为空不过滤
/// @param recycleItemId 回收物 ID,为空不过滤
/// @param skuId 兑换 SKU ID,为空不过滤
/// @param keyword 回收物名称关键字,为空不过滤
/// @return 统计兑换规则结果
long countRules(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("recycleItemId") String recycleItemId,
@Param("skuId") String skuId,
@Param("keyword") String keyword
);
/// 查询兑换规则
///
/// @param storeId 门店 ID
/// @param id 记录 ID
/// @return 兑换规则结果
@Select("SELECT * FROM gao_recycle_exchange_rule WHERE store_id = #{storeId} AND id = #{id}")
GaoRecycleExchangeRule ruleById(@Param("storeId") String storeId, @Param("id") String id);
/// 锁定兑换规则
///
/// @param storeId 门店 ID
/// @param id 记录 ID
/// @return 锁定兑换规则结果
@Select("SELECT * FROM gao_recycle_exchange_rule WHERE store_id = #{storeId} AND id = #{id} FOR UPDATE")
GaoRecycleExchangeRule rule(@Param("storeId") String storeId, @Param("id") String id);
/// 创建兑换规则
///
/// @param rule 兑换规则
void insertRule(GaoRecycleExchangeRule rule);
/// 更新兑换规则
///
/// @param rule 兑换规则
void updateRule(GaoRecycleExchangeRule rule);
}
@@ -0,0 +1,18 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeAction;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/// GaoRecycleExchangeAction 表数据访问
public interface GaoRecycleExchangeActionMapper extends BaseMapper<GaoRecycleExchangeAction, String> {
@Select("SELECT * FROM gao_recycle_exchange_action WHERE store_id=#{storeId} AND request_no=#{requestNo}")
GaoRecycleExchangeAction actionByRequest(@Param("storeId") String storeId, @Param("requestNo") String requestNo);
void insertAction(GaoRecycleExchangeAction action);
@Select("SELECT * FROM gao_recycle_exchange_action WHERE exchange_id = #{id} ORDER BY created_at, id")
List<GaoRecycleExchangeAction> actions(String id);
}
@@ -1,14 +1,12 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchange;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeAction;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/// 回收兑换写入查询
public interface GaoRecycleExchangeWriteMapper extends BaseMapper<GaoRecycleExchange, String> {
public interface GaoRecycleExchangeMapper extends BaseMapper<GaoRecycleExchange, String> {
int updateByOrderStatus(@Param("orderId") String orderId, @Param("status") String status, @Param("updatedAt") long updatedAt);
@@ -31,10 +29,6 @@ public interface GaoRecycleExchangeWriteMapper extends BaseMapper<GaoRecycleExch
/// @return 兑换单,只填 ID 与回收物名称、单位快照
GaoRecycleExchange snapshotByOrderId(@Param("orderId") String orderId);
@Select("SELECT * FROM gao_recycle_exchange_action WHERE store_id=#{storeId} AND request_no=#{requestNo}")
GaoRecycleExchangeAction actionByRequest(@Param("storeId") String storeId, @Param("requestNo") String requestNo);
void insertAction(GaoRecycleExchangeAction action);
/// 撤销兑换单。待领取和已完成都允许撤销,撤销后不能再领取
///
@@ -42,4 +36,7 @@ public interface GaoRecycleExchangeWriteMapper extends BaseMapper<GaoRecycleExch
/// @param updatedAt 更新时间
/// @return 影响行数
int cancel(@Param("id") String id, @Param("updatedAt") long updatedAt);
@Select("SELECT * FROM gao_recycle_exchange WHERE id = #{id}")
GaoRecycleExchange detail(String id);
}
@@ -1,25 +0,0 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchange;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeAction;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/// 回收兑换查询
public interface GaoRecycleExchangeQueryMapper {
/// 查询兑换单
///
/// @param id 记录 ID
/// @return 兑换单结果
@Select("SELECT * FROM gao_recycle_exchange WHERE id = #{id}")
GaoRecycleExchange detail(String id);
/// 查询兑换操作记录
///
/// @param id 记录 ID
/// @return 兑换操作记录结果
@Select("SELECT * FROM gao_recycle_exchange_action WHERE exchange_id = #{id} ORDER BY created_at, id")
List<GaoRecycleExchangeAction> actions(String id);
}
@@ -0,0 +1,22 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRuleItem;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Delete;
import java.util.Collection;
import java.util.List;
/// GaoRecycleExchangeRuleItem 表数据访问
public interface GaoRecycleExchangeRuleItemMapper extends BaseMapper<GaoRecycleExchangeRuleItem, String> {
@Select("SELECT * FROM gao_recycle_exchange_rule_item WHERE rule_id=#{ruleId} ORDER BY sort, id")
List<GaoRecycleExchangeRuleItem> ruleItems(@Param("ruleId") String ruleId);
List<GaoRecycleExchangeRuleItem> ruleItemsByIds(@Param("ids") Collection<String> ids);
void insertRuleItem(GaoRecycleExchangeRuleItem item);
@Delete("DELETE FROM gao_recycle_exchange_rule_item WHERE rule_id=#{ruleId}")
void deleteRuleItems(@Param("ruleId") String ruleId);
}
@@ -0,0 +1,44 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/// GaoRecycleExchangeRule 表数据访问
public interface GaoRecycleExchangeRuleMapper extends BaseMapper<GaoRecycleExchangeRule, String> {
@Delete("DELETE FROM gao_recycle_exchange_rule WHERE store_id=#{storeId} AND id=#{id}")
int deleteRule(@Param("storeId") String storeId, @Param("id") String id);
List<GaoRecycleExchangeRule> rules(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("recycleItemId") String recycleItemId,
@Param("skuId") String skuId,
@Param("keyword") String keyword,
@Param("offset") int offset,
@Param("limit") int limit
);
long countRules(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("recycleItemId") String recycleItemId,
@Param("skuId") String skuId,
@Param("keyword") String keyword
);
@Select("SELECT * FROM gao_recycle_exchange_rule WHERE store_id = #{storeId} AND id = #{id}")
GaoRecycleExchangeRule ruleById(@Param("storeId") String storeId, @Param("id") String id);
@Select("SELECT * FROM gao_recycle_exchange_rule WHERE store_id = #{storeId} AND id = #{id} FOR UPDATE")
GaoRecycleExchangeRule rule(@Param("storeId") String storeId, @Param("id") String id);
void insertRule(GaoRecycleExchangeRule rule);
void updateRule(GaoRecycleExchangeRule rule);
}
@@ -0,0 +1,40 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Collection;
import java.util.List;
/// 回收物表数据访问
public interface GaoRecycleItemMapper extends BaseMapper<GaoRecycleItem, String> {
@Select("SELECT COUNT(*) FROM gao_recycle_item WHERE store_id=#{store} AND id=#{item}")
int validItem(@Param("store") String store, @Param("item") String item);
/// 额度查询权限可用的回收物选项。
@Select("SELECT id, name, unit_name AS unitName, status FROM gao_recycle_item WHERE store_id=#{store} ORDER BY name, id")
List<GaoRecycleItem> accountItems(@Param("store") String store);
List<GaoRecycleItem> items(
@Param("storeId") String storeId,
@Param("status") String status,
@Param("keyword") String keyword,
@Param("offset") int offset,
@Param("limit") int limit
);
long countItems(@Param("storeId") String storeId, @Param("status") String status, @Param("keyword") String keyword);
List<GaoRecycleItem> itemsByIdList(@Param("storeId") String storeId, @Param("idList") Collection<String> idList);
@Select("SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} AND id = #{id}")
GaoRecycleItem itemById(@Param("storeId") String storeId, @Param("id") String id);
@Select("SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} AND id = #{id} FOR UPDATE")
GaoRecycleItem item(@Param("storeId") String storeId, @Param("id") String id);
void insertItem(GaoRecycleItem item);
void updateItem(GaoRecycleItem item);
}
@@ -1,26 +1,29 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleLedgerPage;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger.BizType;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/// 回收物额度流水 Mapper
public interface GaoRecycleLedgerMapper extends BaseMapper<GaoRecycleLedger, String> {
List<Map<String, Object>> listLedger(@Param("store") String store, @Param("customer") String customer);
long countByQuery(GaoRecycleLedgerPage page);
List<Map<String, Object>> yieldsByFulfillment(@Param("biz") String biz);
List<GaoRecycleLedger> selectByQuery(GaoRecycleLedgerPage page);
Map<String, Object> findRequest(@Param("store") String store, @Param("request") String request);
List<GaoRecycleLedger> yieldsByFulfillment(@Param("biz") String biz);
GaoRecycleLedger findRequest(@Param("store") String store, @Param("request") String request);
void ledger(
@Param("id") String id,
@Param("account") String account,
@Param("type") String type,
@Param("type") BizType type,
@Param("biz") String biz,
@Param("request") String request,
@Param("balance") BigDecimal balance,
@@ -0,0 +1,33 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleProductYield;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/// 商品回收物产出配置表数据访问
public interface GaoRecycleProductYieldMapper extends BaseMapper<GaoRecycleProductYield, String> {
int validYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item);
void saveYield(
@Param("id") String id,
@Param("store") String store,
@Param("sku") String sku,
@Param("item") String item,
@Param("quantity") BigDecimal quantity,
@Param("now") long now
);
void deleteYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item, @Param("now") long now);
List<Map<String, Object>> yields(@Param("store") String store, @Param("sku") String sku);
/// 配置页需要的字段用驼峰返回,同时带上回收物名称与单位
List<GaoRecycleProductYield> yieldList(@Param("store") String store, @Param("sku") String sku);
/// 产品维度的产出配置:一个产品下所有 SKU 的产出行,按 SKU 排序返回
List<GaoRecycleProductYield> yieldListByProduct(@Param("store") String store, @Param("product") String product);
}
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoRecycleStatView;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeStatView;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleStatView;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeStatView;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -1,18 +1,18 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderProductRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderSkuRankView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatIntervalStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCalendarStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderConsumptionDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPaymentStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderStatusStatView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderTypeStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderProductRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderSkuRankView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatDailyStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatIntervalStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCalendarStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderConsumptionDailyStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderDailyStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPaymentStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderStatusStatView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderTypeStatView;
import java.util.List;
@@ -1,12 +1,12 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductCustomerRow;
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductView;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceRow;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductCustomerRow;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductView;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceRow;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.mapper;
import com.imyeyu.api.modules.common.entity.Article;
import com.imyeyu.api.modules.gao.vo.GaoStoreDiaryPage;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreDiaryPage;
import com.imyeyu.spring.mapper.BaseMapper;
import java.util.List;
@@ -1,10 +1,10 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordReq;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
import java.util.List;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPageResult;
import com.imyeyu.spring.service.BaseService;
import java.util.List;
@@ -2,8 +2,8 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.common.entity.NotifyDetail;
import com.imyeyu.api.modules.gao.entity.GaoCustomerFollowUpReminder;
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPageResult;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPageResult;
import com.imyeyu.api.modules.user.entity.User;
import com.imyeyu.spring.service.BaseService;
@@ -1,9 +1,9 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoCustomerPackage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackageCancelRequest;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePurchaseRequest;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackageCancelRequest;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePurchaseRequest;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,11 +1,11 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.GaoCustomerTrendStateReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerTrendStateReq;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -2,15 +2,15 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
import com.imyeyu.java.TimiJava;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,17 +1,17 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillment;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentActionRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPage;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPrepareStockRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentReturnRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCustomerRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSkuView;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderListRequest;
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderView;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentActionRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPage;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPrepareStockRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentReturnRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCustomerRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSkuView;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderListRequest;
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderView;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,11 +1,11 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentActionRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentNoRefundRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentReceiveRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRefundRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentActionRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentNoRefundRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentReceiveRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRefundRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
/// GAO 销售订单资金服务
///
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
import com.imyeyu.api.modules.gao.vo.GaoOrderStraightThroughRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderStraightThroughRequest;
/// GAO 订单创建直通服务
///
@@ -2,7 +2,7 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoPackageConfig;
import com.imyeyu.api.modules.gao.entity.GaoPackageConfigItem;
import com.imyeyu.api.modules.gao.vo.GaoPackageConfigPage;
import com.imyeyu.api.modules.gao.vo.packageconfig.GaoPackageConfigPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoPointAccount;
import com.imyeyu.api.modules.gao.vo.GaoPointAccountPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAccountPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,8 +1,8 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
import java.util.List;
@@ -4,8 +4,8 @@ import com.imyeyu.api.modules.common.bean.GroovyScriptExecutionResult;
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
import com.imyeyu.api.modules.gao.entity.GaoPointRule;
import com.imyeyu.api.modules.gao.script.GaoPointDecision;
import com.imyeyu.api.modules.gao.vo.GaoPointAdjustRequest;
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAdjustRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,9 +1,9 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoPointRedeemSku;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuRequest;
/// GAO 积分兑换 SKU 配置服务
///
@@ -2,9 +2,9 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoPointRedemption;
import com.imyeyu.api.modules.gao.entity.GaoPointRedemptionReturn;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionReturnRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionCreateRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionReturnRequest;
import com.imyeyu.spring.bean.PageResult;
import java.util.List;
@@ -3,7 +3,7 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
import com.imyeyu.api.modules.gao.vo.GaoPointAdjustRequest;
import com.imyeyu.api.modules.gao.vo.point.GaoPointAdjustRequest;
/// GAO 客户积分触发服务
///
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoProductCategory;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,15 +1,15 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
import java.util.List;
@@ -1,7 +1,7 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.entity.GaoProduct;
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.spring.service.BaseService;
@@ -1,13 +1,13 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
import java.util.List;
@@ -3,8 +3,8 @@ package com.imyeyu.api.modules.gao.service;
import com.fasterxml.jackson.databind.JsonNode;
import com.imyeyu.api.modules.gao.entity.GaoProductSku;
import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSelection;
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSelection;
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentView;
import com.imyeyu.spring.service.BaseService;
import java.util.Collection;
@@ -2,8 +2,8 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPageResult;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPageResult;
import com.imyeyu.spring.service.BaseService;
import java.util.List;
@@ -3,12 +3,12 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.api.modules.gao.entity.GaoProductStock;
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
import com.imyeyu.api.modules.gao.vo.GaoProductStockChangeRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualInBatchRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.GaoProductStockProductView;
import com.imyeyu.api.modules.gao.vo.GaoStockChangeItem;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockChangeRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualInBatchRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualRevokeRequest;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockProductView;
import com.imyeyu.api.modules.gao.vo.stock.GaoStockChangeItem;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.bean.PageResult;
@@ -2,6 +2,9 @@ package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleAccountMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleProductYieldMapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger.BizType;
import com.imyeyu.api.modules.user.service.UserLoginService;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.utils.Time;
@@ -22,6 +25,7 @@ import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillmentItem;
@RequiredArgsConstructor
public class GaoRecycleAccountService {
private final GaoRecycleAccountMapper mapper;
private final GaoRecycleProductYieldMapper yieldMapper;
private final GaoRecycleLedgerService ledgerService;
private final UserLoginService login;
@@ -29,7 +33,7 @@ public class GaoRecycleAccountService {
public void addFromFulfillment(String store, String customer, String fulfillmentId, List<GaoOrderFulfillmentItem> items) {
Map<String, BigDecimal> quantities = new TreeMap<>();
for (GaoOrderFulfillmentItem item : items) {
for (Map<String, Object> yield : mapper.yields(store, item.getSkuId())) {
for (Map<String, Object> yield : yieldMapper.yields(store, item.getSkuId())) {
String recycleId = (String) yield.get("recycle_item_id");
BigDecimal quantity = item.getBaseQuantity().multiply((BigDecimal) yield.get("quantity_per_base"))
.setScale(3, java.math.RoundingMode.DOWN);
@@ -41,16 +45,16 @@ public class GaoRecycleAccountService {
}
}
for (var entry : quantities.entrySet()) {
change(store, customer, entry.getKey(), entry.getValue(), BigDecimal.ZERO, "FULFILLMENT_YIELD", fulfillmentId, "yield:" + fulfillmentId + ":" + entry.getKey(), null);
change(store, customer, entry.getKey(), entry.getValue(), BigDecimal.ZERO, BizType.FULFILLMENT_YIELD, fulfillmentId, "yield:" + fulfillmentId + ":" + entry.getKey(), null);
}
}
/// 撤回原履约产生的额度,不追溯历史履约
public void revokeFulfillment(String store, String customer, String sourceId, String reverseId) {
for (Map<String, Object> row : ledgerService.yieldsByFulfillment(sourceId)) {
String item = (String) row.get("recycle_item_id");
BigDecimal value = (BigDecimal) row.get("balance_delta");
change(store, customer, item, value.negate(), BigDecimal.ZERO, "FULFILLMENT_REVOKE", reverseId, "yield-revoke:" + reverseId + ":" + item, null);
for (GaoRecycleLedger row : ledgerService.yieldsByFulfillment(sourceId)) {
String item = row.getRecycleItemId();
BigDecimal value = row.getBalanceDelta();
change(store, customer, item, value.negate(), BigDecimal.ZERO, BizType.FULFILLMENT_REVOKE, reverseId, "yield-revoke:" + reverseId + ":" + item, null);
}
}
@@ -66,7 +70,7 @@ public class GaoRecycleAccountService {
/// @param requestNo 幂等号
/// @param reason 原因
@Transactional(TimiServerDBConfig.ROLLBACKER)
public void change(String storeId, String customerId, String recycleItemId, BigDecimal balanceDelta, BigDecimal reservedDelta, String bizType, String bizId, String requestNo, String reason) {
public void change(String storeId, String customerId, String recycleItemId, BigDecimal balanceDelta, BigDecimal reservedDelta, BizType bizType, String bizId, String requestNo, String reason) {
TimiException.required(storeId, "门店不能为空");
TimiException.required(customerId, "客户不能为空");
TimiException.required(recycleItemId, "回收物不能为空");
@@ -76,18 +80,18 @@ public class GaoRecycleAccountService {
TimiException.requiredTrue(!(15 < balanceDelta.precision() - balanceDelta.scale()) && !(15 < reservedDelta.precision() - reservedDelta.scale()), "额度超出范围");
TimiException.required(requestNo, "请求号不能为空");
TimiException.requiredTrue(!requestNo.isBlank() && !(128 < requestNo.length()), "请求号无效");
TimiException.requiredTrue(bizType != null && !bizType.isBlank() && !(32 < bizType.length()) && bizId != null && !bizId.isBlank() && !(36 < bizId.length()), "额度业务信息无效");
TimiException.requiredTrue(bizType != null && bizId != null && !bizId.isBlank() && !(36 < bizId.length()), "额度业务信息无效");
long now = Time.now();
mapper.ensure(UUID.randomUUID().toString(), storeId, customerId, recycleItemId, now);
Map<String, Object> account = mapper.lock(storeId, customerId, recycleItemId);
TimiException.required(account, "额度账户不存在");
Map<String, Object> existing = ledgerService.findRequest(storeId, requestNo);
GaoRecycleLedger existing = ledgerService.findRequest(storeId, requestNo);
if (existing != null) {
TimiException.requiredTrue(Objects.equals(customerId, existing.get("customer_id")) && Objects.equals(recycleItemId, existing.get("recycle_item_id"))
&& Objects.equals(bizType, existing.get("biz_type")) && Objects.equals(bizId, existing.get("biz_id"))
&& balanceDelta.compareTo((BigDecimal) existing.get("balance_delta")) == 0
&& reservedDelta.compareTo((BigDecimal) existing.get("reserved_delta")) == 0
&& Objects.equals(reason, existing.get("reason")), "额度流水请求号对应内容不一致");
TimiException.requiredTrue(Objects.equals(customerId, existing.getCustomerId()) && Objects.equals(recycleItemId, existing.getRecycleItemId())
&& Objects.equals(bizType, existing.getBizType()) && Objects.equals(bizId, existing.getBizId())
&& balanceDelta.compareTo(existing.getBalanceDelta()) == 0
&& reservedDelta.compareTo(existing.getReservedDelta()) == 0
&& Objects.equals(reason, existing.getReason()), "额度流水请求号对应内容不一致");
return;
}
String id = (String) account.get("id");
@@ -11,11 +11,13 @@ import com.imyeyu.api.modules.gao.entity.GaoProductSkuUnit;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRuleItem;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleConfigMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleItemMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeRuleMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeRuleItemMapper;
import com.imyeyu.api.modules.gao.mapper.GaoProductSkuMapper;
import com.imyeyu.api.modules.gao.mapper.GaoProductSkuUnitMapper;
import com.imyeyu.api.modules.gao.vo.GaoRecycleItemRequest;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeRuleRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleItemRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeRuleRequest;
import org.springframework.beans.BeanUtils;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.utils.Time;
@@ -39,7 +41,9 @@ import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
public class GaoRecycleConfigService {
private final GaoRecycleConfigMapper mapper;
private final GaoRecycleItemMapper itemMapper;
private final GaoRecycleExchangeRuleMapper ruleMapper;
private final GaoRecycleExchangeRuleItemMapper ruleItemMapper;
private final AttachmentService attachmentService;
private final GaoProductSkuMapper skuMapper;
private final GaoProductSkuUnitMapper unitMapper;
@@ -60,8 +64,8 @@ public class GaoRecycleConfigService {
String statusName = status == null ? null : status.name();
String keywordText = blankToNull(keyword);
PageResult<GaoRecycleItem> result = new PageResult<>();
result.setTotal(mapper.countItems(storeId, statusName, keywordText));
List<GaoRecycleItem> items = mapper.items(storeId, statusName, keywordText, offset, limit);
result.setTotal(itemMapper.countItems(storeId, statusName, keywordText));
List<GaoRecycleItem> items = itemMapper.items(storeId, statusName, keywordText, offset, limit);
if (!items.isEmpty()) {
Map<String, List<Attachment>> photos = attachmentService.mapByBizIdList(
Attachment.BizType.GAO_RECYCLE_ITEM, items.stream().map(GaoRecycleItem::getId).toList());
@@ -80,7 +84,7 @@ public class GaoRecycleConfigService {
TimiException.required(id, "回收物 ID 不能为空");
String resolved = scope.resolveStoreId(storeId);
TimiException.required(resolved, "门店不能为空");
GaoRecycleItem item = mapper.itemById(resolved, id);
GaoRecycleItem item = itemMapper.itemById(resolved, id);
TimiException.required(item, "回收物不存在");
item.setAttachmentList(attachmentService.listByBizId(Attachment.BizType.GAO_RECYCLE_ITEM, id));
return item;
@@ -104,8 +108,8 @@ public class GaoRecycleConfigService {
String exchangeSkuId = blankToNull(skuId);
String keywordText = blankToNull(keyword);
PageResult<GaoRecycleExchangeRule> result = new PageResult<>();
result.setTotal(mapper.countRules(storeId, statusName, itemId, exchangeSkuId, keywordText));
List<GaoRecycleExchangeRule> list = mapper.rules(storeId, statusName, itemId, exchangeSkuId, keywordText, offset, limit);
result.setTotal(ruleMapper.countRules(storeId, statusName, itemId, exchangeSkuId, keywordText));
List<GaoRecycleExchangeRule> list = ruleMapper.rules(storeId, statusName, itemId, exchangeSkuId, keywordText, offset, limit);
fillRuleDisplay(storeId, list);
result.setList(list);
return result;
@@ -121,7 +125,7 @@ public class GaoRecycleConfigService {
TimiException.required(id, "规则 ID 不能为空");
String resolved = scope.resolveStoreId(storeId);
TimiException.required(resolved, "门店不能为空");
GaoRecycleExchangeRule rule = mapper.ruleById(resolved, id);
GaoRecycleExchangeRule rule = ruleMapper.ruleById(resolved, id);
TimiException.required(rule, "兑换规则不存在");
fillRuleDisplay(resolved, List.of(rule));
return rule;
@@ -153,8 +157,8 @@ public class GaoRecycleConfigService {
: attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, itemIdList);
Map<String, GaoRecycleItem> itemMap = itemIdList.isEmpty()
? Map.of()
: mapper.itemsByIdList(storeId, itemIdList).stream().collect(Collectors.toMap(GaoRecycleItem::getId, Function.identity()));
Map<String, List<GaoRecycleExchangeRuleItem>> ruleItems = mapper.ruleItemsByIds(ruleList.stream().map(GaoRecycleExchangeRule::getId).toList()).stream().collect(Collectors.groupingBy(GaoRecycleExchangeRuleItem::getRuleId));
: itemMapper.itemsByIdList(storeId, itemIdList).stream().collect(Collectors.toMap(GaoRecycleItem::getId, Function.identity()));
Map<String, List<GaoRecycleExchangeRuleItem>> ruleItems = ruleItemMapper.ruleItemsByIds(ruleList.stream().map(GaoRecycleExchangeRule::getId).toList()).stream().collect(Collectors.groupingBy(GaoRecycleExchangeRuleItem::getRuleId));
List<String> skuIdList = distinct(ruleItems.values().stream().flatMap(List::stream).map(GaoRecycleExchangeRuleItem::getSkuId).toList());
Map<String, GaoProductSku> skuMap = skuIdList.isEmpty()
? Map.of()
@@ -214,13 +218,13 @@ public class GaoRecycleConfigService {
if (item.getAllowDecimalQuantity() == null) item.setAllowDecimalQuantity(true);
item.setId(UUID.randomUUID().toString());
item.setCreatedAt(Time.now());
mapper.insertItem(item);
itemMapper.insertItem(item);
} else {
GaoRecycleItem existing = mapper.item(storeId, item.getId());
GaoRecycleItem existing = itemMapper.item(storeId, item.getId());
TimiException.required(existing, "回收物不存在");
if (item.getAllowDecimalQuantity() == null) item.setAllowDecimalQuantity(existing.getAllowDecimalQuantity());
item.setUpdatedAt(Time.now());
mapper.updateItem(item);
itemMapper.updateItem(item);
}
if (request.getAttachmentList() != null) {
attachmentService.updateByBizId(Attachment.BizType.GAO_RECYCLE_ITEM, item.getId(), request.getAttachmentList());
@@ -241,10 +245,10 @@ public class GaoRecycleConfigService {
rule.setStoreId(storeId);
TimiException.required(rule.getRecycleItemId(), "回收物不能为空");
if (rule.getId() != null) {
TimiException.required(mapper.rule(storeId, rule.getId()), "规则不存在");
TimiException.required(ruleMapper.rule(storeId, rule.getId()), "规则不存在");
}
TimiException.required(rule.getStatus(), "规则状态不能为空");
GaoRecycleItem item = mapper.item(storeId, rule.getRecycleItemId());
GaoRecycleItem item = itemMapper.item(storeId, rule.getRecycleItemId());
TimiException.required(item, "回收物不存在");
if (rule.getStatus() == GaoRecycleExchangeRule.Status.ACTIVE) {
TimiException.requiredTrue(item.getStatus() == GaoRecycleItem.Status.ACTIVE, "回收物已停用");
@@ -283,19 +287,19 @@ public class GaoRecycleConfigService {
if (rule.getId() == null) {
rule.setId(UUID.randomUUID().toString());
rule.setCreatedAt(Time.now());
mapper.insertRule(rule);
ruleMapper.insertRule(rule);
} else {
rule.setUpdatedAt(Time.now());
mapper.updateRule(rule);
ruleMapper.updateRule(rule);
}
mapper.deleteRuleItems(rule.getId());
ruleItemMapper.deleteRuleItems(rule.getId());
int position = 0;
for (GaoRecycleExchangeRuleItem entry : items) {
entry.setId(UUID.randomUUID().toString());
entry.setRuleId(rule.getId());
entry.setSort(position++);
entry.setCreatedAt(Time.now());
mapper.insertRuleItem(entry);
ruleItemMapper.insertRuleItem(entry);
}
fillRuleDisplay(storeId, List.of(rule));
return rule;
@@ -306,9 +310,9 @@ public class GaoRecycleConfigService {
public void deleteRule(String storeId, String id) {
String resolved = scope.resolveStoreId(storeId);
TimiException.required(resolved, "门店不能为空");
TimiException.required(mapper.rule(resolved, id), "规则不存在");
mapper.deleteRuleItems(id);
mapper.deleteRule(resolved, id);
TimiException.required(ruleMapper.rule(resolved, id), "规则不存在");
ruleItemMapper.deleteRuleItems(id);
ruleMapper.deleteRule(resolved, id);
}
private void validateQuantity(BigDecimal quantity) {
@@ -4,10 +4,11 @@ import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.api.modules.common.service.AttachmentService;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchange;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeAction;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeQueryMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleConfigMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeActionMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleItemMapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeDetail;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeDetail;
import com.imyeyu.java.bean.timi.TimiException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -21,8 +22,9 @@ import java.util.Map;
@RequiredArgsConstructor
public class GaoRecycleExchangeQueryService {
private final GaoRecycleExchangeQueryMapper mapper;
private final GaoRecycleConfigMapper configMapper;
private final GaoRecycleExchangeMapper mapper;
private final GaoRecycleExchangeActionMapper actionMapper;
private final GaoRecycleItemMapper itemMapper;
private final GaoStoreScopeService scopeService;
private final AttachmentService attachmentService;
@@ -39,12 +41,12 @@ public class GaoRecycleExchangeQueryService {
TimiException.required(exchange, "兑换单不存在");
scopeService.checkStoreId(exchange.getStoreId());
if (exchange.getRecycleItemId() != null) {
GaoRecycleItem item = configMapper.itemById(exchange.getStoreId(), exchange.getRecycleItemId());
GaoRecycleItem item = itemMapper.itemById(exchange.getStoreId(), exchange.getRecycleItemId());
if (item != null) exchange.setAllowDecimalQuantity(item.getAllowDecimalQuantity());
}
GaoRecycleExchangeDetail detail = new GaoRecycleExchangeDetail();
detail.setExchange(exchange);
List<GaoRecycleExchangeAction> actions = mapper.actions(id);
List<GaoRecycleExchangeAction> actions = actionMapper.actions(id);
detail.setActionList(actions);
Map<String, List<Attachment>> attachments = new HashMap<>();
for (GaoRecycleExchangeAction action : actions) {
@@ -17,23 +17,26 @@ import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeAction;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRuleItem;
import com.imyeyu.api.modules.gao.entity.GaoSalesOrderItem;
import com.imyeyu.api.modules.gao.vo.GaoPackageOrderCreateData;
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCancelRequest;
import com.imyeyu.api.modules.gao.vo.GaoRecyclePaymentRequest;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeItemRequest;
import com.imyeyu.api.modules.gao.vo.packageconfig.GaoPackageOrderCreateData;
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCancelRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecyclePaymentRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeItemRequest;
import com.imyeyu.api.modules.gao.entity.GaoRecycleItem;
import com.imyeyu.api.modules.gao.mapper.GaoProductMapper;
import com.imyeyu.api.modules.gao.mapper.GaoProductSkuMapper;
import com.imyeyu.api.modules.gao.mapper.GaoProductSkuUnitMapper;
import com.imyeyu.api.modules.gao.mapper.GaoProductStockRecordMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleConfigMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeWriteMapper;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeActionRequest;
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoStockChangeItem;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentItemRequest;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleItemMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeRuleMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeRuleItemMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeActionMapper;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleExchangeMapper;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeActionRequest;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeCreateRequest;
import com.imyeyu.api.modules.gao.vo.stock.GaoStockChangeItem;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentRevokeRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentCreateRequest;
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentItemRequest;
import com.imyeyu.api.modules.user.service.PermissionChecker;
import com.imyeyu.api.modules.user.service.UserLoginService;
import com.imyeyu.api.modules.system.audit.AuditOperation;
@@ -62,8 +65,11 @@ import java.util.HashMap;
@Service
@RequiredArgsConstructor
public class GaoRecycleExchangeWriteService {
private final GaoRecycleExchangeWriteMapper mapper;
private final GaoRecycleConfigMapper configMapper;
private final GaoRecycleExchangeMapper mapper;
private final GaoRecycleItemMapper itemMapper;
private final GaoRecycleExchangeRuleMapper ruleMapper;
private final GaoRecycleExchangeRuleItemMapper ruleItemMapper;
private final GaoRecycleExchangeActionMapper actionMapper;
private final GaoProductSkuMapper skuMapper;
private final GaoProductMapper productMapper;
private final GaoProductSkuUnitMapper unitMapper;
@@ -118,20 +124,20 @@ public class GaoRecycleExchangeWriteService {
boolean free = request.getRuleId() == null || request.getRuleId().isBlank();
boolean canAdjust = permissions.hasAny(ModuleCode.GAO, GaoPermissionCode.SALES_ORDER_PRICE_OVERRIDE.getValue());
TimiException.requiredTrue(!free || canAdjust, "缺少自由创建兑换单权限");
GaoRecycleExchangeRule rule = free ? null : configMapper.rule(store, request.getRuleId());
GaoRecycleExchangeRule rule = free ? null : ruleMapper.rule(store, request.getRuleId());
TimiException.requiredTrue(free || rule != null && rule.getStatus() == GaoRecycleExchangeRule.Status.ACTIVE, "兑换模板不存在或已停用");
int multiple = free ? 1 : request.getMultiple() == null ? 1 : request.getMultiple();
TimiException.requiredTrue(0 < multiple, "兑换份数必须大于零");
String itemId = request.getRecycleItemId() == null ? free ? null : rule.getRecycleItemId() : request.getRecycleItemId();
TimiException.required(itemId, "回收物不能为空");
GaoRecycleItem item = configMapper.item(store, itemId);
GaoRecycleItem item = itemMapper.item(store, itemId);
TimiException.requiredTrue(item != null && item.getStatus() == GaoRecycleItem.Status.ACTIVE, "回收物不存在或已停用");
BigDecimal preset = free ? null : quantity(rule.getRecycleQuantity().multiply(BigDecimal.valueOf(multiple)));
BigDecimal actual = quantity(request.getRecycleQuantity() == null ? preset : request.getRecycleQuantity());
if (!free && (!itemId.equals(rule.getRecycleItemId()) || actual.compareTo(preset) != 0)) {
TimiException.requiredTrue(canAdjust, "缺少兑换数量调整权限");
}
List<GaoRecycleExchangeRuleItem> defaults = free ? List.of() : configMapper.ruleItems(rule.getId());
List<GaoRecycleExchangeRuleItem> defaults = free ? List.of() : ruleItemMapper.ruleItems(rule.getId());
TimiException.requiredTrue(free || !defaults.isEmpty(), "兑换模板没有明细");
List<GaoRecycleExchangeItemRequest> inputs = request.getItemList();
if (inputs == null || inputs.isEmpty()) {
@@ -296,7 +302,7 @@ public class GaoRecycleExchangeWriteService {
String store = snapshot.getStoreId();
String fingerprint = fingerprint(request.getExchangeId(), GaoRecycleExchangeAction.ActionType.CANCEL, request.getOccurredAt(), request.getReason(), request.getRemark(), number(request.getRetainedRecycleQuantity()), request.getFulfillmentRevokeList(), request.getPaymentRevokeList(), attachments(request.getAttachmentList()));
TimiException.required(mapper.lockStore(store), "门店不存在");
GaoRecycleExchangeAction existing = mapper.actionByRequest(store, request.getRequestNo());
GaoRecycleExchangeAction existing = actionMapper.actionByRequest(store, request.getRequestNo());
if (existing != null) {
TimiException.requiredTrue(fingerprint.equals(existing.getRequestFingerprint()), "请求号对应的操作内容不一致");
return mapper.lockExchange(store, existing.getExchangeId());
@@ -359,7 +365,7 @@ public class GaoRecycleExchangeWriteService {
action.setReason(request.getReason());
action.setRemark(request.getRemark());
action.setRetainedRecycleQuantity(retained);
mapper.insertAction(action);
actionMapper.insertAction(action);
if (orderRequest == null) attachmentService.updateByBizId(Attachment.BizType.GAO_RECYCLE_EXCHANGE_REVOKE, action.getId(), request.getAttachmentList());
TimiException.requiredTrue(mapper.cancel(exchange.getId(), now) == 1, "兑换单状态已变更");
exchange.setStatus(GaoRecycleExchange.Status.CANCELLED);
@@ -1,12 +1,15 @@
package com.imyeyu.api.modules.gao.service;
import com.imyeyu.api.modules.gao.mapper.GaoRecycleLedgerMapper;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger;
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleLedgerPage;
import com.imyeyu.spring.bean.PageResult;
import com.imyeyu.api.modules.gao.entity.GaoRecycleLedger.BizType;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/// 回收物额度流水服务
@Service
@@ -14,19 +17,22 @@ import java.util.Map;
public class GaoRecycleLedgerService {
private final GaoRecycleLedgerMapper mapper;
public List<Map<String, Object>> listLedger(String store, String customer) {
return mapper.listLedger(store, customer);
public PageResult<GaoRecycleLedger> pageByQuery(GaoRecycleLedgerPage page) {
PageResult<GaoRecycleLedger> result = new PageResult<>();
result.setTotal(mapper.countByQuery(page));
result.setList(mapper.selectByQuery(page));
return result;
}
public List<Map<String, Object>> yieldsByFulfillment(String biz) {
public List<GaoRecycleLedger> yieldsByFulfillment(String biz) {
return mapper.yieldsByFulfillment(biz);
}
public Map<String, Object> findRequest(String store, String request) {
public GaoRecycleLedger findRequest(String store, String request) {
return mapper.findRequest(store, request);
}
public void ledger(String id, String account, String type, String biz, String request, BigDecimal balance,
public void ledger(String id, String account, BizType type, String biz, String request, BigDecimal balance,
BigDecimal reserved, String operator, String reason, long now) {
mapper.ledger(id, account, type, biz, request, balance, reserved, operator, reason, now);
}

Some files were not shown because too many files have changed in this diff Show More