dev
hanxuntao 4 weeks ago
commit 8a7ccb6ef6

@ -1050,7 +1050,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1059,7 +1059,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1068,7 +1068,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1077,7 +1077,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1086,7 +1086,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1095,7 +1095,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1104,7 +1104,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1170,7 +1170,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1179,7 +1179,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1188,7 +1188,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1197,7 +1197,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1206,7 +1206,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1215,7 +1215,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1224,7 +1224,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1291,13 +1291,19 @@ namespace DSWeb.Areas.Account.Controllers
var j = 0;
var accdatesqlstr = "";
var DateAccdatesqlstr = "";
var sqlstr = "";
var pcsqlstr = "";
var wmssqlstr = "";
var OPwmssqlstr = "";
var selectbsno = "";
if (isAccDate == "1") accdatesqlstr = ",ACCDATE='"+AccDate+"'";
if (isAccDate == "1")
{
accdatesqlstr = ",ACCDATE='" + AccDate + "'";
DateAccdatesqlstr = ",ACCDATE='" + AccDate + "-01'";
}
if (isbslock == "1")
{
pcsqlstr = ",BillStatus=1 ";
@ -1386,7 +1392,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=1 " + DateAccdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1395,7 +1401,7 @@ namespace DSWeb.Areas.Account.Controllers
else if(enumValue.OPLB == "OP_WMS_MOVE")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1404,7 +1410,7 @@ namespace DSWeb.Areas.Account.Controllers
else if(enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1413,7 +1419,7 @@ namespace DSWeb.Areas.Account.Controllers
else if(enumValue.OPLB == "OP_WMS_IN_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1422,7 +1428,7 @@ namespace DSWeb.Areas.Account.Controllers
else if(enumValue.OPLB == "OP_WMS_OUT_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1431,7 +1437,7 @@ namespace DSWeb.Areas.Account.Controllers
else if(enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1440,7 +1446,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=1 " + accdatesqlstr + OPwmssqlstr + " WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=1 " + DateAccdatesqlstr + OPwmssqlstr + " WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -1854,7 +1860,12 @@ namespace DSWeb.Areas.Account.Controllers
{
var accdatesqlstr = "";
if (isAccDate == "1") accdatesqlstr = ",ACCDATE='" + AccDate + "'";
var DateAccdatesqlstr = "";
if (isAccDate == "1")
{
accdatesqlstr = ",ACCDATE='" + AccDate + "'";
DateAccdatesqlstr = ",ACCDATE='" + AccDate + "-01'";
}
var FEELOCKUPDATEEXCHANGE = MsSysParamSetDAL.GetData("PARAMNAME='FEELOCKUPDATEEXCHANGE'");
var billData=GetFeeDataList(billsql,Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]),"BS");
var json = JsonConvert.Serialize(new { Success = true, Message = "锁定成功" });
@ -1884,37 +1895,37 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 "+ DateAccdatesqlstr + " WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
}
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET BillLock=1 " + accdatesqlstr + " WHERE WMSDOID=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=1 " + accdatesqlstr + " WHERE WMSTRANSFERGOODSID=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET BillLock=1 " + accdatesqlstr + " WHERE WMSDOID=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET BillLock=1 " + accdatesqlstr + " WHERE WMSDOID=@BSNO ");
}
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=1 " + accdatesqlstr + " WHERE WMSPLANID=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET BillLock=1 " + accdatesqlstr + " WHERE WMSPLANID=@BSNO ");
}
cmdUpdate.Parameters.Clear();
@ -1965,37 +1976,37 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=1 WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
}
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET BillLock=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=1 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=1 WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=1 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=1 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=1 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=1 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}
else
{
@ -2269,7 +2280,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=0 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=0 WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2278,7 +2289,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET BillLock=0 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET BillLock=0 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2287,7 +2298,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=0 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=0 WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2296,7 +2307,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET BillLock=0 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET BillLock=0 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2305,7 +2316,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET BillLock=0 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET BillLock=0 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2314,7 +2325,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=0 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=0 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2323,7 +2334,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET BillLock=0 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET BillLock=0 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2385,7 +2396,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
var cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=0 "+ opwmssqlstr + " WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=0 "+ opwmssqlstr + " WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
cmdUpdate.Parameters.Clear();
db.AddInParameter(cmdUpdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdUpdate, tran);
@ -2651,7 +2662,7 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=0 WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET BillLock=0 WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
}
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
@ -2661,27 +2672,27 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=0 WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET BillLock=0 WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET BillLock=0 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET BillLock=0 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET BillLock=0 WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET BillLock=0 WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=0 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET BillLock=0 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET BillLock=0 WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET BillLock=0 WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}
//End
@ -2724,37 +2735,37 @@ namespace DSWeb.Areas.Account.Controllers
else if (enumValue.OPLB == "OP_WMS_FEEDUI")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSDUIID in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
@"UPDATE OP_WMS_FEEDUI_STORAGE SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSDUIID) in(select MASTERNO from v_op_bs where BSNO=@BSNO) ");
}
else if (enumValue.OPLB == "OP_WMS_MOVE")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_MOVE SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_MOVE SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_TRANSFERGOODS")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSTRANSFERGOODSID=@BSNO ");
@"UPDATE OP_WMS_TRANSFERGOODS SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSTRANSFERGOODSID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_IN_DO SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_OUT_DO")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSDOID=@BSNO ");
@"UPDATE OP_WMS_OUT_DO SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSDOID)=@BSNO ");
}
else if (enumValue.OPLB == "VW_OP_WMS_OUT_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_OUT_PLAN SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}
else if (enumValue.OPLB == "OP_WMS_IN_PLAN")
{
cmdUpdate = db.GetSqlStringCommand(
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=0 "+OPwmssqlstr+" WHERE WMSPLANID=@BSNO ");
@"UPDATE OP_WMS_IN_PLAN SET FEESTATUS=0 "+OPwmssqlstr+ " WHERE Convert(varchar(50),WMSPLANID)=@BSNO ");
}

@ -8097,7 +8097,6 @@ namespace DSWeb.Areas.CommMng.DAL
#endregion
#region 测试逻辑
//_data.openid = "oLC-O7beYjw18mo-v7ETryAtE1f8";
//_data.errcode = 0;
#endregion

@ -47,6 +47,7 @@ using DSWeb.MvcShipping.Models.MsOpSeae;
using DSWeb.Areas.Dispatch.Models;
using DSWeb.MvcShipping.Models.MsChFee;
using static DSWeb.Areas.CommMng.DAL.PublicAPIDAL.OAHelper;
using Microsoft.AspNet.SignalR.Hosting;
//using System.Web.Http;
namespace DSWeb.Areas.Dispatch.Controllers
@ -473,8 +474,8 @@ namespace DSWeb.Areas.Dispatch.Controllers
try
{
var bsno= QueryInfo.bsno;
var List = DSWeb.MvcShipping.DAL.MsChFeeDAL.MsChFeeDAL.GetDataList($" bsno='{bsno}' ", 1, "seaeOrder", userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
var List = DSWeb.MvcShipping.DAL.MsChFeeDAL.MsChFeeDAL.GetDataList($" bsno='{bsno}' ", 2, "seaeOrder", userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
var List = DSWeb.MvcShipping.DAL.MsChFeeDAL.MsChFeeDAL.GetDataList($" bsno='{bsno}' ", 1, "", userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
var List = DSWeb.MvcShipping.DAL.MsChFeeDAL.MsChFeeDAL.GetDataList($" bsno='{bsno}' ", 2, "", userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
var evList = new List<DSWeb.MvcShipping.Models.MsChFee.MsChFee>();
if (List != null && List.Count > 0) {
@ -704,7 +705,6 @@ namespace DSWeb.Areas.Dispatch.Controllers
return Json(new { ErrorCode = 500, Message = "发生错误" }, JsonRequestBehavior.AllowGet);
}
#endregion
/// <summary>
@ -3347,82 +3347,736 @@ namespace DSWeb.Areas.Dispatch.Controllers
}
}
/// <summary>
/// 销售订舱审核审批列表
/// </summary>
/// <param name="logininfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult GetAuditDataList(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
#endregion
}
var searchParams = JsonConvert.DeserializeObject<List<SearchParam>>(postContent);
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
var condition = SearchParam.getcondition(searchParams);
var datalist = MsSeaeOrderDAL.GetAuditDataList( condition, userinfo.USERID, userinfo.CODENAME, userinfo.COMPANYID, QueryInfo.start, QueryInfo.limit);
var totalcount = MsSeaeOrderDAL.getAuditCount(condition, userinfo.USERID, userinfo.CODENAME, userinfo.COMPANYID);
return Json(new { ErrorCode = 0, start = QueryInfo.start, limit = QueryInfo.limit, totalcount = totalcount, Data = datalist });
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
public class SearchParam
{
public string FieldName { get; set; }
public string SearchValue { get; set; }
/// <summary>
/// equal like equalandbigger equalandsmaller
/// 销售订舱按条件查询数量
/// </summary>
public string SearchType { get; set; } = "like";
/// <param name="logininfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult GetOrderCount(EnumQueryInfo QueryInfo)
{
try
{
public string getcondition() {
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var result = FieldName;
var searchParams = JsonConvert.DeserializeObject<List<SearchParam>>(postContent);
if (SearchType == "equal") {
result += $" = '{SearchValue}'";
}
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (SearchType == "like")
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
var condition = SearchParam.getcondition(searchParams);
var data = MsSeaeOrderDAL.getTotalCount(condition, userinfo.USERID, userinfo.CODENAME, userinfo.COMPANYID);
return Json(new { ErrorCode = 0, start = QueryInfo.start, limit = QueryInfo.limit, totalcount = data, Data = data });
}
catch (Exception e)
{
result += $" like '%{SearchValue}%' ";
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
if (SearchType == "equalandbigger")
/// <summary>
/// 获取ctn列表
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult GetOrderCtnList(EnumQueryInfo QueryInfo)
{
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
result += $" >= '{SearchValue}'";
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
if (SearchType == "equalandsmaller")
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user .Where(x => x.CODENAME.ToUpper() == "ADMIN").FirstOrDefault();
#endregion
var _result = Json(new { });
try
{
result += $" <= '{SearchValue}'";
var condition = $" ORDNO='{QueryInfo.bsno}'";
var evList = MsSeaeOrderDAL.GetBodyList(condition);
_result = Json(new
{
ErrorCode = 0,
Message = "获取成功",
BaseInfo = evList
});
return _result;
}
catch (Exception e)
{
BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), e.Message, "wxapp", "查询错误");
return result;
_result = Json(new
{
ErrorCode = 500,
Message = e.Message,
Data = e
});
}
return Json(new { ErrorCode = 500, Message = "发生错误" }, JsonRequestBehavior.AllowGet);
}
public static string getcondition(List<SearchParam> SearchParams) {
var condition = " 1 = 1 ";
foreach (var item in SearchParams)
/// <summary>
/// 删除业务
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult DeleteSeaeOrderList(EnumQueryInfo QueryInfo)
{
try
{
condition += " and " + item.getcondition();
}
return condition;
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<SaveSeaeOrderParam>(postContent);
var headcondition = $"B.ORDNO='{saveinfo.Head.ORDNO}'";
var headData = MsSeaeOrderDAL.GetData(headcondition);
var bodyList = saveinfo.Body;
if (headData.ORSTATUS == "8" || headData.ORSTATUS == "0" || headData.ORSTATUS == "1" || headData.ORSTATUS == "4")
{
var _result = Json(new
{
ErrorCode = 500,
Message = "当前状态下不允许删除此业务信息"
});
return _result;
}
var feelist = cdc.ch_fee.Where(x => x.BSNO == headData.BSNO).ToList();
if (feelist != null && feelist.Count > 0) {
var _result = Json(new
{
ErrorCode = 500,
Message = "此业务目前还有费用,不允许删除"
});
return _result;
}
var modb = new ModelObjectDB();
DBResult result = modb.Delete(headData);
if (result.Success == true) { MsSeaeOrderDAL.DeleteDetail(headData); }
//var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL(saveinfo.opstatus, userinfo.USERID, userinfo.SHOWNAME, headData, bodyList);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "删除错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
}
public class SaveParam
{
/// <summary>
/// add edit
/// 删除ctn
/// </summary>
public string opstatus { get; set; }
}
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult DeleteOrderCtnList(EnumQueryInfo QueryInfo)
{
public class SaveSeaeOrderParam: SaveParam
{
public MsSeaeOrder Head {get;set;}
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
public List<MsSeaeOrderCtn> Body { get; set; }
}
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
public class SaveFeeListParam : SaveParam
{
public string bsno { get; set; }
public List<MsChFee> Body { get; set; }
}
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user .Where(x => x.CODENAME.ToUpper() == "ADMIN").FirstOrDefault();
#endregion
var _result = Json(new { });
try
{
var DeleteParams = JsonConvert.DeserializeObject<DelFeeListParam>(postContent);
var delids = DeleteParams.feeids.Replace(",", "','");
//20241024 只有录入和驳回状态可以删明细
//(CASE ORSTATUS WHEN '8' THEN '确认订舱' WHEN '0' THEN '审核通过' WHEN '1' THEN '提交审核' WHEN '2' THEN '驳回' WHEN '4' THEN '退舱' else '录入状态' end)
var headcondition = $" B.ORDNO='{DeleteParams.bsno}' ";
var head = MsSeaeOrderDAL.GetData(headcondition);
if (head.ORSTATUS == "8" || head.ORSTATUS == "0" || head.ORSTATUS == "1" || head.ORSTATUS == "4") {
_result = Json(new
{
ErrorCode = 500,
Message = "当前状态下不允许删除箱信息"
});
return _result;
}
var _r = MsSeaeOrderDAL.DeleteDetail3(DeleteParams.bsno, delids);
_result = Json(new
{
ErrorCode = 0,
Message = "删除成功"
});
return _result;
}
catch (Exception e)
{
BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), e.Message, "wxapp", "查询错误");
_result = Json(new
{
ErrorCode = 500,
Message = e.Message,
Data = e
});
}
return Json(new { ErrorCode = 500, Message = "发生错误" }, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// 提交审核
/// </summary>
/// <param name="QueryInfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult SubmitAudit(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<SaveSeaeOrderParam>(postContent);
var headData = saveinfo.Head;
var bodyList = saveinfo.Body;
var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL.SubmitAudit(headData, userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "保存错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
/// <summary>
/// 撤回提交
/// </summary>
/// <param name="QueryInfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult SubmitAuditBack(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<SaveSeaeOrderParam>(postContent);
var headData = saveinfo.Head;
var bodyList = saveinfo.Body;
var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL.SubmitAuditBack(headData, userinfo.SHOWNAME);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "保存错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
/// <summary>
/// 审核通过
/// </summary>
/// <param name="QueryInfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult AccAuditForm(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<SaveSeaeOrderParam>(postContent);
var headData = saveinfo.Head;
var bodyList = saveinfo.Body;
var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL.AccAuditForm(headData, bodyList, userinfo.USERID, userinfo.SHOWNAME, userinfo.COMPANYID);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "保存错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
/// <summary>
/// 驳回提交
/// </summary>
/// <param name="QueryInfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult AuditBackOrderForm(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<AuditBackParam>(postContent);
var headData = saveinfo.Head;
var bodyList = saveinfo.Body;
var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL.AuditBackOrderForm(headData, saveinfo.orreason, userinfo.SHOWNAME);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "保存错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
/// <summary>
/// 驳回提交
/// </summary>
/// <param name="QueryInfo"></param>
/// <returns></returns>
[System.Web.Http.HttpPost]
public ActionResult AuditOrderForm(EnumQueryInfo QueryInfo)
{
try
{
Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(postData);
string postContent = sRead.ReadToEnd();
sRead.Close();
var cdc = new Common.DB.CommonDataContext();
#region 正式逻辑
var openidok = BasicDataRefDAL.GetWxappUserInfo(QueryInfo.AuthCode);
if (!openidok.Success)
{
return Json(new { ErrorCode = 500, Message = $"发生错误:{openidok.Message}" }, JsonRequestBehavior.AllowGet);
}
var userinfo = (VW_user_md)openidok.Data;
#endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
#endregion
string LANGUAGES = "";
string userid = userinfo.USERID;
var aaa = "";
var saveinfo = JsonConvert.DeserializeObject<AuditOrderParam>(postContent);
var headData = saveinfo.Head;
var bodyList = saveinfo.Body;
var result = DSWeb.MvcShipping.DAL.MsSeaeOrderDAL.MsSeaeOrderDAL.OrderToOp(headData,
saveinfo.accdate,saveinfo.op,saveinfo.custservice,saveinfo.FORWARDER, saveinfo.ORREMARK, userinfo.SHOWNAME, userinfo.COMPANYID,userinfo.USERID);
if (result.Success)
{
return Json(new { ErrorCode = 0, Message = result.Message, Data = result.Data });
}
else
{
return Json(new { ErrorCode = 500, Message = "保存错误:" + result.Message });
}
}
catch (Exception e)
{
return Json(new { ErrorCode = 500, Message = "发生错误:" + e.Message });
}
}
#endregion
}
public class SearchParam
{
public string FieldName { get; set; }
public string SearchValue { get; set; }
/// <summary>
/// equal like equalandbigger equalandsmaller
/// </summary>
public string SearchType { get; set; } = "like";
public string getcondition() {
var result = FieldName;
if (SearchType == "equal") {
result += $" = '{SearchValue}'";
}
if (SearchType == "in")
{
result += $" in({SearchValue})";
}
if (SearchType == "like")
{
result += $" like '%{SearchValue}%' ";
}
if (SearchType == "equalandbigger")
{
result += $" >= '{SearchValue}'";
}
if (SearchType == "equalandsmaller")
{
result += $" <= '{SearchValue}'";
}
if (SearchType == "bigger")
{
result += $" > '{SearchValue}'";
}
if (SearchType == "smaller")
{
result += $" < '{SearchValue}'";
}
return result;
}
public static string getcondition(List<SearchParam> SearchParams) {
var condition = " 1 = 1 ";
foreach (var item in SearchParams)
{
condition += " and " + item.getcondition();
}
return condition;
}
}
public class SaveParam
{
/// <summary>
/// add edit
/// </summary>
public string opstatus { get; set; }
}
public class SaveSeaeOrderParam: SaveParam
{
public MsSeaeOrder Head {get;set;}
public List<MsSeaeOrderCtn> Body { get; set; }
}
public class SaveFeeListParam : SaveParam
{
public string bsno { get; set; }
public List<MsChFee> Body { get; set; }
}
public class DelFeeListParam : SaveParam
{
public string bsno { get; set; }
public string feeids { get; set; }
}
public class AuditBackParam : SaveSeaeOrderParam {
public string orreason { get; set; }
}
public class AuditOrderParam : SaveSeaeOrderParam
{
public string accdate { get; set; }//会计期间 形如 2024-10
public string op { get; set; } //操作 的 showname
public string custservice { get; set; } // 客服的 showname
public string FORWARDER { get; set; } //订舱代理的 shortname
public string ORREMARK { get; set; } //订舱备注
public class DelFeeListParam : SaveParam
{
public string bsno { get; set; }
public string feeids { get; set; }
}
}

@ -491,7 +491,7 @@ namespace DSWeb.MvcShipping.Controllers
{
var dataList = MsSeaeOrderDAL.GetAuditDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), start, limit, sort);
var list = dataList;//.Skip(start).Take(limit);
int count = MsSeaeOrderDAL.getTotalCount(condition, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
int count = MsSeaeOrderDAL.getAuditCount(condition, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = list.ToList() });
return new ContentResult() { Content = json };
}
@ -534,6 +534,8 @@ namespace DSWeb.MvcShipping.Controllers
var OrderData = JsonConvert.Deserialize<MsSeaeOrder>(data.Replace("}", ",") + data2.Replace("{", "").Replace("}", ",") + data3.Replace("{", ""));
var result = new DBResult();
if (OrderData.OPTYPE == "OP_SEAI")
{
result = MsSeaeOrderDAL.OrderToOpSeai(OrderData, accdate, op, custservice, FORWARDER, ORREMARK, Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
@ -944,206 +946,224 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult AuditBackOrderForm(string data, string data2, string data3, string orreason)
{
var OrderData = JsonConvert.Deserialize<MsSeaeOrder>(data.Replace("}", ",") + data2.Replace("{", "").Replace("}", ",") + data3.Replace("{", ""));
var headData = new MsOpSeae();
OrderData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
OrderData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
OrderData.ORREASON = orreason;
OrderData.ORSTATUS = "2";
OrderData.DbOperationType = DbOperationType.DbotUpd;
OrderData.ModelUIStatus = "E";
if (OrderData.PKGS == "") OrderData.PKGS = "0";
if (OrderData.KGS == "") OrderData.KGS = "0";
if (OrderData.CBM == "") OrderData.CBM = "0";
if (OrderData.ETD == "") OrderData.ETD = null;
if (OrderData.STLDATE == "") OrderData.STLDATE = null;
if (OrderData.CONFIRMDATE == "") OrderData.CONFIRMDATE = null;
if (OrderData.AUDITDATE == "") OrderData.AUDITDATE = null;
if (OrderData.ISSUEDATE == "") OrderData.ISSUEDATE = null;
var modb = new ModelObjectDB();
DBResult result = modb.Save(OrderData);
if (result.Success)
{
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "订舱驳回:" + OrderData.ORDNO;
var result = MsSeaeOrderDAL.AuditBackOrderForm(OrderData, orreason, Convert.ToString(Session["SHOWNAME"]));
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />订舱驳回:<br />业务编号:" + OrderData.ORDNO);
Body.Append("<br />客户名称:" + OrderData.CUSTOMERNAME);
Body.Append("<br />揽货人" + OrderData.SALE);
Body.Append("<br />录入人" + OrderData.INPUTBY);
Body.Append("<br />港口:" + OrderData.DESTINATION);
Body.Append("<br />船期:" + OrderData.ETD);
Body.Append("<br />船公司:" + OrderData.CARRIER);
Body.Append("<br />箱量:" + OrderData.CNTRTOTAL);
Body.Append("<br />备注:" + OrderData.REMARK);
Body.Append("<br />驳回原因:" + orreason);
Body.Append("</Body></html> ");
var mailto = "";
var SALE = SysUserDAL.GetData("U.SHOWNAME='" + OrderData.INPUTBY + "'");
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
return BasicDataRefDAL.GetContentResult(result);
//var headData = new MsOpSeae();
//OrderData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
//OrderData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//OrderData.ORREASON = orreason;
//OrderData.ORSTATUS = "2";
//OrderData.DbOperationType = DbOperationType.DbotUpd;
//OrderData.ModelUIStatus = "E";
//if (OrderData.PKGS == "") OrderData.PKGS = "0";
//if (OrderData.KGS == "") OrderData.KGS = "0";
//if (OrderData.CBM == "") OrderData.CBM = "0";
//if (OrderData.ETD == "") OrderData.ETD = null;
//if (OrderData.STLDATE == "") OrderData.STLDATE = null;
//if (OrderData.CONFIRMDATE == "") OrderData.CONFIRMDATE = null;
//if (OrderData.AUDITDATE == "") OrderData.AUDITDATE = null;
//if (OrderData.ISSUEDATE == "") OrderData.ISSUEDATE = null;
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
}
}
//var modb = new ModelObjectDB();
//DBResult result = modb.Save(OrderData);
//if (result.Success)
//{
// var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
// if (PARAMVALUE.PARAMVALUE == "1")
// {
// var mailtitle = "订舱驳回:" + OrderData.ORDNO;
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = ""
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
// var Body = new StringBuilder();
// Body.Append("<html> <Body>");
// Body.Append("<br />订舱驳回:<br />业务编号:" + OrderData.ORDNO);
// Body.Append("<br />客户名称:" + OrderData.CUSTOMERNAME);
// Body.Append("<br />揽货人" + OrderData.SALE);
// Body.Append("<br />录入人" + OrderData.INPUTBY);
// Body.Append("<br />港口:" + OrderData.DESTINATION);
// Body.Append("<br />船期:" + OrderData.ETD);
// Body.Append("<br />船公司:" + OrderData.CARRIER);
// Body.Append("<br />箱量:" + OrderData.CNTRTOTAL);
// Body.Append("<br />备注:" + OrderData.REMARK);
// Body.Append("<br />驳回原因:" + orreason);
// Body.Append("</Body></html> ");
// var mailto = "";
// var SALE = SysUserDAL.GetData("U.SHOWNAME='" + OrderData.INPUTBY + "'");
// if (SALE.EMAIL1 != "")
// {
// if (mailto == "")
// mailto = SALE.EMAIL1;
// else
// mailto = mailto + ";" + SALE.EMAIL1;
// }
// if (mailto != "")
// {
// var j = 0;
// var filepath = "";
// result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
// }
// }
//}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
/// <summary>
/// 销售订舱审核通过
/// </summary>
/// <param name="data"></param>
/// <param name="data2"></param>
/// <param name="data3"></param>
/// <param name="body"></param>
/// <returns></returns>
public ContentResult AccAuditForm(string data, string data2, string data3, string body)
{
var headData = JsonConvert.Deserialize<MsSeaeOrder>(data.Replace("}", ",") + data2.Replace("{", "").Replace("}", ",") + data3.Replace("{", ""));
var bodyList = JsonConvert.Deserialize<List<MsSeaeOrderCtn>>(body);
//if (!string.IsNullOrEmpty(headData.AUDITOPERATOR))
headData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
headData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
headData.ORSTATUS = "0";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
var result = MsSeaeOrderDAL.AccAuditForm(headData, bodyList, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
//var cntr = "";
//if (bodyList != null)
//{
// foreach (var enumValue in bodyList)
// {
// cntr = cntr + enumValue.CTNALL + '*' + enumValue.CTNNUM + "/";
// }
//}
return BasicDataRefDAL.GetContentResult(result);
//headData.CNTRTOTAL = cntr;
////if (!string.IsNullOrEmpty(headData.AUDITOPERATOR))
//headData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
//headData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//headData.ORSTATUS = "0";
//headData.DbOperationType = DbOperationType.DbotUpd;
//headData.ModelUIStatus = "E";
//if (headData.PKGS == "") headData.PKGS = "0";
//if (headData.KGS == "") headData.KGS = "0";
//if (headData.CBM == "") headData.CBM = "0";
//if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
//if (headData.AUDITDATE == "") headData.AUDITDATE = null;
//if (headData.ETD == "") headData.ETD = null;
//if (headData.STLDATE == "") headData.STLDATE = null;
var modb = new ModelObjectDB();
DBResult result = modb.Save(headData);
if (result.Success == true) {
var strSql = new StringBuilder();
strSql.Append("SELECT USERID FROM ");
strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderConfirm') ");
//if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERCONFIRM";
Msgdata.DESCRIPTION = headData.AUDITOPERATOR + "提交订舱确认";
Msgdata.MESSAGECONTENT = headData.AUDITOPERATOR + "提交销订舱确认" + " 单号:" + headData.ORDNO;
Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
////var cntr = "";
////if (bodyList != null)
////{
//// foreach (var enumValue in bodyList)
//// {
//// cntr = cntr + enumValue.CTNALL + '*' + enumValue.CTNNUM + "/";
//// }
////}
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
////headData.CNTRTOTAL = cntr;
}
reader.Close();
}
//var modb = new ModelObjectDB();
//DBResult result = modb.Save(headData);
//if (result.Success == true) {
// var strSql = new StringBuilder();
// strSql.Append("SELECT USERID FROM ");
// strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderConfirm') ");
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "NEW BOOKING:" + headData.CUSTNO+ " PIC已审核通过";
// Database db = DatabaseFactory.CreateDatabase();
// using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
// {
// while (reader.Read())
// {
// var Msgdata = new SYSMessagemb();
// Msgdata.GID = Guid.NewGuid().ToString();
// Msgdata.NAME = "SALEORDERCONFIRM";
// Msgdata.DESCRIPTION = headData.AUDITOPERATOR + "提交订舱确认";
// Msgdata.MESSAGECONTENT = headData.AUDITOPERATOR + "提交销订舱确认" + " 单号:" + headData.ORDNO;
// Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
// Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// Msgdata.ISREAD = "0";
// Msgdata.READCOUNT = "0";
// Msgdata.TYPE = "0";
// Msgdata.TASKURL = "";
// Msgdata.TASKID = headData.BSNO;
// Msgdata.NUMBER = "0";
// Msgdata.RECVTYPE = "2";
// Msgdata.DbOperationType = DbOperationType.DbotIns;
// Msgdata.ModelUIStatus = "I";
// var Msgmodb = new ModelObjectRepository();
// Msgmodb.Save(Msgdata);
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />录入人" + headData.INPUTBY);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.OP + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
foreach (var SALE in SALELIST)
{
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
// }
// reader.Close();
// }
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
}
}
// var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
// if (PARAMVALUE.PARAMVALUE == "1")
// {
// var mailtitle = "NEW BOOKING:" + headData.CUSTNO+ " PIC已审核通过";
// var Body = new StringBuilder();
// Body.Append("<html> <Body>");
// Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
// Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
// Body.Append("<br />揽货人" + headData.SALE);
// Body.Append("<br />录入人" + headData.INPUTBY);
// Body.Append("<br />港口:" + headData.DESTINATION);
// Body.Append("<br />船期:" + headData.ETD);
// Body.Append("<br />船公司:" + headData.CARRIER);
// Body.Append("<br />箱量:" + headData.CNTRTOTAL);
// Body.Append("<br />备注:" + headData.REMARK);
// Body.Append("</Body></html> ");
// var mailto = "";
// var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.OP + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
// foreach (var SALE in SALELIST)
// {
// if (SALE.EMAIL1 != "")
// {
// if (mailto == "")
// mailto = SALE.EMAIL1;
// else
// mailto = mailto + ";" + SALE.EMAIL1;
// }
// }
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var SALEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.SALE + "'");
var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", SALEID);
if (istrue)
{
var accdate = DateTime.Now.ToString("yyyy-MM");
// if (mailto != "")
// {
// var j = 0;
// var filepath = "";
// result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
// }
// }
if (headData.OPTYPE == "OP_SEAI")
{
result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// T_ALL_DA T_ALL_DA = new T_ALL_DA();
// var SALEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.SALE + "'");
// var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", SALEID);
// if (istrue)
// {
// var accdate = DateTime.Now.ToString("yyyy-MM");
//MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
// if (headData.OPTYPE == "OP_SEAI")
// {
// result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// }
// else
// result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = ""
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
// //MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// }
//}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
@ -1256,7 +1276,7 @@ namespace DSWeb.MvcShipping.Controllers
}
if (isautoop||(isauditautoop&& istrue))
if (isautoop||(isauditautoop&& istrue))
{
var accdate = DateTime.Now.ToString("yyyy-MM");
if (headData.OPTYPE == "OP_SEAI")
@ -1563,185 +1583,190 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult SubmitAudit(string data)
{
var headData = JsonConvert.Deserialize<MsSeaeOrder>(data);
DBResult result = null;
if (headData.AUDITOPERATOR == "" || headData.AUDITOPERATOR == null)
{
var ORDERAUDITMUSTBE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERAUDITMUSTBE'");
if (ORDERAUDITMUSTBE.PARAMVALUE == "1")
{
var jsonRespose2 = new JsonResponse
{
Success = false,
Message = "审核人不能为空!",
Data = ""
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
}
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var CUSTSERVICEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
var isautoop = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoToOp", CUSTSERVICEID);
var isauditautoop = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", Convert.ToString(Session["USERID"]));
var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", Convert.ToString(Session["USERID"]));
if (isautoop||(isauditautoop&& istrue))
{
var accdate = DateTime.Now.ToString("yyyy-MM");
if (headData.OPTYPE == "OP_SEAI")
{
result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
//result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
{
// var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", Convert.ToString(Session["USERID"]));
if (istrue)
headData.ORSTATUS = "0";
else
headData.ORSTATUS = "1";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success == true)
{
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "NEW BOOKING:" + headData.CUSTNO+ " 销售已提交订舱";
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />录入人" + headData.INPUTBY);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
// var SALE = SysUserDAL.GetData("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
foreach (var SALE in SALELIST)
{
//var SALEMNG = SysUserDAL.GetData("U.SHOWNAME=(SELECT TOP 1 MANAGE1 FROM SYS_DEPT WHERE DEPTNAME='" + SALE.DEPTNAME+ "' and LINKID='" + SALE.COMPANYID + "')");
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
}
}
var OPLISTNOCANCEL = MsSysParamSetDAL.GetData("PARAMNAME='OPLISTNOCANCEL'");
if (OPLISTNOCANCEL.PARAMVALUE == "1")
{
var USERID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERAUDIT";
Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
Msgdata.MESSAGECONTENT = headData.SALE + "有新订舱,订舱单号:" + headData.ORDNO;
Msgdata.RECEIVER = USERID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
}
else
{
var strSql = new StringBuilder();
strSql.Append("SELECT USERID FROM ");
strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderAudit') ");
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERAUDIT";
Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
Msgdata.MESSAGECONTENT = headData.SALE + "提交销售订舱审核" + " 单号:" + headData.ORDNO;
Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
}
reader.Close();
}
}
}
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = ""
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
var result = MsSeaeOrderDAL.SubmitAudit(headData, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
return BasicDataRefDAL.GetContentResult(result);
// DBResult result = null;
// if (headData.AUDITOPERATOR == "" || headData.AUDITOPERATOR == null)
// {
// var ORDERAUDITMUSTBE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERAUDITMUSTBE'");
// if (ORDERAUDITMUSTBE.PARAMVALUE == "1")
// {
// var jsonRespose2 = new JsonResponse
// {
// Success = false,
// Message = "审核人不能为空!",
// Data = ""
// };
// return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
// }
// }
// T_ALL_DA T_ALL_DA = new T_ALL_DA();
// var CUSTSERVICEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
// var isautoop = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoToOp", CUSTSERVICEID);
// var isauditautoop = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", Convert.ToString(Session["USERID"]));
// var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", Convert.ToString(Session["USERID"]));
// if (isautoop||(isauditautoop&& istrue))
// {
// var accdate = DateTime.Now.ToString("yyyy-MM");
// if (headData.OPTYPE == "OP_SEAI")
// {
// result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// }
// else
// result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// //result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
// }
// else
// {
//// var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", Convert.ToString(Session["USERID"]));
// if (istrue)
// headData.ORSTATUS = "0";
// else
// headData.ORSTATUS = "1";
// headData.DbOperationType = DbOperationType.DbotUpd;
// headData.ModelUIStatus = "E";
// if (headData.PKGS == "") headData.PKGS = "0";
// if (headData.KGS == "") headData.KGS = "0";
// if (headData.CBM == "") headData.CBM = "0";
// if (headData.ETD == "") headData.ETD = null;
// if (headData.STLDATE == "") headData.STLDATE = null;
// if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
// if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
// if (headData.AUDITDATE == "") headData.AUDITDATE = null;
// var modb = new ModelObjectDB();
// result = modb.Save(headData);
// if (result.Success == true)
// {
// var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
// if (PARAMVALUE.PARAMVALUE == "1")
// {
// var mailtitle = "NEW BOOKING:" + headData.CUSTNO+ " 销售已提交订舱";
// var Body = new StringBuilder();
// Body.Append("<html> <Body>");
// Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
// Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
// Body.Append("<br />揽货人" + headData.SALE);
// Body.Append("<br />录入人" + headData.INPUTBY);
// Body.Append("<br />港口:" + headData.DESTINATION);
// Body.Append("<br />船期:" + headData.ETD);
// Body.Append("<br />船公司:" + headData.CARRIER);
// Body.Append("<br />箱量:" + headData.CNTRTOTAL);
// Body.Append("<br />备注:" + headData.REMARK);
// Body.Append("</Body></html> ");
// var mailto = "";
//// var SALE = SysUserDAL.GetData("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
// var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
// foreach (var SALE in SALELIST)
// {
// //var SALEMNG = SysUserDAL.GetData("U.SHOWNAME=(SELECT TOP 1 MANAGE1 FROM SYS_DEPT WHERE DEPTNAME='" + SALE.DEPTNAME+ "' and LINKID='" + SALE.COMPANYID + "')");
// if (SALE.EMAIL1 != "")
// {
// if (mailto == "")
// mailto = SALE.EMAIL1;
// else
// mailto = mailto + ";" + SALE.EMAIL1;
// }
// }
// if (mailto != "")
// {
// var j = 0;
// var filepath = "";
// result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
// }
// }
// var OPLISTNOCANCEL = MsSysParamSetDAL.GetData("PARAMNAME='OPLISTNOCANCEL'");
// if (OPLISTNOCANCEL.PARAMVALUE == "1")
// {
// var USERID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
// var Msgdata = new SYSMessagemb();
// Msgdata.GID = Guid.NewGuid().ToString();
// Msgdata.NAME = "SALEORDERAUDIT";
// Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
// Msgdata.MESSAGECONTENT = headData.SALE + "有新订舱,订舱单号:" + headData.ORDNO;
// Msgdata.RECEIVER = USERID;
// Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// Msgdata.ISREAD = "0";
// Msgdata.READCOUNT = "0";
// Msgdata.TYPE = "0";
// Msgdata.TASKURL = "";
// Msgdata.TASKID = headData.BSNO;
// Msgdata.NUMBER = "0";
// Msgdata.RECVTYPE = "2";
// Msgdata.DbOperationType = DbOperationType.DbotIns;
// Msgdata.ModelUIStatus = "I";
// var Msgmodb = new ModelObjectRepository();
// Msgmodb.Save(Msgdata);
// }
// else
// {
// var strSql = new StringBuilder();
// strSql.Append("SELECT USERID FROM ");
// strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderAudit') ");
// Database db = DatabaseFactory.CreateDatabase();
// using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
// {
// while (reader.Read())
// {
// var Msgdata = new SYSMessagemb();
// Msgdata.GID = Guid.NewGuid().ToString();
// Msgdata.NAME = "SALEORDERAUDIT";
// Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
// Msgdata.MESSAGECONTENT = headData.SALE + "提交销售订舱审核" + " 单号:" + headData.ORDNO;
// Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
// Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// Msgdata.ISREAD = "0";
// Msgdata.READCOUNT = "0";
// Msgdata.TYPE = "0";
// Msgdata.TASKURL = "";
// Msgdata.TASKID = headData.BSNO;
// Msgdata.NUMBER = "0";
// Msgdata.RECVTYPE = "2";
// Msgdata.DbOperationType = DbOperationType.DbotIns;
// Msgdata.ModelUIStatus = "I";
// var Msgmodb = new ModelObjectRepository();
// Msgmodb.Save(Msgdata);
// }
// reader.Close();
// }
// }
// }
// }
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
@ -1749,72 +1774,78 @@ namespace DSWeb.MvcShipping.Controllers
{
var headData = JsonConvert.Deserialize<MsSeaeOrder>(data);
//headData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
//headData.AUDITDATE = DateTime.Now.ToShortDateString();
headData.ORSTATUS = "9";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
var result = MsSeaeOrderDAL.SubmitAuditBack(headData, Convert.ToString(Session["SHOWNAME"]));
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
return BasicDataRefDAL.GetContentResult(result);
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
////headData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
////headData.AUDITDATE = DateTime.Now.ToShortDateString();
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
var modb = new ModelObjectDB();
DBResult result = modb.Save(headData);
if (result.Success) {
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "订舱驳回:" + headData.CUSTNO;
//headData.ORSTATUS = "9";
//headData.DbOperationType = DbOperationType.DbotUpd;
//headData.ModelUIStatus = "E";
//if (headData.PKGS == "") headData.PKGS = "0";
//if (headData.KGS == "") headData.KGS = "0";
//if (headData.CBM == "") headData.CBM = "0";
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />订舱驳回:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.SALE + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
foreach (var SALE in SALELIST)
{
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
}
}
//if (headData.ETD == "") headData.ETD = null;
//if (headData.STLDATE == "") headData.STLDATE = null;
//if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
}
//if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
//if (headData.AUDITDATE == "") headData.AUDITDATE = null;
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = ""
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
//var modb = new ModelObjectDB();
//DBResult result = modb.Save(headData);
//if (result.Success) {
// var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
// if (PARAMVALUE.PARAMVALUE == "1")
// {
// var mailtitle = "订舱驳回:" + headData.CUSTNO;
// var Body = new StringBuilder();
// Body.Append("<html> <Body>");
// Body.Append("<br />订舱驳回:<br />业务编号:" + headData.ORDNO);
// Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
// Body.Append("<br />揽货人" + headData.SALE);
// Body.Append("<br />港口:" + headData.DESTINATION);
// Body.Append("<br />船期:" + headData.ETD);
// Body.Append("<br />船公司:" + headData.CARRIER);
// Body.Append("<br />箱量:" + headData.CNTRTOTAL);
// Body.Append("<br />备注:" + headData.REMARK);
// Body.Append("</Body></html> ");
// var mailto = "";
// var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.SALE + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
// foreach (var SALE in SALELIST)
// {
// if (SALE.EMAIL1 != "")
// {
// if (mailto == "")
// mailto = SALE.EMAIL1;
// else
// mailto = mailto + ";" + SALE.EMAIL1;
// }
// }
// if (mailto != "")
// {
// var j = 0;
// var filepath = "";
// result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, Convert.ToString(Session["SHOWNAME"]));
// }
// }
//}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion

@ -882,6 +882,38 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
}
public static DBResult DeleteDetail2(MsSeaeOrderCtn headData)
{
//var result = new DBResult();
//Database db = DatabaseFactory.CreateDatabase();
//using (var conn = db.CreateConnection())
//{
// conn.Open();
// var tran = conn.BeginTransaction();
// try
// {
// var cmdDelete = db.GetSqlStringCommand("delete from crm_seaeorderctn where CTN_ID='" + headData.CTN_ID + "'");
// db.ExecuteNonQuery(cmdDelete, tran);
// tran.Commit();
// }
// catch (Exception)
// {
// tran.Rollback();
// result.Success = false;
// result.Message = "删除出现错误,请重试或联系系统管理员";
// return result;
// }
//}
//UpdateCtnTotal(headData.ORDNO);
//result.Success = true;
//result.Message = "操作成功";
//return result;
return DeleteDetail3(headData.ORDNO, headData.CTN_ID);
}
public static DBResult DeleteDetail3(string ORDNO,string CTN_ID)
{
var result = new DBResult();
Database db = DatabaseFactory.CreateDatabase();
@ -891,7 +923,7 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
var tran = conn.BeginTransaction();
try
{
var cmdDelete = db.GetSqlStringCommand("delete from crm_seaeorderctn where CTN_ID='" + headData.CTN_ID + "'");
var cmdDelete = db.GetSqlStringCommand("delete from crm_seaeorderctn where CTN_ID in ('" + CTN_ID + "')");
db.ExecuteNonQuery(cmdDelete, tran);
tran.Commit();
}
@ -904,7 +936,7 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
}
}
UpdateCtnTotal(headData.ORDNO);
UpdateCtnTotal(ORDNO);
result.Success = true;
result.Message = "操作成功";
@ -1017,6 +1049,51 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
return SetData(strSql);
}
public static int getAuditCount(string strCondition, string userid, string usercode, string companyid)
{
var rangstr = "";
var ORDERAUDITMUSTBE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERAUDITMUSTBE'");
if (ORDERAUDITMUSTBE.PARAMVALUE == "1")
{
rangstr = " AUDITOPERATOR='" + usercode + "'";
}
else
{
rangstr = GetRangDAStr("audit", userid, usercode, companyid);
}
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(*) ");
strSql.Append(" from crm_seaeorder B ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where " + strCondition);
}
int cnt = 0;
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
cnt = Convert.ToInt32(reader[0]);
}
}
return cnt;
}
public static DBResult AddOrderDetail(string bsno,string ordno,string userid,string companyid,string optype= "op_Seae")
{
var result = new DBResult();
@ -1144,6 +1221,475 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
#endregion
#region 提交审核 撤回提交 审批通过 审批驳回 确定订舱
public static DBResult SubmitAudit(MsSeaeOrder headData,string USERID,string SHOWNAME,string COMPANYID)
{
DBResult result = new DBResult() ;
result.OK();
if (headData.AUDITOPERATOR == "" || headData.AUDITOPERATOR == null)
{
var ORDERAUDITMUSTBE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERAUDITMUSTBE'");
if (ORDERAUDITMUSTBE.PARAMVALUE == "1")
{
//var jsonRespose2 = new JsonResponse
//{
// Success = false,
// Message = "审核人不能为空!",
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
result.SetErrorInfo("审核人不能为空!");
return result;
}
}
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var CUSTSERVICEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
var isautoop = DSWeb.MvcShipping.DAL.MsBaseInfoDAL.MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoToOp", CUSTSERVICEID);
var isauditautoop = DSWeb.MvcShipping.DAL.MsBaseInfoDAL.MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", USERID);
var istrue = DSWeb.MvcShipping.DAL.MsBaseInfoDAL.MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", USERID);
if (isautoop || (isauditautoop && istrue))
{
var accdate = DateTime.Now.ToString("yyyy-MM");
if (headData.OPTYPE == "OP_SEAI")
{
result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
}
else
result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
//result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
}
else
{
// var istrue = MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAutoAudit", USERID);
if (istrue)
headData.ORSTATUS = "0";
else
headData.ORSTATUS = "1";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success == true)
{
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "NEW BOOKING:" + headData.CUSTNO + " 销售已提交订舱";
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />录入人" + headData.INPUTBY);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
// var SALE = SysUserDAL.GetData("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.AUDITOPERATOR + "' or U.SHOWNAME='" + headData.INPUTBY + "'");
foreach (var SALE in SALELIST)
{
//var SALEMNG = SysUserDAL.GetData("U.SHOWNAME=(SELECT TOP 1 MANAGE1 FROM SYS_DEPT WHERE DEPTNAME='" + SALE.DEPTNAME+ "' and LINKID='" + SALE.COMPANYID + "')");
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, SHOWNAME);
}
}
var OPLISTNOCANCEL = MsSysParamSetDAL.GetData("PARAMNAME='OPLISTNOCANCEL'");
if (OPLISTNOCANCEL.PARAMVALUE == "1")
{
var CUSTSERVICE_USERID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.CUSTSERVICE + "'");
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERAUDIT";
Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
Msgdata.MESSAGECONTENT = headData.SALE + "有新订舱,订舱单号:" + headData.ORDNO;
Msgdata.RECEIVER = CUSTSERVICE_USERID;
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
}
else
{
var strSql = new StringBuilder();
strSql.Append("SELECT USERID FROM ");
strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderAudit') ");
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERAUDIT";
Msgdata.DESCRIPTION = headData.SALE + "提交销售订舱";
Msgdata.MESSAGECONTENT = headData.SALE + "提交销售订舱审核" + " 单号:" + headData.ORDNO;
Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
}
reader.Close();
}
}
}
}
return result;
}
public static DBResult SubmitAuditBack(MsSeaeOrder headData, string SHOWNAME)
{
//headData.AUDITOPERATOR = Convert.ToString(Session["SHOWNAME"]);
//headData.AUDITDATE = DateTime.Now.ToShortDateString();
headData.ORSTATUS = "9";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
var modb = new ModelObjectDB();
DBResult result = modb.Save(headData);
if (result.Success)
{
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "订舱驳回:" + headData.CUSTNO;
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />订舱驳回:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.SALE + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
foreach (var SALE in SALELIST)
{
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, SHOWNAME);
}
}
}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
return result;
}
public static DBResult AccAuditForm(MsSeaeOrder headData, List<MsSeaeOrderCtn> bodyList,string USERID,string SHOWNAME,string COMPANYID)
{
//var headData = JsonConvert.Deserialize<MsSeaeOrder>(data.Replace("}", ",") + data2.Replace("{", "").Replace("}", ",") + data3.Replace("{", ""));
//var bodyList = JsonConvert.Deserialize<List<MsSeaeOrderCtn>>(body);
headData.AUDITOPERATOR = SHOWNAME;
headData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
headData.ORSTATUS = "0";
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (headData.PKGS == "") headData.PKGS = "0";
if (headData.KGS == "") headData.KGS = "0";
if (headData.CBM == "") headData.CBM = "0";
if (headData.CONFIRMDATE == "") headData.CONFIRMDATE = null;
if (headData.AUDITDATE == "") headData.AUDITDATE = null;
if (headData.ETD == "") headData.ETD = null;
if (headData.STLDATE == "") headData.STLDATE = null;
if (headData.ISSUEDATE == "") headData.ISSUEDATE = null;
//var cntr = "";
//if (bodyList != null)
//{
// foreach (var enumValue in bodyList)
// {
// cntr = cntr + enumValue.CTNALL + '*' + enumValue.CTNNUM + "/";
// }
//}
//headData.CNTRTOTAL = cntr;
var modb = new ModelObjectDB();
DBResult result = modb.Save(headData);
if (result.Success == true)
{
var strSql = new StringBuilder();
strSql.Append("SELECT USERID FROM ");
strSql.Append(" user_action WHERE ACTIONID in (select GID from action where [NAME]='modSaleOrderConfirm') ");
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
var Msgdata = new SYSMessagemb();
Msgdata.GID = Guid.NewGuid().ToString();
Msgdata.NAME = "SALEORDERCONFIRM";
Msgdata.DESCRIPTION = headData.AUDITOPERATOR + "提交订舱确认";
Msgdata.MESSAGECONTENT = headData.AUDITOPERATOR + "提交销订舱确认" + " 单号:" + headData.ORDNO;
Msgdata.RECEIVER = Convert.ToString(reader["USERID"]);
Msgdata.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Msgdata.ISREAD = "0";
Msgdata.READCOUNT = "0";
Msgdata.TYPE = "0";
Msgdata.TASKURL = "";
Msgdata.TASKID = headData.BSNO;
Msgdata.NUMBER = "0";
Msgdata.RECVTYPE = "2";
Msgdata.DbOperationType = DbOperationType.DbotIns;
Msgdata.ModelUIStatus = "I";
var Msgmodb = new ModelObjectRepository();
Msgmodb.Save(Msgdata);
}
reader.Close();
}
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "NEW BOOKING:" + headData.CUSTNO + " PIC已审核通过";
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />NEW BOOKING:<br />业务编号:" + headData.ORDNO);
Body.Append("<br />客户名称:" + headData.CUSTOMERNAME);
Body.Append("<br />揽货人" + headData.SALE);
Body.Append("<br />录入人" + headData.INPUTBY);
Body.Append("<br />港口:" + headData.DESTINATION);
Body.Append("<br />船期:" + headData.ETD);
Body.Append("<br />船公司:" + headData.CARRIER);
Body.Append("<br />箱量:" + headData.CNTRTOTAL);
Body.Append("<br />备注:" + headData.REMARK);
Body.Append("</Body></html> ");
var mailto = "";
var SALELIST = SysUserDAL.GetDataList("U.SHOWNAME='" + headData.OP + "' or U.SHOWNAME='" + headData.INPUTBY + "' ");
foreach (var SALE in SALELIST)
{
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, SHOWNAME);
}
}
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var SALEID = T_ALL_DA.GetStrSQL("GID", "select top 1 GID from [user] where SHOWNAME='" + headData.SALE + "'");
var istrue = DSWeb.MvcShipping.DAL.MsBaseInfoDAL. MsBaseInfoDAL.GetUserModuleEnable("modSaleOrderAuditAutoOp", SALEID);
if (istrue)
{
var accdate = DateTime.Now.ToString("yyyy-MM");
if (headData.OPTYPE == "OP_SEAI")
{
result = MsSeaeOrderDAL.OrderToOpSeai(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
}
else
result = MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
//MsSeaeOrderDAL.OrderToOp(headData, accdate, headData.OP, headData.CUSTSERVICE, headData.FORWARDER, "", SHOWNAME, COMPANYID, USERID);
}
}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
return result;
}
//驳回
public static DBResult AuditBackOrderForm(MsSeaeOrder OrderData, string orreason,string SHOWNAME)
{
var headData = new MsOpSeae();
OrderData.AUDITOPERATOR = SHOWNAME;
OrderData.AUDITDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
OrderData.ORREASON = orreason;
OrderData.ORSTATUS = "2";
OrderData.DbOperationType = DbOperationType.DbotUpd;
OrderData.ModelUIStatus = "E";
if (OrderData.PKGS == "") OrderData.PKGS = "0";
if (OrderData.KGS == "") OrderData.KGS = "0";
if (OrderData.CBM == "") OrderData.CBM = "0";
if (OrderData.ETD == "") OrderData.ETD = null;
if (OrderData.STLDATE == "") OrderData.STLDATE = null;
if (OrderData.CONFIRMDATE == "") OrderData.CONFIRMDATE = null;
if (OrderData.AUDITDATE == "") OrderData.AUDITDATE = null;
if (OrderData.ISSUEDATE == "") OrderData.ISSUEDATE = null;
var modb = new ModelObjectDB();
DBResult result = modb.Save(OrderData);
if (result.Success)
{
var PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='ORDERSENDMAIL'");
if (PARAMVALUE.PARAMVALUE == "1")
{
var mailtitle = "订舱驳回:" + OrderData.ORDNO;
var Body = new StringBuilder();
Body.Append("<html> <Body>");
Body.Append("<br />订舱驳回:<br />业务编号:" + OrderData.ORDNO);
Body.Append("<br />客户名称:" + OrderData.CUSTOMERNAME);
Body.Append("<br />揽货人" + OrderData.SALE);
Body.Append("<br />录入人" + OrderData.INPUTBY);
Body.Append("<br />港口:" + OrderData.DESTINATION);
Body.Append("<br />船期:" + OrderData.ETD);
Body.Append("<br />船公司:" + OrderData.CARRIER);
Body.Append("<br />箱量:" + OrderData.CNTRTOTAL);
Body.Append("<br />备注:" + OrderData.REMARK);
Body.Append("<br />驳回原因:" + orreason);
Body.Append("</Body></html> ");
var mailto = "";
var SALE = SysUserDAL.GetData("U.SHOWNAME='" + OrderData.INPUTBY + "'");
if (SALE.EMAIL1 != "")
{
if (mailto == "")
mailto = SALE.EMAIL1;
else
mailto = mailto + ";" + SALE.EMAIL1;
}
if (mailto != "")
{
var j = 0;
var filepath = "";
result = MsSeaeOrderDAL.SendMailWithFile(mailtitle, Body.ToString(), filepath, mailto, SHOWNAME);
}
}
}
//var jsonRespose = new JsonResponse
//{
// Success = result.Success,
// Message = result.Message,
// Data = ""
//};
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
return result;
}
#endregion
#region 确认订舱
public static DBResult OrderToOp(MsSeaeOrder OrderData, string accdate, string op, string custservice, string FORWARDER, string ORREMARK,string OPNAME,string COMPANYID,string userid)

Loading…
Cancel
Save