96 lines
3.3 KiB
C#
96 lines
3.3 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Kingdee.BOS;
|
|
using Kingdee.BOS.Core.Bill.PlugIn;
|
|
using Kingdee.BOS.Core.Bill.PlugIn.Args;
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
|
using Kingdee.BOS.Core.Metadata;
|
|
using Kingdee.BOS.Core.Metadata.EntityElement;
|
|
using Kingdee.BOS.Core.SqlBuilder;
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|
using Kingdee.BOS.ServiceHelper;
|
|
using Kingdee.BOS.Util;
|
|
using Kingdee.BOS.Core.DynamicForm;
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
|
using Kingdee.BOS.Core.List.PlugIn;
|
|
|
|
namespace aoyuPlugIn
|
|
{
|
|
[Description("装配录入列表反写已生产数")]
|
|
public class zp_plyg_LB : AbstractListPlugIn
|
|
{
|
|
//列表菜单事件
|
|
public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
|
|
{
|
|
//base.AfterBarItemClick(e);
|
|
|
|
//if (e.BarItemKey == "tbSplitApprove" || e.BarItemKey == "tbApprove")//审核
|
|
//{
|
|
|
|
// fxjdb("1");
|
|
|
|
//}
|
|
//else if (e.BarItemKey == "tbReject")//反审核
|
|
//{
|
|
|
|
// fxjdb("0");
|
|
//}
|
|
}
|
|
//反写已生产数据
|
|
void fxjdb(string issh)
|
|
{
|
|
try
|
|
{
|
|
//string fbillno = "";
|
|
if (this.ListView.SelectedRowsInfo.Count > 0)
|
|
{
|
|
for (int i = 0; i < this.ListView.SelectedRowsInfo.Count; i++)
|
|
{
|
|
//取指定行单据编号
|
|
string fbillno = this.ListView.SelectedRowsInfo[i].BillNo;
|
|
string zt = this.ListView.SelectedRowsInfo[i].DataRow["FDOCUMENTSTATUS"].ToString();
|
|
if (issh == "1")
|
|
{
|
|
if (zt == "D" || zt == "B")
|
|
{
|
|
fx_yscs(fbillno, issh);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (zt == "C")
|
|
{
|
|
fx_yscs(fbillno, issh);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex) { this.View.ShowMessage("反写已生产数时发生错误为:" + ex.Message); }
|
|
}
|
|
void fx_yscs( string fbillno,string sh)
|
|
{
|
|
//string fbillno = this.View.Model.GetValue("FBillNo").ToString();
|
|
var sSql = String.Format("EXEC hw_zplr_fx_scdd " + fbillno + "," + sh);
|
|
var dr = DBServiceHelper.ExecuteDynamicObject(this.Context, sSql);
|
|
string t = "生产数量大于订单数量,不能审核!";
|
|
|
|
if (dr.Count > 0)
|
|
{
|
|
foreach (var item in dr)
|
|
{
|
|
string k = "生产订单:" + item["rwdNo"].ToString() + "|工序编号:" + item["gxNo"].ToString()
|
|
+ "|订单数:" + item["dds"].ToString() + "|已生产数:" + item["yscs"].ToString();
|
|
t = t + "\r\n" + k;
|
|
}
|
|
this.View.ShowMessage(t);
|
|
}
|
|
}
|
|
}
|
|
}
|