Browse Source

增加条码替换记录

master
songnan.zhang 2 years ago
parent
commit
9cdcc8abf1
  1. 10
      APP/QMAPP.Web/App_Data/Menu.xml
  2. 7
      APP/QMAPP.Web/Web.config
  3. 204
      APPQ5/QMAPP.FJC.BLL/BZD/BarCodeReplaceBLL.cs
  4. 1
      APPQ5/QMAPP.FJC.BLL/QMAPP.FJC.BLL.csproj
  5. 255
      APPQ5/QMAPP.FJC.DAL/BZD/BarCodeReplaceDAL.cs
  6. 1
      APPQ5/QMAPP.FJC.DAL/QMAPP.FJC.DAL.csproj
  7. 52
      APPQ5/QMAPP.FJC.Entity/BZD/BarCodeReplace.cs
  8. 1
      APPQ5/QMAPP.FJC.Entity/QMAPP.FJC.Entity.csproj
  9. 8
      APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml
  10. 204
      APPQ5/QMAPP.FJC.Web/Controllers/BarCodeReplaceController.cs
  11. 63
      APPQ5/QMAPP.FJC.Web/Models/BZD/BarCodeReplaceModel.cs
  12. 4
      APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj
  13. 60
      APPQ5/QMAPP.FJC.Web/Views/BarCodeReplace/BarCodeReplaceEdit.aspx
  14. 94
      APPQ5/QMAPP.FJC.Web/Views/BarCodeReplace/BarCodeReplaceList.aspx
  15. 22
      AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs
  16. 7
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/App_Data/FJCServiceList.xml
  17. 8
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

10
APP/QMAPP.Web/App_Data/Menu.xml

@ -453,8 +453,14 @@
<MenuItem MenuID="10080000" SystemID="FJC" MenuDes="登记信息" Action="/SignInfo/List" Target="url" PowerID="CD10080000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1"> <MenuItem MenuID="10080000" SystemID="FJC" MenuDes="登记信息" Action="/SignInfo/List" Target="url" PowerID="CD10080000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1">
<Actions> <Actions>
<Action ContorllerName="SignInfo" ActionName="List" PowerID="CD10080001">查询</Action> <Action ContorllerName="SignInfo" ActionName="List" PowerID="CD10080001">查询</Action>
</Actions>
<!--<Action ContorllerName="SignInfo" ActionName="ExportExcel" PowerID="CD10080002">导出</Action>--> </MenuItem>
<MenuItem MenuID="10090000" MenuDes="条码替换记录" SystemID="FJC" Action="/BarCodeReplace/List" Target="url" PowerID="CD10090000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1">
<Actions>
<Action ContorllerName="BarCodeReplace" ActionName="List" PowerID="CD10090001">查询</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Add" PowerID="CD10090002">新建</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Edit" PowerID="CD10090003">修改</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Delete" PowerID="CD10090004">删除</Action>
</Actions> </Actions>
</MenuItem> </MenuItem>
<!--<MenuItem MenuID="10040000" SystemID="FJC" MenuDes="生产进度查询" Action="" Target="url" PowerID="CD10040000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1"> <!--<MenuItem MenuID="10040000" SystemID="FJC" MenuDes="生产进度查询" Action="" Target="url" PowerID="CD10040000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1">

7
APP/QMAPP.Web/Web.config

@ -40,7 +40,7 @@
<!--主数据库连接--> <!--主数据库连接-->
<!--<add name="maindb" connectionString="Data Source=USER-20180104HU;Initial Catalog=CD_MES;User Id=sa;Password=qm;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=USER-20180104HU;Initial Catalog=CD_MES;User Id=sa;Password=qm;" providerName="System.Data.SqlClient"/>-->
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>
@ -50,9 +50,10 @@
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>
--> -->
<!--<add name="maindb" connectionString="Data Source=119.3.213.202,13315;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=ChangkeTec@2020;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=119.3.213.202,13315;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=ChangkeTec@2020;" providerName="System.Data.SqlClient"/>-->
<!--
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>
<!--
<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />--> <add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />-->
<!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>-->

204
APPQ5/QMAPP.FJC.BLL/BZD/BarCodeReplaceBLL.cs

@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.Entity;
using QMFrameWork.Log;
using System.Data;
using QMAPP.MD.Entity;
using QMAPP.MD.DAL;
using QMAPP.FJC.Entity.BZD;
using QMAPP.FJC.DAL.BZD;
namespace QMAPP.FJC.BLL.BZD
{
/// </summary>
/// 模块名称:条码替换记录
/// 作 者:张松男
/// 编写日期:2022年11月07日
/// </summary>
public class BarCodeReplaceBLL : BaseBLL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public DataResult<BarCodeReplace> Get(BarCodeReplace model)
{
DataResult<BarCodeReplace> result = new DataResult<BarCodeReplace>();
try
{
result.Result = new BarCodeReplaceDAL().Get(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 获取列表(分页)
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(BarCodeReplace condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
//获取物料信息列表
DataPage dataPage = new BarCodeReplaceDAL().GetList(condition, page);
result.Result = dataPage;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
/// <summary>
/// 获取全部条码格式规则
/// </summary>
/// <returns></returns>
public List<BarCodeReplace> GetAllList(string str)
{
return new BarCodeReplaceDAL().GetAllList();
}
#endregion
#region 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Insert(BarCodeReplace info)
{
DataResult<int> result = new DataResult<int>();
try
{
//基本信息
info.PID = Guid.NewGuid().ToString();
info.CREATEDATE = DateTime.Now;
info.FLGDEL = "0";
BarCodeReplaceDAL cmdDAL = new BarCodeReplaceDAL();
result.Result = new BarCodeReplaceDAL().Insert(info);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
/// <summary>
/// 更新信息
/// </summary>
/// <param name="">信息</param>
/// <returns>更新行数</returns>
public DataResult<int> Update(BarCodeReplace info)
{
DataResult<int> result = new DataResult<int>();
try
{
info.FLGDEL = "0";
result.Result = new BarCodeReplaceDAL().Update(info);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 删除
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">主键串</param>
/// <returns>删除个数</returns>
public DataResult<int> Delete(string strs)
{
int count = 0;
DataResult<int> result = new DataResult<int>();
string[] list = strs.Split(":".ToCharArray());
try
{
foreach (string str in list)
{
count += this.DeleteBarcodeRules(new BarCodeReplace { PID = str });
}
result.Result = count;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">信息</param>
/// <returns>删除个数</returns>
public int DeleteBarcodeRules(BarCodeReplace info)
{
try
{
return new BarCodeReplaceDAL().Delete(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="">查询条件</param>
/// <returns>数据</returns>
public DataTable GetExportData(BarCodeReplace info)
{
try
{
return new BarCodeReplaceDAL().GetExportData(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}

1
APPQ5/QMAPP.FJC.BLL/QMAPP.FJC.BLL.csproj

@ -110,6 +110,7 @@
<Compile Include="Bucket\BucketMaterialBLL.cs" /> <Compile Include="Bucket\BucketMaterialBLL.cs" />
<Compile Include="Bucket\BucketInfoBLL.cs" /> <Compile Include="Bucket\BucketInfoBLL.cs" />
<Compile Include="Bucket\RawMaterialRecordBLL.cs" /> <Compile Include="Bucket\RawMaterialRecordBLL.cs" />
<Compile Include="BZD\BarCodeReplaceBLL.cs" />
<Compile Include="BZD\BZDConfigBLL.cs" /> <Compile Include="BZD\BZDConfigBLL.cs" />
<Compile Include="BZD\BarCodeReplacementBLL.cs" /> <Compile Include="BZD\BarCodeReplacementBLL.cs" />
<Compile Include="BZD\BZDRecorderBLL.cs" /> <Compile Include="BZD\BZDRecorderBLL.cs" />

255
APPQ5/QMAPP.FJC.DAL/BZD/BarCodeReplaceDAL.cs

@ -0,0 +1,255 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.MD.Entity;
using QMFrameWork.Data;
using System.Data;
using QMAPP.Entity;
using QMAPP.FJC.Entity.BZD;
namespace QMAPP.FJC.DAL.BZD
{
/// </summary>
/// 模块名称:条码替换记录
/// 作 者:张松男
/// 编写日期:2022年11月07日
/// </summary>
public class BarCodeReplaceDAL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>*信息</returns>
public BarCodeReplace Get(BarCodeReplace info)
{
try
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//获取信息
info = session.Get<BarCodeReplace>(info);
}
return info;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataPage GetList(BarCodeReplace condition, DataPage page)
{
string sql = null;
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = this.GetQuerySql(condition, ref parameters);
//分页关键字段及排序
page.KeyName = "PID";
if (string.IsNullOrEmpty(page.SortExpression))
page.SortExpression = "CREATEDATE DESC";
using (IDataSession session = AppDataFactory.CreateMainSession())
{
// 对应多种数据库
//string sqlChange = this.ChangeSqlByDB(sql, session);
page = session.GetDataPage<BarCodeReplace>(sql, parameters.ToArray(), page);
}
return page;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取全部规则
/// </summary>
/// <returns></returns>
public List<BarCodeReplace> GetAllList()
{
try
{
string sql = "SELECT * FROM [T_AW_BarCodeReplace]";
List<DataParameter> parameters = new List<DataParameter>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.GetList<BarCodeReplace>(sql, parameters.ToArray()).ToList();
}
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取查询语句
/// <summary>
/// 获取查询语句
/// </summary>
/// <param name="user">查询条件</param>
/// <param name="parameters">参数</param>
/// <returns>查询语句</returns>
private string GetQuerySql(BarCodeReplace condition, ref List<DataParameter> parameters)
{
StringBuilder sqlBuilder = new StringBuilder();
StringBuilder whereBuilder = new StringBuilder();
try
{
//构成查询语句//[PID],[MPID],[barcodeFist],[Company_code],[Vehicle_type],[MATERIALCODDE],[configColor],[CREATEUSER],[CREATEDATE],[FLGDEL]
sqlBuilder.Append("SELECT * ");
sqlBuilder.Append("FROM [T_AW_BarCodeReplace] ");
whereBuilder.Append(" AND FLGDEL<> '1' ");
//查询条件
////查询条件
if (string.IsNullOrEmpty(condition.NewProductCode) == false)
{
whereBuilder.Append(" AND NewProductCode LIKE @NewProductCode ");
parameters.Add(new DataParameter { ParameterName = "NewProductCode", DataType = DbType.String, Value = "%" + condition.NewProductCode + "%" });
}
if (string.IsNullOrEmpty(condition.OldProductCode) == false)
{
whereBuilder.Append(" AND OldProductCode LIKE @OldProductCode ");
parameters.Add(new DataParameter { ParameterName = "OldProductCode", DataType = DbType.String, Value = "%" + condition.OldProductCode + "%" });
}
if (whereBuilder.Length > 0)
{
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
}
return sqlBuilder.ToString();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取导出的数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataTable GetExportData(BarCodeReplace info)
{
DataTable dt = null;
string sql = null;
List<DataParameter> parameters = new List<DataParameter>();
try
{
//构成查询语句
sql = this.GetQuerySql(info, ref parameters);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
dt = session.GetTable(sql, parameters.ToArray());
dt.TableName = "BarCodeReplace";
}
return dt;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public int Insert(BarCodeReplace info)
{
int count = 0;
try
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//插入基本信息
count = session.Insert<BarCodeReplace>(info);
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
/// <summary>
/// 更新信息
/// </summary>
/// <param name=""></param>
/// <returns>更新行数</returns>
public int Update(BarCodeReplace info)
{
int count = 0;
try
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//更新基本信息
count = session.Update<BarCodeReplace>(info);
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 逻辑删除
/// <summary>
/// 逻辑删除信息
/// </summary>
/// <param name=""></param>
/// <returns>删除个数</returns>
public int Delete(BarCodeReplace info)
{
StringBuilder sqlBuilder = new StringBuilder();
List<DataParameter> parameters = new List<DataParameter>();
int count = 0;
try
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//删除基本信息
sqlBuilder.Append("UPDATE T_AW_BarCodeReplace ");
sqlBuilder.Append("SET FLGDEL = '1' ");
sqlBuilder.Append("WHERE PID = @PID ");
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info.PID });
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray());
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}

1
APPQ5/QMAPP.FJC.DAL/QMAPP.FJC.DAL.csproj

@ -103,6 +103,7 @@
<Compile Include="Bucket\BucketInfoDAL.cs" /> <Compile Include="Bucket\BucketInfoDAL.cs" />
<Compile Include="Bucket\RawMaterialRecordDAL.cs" /> <Compile Include="Bucket\RawMaterialRecordDAL.cs" />
<Compile Include="BZD\BarcodeRule.cs" /> <Compile Include="BZD\BarcodeRule.cs" />
<Compile Include="BZD\BarCodeReplaceDAL.cs" />
<Compile Include="BZD\BZDConfigDAL.cs" /> <Compile Include="BZD\BZDConfigDAL.cs" />
<Compile Include="BZD\BarCodeReplacementDAL.cs" /> <Compile Include="BZD\BarCodeReplacementDAL.cs" />
<Compile Include="BZD\BZDRecorderDAL.cs" /> <Compile Include="BZD\BZDRecorderDAL.cs" />

52
APPQ5/QMAPP.FJC.Entity/BZD/BarCodeReplace.cs

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMFrameWork.Data.Attributes;
using QMAPP.Entity;
using System.ComponentModel;
using System.Data;
namespace QMAPP.FJC.Entity.BZD
{
/// </summary>
/// 模块名称:条码替换记录
/// 作 者:张松男
/// 编写日期:2022年11月07日
/// </summary>
[DBTable(TableName = "T_AW_BarCodeReplace")]
public class BarCodeReplace : BaseEntity
{
/// <summary>
/// 主键
/// </summary>
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)]
public string PID { get; set; }
/// <summary>
/// 新条码
/// </summary>
[DBColumn(ColumnName = "NewProductCode", DataType = DbType.String)]
public string NewProductCode { get; set; }
/// <summary>
/// 旧条码
/// </summary>
[DBColumn(ColumnName = "OldProductCode", DataType = DbType.String)]
public string OldProductCode { get; set; }
/// <summary>
/// 创建日期
/// </summary>
[DBColumn(ColumnName = "CREATEDATE", DataType = DbType.DateTime)]
public DateTime CREATEDATE { get; set; }
/// <summary>
/// 有效标志
/// </summary>
[DBColumn(ColumnName = "FLGDEL", DataType = DbType.String)]
public string FLGDEL { get; set; }
}
}

1
APPQ5/QMAPP.FJC.Entity/QMAPP.FJC.Entity.csproj

@ -97,6 +97,7 @@
<Compile Include="Bucket\BucketMaterial.cs" /> <Compile Include="Bucket\BucketMaterial.cs" />
<Compile Include="Bucket\BucketInfo.cs" /> <Compile Include="Bucket\BucketInfo.cs" />
<Compile Include="BZD\BarCodeReplacement.cs" /> <Compile Include="BZD\BarCodeReplacement.cs" />
<Compile Include="BZD\BarCodeReplace.cs" />
<Compile Include="BZD\BZDConfig.cs" /> <Compile Include="BZD\BZDConfig.cs" />
<Compile Include="BZD\BZDRecorder.cs" /> <Compile Include="BZD\BZDRecorder.cs" />
<Compile Include="BZD\BZDRecorder2.cs" /> <Compile Include="BZD\BZDRecorder2.cs" />

8
APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml

@ -456,6 +456,14 @@
<Action ContorllerName="SignInfo" ActionName="ExportExcel" PowerID="CD10080002">导出</Action> <Action ContorllerName="SignInfo" ActionName="ExportExcel" PowerID="CD10080002">导出</Action>
</Actions> </Actions>
</MenuItem> </MenuItem>
<MenuItem MenuID="10090000" MenuDes="条码替换记录" SystemID="FJC" Action="/BarCodeReplace/List" Target="url" PowerID="CD10090000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1">
<Actions>
<Action ContorllerName="BarCodeReplace" ActionName="List" PowerID="CD10090001">查询</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Add" PowerID="CD10090002">新建</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Edit" PowerID="CD10090003">修改</Action>
<Action ContorllerName="BarCodeReplace" ActionName="Delete" PowerID="CD10090004">删除</Action>
</Actions>
</MenuItem>
<!--<MenuItem MenuID="10040000" SystemID="FJC" MenuDes="生产进度查询" Action="" Target="url" PowerID="CD10040000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1"> <!--<MenuItem MenuID="10040000" SystemID="FJC" MenuDes="生产进度查询" Action="" Target="url" PowerID="CD10040000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="10000000" Seq="1">
<Actions> <Actions>
</Actions> </Actions>

204
APPQ5/QMAPP.FJC.Web/Controllers/BarCodeReplaceController.cs

@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMAPP.Common.Web.Controllers;
using QMFrameWork.WebUI.Attribute;
using QMAPP.FJC.Web.Models.Basic;
using QMFrameWork.Data;
using QMAPP.FJC.Entity.Basic;
using QMAPP.ServicesAgent;
using QMAPP.Entity;
using QMAPP.MD.Entity;
using QMAPP.MD.Web.Models;
using QMFrameWork.WebUI.DataSource;
using QMFrameWork.Common.Serialization;
using QMAPP.FJC.Web.Models.BZD;
using QMAPP.FJC.Entity.BZD;
namespace QMAPP.FJC.Web.Controllers
{
public class BarCodeReplaceController : QController
{
#region 获取信息
/// <summary>
/// 加载列表
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult List(bool? callback)
{
BarCodeReplaceModel seachModel = new BarCodeReplaceModel();
if (callback == true)
TryGetSelectBuffer<BarCodeReplaceModel>(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/BarCodeReplace/GetList";
return View("BarCodeReplaceList", seachModel);
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetList(bool? callBack)
{
BarCodeReplaceModel seachModel = null;
DataPage page = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
BarCodeReplace condition = null;
DataResult<DataPage> pageResult = new DataResult<DataPage>();
try
{
//获取查询对象
seachModel = GetModel<BarCodeReplaceModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<BarCodeReplaceModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<BarCodeReplaceModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<BarCodeReplace, BarCodeReplaceModel>(seachModel);
#region wcf服务统一接口
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("BarCodeReplaceBLL_GetList", condition, page);
if (pageResult.IsSuccess == false)
{
SetMessage(pageResult.Msg);
return List(true);
}
DateGridResult<BarCodeReplace> result = new DateGridResult<BarCodeReplace>();
result.Total = pageResult.Result.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize<List<BarCodeReplace>>(pageResult.Result.Result.ToString());
#endregion
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 编辑
/// <summary>
/// 编辑载入
/// </summary>
/// <returns>处理结果</returns>
[HandleException]
public ActionResult Edit()
{
BarCodeReplaceModel model = new BarCodeReplaceModel();
string ID = Request.Params["PID"];
BarCodeReplace Entity = new BarCodeReplace();
ServiceAgent wcfAgent = this.GetServiceAgent();
DataResult<BarCodeReplace> result = new DataResult<BarCodeReplace>();
try
{
if (string.IsNullOrEmpty(ID) == false)
{
//修改获取原数据
Entity.PID = ID;
result = wcfAgent.InvokeServiceFunction<DataResult<BarCodeReplace>>("BarCodeReplaceBLL_Get", Entity);
if (result.IsSuccess == false)
{
SetMessage(result.Msg);
return View("BarCodeReplaceEdit", model);
}
model = CopyToModel<BarCodeReplaceModel, BarCodeReplace>(result.Result);
}
return View("BarCodeReplaceEdit", model);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 保存
/// </summary>
/// <param name="model"></param>
/// <returns>处理结果</returns>
[HttpPost]
[HandleException]
[ValidateInput(false)]
public ActionResult Save(BarCodeReplaceModel saveModel)
{
BarCodeReplace Entity = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
DataResult<int> result = new DataResult<int>();
try
{
Entity = CopyToModel<BarCodeReplace, BarCodeReplaceModel>(saveModel);
if (string.IsNullOrEmpty(Entity.PID) == true)
{
//新增
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.BarCodeReplaceBLL_Insert.ToString(), Entity);
if (result.IsSuccess == false)
{
SetMessage("条码已存在!");
return View("BarCodeReplaceEdit", saveModel);
}
}
else
{
//修改
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.BarCodeReplaceBLL_Update.ToString(), Entity);
if (result.IsSuccess == false)
{
SetMessage("条码已存在!");
return View("BarCodeReplaceEdit", saveModel);
}
}
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge));
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 删除
/// <summary>
/// 删除
/// </summary>
/// <returns>结果</returns>
[HttpPost]
[HandleException]
public ActionResult Delete(BarCodeReplace model)
{
string selectKey = Request.Form["selectKey"];
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
var result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.BarCodeReplaceBLL_Delete.ToString(), selectKey);
if (result.Result == 0)
{
SetMessage("信息有关联,删除失败!");
return List(true);
}
SetMessage(AppResource.DeleteMessage);
return List(true);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}

63
APPQ5/QMAPP.FJC.Web/Models/BZD/BarCodeReplaceModel.cs

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc.Html;
using QMFrameWork.WebUI.Attribute;
using QMFrameWork.WebUI;
namespace QMAPP.FJC.Web.Models.BZD
{
/// </summary>
/// 模块名称:条码替换记录
/// 作 者:张松男
/// 编写日期:2022年11月07日
/// </summary>
public class BarCodeReplaceModel : QDGModel
{
/// <summary>
/// 主键
/// </summary>
[Description("主键")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)]
[DGColumn(Hidden = true, PrimaryKey = true)]
public string PID { get; set; }
/// <summary>
/// 新条码
/// </summary>
[Description("新条码")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string NewProductCode { get; set; }
/// <summary>
/// 旧条码
/// </summary>
[Description("旧条码")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string OldProductCode { get; set; }
/// <summary>
/// 是否可用
/// </summary>
[Description("是否可用")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center,Hidden = true)]
public string FLGDEL { get; set; }
/// <summary>
/// 创建日期
/// </summary>
[Description("创建时间")]
[HTMLInput(UpdateRead = true, MaxLength = 20)]
[InputType(inputType.hidden)]
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss")]
public DateTime CREATEDATE { get; set; }
}
}

4
APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj

@ -160,6 +160,7 @@
</Compile> </Compile>
<Compile Include="Common\ExcelOperationHelper.cs" /> <Compile Include="Common\ExcelOperationHelper.cs" />
<Compile Include="Controllers\AndonCallReasonController.cs" /> <Compile Include="Controllers\AndonCallReasonController.cs" />
<Compile Include="Controllers\BarCodeReplaceController.cs" />
<Compile Include="Controllers\ProductTimeController.cs" /> <Compile Include="Controllers\ProductTimeController.cs" />
<Compile Include="Controllers\BomHdrController.cs" /> <Compile Include="Controllers\BomHdrController.cs" />
<Compile Include="Controllers\BarCodeReplacementController.cs" /> <Compile Include="Controllers\BarCodeReplacementController.cs" />
@ -313,6 +314,7 @@
<Compile Include="Models\BZDConfigModel.cs" /> <Compile Include="Models\BZDConfigModel.cs" />
<Compile Include="Models\BZDRecorderModel.cs" /> <Compile Include="Models\BZDRecorderModel.cs" />
<Compile Include="Models\BZD\BarCodeReplacementModel.cs" /> <Compile Include="Models\BZD\BarCodeReplacementModel.cs" />
<Compile Include="Models\BZD\BarCodeReplaceModel.cs" />
<Compile Include="Models\CheckTime\ProductTimeModel.cs" /> <Compile Include="Models\CheckTime\ProductTimeModel.cs" />
<Compile Include="Models\CheckTime\CHECKTIMEModel.cs" /> <Compile Include="Models\CheckTime\CHECKTIMEModel.cs" />
<Compile Include="Models\EM\EmMeterCountModel.cs" /> <Compile Include="Models\EM\EmMeterCountModel.cs" />
@ -922,6 +924,8 @@
<Content Include="Views\BarCodeReplacement\BarCodeReplacementList.aspx" /> <Content Include="Views\BarCodeReplacement\BarCodeReplacementList.aspx" />
<Content Include="Views\AppConfig\AppConfigEdit.aspx" /> <Content Include="Views\AppConfig\AppConfigEdit.aspx" />
<Content Include="Views\AppConfig\AppConfigList.aspx" /> <Content Include="Views\AppConfig\AppConfigList.aspx" />
<Content Include="Views\BarCodeReplace\BarCodeReplaceEdit.aspx" />
<Content Include="Views\BarCodeReplace\BarCodeReplaceList.aspx" />
<Content Include="Views\ProductTime\ProductTimeEdit.aspx" /> <Content Include="Views\ProductTime\ProductTimeEdit.aspx" />
<Content Include="Views\ProductTime\ProductTimeList.aspx" /> <Content Include="Views\ProductTime\ProductTimeList.aspx" />
<Content Include="Views\SignInfo\SignInfoEdit.aspx" /> <Content Include="Views\SignInfo\SignInfoEdit.aspx" />

60
APPQ5/QMAPP.FJC.Web/Views/BarCodeReplace/BarCodeReplaceEdit.aspx

@ -0,0 +1,60 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.BZD.BarCodeReplaceModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
设备信息编辑
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPEdit("条码规则信息编辑", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%>
<table id="editTable" cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<tr>
<th align="right">
<%=Html.QV(p=>p.NewProductCode) %>
</th>
<td>
<%=Html.QC(p => p.NewProductCode)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p=>p.OldProductCode) %>
</th>
<td>
<%=Html.QC(p => p.OldProductCode)%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%=Html.HiddenFor(p => p.PID)%>
<%=Html.HiddenFor(p => p.CREATEDATE)%>
<%=Html.HiddenFor(p => p.FLGDEL)%>
<%=Html.QPEnd() %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<%=Html.QTButtonSave("User", "Save", "return Save();")%>
<%=Html.QTButtonBack("close", "List", "parent.closeAppWindow1();return false;")%>
</td>
</tr>
</table>
<script type="text/javascript">
function Save() {
if (isValidate() == false) {
return false;
}
submitByButton("Save");
}
</script>
</asp:Content>

94
APPQ5/QMAPP.FJC.Web/Views/BarCodeReplace/BarCodeReplaceList.aspx

@ -0,0 +1,94 @@
 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.BZD.BarCodeReplaceModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
条码规则信息列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPSeach(100,true) %>
<table id="condiTable">
<tr>
<th align="right">
<%=Html.QV(p=>p.NewProductCode) %>
</th>
<td>
<%=Html.QC(p => p.NewProductCode)%>
</td>
<th align="right">
<%=Html.QV(p => p.OldProductCode)%>
</th>
<td>
<%=Html.QC(p => p.OldProductCode)%>
</td>
</tr>
</table>
<div style="left: 1px; position: relative;"></div>
<%=Html.QPEnd()%>
<%=Html.QPList() %>
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.BZD.BarCodeReplaceModel>(Model)%>
<%=Html.QPEnd() %>
<%=Html.Hidden("PID")%>
<%=Html.Hidden("selectKey")%>
<script language="javascript" type="text/javascript">
//添加
function Add() {
openAppWindow1('条码替换记录添加', 'Edit', '400', '400');
}
//修改
function Update() {
var ids = getSelectKey();
if (ids == "") {
MSI("提示", "请选择修改记录。");
return;
}
if (ids.indexOf(":") > 0) {
MSI("提示", "每次只能修改一条记录。");
return;
}
document.getElementById("selectKey").value = ids;
openAppWindow1('条码替换记录修改', 'Edit?PID=' + ids, '400', '400');
}
//删除
function Delete() {
var ids = getSelectKey();
if (ids == "") {
MSI("错误", "至少选择一条记录");
}
else {
document.getElementById("selectKey").value = ids;
MSQ("提示",
"确定要删除选中的记录吗?",
function() {
submitByButton("Delete");
});
}
}
$(function () {
$('#FACTORY_CODE').combobox({
panelWidth: '350'
});
});
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<%=Html.QTButtonSearch("BarCodeReplace", "List", "List(1)", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButtonAdd("BarCodeReplace", "Add", "Add()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButtonUpdate("BarCodeReplace", "Edit", "Update()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButtonDelete("BarCodeReplace", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%>
</td>
</tr>
</table>
</asp:Content>

22
AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs

@ -228,6 +228,28 @@ namespace QMAPP.ServicesAgent
[Description("基础数据方法枚举")] [Description("基础数据方法枚举")]
public enum DictService public enum DictService
{ {
#region 条码替换记录
/// <summary>
/// 插入
/// </summary>
[Description("插入")]
BarCodeReplaceBLL_Insert,
/// <summary>
/// 更新
/// </summary>
[Description("更新")]
BarCodeReplaceBLL_Update,
/// <summary>
/// 删除
/// </summary>
[Description("删除")]
BarCodeReplaceBLL_Delete,
#endregion
#region 天津库存 #region 天津库存
/// <summary> /// <summary>

7
ServicesCenter/WCF/QMFrameWork.WebServiceHost/App_Data/FJCServiceList.xml

@ -995,4 +995,11 @@
<AssemblyFile>QMAPP.FJC.BLL.dll</AssemblyFile> <AssemblyFile>QMAPP.FJC.BLL.dll</AssemblyFile>
</ServiceDefinition> </ServiceDefinition>
<ServiceDefinition>
<ServiceName>BarCodeReplaceBLL</ServiceName>
<ServiceDes>条码替换记录</ServiceDes>
<FullLogicClassName>QMAPP.FJC.BLL.BZD.BarCodeReplaceBLL</FullLogicClassName>
<AssemblyFile>QMAPP.FJC.BLL.dll</AssemblyFile>
</ServiceDefinition>
</BusinessDllList> </BusinessDllList>

8
ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

@ -63,18 +63,18 @@
<connectionStrings> <connectionStrings>
<!--主数据库连接--> <!--主数据库连接-->
<!--
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<!--
<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>--> <add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />--> <!--<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />-->
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<!-- <!--
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>
--> -->
<!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>-->

Loading…
Cancel
Save