admin
19 小时以前 a67ef53c207e9aef0ad2be6d2310f8388d1d2830
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -273,6 +273,7 @@
            */
            var TypeLot = "1, 5, 6, 7";         //批次可为空单据类型
            int codeStrNum = 0;
            try
            {
                if (model.Origin == "录入" || model.Origin == "导入")
@@ -378,13 +379,16 @@
                                && m.CreateTime.ToString("yyyyMM") == DateTime.Now.ToString("yyyyMM")).Max(m => m.BoxCodeStr);
                            if(string.IsNullOrWhiteSpace(maxBoxCodeStr))
                            {
                                maxBoxCodeStr = "BK" + toDayTime.Substring(2, 4) + "0001";
                                string codeEndStr = (1 + codeStrNum).ToString().PadLeft(4, '0');
                                maxBoxCodeStr = "BK" + toDayTime.Substring(2, 4) + codeEndStr;
                            }
                            else
                            {
                                maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1).ToString();
                                maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1 + codeStrNum).ToString();
                            }
                            detailModel.BoxCodeStr = maxBoxCodeStr;
                            codeStrNum++;
                        }
                        // 判断是否已存在当前明细
@@ -417,7 +421,7 @@
                        //    DateTime lot22;
                        //    if (!DateTime.TryParse(detailModel.Lot1, out lot12))
                        //    {
                        //        throw new Exception("需要请验物料生产日期转换失败");
                        //        throw new Exception("需要请验料生产日期转换失败");
                        //    }
                        //    if (!DateTime.TryParse(detailModel.Lot2, out lot22))
                        //    {
@@ -431,16 +435,16 @@
                            DateTime lot12;
                            if (!DateTime.TryParse(detailModel.Lot1, out lot12))
                            {
                                throw new Exception("需要请验物料生产日期转换失败");
                                throw new Exception("生产日期转换失败,请检查格式是否正确");
                            }
                            lot1 = lot12.ToString("yyyy-MM-dd");
                        }
                        if (!string.IsNullOrEmpty(lot2))
                        {
                            DateTime lot22;
                            if (!DateTime.TryParse(detailModel.Lot1, out lot22))
                            if (!DateTime.TryParse(detailModel.Lot2, out lot22))
                            {
                                throw new Exception("需要请验物料生产日期转换失败");
                                throw new Exception("到期日期转换失败,请检查格式是否正确");
                            }
                            lot2 = lot22.ToString("yyyy-MM-dd");
                        }
@@ -520,6 +524,7 @@
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }
@@ -695,16 +700,16 @@
                            DateTime lot12;
                            if (!DateTime.TryParse(detailModel.Lot1, out lot12))
                            {
                                throw new Exception("需要请验物料生产日期转换失败");
                                throw new Exception("生产日期转换失败,请检查格式是否正确");
                            }
                            detailModel.Lot1 = lot12.ToString("yyyy-MM-dd");
                        }
                        if (!string.IsNullOrEmpty(detailModel.Lot2))
                        {
                            DateTime lot22;
                            if (!DateTime.TryParse(detailModel.Lot1, out lot22))
                            if (!DateTime.TryParse(detailModel.Lot2, out lot22))
                            {
                                throw new Exception("需要请验物料生产日期转换失败");
                                throw new Exception("到期日期转换失败,请检查格式是否正确");
                            }
                            detailModel.Lot2 = lot22.ToString("yyyy-MM-dd");
                        }
@@ -864,6 +869,7 @@
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw ex;
            }
        }