|
@ -1,6 +1,7 @@ |
|
|
package com.example.demo.serviceImpl.cash; |
|
|
package com.example.demo.serviceImpl.cash; |
|
|
|
|
|
|
|
|
import com.example.demo.domain.entity.CashRecord; |
|
|
import com.example.demo.domain.entity.CashRecord; |
|
|
|
|
|
import com.example.demo.mapper.cash.CashAuditMapper; |
|
|
import com.example.demo.mapper.cash.CashCollectionMapper; |
|
|
import com.example.demo.mapper.cash.CashCollectionMapper; |
|
|
import com.example.demo.service.cash.CashAuditService; |
|
|
import com.example.demo.service.cash.CashAuditService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -19,11 +20,27 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
public class CashAuditServiceImpl implements CashAuditService { |
|
|
public class CashAuditServiceImpl implements CashAuditService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private CashCollectionMapper cashCollectionMapper; |
|
|
private CashCollectionMapper cashCollectionMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private CashAuditMapper cashAuditMapper; |
|
|
@Transactional |
|
|
@Transactional |
|
|
@Override |
|
|
@Override |
|
|
public boolean auditCollection(String token, String orderCode, Integer action, String rejectReason) { |
|
|
public boolean auditCollection(String token, String orderCode, Integer action, String rejectReason) { |
|
|
CashRecord order = cashCollectionMapper.selectUnAuditByOrderCode(orderCode); |
|
|
CashRecord order = cashCollectionMapper.selectUnAuditByOrderCode(orderCode); |
|
|
return false; |
|
|
|
|
|
|
|
|
if (order==null || order.getStatus()!=0){ |
|
|
|
|
|
throw new IllegalArgumentException("订单不存在或已被审核"); |
|
|
|
|
|
} |
|
|
|
|
|
//判断是通过还是驳回,更新审核状态 |
|
|
|
|
|
CashRecord updateOrder = new CashRecord(); |
|
|
|
|
|
updateOrder.setOrderCode(orderCode); |
|
|
|
|
|
if (action==1){ //通过 |
|
|
|
|
|
updateOrder.setStatus(1); |
|
|
|
|
|
} |
|
|
|
|
|
else if (action==2){ //驳回 |
|
|
|
|
|
updateOrder.setStatus(2); |
|
|
|
|
|
updateOrder.setRejectReason(rejectReason); |
|
|
|
|
|
} |
|
|
|
|
|
//更新订单 |
|
|
|
|
|
cashAuditMapper.updateOrder(updateOrder); |
|
|
|
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |