Browse Source

增加天津新需求

master
songnan.zhang 3 years ago
parent
commit
b8c6b748ba
  1. 2
      APP/QMAPP.Web/Views/Home/Login.aspx
  2. 7
      APP/QMAPP.Web/Web.config
  3. 223
      APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs
  4. 2
      APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs
  5. 23
      APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs
  6. BIN
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJDoorPlankPlanImp.xlsx
  7. 39
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJDoorPlankPlanImp.xml
  8. 10
      APPQ5/QMAPP.FJC.Web/Controllers/TJDoorPlankPlanController.cs
  9. 3
      APPQ5/QMAPP.FJC.Web/Models/TianJin/TJDoorPlankPlanModel.cs
  10. 6
      APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj
  11. BIN
      APPQ5/QMAPP.FJC.Web/Temp/5fcea1f9-ea55-4d23-8b98-78541fafab73.xlsx
  12. BIN
      APPQ5/QMAPP.FJC.Web/Temp/af9d4740-7223-4f5c-ad0c-8ffb489a1603.xlsx
  13. BIN
      APPQ5/QMAPP.FJC.Web/Temp/f3271430-e5e1-4ca8-b78b-2351c788f148.xlsx
  14. 6
      APPQ5/QMAPP.FJC.Web/Views/TJDoorPlankPlan/DoorPlankPlanList.aspx
  15. 5
      APPQ5/QMAPP.FJC.Web/Web.config
  16. 8
      APPQ5/QMAPP.WinForm/App.config
  17. 1
      APPQ5/QMAPP.WinForm/Forms/TianJin/RerportModel.ttx
  18. 375
      APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs
  19. BIN
      APPQ5/QMAPP.WinForm/Forms/TianJin/TJPastCard.rpt
  20. 5
      AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs
  21. 5
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

2
APP/QMAPP.Web/Views/Home/Login.aspx

@ -159,7 +159,7 @@
<h1>
富维安道拓数字化工厂</h1>
<h2>
Adient CHENGDU Digital factory</h2>
Adient Digital factory</h2>
<div id="printDiv" style="display: none;">
<span style="font-weight: bold; font-size: 20px; font-family: 宋体; color: #FF0000;">您未安装客户端打印控件,请进行<a
id="A1" href="../../Scripts/Lodop/install_lodop32.exe"><span style="color: #FF0000;

7
APP/QMAPP.Web/Web.config

@ -45,9 +45,12 @@
<!--<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"/>-->
</connectionStrings>
<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />
</connectionStrings>
<!--日志组件配置开始-->
<log4net>
<logger name="loginfo">

223
APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs

@ -540,7 +540,7 @@ namespace QMAPP.FJC.BLL.TianJin
}
#endregion
#region 导入数据
#region 导入数据 --Web-导入计划
/// <summary>
/// 导入Excel表数据
/// </summary>
@ -549,155 +549,78 @@ namespace QMAPP.FJC.BLL.TianJin
/// <param name="plantmodel">工厂信息</param>
/// <param name="productbasicmodel">零件类别信息</param>
/// <returns>结果</returns>
//public DataResult<ImportMessage> GetImportData(List<TJOrderPlan> list, Material materialmodel, QMAPP.FJC.Entity.Basic.MachineInfo machine, FJC.Entity.Basic.ProduceShift produceshiftmodel, QMAPP.MD.Entity.WorkCell workcellmodel)
//{
// DataResult<ImportMessage> result = new DataResult<ImportMessage>();
// TJDoorPlankPlanDAL cmDal = new TJDoorPlankPlanDAL();
// List<TJOrderPlan> List = new List<TJOrderPlan>();
// int index = 0;
// int num = 0;
// try
// {
// result.Result = new ImportMessage();
// result.Result.Errors = new List<RowError>();
// List<Material> materialinfo = null;
// List<FJC.Entity.Basic.ProduceShift> produceshiftinfo = null;
// List<QMAPP.FJC.Entity.Basic.MachineInfo> machineList = null;
// using (IDataSession session = AppDataFactory.CreateMainSession())
// {
// ///获取物料信息
// materialinfo = new QMAPP.MD.BLL.MaterialBLL().GetNewMaterialList(materialmodel,workcellmodel);
// //获取班次信息
// produceshiftinfo = new QMAPP.FJC.BLL.Basic.ProduceShiftBLL().GetWorkcenterShifts(workcellmodel.WORKCENTER_CODE);
// //获取设备信息
// machineList = new QMAPP.FJC.BLL.Basic.MachineInfoBLL().GetMachineForOrderList(machine, workcellmodel);
// //状态判断
// foreach (TJOrderPlan ma in list)
// {
// index++;
// num++;
// //物料
// Material areaMes = materialinfo.Find(a => a.MATERIAL_CODE == ma.MATERIAL_CODE);
// if (areaMes != null)
// {
// ma.MATERIAL_CODE = areaMes.MATERIAL_CODE;
// }
// else
// {
// ma.MATERIAL_CODE = null;
// result.Result.Errors.Add(new RowError(index, "物料信息不存在"));
// result.Result.failureNum += 1;
// continue;
// }
// //班次
// FJC.Entity.Basic.ProduceShift plantMes = produceshiftinfo.Find(p => p.PRODUCESHIFTTCODE == ma.SHIFT_CODE);
// if (plantMes != null)
// {
// ma.SHIFT_CODE = plantMes.PRODUCESHIFTTCODE;
// }
// else
// {
// ma.SHIFT_CODE = null;
// result.Result.Errors.Add(new RowError(index, "班次信息不存在"));
// result.Result.failureNum += 1;
// continue;
// }
// //转变生产要求PRODUCEREQUIRE
// if (ma.PRODUCEREQUIRE != null)
// {
// if (ma.PRODUCEREQUIRE.Equals("以数量为准"))
// {
// ma.PRODUCEREQUIRE = "0";
// }
// else if (ma.PRODUCEREQUIRE.Equals("以时间为准"))
// {
// ma.PRODUCEREQUIRE = "1";
// }
// else
// {
// ma.PRODUCEREQUIRE = null;
// result.Result.Errors.Add(new RowError(index, "生产要求信息错误"));
// result.Result.failureNum += 1;
// continue;
// }
// }
// if (string.IsNullOrEmpty(ma.InfoError) == false)
// {
// ma.PID = null;
// result.Result.failureNum += 1;
// continue;
// }
// //修改改时根据主键等信息获取详细内容信息
// TJOrderPlan oldInfo = cmDal.Get(ma);
// if (oldInfo != null)
// {
// //更新
// ma.PID = oldInfo.PID;
// ma.PLAN_SEQ = oldInfo.PLAN_SEQ;
// ma.FACTORY_CODE = oldInfo.FACTORY_CODE;
// ma.WORKCENTER_CODE = oldInfo.WORKCENTER_CODE;
// ma.PBOM_CODE = oldInfo.PBOM_CODE;
// ma.ROUTE_CODE = oldInfo.ROUTE_CODE;
// ma.PLAN_STATE = oldInfo.PLAN_STATE;
// ma.PLANSOURCE = oldInfo.PLANSOURCE;
// ma.CREATEUSER = oldInfo.CREATEUSER;
// ma.CREATEDATE = oldInfo.CREATEDATE;
// ma.UPDATEUSER = this.LoginUser.UserID;
// ma.UPDATEDATE = oldInfo.UPDATEDATE;
// ma.IsNewInfo = false;
// result.Result.updateNum += 1;
// }
// else
// {
// //新增
// oldInfo = new TJOrderPlan();
// ma.PID = Guid.NewGuid().ToString();
// ma.PLAN_NO = ma.PLAN_NO;
// //int no = new TJDoorPlankPlanDAL().GetNum(ma) + (num - 1);
// //ma.PLAN_SEQ = ma.PLAN_DATE.ToString("yyyyMMdd") + no;
// ma.PLAN_STATE = EnumGeter.PLANSTATE.INIT.GetHashCode().ToString();
// ma.MATERIAL_CODE = ma.MATERIAL_CODE;
// ma.MACHINECODDE = ma.MACHINECODDE;
// ma.QTY = ma.QTY;
// //Pbom
// Pbom pbomcode = new PbomDAL().Get(new Pbom { MATERIAL_CODE = ma.MATERIAL_CODE });
// ma.PBOM_CODE = pbomcode.PBOM_CODE;
// //工艺路线
// QMAPP.MD.Entity.ProcessRoute routecode = new QMAPP.MD.DAL.ProcessRouteDAL().RouteWithMaterial(ma.MATERIAL_CODE);
// ma.ROUTE_CODE = routecode.ROUTE_CODE;
// ma.PLAN_DATE = ma.PLAN_DATE;
// ma.SHIFT_CODE = ma.SHIFT_CODE;
// ma.PLANSOURCE = "1";
// ma.PRODUCEREQUIRE = ma.PRODUCEREQUIRE;
// ma.CREATEUSER = this.LoginUser.UserID;
// ma.CREATEDATE = DateTime.Now;
// ma.UPDATEUSER = ma.CREATEUSER;
// ma.UPDATEDATE = ma.CREATEDATE;
// //工作中心
// string workcentercode = new WorkCellDAL().GetWorkcenter(workcellmodel.WORKCELL_CODE);
// ma.WORKCENTER_CODE = workcentercode;
// //工厂
// string factory = new QMAPP.MD.DAL.FactoryDAL().GetFactoryWithWorkcenter(workcentercode);
// ma.FACTORY_CODE = factory;
// ma.IsNewInfo = true;
// result.Result.insertNum += 1;
// }
// List.Add(ma);
// }
// }
// //导入
// cmDal.GetImportData(List);
// result.Msg = "导入成功";
// result.IsSuccess = true;
// return result;
// }
// catch (Exception ex)
// {
// result.IsSuccess = false;
// result.Ex = ex;
// return result;
// }
//}
public DataResult<ImportMessage> GetImportData(List<TJOrderPlan> list, Material materialmodel, QMAPP.FJC.Entity.Basic.MachineInfo machine, FJC.Entity.Basic.ProduceShift produceshiftmodel, QMAPP.MD.Entity.WorkCell workcellmodel)
{
DataResult<ImportMessage> result = new DataResult<ImportMessage>();
TJDoorPlankPlanDAL cmDal = new TJDoorPlankPlanDAL();
List<TJOrderPlan> List = new List<TJOrderPlan>();
int index = 0;
int num = 0;
try
{
result.Result = new ImportMessage();
result.Result.Errors = new List<RowError>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//获取流水号 导入数据的顺序号 导入文件自己定义
//var SEQSTR = this.GetOrderPlanSeq(model);
foreach (TJOrderPlan ma in list)
{
index++;
num++;
//计划单号
ma.PLAN_NO = "DP" + ma.PLAN_DATE.ToString("yyyyMMdd") + ma.PLAN_SEQ.PadLeft(3,'0');
TJDoorPlankPlanDAL cmdDAL = new TJDoorPlankPlanDAL();
ma.MATERIAL_NAME = cmdDAL.GetMATERIALNAME(ma.MATERIAL_CODE);
//修改改时根据主键等信息获取详细内容信息
TJOrderPlan oldInfo = cmDal.Get(ma);
if (oldInfo != null)
{
//更新
ma.PID = oldInfo.PID;
ma.PLAN_SEQ = oldInfo.PLAN_SEQ;
ma.MATERIAL_CODE = oldInfo.MATERIAL_CODE;
ma.MATERIAL_NAME = oldInfo.MATERIAL_NAME;
ma.PLAN_STATE = oldInfo.PLAN_STATE;
ma.LINENO = oldInfo.LINENO;
ma.CREATEUSER = oldInfo.CREATEUSER;
ma.CREATEDATE = oldInfo.CREATEDATE;
ma.UPDATEUSER = this.LoginUser.UserID;
ma.UPDATEDATE = oldInfo.UPDATEDATE;
ma.IsNewInfo = false;
result.Result.updateNum += 1;
}
else
{
//新增
oldInfo = new TJOrderPlan();
ma.PID = Guid.NewGuid().ToString();
ma.PLAN_STATE = EnumGeter.PLANSTATE.INIT.GetHashCode().ToString();
ma.CREATEUSER = this.LoginUser.UserID;
ma.CREATEDATE = DateTime.Now;
ma.IsNewInfo = true;
result.Result.insertNum += 1;
}
List.Add(ma);
}
}
//导入
cmDal.GetImportData(List);
result.Msg = "导入成功";
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Ex = ex;
return result;
}
}
#endregion

2
APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs

@ -171,7 +171,7 @@ namespace QMAPP.FJC.BLL.TianJin
/// <summary>
/// 添加贴车单
/// 添加贴车单 -- 计划外发运
/// </summary>
/// <param name="ppastecard"></param>
/// <returns></returns>

23
APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs

@ -718,29 +718,6 @@ namespace QMAPP.FJC.DAL.TianJin
#region
try
{
#region 判断是否出现底盘号情况
if (ppastecard.DetailsCardlist.Count == 1)
{
ppastecard.VINLACK = "0";
}
else
{
int firstVin = Convert.ToInt32(ppastecard.DetailsCardlist[0].VIN.Substring(10, 7));
int lastVin = Convert.ToInt32(ppastecard.DetailsCardlist[ppastecard.DetailsCardlist.Count - 1].VIN.Substring(10, 7));
if ((lastVin - firstVin) == ppastecard.DetailsCardlist.Count - 1)
{
ppastecard.VINLACK = "0";
}
else
{
ppastecard.VINLACK = "1";
}
}
#endregion
DataTable tbl = GetPastecardDeatis();
int strindex = 0;
int reindex = 0;

BIN
APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJDoorPlankPlanImp.xlsx

Binary file not shown.

39
APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJDoorPlankPlanImp.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<DataInfoMains>
<DataInfoMain InfoName="TJDoorPlankPlanImp" InfoTitle="门板发运计划信息" TemplateFile="TJDoorPlankPlanImp.xlsx" RecordCount="n">
<DataInfoItems>
<DataInfoItem ColumnName="PLAN_DATE" ColumnTitle="计划日期" XPosition="A" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="PLAN_SEQ" ColumnTitle="计划顺序号" XPosition="B" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="LINENO" ColumnTitle="车型" XPosition="C" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="MATERIAL_CODE" ColumnTitle="物料号" XPosition="D" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="QTY" ColumnTitle="计划数量" XPosition="E" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
</DataInfoItems>
</DataInfoMain>
</DataInfoMains>

10
APPQ5/QMAPP.FJC.Web/Controllers/TJDoorPlankPlanController.cs

@ -295,10 +295,10 @@ namespace QMAPP.FJC.Web.Controllers
try
{
dt = this.GetTableByExcel("DoorPlankPlanImp", fileName, dt);
dt = this.GetTableByExcel("TJDoorPlankPlanImp", fileName, dt);
//格式转换
list = QMFrameWork.Common.Util.BindHelper.ConvertToList<TJOrderPlan>(dt).ToList();
serviceResult = wcfAgent.InvokeServiceFunction<DataResult<ImportMessage>>("DoorPlankPlanBLL_GetImportData", list, materialmodel,machine, produceshiftmodel, workcell);
serviceResult = wcfAgent.InvokeServiceFunction<DataResult<ImportMessage>>("TJDoorPlankPlanBLL_GetImportData", list, materialmodel,machine, produceshiftmodel, workcell);
if (serviceResult.Ex != null)
{
throw serviceResult.Ex;
@ -310,7 +310,7 @@ namespace QMAPP.FJC.Web.Controllers
dt.Rows[error.Key - 1]["InfoError"] = error.Value;
}
ImportMessageModel model = new ImportMessageModel();
model.InfoName = "DoorPlankPlanImp";
model.InfoName = "TJDoorPlankPlanImp";
model.ReturnUrl = "/TJDoorPlankPlan/List?callBack=true";
model.Message = serviceResult.Result;
model.ErrorDt = dt;
@ -347,8 +347,8 @@ namespace QMAPP.FJC.Web.Controllers
try
{
string path = AppDomain.CurrentDomain.BaseDirectory + "App_Data/Excel/";
string fileName = "DoorPlankPlanImp.xlsx";
return File(path + fileName, "application/vnd.ms-excel", Url.Encode("门板信息导入模板.xlsx"));
string fileName = "TJDoorPlankPlanImp.xlsx";
return File(path + fileName, "application/vnd.ms-excel", Url.Encode("门板发运导入模板.xlsx"));
}
catch (Exception ex)
{

3
APPQ5/QMAPP.FJC.Web/Models/TianJin/TJDoorPlankPlanModel.cs

@ -112,6 +112,7 @@ namespace QMAPP.FJC.Web.Models.TianJin
/// 创建用户
/// </summary>
[Description("创建用户")]
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center, Hidden = true)]
public string CREATEUSER { get; set; }
@ -119,7 +120,7 @@ namespace QMAPP.FJC.Web.Models.TianJin
/// 创建用户
/// </summary>
[Description("创建用户")]
[DGColumn(Sortable = true, Width = 100, DataAlign = DataAlign.left)]
[DGColumn(Sortable = true, Width = 100, DataAlign = DataAlign.left,Hidden = true)]
public string CREATEUSERNAME { get; set; }

6
APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj

@ -428,6 +428,9 @@
<Content Include="App_Data\Excel\DoorPlankPlanExp.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\TJDoorPlankPlanImp.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\DoorPlankPlanImp.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -1302,6 +1305,9 @@
<None Include="App_Data\Excel\DoorPlankPlanExp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="App_Data\Excel\TJDoorPlankPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App_Data\Excel\DoorPlankPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

BIN
APPQ5/QMAPP.FJC.Web/Temp/5fcea1f9-ea55-4d23-8b98-78541fafab73.xlsx

Binary file not shown.

BIN
APPQ5/QMAPP.FJC.Web/Temp/af9d4740-7223-4f5c-ad0c-8ffb489a1603.xlsx

Binary file not shown.

BIN
APPQ5/QMAPP.FJC.Web/Temp/f3271430-e5e1-4ca8-b78b-2351c788f148.xlsx

Binary file not shown.

6
APPQ5/QMAPP.FJC.Web/Views/TJDoorPlankPlan/DoorPlankPlanList.aspx

@ -181,9 +181,9 @@
<%=Html.QTButton("insertorder","Insert",QMFrameWork.WebUI.IconCls.add,"Insert()", QMAPP.Common.Web.SystemLimit.isLimt)%> --%>
<%=Html.QTButtonDelete("DoorPlankPlan", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("publish", "PutOut", "detail", "Publish()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%-- <%=Html.QTButton("import", "ImportExcel", QMFrameWork.WebUI.IconCls.undo, "Import()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("template", "TemplateExcel", QMFrameWork.WebUI.IconCls.template, "getTemplate()", QMAPP.Common.Web.SystemLimit.isLimt)%> --%>
<%=Html.QTButton("import", "ImportExcel", QMFrameWork.WebUI.IconCls.undo, "Import()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%-- <%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%>
<%=Html.QTButton("template", "TemplateExcel", QMFrameWork.WebUI.IconCls.template, "getTemplate()", QMAPP.Common.Web.SystemLimit.isLimt)%>
</td>
</tr>
</table>

5
APPQ5/QMAPP.FJC.Web/Web.config

@ -36,7 +36,10 @@
<!--<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;" providerName="System.Data.SqlClient"/>
<!--<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;" 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" />
</connectionStrings>
<!--日志组件配置开始-->
<log4net>

8
APPQ5/QMAPP.WinForm/App.config

@ -8,8 +8,11 @@
<!--<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.111.144.98;Initial Catalog=ADIENT_CD_MES9;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.98;Initial Catalog=ADIENT_CD_MES9;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=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />
</connectionStrings>
@ -123,6 +126,7 @@
<add key="UpperBarcodeLen" value="20" />
<add key="LowerBarcodeLen" value="5" />
<add key="PlaceFirstPositionCode" value="FirstPosition" />
<add key="PlaceFirstPositionType" value="False" />
<add key="PlantNameConfig" value="" />
<add key="ShowDataCount" value="6" />

1
APPQ5/QMAPP.WinForm/Forms/TianJin/RerportModel.ttx

@ -8,3 +8,4 @@ CARSETDESCCN String 100
CP5A String 100
PASTECARDNO String 100
SCANDATE String 100
PRODUCTCODE String 100

375
APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs

@ -45,6 +45,9 @@ namespace QMAPP.WinForm.Forms.TianJin
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent();
List<BarcodeRules> _barcodeRules = null;
public delegate void myMethodDelegate();
private string PlaceFirstPositionType = string.Empty;
#endregion
#region 变量
@ -67,6 +70,9 @@ namespace QMAPP.WinForm.Forms.TianJin
public TJFrmPlace()
{
InitializeComponent();
PlaceFirstPositionType = System.Configuration.ConfigurationManager.AppSettings["PlaceFirstPositionType"].ToString();
_barcodeRules = _agent.InvokeServiceFunction<List<BarcodeRules>>("BarcodeRulesBLL_GetListForSend");
}
#endregion
@ -754,11 +760,11 @@ namespace QMAPP.WinForm.Forms.TianJin
//#region "隐藏了rb_hx 和rb_dx,全部根据pFisType判断,生产线的设置使用按钮进行设置"
if (pFisType == "01")
{
strprodtype = "( )";
strprodtype = "( )";
}
else if (pFisType == "02")
{
strprodtype = "( )";
strprodtype = "( )";
}
//提交数据处理
foreach (DataRow dr in tbl.Rows)
@ -805,7 +811,7 @@ namespace QMAPP.WinForm.Forms.TianJin
nfpastecard.OPERATOR = ClientContext.LoginInfo.UserName.ToString();
// nfpastecard.
}
int rowindex = agent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_AddNewPasteCard.ToString(), nfpastecard);
int rowindex = agent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.FrmPlaceManage.TJFrmPlaceBLL_AddNewPasteCard.ToString(), nfpastecard);
// 打印处理
TJFrmCarCardPrintShow frm = new TJFrmCarCardPrintShow(nfpastecard, strprodtype, "手动");
frm.Owner = this;
@ -813,23 +819,6 @@ namespace QMAPP.WinForm.Forms.TianJin
frm.ShowDialog();
isprint = frm.isprint;
}
//if (isprint)
//{
// nfpastecard.DetailsCardlist = nflist;
// nfindex = 0;
// // BllFisOrder bllFisOrder = new BllFisOrder();
// //int strindex = bllFisOrder.AddPasteCard(nfpastecard);
// //QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
// int strindex = agent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_AddNewPasteCard.ToString(), nfpastecard);
// TJPrintPasteCard prin = new TJPrintPasteCard();
// prin.Print(strindex, nfpastecard, strprodtype);
// GetInitData();
// DGVRemoveRow(nflist, ref ncslist);
// nflist = new List<EPasteDetailsCard>();
// dgvNF.DataMember = null;
// dgvNF.DataSource = nflist;
// //computenfncs();
//}
}
else
{
@ -980,7 +969,7 @@ namespace QMAPP.WinForm.Forms.TianJin
nfpastecard.FailLog = log;
nfindex = 0;
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
int rowindex = agent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_AddPasteCard.ToString(), nfpastecard);
int rowindex = agent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.FrmPlaceManage.TJFrmPlaceBLL_AddNewPasteCard.ToString(), nfpastecard);
//BllFisOrder bllFisOrder = new BllFisOrder();
//int rowindex = bllFisOrder.AddPasteCard(nfpastecard);
TJPrintPasteCard prin = new TJPrintPasteCard();
@ -1040,7 +1029,7 @@ namespace QMAPP.WinForm.Forms.TianJin
if (openConfirmDialog
&& string.Equals(QMAPP.WinForm.Common.LocalSetting.Settings["AlertConfirmEnable", "0"], "1"))
{
Common.frmAlertConfirm alertconfirm = new Common.frmAlertConfirm(message, "CD85010800");
Common.frmAlertConfirm alertconfirm = new Common.frmAlertConfirm(message, "85010800");
alertconfirm.StartPosition = FormStartPosition.CenterScreen;
alertconfirm.ShowDialog();
}
@ -1126,21 +1115,20 @@ namespace QMAPP.WinForm.Forms.TianJin
dgvMATChange.Rows[temprowindex].Cells["STATE"].Value = "1";
break;
temprowindex = dgvMATChange.Rows.Count;
}
else
{
SetContainerItem(nfindex, false);
Alert("条码错误:条码的零件号与FIS队列零件号不符合。");
break;
return;
}
}
else
{
SetContainerItem(nfindex, false);
Alert("条码错误:条码已扫描或车型不符合。");
break;
return;
}
}
@ -1148,9 +1136,11 @@ namespace QMAPP.WinForm.Forms.TianJin
else
{
Alert("扫描条码重复,请重新扫描。");
return;
}
SetContainerItem(nfindex, true);
CreateNFPaste(Code); //创建NF的贴车单以及明细
SetContainerItem(nfindex, true);
if (dgvMATChange.RowCount > 0)
{
dgvMATChange.FirstDisplayedScrollingRowIndex = nfindex - nfindex % 4;
@ -1177,73 +1167,6 @@ namespace QMAPP.WinForm.Forms.TianJin
}
inputstring = txtCode.Text.ToUpper();
this.lberror.Text = null;
#region 使用登录码快速切换用户
//使用登录码快速切换用户
//if (System.Text.RegularExpressions.Regex.IsMatch(txtCode.Text, "^<\\w+::\\w+>$"))
//{
// var ret = ClientContext.CodeLogin(txtCode.Text);
// if (string.Equals(ret, "登录成功!"))
// {
// ClientContext.SetUserAuth(this);
// }
// lberror.Text = ret;
// ArragetxtCode();
// return;
//}
//if (System.Text.RegularExpressions.Regex.IsMatch(txtCode.Text.ToUpper(), "^>CMD:\\w+$"))//扫描输入为指令码
//{
// ExcuteCMDCode();
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
_CMDConfirm = "";
#endregion
//#region 原校验
//string PastNOConfirmEnable = QMAPP.WinForm.Common.LocalSetting.Settings["PastNOConfirmEnable", "0"];
//if (System.Text.RegularExpressions.Regex.IsMatch(txtCode.Text.ToUpper(), "^" + WORKCENTER_CODE + "\\w+$"))//扫描输入为贴车单号
//{
// if (string.Equals("1", PastNOConfirmEnable)) //贴车单确认功能开启
// {
// GetLastPastCard();
// if (string.Equals(txtCode.Text.ToUpper(), lblLastPastNO.Text.ToUpper()))
// {
// lberror.Text = "前车贴车单号确认完成!";
// SetPastNOConfirm(1);
// ArragetxtCode();
// return;
// }
// else
// {
// lberror.Text = "前车贴车单号确认失败!";
// SetPastNOConfirm(2);
// ArragetxtCode();
// return;
// }
// }
// else
// {
// lberror.Text = "贴车单号确认功能未开启,无需扫描贴车单号!";
// SetPastNOConfirm(0);
// ArragetxtCode();
// return;
// }
//}
//if (string.Equals("1", PastNOConfirmEnable)) //贴车单确认功能开启
//{
// if (!pbPastNoConfirmed.Enabled)
// {
// Alert("请先扫描前车贴车单号进行贴车单确认!");
// ArragetxtCode();
// return;
// }
//}
//#endregion
#region fis区是否有记录
if (dgvMATChange.Rows.Count == 0)
@ -1260,10 +1183,8 @@ namespace QMAPP.WinForm.Forms.TianJin
if (this.dgvNF.Rows.Count == 0) //第一个码必须先扫描1号位
{
string placeCode = txtCode.Text.Trim();
var sss = System.Configuration.ConfigurationManager.AppSettings["PlaceFirstPositionCode"].ToString();
if (placeCode.Equals(System.Configuration.ConfigurationManager.AppSettings["PlaceFirstPositionCode"].ToString()))
{
this.placeFirstPosition = placeCode;
this.placeFirstPositionTime = DateTime.Now;
this.txtCode.Text = "";
@ -1275,38 +1196,6 @@ namespace QMAPP.WinForm.Forms.TianJin
#endregion
#region 一号位时间校验
//if (this.dgvNF.Rows.Count == 0 && !string.IsNullOrEmpty(this.placeFirstPosition))//超时判断
//{
// double timeOutSecond = 0;
// //获取超时时间设定值
// //DataTable dtTimeOut = new BllTimeOutSet().GetList();
// DataTable dtTimeOut = agent.InvokeServiceFunction<DataTable>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_GetTimeOutSet.ToString());
// if (dtTimeOut.Rows.Count > 0)
// {
// timeOutSecond = Convert.ToDouble(dtTimeOut.Rows[0]["TIMEOUT_VALUE"].ToString());
// }
// //获取超时时间设定值
// if (timeOutSecond > 0)
// {
// TimeSpan ts = DateTime.Now - this.placeFirstPositionTime;
// if (ts.TotalSeconds > timeOutSecond)
// {
// this.placeFirstPosition = "";
// this.txtCode.Text = "";
// this.placeFirstPositionTime = DateTime.MinValue;
// lberror.Text = "扫描本体件超时,请重新扫描1号位!";
// //处理条码扫描文本框
// ArragetxtCode();
// return;
// }
// }
//}
#endregion
#region 请先扫描1号位
if (string.IsNullOrEmpty(this.placeFirstPosition))
{
@ -1317,27 +1206,83 @@ namespace QMAPP.WinForm.Forms.TianJin
}
#endregion
#region FIS区域数据全部扫描完成,请获取数据后再扫描
if (dgvNF.Rows.Count >= dgvMATChange.Rows.Count)
#region 计划外发运
if (inputstring.Equals("FIRSTPOSITIONTYPE"))
{
Alert("当前计划数据全部扫描完成,请下达计划后再扫描!");
if (PlaceFirstPositionType == "False")
{
PlaceFirstPositionType = "True";
lberror.Text = "关闭验证!";
}
else
{
PlaceFirstPositionType = "False";
lberror.Text = "打开验证!";
}
this.txtCode.Text = "";
//处理条码扫描文本框
ArragetxtCode();
return;
}
#endregion
#region 长度校验
//string pp = System.Configuration.ConfigurationManager.AppSettings["UpperBarcodeLen"].ToString();
//Int32 ul = int.Parse(System.Configuration.ConfigurationManager.AppSettings["UpperBarcodeLen"].ToString());
//Int32 ll = int.Parse(System.Configuration.ConfigurationManager.AppSettings["LowerBarcodeLen"].ToString());
if (PlaceFirstPositionType == "True")
{
#region 校验是否有重复的扫过的条码
if (dgvNF.Rows.Count > 0)
{
for (var i = 0; i < dgvNF.Rows.Count; i++)
{
if (dgvNF.Rows[i].Cells[CODE_NF.Name].Value.ToString().ToUpper() == inputstring)
{
SetContainerItem(nfindex, false);
Alert("该条码已扫描!");
txtCode.Text = "";
txtCode.Focus();
return;
}
}
}
CheckDataBase(inputstring); //检查T_PP_TJFY_WORKORDER 是否存在条码记录
foreach (var rule in _barcodeRules)
{
if (System.Text.RegularExpressions.Regex.IsMatch(inputstring, rule.REGEX))
{
strprodno = rule.MATERIAL_CODE;
strmouldcode = rule.REMARK;
strcarsetdesc_cn = rule.MATERIAL_TYPE;
}
}
//if (txtCode.Text.Length <= ll || txtCode.Text.Length >= ul)
//{
// Alert("条码错误:条码长度不符合要求(" + ll.ToString() + "-" + ul.ToString() + ")。");
//主键
strFiskey = Guid.NewGuid().ToString();
// ArragetxtCode();
// return;
//}
CreateNFPaste(inputstring); //创建NF的贴车单以及明细
//CreateNFPaste__();
SetContainerItem(nfindex, true); //变更右下角位置颜色
txtCode.Text = "";
txtCode.Focus();
return;
#endregion
}
#endregion
#region FIS区域数据全部扫描完成,请获取数据后再扫描
if (dgvNF.Rows.Count >= dgvMATChange.Rows.Count)
{
Alert("当前计划数据全部扫描完成,请下达计划后再扫描!");
ArragetxtCode();
return;
}
#endregion
#region 校验位计算
@ -1374,11 +1319,43 @@ namespace QMAPP.WinForm.Forms.TianJin
}
}
}
#region 底盘号间隔校验
//2016-10-31 闫永刚
int scanSum = dgvNF.Rows.Count;
int lastvinNumber = 0;
int vinNumber = 0;
if (scanSum > 0)
{
lastvinNumber = Convert.ToInt32(dgvMATChange.Rows[scanSum - 1].Cells["REQUESTID"].Value.ToString());
vinNumber = Convert.ToInt32(dgvMATChange.Rows[scanSum].Cells["REQUESTID"].Value.ToString());
}
if ((vinNumber - lastvinNumber) > 1)
{
var dresult = MessageBox.Show("出现顺序号间隔,是否继续发货?", "提示", MessageBoxButtons.YesNo);
if (dresult == DialogResult.No)
{
ArragetxtCode();
return;
}
}
#endregion
#region 判断当前扫描过的数据集合中是否有相同条码
//判断当前扫描过的数据集合中是否有相同条码
CheckDataBase(Code);
#endregion
#endregion
//规则
bool signal = false;
string outSourceProduct = "";
string MOULD_CODE = "";
foreach (var rule in _barcodeRules)
{
@ -1386,7 +1363,7 @@ namespace QMAPP.WinForm.Forms.TianJin
{
signal = true;
ProMaterial = rule.MATERIAL_CODE;
outSourceProduct = rule.DATA_TYPE;
MOULD_CODE = rule.REMARK;
}
}
@ -1415,56 +1392,8 @@ namespace QMAPP.WinForm.Forms.TianJin
//-------------------------End-----------
#endregion
#region 2.判断成品 下线时间校验
//if (product.STATUS != "0")
//{
// SetContainerItem(nfindex, false);
// Alert("扫描的不是合格成品,不能进行发运!");
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
//if (product.OUTFLAG != "0")
//{
// SetContainerItem(nfindex, false);
// Alert("扫描产品已出库,不能进行发运操作!");
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
//var StorageTimeLimit=0d;
//double.TryParse(QMAPP.WinForm.Common.LocalSetting.Settings["StorageTimeLimit", "24"],out StorageTimeLimit);
//if ((DateTime.Now - product.CREATEDATE).TotalHours < StorageTimeLimit)
//{
// SetContainerItem(nfindex, false);
// Alert("扫描产品下线时间不足"+StorageTimeLimit+"小时!,不能进行发运操作!");
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
//var mcresult = agent.InvokeServiceFunction<DataResult<MaterialClass>>("MaterialClassBLL_Get", new MaterialClass { MATERIAL_TYPE_CODE = product.MATERIAL_TYPE });
//var mc = mcresult.IsSuccess ? mcresult.Result : new MaterialClass { };
//if (!string.Equals(mc.MATERIAL_ATTRIBUTE, "2"))
//{
// SetContainerItem(nfindex, false);
// Alert("扫描产品不是总成件!,不能进行发运操作!");
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
//FJC.Entity.ProductIn.ProductIn inrecord = agent.InvokeServiceFunction<FJC.Entity.ProductIn.ProductIn>("ProductInBLL_GetInRecord", Code);
//if (inrecord != null)
//{
// SetContainerItem(nfindex, false);
// Alert("此产品为退返件,请更换总成标签后再发运!");
// txtCode.Text = "";
// txtCode.Focus();
// return;
//}
#endregion
#region 4.与FIS数据匹配
//4.与FIS数据匹配
//4.与FIS数据匹配 匹配到计划后 开始生成贴车单
FISDataCompare(Code, ProMaterial, MOULD_CODE);
#endregion
@ -1480,38 +1409,6 @@ namespace QMAPP.WinForm.Forms.TianJin
#endregion
#region 底盘号间隔校验
//2016-10-31 闫永刚
int scanSum = dgvNF.Rows.Count;
int lastvinNumber = 0;
int vinNumber = 0;
if (scanSum > 0)
{
lastvinNumber = Convert.ToInt32(dgvMATChange.Rows[scanSum - 1].Cells["REQUESTID"].Value.ToString());
vinNumber = Convert.ToInt32(dgvMATChange.Rows[scanSum].Cells["REQUESTID"].Value.ToString());
}
if ((vinNumber - lastvinNumber) > 1)
{
var dresult = MessageBox.Show("出现顺序号间隔,是否继续发货?", "提示", MessageBoxButtons.YesNo);
if (dresult == DialogResult.No)
{
ArragetxtCode();
return;
}
}
#endregion
#region 判断当前扫描过的数据集合中是否有相同条码
//判断当前扫描过的数据集合中是否有相同条码
if (outSourceProduct == "OP")
{
CheckDataBase(Code);
}
#endregion
#region 处理条码扫描文本框
ArragetxtCode();
#endregion
@ -1665,7 +1562,6 @@ namespace QMAPP.WinForm.Forms.TianJin
if (tblbarcode.Rows.Count > 0)
{
Alert("扫描条码重复,请重新扫描。");
}
}
@ -2156,15 +2052,8 @@ namespace QMAPP.WinForm.Forms.TianJin
}
for (int i = 0; i < tpContainer.ColumnCount; i++)
{
//tpContainer.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, tpContainer.ColumnCount > 8 ? 60 : 90));
tpContainer.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
//Label lblno = new Label();
//lblno.Text = (i + 1).ToString();
//lblno.Font = new Font("微软雅黑", 20, FontStyle.Bold);
//lblno.Dock = DockStyle.Fill;
//lblno.TextAlign = ContentAlignment.MiddleCenter;
//tpContainer.Controls.Add(lblno, i, 0);
for (int j = 0; j < tpContainer.RowCount; j++)
{
Label lblItem = new Label();
@ -2175,7 +2064,7 @@ namespace QMAPP.WinForm.Forms.TianJin
tpContainer.Controls.Add(lblItem, i, j);
}
}
//tpContainer.Height = tpContainer.RowCount * (3 + (tpContainer.ColumnCount > 8 ? 60 : 90));
for (int i = 0; i < nfindex; i++)
{
SetContainerItem(i, true);
@ -2190,13 +2079,23 @@ namespace QMAPP.WinForm.Forms.TianJin
/// <param name="result"></param>
public void SetContainerItem(int itemindex, bool result)
{
var columnindex = itemindex / (tpContainer.RowCount);
var rowindex = itemindex % (tpContainer.RowCount) ;
var label = tpContainer.GetControlFromPosition(columnindex, rowindex) as Label;
if (label != null)
if (itemindex == 1)
{
var label = tpContainer.GetControlFromPosition(0, 0) as Label;
label.BackColor = result ? Color.Lime : Color.Red;
}
else
{
itemindex = itemindex - 1;
var columnindex = itemindex / (tpContainer.RowCount);
var rowindex = itemindex % (tpContainer.RowCount);
var label = tpContainer.GetControlFromPosition(columnindex, rowindex) as Label;
if (label != null)
{
label.BackColor = result ? Color.Lime : Color.Red;
}
}
}
/// <summary>

BIN
APPQ5/QMAPP.WinForm/Forms/TianJin/TJPastCard.rpt

Binary file not shown.

5
AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs

@ -2017,6 +2017,11 @@ namespace QMAPP.ServicesAgent
/// </summary>
[Description("贴车单记录明细查询")]
TJFrmPlaceBLL_GetPasteDetails,
/// <summary>
/// 添加贴车单
/// </summary>
[Description(" 添加贴车单")]
TJFrmPlaceBLL_AddPasteCard,
#endregion

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

@ -64,7 +64,10 @@
<!--主数据库连接-->
<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=10.111.144.99;Initial Catalog=ADIENT_CD_MES9;User Id=sa;Password=Password2018;max pool size=10240;" providerName="System.Data.SqlClient"/>-->

Loading…
Cancel
Save