|
|
|
@ -17,6 +17,7 @@ import com.dxhy.order.consumer.dao.GsClientMapper; |
|
|
|
|
import com.dxhy.order.consumer.dao.InterfaceRequestDataMapper; |
|
|
|
|
import com.dxhy.order.consumer.dao.PushInfoRecordMapper; |
|
|
|
|
import com.dxhy.order.consumer.model.PushInfoRecord; |
|
|
|
|
import com.dxhy.order.consumer.dao.InterfaceRequestDataMapper; |
|
|
|
|
import com.dxhy.order.consumer.model.protocol.CommonResponse; |
|
|
|
|
import com.dxhy.order.consumer.model.protocol.ResponseData; |
|
|
|
|
import com.dxhy.order.consumer.model.protocol.ResponseStatus; |
|
|
|
@ -173,10 +174,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
private BaseServiceConfig baseServiceConfig; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private InterfaceRequestDataMapper interfaceRequestDataMapper; |
|
|
|
|
private PushInfoRecordMapper pushInfoRecordMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private PushInfoRecordMapper pushInfoRecordMapper; |
|
|
|
|
private InterfaceRequestDataMapper interfaceRequestDataMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GsClientMapper gsClientMapper; |
|
|
|
@ -700,9 +701,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R sendImageSys(String content, String pushType, PushInfo pushInfo, Long id) { |
|
|
|
|
R r = new R(); |
|
|
|
|
public void sendImageSys(String content, String pushType, PushInfo pushInfo, Long id){ |
|
|
|
|
PushInfo pushInfo1 = new PushInfo(); |
|
|
|
|
pushInfo1.setId(pushInfo.getId()); |
|
|
|
|
pushInfo1.setByzd1("YXXT"); |
|
|
|
@ -712,55 +711,51 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { |
|
|
|
|
|
|
|
|
|
DdfpxxV5 ddfpxx = ddfpzxxV5.getDDFPXX(); |
|
|
|
|
OutputInvoiceRequest outputInvoiceRequest = buildInvoiceRequest(ddfpxx); |
|
|
|
|
if (outputInvoiceRequest.getInvoiceList() != null && outputInvoiceRequest.getInvoiceList().size() > 0) { |
|
|
|
|
if(outputInvoiceRequest.getInvoiceList() != null && outputInvoiceRequest.getInvoiceList().size() > 0){ |
|
|
|
|
String fplxdm = ddfpxx.getFPLXDM(); |
|
|
|
|
boolean b = OrderInfoEnum.ORDER_INVOICE_TYPE_001.getKey().equals(fplxdm) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_002.getKey().equals(fplxdm) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_026.getKey().equals(fplxdm) |
|
|
|
|
|| OrderInfoEnum.ORDER_INVOICE_TYPE_028.getKey().equals(fplxdm); |
|
|
|
|
if (!b) { |
|
|
|
|
String error = String.format("invoiceNo:%s not eleInvoice do not push", outputInvoiceRequest.getInvoiceList().get(0).getInvoiceNumber()); |
|
|
|
|
if(!b){ |
|
|
|
|
String error=String.format("invoiceNo:%s not eleInvoice do not push",outputInvoiceRequest.getInvoiceList().get(0).getInvoiceNumber()); |
|
|
|
|
log.info(error); |
|
|
|
|
failPush(id, content, error, error, pushInfo1, pushType); |
|
|
|
|
r.put(OrderManagementConstant.CODE, "9999"); |
|
|
|
|
r.put(OrderManagementConstant.ALL_MESSAGE, error); |
|
|
|
|
return r; |
|
|
|
|
failPush(id,content,error,error,pushInfo1,pushType); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
String md5Encode = MD5.getMd5Encode(outputInvoiceRequest.getBillNum() + invoiceConfig.getSapSalt()); |
|
|
|
|
String md5Encode = MD5.getMd5Encode(outputInvoiceRequest.getBillNum() + invoiceConfig.getSapSalt() ); |
|
|
|
|
Map<String, String> headerMap = Maps.newHashMap(); |
|
|
|
|
headerMap.put("Authorization", md5Encode); |
|
|
|
|
headerMap.put("Authorization",md5Encode); |
|
|
|
|
String param = JSONObject.toJSONString(outputInvoiceRequest); |
|
|
|
|
if (StringUtils.isNotBlank(param) && param.length() > 400) { |
|
|
|
|
param = param.substring(0, 400); |
|
|
|
|
if(StringUtils.isNotBlank(param) && param.length() > 400){ |
|
|
|
|
param = param.substring(0,400); |
|
|
|
|
} |
|
|
|
|
log.info("call image check request url:{},header:{},parameter:{}", invoiceConfig.getSnYxUrl(), JSONObject.toJSONString(headerMap), param); |
|
|
|
|
log.info("call image check request url:{},header:{},parameter:{}",invoiceConfig.getSnYxUrl(),JSONObject.toJSONString(headerMap),param); |
|
|
|
|
String body = HttpRequest.post(invoiceConfig.getSnYxUrl()).addHeaders(headerMap).body(JSONObject.toJSONString(outputInvoiceRequest)).timeout(300000).execute().body(); |
|
|
|
|
log.info("call image check return parameter:{}", body); |
|
|
|
|
log.info("call image check return parameter:{}",body); |
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(body); |
|
|
|
|
String status = jsonObject.getString("status");//200 成功、 500 失败
|
|
|
|
|
String message = jsonObject.getString("message"); |
|
|
|
|
String data = jsonObject.getString("data"); |
|
|
|
|
if ("200".equals(status)) { |
|
|
|
|
if("200".equals(status)){ |
|
|
|
|
//成功
|
|
|
|
|
successPush(id, content, data, pushInfo1, pushType); |
|
|
|
|
} else { |
|
|
|
|
successPush(id,content,data,pushInfo1,pushType); |
|
|
|
|
}else { |
|
|
|
|
//失败
|
|
|
|
|
failPush(id, content, message, data, pushInfo1, pushType); |
|
|
|
|
failPush(id,content,message,data,pushInfo1,pushType); |
|
|
|
|
} |
|
|
|
|
//暂时不保存状态
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
String error = String.format("影像系统推送数据异常,%s ,推送类型为%s", e.getMessage(), pushType); |
|
|
|
|
String error=String.format("影像系统推送数据异常,%s ,推送类型为%s",e.getMessage(),pushType); |
|
|
|
|
log.error(error); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
failPush(id, content, error, e.getMessage(), pushInfo1, pushType); |
|
|
|
|
r.put(OrderManagementConstant.CODE, "9999"); |
|
|
|
|
r.put(OrderManagementConstant.ALL_MESSAGE, error); |
|
|
|
|
return r; |
|
|
|
|
failPush(id,content,error,e.getMessage(),pushInfo1,pushType); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|