ariesy 推送sap失敗報錯信息修改

release
yefei 2 years ago
parent 80745feb3e
commit 45b4003c1c
  1. 7
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  2. 7
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java

@ -25,6 +25,7 @@ import com.dxhy.erp.utils.HmacSHA1Util;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -927,7 +928,7 @@ public class SDNYMainProcessController extends AbstractController {
log.error("发票同步接口记录保存失败,errormsg:{}",e); log.error("发票同步接口记录保存失败,errormsg:{}",e);
} }
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)));
} catch(NullPointerException exception){ } catch(NullPointerException exception){
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
@ -940,7 +941,7 @@ public class SDNYMainProcessController extends AbstractController {
log.error("发票同步接口记录保存失败,errormsg:{}",e); log.error("发票同步接口记录保存失败,errormsg:{}",e);
} }
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)));
} catch(Exception exception){ } catch(Exception exception){
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
@ -953,7 +954,7 @@ public class SDNYMainProcessController extends AbstractController {
log.error("发票同步接口记录保存失败,errormsg:{}",e); log.error("发票同步接口记录保存失败,errormsg:{}",e);
} }
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)));
} }
} }

@ -770,7 +770,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
reimburse.setInvoiceType(fplxdm); reimburse.setInvoiceType(fplxdm);
reimburse.setInvoiceCode(invoice.getInvoiceCode()); reimburse.setInvoiceCode(invoice.getInvoiceCode());
reimburse.setInvoiceNo(invoice.getInvoiceNumber()); reimburse.setInvoiceNo(invoice.getInvoiceNumber());
reimburse.setInvoiceDate(invoice.getBillingDate());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(new Date());
reimburse.setInvoiceDate(StringUtils.isEmpty(invoice.getBillingDate()) ? dateString : invoice.getBillingDate());
reimburse.setPassenger(invoice.getRiderName()); reimburse.setPassenger(invoice.getRiderName());
if (invoice.getTotalAmount() != null) { if (invoice.getTotalAmount() != null) {
reimburse.setInvoiceAmount(new BigDecimal(invoice.getTotalAmount())); reimburse.setInvoiceAmount(new BigDecimal(invoice.getTotalAmount()));

Loading…
Cancel
Save