| | |
| | | try |
| | | { |
| | | //判断工单是否为未开始状态或者已派发状态(满足其中一种都可删除,否则不允许删除) |
| | | sql = @"select * from TK_Wrk_Man where wo_code=@wocode and status='NEW' or status='ALLO'"; |
| | | sql = @"select * from TK_Wrk_Man where wo_code=@wocode and status in('NEW','ALLO')"; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | |
| | | left join TStep B on A.step_code=B.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | | left join TMateriel_Info P on M.materiel_code=P.partcode |
| | | where A.wo_code=@wo_code"; |
| | | where A.wo_code=@wo_code order by A.seq"; |
| | | dynamicParams.Add("@wo_code", wo_code); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | mes.code = "200"; |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[生产管理,修改报工数据查询接口] |
| | | public static ToMessage MesOrderStepVerifySearch(string reporttype, string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (reporttype != "" && reporttype != null) |
| | | { |
| | | if (reporttype == "BZ") |
| | | { |
| | | search += "and AA.usergroup_code<>''"; |
| | | } |
| | | else |
| | | { |
| | | search += "and AA.usergroup_code='' "; |
| | | } |
| | | } |
| | | if (wo_code != "" && wo_code != null) |
| | | { |
| | | search += "and AA.wo_code like '%'+@wo_code+'%' "; |
| | | dynamicParams.Add("@wo_code", wo_code); |
| | | } |
| | | if (partnumber != "" && partnumber != null) |
| | | { |
| | | search += "and AA.partnumber like '%'+@partnumber+'%' "; |
| | | dynamicParams.Add("@partnumber", partnumber); |
| | | } |
| | | if (partname != "" && partname != null) |
| | | { |
| | | search += "and AA.partname like '%'+@partname+'%' "; |
| | | dynamicParams.Add("@partname", partname); |
| | | } |
| | | if (partspec != "" && partspec != null) |
| | | { |
| | | search += "and AA.partspec like '%'+@partspec+'%' "; |
| | | dynamicParams.Add("@partspec", partspec); |
| | | } |
| | | if (reportuser != "" && reportuser != null) |
| | | { |
| | | search += "and AA.usercode like '%'+@reportuser+'%' "; |
| | | dynamicParams.Add("@reportuser", reportuser); |
| | | } |
| | | if (reportdateopendate != "" && reportdateopendate != null) |
| | | { |
| | | search += "and AA.report_date between @reportdateopendate and @reportdateclosedate "; |
| | | dynamicParams.Add("@reportdateopendate", reportdateopendate + " 00:00:00"); |
| | | dynamicParams.Add("@reportdateclosedate", reportdateclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | search = search.Substring(3);//截取索引2后面的字符 |
| | | // --------------查询指定自制报工外协收料数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from( |
| | | select A.id,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,A.task_qty,M.wkshp_code,G.org_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | M.route_code,R.name as route_name,A.step_code,S.stepname,S.flwtype,D.first_choke,D.last_choke,T.unprice,B.usergroup_code,O.group_name as usergroup_name,B.report_person as usercode,U.username, |
| | | B.report_date,B.report_qty,B.ng_qty,B.bad_qty |
| | | from TK_Wrk_Record A |
| | | inner join TK_Wrk_RecordSub B on A.id=B.m_id |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TPrteEqp_Stad T on A.materiel_code=T.materiel_code and M.route_code=T.route_code and A.step_code=T.step_code and A.eqp_code=T.eqp_code |
| | | left join TMateriel_Info P on A.materiel_code=P.partcode |
| | | left join TOrganization G on M.wkshp_code=G.org_code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | left join TFlw_Rout R on M.route_code=R.code |
| | | left join TFlw_Rtdt D on M.route_code=D.rout_code and A.step_code=D.step_code |
| | | left join TUser U on B.report_person=U.usercode |
| | | left join TGroup O on U.usergroup_code=O.group_code |
| | | where A.style='B' and B.style='B' |
| | | ) as AA where" + search; |
| | | //union all |
| | | //select A.id,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,M.plan_qty as task_qty,M.wkshp_code,G.org_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | //M.route_code,R.name as route_name,A.step_code,S.stepname,S.flwtype,D.first_choke,D.last_choke,T.unprice,'' as usergroup_code,'' as usergroup_name,B.in_person as usercode,U.username, |
| | | //B.in_time as report_date,B.sqty as report_qty,B.ng_qty,B.bad_qty |
| | | //from TK_Wrk_OutRecord A |
| | | //inner join TK_Wrk_OutRecordSub B on A.id = B.m_id |
| | | //left join TK_Wrk_Man M on A.wo_code = M.wo_code |
| | | //left join TStep S on A.step_code = S.stepcode |
| | | //left join TPrteEqp_Stad T on A.materiel_code = T.materiel_code and M.route_code = T.route_code and A.step_code = T.step_code and A.wx_code = T.eqp_code |
| | | //left join TMateriel_Info P on A.materiel_code = P.partcode |
| | | //left join TOrganization G on M.wkshp_code = G.org_code |
| | | //left join TCustomer E on A.wx_code = E.code and E.btype = 'WX' |
| | | //left join TFlw_Rout R on M.route_code = R.code |
| | | //left join TFlw_Rtdt D on M.route_code = D.rout_code and A.step_code = D.step_code |
| | | //left join TUser U on B.in_person = U.usercode |
| | | //where A.style = 'S' and B.style = 'S' |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产管理,修改报工数据提交] |
| | | public static ToMessage MesOrderStepVerifySeave(string username, List<UpdateProductReport> json) |
| | | { |
| | | var sql = ""; |
| | | string[] arra1 = new string[] { }; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | decimal sumrepair_qty = 0, sumbad_qty = 0; //累计维修数量、累计报废数量 |
| | | try |
| | | { |
| | | string date = DateTime.Now.ToString(); //获取系统时间 |
| | | list.Clear(); |
| | | |
| | | |
| | | //循环json数据 |
| | | for (int i = 0; i < json.Count; i++) |
| | | { |
| | | //自制工序 |
| | | if (json[i].flw_type.ToString() == "Z") |
| | | { |
| | | //是否首道 |
| | | if (json[i].first_choke == "Y") |
| | | { |
| | | decimal this_reportqty = decimal.Parse(json[i].report_qty.ToString()); //报工数量(合格) |
| | | decimal this_ngqty = decimal.Parse(json[i].ng_qty.ToString()); //不良数量 |
| | | decimal this_badqty = decimal.Parse(json[i].bad_qty.ToString()); //报废数量 |
| | | //查询当前工序非此次报工:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and id<>@id and step_code=@step_code"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@id", json[i].id); |
| | | dynamicParams.Add("@step_code", json[i].step_code); |
| | | var dt = DapperHelper.selectdata(sql, dynamicParams); |
| | | decimal notthis_reportqty = decimal.Parse(dt.Rows[0]["good_qty"].ToString()); //当前工序非本次报工总数 |
| | | decimal notthis_ngqty = decimal.Parse(dt.Rows[0]["ng_qty"].ToString()); //当前工序非本次报工总数 |
| | | decimal notthis_badqty = decimal.Parse(dt.Rows[0]["bad_qty"].ToString()); //当前工序非本次报工总数 |
| | | //判断:当前工序报工记录:本次报工数量+本次不良数量+本次报废数量+当前工序非本次报工总数+当前工序非本次不良总数+当前工序非本次报废总数>工单任务数量 |
| | | decimal updatereportsumqty = this_reportqty + this_ngqty + this_badqty + notthis_reportqty + notthis_ngqty + notthis_badqty; |
| | | if (updatereportsumqty > decimal.Parse(json[i].task_qty.ToString())) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "自制首道工序修改报工总数量:【" + updatereportsumqty + "】不能大于工单任务数量:【" + json[i].task_qty.ToString() + "】!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | //查询当前工序下道工序:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and step_seq=@step_seq+1"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@step_seq", json[i].step_seq); |
| | | var dt0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (dt0.Rows.Count > 0) |
| | | { |
| | | //判断当前工序:报工总数数量+不良总数数量+报废总数数量<下道工序报工总数量+下道工序不良总数量+下道工序报废总数量 |
| | | decimal last_reportqty = decimal.Parse(dt0.Rows[0]["good_qty"].ToString()); //下道工序报工总数量 |
| | | decimal last_ngqty = decimal.Parse(dt0.Rows[0]["ng_qty"].ToString()); //下道工序不良总数量 |
| | | decimal last_badqty = decimal.Parse(dt0.Rows[0]["bad_qty"].ToString()); //下道工序报废总数量 |
| | | decimal last_updatereportsumqty = last_reportqty + last_ngqty + last_badqty; |
| | | if (updatereportsumqty < last_updatereportsumqty) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "自制首道工序修改报工总数量:【" + updatereportsumqty + "】不能小于下道工序报工总数量:【" + last_updatereportsumqty + "】,请输入合法数值或先修改下道工序报工数量!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | } |
| | | |
| | | } |
| | | //是否末道 |
| | | if (json[i].last_choke == "Y") |
| | | { |
| | | decimal this_reportqty = decimal.Parse(json[i].report_qty.ToString()); //报工数量(合格) |
| | | decimal this_ngqty = decimal.Parse(json[i].ng_qty.ToString()); //不良数量 |
| | | decimal this_badqty = decimal.Parse(json[i].bad_qty.ToString()); //报废数量 |
| | | //查询当前末道工序非此次报工:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and id<>@id and step_code=@step_code"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@id", json[i].id); |
| | | dynamicParams.Add("@step_code", json[i].step_code); |
| | | var dt = DapperHelper.selectdata(sql, dynamicParams); |
| | | decimal notthis_reportqty = decimal.Parse(dt.Rows[0]["good_qty"].ToString()); //当前末道工序非本次报工总数 |
| | | decimal notthis_ngqty = decimal.Parse(dt.Rows[0]["ng_qty"].ToString()); //当前末道工序非本次报工总数 |
| | | decimal notthis_badqty = decimal.Parse(dt.Rows[0]["bad_qty"].ToString()); //当前末道工序非本次报工总数 |
| | | //获取当前末道工序报工总数量:本次修改报工数量+本次修改不良数量+本次修改报废数量+当前末道工序非本次报工总数+当前末道工序非本次不良总数+当前末道工序非本次报废总数 |
| | | decimal updatereportsumqty = this_reportqty + this_ngqty + this_badqty + notthis_reportqty + notthis_ngqty + notthis_badqty; |
| | | |
| | | //查询当前末道工序上道工序:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and step_seq=@step_seq-1"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@step_seq", json[i].step_seq); |
| | | var dt0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (dt0.Rows.Count > 0) |
| | | { |
| | | //判断:当前末道工序报工记录:当前末道工序报工总数(合格+不良+报废)>上道工序报工总数(合格+不良+报废) |
| | | decimal last_reportqty = decimal.Parse(dt0.Rows[0]["good_qty"].ToString()); //下道工序报工总数量 |
| | | decimal last_ngqty = decimal.Parse(dt0.Rows[0]["ng_qty"].ToString()); //下道工序不良总数量 |
| | | decimal last_badqty = decimal.Parse(dt0.Rows[0]["bad_qty"].ToString()); //下道工序报废总数量 |
| | | decimal last_updatereportsumqty = last_reportqty + last_ngqty + last_badqty; |
| | | if (updatereportsumqty > last_updatereportsumqty) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "自制末道工序修改报工总数量:【" + updatereportsumqty + "】不能大于上道工序报工总数量:【" + last_updatereportsumqty + "】,请输入合法数值或先修改上道工序报工数量!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | } |
| | | } |
| | | else //非首道非末道 |
| | | { |
| | | decimal this_reportqty = decimal.Parse(json[i].report_qty.ToString()); //报工数量(合格) |
| | | decimal this_ngqty = decimal.Parse(json[i].ng_qty.ToString()); //不良数量 |
| | | decimal this_badqty = decimal.Parse(json[i].bad_qty.ToString()); //报废数量 |
| | | //查询当前工序非此次报工:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and id<>@id and step_code=@step_code"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@id", json[i].id); |
| | | dynamicParams.Add("@step_code", json[i].step_code); |
| | | var dt = DapperHelper.selectdata(sql, dynamicParams); |
| | | decimal notthis_reportqty = decimal.Parse(dt.Rows[0]["good_qty"].ToString()); //当前工序非本次报工总数 |
| | | decimal notthis_ngqty = decimal.Parse(dt.Rows[0]["ng_qty"].ToString()); //当前工序非本次报工总数 |
| | | decimal notthis_badqty = decimal.Parse(dt.Rows[0]["bad_qty"].ToString()); //当前工序非本次报工总数 |
| | | //获取当前末道工序报工总数量:本次修改报工数量+本次修改不良数量+本次修改报废数量+当前工序非本次报工总数+当前工序非本次不良总数+当前工序非本次报废总数 |
| | | decimal updatereportsumqty = this_reportqty + this_ngqty + this_badqty + notthis_reportqty + notthis_ngqty + notthis_badqty; |
| | | //查询当前工序上道工序:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and step_seq=@step_seq-1"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@step_seq", json[i].step_seq); |
| | | var dt0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (dt0.Rows.Count > 0) |
| | | { |
| | | //判断:当前工序报工记录:当前工序报工总数(合格+不良+报废)>上道工序报工总数(合格+不良+报废) |
| | | decimal last_reportqty = decimal.Parse(dt0.Rows[0]["good_qty"].ToString()); //下道工序报工总数量 |
| | | decimal last_ngqty = decimal.Parse(dt0.Rows[0]["ng_qty"].ToString()); //下道工序不良总数量 |
| | | decimal last_badqty = decimal.Parse(dt0.Rows[0]["bad_qty"].ToString()); //下道工序报废总数量 |
| | | decimal last_updatereportsumqty = last_reportqty + last_ngqty + last_badqty; |
| | | if (updatereportsumqty > last_updatereportsumqty) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "自制工序修改报工总数量:【" + updatereportsumqty + "】不能大于上道工序报工总数量:【" + last_updatereportsumqty + "】,请输入合法数值或先修改上道工序报工数量!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | } |
| | | //查询当前工序下道工序:总报工数量、总不良数量、总报废数量 |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(bad_qty),0) as bad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and step_seq=@step_seq+1"; |
| | | dynamicParams.Add("@wo_code", json[i].wo_code); |
| | | dynamicParams.Add("@step_seq", json[i].step_seq); |
| | | var dt1 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (dt1.Rows.Count > 0) |
| | | { |
| | | //判断当前工序:报工总数数量+不良总数数量+报废总数数量<下道工序报工总数量+下道工序不良总数量+下道工序报废总数量 |
| | | decimal last_reportqty = decimal.Parse(dt1.Rows[0]["good_qty"].ToString()); //下道工序报工总数量 |
| | | decimal last_ngqty = decimal.Parse(dt1.Rows[0]["ng_qty"].ToString()); //下道工序不良总数量 |
| | | decimal last_badqty = decimal.Parse(dt1.Rows[0]["bad_qty"].ToString()); //下道工序报废总数量 |
| | | decimal last_updatereportsumqty = last_reportqty + last_ngqty + last_badqty; |
| | | if (updatereportsumqty < last_updatereportsumqty) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "自制工序修改报工总数量:【" + updatereportsumqty + "】不能小于下道工序报工总数量:【" + last_updatereportsumqty + "】,请输入合法数值或先修改下道工序报工数量!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ///////////////////////////////修改报工////////////////////////////// |
| | | |
| | | //回写对应的报工记录子表合格数量、不良数量、报废数量 |
| | | sql = @"update TK_Wrk_RecordSub set report_qty=report_qty+@repair_qty,ng_qty=ng_qty+@ng_qty,bad_qty=bad_qty+@bad_qty |
| | | where m_id=@m_id and id=@id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(json[i].id), |
| | | id = int.Parse(json[i].sbid), |
| | | repair_qty = decimal.Parse(json[i].report_qty), |
| | | ng_qty = decimal.Parse(json[i].ng_qty), |
| | | bad_qty = decimal.Parse(json[i].bad_qty) |
| | | } |
| | | }); |
| | | //回写对应的报工记录主表合格数量、不良数量、报废数量 |
| | | sql = @"update TK_Wrk_Record set good_qty=good_qty+@good_qty,ng_qty=ng_qty+@ng_qty,bad_qty=bad_qty+@bad_qty |
| | | where wo_code=@wo_code and step_code=@step_code and id=@id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | good_qty = decimal.Parse(json[i].report_qty), |
| | | ng_qty = decimal.Parse(json[i].ng_qty), |
| | | bad_qty = decimal.Parse(json[i].bad_qty), |
| | | wo_code = json[i].wo_code, |
| | | step_code = json[i].step_code, |
| | | id = int.Parse(json[i].id) |
| | | } |
| | | }); |
| | | //回写不良 |
| | | sql = @"update CSR_WorkRecord_Defect set defect_qty=defect_qty+@ng_qty |
| | | where wo_code=@wo_code and step_code=@step_code and record_id=@id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | ng_qty = decimal.Parse(json[i].ng_qty), |
| | | wo_code = json[i].wo_code, |
| | | step_code = json[i].step_code, |
| | | id = int.Parse(json[i].id) |
| | | } |
| | | }); |
| | | } |
| | | //外协工序 |
| | | if (json[i].flw_type.ToString() == "S") |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.Message = "修改报工成功!"; |
| | | mes.data = null; |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "修改报工失败!"; |
| | | mes.data = null; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[MES工单批量关闭查询] |
| | | public static ToMessage MesOrderBitchClosedSearch(string mesorderstus, string mesordercode, string sourceorder, string ordertype, string partcode, string partname, string partspec, int startNum, string creatuser, string createdate, int endNum, string prop, string order) |
| | | { |
| | |
| | | } |
| | | } |
| | | //更新排产生产资源主表 |
| | | sql = @"update gn_wkm_capac_plan set wkshift_code=@wkshift_code,classtype=@classtype,lm_user=@lm_user,lm_time=@lm_time where id=@id"; |
| | | sql = @"update TWkm_capac_plan set wkshift_code=@wkshift_code,classtype=@classtype,lm_user=@lm_user,lm_date=@lm_time where id=@id"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | //循环写入排产生产资源子表 |
| | | for (int i = 0; i < objs.Count; i++) |
| | | { |
| | | sql = @"insert into TWkm_capac_plan_sub(m_id,wkdate,wkshift_code) values()"; |
| | | sql = @"insert into TWkm_capac_plan_sub(m_id,wkdate,wkshift_code) values(@m_id,@wkdate,@wkshift_code)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |