| | |
| | | */ |
| | | var TypeLot = "1, 5, 6, 7"; //批次可为空单据类型 |
| | | |
| | | int codeStrNum = 0; |
| | | try |
| | | { |
| | | if (model.Origin == "录入" || model.Origin == "导入") |
| | |
| | | && 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++; |
| | | } |
| | | |
| | | // 判断是否已存在当前明细 |