如洲 陈
昨天 21eaaa8218e1389babb60d75e6870659abed992e
增加ERP删除任务单后删除工单
已修改8个文件
50 ■■■■ 文件已修改
MES.Service/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/WomcaaManager.cs 50 ●●●● 补丁 | 查看 | 原始文档 | 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 | 历史
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/service/WomcaaManager.cs
@@ -241,27 +241,53 @@
    public bool Delete(YFDelete data)
    {
        if (data == null)
            throw new ArgumentNullException(nameof(data));
        if (string.IsNullOrWhiteSpace(data.FBillNo))
            throw new ArgumentException("FBillNo 不能为空", nameof(data.FBillNo));
        if (string.IsNullOrWhiteSpace(data.FBillTypeID))
            throw new ArgumentException("FBillTypeID 不能为空", nameof(data.FBillTypeID));
        return UseTransaction(db =>
        {
            var update = db.Deleteable<Womcaa>()
                   .Where(it => it.Caa001 == data.FBillNo &&
                                it.SrcBillType == data.FBillTypeID)
                   .ExecuteCommand() > 0;
            // 删除主表数据
            var deleteMain = db.Deleteable<Womcaa>()
                .Where(it => it.Caa001 == data.FBillNo && it.SrcBillType == data.FBillTypeID)
                .ExecuteCommand() > 0;
            var insertOrUpdate = db.Deleteable<Womcab>()
                  .Where(it => it.Cab001 == data.FBillNo &&
                               it.Cab002 == data.FBillTypeID)
                  .ExecuteCommand() > 0;
            // 删除子表数据
            var deleteDetail = db.Deleteable<Womcab>()
                .Where(it => it.Cab001 == data.FBillNo && it.Cab002 == data.FBillTypeID)
                .ExecuteCommand() > 0;
            if (!deleteMain || !deleteDetail)
                throw new Exception("删除失败:主表或子表记录不存在");
            // 调用存储过程进行后续处理
            var inputParam1 = new SugarParameter("P_WORK_NO", data.FBillNo);
            var inputParam2 = new SugarParameter("P_WORK_TYPE", data.FBillTypeID);
            var outParam1 = new SugarParameter("C_RESULT", null, true); // 输出参数
            var outParam2 = new SugarParameter("C_MSG", null, true);   // 输出参数
            if (update && insertOrUpdate) return 1;
            throw new NotImplementedException("删除失败");
            db.Ado.ExecuteCommand(
                "BEGIN PRC_DELETE_DAA(:P_WORK_NO, :P_WORK_TYPE, :C_RESULT, :C_MSG); END;",
                inputParam1, inputParam2, outParam1, outParam2);
            int result = int.Parse((string)outParam1.Value);
            string message = outParam2.Value == DBNull.Value ? string.Empty : (string)outParam2.Value;
            if (result == 1)
            {
                //存储过程失败则事务进行回滚
                db.Ado.RollbackTran();
                throw new Exception(message);
            }
            return 1;
        }) > 0;
    }
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