修改工单生产数量更新的逻辑,现在只有检验合格的才更新生产数量,清除检验合格的结果也会更新
已修改21个文件
128 ■■■■■ 文件已修改
MES.Service/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Release/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Release/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/QC/RKJService.cs 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/publish/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/publish/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/publish/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/publish/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Release/net8.0/publish/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MES.Service/bin/Release/net8.0/MES.Service.dll
Binary files differ
MES.Service/bin/Release/net8.0/MES.Service.pdb
Binary files differ
MES.Service/service/QC/RKJService.cs
@@ -1,4 +1,5 @@
using MES.Service.DB;
using Masuit.Tools.Models;
using MES.Service.DB;
using MES.Service.Dto.service;
using MES.Service.Modes;
using MES.Service.util;
@@ -326,7 +327,7 @@
        if (!string.IsNullOrEmpty(qsItemOqcReq.FcheckResu))
        {
            throw new Exception("该检验单已" + qsItemOqcReq.FcheckResu + ",不运行修改结果");
            throw new Exception("该检验单已" + qsItemOqcReq.FcheckResu + ",不允许修改结果");
        }
        var oracle = SqlSugarHelper.UseTransactionWithOracle(db =>
@@ -444,6 +445,8 @@
    /// womdaa 已生产量 DAA011加回条码报工数量
    /// MES_SCGD_GX 检验标识 CHECK_FLAG,('√','×')
    /// 通过mes_inv_item_in_c_details2的MES_SCGD_GX_ID连接
    ///
    /// 20250602更新 现在不合格不会更新工单生产数量,合格会增加对应工单生产数量
    ///</summary>
    private void setBarCodes(string? FcheckResu, QsItemOqcItemDetail detail,
        SqlSugarClient db)
@@ -483,7 +486,7 @@
        var barCodes = mesInvItemInsList.Select(s => s.ItemBarcode).ToList();
        var count = db.Queryable<MesInvItemBarcodes>()
            .Where(s => barCodes.Contains(s.ItemBarcode) && s.WorkFlg == 0)
            .Where(s => barCodes.Contains(s.ItemBarcode))
            .Count();
        var gxId = mesInvItemInsList.Select(s => s.MesScgdGxId).ToList();
@@ -500,7 +503,7 @@
            if (count <= 0) return;
            
            //取消mes_inv_item_barcodes 的报工标识 WORK_FLG 使用条码
            //更新mes_inv_item_barcodes 的报工标识 WORK_FLG 使用条码
            var executeCommand = db.Updateable<MesInvItemBarcodes>()
                .SetColumns(a => a.WorkFlg == 1)
                .Where(a => barCodes.Contains(a.ItemBarcode))
@@ -508,7 +511,7 @@
            if (executeCommand > 0)
            {
                //womdaa 已生产量 DAA011加回条码报工数量
                //womdaa 已生产量 DAA011加上条码报工数量
                db.Updateable<Womdaa>()
                    .SetColumns(b => b.Daa011 == b.Daa011 + sumQty)
                    .Where(b => b.Daa001 == qsItemOqcReq.Daa001)
@@ -529,14 +532,14 @@
                .Where(a => barCodes.Contains(a.ItemBarcode))
                .ExecuteCommand();
            if (executeCommand > 0)
            /*if (executeCommand > 0)
            {
                //womdaa 已生产量 DAA011加回条码报工数量
                //womdaa 已生产量 DAA011扣除条码报工数量
                db.Updateable<Womdaa>()
                    .SetColumns(b => b.Daa011 == b.Daa011 - sumQty)
                    .Where(b => b.Daa001 == qsItemOqcReq.Daa001)
                    .ExecuteCommand();
            }
            }*/
        }
    }
@@ -738,7 +741,7 @@
        if (!string.IsNullOrEmpty(qsItemOqcReq.FcheckResu))
        {
            throw new Exception("该检验单已" + qsItemOqcReq.FcheckResu + ",不运行修改结果");
            throw new Exception("该检验单已" + qsItemOqcReq.FcheckResu + ",不允许修改结果");
        }
        var withOracle = SqlSugarHelper.UseTransactionWithOracle(db =>
@@ -837,6 +840,43 @@
            SetQSItemDetail(detail);
        });
        //因为默认合格,在这里增加工单生产数量
        var db = SqlSugarHelper.GetInstance();
        var oqcReqList = db.Queryable<QsItemOqcReq, MesInvItemIns, Womdaa>(
               (a, b, c) =>
                   new JoinQueryInfos(
                       JoinType.Left, a.BillNo == b.BillNo,
                       JoinType.Left, c.Daa001 == b.RbillNo
               ))
           .Where(a => a.Id == rkjDto.gid)
           .Select((a, b, c) =>
               new
               {
                   a.Id,
                   a.BillNo,
                   c.Daa001
               })
           .First();
        if (oqcReqList.Id is null or 0) return 0;
        //查询检验数量
        var sumQty = db
            .Queryable<MesInvItemIns, MesInvItemInCDetails2>((a, b) =>
                new JoinQueryInfos(
                    JoinType.Left, a.Id == b.ItemInId))
            .Where((a, b) => a.BillNo == oqcReqList.BillNo)
            .Select((a, b) => new {b.Quantity })
            .MergeTable().Sum( a=> a.Quantity);
        //更新生产量
        db.Updateable<Womdaa>()
                    .SetColumns(b => b.Daa011 == b.Daa011 + sumQty)
                    .Where(b => b.Daa001 == oqcReqList.Daa001)
                    .ExecuteCommand();
        return Convert.ToInt32(rkjDto.gid);
    }
@@ -844,6 +884,74 @@
    {
        if (isRk(dto.gid)) throw new Exception("已有条码入库,不允许清除检验结果");
        var db = SqlSugarHelper.GetInstance();
        //查询检验结果
        var oqcReqList = db.Queryable<QsItemOqcReq, MesInvItemIns, Womdaa>(
               (a, b, c) =>
                   new JoinQueryInfos(
                       JoinType.Left, a.BillNo == b.BillNo,
                       JoinType.Left, c.Daa001 == b.RbillNo
               ))
           .Where(a => a.Id == dto.gid)
           .Select((a, b, c) =>
               new
               {
                   a.FcheckResu,
                   a.Id,
                   a.BillNo,
                   c.Daa001
               })
           .First();
        if (oqcReqList.Id is null or 0) return 0;
        var FcheckResu = oqcReqList.FcheckResu; //检验结果
        //查询检验数量
        var mesInvItemInsList = db
            .Queryable<MesInvItemIns, MesInvItemInCDetails2>((a, b) =>
                new JoinQueryInfos(
                    JoinType.Left, a.Id == b.ItemInId))
            .Where((a, b) => a.BillNo == oqcReqList.BillNo)
            .Select((a, b) => new
            { b.ItemBarcode, b.Quantity, b.MesScgdGxId })
            .ToList();
        var barCodes = mesInvItemInsList.Select(s => s.ItemBarcode).ToList();
        var count = db.Queryable<MesInvItemBarcodes>()
            .Where(s => barCodes.Contains(s.ItemBarcode))
            .Count();
        var gxId = mesInvItemInsList.Select(s => s.MesScgdGxId).ToList();
        var sumQty = mesInvItemInsList.Sum(s => s.Quantity);
        //根据工序id更新工序表的检验结果
        db.Updateable<MesScgdGx>()
            .SetColumns(s => s.CheckFlag == "未检验")
            .Where(s => gxId.Contains(s.Id))
            .ExecuteCommand();
        if (count <= 0) return 0;
        //更新mes_inv_item_barcodes 的报工标识 WORK_FLG 为已报工(主要是针对不合格的检验结果)
        var executeCommand = db.Updateable<MesInvItemBarcodes>()
            .SetColumns(a => a.WorkFlg == 1)
            .Where(a => barCodes.Contains(a.ItemBarcode))
            .ExecuteCommand();
        if ("合格".Equals(FcheckResu)) //检验合格的则回退生产数量
        {
            //womdaa 已生产量 DAA011扣除条码报工数量
            db.Updateable<Womdaa>()
                .SetColumns(b => b.Daa011 == b.Daa011 - sumQty)
                .Where(b => b.Daa001 == oqcReqList.Daa001)
                .ExecuteCommand();
        }
        return SqlSugarHelper.UseTransactionWithOracle(db =>
        {
MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -5,7 +5,7 @@
<Project>
  <PropertyGroup>
    <_PublishTargetUrl>C:\Users\qewqer\Desktop\MES\SG\StandardPda\MESApplication\bin\Release\net8.0\publish\</_PublishTargetUrl>
    <History>True|2025-05-28T11:29:45.5972248Z||;True|2025-05-07T09:38:52.4250140+08:00||;True|2025-04-21T12:10:43.8803364+08:00||;True|2025-04-21T08:27:37.2394337+08:00||;True|2025-04-12T12:05:38.9937329+08:00||;True|2025-04-11T16:26:37.5266569+08:00||;True|2025-03-20T17:58:14.2077893+08:00||;True|2025-03-15T00:59:39.9999573+08:00||;True|2025-03-07T15:42:21.8276566+08:00||;True|2025-02-27T10:43:45.2314689+08:00||;True|2025-02-21T16:39:35.2452658+08:00||;True|2025-01-13T15:35:48.6521519+08:00||;True|2025-01-08T16:15:03.8764923+08:00||;True|2024-12-30T15:00:59.8090011+08:00||;True|2024-12-06T16:11:01.2090466+08:00||;True|2024-11-26T09:07:33.5654976+08:00||;True|2024-11-20T15:49:27.1100474+08:00||;True|2024-11-16T18:18:42.4224922+08:00||;True|2024-11-15T09:32:12.6287354+08:00||;True|2024-11-13T10:19:32.3283327+08:00||;True|2024-09-06T14:40:56.3762241+08:00||;True|2024-08-20T17:12:00.2924570+08:00||;True|2024-08-17T10:57:05.6670396+08:00||;True|2024-08-17T10:56:46.8068041+08:00||;True|2024-08-16T14:09:17.0526491+08:00||;True|2024-08-15T08:40:32.8134665+08:00||;True|2024-08-14T10:00:27.7017207+08:00||;True|2024-08-14T08:54:44.8284031+08:00||;True|2024-08-07T10:32:10.3689256+08:00||;True|2024-08-05T15:45:03.0864530+08:00||;True|2024-08-03T09:59:13.7916520+08:00||;True|2024-07-31T17:27:28.1965929+08:00||;True|2024-07-31T15:27:34.7943845+08:00||;True|2024-07-30T15:04:50.5849235+08:00||;True|2024-07-30T14:09:06.2877325+08:00||;True|2024-07-29T16:11:30.4493940+08:00||;True|2024-07-23T14:30:34.4591002+08:00||;True|2024-07-22T14:17:39.8186158+08:00||;True|2024-04-10T12:55:31.3963752+08:00||;True|2024-04-08T13:59:25.5487203+08:00||;True|2024-04-06T09:30:09.5350539+08:00||;True|2024-04-06T08:46:05.8814658+08:00||;True|2024-04-05T14:06:52.0448024+08:00||;True|2024-04-05T12:47:46.0561601+08:00||;True|2024-02-26T08:46:22.0988887+08:00||;True|2024-02-24T19:17:13.6770376+08:00||;True|2024-02-24T14:32:37.4450337+08:00||;True|2024-02-23T10:22:06.5150173+08:00||;True|2024-02-22T13:19:56.6997993+08:00||;True|2024-02-22T10:53:17.7929585+08:00||;True|2024-02-21T17:08:06.5553444+08:00||;True|2024-02-19T16:24:37.4912012+08:00||;True|2024-02-02T10:07:23.2726075+08:00||;True|2024-02-02T08:36:49.2904460+08:00||;True|2024-01-29T17:44:43.6800769+08:00||;True|2024-01-23T09:47:26.7811926+08:00||;True|2024-01-18T16:23:30.3373836+08:00||;True|2024-01-17T14:22:04.2552286+08:00||;True|2024-01-16T16:54:42.2316892+08:00||;True|2024-01-16T16:37:23.8028858+08:00||;True|2024-01-16T09:25:24.4007775+08:00||;True|2024-01-15T10:18:57.3362616+08:00||;True|2024-01-15T10:07:14.2044763+08:00||;True|2024-01-10T14:03:36.4451130+08:00||;True|2024-01-09T16:45:32.9601815+08:00||;True|2024-01-06T14:16:34.2732220+08:00||;True|2024-01-06T14:11:45.2134717+08:00||;True|2024-01-06T11:30:58.9198887+08:00||;</History>
    <History>True|2025-06-02T11:49:37.3433823Z||;True|2025-06-02T19:45:06.8170643+08:00||;True|2025-06-02T19:33:16.6029887+08:00||;True|2025-06-02T17:37:59.2348839+08:00||;True|2025-05-30T18:48:45.3222297+08:00||;True|2025-05-28T19:29:45.5972248+08:00||;True|2025-05-07T09:38:52.4250140+08:00||;True|2025-04-21T12:10:43.8803364+08:00||;True|2025-04-21T08:27:37.2394337+08:00||;True|2025-04-12T12:05:38.9937329+08:00||;True|2025-04-11T16:26:37.5266569+08:00||;True|2025-03-20T17:58:14.2077893+08:00||;True|2025-03-15T00:59:39.9999573+08:00||;True|2025-03-07T15:42:21.8276566+08:00||;True|2025-02-27T10:43:45.2314689+08:00||;True|2025-02-21T16:39:35.2452658+08:00||;True|2025-01-13T15:35:48.6521519+08:00||;True|2025-01-08T16:15:03.8764923+08:00||;True|2024-12-30T15:00:59.8090011+08:00||;True|2024-12-06T16:11:01.2090466+08:00||;True|2024-11-26T09:07:33.5654976+08:00||;True|2024-11-20T15:49:27.1100474+08:00||;True|2024-11-16T18:18:42.4224922+08:00||;True|2024-11-15T09:32:12.6287354+08:00||;True|2024-11-13T10:19:32.3283327+08:00||;True|2024-09-06T14:40:56.3762241+08:00||;True|2024-08-20T17:12:00.2924570+08:00||;True|2024-08-17T10:57:05.6670396+08:00||;True|2024-08-17T10:56:46.8068041+08:00||;True|2024-08-16T14:09:17.0526491+08:00||;True|2024-08-15T08:40:32.8134665+08:00||;True|2024-08-14T10:00:27.7017207+08:00||;True|2024-08-14T08:54:44.8284031+08:00||;True|2024-08-07T10:32:10.3689256+08:00||;True|2024-08-05T15:45:03.0864530+08:00||;True|2024-08-03T09:59:13.7916520+08:00||;True|2024-07-31T17:27:28.1965929+08:00||;True|2024-07-31T15:27:34.7943845+08:00||;True|2024-07-30T15:04:50.5849235+08:00||;True|2024-07-30T14:09:06.2877325+08:00||;True|2024-07-29T16:11:30.4493940+08:00||;True|2024-07-23T14:30:34.4591002+08:00||;True|2024-07-22T14:17:39.8186158+08:00||;True|2024-04-10T12:55:31.3963752+08:00||;True|2024-04-08T13:59:25.5487203+08:00||;True|2024-04-06T09:30:09.5350539+08:00||;True|2024-04-06T08:46:05.8814658+08:00||;True|2024-04-05T14:06:52.0448024+08:00||;True|2024-04-05T12:47:46.0561601+08:00||;True|2024-02-26T08:46:22.0988887+08:00||;True|2024-02-24T19:17:13.6770376+08:00||;True|2024-02-24T14:32:37.4450337+08:00||;True|2024-02-23T10:22:06.5150173+08:00||;True|2024-02-22T13:19:56.6997993+08:00||;True|2024-02-22T10:53:17.7929585+08:00||;True|2024-02-21T17:08:06.5553444+08:00||;True|2024-02-19T16:24:37.4912012+08:00||;True|2024-02-02T10:07:23.2726075+08:00||;True|2024-02-02T08:36:49.2904460+08:00||;True|2024-01-29T17:44:43.6800769+08:00||;True|2024-01-23T09:47:26.7811926+08:00||;True|2024-01-18T16:23:30.3373836+08:00||;True|2024-01-17T14:22:04.2552286+08:00||;True|2024-01-16T16:54:42.2316892+08:00||;True|2024-01-16T16:37:23.8028858+08:00||;True|2024-01-16T09:25:24.4007775+08:00||;True|2024-01-15T10:18:57.3362616+08:00||;True|2024-01-15T10:07:14.2044763+08:00||;True|2024-01-10T14:03:36.4451130+08:00||;True|2024-01-09T16:45:32.9601815+08:00||;True|2024-01-06T14:16:34.2732220+08:00||;True|2024-01-06T14:11:45.2134717+08:00||;True|2024-01-06T11:30:58.9198887+08:00||;</History>
    <LastFailureDetails />
  </PropertyGroup>
</Project>
MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ
MESApplication/bin/Release/net8.0/MES.Service.dll
Binary files differ
MESApplication/bin/Release/net8.0/MES.Service.pdb
Binary files differ
MESApplication/bin/Release/net8.0/MESApplication.dll
Binary files differ
MESApplication/bin/Release/net8.0/MESApplication.exe
Binary files differ
MESApplication/bin/Release/net8.0/MESApplication.pdb
Binary files differ
MESApplication/bin/Release/net8.0/publish/MES.Service.dll
Binary files differ
MESApplication/bin/Release/net8.0/publish/MES.Service.pdb
Binary files differ
MESApplication/bin/Release/net8.0/publish/MESApplication.dll
Binary files differ
MESApplication/bin/Release/net8.0/publish/MESApplication.exe
Binary files differ
MESApplication/bin/Release/net8.0/publish/MESApplication.pdb
Binary files differ