v1.0.79 #91
@@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor;
|
||||
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 org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/// GAO 客户积分流水接口
|
||||
@@ -41,6 +42,14 @@ public class GaoPointLedgerController {
|
||||
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
|
||||
@RequestRateLimit
|
||||
@RequireGaoPermission(GaoPermissionCode.POINT_ADJUST)
|
||||
|
||||
@@ -19,6 +19,13 @@ public interface GaoPointLedgerMapper extends BaseMapper<GaoPointLedger, String>
|
||||
/// @return 流水
|
||||
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 直接触发来源类型
|
||||
|
||||
@@ -97,6 +97,15 @@ public interface GaoPointLedgerService extends BaseService<GaoPointLedger, Strin
|
||||
/// @return 已存在流水
|
||||
List<GaoPointLedger> listByIdempotencyKeyList(List<String> idempotencyKeyList);
|
||||
|
||||
/// 按流水 ID 查询积分流水
|
||||
///
|
||||
/// 流水详情页只认这一条:列表里裁掉的字段(规则快照、来源载荷等)由它补齐
|
||||
///
|
||||
/// @param storeId 门店 ID,可为空
|
||||
/// @param id 流水 ID
|
||||
/// @return 积分流水,不存在时返回 null
|
||||
GaoPointLedger getByIdAndStoreId(String storeId, String id);
|
||||
|
||||
/// 分页查询积分流水
|
||||
///
|
||||
/// @param page 查询条件
|
||||
|
||||
+10
@@ -174,6 +174,16 @@ public class GaoPointLedgerServiceImplement extends AbstractEntityService<GaoPoi
|
||||
return mapper.selectByIdempotencyKeyList(idempotencyKeyList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GaoPointLedger getByIdAndStoreId(String storeId, String id) {
|
||||
TimiException.required(id, "not found pointLedgerId");
|
||||
GaoPointLedger ledger = mapper.selectByIdAndStoreId(storeId, id);
|
||||
if (ledger != null) {
|
||||
fillCustomer(List.of(ledger));
|
||||
}
|
||||
return ledger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<GaoPointLedger> pageByQuery(GaoPointLedgerPage page) {
|
||||
TimiException.required(page, "not found page");
|
||||
|
||||
@@ -9,6 +9,17 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByIdAndStoreId" resultType="com.imyeyu.api.modules.gao.entity.GaoPointLedger">
|
||||
SELECT *
|
||||
FROM `gao_point_ledger`
|
||||
WHERE `id` = #{id}
|
||||
<if test="storeId != null and storeId != ''">
|
||||
AND `store_id` = #{storeId}
|
||||
</if>
|
||||
AND `deleted_at` IS NULL
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectRuleChangeByTriggerSource" resultType="com.imyeyu.api.modules.gao.entity.GaoPointLedger">
|
||||
SELECT *
|
||||
FROM `gao_point_ledger`
|
||||
|
||||
Reference in New Issue
Block a user