예제 #1
0
        public AscmDeliBatOrderLink(AscmDeliBatOrderLink deliBatOrderLink, string wipEntityName, int wipEntityStatus, string materialDocNumber, string materialName, string materialUnit)
        {
            this.id = deliBatOrderLink.id;
            this.organizationId = deliBatOrderLink.organizationId;
            this.createUser = deliBatOrderLink.createUser;
            this.createTime = deliBatOrderLink.createTime;
            this.modifyUser = deliBatOrderLink.modifyUser;
            this.modifyTime = deliBatOrderLink.modifyTime;
            this.batchId = deliBatOrderLink.batchId;
            this.batchBarCode = deliBatOrderLink.batchBarCode;
            this.batchDocNumber = deliBatOrderLink.batchDocNumber;
            this.warehouseId = deliBatOrderLink.warehouseId;
            this.mainId = deliBatOrderLink.mainId;
            this.deliveryQuantity = deliBatOrderLink.deliveryQuantity;
            this.receivedQuantity = deliBatOrderLink.receivedQuantity;
            this.batchComments = deliBatOrderLink.batchComments;
            this.wipEntityId = deliBatOrderLink.wipEntityId;
            this.materialId = deliBatOrderLink.materialId;

            this.wipEntityName = wipEntityName;
            this.wipEntityStatus = wipEntityStatus;
            this._materialDocNumber = materialDocNumber;
            this._materialName = materialName;
            this._materialUnit = materialUnit;
        }
예제 #2
0
        public AscmDeliBatOrderLink(AscmDeliBatOrderLink deliBatOrderLink, string wipEntityName, int wipEntityStatus, string materialDocNumber, string materialName, string materialUnit)
        {
            this.id               = deliBatOrderLink.id;
            this.organizationId   = deliBatOrderLink.organizationId;
            this.createUser       = deliBatOrderLink.createUser;
            this.createTime       = deliBatOrderLink.createTime;
            this.modifyUser       = deliBatOrderLink.modifyUser;
            this.modifyTime       = deliBatOrderLink.modifyTime;
            this.batchId          = deliBatOrderLink.batchId;
            this.batchBarCode     = deliBatOrderLink.batchBarCode;
            this.batchDocNumber   = deliBatOrderLink.batchDocNumber;
            this.warehouseId      = deliBatOrderLink.warehouseId;
            this.mainId           = deliBatOrderLink.mainId;
            this.deliveryQuantity = deliBatOrderLink.deliveryQuantity;
            this.receivedQuantity = deliBatOrderLink.receivedQuantity;
            this.batchComments    = deliBatOrderLink.batchComments;
            this.wipEntityId      = deliBatOrderLink.wipEntityId;
            this.materialId       = deliBatOrderLink.materialId;

            this.wipEntityName      = wipEntityName;
            this.wipEntityStatus    = wipEntityStatus;
            this._materialDocNumber = materialDocNumber;
            this._materialName      = materialName;
            this._materialUnit      = materialUnit;
        }
예제 #3
0
 public void Delete(AscmDeliBatOrderLink ascmDeliBatOrderLink)
 {
     try
     {
         YnDaoHelper.GetInstance().nHibernateHelper.Delete<AscmDeliBatOrderLink>(ascmDeliBatOrderLink);
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("删除失败(Delete AscmDeliBatOrderLink)", ex);
         throw ex;
     }
 }
예제 #4
0
 public void Update(AscmDeliBatOrderLink ascmDeliBatOrderLink)
 {
     try
     {
         using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
         {
             try
             {
                 YnDaoHelper.GetInstance().nHibernateHelper.Update<AscmDeliBatOrderLink>(ascmDeliBatOrderLink);
                 tx.Commit();//正确执行提交
             }
             catch (Exception ex)
             {
                 tx.Rollback();//回滚
                 YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmDeliBatOrderLink)", ex);
                 throw ex;
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Save AscmDeliBatOrderLink)", ex);
         throw ex;
     }
 }
예제 #5
0
 public List<AscmDeliBatOrderLink> GetListByBatch(int batchId)
 {
     List<AscmDeliBatOrderLink> list = null;
     try
     {
         List<AscmDeliveryOrderDetail> listDeliOrderDetail = AscmDeliveryOrderDetailService.GetInstance().GetListByBatch(batchId);
         if (listDeliOrderDetail != null)
         {
             string ids = "";
             foreach (AscmDeliveryOrderDetail ascmDeliveryOrderDetail in listDeliOrderDetail)
             {
                 if (ids != "")
                     ids += ",";
                 ids += ascmDeliveryOrderDetail.id;
             }
             if (!string.IsNullOrEmpty(ids))
             {
                 string sql = "from AscmDeliBatOrderLink ";
                 string where = "";
                 where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, " id in(" + ids + ")");
                 if (!string.IsNullOrEmpty(where))
                     sql += " where " + where;
                 IList<AscmDeliBatOrderLink> ilist = YnDaoHelper.GetInstance().nHibernateHelper.Find<AscmDeliBatOrderLink>(sql);
                 if (ilist != null && ilist.Count > 0)
                 {
                     list = YnBaseClass2.Helper.ConvertHelper.ConvertIListToList<AscmDeliBatOrderLink>(ilist);
                     foreach (AscmDeliBatOrderLink deliBatOrderLink in list)
                     {
                         AscmDeliveryOrderDetail deliveryOrderDetail = listDeliOrderDetail.Find(P => P.id == deliBatOrderLink.id);
                         deliBatOrderLink.ascmDeliveryOrderDetail = deliveryOrderDetail;
                         deliBatOrderLink.batchId = batchId;
                         deliBatOrderLink.batchBarCode = deliveryOrderDetail.mainBatchBarCode;
                         deliBatOrderLink.batchDocNumber = deliveryOrderDetail.mainBatchDocNumber;
                         deliBatOrderLink.warehouseId = deliveryOrderDetail.warehouseId;
                         deliBatOrderLink.mainId = deliveryOrderDetail.mainId;
                     }
                 }
                 else
                 {
                     list = new List<AscmDeliBatOrderLink>();
                     foreach (AscmDeliveryOrderDetail deliveryOrderDetail in listDeliOrderDetail)
                     {
                         AscmDeliBatOrderLink ascmDeliBatOrderLink = new AscmDeliBatOrderLink();
                         ascmDeliBatOrderLink.id = deliveryOrderDetail.id;
                         ascmDeliBatOrderLink.ascmDeliveryOrderDetail = deliveryOrderDetail;
                         ascmDeliBatOrderLink.batchId = batchId;
                         ascmDeliBatOrderLink.batchBarCode = deliveryOrderDetail.mainBatchBarCode;
                         ascmDeliBatOrderLink.batchDocNumber = deliveryOrderDetail.mainBatchDocNumber;
                         ascmDeliBatOrderLink.warehouseId = deliveryOrderDetail.warehouseId;
                         ascmDeliBatOrderLink.mainId = deliveryOrderDetail.mainId;
                         ascmDeliBatOrderLink.deliveryQuantity = deliveryOrderDetail.deliveryQuantity;
                         ascmDeliBatOrderLink.receivedQuantity = deliveryOrderDetail.deliveryQuantity;
                         list.Add(ascmDeliBatOrderLink);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("查询失败(Find AscmDeliBatOrderLink)", ex);
         throw ex;
     }
     return list;
 }
예제 #6
0
        public OracleParameter[] GetSysReceiveParams(List<AscmDeliBatOrderLink> listDeliBatOrderLink, AscmDeliBatOrderLink ascmDeliBatOrderLink, string userId,out string paramsKey)
        {
            //注意MES存储过程中要求字符串数组长度一致,并且一一对应
            string[] headIds = listDeliBatOrderLink.Select(P => P.mainId.ToString()).ToArray();
            string[] lineIds = listDeliBatOrderLink.Select(P => P.id.ToString()).ToArray();
            string[] itemlocs = new string[lineIds.Length];
            string[] recqtys = listDeliBatOrderLink.Select(P => P.receivedQuantity.ToString()).ToArray();
            string[] mrecqtys = listDeliBatOrderLink.Select(P => P.deliveryQuantity.ToString()).ToArray();
            string[] priorities = new string[lineIds.Length];
            string[] istries = new string[lineIds.Length];
            string[] tryitemdesc = new string[lineIds.Length];
            //为数组元素指定默认值
            for (int i = 0; i < lineIds.Length; i++)
            {
                itemlocs[i] = "";
                priorities[i] = "IQC_Normal";
                istries[i] = "N";
                tryitemdesc[i] = "";
            }

            StringBuilder strKey = new StringBuilder();
            foreach (var item in headIds)
            {
                strKey.Append(item + ",");
            }
            foreach (var item in lineIds)
            {
                strKey.Append(item + ",");
            }
            paramsKey = strKey.ToString();

            return new OracleParameter[] {
                //库存组织
                new OracleParameter{
                    ParameterName = "i_org_id",
                    OracleDbType = OracleDbType.Int32,
                    Value = orgId,
                    Direction = ParameterDirection.Input
                },
                //送货批条码号
                new OracleParameter{
                    ParameterName = "i_batch_bar_code",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = ascmDeliBatOrderLink.batchBarCode,
                    Direction = ParameterDirection.Input
                },
                //自动返还,默认值FALSE
                new OracleParameter{
                    ParameterName = "i_autoreturnitem",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = "FALSE",
                    Direction = ParameterDirection.Input
                },
                //收货仓库编码
                new OracleParameter{
                    ParameterName = "i_inv_code",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = ascmDeliBatOrderLink.warehouseId,
                    Direction = ParameterDirection.Input
                },
                //是否外租仓,默认值N
                new OracleParameter{
                    ParameterName = "i_isrentedinv",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = "N",
                    Direction = ParameterDirection.Input
                },
                //是否外检合格,默认值N
                new OracleParameter{
                    ParameterName = "i_ischeckedokinvendor",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = "N",
                    Direction = ParameterDirection.Input
                },
                //送货单备注
                new OracleParameter{
                    ParameterName = "i_memo",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 240,
                    Value = "",
                    Direction = ParameterDirection.Input
                },
                //送货单头ID(字符串数组)
                new OracleParameter{
                    ParameterName = "i_headid",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = headIds,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //送货单行ID(字符串数组)
                new OracleParameter{
                    ParameterName = "i_lineid",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = lineIds,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //位置,支持多位置存储,多位置存储时用英文逗号隔开(字符串数组)
                new OracleParameter{
                    ParameterName = "i_itemloc",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = itemlocs,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //实收数量(字符串数组),不可为空
                new OracleParameter{
                    ParameterName = "i_recqty",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = recqtys,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //送货数量,根据多位置一一对应,当非多位置存储时默认为0(字符串数组)
                new OracleParameter{
                    ParameterName = "i_mrecqty",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = mrecqtys,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //紧急程度,默认值为:IQC_Normal(字符串数组)
                new OracleParameter{
                    ParameterName = "i_priority",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = priorities,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //试流,默认值为:N(字符串数组)
                new OracleParameter{
                    ParameterName = "i_istry",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = istries,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //试流物料,默认值为空(字符串数组)
                new OracleParameter{
                    ParameterName = "i_tryitemdesc",
                    OracleDbType = OracleDbType.Varchar2,
                    Value = tryitemdesc,
                    Direction = ParameterDirection.Input,
                    CollectionType = OracleCollectionType.PLSQLAssociativeArray
                },
                //用户名称
                new OracleParameter{
                    ParameterName = "i_user_code",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 80,
                    Value = userId,
                    Direction = ParameterDirection.Input
                },
                //返回参(值为0时表示成功)
                new OracleParameter{
                    ParameterName = "o_ret_code",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 4000,
                    Direction = ParameterDirection.Output
                },
                //返回参(错误信息)
                new OracleParameter{
                    ParameterName = "o_ret_msg",
                    OracleDbType = OracleDbType.Varchar2,
                    Size = 4000,
                    Direction = ParameterDirection.Output
                }
            };
        }