Compare commits
17
Commits
v1.0.74
...
badda20f32
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
badda20f32 | ||
|
|
386e26e77e | ||
|
|
597101723c | ||
|
|
30e5888240 | ||
|
|
743f491efc | ||
|
|
c40ba5383e | ||
|
|
ca87a273bc | ||
|
|
0166a5585b | ||
|
|
78cfe0708c | ||
|
|
bdcf32ba26 | ||
|
|
6feaad4b33 | ||
|
|
8954902994 | ||
|
|
09a8547ded | ||
|
|
82110e36b7 | ||
|
|
5604edc00b | ||
|
|
7294e9050d | ||
|
|
7d87ca7a86 |
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||||
<artifactId>TimiServerAPI</artifactId>
|
<artifactId>TimiServerAPI</artifactId>
|
||||||
<version>1.0.74</version>
|
<version>1.0.79</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>TimiServerAPI</name>
|
<name>TimiServerAPI</name>
|
||||||
<description>imyeyu.com API</description>
|
<description>imyeyu.com API</description>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
///
|
///
|
||||||
/// 应用发布通道
|
/// 应用发布通道
|
||||||
///
|
///
|
||||||
/// 通道只持有一个指针,回滚就是改指向,发布记录本身不可变
|
/// 通道分别持有热更包和原生包指针
|
||||||
///
|
///
|
||||||
/// @author Codex
|
/// @author Codex
|
||||||
/// @since 2026-11-06
|
/// @since 2026-11-06
|
||||||
@@ -24,7 +24,13 @@ public class AppChannel extends UUIDEntity {
|
|||||||
/// 通道名称
|
/// 通道名称
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
/// 当前指向的发布 ID,为空表示该通道无发布
|
/// 当前热更包发布 ID
|
||||||
|
protected String bundleReleaseId;
|
||||||
|
|
||||||
|
/// 当前原生包发布 ID
|
||||||
|
protected String nativeReleaseId;
|
||||||
|
|
||||||
|
/// 过渡期旧指针
|
||||||
protected String releaseId;
|
protected String releaseId;
|
||||||
|
|
||||||
/// 最后操作人用户 ID
|
/// 最后操作人用户 ID
|
||||||
|
|||||||
@@ -44,4 +44,11 @@ public interface AppChannelMapper extends BaseMapper<AppChannel, String> {
|
|||||||
@Param("updatedBy") String updatedBy,
|
@Param("updatedBy") String updatedBy,
|
||||||
@Param("updatedAt") Long updatedAt
|
@Param("updatedAt") Long updatedAt
|
||||||
);
|
);
|
||||||
|
/// 按类型切换指针并同步旧指针
|
||||||
|
@Update("UPDATE app_channel SET bundle_release_id = CASE WHEN #{nativeRelease} = false THEN #{releaseId} ELSE bundle_release_id END, native_release_id = CASE WHEN #{nativeRelease} = true THEN #{releaseId} ELSE native_release_id END, release_id = #{releaseId}, updated_by = #{updatedBy}, updated_at = #{updatedAt} WHERE id = #{id}")
|
||||||
|
int updatePointers(@Param("id") String id, @Param("releaseId") String releaseId, @Param("nativeRelease") boolean nativeRelease, @Param("updatedBy") String updatedBy, @Param("updatedAt") Long updatedAt);
|
||||||
|
|
||||||
|
/// 清除所有通道中指向撤回记录的指针
|
||||||
|
@Update("UPDATE app_channel SET bundle_release_id = CASE WHEN bundle_release_id = #{releaseId} THEN NULL ELSE bundle_release_id END, native_release_id = CASE WHEN native_release_id = #{releaseId} THEN NULL ELSE native_release_id END, release_id = CASE WHEN release_id = #{releaseId} THEN NULL ELSE release_id END, updated_by = #{updatedBy}, updated_at = #{updatedAt} WHERE product_id = #{productId} AND deleted_at IS NULL AND (bundle_release_id = #{releaseId} OR native_release_id = #{releaseId} OR release_id = #{releaseId})")
|
||||||
|
int clearRelease(@Param("productId") String productId, @Param("releaseId") String releaseId, @Param("updatedBy") String updatedBy, @Param("updatedAt") Long updatedAt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.imyeyu.api.modules.app.service;
|
|||||||
import com.imyeyu.api.modules.app.entity.AppChannel;
|
import com.imyeyu.api.modules.app.entity.AppChannel;
|
||||||
import com.imyeyu.api.modules.app.entity.AppProduct;
|
import com.imyeyu.api.modules.app.entity.AppProduct;
|
||||||
import com.imyeyu.api.modules.app.entity.AppRelease;
|
import com.imyeyu.api.modules.app.entity.AppRelease;
|
||||||
|
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
|
||||||
import com.imyeyu.api.modules.app.mapper.AppChannelMapper;
|
import com.imyeyu.api.modules.app.mapper.AppChannelMapper;
|
||||||
import com.imyeyu.api.modules.app.mapper.AppProductMapper;
|
import com.imyeyu.api.modules.app.mapper.AppProductMapper;
|
||||||
import com.imyeyu.api.modules.app.mapper.AppReleaseMapper;
|
import com.imyeyu.api.modules.app.mapper.AppReleaseMapper;
|
||||||
@@ -16,6 +17,7 @@ import com.imyeyu.java.TimiJava;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -42,11 +44,23 @@ public class AppVersionService {
|
|||||||
/// 内置包版本标识
|
/// 内置包版本标识
|
||||||
public static final String BUILTIN_VERSION = "builtin";
|
public static final String BUILTIN_VERSION = "builtin";
|
||||||
|
|
||||||
|
/// 首个能处理外壳安装包的 Web 包版本
|
||||||
|
///
|
||||||
|
/// 更早的包不认识 shell 标记,只会把 url 当热更 zip 交给插件解压,拿到 APK 必然失败。
|
||||||
|
/// 通道指向原生包时,低于这个版本的设备改为下发热更包,先把它升到能自升级为止
|
||||||
|
public static final String SHELL_AWARE_VERSION = "1.3.2";
|
||||||
|
|
||||||
|
/// 首个按独立字段接收外壳更新的 Web 包版本
|
||||||
|
///
|
||||||
|
/// 从这版起响应把安装包放到 shellUrl,主字段 url 永远给热更包;
|
||||||
|
/// 更早的包只认「主字段 + shell 标记」,所以两套语义要并存到 1.5.0 铺开为止
|
||||||
|
public static final String SHELL_JSON_AWARE_VERSION = "1.5.0";
|
||||||
|
|
||||||
/// 更新日志最多返回的版本条数
|
/// 更新日志最多返回的版本条数
|
||||||
public static final int MAX_NOTES = 20;
|
public static final int MAX_NOTES = 8;
|
||||||
|
|
||||||
/// 已是最新时展示的版本条数
|
/// 已是最新时展示的版本条数
|
||||||
public static final int TAIL_NOTES = 3;
|
public static final int TAIL_NOTES = 8;
|
||||||
|
|
||||||
/// 灰度基数
|
/// 灰度基数
|
||||||
private static final long GRAY_BASE = 10000L;
|
private static final long GRAY_BASE = 10000L;
|
||||||
@@ -66,21 +80,26 @@ public class AppVersionService {
|
|||||||
if (product == null) {
|
if (product == null) {
|
||||||
return AppUpdateCheckResponse.none(currentVersion);
|
return AppUpdateCheckResponse.none(currentVersion);
|
||||||
}
|
}
|
||||||
AppRelease release = resolveChannelRelease(product, req);
|
|
||||||
if (release == null) {
|
|
||||||
return AppUpdateCheckResponse.none(currentVersion);
|
|
||||||
}
|
|
||||||
int currentCode = parseInt(req.getVersionCode(), 0);
|
int currentCode = parseInt(req.getVersionCode(), 0);
|
||||||
if (release.getKind() == AppRelease.Kind.NATIVE) {
|
AppRelease bundlePointer = resolvePointer(product, req, AppRelease.Kind.BUNDLE);
|
||||||
AppRelease target = resolveNative(release, currentCode);
|
AppRelease nativePointer = resolvePointer(product, req, AppRelease.Kind.NATIVE);
|
||||||
return target == null
|
AppRelease bundle = bundlePointer == null ? null : resolveBundle(bundlePointer, product, currentCode, currentVersion, req.getDeviceId());
|
||||||
? AppUpdateCheckResponse.none(currentVersion)
|
AppRelease nativeTarget = nativePointer == null ? null : resolveNative(nativePointer, currentCode);
|
||||||
: buildResponse(target, Boolean.TRUE.equals(target.getMandatory()), true);
|
boolean shellAware = 0 <= compareVersion(currentVersion, SHELL_AWARE_VERSION);
|
||||||
|
boolean jsonAware = 0 <= compareVersion(currentVersion, SHELL_JSON_AWARE_VERSION);
|
||||||
|
// 认识 shell 标记但还不认识独立字段的包,主字段继续给安装包
|
||||||
|
if (nativeTarget != null && shellAware && !jsonAware) {
|
||||||
|
return buildResponse(nativeTarget, Boolean.TRUE.equals(nativeTarget.getMandatory()), true);
|
||||||
}
|
}
|
||||||
AppRelease target = resolveBundle(release, product, currentCode, currentVersion, req.getDeviceId());
|
AppUpdateCheckResponse response = bundle == null ? AppUpdateCheckResponse.none(currentVersion) : buildResponse(bundle, false, false);
|
||||||
return target == null
|
if (nativeTarget != null && jsonAware) {
|
||||||
? AppUpdateCheckResponse.none(currentVersion)
|
AppUpdateCheckResponse shell = buildResponse(nativeTarget, false, true);
|
||||||
: buildResponse(target, false, false);
|
response.setShellUrl(shell.getUrl());
|
||||||
|
response.setShellVersion(shell.getVersion());
|
||||||
|
response.setShellChecksum(shell.getChecksum());
|
||||||
|
response.setShellMandatory(Boolean.TRUE.equals(nativeTarget.getMandatory()));
|
||||||
|
}
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 查询更新日志
|
/// 查询更新日志
|
||||||
@@ -100,9 +119,12 @@ public class AppVersionService {
|
|||||||
if (product == null) {
|
if (product == null) {
|
||||||
return new AppUpdateNotesResponse(null, Collections.emptyList());
|
return new AppUpdateNotesResponse(null, Collections.emptyList());
|
||||||
}
|
}
|
||||||
AppRelease target = resolveChannelRelease(product, req);
|
AppRelease target = resolvePointer(product, req, AppRelease.Kind.BUNDLE);
|
||||||
// 原生包更新走安装包,与热更日志无关
|
// 指针为空(刚建通道还没发过热更)时退回最近一次发布,日志不该跟着空
|
||||||
if (target == null || target.getKind() == AppRelease.Kind.NATIVE) {
|
if (target == null) {
|
||||||
|
target = latestPublishedBundle(product);
|
||||||
|
}
|
||||||
|
if (target == null) {
|
||||||
return new AppUpdateNotesResponse(null, Collections.emptyList());
|
return new AppUpdateNotesResponse(null, Collections.emptyList());
|
||||||
}
|
}
|
||||||
// 当前版本不低于通道版本:已是最新,或回滚后反而超前
|
// 当前版本不低于通道版本:已是最新,或回滚后反而超前
|
||||||
@@ -156,17 +178,22 @@ public class AppVersionService {
|
|||||||
/// @param product 产品
|
/// @param product 产品
|
||||||
/// @param req 插件上报信息
|
/// @param req 插件上报信息
|
||||||
/// @return 发布记录,通道为空或指向的记录不可用时为 null
|
/// @return 发布记录,通道为空或指向的记录不可用时为 null
|
||||||
private AppRelease resolveChannelRelease(AppProduct product, AppUpdateCheckRequest req) {
|
private AppRelease resolvePointer(AppProduct product, AppUpdateCheckRequest req, AppRelease.Kind kind) {
|
||||||
String channelCode = TimiJava.isEmpty(req.getChannel()) ? DEFAULT_CHANNEL : req.getChannel();
|
String channelCode = TimiJava.isEmpty(req.getChannel()) ? DEFAULT_CHANNEL : req.getChannel();
|
||||||
AppChannel channel = channelMapper.selectByProductAndCode(product.getId(), channelCode);
|
AppChannel channel = channelMapper.selectByProductAndCode(product.getId(), channelCode);
|
||||||
if (channel == null || TimiJava.isEmpty(channel.getReleaseId())) {
|
if (channel == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
AppRelease release = releaseMapper.select(channel.getReleaseId());
|
String id = kind == AppRelease.Kind.BUNDLE ? channel.getBundleReleaseId() : channel.getNativeReleaseId();
|
||||||
if (release == null || release.getStatus() != AppRelease.Status.PUBLISHED) {
|
// 兼容旧代码在回滚期间仅更新旧指针的情况
|
||||||
|
if (TimiJava.isEmpty(id)) {
|
||||||
|
id = channel.getReleaseId();
|
||||||
|
}
|
||||||
|
if (TimiJava.isEmpty(id)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return release;
|
AppRelease release = releaseMapper.select(id);
|
||||||
|
return release != null && release.getKind() == kind && release.getStatus() == AppRelease.Status.PUBLISHED ? release : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 原生包是否需要更新
|
/// 原生包是否需要更新
|
||||||
@@ -217,6 +244,23 @@ public class AppVersionService {
|
|||||||
return release;
|
return release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 取最近一次发布的热更包
|
||||||
|
///
|
||||||
|
/// 通道指向原生包时,更新日志没有「通道版本」可用,改用这里兜底。
|
||||||
|
/// 日志是「这个产品最近发了什么」,与设备能不能装无关,所以不套灰度与兼容区间
|
||||||
|
///
|
||||||
|
/// @param product 产品
|
||||||
|
/// @return 版本最高的已发布热更包,没有则返回 null
|
||||||
|
private AppRelease latestPublishedBundle(AppProduct product) {
|
||||||
|
AppRelease latest = null;
|
||||||
|
for (AppRelease item : releaseMapper.selectPublished(product.getId(), AppRelease.Kind.BUNDLE)) {
|
||||||
|
if (latest == null || 0 < compareVersion(item.getVersionName(), latest.getVersionName())) {
|
||||||
|
latest = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return latest;
|
||||||
|
}
|
||||||
|
|
||||||
/// 判断设备是否命中灰度
|
/// 判断设备是否命中灰度
|
||||||
///
|
///
|
||||||
/// @param grayPermille 灰度比例,万分比
|
/// @param grayPermille 灰度比例,万分比
|
||||||
@@ -248,7 +292,7 @@ public class AppVersionService {
|
|||||||
.path("/attach/download/")
|
.path("/attach/download/")
|
||||||
.path(release.getAttachmentId())
|
.path(release.getAttachmentId())
|
||||||
.toUriString();
|
.toUriString();
|
||||||
return new AppUpdateCheckResponse(release.getVersionName(), url, release.getSha256(), mandatory, shell, release.getNote());
|
return new AppUpdateCheckResponse(release.getVersionName(), url, release.getSha256(), mandatory, shell, release.getNote(), null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 比较版本号
|
/// 比较版本号
|
||||||
@@ -316,6 +360,7 @@ public class AppVersionService {
|
|||||||
/// @param grayPermille 灰度比例,为空时保持原值
|
/// @param grayPermille 灰度比例,为空时保持原值
|
||||||
/// @param operatorId 操作人用户 ID
|
/// @param operatorId 操作人用户 ID
|
||||||
/// @param note 变更说明
|
/// @param note 变更说明
|
||||||
|
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||||
public void publish(String releaseId, String channelCode, Integer grayPermille, String operatorId, String note) {
|
public void publish(String releaseId, String channelCode, Integer grayPermille, String operatorId, String note) {
|
||||||
AppRelease release = releaseMapper.select(releaseId);
|
AppRelease release = releaseMapper.select(releaseId);
|
||||||
if (release == null) {
|
if (release == null) {
|
||||||
@@ -336,7 +381,7 @@ public class AppVersionService {
|
|||||||
release.setNote(TimiJava.isEmpty(note) ? release.getNote() : note);
|
release.setNote(TimiJava.isEmpty(note) ? release.getNote() : note);
|
||||||
release.setUpdatedAt(now);
|
release.setUpdatedAt(now);
|
||||||
releaseMapper.updateSelective(release);
|
releaseMapper.updateSelective(release);
|
||||||
channelMapper.updateReleaseId(channel.getId(), releaseId, operatorId, now);
|
channelMapper.updatePointers(channel.getId(), releaseId, release.getKind() == AppRelease.Kind.NATIVE, operatorId, now);
|
||||||
log("APP_RELEASE_PUBLISH", releaseId);
|
log("APP_RELEASE_PUBLISH", releaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,6 +393,7 @@ public class AppVersionService {
|
|||||||
/// @param channelCode 通道代码
|
/// @param channelCode 通道代码
|
||||||
/// @param targetReleaseId 目标发布 ID
|
/// @param targetReleaseId 目标发布 ID
|
||||||
/// @param operatorId 操作人用户 ID
|
/// @param operatorId 操作人用户 ID
|
||||||
|
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||||
public void rollback(String productId, String channelCode, String targetReleaseId, String operatorId) {
|
public void rollback(String productId, String channelCode, String targetReleaseId, String operatorId) {
|
||||||
AppChannel channel = channelMapper.selectByProductAndCode(productId, channelCode);
|
AppChannel channel = channelMapper.selectByProductAndCode(productId, channelCode);
|
||||||
if (channel == null) {
|
if (channel == null) {
|
||||||
@@ -362,7 +408,7 @@ public class AppVersionService {
|
|||||||
target.setStatus(AppRelease.Status.PUBLISHED);
|
target.setStatus(AppRelease.Status.PUBLISHED);
|
||||||
target.setUpdatedAt(now);
|
target.setUpdatedAt(now);
|
||||||
releaseMapper.updateSelective(target);
|
releaseMapper.updateSelective(target);
|
||||||
channelMapper.updateReleaseId(channel.getId(), targetReleaseId, operatorId, now);
|
channelMapper.updatePointers(channel.getId(), targetReleaseId, target.getKind() == AppRelease.Kind.NATIVE, operatorId, now);
|
||||||
log("APP_RELEASE_ROLLBACK", targetReleaseId);
|
log("APP_RELEASE_ROLLBACK", targetReleaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,6 +416,7 @@ public class AppVersionService {
|
|||||||
///
|
///
|
||||||
/// @param releaseId 发布 ID
|
/// @param releaseId 发布 ID
|
||||||
/// @param operatorId 操作人用户 ID
|
/// @param operatorId 操作人用户 ID
|
||||||
|
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||||
public void revoke(String releaseId, String operatorId) {
|
public void revoke(String releaseId, String operatorId) {
|
||||||
AppRelease release = releaseMapper.select(releaseId);
|
AppRelease release = releaseMapper.select(releaseId);
|
||||||
if (release == null) {
|
if (release == null) {
|
||||||
@@ -379,10 +426,7 @@ public class AppVersionService {
|
|||||||
release.setStatus(AppRelease.Status.REVOKED);
|
release.setStatus(AppRelease.Status.REVOKED);
|
||||||
release.setUpdatedAt(now);
|
release.setUpdatedAt(now);
|
||||||
releaseMapper.updateSelective(release);
|
releaseMapper.updateSelective(release);
|
||||||
AppChannel channel = channelMapper.selectByProductAndCode(release.getProductId(), DEFAULT_CHANNEL);
|
channelMapper.clearRelease(release.getProductId(), releaseId, operatorId, now);
|
||||||
if (channel != null && releaseId.equals(channel.getReleaseId())) {
|
|
||||||
channelMapper.updateReleaseId(channel.getId(), null, operatorId, now);
|
|
||||||
}
|
|
||||||
log("APP_RELEASE_REVOKE", releaseId);
|
log("APP_RELEASE_REVOKE", releaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,23 @@ public class AppUpdateCheckResponse {
|
|||||||
/// 字段名不能叫 message:Capgo 插件把 message 当作错误信息,收到会直接判为检查失败
|
/// 字段名不能叫 message:Capgo 插件把 message 当作错误信息,收到会直接判为检查失败
|
||||||
protected String note;
|
protected String note;
|
||||||
|
|
||||||
|
/// 外壳下载地址
|
||||||
|
protected String shellUrl;
|
||||||
|
|
||||||
|
/// 外壳版本
|
||||||
|
protected String shellVersion;
|
||||||
|
|
||||||
|
/// 外壳 SHA-256
|
||||||
|
protected String shellChecksum;
|
||||||
|
|
||||||
|
/// true 为强制更新
|
||||||
|
protected Boolean shellMandatory;
|
||||||
|
|
||||||
/// 构建无更新响应,version 与当前一致时插件不会下载
|
/// 构建无更新响应,version 与当前一致时插件不会下载
|
||||||
///
|
///
|
||||||
/// @param currentVersion 当前运行的 Web 包版本
|
/// @param currentVersion 当前运行的 Web 包版本
|
||||||
/// @return 无更新响应
|
/// @return 无更新响应
|
||||||
public static AppUpdateCheckResponse none(String currentVersion) {
|
public static AppUpdateCheckResponse none(String currentVersion) {
|
||||||
return new AppUpdateCheckResponse(currentVersion, "", null, false, null, null);
|
return new AppUpdateCheckResponse(currentVersion, "", null, false, null, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -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.GaoStoreBusinessDayService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
|
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreDiaryPage;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreDiaryPage;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoCustomerChartService;
|
import com.imyeyu.api.modules.gao.service.GaoCustomerChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
+2
-2
@@ -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.GaoCustomerConsumptionRecordService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPageResult;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.entity.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerTrendStateReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerTrendStateReq;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
|
|||||||
+2
-2
@@ -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.GaoCustomerFollowUpReminderService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerFollowUpReminderPageResult;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPageResult;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
|
|||||||
+3
-3
@@ -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.GaoOrderFulfillmentService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
|
import com.imyeyu.api.modules.gao.service.GaoSalesOrderService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackageCancelRequest;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackageCancelRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePurchaseRequest;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePurchaseRequest;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
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.GaoEventRecordService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoEventService;
|
import com.imyeyu.api.modules.gao.service.GaoEventService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPageResult;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPageResult;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
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.GaoFundRecordService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
|
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoFundRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.fund.GaoFundRevokeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserLoginService;
|
import com.imyeyu.api.modules.user.service.UserLoginService;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
|
|||||||
+11
-11
@@ -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.service.GaoSalesOrderService;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentActionRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentActionRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPage;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPrepareStockRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPrepareStockRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentRevokeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentReturnRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentReturnRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCustomerRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCustomerRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSkuView;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSkuView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderListRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderListRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderView;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderView;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
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.GaoPackageConfigService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductSkuService;
|
import com.imyeyu.api.modules.gao.service.GaoProductSkuService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.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.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
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.entity.GaoPointAccount;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoPointAccountService;
|
import com.imyeyu.api.modules.gao.service.GaoPointAccountService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
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.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.GaoPointLedgerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoPointTriggerService;
|
import com.imyeyu.api.modules.gao.service.GaoPointTriggerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointAdjustRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointAdjustRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
@@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/// GAO 客户积分流水接口
|
/// GAO 客户积分流水接口
|
||||||
@@ -41,6 +42,14 @@ public class GaoPointLedgerController {
|
|||||||
return ledgerService.pageByQuery(page);
|
return ledgerService.pageByQuery(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AOPLog
|
||||||
|
@RequestRateLimit
|
||||||
|
@RequireGaoPermission(GaoPermissionCode.POINT_LEDGER_READ)
|
||||||
|
@PostMapping("/ledger/detail")
|
||||||
|
public GaoPointLedger detail(@RequestParam String id, @RequestParam(required = false) String storeId) {
|
||||||
|
return ledgerService.getByIdAndStoreId(storeScopeService.resolveStoreId(storeId), id);
|
||||||
|
}
|
||||||
|
|
||||||
@AOPLog
|
@AOPLog
|
||||||
@RequestRateLimit
|
@RequestRateLimit
|
||||||
@RequireGaoPermission(GaoPermissionCode.POINT_ADJUST)
|
@RequireGaoPermission(GaoPermissionCode.POINT_ADJUST)
|
||||||
|
|||||||
+3
-3
@@ -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.entity.GaoPointRedeemSku;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoPointRedeemSkuService;
|
import com.imyeyu.api.modules.gao.service.GaoPointRedeemSkuService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuRequest;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
+3
-3
@@ -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.entity.GaoPointRedemptionReturn;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoPointRedemptionService;
|
import com.imyeyu.api.modules.gao.service.GaoPointRedemptionService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionReturnRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionReturnRequest;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
+10
-10
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductChartService;
|
import com.imyeyu.api.modules.gao.service.GaoProductChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.GaoProductSpec;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductSpecValue;
|
import com.imyeyu.api.modules.gao.entity.GaoProductSpecValue;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
+8
-8
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductSkuChartService;
|
import com.imyeyu.api.modules.gao.service.GaoProductSkuChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.GaoProductStockService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoProductStockRecordService;
|
import com.imyeyu.api.modules.gao.service.GaoProductStockRecordService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockBatchRequest;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockBatchRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockChangeRequest;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockChangeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualInBatchRequest;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualInBatchRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockManualRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockManualRevokeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockProductView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockProductView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPageResult;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPageResult;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
+111
-110
@@ -6,136 +6,137 @@ import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
|
|||||||
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.mapper.GaoRecycleAccountMapper;
|
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.GaoCustomerService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleAccountService;
|
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
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.java.bean.timi.TimiException;
|
||||||
|
import com.imyeyu.utils.Time;
|
||||||
import lombok.RequiredArgsConstructor;
|
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 java.math.BigDecimal;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import com.imyeyu.utils.Time;
|
|
||||||
|
|
||||||
/// 客户回收物额度接口
|
/// 客户回收物额度接口
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/gao/recycle/account")
|
@RequestMapping("/gao/recycle/account")
|
||||||
public class GaoRecycleAccountController {
|
public class GaoRecycleAccountController {
|
||||||
private final GaoRecycleAccountMapper mapper;
|
private final GaoRecycleAccountMapper mapper;
|
||||||
private final GaoRecycleAccountService service;
|
private final GaoRecycleProductYieldMapper yieldMapper;
|
||||||
private final GaoStoreScopeService scope;
|
private final GaoRecycleItemMapper itemMapper;
|
||||||
private final GaoCustomerService customerService;
|
private final GaoStoreScopeService scope;
|
||||||
private final AttachmentService attachmentService;
|
private final GaoCustomerService customerService;
|
||||||
|
private final AttachmentService attachmentService;
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
||||||
@PostMapping("/yield/list")
|
@PostMapping("/yield/list")
|
||||||
public List<Map<String, Object>> yields(@RequestParam String storeId, @RequestParam String skuId) {
|
public List<GaoRecycleProductYield> yields(@RequestParam String storeId, @RequestParam String skuId) {
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
List<Map<String, Object>> rows = mapper.yieldList(storeId, skuId);
|
List<GaoRecycleProductYield> rows = yieldMapper.yieldList(storeId, skuId);
|
||||||
List<String> itemIds = rows.stream().map(row -> (String) row.get("recycleItemId")).filter(java.util.Objects::nonNull).distinct().toList();
|
List<String> ids = rows.stream().map(GaoRecycleProductYield::getRecycleItemId).filter(Objects::nonNull).distinct().toList();
|
||||||
if (!itemIds.isEmpty()) {
|
if (!ids.isEmpty()) {
|
||||||
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, itemIds);
|
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, ids);
|
||||||
rows.forEach(row -> row.put("attachmentList", attachments.getOrDefault(row.get("recycleItemId"), List.of())));
|
rows.forEach(row -> row.setAttachmentList(attachments.getOrDefault(row.getRecycleItemId(), List.of())));
|
||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 产品详情里配置产出回收物用的批量查询,一次返回该产品所有 SKU 的产出行
|
/// 产品所有 SKU 的产出行
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
||||||
@PostMapping("/yield/product/list")
|
@PostMapping("/yield/product/list")
|
||||||
public List<Map<String, Object>> yieldsByProduct(@RequestParam String storeId, @RequestParam String productId) {
|
public List<GaoRecycleProductYield> yieldsByProduct(@RequestParam String storeId, @RequestParam String productId) {
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
return mapper.yieldListByProduct(storeId, productId);
|
return yieldMapper.yieldListByProduct(storeId, productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
||||||
@PostMapping("/yield/save")
|
@PostMapping("/yield/save")
|
||||||
public void saveYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId, @RequestParam BigDecimal quantityPerBase) {
|
public void saveYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId, @RequestParam BigDecimal quantityPerBase) {
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
// 额度按三位小数记账,比例精度高于额度会让换算结果必然超出精度
|
var quantity = quantityPerBase;
|
||||||
TimiException.requiredTrue(0 < quantityPerBase.signum() && !(3 < quantityPerBase.stripTrailingZeros().scale())
|
TimiException.requiredTrue(quantity != null && 0 < quantity.signum() && !(3 < quantity.stripTrailingZeros().scale())
|
||||||
&& !(12 < quantityPerBase.precision() - quantityPerBase.scale()), "产物数量比例最多保留三位小数");
|
&& !(12 < quantity.precision() - quantity.scale()), "产物数量比例最多保留三位小数");
|
||||||
TimiException.requiredTrue(mapper.validYield(storeId, skuId, recycleItemId) == 1, "商品或回收物不属于当前门店");
|
TimiException.requiredTrue(yieldMapper.validYield(storeId, skuId, recycleItemId) == 1, "商品或回收物不属于当前门店");
|
||||||
mapper.saveYield(UUID.randomUUID().toString(), storeId, skuId, recycleItemId, quantityPerBase, Time.now());
|
yieldMapper.saveYield(UUID.randomUUID().toString(), storeId, skuId, recycleItemId, quantity, Time.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_EXCHANGE_CONFIG_MANAGE)
|
||||||
@PostMapping("/yield/delete")
|
@PostMapping("/yield/delete")
|
||||||
public void deleteYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId) {
|
public void deleteYield(@RequestParam String storeId, @RequestParam String skuId, @RequestParam String recycleItemId) {
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
mapper.deleteYield(storeId, skuId, recycleItemId, Time.now());
|
yieldMapper.deleteYield(storeId, skuId, recycleItemId, Time.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public List<Map<String, Object>> list(@RequestParam String storeId, @RequestParam String customerId) {
|
public List<GaoRecycleAccount> list(@RequestParam String storeId, @RequestParam String customerId) {
|
||||||
checkCustomer(storeId, customerId);
|
checkCustomer(storeId, customerId);
|
||||||
return mapper.listAccounts(storeId, customerId);
|
return mapper.listAccounts(storeId, customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 按客户分页返回额度,汇总按回收物分别计算,避免混加不同单位。
|
/// 按客户分页返回额度,汇总按回收物分别计算
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
||||||
@PostMapping("/customers")
|
@PostMapping("/customers")
|
||||||
public Map<String, Object> customers(@RequestParam String storeId, @RequestParam(required = false) String recycleItemId,
|
public GaoRecycleAccountCustomerPageResult customers(@RequestBody GaoRecycleAccountCustomerPage query) {
|
||||||
@RequestParam(required = false) String keyword, @RequestParam(required = false) List<String> customerIds, @RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "20") int limit) {
|
String storeId = query.getStoreId();
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
int safeOffset = Math.max(0, offset);
|
long limit = Math.max(1, Math.min(query.getLimit(), 100));
|
||||||
int safeLimit = Math.max(1, Math.min(limit, 100));
|
long offset = (long) Math.max(0, query.getIndex()) * limit;
|
||||||
List<String> ids = mapper.customerPage(storeId, recycleItemId, keyword, customerIds, safeOffset, safeLimit);
|
List<String> ids = mapper.customerPage(storeId, query.getRecycleItemId(), query.getKeyword(), query.getCustomerIds(), offset, limit);
|
||||||
List<Map<String, Object>> rows = new java.util.ArrayList<>();
|
List<GaoRecycleAccountCustomerView> rows = new ArrayList<>();
|
||||||
if (!ids.isEmpty()) {
|
if (!ids.isEmpty()) {
|
||||||
Map<String, GaoCustomer> customers = customerService.mapByIdList(ids);
|
Map<String, GaoCustomer> customers = customerService.mapByIdList(ids);
|
||||||
Map<String, List<Attachment>> photos = attachmentService.mapByBizIdList(Attachment.BizType.GAO_CUSTOMER, ids, GaoCustomer.AttachType.PHOTO.name());
|
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);
|
List<GaoRecycleAccount> accounts = mapper.customerAccounts(storeId, ids, query.getRecycleItemId());
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
GaoCustomer customer = customers.get(id);
|
GaoCustomer customer = customers.get(id);
|
||||||
if (customer == null) continue;
|
if (customer == null) continue;
|
||||||
customer.setAttachmentList(photos.getOrDefault(id, List.of()));
|
customer.setAttachmentList(photos.getOrDefault(id, List.of()));
|
||||||
rows.add(Map.of("customer", customer, "accounts", accounts.stream().filter(account -> id.equals(account.get("customerId"))).toList()));
|
GaoRecycleAccountCustomerView row = new GaoRecycleAccountCustomerView();
|
||||||
}
|
row.setCustomer(customer);
|
||||||
}
|
row.setAccounts(accounts.stream().filter(account -> id.equals(account.getCustomerId())).toList());
|
||||||
return Map.of("list", rows, "total", mapper.customerCount(storeId, recycleItemId, keyword, customerIds), "totals", mapper.accountTotals(storeId, keyword, customerIds));
|
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)
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
||||||
@PostMapping("/items")
|
@PostMapping("/items")
|
||||||
public List<Map<String, Object>> accountItems(@RequestParam String storeId) {
|
public List<GaoRecycleItem> accountItems(@RequestParam String storeId) {
|
||||||
scope.checkStoreId(storeId);
|
scope.checkStoreId(storeId);
|
||||||
List<Map<String, Object>> items = mapper.accountItems(storeId);
|
List<GaoRecycleItem> items = itemMapper.accountItems(storeId);
|
||||||
List<String> ids = items.stream().map(item -> (String) item.get("id")).filter(java.util.Objects::nonNull).toList();
|
List<String> ids = items.stream().map(GaoRecycleItem::getId).filter(Objects::nonNull).toList();
|
||||||
if (!ids.isEmpty()) {
|
if (!ids.isEmpty()) {
|
||||||
Map<String, List<Attachment>> attachments = attachmentService.mapByBizIdList(Attachment.BizType.GAO_RECYCLE_ITEM, ids);
|
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())));
|
items.forEach(item -> item.setAttachmentList(attachments.getOrDefault(item.getId(), List.of())));
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
private void checkCustomer(String storeId, String customerId) {
|
||||||
@PostMapping("/ledger")
|
scope.checkStoreId(storeId);
|
||||||
public List<Map<String, Object>> ledger(@RequestParam String storeId, @RequestParam String customerId) {
|
GaoCustomer customer = customerService.get(customerId);
|
||||||
checkCustomer(storeId, customerId);
|
TimiException.requiredTrue(customer != null && storeId.equals(customer.getStoreId()), "客户不属于当前门店");
|
||||||
return mapper.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()), "客户不属于当前门店");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.GaoRecycleItem;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
|
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchangeRule;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleConfigService;
|
import com.imyeyu.api.modules.gao.service.GaoRecycleConfigService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleItemRequest;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleItemRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeRuleRequest;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeRuleRequest;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
+1
-1
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeQueryService;
|
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeQueryService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeViewService;
|
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.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
+1
-1
@@ -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.entity.GaoRecycleExchange;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeWriteService;
|
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeWriteService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeViewService;
|
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.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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("/detail")
|
||||||
|
public GaoRecycleLedger detail(@RequestParam String id) {
|
||||||
|
GaoRecycleLedger ledger = service.detail(id);
|
||||||
|
TimiException.required(ledger, "回收物流水不存在");
|
||||||
|
scope.checkStoreId(ledger.getStoreId());
|
||||||
|
return ledger;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequireGaoPermission(GaoPermissionCode.RECYCLE_ACCOUNT_READ)
|
||||||
|
@PostMapping("/list")
|
||||||
|
public PageResult<GaoRecycleLedger> list(@RequestBody GaoRecycleLedgerPage page) {
|
||||||
|
TimiException.required(page, "请求不能为空");
|
||||||
|
scope.checkStoreId(page.getStoreId());
|
||||||
|
if (page.getCustomerId() != null && !page.getCustomerId().isBlank()) {
|
||||||
|
checkCustomer(page.getStoreId(), page.getCustomerId());
|
||||||
|
}
|
||||||
|
TimiException.requiredTrue(page.getIndex() >= 0 && page.getSize() > 0 && page.getSize() <= 100, "分页参数无效");
|
||||||
|
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()), "客户不属于当前门店");
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-2
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoRecyclePayment;
|
import com.imyeyu.api.modules.gao.entity.GaoRecyclePayment;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecyclePaymentService;
|
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 lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
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.RestController;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import com.imyeyu.api.bean.PermissionMatchMode;
|
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.modules.user.service.PermissionChecker;
|
||||||
import com.imyeyu.api.bean.ModuleCode;
|
import com.imyeyu.api.bean.ModuleCode;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -33,6 +33,10 @@ public class GaoRecyclePaymentController {
|
|||||||
@PostMapping("/create-and-verify")
|
@PostMapping("/create-and-verify")
|
||||||
public GaoRecyclePayment createAndVerify(@RequestBody GaoRecyclePaymentRequest request) { return service.createAndVerify(request); }
|
public GaoRecyclePayment createAndVerify(@RequestBody GaoRecyclePaymentRequest request) { return service.createAndVerify(request); }
|
||||||
|
|
||||||
|
@RequireGaoPermission(GaoPermissionCode.FUND_RECORD_READ)
|
||||||
|
@PostMapping("/detail")
|
||||||
|
public GaoRecyclePayment detail(@RequestParam String id) { return service.detail(id); }
|
||||||
|
|
||||||
@RequireGaoPermission(GaoPermissionCode.FUND_RECORD_READ)
|
@RequireGaoPermission(GaoPermissionCode.FUND_RECORD_READ)
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public List<GaoRecyclePayment> list(@RequestParam String orderId) { return service.list(orderId); }
|
public List<GaoRecyclePayment> list(@RequestParam String orderId) { return service.list(orderId); }
|
||||||
|
|||||||
@@ -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.annotation.RequireGaoPermission;
|
||||||
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleStatService;
|
import com.imyeyu.api.modules.gao.service.GaoRecycleStatService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleStatView;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeStatView;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeStatView;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
+13
-13
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoSalesOrderChartService;
|
import com.imyeyu.api.modules.gao.service.GaoSalesOrderChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderProductRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderProductRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderSkuRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderSkuRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatIntervalStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatIntervalStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCalendarStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCalendarStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderConsumptionDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderConsumptionDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPaymentStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPaymentStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderStatusStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderStatusStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderTypeStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderTypeStatView;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.entity.GaoSalesOrder;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoRecycleExchangeWriteService;
|
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.GaoSalesOrderService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoDirectProductOrderCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoDirectProductOrderCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductCustomerView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductCustomerView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentActionRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentActionRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentNoRefundRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentNoRefundRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentReceiveRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentReceiveRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRefundRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRefundRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCancelRequest;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCancelRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderUpdateRequest;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderUpdateRequest;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
import com.imyeyu.api.modules.user.service.UserService;
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
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.GaoPointChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreChartService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreChartService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
import com.imyeyu.java.bean.timi.TimiException;
|
||||||
import com.imyeyu.spring.annotation.AOPLog;
|
import com.imyeyu.spring.annotation.AOPLog;
|
||||||
import com.imyeyu.spring.annotation.RequestRateLimit;
|
import com.imyeyu.spring.annotation.RequestRateLimit;
|
||||||
|
|||||||
@@ -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.bean.GaoPermissionCode;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
|
import com.imyeyu.api.modules.gao.service.GaoStoreDiaryService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
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.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.UserLoginService;
|
import com.imyeyu.api.modules.user.service.UserLoginService;
|
||||||
import com.imyeyu.api.modules.user.service.UserService;
|
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.GaoStoreScopeService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoUserInviteService;
|
import com.imyeyu.api.modules.gao.service.GaoUserInviteService;
|
||||||
import com.imyeyu.api.modules.gao.service.GaoUserService;
|
import com.imyeyu.api.modules.gao.service.GaoUserService;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteCreateResponse;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteCreateResponse;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteRegisterData;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteRegisterData;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteRegisterRequest;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteRegisterRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteValidateRequest;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteValidateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoUserInviteValidateResponse;
|
import com.imyeyu.api.modules.gao.vo.user.GaoUserInviteValidateResponse;
|
||||||
import com.imyeyu.api.modules.user.entity.Role;
|
import com.imyeyu.api.modules.user.entity.Role;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.api.modules.user.service.AuthorizationScopeService;
|
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.api.modules.user.entity.User;
|
||||||
import com.imyeyu.spring.annotation.table.Transient;
|
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 lombok.Data;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/// 回收兑换操作记录
|
/// 回收兑换操作记录
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class GaoRecycleExchangeAction implements IDEntity<String>, Creatable {
|
||||||
public class GaoRecycleExchangeAction extends UUIDEntity {
|
|
||||||
|
@Id
|
||||||
|
@AutoUUID
|
||||||
|
private String id;
|
||||||
|
private Long createdAt;
|
||||||
|
|
||||||
/// 撤销后门店最终保留的回收物数量
|
/// 撤销后门店最终保留的回收物数量
|
||||||
private BigDecimal retainedRecycleQuantity;
|
private BigDecimal retainedRecycleQuantity;
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,27 @@
|
|||||||
package com.imyeyu.api.modules.gao.entity;
|
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.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.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/// 回收兑换规则
|
/// 回收兑换规则
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class GaoRecycleExchangeRule implements IDEntity<String>, Creatable, Updatable {
|
||||||
public class GaoRecycleExchangeRule extends UUIDEntity {
|
|
||||||
|
@Id
|
||||||
|
@AutoUUID
|
||||||
|
private String id;
|
||||||
|
private Long createdAt;
|
||||||
|
private Long updatedAt;
|
||||||
|
|
||||||
/// 兑换模板明细
|
/// 兑换模板明细
|
||||||
@Transient
|
@Transient
|
||||||
private List<GaoRecycleExchangeRuleItem> itemList;
|
private List<GaoRecycleExchangeRuleItem> itemList;
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
package com.imyeyu.api.modules.gao.entity;
|
package com.imyeyu.api.modules.gao.entity;
|
||||||
|
|
||||||
import lombok.Data;
|
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;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/// 回收兑换模板明细
|
/// 回收兑换模板明细
|
||||||
@Data
|
@Data
|
||||||
public class GaoRecycleExchangeRuleItem {
|
public class GaoRecycleExchangeRuleItem implements IDEntity<String>, Creatable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@AutoUUID
|
||||||
private String id;
|
private String id;
|
||||||
private String ruleId;
|
private String ruleId;
|
||||||
private String skuId;
|
private String skuId;
|
||||||
@@ -16,19 +23,27 @@ public class GaoRecycleExchangeRuleItem {
|
|||||||
private Integer sort;
|
private Integer sort;
|
||||||
private Long createdAt;
|
private Long createdAt;
|
||||||
/// 展示用产品名称
|
/// 展示用产品名称
|
||||||
|
@Transient
|
||||||
private String productName;
|
private String productName;
|
||||||
/// 展示用 SKU 名称
|
/// 展示用 SKU 名称
|
||||||
|
@Transient
|
||||||
private String skuName;
|
private String skuName;
|
||||||
/// 展示用规格摘要
|
/// 展示用规格摘要
|
||||||
|
@Transient
|
||||||
private String specSummary;
|
private String specSummary;
|
||||||
/// 展示用单位名称
|
/// 展示用单位名称
|
||||||
|
@Transient
|
||||||
private String unitName;
|
private String unitName;
|
||||||
/// 展示用 SKU 编码
|
/// 展示用 SKU 编码
|
||||||
|
@Transient
|
||||||
private String skuCode;
|
private String skuCode;
|
||||||
/// 展示用产品类型
|
/// 展示用产品类型
|
||||||
|
@Transient
|
||||||
private String productType;
|
private String productType;
|
||||||
/// true 为启用库存管理
|
/// true 为启用库存管理
|
||||||
|
@Transient
|
||||||
private Boolean stockEnabled;
|
private Boolean stockEnabled;
|
||||||
/// true 为允许小数数量
|
/// true 为允许小数数量
|
||||||
|
@Transient
|
||||||
private Boolean allowDecimalQuantity;
|
private Boolean allowDecimalQuantity;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
package com.imyeyu.api.modules.gao.entity;
|
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.api.modules.common.entity.Attachment;
|
||||||
import com.imyeyu.spring.annotation.table.Transient;
|
import com.imyeyu.spring.annotation.table.Transient;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/// 回收物类型
|
/// 回收物类型
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class GaoRecycleItem implements IDEntity<String>, Creatable, Updatable {
|
||||||
public class GaoRecycleItem extends UUIDEntity {
|
|
||||||
|
@Id
|
||||||
|
@AutoUUID
|
||||||
|
private String id;
|
||||||
|
private Long createdAt;
|
||||||
|
private Long updatedAt;
|
||||||
|
|
||||||
|
|
||||||
/// 状态
|
/// 状态
|
||||||
public enum Status {
|
public enum Status {
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.imyeyu.api.modules.gao.entity;
|
||||||
|
|
||||||
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
|
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 lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/// 回收物额度流水
|
||||||
|
@Data
|
||||||
|
public class GaoRecycleLedger implements IDEntity<String>, Creatable {
|
||||||
|
|
||||||
|
/// 流水业务类型;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;
|
||||||
|
@Transient
|
||||||
|
private User operator;
|
||||||
|
private String reason;
|
||||||
|
private Long createdAt;
|
||||||
|
@Transient
|
||||||
|
private GaoCustomer customer;
|
||||||
|
@Transient
|
||||||
|
private String customerName;
|
||||||
|
@Transient
|
||||||
|
private String customerCode;
|
||||||
|
@Transient
|
||||||
|
private String recycleName;
|
||||||
|
@Transient
|
||||||
|
private String recycleUnit;
|
||||||
|
}
|
||||||
@@ -51,6 +51,12 @@ public class GaoRecyclePayment extends UUIDEntity {
|
|||||||
private String recycleName;
|
private String recycleName;
|
||||||
@Transient
|
@Transient
|
||||||
private String recycleUnit;
|
private String recycleUnit;
|
||||||
|
/// 关联订单当前成交金额,单位分
|
||||||
|
@Transient
|
||||||
|
private Long salesOrderAmount;
|
||||||
|
/// 关联订单当前剩余待收金额,单位分
|
||||||
|
@Transient
|
||||||
|
private Long salesOrderUnpaidAmount;
|
||||||
@Transient
|
@Transient
|
||||||
private GaoCustomer customer;
|
private GaoCustomer customer;
|
||||||
@Transient
|
@Transient
|
||||||
|
|||||||
@@ -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
-1
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -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.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerFollowUpReminder;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateCustomerView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateCustomerView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseTextView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseTextView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerPackage;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
|
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillment;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
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;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPackageConfig;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointAccount;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -19,6 +19,13 @@ public interface GaoPointLedgerMapper extends BaseMapper<GaoPointLedger, String>
|
|||||||
/// @return 流水
|
/// @return 流水
|
||||||
GaoPointLedger selectByIdempotencyKey(@Param("idempotencyKey") String idempotencyKey);
|
GaoPointLedger selectByIdempotencyKey(@Param("idempotencyKey") String idempotencyKey);
|
||||||
|
|
||||||
|
/// 按流水 ID 和门店查询流水
|
||||||
|
///
|
||||||
|
/// @param storeId 门店 ID,可为空
|
||||||
|
/// @param id 流水 ID
|
||||||
|
/// @return 流水
|
||||||
|
GaoPointLedger selectByIdAndStoreId(@Param("storeId") String storeId, @Param("id") String id);
|
||||||
|
|
||||||
/// 查询触发来源产生的原始规则积分流水
|
/// 查询触发来源产生的原始规则积分流水
|
||||||
///
|
///
|
||||||
/// @param triggerSourceType 直接触发来源类型
|
/// @param triggerSourceType 直接触发来源类型
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointRedeemSku;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointRedemption;
|
import com.imyeyu.api.modules.gao.entity.GaoPointRedemption;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -21,6 +21,9 @@ public interface GaoPointRedemptionMapper extends BaseMapper<GaoPointRedemption,
|
|||||||
/// 按门店和 ID 查询兑换单
|
/// 按门店和 ID 查询兑换单
|
||||||
GaoPointRedemption selectByStoreIdAndId(@Param("storeId") String storeId, @Param("id") String id);
|
GaoPointRedemption selectByStoreIdAndId(@Param("storeId") String storeId, @Param("id") String id);
|
||||||
|
|
||||||
|
/// 按 ID 列表查询兑换单
|
||||||
|
List<GaoPointRedemption> selectByIdList(@Param("idList") List<String> idList);
|
||||||
|
|
||||||
/// 锁定兑换单
|
/// 锁定兑换单
|
||||||
GaoPointRedemption selectForUpdate(@Param("id") String id);
|
GaoPointRedemption selectForUpdate(@Param("id") String id);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductCategory;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProduct;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductStock;
|
import com.imyeyu.api.modules.gao.entity.GaoProductStock;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockProductView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockProductView;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
|
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordPage;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockRecordSkuSummaryView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockRecordSkuSummaryView;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,88 +1,38 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Insert;
|
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.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
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);
|
|
||||||
@Select("SELECT COUNT(*) FROM gao_product_sku s JOIN gao_recycle_item r ON r.store_id=s.store_id WHERE s.store_id=#{store} AND s.id=#{sku} AND r.id=#{item}")
|
|
||||||
int validYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item);
|
|
||||||
|
|
||||||
@Insert("INSERT INTO gao_recycle_product_yield (id,store_id,sku_id,recycle_item_id,quantity_per_base,created_at) VALUES (#{id},#{store},#{sku},#{item},#{quantity},#{now}) ON DUPLICATE KEY UPDATE quantity_per_base=VALUES(quantity_per_base),updated_at=VALUES(created_at),deleted_at=NULL")
|
List<GaoRecycleAccount> listAccounts(@Param("store") String store, @Param("customer") String customer);
|
||||||
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);
|
|
||||||
|
|
||||||
@Update("UPDATE gao_recycle_product_yield SET deleted_at=#{now}, updated_at=#{now} WHERE store_id=#{store} AND sku_id=#{sku} AND recycle_item_id=#{item} AND deleted_at IS NULL")
|
|
||||||
void deleteYield(@Param("store") String store, @Param("sku") String sku, @Param("item") String item, @Param("now") long now);
|
|
||||||
@Select("SELECT a.id, a.customer_id AS customerId, a.recycle_item_id AS recycleItemId, a.balance, a.reserved, " +
|
|
||||||
"i.name AS recycleName, i.unit_name AS recycleUnit, a.created_at AS createdAt, a.updated_at AS updatedAt " +
|
|
||||||
"FROM gao_recycle_account a LEFT JOIN gao_recycle_item i ON i.id = a.recycle_item_id " +
|
|
||||||
"WHERE a.store_id=#{store} AND a.customer_id=#{customer} AND a.deleted_at IS NULL ORDER BY a.recycle_item_id")
|
|
||||||
List<Map<String, Object>> listAccounts(@Param("store") String store, @Param("customer") String customer);
|
|
||||||
|
|
||||||
/// 按客户分页,筛选条件与汇总使用相同的有效账户范围。
|
/// 按客户分页,筛选条件与汇总使用相同的有效账户范围。
|
||||||
@Select("<script>SELECT a.customer_id FROM gao_recycle_account a JOIN gao_customer c ON c.id=a.customer_id AND c.store_id=a.store_id AND c.deleted_at IS NULL WHERE a.store_id=#{store} AND a.deleted_at IS NULL AND a.balance > 0 <if test='customers != null and !customers.isEmpty()'> AND a.customer_id IN <foreach collection='customers' item='customer' open='(' separator=',' close=')'>#{customer}</foreach> </if> <if test='keyword != null and keyword != ""'> AND (c.name LIKE CONCAT('%',#{keyword},'%') OR c.code LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_full LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_initial LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_mixed LIKE CONCAT('%',#{keyword},'%')) </if> <if test='item != null and item != ""'> AND a.recycle_item_id=#{item} </if> GROUP BY a.customer_id ORDER BY a.customer_id LIMIT #{limit} OFFSET #{offset}</script>")
|
List<String> customerPage(
|
||||||
List<String> customerPage(@Param("store") String store, @Param("item") String item, @Param("keyword") String keyword, @Param("customers") List<String> customers, @Param("offset") int offset, @Param("limit") int limit);
|
@Param("store") String store,
|
||||||
|
@Param("item") String item,
|
||||||
|
@Param("keyword") String keyword,
|
||||||
|
@Param("customers") List<String> customers,
|
||||||
|
@Param("offset") long offset,
|
||||||
|
@Param("limit") long limit
|
||||||
|
);
|
||||||
|
|
||||||
@Select("<script>SELECT COUNT(DISTINCT a.customer_id) FROM gao_recycle_account a JOIN gao_customer c ON c.id=a.customer_id AND c.store_id=a.store_id AND c.deleted_at IS NULL WHERE a.store_id=#{store} AND a.deleted_at IS NULL AND a.balance > 0 <if test='customers != null and !customers.isEmpty()'> AND a.customer_id IN <foreach collection='customers' item='customer' open='(' separator=',' close=')'>#{customer}</foreach> </if> <if test='keyword != null and keyword != ""'> AND (c.name LIKE CONCAT('%',#{keyword},'%') OR c.code LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_full LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_initial LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_mixed LIKE CONCAT('%',#{keyword},'%')) </if> <if test='item != null and item != ""'> AND a.recycle_item_id=#{item} </if></script>")
|
|
||||||
long customerCount(@Param("store") String store, @Param("item") String item, @Param("keyword") String keyword, @Param("customers") List<String> customers);
|
long customerCount(@Param("store") String store, @Param("item") String item, @Param("keyword") String keyword, @Param("customers") List<String> customers);
|
||||||
|
|
||||||
@Select("<script>SELECT a.customer_id AS customerId, a.recycle_item_id AS recycleItemId, a.balance, a.reserved, i.name AS recycleName, i.unit_name AS recycleUnit FROM gao_recycle_account a LEFT JOIN gao_recycle_item i ON i.id=a.recycle_item_id AND i.store_id=a.store_id WHERE a.store_id=#{store} AND a.deleted_at IS NULL AND a.balance > 0 AND a.customer_id IN <foreach collection='customers' item='customer' open='(' separator=',' close=')'>#{customer}</foreach> <if test='item != null and item != ""'> AND a.recycle_item_id=#{item} </if> ORDER BY a.recycle_item_id</script>")
|
List<GaoRecycleAccount> customerAccounts(@Param("store") String store, @Param("customers") List<String> customers, @Param("item") String item);
|
||||||
List<Map<String, Object>> customerAccounts(@Param("store") String store, @Param("customers") List<String> customers, @Param("item") String item);
|
|
||||||
|
|
||||||
@Select("<script>SELECT a.recycle_item_id AS recycleItemId, i.name AS recycleName, i.unit_name AS recycleUnit, SUM(a.balance) AS balance, SUM(a.reserved) AS reserved FROM gao_recycle_account a JOIN gao_customer c ON c.id=a.customer_id AND c.store_id=a.store_id AND c.deleted_at IS NULL LEFT JOIN gao_recycle_item i ON i.id=a.recycle_item_id AND i.store_id=a.store_id WHERE a.store_id=#{store} AND a.deleted_at IS NULL AND a.balance > 0 <if test='customers != null and !customers.isEmpty()'> AND a.customer_id IN <foreach collection='customers' item='customer' open='(' separator=',' close=')'>#{customer}</foreach> </if> <if test='keyword != null and keyword != ""'> AND (c.name LIKE CONCAT('%',#{keyword},'%') OR c.code LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_full LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_initial LIKE CONCAT('%',#{keyword},'%') OR c.name_pinyin_mixed LIKE CONCAT('%',#{keyword},'%')) </if> GROUP BY a.recycle_item_id, i.name, i.unit_name ORDER BY i.name, a.recycle_item_id</script>")
|
List<GaoRecycleAccount> accountTotals(@Param("store") String store, @Param("keyword") String keyword, @Param("customers") List<String> customers);
|
||||||
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);
|
|
||||||
|
|
||||||
@Select("SELECT id, account_id AS accountId, store_id AS storeId, customer_id AS customerId, recycle_item_id AS recycleItemId, " +
|
|
||||||
"biz_type AS bizType, biz_id AS bizId, request_no AS requestNo, balance_delta AS balanceDelta, reserved_delta AS reservedDelta, " +
|
|
||||||
"balance_after AS balanceAfter, reserved_after AS reservedAfter, operator_user_id AS operatorUserId, reason, created_at AS createdAt " +
|
|
||||||
"FROM gao_recycle_ledger WHERE store_id=#{store} AND customer_id=#{customer} ORDER BY created_at DESC LIMIT 100")
|
|
||||||
List<Map<String, Object>> listLedger(@Param("store") String store, @Param("customer") String customer);
|
|
||||||
@Select("SELECT recycle_item_id,quantity_per_base FROM gao_recycle_product_yield WHERE store_id=#{store} AND sku_id=#{sku} AND deleted_at IS NULL ORDER BY recycle_item_id")
|
|
||||||
List<Map<String, Object>> yields(@Param("store") String store, @Param("sku") String sku);
|
|
||||||
|
|
||||||
/// 配置页需要的字段用驼峰返回,同时带上回收物名称与单位
|
|
||||||
@Select("SELECT y.recycle_item_id AS recycleItemId, y.quantity_per_base AS quantityPerBase, " +
|
|
||||||
"i.name AS recycleName, i.unit_name AS recycleUnit, i.allow_decimal_quantity AS allowDecimalQuantity " +
|
|
||||||
"FROM gao_recycle_product_yield y LEFT JOIN gao_recycle_item i ON i.id = y.recycle_item_id " +
|
|
||||||
"WHERE y.store_id=#{store} AND y.sku_id=#{sku} AND y.deleted_at IS NULL ORDER BY y.recycle_item_id")
|
|
||||||
List<Map<String, Object>> yieldList(@Param("store") String store, @Param("sku") String sku);
|
|
||||||
|
|
||||||
/// 产品维度的产出配置:一个产品下所有 SKU 的产出行,按 SKU 排序返回
|
|
||||||
@Select("SELECT y.sku_id AS skuId, y.recycle_item_id AS recycleItemId, y.quantity_per_base AS quantityPerBase, " +
|
|
||||||
"i.name AS recycleName, i.unit_name AS recycleUnit, s.name AS skuName, s.spec_summary AS skuSpecSummary " +
|
|
||||||
"FROM gao_recycle_product_yield y " +
|
|
||||||
"JOIN gao_product_sku s ON s.id = y.sku_id AND s.deleted_at IS NULL " +
|
|
||||||
"LEFT JOIN gao_recycle_item i ON i.id = y.recycle_item_id " +
|
|
||||||
"WHERE y.store_id=#{store} AND s.product_id=#{product} AND y.deleted_at IS NULL " +
|
|
||||||
"ORDER BY s.sort, s.name, y.recycle_item_id")
|
|
||||||
List<Map<String, Object>> yieldListByProduct(@Param("store") String store, @Param("product") String product);
|
|
||||||
|
|
||||||
@Select("SELECT recycle_item_id,balance_delta FROM gao_recycle_ledger WHERE biz_type='FULFILLMENT_YIELD' AND biz_id=#{biz} ORDER BY recycle_item_id")
|
|
||||||
List<Map<String, Object>> yieldsByFulfillment(@Param("biz") String biz);
|
|
||||||
@Insert("INSERT IGNORE INTO gao_recycle_account (id,store_id,customer_id,recycle_item_id,balance,reserved,created_at) VALUES (#{id},#{store},#{customer},#{item},0,0,#{now})")
|
|
||||||
void ensure(@Param("id") String id, @Param("store") String store, @Param("customer") String customer, @Param("item") String item, @Param("now") long now);
|
void ensure(@Param("id") String id, @Param("store") String store, @Param("customer") String customer, @Param("item") String item, @Param("now") long now);
|
||||||
|
|
||||||
@Select("SELECT id,balance,reserved FROM gao_recycle_account WHERE store_id=#{store} AND customer_id=#{customer} AND recycle_item_id=#{item} FOR UPDATE")
|
|
||||||
Map<String, Object> lock(@Param("store") String store, @Param("customer") String customer, @Param("item") String item);
|
Map<String, Object> lock(@Param("store") String store, @Param("customer") String customer, @Param("item") String item);
|
||||||
|
|
||||||
@Select("SELECT customer_id,recycle_item_id,biz_type,biz_id,balance_delta,reserved_delta,reason FROM gao_recycle_ledger WHERE store_id=#{store} AND request_no=#{request} FOR UPDATE")
|
|
||||||
Map<String, Object> findRequest(@Param("store") String store, @Param("request") String request);
|
|
||||||
|
|
||||||
@Update("UPDATE gao_recycle_account SET balance=balance+#{balance},reserved=reserved+#{reserved},updated_at=#{now} WHERE id=#{id} AND balance+#{balance} >= 0 AND reserved+#{reserved} >= 0 AND reserved+#{reserved} <= balance+#{balance}")
|
|
||||||
int change(@Param("id") String id, @Param("balance") BigDecimal balance, @Param("reserved") BigDecimal reserved, @Param("now") long now);
|
int change(@Param("id") String id, @Param("balance") BigDecimal balance, @Param("reserved") BigDecimal reserved, @Param("now") long now);
|
||||||
|
|
||||||
@Insert("INSERT INTO gao_recycle_ledger (id,account_id,store_id,customer_id,recycle_item_id,biz_type,biz_id,request_no,balance_delta,reserved_delta,balance_after,reserved_after,operator_user_id,reason,created_at) SELECT #{id},id,store_id,customer_id,recycle_item_id,#{type},#{biz},#{request},#{balance},#{reserved},balance,reserved,#{operator},#{reason},#{now} FROM gao_recycle_account WHERE id=#{account}")
|
|
||||||
void ledger(@Param("id") String id, @Param("account") String account, @Param("type") String type, @Param("biz") String biz, @Param("request") String request, @Param("balance") BigDecimal balance, @Param("reserved") BigDecimal reserved, @Param("operator") String operator, @Param("reason") String reason, @Param("now") long now);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,170 +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.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
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 模板明细
|
|
||||||
@Select("<script>SELECT * FROM gao_recycle_exchange_rule_item WHERE rule_id IN <foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach> ORDER BY sort, id</script>")
|
|
||||||
List<GaoRecycleExchangeRuleItem> ruleItemsByIds(@Param("ids") Collection<String> ids);
|
|
||||||
|
|
||||||
/// 新增模板明细
|
|
||||||
/// @param item 模板明细
|
|
||||||
@Insert("INSERT INTO gao_recycle_exchange_rule_item (id,rule_id,sku_id,sku_unit_id,exchange_quantity,sort,created_at) VALUES (#{id},#{ruleId},#{skuId},#{skuUnitId},#{exchangeQuantity},#{sort},#{createdAt})")
|
|
||||||
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 回收物结果
|
|
||||||
@Select("SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} "
|
|
||||||
+ "AND (#{status} IS NULL OR status = #{status}) "
|
|
||||||
+ "AND (#{keyword} IS NULL OR name LIKE CONCAT('%', #{keyword}, '%')) "
|
|
||||||
+ "ORDER BY created_at DESC LIMIT #{offset}, #{limit}")
|
|
||||||
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 统计回收物结果
|
|
||||||
@Select("SELECT COUNT(*) FROM gao_recycle_item WHERE store_id = #{storeId} "
|
|
||||||
+ "AND (#{status} IS NULL OR status = #{status}) "
|
|
||||||
+ "AND (#{keyword} IS NULL OR name LIKE CONCAT('%', #{keyword}, '%'))")
|
|
||||||
long countItems(@Param("storeId") String storeId, @Param("status") String status, @Param("keyword") String keyword);
|
|
||||||
|
|
||||||
/// 按 ID 批量查询回收物
|
|
||||||
///
|
|
||||||
/// @param storeId 门店 ID
|
|
||||||
/// @param idList 回收物 ID 列表
|
|
||||||
/// @return 回收物结果
|
|
||||||
@Select("<script>SELECT * FROM gao_recycle_item WHERE store_id = #{storeId} AND id IN "
|
|
||||||
+ "<foreach collection='idList' item='id' open='(' separator=',' close=')'>#{id}</foreach></script>")
|
|
||||||
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 回收物
|
|
||||||
@Insert("INSERT INTO gao_recycle_item (id, store_id, name, unit_name, allow_decimal_quantity, status, remark, created_at) VALUES (#{id}, #{storeId}, #{name}, #{unitName}, #{allowDecimalQuantity}, #{status}, #{remark}, #{createdAt})")
|
|
||||||
void insertItem(GaoRecycleItem item);
|
|
||||||
|
|
||||||
/// 更新回收物
|
|
||||||
///
|
|
||||||
/// @param item 回收物
|
|
||||||
@Update("UPDATE gao_recycle_item SET name=#{name}, unit_name=#{unitName}, allow_decimal_quantity=#{allowDecimalQuantity}, status=#{status}, remark=#{remark}, updated_at=#{updatedAt} WHERE store_id=#{storeId} AND id=#{id}")
|
|
||||||
void updateItem(GaoRecycleItem item);
|
|
||||||
|
|
||||||
/// 分页查询兑换规则
|
|
||||||
///
|
|
||||||
/// @param storeId 门店 ID
|
|
||||||
/// @param status 规则状态,为空不过滤
|
|
||||||
/// @param recycleItemId 回收物 ID,为空不过滤
|
|
||||||
/// @param skuId 兑换 SKU ID,为空不过滤
|
|
||||||
/// @param keyword 回收物名称关键字,为空不过滤
|
|
||||||
/// @param offset 分页偏移量
|
|
||||||
/// @param limit 分页数量
|
|
||||||
/// @return 兑换规则结果
|
|
||||||
@Select("SELECT rule.* FROM gao_recycle_exchange_rule rule WHERE rule.store_id = #{storeId} "
|
|
||||||
+ "AND (#{status} IS NULL OR rule.status = #{status}) "
|
|
||||||
+ "AND (#{recycleItemId} IS NULL OR rule.recycle_item_id = #{recycleItemId}) "
|
|
||||||
+ "AND (#{skuId} IS NULL OR EXISTS (SELECT 1 FROM gao_recycle_exchange_rule_item ri WHERE ri.rule_id=rule.id AND ri.sku_id=#{skuId})) "
|
|
||||||
+ "AND (#{keyword} IS NULL OR EXISTS (SELECT 1 FROM gao_recycle_item item WHERE item.id = rule.recycle_item_id AND item.name LIKE CONCAT('%', #{keyword}, '%'))) "
|
|
||||||
+ "ORDER BY rule.sort, rule.created_at DESC LIMIT #{offset}, #{limit}")
|
|
||||||
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 统计兑换规则结果
|
|
||||||
@Select("SELECT COUNT(*) FROM gao_recycle_exchange_rule rule WHERE rule.store_id = #{storeId} "
|
|
||||||
+ "AND (#{status} IS NULL OR rule.status = #{status}) "
|
|
||||||
+ "AND (#{recycleItemId} IS NULL OR rule.recycle_item_id = #{recycleItemId}) "
|
|
||||||
+ "AND (#{skuId} IS NULL OR EXISTS (SELECT 1 FROM gao_recycle_exchange_rule_item ri WHERE ri.rule_id=rule.id AND ri.sku_id=#{skuId})) "
|
|
||||||
+ "AND (#{keyword} IS NULL OR EXISTS (SELECT 1 FROM gao_recycle_item item WHERE item.id = rule.recycle_item_id AND item.name LIKE CONCAT('%', #{keyword}, '%')))")
|
|
||||||
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 兑换规则
|
|
||||||
@Insert("INSERT INTO gao_recycle_exchange_rule (id, store_id, recycle_item_id, recycle_quantity, status, sort, remark, created_at) VALUES (#{id}, #{storeId}, #{recycleItemId}, #{recycleQuantity}, #{status}, #{sort}, #{remark}, #{createdAt})")
|
|
||||||
void insertRule(GaoRecycleExchangeRule rule);
|
|
||||||
|
|
||||||
/// 更新兑换规则
|
|
||||||
///
|
|
||||||
/// @param rule 兑换规则
|
|
||||||
@Update("UPDATE gao_recycle_exchange_rule SET recycle_item_id=#{recycleItemId}, recycle_quantity=#{recycleQuantity}, status=#{status}, sort=#{sort}, remark=#{remark}, updated_at=#{updatedAt} WHERE store_id=#{storeId} AND id=#{id}")
|
|
||||||
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);
|
||||||
|
}
|
||||||
+6
-13
@@ -1,18 +1,15 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoRecycleExchange;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
|
|
||||||
/// 回收兑换写入查询
|
/// 回收兑换写入查询
|
||||||
public interface GaoRecycleExchangeWriteMapper extends BaseMapper<GaoRecycleExchange, String> {
|
public interface GaoRecycleExchangeMapper extends BaseMapper<GaoRecycleExchange, String> {
|
||||||
@Update("UPDATE gao_recycle_exchange SET status=#{status}, updated_at=#{updatedAt} WHERE sales_order_id=#{orderId} AND status IN ('PENDING','COMPLETED')")
|
|
||||||
int updateByOrderStatus(@Param("orderId") String orderId, @Param("status") String status, @Param("updatedAt") long updatedAt);
|
int updateByOrderStatus(@Param("orderId") String orderId, @Param("status") String status, @Param("updatedAt") long updatedAt);
|
||||||
|
|
||||||
@Select("SELECT id FROM gao_store WHERE id = #{id} FOR UPDATE")
|
@Select("SELECT id FROM gao_store WHERE id = #{id} FOR UPDATE")
|
||||||
String lockStore(String id);
|
String lockStore(String id);
|
||||||
|
|
||||||
@@ -30,20 +27,16 @@ public interface GaoRecycleExchangeWriteMapper extends BaseMapper<GaoRecycleExch
|
|||||||
///
|
///
|
||||||
/// @param orderId 销售订单 ID
|
/// @param orderId 销售订单 ID
|
||||||
/// @return 兑换单,只填 ID 与回收物名称、单位快照
|
/// @return 兑换单,只填 ID 与回收物名称、单位快照
|
||||||
@Select("SELECT id, recycle_name_snapshot, recycle_unit_snapshot FROM gao_recycle_exchange WHERE sales_order_id=#{orderId} LIMIT 1")
|
|
||||||
GaoRecycleExchange snapshotByOrderId(@Param("orderId") String orderId);
|
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);
|
|
||||||
|
|
||||||
@Insert("INSERT INTO gao_recycle_exchange_action (id,store_id,exchange_id,request_no,request_fingerprint,action_type,operator_user_id,occurred_at,created_at,reason,remark,retained_recycle_quantity) VALUES (#{id},#{storeId},#{exchangeId},#{requestNo},#{requestFingerprint},#{actionType},#{operatorUserId},#{occurredAt},#{createdAt},#{reason},#{remark},#{retainedRecycleQuantity})")
|
|
||||||
void insertAction(GaoRecycleExchangeAction action);
|
|
||||||
|
|
||||||
/// 撤销兑换单。待领取和已完成都允许撤销,撤销后不能再领取
|
/// 撤销兑换单。待领取和已完成都允许撤销,撤销后不能再领取
|
||||||
///
|
///
|
||||||
/// @param id 兑换单 ID
|
/// @param id 兑换单 ID
|
||||||
/// @param updatedAt 更新时间
|
/// @param updatedAt 更新时间
|
||||||
/// @return 影响行数
|
/// @return 影响行数
|
||||||
@Update("UPDATE gao_recycle_exchange SET status = 'CANCELLED', updated_at = #{updatedAt} WHERE id = #{id} AND status IN ('PENDING', 'COMPLETED')")
|
|
||||||
int cancel(@Param("id") String id, @Param("updatedAt") long updatedAt);
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/// 回收物额度流水 Mapper
|
||||||
|
public interface GaoRecycleLedgerMapper extends BaseMapper<GaoRecycleLedger, String> {
|
||||||
|
|
||||||
|
GaoRecycleLedger detail(@Param("id") String id);
|
||||||
|
|
||||||
|
long countByQuery(GaoRecycleLedgerPage page);
|
||||||
|
|
||||||
|
List<GaoRecycleLedger> selectByQuery(GaoRecycleLedgerPage page);
|
||||||
|
|
||||||
|
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") BizType type,
|
||||||
|
@Param("biz") String biz,
|
||||||
|
@Param("request") String request,
|
||||||
|
@Param("balance") BigDecimal balance,
|
||||||
|
@Param("reserved") BigDecimal reserved,
|
||||||
|
@Param("operator") String operator,
|
||||||
|
@Param("reason") String reason,
|
||||||
|
@Param("now") long now
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,38 +4,46 @@ import com.imyeyu.api.modules.gao.entity.GaoRecyclePayment;
|
|||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/// 回收物支付查询
|
/// 回收物支付查询
|
||||||
public interface GaoRecyclePaymentMapper extends BaseMapper<GaoRecyclePayment, String> {
|
public interface GaoRecyclePaymentMapper extends BaseMapper<GaoRecyclePayment, String> {
|
||||||
|
|
||||||
@Select("SELECT * FROM gao_recycle_payment WHERE id=#{id} FOR UPDATE")
|
@Select("SELECT * FROM gao_recycle_payment WHERE id=#{id} FOR UPDATE")
|
||||||
GaoRecyclePayment lock(@Param("id") String id);
|
GaoRecyclePayment lock(@Param("id") String id);
|
||||||
|
|
||||||
@Select("SELECT * FROM gao_recycle_payment WHERE id=#{id}")
|
@Select("SELECT * FROM gao_recycle_payment WHERE id=#{id}")
|
||||||
GaoRecyclePayment byId(@Param("id") String id);
|
GaoRecyclePayment byId(@Param("id") String id);
|
||||||
|
|
||||||
@Select("SELECT * FROM gao_recycle_payment WHERE store_id=#{storeId} AND request_no=#{requestNo}")
|
@Select("SELECT * FROM gao_recycle_payment WHERE store_id=#{storeId} AND request_no=#{requestNo}")
|
||||||
GaoRecyclePayment byRequest(@Param("storeId") String storeId, @Param("requestNo") String requestNo);
|
GaoRecyclePayment byRequest(@Param("storeId") String storeId, @Param("requestNo") String requestNo);
|
||||||
@Select("SELECT COALESCE(SUM(quantity),0) FROM gao_recycle_payment WHERE order_id=#{orderId} AND status IN ('PENDING','VERIFIED') AND source_payment_id IS NULL")
|
|
||||||
BigDecimal occupied(@Param("orderId") String orderId);
|
BigDecimal occupied(@Param("orderId") String orderId);
|
||||||
@Select("SELECT COALESCE(SUM(quantity),0) FROM gao_recycle_payment WHERE order_id=#{orderId} AND status='VERIFIED' AND source_payment_id IS NULL")
|
|
||||||
BigDecimal paid(@Param("orderId") String orderId);
|
BigDecimal paid(@Param("orderId") String orderId);
|
||||||
|
|
||||||
@Select("SELECT * FROM gao_recycle_payment WHERE order_id=#{orderId} ORDER BY created_at, id")
|
@Select("SELECT * FROM gao_recycle_payment WHERE order_id=#{orderId} ORDER BY created_at, id")
|
||||||
List<GaoRecyclePayment> list(@Param("orderId") String orderId);
|
List<GaoRecyclePayment> list(@Param("orderId") String orderId);
|
||||||
@Select({"<script>",
|
|
||||||
"SELECT p.*, e.id AS recycleExchangeId, e.recycle_name_snapshot AS recycleName, e.recycle_unit_snapshot AS recycleUnit",
|
List<GaoRecyclePayment> search(
|
||||||
"FROM gao_recycle_payment p LEFT JOIN gao_recycle_exchange e ON e.sales_order_id = p.order_id WHERE 1=1",
|
@Param("storeId") String storeId,
|
||||||
"<if test='storeId != null'> AND p.store_id = #{storeId}</if>",
|
@Param("customerId") String customerId,
|
||||||
"<if test='customerId != null and customerId != ""'> AND p.customer_id = #{customerId}</if>",
|
@Param("orderId") String orderId,
|
||||||
"<if test='orderId != null and orderId != ""'> AND p.order_id = #{orderId}</if>",
|
@Param("status") String status,
|
||||||
"<if test='status != null and status != ""'> AND p.status = #{status}</if>",
|
@Param("beginAt") Long beginAt,
|
||||||
"<if test='beginAt != null'> AND p.occurred_at >= #{beginAt}</if>",
|
@Param("endAt") Long endAt,
|
||||||
"<if test='endAt != null'> AND p.occurred_at <= #{endAt}</if>",
|
@Param("offset") int offset,
|
||||||
"ORDER BY p.occurred_at DESC, p.created_at DESC, p.id DESC LIMIT #{offset}, #{limit}",
|
@Param("limit") int limit
|
||||||
"</script>"})
|
);
|
||||||
List<GaoRecyclePayment> search(@Param("storeId") String storeId, @Param("customerId") String customerId, @Param("orderId") String orderId,
|
|
||||||
@Param("status") String status, @Param("beginAt") Long beginAt, @Param("endAt") Long endAt,
|
int status(
|
||||||
@Param("offset") int offset, @Param("limit") int limit);
|
@Param("id") String id,
|
||||||
@Update("UPDATE gao_recycle_payment SET status=#{status}, verifier_user_id=#{user}, verified_at=#{time}, reason=#{reason}, updated_at=#{time} WHERE id=#{id} AND status=#{expected}")
|
@Param("expected") GaoRecyclePayment.Status expected,
|
||||||
int status(@Param("id") String id, @Param("expected") GaoRecyclePayment.Status expected, @Param("status") GaoRecyclePayment.Status status, @Param("user") String user, @Param("time") long time, @Param("reason") String reason);
|
@Param("status") GaoRecyclePayment.Status status,
|
||||||
|
@Param("user") String user,
|
||||||
|
@Param("time") long time,
|
||||||
|
@Param("reason") String reason
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/// 回收实物流转查询
|
/// 回收实物流转查询
|
||||||
public interface GaoRecyclePhysicalMapper {
|
public interface GaoRecyclePhysicalMapper {
|
||||||
@Select("SELECT COALESCE(SUM(CASE WHEN direction='IN' THEN quantity ELSE -quantity END),0) FROM gao_recycle_physical_record WHERE order_id=#{orderId}")
|
|
||||||
BigDecimal balance(@Param("orderId") String orderId);
|
BigDecimal balance(@Param("orderId") String orderId);
|
||||||
|
|
||||||
@Select("SELECT COALESCE(SUM(CASE WHEN direction='IN' THEN quantity ELSE -quantity END),0) FROM gao_recycle_physical_record WHERE order_id=#{orderId} AND payment_id=#{paymentId}")
|
|
||||||
BigDecimal paymentBalance(@Param("orderId") String orderId, @Param("paymentId") String paymentId);
|
BigDecimal paymentBalance(@Param("orderId") String orderId, @Param("paymentId") String paymentId);
|
||||||
|
|
||||||
@Insert("INSERT INTO gao_recycle_physical_record (id,store_id,customer_id,order_id,recycle_item_id,payment_id,source_type,source_id,direction,quantity,occurred_at,created_at) VALUES (#{id},#{storeId},#{customerId},#{orderId},#{itemId},#{paymentId},#{sourceType},#{sourceId},#{direction},#{quantity},#{occurredAt},#{createdAt})")
|
void insert(
|
||||||
void insert(@Param("id") String id, @Param("storeId") String storeId, @Param("customerId") String customerId,
|
@Param("id") String id,
|
||||||
@Param("orderId") String orderId, @Param("itemId") String itemId, @Param("paymentId") String paymentId, @Param("sourceType") String sourceType,
|
@Param("storeId") String storeId,
|
||||||
@Param("sourceId") String sourceId, @Param("direction") String direction, @Param("quantity") BigDecimal quantity,
|
@Param("customerId") String customerId,
|
||||||
@Param("occurredAt") long occurredAt, @Param("createdAt") long createdAt);
|
@Param("orderId") String orderId,
|
||||||
|
@Param("itemId") String itemId,
|
||||||
|
@Param("paymentId") String paymentId,
|
||||||
|
@Param("sourceType") String sourceType,
|
||||||
|
@Param("sourceId") String sourceId,
|
||||||
|
@Param("direction") String direction,
|
||||||
|
@Param("quantity") BigDecimal quantity,
|
||||||
|
@Param("occurredAt") long occurredAt,
|
||||||
|
@Param("createdAt") long createdAt
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,28 +1,27 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleStatView;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoRecycleExchangeStatView;
|
import com.imyeyu.api.modules.gao.vo.recycle.GaoRecycleExchangeStatView;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/// 回收统计 Mapper
|
/// 回收统计 Mapper
|
||||||
public interface GaoRecycleStatMapper {
|
public interface GaoRecycleStatMapper {
|
||||||
|
|
||||||
/// 按操作业务时间统计收到和退回数量
|
/// 按操作业务时间统计收到和退回数量
|
||||||
///
|
///
|
||||||
/// @param storeId 门店 ID
|
/// @param storeId 门店 ID
|
||||||
/// @param startAt 区间起点,包含
|
/// @param startAt 区间起点,包含
|
||||||
/// @param endAt 区间终点,不包含
|
/// @param endAt 区间终点,不包含
|
||||||
/// @return 回收统计
|
/// @return 回收统计
|
||||||
List<GaoRecycleStatView> selectRecycleStats(@Param("storeId") String storeId,
|
List<GaoRecycleStatView> selectRecycleStats(@Param("storeId") String storeId, @Param("startAt") long startAt, @Param("endAt") long endAt);
|
||||||
@Param("startAt") long startAt, @Param("endAt") long endAt);
|
|
||||||
|
|
||||||
/// 按业务时间统计兑换、核销和冲正数量
|
/// 按业务时间统计兑换、核销和冲正数量
|
||||||
///
|
///
|
||||||
/// @param storeId 门店 ID
|
/// @param storeId 门店 ID
|
||||||
/// @param startAt 区间起点,包含
|
/// @param startAt 区间起点,包含
|
||||||
/// @param endAt 区间终点,不包含
|
/// @param endAt 区间终点,不包含
|
||||||
/// @return 兑换统计
|
/// @return 兑换统计
|
||||||
List<GaoRecycleExchangeStatView> selectExchangeStats(@Param("storeId") String storeId,
|
List<GaoRecycleExchangeStatView> selectExchangeStats(@Param("storeId") String storeId, @Param("startAt") long startAt, @Param("endAt") long endAt);
|
||||||
@Param("startAt") long startAt, @Param("endAt") long endAt);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderProductRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderProductRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerOrderSkuRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerOrderSkuRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerRepeatIntervalStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerRepeatIntervalStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderChartReq;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderCalendarStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderCalendarStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderConsumptionDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderConsumptionDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPaymentStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPaymentStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderStatusStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderStatusStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderTypeStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderTypeStatView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductCustomerRow;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductCustomerRow;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerProductView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerProductView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderPage;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoSalesOrderReceivableStatView;
|
import com.imyeyu.api.modules.gao.vo.salesorder.GaoSalesOrderReceivableStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceRow;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceRow;
|
||||||
import com.imyeyu.spring.mapper.BaseMapper;
|
import com.imyeyu.spring.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.mapper;
|
package com.imyeyu.api.modules.gao.mapper;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.common.entity.Article;
|
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 com.imyeyu.spring.mapper.BaseMapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDiseaseWordView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDiseaseWordView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
|
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.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerConsumptionRecordPageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@ package com.imyeyu.api.modules.gao.service;
|
|||||||
|
|
||||||
import com.imyeyu.api.modules.common.entity.NotifyDetail;
|
import com.imyeyu.api.modules.common.entity.NotifyDetail;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerFollowUpReminder;
|
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.api.modules.gao.vo.GaoCustomerFollowUpReminderPageResult;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerFollowUpReminderPageResult;
|
||||||
import com.imyeyu.api.modules.user.entity.User;
|
import com.imyeyu.api.modules.user.entity.User;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerPackage;
|
import com.imyeyu.api.modules.gao.entity.GaoCustomerPackage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackageCancelRequest;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackageCancelRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPackagePurchaseRequest;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPackagePurchaseRequest;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
import com.imyeyu.api.modules.gao.entity.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerAgeStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerAgeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerDailyStateView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerDailyStateView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerGenderStatView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerGenderStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerPage;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerTrendStateReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerTrendStateReq;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
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.GaoCustomer;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
|
import com.imyeyu.api.modules.gao.entity.GaoEventRecord;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerChartReq;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventOptionStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventOptionStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerEventRankView;
|
import com.imyeyu.api.modules.gao.vo.customer.GaoCustomerEventRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordRankPage;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordRankPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordCalendarView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordCalendarView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoEventRecordNumberValueDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.event.GaoEventRecordNumberValueDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
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.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillment;
|
import com.imyeyu.api.modules.gao.entity.GaoOrderFulfillment;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentActionRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentActionRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPage;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentPrepareStockRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentPrepareStockRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentRevokeRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderFulfillmentReturnRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderFulfillmentReturnRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentCustomerRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentCustomerRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSkuView;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSkuView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderListRequest;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderListRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoQuickFulfillmentSourceOrderView;
|
import com.imyeyu.api.modules.gao.vo.fulfillment.GaoQuickFulfillmentSourceOrderView;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentActionRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentActionRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentNoRefundRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentNoRefundRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentReceiveRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentReceiveRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRefundRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRefundRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
|
import com.imyeyu.api.modules.gao.vo.order.GaoOrderPaymentRevokeRequest;
|
||||||
|
|
||||||
/// GAO 销售订单资金服务
|
/// GAO 销售订单资金服务
|
||||||
///
|
///
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
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 订单创建直通服务
|
/// 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.GaoPackageConfig;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPackageConfigItem;
|
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.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointAccount;
|
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.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionProductRankView;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionProductRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoStoreChartReq;
|
import com.imyeyu.api.modules.gao.vo.store.GaoStoreChartReq;
|
||||||
|
|
||||||
import java.util.List;
|
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.GaoPointLedger;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointRule;
|
import com.imyeyu.api.modules.gao.entity.GaoPointRule;
|
||||||
import com.imyeyu.api.modules.gao.script.GaoPointDecision;
|
import com.imyeyu.api.modules.gao.script.GaoPointDecision;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointAdjustRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointAdjustRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointLedgerPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointLedgerPage;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
@@ -97,6 +97,15 @@ public interface GaoPointLedgerService extends BaseService<GaoPointLedger, Strin
|
|||||||
/// @return 已存在流水
|
/// @return 已存在流水
|
||||||
List<GaoPointLedger> listByIdempotencyKeyList(List<String> idempotencyKeyList);
|
List<GaoPointLedger> listByIdempotencyKeyList(List<String> idempotencyKeyList);
|
||||||
|
|
||||||
|
/// 按流水 ID 查询积分流水
|
||||||
|
///
|
||||||
|
/// 流水详情页只认这一条:列表里裁掉的字段(规则快照、来源载荷等)由它补齐
|
||||||
|
///
|
||||||
|
/// @param storeId 门店 ID,可为空
|
||||||
|
/// @param id 流水 ID
|
||||||
|
/// @return 积分流水,不存在时返回 null
|
||||||
|
GaoPointLedger getByIdAndStoreId(String storeId, String id);
|
||||||
|
|
||||||
/// 分页查询积分流水
|
/// 分页查询积分流水
|
||||||
///
|
///
|
||||||
/// @param page 查询条件
|
/// @param page 查询条件
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointRedeemSku;
|
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.api.modules.gao.vo.GaoPointRedeemSkuPageResult;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuPageResult;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedeemSkuRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedeemSkuRequest;
|
||||||
|
|
||||||
/// GAO 积分兑换 SKU 配置服务
|
/// 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.GaoPointRedemption;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointRedemptionReturn;
|
import com.imyeyu.api.modules.gao.entity.GaoPointRedemptionReturn;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionCreateRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionCreateRequest;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionPage;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionPage;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoPointRedemptionReturnRequest;
|
import com.imyeyu.api.modules.gao.vo.point.GaoPointRedemptionReturnRequest;
|
||||||
import com.imyeyu.spring.bean.PageResult;
|
import com.imyeyu.spring.bean.PageResult;
|
||||||
|
|
||||||
import java.util.List;
|
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.GaoEventRecord;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
|
import com.imyeyu.api.modules.gao.entity.GaoPointLedger;
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
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 客户积分触发服务
|
/// GAO 客户积分触发服务
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProductCategory;
|
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.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductCategoryStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductCategoryStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductTypeStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductTypeStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductUnitSalesRankView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.entity.GaoProduct;
|
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.bean.PageResult;
|
||||||
import com.imyeyu.spring.service.BaseService;
|
import com.imyeyu.spring.service.BaseService;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.imyeyu.api.modules.gao.service;
|
package com.imyeyu.api.modules.gao.service;
|
||||||
|
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductChartReq;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductChartReq;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuFulfillmentRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuFulfillmentRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuSalesRankView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockHealthView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockHealthView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuStockMovementDailyStatView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuStockMovementDailyStatView;
|
||||||
import com.imyeyu.api.modules.gao.vo.GaoProductSkuUnitSalesRankView;
|
import com.imyeyu.api.modules.gao.vo.product.GaoProductSkuUnitSalesRankView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user