From d68c24f5f8355ac8e1dabee1f7504eda40aa64e2 Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期五, 15 十月 2021 10:42:53 +0800
Subject: [PATCH] 优化工序流转卡维护列表返回异常提示
---
PlanM/数据导入/Gy_DataIn_RoutingBill.cs | 163 +++++++++++++++++++++++++++---------------------------
1 files changed, 81 insertions(+), 82 deletions(-)
diff --git "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs" "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
index 26b6a9e..9f1b7aa 100644
--- "a/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
+++ "b/PlanM/\346\225\260\346\215\256\345\257\274\345\205\245/Gy_DataIn_RoutingBill.cs"
@@ -17,29 +17,29 @@
InitializeComponent();
}
- public int HMaterNumberCol = 0; //???????
- public int HProcNoCol = 0; //???????
- public int HProcNameCol = 0; //????
- public int HWorkCenterNameCol = 0; //????????
- public int HWorkQtyCol = 0; //???????
- public int HBeginDayQtyCol = 6; //????????
- public int HBeginFixQtyCol = 7; //????????
- public int HFixPriceCol = 8; //???? С?????
- public int HProcPriceCol = 9; //????
- public int HTechnologyParameterCol = 0; //???????
- public int HPicNumCol = 0; //?????
- public int HProcCheckNoteCol = 0; //???????????
+ public int HMaterNumberCol = 0; //产品代码
+ public int HProcNoCol = 0; //工序序号
+ public int HProcNameCol = 0; //工序
+ public int HWorkCenterNameCol = 0; //工作中心
+ public int HWorkQtyCol = 0; //加工数量
+ public int HBeginDayQtyCol = 6; //开工固天
+ public int HBeginFixQtyCol = 7; //开工余量
+ public int HFixPriceCol = 8; //定额 小时工资
+ public int HProcPriceCol = 9; //工价
+ public int HTechnologyParameterCol = 0; //工艺参数
+ public int HPicNumCol = 0; //图纸编号
+ public int HProcCheckNoteCol = 0; //本工序确认记录
- public int HPicNumVerCol = 0; //???汾
- public int HPicNumAssembleCol = 0; //??????
- public int HMaterTextureCol = 0; //????
- public int HProductNumCol = 0; //??????
- public int HVerNumCol = 0; //?汾
- public int HMouldNoCol = 0; //?????
- public int HProcWorkNumCol = 0; //?????
- public int HPassRateCol = 0; //????
+ public int HPicNumVerCol = 0; //图号版本
+ public int HPicNumAssembleCol = 0; //总装图号
+ public int HMaterTextureCol = 0; //材质
+ public int HProductNumCol = 0; //成品编号
+ public int HVerNumCol = 0; //版本
+ public int HMouldNoCol = 0; //模具编号
+ public int HProcWorkNumCol = 0; //程序号
+ public int HPassRateCol = 0; //良率
//
- public const int HBeginRow = 2; //??Ч????????????
+ public const int HBeginRow = 2; //有效数据,开始行数
//
public DAL.ClsGy_Process_View oProcHlp = new DAL.ClsGy_Process_View();
DAL.ClsGy_WorkCenter_View oCenHlp = new DAL.ClsGy_WorkCenter_View();
@@ -57,7 +57,7 @@
}
/// <summary>
- /// ?????????
+ /// 初始化界面
/// </summary>
public override void initData()
{
@@ -70,7 +70,7 @@
base.ModRightNameEdit = base.ModRightName + base.ModRightNameEdit;
base.ModRightNameMoney = base.ModRightName + base.ModRightNameMoney;
base.ModRightNameQty = base.ModRightName + base.ModRightNameQty;
- base.ModCaption = "????·?????";
+ base.ModCaption = "工艺路线导入";
this.Text = base.ModCaption;
lblCaption.Text = base.ModCaption;
//
@@ -78,7 +78,7 @@
DBUtility.Gy_BaseFun.SetComboxPeriod(cmbHPeriod);
//
}
- //????
+ //导入
public override void Sub_DataIn()
{
try
@@ -86,26 +86,26 @@
string hnumber = "";
string HBillNo = "";
//
- HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
- HProcNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
- HProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("????", grdMain);
- HWorkCenterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("????????", grdMain);
- HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
- HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
- HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????", grdMain);
- HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("???????????", grdMain);
- HPicNumVerCol = DBUtility.Gy_BaseFun.Fun_GetCol("???汾", grdMain);
- HPicNumAssembleCol = DBUtility.Gy_BaseFun.Fun_GetCol("??????", grdMain);
- HMaterTextureCol = DBUtility.Gy_BaseFun.Fun_GetCol("????", grdMain);
- HProductNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("??????", grdMain);
- HVerNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?汾", grdMain);
- HMouldNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
- HProcWorkNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("?????", grdMain);
- HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("????????", grdMain);
- HBeginDayQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("????????", grdMain);
- HFixPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("С?????", grdMain);
- HProcPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("????????", grdMain);
- HPassRateCol = DBUtility.Gy_BaseFun.Fun_GetCol("????", grdMain);
+ HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("产品代码", grdMain);
+ HProcNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序序号", grdMain);
+ HProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工序", grdMain);
+ HWorkCenterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("工作中心", grdMain);
+ HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("加工数量", grdMain);
+ HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("图纸编号", grdMain);
+ HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("工艺参数", grdMain);
+ HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("本工序确认记录", grdMain);
+ HPicNumVerCol = DBUtility.Gy_BaseFun.Fun_GetCol("图号版本", grdMain);
+ HPicNumAssembleCol = DBUtility.Gy_BaseFun.Fun_GetCol("总装图号", grdMain);
+ HMaterTextureCol = DBUtility.Gy_BaseFun.Fun_GetCol("材质", grdMain);
+ HProductNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("成品编号", grdMain);
+ HVerNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("版本", grdMain);
+ HMouldNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("模具编号", grdMain);
+ HProcWorkNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("程序号", grdMain);
+ HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("开工余量", grdMain);
+ HBeginDayQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("开工固天", grdMain);
+ HFixPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("小时工资", grdMain);
+ HProcPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("单个工价", grdMain);
+ HPassRateCol = DBUtility.Gy_BaseFun.Fun_GetCol("良率", grdMain);
//没有找到列
if (HMaterNumberCol == -1)
@@ -232,11 +232,6 @@
}
for (int i = 0; i <= grdMain.Rows.Count - 1; i++)
{
- BillNew.omodel.HPicNumVer = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumVerCol].Value);
- BillNew.omodel.HPicNumAssemble = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumAssembleCol].Value);
- BillNew.omodel.HMaterTexture = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterTextureCol].Value);
- BillNew.omodel.HProductNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProductNumCol].Value);
- BillNew.omodel.HVerNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HVerNumCol].Value);
string sHNumber = "";
if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value) != "")
{
@@ -251,7 +246,7 @@
if (hnumber == DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value))
{
- //???????????
+ //得到物料内码
if (oMaterHlp.GetInfoByNumber(sHNumber))
{
if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID)
@@ -261,16 +256,20 @@
BillNew.omodel.HUnitID = oMaterHlp.omodel.HUnitID;
BillNew.omodel.HUnitNumber = oMaterHlp.omodel.HUnitNumber;
}
-
+ BillNew.omodel.HPicNumVer = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumVerCol].Value);
+ BillNew.omodel.HPicNumAssemble = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumAssembleCol].Value);
+ BillNew.omodel.HMaterTexture = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterTextureCol].Value);
+ BillNew.omodel.HProductNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProductNumCol].Value);
+ BillNew.omodel.HVerNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HVerNumCol].Value);
}
else
{
BillNew.omodel.HMaterID = 0;
- MessageBox.Show("??" + i.ToString() + "??," + sHNumber + "????????????????");
+ MessageBox.Show("第" + i.ToString() + "行," + sHNumber + "没有找到对应的物料!");
return;
}
j++;
- //д????
+ //写入类
WriteClass(i);
}
@@ -279,18 +278,18 @@
DataSet Ds;
ClsCN oCn = new ClsCN();
bool b = false;
- // ?ж??????????·??
+ // 判断是否存在工艺路线
Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain");
if (checkadd.Checked == true)
{
- //if (Ds.Tables[0].Rows.Count == 0)//???
+ //if (Ds.Tables[0].Rows.Count == 0)//追加
//{
- //????? ????????????
+ //新增前 先删除原来工艺
BillNew.DeleteByMaterID(BillNew.omodel.HMaterID);
b = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
if (b == false)
{
- MessageBox.Show("??" + i.ToString() + "??,????" + BillNew.omodel.HMaterNumber + "????????·??????????293???У????" + ClsPub.sExeReturnInfo);
+ MessageBox.Show("第" + i.ToString() + "行,物料" + BillNew.omodel.HMaterNumber + "新增工艺路线失败!代码293行中,原因:" + ClsPub.sExeReturnInfo);
return;
}
c++;
@@ -319,13 +318,13 @@
hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value);
- //????????????
+ //审核代码是否合理
if (!DBUtility.ClsPub.AllowNumber(sHNumber))
{
- MessageBox.Show("????????в????????????.????????λ?λ???????.????", "???");
+ MessageBox.Show("物料代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
return;
}
- //???????????
+ //得到物料内码
if (oMaterHlp.GetInfoByNumber(sHNumber))
{
if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID)
@@ -382,7 +381,7 @@
}
}
- //д???? ????
+ //写入类 从控件
private bool WriteClass(int row)
{
string sHNumber = "";
@@ -402,22 +401,22 @@
sBeginDayQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginDayQtyCol].Value);
sBeginFixQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginFixQtyCol].Value);
sHPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HPassRateCol].Value);
- //?ж???????? ????
+ //判断是否允许 保存
Model.ClsGy_RoutingBillSub oSub = new Model.ClsGy_RoutingBillSub();
- //???????????
+ //得到工序内码
if (oProcHlp.GetInfoByName(sHNamePoc))
{
oSub.HProcID = oProcHlp.omodel.HItemID;
}
- //???????????
+ //得到车间内码
if (oCenHlp.GetInfoByName(sHNumberCen))
{
oSub.HCenterID = oCenHlp.omodel.HItemID;
}
- //д?????
+ //写入信息
oSub.HEntryID = j;
oSub.HProcNo = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[HProcNoCol].Value);
@@ -425,7 +424,7 @@
oSub.HWorkQty = sWorkQty;
oSub.HPassRate = sHPassRate;
oSub.HRemark = "";
- oSub.HTimeUnit = "С?";
+ oSub.HTimeUnit = "小时";
oSub.HReadyTime = 0;
oSub.HQueueTime = 0;
oSub.HMoveTime = 0;
@@ -457,7 +456,7 @@
return true;
}
- //???????
+ //检查物料
private bool Checkdata()
{
bool b = false;
@@ -481,53 +480,53 @@
{
//
int index = i + 1;
- //???????????С???????
+ //加工数量不能小于等于零
if (sWorkQty <= 0)
{
- MessageBox.Show("??" + index + "?м??????????С???????", "???");
+ MessageBox.Show("第" + index + "行加工数量不能小于等于零!", "提示");
return false;
}
- //???????С???????
+ //良率不能小于等于零
if (sHPassRate <= 0)
{
- MessageBox.Show("??" + index + "?????????С???????", "???");
+ MessageBox.Show("第" + index + "行良率不能小于等于零!", "提示");
return false;
}
- //????????????
+ //审核代码是否合理
if (!DBUtility.ClsPub.AllowNumber(sHNumber))
{
- MessageBox.Show("????????в????????????.????????λ?λ???????.????", "???");
+ MessageBox.Show("物料代码中不能出现连续‘.’并且首位末位不能为‘.’!", "提示");
return false;
}
- //???????????
+ //得到物料内码
int j = i + HBeginRow;
if (!oMaterHlp.GetInfoByNumber(sHNumber))
{
- sMsg = "[" + sHNumber + "]?????????";
+ sMsg = "[" + sHNumber + "]物料不存在";
if (sErrMsg.Contains(sMsg) == false)
{
- sErrMsg = sErrMsg + "[" + sHNumber + "]?????????\r\n";
+ sErrMsg = sErrMsg + "[" + sHNumber + "]物料不存在\r\n";
}
b = true;
}
- //???????????
+ //得到工序内码
if (!oProcHlp.GetInfoByName(sHNamePoc))
{
- sMsg = "[" + sHNamePoc + "]????????";
+ sMsg = "[" + sHNamePoc + "]工序不存在";
if (sErrMsg.Contains(sMsg) == false)
{
- sErrMsg = sErrMsg + "[" + sHNamePoc + "]????????\r\n";
+ sErrMsg = sErrMsg + "[" + sHNamePoc + "]工序不存在\r\n";
}
b = true;
}
- //???????????????
+ //得到工作中心内码
if (!oCenHlp.GetInfoByName(sHNumberCen))
{
- sMsg = "[" + sHNumberCen + "]?????????????";
+ sMsg = "[" + sHNumberCen + "]工作中心不存在";
if (sErrMsg.Contains(sMsg) == false)
{
- sErrMsg = sErrMsg + "[" + sHNumberCen + "]?????????????\r\n";
+ sErrMsg = sErrMsg + "[" + sHNumberCen + "]工作中心不存在\r\n";
}
b = true;
--
Gitblit v1.9.1