Exemple #1
0
 /// <summary>
 /// OrderPltType
 /// </summary>
 /// <param name="plt">plt</param>
 public S_common_ret OrderPltType(string plt)
 {
     try
     {
         S_common_ret ret = new S_common_ret();
         ret.state = 0;
         IList<PakWhPltTypeInfo> reGetTypeList = palletRepository.GetPakWhPltTypeListByPlt(plt);
         foreach (PakWhPltTypeInfo tmp in reGetTypeList)
         {
             if (null != tmp)
             {
                 if (tmp.bol.Length > 0)
                 {
                     //有资料时,不需要重新整理
                     ret.state = 101;
                     return ret;
                 }
                 else
                 {
                     break;
                 }
             }
         }
         S_DN_Extended value = GetDN(plt);
         if (value.success == 0)
         {
             ret.state = 3;
             return ret;
         }
         string regId = value.regId;
         if (regId != null && regId.Length == 3)
         { regId = regId.Substring(1, 2); }
         else
         { regId = ""; }
       //  if (value.regId == "SAF" || value.regId == "SCN")
         //if (regId == "AF" || regId == "CN")
         if (regId == "AF" || ActivityCommonImpl.Instance.CheckDomesticDN(regId))
         {
             if (null != value.consolidated
                 && value.consolidated.Length > 0)
             {
                 DoOrderPltType(value.consolidated, "Consolidated", value.carrier, value.consolidated);
             }
             else if (null != value.emeaCarrier
                 && value.emeaCarrier.Length > 0)
             {
                 DoOrderPltType(value.emeaCarrier, "EmeaCarrier", value.carrier, value.emeaCarrier);
             }
             else if (null != value.bol
                 && value.bol.Length > 0)
             {
                 DoOrderPltType(value.bol, "BOL", value.carrier, value.bol);
             }
             else if (null != value.carrier
                 && value.carrier.Length > 0)
             {
                 palletRepository.DeletePakWhPltTypeByPlt(plt);
                 PakWhPltTypeInfo newType = new PakWhPltTypeInfo();
                 newType.carrier = value.carrier;
                 newType.bol = value.carrier;
                 newType.plt = plt;
                 newType.cdt = DateTime.Now;
                 newType.tp = "F";
                 palletRepository.InsertPakWhPltTypeInfo(newType);
             }
         }
       //  else if (!(value.regId == "SAF" || value.regId == "SCN"))
         else if (!(regId == "AF" || ActivityCommonImpl.Instance.CheckDomesticDN(regId)))
       
         {
             if (null != value.emeaCarrier
                 && value.emeaCarrier.Length > 0)
             {
                 DoOrderPltType(value.emeaCarrier, "EmeaCarrier", value.carrier, value.emeaCarrier);
             }
             else if (null != value.bol
                 && value.bol.Length > 0)
             {
                 DoOrderPltType(value.bol, "BOL", value.carrier, value.bol);
             }
             else if (null != value.carrier
                 && value.carrier.Length > 0)
             {
                 palletRepository.DeletePakWhPltTypeByPlt(plt);
                 PakWhPltTypeInfo newType = new PakWhPltTypeInfo();
                 newType.carrier = value.carrier;
                 newType.bol = value.carrier;
                 newType.plt = plt;
                 newType.cdt = DateTime.Now;
                 newType.tp = "F";
                 palletRepository.InsertPakWhPltTypeInfo(newType);
             }
         }
         //成功结束
         ret.state = 102;
         return ret;
     }
     catch (FisException e)
     {
         logger.Error(e.mErrmsg, e);
         throw new Exception(e.mErrmsg);
     }
     catch (Exception e)
     {
         logger.Error(e.Message, e);
         throw new SystemException(e.Message);
     }
 }
Exemple #2
0
 void DoOrderPltType(string infoValue, string infoType, string para1, string para2)
 {
     IList<Delivery> deliveryList = currentRepository.GetDeliveryByValueAndType(infoValue, infoType);
     if (infoType == "Consolidated")
     {
         deliveryList = currentRepository.GetDeliveryListByInfoValue(infoValue);
     }
     IList<DeliveryPallet> palletList = new List<DeliveryPallet> ();
     foreach (Delivery tmp in deliveryList)
     {
         foreach (DeliveryPallet aPallet in tmp.DnPalletList)
         {
             bool nonAdd = false;
             foreach(DeliveryPallet bPallet in palletList)
             {
                 if (bPallet.PalletID == aPallet.PalletID)
                 {
                     nonAdd = true;
                     break;
                 }
             }
             if(nonAdd == false)
             {
                 palletList.Add(aPallet);
             }
         }
     }
     foreach (DeliveryPallet pallet in palletList)
     {
         palletRepository.DeletePakWhPltTypeByPlt(pallet.PalletID);
         PakWhPltTypeInfo newType = new PakWhPltTypeInfo();
         newType.carrier = para1;
         newType.bol = para2;
         newType.plt = pallet.PalletID;
         newType.cdt = DateTime.Now;
         newType.tp = "F";
         palletRepository.InsertPakWhPltTypeInfo(newType);
     }
 }