|
|
@@ -16,6 +16,7 @@ using System.Data;
|
|
|
using System.Linq;
|
|
|
using System.Net;
|
|
|
using System.Reflection;
|
|
|
+using System.Security.Cryptography;
|
|
|
using System.Security.Cryptography.X509Certificates;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
@@ -2498,6 +2499,95 @@ namespace SiteCore.Handler
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ public void checkOrderToWhere()
|
|
|
+ {
|
|
|
+ if (UrlPostParmsCheck("data"))
|
|
|
+ {
|
|
|
+ string result = "内部";
|
|
|
+ string data = GetPostString("data");
|
|
|
+ Api_trade_info info = null;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ info = JsonConvert.DeserializeObject<Api_trade_info>(data);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ XLog.SaveLog(0, "checkOrderToWhere|1|" + ex.Message);
|
|
|
+ returnErrorMsg(ex.Message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (info == null)
|
|
|
+ {
|
|
|
+ XLog.SaveLog(0, "checkOrderToWhere Api_trade_info isNull");
|
|
|
+ returnErrorMsg("接口对象处理错误Api_trade_info=null");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ BizOrder bizOrder = info.bizOrder;
|
|
|
+ if (bizOrder == null)
|
|
|
+ {
|
|
|
+ returnErrorMsg("接口对象处理错误bizOrder=null");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ string none_wh = "内部";
|
|
|
+ List<string> none_list = new List<string>();
|
|
|
+ List<preToWhereVo> list = new List<preToWhereVo>();
|
|
|
+ foreach (Api_trade_info.bizOrderSplit item in bizOrder.bizOrderSplits)
|
|
|
+ {
|
|
|
+ preToWhereVo preToWhereVo = new preToWhereVo();
|
|
|
+ CeErpTradeCell ceErpTradeCell = new CeErpTradeCell();
|
|
|
+ CeErpTradeCellExtend ceErpTradeCellExtend = new CeErpTradeCellExtend();
|
|
|
+ preToWhereVo.ctid = item.splitNo;
|
|
|
+ ceErpTradeCell.ctid = item.splitNo;
|
|
|
+ ceErpTradeCell.seller_memo = item.systemRemark;
|
|
|
+ ceErpTradeCell.OtherMemo = item.otherRemark;
|
|
|
+ CeErpShop nShop = CeErpShop.GetShopIdByName(GetNull_tostring(bizOrder.openSellerNick));
|
|
|
+ if (nShop != null)
|
|
|
+ {
|
|
|
+ ceErpTradeCell.ShopId = nShop.ID;
|
|
|
+ }
|
|
|
+ ceErpTradeCell.ProductId = tmcHelper.getProductIdByName(item.cate3Id);
|
|
|
+ ceErpTradeCell.isDianziOrder = item.isDianziOrder;
|
|
|
+ ceErpTradeCellExtend.spu_id = item.spuId;
|
|
|
+ ceErpTradeCellExtend = commonHelper.sendSpuData(ceErpTradeCell, ceErpTradeCellExtend);
|
|
|
+ if (ceErpTradeCellExtend != null)
|
|
|
+ {
|
|
|
+ if ("外协".Equals(ceErpTradeCellExtend.ToType))
|
|
|
+ {
|
|
|
+ result = "外协";
|
|
|
+ }
|
|
|
+ if ("内部".Equals(ceErpTradeCellExtend.ToType))
|
|
|
+ {
|
|
|
+ result = "内部";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (result == "无")
|
|
|
+ {
|
|
|
+ none_list.Add(ceErpTradeCell.ctid);
|
|
|
+ designApiResponseVo designApiResponseVo = commonHelper.checkOrderDesignInfo(ceErpTradeCell, "");
|
|
|
+ if (designApiResponseVo.code == 200)
|
|
|
+ {
|
|
|
+ result = none_wh = "外协";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ preToWhereVo.to = result;
|
|
|
+ list.Add(preToWhereVo);
|
|
|
+ }
|
|
|
+ if ("外协".Equals(none_wh))
|
|
|
+ {
|
|
|
+ foreach (preToWhereVo item in list)
|
|
|
+ {
|
|
|
+ if (none_list.Contains(item.ctid))
|
|
|
+ {
|
|
|
+ item.to = none_wh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ returnSuccess(JsonConvert.SerializeObject(list));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static apiUploaderResponse CopyDesignFile(string ctid, string oldCtid, int userId)
|
|
|
{
|
|
|
|