| | |
| | | FBILLNO = _dt.Rows[0]["FBILLNO"].ToString(); |
| | | FMoFBillType = _dt.Rows[0]["FMoFBillType"].ToString(); |
| | | } |
| | | //物料编码 + 生产订单号 + 生产资源 + 生产订单行号 去判断是否导入过 带出日计划工单ID及编号 |
| | | //物料编码 + 生产订单号 + 生产资源 + 生产订单行号 去判断是否导入过 带出日计划工单ID及编号 和 关闭数量(6.18更) |
| | | string fDayPlanID = ""; |
| | | string fDayPlanBillNo = ""; |
| | | sql = string.Format(@"select a.FID,FBILLNO,FSCOrderNo,FHMaterID,FHSourceID from Sc_WorkBillSortBillMain a JOIN T_BD_MATERIAL b ON a.FHMaterID = b.FMATERIALID |
| | | string fCloseCount = ""; |
| | | sql = string.Format(@"select a.FID,FBILLNO,FSCOrderNo,FHMaterID,FHSourceID,a.FCloseCount from Sc_WorkBillSortBillMain a JOIN T_BD_MATERIAL b ON a.FHMaterID = b.FMATERIALID |
| | | left join T_ENG_WORKCENTER c on a.FHSourceID=c.fid |
| | | where FSCOrderNo ='{0}' and b.FNUMBER ='{1}' and a.FSRCBILLENTRYSEQ ='{3}' and (isnull(c.FNUMBER,'') ='{2}' or (select count(*) from T_ENG_WORKCENTER where isnull(c.FNUMBER,'') ='{2}')=0)", dt.Rows[i][1].ToString(), dt.Rows[i][5].ToString(), dt.Rows[i][4].ToString(), dt.Rows[i][2].ToString()); |
| | | DataTable dayPlanDt = DBServiceHelper.ExecuteDataSet(Context, sql).Tables[0]; |
| | |
| | | { |
| | | fDayPlanID = dayPlanDt.Rows[0]["FID"].ToString(); |
| | | fDayPlanBillNo = dayPlanDt.Rows[0]["FBILLNO"].ToString(); |
| | | fCloseCount = dayPlanDt.Rows[0]["FCloseCount"].ToString(); |
| | | } |
| | | //DynamicObject row = new DynamicObject(entity.DynamicObjectType); |
| | | this.Model.CreateNewEntryRow("FEntity"); |
| | |
| | | this.Model.SetValue("FDayPlanID", fDayPlanID, i);//日计划工单ID |
| | | this.Model.SetValue("FDayPlanBillNo", fDayPlanBillNo, i);//日工单编号 |
| | | this.Model.SetValue("FSRCBILLENTRYSEQ", dt.Rows[i][2].ToString(), i);//生产订单明细行号 |
| | | this.Model.SetValue("FCloseCount", fCloseCount, i);//关闭数量 |
| | | for (int j = 0; j <= 60; j++) |
| | | { |
| | | this.Model.SetValue("FT" + "" + j + "", dt.Rows[i][15 + j].ToString(), i); |
| | |
| | | } |
| | | foreach (DynamicObject current in entityDataObjoct) |
| | | { |
| | | if (Convert.ToInt32(current["FNoScheduled"]) < 0) |
| | | _result += "序号:" + Convert.ToString(current["SEQ"]) + ",日计划总数量超出生产订单数量"; |
| | | //未排数量= 总数 - 日计划 超出日计划为负 + 关闭数量 < 0 表示超出了总计划数量 |
| | | if (Convert.ToInt32(current["FNoScheduled"]) + Convert.ToInt32(current["FCloseCount"]) < 0) |
| | | _result += "序号:" + Convert.ToString(current["SEQ"]) + ",日计划总数量超出生产订单数量+关闭数量"; |
| | | } |
| | | if (_result != "") |
| | | { |