Просмотр исходного кода

删除外链判断.新增系统报价

zhuyiyi 1 неделя назад
Родитель
Сommit
e0c48dcfdf

+ 23 - 0
BizCom/Dao/CeErpTradeCellExtend.cs

@@ -481,6 +481,29 @@ namespace BizCom
             get { return _isJoint; }
             set { _isJoint = value; }
         }
+        private double _sysPrice = 0;
+
+        /// <summary>
+        /// 系统报价
+        /// </summary>
+        [Property]
+        public double sysPrice
+        {
+            get { return _sysPrice; }
+            set { _sysPrice = value; }
+        }
+
+        private string _sysPriceContent = "";
+
+        /// <summary>
+        /// 系统报价内容
+        /// </summary>
+        [Property]
+        public string sysPriceContent
+        {
+            get { return _sysPriceContent; }
+            set { _sysPriceContent = value; }
+        }
         public static CeErpTradeCellExtend getByTid(string ctid)
         {
             return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));

+ 13 - 1
SiteCore/Handler/sync.order.cs

@@ -2595,7 +2595,7 @@ namespace SiteCore.Handler
                             return;
                         }
                         //157赖橙帆 159林晨 73 静之颖
-                        if (entity.OrderState > 3 && entity.DispatchSort == 2 && userid != 3542 && CurrentUser.UserPost.Post.Code != "SysAdmin" && CurrentUser.UserPost.Post.Code != "Summarize" && CurrentUser.UserID != 157 && CurrentUser.UserID != 159 && CurrentUser.UserID != 1479 && CurrentUser.UserID != 73)
+                        if (entity.OrderState > 3 && entity.DispatchSort == 2 && userid != 3542 && CurrentUser.UserPost.Post.Code != "SysAdmin" && CurrentUser.UserPost.Post.Code != "Summarize" && CurrentUser.UserID != 157 && CurrentUser.UserID != 159 && CurrentUser.UserID != 1479)
                         {
                             returnErrorMsg("指派设计共创无法再次指派!");
                             return;
@@ -15223,6 +15223,18 @@ namespace SiteCore.Handler
             ReturnSuccess("{" + string.Format("\"data\":{0}", "\"" + string.Join(",", list) + "\"") + "}");
             return;
         }
+
+        public void getSysPrice()
+        {
+            string ctid = GetPostString("ctid");
+            CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ctid);
+            if (ceErpTradeCell.ProductId == 0)
+            {
+                returnSuccessMsg("没有产品id");
+            }
+            dataHelper.get_sys_price(ceErpTradeCell);
+            returnSuccessMsg("保存成功");
+        }
     }
 }
 

+ 17 - 0
SiteCore/taoObj/SysPriceResponseVo.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SiteCore.taoObj
+{
+    public class SysPriceResponseVo
+    {
+        public string ordersn { get; set; }
+
+        public double price { get; set; }
+
+        public string sysContent { get; set; }
+    }
+}

+ 2 - 1
SiteCore/taobao/commonHelper.cs

@@ -2960,7 +2960,8 @@ namespace SiteCore
             {
                 return null;
             }
-            string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, ceErpTradeCell.ShopId);
+            //string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, ceErpTradeCell.ShopId);
+            string result = "无";
             ceErpTradeCellExtend.ToType = result;
             int dispatchSort = 0;
             if ("无".Equals(result) && spu_shopIds.Contains(ceErpTradeCell.ShopId))

+ 101 - 0
SiteCore/taobao/dataHelper.cs

@@ -384,6 +384,107 @@ namespace SiteCore.Handler
             return;
 
         }
+        //http://47.114.150.226:88/Handler/dataHelper.ashx?t=set_sys_price   post请求参数(参数放body中):string tid(淘宝订单号)
+        public void set_sys_price()
+        {
+            string data = GetPostString("data");
+            if (!string.IsNullOrEmpty(data))
+            {
+                List<SysPriceResponseVo> list = JsonConvert.DeserializeObject<List<SysPriceResponseVo>>(data);
+                foreach (SysPriceResponseVo item in list)
+                {
+                    string ordersn = item.ordersn;
+                    double price = item.price;
+                    string sysPriceContent = item.sysContent;
+
+
+                    CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCode(ordersn);
+                    if (ceErpTradeCell == null)
+                    {
+                        ceErpTradeCell = CeErpTradeCell.GetByCtid(ordersn);
+                    }
+                    if (ceErpTradeCell == null)
+                    {
+                        returnErrorMsg("查无订单");
+                        return;
+                    }
+                    CeErpTradeCellExtend ce = CeErpTradeCellExtend.getByTid(ceErpTradeCell.ctid);
+                    if (ce == null)
+                    {
+                        ce = new CeErpTradeCellExtend();
+                        ce.ctid = ceErpTradeCell.ctid;
+                    }
+                    ce.sysPrice = price;
+                    ce.sysPriceContent = sysPriceContent;
+                    string sql = string.Format("select ptid,payment from CE_ErpTradeCell where ptid ='{0}' and  IsSample = 2", ceErpTradeCell.tid);
+                    DataTable dt_price = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+                    if (dt_price != null && dt_price.Rows.Count > 0)
+                    {
+                        double diffPirce = 0;
+                        foreach (DataRow dr in dt_price.Rows)
+                        {
+                            if (Convert.IsDBNull(dr["payment"]))
+                            {
+                                diffPirce += Convert.ToDouble(dr["payment"]);
+                            }
+                        }
+                        ce.differentAmount = diffPirce;
+                    }
+                    if (ce.ID != 0)
+                    {
+                        ce.Update();
+                    }
+                    else
+                    {
+                        ce.Create();
+                    }
+                    returnSuccessMsg("修改成功!");
+                    return;
+                }
+            }
+
+            returnErrorMsg("缺少必要参数");
+        }
+
+        public static void get_sys_price(CeErpTradeCell ceErpTradeCell)
+        {
+            CeErpProduct product = CeErpProduct.GetById(ceErpTradeCell.ProductId);
+            string param = "[{ \"product_type\": \"" + product.PType + "\",        \"remark\": \"" + ceErpTradeCell.seller_memo + "\"    }]";
+            string result = sysHttpClient(param);
+        }
+
+        public static string sysHttpClient(string param)
+        {
+            var client = new HttpClient();
+            var request = new HttpRequestMessage
+            {
+                Method = HttpMethod.Post,
+                RequestUri = new Uri("http://47.122.57.102:11004/quotations/batch"),
+                Content = new StringContent(param)
+                {
+                    Headers =
+                    {
+                        ContentType = new MediaTypeHeaderValue("application/json")
+                    }
+                }
+            };
+            var task = Task.Run(() =>
+            {
+                try
+                {
+                    var response = client.SendAsync(request).Result;
+                    response.EnsureSuccessStatusCode();
+                    return response.Content.ReadAsStringAsync().Result;
+                }
+                catch (Exception e)
+                {
+                    return "";
+                }
+
+
+            });
+            return task.Result;
+        }
 
         public void getOrderInvoiceInfo()
         {

+ 2 - 1
Web/EDelivery/WaitingOrder.aspx

@@ -35,7 +35,8 @@
                 <div field="pay_time" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">付款时间</div>
                 <div field="SupplierName" width="60" align="center" headeralign="center">供应商</div>
                 <div field="payment" width="40" align="center" headeralign="center">金额</div>
-                <div field="compenPrice" width="80" align="center" headeralign="center">补差金额</div>
+                <div field="compenPrice" width="60" align="center" headeralign="center">补差金额</div>
+                <div field="sysPrice" width="60" align="center" headeralign="center">报价金额</div>
                 <div field="payment_cyt" width="80" align="center" headeralign="center">成本金额</div>
                 <div field="delivery_paymant" width="40" align="center" headeralign="center">偏远物流费</div>
                 <div field="CustomerUserName" width="60" align="center" headeralign="center" renderer="orderCusRenderer">客服/设计</div>

+ 7 - 0
Web/EDelivery/js/WaitingOrder.js

@@ -351,6 +351,7 @@ function actionRenderer(e) {
         html += getGridBtn("view", "付款图片", "viewPayImg('" + id + "')");
     }
     html += getGridBtn("edit", "查看报价", "GetToQuote('" + id + "')");
+    html += getGridBtn("lock", "系统报价", "getSysPrice('" + id + "')");
     if (record.authCount > 0) {
         html += getGridBtn("view", "授权下载", "downAuth('" + record.tid + "','" + record.ctid + "')");
     }
@@ -358,6 +359,12 @@ function actionRenderer(e) {
 
     return html;
 }
+
+function getSysPrice(ctid) {
+    postAjax("getSysPrice", { ctid }, function (data) {
+        resultShow(data, "grid.reload();");
+    });
+}
 function saveJointorder(ctid) {
     postAjax("saveJointorder", { ctid }, function (data) {
         resultShow(data, "grid.reload();");

+ 2 - 0
Web/EOrder/OrderList.aspx

@@ -133,6 +133,8 @@
                 <div field="CustomerUserName" width="60" align="center" headeralign="center" renderer="orderCusRenderer">客服</div>
                 <div field="DesignUserName" width="60" align="center" headeralign="center" renderer="orderDesignRenderer">设计师</div>
                 <div field="DesignPrice" visible="false" align="center" headeralign="center">设计费</div>
+                <div field="differentAmount" visible="false" align="center" headeralign="center">补差金额</div>
+                <div field="sysPrice" visible="false" align="center" headeralign="center">系统报价</div>
                 <div field="end_time" visible="false" align="center" headeralign="center">确认收货时间</div>
 
                 <div field="WaitDesignTime" visible="false" align="center" headeralign="center">指派时间</div>

+ 2 - 2
ecomServer/MainForm.cs

@@ -1404,10 +1404,10 @@ namespace ErpServer
             {
                 try
                 {
-                    foreach (string id in shopIds)
+                    /*foreach (string id in shopIds)
                     {
                         apiHelper.Api_SyncOrderByTime(id);
-                    }
+                    }*/
                     StringBuilder sql = new StringBuilder();
                     sql.AppendFormat("select * from view_dataSendOrderInfo where isSync=0  and payment_cyt > 0");
                     DataTable dth = SqlHelper.ExecuteDataset(sql.ToString()).Tables[0];