| | |
| | | using System.Dynamic; |
| | | using Masuit.Tools.Models; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.Modes.DingAPI; |
| | | using MES.Service.service.QC; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取行不良原因 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | | [HttpPost("GetReason")] |
| | | public ResponseResult GetReason([FromBody] JObject data) |
| | | { |
| | | string billNo = data["billNo"].ToString(); |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var tbBillList = new SJService(); |
| | | var reasons = tbBillList.GetReason(billNo); |
| | | resultInfos.tbBillList = reasons; |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = reasons |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("GetDingDept")] |
| | | public ResponseResult GetDingDept() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var tbBillList = new SJService(); |
| | | var depts = tbBillList.getDingDept(); |
| | | resultInfos.tbBillList = depts; |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = depts |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("GetDeptTree")] |
| | | public ResponseResult GetDeptTree() |
| | | { |
| | | try |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | var flatList = db.Queryable<DingDept>().ToList(); |
| | | var tbBillList = new SJService(); |
| | | |
| | | // 转换为树 |
| | | var tree = tbBillList.BuildDeptTree(); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = tree |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | [HttpPost("GetDingUser")] |
| | | public ResponseResult GetDingUser() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var tbBillList = new SJService(); |
| | | var users = tbBillList.getDingUser(); |
| | | resultInfos.tbBillList = users; |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = users |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("DingJZCSD")] |
| | | public ResponseResult DingJZCSD(JzcsdData Indata) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var tbBillList = new SJService(); |
| | | var depts = tbBillList.DingJZCSD(Indata); |
| | | resultInfos.tbBillList = depts; |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = depts |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | [HttpPost("SetQSItemDetail")] |
| | | public ResponseResult SetQSItemDetail([FromBody] QsItemIpiItemDetail detail) |
| | | { |