|
@@ -52,7 +52,6 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
|
|
|
@Autowired
|
|
|
SelfCarCalculateInforMapper calculateInforMapper;
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
public RespR<List<CardTradeModel>> getTradeList(TradeRequestVo tradeRequestVo) {
|
|
|
Customer customer = customerMapper.selectByCustomerName(tradeRequestVo.getCustomerName());
|
|
|
if(customer == null || customer.getAccstatus().intValue() == 1){
|
|
@@ -103,17 +102,6 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
|
|
|
selfCarTrade.setFee(cardTradeModel.getFee());
|
|
|
selfCarTrade.setStatus(tradeRequestVo.getTradeStatus());
|
|
|
sellCarTradeMapper.insert(selfCarTrade);
|
|
|
- //计费
|
|
|
- SelfCarCalculateInfor carCalculateInfor = new SelfCarCalculateInfor();
|
|
|
- carCalculateInfor.setCustomId(customerRec.getCustomerName());
|
|
|
- carCalculateInfor.setCompanyNum(customerRec.getCompanyName());
|
|
|
- carCalculateInfor.setCalTime(StringUtils.substring(cardTradeModel.getExTime(),0,7));
|
|
|
- carCalculateInfor.setFee(customer.getFee());
|
|
|
- carCalculateInfor.setEtcNum(cardTradeModel.getCardId());
|
|
|
- if(calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null){
|
|
|
- calculateInforMapper.insert(carCalculateInfor);
|
|
|
- }
|
|
|
-
|
|
|
}else{
|
|
|
if(selfCarTrade.getStatus()!=tradeRequestVo.getTradeStatus()){
|
|
|
selfCarTrade.setStatus(tradeRequestVo.getTradeStatus());
|
|
@@ -188,8 +176,10 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public RespR<List<SelfCarInvoice>> getSelfCarInvoicesByApplyIds(ApplQueryInvVo applQueryInvVo) {
|
|
|
B2BInvoiceQueryByApplyRequest b2BInvoiceQueryRequest = new B2BInvoiceQueryByApplyRequest();
|
|
|
+ Customer customer = customerMapper.selectByCustomerName(applQueryInvVo.getCustomerName());
|
|
|
CustomerRec customerRec = new CustomerRec();
|
|
|
customerRec.setCustomerName(applQueryInvVo.getCustomerName());
|
|
|
customerRec.setCompanyName(applQueryInvVo.getCompanyName());
|
|
@@ -209,11 +199,27 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
|
|
|
for(B2BInvoiceQueryByApplyModel b2BInvoiceQueryByApplyModel:b2BInvoiceQueryByApplyModels){
|
|
|
SelfCarInvoice selfCarInvoice = new SelfCarInvoice();
|
|
|
BeanUtils.copyProperties(b2BInvoiceQueryByApplyModel,selfCarInvoice);
|
|
|
+ selfCarInvoice.setCompanyName(customerRec.getCompanyName());
|
|
|
+ selfCarInvoice.setCompanyNum(customerRec.getCompanyNum());
|
|
|
+ selfCarInvoice.setCustomerName(customerRec.getCustomerName());
|
|
|
+ selfCarInvoice.setBuyerTaxpayerCode(customerRec.getCompanyReferencenum());
|
|
|
+ selfCarInvoice.setExStation(b2BInvoiceQueryByApplyModel.getExStationName());
|
|
|
+ selfCarInvoice.setEnStation(b2BInvoiceQueryByApplyModel.getEnStationName());
|
|
|
selfCarInvoice.setInvoiceMakeTime(DateUtil.tTimeToDate(selfCarInvoice.getInvoiceMakeTime()));
|
|
|
selfCarInvoice.setExTime(DateUtil.tTimeToDate(selfCarInvoice.getExTime()));
|
|
|
if(selfCarInvoiceMapper.selectByTradeAndInvoiceMakeTime(selfCarInvoice)==null || selfCarInvoiceMapper.selectByTradeAndInvoiceMakeTime(selfCarInvoice).size()==0){
|
|
|
selfCarInvoiceMapper.insert(selfCarInvoice);
|
|
|
}
|
|
|
+ //计费
|
|
|
+ SelfCarCalculateInfor carCalculateInfor = new SelfCarCalculateInfor();
|
|
|
+ carCalculateInfor.setCustomId(customerRec.getCustomerName());
|
|
|
+ carCalculateInfor.setCompanyNum(customerRec.getCompanyName());
|
|
|
+ carCalculateInfor.setCalTime(StringUtils.substring(b2BInvoiceQueryByApplyModel.getExTime(),0,7));
|
|
|
+ carCalculateInfor.setFee(customer.getFee());
|
|
|
+ carCalculateInfor.setEtcNum(b2BInvoiceQueryByApplyModel.getCardId());
|
|
|
+ if(calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null){
|
|
|
+ calculateInforMapper.insert(carCalculateInfor);
|
|
|
+ }
|
|
|
}
|
|
|
//返回相应的发票
|
|
|
return new RespR(b2BInvoiceQueryByApplyModels);
|
|
@@ -259,6 +265,18 @@ public class SelfCarServiceLImpl implements SelfCarServiceL {
|
|
|
if(selfCarInvoiceMapper.selectByTradeAndInvoiceMakeTime(selfCarInvoice)==null || selfCarInvoiceMapper.selectByTradeAndInvoiceMakeTime(selfCarInvoice).size()==0){
|
|
|
selfCarInvoiceMapper.insert(selfCarInvoice);
|
|
|
}
|
|
|
+
|
|
|
+ //计费
|
|
|
+ SelfCarCalculateInfor carCalculateInfor = new SelfCarCalculateInfor();
|
|
|
+ carCalculateInfor.setCustomId(customerRec.getCustomerName());
|
|
|
+ carCalculateInfor.setCompanyNum(customerRec.getCompanyName());
|
|
|
+ carCalculateInfor.setCalTime(StringUtils.substring(b2BInvoiceListModel.getExTime(),0,7));
|
|
|
+ carCalculateInfor.setFee(customer.getFee());
|
|
|
+ carCalculateInfor.setEtcNum(b2BInvoiceListModel.getCardId());
|
|
|
+ if(calculateInforMapper.selectByEtcAndTime(carCalculateInfor) == null){
|
|
|
+ //todo 扣减客户金额
|
|
|
+ calculateInforMapper.insert(carCalculateInfor);
|
|
|
+ }
|
|
|
selfCarInvoices.add(selfCarInvoice);
|
|
|
}
|
|
|
}
|