| | |
| | | lm_date = DateTime.Now.ToString() |
| | | } |
| | | }); |
| | | //当前产品工艺路线对应工序是否已设置节拍工价 |
| | | sql = @"select * from TPrteEqp_Stad where materiel_code=@partcode and route_code=@routecode"; |
| | | dynamicParams.Add("@partcode", json[0].partcode); |
| | | dynamicParams.Add("@routecode", json[0].children[i].code); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count<=0) |
| | | { |
| | | //清除节拍工价表对应数据 |
| | | sql = @"delete TPrteEqp_Stad where materiel_code=@partcode and route_code=@routecode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, routecode=json[0].children[i].code } }); |
| | | } |
| | | } |
| | | //标记物料表关联工艺路线标识 |
| | | sql = @"update TMateriel_Info set is_retdproc='Y',default_route=@defaultroute_code where partcode=@partcode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, defaultroute_code = json[0].defaultroute_code } }); |
| | | |
| | | |
| | | //清除节拍工价表当前产品对应工艺路线不包含此次设置的其它数据 |
| | | //string分割转string[] |
| | | string[] routcode = Array.ConvertAll<string, string>(string.Join(",", json[0].children.Select(s => s.code)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); |
| | | sql = @"delete TPrteEqp_Stad where materiel_code=@partcode and route_code not in @routecode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, routecode= routcode } }); |
| | | } |
| | | } |
| | | else //工序版 |
| | |
| | | lm_date = DateTime.Now.ToString() |
| | | } |
| | | }); |
| | | //当前产品对应工序是否已设置节拍工价 |
| | | sql = @"select * from TPrteEqp_Stad where materiel_code=@partcode and step_code=@stepcode"; |
| | | dynamicParams.Add("@partcode", json[0].partcode); |
| | | dynamicParams.Add("@stepcode", json[0].children[i].code); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count <= 0) |
| | | { |
| | | //清除节拍工价表对应数据 |
| | | sql = @"delete TPrteEqp_Stad where materiel_code=@partcode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, routecode = json[0].children[i].code } }); |
| | | } |
| | | } |
| | | //标记物料表关联工艺路线标识 |
| | | sql = @"update TMateriel_Info set is_retdproc='Y',default_route=@defaultroute_code where partcode=@partcode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, defaultroute_code = json[0].defaultroute_code } }); |
| | | //清除节拍工价表对应数据 |
| | | |
| | | //清除节拍工价表当前产品对应工序不包含此次设置的其它数据 |
| | | //string分割转string[] |
| | | string[] stepcode = Array.ConvertAll<string, string>(string.Join(",", json[0].children.Select(s => s.code)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); |
| | | sql = @"delete TPrteEqp_Stad where materiel_code=@partcode and step_code not in @stepcode"; |
| | | list.Add(new { str = sql, parm = new { partcode = json[0].partcode, stepcode = stepcode } }); |
| | | } |
| | | } |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | |
| | | //获取物料数据 |
| | | sql = @"select M.partcode,M.partname,M.partspec,M.idunit as uom_code,T.name as uom_name, |
| | | M.idunitgroup as stocktype_code,D.name as stocktype_name, |
| | | M.idwarehouse as stck_code,S.name as stck_name |
| | | M.idwarehouse as stck_code,S.name as stck_name,M.default_route |
| | | from TMateriel_Info M |
| | | left join TUnit T on M.idunit=T.code |
| | | left join TUnitGroup D on M.idunitgroup=D.code |