|
|
@@ -2123,7 +2123,8 @@ namespace SiteCore
|
|
|
{ "RefundType", refund_type },
|
|
|
{ "ReprintReasons", after },
|
|
|
{ "ReasonsImgUrls", entity.AfterSaleSupplierImg },
|
|
|
- { "ReasonRemarks", ceErpTradeAfterSaleExtend.supplierResponsible }
|
|
|
+ { "ReasonRemarks", ceErpTradeAfterSaleExtend.supplierResponsible },
|
|
|
+ { "RefundAmount", entity.DeductFee }
|
|
|
};
|
|
|
/**JObject jsonObject12 = new JObject
|
|
|
{
|
|
|
@@ -3037,5 +3038,112 @@ namespace SiteCore
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ public static bool setFromDataInfo(string tid, string content, int userId)
|
|
|
+ {
|
|
|
+ CeErpTradeCell tradeCell = CeErpTradeCell.GetByCtid(tid);
|
|
|
+ if (tradeCell == null)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ string info_sql = string.Format("SELECT ctid FROM [dbo].[CE_ErpTradeCell] WHERE tid ='{0}'", tradeCell.tid);
|
|
|
+ if (tradeCell.ctid.Contains("S_"))
|
|
|
+ {
|
|
|
+ info_sql = string.Format("SELECT ctid FROM [dbo].[CE_ErpTradeCell] WHERE ctid ='{0}'", tradeCell.ctid);
|
|
|
+ }
|
|
|
+ DataTable data = DbHelper.DbConn.ExecuteDataset(info_sql).Tables[0];
|
|
|
+
|
|
|
+ CeErpOrderFormData formData = null;
|
|
|
+ if (data.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ List<CeErpTradeCell> cell_list = new List<CeErpTradeCell>();
|
|
|
+ foreach (DataRow row in data.Rows)
|
|
|
+ {
|
|
|
+ string ctid = row["ctid"].ToString();
|
|
|
+ CeErpTradeCell cell = CeErpTradeCell.GetByCtid(ctid);
|
|
|
+ cell_list.Add(cell);
|
|
|
+ formData = CeErpOrderFormData.GetByTid(ctid);
|
|
|
+ if (formData == null)
|
|
|
+ {
|
|
|
+ formData = new CeErpOrderFormData();
|
|
|
+ }
|
|
|
+
|
|
|
+ formData.tid = ctid;
|
|
|
+ formData.content = content;
|
|
|
+ if (formData.ID > 0)
|
|
|
+ {
|
|
|
+ formData.Update();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ formData.userId = userId;
|
|
|
+ formData.Create();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (tradeCell.OrderState >= 5)
|
|
|
+ {
|
|
|
+ LogHelper.addLog(tradeCell.ctid, formData.userId > 0 ? formData.userId : 3542, "外链派单:订单状态不正确!", tradeCell.OrderState);
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+ //能进来并且没有设计师
|
|
|
+
|
|
|
+ foreach (CeErpTradeCell entity in cell_list)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (entity != null && entity.seller_memo.Length > 0)
|
|
|
+ {
|
|
|
+ if (entity.OrderState >= 5)
|
|
|
+ {
|
|
|
+ LogHelper.addLog(entity.ctid, formData.userId > 0 ? formData.userId : 3542, "外链派单:订单状态不正确!", entity.OrderState);
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
+ //判断能不能推送
|
|
|
+ designApiResponseVo result = commonHelper.checkOrderListDesignInfo(entity.tid, entity.ctid);
|
|
|
+ if (result != null && result.code == 200)
|
|
|
+ {
|
|
|
+ designApiResponseVo response = designHelper.API_GetPrintData_CreateOrder(entity, "SysAdmin");
|
|
|
+ if (response.code == 200)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (response.msg == "设计共创:成功")
|
|
|
+ {
|
|
|
+ if (entity.ctid.IndexOf("S_") == -1)
|
|
|
+ {
|
|
|
+ int suid = commonHelper.autoDistributeToSupplier(entity); //自动分配供应商
|
|
|
+ entity.SupplierId = suid;
|
|
|
+ string suname = commonHelper.getSupplierNameById(entity.SupplierId);
|
|
|
+ LogHelper.addLog(entity.ctid, 0, "匹配供应商:" + suname, entity.OrderState);
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.OrderState = Convert.ToInt32(OrderState.待设计);
|
|
|
+ entity.DesignUserId = 3542;
|
|
|
+ entity.WaitDesignTime = DateTime.Now;
|
|
|
+ entity.DispatchSort = 2;
|
|
|
+ entity.UpdateTime = DateTime.Now;
|
|
|
+ entity.Update();
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LogHelper.addLog(entity.ctid, formData.userId > 0 ? formData.userId : 3542, "外链派单:" + response.msg, Convert.ToInt32(OrderState.待设计));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LogHelper.addLog(entity.ctid, formData.userId > 0 ? formData.userId : 3542, "外链派单:" + result.msg, Convert.ToInt32(OrderState.待设计));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ XLog.SaveLog(0, "外链派单:" + ex.Message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|