|
|
@@ -118,10 +118,25 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
cdStepCode = dtStep.Rows[0]["cd_stepcode"].ToString();
|
|
|
|
|
|
- //三、检查 makeserial.ms_nextstepcode 到本次查到的工序之间是否存在未跳站的中间工序
|
|
|
- // cd_detno 落在两者之间 nvl(cd_ifjump,0)=0 的记录即为必须完成却未完成的工序
|
|
|
+ //三、工序顺序校验:本次工序不得回退到 ms_nextstepcode 之前,且两者之间不得夹有未完成的非跳站工序
|
|
|
if (nextStepCode != "")
|
|
|
{
|
|
|
+ //三-1、本次工序的 cd_detno 若小于 ms_nextstepcode 对应的 cd_detno(即想跳回已过的工序),不允许更新
|
|
|
+ DataTable dtBack = (DataTable)dh.ExecuteSql("select 1 from craftdetail a where cd_crid=(select cr_id from craft where cr_code='" + craftCode + "' and cr_prodcode='" + prodCode + "')"
|
|
|
+ + " and cd_stepcode='" + cdStepCode + "' and rownum=1"
|
|
|
+ + " and cd_detno<(select b.cd_detno from craftdetail b where b.cd_crid=a.cd_crid and b.cd_stepcode='" + nextStepCode + "' and rownum=1)", "select");
|
|
|
+ if (dtBack.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ DataTable dtNextNameBack = (DataTable)dh.ExecuteSql("select st_name from step where st_code='" + nextStepCode + "'", "select");
|
|
|
+ string nextStepNameBack = dtNextNameBack.Rows.Count > 0 ? dtNextNameBack.Rows[0]["st_name"].ToString() : "";
|
|
|
+ OperateResult.AppendText("<<" + sn + "下一工序是" + nextStepCode + "(" + nextStepNameBack + ")\n", Color.Red, sncode);
|
|
|
+ sncode.Clear();
|
|
|
+ sncode.Focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //三-2、检查 makeserial.ms_nextstepcode 到本次查到的工序之间是否存在未跳站的中间工序
|
|
|
+ // cd_detno 落在两者之间 nvl(cd_ifjump,0)=0 的记录即为必须完成却未完成的工序
|
|
|
DataTable dtJump = (DataTable)dh.ExecuteSql("select a.cd_detno,a.cd_stepcode from craftdetail a where a.cd_crid=(select cr_id from craft where cr_code='" + craftCode + "' and cr_prodcode='" + prodCode + "')"
|
|
|
+ " and a.cd_detno>(select b.cd_detno from craftdetail b where b.cd_crid=a.cd_crid and b.cd_stepcode='" + nextStepCode + "' and rownum=1)"
|
|
|
+ " and a.cd_detno<(select c.cd_detno from craftdetail c where c.cd_crid=a.cd_crid and c.cd_stepcode='" + cdStepCode + "' and rownum=1)"
|