|
@@ -225,10 +225,10 @@ public class NoCarServiceImpl implements NoCarService{
|
|
if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),new Date())<-72){
|
|
if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),new Date())<-72){
|
|
return new RespR(false,"失败,运单开始时间超72小时");
|
|
return new RespR(false,"失败,运单开始时间超72小时");
|
|
}
|
|
}
|
|
- if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
|
|
|
|
+ /* if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
|
|
RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
|
|
if(respR.getCode() == 1){
|
|
if(respR.getCode() == 1){
|
|
log.info("运单上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,respR.getMsg());
|
|
log.info("运单上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,respR.getMsg());
|
|
@@ -251,7 +251,7 @@ public class NoCarServiceImpl implements NoCarService{
|
|
//插入或者更新运单
|
|
//插入或者更新运单
|
|
public void insertOrUpdateBill(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb){
|
|
public void insertOrUpdateBill(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb){
|
|
|
|
|
|
- if(noCarWayBillDb == null){
|
|
|
|
|
|
+ if(noCarWaybillMapper.selectByBillNumforLock(noCarWayBill.getBillNum()) == null){
|
|
noCarWaybillMapper.insert(noCarWayBill);
|
|
noCarWaybillMapper.insert(noCarWayBill);
|
|
}else{
|
|
}else{
|
|
noCarWaybillMapper.updateByBillNum(noCarWayBill);
|
|
noCarWaybillMapper.updateByBillNum(noCarWayBill);
|
|
@@ -306,7 +306,7 @@ public class NoCarServiceImpl implements NoCarService{
|
|
log.info("运单结束开始:NoCarServiceImpl.noCarWaybillEnd{}",noCarWayBill);
|
|
log.info("运单结束开始:NoCarServiceImpl.noCarWaybillEnd{}",noCarWayBill);
|
|
if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill1.getHisFlag() ==1 ){
|
|
if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill1.getHisFlag() ==1 ){
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
|
|
- noCarWayBill.setFailReason("当前运单状态无法结束,请检查当前指令状态");
|
|
|
|
|
|
+ noCarWayBill.setFailReason((noCarWayBill1 == null?"":noCarWayBill1.getFailReason())+";当前运单状态无法结束,请检查当前指令状态");
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
|
|
return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
|
|
}
|
|
}
|
|
@@ -314,13 +314,13 @@ public class NoCarServiceImpl implements NoCarService{
|
|
noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
|
|
noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
|
|
noCarWayBill1.setBatchNumEnd(noCarWayBill.getBatchNumEnd());
|
|
noCarWayBill1.setBatchNumEnd(noCarWayBill.getBatchNumEnd());
|
|
noCarWayBill1.setInterType(noCarWayBill.getInterType());
|
|
noCarWayBill1.setInterType(noCarWayBill.getInterType());
|
|
- if((DateUtil.getDistanceHours(noCarWayBill1.getStartTime(),DateUtil.StringToDate(noCarWayBill1.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
|
|
|
|
+ /*if((DateUtil.getDistanceHours(noCarWayBill1.getStartTime(),DateUtil.StringToDate(noCarWayBill1.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
//noCarWayBill1.setBillwayStatus(4);
|
|
//noCarWayBill1.setBillwayStatus(4);
|
|
noCarWayBill1.setFailReason("失败,承运时长超96小时");
|
|
noCarWayBill1.setFailReason("失败,承运时长超96小时");
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
|
|
WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
|
|
String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
|
|
String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
|
|
@@ -359,10 +359,10 @@ public class NoCarServiceImpl implements NoCarService{
|
|
log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,"必须是二十天前的运单");
|
|
log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,"必须是二十天前的运单");
|
|
return new RespR(false,"失败,运单未满20天时效");
|
|
return new RespR(false,"失败,运单未满20天时效");
|
|
}
|
|
}
|
|
- if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
|
|
|
|
+ /* if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
log.info("历史运单开始上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
log.info("历史运单开始上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
|
|
RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
|
|
if(respR.getCode() == 1){
|
|
if(respR.getCode() == 1){
|
|
@@ -411,19 +411,19 @@ public class NoCarServiceImpl implements NoCarService{
|
|
log.info("历史运单结束上传:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"开始");
|
|
log.info("历史运单结束上传:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"开始");
|
|
if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill.getHisFlag() ==0 || noCarWayBill1.getBillwayStatus() == -3 ){
|
|
if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill.getHisFlag() ==0 || noCarWayBill1.getBillwayStatus() == -3 ){
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
|
|
log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
|
|
- noCarWayBill.setFailReason("当前运单状态无法结束,请检查当前指令状态");
|
|
|
|
|
|
+ noCarWayBill.setFailReason((noCarWayBill1 == null?"":noCarWayBill1.getFailReason())+"当前运单状态无法结束,请检查当前指令状态");
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
|
|
return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
|
|
}
|
|
}
|
|
noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
|
|
noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
|
|
noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
|
|
noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
|
|
noCarWayBill1.setInterType(noCarWayBill.getInterType());
|
|
noCarWayBill1.setInterType(noCarWayBill.getInterType());
|
|
- if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
|
|
|
|
+ /*if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
|
|
log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
|
|
noCarWayBill.setFailReason("失败,承运时长超96小时");
|
|
noCarWayBill.setFailReason("失败,承运时长超96小时");
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
return new RespR(false,"失败,承运时长超96小时");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
|
|
WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
|
|
String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
|
|
String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
|
|
waybillEndRequest.setCompanyNum(companyNum);
|
|
waybillEndRequest.setCompanyNum(companyNum);
|
|
@@ -457,16 +457,21 @@ public class NoCarServiceImpl implements NoCarService{
|
|
billInvoices.stream().forEach(billInvoice -> {
|
|
billInvoices.stream().forEach(billInvoice -> {
|
|
InvoiceProcessingListModel invoiceProcessingListModel = new InvoiceProcessingListModel();
|
|
InvoiceProcessingListModel invoiceProcessingListModel = new InvoiceProcessingListModel();
|
|
BeanUtils.copyProperties(billInvoice,invoiceProcessingListModel);
|
|
BeanUtils.copyProperties(billInvoice,invoiceProcessingListModel);
|
|
|
|
+ invoiceProcessingListModel.setExTime(DateUtil.dateToTime(invoiceProcessingListModel.getExTime()));
|
|
|
|
+ invoiceProcessingListModel.setInvoiceMakeTime(DateUtil.dateToTime(invoiceProcessingListModel.getInvoiceMakeTime()));
|
|
|
|
+ invoiceProcessingListModel.setTradeMatchTime(DateUtil.dateToTime(invoiceProcessingListModel.getTradeMatchTime()));
|
|
invoiceProcessingListModels.add(invoiceProcessingListModel);
|
|
invoiceProcessingListModels.add(invoiceProcessingListModel);
|
|
});
|
|
});
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
waybillNumFindInvoiceResponse.setResult(invoiceProcessingListModels);
|
|
waybillNumFindInvoiceResponse.setResult(invoiceProcessingListModels);
|
|
waybillNumFindInvoiceResponse.setPlateNum(noCarWayBill.getPlateNum());
|
|
waybillNumFindInvoiceResponse.setPlateNum(noCarWayBill.getPlateNum());
|
|
waybillNumFindInvoiceResponse.setInfo("成功");
|
|
waybillNumFindInvoiceResponse.setInfo("成功");
|
|
- waybillNumFindInvoiceResponse.setWaybillStartTime(noCarWayBill.getStartTime());
|
|
|
|
- waybillNumFindInvoiceResponse.setWaybillEndTime(noCarWayBill.getPredictEndTime());
|
|
|
|
|
|
+ waybillNumFindInvoiceResponse.setWaybillStartTime(DateUtil.dateToTime(noCarWayBill.getStartTime()));
|
|
|
|
+ waybillNumFindInvoiceResponse.setWaybillEndTime(DateUtil.dateToTime(noCarWayBill.getPredictEndTime()));
|
|
waybillNumFindInvoiceResponse.setWaybillStatus(noCarWayBill.getBillwayStatus());
|
|
waybillNumFindInvoiceResponse.setWaybillStatus(noCarWayBill.getBillwayStatus());
|
|
- waybillNumFindInvoiceResponse.setReceiveTime(DateUtil.getCurrentDateStr());
|
|
|
|
|
|
+ waybillNumFindInvoiceResponse.setReceiveTime(DateUtil.dateToTime(DateUtil.getCurrentDateStr()));
|
|
waybillNumFindInvoiceResponse.setWaybillNum(noCarWayBill.getBillNum());
|
|
waybillNumFindInvoiceResponse.setWaybillNum(noCarWayBill.getBillNum());
|
|
return waybillNumFindInvoiceResponse;
|
|
return waybillNumFindInvoiceResponse;
|
|
}
|
|
}
|
|
@@ -479,7 +484,11 @@ public class NoCarServiceImpl implements NoCarService{
|
|
if(isInterface){
|
|
if(isInterface){
|
|
//直接返回发票信息
|
|
//直接返回发票信息
|
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
- return new RespR(buildInterFaceVoiceData(noCarWayBill,billInvoices));
|
|
|
|
|
|
+ WaybillNumFindInvoiceResponse waybillNumFindInvoiceResponse = buildInterFaceVoiceData(noCarWayBill,billInvoices);
|
|
|
|
+ if(waybillNumFindInvoiceResponse == null){
|
|
|
|
+ return new RespR(false,"未查得");
|
|
|
|
+ }
|
|
|
|
+ return new RespR(waybillNumFindInvoiceResponse);
|
|
}else{
|
|
}else{
|
|
return new RespR("success");
|
|
return new RespR("success");
|
|
}
|
|
}
|
|
@@ -490,7 +499,11 @@ public class NoCarServiceImpl implements NoCarService{
|
|
if(isInterface){
|
|
if(isInterface){
|
|
//直接返回发票信息
|
|
//直接返回发票信息
|
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
|
|
- return new RespR(buildInterFaceVoiceData(noCarWayBill,billInvoices));
|
|
|
|
|
|
+ WaybillNumFindInvoiceResponse waybillNumFindInvoiceResponse = buildInterFaceVoiceData(noCarWayBill,billInvoices);
|
|
|
|
+ if(waybillNumFindInvoiceResponse == null){
|
|
|
|
+ return new RespR(false,"未查得");
|
|
|
|
+ }
|
|
|
|
+ return new RespR(waybillNumFindInvoiceResponse);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int status = noCarWayBill.getBillwayStatus();
|
|
int status = noCarWayBill.getBillwayStatus();
|