DS7_JinGang
hanxuntao 2 years ago
commit daf574a601

@ -1655,6 +1655,9 @@ namespace DSWeb.Common.DB
public decimal? GOODSRKSL { get; set; }
public decimal? GOODSRKSLACTUAL { get; set; }
public decimal? GOODSPFSL { get; set; }
/// <summary>
/// 库存量
/// </summary>
public decimal? GOODSSTOCK { get; set; }
public string CHARGEUNIT { get; set; }
public string REMARK_OUT { get; set; }
@ -1878,7 +1881,14 @@ namespace DSWeb.Common.DB
public string GOODSSTANDARD { get; set; }
public decimal? GOODSPACK { get; set; }
public string CHARGEUNIT { get; set; }
/// <summary>
/// 入库量
/// </summary>
public decimal? GOODSRKSL { get; set; }
/// <summary>
/// 库存量
/// </summary>
public decimal? GOODSSTOCK { get; set; }
public int? FREESTORAGEPERIOD { get; set; }
public bool? ISLOCK { get; set; }
@ -1894,6 +1904,9 @@ namespace DSWeb.Common.DB
public string REMARK { get; set; }
public decimal? GOODSPACKSTOCK { get; set; }
public string KINDPKGS { get; set; }
/// <summary>
/// 重量
/// </summary>
public decimal? GOODSKGS { get; set; }
public string CLIENTCODEOLD { get; set; }
public string CLIENTNAMEOLD { get; set; }
@ -1928,6 +1941,9 @@ namespace DSWeb.Common.DB
public double CHIMA1 { get; set; }
public double CHIMA2 { get; set; }
public decimal? ZHONGLIANG2 { get; set; }
/// <summary>
/// 实际重量
/// </summary>
public double SHIJIZHONGLIANG { get; set; }
public double SHIJICHIMA { get; set; }
public decimal? JIANSHU1 { get; set; }

@ -18,6 +18,8 @@ using DSWeb.Areas.MvcShipping.Job;
using System.Runtime.Caching;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.Areas.MvcShipping.Helper;
using HcUtility.Comm;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
namespace DSWeb.Areas.CommMng.Controllers
{
@ -238,13 +240,20 @@ namespace DSWeb.Areas.CommMng.Controllers
//反序列化json串拿去加密字符串
var objRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(strJson.ToString(), new { encrypt = "" });
var = DingTalkProcess.GetDingTalkProcess("诚锐入货通知");
string ever = objRtn.encrypt;
var appname = MsSysParamSetDAL.GetSysParamValue("DingTalkAppName");
//var 钉钉应用 = DingTalkApp.GetDingTalkApp("诚锐东胜对接");
var = DingTalkApp.GetDingTalkApp(appname);
//钉钉应用=DingTalkProcess.GetDingTalkProcessByProcessCode(callbackinfo.processCode);
//实例化钉钉解密类构造参数为对应的 应用中的token、aes_key、AppKey值
DingTalkEncryptor dingTalkEncryptor = new DingTalkEncryptor(.token, .aes_key, .appkey);
//定义字符串接收解密后的值
string text = dingTalkEncryptor.getDecryptMsg(signature, timestamp, nonce, ever);
//JeffSoft.Logger.Error("dingTalkEncryptor.getDecryptMsg:" + text + "");
@ -252,7 +261,16 @@ namespace DSWeb.Areas.CommMng.Controllers
var callbackinfo = JsonConvert.Deserialize<CallBackInfo>(text);
.SaveCallBack(callbackinfo);
var = .GetDingTalkProcessByProcessCode(callbackinfo.processCode);
.SaveCallBack(callbackinfo);
//var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(text.ToString(), new { EventType = "" });
@ -271,7 +289,7 @@ namespace DSWeb.Areas.CommMng.Controllers
var DDresult = DingCallBackMsg.result;
var mes = string.Format("bpms_instance_change Success,title:{0},result:{1}", DDtitle, DDresult);
.DoDeal();
.DoDeal();
//if ()
//result = DingTalkHelper.DingTalk_Instanceinfo("i0P82FAHT_G9TWJmavxGdg03131673000830");
@ -302,6 +320,51 @@ namespace DSWeb.Areas.CommMng.Controllers
return data;
}
[System.Web.Mvc.HttpPost]
public string Test_DingdingCallback(string text)
{
var result = "";
var _r = new DBResult();
var = DingTalkApp.GetDingTalkApp("诚锐东胜对接");
var callbackinfo = JsonConvert.Deserialize<CallBackInfo>(text);
var = .GetDingTalkProcessByProcessCode(callbackinfo.processCode);
.SaveCallBack(callbackinfo);
//var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(text.ToString(), new { EventType = "" });
//var _jsstr = JsonConvert.Serialize(objRtn2);
//BasicDataRefDAL.SaveLog(_jsstr, "admin", "钉钉回调", "保存2");
//取出事件类型字段
//JeffSoft.Logger.Error("DingdingCallback Success,EventType:" + EventType + "");
//第二部分
// { //判断事件类型是否是日程事件
if ("bpms_instance_change" == callbackinfo.EventType)
{
var DingCallBackMsg = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(text.ToString(), new DingCallBackMsg());
var DDtitle = DingCallBackMsg.title;
var DDresult = DingCallBackMsg.result;
var mes = string.Format("bpms_instance_change Success,title:{0},result:{1}", DDtitle, DDresult);
_r= .DoDeal();
//if ()
//result = DingTalkHelper.DingTalk_Instanceinfo("i0P82FAHT_G9TWJmavxGdg03131673000830");
//var _jsstr3 = JsonConvert.Serialize(objRtn2);
//BasicDataRefDAL.SaveLog(_jsstr, "admin", "钉钉回调", "保存3");
//JeffSoft.Logger.Error(mes);
}
var data = Newtonsoft.Json.JsonConvert.SerializeObject(_r);
return data;
}
public class CallBackInfo
{
/// <summary>
@ -331,7 +394,7 @@ namespace DSWeb.Areas.CommMng.Controllers
/// <summary>
///
/// </summary>
public int createTime { get; set; }
public long? createTime { get; set; }
/// <summary>
///
/// </summary>
@ -351,7 +414,7 @@ namespace DSWeb.Areas.CommMng.Controllers
/// <summary>
///
/// </summary>
public int taskId { get; set; }
public long? taskId { get; set; }
}
}
}

@ -4954,6 +4954,7 @@ namespace DSWeb.Areas.CommMng.DAL
var lv = StrToDic(infoList[0].PROPVALUE);
if (lv[fieldname] == fieldvalue) {
result = lv;
result.Add("BSNO", item.BSNO);
return result;
}

@ -23,6 +23,8 @@ using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.Areas.MvcShipping.Helper;
using DSWeb.Common.DB;
using System.Data.Entity.Migrations;
//using DSWeb.MvcShipping.Models.WMS;
namespace DSWeb.MvcShipping.DAL.WMSNewDAL
{
@ -949,10 +951,11 @@ namespace DSWeb.MvcShipping.DAL.WMSNewDAL
{
var result = new DBResult();
//如果是费用入账动作 且配置了钉钉审批入库 则调用
//result = DingTalkHelper.Send_WMSIN(userid, wmsno);
//如果是费用入账动作 且配置了钉钉审批入库 则调用向钉钉发送新建审批实例方法
result = DingTalkHelper.Send_WMSIN(userid, wmsno);
result = TestReadDingtalkInstanceinfo();
//仅用于测试解析读取钉钉审批实例内容
//result = TestReadDingtalkInstanceinfo();
msg = result.Message;
return result.Success;
@ -977,7 +980,7 @@ namespace DSWeb.MvcShipping.DAL.WMSNewDAL
}
private static DBResult DoWMSLOCK(string wmsnoListStr) {
public static DBResult DoWMSLOCK(string wmsnoListStr) {
var result = new DBResult();
@ -1025,29 +1028,168 @@ namespace DSWeb.MvcShipping.DAL.WMSNewDAL
return result;
}
/// <summary>
/// 用于测试读取钉钉审批实例内容
/// </summary>
/// <returns></returns>
public static DBResult TestReadDingtalkInstanceinfo()
{
var result = new DBResult();
//var userid=
try
{
//如果是费用入账动作 且配置了钉钉审批入库 则调用
result = DingTalkHelper.DingTalk_Instanceinfo("Wnr2YHcmSD-PjBWkTDkqIg05361673511300");
//如果是费用入账动作 且配置了钉钉审批入库 则调用
result = DingTalkHelper.DingTalk_Instanceinfo("Wnr2YHcmSD-PjBWkTDkqIg05361673511300");
DingTalkInstanceinfo di = JsonConvert.Deserialize<DingTalkInstanceinfo>(result.Data.ToString());
DingTalkInstanceinfo di = JsonConvert.Deserialize<DingTalkInstanceinfo>(result.Data.ToString());
//根据内容修改wms和wmsin值
var cdc = new CommonDataContext();
var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", "Wnr2YHcmSD-PjBWkTDkqIg05361673511300");
if (lv != null && lv.ContainsKey("instanceId"))
{
var wmsno = lv["BSNO"];
var wmsold = new Models.WMS.WMS_IN_OLD(wmsno);
var wms = wmsold.wms;
var wmslist = wmsold.wms_in;
//var wms = cdc.wms.FirstOrDefault(x => x.WMSNO == wmsno);
//var wmslist = new List<wms_in_md>();
//if (wms != null) {
// wmslist = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wms.GID).ToList();
//}
var updwmsinlist = new List<wms_in_md>();
var newwmsinlist = new List<wms_in_md>();
var = new wms_in_md();
foreach (var item in di.result.formComponentValues)
{
//从其中查找货物信息 并更新至当前
if (item.name == "客户名称")
{
//根据内容修改wms和wmsin值
var cdc = new CommonDataContext();
var lv= BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", "Wnr2YHcmSD-PjBWkTDkqIg05361673511300");
if (lv != null && lv.ContainsKey("instanceId")) {
var wmsno = lv["BSNO"];
var wms = cdc.wms.FirstOrDefault(x => x.WMSNO == wmsno);
var wmslist = new List<wms_in_md>();
if (wms != null) {
wmslist = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wms.GID).ToList();
//var cust=cdc.info_client.Where(x=>x.SHORTNAME==item.value || x.DESCRIPTION==item.value)
}
if (item.name == "入库日期")
{
wms.WMSDATE = Convert.ToDateTime(item.value);
}
if (item.name == "入库信息")
{
var list = FormComponentValues.GetRowValues(item.value);
if (list != null) {
foreach (var DingWmsin in list)
{
var = DingWmsin.getValue("提单号");
var = DingWmsin.getValue("箱号");
if (wmslist.Exists(x => x.BLNO == && x.CNTRNO == ))
{
var updrec = wmslist.First(x => x.BLNO == && x.CNTRNO == );
//new DingTalkFormField("提单号", item.BLNO),
//new DingTalkFormField("箱号", item.CNTRNO),
//new DingTalkFormField("品名", item.GOODSNAME),
//new DingTalkFormField("重量", item.GOODSRKSL.ToString()),
//new DingTalkFormField("件数", item.GOODSPACK.ToString()),
//new DingTalkFormField("尺码", item.CHIMA1.ToString()),
//new DingTalkFormField("库位", item.CHIMA1.ToString())
updrec.GOODSNAME = DingWmsin.getValue("品名");
if (wms.CHARGEUNIT == "吨"|| wms.CHARGEUNIT == "千克")
{
updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
if (wms.CHARGEUNIT == "CBM")
{
updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("尺码"));
updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
updrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数"));
updrec.AREANAME = DingWmsin.getValue("库位");
updrec.DODATE = wms.WMSDATE;
updwmsinlist.Add(updrec);
}
else
{
var newrec = new wms_in_md();
newrec.ASSOCIATEDNO = wms.GID;
newrec.GID = Guid.NewGuid().ToString();
newrec.BLNO = DingWmsin.getValue("提单号");
newrec.CNTRNO = DingWmsin.getValue("箱号");
newrec.CLIENTNAME = wms.CUSTOMERNAME;
newrec.DODATE = wms.WMSDATE;
newrec.GOODSNAME = DingWmsin.getValue("品名");
newrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数"));
newrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
newrec.AREANAME = DingWmsin.getValue("库位");
newrec.CREATETIME = DateTime.Now;
newrec.CHARGEUNIT = wms.CHARGEUNIT;
newrec.CORPID = wms.CORPID;
newwmsinlist.Add(newrec);
}
}
}
}
if (item.name == "车队信息")
{
var list = FormComponentValues.GetRowValues(item.value);
if (list != null && list.Count > 0)
{
var name = list[0].getValue("车队");
var = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == name);
if ( != null && .SHORTNAME != null && .SHORTNAME != "")
{
.CHEDUIID = .GID;
.TRUCKNO = list[0].getValue("车牌号");
}
}
}
}
cdc.wms.AddOrUpdate(wms);
if (updwmsinlist != null && updwmsinlist.Count > 0)
{
foreach (var item in updwmsinlist)
{
item.CHEDUIID = .CHEDUIID;
item.TRUCKNO = .TRUCKNO;
cdc.wms_in.AddOrUpdate(item);
}
}
if (newwmsinlist != null && newwmsinlist.Count > 0)
{
foreach (var item in newwmsinlist)
{
item.CHEDUIID = .CHEDUIID;
item.TRUCKNO = .TRUCKNO;
cdc.wms_in.AddOrUpdate(item);
}
}
cdc.SaveChanges();
}
}
catch (Exception e) {
result.SetErrorInfo(e.Message);
}
return result;
}

@ -12,6 +12,7 @@ using java.util;
using log4net;
using Microsoft.Office.Interop.Excel;
using Newtonsoft.Json;
using NPOI.OpenXmlFormats.Wordprocessing;
using System;
using System.Collections.Generic;
using System.Configuration;
@ -25,6 +26,10 @@ using System.Web;
using Tea;
using static DSWeb.Areas.CommMng.Controllers.WorkFlowController;
using static DSWeb.Areas.MvcShipping.Helper.DingTalk_SendAuditWork;
using Newtonsoft.Json.Linq;
using sun.tools.jar.resources;
using System.Data.Entity.Migrations;
using AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models;
namespace DSWeb.Areas.MvcShipping.Helper
{
@ -145,6 +150,15 @@ namespace DSWeb.Areas.MvcShipping.Helper
}
result = dh.DoSend();
if (result.Success) {
//将wms锁定状态改为是
var cdc = new CommonDataContext();
var _wmsno= wmsno.Replace("'", "");
var wms = cdc.wms.First(x => x.WMSNO == _wmsno);
wms.ISLOCK2= true;
cdc.SaveChanges();
}
}
else {
result.SetErrorInfo("该业务已发送");
@ -372,7 +386,9 @@ namespace DSWeb.Areas.MvcShipping.Helper
DingTalk_OAAuditBody body = new DingTalk_OAAuditBody();
var dp = DingTalkProcess.GetDingTalkProcess("诚锐入货通知");
var app = DingTalkApp.GetDingTalkApp("诚锐东胜对接");
var dp = app.GetProcess("诚锐入货通知");
body.deptId = dp.deptid;//
//获取用户的钉钉id
@ -406,7 +422,7 @@ namespace DSWeb.Areas.MvcShipping.Helper
new DingTalkFormField("重量", item.GOODSRKSL.ToString()),
new DingTalkFormField("件数", item.GOODSPACK.ToString()),
new DingTalkFormField("尺码", item.CHIMA1.ToString()),
new DingTalkFormField("库位", item.CHIMA1.ToString())
new DingTalkFormField("库位", item.AREANAME.ToString())
};
list.Add(newrk);
@ -555,8 +571,199 @@ namespace DSWeb.Areas.MvcShipping.Helper
type = callbackinfo.type;
}
}
public DBResult ReadDingtalkInstanceinfo()
{
var result = new DBResult();
//var userid=
try
{
//如果是费用入账动作 且配置了钉钉审批入库 则调用
result = DingTalkHelper.DingTalk_Instanceinfo(processInstanceId);
DingTalkInstanceinfo di = DSWeb.MvcShipping.Helper.JsonConvert.Deserialize<DingTalkInstanceinfo>(result.Data.ToString());
//根据内容修改wms和wmsin值
var cdc = new CommonDataContext();
var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", "Wnr2YHcmSD-PjBWkTDkqIg05361673511300");
if (lv != null && lv.ContainsKey("instanceId"))
{
var wmsno = lv["BSNO"];
var wmsold = new DSWeb.MvcShipping.Models.WMS.WMS_IN_OLD(wmsno);
var wms = wmsold.wms;
var wmslist = wmsold.wms_in;
//var wms = cdc.wms.FirstOrDefault(x => x.WMSNO == wmsno);
//var wmslist = new List<wms_in_md>();
//if (wms != null) {
// wmslist = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wms.GID).ToList();
//}
var updwmsinlist = new List<wms_in_md>();
var newwmsinlist = new List<wms_in_md>();
var = new wms_in_md();
foreach (var item in di.result.formComponentValues)
{
//从其中查找货物信息 并更新至当前
if (item.name == "客户名称")
{
//var cust=cdc.info_client.Where(x=>x.SHORTNAME==item.value || x.DESCRIPTION==item.value)
}
if (item.name == "入库日期")
{
wms.WMSDATE = Convert.ToDateTime(item.value);
}
if (item.name == "入库信息")
{
var list = FormComponentValues.GetRowValues(item.value);
if (list != null)
{
foreach (var DingWmsin in list)
{
var = DingWmsin.getValue("提单号");
var = DingWmsin.getValue("箱号");
if (wmslist.Exists(x => x.BLNO == && x.CNTRNO == ))
{
var updrec = wmslist.First(x => x.BLNO == && x.CNTRNO == );
//new DingTalkFormField("提单号", item.BLNO),
//new DingTalkFormField("箱号", item.CNTRNO),
//new DingTalkFormField("品名", item.GOODSNAME),
//new DingTalkFormField("重量", item.GOODSRKSL.ToString()),
//new DingTalkFormField("件数", item.GOODSPACK.ToString()),
//new DingTalkFormField("尺码", item.CHIMA1.ToString()),
//new DingTalkFormField("库位", item.CHIMA1.ToString())
updrec.GOODSNAME = DingWmsin.getValue("品名");
if (wms.CHARGEUNIT == "吨" || wms.CHARGEUNIT == "千克")
{
updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
if (wms.CHARGEUNIT == "CBM")
{
updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("尺码"));
updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
updrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数"));
updrec.AREANAME = DingWmsin.getValue("库位");
updrec.DODATE = wms.WMSDATE;
updwmsinlist.Add(updrec);
}
else
{
var newrec = new wms_in_md();
newrec.ASSOCIATEDNO = wms.GID;
newrec.GID = Guid.NewGuid().ToString();
newrec.BLNO = DingWmsin.getValue("提单号");
newrec.CNTRNO = DingWmsin.getValue("箱号");
newrec.CLIENTNAME = wms.CUSTOMERNAME;
newrec.DODATE = wms.WMSDATE;
newrec.GOODSNAME = DingWmsin.getValue("品名");
if (wms.CHARGEUNIT == "吨" || wms.CHARGEUNIT == "千克")
{
newrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
newrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
newrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
if (wms.CHARGEUNIT == "CBM")
{
newrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("尺码"));
newrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量"));
newrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量"));
newrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码"));
newrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码"));
}
newrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数"));
newrec.AREANAME = DingWmsin.getValue("库位");
newrec.CREATETIME = DateTime.Now;
newrec.CHARGEUNIT = wms.CHARGEUNIT;
newrec.CORPID = wms.CORPID;
newwmsinlist.Add(newrec);
}
}
}
}
if (item.name == "车队信息")
{
var list = FormComponentValues.GetRowValues(item.value);
if (list != null && list.Count > 0)
{
var name = list[0].getValue("车队");
var = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == name);
if ( != null && .SHORTNAME != null && .SHORTNAME != "")
{
.CHEDUIID = .GID;
.TRUCKNO = list[0].getValue("车牌号");
}
}
}
}
cdc.wms.AddOrUpdate(wms);
if (updwmsinlist != null && updwmsinlist.Count > 0)
{
foreach (var item in updwmsinlist)
{
item.CHEDUIID = .CHEDUIID;
item.TRUCKNO = .TRUCKNO;
cdc.wms_in.AddOrUpdate(item);
}
}
if (newwmsinlist != null && newwmsinlist.Count > 0)
{
foreach (var item in newwmsinlist)
{
item.CHEDUIID = .CHEDUIID;
item.TRUCKNO = .TRUCKNO;
cdc.wms_in.AddOrUpdate(item);
}
}
wms.ISLOCK2 = false;
cdc.wms.AddOrUpdate(wms);
cdc.SaveChanges();
//然后执行入库的费用入账原逻辑
DSWeb.MvcShipping.DAL.WMSNewDAL.WMSNewDAL.DoWMSLOCK(wmsno);
}
}
catch (Exception e)
{
result.SetErrorInfo(e.Message);
}
return result;
}
}
public class OperationRecords
{
@ -601,20 +808,25 @@ namespace DSWeb.Areas.MvcShipping.Helper
/// </summary>
public string value { get; set; }
public GetRowValues() {
public static List<row> GetRowValues(string value)
{
//用value值文本来解析成 行信息
var result = new ();
var result = new List<row>();
if (value.Contains("\\\"rowValue\\\""))
if (value.Contains("\"rowValue\""))
{
try
{
var _value = value.Replace("\\", "");
var hxx = JsonConvert.DeserializeObject<>(_value);
result = hxx;
var jarr = JArray.Parse(value);
foreach (var item in jarr)
{
var obj = item as JObject;
var row =JsonConvert.DeserializeObject<row>(obj.ToString());
result.Add(row);
}
}
catch (Exception ex)
{ }
@ -636,6 +848,10 @@ namespace DSWeb.Areas.MvcShipping.Helper
/// <summary>
///
/// </summary>
public string finishTime { get; set; }
/// <summary>
///
/// </summary>
public string pcUrl { get; set; }
/// <summary>
///
@ -652,7 +868,7 @@ namespace DSWeb.Areas.MvcShipping.Helper
/// <summary>
///
/// </summary>
public int taskId { get; set; }
public long? taskId { get; set; }
/// <summary>
///
/// </summary>
@ -661,6 +877,10 @@ namespace DSWeb.Areas.MvcShipping.Helper
public class Result
{
/// <summary>
///
/// </summary>
public string finishTime { get; set; }
/// <summary>
///
/// </summary>
@ -728,13 +948,19 @@ namespace DSWeb.Areas.MvcShipping.Helper
}
public class
{
public List<row> row { get; set; }
}
public class row
{
public List<rowValue> rowValue { get; set; }
public string rowNumber { get; set; }
public string getValue(string fieldname) {
public string getValue(string fieldname)
{
var result = "";
if (rowValue.Exists(x => x.label == fieldname)) {
if (rowValue.Exists(x => x.label == fieldname))
{
result = rowValue.First(x => x.label == fieldname).value;
}
return result;
@ -747,42 +973,99 @@ namespace DSWeb.Areas.MvcShipping.Helper
public string value { get; set; }
public string key { get; set; }
}
#endregion
#region 钉钉业务类
public class DingTalkProcess {
public string processname { get; set; }
public string processCode { get; set; }
public class DingTalkApp {
public string token { get; set; }
public string aes_key { get; set; }
public string appkey { get; set; }
public long agentid { get; set; }
public long deptid { get; set; }
//public string callbackstr { get; set; }
public static DingTalkApp GetDingTalkApp(string appname)
{
public DingTalkCallbackDealHelper callbackinfo { get; set; }
var result = new DingTalkApp();
if (appname == "ddlucky测试应用")
{
result = new DingTalkApp_ddlucky();
return result;
public void SaveCallBack(CallBackInfo _callbackinfo) {
callbackinfo = new DingTalkCallbackDealHelper(_callbackinfo);
}
if (appname == "诚锐东胜对接")
{
result = new DingTalkApp_();
return result;
}
return result;
}
public DingTalkProcess() { }
public DingTalkProcess(string processname) { this.processname = processname; }
/// <summary>
/// 这些数值来自于钉钉中某个组织的某个应用。一个应用可以监听多个实际业务的返回值
/// </summary>
/// <param name="processname"></param>
/// <returns></returns>
public static DingTalkProcess GetDingTalkProcess(string processname) {
public virtual DingTalkProcess GetProcess(string processname) {
return new DingTalkProcess();
}
public virtual DingTalkProcess GetDingTalkProcessByProcessCode(string processcode)
{
return new DingTalkProcess();
}
}
public class DingTalkApp_ddlucky : DingTalkApp
{
public DingTalkApp_ddlucky() {
token = "zbGFOwrH6zCvq3VE3izLmWRTNUC1YcX";
aes_key = "sb6GkCKsUwNQo3RKbX1MzHKea1ZsE221n3xQ9hwJBMK";
appkey = "dingsaofiohmsrcbxyef";
agentid = 2298782307;
deptid = 809181118;
}
public static DingTalkProcess GetDingTalkProcess(string processname)
{
var result = new DingTalkProcess();
if (processname == "测试入货通知") {
if (processname == "测试入货通知")
{
result = new DingTalkProcess_(processname);
return result;
}
return result;
}
public static DingTalkProcess GetDingTalkProcessByProcessCode(string processCode)
{
var processdic = new Dictionary<string, string> {
{ "PROC-0DC40EA2-E9D2-4917-A597-AD77EC055C49","测试入货通知"}
};
if (processdic.ContainsKey(processCode))
{
return GetDingTalkProcess(processdic[processCode]);
}
else { return new DingTalkProcess(); }
}
}
public class DingTalkApp_ : DingTalkApp
{
public DingTalkApp_()
{
token = "CWhvNvfyuNf9D8halMs5PyHV70CrFx3E";
aes_key = "O5u6L8YnUaucnC8FyFNMeMeGE5uoYSAGFGdg3rOHftt";
appkey = "dingkt5caipnn4fbuqsf";
agentid = 2365401074;
deptid = 432400353;
}
public static DingTalkProcess GetDingTalkProcess(string processname)
{
var result = new DingTalkProcess();
if (processname == "诚锐入货通知")
{
result = new DingTalkProcess_(processname);
@ -791,6 +1074,45 @@ namespace DSWeb.Areas.MvcShipping.Helper
return result;
}
new public static DingTalkProcess GetDingTalkProcessByProcessCode(string processCode)
{
var processdic = new Dictionary<string, string> {
{ "PROC-0888A19C-0562-42AC-A9C6-24E4C4398410","诚锐入货通知"}
};
if (processdic.ContainsKey(processCode))
{
return GetDingTalkProcess(processdic[processCode]);
}
else { return new DingTalkProcess(); }
}
}
public class DingTalkProcess: DingTalkApp
{
public string processname { get; set; }
public string processCode { get; set; }
//public string callbackstr { get; set; }
public DingTalkCallbackDealHelper callbackinfo { get; set; }
public void SaveCallBack(CallBackInfo _callbackinfo) {
callbackinfo = new DingTalkCallbackDealHelper(_callbackinfo);
}
public DingTalkProcess() { }
public DingTalkProcess(string processname) { this.processname = processname; }
/// <summary>
/// 这些数值来自于钉钉中某个组织的某个应用。一个应用可以监听多个实际业务的返回值
/// </summary>
/// <param name="processname"></param>
/// <returns></returns>
public virtual DBResult DoDeal() { return new DBResult(); }
}
@ -799,12 +1121,14 @@ namespace DSWeb.Areas.MvcShipping.Helper
public DingTalkProcess_(string processname)
{
this.processname = processname;
//token = "zbGFOwrH6zCvq3VE3izLmWRTNUC1YcX";
//aes_key = "sb6GkCKsUwNQo3RKbX1MzHKea1ZsE221n3xQ9hwJBMK";
//appkey = "dingsaofiohmsrcbxyef";
//agentid = 2298782307;
processCode = "PROC-0DC40EA2-E9D2-4917-A597-AD77EC055C49";
token = "zbGFOwrH6zCvq3VE3izLmWRTNUC1YcX";
aes_key = "sb6GkCKsUwNQo3RKbX1MzHKea1ZsE221n3xQ9hwJBMK";
appkey = "dingsaofiohmsrcbxyef";
agentid = 2298782307;
agentid = 809181118;
}
@ -823,17 +1147,20 @@ namespace DSWeb.Areas.MvcShipping.Helper
{
public DingTalkProcess_(string processname) {
this.processname = processname;
//token = "CWhvNvfyuNf9D8halMs5PyHV70CrFx3E";
//aes_key = "O5u6L8YnUaucnC8FyFNMeMeGE5uoYSAGFGdg3rOHftt";
//appkey = "dingkt5caipnn4fbuqsf";
//agentid = 2365401074;
processCode = "PROC-0888A19C-0562-42AC-A9C6-24E4C4398410";
token = "CWhvNvfyuNf9D8halMs5PyHV70CrFx3E";
aes_key = "O5u6L8YnUaucnC8FyFNMeMeGE5uoYSAGFGdg3rOHftt";
appkey = "dingkt5caipnn4fbuqsf";
agentid = 2365401074;
deptid = 432400353;
}
public override DBResult DoDeal()
{
return new DBResult();
//return new DBResult();
return callbackinfo.ReadDingtalkInstanceinfo();
}
}

@ -3,6 +3,8 @@ using DSWeb.Common.DB;
using System.Collections.Generic;
using HcUtility.Core;
using Newtonsoft.Json;
using DSWeb.Areas.CommMng.DAL;
using System.Linq;
namespace DSWeb.MvcShipping.Models.WMS
{
@ -2997,6 +2999,15 @@ namespace DSWeb.MvcShipping.Models.WMS
public WMS_IN_OLD(string wmsno) {
var cdc = new CommonDataContext();
wms = cdc.wms.FirstOrDefault(x => x.WMSNO == wmsno);
if (wms != null)
{
wms_in = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wms.GID).ToList();
}
}
}
#region 新的仓储数据结构

Loading…
Cancel
Save