|
@@ -1,6 +1,7 @@
|
|
|
package com.jkcredit.invoice.credit.custInterface;
|
|
|
|
|
|
import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.CardTradeModel;
|
|
|
+import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleQueryResponse;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jkcredit.invoice.common.DataResult;
|
|
@@ -263,15 +264,22 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
){
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
- CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
|
|
|
- if (null == customerCarRec1){
|
|
|
+ CustomerRec customerRec = new CustomerRec();
|
|
|
+ customerRec.setCustomerName(appKey);
|
|
|
+ customerRec.setCompanyReferencenum(taxplayerCode);
|
|
|
+ customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
|
|
|
+ if(customerRec == null){
|
|
|
+ result.setMsg("客户:"+appKey+";税号"+taxplayerCode+"未在平台备案成功,请先做备案");
|
|
|
return result;
|
|
|
}
|
|
|
+ /* CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
|
|
|
+ if (null == customerCarRec1){
|
|
|
+ return result;
|
|
|
+ }*/
|
|
|
|
|
|
NoCarWayBill noCarWayBill = new NoCarWayBill();
|
|
|
noCarWayBill.setCustomerName(appKey);
|
|
|
- noCarWayBill.setCompanyName(customerCarRec1.getCompanyName());
|
|
|
+ noCarWayBill.setCompanyName(customerRec.getCompanyName());
|
|
|
noCarWayBill.setPlateNum(plateNumber);
|
|
|
noCarWayBill.setBillNum(num);
|
|
|
noCarWayBill.setPlateColor(plateColor);
|
|
@@ -282,10 +290,34 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
noCarWayBill.setFee(fee.longValue());
|
|
|
noCarWayBill.setTitleType(titleType);
|
|
|
noCarWayBill.setTaxplayerCode(taxplayerCode);
|
|
|
+ noCarWayBill.setHisFlag(0);
|
|
|
+
|
|
|
NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
|
|
|
|
if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
|
|
|
- noCarWaybillMapperImprt.updateBillway(-2, "失败,运单号重复", noCarWayBill);
|
|
|
+ result.setMsg("运单号重复");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ List<CustomerCarRec> customerCarRecs = new ArrayList<>();
|
|
|
+ CustomerCarRec customerCarRec = new CustomerCarRec();
|
|
|
+ customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
|
|
|
+ customerCarRec.setCarNum(noCarWayBill.getPlateNum());
|
|
|
+ customerCarRec.setCarColor(noCarWayBill.getPlateColor());
|
|
|
+ customerCarRec.setCustomerName(appKey);
|
|
|
+ customerCarRec.setInterType(0);
|
|
|
+ customerCarRec.setCompanyNum(customerRec.getCompanyNum());
|
|
|
+ customerCarRec.setBusinessType("2");
|
|
|
+ customerCarRec.setServiceOperation(1);//默认运营车辆
|
|
|
+ noCarWayBill.setTitleType(2);
|
|
|
+ //先查询上游是否已经备案
|
|
|
+ RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
|
|
|
+ if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
|
|
|
+ customerCarRecs.add(customerCarRec);
|
|
|
+ RespR respR = noCarService.customerCarRec(customerCarRecs);
|
|
|
+ if(respR.getCode() ==1){
|
|
|
+ result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
RespR rs = noCarService.noCarWaybillStart(noCarWayBill);
|
|
|
long costtimeend = System.currentTimeMillis();
|
|
@@ -434,14 +466,18 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(plateNumber);
|
|
|
- if (null == customerCarRec1){
|
|
|
+ CustomerRec customerRec = new CustomerRec();
|
|
|
+ customerRec.setCustomerName(appKey);
|
|
|
+ customerRec.setCompanyReferencenum(taxplayerCode);
|
|
|
+ customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
|
|
|
+ if(customerRec == null){
|
|
|
+ result.setMsg("客户:"+appKey+";税号"+taxplayerCode+"未在平台备案成功,请先做备案");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
NoCarWayBill noCarWayBill = new NoCarWayBill();
|
|
|
noCarWayBill.setCustomerName(appKey);
|
|
|
- noCarWayBill.setCompanyName(customerCarRec1.getCompanyName());
|
|
|
+ noCarWayBill.setCompanyName(customerRec.getCompanyName());
|
|
|
noCarWayBill.setPlateNum(plateNumber);
|
|
|
noCarWayBill.setBillNum(num);
|
|
|
noCarWayBill.setPlateColor(plateColor);
|
|
@@ -457,10 +493,31 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
|
|
|
|
if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
|
|
|
- noCarWaybillMapperImprt.updateBillway(-2, "失败,运单号重复", noCarWayBill);
|
|
|
+ result.setMsg("运单号重复");
|
|
|
+ return result;
|
|
|
}
|
|
|
-
|
|
|
- RespR rs = noCarService.noCarHisWaybillStart(noCarWayBill);
|
|
|
+ List<CustomerCarRec> customerCarRecs = new ArrayList<>();
|
|
|
+ CustomerCarRec customerCarRec = new CustomerCarRec();
|
|
|
+ customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
|
|
|
+ customerCarRec.setCarNum(noCarWayBill.getPlateNum());
|
|
|
+ customerCarRec.setCarColor(noCarWayBill.getPlateColor());
|
|
|
+ customerCarRec.setCustomerName(appKey);
|
|
|
+ customerCarRec.setInterType(0);
|
|
|
+ customerCarRec.setCompanyNum(customerRec.getCompanyNum());
|
|
|
+ customerCarRec.setBusinessType("2");
|
|
|
+ customerCarRec.setServiceOperation(1);//默认运营车辆
|
|
|
+ noCarWayBill.setTitleType(2);
|
|
|
+ //先查询上游是否已经备案
|
|
|
+ RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
|
|
|
+ if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
|
|
|
+ customerCarRecs.add(customerCarRec);
|
|
|
+ RespR respR = noCarService.customerCarRec(customerCarRecs);
|
|
|
+ if(respR.getCode() ==1){
|
|
|
+ result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ RespR rs = noCarService.noCarHisWaybillStart(noCarWayBill);
|
|
|
long costtimeend = System.currentTimeMillis();
|
|
|
log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] result is "
|
|
|
+ rs.toString() + ", request is " + data + " ,costtime="
|