张松男 4 months ago
parent
commit
4da5a13be9
  1. 6
      APP/QMAPP.Web/App_Data/Menu.xml
  2. 2
      APPQ5/QMAPP.FJC.BLL/Bucket/BucketMaterialClassBLL.cs
  3. 12
      APPQ5/QMAPP.FJC.BLL/CompleteStatistics/CompleteStatisticsBLL.cs
  4. 1
      APPQ5/QMAPP.FJC.BLL/QMAPP.FJC.BLL.csproj
  5. 141
      APPQ5/QMAPP.FJC.BLL/TianJin/MonitordataBLL.cs
  6. 494
      APPQ5/QMAPP.FJC.BLL/TianJin/TJPaoMoPlanBLL.cs
  7. 524
      APPQ5/QMAPP.FJC.BLL/TianJin/TJZhuSuPlanBLL.cs
  8. 16
      APPQ5/QMAPP.FJC.DAL/Bucket/BucketMaterialClassDAL.cs
  9. 50
      APPQ5/QMAPP.FJC.DAL/CompleteStatistics/CompleteStatisticsDAL.cs
  10. 613
      APPQ5/QMAPP.FJC.DAL/CompleteStatistics/TJCompleteStatisticsDAL.cs
  11. 2
      APPQ5/QMAPP.FJC.DAL/QMAPP.FJC.DAL.csproj
  12. 201
      APPQ5/QMAPP.FJC.DAL/TianJin/MonitordataDAL.cs
  13. 74
      APPQ5/QMAPP.FJC.DAL/TianJin/TJPaoMoPlanDAL.cs
  14. 110
      APPQ5/QMAPP.FJC.DAL/TianJin/TJZhuSuPlanDAL.cs
  15. 6
      APPQ5/QMAPP.FJC.Entity/Bucket/BucketMaterialClass.cs
  16. 4
      APPQ5/QMAPP.FJC.Entity/CompleteStatistics/CompleteStatisticsEntity.cs
  17. 80
      APPQ5/QMAPP.FJC.Entity/CompleteStatistics/TJCompleteStatisticsEntity.cs
  18. 92
      APPQ5/QMAPP.FJC.Entity/CompleteStatistics/Table/T_AW_COMPLETE_TJSTATISTICS.cs
  19. 3
      APPQ5/QMAPP.FJC.Entity/QMAPP.FJC.Entity.csproj
  20. 183
      APPQ5/QMAPP.FJC.Entity/TianJin/Monitordata.cs
  21. 13
      APPQ5/QMAPP.FJC.Entity/TianJin/TJPaoMoPlan.cs
  22. 15
      APPQ5/QMAPP.FJC.Entity/TianJin/TJZhuSuPlan.cs
  23. BIN
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJPaoMoPlanImp.xlsx
  24. 43
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJPaoMoPlanImp.xml
  25. BIN
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJZhuSuPlanImp.xlsx
  26. 43
      APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJZhuSuPlanImp.xml
  27. 131
      APPQ5/QMAPP.FJC.Web/Controllers/MonitordataController.cs
  28. 4
      APPQ5/QMAPP.FJC.Web/Models/Bucket/BucketMaterialClassModel.cs
  29. 242
      APPQ5/QMAPP.FJC.Web/Models/TianJin/MonitordataModel.cs
  30. 18
      APPQ5/QMAPP.FJC.Web/Models/TianJin/TJPaoMoPlanModel.cs
  31. 19
      APPQ5/QMAPP.FJC.Web/Models/TianJin/TJZhuSuPlanModel.cs
  32. 17
      APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj
  33. BIN
      APPQ5/QMAPP.FJC.Web/Temp/04409478-d788-4852-8555-f18cbd26a4af.xlsx
  34. BIN
      APPQ5/QMAPP.FJC.Web/Temp/93f7ac3d-039c-4909-b0d0-93e8be0fb2ed.xlsx
  35. BIN
      APPQ5/QMAPP.FJC.Web/Temp/9c911783-5bb0-45b7-909f-52e9ae8dfe9f.xlsx
  36. BIN
      APPQ5/QMAPP.FJC.Web/Temp/e42910bf-4998-4621-aa8a-5fb504b03308.xlsx
  37. 4
      APPQ5/QMAPP.FJC.Web/Views/BucketMaterialClass/BucketMaterialClassEdit.aspx
  38. 4
      APPQ5/QMAPP.FJC.Web/Views/BucketMaterialClass/BucketMaterialClassList.aspx
  39. 91
      APPQ5/QMAPP.FJC.Web/Views/Monitordata/MonitordataList.aspx
  40. 170
      APPQ5/QMAPP.FJC.Web/Views/RawMaterialRecordCount/QTYCompletionRateCountView.aspx
  41. 16
      APPQ5/QMAPP.FJC.Web/Views/TJPaoMoPlan/TJPaoMoPlanEdit.aspx
  42. 16
      APPQ5/QMAPP.FJC.Web/Views/TJZhuSuPlan/TJZhuSuPlanEdit.aspx
  43. 2
      APPQ5/QMAPP.WinForm/Forms/Injection/InjectionCodePrint.cs
  44. 2
      APPQ5/QMAPP.WinForm/Forms/Injection/SewingPrint.cs
  45. 9
      APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs
  46. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  47. 7
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/App_Data/FJCServiceList.xml
  48. 20
      WebAPI/Controllers/InventoryController.cs
  49. 76
      WebAPI/Controllers/MachineClassController.cs
  50. 2
      WebAPI/Controllers/WareController.cs

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

@ -898,7 +898,11 @@
<Action ContorllerName="BucketMaterialClass" ActionName="Delete" PowerID="CD20130004">删除</Action>
</Actions>
</MenuItem>
<MenuItem MenuID="20140000" SystemID="FJC" MenuDes="注塑加工参数" Action="/Monitordata/List" Target="url" PowerID="CD20140000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="20000000" Seq="1">
<Actions>
<Action ContorllerName="Monitordata" ActionName="List" PowerID="CD20140001">查询</Action>
</Actions>
</MenuItem>
<!--<MenuItem MenuID="13150000" SystemID="MESReport" MenuDes="班次节拍统计" Action="/ProduceCycleTimeShift/Index" Target="url" PowerID="CD13101000" Visible="true" Ico="../../Content/Menu/images/ico/2.gif" SuperID="13000000" Seq="1">
<Actions>
<Action ContorllerName="ProduceCycleTimeShift" ActionName="Index" PowerID="CD13150001">查询</Action>

2
APPQ5/QMAPP.FJC.BLL/Bucket/BucketMaterialClassBLL.cs

@ -183,7 +183,7 @@ namespace QMAPP.FJC.BLL.Bucket
//基本信息
info.IsCheck = model.IsCheck;
info.MaterialCode = model.MaterialCode;
info.MaterialName = model.MaterialName;
info.RawMaterial = model.RawMaterial;
info.CREATEUSER = model.CREATEUSER;
info.CREATEDATE = model.CREATEDATE;

12
APPQ5/QMAPP.FJC.BLL/CompleteStatistics/CompleteStatisticsBLL.cs

@ -42,12 +42,11 @@ namespace QMAPP.FJC.BLL.CompleteStatistics
{
try {
//向MES T_AW_COMPLETE_STATISTICS插入需要的数据
//int count = new CompleteStatisticsDAL().GenericCompleteStatistics(starTime, endTime);
int count = new CompleteStatisticsDAL().GenericCompleteStatistics(starTime, endTime);
string isAutoExport = this.GetSysConfigValue(CompleteStatisticsConstants.COMP_AUTO_EXPORT); //完工统计标识:1 自动,0 手动。
if (isAutoExport.Equals("1")) {
//this.ExportCompleteStatistics(new CompleteStatisticsEntity { SENDTIME = starTime.ToString("yyyy/MM/dd HH:mm:ss"), EENDTIME = endTime.ToString("yyyy/MM/dd HH:mm:ss") });
this.ExportCompleteStatisticsSQL(new CompleteStatisticsEntity { SENDTIME = starTime.ToString("yyyy/MM/dd HH:mm:ss"), EENDTIME = endTime.ToString("yyyy/MM/dd HH:mm:ss") });
}
return 0;
}
@ -173,7 +172,7 @@ namespace QMAPP.FJC.BLL.CompleteStatistics
/// </summary>
/// <param name="model">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Insert(CompleteStatisticsEntity model)
public DataResult<int> Insert(TJCompleteStatisticsEntity model)
{
DataResult<int> result = new DataResult<int>
{
@ -182,7 +181,7 @@ namespace QMAPP.FJC.BLL.CompleteStatistics
};
try {
var material = new CompleteStatisticsDAL().GetMFGMaterialCode(model.MATERIALNO);
var material = new TJCompleteStatisticsDAL().GetMFGMaterialCode(model.MATERIALNO);
if (!string.IsNullOrEmpty(material))
model.MATERIALNO = material;
@ -193,8 +192,9 @@ namespace QMAPP.FJC.BLL.CompleteStatistics
model.CREATETIME = DateTime.Now;
model.UPDATEUSER = this.LoginUser.UserID;
model.DELFLAG = "0";
result.Result = new CompleteStatisticsDAL().Insert(model);
var count =new TJCompleteStatisticsDAL().Select_Get(model.ORDERNO);
if (count<=0)
result.Result = new TJCompleteStatisticsDAL().Insert(model);
}
catch (Exception ex) {
LogManager.LogHelper.Error(new LogInfo {ErrorInfo = ex, Tag = ex.StackTrace, Info = "插入统计信息异常!"});

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

@ -196,6 +196,7 @@
<Compile Include="QT\MaterialBindingBLL.cs" />
<Compile Include="SendManage\SendPlanRecordBLL.cs" />
<Compile Include="Stocktaking\StocktakingBLL.cs" />
<Compile Include="TianJin\MonitordataBLL.cs" />
<Compile Include="TianJin\StorageLogBLL.cs" />
<Compile Include="TianJin\StorageBLL.cs" />
<Compile Include="TianJin\TJDoorPlankPlanBLL.cs" />

141
APPQ5/QMAPP.FJC.BLL/TianJin/MonitordataBLL.cs

@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.DAL.ProduceManage;
using QMAPP.FJC.Entity.ProduceManage;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity;
using QMAPP.MD.Entity.TianJin;
using QMAPP.FJC.DAL.TianJin;
using System.Data;
namespace QMAPP.FJC.BLL.TianJin
{
/// <summary>
/// 模块名称:库存日志信息
/// 作 者:张松男
/// 编写日期:2022年02月17日
/// </summary>
public class MonitordataBLL : BaseBLL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public DataResult<Monitordata> Get(Monitordata model)
{
DataResult<Monitordata> result = new DataResult<Monitordata>();
try
{
result.Result = new MonitordataDAL().Get(model);
result.IsSuccess = true;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "获取异常";
}
return result;
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(Monitordata condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
DataPage dataPage = new MonitordataDAL().GetList(condition, page);
result.IsSuccess = true;
result.Result = dataPage;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取列表异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "获取列表异常!";
}
return result;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <returns>全部集合</returns>
public List<Monitordata> GetAllList()
{
try
{
//获取信息列表
return new MonitordataDAL().GetALL();
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取列表异常!"
});
throw ex;
}
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataTable GetExportData(Monitordata model)
{
try
{
return new MonitordataDAL().GetExportData(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "导出库存信息"
});
throw ex;
}
}
#endregion
}
}

494
APPQ5/QMAPP.FJC.BLL/TianJin/TJPaoMoPlanBLL.cs

@ -224,75 +224,24 @@ namespace QMAPP.FJC.BLL.TianJin
result.Msg = "该订单号已经存在!";
return result;
}
//if (model.COMPLETE_QTY > model.QTY)
//{
// result.IsSuccess = false;
// result.Msg = "修改后的计划数量不能小于已完成数量!";
// return result;
//}
if (model.PLAN_STATE == EnumGeter.PLANSTATE.COMPLATED.GetHashCode().ToString())
{
result.IsSuccess = false;
result.Msg = "订单已经完成不能进行修改!";
return result;
}
#region 如果修改后的计划数量等于完成数量,将计划状态更新为完成
//if (model.QTY.Equals(model.COMPLETE_QTY))
//{
// model.PLAN_STATE = EnumGeter.PLANSTATE.COMPLATED.GetHashCode().ToString();
//}
#endregion
#region 判断数量
TJPaoMoPlanDAL TJPaoMoPlanDAL = new TJPaoMoPlanDAL();
TJPaoMoPlan initialOrderPlan = TJPaoMoPlanDAL.Get(new TJPaoMoPlan { PID = model.PID });
string deleteWorkOrderSql = "";
List<WorkOrder> workOrderList = new List<WorkOrder>();
WorkOrderDAL workOrderDal = new WorkOrderDAL();
//将计划数量调整变小,删除为生产的派工单
if ((initialOrderPlan.QTY - model.QTY) > 0)
{
deleteWorkOrderSql = string.Format("delete from T_PP_WORKORDER where pid in (select top {0} pid from T_PP_WORKORDER where ORDERPLANID='{1}' and COMPLETE_QTY=0 )", (initialOrderPlan.QTY - model.QTY), initialOrderPlan.PID);
}
else
{
List<WorkOrder> list = workOrderDal.GetList(new WorkOrder() { ORDERPLANID = initialOrderPlan.PID });
if (list.Count > 0)
{
WorkOrder wo = list.First();
//将计划数量调整变大
for (int i = 0; i < (model.QTY - initialOrderPlan.QTY); i++)
{
WorkOrder inWO = BindHelper.CopyToModel<WorkOrder, WorkOrder>(wo, false);//CopyToModel<WorkOrder, WorkOrder>(wo);
inWO.PID = Guid.NewGuid().ToString();
inWO.COMPLETE_QTY = 0;
workOrderList.Add(inWO);
}
}
}
#endregion
using (IDataSession session = AppDataFactory.CreateMainSession())
{
session.OpenTs();
TJPaoMoPlanDAL.BaseSession = session;
workOrderDal.BaseSession = session;
Pbom pbomcode = new PbomDAL().Get(new Pbom { MATERIAL_CODE = model.MATERIAL_CODE });
if (pbomcode!=null)
{
//model.PBOM_CODE = pbomcode.PBOM_CODE;
}
if (model.QTY <= model.COMPLETE_QTY)
model.PLAN_STATE = "3";
else
model.PLAN_STATE = "0";
TJPaoMoPlanDAL.Update(model);
@ -311,20 +260,7 @@ namespace QMAPP.FJC.BLL.TianJin
int no = new TJPaoMoPlanDAL().InsertRecord(record);
#endregion
if (string.IsNullOrEmpty(deleteWorkOrderSql) == false)
{
session.ExecuteSql(deleteWorkOrderSql, new List<DataParameter>().ToArray());
}
if (workOrderList.Count > 0)
{
foreach (var wo in workOrderList)
{
workOrderDal.Insert(wo);
}
}
session.CommitTs();
}
@ -378,26 +314,9 @@ namespace QMAPP.FJC.BLL.TianJin
{
TJPaoMoPlan op = TJPaoMoPlanDAL.Get(new TJPaoMoPlan() { PID = str });
//去T_PP_WORkORDER表查询此计划下的派工单是否有不为0(初始)状态的派工信息,若有则不让删除
int Num = workOrderDal.GetAllWorkOrder(str);
//如果订单初始化或是确认生产并且生产数量为0
//if (op.PLAN_STATE == EnumGeter.PLANSTATE.INIT.GetHashCode().ToString()
// || (op.PLAN_STATE == EnumGeter.PLANSTATE.COMMIT.GetHashCode().ToString() && op.COMPLETE_QTY == 0 && Num==0))
//{
// deleteOrderList.Add(op);
//}
//else
//{
// validOrderList.Add(op);
//}
}
if (validOrderList.Count > 0)
{
result.IsSuccess = false;
result.Msg = "删除失败,只有计划状态为初始状态、执行状态并且完成数量为0的订单可以删除!";
return result;
deleteOrderList.Add(op);
}
using (IDataSession session = AppDataFactory.CreateMainSession())
{
@ -516,7 +435,7 @@ namespace QMAPP.FJC.BLL.TianJin
TJPaoMoPlanDAL.BaseSession = session;
foreach (var op in putOutPlanList)
{
TJPaoMoPlanDAL.Update(op);
// TJPaoMoPlanDAL.Update(op);
}
session.DbHelper.BulkCopyData(totalDt, "T_PP_WORKORDER", dbConn, ids);
@ -728,315 +647,94 @@ namespace QMAPP.FJC.BLL.TianJin
/// <param name="plantmodel">班次信息</param>
/// <param name="productbasicmodel">零件类别信息</param>
/// <returns>结果</returns>
//public DataResult<ImportMessage> GetImportData(List<TJPaoMoPlan> list, Material condition, MachineInfo machine, ProduceShift produceshiftmodel, WorkCell workcellmodel)
//{
// DataResult<ImportMessage> result = new DataResult<ImportMessage>();
// TJPaoMoPlanDAL cmDal = new TJPaoMoPlanDAL();
// cmDal.BaseSession = AppDataFactory.CreateMainSession();
// List<TJPaoMoPlan> List = new List<TJPaoMoPlan>();
// List<WorkOrder> workOrderList = new List<WorkOrder>();
public DataResult<ImportMessage> GetImportData(List<TJPaoMoPlan> list, Material condition, MachineInfo machine, ProduceShift produceshiftmodel, WorkCell workcellmodel)
{
DataResult<ImportMessage> result = new DataResult<ImportMessage>();
TJPaoMoPlanDAL cmDal = new TJPaoMoPlanDAL();
cmDal.BaseSession = AppDataFactory.CreateMainSession();
List<TJPaoMoPlan> List = new List<TJPaoMoPlan>();
List<WorkOrder> workOrderList = new List<WorkOrder>();
DataTable orderDt = GetOrderPlanTable();
DataTable workOrderDt = GetWorkOrderTable();
int index = 0;
int num = 0;
try
{
result.Result = new ImportMessage();
result.Result.Errors = new List<RowError>();
foreach (TJPaoMoPlan ma in list)
{
if (string.IsNullOrEmpty(ma.InfoError))
{
index++;
num++;
}
if (string.IsNullOrEmpty(ma.InfoError) == false)
{
ma.PID = null;
result.Result.failureNum += 1;
continue;
}
var model = new TJPaoMoPlan();
//基本信息
model.PID = Guid.NewGuid().ToString();
model.PLAN_STATE = "0";
var materialinfo = new QMAPP.MD.BLL.MaterialBLL().GetMaterialForOrder("DOORPLANK");
Material areaMes = materialinfo.Find(a => a.MATERIAL_CODE == ma.MATERIAL_CODE.Trim());
if (areaMes != null)
{
model.MATERIAL_CODE = areaMes.MATERIAL_CODE;
}
else
{
ma.MATERIAL_CODE = null;
result.Result.Errors.Add(new RowError(index, "物料信息不存在"));
result.Result.failureNum += 1;
continue;
}
// DataTable orderDt = GetOrderPlanTable();
// DataTable workOrderDt = GetWorkOrderTable();
// int index = 0;
// int num = 0;
// try
// {
// result.Result = new ImportMessage();
// result.Result.Errors = new List<RowError>();
// List<Material> materialinfo = null;
// List<ProduceShift> produceshiftinfo = null;
// List<MachineInfo> machineList = null;
// ///获取物料信息(PBOM表)
// materialinfo = new QMAPP.MD.BLL.MaterialBLL().GetMaterialForOrder(workcellmodel.WORKCELL_CODE);
// //获取班次信息
// produceshiftinfo = new QMAPP.FJC.BLL.Basic.ProduceShiftBLL().GetWorkcenterShifts(workcellmodel.WORKCENTER_CODE);
// //获取设备信息
// machineList = new QMAPP.FJC.BLL.Basic.MachineInfoBLL().GetMachineForOrderList(machine, workcellmodel);
// foreach (TJPaoMoPlan ma in list)
// {
// if (string.IsNullOrEmpty(ma.InfoError))
// {
// #region 状态判断
// index++;
// num++;
// //物料
// Material areaMes = materialinfo.Find(a => a.MATERIAL_CODE == ma.MATERIAL_CODE.Trim());
// 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;
// }
// //班次
// //Shift plantMes = produceshiftinfo.Find(p => p.SHIFT_CODE == ma.SHIFT_CODE.Trim());
// //if (plantMes != null)
// //{
// // ma.SHIFT_CODE = plantMes.SHIFT_CODE;
// //}
// //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.Trim().Equals("以数量为准"))
// {
// ma.PRODUCEREQUIRE = "0";
// }
// else if (ma.PRODUCEREQUIRE.Trim().Equals("以时间为准"))
// {
// ma.PRODUCEREQUIRE = "1";
// }
// else
// {
// ma.PRODUCEREQUIRE = null;
// result.Result.Errors.Add(new RowError(index, "生产要求信息错误"));
// result.Result.failureNum += 1;
// continue;
// }
// }
// //设备
// MachineInfo machineMes = machineList.Find(c => c.MACHINECODDE == ma.MACHINECODDE.Trim());
// if (machineMes != null)
// {
// ma.MACHINECODDE = ma.MACHINECODDE;
// }
// else
// {
// ma.MACHINECODDE = null;
// result.Result.Errors.Add(new RowError(index, "设备信息不存在"));
// result.Result.failureNum += 1;
// continue;
// }
// //if (machineList.Count(o => o.MACHINECODDE.Trim() == ma.MACHINECODDE.ToUpper()) > 0)
// //{
// // ma.MACHINECODDE = ma.MACHINECODDE;
// //}
// //else
// //{
// // ma.MACHINECODDE = null;
// // result.Result.Errors.Add(new RowError(index, "设备不符"));
// // result.Result.failureNum += 1;
// // continue;
// //}
// #region 时间
// //计划日期
// DateTime dateTime = new DateTime();
// bool convertResult = DateTime.TryParse(ma.PLAN_DATEIN, out dateTime);
// if (!convertResult)
// {
// result.Result.Errors.Add(new RowError(index, "计划日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat1 = new DateTimeFormatInfo();
// dtFormat1.ShortDatePattern = "yyyy/MM/dd";
// ma.PLAN_DATE = Convert.ToDateTime(ma.PLAN_DATEIN, dtFormat1);
// }
// //开始日期
// bool convertResultstart = DateTime.TryParse(ma.STARTTIMEIN, out dateTime);
// if (!convertResultstart)
// {
// result.Result.Errors.Add(new RowError(index, "开始日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat2 = new DateTimeFormatInfo();
// dtFormat2.ShortDatePattern = "yyyy/MM/dd hh:mm:ss";
// ma.STARTTIME = Convert.ToDateTime(ma.STARTTIMEIN, dtFormat2);
// }
// //截止日期
// bool convertResultend = DateTime.TryParse(ma.ENDTIMEIN, out dateTime);
// if (!convertResultend)
// {
// result.Result.Errors.Add(new RowError(index, "截止日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat3 = new DateTimeFormatInfo();
// dtFormat3.ShortDatePattern = "yyyy/MM/dd hh:mm:ss";
// ma.ENDTIME = Convert.ToDateTime(ma.ENDTIMEIN, dtFormat3);
// }
// #endregion
// #endregion
// }
// if (string.IsNullOrEmpty(ma.InfoError) == false)
// {
// ma.PID = null;
// result.Result.failureNum += 1;
// continue;
// }
// //修改改时根据主键等信息获取详细内容信息
// //TJPaoMoPlan oldInfo = cmDal.GetInfo(ma);
// #region 注释掉另一种导入增加和更新
// //增加
// //DataRow odr = orderDt.NewRow();
// //odr["PID"] = Guid.NewGuid().ToString();
// //odr["FACTORY_CODE"] = "";
// //odr["PLAN_NO"] = "";
// //odr["PLAN_SEQ"] = "";
// //odr["PLAN_STATE"] = EnumGeter.PLANSTATE.INIT.GetHashCode().ToString();
// //odr["MATERIAL_CODE"] = ma.MATERIAL_CODE;
// //odr["PBOM_CODE"] = "";
// //odr["QTY"] = ma.QTY;
// //odr["COMPLETE_QTY"] = ma.QTY;
// //odr["PLAN_DATE"] = ma.PLAN_DATE;
// //odr["SHIFT_CODE"] = "";
// //odr["PLANSOURCE"] = DBNull.Value;
// //odr["PRODUCEREQUIRE"] = ma.PRODUCEREQUIRE;
// //odr["CREATEDATE"] = System.DateTime.Now;
// //odr["CREATEUSER"] = this.LoginUser.UserID;
// //odr["UPDATEDATE"] = System.DateTime.Now;
// //odr["UPDATEUSER"] = this.LoginUser.UserID;
// //odr["WORKCENTER_CODE"] = "ZS";
// //orderDt.Rows.Add(odr);
// //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
// //{
// #endregion
// //新增
// //oldInfo = new TJPaoMoPlan();
// ma.PID = Guid.NewGuid().ToString();
// //ma.PLAN_NO = ma.PLAN_NO;
// //FISPlan planinfo = new FISPlan();
// //planinfo.PREFIX = "IN";
// ////planinfo.DATASTR = ma.PLAN_DATE.ToString("yyyyMMdd");
// //////获取流水号
// //planinfo = this.GetOrderPlanSeq(planinfo);
// //planinfo.DATASTR = ma.PLAN_DATE.ToString("yyyyMMdd");
// //ma.PLAN_NO = planinfo.PREFIX + planinfo.DATASTR + planinfo.SEQSTR;
// //ma.PLAN_NO = planinfo.PREFIX+ma.PLAN_NO;
// //int no = new DoorPlankPlanDAL().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 });
// if (pbomcode != null)
// {
// ma.PBOM_CODE = pbomcode.PBOM_CODE;
// }
// //工艺路线
// QMAPP.MD.Entity.ProcessRoute routecode = new QMAPP.MD.DAL.ProcessRouteDAL().RouteWithMaterial(ma.MATERIAL_CODE);
// if (routecode != null)
// {
// 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);
// #region 注入派工单信息(已注释)
// ////注入派工单信息
// //for (int i = 0; i < ma.QTY; i++)
// //{
// // DataRow workOrder = workOrderDt.NewRow();
// // workOrder["PID"] = Guid.NewGuid().ToString();
// // workOrder["ORDERPLANID"] = odr["PID"];
// // workOrder["ORDERPLAN_NO"] = (odr["PLAN_NO"].ToString() + (i + 1).ToString().PadLeft(4, '0'));
// // workOrder["ORDER_TYPE"] = EnumGeter.WORKORDERTYPE.PROCEDURE.GetHashCode().ToString();
// // workOrder["SEQ"] = (i + 1).ToString();
// // workOrder["MATERIAL_CODE"] = ma.MATERIAL_CODE;
// // workOrder["PBOM_CODE"] = "";
// // workOrder["QTY"] = 1;
// // workOrder["COMPLETE_QTY"] = 0;
// // workOrder["PLAN_DATE"] = ma.PLAN_DATE;
// // workOrder["SHIFT_CODE"] = "";
// // workOrder["WORKCENTER_CODE"] = "";
// // workOrder["WORKCELL_CODE"] = "";
// // workOrder["WORKLOC_CODE"] = "";
// // workOrder["REMARK"] = "";
// // workOrder["EQPT_NAME"] = "";
// // workOrder["EQPT_CODE"] = "";
// // workOrder["STATE"] = EnumGeter.WORKPLANSTATE.INIT.GetHashCode().ToString();
// // workOrderDt.Rows.Add(workOrder);
// //}
// #endregion
// }
model.CREATEUSER = this.LoginUser.UserID;
model.CREATEDATE = DateTime.Now;
model.UPDATEUSER = model.CREATEUSER;
model.UPDATEDATE = DateTime.Now;
model.QTY = ma.QTY;
if (model.QTY <= model.COMPLETE_QTY)
model.PLAN_STATE = "3";
TJPaoMoPlanDAL cmdDAL = new TJPaoMoPlanDAL();
if (ExistsOrderPlan(model) > 0)
{
result.IsSuccess = false;
result.Msg = "该订单号已经存在!";
return result;
}
model.PLAN_DATE = ma.PLAN_DATE;
model.PLAN_NO = ma.PLAN_NO;
model.PLAN_SEQ = ma.PLAN_NO.Substring(10,4);
List.Add(model);
result.Result.insertNum += 1;
}
cmDal.GetImportData(List);
result.Msg = "导入成功";
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Ex = ex;
return result;
}
}
// cmDal.GetImportData(List);
// result.Msg = "导入成功";
// result.IsSuccess = true;
// return result;
// }
// catch (Exception ex)
// {
// result.IsSuccess = false;
// result.Ex = ex;
// return result;
// }
//}
#endregion
#region 获取产品表

524
APPQ5/QMAPP.FJC.BLL/TianJin/TJZhuSuPlanBLL.cs

@ -225,74 +225,23 @@ namespace QMAPP.FJC.BLL.TianJin
return result;
}
//if (model.COMPLETE_QTY > model.QTY)
//{
// result.IsSuccess = false;
// result.Msg = "修改后的计划数量不能小于已完成数量!";
// return result;
//}
if (model.PLAN_STATE == EnumGeter.PLANSTATE.COMPLATED.GetHashCode().ToString())
{
result.IsSuccess = false;
result.Msg = "订单已经完成不能进行修改!";
return result;
}
#region 如果修改后的计划数量等于完成数量,将计划状态更新为完成
//if (model.QTY.Equals(model.COMPLETE_QTY))
//{
// model.PLAN_STATE = EnumGeter.PLANSTATE.COMPLATED.GetHashCode().ToString();
//}
#endregion
#region 判断数量
TJZhuSuPlanDAL TJZhuSuPlanDAL = new TJZhuSuPlanDAL();
TJZhuSuPlan initialOrderPlan = TJZhuSuPlanDAL.Get(new TJZhuSuPlan { PID = model.PID });
string deleteWorkOrderSql = "";
List<WorkOrder> workOrderList = new List<WorkOrder>();
WorkOrderDAL workOrderDal = new WorkOrderDAL();
//将计划数量调整变小,删除为生产的派工单
if ((initialOrderPlan.QTY - model.QTY) > 0)
{
deleteWorkOrderSql = string.Format("delete from T_PP_WORKORDER where pid in (select top {0} pid from T_PP_WORKORDER where ORDERPLANID='{1}' and COMPLETE_QTY=0 )", (initialOrderPlan.QTY - model.QTY), initialOrderPlan.PID);
}
else
{
List<WorkOrder> list = workOrderDal.GetList(new WorkOrder() { ORDERPLANID = initialOrderPlan.PID });
if (list.Count > 0)
{
WorkOrder wo = list.First();
//将计划数量调整变大
for (int i = 0; i < (model.QTY - initialOrderPlan.QTY); i++)
{
WorkOrder inWO = BindHelper.CopyToModel<WorkOrder, WorkOrder>(wo, false);//CopyToModel<WorkOrder, WorkOrder>(wo);
inWO.PID = Guid.NewGuid().ToString();
inWO.COMPLETE_QTY = 0;
workOrderList.Add(inWO);
}
}
}
#endregion
using (IDataSession session = AppDataFactory.CreateMainSession())
{
session.OpenTs();
TJZhuSuPlanDAL.BaseSession = session;
workOrderDal.BaseSession = session;
Pbom pbomcode = new PbomDAL().Get(new Pbom { MATERIAL_CODE = model.MATERIAL_CODE });
if (pbomcode!=null)
if (pbomcode != null)
{
//model.PBOM_CODE = pbomcode.PBOM_CODE;
//model.PBOM_CODE = pbomcode.PBOM_CODE;
}
if (model.QTY <= model.COMPLETE_QTY)
model.PLAN_STATE = "3";
else
model.PLAN_STATE = "0";
TJZhuSuPlanDAL.Update(model);
@ -312,19 +261,6 @@ namespace QMAPP.FJC.BLL.TianJin
int no = new TJZhuSuPlanDAL().InsertRecord(record);
#endregion
if (string.IsNullOrEmpty(deleteWorkOrderSql) == false)
{
session.ExecuteSql(deleteWorkOrderSql, new List<DataParameter>().ToArray());
}
if (workOrderList.Count > 0)
{
foreach (var wo in workOrderList)
{
workOrderDal.Insert(wo);
}
}
session.CommitTs();
}
@ -373,32 +309,15 @@ namespace QMAPP.FJC.BLL.TianJin
//校验未通过的订单
List<TJZhuSuPlan> validOrderList = new List<TJZhuSuPlan>();
//可以删除的订单
List<TJZhuSuPlan> deleteOrderList = new List<TJZhuSuPlan>();
List<TJZhuSuPlan> deleteOrderList = new List<TJZhuSuPlan>();
foreach (string str in list)
{
TJZhuSuPlan op = TJZhuSuPlanDAL.Get(new TJZhuSuPlan() { PID = str });
//去T_PP_WORkORDER表查询此计划下的派工单是否有不为0(初始)状态的派工信息,若有则不让删除
int Num = workOrderDal.GetAllWorkOrder(str);
//如果订单初始化或是确认生产并且生产数量为0
//if (op.PLAN_STATE == EnumGeter.PLANSTATE.INIT.GetHashCode().ToString()
// || (op.PLAN_STATE == EnumGeter.PLANSTATE.COMMIT.GetHashCode().ToString() && op.COMPLETE_QTY == 0 && Num==0))
//{
// deleteOrderList.Add(op);
//}
//else
//{
// validOrderList.Add(op);
//}
}
if (validOrderList.Count > 0)
{
result.IsSuccess = false;
result.Msg = "删除失败,只有计划状态为初始状态、执行状态并且完成数量为0的订单可以删除!";
return result;
deleteOrderList.Add(op);
}
using (IDataSession session = AppDataFactory.CreateMainSession())
{
session.OpenTs();
@ -516,7 +435,7 @@ namespace QMAPP.FJC.BLL.TianJin
TJZhuSuPlanDAL.BaseSession = session;
foreach (var op in putOutPlanList)
{
TJZhuSuPlanDAL.Update(op);
// TJZhuSuPlanDAL.Update(op);
}
session.DbHelper.BulkCopyData(totalDt, "T_PP_WORKORDER", dbConn, ids);
@ -708,7 +627,7 @@ namespace QMAPP.FJC.BLL.TianJin
dr["PLAN_STATE"] = dictPLANSTATE.GetDictValue(dr["PLAN_STATE"].ToString());
dr["PLANSOURCE"] = dictPLANSOURCE.GetDictValue(dr["PLANSOURCE"].ToString());
}
return dt;
}
catch (Exception ex)
@ -728,315 +647,94 @@ namespace QMAPP.FJC.BLL.TianJin
/// <param name="plantmodel">班次信息</param>
/// <param name="productbasicmodel">零件类别信息</param>
/// <returns>结果</returns>
//public DataResult<ImportMessage> GetImportData(List<TJZhuSuPlan> list, Material condition, MachineInfo machine, ProduceShift produceshiftmodel, WorkCell workcellmodel)
//{
// DataResult<ImportMessage> result = new DataResult<ImportMessage>();
// TJZhuSuPlanDAL cmDal = new TJZhuSuPlanDAL();
// cmDal.BaseSession = AppDataFactory.CreateMainSession();
// List<TJZhuSuPlan> List = new List<TJZhuSuPlan>();
// List<WorkOrder> workOrderList = new List<WorkOrder>();
public DataResult<ImportMessage> GetImportData(List<TJZhuSuPlan> list, Material condition, MachineInfo machine, ProduceShift produceshiftmodel, WorkCell workcellmodel)
{
DataResult<ImportMessage> result = new DataResult<ImportMessage>();
TJZhuSuPlanDAL cmDal = new TJZhuSuPlanDAL();
cmDal.BaseSession = AppDataFactory.CreateMainSession();
List<TJZhuSuPlan> List = new List<TJZhuSuPlan>();
List<WorkOrder> workOrderList = new List<WorkOrder>();
DataTable orderDt = GetOrderPlanTable();
DataTable workOrderDt = GetWorkOrderTable();
int index = 0;
int num = 0;
try
{
result.Result = new ImportMessage();
result.Result.Errors = new List<RowError>();
// DataTable orderDt = GetOrderPlanTable();
// DataTable workOrderDt = GetWorkOrderTable();
// int index = 0;
// int num = 0;
// try
// {
// result.Result = new ImportMessage();
// result.Result.Errors = new List<RowError>();
// List<Material> materialinfo = null;
// List<ProduceShift> produceshiftinfo = null;
// List<MachineInfo> machineList = null;
// ///获取物料信息(PBOM表)
// materialinfo = new QMAPP.MD.BLL.MaterialBLL().GetMaterialForOrder(workcellmodel.WORKCELL_CODE);
// //获取班次信息
// produceshiftinfo = new QMAPP.FJC.BLL.Basic.ProduceShiftBLL().GetWorkcenterShifts(workcellmodel.WORKCENTER_CODE);
// //获取设备信息
// machineList = new QMAPP.FJC.BLL.Basic.MachineInfoBLL().GetMachineForOrderList(machine, workcellmodel);
// foreach (TJZhuSuPlan ma in list)
// {
// if (string.IsNullOrEmpty(ma.InfoError))
// {
// #region 状态判断
// index++;
// num++;
// //物料
// Material areaMes = materialinfo.Find(a => a.MATERIAL_CODE == ma.MATERIAL_CODE.Trim());
// 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;
// }
// //班次
// //Shift plantMes = produceshiftinfo.Find(p => p.SHIFT_CODE == ma.SHIFT_CODE.Trim());
// //if (plantMes != null)
// //{
// // ma.SHIFT_CODE = plantMes.SHIFT_CODE;
// //}
// //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.Trim().Equals("以数量为准"))
// {
// ma.PRODUCEREQUIRE = "0";
// }
// else if (ma.PRODUCEREQUIRE.Trim().Equals("以时间为准"))
// {
// ma.PRODUCEREQUIRE = "1";
// }
// else
// {
// ma.PRODUCEREQUIRE = null;
// result.Result.Errors.Add(new RowError(index, "生产要求信息错误"));
// result.Result.failureNum += 1;
// continue;
// }
// }
// //设备
// MachineInfo machineMes = machineList.Find(c => c.MACHINECODDE == ma.MACHINECODDE.Trim());
// if (machineMes != null)
// {
// ma.MACHINECODDE = ma.MACHINECODDE;
// }
// else
// {
// ma.MACHINECODDE = null;
// result.Result.Errors.Add(new RowError(index, "设备信息不存在"));
// result.Result.failureNum += 1;
// continue;
// }
// //if (machineList.Count(o => o.MACHINECODDE.Trim() == ma.MACHINECODDE.ToUpper()) > 0)
// //{
// // ma.MACHINECODDE = ma.MACHINECODDE;
// //}
// //else
// //{
// // ma.MACHINECODDE = null;
// // result.Result.Errors.Add(new RowError(index, "设备不符"));
// // result.Result.failureNum += 1;
// // continue;
// //}
// #region 时间
// //计划日期
// DateTime dateTime = new DateTime();
// bool convertResult = DateTime.TryParse(ma.PLAN_DATEIN, out dateTime);
// if (!convertResult)
// {
// result.Result.Errors.Add(new RowError(index, "计划日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat1 = new DateTimeFormatInfo();
// dtFormat1.ShortDatePattern = "yyyy/MM/dd";
// ma.PLAN_DATE = Convert.ToDateTime(ma.PLAN_DATEIN, dtFormat1);
// }
// //开始日期
// bool convertResultstart = DateTime.TryParse(ma.STARTTIMEIN, out dateTime);
// if (!convertResultstart)
// {
// result.Result.Errors.Add(new RowError(index, "开始日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat2 = new DateTimeFormatInfo();
// dtFormat2.ShortDatePattern = "yyyy/MM/dd hh:mm:ss";
// ma.STARTTIME = Convert.ToDateTime(ma.STARTTIMEIN, dtFormat2);
// }
// //截止日期
// bool convertResultend = DateTime.TryParse(ma.ENDTIMEIN, out dateTime);
// if (!convertResultend)
// {
// result.Result.Errors.Add(new RowError(index, "截止日期格式错误!"));
// result.Result.failureNum += 1;
// continue;
// }
// else
// {
// DateTimeFormatInfo dtFormat3 = new DateTimeFormatInfo();
// dtFormat3.ShortDatePattern = "yyyy/MM/dd hh:mm:ss";
// ma.ENDTIME = Convert.ToDateTime(ma.ENDTIMEIN, dtFormat3);
// }
// #endregion
// #endregion
// }
// if (string.IsNullOrEmpty(ma.InfoError) == false)
// {
// ma.PID = null;
// result.Result.failureNum += 1;
// continue;
// }
// //修改改时根据主键等信息获取详细内容信息
// //TJZhuSuPlan oldInfo = cmDal.GetInfo(ma);
// #region 注释掉另一种导入增加和更新
// //增加
// //DataRow odr = orderDt.NewRow();
// //odr["PID"] = Guid.NewGuid().ToString();
// //odr["FACTORY_CODE"] = "";
// //odr["PLAN_NO"] = "";
// //odr["PLAN_SEQ"] = "";
// //odr["PLAN_STATE"] = EnumGeter.PLANSTATE.INIT.GetHashCode().ToString();
// //odr["MATERIAL_CODE"] = ma.MATERIAL_CODE;
// //odr["PBOM_CODE"] = "";
// //odr["QTY"] = ma.QTY;
// //odr["COMPLETE_QTY"] = ma.QTY;
// //odr["PLAN_DATE"] = ma.PLAN_DATE;
// //odr["SHIFT_CODE"] = "";
// //odr["PLANSOURCE"] = DBNull.Value;
// //odr["PRODUCEREQUIRE"] = ma.PRODUCEREQUIRE;
// //odr["CREATEDATE"] = System.DateTime.Now;
// //odr["CREATEUSER"] = this.LoginUser.UserID;
// //odr["UPDATEDATE"] = System.DateTime.Now;
// //odr["UPDATEUSER"] = this.LoginUser.UserID;
// //odr["WORKCENTER_CODE"] = "ZS";
// //orderDt.Rows.Add(odr);
// //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
// //{
// #endregion
// //新增
// //oldInfo = new TJZhuSuPlan();
// ma.PID = Guid.NewGuid().ToString();
// //ma.PLAN_NO = ma.PLAN_NO;
// //FISPlan planinfo = new FISPlan();
// //planinfo.PREFIX = "IN";
// ////planinfo.DATASTR = ma.PLAN_DATE.ToString("yyyyMMdd");
// //////获取流水号
// //planinfo = this.GetOrderPlanSeq(planinfo);
// //planinfo.DATASTR = ma.PLAN_DATE.ToString("yyyyMMdd");
// //ma.PLAN_NO = planinfo.PREFIX + planinfo.DATASTR + planinfo.SEQSTR;
// //ma.PLAN_NO = planinfo.PREFIX+ma.PLAN_NO;
// //int no = new DoorPlankPlanDAL().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 });
// if (pbomcode != null)
// {
// ma.PBOM_CODE = pbomcode.PBOM_CODE;
// }
// //工艺路线
// QMAPP.MD.Entity.ProcessRoute routecode = new QMAPP.MD.DAL.ProcessRouteDAL().RouteWithMaterial(ma.MATERIAL_CODE);
// if (routecode != null)
// {
// 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);
// #region 注入派工单信息(已注释)
// ////注入派工单信息
// //for (int i = 0; i < ma.QTY; i++)
// //{
// // DataRow workOrder = workOrderDt.NewRow();
// // workOrder["PID"] = Guid.NewGuid().ToString();
// // workOrder["ORDERPLANID"] = odr["PID"];
// // workOrder["ORDERPLAN_NO"] = (odr["PLAN_NO"].ToString() + (i + 1).ToString().PadLeft(4, '0'));
// // workOrder["ORDER_TYPE"] = EnumGeter.WORKORDERTYPE.PROCEDURE.GetHashCode().ToString();
// // workOrder["SEQ"] = (i + 1).ToString();
// // workOrder["MATERIAL_CODE"] = ma.MATERIAL_CODE;
// // workOrder["PBOM_CODE"] = "";
// // workOrder["QTY"] = 1;
// // workOrder["COMPLETE_QTY"] = 0;
// // workOrder["PLAN_DATE"] = ma.PLAN_DATE;
// // workOrder["SHIFT_CODE"] = "";
// // workOrder["WORKCENTER_CODE"] = "";
// // workOrder["WORKCELL_CODE"] = "";
// // workOrder["WORKLOC_CODE"] = "";
// // workOrder["REMARK"] = "";
// // workOrder["EQPT_NAME"] = "";
// // workOrder["EQPT_CODE"] = "";
// // workOrder["STATE"] = EnumGeter.WORKPLANSTATE.INIT.GetHashCode().ToString();
// // workOrderDt.Rows.Add(workOrder);
// //}
// #endregion
// }
foreach (TJZhuSuPlan ma in list)
{
if (string.IsNullOrEmpty(ma.InfoError))
{
index++;
num++;
}
if (string.IsNullOrEmpty(ma.InfoError) == false)
{
ma.PID = null;
result.Result.failureNum += 1;
continue;
}
var model = new TJZhuSuPlan();
//基本信息
model.PID = Guid.NewGuid().ToString();
model.PLAN_STATE = "0";
var materialinfo = new QMAPP.MD.BLL.MaterialBLL().GetMaterialForOrder("DOORPLANK");
Material areaMes = materialinfo.Find(a => a.MATERIAL_CODE == ma.MATERIAL_CODE.Trim());
if (areaMes != null)
{
model.MATERIAL_CODE = areaMes.MATERIAL_CODE;
}
else
{
ma.MATERIAL_CODE = null;
result.Result.Errors.Add(new RowError(index, "物料信息不存在"));
result.Result.failureNum += 1;
continue;
}
model.CREATEUSER = this.LoginUser.UserID;
model.CREATEDATE = DateTime.Now;
model.UPDATEUSER = model.CREATEUSER;
model.UPDATEDATE = DateTime.Now;
model.QTY = ma.QTY;
if (model.QTY <= model.COMPLETE_QTY)
model.PLAN_STATE = "3";
TJZhuSuPlanDAL cmdDAL = new TJZhuSuPlanDAL();
if (ExistsOrderPlan(model) > 0)
{
result.IsSuccess = false;
result.Msg = "该订单号已经存在!";
return result;
}
model.PLAN_DATE = ma.PLAN_DATE;
model.PLAN_NO = ma.PLAN_NO;
model.PLAN_SEQ = ma.PLAN_NO.Substring(10, 4);
List.Add(model);
result.Result.insertNum += 1;
}
cmDal.GetImportData(List);
result.Msg = "导入成功";
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Ex = ex;
return result;
}
}
// cmDal.GetImportData(List);
// result.Msg = "导入成功";
// result.IsSuccess = true;
// return result;
// }
// catch (Exception ex)
// {
// result.IsSuccess = false;
// result.Ex = ex;
// return result;
// }
//}
#endregion
#region 获取产品表
@ -1124,7 +822,7 @@ namespace QMAPP.FJC.BLL.TianJin
}
//如果订单初始化或是确认生产
if (op.PLAN_STATE == EnumGeter.PLANSTATE.COMMIT.GetHashCode().ToString()
|| op.PLAN_STATE == EnumGeter.PLANSTATE.CREATING.GetHashCode().ToString() )
|| op.PLAN_STATE == EnumGeter.PLANSTATE.CREATING.GetHashCode().ToString())
{
ChangePlanList.Add(op);
}
@ -1158,24 +856,24 @@ namespace QMAPP.FJC.BLL.TianJin
//更新workorder相应字段
WorkOrderDAL workOrderDal = new WorkOrderDAL();
WorkOrder wo = workOrderDal.GetworkOrderInfo(new WorkOrder() { ORDERPLANID = op.PID });
if(wo.PID!=null)
if (wo.PID != null)
{
wo.COMPLETE_QTY = 1;
wo.STATE = 3;
wo.COMPLETE_QTY = 1;
wo.STATE = 3;
}
using (IDataSession session = AppDataFactory.CreateMainSession())
using (IDataSession session = AppDataFactory.CreateMainSession())
{
session.OpenTs();
TJZhuSuPlanDAL.BaseSession = session;
workOrderDal.BaseSession = session;
//更新订单
TJZhuSuPlanDAL.ChangeOrderPlan(op);
//更新订单
TJZhuSuPlanDAL.ChangeOrderPlan(op);
//更新订单下的派工单
workOrderDal.ChangeByOrderPlan(wo);
session.CommitTs();
//更新订单下的派工单
workOrderDal.ChangeByOrderPlan(wo);
session.CommitTs();
}
result.IsSuccess = true;
return result;
@ -1234,13 +932,13 @@ namespace QMAPP.FJC.BLL.TianJin
{
if (currentseq - lastseq > 1)
{
}
}
}
else
{
if (currentseq != minseq)
{
}
}
}
}
}
@ -1269,7 +967,7 @@ namespace QMAPP.FJC.BLL.TianJin
string seqstr = (Convert.ToInt32(fisplan.SEQSTR) + 1).ToString().PadLeft(4, '0');
fisplan.SEQSTR = seqstr;
//更新表T_AW_FISPLAN数据
}
//不存在则插入此日期信息
else
@ -1463,7 +1161,7 @@ namespace QMAPP.FJC.BLL.TianJin
if (string.IsNullOrWhiteSpace(materialcode))
{
return new DataResult<TJZhuSuPlan> { IsSuccess = false, Ex = new Exception("FIS码未能识别,FIS短语字典配置不准确或未更新!") };
//throw new ;
}

16
APPQ5/QMAPP.FJC.DAL/Bucket/BucketMaterialClassDAL.cs

@ -90,7 +90,7 @@ namespace QMAPP.FJC.DAL.Bucket
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = $"select * from T_MD_BucketMaterialClass where MaterialCode = '{info.MaterialCode}' and IsCheck <> '1'";
sql = $"select * from T_MD_BucketMaterialClassPaomo where RawMaterial = '{info.RawMaterial}' and IsCheck <> '1'";
//分页关键字段及排序
using (IDataSession session = AppDataFactory.CreateMainSession())
@ -123,13 +123,13 @@ namespace QMAPP.FJC.DAL.Bucket
try
{
//构成查询语句
sqlBuilder.Append("SELECT PID,MaterialCode,RawMaterial,IsCheck,CREATEUSER,CREATEDATE,UPDATEUSER,UPDATEDATE ");
sqlBuilder.Append("FROM T_MD_BucketMaterialClass ");
sqlBuilder.Append("SELECT PID,MaterialName ,RawMaterial,IsCheck,CREATEUSER,CREATEDATE,UPDATEUSER,UPDATEDATE ");
sqlBuilder.Append("FROM T_MD_BucketMaterialClassPaomo ");
whereBuilder.Append(" AND IsCheck<> '1' ");
if (string.IsNullOrEmpty(condition.MaterialCode) == false)
if (string.IsNullOrEmpty(condition.RawMaterial) == false)
{
whereBuilder.Append(" AND MaterialCode = @MaterialCode");
parameters.Add(new DataParameter { ParameterName = "MaterialCode", DataType = DbType.String, Value = condition.MaterialCode });
whereBuilder.Append(" AND RawMaterial = @RawMaterial");
parameters.Add(new DataParameter { ParameterName = "RawMaterial", DataType = DbType.String, Value = condition.RawMaterial });
}
//查询条件
if (whereBuilder.Length > 0)
@ -159,7 +159,7 @@ namespace QMAPP.FJC.DAL.Bucket
int count = 0;
try
{
sqlBuilder.Append("SELECT COUNT(0) FROM T_MD_BucketMaterialClass");
sqlBuilder.Append("SELECT COUNT(0) FROM T_MD_BucketMaterialClassPaomo");
if (info.PID == null)
{
info.PID = "";
@ -252,7 +252,7 @@ namespace QMAPP.FJC.DAL.Bucket
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//删除基本信息
sqlBuilder.Append("UPDATE T_MD_BucketMaterialClass ");
sqlBuilder.Append("UPDATE T_MD_BucketMaterialClassPaomo ");
sqlBuilder.Append("SET IsCheck = '1' ");
sqlBuilder.Append("WHERE PID = @PID ");
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info });

50
APPQ5/QMAPP.FJC.DAL/CompleteStatistics/CompleteStatisticsDAL.cs

@ -50,6 +50,15 @@ namespace QMAPP.FJC.DAL.CompleteStatistics
}
}
public int Select_Get(string ProductCode)
{
var sql = $"select * from T_AW_COMPLETE_STATISTICS where ORDERNO = '{ProductCode}' and DELFLAG = '0'";
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.GetList<CompleteStatisticsEntity>(sql, new DataParameter[] { }).ToList().Count;
}
}
public bool ExistCompleteStatistics(CompleteStatisticsEntity model)
{
throw new NotImplementedException();
@ -75,24 +84,24 @@ namespace QMAPP.FJC.DAL.CompleteStatistics
public int GenericCompleteStatistics(DateTime starTime, DateTime endTime)
{
int count;
int count = 0;
using (IDataSession session = AppDataFactory.CreateMainSession())
{
DataParameter[] parameters = {
new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
};
//DataParameter[] parameters = {
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
//};
try {
session.OpenTs();
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
//成品
string sql = GetGenericStatisticsSqlForBORA();
count = session.ExecuteSql(sql, parameters);
//注塑件
sql = GetGenericStatisticsSqlForINJECT();
count += session.ExecuteSql(sql, parameters);
//string sql = GetGenericStatisticsSqlForBORA();
//count = session.ExecuteSql(sql, parameters);
////注塑件
//sql = GetGenericStatisticsSqlForINJECT();
//count += session.ExecuteSql(sql, parameters);
this.UpdateLastGenericTime(endTime, session);
@ -108,25 +117,25 @@ namespace QMAPP.FJC.DAL.CompleteStatistics
public int FrmPlaceCompleteStatistics(DateTime starTime, DateTime endTime)
{
int count;
int count = 0;
using (IDataSession session = AppDataFactory.CreateMainSession())
{
DataParameter[] parameters = {
new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
};
//DataParameter[] parameters = {
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
//};
try
{
session.OpenTs();
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
//成品
string sql = GetGenericStatisticsSqlForBORA();
count = session.ExecuteSql(sql, parameters);
//注塑件
sql = GetGenericStatisticsSqlForINJECT();
count += session.ExecuteSql(sql, parameters);
//string sql = GetGenericStatisticsSqlForBORA();
//count = session.ExecuteSql(sql, parameters);
////注塑件
//sql = GetGenericStatisticsSqlForINJECT();
//count += session.ExecuteSql(sql, parameters);
this.UpdateLastGenericTime(endTime, session);
@ -448,6 +457,7 @@ namespace QMAPP.FJC.DAL.CompleteStatistics
parameters = parametersList.ToArray();
return sql.ToString();
}
public List<CompleteStatisticsEntity> GetExportData(CompleteStatisticsEntity model, IDataSession session)
{

613
APPQ5/QMAPP.FJC.DAL/CompleteStatistics/TJCompleteStatisticsDAL.cs

@ -0,0 +1,613 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using QMAPP.DAL;
using QMAPP.FJC.Entity.Common.Constants;
using QMAPP.FJC.Entity.CompleteStatistics;
using QMFrameWork.Data;
namespace QMAPP.FJC.DAL.CompleteStatistics
{
public class TJCompleteStatisticsDAL : BaseDAL
{
public DataPage GetList(TJCompleteStatisticsEntity condition, DataPage page)
{
DataParameter[] parameters;
string sql = this.GetQuerySql(condition, out parameters);
//分页关键字段及排序
page.KeyName = "PID";
page.SortExpression = "ORDERNO ASC";
using (IDataSession session = AppDataFactory.CreateMainSession()) {
page = session.GetDataPage<TJCompleteStatisticsEntity>(sql, parameters, page);
}
return page;
}
public List<TJCompleteStatisticsEntity> GetList(TJCompleteStatisticsEntity condition)
{
DataParameter[] parameters;
string sql = this.GetQuerySql(condition, out parameters);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.GetList<TJCompleteStatisticsEntity>(sql, parameters).ToList();
}
}
public TJCompleteStatisticsEntity Get(TJCompleteStatisticsEntity model)
{
using (IDataSession session = AppDataFactory.CreateMainSession()) {
return session.Get(model);
}
}
public int Insert(TJCompleteStatisticsEntity model)
{
using (IDataSession session = AppDataFactory.CreateMainSession()) {
return session.Insert(model);
}
}
public int Select_Get(string ProductCode)
{
var sql = $"select * from T_AW_COMPLETE_TJSTATISTICS where ORDERNO = '{ProductCode}' and DELFLAG = '0'";
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.GetList<TJCompleteStatisticsEntity>(sql, new DataParameter[] { }).ToList().Count;
}
}
public bool ExistCompleteStatistics(TJCompleteStatisticsEntity model)
{
throw new NotImplementedException();
}
protected string ExistQureySql()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT *");
sql.AppendLine(" FROM T_AW_MAINOPERATION T");
sql.AppendLine(" WHERE INFO.BARCODEIDENTIFY IS NOT NULL");
sql.AppendLine(" AND T.OPERATEDDATE > @StartTime");
sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime");
return sql.ToString();
}
public int Update(TJCompleteStatisticsEntity model)
{
using (IDataSession session = AppDataFactory.CreateMainSession()) {
return session.Update(model);
}
}
public int GenericCompleteStatistics(DateTime starTime, DateTime endTime)
{
int count = 0;
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//DataParameter[] parameters = {
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
//};
try {
session.OpenTs();
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
//成品
//string sql = GetGenericStatisticsSqlForBORA();
//count = session.ExecuteSql(sql, parameters);
////注塑件
//sql = GetGenericStatisticsSqlForINJECT();
//count += session.ExecuteSql(sql, parameters);
this.UpdateLastGenericTime(endTime, session);
session.CommitTs();
}
catch (Exception) {
session.RollbackTs();
throw;
}
}
return count;
}
public int FrmPlaceCompleteStatistics(DateTime starTime, DateTime endTime)
{
int count = 0;
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//DataParameter[] parameters = {
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
//};
try
{
session.OpenTs();
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
//成品
//string sql = GetGenericStatisticsSqlForBORA();
//count = session.ExecuteSql(sql, parameters);
////注塑件
//sql = GetGenericStatisticsSqlForINJECT();
//count += session.ExecuteSql(sql, parameters);
this.UpdateLastGenericTime(endTime, session);
session.CommitTs();
}
catch (Exception)
{
session.RollbackTs();
throw;
}
}
return count;
}
public SystemConfig GetSystemConfig(string codeType)
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT *");
sql.AppendLine(" FROM T_SYSTEM_CONFIG");
sql.AppendLine(" WHERE CODETYPE = @CodeType");
DataParameter[] parameters = {
new DataParameter {ParameterName = "CodeType", DataType = DbType.String, Value = codeType}
};
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.Get<SystemConfig>(sql.ToString(), parameters);
}
}
public string GetMFGMaterialCode(string MaterialCode)
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT *");
sql.AppendLine(" FROM T_PP_TJFY_ExchangeType");
sql.AppendLine(" WHERE MaterialCode = @MaterialCode");
DataParameter[] parameters = {
new DataParameter {ParameterName = "MaterialCode", DataType = DbType.String, Value = MaterialCode}
};
using (IDataSession session = AppDataFactory.CreateMainSession())
{
var date = session.GetTable(sql.ToString(), parameters);
if (date.Rows.Count > 0)
{
return date.Rows[0]["MFGMaterialCode"].ToString();
}
else
return "";
}
}
protected int UpdateLastGenericTime(DateTime endTime, IDataSession session)
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("UPDATE T_SYSTEM_CONFIG");
sql.AppendLine(" SET CODEVALUE = @EndTime");
sql.AppendLine(" WHERE CODETYPE = @CodeType");
DataParameter[] parameters =
{
new DataParameter {ParameterName = "EndTime", DataType = DbType.String, Value = endTime.ToString("yyyy/MM/dd HH:mm:ss")},
new DataParameter {ParameterName = "CodeType", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_LSTTIME}
};
return session.ExecuteSql(sql.ToString(), parameters);
}
/// <summary>
/// 成都工厂适用SQL
/// </summary>
/// <returns></returns>
protected string GetGenericStatisticsSqlForCD()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("INSERT INTO T_AW_COMPLETE_TJSTATISTICS");
sql.AppendLine("SELECT NEWID(),");
sql.AppendLine(" REPLACE(T.CUSTOMERSPAREPARTS, ' ', '') AS MATERIALNO,");
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,");
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,");
sql.AppendLine(" @StartTime AS STARTTIME,");
sql.AppendLine(" @EndTime AS ENDTIME,");
sql.AppendLine(" CNFG.CODEVALUE + ");
sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) +");
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY T.CUSTOMERSPAREPARTS))) + CAST (ROW_NUMBER() OVER (ORDER BY T.CUSTOMERSPAREPARTS) AS VARCHAR) AS ORDERNO,");
sql.AppendLine(" GETDATE() AS CREATETIME,");
sql.AppendLine(" USR.USERID AS CREATEUSER,");
sql.AppendLine(" GETDATE() AS UPDATETIME,");
sql.AppendLine(" USR.USERID AS UPDATEUSER,");
sql.AppendLine(" '0' AS DELFLAG");
sql.AppendLine(" FROM T_DAS_BARCODEVIBPAR T");
sql.AppendLine(" LEFT JOIN T_QM_USER USR");
sql.AppendLine(" ON USR.USERID = 'SYSTEM'");
sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG");
sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER'");
sql.AppendLine(" WHERE T.SCANTIME > @StartTime");
sql.AppendLine(" AND T.SCANTIME <= @EndTime");
sql.AppendLine(" AND SUBSTRING(T.ABARCODE, 9, 2) <> '99'");
sql.AppendLine(" GROUP BY T.CUSTOMERSPAREPARTS, USR.USERID, CNFG.CODEVALUE");
return sql.ToString();
}
//长春
protected string GetGenericStatisticsSqlForCC()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine("INSERT INTO T_AW_COMPLETE_TJSTATISTICS");
sql.AppendLine("SELECT NEWID(),");
sql.AppendLine(" INFO.MATERIALNO AS MATERIALNO,");
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,");
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,");
sql.AppendLine(" @StartTime AS STARTTIME,");
sql.AppendLine(" @EndTime AS ENDTIME,");
sql.AppendLine(" CNFG.CODEVALUE + ");
sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) +");
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY INFO.MATERIALNO))) + CAST (ROW_NUMBER() OVER (ORDER BY INFO.MATERIALNO) AS VARCHAR) AS ORDERNO,");
sql.AppendLine(" GETDATE() AS CREATETIME,");
sql.AppendLine(" USR.USERID AS CREATEUSER,");
sql.AppendLine(" GETDATE() AS UPDATETIME,");
sql.AppendLine(" USR.USERID AS UPDATEUSER,");
sql.AppendLine(" '0' AS DELFLAG");
sql.AppendLine(" FROM T_AW_MAINOPERATION T");
sql.AppendLine(" LEFT JOIN T_BD_BARCODE_PRODUCT_RELATION RELATION");
sql.AppendLine(" ON T.PRODUCTTYPE = RELATION.PRODUCTTYPE");
sql.AppendLine(" AND T.PROCESSTYPE = RELATION.PROCESSTYPE");
sql.AppendLine(" LEFT JOIN T_BD_MATERIAL_BARCODE_INFO INFO");
sql.AppendLine(" ON INFO.PROCESSTYPE = RELATION.PROCESSTYPE");
sql.AppendLine(" AND INFO.PRODUCTTYPE = RELATION.PRODUCTTYPE");
sql.AppendLine(" AND SUBSTRING(T.PRODUCTCODE, RELATION.STARTINDEX, RELATION.SUBLENGTH) = INFO.BARCODEIDENTIFY");
sql.AppendLine(" LEFT JOIN T_QM_USER USR");
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM'");
sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG");
sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER'");
sql.AppendLine(" WHERE INFO.BARCODEIDENTIFY IS NOT NULL");
sql.AppendLine(" AND T.OPERATEDDATE > @StartTime");
sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime");
sql.AppendLine(" GROUP BY INFO.MATERIALNO, USR.USERID, CNFG.CODEVALUE");
return sql.ToString();
}
//青岛仪表板/门板的成品
//protected string GetGenericStatisticsSqlForBORA()
//{
// StringBuilder sql = new StringBuilder();
// sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS ");
// sql.AppendLine(" SELECT NEWID(), ");
// sql.AppendLine(" T.MATERIAL_CODE AS MATERIALNO, ");
// sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT, ");
// sql.AppendLine(" COUNT(*) AS COMPLETECOUNT, ");
// sql.AppendLine(" @StartTime AS STARTTIME, ");
// sql.AppendLine(" @EndTime AS ENDTIME, ");
// sql.AppendLine(" CNFG.CODEVALUE + ");
// sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) + ");
// sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
// sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY T.MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY T.MATERIAL_CODE) AS VARCHAR) AS ORDERNO, ");
// sql.AppendLine(" GETDATE() AS CREATETIME, ");
// sql.AppendLine(" USR.USERID AS CREATEUSER, ");
// sql.AppendLine(" GETDATE() AS UPDATETIME, ");
// sql.AppendLine(" USR.USERID AS UPDATEUSER, ");
// sql.AppendLine(" '0' AS DELFLAG ");
// sql.AppendLine(" FROM T_AW_MAINOPERATION T ");
// sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS C ON C.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE_CODE ");
// sql.AppendLine(" LEFT JOIN T_QM_USER USR ");
// sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' ");
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG ");
// sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER' ");
// sql.AppendLine(" WHERE T.OPERATEDDATE > @StartTime ");
// sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime ");
// sql.AppendLine(" AND C.MATERIAL_ATTRIBUTE='2' ");
// sql.AppendLine(" GROUP BY T.MATERIAL_CODE, USR.USERID, CNFG.CODEVALUE ");
// return sql.ToString();
//}
//青岛注塑件
protected string GetGenericStatisticsSqlForBORA()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS ");
sql.AppendLine(" SELECT NEWID(),");
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO,");
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,");
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,");
sql.AppendLine(" @StartTime AS STARTTIME,");
sql.AppendLine(" @EndTime AS ENDTIME,");
sql.AppendLine(" C.ORDERIDENTITY + ");
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + ");
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, ");
sql.AppendLine(" GETDATE() AS CREATETIME, ");
sql.AppendLine(" USR.USERID AS CREATEUSER, ");
sql.AppendLine(" GETDATE() AS UPDATETIME, ");
sql.AppendLine(" USR.USERID AS UPDATEUSER, ");
sql.AppendLine(" '0' AS DELFLAG ");
sql.AppendLine(" FROM T_AW_PRODUCT T ");
sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS S ON S.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE ");
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE ");
sql.AppendLine(" LEFT JOIN T_QM_USER USR ");
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' ");
sql.AppendLine(" WHERE S.MATERIAL_ATTRIBUTE='2' ");
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL ");
sql.AppendLine(" AND T.CREATEDATE > @StartTime ");
sql.AppendLine(" AND T.CREATEDATE <= @EndTime ");
sql.AppendLine(" AND T.MACHINECODDE IS NOT NULL ");
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY ");
return sql.ToString();
}
//天津770发运 MFG回冲
protected string GetFrmPlaceStatisticsSql()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS ");
sql.AppendLine(" SELECT NEWID(),");
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO,");
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,");
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,");
sql.AppendLine(" @StartTime AS STARTTIME,");
sql.AppendLine(" @EndTime AS ENDTIME,");
sql.AppendLine(" C.ORDERIDENTITY + ");
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + ");
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, ");
sql.AppendLine(" GETDATE() AS CREATETIME, ");
sql.AppendLine(" USR.USERID AS CREATEUSER, ");
sql.AppendLine(" GETDATE() AS UPDATETIME, ");
sql.AppendLine(" USR.USERID AS UPDATEUSER, ");
sql.AppendLine(" '0' AS DELFLAG ");
sql.AppendLine(" FROM T_AW_PRODUCT T ");
sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS S ON S.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE ");
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE ");
sql.AppendLine(" LEFT JOIN T_QM_USER USR ");
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' ");
sql.AppendLine(" WHERE S.MATERIAL_ATTRIBUTE='2' ");
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL ");
sql.AppendLine(" AND T.CREATEDATE > @StartTime ");
sql.AppendLine(" AND T.CREATEDATE <= @EndTime ");
sql.AppendLine(" AND T.MACHINECODDE IS NOT NULL ");
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY ");
return sql.ToString();
}
protected string GetGenericStatisticsSqlForINJECT()
{
StringBuilder sql = new StringBuilder();
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS ");
sql.AppendLine(" SELECT NEWID(), ");
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO, ");
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT, ");
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT, ");
sql.AppendLine(" @StartTime AS STARTTIME, ");
sql.AppendLine(" @EndTime AS ENDTIME, ");
sql.AppendLine(" C.ORDERIDENTITY + ");
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + ");
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + ");
sql.AppendLine(" CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, ");
sql.AppendLine(" GETDATE() AS CREATETIME, ");
sql.AppendLine(" USR.USERID AS CREATEUSER, ");
sql.AppendLine(" GETDATE() AS UPDATETIME, ");
sql.AppendLine(" USR.USERID AS UPDATEUSER, ");
sql.AppendLine(" '0' AS DELFLAG ");
sql.AppendLine(" FROM T_TM_MonitorCode T ");
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C ");
sql.AppendLine(" ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE ");
sql.AppendLine(" LEFT JOIN T_QM_USER USR ");
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' ");
sql.AppendLine(" WHERE T.CurrentMode='3' ");
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL ");
sql.AppendLine(" AND T.CREATEDATE > @StartTime ");
sql.AppendLine(" AND T.CREATEDATE <= @EndTime ");
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY ");
return sql.ToString();
}
protected string GetQuerySql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters)
{
List<DataParameter> parametersList = new List<DataParameter>();
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT T.PID, ");
sql.AppendLine(" T.MATERIALNO, ");
sql.AppendLine(" MAT.MATERIALNAME, ");
sql.AppendLine(" MAT.PRODUCTLINE, ");
sql.AppendLine(" T.SYSCOMPLETECOUNT,");
sql.AppendLine(" T.COMPLETECOUNT,");
sql.AppendLine(" T.STARTTIME, ");
sql.AppendLine(" T.ENDTIME, ");
sql.AppendLine(" T.ORDERNO, ");
sql.AppendLine(" T.CREATETIME,");
sql.AppendLine(" T.CREATEUSER,");
sql.AppendLine(" T.UPDATETIME,");
sql.AppendLine(" T.UPDATEUSER,");
sql.AppendLine(" T.DELFLAG,");
sql.AppendLine(" CUSER.USERNAME AS CREATEUSER_DISPLAY,");
sql.AppendLine(" UUSER.USERNAME AS UPDATEUSER_DISPLAY");
sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T");
sql.AppendLine(" LEFT JOIN T_QM_USER CUSER");
sql.AppendLine(" ON T.CREATEUSER = CUSER.USERID");
sql.AppendLine(" LEFT JOIN T_QM_USER UUSER");
sql.AppendLine(" ON T.UPDATEUSER = UUSER.USERID");
sql.AppendLine(" INNER JOIN T_BD_MATERIAL_BARCODE_INFO MAT");
sql.AppendLine(" ON T.MATERIALNO = MAT.MATERIALNO");
sql.AppendLine(" WHERE 1 = 1");
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO))
{
sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo");
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) });
}
if (!string.IsNullOrWhiteSpace(condition.DELFLAG))
{
if(condition.DELFLAG == "是")
sql.AppendLine(" AND T.DELFLAG = '1'");
else if(condition.DELFLAG == "否")
sql.AppendLine(" AND T.DELFLAG = '0'");
}
if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
{
sql.AppendLine(" AND T.ENDTIME >= @SEndTime");
parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
}
if (!string.IsNullOrWhiteSpace(condition.EENDTIME))
{
sql.AppendLine(" AND T.ENDTIME <= @EEndTime");
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.EENDTIME) });
}
parameters = parametersList.ToArray();
return sql.ToString();
}
public List<TJCompleteStatisticsEntity> GetExportData(TJCompleteStatisticsEntity model, IDataSession session)
{
DataParameter[] parameters;
string sql = this.GetExportSql(model, out parameters);
DataParameter[] unableParameters;
//数据上传状态回填
string unableSql = this.unableExportDataString(model, out unableParameters);
List<TJCompleteStatisticsEntity> rtn = session.GetList<TJCompleteStatisticsEntity>(sql, parameters).ToList();
//var count = session.ExecuteSql(unableSql, unableParameters);
using (IDataSession session2 = AppDataFactory.CreateMainSession())
{
var count = session2.ExecuteSql(unableSql, unableParameters);
}
return rtn;
}
private string unableExportDataString(TJCompleteStatisticsEntity condition, out DataParameter[] parameters)
{
List<DataParameter> parametersList = new List<DataParameter>();
StringBuilder sql = new StringBuilder();
sql.AppendLine("UPDATE [dbo].[T_AW_COMPLETE_TJSTATISTICS] ");
sql.AppendLine(" SET DELFLAG = '1'");
sql.AppendLine(" WHERE DELFLAG = '0'");
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO))
{
sql.AppendLine(" AND MATERIALNO LIKE @MaterialNo");
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) });
}
//20211214重传后DELFLAG状态修改
//if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
//{
// sql.AppendLine(" AND ENDTIME >= @SEndTime");
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
//}
if (!string.IsNullOrWhiteSpace(condition.EENDTIME))
{
sql.AppendLine(" AND ENDTIME <= @EEndTime");
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.EENDTIME) });
}
parameters = parametersList.ToArray();
return sql.ToString();
}
//protected string GetExportSql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters)
//{
// List<DataParameter> parametersList = new List<DataParameter>();
// StringBuilder sql = new StringBuilder();
// sql.AppendLine("SELECT EM.CODEVALUE AS EMPLOYEE, ");
// sql.AppendLine(" SI.CODEVALUE AS SITE, ");
// sql.AppendLine(" '' AS SHIFT, ");
// sql.AppendLine(" T.MATERIALNO, ");
// sql.AppendLine(" MAT.PRODUCTLINE, ");
// sql.AppendLine(" '' AS EDIMAT, ");
// sql.AppendLine(" '' AS SERIAL, ");
// sql.AppendLine(" USR.CODEVALUE AS USERID, ");
// sql.AppendLine(" T.ORDERNO, ");
// sql.AppendLine(" T.COMPLETECOUNT,");
// sql.AppendLine(" T.STARTTIME");
// sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T");
// sql.AppendLine(" INNER JOIN T_BD_MATERIAL_BARCODE_INFO MAT");
// sql.AppendLine(" ON T.MATERIALNO = MAT.MATERIALNO");
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG EM");
// sql.AppendLine(" ON EM.CODETYPE = @Employee");
// parametersList.Add(new DataParameter { ParameterName = "Employee", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_EMPLOYEE });
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG SI");
// sql.AppendLine(" ON SI.CODETYPE = @Site");
// parametersList.Add(new DataParameter { ParameterName = "Site", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_SITE });
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG USR");
// sql.AppendLine(" ON USR.CODETYPE = @UserId");
// parametersList.Add(new DataParameter { ParameterName = "UserId", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_USER });
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG ORD");
// sql.AppendLine(" ON ORD.CODETYPE = @OrderNo");
// parametersList.Add(new DataParameter { ParameterName = "OrderNo", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_ORDER });
// sql.AppendLine(" WHERE T.DELFLAG = '0'");
// if (!string.IsNullOrWhiteSpace(condition.MATERIALNO))
// {
// sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo");
// parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) });
// }
// if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
// {
// sql.AppendLine(" AND T.ENDTIME >= @SEndTime");
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
// }
// if (!string.IsNullOrWhiteSpace(condition.EENDTIME))
// {
// sql.AppendLine(" AND T.ENDTIME <= @EEndTime");
// parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = string.Format("{0}", condition.EENDTIME) });
// }
// sql.AppendLine(" ORDER BY T.ORDERNO ASC");
// parameters = parametersList.ToArray();
// return sql.ToString();
//}
protected string GetExportSql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters)
{
List<DataParameter> parametersList = new List<DataParameter>();
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT (select top 1 MFG_USERCODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS EMPLOYEE, ");
sql.AppendLine(" (select top 1 MFG_LOCATIONCODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS SITE, ");
sql.AppendLine(" '' AS SHIFT, ");
sql.AppendLine(" T.MATERIALNO, ");
sql.AppendLine(" (select top 1 PRODUCELINECODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS PRODUCTLINE, ");
sql.AppendLine(" '' AS EDIMAT, ");
sql.AppendLine(" '' AS SERIAL, ");
sql.AppendLine(" (select top 1 USERID from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO), ");
sql.AppendLine(" T.ORDERNO, ");
sql.AppendLine(" T.COMPLETECOUNT,");
sql.AppendLine(" T.STARTTIME,");
sql.AppendLine(" T.ENDTIME");
sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T");
sql.AppendLine(" WHERE T.DELFLAG = '0'");
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO))
{
sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo");
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) });
}
//20211214如网络中断,重连后数据重传
//if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
//{
// sql.AppendLine(" AND T.ENDTIME >= @SEndTime");
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
//}
if (!string.IsNullOrWhiteSpace(condition.EENDTIME))
{
sql.AppendLine(" AND T.ENDTIME <= @EEndTime");
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = string.Format("{0}", condition.EENDTIME) });
}
sql.AppendLine(" ORDER BY T.ORDERNO ASC");
parameters = parametersList.ToArray();
return sql.ToString();
}
public DataTable ExportExcelData(TJCompleteStatisticsEntity model)
{
DataParameter[] parameters;
string sql = this.GetQuerySql(model, out parameters);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.GetTable(sql, parameters);
}
}
}
}

2
APPQ5/QMAPP.FJC.DAL/QMAPP.FJC.DAL.csproj

@ -111,6 +111,7 @@
<Compile Include="CellCycle\CellCycleTimeSetDAL.cs" />
<Compile Include="CheckTime\ProductTimeDAL.cs" />
<Compile Include="CheckTime\CHECKTIMEDAL.cs" />
<Compile Include="CompleteStatistics\TJCompleteStatisticsDAL.cs" />
<Compile Include="CompleteStatistics\CompleteStatisticsDAL.cs" />
<Compile Include="Dianjian\InOutPut_BeginShiftDAL.cs" />
<Compile Include="Dianjian\InOutPut_InventoryLogDAL.cs" />
@ -186,6 +187,7 @@
<Compile Include="SA\WorkcellQtyCountDAL.cs" />
<Compile Include="SendManage\SendPlanRecordDAL.cs" />
<Compile Include="Stocktaking\StocktakingDAL.cs" />
<Compile Include="TianJin\MonitordataDAL.cs" />
<Compile Include="TianJin\StorageLogDAL.cs" />
<Compile Include="TianJin\StorageDAL.cs" />
<Compile Include="TianJin\TJDoorPlankPlanDAL.cs" />

201
APPQ5/QMAPP.FJC.DAL/TianJin/MonitordataDAL.cs

@ -0,0 +1,201 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.Entity.MD;
using QMFrameWork.Data;
using System.Data;
using QMAPP.Entity;
using QMAPP.MD.Entity.Bucket;
using QMAPP.MD.Entity.TianJin;
namespace QMAPP.FJC.DAL.TianJin
{
/// <summary>
/// 模块名称:库存日志信息
/// 作 者:张松男
/// 编写日期:2022年02月17日
/// </summary>
public class MonitordataDAL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>*信息</returns>
public Monitordata Get(Monitordata info)
{
try
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//获取信息
info = session.Get<Monitordata>(info);
}
return info;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>*信息</returns>
public Monitordata Get(string materialcode)
{
try
{
string sql = "SELECT top1 * FROM [T_AW_Monitordata] WHERE [ProductCode]=@ProductCode";
List<DataParameter> parameters = new List<DataParameter>();
parameters.Add(new DataParameter("ProductCode", materialcode));
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//获取信息
var info = session.Get<Monitordata>(sql, parameters.ToArray());
return info;
}
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataPage GetList(Monitordata condition, DataPage page)
{
string sql = null;
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = this.GetQuerySql(condition, ref parameters);
//分页关键字段及排序
page.KeyName = "id";
if (string.IsNullOrEmpty(page.SortExpression))
page.SortExpression = "RecordDate DESC";
using (IDataSession session = AppDataFactory.CreateMainSession())
{
page = session.GetDataPage<Monitordata>(sql, parameters.ToArray(), page);
}
return page;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public List<Monitordata> GetALL()
{
string sql = null;
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = "SELECT * FROM T_AW_Monitordata ";
//分页关键字段及排序
var LIST = new List<Monitordata>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
LIST = session.GetList<Monitordata>(sql, parameters.ToArray()).ToList();
}
return LIST;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取查询语句
/// <summary>
/// 获取查询语句
/// </summary>
/// <param name="user">查询条件</param>
/// <param name="parameters">参数</param>
/// <returns>查询语句</returns>
private string GetQuerySql(Monitordata condition, ref List<DataParameter> parameters)
{
StringBuilder sqlBuilder = new StringBuilder();
StringBuilder whereBuilder = new StringBuilder();
try
{
//构成查询语句
sqlBuilder.Append("SELECT * ");
sqlBuilder.Append("FROM monitordata ");
if (string.IsNullOrEmpty(condition.QrCodeContent) == false)
{
whereBuilder.Append(" AND QrCodeContent = @QrCodeContent");
parameters.Add(new DataParameter { ParameterName = "QrCodeContent", DataType = DbType.String, Value = condition.QrCodeContent });
}
if (condition.BeginTime != DateTime.MinValue)
whereBuilder.Append($" and RecordDate >= '{condition.BeginTime}' ");
if (condition.EndTime != DateTime.MinValue)
whereBuilder.Append($" and RecordDate <= '{condition.EndTime}' ");
//查询条件
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(Monitordata model)
{
DataTable dt = null;
string sql = null;
List<DataParameter> parameters = new List<DataParameter>();
try
{
//构成查询语句
sql = this.GetQuerySql(model, ref parameters);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
dt = session.GetTable(sql, parameters.ToArray());
dt.TableName = "T_AW_Monitordata";
}
return dt;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}

74
APPQ5/QMAPP.FJC.DAL/TianJin/TJPaoMoPlanDAL.cs

@ -33,7 +33,7 @@ namespace QMAPP.FJC.DAL.TianJin
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = "SELECT * FROM T_PP_TJFY_ORDERPLAN WHERE 1=1 ";
sql = "SELECT * FROM T_PP_ORDERPLAN_PAOMO WHERE 1=1 ";
if (string.IsNullOrEmpty(model.PID) == false)
{
sql += " AND PID = @PID";
@ -230,6 +230,8 @@ namespace QMAPP.FJC.DAL.TianJin
sqlBuilder.AppendLine(" ,O.REMARK ");
sqlBuilder.AppendLine(" ,O.QTY ");
sqlBuilder.AppendLine(" ,O.COMPLETE_QTY ");
sqlBuilder.AppendLine(" ,O.SCRAP_QTY ");
sqlBuilder.AppendLine(" ,O.REPAIR_QTY ");
sqlBuilder.AppendLine(" ,CONVERT(VARCHAR(19),O.PLAN_DATE,120) AS PLAN_DATE ");
sqlBuilder.AppendLine(" ,O.SHIFT_CODE ");
sqlBuilder.AppendLine(" ,P.PRODUCESHIFTNAME AS SHIFT_NAME ");
@ -407,7 +409,7 @@ namespace QMAPP.FJC.DAL.TianJin
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
var sql = $"update T_PP_TJFY_ORDERPLAN set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',PLAN_SEQ = '{model.PLAN_SEQ}',PLAN_NO = '{model.PLAN_NO}',MATERIAL_NAME = '{model.MATERIAL_NAME}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';";
var sql = $"update T_PP_ORDERPLAN_PAOMO set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',COMPLETE_QTY = '{model.COMPLETE_QTY}',SCRAP_QTY = '{model.SCRAP_QTY}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';";
//更新基本信息
count = session.ExecuteSql(sql);
InsertOrderPlanTrace(session, model, "修改");
@ -625,53 +627,25 @@ namespace QMAPP.FJC.DAL.TianJin
session.OpenTs();
foreach (TJPaoMoPlan info in list)
{
if (info.IsNewInfo == true)
{
//插入信息
int count = session.Insert<TJPaoMoPlan>(info);
//InsertOrderPlanTrace(session, info, "新增");
////痕迹表
FISPlanRecord record = new FISPlanRecord();
record.PID = Guid.NewGuid().ToString();
record.MID = info.PID;
record.PLAN_NO = info.PLAN_NO;
record.MATERIAL_CODE = info.MATERIAL_CODE;
record.PLAN_QTY = info.QTY;
record.OPERATION_TYPE = "0";
record.CREATEUSER = info.CREATEUSER;
record.CREATEDATE = info.CREATEDATE;
//int no = new OrderPlanDAL().InsertRecord(record);
em.insertNum++;
}
else
{
//更新信息
int count = session.Update<TJPaoMoPlan>(info);
//InsertOrderPlanTrace(session, info, "修改");
//#region 插入修改信息痕迹表
////插入修改信息痕迹表
//FISPlanRecord record = new FISPlanRecord();
//record.PID = Guid.NewGuid().ToString();
//record.MID = info.PID;
//record.PLAN_NO = info.PLAN_NO;
//record.MATERIAL_CODE = info.MATERIAL_CODE;
//record.PLAN_QTY = info.QTY;
//record.OPERATION_TYPE = "1";
//record.CREATEUSER = info.CREATEUSER;
//record.CREATEDATE = info.CREATEDATE;
//int no = new OrderPlanDAL().InsertRecord(record);
#endregion
em.updateNum++;
}
//插入信息
int count = session.Insert<TJPaoMoPlan>(info);
////痕迹表
FISPlanRecord record = new FISPlanRecord();
record.PID = Guid.NewGuid().ToString();
record.MID = info.PID;
record.PLAN_NO = info.PLAN_NO;
record.MATERIAL_CODE = info.MATERIAL_CODE;
record.PLAN_QTY = info.QTY;
record.OPERATION_TYPE = "0";
record.CREATEUSER = info.CREATEUSER;
record.CREATEDATE = info.CREATEDATE;
session.Insert<FISPlanRecord>(record);
em.insertNum++;
}
session.CommitTs();
}
@ -682,7 +656,7 @@ namespace QMAPP.FJC.DAL.TianJin
}
return em;
}
//#endregion
#endregion
#region 获取导出的数据
/// <summary>

110
APPQ5/QMAPP.FJC.DAL/TianJin/TJZhuSuPlanDAL.cs

@ -33,7 +33,7 @@ namespace QMAPP.FJC.DAL.TianJin
List<DataParameter> parameters = new List<DataParameter>();
try
{
sql = "SELECT * FROM T_PP_TJFY_ORDERPLAN WHERE 1=1 ";
sql = "SELECT * FROM T_PP_ORDERPLAN_ZHUSU WHERE 1=1 ";
if (string.IsNullOrEmpty(model.PID) == false)
{
sql += " AND PID = @PID";
@ -230,6 +230,8 @@ namespace QMAPP.FJC.DAL.TianJin
sqlBuilder.AppendLine(" ,O.REMARK ");
sqlBuilder.AppendLine(" ,O.QTY ");
sqlBuilder.AppendLine(" ,O.COMPLETE_QTY ");
sqlBuilder.AppendLine(" ,O.SCRAP_QTY ");
sqlBuilder.AppendLine(" ,O.REPAIR_QTY ");
sqlBuilder.AppendLine(" ,CONVERT(VARCHAR(19),O.PLAN_DATE,120) AS PLAN_DATE ");
sqlBuilder.AppendLine(" ,O.SHIFT_CODE ");
sqlBuilder.AppendLine(" ,P.PRODUCESHIFTNAME AS SHIFT_NAME ");
@ -407,7 +409,7 @@ namespace QMAPP.FJC.DAL.TianJin
{
using (IDataSession session = AppDataFactory.CreateMainSession())
{
var sql = $"update T_PP_TJFY_ORDERPLAN set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',PLAN_SEQ = '{model.PLAN_SEQ}',PLAN_NO = '{model.PLAN_NO}',MATERIAL_NAME = '{model.MATERIAL_NAME}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';";
var sql = $"update T_PP_ORDERPLAN_ZHUSU set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',COMPLETE_QTY = '{model.COMPLETE_QTY}',SCRAP_QTY = '{model.SCRAP_QTY}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';";
//更新基本信息
count = session.ExecuteSql(sql);
InsertOrderPlanTrace(session, model, "修改");
@ -472,7 +474,7 @@ namespace QMAPP.FJC.DAL.TianJin
num = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID)));
state = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder2.ToString(), new DataParameter("PID", model.PID)));
}
return num+state;
return num + state;
}
#endregion
@ -507,22 +509,22 @@ namespace QMAPP.FJC.DAL.TianJin
StringBuilder sqlBuilder = new StringBuilder();
StringBuilder sqlBuilder2 = new StringBuilder();
List<DataParameter> parameters = new List<DataParameter>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_ZHUSU ");
sqlBuilder.AppendLine(" SET PLAN_STATE='1' ");
sqlBuilder.AppendLine(" WHERE PID = @PID ");
using (IDataSession session = AppDataFactory.CreateMainSession())
{
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_ZHUSU ");
sqlBuilder.AppendLine(" SET PLAN_STATE='1' ");
sqlBuilder.AppendLine(" WHERE PID = @PID ");
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER ");
sqlBuilder2.AppendLine(" SET STATE='1' ");
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID ");
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER ");
sqlBuilder2.AppendLine(" SET STATE='1' ");
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID ");
//发布更新基本信息
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID });
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray());
count2 = session.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray());
}
return count;
//发布更新基本信息
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID });
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray());
count2 = session.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray());
}
return count;
}
#endregion
@ -535,7 +537,7 @@ namespace QMAPP.FJC.DAL.TianJin
/// <returns>发布个数</returns>
public int PutOutBaseSession(TJZhuSuPlan model, DataTable workOrderDt)
{
if (BaseSession==null)
if (BaseSession == null)
{
BaseSession = AppDataFactory.CreateMainSession();
}
@ -625,53 +627,25 @@ namespace QMAPP.FJC.DAL.TianJin
session.OpenTs();
foreach (TJZhuSuPlan info in list)
{
if (info.IsNewInfo == true)
{
//插入信息
int count = session.Insert<TJZhuSuPlan>(info);
//InsertOrderPlanTrace(session, info, "新增");
////痕迹表
FISPlanRecord record = new FISPlanRecord();
record.PID = Guid.NewGuid().ToString();
record.MID = info.PID;
record.PLAN_NO = info.PLAN_NO;
record.MATERIAL_CODE = info.MATERIAL_CODE;
record.PLAN_QTY = info.QTY;
record.OPERATION_TYPE = "0";
record.CREATEUSER = info.CREATEUSER;
record.CREATEDATE = info.CREATEDATE;
//int no = new OrderPlanDAL().InsertRecord(record);
em.insertNum++;
}
else
{
//更新信息
int count = session.Update<TJZhuSuPlan>(info);
//InsertOrderPlanTrace(session, info, "修改");
//#region 插入修改信息痕迹表
////插入修改信息痕迹表
//FISPlanRecord record = new FISPlanRecord();
//record.PID = Guid.NewGuid().ToString();
//record.MID = info.PID;
//record.PLAN_NO = info.PLAN_NO;
//record.MATERIAL_CODE = info.MATERIAL_CODE;
//record.PLAN_QTY = info.QTY;
//record.OPERATION_TYPE = "1";
//record.CREATEUSER = info.CREATEUSER;
//record.CREATEDATE = info.CREATEDATE;
//int no = new OrderPlanDAL().InsertRecord(record);
#endregion
em.updateNum++;
}
//插入信息
int count = session.Insert<TJZhuSuPlan>(info);
////痕迹表
FISPlanRecord record = new FISPlanRecord();
record.PID = Guid.NewGuid().ToString();
record.MID = info.PID;
record.PLAN_NO = info.PLAN_NO;
record.MATERIAL_CODE = info.MATERIAL_CODE;
record.PLAN_QTY = info.QTY;
record.OPERATION_TYPE = "0";
record.CREATEUSER = info.CREATEUSER;
record.CREATEDATE = info.CREATEDATE;
session.Insert<FISPlanRecord>(record);
em.insertNum++;
}
session.CommitTs();
}
@ -682,7 +656,7 @@ namespace QMAPP.FJC.DAL.TianJin
}
return em;
}
//#endregion
#endregion
#region 获取导出的数据
/// <summary>
@ -762,7 +736,7 @@ namespace QMAPP.FJC.DAL.TianJin
try
{
sql = $"SELECT TOP 1 PLAN_SEQ as 'SEQSTR',PLAN_DATE as 'DATASTR' FROM T_PP_ORDERPLAN_ZHUSU WHERE PLAN_DATE = '{condition.DATASTR}' ORDER BY PLAN_SEQ DESC ";
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//获取信息
@ -866,7 +840,7 @@ namespace QMAPP.FJC.DAL.TianJin
using (IDataSession session = AppDataFactory.CreateMainSession())
{
//插入基本信息
no = session.Insert<FISPlanRecord>(record);
no = session.Insert<FISPlanRecord>(record);
}
}
return no;

6
APPQ5/QMAPP.FJC.Entity/Bucket/BucketMaterialClass.cs

@ -14,7 +14,7 @@ namespace QMAPP.MD.Entity.Bucket
/// 作 者:张松男
/// 编写日期:2021年08月11日
/// </summary>
[DBTable(TableName = "T_MD_BucketMaterialClass")]
[DBTable(TableName = "T_MD_BucketMaterialClassPaomo")]
public class BucketMaterialClass : BaseEntity
{
/// <summary>
@ -28,8 +28,8 @@ namespace QMAPP.MD.Entity.Bucket
/// 物料编号
/// </summary>
[Description("物料编号")]
[DBColumn(ColumnName = "MaterialCode", DataType = DbType.String)]
public string MaterialCode { get; set; }
[DBColumn(ColumnName = "MaterialName", DataType = DbType.String)]
public string MaterialName { get; set; }
/// <summary>
/// 原料零件号

4
APPQ5/QMAPP.FJC.Entity/CompleteStatistics/CompleteStatisticsEntity.cs

@ -54,11 +54,11 @@ namespace QMAPP.FJC.Entity.CompleteStatistics
sql.AppendFormat(",'{0}'", this.COMPLETECOUNT);//xxmes_bk_qty
sql.AppendFormat(",'{0}'", this.PRODUCTLINE);//xxmes_bk_line
sql.AppendFormat(",'{0}'", this.ORDERNO);//xxmes_bk_doc
sql.AppendFormat(",'{0}'", this.SHIFT);//xxmes_bk_shift
sql.AppendFormat(",'{0}'", "A");//xxmes_bk_shift
sql.AppendFormat(",'{0}'", this.EMPLOYEE);//xxmes_bk_emp
sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", this.STARTTIME);//xxmes_bk_effdate
//sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", DateTime.Now.ToString("yyyyMMddHHmmss"));//xxmes_bk_effdate
sql.AppendFormat(",'{0}'", this.ORDERNO.Substring(0, 4));//xxmes_bk_prod
sql.AppendFormat(",'{0}'", "DP20");//xxmes_bk_prod
sql.AppendFormat(",'0')");//xxmes_bk_qadread
//string format = "\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",{6},\"{7}\",\"{8}\",{9},{10}";

80
APPQ5/QMAPP.FJC.Entity/CompleteStatistics/TJCompleteStatisticsEntity.cs

@ -0,0 +1,80 @@
using System;
using System.Linq;
using QMAPP.FJC.Entity.CompleteStatistics.Table;
using QMFrameWork.Data.Attributes;
namespace QMAPP.FJC.Entity.CompleteStatistics
{
/// <summary>
/// 完工统计表
/// </summary>
[DBTable(TableName = "T_AW_COMPLETE_TJSTATISTICS", TimeStampColumn = "UPDATETIME")]
public class TJCompleteStatisticsEntity : T_AW_COMPLETE_TJSTATISTICS
{
public string MATERIALNAME { get; set; }
public string PRODUCTLINE { get; set; }
public string CREATEUSER_DISPLAY { get; set; }
public string UPDATEUSER_DISPLAY { get; set; }
public string SENDTIME { get; set; }
public string EENDTIME { get; set; }
public string DOESEXPORT
{
get
{
if (!string.IsNullOrEmpty(this.DELFLAG) && this.DELFLAG.Equals("1"))
{
return "是";
}
return "否";
}
}
//For File
public string EMPLOYEE { get; set; }
public string SITE { get; set; }
public string SHIFT { get; set; }
public string EDIMAT { get; set; }
public string SERIAL { get; set; }
public string USERID { get; set; }
public override string ToString()
{
string format = "\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",{6},\"{7}\",\"{8}\",{9},{10}";
return string.Format(format, this.EMPLOYEE, this.SITE, this.SHIFT, this.MATERIALNO.Trim(), this.PRODUCTLINE, this.EDIMAT, this.SERIAL, this.USERID
, this.ORDERNO, this.COMPLETECOUNT, this.STARTTIME.ToString("MM/dd/yy"));
}
public string ToSQL()
{
System.Text.StringBuilder sql = new System.Text.StringBuilder();
sql.Append("INSERT INTO xxmes_bk_det(xxmes_bk_site,xxmes_bk_part,xxmes_bk_qty,xxmes_bk_line,xxmes_bk_doc,xxmes_bk_shift,xxmes_bk_emp,xxmes_bk_effdate,xxmes_bk_prod,xxmes_bk_qadread) ");
sql.Append("values ");
sql.AppendFormat("('{0}'", this.SITE);//xxmes_bk_site
sql.AppendFormat(",'{0}'", this.MATERIALNO);//xxmes_bk_part
sql.AppendFormat(",'{0}'", this.COMPLETECOUNT);//xxmes_bk_qty
sql.AppendFormat(",'{0}'", this.PRODUCTLINE);//xxmes_bk_line
sql.AppendFormat(",'{0}'", this.ORDERNO);//xxmes_bk_doc
sql.AppendFormat(",'{0}'", "A");//xxmes_bk_shift
sql.AppendFormat(",'{0}'", this.EMPLOYEE);//xxmes_bk_emp
sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", this.STARTTIME);//xxmes_bk_effdate
//sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", DateTime.Now.ToString("yyyyMMddHHmmss"));//xxmes_bk_effdate
sql.AppendFormat(",'{0}'", "DP20");//xxmes_bk_prod
sql.AppendFormat(",'0')");//xxmes_bk_qadread
//string format = "\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",{6},\"{7}\",\"{8}\",{9},{10}";
//return string.Format(format, this.EMPLOYEE, this.SITE, this.SHIFT, this.MATERIALNO.Trim(), this.PRODUCTLINE, this.EDIMAT, this.SERIAL, this.USERID
// , this.ORDERNO, this.COMPLETECOUNT, this.STARTTIME.ToString("MM/dd/yy"));
return sql.ToString();
}
/// <summary>
/// 根据GUID获取16位的唯一字符串
/// </summary>
/// <returns></returns>
private string GuidTo16String()
{
long i = Guid.NewGuid().ToByteArray().Aggregate<byte, long>(1, (current, b) => current*((int) b + 1));
return string.Format("{0:x}", i - DateTime.Now.Ticks).PadRight(16, '0').ToUpper();
}
}
}

92
APPQ5/QMAPP.FJC.Entity/CompleteStatistics/Table/T_AW_COMPLETE_TJSTATISTICS.cs

@ -0,0 +1,92 @@
using System;
using System.Data;
using QMAPP.Entity;
using QMFrameWork.Data.Attributes;
namespace QMAPP.FJC.Entity.CompleteStatistics.Table
{
/// <summary>
/// 完工统计表
/// </summary>
[DBTable(TableName = "T_AW_COMPLETE_TJSTATISTICS", TimeStampColumn = "UPDATETIME")]
public class T_AW_COMPLETE_TJSTATISTICS : BaseEntity
{
/// <summary>
/// 设备信息主键
/// </summary>
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)]
public string PID { get; set; }
/// <summary>
/// 零件号
/// </summary>
[DBColumn(ColumnName = "MATERIALNO", DataType = DbType.String)]
public string MATERIALNO { get; set; }
/// <summary>
/// 系统统计数量
/// </summary>
[DBColumn(ColumnName = "SYSCOMPLETECOUNT", DataType = DbType.Int32)]
public int SYSCOMPLETECOUNT { get; set; }
/// <summary>
/// 人工统计数量
/// </summary>
[DBColumn(ColumnName = "COMPLETECOUNT", DataType = DbType.Int32)]
public int COMPLETECOUNT { get; set; }
/// <summary>
/// 开始时间
/// </summary>
[DBColumn(ColumnName = "STARTTIME", DataType = DbType.DateTime)]
public DateTime STARTTIME { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[DBColumn(ColumnName = "ENDTIME", DataType = DbType.DateTime)]
public DateTime ENDTIME { get; set; }
/// <summary>
/// 订单号
/// </summary>
[DBColumn(ColumnName = "ORDERNO", DataType = DbType.String)]
public string ORDERNO { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[DBColumn(ColumnName = "CREATETIME", DataType = DbType.DateTime)]
public DateTime CREATETIME { get; set; }
/// <summary>
/// 创建者
/// </summary>
[DBColumn(ColumnName = "CREATEUSER", DataType = DbType.String)]
public string CREATEUSER { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[DBColumn(ColumnName = "UPDATETIME", DataType = DbType.DateTime)]
public DateTime UPDATETIME { get; set; }
/// <summary>
/// 更新者
/// </summary>
[DBColumn(ColumnName = "UPDATEUSER", DataType = DbType.String)]
public string UPDATEUSER { get; set; }
/// <summary>
/// 删除标识
/// </summary>
[DBColumn(ColumnName = "DELFLAG", DataType = DbType.String)]
public string DELFLAG { get; set; }
/// <summary>
/// 产线
/// </summary>
[DBColumn(ColumnName = "line", DataType = DbType.String)]
public string line { get; set; }
}
}

3
APPQ5/QMAPP.FJC.Entity/QMAPP.FJC.Entity.csproj

@ -108,6 +108,8 @@
<Compile Include="Common\EnumGeter.cs" />
<Compile Include="Common\Constants\CompleteStatisticsConstants.cs" />
<Compile Include="CompleteStatistics\BarcodeMaterialRelation.cs" />
<Compile Include="CompleteStatistics\Table\T_AW_COMPLETE_TJSTATISTICS.cs" />
<Compile Include="CompleteStatistics\TJCompleteStatisticsEntity.cs" />
<Compile Include="CompleteStatistics\CompleteStatisticsEntity.cs" />
<Compile Include="CompleteStatistics\MaterialBarcodeInfo.cs" />
<Compile Include="CompleteStatistics\SystemConfig.cs" />
@ -233,6 +235,7 @@
<Compile Include="Stocktaking\CountSheetInfo.cs" />
<Compile Include="Stocktaking\Material.cs" />
<Compile Include="Stocktaking\test.cs" />
<Compile Include="TianJin\Monitordata.cs" />
<Compile Include="TianJin\StorageLog.cs" />
<Compile Include="TianJin\Storage.cs" />
<Compile Include="TianJin\TJEPasteCard.cs" />

183
APPQ5/QMAPP.FJC.Entity/TianJin/Monitordata.cs

@ -0,0 +1,183 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.Entity;
using QMFrameWork.Data.Attributes;
using System.ComponentModel;
using System.Data;
namespace QMAPP.MD.Entity.TianJin
{
/// <summary>
/// 模块名称:注塑设备参数
/// 作 者:张松男
/// 编写日期:2024年07月12日
/// </summary>
[DBTable(TableName = "monitordata")]
public class Monitordata : BaseEntity
{
/// <summary>
/// 主键
/// </summary>
[Description("主键")]
[DBColumn(ColumnName = "id", DataType = DbType.String, IsKey = true)]
public string id { get; set; }
/// <summary>
/// 条码
/// </summary>
[Description("条码")]
[DBColumn(ColumnName = "QrCodeContent", DataType = DbType.String)]
public string QrCodeContent { get; set; }
/// <summary>
/// IpAddr
/// </summary>
[Description("IpAddr")]
[DBColumn(ColumnName = "IpAddr", DataType = DbType.String)]
public string IpAddr { get; set; }
/// <summary>
/// 生产时间
/// </summary>
[Description("生产时间")]
[DBColumn(ColumnName = "RecordDate", DataType = DbType.String)]
public string RecordDate { get; set; }
public DateTime EndTime { get; set; }
public DateTime BeginTime { get; set; }
/// <summary>
/// 注塑开始位置
/// </summary>
[Description("注塑开始位置")]
[DBColumn(ColumnName = "InjectStartPos", DataType = DbType.String)]
public string InjectStartPos { get; set; }
/// <summary>
/// 保压结束位置
/// </summary>
[Description("保压结束位置")]
[DBColumn(ColumnName = "HoldEndPos", DataType = DbType.String)]
public string HoldEndPos { get; set; }
/// <summary>
/// 储料完成位置
/// </summary>
[Description("储料完成位置")]
[DBColumn(ColumnName = "ChargeEndPos", DataType = DbType.String)]
public string ChargeEndPos { get; set; }
/// <summary>
/// 产品膜具
/// </summary>
[Description("产品膜具")]
[DBColumn(ColumnName = "sv_RecentMoldData", DataType = DbType.String)]
public string sv_RecentMoldData { get; set; }
/// <summary>
/// 生产班次
/// </summary>
[Description("生产班次")]
[DBColumn(ColumnName = "tour", DataType = DbType.String)]
public string tour { get; set; }
/// <summary>
/// 任务编号
/// </summary>
[Description("任务编号")]
[DBColumn(ColumnName = "TaskNo", DataType = DbType.String)]
public string TaskNo { get; set; }
/// <summary>
/// CutOffPressure
/// </summary>
[Description("CutOffPressure")]
[DBColumn(ColumnName = "TasCutOffPressurekNo", DataType = DbType.String)]
public string CutOffPressure { get; set; }
/// <summary>
/// HoldPresSPos
/// </summary>
[Description("HoldPresSPos")]
[DBColumn(ColumnName = "HoldPresSPos", DataType = DbType.String)]
public string HoldPresSPos { get; set; }
/// <summary>
/// InjectMaxPressure
/// </summary>
[Description("InjectMaxPressure")]
[DBColumn(ColumnName = "InjectMaxPressure", DataType = DbType.String)]
public string InjectMaxPressure { get; set; }
/// <summary>
/// InjectMaxSP
/// </summary>
[Description("InjectMaxSP")]
[DBColumn(ColumnName = "InjectMaxSP", DataType = DbType.String)]
public string InjectMaxSP { get; set; }
/// <summary>
/// ChargeMaxRPM
/// </summary>
[Description("ChargeMaxRPM")]
[DBColumn(ColumnName = "ChargeMaxRPM", DataType = DbType.String)]
public string ChargeMaxRPM { get; set; }
/// <summary>
/// MoldOpenEndPos
/// </summary>
[Description("MoldOpenEndPos")]
[DBColumn(ColumnName = "MoldOpenEndPos", DataType = DbType.String)]
public string MoldOpenEndPos { get; set; }
/// <summary>
/// MoldProTime
/// </summary>
[Description("MoldProTime")]
[DBColumn(ColumnName = "MoldProTime", DataType = DbType.String)]
public string MoldProTime { get; set; }
/// <summary>
/// InjSwitchTime
/// </summary>
[Description("InjSwitchTime")]
[DBColumn(ColumnName = "InjSwitchTime", DataType = DbType.String)]
public string InjSwitchTime { get; set; }
/// <summary>
/// ChargeTime
/// </summary>
[Description("ChargeTime")]
[DBColumn(ColumnName = "ChargeTime", DataType = DbType.String)]
public string ChargeTime { get; set; }
/// <summary>
/// InjHoldTime
/// </summary>
[Description("InjHoldTime")]
[DBColumn(ColumnName = "InjHoldTime", DataType = DbType.String)]
public string InjHoldTime { get; set; }
/// <summary>
/// MoldCloseTime
/// </summary>
[Description("MoldCloseTime")]
[DBColumn(ColumnName = "MoldCloseTime", DataType = DbType.String)]
public string MoldCloseTime { get; set; }
/// <summary>
/// MoldOpenTime
/// </summary>
[Description("MoldOpenTime")]
[DBColumn(ColumnName = "MoldOpenTime", DataType = DbType.String)]
public string MoldOpenTime { get; set; }
/// <summary>
/// CycleTime
/// </summary>
[Description("CycleTime")]
[DBColumn(ColumnName = "CycleTime", DataType = DbType.String)]
public string CycleTime { get; set; }
}
}

13
APPQ5/QMAPP.FJC.Entity/TianJin/TJPaoMoPlan.cs

@ -71,7 +71,18 @@ namespace QMAPP.FJC.Entity.TianJin
///</summary>
[DBColumn(ColumnName = "COMPLETE_QTY", DataType = DbType.String)]
public int COMPLETE_QTY { get; set; }
///<summary>
///报废数量
///</summary>
[DBColumn(ColumnName = "SCRAP_QTY", DataType = DbType.String)]
public int SCRAP_QTY { get; set; }
///<summary>
///返修数量
///</summary>
[DBColumn(ColumnName = "REPAIR_QTY", DataType = DbType.String)]
public int REPAIR_QTY { get; set; }
///<summary>
///计划日期

15
APPQ5/QMAPP.FJC.Entity/TianJin/TJZhuSuPlan.cs

@ -71,7 +71,20 @@ namespace QMAPP.FJC.Entity.TianJin
///</summary>
[DBColumn(ColumnName = "COMPLETE_QTY", DataType = DbType.String)]
public int COMPLETE_QTY { get; set; }
///<summary>
///报废数量
///</summary>
[DBColumn(ColumnName = "SCRAP_QTY", DataType = DbType.String)]
public int SCRAP_QTY { get; set; }
///<summary>
///返修数量
///</summary>
[DBColumn(ColumnName = "REPAIR_QTY", DataType = DbType.String)]
public int REPAIR_QTY { get; set; }
///<summary>
///计划日期

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

Binary file not shown.

43
APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJPaoMoPlanImp.xml

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<DataInfoMains>
<DataInfoMain InfoName="TJPaoMoPlanImp" InfoTitle="泡沫计划信息" TemplateFile="TJPaoMoPlanImp.xlsx" RecordCount="n">
<DataInfoItems>
<DataInfoItem ColumnName="PLAN_NO" ColumnTitle="计划单号" XPosition="A" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="MATERIAL_CODE" ColumnTitle="物料号" XPosition="B" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="PLAN_DATE" ColumnTitle="计划日期" XPosition="C" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="QTY" ColumnTitle="计划数量" XPosition="D" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="SHIFT_CODE" ColumnTitle="班次编码" XPosition="E" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="PRODUCEREQUIRE" ColumnTitle="生产要求" XPosition="F" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
</DataInfoItems>
</DataInfoMain>
</DataInfoMains>

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

Binary file not shown.

43
APPQ5/QMAPP.FJC.Web/App_Data/Excel/TJZhuSuPlanImp.xml

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<DataInfoMains>
<DataInfoMain InfoName="TJZhuSuPlanImp" InfoTitle="注塑计划信息" TemplateFile="TJZhuSuPlanImp.xlsx" RecordCount="n">
<DataInfoItems>
<DataInfoItem ColumnName="PLAN_NO" ColumnTitle="计划单号" XPosition="A" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="MATERIAL_CODE" ColumnTitle="物料号" XPosition="B" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="PLAN_DATE" ColumnTitle="计划日期" XPosition="C" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="QTY" ColumnTitle="计划数量" XPosition="D" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="SHIFT_CODE" ColumnTitle="班次编码" XPosition="E" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
<DataInfoItem ColumnName="PRODUCEREQUIRE" ColumnTitle="生产要求" XPosition="F" YPosition="3" >
<Observers>
<Observer name="Required" ></Observer>
</Observers>
</DataInfoItem>
</DataInfoItems>
</DataInfoMain>
</DataInfoMains>

131
APPQ5/QMAPP.FJC.Web/Controllers/MonitordataController.cs

@ -0,0 +1,131 @@
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.MD.Entity.TianJin;
using QMAPP.FJC.Web.Models.TianJin;
using System.Data;
using QMAPP.FJC.BLL.TianJin;
namespace QMAPP.FJC.Web.Controllers
{
public class MonitordataController : QController
{
#region 获取信息
/// <summary>
/// 加载列表
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult List(bool? callback)
{
MonitordataModel seachModel = new MonitordataModel();
if (callback == true)
TryGetSelectBuffer<MonitordataModel>(out seachModel);
seachModel.rownumbers = false;
seachModel.url = "/Monitordata/GetList";
return View("MonitordataList", seachModel);
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>列表</returns>
[HandleException]
public ActionResult GetList(bool? callBack)
{
MonitordataModel seachModel = null;
DataPage page = null;
ServiceAgent wcfAgent = this.GetServiceAgent();
Monitordata condition = null;
DataResult<DataPage> pageResult = new DataResult<DataPage>();
try
{
//获取查询对象
seachModel = GetModel<MonitordataModel>();
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<MonitordataModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<MonitordataModel>(seachModel);
}
#endregion
//获取前台分页设置信息
page = this.GetDataPage(seachModel);
condition = CopyToModel<Monitordata, MonitordataModel>(seachModel);
#region wcf服务统一接口
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("MonitordataBLL_GetList", condition, page);
if (pageResult.IsSuccess == false)
{
SetMessage(pageResult.Msg);
return List(true);
}
DateGridResult<Monitordata> result = new DateGridResult<Monitordata>();
result.Total = pageResult.Result.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize<List<Monitordata>>(pageResult.Result.Result.ToString());
#endregion
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出excel
/// <summary>
/// 导出excel
/// </summary>
/// <returns>结果</returns>
[HttpPost]
public ActionResult ExportExcel()
{
MonitordataModel seachModel = null;
Monitordata condition = null;
DataTable exportDt = new DataTable();
ServiceAgent wcfAgent = this.GetServiceAgent();
try
{
//获取查询对象
seachModel = GetModel<MonitordataModel>();
condition = CopyToModel<Monitordata, MonitordataModel>(seachModel);
//condition.PIDList = Request.Form["selectKey"];
//获取数据
MonitordataBLL op = new MonitordataBLL();
//exportDt = op.GetExportData(condition);
exportDt = wcfAgent.InvokeServiceFunction<DataTable>("MonitordataBLL_GetExportData", condition);
//导出
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
return efTool.GetExcelFileResult("MonitordataExp", "库存日志信息.xlsx", exportDt);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}

4
APPQ5/QMAPP.FJC.Web/Models/Bucket/BucketMaterialClassModel.cs

@ -28,9 +28,9 @@ namespace QMAPP.FJC.Web.Models.Bucket
/// </summary>
[Description("零件物料号")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.combotree)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)]
public string MaterialCode { get; set; }
public string MaterialName { get; set; }
/// <summary>
/// 零件号

242
APPQ5/QMAPP.FJC.Web/Models/TianJin/MonitordataModel.cs

@ -0,0 +1,242 @@
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.TianJin
{
/// <summary>
/// 模块名称:注塑信息
/// 作 者:张松男
/// 编写日期:2022年02月17日
/// </summary>
public class MonitordataModel : QDGModel
{
/// <summary>
/// 主键
/// </summary>
[Description("主键")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)]
[DGColumn(Hidden = true, PrimaryKey = true)]
public string id { get; set; }
/// <summary>
/// 条码
/// </summary>
[Description("条码")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string QrCodeContent { get; set; }
/// <summary>
/// IpAddr
/// </summary>
[Description("IpAddr")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string IpAddr { get; set; }
/// <summary>
/// 生产时间
/// </summary>
[Description("生产时间")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public DateTime RecordDate { get; set; }
/// <summary>
/// 注塑开始位置
/// </summary>
[Description("注塑开始位置")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string InjectStartPos { get; set; }
/// <summary>
/// 保压结束位置
/// </summary>
[Description("保压结束位置")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string HoldEndPos { get; set; }
/// <summary>
/// 储料完成位置
/// </summary>
[Description("储料完成位置")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string ChargeEndPos { get; set; }
/// <summary>
/// 产品膜具
/// </summary>
[Description("产品膜具")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string sv_RecentMoldData { get; set; }
/// <summary>
/// 生产班次
/// </summary>
[Description("生产班次")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string tour { get; set; }
/// <summary>
/// 任务编号
/// </summary>
[Description("任务编号")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string TaskNo { get; set; }
/// <summary>
/// CutOffPressure
/// </summary>
[Description("CutOffPressure")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string CutOffPressure { get; set; }
/// <summary>
/// HoldPresSPos
/// </summary>
[Description("HoldPresSPos")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string HoldPresSPos { get; set; }
/// <summary>
/// InjectMaxPressure
/// </summary>
[Description("InjectMaxPressure")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string InjectMaxPressure { get; set; }
/// <summary>
/// InjectMaxSP
/// </summary>
[Description("InjectMaxSP")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string InjectMaxSP { get; set; }
/// <summary>
/// ChargeMaxRPM
/// </summary>
[Description("ChargeMaxRPM")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string ChargeMaxRPM { get; set; }
/// <summary>
/// MoldOpenEndPos
/// </summary>
[Description("MoldOpenEndPos")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string MoldOpenEndPos { get; set; }
/// <summary>
/// MoldProTime
/// </summary>
[Description("MoldProTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string MoldProTime { get; set; }
/// <summary>
/// InjSwitchTime
/// </summary>
[Description("InjSwitchTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string InjSwitchTime { get; set; }
/// <summary>
/// ChargeTime
/// </summary>
[Description("ChargeTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string ChargeTime { get; set; }
/// <summary>
/// InjHoldTime
/// </summary>
[Description("InjHoldTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string InjHoldTime { get; set; }
/// <summary>
/// MoldCloseTime
/// </summary>
[Description("MoldCloseTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string MoldCloseTime { get; set; }
/// <summary>
/// MoldOpenTime
/// </summary>
[Description("MoldOpenTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string MoldOpenTime { get; set; }
/// <summary>
/// CycleTime
/// </summary>
[Description("CycleTime")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)]
public string CycleTime { get; set; }
/// <summary>
/// 开始时间
/// </summary>
[Description("开始时间")]
[HTMLInput(UpdateRead = true, MaxLength = 20)]
[InputType(inputType.dateTimeBox)]
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss", Hidden = true)]
public string BeginTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[Description("结束时间")]
[HTMLInput(UpdateRead = true, MaxLength = 20)]
[InputType(inputType.dateTimeBox)]
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss", Hidden = true)]
public string EndTime { get; set; }
}
}

18
APPQ5/QMAPP.FJC.Web/Models/TianJin/TJPaoMoPlanModel.cs

@ -90,6 +90,24 @@ namespace QMAPP.FJC.Web.Models.TianJin
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string COMPLETE_QTY { get; set; }
///<summary>
//报废数量
///</summary>
[Description("报废数量")]
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string SCRAP_QTY { get; set; }
///<summary>
//返修数量
///</summary>
[Description("返修数量")]
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string REPAIR_QTY { get; set; }
///<summary>
///备注
///</summary>

19
APPQ5/QMAPP.FJC.Web/Models/TianJin/TJZhuSuPlanModel.cs

@ -90,6 +90,25 @@ namespace QMAPP.FJC.Web.Models.TianJin
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string COMPLETE_QTY { get; set; }
///<summary>
//报废数量
///</summary>
[Description("报废数量")]
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string SCRAP_QTY { get; set; }
///<summary>
//返修数量
///</summary>
[Description("返修数量")]
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)]
public string REPAIR_QTY { get; set; }
///<summary>
///备注
///</summary>

17
APPQ5/QMAPP.FJC.Web/QMAPP.FJC.Web.csproj

@ -175,6 +175,7 @@
<Compile Include="Controllers\InjectionCountController.cs" />
<Compile Include="Controllers\SignInfoController.cs" />
<Compile Include="Controllers\PaomoPlanPrintController.cs" />
<Compile Include="Controllers\MonitordataController.cs" />
<Compile Include="Controllers\TJZhuSuPlanController.cs" />
<Compile Include="Controllers\TJPaoMoPlanController.cs" />
<Compile Include="Controllers\TJDoorPlankPlanPrintController.cs" />
@ -391,6 +392,7 @@
<Compile Include="Models\Stocktaking\StocktakingSearchModel.cs" />
<Compile Include="Models\TestEChartModel.cs" />
<Compile Include="Models\TianJin\InjectionCountModelModel.cs" />
<Compile Include="Models\TianJin\MonitordataModel.cs" />
<Compile Include="Models\TianJin\StorageLogModel.cs" />
<Compile Include="Models\TianJin\StorageModel.cs" />
<Compile Include="Models\TianJin\TJZhuSuPlanModel.cs" />
@ -434,6 +436,12 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Excel\TJZhuSuPlanImp.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\TJPaoMoPlanImp.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\T_PA_INJ_1500T_2Exp.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -968,11 +976,12 @@
<Content Include="Views\PutMachineClass\PutMachineClassList.aspx" />
<Content Include="Views\ProductTime\ProductTimeEdit.aspx" />
<Content Include="Views\ProductTime\ProductTimeList.aspx" />
<Content Include="Views\RawMaterialRecordCount\QTYRawMaterialRecordCount.aspx" />
<Content Include="Views\RawMaterialRecordCount\QTYCompletionRateCountView.aspx" />
<Content Include="Views\SignInfo\SignInfoEdit.aspx" />
<Content Include="Views\SignInfo\SignInfoList.aspx" />
<Content Include="Views\BucketMaterialClass\BucketMaterialClassEdit.aspx" />
<Content Include="Views\BucketMaterialClass\BucketMaterialClassList.aspx" />
<Content Include="Views\Monitordata\MonitordataList.aspx" />
<Content Include="Views\TJZhuSuPlan\TJZhuSuPlanEdit.aspx" />
<Content Include="Views\TJZhuSuPlan\TJZhuSuPlanList.aspx" />
<Content Include="Views\TJPaoMoPlan\TJPaoMoPlanEdit.aspx" />
@ -1396,6 +1405,9 @@
<Content Include="App_Data\Excel\TJDoorPlankPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\TJPaoMoPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App_Data\Excel\DoorPlankPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@ -1489,6 +1501,9 @@
<Content Include="App_Data\Excel\T_PA_INJ_1500T_2Exp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="App_Data\Excel\TJZhuSuPlanImp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App_Data\Excel\UltraExp.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

BIN
APPQ5/QMAPP.FJC.Web/Temp/04409478-d788-4852-8555-f18cbd26a4af.xlsx

Binary file not shown.

BIN
APPQ5/QMAPP.FJC.Web/Temp/93f7ac3d-039c-4909-b0d0-93e8be0fb2ed.xlsx

Binary file not shown.

BIN
APPQ5/QMAPP.FJC.Web/Temp/9c911783-5bb0-45b7-909f-52e9ae8dfe9f.xlsx

Binary file not shown.

BIN
APPQ5/QMAPP.FJC.Web/Temp/e42910bf-4998-4621-aa8a-5fb504b03308.xlsx

Binary file not shown.

4
APPQ5/QMAPP.FJC.Web/Views/BucketMaterialClass/BucketMaterialClassEdit.aspx

@ -14,10 +14,10 @@
<tr>
<th align="right">
<%=Html.QV(p=>p.MaterialCode) %>
<%=Html.QV(p=>p.MaterialName) %>
</th>
<td>
<%=Html.QC(p => p.MaterialCode)%>
<%=Html.QC(p => p.MaterialName)%>
</td>
</tr>

4
APPQ5/QMAPP.FJC.Web/Views/BucketMaterialClass/BucketMaterialClassList.aspx

@ -10,10 +10,10 @@
<table id="condiTable">
<tr>
<th align="right">
<%=Html.QV(p => p.MaterialCode)%>
<%=Html.QV(p => p.RawMaterial)%>
</th>
<td>
<%=Html.QC(p => p.MaterialCode)%>
<%=Html.QC(p => p.RawMaterial)%>
</td>
</tr>

91
APPQ5/QMAPP.FJC.Web/Views/Monitordata/MonitordataList.aspx

@ -0,0 +1,91 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.MonitordataModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
订单生产计划列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPSeach(80, true)%>
<table id="condiTable">
<tr>
<th align="right">
<%=Html.QV(p => p.QrCodeContent)%>
</th>
<td>
<%=Html.QC(p => p.QrCodeContent)%>
</td>
<th align="right">
<%=Html.QV(p => p.BeginTime)%>
</th>
<td>
<%=Html.QC(p => p.BeginTime)%>
</td>
<th align="right">
<%=Html.QV(p => p.EndTime)%>
</th>
<td>
<%=Html.QC(p => p.EndTime)%>
</td>
</tr>
</table>
<%=Html.QPEnd()%>
<%=Html.QPList() %>
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.TianJin.MonitordataModel>(Model)%>
<%=Html.QPEnd() %>
<%=Html.Hidden("selectKey")%>
<%=Html.Hidden("fileName")%>
<%=Html.Hidden("ORDER_TYPE")%>
<script language="javascript" type="text/javascript">
$(function () {
var type = document.getElementById("ORDER_TYPE").value;
//获取物料下拉数据源
$('#MATERIAL_CODE').combotree({
url: "/Dict/GetFisMaterialTree?ordertype=" + type,
panelHeight: '250',
panelWidth: '500',
});
List(1);
});
//导出
function Export() {
document.getElementById("selectKey").value = getSelectKey();
submitByButton("ExportExcel");
}
//查询
function Search() {
//var endtime = document.getElementById("PLANTIMEEND").value;
//if (parseDate($("#PLANTIMESTART").val()) > parseDate($("#PLANTIMEEND").val()) && endtime != "") {
// alert("开始时间不能大于结束时间!");
// return;
//}
List(1)
}
$(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("Monitordata", "List", "Search()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>
</td>
</tr>
</table>
</asp:Content>

170
APPQ5/QMAPP.FJC.Web/Views/RawMaterialRecordCount/QTYCompletionRateCountView.aspx

@ -0,0 +1,170 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.MESReport.Web.Models.LineQTY.QTYCompletionRateVModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
生产完成率分析
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPSeach(80,true) %>
<table id="condiTable">
<tr>
<%--<th align="right">
<%=Html.QV(p => p.MATERIAL_CODE)%>
</th>
<td>
<%=Html.QC(p => p.MATERIAL_CODE)%>
</td>
<th align="right">
<%=Html.QV(p => p.TYPE_COUNT)%>
</th>
<td>
<%=Html.QC(p => p.TYPE_COUNT)%>
</td>--%>
<th align="right">
<%=Html.QV(p => p.WORKCENTER_CODE)%>
</th>
<td>
<%=Html.QC(p => p.WORKCENTER_CODE)%>
</td>
<th align="right">
日期
</th>
<td>
<%=Html.QC(p => p.START_DATE)%>
</td>
<th align="right">
</th>
<td>
<%=Html.QC(p => p.END_DATE)%>
</td>
</tr>
</table>
<%=Html.QPEnd()%>
<%=Html.QPList() %>
<!--图表配置-->
<%=QMAPP.MESReport.Web.Controllers.EChartExampleController.QMEChartPageConfig()%>
<div style="overflow: auto; height: 99%;">
<div style="width: 100%; text-align: center;">
<%--异步获取数据生成图表--%>
<%=QMFrameWork.WebUI.QMEChart.QMEChartHelper.CreateEchart("echartID", "/QTYCompletionRateCount/GetEchartDataBar2", new string[] { "line", "bar" }
, "myEChart",400, QMFrameWork.WebUI.QMEChart.QMEChartHelper.echartEventEnum.click, "")%>
</div>
<div style="width: 100%; text-align: center;padding: 15px 0 0 0;">
<table id="maintb" class="mtbtt" style="width:90%; margin:0px auto;">
</table>
</div>
</div>
<script type="text/javascript">
function GetTable() {
$.ajax({
type: "POST",
url: "/QTYCompletionRateCount/GetTable?WORKCENTER_CODE=" + $("input[name='WORKCENTER_CODE']").val() + "&START_DATE=" + $("input[name='START_DATE']").val() + "&END_DATE=" + $("input[name='END_DATE']").val(),
dataType: "json",
data: {},
success: function (data) {
$("#maintb").html(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
//alert(errorThrown);
}
});
}
function refreshEChartbar2() {
var endtime = document.getElementById("END_DATE").value;
if (parseDate($("#START_DATE").val()) > parseDate($("#END_DATE").val()) && endtime != "") {
alert("开始时间不能大于结束时间!");
return;
}
var ps = [];
var WORKCENTER_CODE = {};
WORKCENTER_CODE.key = "WORKCENTER_CODE";
WORKCENTER_CODE.value = $("input[name='WORKCENTER_CODE']").val();
ps.push(WORKCENTER_CODE);
// var MATERIAL_CODE = {};
// MATERIAL_CODE.key = "MATERIAL_CODE";
// MATERIAL_CODE.value = $("input[name='MATERIAL_CODE']").val();
// ps.push(MATERIAL_CODE);
// var TYPE_COUNT = {};
// TYPE_COUNT.key = "TYPE_COUNT";
// TYPE_COUNT.value = $("input[name='TYPE_COUNT']").val();
// ps.push(TYPE_COUNT);
var START_DATE = {};
START_DATE.key = "START_DATE";
START_DATE.value = $("input[name='START_DATE']").val();
ps.push(START_DATE);
var END_DATE = {};
END_DATE.key = "END_DATE";
END_DATE.value = $("input[name='END_DATE']").val();
ps.push(END_DATE);
GetEchartData("/QTYCompletionRateCount/GetEchartDataBar2", myEChart, ps);
GetTable();
}
//导出图片
// function Export() {
// var img = myEChart.getDataURL("png");
// $("#hiChartImg").val(img);
// submitByButton("ExportBanCi");
// }
//导出Excel
function Export() {
var ids = document.getElementById("selectKey").value;
$.get("/QTYCompletionRateCount/ExportExcel", $("form").serializeArray(), function (data) {
submitByButton("/QTYCompletionRateCount/ExportFile?FileName=" + data);
});
}
</script>
<input id="hiChartImg" name="hiChartImg" type="hidden" />
<%=Html.QPEnd() %>
<%=Html.Hidden("selectKey")%>
<%=Html.Hidden("PID")%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<style type="text/css">
.mtbtt
{
border-collapse:collapse;
}
.mtbtt tr td
{
border: 1px solid grey;
}
.L1cos
{
width:160px;
}
</style>
<table cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<%=Html.QTButtonSearch("QTYCompletionRateCount", "QTYCompletionRateCountView", "refreshEChartbar2()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("export", "ExportBanCi", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>
</td>
</tr>
</table>
</asp:Content>

16
APPQ5/QMAPP.FJC.Web/Views/TJPaoMoPlan/TJPaoMoPlanEdit.aspx

@ -53,6 +53,22 @@
<td>
<%=Html.QC(p => p.COMPLETE_QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.REPAIR_QTY)%>
</th>
<td>
<%=Html.QC(p => p.REPAIR_QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.SCRAP_QTY)%>
</th>
<td>
<%=Html.QC(p => p.SCRAP_QTY)%>
</td>
</tr>
<tr>
<th align="right">

16
APPQ5/QMAPP.FJC.Web/Views/TJZhuSuPlan/TJZhuSuPlanEdit.aspx

@ -54,6 +54,22 @@
<%=Html.QC(p => p.COMPLETE_QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.REPAIR_QTY)%>
</th>
<td>
<%=Html.QC(p => p.REPAIR_QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.SCRAP_QTY)%>
</th>
<td>
<%=Html.QC(p => p.SCRAP_QTY)%>
</td>
</tr>
<tr>
<th align="right">
<%=Html.QV(p => p.REMARK)%>

2
APPQ5/QMAPP.WinForm/Forms/Injection/InjectionCodePrint.cs

@ -254,7 +254,7 @@ namespace QMAPP.WinForm.Forms.Injection
foreach (var la in labels)
{
var material_T = new BucketMaterialClass() { MaterialCode = la.MaterialCode };
var material_T = new BucketMaterialClass() { MaterialName = la.MaterialName };
var List = _agent.InvokeServiceFunction<List<RawMaterial>>(B9BasicService.RawMaterialBLL_GetListTo.ToString(), material_T);
if (List != null && List.Count > 0)

2
APPQ5/QMAPP.WinForm/Forms/Injection/SewingPrint.cs

@ -244,7 +244,7 @@ namespace QMAPP.WinForm.Forms.Injection
foreach (var la in labels)
{
var material_T = new BucketMaterialClass() { MaterialCode = la.MaterialCode };
var material_T = new BucketMaterialClass() { MaterialName = la.MaterialCode };
var List = _agent.InvokeServiceFunction<List<RawMaterial>>(B9BasicService.RawMaterialBLL_GetListTo.ToString(), material_T);
if (List != null && List.Count > 0)

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

@ -2178,8 +2178,10 @@ namespace QMAPP.WinForm.Forms.TianJin
{
if (dgvNF.Rows[a].Cells[CODE_NF.Name].Value.ToString().ToUpper() == tbl.Rows[i]["VIN"].ToString())
{
var sssss = dgvNF.Rows[a].Cells[CARSETDESC_CN_NF.Name].Value.ToString();
ncsdr["CARSETDESCCN"] = sssss;
var CARSETDESCCN = dgvNF.Rows[a].Cells[CARSETDESC_CN_NF.Name].Value.ToString();
var Material_code = dgvNF.Rows[a].Cells[PRODNO_NF.Name].Value.ToString();
ncsdr["CARSETDESCCN"] = CARSETDESCCN;
tbl.Rows[i]["PRODNO"] = Material_code;
}
}
@ -2563,13 +2565,14 @@ namespace QMAPP.WinForm.Forms.TianJin
{
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
CompleteStatisticsEntity model = new CompleteStatisticsEntity();
TJCompleteStatisticsEntity model = new TJCompleteStatisticsEntity();
model.MATERIALNO = MaterialCode;
model.SYSCOMPLETECOUNT = 1;
model.COMPLETECOUNT = 1;
model.STARTTIME = DateTime.Now;
model.ENDTIME = DateTime.Now;
model.ORDERNO = ORDERNO;
model.line = "770B";
var ss = agent.InvokeServiceFunction<DataResult<int>>("CompleteStatisticsBLL_Insert", model);
}

4
APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2024.07.05.01")]
[assembly: AssemblyFileVersion("2024.07.05.01")]
[assembly: AssemblyVersion("2024.07.24.01")]
[assembly: AssemblyFileVersion("2024.07.24.01")]

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

@ -1064,5 +1064,12 @@
<FullLogicClassName>QMAPP.FJC.BLL.TianJin.TJZhuSuPlanBLL</FullLogicClassName>
<AssemblyFile>QMAPP.FJC.BLL.dll</AssemblyFile>
</ServiceDefinition>
<ServiceDefinition>
<ServiceName>MonitordataBLL</ServiceName>
<ServiceDes>注塑参数</ServiceDes>
<FullLogicClassName>QMAPP.FJC.BLL.TianJin.MonitordataBLL</FullLogicClassName>
<AssemblyFile>QMAPP.FJC.BLL.dll</AssemblyFile>
</ServiceDefinition>
</BusinessDllList>

20
WebAPI/Controllers/InventoryController.cs

@ -250,6 +250,26 @@ namespace WebAPI.Controllers
$"(NEWID(), '{resObj.ProductCode}', '{resObj.Type}', '{resObj.State}', '{resObj.User}', '{DateTime.Now}');";
SqlData.InsertWare(sql_log);
if (resObj.Type == "1" && resObj.State == "3")
{
var sel3 = $"update [dbo].[T_PP_ORDERPLAN_PAOMO] set REPAIR_QTY = REPAIR_QTY + 1 where PLAN_NO = '{resObj.PlanID.Substring(0, 14)}'";
SqlData.InsertWare(sel3);
}
else if (resObj.Type == "1" && resObj.State == "4")
{
var sel3 = $"update [dbo].[T_PP_ORDERPLAN_PAOMO] set SCRAP_QTY = SCRAP_QTY + 1 where PLAN_NO = '{resObj.PlanID.Substring(0, 14)}'";
SqlData.InsertWare(sel3);
}
else if (resObj.Type == "2" && resObj.State == "3")
{
var sel3 = $"update [dbo].[T_PP_ORDERPLAN_ZHUSU] set REPAIR_QTY = REPAIR_QTY + 1 where PLAN_NO = '{resObj.PlanID.Substring(0, 14)}'";
SqlData.InsertWare(sel3);
}
else if (resObj.Type == "2" && resObj.State == "4")
{
var sel3 = $"update [dbo].[T_PP_ORDERPLAN_ZHUSU] set SCRAP_QTY = SCRAP_QTY + 1 where PLAN_NO = '{resObj.PlanID.Substring(0, 14)}'";
SqlData.InsertWare(sel3);
}
}
else
{

76
WebAPI/Controllers/MachineClassController.cs

@ -245,40 +245,64 @@ namespace WebAPI.Controllers
var list_MachineClass = new List<MachineClass>();
if (dataSet.Tables[0].Rows.Count > 0)
{
foreach (DataRow R in dataSet.Tables[0].Rows)
if (sql_selectSetValue.Tables[0].Rows.Count > 0)
{
var t = new MachineClass();
t.PID = R["PID"].ToString();
t.MachineCode = R["MachineCode"].ToString();
t.Name = R["Name"].ToString();
t.Position = R["Position"].ToString();
t.Content = R["Content"].ToString();
t.Methond = R["Methond"].ToString();
t.Type = R["Type"].ToString();
t.SerialNumber = R["SerialNumber"].ToString();
var m = list_PutMachine.Where(p => p.MachinePID == t.PID).OrderBy(o => o.SerialNumber).ToList();
t.putMachine = m;
if (sql_selectSetValue.Tables[0].Rows.Count > 0)
{
t.SelectName = sql_selectSetValue.Tables[0].Rows[0]["HoldEndPos"].ToString();
t.SelectValue = sql_selectSetValue.Tables[0].Rows[0]["HoldEndPos"].ToString();
}
else
foreach (DataRow R in dataSet.Tables[0].Rows)
{
t.SelectName = "0";
t.SelectValue = "0";
var t = new MachineClass();
t.PID = R["PID"].ToString();
t.MachineCode = R["MachineCode"].ToString();
t.Name = R["Name"].ToString();
t.Position = R["Position"].ToString();
t.Content = R["Content"].ToString();
t.Methond = R["Methond"].ToString();
t.Type = R["Type"].ToString();
t.SerialNumber = R["SerialNumber"].ToString();
var m = list_PutMachine.Where(p => p.MachinePID == t.PID).OrderBy(o => o.SerialNumber).ToList();
t.putMachine = m;
if (sql_selectSetValue.Tables[0].Rows.Count > 0)
{
if (R["SerialNumber"].ToString() == "1")
{
//注塑开始位置
t.SelectName = sql_selectSetValue.Tables[0].Rows[0]["InjectStartPos"].ToString();
t.SelectValue = sql_selectSetValue.Tables[0].Rows[0]["InjectStartPos"].ToString();
}
else if (R["SerialNumber"].ToString() == "2")
{
//保压结束位置
t.SelectName = sql_selectSetValue.Tables[0].Rows[0]["HoldEndPos"].ToString();
t.SelectValue = sql_selectSetValue.Tables[0].Rows[0]["HoldEndPos"].ToString();
}
else if (R["SerialNumber"].ToString() == "3")
{
//储料完成位置
t.SelectName = sql_selectSetValue.Tables[0].Rows[0]["ChargeEndPos"].ToString();
t.SelectValue = sql_selectSetValue.Tables[0].Rows[0]["ChargeEndPos"].ToString();
}
}
else
{
t.SelectName = "0";
t.SelectValue = "0";
}
list_MachineClass.Add(t);
}
list_MachineClass.Add(t);
result.Result = list_MachineClass;
}
else
{
result.Code = 202;
result.Message = "产品信息不存在";
}
result.Result = list_MachineClass;
}
else
{
result.Code = 201;
result.Message = "设备信息不存在";
}
return result;

2
WebAPI/Controllers/WareController.cs

@ -59,7 +59,7 @@ namespace WebAPI.Controllers
var resObj = JsonHelper.Instance.JsonToObj<ReceiveWare>(requeststr);
var sql = $"INSERT INTO [dbo].[T_MD_RawMaterialPaomo] ([PID], [planNumber], [materialName], [materialCode], [materialQty], [UserName], [CreateTime], [Remark1], [Remark2], [Remark3]) VALUES" +
$" (N'{Guid.NewGuid()}', N'{resObj.planNumber.Substring(0, 14)}', N'{resObj.materialName}', N'{resObj.materialCode}', N'{resObj.materialQty}', N'{resObj.id}', '{DateTime.Now}', NULL, NULL, NULL);";
$" (N'{Guid.NewGuid()}', NULL, N'{resObj.materialName}', N'{resObj.materialCode}', N'{resObj.materialQty}', N'{resObj.id}', '{DateTime.Now}', NULL, NULL, NULL);";
SqlData.InsertWare(sql);

Loading…
Cancel
Save