1
pulg
2025-05-14 5a640911f7e7ef3a003775993f077e1a0e9ac130
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using HH.WCS.Hexafluo;
using HH.WCS.Hexafluo.util;
using HH.WCS.Hexafluo.wms;
using HH.WCS.SJML.Dto;
using HH.WCS.SJML.Entitys;
using System;
 
namespace HH.WCS.SJML.wms
{
    public class CntrItemRelHelper
    {
 
        /// <summary>
        /// 添加数据到重量计算表
        /// </summary>
        /// <returns></returns>
        public OperateResult InsertProviderAdd(TN_WeightCounterEntitys tN_Weight)
        {
            OperateResult result = OperateResult.Succeed();
            try
            {
                SqlSugarHelper.Db.BeginTran();
                var I = SqlSugarHelper.Db.Insertable(tN_Weight).ExecuteCommand();
                if (I == 0)
                {
                    throw new Exception("添加重量计算表 影响行数为0");
                }
                SqlSugarHelper.Db.Ado.CommitTran();
                return result;
            }
            catch (Exception ex)
            {
 
                LogHelper.Info("原料入库", "添加重量计算表报错--" + ex.Message + ex.StackTrace);
                SqlSugarHelper.Db.Ado.RollbackTran();
                return OperateResult.Error(ex.Message);
            }
        }
 
        /// <summary>
        /// 物料品质修改
        /// </summary>
        /// <param name="Vendor"></param>
        /// <returns></returns>
        public OperateResult SjUpdateItemState_CntrItemRelUpdate(UpdateItemStateDto Vendor)
        {
            try
            {
                OperateResult result = OperateResult.Succeed();
                SqlSugarHelper.Db.BeginTran();
                var I = SqlSugarHelper.Db.Updateable<CntrItemRel>().SetColumns(it => it.S_ITEM_STATE == Vendor.ItemState).Where(x => x.S_BATCH_NO == Vendor.flot).ExecuteCommand();
                if (I == 0)
                {
                    throw new Exception("物料表更新失败");
                }
                SqlSugarHelper.Db.CommitTran();
                return result;
            }
            catch (Exception ex)
            {
                SqlSugarHelper.Db.RollbackTran();
                LogHelper.Info("物料品质修改", "更新报错--" + ex.Message + ex.StackTrace);
                return OperateResult.Error(ex.Message);
            }
 
        }
    }
}