feat(材料管理):增加调拨出库
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
IF COL_LENGTH('dbo.Tw_InOutPlanMaster', 'TransferWarehouseId') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE dbo.Tw_InOutPlanMaster
|
||||
ADD TransferWarehouseId NVARCHAR(50) NULL;
|
||||
END;
|
||||
GO
|
||||
|
||||
IF COL_LENGTH('dbo.Tw_InOutPlanMaster', 'TransferBatchId') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE dbo.Tw_InOutPlanMaster
|
||||
ADD TransferBatchId NVARCHAR(50) NULL;
|
||||
END;
|
||||
GO
|
||||
|
||||
-- 创建 HJGL_DrawingRecognition_Material 表
|
||||
CREATE TABLE HJGL_DrawingRecognition_Material (
|
||||
id NVARCHAR(50) NOT NULL, -- 主键
|
||||
pipe_no NVARCHAR(200) NULL, -- 管线号
|
||||
pipe_page_no INT NULL, -- 管线号码
|
||||
seq_no INT NULL, -- 序号(原值为字符串 "1")
|
||||
category NVARCHAR(255) NULL, -- 类别(允许空)
|
||||
description NVARCHAR(1000) NULL, -- 描述(支持长文本)
|
||||
spec NVARCHAR(100) NULL, -- 规格
|
||||
code NVARCHAR(100) NULL, -- 代码
|
||||
qty NVARCHAR(50) NULL, -- 数量(含单位,如 "3.5 M")
|
||||
unit NVARCHAR(50) NULL, -- 单位(允许空)
|
||||
material NVARCHAR(255) NULL, -- 材料(允许空)
|
||||
drawing_number NVARCHAR(200) NULL, -- 图号(允许空)
|
||||
remark NVARCHAR(1000) NULL, -- 备注(允许空)
|
||||
CONSTRAINT PK_HJGL_DrawingRecognition_Material PRIMARY KEY (id) -- 主键约束
|
||||
);
|
||||
GO
|
||||
-- 创建 HJGL_DrawingRecognition_PipeLengths 表
|
||||
CREATE TABLE HJGL_DrawingRecognition_PipeLengths (
|
||||
id NVARCHAR(50) NOT NULL, -- 记录ID
|
||||
pipe_no INT NULL, -- 管线号
|
||||
pipe_page_no INT NULL, -- 管线号页码
|
||||
group_index INT NULL, -- 组索引
|
||||
pos_no NVARCHAR(50) NULL, -- 位置编号(如 "<1>")
|
||||
length_mm NVARCHAR(50) NULL, -- 长度(单位:毫米)
|
||||
dn NVARCHAR(50) NULL -- 公称直径(DN)
|
||||
CONSTRAINT PK_HJGL_DrawingRecognition_PipeLengths PRIMARY KEY (id) -- 主键约束
|
||||
);
|
||||
GO
|
||||
@@ -18,6 +18,8 @@ namespace BLL
|
||||
补料出库 = 50,
|
||||
其他出库 = 60,
|
||||
散件出库 = 70,
|
||||
调拨入库 = 80,
|
||||
调拨出库 = 90,
|
||||
}
|
||||
public enum Category : int
|
||||
{
|
||||
@@ -41,7 +43,9 @@ namespace BLL
|
||||
{ "领料出库" ,(int)TypeInt.领料出库},
|
||||
{ "补料出库" ,(int)TypeInt.补料出库},
|
||||
{ "其他出库" ,(int)TypeInt.其他出库},
|
||||
{ "散件出库" ,(int)TypeInt.散件出库}
|
||||
{ "散件出库" ,(int)TypeInt.散件出库},
|
||||
{ "调拨入库" ,(int)TypeInt.调拨入库},
|
||||
{ "调拨出库" ,(int)TypeInt.调拨出库}
|
||||
};
|
||||
public static Dictionary<string, int> PlanPrintMap = new Dictionary<string, int>
|
||||
{
|
||||
@@ -51,7 +55,9 @@ namespace BLL
|
||||
{ "材料领用申请单" ,(int)TypeInt.领料出库},
|
||||
{ "补料申请单" ,(int)TypeInt.补料出库},
|
||||
{ "其他出库申请单" ,(int)TypeInt.其他出库},
|
||||
{ "散件出库申请单" ,(int)TypeInt.散件出库}
|
||||
{ "散件出库申请单" ,(int)TypeInt.散件出库},
|
||||
{ "调拨入库申请单" ,(int)TypeInt.调拨入库},
|
||||
{ "调拨出库申请单" ,(int)TypeInt.调拨出库}
|
||||
};
|
||||
public static Dictionary<string, int> PrintMap = new Dictionary<string, int>
|
||||
{
|
||||
@@ -61,7 +67,9 @@ namespace BLL
|
||||
{ "材料出库单" ,(int)TypeInt.领料出库},
|
||||
{ "补料出库单" ,(int)TypeInt.补料出库},
|
||||
{ "其他出库单" ,(int)TypeInt.其他出库},
|
||||
{ "散件出库单" ,(int)TypeInt.散件出库}
|
||||
{ "散件出库单" ,(int)TypeInt.散件出库},
|
||||
{ "调拨入库单" ,(int)TypeInt.调拨入库},
|
||||
{ "调拨出库单" ,(int)TypeInt.调拨出库}
|
||||
};
|
||||
public static Dictionary<string, int> StateMap = new Dictionary<string, int>
|
||||
{
|
||||
@@ -78,4 +86,4 @@ namespace BLL
|
||||
{ "管段" ,(int)Category.管段},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Transactions;
|
||||
|
||||
|
||||
namespace BLL
|
||||
@@ -54,6 +55,8 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitWorkId) || x.WeldTaskId.Contains(table.UnitWorkId)) &&
|
||||
(string.IsNullOrEmpty(table.WeldTaskId) || x.WeldTaskId.Contains(table.WeldTaskId)) &&
|
||||
(string.IsNullOrEmpty(table.TransferWarehouseId) || x.TransferWarehouseId == table.TransferWarehouseId) &&
|
||||
(string.IsNullOrEmpty(table.TransferBatchId) || x.TransferBatchId == table.TransferBatchId) &&
|
||||
(table.InOutType == null || x.InOutType == table.InOutType) &&
|
||||
(table.TypeInt == null || x.TypeInt == table.TypeInt) &&
|
||||
(table.Category == null || x.Category == table.Category) &&
|
||||
@@ -90,7 +93,9 @@ namespace BLL
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseDate = x.WarehouseDate,
|
||||
WarehouseManName = warehouseperson.PersonName,
|
||||
PipeLineSortIndex = y.PipeLineSortIndex
|
||||
PipeLineSortIndex = y.PipeLineSortIndex,
|
||||
TransferWarehouseId = x.TransferWarehouseId,
|
||||
TransferBatchId = x.TransferBatchId
|
||||
|
||||
}
|
||||
;
|
||||
@@ -153,6 +158,8 @@ namespace BLL
|
||||
WarehouseDate = x.WarehouseDate,
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
PipeLineSortIndex = x.PipeLineSortIndex,
|
||||
TransferWarehouseId = x.TransferWarehouseId,
|
||||
TransferBatchId = x.TransferBatchId,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
@@ -203,7 +210,9 @@ namespace BLL
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseDate = x.WarehouseDate,
|
||||
WarehouseManName = x.WarehouseManName
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
TransferWarehouseId = x.TransferWarehouseId,
|
||||
TransferBatchId = x.TransferBatchId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -721,6 +730,8 @@ namespace BLL
|
||||
AuditDate2 = newtable.AuditDate2,
|
||||
WarehouseMan = newtable.WarehouseMan,
|
||||
WarehouseDate = newtable.WarehouseDate,
|
||||
TransferWarehouseId = newtable.TransferWarehouseId,
|
||||
TransferBatchId = newtable.TransferBatchId,
|
||||
};
|
||||
Funs.DB.Tw_InOutPlanMaster.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
@@ -753,6 +764,8 @@ namespace BLL
|
||||
table.AuditDate2 = newtable.AuditDate2;
|
||||
table.WarehouseMan = newtable.WarehouseMan;
|
||||
table.WarehouseDate = newtable.WarehouseDate;
|
||||
table.TransferWarehouseId = newtable.TransferWarehouseId;
|
||||
table.TransferBatchId = newtable.TransferBatchId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -932,6 +945,22 @@ namespace BLL
|
||||
}
|
||||
public static string GetDataInCusBillCode(string projectid, string unitcode, string typeString, string unitWorkCode = "", string Category = "")
|
||||
{
|
||||
if (typeString == TwConst.TypeInt.调拨出库.ToString())
|
||||
{
|
||||
string datePrefix = string.Format("{0:yyyyMMdd}", DateTime.Now);
|
||||
string codePrefix = datePrefix + "-TR-";
|
||||
var transferCodes = GetModle(new Tw_InOutMasterOutput
|
||||
{
|
||||
ProjectId = projectid,
|
||||
TypeInt = (int)TwConst.TypeInt.调拨出库
|
||||
})
|
||||
.Where(x => x.CusBillCode != null && x.CusBillCode.StartsWith(codePrefix))
|
||||
.Select(x => x.CusBillCode)
|
||||
.ToList();
|
||||
|
||||
int maxSequence = transferCodes.Select(GetTransferSequence).DefaultIfEmpty(0).Max();
|
||||
return string.Format("{0}-TR-{1}-OUT-AP", datePrefix, (maxSequence + 1).ToString("D2"));
|
||||
}
|
||||
if (typeString == TwConst.TypeInt.其他入库.ToString())
|
||||
{
|
||||
//生成规则是20240919-unitcode-AP-GR01
|
||||
@@ -998,6 +1027,220 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据调拨出库申请编号生成同批次调拨入库申请编号
|
||||
/// </summary>
|
||||
public static string GetTransferInCusBillCode(string outCusBillCode)
|
||||
{
|
||||
return (outCusBillCode ?? string.Empty).Replace("-OUT-AP", "-IN-AP");
|
||||
}
|
||||
|
||||
private static int GetTransferSequence(string cusBillCode)
|
||||
{
|
||||
string[] parts = (cusBillCode ?? string.Empty).Split('-');
|
||||
int sequence;
|
||||
return parts.Length >= 3 && int.TryParse(parts[2], out sequence) ? sequence : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交调拨出库草稿,并在同一事务内生成配对的调拨入库申请
|
||||
/// </summary>
|
||||
public static ResponeData SubmitTransferPlan(string outPlanId, string targetWarehouseId, IDictionary<string, decimal> detailPlanNums)
|
||||
{
|
||||
ResponeData result = new ResponeData();
|
||||
try
|
||||
{
|
||||
TransactionOptions options = new TransactionOptions
|
||||
{
|
||||
IsolationLevel = System.Transactions.IsolationLevel.Serializable,
|
||||
Timeout = TransactionManager.DefaultTimeout
|
||||
};
|
||||
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Tw_InOutPlanMaster outPlan = db.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == outPlanId);
|
||||
if (outPlan == null || outPlan.TypeInt != (int)TwConst.TypeInt.调拨出库)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "未找到有效的调拨出库申请!";
|
||||
return result;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(outPlan.TransferBatchId))
|
||||
{
|
||||
Tw_InOutPlanMaster existingInPlan = db.Tw_InOutPlanMaster.FirstOrDefault(x =>
|
||||
x.TransferBatchId == outPlan.TransferBatchId && x.InOutType == (int)TwConst.InOutType.入库);
|
||||
if (existingInPlan != null)
|
||||
{
|
||||
result.data = existingInPlan.Id;
|
||||
result.message = "调拨入库申请已生成。";
|
||||
scope.Complete();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (outPlan.State != (int)TwConst.State.待提交)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "只有待提交的调拨出库申请允许提交!";
|
||||
return result;
|
||||
}
|
||||
if (string.IsNullOrEmpty(targetWarehouseId) || targetWarehouseId == outPlan.WarehouseId)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "调出仓库和调入仓库不能为空且不能相同!";
|
||||
return result;
|
||||
}
|
||||
|
||||
Base_Warehouse sourceWarehouse = db.Base_Warehouse.FirstOrDefault(x => x.WarehouseId == outPlan.WarehouseId && x.ProjectId == outPlan.ProjectId);
|
||||
Base_Warehouse targetWarehouse = db.Base_Warehouse.FirstOrDefault(x => x.WarehouseId == targetWarehouseId && x.ProjectId == outPlan.ProjectId);
|
||||
if (sourceWarehouse == null || targetWarehouse == null)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "调出仓库或调入仓库不属于当前项目!";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(outPlan.TransferBatchId))
|
||||
{
|
||||
outPlan.TransferBatchId = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
List<Tw_InOutPlanDetail> outDetails = db.Tw_InOutPlanDetail.Where(x => x.InOutPlanMasterId == outPlan.Id).ToList();
|
||||
if (outDetails.Count == 0)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "请添加调拨明细!";
|
||||
return result;
|
||||
}
|
||||
if (detailPlanNums == null || detailPlanNums.Keys.Except(outDetails.Select(x => x.Id)).Any())
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "调拨明细数据已变化,请刷新后重新提交!";
|
||||
return result;
|
||||
}
|
||||
foreach (Tw_InOutPlanDetail detail in outDetails)
|
||||
{
|
||||
decimal planNum;
|
||||
if (!detailPlanNums.TryGetValue(detail.Id, out planNum) || planNum <= 0 || string.IsNullOrEmpty(detail.MaterialCode))
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = "调拨明细的材料主编码不能为空,计划数量必须大于0!";
|
||||
return result;
|
||||
}
|
||||
detail.PlanNum = planNum;
|
||||
}
|
||||
|
||||
// 调拨提交按材料主编码汇总校验,防止同一材料拆行后绕过库存上限。
|
||||
var planTotals = outDetails.GroupBy(x => x.MaterialCode).Select(x => new
|
||||
{
|
||||
MaterialCode = x.Key,
|
||||
PlanNum = x.Sum(y => y.PlanNum ?? 0)
|
||||
}).ToList();
|
||||
var stockTotals = db.Tw_MaterialStock
|
||||
.Where(x => x.ProjectId == outPlan.ProjectId && x.WarehouseId == outPlan.WarehouseId)
|
||||
.GroupBy(x => x.PipeLineMatCode)
|
||||
.Select(x => new
|
||||
{
|
||||
MaterialCode = x.Key,
|
||||
StockNum = x.Sum(y => y.StockNum ?? 0)
|
||||
}).ToList();
|
||||
foreach (var planTotal in planTotals)
|
||||
{
|
||||
decimal stockNum = stockTotals.Where(x => x.MaterialCode == planTotal.MaterialCode).Select(x => x.StockNum).FirstOrDefault();
|
||||
if (planTotal.PlanNum > stockNum)
|
||||
{
|
||||
result.code = 0;
|
||||
result.message = string.Format("材料[{0}]计划调拨数量{1}超过当前库存{2}!", planTotal.MaterialCode, planTotal.PlanNum, stockNum);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
outPlan.TransferWarehouseId = targetWarehouseId;
|
||||
outPlan.InOutType = (int)TwConst.InOutType.出库;
|
||||
outPlan.State = (int)TwConst.State.待审核;
|
||||
|
||||
string inPlanId = Guid.NewGuid().ToString();
|
||||
Tw_InOutPlanMaster inPlan = new Tw_InOutPlanMaster
|
||||
{
|
||||
Id = inPlanId,
|
||||
ProjectId = outPlan.ProjectId,
|
||||
CusBillCode = GetTransferInCusBillCode(outPlan.CusBillCode),
|
||||
WarehouseId = targetWarehouse.WarehouseId,
|
||||
WarehouseCode = targetWarehouse.WarehouseName,
|
||||
TransferWarehouseId = sourceWarehouse.WarehouseId,
|
||||
TransferBatchId = outPlan.TransferBatchId,
|
||||
Source = outPlan.Source,
|
||||
InOutType = (int)TwConst.InOutType.入库,
|
||||
TypeInt = (int)TwConst.TypeInt.调拨入库,
|
||||
State = (int)TwConst.State.待审核,
|
||||
CreateMan = outPlan.CreateMan,
|
||||
CreateDate = outPlan.CreateDate,
|
||||
WeldTaskId = outPlan.WeldTaskId,
|
||||
ReqUnitId = outPlan.ReqUnitId,
|
||||
Category = outPlan.Category,
|
||||
Remark = outPlan.Remark
|
||||
};
|
||||
db.Tw_InOutPlanMaster.InsertOnSubmit(inPlan);
|
||||
|
||||
List<Tw_InOutPlanDetail> inDetails = outDetails.Select(x => new Tw_InOutPlanDetail
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
InOutPlanMasterId = inPlanId,
|
||||
MaterialCode = x.MaterialCode,
|
||||
PlanNum = x.PlanNum,
|
||||
SortIndex = x.SortIndex
|
||||
}).ToList();
|
||||
db.Tw_InOutPlanDetail.InsertAllOnSubmit(inDetails);
|
||||
db.SubmitChanges();
|
||||
scope.Complete();
|
||||
result.data = inPlanId;
|
||||
result.message = "调拨出入库申请生成成功。";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string existingInPlanId = GetExistingTransferInPlanId(outPlanId);
|
||||
if (!string.IsNullOrEmpty(existingInPlanId))
|
||||
{
|
||||
result.code = 1;
|
||||
result.data = existingInPlanId;
|
||||
result.message = "调拨入库申请已生成。";
|
||||
return result;
|
||||
}
|
||||
result.code = 0;
|
||||
result.message = "调拨申请提交失败:" + ex.Message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 并发提交发生唯一键冲突或死锁时,回查已成功生成的配对入库申请。
|
||||
/// </summary>
|
||||
private static string GetExistingTransferInPlanId(string outPlanId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string transferBatchId = db.Tw_InOutPlanMaster
|
||||
.Where(x => x.Id == outPlanId)
|
||||
.Select(x => x.TransferBatchId)
|
||||
.FirstOrDefault();
|
||||
if (string.IsNullOrEmpty(transferBatchId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return db.Tw_InOutPlanMaster
|
||||
.Where(x => x.TransferBatchId == transferBatchId && x.InOutType == (int)TwConst.InOutType.入库)
|
||||
.Select(x => x.Id)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据任务单生成出库计划单
|
||||
/// </summary>
|
||||
|
||||
@@ -378,6 +378,9 @@ namespace BLL
|
||||
case TwConst.TypeInt.采购入库:
|
||||
cusBillCode = planCusBillCode.Replace("-AP", ""); ;
|
||||
break;
|
||||
case TwConst.TypeInt.调拨入库:
|
||||
cusBillCode = planCusBillCode.Replace("-AP", "-GI");
|
||||
break;
|
||||
}
|
||||
return cusBillCode;
|
||||
}
|
||||
|
||||
@@ -407,6 +407,9 @@ namespace BLL
|
||||
case TwConst.TypeInt.其他出库:
|
||||
cusBillCode = planCusBillCode.Replace("-AP-", "-GI-");
|
||||
break;
|
||||
case TwConst.TypeInt.调拨出库:
|
||||
cusBillCode = planCusBillCode.Replace("-AP", "-GI");
|
||||
break;
|
||||
|
||||
}
|
||||
return cusBillCode;
|
||||
|
||||
@@ -171,6 +171,11 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var model = BLL.TwInOutplanmasterService.GetById(rowID);
|
||||
if (!string.IsNullOrEmpty(model.TransferBatchId))
|
||||
{
|
||||
Alert.ShowInTop("已提交的调拨申请不允许单独删除!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (model.State == (int)TwConst.State.已审核 || model.State == (int)TwConst.State.已完成)
|
||||
{
|
||||
Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning);
|
||||
@@ -200,6 +205,11 @@ namespace FineUIPro.Web.CLGL
|
||||
}
|
||||
string ID = Grid1.SelectedRowID;
|
||||
var model = BLL.TwInOutplanmasterService.GetById(ID);
|
||||
if (model != null && model.TypeInt == (int)TwConst.TypeInt.调拨入库)
|
||||
{
|
||||
Alert.ShowInTop("调拨入库申请由调拨出库申请配对生成,不允许单独编辑!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (model != null) ///已上报时不能删除
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterApplyEdit.aspx?Id={0}", ID, "编辑 - ")));
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace FineUIPro.Web.CLGL
|
||||
|
||||
drpTypeInt.DataTextField = "Key";
|
||||
drpTypeInt.DataValueField = "Value";
|
||||
drpTypeInt.DataSource = TwConst.TypeIntMap.Where(x => x.Key.Contains("入库"));
|
||||
drpTypeInt.DataSource = TwConst.TypeIntMap.Where(x => x.Key.Contains("入库") && x.Value != (int)TwConst.TypeInt.调拨入库);
|
||||
drpTypeInt.DataBind();
|
||||
|
||||
drpCategory.DataTextField = "Key";
|
||||
@@ -160,6 +160,12 @@ namespace FineUIPro.Web.CLGL
|
||||
|
||||
private bool Save(string type, bool validateDetail)
|
||||
{
|
||||
var currentModel = string.IsNullOrEmpty(Id) ? null : TwInOutplanmasterService.GetById(Id);
|
||||
if (currentModel != null && currentModel.TypeInt == (int)TwConst.TypeInt.调拨入库)
|
||||
{
|
||||
Alert.ShowInTop("调拨入库申请不允许单独编辑!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
if (!ValidateMaster())
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -444,6 +444,11 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var model = BLL.TwInOutplanmasterService.GetById(rowID);
|
||||
if (!string.IsNullOrEmpty(model.TransferBatchId) && model.State != (int)TwConst.State.待提交)
|
||||
{
|
||||
Alert.ShowInTop("已提交的调拨申请不允许单独删除!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (model.State == (int)TwConst.State.已审核 || model.State == (int)TwConst.State.已完成)
|
||||
{
|
||||
Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning);
|
||||
@@ -530,7 +535,10 @@ namespace FineUIPro.Web.CLGL
|
||||
}
|
||||
string planId = Grid1.SelectedRowID;
|
||||
var planMaster = BLL.TwInOutplanmasterService.GetById(planId);
|
||||
if (planMaster.State == (int)TwConst.State.待提交 && (planMaster.TypeInt == (int)TwConst.TypeInt.散件出库 || planMaster.TypeInt == (int)TwConst.TypeInt.其他出库))
|
||||
if (planMaster.State == (int)TwConst.State.待提交 &&
|
||||
(planMaster.TypeInt == (int)TwConst.TypeInt.散件出库 ||
|
||||
planMaster.TypeInt == (int)TwConst.TypeInt.其他出库 ||
|
||||
planMaster.TypeInt == (int)TwConst.TypeInt.调拨出库))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?UnitWorkId={0}&Id={1} ", tvControlItem.SelectedNodeID, planId, "新增 - ")));
|
||||
|
||||
|
||||
@@ -134,10 +134,10 @@ namespace FineUIPro.Web.CLGL
|
||||
responeData.message = "请先保存出库单后再导入明细!";
|
||||
return responeData;
|
||||
}
|
||||
if (master.TypeInt != (int)TwConst.TypeInt.其他出库)
|
||||
if (master.TypeInt != (int)TwConst.TypeInt.其他出库 && master.TypeInt != (int)TwConst.TypeInt.调拨出库)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "只有选择其他出库时才允许导入出库明细!";
|
||||
responeData.message = "只有选择其他出库或调拨出库时才允许导入出库明细!";
|
||||
return responeData;
|
||||
}
|
||||
List<Tw_MaterialStockOutput> stockList = GetSelectableStockList(master);
|
||||
|
||||
@@ -40,15 +40,18 @@
|
||||
</f:TextBox>
|
||||
|
||||
<f:DropDownList ID="drpWarehouse" runat="server" Label="仓库" ColumnWidth="20%"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px">
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px" Required="true" ShowRedStar="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpTransferWarehouse" runat="server" Label="调入仓库" ColumnWidth="20%" Hidden="true"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px" Required="true" ShowRedStar="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpTypeInt" runat="server" Label="类型" ColumnWidth="20%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="30%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true"
|
||||
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="20%" OnSelectedIndexChanged="drpTypeInt_SelectedIndexChanged" AutoPostBack="true"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="30%" runat="server" ShowRedStar="true" Required="true">
|
||||
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="20%" runat="server" ShowRedStar="true" Required="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace FineUIPro.Web.CLGL
|
||||
drpReqUnit.SelectedValue = result.ReqUnitId;
|
||||
drpTypeInt.SelectedValue = result.TypeInt.ToString();
|
||||
drpWarehouse.SelectedValue = result.WarehouseId;
|
||||
drpTransferWarehouse.SelectedValue = result.TransferWarehouseId;
|
||||
drpCategory.SelectedValue = result.Category.ToString();
|
||||
txtRemark.Text = result.Remark;
|
||||
txtCusBillCode.Text = result.CusBillCode;
|
||||
@@ -75,7 +76,7 @@ namespace FineUIPro.Web.CLGL
|
||||
txtCreateMan.Text = this.CurrUser.PersonName;
|
||||
txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
drpReqUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(drpReqUnit.SelectedValue)?.UnitCode, UnitWorkService.getUnitWorkByUnitWorkId(UnitWorkId)?.UnitWorkCode, drpTypeInt.SelectedText, drpCategory.SelectedText);
|
||||
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(drpReqUnit.SelectedValue)?.UnitCode, drpTypeInt.SelectedText, UnitWorkService.getUnitWorkByUnitWorkId(UnitWorkId)?.UnitWorkCode, drpCategory.SelectedText);
|
||||
}
|
||||
|
||||
drpTypeInt_SelectedIndexChanged(null, null);
|
||||
@@ -90,7 +91,13 @@ namespace FineUIPro.Web.CLGL
|
||||
drpWarehouse.DataSource = BLL.TwInOutplanmasterService.GetWarehouseCode(this.CurrUser.LoginProjectId);
|
||||
drpWarehouse.DataBind();
|
||||
|
||||
string[] typeIntArr = { TwConst.TypeInt.散件出库.ToString(), TwConst.TypeInt.其他出库.ToString() };
|
||||
drpTransferWarehouse.DataTextField = "Key";
|
||||
drpTransferWarehouse.DataValueField = "Value";
|
||||
drpTransferWarehouse.DataSource = BLL.TwInOutplanmasterService.GetWarehouseCode(this.CurrUser.LoginProjectId);
|
||||
drpTransferWarehouse.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpTransferWarehouse);
|
||||
|
||||
string[] typeIntArr = { TwConst.TypeInt.散件出库.ToString(), TwConst.TypeInt.其他出库.ToString(), TwConst.TypeInt.调拨出库.ToString() };
|
||||
drpTypeInt.DataTextField = "Key";
|
||||
drpTypeInt.DataValueField = "Value";
|
||||
drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => typeIntArr.Contains(x.Key));
|
||||
@@ -117,7 +124,7 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
var queryRelationModel = new Tw_InOutDetailOutput();
|
||||
queryRelationModel.InOutPlanMasterId = Id;
|
||||
var tb = TwInOutplandetailService.GetListData(queryRelationModel, Grid1);
|
||||
var tb = TwInOutplandetailService.GetListData(queryRelationModel, Grid2);
|
||||
Grid2.DataSource = tb;
|
||||
Grid2.DataBind();
|
||||
}
|
||||
@@ -132,19 +139,19 @@ namespace FineUIPro.Web.CLGL
|
||||
/// <param name="e"></param>
|
||||
protected void btnSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save(Const.BtnSave);
|
||||
if (!Save(Const.BtnSave)) return;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelect.aspx?UnitWorkId={0}&Id={1}", UnitWorkId, Id, "选择- ")));
|
||||
|
||||
}
|
||||
protected void btnSelectStock_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save(Const.BtnSave);
|
||||
if (!Save(Const.BtnSave)) return;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelectStock.aspx?UnitWorkId={0}&Id={1}", UnitWorkId, Id, "选择- ")));
|
||||
|
||||
}
|
||||
protected void btnImportStock_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save(Const.BtnSave);
|
||||
if (!Save(Const.BtnSave)) return;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterDetailImport.aspx?Id={0}", Id, "导入- ")));
|
||||
|
||||
}
|
||||
@@ -152,19 +159,50 @@ namespace FineUIPro.Web.CLGL
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save(Const.BtnSave);
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
if (Save(Const.BtnSave))
|
||||
{
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save(Const.BtnSubmit);
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
if (IsTransferType())
|
||||
{
|
||||
Tw_InOutPlanMaster currentModel = string.IsNullOrEmpty(Id) ? null : TwInOutplanmasterService.GetById(Id);
|
||||
// 重复提交旧页面时直接查询配对结果,避免先保存而把已提交申请重置为待提交。
|
||||
if (currentModel == null || currentModel.State == (int)TwConst.State.待提交)
|
||||
{
|
||||
if (!Save(Const.BtnSave)) return;
|
||||
}
|
||||
ResponeData result = TwInOutplanmasterService.SubmitTransferPlan(Id, drpTransferWarehouse.SelectedValue, GetDetailPlanNums());
|
||||
if (result.code == 0)
|
||||
{
|
||||
Alert.ShowInTop(result.message, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
ShowNotify(result.message, MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Save(Const.BtnSubmit)) return;
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
void Save(string type)
|
||||
private bool Save(string type)
|
||||
{
|
||||
if (!ValidateMaster()) return false;
|
||||
|
||||
Tw_InOutPlanMaster currentModel = string.IsNullOrEmpty(Id) ? null : TwInOutplanmasterService.GetById(Id);
|
||||
if (currentModel != null && !string.IsNullOrEmpty(currentModel.TransferBatchId) &&
|
||||
currentModel.State != (int)TwConst.State.待提交)
|
||||
{
|
||||
Alert.ShowInTop("已提交的调拨申请不允许修改!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
int state = (int)TwConst.State.待提交;
|
||||
switch (type)
|
||||
{
|
||||
@@ -197,11 +235,12 @@ namespace FineUIPro.Web.CLGL
|
||||
Category = int.Parse(drpCategory.SelectedValue),
|
||||
State = state
|
||||
};
|
||||
SetTransferFields(model);
|
||||
TwInOutplanmasterService.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
var model = TwInOutplanmasterService.GetById(Id);
|
||||
var model = currentModel;
|
||||
model.CusBillCode = txtCusBillCode.Text;
|
||||
model.WarehouseId = drpWarehouse.SelectedValue;
|
||||
model.WarehouseCode = drpWarehouse.SelectedText;
|
||||
@@ -215,6 +254,7 @@ namespace FineUIPro.Web.CLGL
|
||||
model.InOutType = (int)TwConst.InOutType.出库;
|
||||
model.Category = int.Parse(drpCategory.SelectedValue);
|
||||
model.State = state;
|
||||
SetTransferFields(model);
|
||||
TwInOutplanmasterService.Update(model);
|
||||
}
|
||||
if (drpTypeInt.SelectedValue == ((int)TwConst.TypeInt.散件出库).ToString())
|
||||
@@ -226,6 +266,66 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
SaveDetail();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 调拨草稿保存对方仓库和稳定批次,切换为普通出库时清空调拨字段。
|
||||
/// </summary>
|
||||
private void SetTransferFields(Tw_InOutPlanMaster model)
|
||||
{
|
||||
if (IsTransferType())
|
||||
{
|
||||
model.TransferWarehouseId = drpTransferWarehouse.SelectedValue;
|
||||
if (string.IsNullOrEmpty(model.TransferBatchId))
|
||||
{
|
||||
model.TransferBatchId = Guid.NewGuid().ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
model.TransferWarehouseId = null;
|
||||
model.TransferBatchId = null;
|
||||
}
|
||||
}
|
||||
|
||||
private bool ValidateMaster()
|
||||
{
|
||||
if (string.IsNullOrEmpty(drpWarehouse.SelectedValue) || drpWarehouse.SelectedValue == Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择仓库!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
if (IsTransferType())
|
||||
{
|
||||
if (string.IsNullOrEmpty(drpTransferWarehouse.SelectedValue) || drpTransferWarehouse.SelectedValue == Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择调入仓库!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
if (drpTransferWarehouse.SelectedValue == drpWarehouse.SelectedValue)
|
||||
{
|
||||
Alert.ShowInTop("调出仓库和调入仓库不能相同!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsTransferType()
|
||||
{
|
||||
return drpTypeInt.SelectedValue == ((int)TwConst.TypeInt.调拨出库).ToString();
|
||||
}
|
||||
|
||||
private IDictionary<string, decimal> GetDetailPlanNums()
|
||||
{
|
||||
Dictionary<string, decimal> result = new Dictionary<string, decimal>();
|
||||
foreach (JObject row in Grid2.GetMergedData())
|
||||
{
|
||||
JObject values = row.Value<JObject>("values");
|
||||
result[row.Value<string>("id")] = values.Value<decimal>("PlanNum");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -315,6 +415,14 @@ namespace FineUIPro.Web.CLGL
|
||||
Grid1.Hidden = true;
|
||||
Grid2.Hidden = false;
|
||||
}
|
||||
|
||||
bool isTransfer = IsTransferType();
|
||||
drpWarehouse.Label = isTransfer ? "调出仓库" : "仓库";
|
||||
drpTransferWarehouse.Hidden = !isTransfer;
|
||||
if (!isTransfer)
|
||||
{
|
||||
drpTransferWarehouse.SelectedValue = Const._Null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,15 @@ namespace FineUIPro.Web.CLGL
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWarehouse;
|
||||
|
||||
/// <summary>
|
||||
/// drpTransferWarehouse 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpTransferWarehouse;
|
||||
|
||||
/// <summary>
|
||||
/// drpTypeInt 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -41,8 +41,11 @@
|
||||
runat="server" BoxFlex="1" DataKeyNames="id" EnableColumnLines="true" DataIDField="id" OnRowDoubleClick="Grid1_RowDoubleClick"
|
||||
EnableTextSelection="True" EnableRowDoubleClickEvent="true" AllowColumnLocking="true">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center" TextAlign="Center"/>
|
||||
<f:RenderField Width="70px" HeaderText="页码" ColumnID="page_no" DataField="page_no"
|
||||
<%--<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center" TextAlign="Center"/>--%>
|
||||
<f:RenderField Width="70px" HeaderText="序号" ColumnID="seq_no" DataField="seq_no"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" HeaderText="页码" ColumnID="page_no" DataField="page_no"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" HeaderText="管线号" ColumnID="pipe_no" DataField="pipe_no"
|
||||
|
||||
+627
-2
@@ -1,5 +1,4 @@
|
||||
|
||||
#pragma warning disable 1591
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
@@ -660,6 +659,12 @@ namespace Model
|
||||
partial void InsertHJGL_DesignBasisDataImportVerSionLog(HJGL_DesignBasisDataImportVerSionLog instance);
|
||||
partial void UpdateHJGL_DesignBasisDataImportVerSionLog(HJGL_DesignBasisDataImportVerSionLog instance);
|
||||
partial void DeleteHJGL_DesignBasisDataImportVerSionLog(HJGL_DesignBasisDataImportVerSionLog instance);
|
||||
partial void InsertHJGL_DrawingRecognition_Material(HJGL_DrawingRecognition_Material instance);
|
||||
partial void UpdateHJGL_DrawingRecognition_Material(HJGL_DrawingRecognition_Material instance);
|
||||
partial void DeleteHJGL_DrawingRecognition_Material(HJGL_DrawingRecognition_Material instance);
|
||||
partial void InsertHJGL_DrawingRecognition_PipeLengths(HJGL_DrawingRecognition_PipeLengths instance);
|
||||
partial void UpdateHJGL_DrawingRecognition_PipeLengths(HJGL_DrawingRecognition_PipeLengths instance);
|
||||
partial void DeleteHJGL_DrawingRecognition_PipeLengths(HJGL_DrawingRecognition_PipeLengths instance);
|
||||
partial void InsertHJGL_Hard_Report(HJGL_Hard_Report instance);
|
||||
partial void UpdateHJGL_Hard_Report(HJGL_Hard_Report instance);
|
||||
partial void DeleteHJGL_Hard_Report(HJGL_Hard_Report instance);
|
||||
@@ -3662,6 +3667,22 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<HJGL_DrawingRecognition_Material> HJGL_DrawingRecognition_Material
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<HJGL_DrawingRecognition_Material>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<HJGL_DrawingRecognition_PipeLengths> HJGL_DrawingRecognition_PipeLengths
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<HJGL_DrawingRecognition_PipeLengths>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<HJGL_Hard_Report> HJGL_Hard_Report
|
||||
{
|
||||
get
|
||||
@@ -96966,6 +96987,562 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_DrawingRecognition_Material")]
|
||||
public partial class HJGL_DrawingRecognition_Material : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private string _Id;
|
||||
|
||||
private string _Pipe_no;
|
||||
|
||||
private System.Nullable<int> _Pipe_page_no;
|
||||
|
||||
private System.Nullable<int> _Seq_no;
|
||||
|
||||
private string _Category;
|
||||
|
||||
private string _Description;
|
||||
|
||||
private string _Spec;
|
||||
|
||||
private string _Code;
|
||||
|
||||
private string _Qty;
|
||||
|
||||
private string _Unit;
|
||||
|
||||
private string _Material;
|
||||
|
||||
private string _Drawing_number;
|
||||
|
||||
private string _Remark;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnIdChanging(string value);
|
||||
partial void OnIdChanged();
|
||||
partial void OnPipe_noChanging(string value);
|
||||
partial void OnPipe_noChanged();
|
||||
partial void OnPipe_page_noChanging(System.Nullable<int> value);
|
||||
partial void OnPipe_page_noChanged();
|
||||
partial void OnSeq_noChanging(System.Nullable<int> value);
|
||||
partial void OnSeq_noChanged();
|
||||
partial void OnCategoryChanging(string value);
|
||||
partial void OnCategoryChanged();
|
||||
partial void OnDescriptionChanging(string value);
|
||||
partial void OnDescriptionChanged();
|
||||
partial void OnSpecChanging(string value);
|
||||
partial void OnSpecChanged();
|
||||
partial void OnCodeChanging(string value);
|
||||
partial void OnCodeChanged();
|
||||
partial void OnQtyChanging(string value);
|
||||
partial void OnQtyChanged();
|
||||
partial void OnUnitChanging(string value);
|
||||
partial void OnUnitChanged();
|
||||
partial void OnMaterialChanging(string value);
|
||||
partial void OnMaterialChanged();
|
||||
partial void OnDrawing_numberChanging(string value);
|
||||
partial void OnDrawing_numberChanged();
|
||||
partial void OnRemarkChanging(string value);
|
||||
partial void OnRemarkChanged();
|
||||
#endregion
|
||||
|
||||
public HJGL_DrawingRecognition_Material()
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="id", Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Id;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Id != value))
|
||||
{
|
||||
this.OnIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Id = value;
|
||||
this.SendPropertyChanged("Id");
|
||||
this.OnIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="pipe_no", Storage="_Pipe_no", DbType="NVarChar(200)")]
|
||||
public string Pipe_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Pipe_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Pipe_no != value))
|
||||
{
|
||||
this.OnPipe_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Pipe_no = value;
|
||||
this.SendPropertyChanged("Pipe_no");
|
||||
this.OnPipe_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="pipe_page_no", Storage="_Pipe_page_no", DbType="Int")]
|
||||
public System.Nullable<int> Pipe_page_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Pipe_page_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Pipe_page_no != value))
|
||||
{
|
||||
this.OnPipe_page_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Pipe_page_no = value;
|
||||
this.SendPropertyChanged("Pipe_page_no");
|
||||
this.OnPipe_page_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="seq_no", Storage="_Seq_no", DbType="Int")]
|
||||
public System.Nullable<int> Seq_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Seq_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Seq_no != value))
|
||||
{
|
||||
this.OnSeq_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Seq_no = value;
|
||||
this.SendPropertyChanged("Seq_no");
|
||||
this.OnSeq_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="category", Storage="_Category", DbType="NVarChar(255)")]
|
||||
public string Category
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Category;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Category != value))
|
||||
{
|
||||
this.OnCategoryChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Category = value;
|
||||
this.SendPropertyChanged("Category");
|
||||
this.OnCategoryChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="description", Storage="_Description", DbType="NVarChar(1000)")]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Description;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Description != value))
|
||||
{
|
||||
this.OnDescriptionChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Description = value;
|
||||
this.SendPropertyChanged("Description");
|
||||
this.OnDescriptionChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="spec", Storage="_Spec", DbType="NVarChar(100)")]
|
||||
public string Spec
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Spec;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Spec != value))
|
||||
{
|
||||
this.OnSpecChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Spec = value;
|
||||
this.SendPropertyChanged("Spec");
|
||||
this.OnSpecChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="code", Storage="_Code", DbType="NVarChar(100)")]
|
||||
public string Code
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Code;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Code != value))
|
||||
{
|
||||
this.OnCodeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Code = value;
|
||||
this.SendPropertyChanged("Code");
|
||||
this.OnCodeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="qty", Storage="_Qty", DbType="NVarChar(50)")]
|
||||
public string Qty
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Qty;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Qty != value))
|
||||
{
|
||||
this.OnQtyChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Qty = value;
|
||||
this.SendPropertyChanged("Qty");
|
||||
this.OnQtyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="unit", Storage="_Unit", DbType="NVarChar(50)")]
|
||||
public string Unit
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Unit;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Unit != value))
|
||||
{
|
||||
this.OnUnitChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Unit = value;
|
||||
this.SendPropertyChanged("Unit");
|
||||
this.OnUnitChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="material", Storage="_Material", DbType="NVarChar(255)")]
|
||||
public string Material
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Material;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Material != value))
|
||||
{
|
||||
this.OnMaterialChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Material = value;
|
||||
this.SendPropertyChanged("Material");
|
||||
this.OnMaterialChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="drawing_number", Storage="_Drawing_number", DbType="NVarChar(200)")]
|
||||
public string Drawing_number
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Drawing_number;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Drawing_number != value))
|
||||
{
|
||||
this.OnDrawing_numberChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Drawing_number = value;
|
||||
this.SendPropertyChanged("Drawing_number");
|
||||
this.OnDrawing_numberChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="remark", Storage="_Remark", DbType="NVarChar(1000)")]
|
||||
public string Remark
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Remark;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Remark != value))
|
||||
{
|
||||
this.OnRemarkChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Remark = value;
|
||||
this.SendPropertyChanged("Remark");
|
||||
this.OnRemarkChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_DrawingRecognition_PipeLengths")]
|
||||
public partial class HJGL_DrawingRecognition_PipeLengths : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private string _Id;
|
||||
|
||||
private System.Nullable<int> _Pipe_no;
|
||||
|
||||
private System.Nullable<int> _Pipe_page_no;
|
||||
|
||||
private System.Nullable<int> _Group_index;
|
||||
|
||||
private string _Pos_no;
|
||||
|
||||
private string _Length_mm;
|
||||
|
||||
private string _Dn;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnIdChanging(string value);
|
||||
partial void OnIdChanged();
|
||||
partial void OnPipe_noChanging(System.Nullable<int> value);
|
||||
partial void OnPipe_noChanged();
|
||||
partial void OnPipe_page_noChanging(System.Nullable<int> value);
|
||||
partial void OnPipe_page_noChanged();
|
||||
partial void OnGroup_indexChanging(System.Nullable<int> value);
|
||||
partial void OnGroup_indexChanged();
|
||||
partial void OnPos_noChanging(string value);
|
||||
partial void OnPos_noChanged();
|
||||
partial void OnLength_mmChanging(string value);
|
||||
partial void OnLength_mmChanged();
|
||||
partial void OnDnChanging(string value);
|
||||
partial void OnDnChanged();
|
||||
#endregion
|
||||
|
||||
public HJGL_DrawingRecognition_PipeLengths()
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="id", Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Id;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Id != value))
|
||||
{
|
||||
this.OnIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Id = value;
|
||||
this.SendPropertyChanged("Id");
|
||||
this.OnIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="pipe_no", Storage="_Pipe_no", DbType="Int")]
|
||||
public System.Nullable<int> Pipe_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Pipe_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Pipe_no != value))
|
||||
{
|
||||
this.OnPipe_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Pipe_no = value;
|
||||
this.SendPropertyChanged("Pipe_no");
|
||||
this.OnPipe_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="pipe_page_no", Storage="_Pipe_page_no", DbType="Int")]
|
||||
public System.Nullable<int> Pipe_page_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Pipe_page_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Pipe_page_no != value))
|
||||
{
|
||||
this.OnPipe_page_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Pipe_page_no = value;
|
||||
this.SendPropertyChanged("Pipe_page_no");
|
||||
this.OnPipe_page_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="group_index", Storage="_Group_index", DbType="Int")]
|
||||
public System.Nullable<int> Group_index
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Group_index;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Group_index != value))
|
||||
{
|
||||
this.OnGroup_indexChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Group_index = value;
|
||||
this.SendPropertyChanged("Group_index");
|
||||
this.OnGroup_indexChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="pos_no", Storage="_Pos_no", DbType="NVarChar(50)")]
|
||||
public string Pos_no
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Pos_no;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Pos_no != value))
|
||||
{
|
||||
this.OnPos_noChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Pos_no = value;
|
||||
this.SendPropertyChanged("Pos_no");
|
||||
this.OnPos_noChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="length_mm", Storage="_Length_mm", DbType="NVarChar(50)")]
|
||||
public string Length_mm
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Length_mm;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Length_mm != value))
|
||||
{
|
||||
this.OnLength_mmChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Length_mm = value;
|
||||
this.SendPropertyChanged("Length_mm");
|
||||
this.OnLength_mmChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="dn", Storage="_Dn", DbType="NVarChar(50)")]
|
||||
public string Dn
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Dn;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Dn != value))
|
||||
{
|
||||
this.OnDnChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Dn = value;
|
||||
this.SendPropertyChanged("Dn");
|
||||
this.OnDnChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_Hard_Report")]
|
||||
public partial class HJGL_Hard_Report : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
@@ -278888,6 +279465,10 @@ namespace Model
|
||||
|
||||
private string _WarehouseId;
|
||||
|
||||
private string _TransferWarehouseId;
|
||||
|
||||
private string _TransferBatchId;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
@@ -278936,6 +279517,10 @@ namespace Model
|
||||
partial void OnWarehouseDateChanged();
|
||||
partial void OnWarehouseIdChanging(string value);
|
||||
partial void OnWarehouseIdChanged();
|
||||
partial void OnTransferWarehouseIdChanging(string value);
|
||||
partial void OnTransferWarehouseIdChanged();
|
||||
partial void OnTransferBatchIdChanging(string value);
|
||||
partial void OnTransferBatchIdChanged();
|
||||
#endregion
|
||||
|
||||
public Tw_InOutPlanMaster()
|
||||
@@ -279383,6 +279968,46 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TransferWarehouseId", DbType="NVarChar(50)")]
|
||||
public string TransferWarehouseId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._TransferWarehouseId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._TransferWarehouseId != value))
|
||||
{
|
||||
this.OnTransferWarehouseIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._TransferWarehouseId = value;
|
||||
this.SendPropertyChanged("TransferWarehouseId");
|
||||
this.OnTransferWarehouseIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TransferBatchId", DbType="NVarChar(50)")]
|
||||
public string TransferBatchId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._TransferBatchId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._TransferBatchId != value))
|
||||
{
|
||||
this.OnTransferBatchIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._TransferBatchId = value;
|
||||
this.SendPropertyChanged("TransferBatchId");
|
||||
this.OnTransferBatchIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
Reference in New Issue
Block a user