南骏 池
2025-02-14 2075957d9c0c87e66b0392fdc0a2d5b9290dfee5
1.成品入库后台完成
2.报工后台优化
已修改3个文件
33 ■■■■ 文件已修改
Controllers/Warehouse/MesCprkController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/Warehouse/MesCprkManager.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/Wom/MesWorkProdManager.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Controllers/Warehouse/MesCprkController.cs
@@ -57,7 +57,7 @@
        try
        {
            dynamic resultInfos = new ExpandoObject();
            //resultInfos.tbBillList = m.CPRK(unity);
            resultInfos.tbBillList = m.CPRK(unity);
            return new ResponseResult
            {
                status = 0,
service/Warehouse/MesCprkManager.cs
@@ -32,10 +32,10 @@
        using (var conn = new SqlConnection(DbHelperSQL.strConn))
        {
            if (unity.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空");
            if (unity.CfNum <= 0) throw new Exception("拆分数量需大于等于0");
            if (unity.sectionCode.IsNullOrEmpty()) throw new Exception("库位编号不允许为空");
            if (unity.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空");
            using (var cmd = new SqlCommand("[prc_pda_bar_cf]", conn))
            using (var cmd = new SqlCommand("[prc_pda_inv_cprk]", conn))
            {
                try
                {
@@ -43,12 +43,12 @@
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter[] parameters =
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.NVarChar, 300),
                        new("@barcode_new", SqlDbType.NVarChar, 300),
                        new("@c_user", unity.userName),
                        new("@p_old_barcode", unity.barcode),
                        new("@p_qty", unity.CfNum),
                        new("@po_outMsg", SqlDbType.NVarChar, 300),
                        new("@po_outSum", SqlDbType.NVarChar, 300),
                        new("@po_womInBarSum", SqlDbType.NVarChar, 300),
                        new("@pi_user", unity.userName),
                        new("@pi_barcode", unity.barcode),
                        new("@pi_sectionCode", unity.sectionCode),
                    };
                    parameters[0].Direction = ParameterDirection.Output;
service/Wom/MesWorkProdManager.cs
@@ -137,7 +137,7 @@
                        Quantity = reportQty
                    })
                    .Where(x => x.Guid == barcode.Guid)
                    .ExecuteCommandAsync();
                    .ExecuteCommand();
                // 11. 获取或创建报工单
                var workProd = db.Queryable<MesWorkProd>()
@@ -199,11 +199,12 @@
                // 13. 更新工单已报工数量
                db.Updateable<Womdaa>()
                    .SetColumns(x =>
                        x.Daa011 == (x.Daa011 ?? 0) + (int)barcode.Quantity
                    )
                    .Where(x => x.Daa001 == barcode.BillNo)
                    .ExecuteCommandAsync();
                        .SetColumns(x => new Womdaa
                        {
                            Daa011 = (x.Daa011 ?? 0) + (int)barcode.Quantity
                        })
                        .Where(x => x.Daa001 == barcode.BillNo)
                        .ExecuteCommand();
                // 14. 重新获取最新已报工数量
                reportedQty = db.Queryable<MesWorkProd, MesWorkProdCDetails>(
@@ -222,7 +223,7 @@
        // 15. 返回处理结果
        return new ScanWorkResult
        {
            TaskNo = barcode.TaskNo,
            TaskNo = barcode.BillNo,
            ItemNo = item.ItemNo,
            PlanQty = planQty ?? 0,
            ReportedQty = reportedQty ?? 0,