|
@@ -312,7 +312,7 @@ public class NoCarServiceImpl implements NoCarService{
|
|
|
customerRecParm.setCustomerName(noCarWayBill.getCustomerName());
|
|
|
CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecParm);
|
|
|
if(customerRec == null || customerRec.getRecStatus()!=1){
|
|
|
- return new RespR(false,"客户未备案企业或运单编号与查询主体不符");
|
|
|
+ return new RespR(true);//
|
|
|
}
|
|
|
noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
|
|
|
noCarWayBill.setCompanyAdress(customerRec.getCompanyAdress());
|
|
@@ -558,7 +558,7 @@ public class NoCarServiceImpl implements NoCarService{
|
|
|
@Transactional(isolation= Isolation.READ_COMMITTED)
|
|
|
public RespR getInvoiceByWayBillNumReal(NoCarWayBill noCarWayBill, boolean isInterface) {
|
|
|
log.info("取票啦:NoCarServiceImpl.getInvoiceByWayBillNumReal{},isCurr{}",noCarWayBill,isInterface);
|
|
|
- if(isInterface){
|
|
|
+ if(isInterface && noCarWayBill.getBillwayStatus()!=-5){
|
|
|
if(noCarWayBill.getBillwayStatus() == 1 || noCarWayBill.getBillwayStatus() == 2 || noCarWayBill.getBillwayStatus() == 3 || noCarWayBill.getBillwayStatus() == 4){
|
|
|
//直接返回发票信息
|
|
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
@@ -568,7 +568,7 @@ public class NoCarServiceImpl implements NoCarService{
|
|
|
return new RespR(false,noCarWayBill.getFailReason()==null?"运单未知异常":noCarWayBill.getFailReason());
|
|
|
}
|
|
|
}
|
|
|
- if(noCarWayBill.getBillwayStatus()!=2){
|
|
|
+ if(noCarWayBill.getBillwayStatus()!=2 && noCarWayBill.getBillwayStatus()!=-5){
|
|
|
return new RespR(false,"不是开票中的状态,别取票啦");
|
|
|
}
|
|
|
RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
|
|
@@ -588,10 +588,22 @@ public class NoCarServiceImpl implements NoCarService{
|
|
|
return new RespR(false,responseRespR.getMsg());
|
|
|
}else{
|
|
|
int tempStatus = responseRespR.getData().getWaybillStatus().intValue();
|
|
|
- //更改票状态
|
|
|
- noCarWayBill.setBillwayStatus(tempStatus);
|
|
|
- noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
|
|
|
- noCarWaybillMapper.updateByBillNum(noCarWayBill);
|
|
|
+ if(noCarWayBill.getBillwayStatus()==-5){
|
|
|
+ noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
|
|
|
+ noCarWayBill.setInterType(0);
|
|
|
+ noCarWayBill.setPlateNum(responseRespR.getData().getPlateNum());
|
|
|
+ noCarWayBill.setStartTime(DateUtil.tTimeToDate(responseRespR.getData().getWaybillStartTime()));
|
|
|
+ noCarWayBill.setPredictEndTime(DateUtil.tTimeToDate(responseRespR.getData().getWaybillEndTime()));
|
|
|
+ //更改票状态
|
|
|
+ noCarWayBill.setBillwayStatus(tempStatus);
|
|
|
+ insertOrUpdateBillEnd(noCarWayBill);
|
|
|
+ }else {
|
|
|
+ //更改票状态
|
|
|
+ noCarWayBill.setBillwayStatus(tempStatus);
|
|
|
+ noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
|
|
|
+ noCarWaybillMapper.updateByBillNum(noCarWayBill);
|
|
|
+ }
|
|
|
+
|
|
|
if(tempStatus == 2 || tempStatus==3){
|
|
|
//删除已有发票
|
|
|
billInvoiceMapper.deleteByBillNum(noCarWayBill.getBillNum());
|
|
@@ -642,11 +654,11 @@ public class NoCarServiceImpl implements NoCarService{
|
|
|
|
|
|
});
|
|
|
customerMapper.updateByPrimaryKeySelective(customer);
|
|
|
- if(isInterface){
|
|
|
- return new RespR(responseRespR.getData());
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
+ if(isInterface){
|
|
|
+ return new RespR(responseRespR.getData());
|
|
|
+ }
|
|
|
}
|
|
|
return new RespR("success");
|
|
|
}
|