业务调账
parent
9d5da6f075
commit
200bc1ee3a
|
|
@ -11,6 +11,7 @@ import com.njzscloud.supervisory.order.pojo.param.*;
|
|||
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
|
||||
import com.njzscloud.supervisory.order.service.AccountRegulationService;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import com.njzscloud.supervisory.sys.log.annotation.Log;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -31,6 +32,8 @@ import java.util.List;
|
|||
public class OrderInfoController {
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
private final AccountRegulationService accountRegulationService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -268,4 +271,14 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Log("业务调账")
|
||||
@PostMapping("/account_regulation")
|
||||
public R<?> accountRegulation(@RequestBody RegulationParam param) {
|
||||
accountRegulationService.accountRegulation(param);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 调账入参
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class RegulationParam {
|
||||
|
||||
/**
|
||||
* 清运公司Id
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 订单sn
|
||||
*/
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private String delta;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.ChangePriceParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.RegulationParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 调账
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AccountRegulationService {
|
||||
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* 业务调账
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void accountRegulation(RegulationParam param) {
|
||||
OrderInfoEntity order = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, param.getSn()));
|
||||
Assert.notNull(order, () -> Exceptions.clierr("订单不存在"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue