| | |
| | | */ |
| | | public class OrderDataFlow extends AbstractOrderDataFlowContext { |
| | | |
| | | public OrderDataFlow(){} |
| | | |
| | | protected OrderDataFlow(Date startDate, String code) { |
| | | public OrderDataFlow(Date startDate, String code) { |
| | | super(startDate, code); |
| | | } |
| | | |
| | |
| | | Assert.isJsonObject(reqInfo,"当前报文不是有效json,请检查"+reqInfo); |
| | | this.setDataFlowId(UUID.randomUUID().toString().replace("-","").toLowerCase()); |
| | | //赋值请求报文 |
| | | this.setResJson(JSONObject.parseObject(reqInfo)); |
| | | this.setReqJson(JSONObject.parseObject(reqInfo)); |
| | | //赋值 请求头信息 |
| | | this.setReqHeaders(headerAll); |
| | | |
| | | //构建返回头 |
| | | builderResHeaders(); |
| | | |
| | | //构建返回json 为{"msg":[]} |
| | | builderResJson(); |
| | | |
| | | //构建 订单信息 |
| | | builderOrders(); |
| | |
| | | |
| | | Assert.isDate(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME),"构建OrderDataFlow对象失败,请求头中"+CommonConstant.HTTP_REQ_TIME+"格式错误"); |
| | | |
| | | this.orders.setRequestTime(DateUtil.getDefaultDateFromString(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME))); |
| | | this.orders.setRequestTime(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME)); |
| | | |
| | | this.orders.setoId("-1"); |
| | | |
| | |
| | | |
| | | this.businessList = new ArrayList<Business>(); |
| | | |
| | | JSONArray tmpBusiness = this.getResJson().getJSONArray("business"); |
| | | JSONArray tmpBusiness = this.getReqJson().getJSONArray("business"); |
| | | |
| | | Business business = null; |
| | | for (int tmpBusinessIndex = 0;tmpBusinessIndex < tmpBusiness.size();tmpBusinessIndex++){ |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化构建返回报文 |
| | | */ |
| | | private void builderResJson(){ |
| | | JSONObject resJson = new JSONObject(); |
| | | resJson.put("msg",new JSONArray()); |
| | | this.setResJson(resJson); |
| | | } |
| | | |
| | | |
| | | public Orders getOrders() { |
| | | return orders; |