✨ 完善核销用户记录和毛利报表导出日志

This commit is contained in:
caojia
2026-10-19 16:43:14 +08:00
parent a754e8dcc6
commit 383ef55e00
14 changed files with 103 additions and 24 deletions
@@ -116,6 +116,7 @@ public class ArBalanceWriteoffServiceImpl implements IArBalanceWriteoffService {
}
String operator = SecurityUtils.getUsername();
Long operatorUserId = SecurityUtils.getUserId();
String requestId = IdUtils.fastSimpleUUID();
String currency = StringUtils.hasText(bill.getCurrency()) ? bill.getCurrency().trim().toUpperCase() : "CNY";
Date writeoffDate = cmd.getWriteoffDate() != null ? cmd.getWriteoffDate() : new Date();
@@ -133,6 +134,7 @@ public class ArBalanceWriteoffServiceImpl implements IArBalanceWriteoffService {
writeoff.setWriteoffDate(writeoffDate);
writeoff.setStatus(ArBalanceWriteoffStatus.EFFECTIVE.getCode());
writeoff.setRemark(StringUtils.hasText(cmd.getRemark()) ? cmd.getRemark().trim() : null);
writeoff.setCreateUserId(operatorUserId);
writeoff.setCreateBy(operator);
writeoffMapper.insertArBalanceWriteoff(writeoff);
@@ -177,6 +179,7 @@ public class ArBalanceWriteoffServiceImpl implements IArBalanceWriteoffService {
}
String operator = SecurityUtils.getUsername();
Long operatorUserId = SecurityUtils.getUserId();
String requestId = IdUtils.fastSimpleUUID();
String cancelRemark = StringUtils.hasText(remark) ? remark.trim() : "取消余额核销";
String fromStatus = bill.getStatus();
@@ -195,7 +198,7 @@ public class ArBalanceWriteoffServiceImpl implements IArBalanceWriteoffService {
}
// 3. 核销单置为CANCELLED(口径变更后无回补流水,reverse_flow_id 置空)
if (writeoffMapper.updateCancelled(writeoffId, null, operator, cancelRemark,
if (writeoffMapper.updateCancelled(writeoffId, null, operator, operatorUserId, cancelRemark,
ArBalanceWriteoffStatus.CANCELLED.getCode(), ArBalanceWriteoffStatus.EFFECTIVE.getCode()) != 1) {
throw new ServiceException("核销记录状态已变化,请刷新后重试");
}