| | |
| | | [ApiExplorerSettings(GroupName = "工单管理")] |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | //[ChannelActionFilter] |
| | | [ChannelActionFilter] |
| | | public class WorkOrderController : Controller |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | // 创建一个新的字典 |
| | | Dictionary<object, object> dict = new Dictionary<object, object>(); |
| | | //通过产品编码查找关联的工序信息 |
| | | sql = @"select A.step_seq,A.step_code,S.stepname as step_name,A.unprice,A.isbott,A.isend |
| | | sql = @"select A.step_seq,A.step_code as stepcode,S.stepname as stepname,A.unprice as stepprice,A.isbott,A.isend |
| | | from ( |
| | | select S.materiel_code,R.step_seq,S.step_code,S.unprice,R.isbott,R.isend from TPrteEqp_Stad S |
| | | inner join TMateriel_Step R on S.materiel_code=R.materiel_code and S.step_code=R.step_code |
| | |
| | | // 创建一个新的字典 |
| | | Dictionary<object, object> dict = new Dictionary<object, object>(); |
| | | //通过工艺路线编码查找关联的工序信息 |
| | | sql = @"select A.step_seq,A.step_code,S.stepname as step_name,A.unprice,A.isbott,A.isend |
| | | sql = @"select A.step_seq,A.step_code as stepcode,S.stepname as stepname,A.unprice as stepprice,A.isbott,A.isend |
| | | from ( |
| | | select S.materiel_code,R.seq as step_seq,S.step_code,S.unprice,R.first_choke as isbott,R.last_choke as isend from TPrteEqp_Stad S |
| | | inner join TFlw_Rtdt R on S.route_code=R.rout_code and S.step_code=R.step_code |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.route_code,R.name as route_name,A.plan_qty,A.wkshp_code,C.torg_name as wkshp_name, |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.route_code,B.default_route,R.name as route_name,A.plan_qty,A.wkshp_code,C.torg_name as wkshp_name, |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date,A.data_sources,A.isstep,A.clerkuser, |
| | | B.priuserdefnvc1,B.priuserdefnvc2,B.priuserdefnvc3,B.priuserdefnvc4,B.priuserdefnvc5,B.priuserdefnvc6 |
| | | from TK_Wrk_Man A |
| | |
| | | { |
| | | for (int i = 0; i < json.Count; i++) |
| | | { |
| | | route_code = json[i].routecode; |
| | | //修改工单表 |
| | | sql = @"update TK_Wrk_Man set wotype=@wotype,wkshp_code=@wkshp_code,plan_qty=@plan_qty,lm_user=@lm_user,lm_date=@lm_date, |
| | | materiel_code=@materiel_code,route_code=@route_code,sourceid=@sourceid,m_po=@m_po,saleOrderDeliveryDate=@saleOrderDeliveryDate,plan_startdate=@plan_startdate,plan_enddate=@plan_enddate,isstep=@isstep |
| | |
| | | if (route) //工艺路线版 |
| | | { |
| | | //MES工单查找历史引用最新工序信息 |
| | | sql = @"select S.wo_code,S.seq,S.step_code,S.stepprice,isbott,isend |
| | | sql = @"select S.wo_code,S.seq,S.step_code,T.stepname as step_name,S.stepprice,isbott,isend |
| | | from TK_Wrk_Step S |
| | | inner join ( |
| | | select top 1 A.wo_code,A.route_code from TK_Wrk_Man A |
| | |
| | | else |
| | | { |
| | | //MES工单查找历史引用最新工序信息 |
| | | sql = @"select S.wo_code,S.seq,S.step_code,S.stepprice,isbott,isend |
| | | sql = @"select S.wo_code,S.seq,S.step_code,T.stepname as step_name,S.stepprice,isbott,isend |
| | | from TK_Wrk_Step S |
| | | inner join ( |
| | | select top 1 A.wo_code from TK_Wrk_Man A |