Compare commits
44
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b373cbbe46 | ||
|
|
acd97c7b9b | ||
|
|
118bdb1666 | ||
|
|
944de228f7 | ||
|
|
25c9cd4dfc | ||
|
|
882cd226ec | ||
|
|
feb4d7af66 | ||
|
|
d75ab1ed5f | ||
|
|
a501eb7443 | ||
|
|
19941d9480 | ||
|
|
cd3d522d4f | ||
|
|
181c5078e9 | ||
|
|
e97f46e6b4 | ||
|
|
c0f89deb83 | ||
|
|
ce695463d3 | ||
|
|
83c683d473 | ||
|
|
9555474b0b | ||
|
|
a150f9e017 | ||
|
|
ecd2fa1c33 | ||
|
|
e3236d262d | ||
|
|
c8e2e16ba5 | ||
|
|
99b44faf09 | ||
|
|
b3e3cbf84b | ||
|
|
0aee11d824 | ||
|
|
fcf358a768 | ||
|
|
619369104c | ||
|
|
4f1408b9d0 | ||
|
|
029eea70cc | ||
|
|
22b1e65385 | ||
|
|
2170c48763 | ||
|
|
c2d1c48aae | ||
|
|
e14958c643 | ||
|
|
da288338cd | ||
|
|
ea430f2468 | ||
|
|
f76f79744a | ||
|
|
19daaff907 | ||
|
|
db94d8f932 | ||
|
|
53618fe362 | ||
|
|
523edffc4e | ||
|
|
c7ddb1a8b0 | ||
|
|
45c9fc814a | ||
|
|
407dc13ac4 | ||
|
|
0c06bf16c2 | ||
|
|
1db39e77d3 |
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||
<artifactId>TimiServerAPI</artifactId>
|
||||
<version>1.0.35</version>
|
||||
<version>1.0.33</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>TimiServerAPI</name>
|
||||
<description>imyeyu.com API</description>
|
||||
|
||||
+2
-29
@@ -1,12 +1,8 @@
|
||||
package com.imyeyu.api.modules.gao.controller;
|
||||
|
||||
import com.imyeyu.api.modules.common.entity.Attachment;
|
||||
import com.imyeyu.api.modules.common.service.AttachmentService;
|
||||
import com.imyeyu.api.modules.gao.annotation.RequireGaoPermission;
|
||||
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerConsumptionRecordService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoStoreScopeService;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
|
||||
@@ -19,9 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/// GAO 客户消费事实接口
|
||||
///
|
||||
/// @author Codex
|
||||
@@ -31,10 +24,8 @@ import java.util.Map;
|
||||
@RequestMapping("/gao/customer/consumption-record")
|
||||
public class GaoCustomerConsumptionRecordController {
|
||||
|
||||
private final AttachmentService attachmentService;
|
||||
private final GaoCustomerService customerService;
|
||||
private final GaoStoreScopeService storeScopeService;
|
||||
private final GaoCustomerConsumptionRecordService service;
|
||||
private final GaoStoreScopeService storeScopeService;
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@@ -43,24 +34,6 @@ public class GaoCustomerConsumptionRecordController {
|
||||
public GaoCustomerConsumptionRecordPageResult list(@RequestBody GaoCustomerConsumptionRecordPage page) {
|
||||
TimiException.required(page, "not found consumption record page");
|
||||
page.setStoreId(storeScopeService.resolveStoreId(page.getStoreId()));
|
||||
|
||||
GaoCustomerConsumptionRecordPageResult result = service.pageByQuery(page);
|
||||
List<String> customerIdList = result.getList()
|
||||
.stream()
|
||||
.map(GaoCustomerConsumptionRecord::getCustomerId)
|
||||
.filter(customerId -> customerId != null && !customerId.isBlank())
|
||||
.distinct()
|
||||
.toList();
|
||||
var customerMap = customerService.mapByIdList(customerIdList);
|
||||
Map<String, List<Attachment>> attachmentMap = attachmentService.mapByBizIdList(Attachment.BizType.GAO_CUSTOMER, customerIdList);
|
||||
for (GaoCustomerConsumptionRecord record : result.getList()) {
|
||||
var customer = customerMap.get(record.getCustomerId());
|
||||
if (customer == null) {
|
||||
continue;
|
||||
}
|
||||
customer.setAttachmentList(attachmentMap.getOrDefault(customer.getId(), List.of()));
|
||||
record.setCustomer(customer);
|
||||
}
|
||||
return result;
|
||||
return service.pageByQuery(page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.imyeyu.api.modules.gao.vo.GaoFundRecordPage;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoFundRevokeRequest;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
|
||||
import com.imyeyu.api.modules.user.entity.User;
|
||||
import com.imyeyu.api.modules.user.service.UserLoginService;
|
||||
import com.imyeyu.api.modules.user.service.UserService;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.spring.annotation.AOPLog;
|
||||
@@ -43,7 +42,6 @@ public class GaoFundRecordController {
|
||||
private final GaoStoreScopeService storeScopeService;
|
||||
private final AttachmentService attachmentService;
|
||||
private final UserService userService;
|
||||
private final UserLoginService userLoginService;
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@@ -68,33 +66,6 @@ public class GaoFundRecordController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@RequireGaoPermission(GaoPermissionCode.FUND_RECEIVE_CREATE)
|
||||
@PostMapping("/my-receive/list")
|
||||
public PageResult<GaoFundRecord> listMyReceive(@RequestBody GaoFundRecordPage page) {
|
||||
TimiException.required(page, "not found page");
|
||||
page.setStoreId(storeScopeService.resolveStoreId(page.getStoreId()));
|
||||
page.setOperatorUserId(userLoginService.getRequireLoginUserId());
|
||||
page.setOperationType(GaoFundRecord.OperationType.RECEIVE);
|
||||
PageResult<GaoFundRecord> result = service.pageByQuery(page);
|
||||
fillTransient(result.getList());
|
||||
return result;
|
||||
}
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@RequireGaoPermission(GaoPermissionCode.FUND_RECEIVE_CREATE)
|
||||
@PostMapping("/my-receive/detail")
|
||||
public GaoFundRecord detailMyReceive(@RequestParam String id) {
|
||||
GaoFundRecord result = service.detail(id);
|
||||
TimiException.requiredTrue(result.getOperationType() == GaoFundRecord.OperationType.RECEIVE, "not found fund receive record");
|
||||
TimiException.requiredTrue(userLoginService.getRequireLoginUserId().equals(result.getOperatorUserId()), "只能读取自己提交的收款");
|
||||
storeScopeService.checkStoreId(result.getStoreId());
|
||||
fillTransient(List.of(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@RequireGaoPermission(GaoPermissionCode.FUND_REVOKE)
|
||||
|
||||
@@ -2,7 +2,6 @@ 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.bean.PermissionMatchMode;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
||||
@@ -113,7 +112,7 @@ public class GaoSalesOrderController {
|
||||
|
||||
@AOPLog
|
||||
@RequestRateLimit
|
||||
@RequireGaoPermission(value = {GaoPermissionCode.FUND_RECEIVE_CREATE, GaoPermissionCode.FUND_RECORD_READ}, mode = PermissionMatchMode.ANY)
|
||||
@RequireGaoPermission(GaoPermissionCode.FUND_RECEIVE_CREATE)
|
||||
@PostMapping("/payment/cancel")
|
||||
public GaoFundRecord cancelPayment(@RequestBody GaoOrderPaymentActionRequest request) {
|
||||
return paymentService.cancel(request);
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface GaoOrderPaymentService {
|
||||
/// 拒绝收款
|
||||
GaoFundRecord reject(GaoOrderPaymentActionRequest request);
|
||||
|
||||
/// 撤销待核销收款
|
||||
/// 撤销自己提交的收款
|
||||
GaoFundRecord cancel(GaoOrderPaymentActionRequest request);
|
||||
|
||||
/// 登记退款
|
||||
|
||||
+7
-4
@@ -1,12 +1,11 @@
|
||||
package com.imyeyu.api.modules.gao.service.implement;
|
||||
|
||||
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
|
||||
import com.imyeyu.api.modules.common.service.AttachmentService;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||
import com.imyeyu.api.modules.gao.mapper.GaoCustomerConsumptionRecordMapper;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerConsumptionRecordService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoCustomerConsumptionRecordService;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPage;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoCustomerConsumptionRecordPageResult;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
@@ -29,7 +28,6 @@ public class GaoCustomerConsumptionRecordServiceImplement extends AbstractEntity
|
||||
|
||||
private final GaoCustomerConsumptionRecordMapper mapper;
|
||||
private final GaoCustomerService customerService;
|
||||
private final AttachmentService attachmentService;
|
||||
|
||||
@Override
|
||||
protected BaseMapper<GaoCustomerConsumptionRecord, String> mapper() {
|
||||
@@ -42,7 +40,12 @@ public class GaoCustomerConsumptionRecordServiceImplement extends AbstractEntity
|
||||
GaoCustomerConsumptionRecordPageResult result = new GaoCustomerConsumptionRecordPageResult();
|
||||
result.setTotal(mapper.countByQuery(page));
|
||||
result.setAmountTotal(mapper.sumAmountByPage(page));
|
||||
result.setList(mapper.selectByQuery(page));
|
||||
List<GaoCustomerConsumptionRecord> list = mapper.selectByQuery(page);
|
||||
result.setList(list);
|
||||
var customerMap = customerService.mapByIdList(list.stream().map(GaoCustomerConsumptionRecord::getCustomerId).toList());
|
||||
for (GaoCustomerConsumptionRecord record : list) {
|
||||
record.setCustomer(customerMap.get(record.getCustomerId()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -1,12 +1,10 @@
|
||||
package com.imyeyu.api.modules.gao.service.implement;
|
||||
|
||||
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
|
||||
import com.imyeyu.api.bean.ModuleCode;
|
||||
import com.imyeyu.api.modules.common.entity.Attachment;
|
||||
import com.imyeyu.api.modules.common.service.AttachmentService;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoFundRecord;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoSalesOrder;
|
||||
import com.imyeyu.api.modules.gao.bean.GaoPermissionCode;
|
||||
import com.imyeyu.api.modules.gao.service.GaoFundRecordService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoOrderPaymentService;
|
||||
import com.imyeyu.api.modules.gao.service.GaoPointTriggerService;
|
||||
@@ -19,7 +17,6 @@ import com.imyeyu.api.modules.gao.vo.GaoOrderPaymentRevokeRequest;
|
||||
import com.imyeyu.api.modules.system.entity.Logger;
|
||||
import com.imyeyu.api.modules.system.service.LoggerService;
|
||||
import com.imyeyu.api.modules.user.service.UserLoginService;
|
||||
import com.imyeyu.api.modules.user.service.PermissionChecker;
|
||||
import com.imyeyu.java.TimiJava;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.spring.service.AbstractEntityService;
|
||||
@@ -43,7 +40,6 @@ public class GaoOrderPaymentServiceImplement implements GaoOrderPaymentService {
|
||||
private final GaoPointTriggerService pointTriggerService;
|
||||
private final AttachmentService attachmentService;
|
||||
private final UserLoginService userLoginService;
|
||||
private final PermissionChecker permissionChecker;
|
||||
private final LoggerService loggerService;
|
||||
|
||||
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||
@@ -114,8 +110,7 @@ public class GaoOrderPaymentServiceImplement implements GaoOrderPaymentService {
|
||||
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||
@Override
|
||||
public GaoFundRecord cancel(GaoOrderPaymentActionRequest request) {
|
||||
boolean onlyOperator = !permissionChecker.hasAny(ModuleCode.GAO, GaoPermissionCode.FUND_RECORD_READ.getValue());
|
||||
return releasePending(request, GaoFundRecord.Status.CANCELLED, onlyOperator);
|
||||
return releasePending(request, GaoFundRecord.Status.CANCELLED, true);
|
||||
}
|
||||
|
||||
private GaoFundRecord releasePending(GaoOrderPaymentActionRequest request, GaoFundRecord.Status targetStatus, boolean onlyOperator) {
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class GaoPointTriggerServiceImplement implements GaoPointTriggerService {
|
||||
GaoPointScriptContext context = eventContext(rule, record);
|
||||
GroovyScriptExecutionResult<GaoPointDecision> execution = evaluate(rule, record.getStoreId(), record.getCustomerId(), record.getRegisteredAt(),
|
||||
GaoPointRule.TriggerRefType.EVENT.name(), record.getEventId());
|
||||
if (execution.result() == null) {
|
||||
if (execution == null) {
|
||||
continue;
|
||||
}
|
||||
pointDeltaTotal += applyDecision(rule, execution, GaoPointLedger.TriggerSourceType.EVENT_RECORD, record.getId(), null,
|
||||
|
||||
@@ -39,7 +39,4 @@ public class GaoFundRecordPage extends BasePage {
|
||||
|
||||
/// 操作结束时间
|
||||
private Long endAt;
|
||||
|
||||
/// 操作用户 ID,仅限服务端设置的数据范围条件
|
||||
private String operatorUserId;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
<if test="status != null">AND f.`status` = #{status}</if>
|
||||
<if test="beginAt != null">AND f.`occurred_at` >= #{beginAt}</if>
|
||||
<if test="endAt != null">AND f.`occurred_at` <= #{endAt}</if>
|
||||
<if test="operatorUserId != null and operatorUserId != ''">AND f.`operator_user_id` = #{operatorUserId}</if>
|
||||
</sql>
|
||||
<select id="countByQuery" resultType="long">
|
||||
SELECT COUNT(1) FROM `gao_fund_record` f WHERE <include refid="queryWhere"/>
|
||||
|
||||
Reference in New Issue
Block a user