|
|
@@ -998,13 +998,18 @@ public class AssetService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public void metaDestroyWithoutTradeCode(List<Long> ids, Long userId, OperationSource source) {
|
|
|
+ public void metaDestroyWithoutTradeCode(MetaDestroyParam metaDestroyParam, Long userId, OperationSource source) {
|
|
|
+ List<Long> ids = metaDestroyParam.getIds();
|
|
|
+ String remark = metaDestroyParam.getRemark();
|
|
|
+ if (CollectionUtils.isEmpty(ids)) {
|
|
|
+ throw new BusinessException("要销毁的藏品id为空");
|
|
|
+ }
|
|
|
ids.forEach(id -> {
|
|
|
- destroyWithoutTradeCode(id, userId, source);
|
|
|
+ destroyWithoutTradeCode(id, userId, source, remark);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public void destroyWithoutTradeCode(Long id, Long userId, OperationSource source) {
|
|
|
+ public void destroyWithoutTradeCode(Long id, Long userId, OperationSource source, String remark) {
|
|
|
Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
if (!asset.getUserId().equals(userId)) {
|
|
|
throw new BusinessException("此藏品不属于该用户");
|
|
|
@@ -1056,6 +1061,7 @@ public class AssetService {
|
|
|
.type(RecordType.OBTAIN)
|
|
|
.companyId(asset.getCompanyId())
|
|
|
.source(source)
|
|
|
+ .remark(remark)
|
|
|
.build());
|
|
|
|
|
|
//加积分
|