|
|
@@ -134,7 +134,7 @@ namespace SiteCore.Handler
|
|
|
string tid = GetPostString("ctid");
|
|
|
string date1 = GetPostString("date1");
|
|
|
//12-1 修改
|
|
|
- string urgent = GetPostString("urgent");
|
|
|
+ string urgent = GetPostString("urgent");
|
|
|
string back = GetPostString("back");
|
|
|
string offlineSearch = GetPostString("offlineSearch");
|
|
|
int paramsCount = 0;
|
|
|
@@ -4436,6 +4436,166 @@ namespace SiteCore.Handler
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void batch_ins_erp_returnreason()
|
|
|
+ {
|
|
|
+ if (UrlPostParmsCheck("ctids"))
|
|
|
+ {
|
|
|
+ string ctids = GetPostString("ctids");
|
|
|
+ if (!string.IsNullOrEmpty(ctids))
|
|
|
+ {
|
|
|
+ List<string> ctid_list = ctids.Split(',').ToList();
|
|
|
+
|
|
|
+ CeErpTradeCell entity = null;
|
|
|
+ List<string> message_list = new List<string>();
|
|
|
+ foreach (string eid in ctid_list)
|
|
|
+ {
|
|
|
+ if (eid != "") entity = CeErpTradeCell.GetByCtid(eid);
|
|
|
+ string userpost = CurrentUser.UserPost.Post.Code;
|
|
|
+ if (entity != null)
|
|
|
+ {
|
|
|
+ bool isPlace = false;
|
|
|
+ if (entity.OrderState > 6)
|
|
|
+ {
|
|
|
+ message_list.Add(eid + ":已发货无法打回!");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (entity.OrderState == 6)
|
|
|
+ {
|
|
|
+ isPlace = true;
|
|
|
+ }
|
|
|
+ bool isNeedUpdateCell2 = false;
|
|
|
+ if (entity.OrderState >= 6)
|
|
|
+ {
|
|
|
+ isNeedUpdateCell2 = true;
|
|
|
+ }
|
|
|
+ int returnTag = 2;
|
|
|
+ if (userpost == "Supplier")
|
|
|
+ {
|
|
|
+ returnTag = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ int toType = GetPostInt("totype");
|
|
|
+ string fromType = "3";
|
|
|
+ if (entity.OrderState < 5)
|
|
|
+ {
|
|
|
+ fromType = "3";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fromType = "4";
|
|
|
+ }
|
|
|
+ if (entity.IsXianHuo == 0)
|
|
|
+ {
|
|
|
+ if (returnTag == 2)
|
|
|
+ {
|
|
|
+ if (toType == 1)
|
|
|
+ {
|
|
|
+ entity.OrderState = 0;
|
|
|
+ entity.ReturnUserType = 1;
|
|
|
+ string clearman = GetPostString("clearman");
|
|
|
+ if (!string.IsNullOrEmpty(clearman))
|
|
|
+ {
|
|
|
+ entity.DesignUserId = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ entity.OrderState = 3;
|
|
|
+ entity.ReturnUserType = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.IsReadTag = 1;
|
|
|
+ }
|
|
|
+ else if (returnTag == 1)
|
|
|
+ {
|
|
|
+ entity.OrderState = 5;
|
|
|
+ }
|
|
|
+ entity.IsVerifyToSupplier = false;
|
|
|
+ }
|
|
|
+ if (entity.IsXianHuo == 1)
|
|
|
+ {
|
|
|
+ entity.OrderState = 5;
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.UnusualTag = 0;
|
|
|
+ entity.UnusualTime = null;
|
|
|
+ entity.UnusualCon = "";
|
|
|
+ entity.IsReturn = returnTag;
|
|
|
+ entity.ReturnTime = DateTime.Now;
|
|
|
+ entity.UpdateTime = DateTime.Now;
|
|
|
+ entity.ReturnReason = GetPostString("returnreason");
|
|
|
+ entity.Update();
|
|
|
+ if (entity.OrderState == 3)
|
|
|
+ {
|
|
|
+ ApiVo apiVo = new ApiVo();
|
|
|
+ apiVo.orderNumber = entity.ctid;
|
|
|
+ apiVo.actionName = "rebutDesign";
|
|
|
+ apiVo.orderRemarks = entity.ReturnReason;
|
|
|
+ designHelper.API_WorkCore(apiVo);//rebutDesign
|
|
|
+ }
|
|
|
+ CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(entity.ctid);
|
|
|
+ if (ceErpTradeCellExtend != null && ceErpTradeCellExtend.orderFrom == 30)
|
|
|
+ {
|
|
|
+ //dataHelper.api_orderBack(entity.ctid, fromType, entity.ReturnReason);
|
|
|
+ }
|
|
|
+ //CeErpSukuraData.createInfo(entity.ctid, 5);
|
|
|
+ //apiDesign.API_GetPrintData_ModifyOrder(entity.ctid, entity.seller_memo, false, true, entity.ReturnReason);
|
|
|
+ LogHelper.addLog(entity.ctid, CurrentUser.UserID, "退单:" + entity.ReturnReason, entity.OrderState);
|
|
|
+ if (isPlace)
|
|
|
+ {
|
|
|
+ string sql = string.Format("select * from view_dataSendOrderInfo where ctid='{0}'", entity.ctid);
|
|
|
+ DataTable dth = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
|
|
|
+ if (dth != null && dth.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ dataSendOrderBean dataSendOrderBean = null;
|
|
|
+ foreach (DataRow item in dth.Rows)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ dataSendOrderBean = new dataSendOrderBean();
|
|
|
+ dataSendOrderBean.Date1723191218572 = item["pay_time"].ToString();
|
|
|
+ dataSendOrderBean.RelevanceForm1723191634028 = item["SupplierId"].ToString();
|
|
|
+ dataSendOrderBean.RelevanceForm1723191239149 = item["ShopId"].ToString();
|
|
|
+ dataSendOrderBean.Date1723193880305 = item["FinishDeliveryTime"].ToString();
|
|
|
+ dataSendOrderBean.Date1723193870660 = item["FinishPlaceTime"].ToString();
|
|
|
+ dataSendOrderBean.LongText1723542734262 = item["seller_memo"].ToString();
|
|
|
+ dataSendOrderBean.ShortText1723542735637 = item["OtherMemo"].ToString();
|
|
|
+ dataSendOrderBean.ShortText1723542736542 = item["address"].ToString();
|
|
|
+ dataSendOrderBean.ShortText1723193907492 = item["OutSid"].ToString();
|
|
|
+ dataSendOrderBean.Number1723193919446 = item["payment_cyt"].ToString();
|
|
|
+ dataSendOrderBean.ShortText1723707899761 = item["ctid"].ToString();
|
|
|
+ dataSendOrderBean.Radio1723534706288 = "打回";
|
|
|
+ dataResponseVo result = dataHelper.CreateBoFahuo(dataSendOrderBean);
|
|
|
+ if (result != null)
|
|
|
+ {
|
|
|
+ if ("0".Equals(result.errcode))
|
|
|
+ {
|
|
|
+ CeErpDataSendOrderInfo.updateAsync(item["ctid"].ToString(), JsonConvert.SerializeObject(dataSendOrderBean));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CeErpDataSendOrderInfo.updateError(item["ctid"].ToString(), result.errmsg, JsonConvert.SerializeObject(dataSendOrderBean));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ returnSuccessMsg(message_list.Count > 0 ? string.Join("、", message_list) : "操作成功");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ returnErrorMsg("找不到订单记录");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void cyt_erp_returnreason()
|
|
|
{
|
|
|
if (UrlPostParmsCheck("ctid"))
|