VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -505,10 +505,11 @@
                    }
                }
                //判断工艺路线对应工序关联的工作站是否有设置节拍工价
                sql = @"select AA.step_code,AA.eqp_code,S.unprice  from (
                        select A.code,B.step_code,C.eqp_code from TFlw_Rout A
                sql = @"select AA.step_code,AA.eqp_code,AA.flwtype,S.unprice  from (
                        select A.code,B.step_code,C.eqp_code,S.flwtype from TFlw_Rout A
                        inner join TFlw_Rtdt B on A.code=B.rout_code
                        left join TFlw_Rteqp C on B.step_code=C.step_code
                        left join TStep S on B.step_code=S.stepcode
                        where A.code=@route_code
                        ) as AA
                        left join (select * from TPrteEqp_Stad   where materiel_code=@partcode and route_code=@route_code) as S on
@@ -518,13 +519,16 @@
                var dtc = DapperHelper.selectdata(sql, dynamicParams);
                for (int i = 0; i < dtc.Rows.Count; i++)
                {
                    if (dtc.Rows[i].IsNull("unprice") || decimal.Parse(dtc.Rows[i]["unprice"].ToString()) == 0)
                    if (dtc.Rows[i]["flwtype"].ToString() == "Z") //判断工序是否为自制
                    {
                        mes.code = "300";
                        mes.count = 0;
                        mes.Message = "节拍工价中:当前产品【" + partcode + "】,对应工艺路线【" + routecode + "】未设置(或未设置全)或工价小于等于0!";
                        mes.data = null;
                        return mes;
                        if (dtc.Rows[i].IsNull("unprice") || decimal.Parse(dtc.Rows[i]["unprice"].ToString()) == 0)
                        {
                            mes.code = "300";
                            mes.count = 0;
                            mes.Message = "节拍工价中:当前产品【" + partcode + "】,对应工艺路线【" + routecode + "】未设置(或未设置全)或工价小于等于0!";
                            mes.data = null;
                            return mes;
                        }
                    }
                }
            }
@@ -597,6 +601,25 @@
                            CreateDate = DateTime.Now.ToString()
                        }
                    });
                    //写入工单工艺路线工序工价复制表
                    sql = @"insert into TWoPrteEqp_Stad(wo,materiel_code,eqp_code,stand_value,opc_conver,route_code,unprice,eqp_value,cavity_qty,wkspcode,lm_user,lm_date,torg_code,is_delete,step_code)
                           select distinct @mesordercode as wo,S.materiel_code,S.eqp_code,S.stand_value,S.opc_conver,S.route_code,S.unprice,
                           S.eqp_value,S.cavity_qty,S.wkspcode,S.lm_user,S.lm_date,S.torg_code,S.is_delete,S.step_code
                           from TFlw_Rtdt A
                           inner join TFlw_Rteqp C on A.step_code=C.step_code
                           inner join (select *   from TPrteEqp_Stad  where materiel_code=@materiel_code and route_code=@routecode) as S on C.step_code=S.step_code and C.eqp_code=S.eqp_code";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            mesordercode = mesordercode,
                            materiel_code = partcode,
                            routecode = routecode
                        }
                    });
                    //if (is_aps == "Y")  //是否排程
                    //{
                    //    string sql1 = "select id from TBom_Main  where materiel_code='" + PartNumber + "' and status='Y' and version='" + VsionId + "'";
@@ -664,6 +687,35 @@
                            CreateDate = DateTime.Now.ToString()
                        }
                    });
                    //删除工单工艺路线工序工价复制表
                    sql = @"delete TWoPrteEqp_Stad where wo=@mesordercode";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            mesordercode = mesordercode
                        }
                    });
                    //写入工单工艺路线工序工价复制表
                    sql = @"insert into TWoPrteEqp_Stad(wo,materiel_code,eqp_code,stand_value,opc_conver,route_code,unprice,eqp_value,cavity_qty,wkspcode,lm_user,lm_date,torg_code,is_delete,step_code)
                           select distinct @mesordercode as wo,S.materiel_code,S.eqp_code,S.stand_value,S.opc_conver,S.route_code,S.unprice,
                           S.eqp_value,S.cavity_qty,S.wkspcode,S.lm_user,S.lm_date,S.torg_code,S.is_delete,S.step_code
                           from TFlw_Rtdt A
                           inner join TFlw_Rteqp C on A.step_code=C.step_code
                           inner join (select *   from TPrteEqp_Stad  where materiel_code=@materiel_code and route_code=@routecode) as S on C.step_code=S.step_code and C.eqp_code=S.eqp_code";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            mesordercode = mesordercode,
                            materiel_code = partcode,
                            routecode = routecode
                        }
                    });
                    bool aa = DapperHelper.DoTransaction(list);
                    if (aa)
                    {