dengjunjie
2 天以前 b784d019c3848718eb95eb0d34dde34c6a262b06
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
 
namespace WIDESEAWCS_BasicInfoService
{
    public class FormulaService : ServiceBase<Dt_Formula, IRepository<Dt_Formula>>, IFormulaService
    {
        public FormulaService(IRepository<Dt_Formula> BaseDal) : base(BaseDal)
        {
        }
 
        public IRepository<Dt_Formula> Repository => BaseDal;
 
        public override WebResponseContent AddData(SaveModel saveModel)
        {
            return base.AddData(saveModel);
        }
 
        //public override WebResponseContent UpdateData(SaveModel saveModel)
        //{
        //    Dt_Formula dt_Formula = new Dt_Formula()
        //    {
        //        Id = saveModel.MainData["id"].ObjToInt(),
        //        ProductCode = saveModel.MainData["productCode"].ToString(),
        //        ProductName = saveModel.MainData["productName"].ToString(),
        //        ProductLength = decimal.Parse(saveModel.MainData["productLength"].ToString()),
        //        ProductWidth = decimal.Parse(saveModel.MainData["productWidth"].ToString()),
        //        ProductHeight = decimal.Parse(saveModel.MainData["productHeight"].ToString()),
        //        ScrewDownsetDistance = decimal.Parse(saveModel.MainData["screwDownsetDistance"].ToString()),
        //        ScrewTorqueOutput = decimal.Parse(saveModel.MainData["screwTorqueOutput"].ToString()),
        //        DintAutoScrewOn = saveModel.MainData["dintAutoScrewOn"].ObjToInt(),
        //        P0P1Width = decimal.Parse(saveModel.MainData["p0P1Width"].ToString()),
        //        P0P2Width = decimal.Parse(saveModel.MainData["p0P2Width"].ToString()),
        //        P0P3Width = decimal.Parse(saveModel.MainData["p0P3Width"].ToString()),
        //        P1P3Height = decimal.Parse(saveModel.MainData["p1P3Height"].ToString()),
        //        P2P3Height = decimal.Parse(saveModel.MainData["p2P3Height"].ToString()),
 
        //        //ScrewTorque = float.Parse(saveModel.MainData["ScrewTorque"].ToString()),
        //        //UpdateBy = saveModel.UpdateBy,
        //        //UpdateTime = DateTime.Now
        //    };
        //    return UpdateData(dt_Formula);
        //    //return base.UpdateData(saveModel);
        //}
 
        //public override WebResponseContent UpdateData(Dt_Formula entity)
        //{
        //    return base.UpdateData(entity);
        //}
 
 
        /// <summary>
        /// 获取站台成品
        /// </summary>
        /// <returns></returns>
        public WebResponseContent getEndProductList()
        {
            try
            {
                List<Dt_Formula> dt_Formulas = BaseDal.QueryData(x => 1 == 1);
                var resultList = dt_Formulas.Select(item => new
                {
                    key = item.ProductCode,    
                    value = item.ProductCode
                }).ToList();
                return WebResponseContent.Instance.OK("查询站台成品成功", resultList);
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error($"查询站台成品失败:{ex.Message}");
            }
        }
    }
}