✨ 完善核销用户记录和毛利报表导出日志
This commit is contained in:
@@ -65,6 +65,12 @@ public class ArBalanceWriteoff extends BaseEntity
|
||||
/** 核销备注 */
|
||||
private String remark;
|
||||
|
||||
/** 执行核销的用户主键 */
|
||||
private Long createUserId;
|
||||
|
||||
/** 执行反核销的用户主键 */
|
||||
private Long cancelUserId;
|
||||
|
||||
/** 反核销人 */
|
||||
private String cancelBy;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ public interface ArBalanceWriteoffMapper
|
||||
int updateCancelled(@Param("writeoffId") Long writeoffId,
|
||||
@Param("reverseFlowId") Long reverseFlowId,
|
||||
@Param("cancelBy") String cancelBy,
|
||||
@Param("cancelUserId") Long cancelUserId,
|
||||
@Param("cancelRemark") String cancelRemark,
|
||||
@Param("status") String status,
|
||||
@Param("effectiveStatus") String effectiveStatus);
|
||||
|
||||
+4
-1
@@ -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("核销记录状态已变化,请刷新后重试");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user