Subversion Repositories SmartDukaan

Rev

Rev 305 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 305 Rev 358
Line 35... Line 35...
35
     * 
35
     * 
36
     * @param id
36
     * @param id
37
     */
37
     */
38
    public Transaction getTransaction(long id) throws TransactionServiceException, TException;
38
    public Transaction getTransaction(long id) throws TransactionServiceException, TException;
39
 
39
 
40
    public List<Transaction> getAllTransactions(TransactionStatus status, long from_date, long to_date) throws TransactionServiceException, TException;
40
    public List<Transaction> getAllTransactions(TransactionStatus status, long from_date, long to_date, long warehouse_id) throws TransactionServiceException, TException;
41
 
41
 
42
    public List<Transaction> getTransactionsForShipmentStatus(ShipmentStatus status, long from_date, long to_date) throws TransactionServiceException, TException;
42
    public List<Transaction> getTransactionsForShipmentStatus(ShipmentStatus status, long from_date, long to_date) throws TransactionServiceException, TException;
43
 
43
 
44
    public List<Transaction> getTransactionsForCustomer(long customerId, long from_date, long to_date, TransactionStatus status) throws TransactionServiceException, TException;
44
    public List<Transaction> getTransactionsForCustomer(long customerId, long from_date, long to_date, TransactionStatus status) throws TransactionServiceException, TException;
45
 
45
 
Line 182... Line 182...
182
        throw result.ex;
182
        throw result.ex;
183
      }
183
      }
184
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransaction failed: unknown result");
184
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTransaction failed: unknown result");
185
    }
185
    }
186
 
186
 
187
    public List<Transaction> getAllTransactions(TransactionStatus status, long from_date, long to_date) throws TransactionServiceException, TException
187
    public List<Transaction> getAllTransactions(TransactionStatus status, long from_date, long to_date, long warehouse_id) throws TransactionServiceException, TException
188
    {
188
    {
189
      send_getAllTransactions(status, from_date, to_date);
189
      send_getAllTransactions(status, from_date, to_date, warehouse_id);
190
      return recv_getAllTransactions();
190
      return recv_getAllTransactions();
191
    }
191
    }
192
 
192
 
193
    public void send_getAllTransactions(TransactionStatus status, long from_date, long to_date) throws TException
193
    public void send_getAllTransactions(TransactionStatus status, long from_date, long to_date, long warehouse_id) throws TException
194
    {
194
    {
195
      oprot_.writeMessageBegin(new TMessage("getAllTransactions", TMessageType.CALL, seqid_));
195
      oprot_.writeMessageBegin(new TMessage("getAllTransactions", TMessageType.CALL, seqid_));
196
      getAllTransactions_args args = new getAllTransactions_args();
196
      getAllTransactions_args args = new getAllTransactions_args();
197
      args.status = status;
197
      args.status = status;
198
      args.from_date = from_date;
198
      args.from_date = from_date;
199
      args.to_date = to_date;
199
      args.to_date = to_date;
-
 
200
      args.warehouse_id = warehouse_id;
200
      args.write(oprot_);
201
      args.write(oprot_);
201
      oprot_.writeMessageEnd();
202
      oprot_.writeMessageEnd();
202
      oprot_.getTransport().flush();
203
      oprot_.getTransport().flush();
203
    }
204
    }
204
 
205
 
Line 1037... Line 1038...
1037
        getAllTransactions_args args = new getAllTransactions_args();
1038
        getAllTransactions_args args = new getAllTransactions_args();
1038
        args.read(iprot);
1039
        args.read(iprot);
1039
        iprot.readMessageEnd();
1040
        iprot.readMessageEnd();
1040
        getAllTransactions_result result = new getAllTransactions_result();
1041
        getAllTransactions_result result = new getAllTransactions_result();
1041
        try {
1042
        try {
1042
          result.success = iface_.getAllTransactions(args.status, args.from_date, args.to_date);
1043
          result.success = iface_.getAllTransactions(args.status, args.from_date, args.to_date, args.warehouse_id);
1043
        } catch (TransactionServiceException ex) {
1044
        } catch (TransactionServiceException ex) {
1044
          result.ex = ex;
1045
          result.ex = ex;
1045
        } catch (Throwable th) {
1046
        } catch (Throwable th) {
1046
          LOGGER.error("Internal error processing getAllTransactions", th);
1047
          LOGGER.error("Internal error processing getAllTransactions", th);
1047
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllTransactions");
1048
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllTransactions");
Line 2798... Line 2799...
2798
    private static final TStruct STRUCT_DESC = new TStruct("getAllTransactions_args");
2799
    private static final TStruct STRUCT_DESC = new TStruct("getAllTransactions_args");
2799
 
2800
 
2800
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)1);
2801
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)1);
2801
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)2);
2802
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)2);
2802
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)3);
2803
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)3);
-
 
2804
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)4);
2803
 
2805
 
2804
    private TransactionStatus status;
2806
    private TransactionStatus status;
2805
    private long from_date;
2807
    private long from_date;
2806
    private long to_date;
2808
    private long to_date;
-
 
2809
    private long warehouse_id;
2807
 
2810
 
2808
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2811
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2809
    public enum _Fields implements TFieldIdEnum {
2812
    public enum _Fields implements TFieldIdEnum {
2810
      /**
2813
      /**
2811
       * 
2814
       * 
2812
       * @see TransactionStatus
2815
       * @see TransactionStatus
2813
       */
2816
       */
2814
      STATUS((short)1, "status"),
2817
      STATUS((short)1, "status"),
2815
      FROM_DATE((short)2, "from_date"),
2818
      FROM_DATE((short)2, "from_date"),
2816
      TO_DATE((short)3, "to_date");
2819
      TO_DATE((short)3, "to_date"),
-
 
2820
      WAREHOUSE_ID((short)4, "warehouse_id");
2817
 
2821
 
2818
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2822
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2819
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2823
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2820
 
2824
 
2821
      static {
2825
      static {
Line 2867... Line 2871...
2867
    }
2871
    }
2868
 
2872
 
2869
    // isset id assignments
2873
    // isset id assignments
2870
    private static final int __FROM_DATE_ISSET_ID = 0;
2874
    private static final int __FROM_DATE_ISSET_ID = 0;
2871
    private static final int __TO_DATE_ISSET_ID = 1;
2875
    private static final int __TO_DATE_ISSET_ID = 1;
-
 
2876
    private static final int __WAREHOUSE_ID_ISSET_ID = 2;
2872
    private BitSet __isset_bit_vector = new BitSet(2);
2877
    private BitSet __isset_bit_vector = new BitSet(3);
2873
 
2878
 
2874
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2879
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2875
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
2880
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
2876
          new EnumMetaData(TType.ENUM, TransactionStatus.class)));
2881
          new EnumMetaData(TType.ENUM, TransactionStatus.class)));
2877
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
2882
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
2878
          new FieldValueMetaData(TType.I64)));
2883
          new FieldValueMetaData(TType.I64)));
2879
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
2884
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
2880
          new FieldValueMetaData(TType.I64)));
2885
          new FieldValueMetaData(TType.I64)));
-
 
2886
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
-
 
2887
          new FieldValueMetaData(TType.I64)));
2881
    }});
2888
    }});
2882
 
2889
 
2883
    static {
2890
    static {
2884
      FieldMetaData.addStructMetaDataMap(getAllTransactions_args.class, metaDataMap);
2891
      FieldMetaData.addStructMetaDataMap(getAllTransactions_args.class, metaDataMap);
2885
    }
2892
    }
Line 2888... Line 2895...
2888
    }
2895
    }
2889
 
2896
 
2890
    public getAllTransactions_args(
2897
    public getAllTransactions_args(
2891
      TransactionStatus status,
2898
      TransactionStatus status,
2892
      long from_date,
2899
      long from_date,
2893
      long to_date)
2900
      long to_date,
-
 
2901
      long warehouse_id)
2894
    {
2902
    {
2895
      this();
2903
      this();
2896
      this.status = status;
2904
      this.status = status;
2897
      this.from_date = from_date;
2905
      this.from_date = from_date;
2898
      setFrom_dateIsSet(true);
2906
      setFrom_dateIsSet(true);
2899
      this.to_date = to_date;
2907
      this.to_date = to_date;
2900
      setTo_dateIsSet(true);
2908
      setTo_dateIsSet(true);
-
 
2909
      this.warehouse_id = warehouse_id;
-
 
2910
      setWarehouse_idIsSet(true);
2901
    }
2911
    }
2902
 
2912
 
2903
    /**
2913
    /**
2904
     * Performs a deep copy on <i>other</i>.
2914
     * Performs a deep copy on <i>other</i>.
2905
     */
2915
     */
Line 2909... Line 2919...
2909
      if (other.isSetStatus()) {
2919
      if (other.isSetStatus()) {
2910
        this.status = other.status;
2920
        this.status = other.status;
2911
      }
2921
      }
2912
      this.from_date = other.from_date;
2922
      this.from_date = other.from_date;
2913
      this.to_date = other.to_date;
2923
      this.to_date = other.to_date;
-
 
2924
      this.warehouse_id = other.warehouse_id;
2914
    }
2925
    }
2915
 
2926
 
2916
    public getAllTransactions_args deepCopy() {
2927
    public getAllTransactions_args deepCopy() {
2917
      return new getAllTransactions_args(this);
2928
      return new getAllTransactions_args(this);
2918
    }
2929
    }
Line 2998... Line 3009...
2998
 
3009
 
2999
    public void setTo_dateIsSet(boolean value) {
3010
    public void setTo_dateIsSet(boolean value) {
3000
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
3011
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
3001
    }
3012
    }
3002
 
3013
 
-
 
3014
    public long getWarehouse_id() {
-
 
3015
      return this.warehouse_id;
-
 
3016
    }
-
 
3017
 
-
 
3018
    public getAllTransactions_args setWarehouse_id(long warehouse_id) {
-
 
3019
      this.warehouse_id = warehouse_id;
-
 
3020
      setWarehouse_idIsSet(true);
-
 
3021
      return this;
-
 
3022
    }
-
 
3023
 
-
 
3024
    public void unsetWarehouse_id() {
-
 
3025
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
-
 
3026
    }
-
 
3027
 
-
 
3028
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
-
 
3029
    public boolean isSetWarehouse_id() {
-
 
3030
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
-
 
3031
    }
-
 
3032
 
-
 
3033
    public void setWarehouse_idIsSet(boolean value) {
-
 
3034
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
-
 
3035
    }
-
 
3036
 
3003
    public void setFieldValue(_Fields field, Object value) {
3037
    public void setFieldValue(_Fields field, Object value) {
3004
      switch (field) {
3038
      switch (field) {
3005
      case STATUS:
3039
      case STATUS:
3006
        if (value == null) {
3040
        if (value == null) {
3007
          unsetStatus();
3041
          unsetStatus();
Line 3024... Line 3058...
3024
        } else {
3058
        } else {
3025
          setTo_date((Long)value);
3059
          setTo_date((Long)value);
3026
        }
3060
        }
3027
        break;
3061
        break;
3028
 
3062
 
-
 
3063
      case WAREHOUSE_ID:
-
 
3064
        if (value == null) {
-
 
3065
          unsetWarehouse_id();
-
 
3066
        } else {
-
 
3067
          setWarehouse_id((Long)value);
-
 
3068
        }
-
 
3069
        break;
-
 
3070
 
3029
      }
3071
      }
3030
    }
3072
    }
3031
 
3073
 
3032
    public void setFieldValue(int fieldID, Object value) {
3074
    public void setFieldValue(int fieldID, Object value) {
3033
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3075
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 3042... Line 3084...
3042
        return new Long(getFrom_date());
3084
        return new Long(getFrom_date());
3043
 
3085
 
3044
      case TO_DATE:
3086
      case TO_DATE:
3045
        return new Long(getTo_date());
3087
        return new Long(getTo_date());
3046
 
3088
 
-
 
3089
      case WAREHOUSE_ID:
-
 
3090
        return new Long(getWarehouse_id());
-
 
3091
 
3047
      }
3092
      }
3048
      throw new IllegalStateException();
3093
      throw new IllegalStateException();
3049
    }
3094
    }
3050
 
3095
 
3051
    public Object getFieldValue(int fieldId) {
3096
    public Object getFieldValue(int fieldId) {
Line 3059... Line 3104...
3059
        return isSetStatus();
3104
        return isSetStatus();
3060
      case FROM_DATE:
3105
      case FROM_DATE:
3061
        return isSetFrom_date();
3106
        return isSetFrom_date();
3062
      case TO_DATE:
3107
      case TO_DATE:
3063
        return isSetTo_date();
3108
        return isSetTo_date();
-
 
3109
      case WAREHOUSE_ID:
-
 
3110
        return isSetWarehouse_id();
3064
      }
3111
      }
3065
      throw new IllegalStateException();
3112
      throw new IllegalStateException();
3066
    }
3113
    }
3067
 
3114
 
3068
    public boolean isSet(int fieldID) {
3115
    public boolean isSet(int fieldID) {
Line 3107... Line 3154...
3107
          return false;
3154
          return false;
3108
        if (this.to_date != that.to_date)
3155
        if (this.to_date != that.to_date)
3109
          return false;
3156
          return false;
3110
      }
3157
      }
3111
 
3158
 
-
 
3159
      boolean this_present_warehouse_id = true;
-
 
3160
      boolean that_present_warehouse_id = true;
-
 
3161
      if (this_present_warehouse_id || that_present_warehouse_id) {
-
 
3162
        if (!(this_present_warehouse_id && that_present_warehouse_id))
-
 
3163
          return false;
-
 
3164
        if (this.warehouse_id != that.warehouse_id)
-
 
3165
          return false;
-
 
3166
      }
-
 
3167
 
3112
      return true;
3168
      return true;
3113
    }
3169
    }
3114
 
3170
 
3115
    @Override
3171
    @Override
3116
    public int hashCode() {
3172
    public int hashCode() {
Line 3147... Line 3203...
3147
      }
3203
      }
3148
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
3204
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
3149
      if (lastComparison != 0) {
3205
      if (lastComparison != 0) {
3150
        return lastComparison;
3206
        return lastComparison;
3151
      }
3207
      }
-
 
3208
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
-
 
3209
      if (lastComparison != 0) {
-
 
3210
        return lastComparison;
-
 
3211
      }
-
 
3212
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
-
 
3213
      if (lastComparison != 0) {
-
 
3214
        return lastComparison;
-
 
3215
      }
3152
      return 0;
3216
      return 0;
3153
    }
3217
    }
3154
 
3218
 
3155
    public void read(TProtocol iprot) throws TException {
3219
    public void read(TProtocol iprot) throws TException {
3156
      TField field;
3220
      TField field;
Line 3187... Line 3251...
3187
                setTo_dateIsSet(true);
3251
                setTo_dateIsSet(true);
3188
              } else { 
3252
              } else { 
3189
                TProtocolUtil.skip(iprot, field.type);
3253
                TProtocolUtil.skip(iprot, field.type);
3190
              }
3254
              }
3191
              break;
3255
              break;
-
 
3256
            case WAREHOUSE_ID:
-
 
3257
              if (field.type == TType.I64) {
-
 
3258
                this.warehouse_id = iprot.readI64();
-
 
3259
                setWarehouse_idIsSet(true);
-
 
3260
              } else { 
-
 
3261
                TProtocolUtil.skip(iprot, field.type);
-
 
3262
              }
-
 
3263
              break;
3192
          }
3264
          }
3193
          iprot.readFieldEnd();
3265
          iprot.readFieldEnd();
3194
        }
3266
        }
3195
      }
3267
      }
3196
      iprot.readStructEnd();
3268
      iprot.readStructEnd();
Line 3210... Line 3282...
3210
      oprot.writeI64(this.from_date);
3282
      oprot.writeI64(this.from_date);
3211
      oprot.writeFieldEnd();
3283
      oprot.writeFieldEnd();
3212
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
3284
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
3213
      oprot.writeI64(this.to_date);
3285
      oprot.writeI64(this.to_date);
3214
      oprot.writeFieldEnd();
3286
      oprot.writeFieldEnd();
-
 
3287
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
-
 
3288
      oprot.writeI64(this.warehouse_id);
-
 
3289
      oprot.writeFieldEnd();
3215
      oprot.writeFieldStop();
3290
      oprot.writeFieldStop();
3216
      oprot.writeStructEnd();
3291
      oprot.writeStructEnd();
3217
    }
3292
    }
3218
 
3293
 
3219
    @Override
3294
    @Override
Line 3242... Line 3317...
3242
      first = false;
3317
      first = false;
3243
      if (!first) sb.append(", ");
3318
      if (!first) sb.append(", ");
3244
      sb.append("to_date:");
3319
      sb.append("to_date:");
3245
      sb.append(this.to_date);
3320
      sb.append(this.to_date);
3246
      first = false;
3321
      first = false;
-
 
3322
      if (!first) sb.append(", ");
-
 
3323
      sb.append("warehouse_id:");
-
 
3324
      sb.append(this.warehouse_id);
-
 
3325
      first = false;
3247
      sb.append(")");
3326
      sb.append(")");
3248
      return sb.toString();
3327
      return sb.toString();
3249
    }
3328
    }
3250
 
3329
 
3251
    public void validate() throws TException {
3330
    public void validate() throws TException {