DEmon/iWareDataCore/BASE/Service/PlaceMaterialViewService.cs
@@ -43,12 +43,12 @@
        /// <summary>
        /// 获取各种状态的库位
        /// </summary>
        /// <returns></returns>
        public List<PlaceStatusNumEntity> GetPlaceStatusNum(out string msg)
        public List<PlaceStatusNumEntity> GetPlaceStatusNum(out string msg)
        {
            msg = "";
            List<PlaceStatusNumEntity> psnlst = new List<PlaceStatusNumEntity>();
@@ -77,7 +77,7 @@
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public List<PlaceMaterialViewEntity> GetPlacePreview(out string msg)
        public List<PlaceMaterialViewEntity> GetPlacePreview(out string msg)
        {
            msg = "";
            List<PlaceMaterialViewEntity> psnlst = new List<PlaceMaterialViewEntity>();
@@ -87,7 +87,8 @@
                {
                    string sql = @"SELECT A.id, ISNULL(C.createtime,'1990-01-01') as createtime, ISNULL(C.updatetime,'1990-01-01') as updatetime, A.code AS placecode, A.status,
A.islock, A.isexecute, B.name as placetypename, B.remark as placetyperemark, D.name, D.code AS materialcode, D.description, D.typeremark, D.typename, 
ISNULL(D.status,0) AS materialstatus, A.id as placeid, ISNULL(C.materialid,0) as materialid, D.remark, A.layer, A.col, A.row, A.typeid as placetypeid
ISNULL(D.status,0) AS materialstatus, A.id as placeid, ISNULL(C.materialid,0) as materialid, D.remark, A.layer, A.col, A.row, A.typeid as placetypeid,
D.thick, D.wide, D.length,D.IssueProjectNo,D.ProcurementProjectNo,D.SerialNo,D.ClassificationSociety,D.CuttingType,D.Version
FROM   dbo.BASEPlace AS A LEFT OUTER JOIN
       dbo.BASEPlaceType AS B ON A.typeid = B.id LEFT OUTER JOIN
       dbo.BASEPlaceMaterial as C on A.id=C.placeid  LEFT OUTER JOIN
@@ -118,7 +119,7 @@
                    return mcore.BASEPlaceMaterialViews.FirstOrDefault(x => x.materialcode == materialcode).placecode;
                }
            }
            catch (Exception ex)
            {
@@ -127,5 +128,40 @@
            }
        }
        /// <summary>
        /// 根据物料信息列表找取指定的库位物料信息 【Editby shaocx,2025-09-29】
        /// </summary>
        /// <param name="materialcode"></param>
        /// <returns></returns>
        public List<int> GetPlaceMaterialViewsByCodeList(List<string> materialcodeList, out string msg)
        {
            msg = "";
            try
            {
                using (DbModelCore mcore = new DbModelCore())
                {
                    var list = mcore.BASEPlaceMaterialViews.Where(x => materialcodeList.Contains(x.materialcode)).ToList();
                    foreach (var item in list)
                    {
                        if (!materialcodeList.Contains(item.materialcode))
                        {
                            msg = $"唯一编码{item.materialcode}没有库存";
                            return null;
                        }
                    }
                    return list.Select(x => x.id).ToList();
                }
            }
            catch (Exception ex)
            {
                msg = "异常:" + ex.ToString();
                LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "GetPlaceMaterialViewsByCodeList", ex.Message);
                return null;
            }
        }
    }
}