GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
GenerateOrderInfo generateOrderInfo = new GenerateOrderInfo();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm");
String payNo = geBcMaxNoService.getSerialNo(GeBcMaxNoService.PAYGROUP,sdf.format(date), PayInf.class);
String businessSource = basicService.getConfigValue("Interf", "Pay","comm", "BusinessSource");
String businessType = basicService.getConfigValue("Interf", "Pay","comm", "BusinessType");
String operateCode = basicService.getConfigValue("Interf", "Pay","comm", "OperateCode");
String endpoint = basicService.getConfigValue("Interf", "Car","ECarCommonService", "DBPayUrl");
String strUserCode = basicService.getConfigValue("Interf", "Car","ECarCommonService", "strUserCode");
String strComCode = basicService.getConfigValue("Interf", "Car","ECarCommonService", "strComCode");
String strSystemCode = basicService.getConfigValue("Interf", "Car", "ECarCommonService", "strSystemCode");
String operationName = basicService.getConfigValue("Interf", "Car", "ECarCommonService", "operationName");
String strRequestType = basicService.getConfigValue("Interf", "Car", "ECarCommonService", "GenerateOrderRequest");
BigDecimal sumPayfee = orderService.getPremium(orderNos);
// BigDecimal sumPayfee=new BigDecimal("0.01");
generateOrderInfo.setBusinessSource(businessSource);//
generateOrderInfo.setSourceOrder(payNo);//
generateOrderInfo.setSumPayfee(sumPayfee);//
generateOrderInfo.setOperateCode(operateCode);//
generateOrderInfo.setBusinessType(businessType);//
List<GenerateGoods> goodsList = payInfService.findGenerateGoods(orderNos);
GenerateSignInfo generateSign = new GenerateSignInfo();
String sign = "";
try {
sign = getSign241(generateOrderInfo, goodsList);
} catch (Exception e) {
e.printStackTrace();
}
generateSign.setSign(sign);// 签名密文
GenerateOrderRequestBody body = new GenerateOrderRequestBody();
Head head = new Head();
head.setComCode(strComCode);
head.setRequestType(strRequestType);
head.setUserCode(strUserCode);
body.setGoodsList(goodsList);
body.setOrderInfo(generateOrderInfo);
body.setSignInfo(generateSign);
generateOrderRequest.setHead(head);
generateOrderRequest.setBody(body);
JaxbBinder reqJaxbBinder = new JaxbBinder(GenerateOrderRequest.class);
String requestXml = reqJaxbBinder.toXml(generateOrderRequest, "UTF-8");
logger.info(requestXml);
String responseXml = CarWebserviceClient.webclientRPC(strUserCode, strComCode, strSystemCode, strRequestType, operationName,endpoint, requestXml);
logger.info(responseXml);
businessLogService.addBusinessLog("paymentRequest241", "", "", requestXml, strRequestType,responseXml);
JaxbBinder reseJaxbBinder = new JaxbBinder(GenerateOrderResponse.class);
GenerateOrderResponse response = reseJaxbBinder.fromXml(responseXml);