- 装配日期:
+ 装配时间:
|
@@ -188,6 +192,7 @@
});
// 下拉框加载
+ reloadline_station();
//reload_station_no('#station_no');
reload_part_no('#part_no');
//新增按钮点击
@@ -308,14 +313,12 @@
function SaveInfo(isEdit) {
var ID = isEdit == true ? PrimaryID : 0;
- var PartNo = $('#part_no').combo('getValue');
- //var StationID = $('#station_no').combo('getValue');
- var OrderDate = $('#OrderDate').datebox('getValue');
- //var IsOneMore = checkboxValue($('#IsOneMore'));
+ var PartNo = $('#part_no').combo('getValue');
+ var OrderDate = $('#OrderDate').datebox('getValue');
var OrderCount = $('#OrderCount').val();
var OrderName = $('#OrderName').val();
- var Line = $('#Line').val();
- var Station = $('#Station').val();
+ var Line = $('#line_id').combo('getText');
+ var Station = $('#station_id').combo('getText');
if (PartNo == "") {
$.messager.alert('提示', '零件不能为空,请重新输入', 'warning');
@@ -413,8 +416,8 @@
//toggleChecked('#IsOneMore', row.IsOneMore);
$('#OrderCount').val(row.OrderCount);
$('#OrderName').val(row.OrderName);
- $('#Line').val(row.Line);
- $('#Station').val(row.Station);
+ $('#line_id').combobox('select', row.Line);
+ $('#station_id').combobox('select', row.Station);
var pa = /.*\((.*)\)/;
var unixtime = row.OrderDate.match(pa)[1].substring(0, 10);
$('#OrderDate').datetimebox('setValue', getTime(unixtime).substring(0, 19));
@@ -467,8 +470,8 @@
$('#OrderDate').datebox('setValue', '');
$('#OrderCount').val('');
$('#OrderName').val('');
- $('#Line').val('');
- $('#Station').val('');
+ $('#line_id').combo('clear');
+ $('#station_id').combo('clear');
}
function toggleChecked(id, checked) {
@@ -482,7 +485,7 @@
* 加载产品下拉信息
**/
function reload_part_no(ctl) {
- base_reload_combobox(ctl, '/HttpHandlers/ProductHandler.ashx?method=GetComboboxProduct4');
+ base_reload_combobox(ctl, '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=6000');
}
function reload_station_no(ctl) {
@@ -507,6 +510,27 @@
document.body.appendChild(temp_form);
temp_form.submit();
}
+
+ function reloadline_station() {
+
+ $('#line_id').combobox({
+ url: '/HttpHandlers/LineHandler.ashx?method=QueryForCombobox',
+ onLoadSuccess: function () {
+ var val = $(this).combobox('getData');
+ $(this).combobox('select', val[0].LineID);
+ },
+ onSelect: function (row) {
+ $('#station_id').combobox({
+ url: '/HttpHandlers/StationHandler.ashx?method=QueryForComboboxByLineIDNew&&LineID=' + row.LineID + '',
+ onLoadSuccess: function () {
+ //var val = $(this).combobox('getData');
+ //$(this).combobox('select', val[0].ID);
+ },
+
+ });
+ }
+ });
+ }
From af2423fb177046d4e4f1e05a4687c0fad8dd452f Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Thu, 17 Jul 2025 11:35:53 +0800
Subject: [PATCH 04/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=A8=E6=A7=9B?=
=?UTF-8?q?=E8=AE=A1=E5=88=92BLL?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs b/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs
index 7b20c9c..730310f 100644
--- a/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs
+++ b/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs
@@ -57,7 +57,10 @@ namespace MESClassLibrary.BLL.BasicInfo
{
try
{
- var data = db.SearchInfoByID(md.ID.ToString());
+ var list = db.SearchAllInfo().Where(p => p.ID == md.ID).ToList();//查询明细
+ if(list.Count==0) return false;
+ var data = list[0];
+ //var data = db.SearchInfoByID(md.ID.ToString());
if (data.State == 3)
{
msg = "该计划已经完成";
@@ -69,13 +72,11 @@ namespace MESClassLibrary.BLL.BasicInfo
return false;
}
if (data.OKCount.GetValueOrDefault(0) == 0)
- {
- //data.StationID = md.StationID;
+ {
data.PartNo = md.PartNo;
data.OrderDate = md.OrderDate;
}
-
- //data.IsOneMore = md.IsOneMore;
+
data.OrderCount = md.OrderCount;
data.OrderName = md.OrderName;
return db.UpdateInfo(data);
From dd383d707db387b4e619d7bb52989e00f8cdc544 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Thu, 17 Jul 2025 17:23:27 +0800
Subject: [PATCH 05/10] =?UTF-8?q?pda=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WebService/AppWebservice.asmx.cs | 111 ++++++++++++++++++++++++++++++
WebService/Function.cs | 111 ++++++++++++++++++++++++++++++
WebService/Model/MKModel .cs | 43 ++++++++++++
WebService/WebService.csproj | 1 +
WebService/WebService.csproj.user | 4 +-
5 files changed, 268 insertions(+), 2 deletions(-)
create mode 100644 WebService/Model/MKModel .cs
diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs
index 071dd5c..3517e03 100644
--- a/WebService/AppWebservice.asmx.cs
+++ b/WebService/AppWebservice.asmx.cs
@@ -25,6 +25,117 @@ namespace Webservice
return "Hello World";
}
+
+ ///
+ /// 箱码与总成码关系绑定
+ ///
+ ///
+ ///
+ ///
+ ///
+ [WebMethod]
+ [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
+ public void BindBoxCodeAndBarCode(string app_id, string boxCode, string barCode, string sign)
+ {
+ string errorReason = "";
+
+ JsonModel model = new JsonModel();
+ model.Result = "0";
+ model.ResultType = "Result";
+ model.ResultRowsCount = "0";
+ model.ErrReason = errorReason;
+ model.DataList = null;
+
+ LogHelper.WriteSysLogBase("箱码与总成码关系绑定,入参boxCode=" + boxCode + ",barCode=" + barCode, MethodBase.GetCurrentMethod().Name);
+
+ #region 参数判断
+ //if (string.IsNullOrWhiteSpace(app_id))
+ //{
+ // model.ErrReason = "缺少必要传入参数 app_id";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ //if (string.IsNullOrWhiteSpace(boxCode))
+ //{
+ // model.ErrReason = "缺少必要传入参数 boxCode";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ //if (string.IsNullOrWhiteSpace(barCode))
+ //{
+ // model.ErrReason = "缺少必要传入参数 barCode";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ //if (string.IsNullOrWhiteSpace(sign))
+ //{
+ // model.ErrReason = "缺少必要传入参数 sign";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ //bool access = Function.AppIDIsRight(app_id.Trim());
+ //if (!access)
+ //{
+ // model.ErrReason = "APP接口调用标识不正确 远程服务器拒绝了此次连接请求";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ //string[] param = { Function.app_secret.Trim(), boxCode.Trim(), barCode.Trim() };
+ //bool paramIsRight = Function.signIsRight(param, sign);
+ //if (!paramIsRight)
+ //{
+ // model.ErrReason = "sign参数传输错误 远程服务器拒绝了此次连接请求";
+ // Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ // return;
+ //}
+ #endregion
+
+ int updateNum = Function.BindBoxCodeAndBarCode(boxCode, barCode, out errorReason);
+
+ DataTable dt = Function.GetCodeRecords(boxCode, out errorReason);
+ List listInfo = new List();
+
+ if (dt.Rows.Count < 1)
+ {
+ model.Result = "0";
+ model.ResultRowsCount = "0";
+ model.DataList = null;
+ model.ErrReason = errorReason;
+ }
+ else
+ {
+
+ listInfo = Tools.DataTableToList.ConvertTo(dt);
+ model.ResultRowsCount = listInfo.Count.ToString();
+ model.DataList = listInfo;
+ }
+
+ if (updateNum == 0 && !string.IsNullOrEmpty(barCode))
+ {
+ model.Result = "0";
+ model.ErrReason = "箱码和总成码绑定失败";
+ }
+ else
+ {
+ model.Result = "1";
+ string qtyValue = "0";
+ var boxCodeSplit = boxCode.Split(';');
+ foreach (string part in boxCodeSplit)
+ {
+ if (part.StartsWith("QTY:"))
+ {
+ qtyValue = part.Substring(4); // 从"QTY:"后的字符开始截取
+ }
+ }
+ if(listInfo.Count.ToString() == qtyValue)
+ {
+ model.ErrReason = "已满箱";
+ }
+ }
+
+ Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ }
+
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public void MD5Encrypt(string str)
diff --git a/WebService/Function.cs b/WebService/Function.cs
index 4a330d3..d035741 100644
--- a/WebService/Function.cs
+++ b/WebService/Function.cs
@@ -325,6 +325,117 @@ namespace Webservice
}
}
+ ///
+ /// 获取装箱记录
+ ///
+ ///
+ ///
+ ///
+ public static DataTable GetCodeRecords(string boxCode, out string errorReason)
+ {
+ DataTable res = new DataTable();
+ try
+ {
+ string sql = @"
+ select * from tb_Punch_Code_Record where BoxCode = '" + boxCode + @"' order by CreateTime desc
+ ";
+ res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null);
+
+ errorReason = "";
+ return res;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.WriteLogManager(ex);
+ LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name);
+ errorReason = ex.Message;
+ return res;
+ }
+ }
+
+ ///
+ /// 箱码和总成码绑定
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static int BindBoxCodeAndBarCode(string boxCode, string barCode, out string errorReason)
+ {
+ int updateNum = 0;
+ string qtyValue = "0";
+ try
+ {
+ errorReason = "";
+ var boxCodeSplit = boxCode.Split(';');
+ foreach (string part in boxCodeSplit)
+ {
+ if (part.StartsWith("QTY:"))
+ {
+ qtyValue = part.Substring(4); // 从"QTY:"后的字符开始截取
+ }
+ }
+
+ string sql = @"
+ select top 1 * from tb_Punch_Code_Record where Flag=1 and ZcBarCode = '" + barCode + @"' order by CreateTime desc
+ ";
+ DataTable dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null);
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ string id = dt.Rows[0]["ID"].ToString();
+ string barcode = dt.Rows[0]["barcode"].ToString();
+ string zcBarCode = dt.Rows[0]["ZcBarCode"].ToString();
+ string boxCodeDB = dt.Rows[0]["BoxCode"].ToString();
+ if(string.IsNullOrEmpty(boxCodeDB))
+ {
+ string updateSql = @" update [dbo].[tb_Punch_Code_Record] set BoxCode='" + boxCode + "',pkg='"+qtyValue+"' where ID='" + id + "'";
+ updateNum = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, updateSql, null);
+ if (updateNum == 0)
+ {
+ errorReason = "箱码和总成码绑定失败";
+ }
+ else
+ {
+ string insertSql = @"
+ insert into tb_Punch_Interface(PackageCode,OneBarCode)
+ values('" + boxCode + "','"+ barCode + @"')
+ ";
+ int insertNum = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, insertSql, null);
+ }
+ }
+ else
+ {
+ if(boxCode.Trim() == boxCodeDB.Trim())
+ {
+ errorReason = "箱码已包含此总成";
+ }
+ else
+ {
+ errorReason = "其他箱码已包含此总成";
+ }
+
+ }
+
+ }
+ else
+ {
+ errorReason = "根据总成码未查到合格信息";
+ }
+
+ return updateNum;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.WriteLogManager(ex);
+ LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name);
+ errorReason = ex.Message;
+ return updateNum;
+ }
+ }
+
+
+
+
public static DataTable GetMaterialInfo(string drumCode, out string errorReason)
{
DataTable res = new DataTable();
diff --git a/WebService/Model/MKModel .cs b/WebService/Model/MKModel .cs
new file mode 100644
index 0000000..7b5b120
--- /dev/null
+++ b/WebService/Model/MKModel .cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebService.Model
+{
+ public class MKModel
+ {
+ ///
+ /// 塑件码
+ ///
+ public string barcode { get; set; }
+ ///
+ /// 总成零件号
+ ///
+ public string ZcBarCode { get; set; }
+ /////
+ ///// 订单号
+ /////
+ //public string OrderNo { get; set; }
+ /////
+ ///// 班次
+ /////
+ //public string WorkClass { get; set; }
+ ///
+ /// 合格标记
+ ///
+ public int Flag { get; set; }
+ ///
+ /// 箱码
+ ///
+ public string BoxCode { get; set; }
+ /////
+ ///// 标包
+ /////
+ //public string PKG { get; set; }
+ /////
+ ///// 创建时间
+ /////
+ //public DateTime CreateTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/WebService/WebService.csproj b/WebService/WebService.csproj
index b40b104..4bc0235 100644
--- a/WebService/WebService.csproj
+++ b/WebService/WebService.csproj
@@ -122,6 +122,7 @@
+
diff --git a/WebService/WebService.csproj.user b/WebService/WebService.csproj.user
index e32f45c..1f24385 100644
--- a/WebService/WebService.csproj.user
+++ b/WebService/WebService.csproj.user
@@ -1,4 +1,4 @@
-
+
Debug|Any CPU
@@ -15,7 +15,7 @@
- WMSWebService.asmx
+ AppWebservice.asmx
SpecificPage
True
False
From 5413346a9ebdfc4ea884c2b63f6e36ec5e7acc18 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Fri, 18 Jul 2025 16:18:06 +0800
Subject: [PATCH 06/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0PDA=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WebService/AppWebservice.asmx.cs | 16 ++++++++++------
WebService/Function.cs | 9 +++++++++
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs
index 3517e03..3140d81 100644
--- a/WebService/AppWebservice.asmx.cs
+++ b/WebService/AppWebservice.asmx.cs
@@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Data;
using System.Reflection;
+using System.Runtime.Remoting.Contexts;
+using System.Text;
using System.Web.Script.Services;
using System.Web.Services;
using Tools;
@@ -47,6 +49,7 @@ namespace Webservice
model.DataList = null;
LogHelper.WriteSysLogBase("箱码与总成码关系绑定,入参boxCode=" + boxCode + ",barCode=" + barCode, MethodBase.GetCurrentMethod().Name);
+ Context.Response.ContentType = "application/json; charset=utf-8";
#region 参数判断
//if (string.IsNullOrWhiteSpace(app_id))
@@ -55,12 +58,12 @@ namespace Webservice
// Context.Response.Write(JSONTools.ScriptSerialize>(model));
// return;
//}
- //if (string.IsNullOrWhiteSpace(boxCode))
- //{
- // model.ErrReason = "缺少必要传入参数 boxCode";
- // Context.Response.Write(JSONTools.ScriptSerialize>(model));
- // return;
- //}
+ if (string.IsNullOrWhiteSpace(boxCode))
+ {
+ model.ErrReason = "缺少必要传入参数 boxCode";
+ Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ return;
+ }
//if (string.IsNullOrWhiteSpace(barCode))
//{
// model.ErrReason = "缺少必要传入参数 barCode";
@@ -133,6 +136,7 @@ namespace Webservice
}
}
+
Context.Response.Write(JSONTools.ScriptSerialize>(model));
}
diff --git a/WebService/Function.cs b/WebService/Function.cs
index d035741..1baa7cf 100644
--- a/WebService/Function.cs
+++ b/WebService/Function.cs
@@ -376,6 +376,15 @@ namespace Webservice
}
}
+ DataTable dtBoxNum = GetCodeRecords(boxCode, out errorReason);
+ if(dtBoxNum != null && dtBoxNum.Rows.Count.ToString() == qtyValue)
+ {
+ errorReason = "此箱码已满箱";
+ return updateNum;
+ }
+
+
+
string sql = @"
select top 1 * from tb_Punch_Code_Record where Flag=1 and ZcBarCode = '" + barCode + @"' order by CreateTime desc
";
From 28ad141642c29f238d82b69027abe2f211c6560f Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Wed, 23 Jul 2025 14:56:33 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E4=BC=98=E5=8C=96Pda=E8=A3=85=E7=AE=B1?=
=?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=8F=90=E7=A4=BA=E8=AF=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WebService/AppWebservice.asmx.cs | 108 ++++++++++++++++++++++++-------
WebService/Function.cs | 10 +--
2 files changed, 91 insertions(+), 27 deletions(-)
diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs
index 3140d81..9c3f1cf 100644
--- a/WebService/AppWebservice.asmx.cs
+++ b/WebService/AppWebservice.asmx.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Data;
+using System.Linq;
using System.Reflection;
using System.Runtime.Remoting.Contexts;
using System.Text;
@@ -64,6 +65,14 @@ namespace Webservice
Context.Response.Write(JSONTools.ScriptSerialize>(model));
return;
}
+ //箱码格式验证
+ var boxCodeList = boxCode.Split(';');
+ if (!boxCode.Contains("PN") || !boxCode.Contains("PKG") || !boxCode.Contains("QTY") || boxCodeList.Length != 7 || boxCodeList[0].Length != 16 || boxCodeList[1].Length != 12 || boxCodeList[5].Length != 16)
+ {
+ model.ErrReason = "箱码标签格式不对";
+ Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ return;
+ }
//if (string.IsNullOrWhiteSpace(barCode))
//{
// model.ErrReason = "缺少必要传入参数 barCode";
@@ -93,9 +102,8 @@ namespace Webservice
//}
#endregion
- int updateNum = Function.BindBoxCodeAndBarCode(boxCode, barCode, out errorReason);
-
- DataTable dt = Function.GetCodeRecords(boxCode, out errorReason);
+ string errorReasonBoxData = "";
+ DataTable dt = Function.GetCodeRecords(boxCode, out errorReasonBoxData);
List listInfo = new List();
if (dt.Rows.Count < 1)
@@ -103,40 +111,96 @@ namespace Webservice
model.Result = "0";
model.ResultRowsCount = "0";
model.DataList = null;
- model.ErrReason = errorReason;
+ if (string.IsNullOrEmpty(errorReasonBoxData))
+ {
+ model.ErrReason = "箱码包含总成数量为零";
+ }
+ else
+ {
+ model.ErrReason = errorReasonBoxData;
+ }
}
else
{
-
listInfo = Tools.DataTableToList.ConvertTo(dt);
model.ResultRowsCount = listInfo.Count.ToString();
model.DataList = listInfo;
}
-
- if (updateNum == 0 && !string.IsNullOrEmpty(barCode))
+ if(!string.IsNullOrEmpty(barCode))
{
- model.Result = "0";
- model.ErrReason = "箱码和总成码绑定失败";
- }
- else
- {
- model.Result = "1";
- string qtyValue = "0";
- var boxCodeSplit = boxCode.Split(';');
- foreach (string part in boxCodeSplit)
+ #region 数据合法性判断
+ //总成码格式验证
+ var barCodeList = barCode.Split(';');
+ if (!barCode.Contains("S104") || !barCode.Contains(".") || barCodeList[0].Length != 17 || barCodeList[1].Length != 4 || barCodeList[2].Length != 4)
+ {
+ model.ErrReason = "总成条码格式不对或不存在";
+ Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ return;
+ }
+
+ //箱码和总成码零件验证
+ string boxPartNo = boxCodeList[0].Substring(3,10);
+ string barCodePartNo = barCodeList[0].Substring(0, 10);
+ if(boxPartNo != barCodePartNo)
+ {
+ model.ErrReason = "箱码和总成条码零件号不符";
+ Context.Response.Write(JSONTools.ScriptSerialize>(model));
+ return;
+ }
+
+
+
+ #endregion
+
+ int updateNum = Function.BindBoxCodeAndBarCode(boxCode, barCode, out errorReason);
+
+ dt = Function.GetCodeRecords(boxCode, out errorReasonBoxData);
+
+ if (dt.Rows.Count < 1)
{
- if (part.StartsWith("QTY:"))
+ model.Result = "0";
+ model.ResultRowsCount = "0";
+ model.DataList = null;
+ if (string.IsNullOrEmpty(errorReasonBoxData))
+ {
+ model.ErrReason = "箱码包含总成数量为零";
+ }
+ else
{
- qtyValue = part.Substring(4); // 从"QTY:"后的字符开始截取
+ model.ErrReason = errorReasonBoxData;
}
}
- if(listInfo.Count.ToString() == qtyValue)
+ else
{
- model.ErrReason = "已满箱";
+
+ listInfo = Tools.DataTableToList.ConvertTo(dt);
+ model.ResultRowsCount = listInfo.Count.ToString();
+ model.DataList = listInfo;
}
- }
-
+ if (!string.IsNullOrEmpty(errorReason) && !string.IsNullOrEmpty(barCode))
+ {
+ model.Result = "0";
+ model.ErrReason = errorReason;
+ }
+ else
+ {
+ model.Result = "1";
+ string qtyValue = "0";
+ var boxCodeSplit = boxCode.Split(';');
+ foreach (string part in boxCodeSplit)
+ {
+ if (part.StartsWith("QTY:"))
+ {
+ qtyValue = part.Substring(4); // 从"QTY:"后的字符开始截取
+ }
+ }
+ if (listInfo.Count.ToString() == qtyValue)
+ {
+
+ }
+ }
+ }
Context.Response.Write(JSONTools.ScriptSerialize>(model));
}
diff --git a/WebService/Function.cs b/WebService/Function.cs
index 1baa7cf..2f759b5 100644
--- a/WebService/Function.cs
+++ b/WebService/Function.cs
@@ -379,7 +379,7 @@ namespace Webservice
DataTable dtBoxNum = GetCodeRecords(boxCode, out errorReason);
if(dtBoxNum != null && dtBoxNum.Rows.Count.ToString() == qtyValue)
{
- errorReason = "此箱码已满箱";
+ errorReason = "扫描总数超出箱码限制数量";
return updateNum;
}
@@ -401,7 +401,7 @@ namespace Webservice
updateNum = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, updateSql, null);
if (updateNum == 0)
{
- errorReason = "箱码和总成码绑定失败";
+ errorReason = "总成条码装箱失败";
}
else
{
@@ -416,11 +416,11 @@ namespace Webservice
{
if(boxCode.Trim() == boxCodeDB.Trim())
{
- errorReason = "箱码已包含此总成";
+ errorReason = "总成条码已装箱";
}
else
{
- errorReason = "其他箱码已包含此总成";
+ errorReason = "总成条码已被其他箱码装箱";
}
}
@@ -428,7 +428,7 @@ namespace Webservice
}
else
{
- errorReason = "根据总成码未查到合格信息";
+ errorReason = "总成条码格式不对或不存在";
}
return updateNum;
From 8834694ec1680a643b51ec8259e8647a9ad0a017 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Thu, 24 Jul 2025 14:50:48 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E4=BC=98=E5=8C=96APP=E8=A3=85=E7=AE=B1?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
WebService/AppWebservice.asmx.cs | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/WebService/AppWebservice.asmx.cs b/WebService/AppWebservice.asmx.cs
index 9c3f1cf..9487064 100644
--- a/WebService/AppWebservice.asmx.cs
+++ b/WebService/AppWebservice.asmx.cs
@@ -108,15 +108,17 @@ namespace Webservice
if (dt.Rows.Count < 1)
{
- model.Result = "0";
+
model.ResultRowsCount = "0";
model.DataList = null;
if (string.IsNullOrEmpty(errorReasonBoxData))
{
- model.ErrReason = "箱码包含总成数量为零";
+ model.Result = "1";
+ model.ErrReason = "";
}
else
{
+ model.Result = "0";
model.ErrReason = errorReasonBoxData;
}
}
@@ -133,6 +135,7 @@ namespace Webservice
var barCodeList = barCode.Split(';');
if (!barCode.Contains("S104") || !barCode.Contains(".") || barCodeList[0].Length != 17 || barCodeList[1].Length != 4 || barCodeList[2].Length != 4)
{
+ model.Result = "0";
model.ErrReason = "总成条码格式不对或不存在";
Context.Response.Write(JSONTools.ScriptSerialize>(model));
return;
@@ -143,6 +146,7 @@ namespace Webservice
string barCodePartNo = barCodeList[0].Substring(0, 10);
if(boxPartNo != barCodePartNo)
{
+ model.Result = "0";
model.ErrReason = "箱码和总成条码零件号不符";
Context.Response.Write(JSONTools.ScriptSerialize>(model));
return;
@@ -158,15 +162,17 @@ namespace Webservice
if (dt.Rows.Count < 1)
{
- model.Result = "0";
+
model.ResultRowsCount = "0";
model.DataList = null;
if (string.IsNullOrEmpty(errorReasonBoxData))
{
- model.ErrReason = "箱码包含总成数量为零";
+ model.Result = "1";
+ model.ErrReason = "";
}
else
{
+ model.Result = "0";
model.ErrReason = errorReasonBoxData;
}
}
From 243d0bbd20ab94b2e00dbc81737d700d13c5c468 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Fri, 25 Jul 2025 13:29:23 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=A8=E6=A7=9B?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
MESWebSite/Excel/装配Bom导入模板.xlsx | Bin 0 -> 18944 bytes
MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs | 122 +++++-
MESWebSite/HttpHandlers/ConfigHandler.ashx | 1 +
MESWebSite/HttpHandlers/ConfigHandler.ashx.cs | 132 +++++++
.../HttpHandlers/ZP_MK_PlanHandler.ashx.cs | 15 +-
MESWebSite/MESWebSite.csproj | 13 +
MESWebSite/MESWebSite.csproj.user | 4 +-
MESWebSite/Manage/Bom_MK.aspx | 138 ++++++-
MESWebSite/Manage/Bom_MK.aspx.cs | 268 ++++++++++++-
MESWebSite/Manage/Bom_MK.aspx.designer.cs | 54 +++
MESWebSite/Manage/Config.aspx | 354 ++++++++++++++++++
MESWebSite/Manage/Config.aspx.cs | 20 +
MESWebSite/Manage/Config.aspx.designer.cs | 44 +++
MESWebSite/Manage/ZP_MK_Plan.aspx | 25 +-
.../PublishProfiles/FolderProfile.pubxml | 17 +
15 files changed, 1184 insertions(+), 23 deletions(-)
create mode 100644 MESWebSite/Excel/装配Bom导入模板.xlsx
create mode 100644 MESWebSite/HttpHandlers/ConfigHandler.ashx
create mode 100644 MESWebSite/HttpHandlers/ConfigHandler.ashx.cs
create mode 100644 MESWebSite/Manage/Config.aspx
create mode 100644 MESWebSite/Manage/Config.aspx.cs
create mode 100644 MESWebSite/Manage/Config.aspx.designer.cs
create mode 100644 MESWebSite/Properties/PublishProfiles/FolderProfile.pubxml
diff --git a/MESWebSite/Excel/装配Bom导入模板.xlsx b/MESWebSite/Excel/装配Bom导入模板.xlsx
new file mode 100644
index 0000000000000000000000000000000000000000..1b1182fff846b4188932c2511f847b84fa6230e6
GIT binary patch
literal 18944
zcmeHP2V4}_*1x+fu%IYi1c9XpNRuK>BTY0aC?Hr7X`)y$U=R`!EW{|NAc>Wz(O~a2
ziUv>=QH&ME7z-kby+ng3y5Bi73_I-Ztj71g@B8JwT)Z=L&pqdV&;8#rbMNeU?yT0W
zA9oqn5UJozl*oIr8c|`%d2o%93YvtN!Ud+^i^XDENC;g16aGdFyaQj&q4AU;3Lq*&
z#5PxjD1@j6Q5|9%h;1QiKx_xGJw)gNL<^!eL>-8_5cMGHL+k+20Afdoh7gS)c7kXO
z(F7v)8H{FdZNW9~f^r6QvMDW2(B*Y^jCDf7h
zp-=Qt(>peDc+)kW2$H_o(I5yKmiW6Q_!{HPgEO$eh{MVS<7oKY>!QKiWl-6PD*pr%#2-zO()Rk^x
z9vQ~>rSuk1M|0}f4vsu>fU^0Gk~qWs^$ak@8M)Y?mU%IONEKe0)N@<=~^fk6eEUapRDyamd{`
z@P!=uS{(YC9C95Fxf+LDx?M~Jb}*WC2+y3l{tf3>6#Z?-eXCm-}o4N_Nsp66uka5J8xDZ|x5j8t#3s;i*
zqPz!bo!h$Z@-)nW9dpWxw)Lg1O$0+p7x<$J<0=N_Tm@hr7jzmlQFrco(AAaaYwN6RJFYE;*vg)BjJF^QiRz)(`{DGl5P{@$j0KO62w&ay1Tl7Y@0tTsb~mGW`3B
zd__#TxU!Ka$JGucFVND`Z=>Ia2n?xyf-4|-`nW2RC&wo%d2(DmQSwU!yzw<){J|BK
zJUOniSaMiU(R{YZq2IFWg)1^j|2r+MrEQji|6M8nah1l%i%pA7i9n5#T8zA_==ob>V+#oO1`(*Pk}9kgR8^VatBI|
zE5_DxJ4%kL$kuWvN)81{$&EPVrW`o-9C9}f9J)WqmP_+2>nE3-=2I4j=3iE>&*3MR
z-1RT|&&4y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ZVv#NvXm?bWXJ>7A33ps2q6=>LSH-~
zYC`mdC|zgFS0({a(>Q9GhM)K20`0H-e*~U@%AV~2@`C{%$-hNs|4reqmj7=mwgu+z
zUOx5%3{4R6{*M9s4>l2wB?y_*;eh=I#}tl*oy}>K;TQ^peiID+J_&l$Xy`$4VCfI%
zaj+RM8W!8}kb{AF&ge&afmF6n;uylQiobDkgQEj1{#}S89P!IuN4Rz-UJ!9F0CmkE
sdP2$_a=hTm56->e4{f`F#E+7?!gT;hz2N8x=RV+@3#Ey+|IOil07iB|t^fc4
literal 0
HcmV?d00001
diff --git a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs
index 86f79e7..0b49593 100644
--- a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs
+++ b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs
@@ -2,8 +2,11 @@
using MESClassLibrary.BLL.BasicInfo;
using MESClassLibrary.EFModel;
using MESWebSite.CommonClass;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Web;
@@ -37,7 +40,10 @@ namespace MESWebSite.HttpHandlers
case "DelInfo":
DelInfo();
break;
-
+ case "QueryExcel":
+ QueryExcel();
+ break;
+
default:
break;
@@ -83,8 +89,36 @@ namespace MESWebSite.HttpHandlers
string IsPartAssemble = Request.Params["IsPartAssemble"];
string StationNo = Request.Params["StationNo"];
string LineName = Request.Params["LineName"];
+ string LeftCount = Request.Params["LeftCount"];
+ string RightCount = Request.Params["RightCount"];
+ string ProductName1 = Request.Params["ProductName1"];
+ string ProductName2 = Request.Params["ProductName2"];
+
+ if(string.IsNullOrEmpty(LeftCount))
+ {
+ LeftCount = "0";
+ }
+ if (string.IsNullOrEmpty(RightCount))
+ {
+ RightCount = "0";
+ }
+ string lineName = "";
+ BasicBLL lineNameDB = new BasicBLL();
+ var lineNameList = lineNameDB.Search(p => p.LineName == LineName);
+ if (lineNameList != null && lineNameList.Count > 0)
+ {
+ lineName = lineNameList[0].LineName;
+ }
+
+ if (string.IsNullOrEmpty(lineName))
+ {
+ Response.Write(ResponseResult.Fail("产线不存在!"));
+ Response.End();
+ return;
+ }
+
string stationNo = "";
BasicBLL stationDB = new BasicBLL();
var stationList = stationDB.Search(p => p.StationNo == StationNo);
@@ -100,6 +134,44 @@ namespace MESWebSite.HttpHandlers
return;
}
+ //一个总成对应一个半成品
+ BasicBLL partAssembleNum = new BasicBLL();
+ int id_mk = int.Parse(BomID);
+ var partAssembleList = partAssembleNum.Search(p => p.PartNo1 == PartNo1 && p.IsPartAssemble == 1 && p.BomID != id_mk);
+ if (partAssembleList != null && partAssembleList.Count == 1 && IsPartAssemble == "1")
+ {
+ Response.Write(ResponseResult.Fail("一个总成只能配置一个半成品!"));
+ Response.End();
+ return;
+ }
+
+ //查询产品描述
+ BasicBLL productDesc = new BasicBLL();
+ var productDescList = productDesc.Search(p => p.PartNo == PartNo1);
+ if (productDescList != null && productDescList.Count >= 1 )
+ {
+ ProductName1 = productDescList[0].ProductName;
+ }
+ else
+ {
+ Response.Write(ResponseResult.Fail("总成零件号:" + PartNo1 +" 产品信息不存在"));
+ Response.End();
+ return;
+ }
+
+ productDescList = productDesc.Search(p => p.PartNo == PartNo2);
+ if (productDescList != null && productDescList.Count >= 1)
+ {
+ ProductName2 = productDescList[0].ProductName;
+ }
+ else
+ {
+ Response.Write(ResponseResult.Fail("子零件号:" + PartNo2 + " 产品信息不存在"));
+ Response.End();
+ return;
+ }
+
+
Bom_MKBLL bll = new Bom_MKBLL();
tb_Bom_MK md = new tb_Bom_MK();
@@ -107,7 +179,12 @@ namespace MESWebSite.HttpHandlers
md.PartNo2 = PartNo2;
md.LineName = LineName;
md.StationNo = StationNo;
- if(IsPartAssemble == "1")
+ md.LeftCount = int.Parse(LeftCount);
+ md.RightCount = int.Parse(RightCount);
+ md.PartDesc1 = ProductName1;
+ md.PartDesc2 = ProductName2;
+
+ if (IsPartAssemble == "1")
{
md.IsPartAssemble = 1;
}
@@ -129,6 +206,15 @@ namespace MESWebSite.HttpHandlers
if (BomID == "0")
{
+ BasicBLL partNoBindDB = new BasicBLL();
+ var partNo1List = partNoBindDB.Search(p => p.PartNo1 == PartNo1 && p.PartNo2 == PartNo2 && p.LineName == LineName && p.StationNo == StationNo);
+ if (partNo1List != null && partNo1List.Count > 0)
+ {
+ Response.Write(ResponseResult.Fail("BOM总成零件号与子零件号绑定关系在系统中已存在"));
+ Response.End();
+ return;
+ }
+
//新增
//md.BomID = Guid.NewGuid().ToString();
Response.Write(bll.AddInfo(md) == true ? ResponseResult.Success() : ResponseResult.Fail("添加失败"));
@@ -158,5 +244,37 @@ namespace MESWebSite.HttpHandlers
}
+ void QueryExcel()
+ {
+ string PartNo1 = Request.Params["PartNo1"];
+ string LineName = Request.Params["LineName"];
+
+ Bom_MKBLL bll = new Bom_MKBLL();
+
+ List> list = bll.SearchForExcel(PartNo1, LineName);
+ XSSFWorkbook book = new XSSFWorkbook();
+ ISheet sheet = book.CreateSheet("Sheet1");
+
+ for (int i = 0; i < list.Count; i++)
+ {
+ IRow row = sheet.CreateRow(i);
+
+ for (int k = 0; k < list[i].Count; k++)
+ {
+ row.CreateCell(k).SetCellValue(list[i][k].ToString());
+ }
+
+ }
+
+ // 写入到客户端
+ MemoryStream ms = new MemoryStream();
+ book.Write(ms);
+ Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.xlsx", DateTime.Now.ToString("yyyyMMddHHmmssfff")));
+ Response.BinaryWrite(ms.ToArray());
+ book = null;
+ ms.Close();
+ ms.Dispose();
+ }
+
}
}
\ No newline at end of file
diff --git a/MESWebSite/HttpHandlers/ConfigHandler.ashx b/MESWebSite/HttpHandlers/ConfigHandler.ashx
new file mode 100644
index 0000000..210020a
--- /dev/null
+++ b/MESWebSite/HttpHandlers/ConfigHandler.ashx
@@ -0,0 +1 @@
+<%@ WebHandler Language="C#" CodeBehind="ConfigHandler.ashx.cs" Class="MESWebSite.HttpHandlers.ConfigHandler" %>
diff --git a/MESWebSite/HttpHandlers/ConfigHandler.ashx.cs b/MESWebSite/HttpHandlers/ConfigHandler.ashx.cs
new file mode 100644
index 0000000..519f5f3
--- /dev/null
+++ b/MESWebSite/HttpHandlers/ConfigHandler.ashx.cs
@@ -0,0 +1,132 @@
+using MESClassLibrary.BLL.BasicInfo;
+using MESClassLibrary.EFModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace MESWebSite.HttpHandlers
+{
+ ///
+ /// ConfigHandler 的摘要说明
+ ///
+ public class ConfigHandler : IHttpHandler
+ {
+
+ HttpRequest Request = null;
+ HttpResponse Response = null;
+
+ public void ProcessRequest(HttpContext context)
+ {
+ context.Response.ContentType = "text/plain";
+ Request = context.Request;
+ Response = context.Response;
+
+ string method = Request.Params["method"];
+ switch (method)
+ {
+
+ case "QueryList":
+ QueryList();
+ break;
+ case "SaveInfo":
+ SaveInfo();
+ break;
+ case "DelInfo":
+ DelInfo();
+ break;
+ case "QueryForCombobox":
+ QueryForCombobox();
+ break;
+ default:
+ break;
+
+ }
+
+ }
+ public bool IsReusable
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ void QueryList()
+ {
+ string page = Request.Params["page"];
+ string pagesize = Request.Params["rows"];
+ string name = Request.Params["name"];
+
+ if (string.IsNullOrEmpty(page))
+ {
+ page = "0";
+ }
+ if (string.IsNullOrEmpty(pagesize))
+ {
+ pagesize = "15";
+ }
+ ConfigBLL bll = new ConfigBLL();
+ Response.Write(bll.SearchInfo(page, pagesize, name));
+ Response.End();
+
+
+ }
+ void SaveInfo()
+ {
+ string ID = Request.Params["ID"];
+ string name = Request.Params["name"];
+ string value = Request.Params["value"];
+ string des = Request.Params["des"];
+
+ ConfigBLL bll = new ConfigBLL();
+ tb_Config md = new tb_Config();
+
+ //md.name = name;
+ if(value != "true" && value != "false")
+ {
+ Response.Write("false");
+ Response.End();
+ return;
+ }
+ md.value = value;
+ //md.des = des;
+
+
+
+ if (ID == "0")
+ {
+ //新增
+ md.ID = Guid.NewGuid().ToString();
+ Response.Write(bll.AddInfo(md) == true ? "true" : "false");
+ }
+ else
+ {
+ //修改
+ md.ID = ID;
+ Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
+ }
+ Response.End();
+ }
+ void DelInfo()
+ {
+ string ID = Request.Params["ID"];
+
+ ConfigBLL bll = new ConfigBLL();
+ tb_Config md = new tb_Config();
+
+ md.ID = ID;
+ //Response.Write(bll.DelInfo(md) == true ? "true" : "false");
+ Response.Write("false");
+ Response.End();
+
+ }
+ void QueryForCombobox()
+ {
+ PlaceBLL bll = new PlaceBLL();
+ Response.Write(bll.GetComboboxData());
+ Response.End();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs
index 75d0df8..589c248 100644
--- a/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs
+++ b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs
@@ -40,11 +40,12 @@ namespace MESWebSite.HttpHandlers
string StartTime = GetParam("StartTime");
string EndTime = GetParam("EndTime");
string PartNo = GetParam("PartNo");
+ string State = GetParam("State");
int page = Page.To32Int();
int pageSize = Rows.To32Int();
ZP_MK_PlanBLL bll = new ZP_MK_PlanBLL();
- string reslut = bll.SearchInfoAll(page, pageSize, StartTime, EndTime, PartNo);
+ string reslut = bll.SearchInfoAll(page, pageSize, StartTime, EndTime, PartNo, State);
Response.Write(reslut);
Response.End();
}
@@ -126,17 +127,7 @@ namespace MESWebSite.HttpHandlers
Station = station,
};
-
- //DataTable dt = bll.SearchOrderNo(DateTime.Now.ToString("yyyMMdd"));
- //if (dt != null && dt.Rows.Count > 0)
- //{
- // string old = dt.Rows[0]["OrderNo"].ToString();
- // zpp.OrderNo = DateTime.Now.ToString("yyyMMdd") + (Convert.ToInt32(old.Substring(old.Length - 4, 4))+1).ToString().PadLeft(4,'0');
- //}
- //else
- //{
- // zpp.OrderNo = DateTime.Now.ToString("yyyMMdd") + "0001";
- //}
+
if (id == "0")
{
diff --git a/MESWebSite/MESWebSite.csproj b/MESWebSite/MESWebSite.csproj
index ccaf66e..86a2684 100644
--- a/MESWebSite/MESWebSite.csproj
+++ b/MESWebSite/MESWebSite.csproj
@@ -121,6 +121,7 @@
+
@@ -840,6 +841,8 @@
+
+
@@ -1094,6 +1097,9 @@
BucketStateHandler.ashx
+
+ ConfigHandler.ashx
+
XDProductHandler.ashx
@@ -1363,6 +1369,13 @@
BucketState.aspx
+
+ Config.aspx
+ ASPXCodeBehind
+
+
+ Config.aspx
+
XDStockArea.aspx
ASPXCodeBehind
diff --git a/MESWebSite/MESWebSite.csproj.user b/MESWebSite/MESWebSite.csproj.user
index ced2bb3..9b19fce 100644
--- a/MESWebSite/MESWebSite.csproj.user
+++ b/MESWebSite/MESWebSite.csproj.user
@@ -1,7 +1,7 @@
-
+
- D:\Project\2、北汽模塑一厂\SVN\Code\MESWebSite\Properties\PublishProfiles\BBMPT1.pubxml
+ D:\job\BBMPT1\MESWebSite\Properties\PublishProfiles\FolderProfile.pubxml
ProjectFiles
Debug|Any CPU
true
diff --git a/MESWebSite/Manage/Bom_MK.aspx b/MESWebSite/Manage/Bom_MK.aspx
index bd4c6b8..637c35d 100644
--- a/MESWebSite/Manage/Bom_MK.aspx
+++ b/MESWebSite/Manage/Bom_MK.aspx
@@ -77,6 +77,12 @@
删除
|
+
+ 导出
+ |
+
+ 导入
+ |
|
@@ -153,7 +159,29 @@
data-options="valueField: 'StationID',textField: 'StationNo'">