如洲 陈
2025-10-30 87bdc068d2135c27fa23732bab14ac297787e6e5
MESApplication/Controllers/QC/SJController.cs
@@ -12,27 +12,6 @@
[ApiController]
public class SJController : ControllerBase
{
    [HttpPost("GetMaxBillNo")]
    public ResponseResult GetMaxBillNo()
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new SJService().getMaxBillNo();
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("GetPage")]
@@ -41,14 +20,15 @@
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new SJService().getPage(queryObj);
            var service = new SJService();
            var (tbBillList, totalCount) = service.getPageWithTotal(queryObj);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
                data = resultInfos,
                TotalCount = totalCount
            };
        }
        catch (Exception ex)
@@ -82,27 +62,6 @@
        }
    }
    [HttpPost("Save")]
    public ResponseResult Save([FromBody] QsItem item)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList = new SJService();
            var detail021 = tbBillList.Save(item);
            resultInfos.tbBillList = detail021;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    //SaveItem
    [HttpPost("SaveItem")]
@@ -319,4 +278,52 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("SJQaSubmit")]
    public ResponseResult SJQaSubmit([FromBody] JObject data)
    {
        var userNo = data["userNo"]?.ToString();
        var id = Convert.ToDecimal(data["id"]?.ToString());
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList = new SJService().SJQaSubmit(userNo, id);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("GenUpdateSJ")]
    public ResponseResult GenUpdateSJ([FromBody] JObject data)
    {
        var id = Convert.ToDecimal(data["id"]?.ToString());
        var no = data["no"]?.ToString();
        var userNo = data["userNo"]?.ToString();
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var service = new SJService();
            var (code, msg) = service.GenUpdateSJ(id, no, userNo);
            resultInfos.tbBillList = new { result = code, message = msg };
            return new ResponseResult
            {
                status = code,
                message = msg,
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}