诚锐钉钉审批,入库流程取消车辆信息列表,在入库信息加车队和车牌号

DS7_JinGang
ddlucky 2 years ago
parent 67a7f137c8
commit ff878d2261

@ -326,6 +326,7 @@ namespace DSWeb.Areas.CommMng.Controllers
public string Test_DingdingCallback(string text) public string Test_DingdingCallback(string text)
{ {
var result = ""; var result = "";
try {
var _r = new DBResult(); var _r = new DBResult();
var appname = MsSysParamSetDAL.GetSysParamValue("DingTalkAppName"); var appname = MsSysParamSetDAL.GetSysParamValue("DingTalkAppName");
@ -371,9 +372,15 @@ namespace DSWeb.Areas.CommMng.Controllers
var data = Newtonsoft.Json.JsonConvert.SerializeObject(_r); var data = Newtonsoft.Json.JsonConvert.SerializeObject(_r);
return data; return data;
} }
catch(Exception ex)
{
return ex.Message;
}
}
public class CallBackInfo public class CallBackInfo
{ {

@ -23,6 +23,7 @@ using DSWeb.MvcShipping.DAL.WMSStock;
using System.Configuration; using System.Configuration;
using DSWeb.Areas.MvcShipping.Helper; using DSWeb.Areas.MvcShipping.Helper;
using NPOI.HSSF.Record; using NPOI.HSSF.Record;
using Quartz.Util;
namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL
{ {
@ -1898,6 +1899,8 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL
Database db = DatabaseFactory.CreateDatabase(); Database db = DatabaseFactory.CreateDatabase();
gids = "'" + gids.Trim().Replace(",", "','") + "'";
//20230128 改为 //20230128 改为
if (ConfigurationManager.AppSettings["DingTalkAuditWMSIN"] == "true") if (ConfigurationManager.AppSettings["DingTalkAuditWMSIN"] == "true")
{//向钉钉发送出库审批流程 {//向钉钉发送出库审批流程
@ -1914,20 +1917,32 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL
strSql.Append(" ,ol.PROPVALUE"); strSql.Append(" ,ol.PROPVALUE");
strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno ");
strSql.Append(" left join OP_LOGICINFO ol on ol.BSNO=o.bsno "); strSql.Append(" left join OP_LOGICINFO ol on ol.BSNO=o.bsno ");
strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0");
//var 需要发送给钉钉出库审核流程的业务编号List = new List<string>(); //var 需要发送给钉钉出库审核流程的业务编号List = new List<string>();
var outbsnodic = new Dictionary<string, string>();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{ {
while (reader.Read()) while (reader.Read())
{ {
var outbsno = Convert.ToString(reader["OUTNO"]); var outbsno = Convert.ToString(reader["OUTNO"]);
if(!outbsnodic.ContainsKey(outbsno))
{
var instanceId = Convert.ToString(reader["PROPVALUE"]); var instanceId = Convert.ToString(reader["PROPVALUE"]);
outbsnodic.Add(outbsno, instanceId);
}
}
}
foreach(var item in outbsnodic)
{
if (!string.IsNullOrWhiteSpace(instanceId)) continue; //if (!string.IsNullOrWhiteSpace(item.Value)) continue;
var _r = DingTalkHelper.Send_WMSOUT(strUserID, outbsno); var _r = DingTalkHelper.Send_WMSOUT(strUserID, item.Key);
if (!_r.Success) if (!_r.Success)
{ {
_r0.SetErrorInfo(_r.Message); _r0.SetErrorInfo(_r.Message);
@ -1947,8 +1962,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL
} }
} }
result.SetErrorInfo("钉钉提交成功");
}
return result; return result;
} }
else { else {
@ -1992,7 +2006,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL
strSql.Append(" o.TRUCKNAME as TRUCKNAME_OUT,isnull(d.GOODSOUTFEEAP,0) AS GOODSOUTFEEAP_OUT,"); strSql.Append(" o.TRUCKNAME as TRUCKNAME_OUT,isnull(d.GOODSOUTFEEAP,0) AS GOODSOUTFEEAP_OUT,");
strSql.Append(" isnull(d.ARFEE,0) AS ARFEE_OUT,isnull(d.ARFEE_2,0) AS ARFEE_2_OUT,d.GID OUTDEGID"); strSql.Append(" isnull(d.ARFEE,0) AS ARFEE_OUT,isnull(d.ARFEE_2,0) AS ARFEE_2_OUT,d.GID OUTDEGID");
strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno ");
strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0");
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{ {

@ -509,6 +509,7 @@ namespace DSWeb.Areas.MvcShipping.Helper
foreach (var item in wmsinList) foreach (var item in wmsinList)
{ {
var = list.First(x => x.GID == item.CHEDUIID).SHORTNAME;
var newrk = new List<DingTalkFormField> var newrk = new List<DingTalkFormField>
{ {
new DingTalkFormField("提单号", item.BLNO), new DingTalkFormField("提单号", item.BLNO),
@ -517,7 +518,9 @@ namespace DSWeb.Areas.MvcShipping.Helper
new DingTalkFormField("重量", item.GOODSRKSL.ToString()), new DingTalkFormField("重量", item.GOODSRKSL.ToString()),
new DingTalkFormField("件数", item.GOODSPACK.ToString()), new DingTalkFormField("件数", item.GOODSPACK.ToString()),
new DingTalkFormField("尺码", item.CHIMA1.ToString()), new DingTalkFormField("尺码", item.CHIMA1.ToString()),
new DingTalkFormField("库位", item.AREANAME.ToString()) new DingTalkFormField("库位", item.AREANAME.ToString()),
new DingTalkFormField("车队", ),
new DingTalkFormField("车牌号", item.TRUCKNO.ToString())
}; };
list.Add(newrk); list.Add(newrk);
@ -545,7 +548,9 @@ namespace DSWeb.Areas.MvcShipping.Helper
var = new DingTalkFormField("入库信息", JsonConvert.SerializeObject(list)); var = new DingTalkFormField("入库信息", JsonConvert.SerializeObject(list));
var = new DingTalkFormField("车队信息", JsonConvert.SerializeObject(list));
//20230130 取消入库审核的车队信息
//var 车队信息 = new DingTalkFormField("车队信息", JsonConvert.SerializeObject(车队信息list));
body.formComponentValues = new List<DingTalkFormField> body.formComponentValues = new List<DingTalkFormField>
{ {
@ -553,8 +558,7 @@ namespace DSWeb.Areas.MvcShipping.Helper
//增加字段内容 //增加字段内容
new DingTalkFormField("客户名称", wms.CUSTOMERNAME), new DingTalkFormField("客户名称", wms.CUSTOMERNAME),
new DingTalkFormField("入库日期", ((DateTime)wms.WMSDATE).ToString("yyyy-MM-dd")), new DingTalkFormField("入库日期", ((DateTime)wms.WMSDATE).ToString("yyyy-MM-dd")),
,
}; };
jsonObj = body; jsonObj = body;
@ -1590,6 +1594,16 @@ namespace DSWeb.Areas.MvcShipping.Helper
updrec.AREANAME = DingWmsin.getValue("库位"); updrec.AREANAME = DingWmsin.getValue("库位");
updrec.DODATE = wms.WMSDATE; updrec.DODATE = wms.WMSDATE;
//if(string.IsNullOrWhiteSpace(DingWmsin.getValue("车牌号")))
updrec.TRUCKNO = DingWmsin.getValue("车牌号");
var name= DingWmsin.getValue("车队");
var infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == name);
if(infoclient!=null && string.IsNullOrWhiteSpace( infoclient.SHORTNAME))
updrec.CHEDUIID = infoclient.SHORTNAME;
updwmsinlist.Add(updrec); updwmsinlist.Add(updrec);
} }
else else
@ -1631,27 +1645,36 @@ namespace DSWeb.Areas.MvcShipping.Helper
newrec.CREATETIME = DateTime.Now; newrec.CREATETIME = DateTime.Now;
newrec.CHARGEUNIT = wms.CHARGEUNIT; newrec.CHARGEUNIT = wms.CHARGEUNIT;
newrec.CORPID = wms.CORPID; newrec.CORPID = wms.CORPID;
newrec.TRUCKNO = DingWmsin.getValue("车牌号");
var name = DingWmsin.getValue("车队");
var infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == name);
if (infoclient != null && string.IsNullOrWhiteSpace(infoclient.SHORTNAME))
newrec.CHEDUIID = infoclient.SHORTNAME;
newwmsinlist.Add(newrec); newwmsinlist.Add(newrec);
} }
} }
} }
} }
if (item.name == "车队信息") //if (item.name == "车队信息")
{ //{
var list = FormComponentValues.GetRowValues(item.value); // var 车队信息list = FormComponentValues.GetRowValues(item.value);
if (list != null && list.Count > 0) // if (车队信息list != null && 车队信息list.Count > 0)
{ // {
var name = list[0].getValue("车队"); // var 车队name = 车队信息list[0].getValue("车队");
var = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == name); // var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name);
if ( != null && .SHORTNAME != null && .SHORTNAME != "") // if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "")
{ // {
.CHEDUIID = .GID; // 车辆信息.CHEDUIID = 车队.GID;
.TRUCKNO = list[0].getValue("车牌号"); // 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号");
} // }
} // }
} //}
} }
cdc.wms.AddOrUpdate(wms); cdc.wms.AddOrUpdate(wms);
if (updwmsinlist != null && updwmsinlist.Count > 0) if (updwmsinlist != null && updwmsinlist.Count > 0)
@ -1814,19 +1837,13 @@ namespace DSWeb.Areas.MvcShipping.Helper
} }
} }
if (item.name == "车信息") if (item.name == "车信息")
{ {
var list = FormComponentValues.GetRowValues(item.value); var list = FormComponentValues.GetRowValues(item.value);
if (list != null && list.Count > 0) 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("车牌号"); .TRUCKNO = list[0].getValue("车牌号");
} }
}
} }
} }

Loading…
Cancel
Save