Browse Source

增加门板计划发布到总成工位

master
songnan.zhang 3 years ago
parent
commit
9d518d68fa
  1. 44
      APPMD/QMAPP.MD.DAL/WorkCellDAL.cs
  2. 118
      APPQ5/QMAPP.FJC.BLL/FIS/DashBoardPlanBLL.cs
  3. 1
      APPQ5/QMAPP.FJC.Web/Content/Xml/Dictionary.xml
  4. 23
      APPQ5/QMAPP.FJC.Web/Controllers/DashBoardPlanController.cs
  5. 2
      APPQ5/QMAPP.FJC.Web/Views/DashBoardPlan/DashBoardPlanEdit.aspx
  6. 15
      APPQ5/QMAPP.FJC.Web/Views/DashBoardPlan/DashBoardPlanList.aspx

44
APPMD/QMAPP.MD.DAL/WorkCellDAL.cs

@ -830,7 +830,51 @@ namespace QMAPP.MD.DAL
#endregion
public List<ProcessRouteWorkCellSeq> GetEndWorkCell(string pbomcode)
{
List<ProcessRouteWorkCellSeq> list = new List<ProcessRouteWorkCellSeq>();
if (string.IsNullOrEmpty(pbomcode))
{
return list;
}
string sql = string.Format(@"SELECT seq.* FROM T_MD_PBOM pm,T_MD_MATERIAL_ROUTE mr,T_MD_PROCESS_ROUTE_WORKCELL rw,T_MD_PROCESS_ROUTE_WORKCELL_SEQ seq
where pm.PBOM_CODE='{0}' and pm.MATERIAL_CODE=mr.MATERIAL_CODE
and mr.ROUTE_CODE=rw.ROUTE_CODE and rw.WORKCELL_CODE=seq.WORKCELL_CODE", pbomcode);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
list = session.GetList<ProcessRouteWorkCellSeq>(sql, new List<DataParameter>().ToArray()).ToList<ProcessRouteWorkCellSeq>();
}
if (list != null && list.Count >0)
{
List<ProcessRouteWorkCellSeq> list2 = new List<ProcessRouteWorkCellSeq>();
var list3 = list.Where(u => u.PRE_WORKCELL_CODE == null || u.PRE_WORKCELL_CODE == "").ToList();
var t = list3[0];
list.Remove(t);
var endlist = GetEndCellPID(list, t.WORKCELL_CODE);
list2.Add(endlist);
return list2;
}
return list;
}
public ProcessRouteWorkCellSeq GetEndCellPID(List<ProcessRouteWorkCellSeq> processRouteWorkCellSeqs, string PRE_WORKCELL_CODE)
{
if (processRouteWorkCellSeqs.Count == 1)
return processRouteWorkCellSeqs[0];
foreach (var SEQ in processRouteWorkCellSeqs)
{
if (SEQ.PRE_WORKCELL_CODE == PRE_WORKCELL_CODE)
{
processRouteWorkCellSeqs.Remove(SEQ);
return GetEndCellPID(processRouteWorkCellSeqs, SEQ.WORKCELL_CODE);
}
}
return null;
}
}
}

118
APPQ5/QMAPP.FJC.BLL/FIS/DashBoardPlanBLL.cs

@ -594,6 +594,124 @@ namespace QMAPP.FJC.BLL.FIS
return workOrderDt;
}
/// <summary>
/// 发布信息--直接发布到最后一个工位
/// </summary>
/// <param name=""></param>
/// <returns>发布个数</returns>
public DataResult<int> PutOutEndWorkCell(string strs)
{
string[] list = strs.Split(":".ToCharArray());
DataResult<int> result = new DataResult<int>();
try
{
OrderPlanDAL orderPlandal = new OrderPlanDAL();
List<OrderPlan> validorderPlanList = new List<OrderPlan>();
List<OrderPlan> putOutPlanList = new List<OrderPlan>();
foreach (string str in list)
{
OrderPlan op = orderPlandal.Get(new OrderPlan { PID = str });
if (op.PLAN_STATE != EnumGeter.PLANSTATE.INIT.GetHashCode().ToString())
{
validorderPlanList.Add(op);
}
putOutPlanList.Add(op);
}
if (validorderPlanList.Count > 0)
{
result.IsSuccess = false;
result.Msg = "只有初始状态下的订单能够进行发布!";
return result;
}
DataTable totalDt = GetWorkOrderTable();
foreach (var op in putOutPlanList)
{
op.PLAN_STATE = EnumGeter.PLANSTATE.COMMIT.GetHashCode().ToString();
op.UPDATEUSER = this.LoginUser.UserID;
totalDt = this.PutOutOrderPlanEndWorkCell(op, totalDt);
}
using (IDataSession session = AppDataFactory.CreateMainSession())
{
IDbConnection dbConn = DbManager.MainConnectionInfo.Connection;
IDbTransaction ids = dbConn.BeginTransaction();
orderPlandal.BaseSession = session;
foreach (var op in putOutPlanList)
{
orderPlandal.Update(op);
}
session.DbHelper.BulkCopyData(totalDt, "T_PP_WORKORDER", dbConn, ids);
ids.Commit();
}
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 发布信息--直接发布到最后一个工位
/// </summary>
/// <param name="">信息</param>
/// <returns>发布个数</returns>
public DataTable PutOutOrderPlanEndWorkCell(OrderPlan info, DataTable workOrderDt)
{
WorkCellDAL workCelldal = new WorkCellDAL();
string pbomcode = info.PBOM_CODE;
List<QMAPP.MD.Entity.ProcessRouteWorkCellSeq> list = workCelldal.GetEndWorkCell(pbomcode);
var dicPRI = new DictManageBLL(Dict.DictKind.ORDERPRI);
//注入派工单信息
for (int i = 0; i < info.QTY; i++)
{
foreach (var seq in list)
{
DataRow workOrder = workOrderDt.NewRow();
workOrder["PID"] = Guid.NewGuid().ToString();
workOrder["ORDERPLANID"] = info.PID;
workOrder["ORDERPLAN_NO"] = (info.PLAN_NO.ToString() + (i + 1).ToString().PadLeft(4, '0'));
workOrder["ORDER_TYPE"] = info.PLANSOURCE;
workOrder["SEQ"] = (i + 1).ToString().PadLeft(6, '0');
workOrder["MATERIAL_CODE"] = info.MATERIAL_CODE;
workOrder["PBOM_CODE"] = info.PBOM_CODE;
workOrder["QTY"] = 1;
workOrder["COMPLETE_QTY"] = 0;
workOrder["PLAN_DATE"] = info.PLAN_DATE;
workOrder["SHIFT_CODE"] = info.SHIFT_CODE;
workOrder["WORKCENTER_CODE"] = info.WORKCENTER_CODE;
workOrder["WORKCELL_CODE"] = seq.WORKCELL_CODE;
workOrder["WORKLOC_CODE"] = "";
workOrder["REMARK"] = "";
workOrder["EQPT_NAME"] = "";
workOrder["EQPT_CODE"] = "";
workOrder["STATE"] = EnumGeter.WORKPLANSTATE.INIT.GetHashCode().ToString();
workOrder["PRI"] = dicPRI.GetDictValue(info.PLANSOURCE);
workOrderDt.Rows.Add(workOrder);
}
}
return workOrderDt;
}
public List<WorkOrder> PutOutOrderPlan(OrderPlan info,int number,int lastIndex)
{
List<WorkOrder> wolist = new List<WorkOrder>();

1
APPQ5/QMAPP.FJC.Web/Content/Xml/Dictionary.xml

@ -562,5 +562,6 @@
<Button key="Enable" value="启用"/>
<Button key="Disable" value="禁用"/>
<Button key="Statistics" value="统计"/>
<Button key="PublishEndWorkCell" value="发布到总成工位" />
</Buttons>
</Config>

23
APPQ5/QMAPP.FJC.Web/Controllers/DashBoardPlanController.cs

@ -245,6 +245,29 @@ namespace QMAPP.FJC.Web.Controllers
}
#endregion
#region 发布
/// <summary>
/// 发布
/// </summary>
/// <returns></returns>
[HttpPost]
[HandleException]
public ActionResult PutOutEndWorkCell(OrderPlan model)
{
string selectKey = Request.Form["selectKey"];
ServiceAgent wcfAgent = this.GetServiceAgent();
DataResult<int> result = new DataResult<int>();
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("DashBoardPlanBLL_PutOutEndWorkCell", selectKey);
if (result.IsSuccess == false)
{
SetMessage(result.Msg);
return List(true);
}
SetMessage(AppResource.PutOutMessage);
return List(true);
}
#endregion
#region 导出excel
/// <summary>
/// 导出excel

2
APPQ5/QMAPP.FJC.Web/Views/DashBoardPlan/DashBoardPlanEdit.aspx

@ -196,7 +196,7 @@
var type = document.getElementById("ORDER_TYPE").value;
//获取物料下拉数据源
$('#MATERIAL_CODE').combotree({
url: "/Dict/GetFisMaterialTree?ordertype=" + type,
url: "/Dict/GetFisMaterialTree?ordertype=DOORPLANK" ,
panelHeight: '250',
panelWidth: '500',
});

15
APPQ5/QMAPP.FJC.Web/Views/DashBoardPlan/DashBoardPlanList.aspx

@ -142,6 +142,20 @@
}
}
//发布
function PublishEndWorkCell() {
var ids = getSelectKey();
if (ids == "") {
MSI("错误", "至少选择一条记录");
}
else {
document.getElementById("selectKey").value = ids;
MSQ("提示", "确定要发布选中的记录吗?", function () {
submitByButton("PutOutEndWorkCell");
})
}
}
//修改计划顺序
function EditDashBoardPlanSeq() {
var ids = getSelectKey();
@ -174,6 +188,7 @@
<%=Html.QTButton("EditSeq", "EditDashBoardPlanSeq", QMFrameWork.WebUI.IconCls.edit, "EditDashBoardPlanSeq()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButtonDelete("DashBoardPlan", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("publish", "PutOut", "detail", "Publish()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("PublishEndWorkCell", "PutOut", "detail", "PublishEndWorkCell()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("import", "ImportExcel", QMFrameWork.WebUI.IconCls.undo, "Import()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>
<%=Html.QTButton("template", "TemplateExcel", QMFrameWork.WebUI.IconCls.template, "getTemplate()", QMAPP.Common.Web.SystemLimit.isLimt)%>

Loading…
Cancel
Save