|
@@ -42,13 +42,13 @@ public class InvoiceListServiceImpl implements InvoiceListService {
|
|
|
|
|
|
@Override
|
|
|
public Long createInvoiceList(InvoiceListSaveReqVO createReqVO) {
|
|
|
-
|
|
|
- PayOrderBaseRespDTO data = payOrderApi.getOrder2(Long.valueOf(createReqVO.getPayOrderId())).getData();
|
|
|
+ Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ PayOrderBaseRespDTO data = payOrderApi.getOrder2(createReqVO.getPayOrderId()).getData();
|
|
|
if(null==data){
|
|
|
throw exception(INVOICE_LIST_ORDER_NOT_EXISTS);
|
|
|
}
|
|
|
// 非本人订单
|
|
|
- if(!SecurityFrameworkUtils.getLoginUserId().toString().equals( data.getChannelUserId())){
|
|
|
+ if(!loginUserId.toString().equals( data.getChannelUserId())){
|
|
|
throw exception(INVOICE_LIST_ORDER_NOT_EXISTS);
|
|
|
}
|
|
|
|
|
@@ -62,6 +62,8 @@ public class InvoiceListServiceImpl implements InvoiceListService {
|
|
|
|
|
|
// 插入
|
|
|
InvoiceListDO invoiceList = BeanUtils.toBean(createReqVO, InvoiceListDO.class);
|
|
|
+ invoiceList.setUserId(loginUserId);
|
|
|
+ invoiceList.setStatus(0);
|
|
|
invoiceListMapper.insert(invoiceList);
|
|
|
// 返回
|
|
|
return invoiceList.getId();
|
|
@@ -77,21 +79,21 @@ public class InvoiceListServiceImpl implements InvoiceListService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void deleteInvoiceList(String id) {
|
|
|
+ public void deleteInvoiceList(Long id) {
|
|
|
// 校验存在
|
|
|
validateInvoiceListExists(id);
|
|
|
// 删除
|
|
|
invoiceListMapper.deleteById(id);
|
|
|
}
|
|
|
|
|
|
- private void validateInvoiceListExists(String id) {
|
|
|
+ private void validateInvoiceListExists(Long id) {
|
|
|
if (invoiceListMapper.selectById(id) == null) {
|
|
|
throw exception(INVOICE_LIST_NOT_EXISTS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public InvoiceListDO getInvoiceList(String id) {
|
|
|
+ public InvoiceListDO getInvoiceList(Long id) {
|
|
|
return invoiceListMapper.selectById(id);
|
|
|
}
|
|
|
|