zyf
2025-11-21 612b2285b823072809d811d456787432a3234fc3
MESApplication/Controllers/QC/XJController.cs
@@ -60,13 +60,14 @@
    //getLine
    [HttpPost("getLineAll")]
    public ResponseResult getLineAll()
    public ResponseResult getLineAll([FromBody] JObject data)
    {
        try
        {
            string UserNo = data["userNo"]?.ToString();
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().getLineAll();
                new XJService().getLineAll(UserNo);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
@@ -88,13 +89,13 @@
    [HttpPost("getDaa001")]
    public ResponseResult getDaa001([FromBody] JObject data)
    {
        var daa020 = data["daa020"].ToString();
        var item = data["item"].ToString();
        //var daa020 = data["daa020"].ToString();
        //var item = data["item"].ToString();
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().getDaa001(daa020, item);
                new XJService().getDaa001(data);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
@@ -165,11 +166,12 @@
    public ResponseResult setJYItem([FromBody] JObject data)
    {
        var itemNo = data["itemNo"].ToString();
        var planName = data["planName"].ToString();
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().setJYItem(itemNo);
                new XJService().setJYItem(itemNo, planName);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
@@ -194,6 +196,30 @@
            var tbBillList =
                new XJService().save(xjDto);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("SavePlan")]
    public ResponseResult SavePlan([FromBody] JObject data)
    {
        decimal pid = Convert.ToDecimal(data["pid"]);
        string planName = data["planName"].ToString();
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var XJ = new XJService();
            decimal res = XJ.SavePlan(pid, planName);
            resultInfos.res = res;
            return new ResponseResult
            {
                status = 0,
@@ -236,14 +262,14 @@
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().getPage(queryObj);
            resultInfos.tbBillList = tbBillList;
            var (items, totalCount) = new XJService().getPage(queryObj);
            resultInfos.tbBillList = items;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
                data = resultInfos,
                TotalCount = totalCount
            };
        }
        catch (Exception ex)
@@ -419,6 +445,29 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    //saveNotesPid  修改整改措施
    [HttpPost("saveNotesPid")]
    public ResponseResult saveNotesPid([FromBody] XJDto rkjDto)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().saveNotesPid(rkjDto);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    //saveRemarksById
    [HttpPost("saveRemarksById")]
@@ -442,4 +491,112 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("XJQaSubmit")]
    public ResponseResult XJQaSubmit(LLJDto rkjDto)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new XJService().XJQaSubmit(rkjDto);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <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 XJService();
            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("CreateNew")]
    public ResponseResult CreateNew([FromBody] JObject data)
    {
        var daaNo = data["daaNo"]?.ToString();
        var userNo = data["statusUser"]?.ToString();
        var planName = data["planName"]?.ToString();
        try
        {
            var service = new XJService();
            var (res, msg, billNo) = service.CreateNew(daaNo, userNo, planName);
            dynamic resultInfos = new ExpandoObject();
            resultInfos.res = res;
            resultInfos.msg = msg;
            resultInfos.billNo = billNo;// 返回到前端
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("GetItemProj")]
    public ResponseResult GetItemProj([FromBody] JObject data)
    {
        var itemNo = data["itemNo"]?.ToString();
        try
        {
            var service = new XJService();
            var qaPlans = service.GetItemProj(itemNo);
            dynamic resultInfos = new ExpandoObject();
            resultInfos.qaPlans = qaPlans;  // 返回到前端
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}