diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs
index fafa517..514d77e 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs
@@ -211,7 +211,19 @@ namespace ICSSoft.Common
 
         [Description("调拨申请单")]
         [DBValue("47")]
-        StepTransferApplicationIn,   
+        StepTransferApplicationIn,
+
+        [Description("条码查询")]
+        [DBValue("70")]
+        LOTInfoGet,
+
+        [Description("绑定")]
+        [DBValue("71")]
+        ContainerBind,
+
+        [Description("解绑")]
+        [DBValue("72")]
+        ContainerUnBind,
 
     }
 }
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
index 58b3b12..3d2eb5e 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
@@ -918,18 +918,18 @@ namespace ICSSoft.DataProject
                                     WHERE {2} ";
                         #endregion
                     }
-                    else if(isMerge)//合并发料
+                    else if (isMerge)//合并发料
                     {
                         #region SLQ
-                        string sqlMerge = "SELECT ID FROM ICSMOPickMerge WHERE MergeID='"+ JsonData.TransCode + "' AND WorkPoint='"+ JsonData.WorkPoint + "'";
-                   
+                        string sqlMerge = "SELECT ID FROM ICSMOPickMerge WHERE MergeID='" + JsonData.TransCode + "' AND WorkPoint='" + JsonData.WorkPoint + "'";
+
                         DataTable sign = DBHelper.SQlReturnData(sqlMerge, cmd);
                         if (sign != null && flag.Rows.Count > 0)
                         {
                             string whereMerge = string.Format("mer.MergeID='{0}' AND mer.WorkPoint='{1}'", JsonData.TransCode, JsonData.WorkPoint);
                             sql = string.Format(sql, columnsMerge, tableNameMerge, whereMerge, JsonData.TransCode, JsonData.WorkPoint);
                         }
-                        else 
+                        else
                         {
                             sql = @" BEGIN
                                     IF EXISTS(SELECT a.ID FROM {1} INNER JOIN ICSMOPickMerge c ON a.ID=c.SourceID AND a.WorkPoint=c.WorkPoint WHERE {2})
@@ -939,14 +939,14 @@ namespace ICSSoft.DataProject
                                     END
                                 " + sqlCheck + sql + @"
                                 END";
-                        }           
+                        }
                         #endregion
                     }
                     else
                     {
                         sql = sqlCheck + sql;
                     }
-                    
+
                     where = string.Format(where, JsonData.TransCode, JsonData.WorkPoint);
                     sql = string.Format(sql, columns, tableName, where, JsonData.TransCode);
 
@@ -970,6 +970,132 @@ namespace ICSSoft.DataProject
         }
         #endregion
 
+        #region 料架信息
+        /// <summary>
+        /// 料架验证
+        /// </summary>
+        /// <param name="JsonData"></param>
+        /// <returns></returns>
+        public static Result ContainerCheck(ICSContainerInfo JsonData)
+        {
+            var language = LanguageHelper.GetName("WMSAPIInfo");
+            DataTable table = new DataTable();
+            string msg = "";
+            using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
+            {
+                conn.Open();
+                SqlCommand cmd = new SqlCommand();
+                cmd.Connection = conn;
+                try
+                {
+                    string TransType = JsonData.TransType;
+                    string ContainerID = "";
+                    if (String.IsNullOrEmpty(JsonData.ContainerCode))
+                    {
+                        msg = string.Format(language.GetNameByCode("WMSAPIInfo007"));//"传入数据为空!"
+                    }
+                    if (String.IsNullOrEmpty(JsonData.WorkPoint))
+                    {
+                        msg = string.Format(language.GetNameByCode("WMSAPIInfo004"));//"站点不能为空!"
+                    }
+                    if (TransType != TransTypeEnum.ContainerBind.GetDescription() && TransType != TransTypeEnum.ContainerUnBind.GetDescription())
+                    {
+                        throw new Exception(language.GetNameByCode("WMSAPIInfo199"));//"操作类型错误!"
+                    }
+                    string chksql = @"select ID,ContainerCode from ICSContainer
+                                      where ContainerCode='{0}' AND WorkPoint='{1}'";
+                    chksql = string.Format(chksql, JsonData.ContainerCode, JsonData.WorkPoint);
+                    DataTable chkdt = DBHelper.SQlReturnData(chksql, cmd);
+                    if (chkdt.Rows.Count == 0)
+                    {
+                        msg = string.Format(language.GetNameByCode("WMSAPIInfo195"), JsonData.ContainerCode);//"容器不存在!"
+                    }
+                    else
+                    {
+                        ContainerID = chkdt.Rows[0]["ID"].ToString();
+                    }
+                    if (TransType == TransTypeEnum.ContainerBind.GetDescription())
+                    {
+                        chksql = @" select C.LotNo from ICSContainer A
+                                INNER JOIN ICSContainerLot B ON B.ContainerID=A.ID AND B.WorkPoint=A.WorkPoint
+                                INNER JOIN ICSWareHouseLotInfo C ON C.LotNo=B.LotNo AND C.WorkPoint=B.WorkPoint
+                                WHERE A.ContainerCode='{0}' AND A.WorkPoint='{1}'";
+                        chksql = string.Format(chksql, JsonData.ContainerCode, JsonData.WorkPoint);
+                        chkdt = DBHelper.SQlReturnData(chksql, cmd);
+                        if (chkdt.Rows.Count != 0)
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo196"), JsonData.ContainerCode);//"容器已入库!"
+                        }
+                    }
+                    else
+                    {
+                        chksql = @"select LotNo from ICSContainerLot
+                                   where ContainerID='{0}' AND WorkPoint='{1}'";
+                        chksql = string.Format(chksql, ContainerID, JsonData.WorkPoint);
+                        chkdt = DBHelper.SQlReturnData(chksql, cmd);
+                        if (chkdt.Rows.Count == 0)
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo200"), JsonData.ContainerCode);//"容器未绑定条码!"
+                        }
+                        else
+                        {
+                            string sql = @"SELECT a.ID,
+                                           con.ContainerCode,
+                                           con.ContainerName,
+                                           a.LotNo,
+                                           a.InvCode,
+                                           inv.InvName,
+                                           inv.InvStd,
+                                           a.Quantity
+                                           FROM ICSWareHouseLotInfo a 
+                                           LEFT JOIN ICSContainerLot conlot ON a.LotNo=conlot.LotNo AND a.WorkPoint=conlot.WorkPoint
+                                           LEFT JOIN ICSContainer con ON conlot.ContainerID=con.ID AND conlot.WorkPoint=con.WorkPoint
+                                           INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint
+                                           WHERE  bom.ContainerCode='{0}' AND a.WorkPoint='{1}' ";
+                            sql = string.Format(sql, JsonData.ContainerCode, JsonData.WorkPoint);
+                            log.Info("条码sql:" + sql);
+                            table = DBHelper.SQlReturnData(sql, cmd);
+                        }
+                    }
+                    Result res = new Result();
+                    if (msg == "")
+                    {
+                        if (TransType == TransTypeEnum.ContainerBind.GetDescription())
+                        {
+                            res.Success = true;
+                            res.Message = msg;// "接口调用成功!";
+                        }
+                        else
+                        {
+                            res.Success = true;
+                            res.Message = msg;// "接口调用成功!";
+                            res.Data = table;
+                        }
+                    }
+                    else
+                    {
+                        res.Success = false;
+                        res.Message = msg;// "返回错误信息!";
+                    }
+                    return res;
+                }
+                catch (Exception ex)
+                {
+                    log.Error(ex.Message);
+                    throw new Exception(ex.Message);
+                }
+                finally
+                {
+                    if (conn.State == ConnectionState.Open)
+                    {
+                        conn.Close();
+                    }
+                    conn.Dispose();
+                }
+            }
+        }
+        #endregion
+
         #region 条码信息
         /// <summary>
         /// 条码信息
@@ -1193,10 +1319,10 @@ namespace ICSSoft.DataProject
                                     WHERE  bom.ContainerCode='{2}' AND a.WorkPoint='{3}' ";
                         }
                     }
-                        
 
-                    
-                    
+
+
+
                     #endregion
                     bool isOut = false;                 //出库标记
                     string columns = string.Empty;      //查询源头单据表的特殊列名
@@ -1222,7 +1348,7 @@ namespace ICSSoft.DataProject
                         || TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription()//开立委外红字入库单
                         || TransType == TransTypeEnum.BrrowDoc.GetDescription()                    //借用
                         || TransType == TransTypeEnum.TransferLibrary.GetDescription()             //移库
-                        //|| TransType == TransTypeEnum.DisassemblyDoc.GetDescription()             //拆卸单(散件生成条码入库)
+                                                                                                   //|| TransType == TransTypeEnum.DisassemblyDoc.GetDescription()             //拆卸单(散件生成条码入库)
                         )
                     {
                         isOut = true;
@@ -1230,17 +1356,17 @@ namespace ICSSoft.DataProject
                     //库位查询
                     if (TransType == TransTypeEnum.LocationSeatch.GetDescription())
                     {
-           //             Losql = @"" + Losql + "group by a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,s.WarehouseCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,s.sumQty,inv.AmountUnit,ext.ID,ext.ProjectCode,ext.Version,ext.Brand, " +
-           //                 "ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER ,a.MTIME";
+                        //             Losql = @"" + Losql + "group by a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,s.WarehouseCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,s.sumQty,inv.AmountUnit,ext.ID,ext.ProjectCode,ext.Version,ext.Brand, " +
+                        //                 "ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER ,a.MTIME";
 
-           //             columns = @"s.WarehouseCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,sum(a.Quantity) as Qty,s.sumQty,";
+                        //             columns = @"s.WarehouseCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,sum(a.Quantity) as Qty,s.sumQty,";
 
-           //             tableName = @"ICSWareHouseLotInfo a 
-											//LEFT JOIN ICSLocation b ON a.LocationCode = b.LocationCode and a.WorkPoint=b.WorkPoint
-											//INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint
-											//INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint
-											//LEFT JOIN (select SUM(Quantity) AS sumQty,WarehouseCode,INVCode from ICSWareHouseLotInfo  group by WarehouseCode,INVCode)s 
-											//ON a.INVCode=s.INVCode ";
+                        //             tableName = @"ICSWareHouseLotInfo a 
+                        //LEFT JOIN ICSLocation b ON a.LocationCode = b.LocationCode and a.WorkPoint=b.WorkPoint
+                        //INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint
+                        //INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint
+                        //LEFT JOIN (select SUM(Quantity) AS sumQty,WarehouseCode,INVCode from ICSWareHouseLotInfo  group by WarehouseCode,INVCode)s 
+                        //ON a.INVCode=s.INVCode ";
 
                     }
                     else
@@ -1694,6 +1820,25 @@ namespace ICSSoft.DataProject
                                     LEFT JOIN (SELECT EATTRIBUTE1 AS LotNo,WorkPoint,EATTRIBUTE1+'-'+CAST((MAX(CAST(SUBSTRING(LotNo, CHARINDEX('-', LotNo)+1, LEN(LotNo)-CHARINDEX('-', LotNo)) AS INT))+1) AS VARCHAR) AS SplitLotNo FROM ICSInventoryLot GROUP BY EATTRIBUTE1,WorkPoint) split ON a.LotNo=split.LotNo AND a.WorkPoint=split.WorkPoint
                                     LEFT JOIN ICSInventoryBatchEnable invBat ON a.InvCode=invBat.InvCode AND a.WarehouseCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint";
                         }
+                        else if (TransType == TransTypeEnum.LOTInfoGet.GetDescription())
+                        {
+                            sql = @"IF EXISTS(SELECT a.ID FROM ICSWareHouseLotInfo a WHERE a.LotNo='{2}' AND a.WorkPoint='{3}' AND a.Quantity>0)
+                                    BEGIN
+	                                    RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo039"), "{2}") + @"',16,1);
+                                        RETURN
+                                    END
+                                    IF NOT EXISTS(SELECT a.ID FROM ICSInventoryLot a WHERE a.LotNo='{2}' AND a.WorkPoint='{3}' )
+                                    BEGIN
+	                                    RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo038"), "{2}") + @"',16,1);
+                                        RETURN
+                                    END
+                                    " + sql;
+
+                            columns = @"a.Quantity,";
+
+                            tableName = @" ICSInventoryLot a
+                                    INNER JOIN ICSExtension ext ON ext.ID=a.ExtensionID AND ext.WorkPoint=a.WorkPoint";
+                        }
                         //出库条码
                         else if (isOut)
                         {
@@ -1780,7 +1925,7 @@ namespace ICSSoft.DataProject
 
                             if (ScanType == "LOTNO")
                             {
-                                
+
                                 sql = @" 
                                 IF NOT EXISTS(SELECT a.ID FROM ICSInventoryLot a WHERE a.LotNo = '{2}' AND a.WorkPoint = '{3}')
                                             BEGIN
@@ -1817,20 +1962,20 @@ namespace ICSSoft.DataProject
                                 LotTypesql = string.Format(LotTypesql, JsonData.Code, JsonData.WorkPoint);
                                 DataTable dt = DBHelper.SQlReturnData(LotTypesql, cmd);
                                 LotType = dt.Rows[0]["Type"].ToString();
-                                
+
 
                                 if (mode.itemCode.Equals("LocationRemind01"))
-                                    {
+                                {
                                     columnsWHNAME = @"
                                                 (SELECT Top 1 locat.LocationName from ICSWareHouseLotInfoLog log 
 											LEFT JOIN ICSLocation locat on locat.LocationCode=log.ToLocationCode and log.WorkPoint=locat.WorkPoint where log.TransType='2' and a.InvCode=log.InvCode AND a.WorkPoint=log.WorkPoint
 											ORDER BY log.Mtime desc) AS LocationName,";
-                                    
 
-                                        
-                                    }
-                                    else if (mode.itemCode.Equals("LocationRemind02"))
-                                    {
+
+
+                                }
+                                else if (mode.itemCode.Equals("LocationRemind02"))
+                                {
                                     columnsWHNAME = @"
                                             STUFF(
 											    (SELECT DISTINCT ',' + LocationName
@@ -1841,11 +1986,11 @@ namespace ICSSoft.DataProject
 											    ),1,1,''
 											    ) AS LocationName,";
 
-                                        
-                                    }
-                                    else
-                                    {
-                                        columnsWHNAME = @"
+
+                                }
+                                else
+                                {
+                                    columnsWHNAME = @"
                                         STUFF(
 											(SELECT DISTINCT ',' + LocationName
 												from ICSLocation  wh
@@ -1854,19 +1999,21 @@ namespace ICSSoft.DataProject
 												FOR xml path('')
 											),1,1,''
 											) AS LocationName,";
-                                        
-                                    }
+
+                                }
 
                                 #region 根据条码类型找到单据仓库信息
                                 if (LotType.Equals("1"))
                                 {//生产退料
                                     columnsWHCODE = @"(SELECT negg.WHCODE FROM ICSMOApplyNegDetail neg LEFT JOIN ICSMOApplyNeg negg ON neg.ApplyNegCode=negg.ApplyNegCode 
                                                         WHERE  lotdd.TransCode=neg.ApplyNegCode AND lotdd.TransSequence=neg.Sequence AND lotdd.WorkPoint=neg.WorkPoint and negg.Type='1') AS WHCode";
-                                }else if (LotType.Equals("2"))
+                                }
+                                else if (LotType.Equals("2"))
                                 {//委外退料
                                     columnsWHCODE = @"(SELECT negg.WHCODE FROM ICSOApplyNegDetail neg LEFT JOIN ICSOApplyNeg negg ON neg.OApplyNegCode=negg.OApplyNegCode 
                                                         WHERE  lotdd.TransCode=neg.OApplyNegCode AND lotdd.TransSequence=neg.Sequence AND lotdd.WorkPoint=neg.WorkPoint and negg.Type='1') AS WHCode";
-                                }else if (LotType.Equals("3"))
+                                }
+                                else if (LotType.Equals("3"))
                                 {//工单
                                     columnsWHCODE = @"(SELECT a.WHCode FROM ICSMO a WHERE a.MOCode=lotdd.TransCode AND a.Sequence=lotdd.TransSequence AND a.WorkPoint=lotdd.WorkPoint) AS WHCode";
                                 }
@@ -1999,13 +2146,13 @@ namespace ICSSoft.DataProject
                         if (string.IsNullOrWhiteSpace(columns) || string.IsNullOrWhiteSpace(tableName))
                             throw new Exception(language.GetNameByCode("WMSAPIInfo003"));
                     }
-                    
+
 
                     if (TransType == TransTypeEnum.LocationSeatch.GetDescription())
                     {
                         Losql = string.Format(Losql, columns, tableName, JsonData.Code, JsonData.WorkPoint);
 
-                         table = DBHelper.SQlReturnData(Losql, cmd);
+                        table = DBHelper.SQlReturnData(Losql, cmd);
                     }
                     else
                     {
@@ -2013,10 +2160,10 @@ namespace ICSSoft.DataProject
                         log.Info("条码sql:" + sql);
                         table = DBHelper.SQlReturnData(sql, cmd);
                     }
-                    
+
                     if (table == null || table.Rows.Count <= 0)
                         throw new Exception(language.GetNameByCode("WMSAPIInfo008"));//"未查询到条码数据!"
-                    
+
                     #region 出库检验是否符合源头单据
                     string msg = string.Empty;
                     bool isLimit = false;
@@ -2046,7 +2193,7 @@ namespace ICSSoft.DataProject
                             }
 
                         }
-                        else if(TransType != TransTypeEnum.LocationSeatch.GetDescription())
+                        else if (TransType != TransTypeEnum.LocationSeatch.GetDescription())
                         {
                             if (string.IsNullOrEmpty(JsonData.TransCode))
                             {
@@ -2209,7 +2356,7 @@ namespace ICSSoft.DataProject
                             throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
                         }
                         string WHTransType = "2";
-                        
+
 
                         foreach (var itemInfo in item.detail)
                         {
@@ -2378,7 +2525,7 @@ namespace ICSSoft.DataProject
                                 }
                                 //入库
                                 ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
-                                    item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID,itemInfo.InvCode + itemInfo.WarehouseCode);
+                                    item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode);
                             }
                         }
 
@@ -2423,7 +2570,7 @@ namespace ICSSoft.DataProject
                             ICSManufactureService.MOIssueDocNegativeERP(TransType, Identification, cmd, language, BusinessCode);
                         //生产入库
                         else if (TransType == TransTypeEnum.ManufactureReceiveDoc.GetDescription())
-                            ICSManufactureService.ManufactureReceiveDocERP(TransType, Identification, cmd, language,BusinessCode);
+                            ICSManufactureService.ManufactureReceiveDocERP(TransType, Identification, cmd, language, BusinessCode);
                         //开立的生产入库单
                         else if (TransType == TransTypeEnum.ManufactureReceive.GetDescription())
                             ICSManufactureService.ManufactureReceiveERP(TransType, Identification, cmd, language, BusinessCode);
@@ -2525,7 +2672,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription<DBValue>(), cmd, language);
                             }
                         }
@@ -2540,7 +2687,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingIssueDoc.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
@@ -2570,7 +2717,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.MOIssueDoc.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
@@ -2615,7 +2762,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.OtherOutDoc.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
@@ -2646,7 +2793,7 @@ namespace ICSSoft.DataProject
                             {
                                 //出库
                                 printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
-                                    item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription<DBValue>(), cmd, language,MergeID);
+                                    item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
                         #endregion
@@ -2660,7 +2807,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.MOIssue.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
@@ -2675,7 +2822,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.OOIssue.GetDescription<DBValue>(), cmd, language, MergeID);
                             }
                         }
@@ -2690,7 +2837,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.PurchaseReceive.GetDescription<DBValue>(), cmd, language);
                             }
                         }
@@ -2705,7 +2852,7 @@ namespace ICSSoft.DataProject
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription<DBValue>(), cmd, language);
                             }
                         }
@@ -2716,11 +2863,11 @@ namespace ICSSoft.DataProject
                             BusinessCode = TransTypeEnum.BrrowDoc.GetDescription<DBValue>();
                             //更新源头单据数量
                             ICSWareHouseService.BrrowDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
-                            
+
                             foreach (var itemInfo in item.detail)
                             {
                                 //出库
-                                printTable=ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
+                                printTable = ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity,
                                     item.User, item.WorkPoint, "3", TransTypeEnum.BrrowDoc.GetDescription<DBValue>(), cmd, language, MergeID);
 
                             }
@@ -2736,7 +2883,7 @@ namespace ICSSoft.DataProject
                     {
                         //采购退货
                         if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription())
-                            ICSPurchaseService.PurchaseReceiveDoctNegativeERP(TransType, Identification, cmd, language,BusinessCode);
+                            ICSPurchaseService.PurchaseReceiveDoctNegativeERP(TransType, Identification, cmd, language, BusinessCode);
                         //委外发料
                         else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription())
                             ICSOutsourcingService.OutsourcingIssueDocERP(TransType, Identification, cmd, language, BusinessCode);
@@ -2788,7 +2935,7 @@ namespace ICSSoft.DataProject
                         cmd.Transaction.Commit();
                         return table;
                     }
-                   
+
                 }
                 catch (Exception ex)
                 {
@@ -4734,7 +4881,7 @@ namespace ICSSoft.DataProject
                             ICSWareHouseService.OneStepTransferDocIn(item.TransCode, item.TransSequence, item.WorkPoint, itemInfo.CurrentQuantity, cmd, language);
 
                             //更新条码信息
-                            printTable=ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode,
+                            printTable = ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode,
                                 itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", TransTypeEnum.OneStepTransferDocIn.GetDescription<DBValue>(), cmd, language, MergeID);
                         }
                     }
@@ -4751,7 +4898,7 @@ namespace ICSSoft.DataProject
                         cmd.Transaction.Commit();
                         return table;
                     }
-                    
+
                 }
                 catch (Exception ex)
                 {
@@ -4858,7 +5005,7 @@ namespace ICSSoft.DataProject
         #endregion
 
 
-        
+
         #region 调拨申请单
         /// <summary>
         /// 调拨
@@ -5585,7 +5732,7 @@ namespace ICSSoft.DataProject
                     sql = @"SELECT a.ContainerCode, a.ContainerName,b.LotNo FROM ICSContainer a
                                     INNER JOIN ICSContainerLot b ON a.ID=b.ContainerID
                                     WHERE a.ContainerCODE+a.WorkPoint IN({0})";
-                    sql = string.Format(sql, codes.Substring(0,codes.Length - 1));
+                    sql = string.Format(sql, codes.Substring(0, codes.Length - 1));
                     DataTable table = DBHelper.SQlReturnData(sql, cmd);
                     cmd.Transaction.Commit();
                     return table;
@@ -6142,14 +6289,14 @@ namespace ICSSoft.DataProject
         /// <returns></returns>
         public static DataTable TransCodemationGet(TransferDoc JsonData)
         {
-            var language = LanguageHelper.GetName("WMSAPIInfo");   
+            var language = LanguageHelper.GetName("WMSAPIInfo");
             if (JsonData == null)
             {
                 throw new Exception(language.GetNameByCode("WMSAPIInfo007"));//"传送数据为空!"
             }
             using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
             {
-                conn.Open(); 
+                conn.Open();
                 SqlTransaction sqlTran = conn.BeginTransaction();
                 SqlCommand cmd = new SqlCommand();
                 cmd.Transaction = sqlTran;
@@ -6161,7 +6308,7 @@ namespace ICSSoft.DataProject
 
                     string sql = @"SELECT DISTINCT TransferNO as TransCode FROM ICSTransferApplication 
 WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by TransferNO desc";
-                    sql = string.Format(sql, Workpoint);   
+                    sql = string.Format(sql, Workpoint);
 
                     DataTable table = DBHelper.SQlReturnData(sql, cmd);
                     return table;
@@ -6185,6 +6332,79 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
         }
         #endregion
 
+        #region 料架条码绑定/解绑
+        /// <summary>
+        /// 料架条码绑定
+        /// </summary>
+        /// <param name="JsonData"></param>
+        /// <returns></returns>
+        public static Result ContainerBindCreate(List<ICSContainerBind> JsonData)
+        {
+            var language = LanguageHelper.GetName("WMSAPIInfo");
+            DataTable table = new DataTable();
+            string msg = "";
+            using (SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
+            {
+                conn.Open();
+                SqlCommand cmd = new SqlCommand();
+                cmd.Connection = conn;
+                try
+                {
+                    foreach (ICSContainerBind item in JsonData) 
+                    {
+                        string TransType = item.TransType;
+                        if (JsonData.Count <= 0)
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo007"));//"传入数据为空!"
+                        }
+                        if (String.IsNullOrEmpty(item.WorkPoint))
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo004"));//"站点不能为空!"
+                        }
+                        if (String.IsNullOrEmpty(item.LotNo))
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo005"));//"条码不能为空!"
+                        }
+                        if (String.IsNullOrEmpty(item.ContainerCode))
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo197"));//"料架不能为空!"
+                        }
+                        if (TransType != TransTypeEnum.ContainerBind.GetDescription() && TransType != TransTypeEnum.ContainerUnBind.GetDescription())
+                        {
+                            msg = string.Format(language.GetNameByCode("WMSAPIInfo199"));//"操作类型错误!"
+                        }
+                        if (TransType == TransTypeEnum.ContainerBind.GetDescription())
+                        {
+                            //料架条码绑定
+                            ICSWareHouseLotInfoService.ContainerBind(item.LotNo, item.ContainerCode, item.ContainerType, item.User, item.WorkPoint, cmd, language);
+                        }
+                        else
+                        {
+                            //料架条码解绑
+                            ICSWareHouseLotInfoService.ContainerUnBind(item.ContainerCode, item.WorkPoint, cmd, language);
+                        }
+                    }
+                    Result res = new Result();
+                    res.Success = true;
+                    res.Message = msg;// "接口调用成功!";
+                    return res;
+                }
+                catch (Exception ex)
+                {
+                    log.Error(ex.Message);
+                    throw new Exception(ex.Message);
+                }
+                finally
+                {
+                    if (conn.State == ConnectionState.Open)
+                    {
+                        conn.Close();
+                    }
+                    conn.Dispose();
+                }
+            }
+        }
+        #endregion
 
     }
 }
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
index f20fa7d..99f6ec9 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
@@ -52,7 +52,7 @@ namespace ICSSoft.DataProject
         /// <param name="cmd"></param>
         /// <param name="jointLotNo"></param>
         public static void WareHouseLotInfoUp(string Identification, string LocationCode, string LotNo, string Quantity, string User,
-        string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID,string jointLotNo)
+        string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID, string jointLotNo)
         {
             try
             {
@@ -172,7 +172,7 @@ namespace ICSSoft.DataProject
                 #endregion
 
                 #region 管控方式是"料品"时
-                
+
                 ControlMode mode = ICSControlModeService.GetControlMode();
 
                 if (mode.itemCode.Equals("ControlMode02"))
@@ -228,25 +228,25 @@ namespace ICSSoft.DataProject
                             lotNoMode.Version, lotNoMode.Brand, lotNoMode.cFree1, lotNoMode.cFree2, lotNoMode.cFree3, lotNoMode.cFree4, lotNoMode.cFree5, lotNoMode.cFree6, lotNoMode.cFree7,
                             lotNoMode.cFree8, lotNoMode.cFree9, lotNoMode.cFree10, cmd, language, LocationCode, LotNo);
                     }
-                        try
-                        {
+                    try
+                    {
 
-                         //合并前日志
-                            WareHouseLotInfoLog(Identification, jointLotNo, User, WorkPoint, "2",
-                                TransTypeEnum.LOTMergeBefore.GetDescription<DBValue>(), cmd, language);
-                            
-                         //更新目标条码库存
-                                WareHouseLotInfoMerge(Identification, jointLotNo, LotNo, Quantity, User, WorkPoint, "2",
-                                TransTypeEnum.LOTMergeAfter.GetDescription<DBValue>(), cmd, language);
-                        
-                          //合并后日志
-                            WareHouseLotInfoLog(Identification, jointLotNo, User, WorkPoint, "2",
-                                TransTypeEnum.LOTMergeAfter.GetDescription<DBValue>(), cmd, language);
-                        }
-                        catch (Exception)
-                        {
-                            throw;
-                        }
+                        //合并前日志
+                        WareHouseLotInfoLog(Identification, jointLotNo, User, WorkPoint, "2",
+                            TransTypeEnum.LOTMergeBefore.GetDescription<DBValue>(), cmd, language);
+
+                        //更新目标条码库存
+                        WareHouseLotInfoMerge(Identification, jointLotNo, LotNo, Quantity, User, WorkPoint, "2",
+                        TransTypeEnum.LOTMergeAfter.GetDescription<DBValue>(), cmd, language);
+
+                        //合并后日志
+                        WareHouseLotInfoLog(Identification, jointLotNo, User, WorkPoint, "2",
+                            TransTypeEnum.LOTMergeAfter.GetDescription<DBValue>(), cmd, language);
+                    }
+                    catch (Exception)
+                    {
+                        throw;
+                    }
 
 
                 }
@@ -386,9 +386,9 @@ namespace ICSSoft.DataProject
                             DROP table #resulttemp
                             DROP table #barcodetemp";
                     #endregion
-                    sql = String.Format(sql,LotNo,WorkPoint, Quantity);
-                    DataTable table = DBHelper.SQlReturnData(sql,cmd);
-                    string json = JsonConvert.SerializeObject(table); 
+                    sql = String.Format(sql, LotNo, WorkPoint, Quantity);
+                    DataTable table = DBHelper.SQlReturnData(sql, cmd);
+                    string json = JsonConvert.SerializeObject(table);
                     List<DownItemModel> downItemModels = JsonConvert.DeserializeObject<List<DownItemModel>>(json);
                     foreach (DownItemModel model in downItemModels)
                     {
@@ -396,10 +396,10 @@ namespace ICSSoft.DataProject
                         {
                             throw new Exception(language.GetNameByCode("WMSAPIInfo201"));
                         }
-                        WareHouseLotInfoDown(Identification,model.TransCode,model.Sequence + "~" + model.TransSequence,model.LotNo,model.Quantity,User,WorkPoint,"12",BusinessCode,cmd,language);
+                        WareHouseLotInfoDown(Identification, model.TransCode, model.Sequence + "~" + model.TransSequence, model.LotNo, model.Quantity, User, WorkPoint, "12", BusinessCode, cmd, language);
                         //回写已领数量
-                        sql = @"UPDATE ICSMOPick SET IssueQuantity=(ISNULL(IssueQuantity,0)+" + model.Quantity+") WHERE MODetailID='{0}' AND Sequence='{1}' AND WorkPoint='{2}'";
-                        sql = String.Format(sql,model.DetailID,model.TransSequence,WorkPoint);
+                        sql = @"UPDATE ICSMOPick SET IssueQuantity=(ISNULL(IssueQuantity,0)+" + model.Quantity + ") WHERE MODetailID='{0}' AND Sequence='{1}' AND WorkPoint='{2}'";
+                        sql = String.Format(sql, model.DetailID, model.TransSequence, WorkPoint);
                         if (!DBHelper.ExecuteNonQuery(sql, cmd))
                         {
                             throw new Exception(language.GetNameByCode("WMSAPIInfo199"));
@@ -553,7 +553,7 @@ namespace ICSSoft.DataProject
                         }
                         WareHouseLotInfoDown(Identification, model.TransCode, model.Sequence + "~" + model.TransSequence, model.LotNo, model.Quantity, User, WorkPoint, "13", BusinessCode, cmd, language);
                         //回写已领数量
-                        sql = @"UPDATE ICSOOPick SET IssueQuantity=(ISNULL(IssueQuantity,0)+" + model.Quantity+") WHERE OODetailID='{0}' AND Sequence='{1}' AND WorkPoint='{2}'";
+                        sql = @"UPDATE ICSOOPick SET IssueQuantity=(ISNULL(IssueQuantity,0)+" + model.Quantity + ") WHERE OODetailID='{0}' AND Sequence='{1}' AND WorkPoint='{2}'";
                         sql = String.Format(sql, model.DetailID, model.TransSequence, WorkPoint);
                         if (!DBHelper.ExecuteNonQuery(sql, cmd))
                         {
@@ -563,7 +563,7 @@ namespace ICSSoft.DataProject
                 }
                 #endregion
 
-                
+
 
             }
             catch (Exception)
@@ -597,7 +597,7 @@ namespace ICSSoft.DataProject
             DataTable lstDt = new DataTable();
             try
             {
-                
+
                 ///更新库存
                 string sql = @"UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)-'{2}' WHERE LotNo='{0}' AND WorkPoint='{1}'
 
@@ -613,7 +613,7 @@ namespace ICSSoft.DataProject
                     throw new Exception(language.GetNameByCode("WMSAPIInfo168"));//"库存更新失败!");
                 }
 
-                
+
 
                 //检验是否分批
                 sql = @"SELECT b.LotEnable,b.PrintEnable FROM ICSInventoryLot a
@@ -634,7 +634,7 @@ namespace ICSSoft.DataProject
                 if (LotEnable.Equals("True"))
                 {
                     ///分批前添加日志
-                     sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
+                    sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
                         BEGIN
 	                        RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1);
                             RETURN
@@ -755,7 +755,7 @@ namespace ICSSoft.DataProject
                                 ";
                         sql = string.Format(sql, LotNo, WorkPoint);
                         dtLotno = DBHelper.SQlReturnData(sql, cmd);
-                        lstDt=dtLotno;
+                        lstDt = dtLotno;
                     }
 
                     ///添加日志
@@ -792,7 +792,7 @@ namespace ICSSoft.DataProject
                 else
                 {
                     NewBarCodeList.Add(LotNo);
-                    
+
                     ///添加日志
                     sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
                         BEGIN
@@ -822,7 +822,7 @@ namespace ICSSoft.DataProject
                         throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
                     }
                 }
-                
+
 
 
             }
@@ -846,7 +846,7 @@ namespace ICSSoft.DataProject
         /// <param name="TransType"></param>
         /// <param name="cmd"></param>
         public static void WareHouseLotInfoUpdate(string Identification, string TransCode, string TransSequence, string LotNo, string Quantity, string User,
-            string WorkPoint, string TransType,string CheckKind, SqlCommand cmd, Dictionary<string, string> language)
+            string WorkPoint, string TransType, string CheckKind, SqlCommand cmd, Dictionary<string, string> language)
         {
             try
             {
@@ -1174,7 +1174,7 @@ namespace ICSSoft.DataProject
                         throw new Exception(language.GetNameByCode("WMSAPIInfo168"));//"库存更新失败!");
                     }
                 }
-                    
+
             }
             catch (Exception)
             {
@@ -1201,7 +1201,7 @@ namespace ICSSoft.DataProject
             {
 
                 string sql = @"SELECT WarehouseCode FROM ICSWareHouseLotInfo a WHERE LotNo='{0}' AND WorkPoint='{1}'";
-                sql = string.Format(sql, LotNo,WorkPoint);
+                sql = string.Format(sql, LotNo, WorkPoint);
                 DataTable dt = DBHelper.SQlReturnData(sql, cmd);
                 if (dt == null || dt.Rows.Count <= 0)
                 {
@@ -1209,7 +1209,7 @@ namespace ICSSoft.DataProject
                 }
                 string whcode = dt.Rows[0]["WarehouseCode"].ToString();
                 ///添加日志
-                 sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
+                sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
                         BEGIN
 	                        RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1);
                             RETURN
@@ -2200,7 +2200,7 @@ namespace ICSSoft.DataProject
         /// <param name="cmd"></param>
         /// <param name="language"></param>
         public static void CreateLotNo(string LotNo, string Quantity, string TransCode, string TransSequence, string WorkPoint, string Identification, string User, string InvCode, string BusinessCode,
-            string ProjectCode, string BatchCode, string Version, string Brand, string cFree1, string cFree2, string cFree3, string cFree4, string cFree5,string cFree6, string cFree7, string cFree8, string cFree9, string cFree10, SqlCommand cmd, Dictionary<string, string> language,string LocationCode,string OLDLotNo)
+            string ProjectCode, string BatchCode, string Version, string Brand, string cFree1, string cFree2, string cFree3, string cFree4, string cFree5, string cFree6, string cFree7, string cFree8, string cFree9, string cFree10, SqlCommand cmd, Dictionary<string, string> language, string LocationCode, string OLDLotNo)
         {
             try
             {
@@ -2231,25 +2231,25 @@ namespace ICSSoft.DataProject
                 //if (!EffectiveEnable.Equals("False"))
                 //{
                 int year = now.Year;
-                    int month = now.Month;
-                    int day = now.Day;
-                    int n = DateTime.DaysInMonth(year, month);
-                    int k = day + EffectiveDays;
-                    if (k > n)
-                    {
-                        day = EffectiveDays - (n - day);
-                        month = month + 1;
-                        if (month > 12)
-                        {
-                            month = 1;
-                            year = year + 1;
-                        }
-                    }
-                    else
+                int month = now.Month;
+                int day = now.Day;
+                int n = DateTime.DaysInMonth(year, month);
+                int k = day + EffectiveDays;
+                if (k > n)
+                {
+                    day = EffectiveDays - (n - day);
+                    month = month + 1;
+                    if (month > 12)
                     {
-                        day = day + EffectiveDays;
+                        month = 1;
+                        year = year + 1;
                     }
-                    Time = year + "-" + month + "-" + day;
+                }
+                else
+                {
+                    day = day + EffectiveDays;
+                }
+                Time = year + "-" + month + "-" + day;
                 //}
                 //else
                 //{
@@ -2300,7 +2300,7 @@ namespace ICSSoft.DataProject
                         FROM Sys_SRM_User f
                         where f.F_Account='{2}' and f.F_Location='{4}'
                         ";
-                sql = string.Format(sql, LotNo, Quantity, User, TransCode, WorkPoint, TransSequence, dtt, IDD,InvCode);
+                sql = string.Format(sql, LotNo, Quantity, User, TransCode, WorkPoint, TransSequence, dtt, IDD, InvCode);
                 if (!DBHelper.ExecuteNonQuery(sql, cmd))
                 {
                     throw new Exception(language.GetNameByCode("WMSAPIInfo366"));
@@ -2352,5 +2352,68 @@ namespace ICSSoft.DataProject
                 throw;
             }
         }
+
+        /// <summary>
+        /// 料架条码绑定
+        /// </summary>
+        /// <param name="LotNo"></param>
+        /// <param name="ContainerCode"></param>
+        /// <param name="User"></param>
+        /// <param name="WorkPoint"></param>
+        /// <param name="cmd"></param>
+        /// <param name="language"></param>
+        public static void ContainerBind(string LotNo, string ContainerCode, string ContainerType, string User, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language)
+        {
+            try
+            {
+                ///添加日志
+                string sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{3}' AND F_Location='{2}')
+                        BEGIN
+	                        RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{3}") + @"',16,1);
+                            RETURN
+                        END
+                        INSERT INTO ICSContainerLot
+                        (ID,ContainerID,LotNo,MUSER,MUSERName,WorkPoint,MTIME,EATTRIBUTE1)
+                        SELECT NEWID(),ID,'{0}','{3}'
+                        ,(SELECT F_RealName FROM Sys_SRM_User WHERE F_Account='{3}' AND F_Location='{2}'),'{2}',GETDATE(),'{4}' FROM ICSContainer
+                        WHERE ContainerCode='{1}' AND WorkPoint='{2}'
+                        ";
+                sql = string.Format(sql, LotNo, ContainerCode, WorkPoint, User, ContainerType);
+
+                if (!DBHelper.ExecuteNonQuery(sql, cmd))
+                {
+                    throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo060"), ContainerCode, LotNo));
+                }
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
+        /// <summary>
+        /// 料架条码解绑
+        /// </summary>
+        /// <param name="ContainerCode"></param>
+        /// <param name="WorkPoint"></param>
+        /// <param name="cmd"></param>
+        /// <param name="language"></param>
+        public static void ContainerUnBind(string ContainerCode, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language)
+        {
+            try
+            {
+                ///添加日志
+                string sql = @"delete from ICSContainerLot
+                               WHERE ContainerCode='{0}' AND WorkPoint='{1}'";
+                sql = string.Format(sql, ContainerCode, WorkPoint);
+                if (!DBHelper.ExecuteNonQuery(sql, cmd))
+                {
+                    throw new Exception(string.Format(language.GetNameByCode("WMSAPIInfo201"), ContainerCode, ContainerCode));
+                }
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
     }
 }
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
index 817ef3b..5a05d92 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
@@ -258,7 +258,43 @@ namespace ICSSoft.WebAPI.Controllers
             return result;
 
         }
-
+        /// <summary>
+        /// 验证箱号是否可用
+        /// </summary>
+        /// <param name="JsonData"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/ContainerCheck/Get")]
+        public HttpResponseMessage ContainerCheck([FromBody] object JsonData)
+        {
+            log.Info("获取条码信息传入值" + JsonData);
+            try
+            {
+                if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
+                {
+                    ICSContainerInfo model = new ICSContainerInfo();
+                    model = JsonConvert.DeserializeObject<ICSContainerInfo>(JsonData.ToString());
+                    //var resultStr = ICSSubmitService.BarCodeInformationGet(model);
+                    //res.Success = true;
+                    //res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+                    //res.Data = resultStr;
+                    res = ICSSubmitService.ContainerCheck(model);
+                }
+            }
+            catch (Exception ex)
+            {
+                log.Error("转换失败:" + ex.ToString());
+                res.Success = false;
+                res.Message = ex.Message;
+            }
+            finally
+            {
+                str = JsonConvert.SerializeObject(res);
+                result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
+            }
+            log.Debug("获取条码信息返回值:" + str);
+            return result;
+        }
         /// <summary>
         /// 使用中
         /// 获取条码信息
@@ -1852,7 +1888,7 @@ namespace ICSSoft.WebAPI.Controllers
 
         #region 调拨申请单
         [HttpPost]
-        [Route("api/TransferApplication/Update")]   
+        [Route("api/TransferApplication/Update")]
         public HttpResponseMessage ICSTransferApplicationupdte([FromBody] object JsonData)
         {
             log.Info("调拨单传入值" + JsonData);
@@ -1892,7 +1928,7 @@ namespace ICSSoft.WebAPI.Controllers
 
         #region 调拨申请单(无来源)
         [HttpPost]
-        [Route("api/TransferApplication/Create")]   
+        [Route("api/TransferApplication/Create")]
         public HttpResponseMessage TransferApplicationCreate([FromBody] object JsonData)
         {
             try
@@ -1903,7 +1939,7 @@ namespace ICSSoft.WebAPI.Controllers
                     model = JsonConvert.DeserializeObject<List<TransferApplication>>(JsonData.ToString());
                     //WMSBarCoreService action = new WMSBarCoreService();
                     //var resultStr = action.TransferDocupdte(model);
-                   // var resultStr = ICSSubmitService.TransferDocCreate(model);
+                    // var resultStr = ICSSubmitService.TransferDocCreate(model);
                     var resultStr = ICSSubmitService.TransferApplicationCreate(model);
                     res.Success = true;
                     res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
@@ -1931,7 +1967,7 @@ namespace ICSSoft.WebAPI.Controllers
 
         #region 调拨申请单
         [HttpPost]
-        [Route("api/TransferApplicationIn/Create")]   
+        [Route("api/TransferApplicationIn/Create")]
         public HttpResponseMessage TransferApplicationInCreate([FromBody] object JsonData)
         {
             try
@@ -1942,7 +1978,7 @@ namespace ICSSoft.WebAPI.Controllers
                     model = JsonConvert.DeserializeObject<List<TransferApplication>>(JsonData.ToString());
                     //WMSBarCoreService action = new WMSBarCoreService();
                     //var resultStr = action.TransferDocupdte(model);
-                   // var resultStr = ICSSubmitService.TransferDocInCreate(model);
+                    // var resultStr = ICSSubmitService.TransferDocInCreate(model);
                     var resultStr = ICSSubmitService.TransferApplicationInCreate(model);
                     res.Success = true;
                     res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
@@ -1970,7 +2006,7 @@ namespace ICSSoft.WebAPI.Controllers
 
         #region 获取所有未发,未发完调拨单
         [HttpPost]
-        [Route("api/TransferApplication/ Get")]    
+        [Route("api/TransferApplication/ Get")]
         public HttpResponseMessage TransCodemationGet([FromBody] object JsonData)
         {
             try
@@ -1981,7 +2017,7 @@ namespace ICSSoft.WebAPI.Controllers
                     model = JsonConvert.DeserializeObject<TransferDoc>(JsonData.ToString());
                     //WMSBarCoreService action = new WMSBarCoreService();
                     //var resultStr = action.TransferDocupdte(model);    
-                    
+
                     var resultStr = ICSSubmitService.TransCodemationGet(model);
                     res.Success = true;
                     res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
@@ -2061,6 +2097,90 @@ namespace ICSSoft.WebAPI.Controllers
             return result;
         }
         #endregion
-        
+
+        #region 条码容器绑定
+        /// <summary>
+        /// 条码容器绑定
+        /// </summary>
+        /// <param name="JsonData"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/ContainerBind/Create")]
+        public HttpResponseMessage ContainerBindCreate([FromBody] object JsonData)
+        {
+
+            log.Info("合并传入值" + JsonData);
+            try
+            {
+                if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
+                {
+                    List<ICSContainerBind> model = new List<ICSContainerBind>();
+                    model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
+                    //WMSBarCoreService action = new WMSBarCoreService();
+                    //var resultStr = action.LOTMergeCreate(model);
+                    //res.Success = true;
+                    //res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+                    ////res.Data = resultStr;
+                    res = ICSSubmitService.ContainerBindCreate(model);
+                }
+            }
+            catch (Exception ex)
+            {
+                log.Error("转换失败:" + ex.ToString());
+                res.Success = false;
+                res.Message = ex.Message;
+            }
+            finally
+            {
+                str = JsonConvert.SerializeObject(res);
+                result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
+            }
+            log.Debug("条码料架绑定返回值:" + str);
+            return result;
+        }
+        #endregion
+
+        #region 条码容器绑定
+        /// <summary>
+        /// 条码容器绑定
+        /// </summary>
+        /// <param name="JsonData"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [Route("api/ContainerUnBind/Create")]
+        public HttpResponseMessage ContainerUnBindCreate([FromBody] object JsonData)
+        {
+
+            log.Info("合并传入值" + JsonData);
+            try
+            {
+                if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
+                {
+                    List<ICSContainerBind> model = new List<ICSContainerBind>();
+                    model = JsonConvert.DeserializeObject<List<ICSContainerBind>>(JsonData.ToString());
+                    //WMSBarCoreService action = new WMSBarCoreService();
+                    //var resultStr = action.LOTMergeCreate(model);
+                    //res.Success = true;
+                    //res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+                    ////res.Data = resultStr;
+                    res = ICSSubmitService.ContainerBindCreate(model);
+                }
+            }
+            catch (Exception ex)
+            {
+                log.Error("转换失败:" + ex.ToString());
+                res.Success = false;
+                res.Message = ex.Message;
+            }
+            finally
+            {
+                str = JsonConvert.SerializeObject(res);
+                result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
+            }
+            log.Debug("条码料架绑定返回值:" + str);
+            return result;
+        }
+        #endregion
+
     }
 }