| | |
| | | } |
| | | if (operType == "Update") |
| | | { |
| | | var sql = @"update TMateriel_Type set partname=@materialname,partspec=@materialspec,uom_code=@uomcode,materieltype_code=@materialtypecode,stck_code=@warehousecode, |
| | | var sql = @"update TMateriel_Info set partname=@materialname,partspec=@materialspec,uom_code=@uomcode,materieltype_code=@materialtypecode,stck_code=@warehousecode, |
| | | maxqty=@maxstockqty,minqty=@minstockqty,lm_user=@username,lm_date=@CreateDate where id=@materialid"; |
| | | dynamicParams.Add("@materialid", materialid); |
| | | dynamicParams.Add("@materialname", materialname); |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select code,name,description,enable,lm_user,lm_date |
| | | var sql = @"select id,code,name,description,enable,lm_user,lm_date |
| | | from TFlw_Rout |
| | | where is_delete<>'1' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | |
| | | is_laststep = "Y"; |
| | | } |
| | | //新增工艺路线关联工序表 |
| | | sql = @"insert TFlw_Rtdt (rout_code,seq,step_code,first_choke,last_choke,lm_user,lm_date) values()"; |
| | | sql = @"insert TFlw_Rtdt (rout_code,seq,step_code,first_choke,last_choke,lm_user,lm_date) values(@rout_code,@seq,@step_code,@first_choke,@last_choke,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { rout_code = json.code, seq = Convert.ToInt32(json.Data.Rows[i]["SEQ"].ToString()), step_code = json.Data.Rows[i]["STEPCODE"].ToString(), first_choke = is_firststep, last_choke = is_laststep, lm_user = username, lm_date = DateTime.Now.ToString() } }); |
| | | } |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | |
| | | |
| | | |
| | | |
| | | #region[工艺路线下拉查询接口] |
| | | public static ToMessage RouteSearch() |
| | | #region[工序下拉查询接口] |
| | | public static ToMessage StepSelect() |
| | | { |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //获取工艺路线数据 |
| | | sql = @"select code,name from TFlw_Rout where is_delete<>'1' "; |
| | | //获取工序数据 |
| | | sql = @"select stepcode,stepname from TStep where is_delete<>'1' "; |
| | | var data = DapperHelper.selecttable(sql); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select stepcode,stepname,flwtype,enable,descr,lm_user,lm_date,is_eqp,is_defect |
| | | var sql = @"select id,stepcode,stepname,flwtype,enable,descr,lm_user,lm_date,is_eqp,is_defect |
| | | from TStep |
| | | where is_delete<>'1' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | |
| | | } |
| | | |
| | | //删除设备节拍工价表 |
| | | sql = @"delete TPrteEqp_Stad where stepcode=@stepcode"; |
| | | sql = @"delete TPrteEqp_Stad where step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | //删除工序关联工作站表 |
| | | sql = @"delete TFlw_Rteqp where step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | //删除缺陷关联工序表 |
| | | sql = @"update TDefect_Step where step_code=@stepcode"; |
| | | sql = @"delete TDefect_Step where step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | //删除工序 |
| | | sql = @"update TStep set is_delete='1' where partcode=@stepcode"; |
| | | sql = @"update TStep set is_delete='1' where stepcode=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | |
| | | select distinct A.eqp_code,B.btype from TFlw_Rteqp A |
| | | inner join TCustomer B on A.eqp_code=B.code |
| | | where A.step_code=@stepcode and A.is_delete<>'1' and B.is_delete<>'1' |
| | | ) B on T.code=B.eqp_code where T.btype='WX' and T.is_delete<>'1'"; |
| | | ) B on T.btype=B.btype where T.btype='WX' and T.is_delete<>'1'"; |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | for (int i = 0; i < data.Rows.Count; i++) |
| | |
| | | left join( |
| | | select distinct A.eqp_code from TFlw_Rteqp A |
| | | inner join TEqpInfo B on A.eqp_code=B.code |
| | | where B.wksp_code='W001' and A.is_delete<>'1' and B.is_delete<>'1' |
| | | ) B on A.code=B.eqp_code and A.is_delete<>'1'"; |
| | | where A.step_code=@stepcode and A.is_delete<>'1' and B.is_delete<>'1' |
| | | ) B on A.code=B.eqp_code where A.wksp_code=@wkspcode and A.is_delete<>'1'"; |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | dynamicParams.Add("@wkspcode", data.Rows[i]["WKSP_CODE"].ToString()); |
| | | var data0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | for (int j = 0; j < data0.Rows.Count; j++) |
| | | { |
| | |
| | | sql = @"delete TFlw_Rteqp where step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | //标记工序表关联工作站标识 |
| | | sql = @"update TStep is_eqp='N' where stepcode=@stepcode"; |
| | | sql = @"update TStep set is_eqp='N' where stepcode=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | } |
| | | else |
| | |
| | | //获取工序关联缺陷数据(包含关联标识) |
| | | sql = @"select A.code,A.name,(case when B.defect_code is null then 'N' else 'Y' end) flag from TDefect A |
| | | left join( |
| | | select distinct defect_code from TDefect_Step where step_code='' and is_delete<>'1' |
| | | select distinct defect_code from TDefect_Step where step_code=@stepcode and is_delete<>'1' |
| | | ) B on A.code=B.defect_code"; |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | |
| | | sql = @"delete TDefect_Step where step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | //标记工序表关联工作站标识 |
| | | sql = @"update TStep is_defect='N' where stepcode=@stepcode"; |
| | | sql = @"update TStep set is_defect='N' where stepcode=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { stepcode = stepcode } }); |
| | | } |
| | | else |
| | |
| | | { |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select C.partcode,C.partname,B.wksp_code,T.org_name as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice |
| | | var sql = @"select B.code as eqpcode,B.name as eqpname,B.wksp_code,T.org_name as wksp_name,A.eqp_value,A.stand_value,A.cavity_qty,A.unprice |
| | | from ( |
| | | select materiel_code, eqp_code,eqp_value,stand_value,cavity_qty,unprice from TPrteEqp_Stad |
| | | where materiel_code=@partcode and route_code=@routecode and step_code=@stepcode |
| | |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and A.materiel_code=@partcode "; |
| | | dynamicParams.Add("@stepcode", partcode); |
| | | dynamicParams.Add("@partcode", partcode); |
| | | } |
| | | if (routecode != "" && routecode != null) |
| | | { |