You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
680 lines
28 KiB
C#
680 lines
28 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using DSWeb.MvcShipping.Models.WMSNew;
|
|
using DSWeb.MvcShipping.Models.MsStevedores;
|
|
using DSWeb.MvcShipping.DAL.WMSNewDAL;
|
|
using DSWeb.MvcShipping.DAL.MsAnnounce;
|
|
using System.Collections.Generic;
|
|
using HcUtility.Comm;
|
|
using HcUtility.Core;
|
|
using System.Web.Script.Serialization;
|
|
using DSWeb.EntityDA;
|
|
using System.Data;
|
|
using System.Text;
|
|
using DSWeb.Areas.CommMng.Models;
|
|
using Microsoft.Practices.EnterpriseLibrary.Data;
|
|
using DSWeb.Areas.MvcShipping.DAL.Message;
|
|
using DSWeb.MvcShipping.DAL.MsSysBillNoSet;
|
|
using DSWeb.MvcShipping.DAL.MsCodeFtpSet;
|
|
|
|
using DSWeb.TruckMng.Comm.Cookie;
|
|
using DSWeb.TruckMng.Helper;
|
|
using DSWeb.TruckMng.Helper.Repository;
|
|
|
|
|
|
namespace DSWeb.MvcShipping.Controllers
|
|
{
|
|
public class WMSNewController : Controller
|
|
{
|
|
//
|
|
// GET:
|
|
public ActionResult Index ( )
|
|
{
|
|
return View();
|
|
}
|
|
//
|
|
// GET: /
|
|
public ActionResult Edit ( )
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult InEdit ( )
|
|
{
|
|
return View();
|
|
}
|
|
public ContentResult GetDataList ( int start, int limit, string sort, string condition )
|
|
{
|
|
int count = 0;
|
|
var dataList = WMSNewDAL.GetDataList(condition,start,limit,out count,sort);
|
|
var timeStamp = DateTime.Now.ToShortDateString();
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList(), timeStamp = timeStamp });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetDataList_LTJY(int start, int limit, string sort, string condition)
|
|
{
|
|
int count = 0;
|
|
var dataList = WMSNewDAL.GetDataList_LTJY(condition, start, limit, out count, sort);
|
|
var timeStamp = DateTime.Now.ToShortDateString();
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList(), timeStamp = timeStamp });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetData ( string handle, string condition )
|
|
{
|
|
WMSNewList head = null;
|
|
var timeStamp = DateTime.Now.ToShortDateString();
|
|
var wmsnoManual = "0";
|
|
if (handle == "edit")
|
|
{
|
|
head = WMSNewDAL.GetData(condition);
|
|
|
|
}
|
|
|
|
if (head == null)
|
|
{
|
|
head = new WMSNewList();
|
|
head.ARFEE = "0";
|
|
head.APFEE = "0";
|
|
head.CHARGEUNIT = "吨";
|
|
}
|
|
wmsnoManual = WMSNewDAL.GetWMSNOManualConfig();
|
|
var json = JsonConvert.Serialize(
|
|
new { Success = true, Message = "查询成功", data = head, timeStamp = timeStamp,WMSNOManual=wmsnoManual });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetData_LTJY(string handle, string condition)
|
|
{
|
|
WMSNewList head = null;
|
|
var timeStamp = DateTime.Now.ToShortDateString();
|
|
var wmsnoManual = "0";
|
|
if (handle == "edit")
|
|
{
|
|
head = WMSNewDAL.GetData_LTJY(condition);
|
|
|
|
}
|
|
|
|
if (head == null)
|
|
{
|
|
head = new WMSNewList();
|
|
head.ARFEE = "0";
|
|
head.APFEE = "0";
|
|
head.CHARGEUNIT = "吨";
|
|
}
|
|
wmsnoManual = WMSNewDAL.GetWMSNOManualConfig();
|
|
var json = JsonConvert.Serialize(
|
|
new { Success = true, Message = "查询成功", data = head, timeStamp = timeStamp, WMSNOManual = wmsnoManual });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
|
|
public ContentResult Delete ( string data, string USERID )
|
|
{
|
|
var WMSNewList = JsonConvert.Deserialize<List<WMSNewList>>(data);
|
|
|
|
string msg = "";
|
|
|
|
bool success = WMSNewDAL.Delete(WMSNewList,out msg);
|
|
|
|
var jsonRespose = new JsonResponse { Success = success, Message = msg };
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
|
|
private List<WMSNewList> serializeParams ( List<WMSNewList> list )
|
|
{
|
|
|
|
return list;
|
|
}
|
|
|
|
public ContentResult Save ( string opstatus, string data, string WMSINBody, string WMSINBodyDel)
|
|
{
|
|
var head = JsonConvert.Deserialize<WMSNew>(data);
|
|
var WMSINBodyList = JsonConvert.Deserialize<List<WMSNewIN>>(WMSINBody);
|
|
var WMSINBodyDelList = JsonConvert.Deserialize<List<WMSNewIN>>(WMSINBodyDel);
|
|
if (WMSINBodyList!=null)
|
|
{
|
|
foreach (var item in WMSINBodyList)
|
|
{
|
|
item.STORAGENAME = head.STORAGENAME;
|
|
}
|
|
}
|
|
if (head.WMSDATE == "")
|
|
{
|
|
head.WMSDATE = DateTime.Now.ToString("yyyy-MM-dd");
|
|
}
|
|
var CustomsNo = head.CUSTOMNO;
|
|
var BSNO = head.ASSOCIATEDNO;
|
|
var BLNO = head.BLNO;
|
|
var CONTRACTNO = head.CONTRACTNO;
|
|
var jsonRespose = new JsonResponse();
|
|
//检查是否报关
|
|
bool ISCustomsClearance = WMSNewDAL.CheckISCustomsClearance(CustomsNo,BLNO);
|
|
if (!ISCustomsClearance)
|
|
{
|
|
jsonRespose.Success = false;
|
|
jsonRespose.Message = "未进行报关,不允许入库!";
|
|
}
|
|
else
|
|
{
|
|
if (opstatus == "add")
|
|
{
|
|
if (WMSINBodyList!=null && WMSINBodyList.Count > 0)
|
|
{
|
|
head.GOODSNAMEID = WMSINBodyList[0].GOODSNAMEID;
|
|
head.GOODSNAME = WMSINBodyList[0].GOODSNAME;
|
|
}
|
|
|
|
head.DbOperationType = DbOperationType.DbotIns;
|
|
head.ModelUIStatus = "I";
|
|
head.CORPID = Convert.ToString(Session["COMPANYID"]).Trim();//CORPID
|
|
head.GID = "Wms" + Guid.NewGuid().ToString().Replace("-", ""); ;//获取管理费单号
|
|
head.WMSOP = CookieConfig.GetCookie_UserName(Request);
|
|
head.CREATEUSER = CookieConfig.GetCookie_UserId(Request);
|
|
//head.WMSNO = getCodeRule("入库单号", "WMSNO", "WMS", head.WMSDATE);//调用编码规则
|
|
if (head.WMSNO==""||head.WMSNO==null)
|
|
{
|
|
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='仓储入库'", Convert.ToString(Session["COMPANYID"]));
|
|
head.WMSNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.WMSDATE.ToString().Trim(), head.ACCDATE.ToString().Trim());
|
|
if (head.WMSNO == null || head.WMSNO == string.Empty)
|
|
{
|
|
jsonRespose.Success = false;
|
|
jsonRespose.Message = "入库单号生成失败!";
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
}
|
|
|
|
if (head.ASSOCIATEDNO == "")
|
|
{
|
|
head.ASSOCIATEDNO = head.GID;
|
|
}
|
|
|
|
}
|
|
else if (opstatus == "edit")
|
|
{
|
|
if (WMSINBodyList!=null)
|
|
{
|
|
if (WMSINBodyList.Count > 0)
|
|
{
|
|
head.GOODSNAMEID = WMSINBodyList[0].GOODSNAMEID;
|
|
head.GOODSNAME = WMSINBodyList[0].GOODSNAME;
|
|
}
|
|
}
|
|
if (head.ISCHANGE == "货权转移")
|
|
{
|
|
head.ISCHANGE = "True";
|
|
}
|
|
else
|
|
{
|
|
head.ISCHANGE = "False";
|
|
}
|
|
head.CREATEUSER = head.CREATEUSER;
|
|
head.DbOperationType = DbOperationType.DbotUpd;
|
|
head.ModelUIStatus = "E";
|
|
head.MODIFIEDTIME = DateTime.Now.ToString();
|
|
head.MODIFIEDUSER = CookieConfig.GetCookie_UserId(Request);
|
|
head.CORPID = Convert.ToString(Session["COMPANYID"]).Trim();//CORPID
|
|
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
head.DbOperationType = DbOperationType.DbotDel;
|
|
}
|
|
if (WMSINBodyList!=null)
|
|
{
|
|
foreach (var wmsin in WMSINBodyList)
|
|
{
|
|
wmsin.BSNO = BSNO;
|
|
wmsin.CONTRACTNO = CONTRACTNO;
|
|
wmsin.BLNO = BLNO;
|
|
}
|
|
}
|
|
|
|
var modb = new ModelObjectRepository();
|
|
DBResult result;
|
|
if (WMSINBodyList==null)
|
|
{
|
|
WMSINBodyList = new List<WMSNewIN>();
|
|
}
|
|
|
|
result = modb.Save(head,
|
|
ModelObjectConvert<WMSNewIN>.ToModelObjectList(WMSINBodyList),
|
|
ModelObjectConvert<WMSNewIN>.ToModelObjectList(WMSINBodyDelList)
|
|
);
|
|
|
|
|
|
|
|
jsonRespose.Success = result.Success;
|
|
jsonRespose.Message = result.Message;
|
|
jsonRespose.Data = WMSNewDAL.GetData(" GID='" + head.GID + "'");
|
|
|
|
}
|
|
|
|
|
|
|
|
//p_op_gain(head.BXGID);
|
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
|
|
public ContentResult Save_LTJY(string opstatus, string data, string WMSINBody, string WMSINBodyDel)
|
|
{
|
|
var head = JsonConvert.Deserialize<WMSNew>(data);
|
|
var WMSINBodyList = JsonConvert.Deserialize<List<WMSNewIN>>(WMSINBody);
|
|
var WMSINBodyDelList = JsonConvert.Deserialize<List<WMSNewIN>>(WMSINBodyDel);
|
|
if (WMSINBodyList != null)
|
|
{
|
|
foreach (var item in WMSINBodyList)
|
|
{
|
|
item.STORAGENAME = head.STORAGENAME;
|
|
}
|
|
}
|
|
if (head.WMSDATE == "")
|
|
{
|
|
head.WMSDATE = DateTime.Now.ToString("yyyy-MM-dd");
|
|
}
|
|
var CustomsNo = head.CUSTOMNO;
|
|
var BSNO = head.ASSOCIATEDNO;
|
|
var BLNO = head.BLNO;
|
|
var CONTRACTNO = head.CONTRACTNO;
|
|
var jsonRespose = new JsonResponse();
|
|
//检查是否报关
|
|
bool ISCustomsClearance = WMSNewDAL.CheckISCustomsClearance(CustomsNo, BLNO);
|
|
if (!ISCustomsClearance)
|
|
{
|
|
jsonRespose.Success = false;
|
|
jsonRespose.Message = "未进行报关,不允许入库!";
|
|
}
|
|
else
|
|
{
|
|
if (opstatus == "add")
|
|
{
|
|
if (WMSINBodyList != null && WMSINBodyList.Count > 0)
|
|
{
|
|
head.GOODSNAMEID = WMSINBodyList[0].GOODSNAMEID;
|
|
head.GOODSNAME = WMSINBodyList[0].GOODSNAME;
|
|
}
|
|
|
|
head.DbOperationType = DbOperationType.DbotIns;
|
|
head.ModelUIStatus = "I";
|
|
head.CORPID = Convert.ToString(Session["COMPANYID"]).Trim();//CORPID
|
|
head.GID = "Wms" + Guid.NewGuid().ToString().Replace("-", ""); ;//获取管理费单号
|
|
head.WMSOP = CookieConfig.GetCookie_UserName(Request);
|
|
head.CREATEUSER = CookieConfig.GetCookie_UserId(Request);
|
|
//head.WMSNO = getCodeRule("入库单号", "WMSNO", "WMS", head.WMSDATE);//调用编码规则
|
|
if (head.WMSNO == "" || head.WMSNO == null)
|
|
{
|
|
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='仓储入库'", Convert.ToString(Session["COMPANYID"]));
|
|
head.WMSNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.WMSDATE.ToString().Trim(), head.ACCDATE.ToString().Trim());
|
|
if (head.WMSNO == null || head.WMSNO == string.Empty)
|
|
{
|
|
jsonRespose.Success = false;
|
|
jsonRespose.Message = "入库单号生成失败!";
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
}
|
|
|
|
if (head.ASSOCIATEDNO == "")
|
|
{
|
|
head.ASSOCIATEDNO = head.GID;
|
|
}
|
|
|
|
}
|
|
else if (opstatus == "edit")
|
|
{
|
|
if (WMSINBodyList != null)
|
|
{
|
|
if (WMSINBodyList.Count > 0)
|
|
{
|
|
head.GOODSNAMEID = WMSINBodyList[0].GOODSNAMEID;
|
|
head.GOODSNAME = WMSINBodyList[0].GOODSNAME;
|
|
}
|
|
}
|
|
if (head.ISCHANGE == "货权转移")
|
|
{
|
|
head.ISCHANGE = "True";
|
|
}
|
|
else
|
|
{
|
|
head.ISCHANGE = "False";
|
|
}
|
|
head.CREATEUSER = head.CREATEUSER;
|
|
head.DbOperationType = DbOperationType.DbotUpd;
|
|
head.ModelUIStatus = "E";
|
|
head.MODIFIEDTIME = DateTime.Now.ToString();
|
|
head.MODIFIEDUSER = CookieConfig.GetCookie_UserId(Request);
|
|
head.CORPID = Convert.ToString(Session["COMPANYID"]).Trim();//CORPID
|
|
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
head.DbOperationType = DbOperationType.DbotDel;
|
|
}
|
|
if (WMSINBodyList != null)
|
|
{
|
|
foreach (var wmsin in WMSINBodyList)
|
|
{
|
|
wmsin.BSNO = BSNO;
|
|
wmsin.CONTRACTNO = CONTRACTNO;
|
|
wmsin.BLNO = BLNO;
|
|
}
|
|
}
|
|
|
|
var modb = new ModelObjectRepository();
|
|
DBResult result;
|
|
if (WMSINBodyList == null)
|
|
{
|
|
WMSINBodyList = new List<WMSNewIN>();
|
|
}
|
|
|
|
result = modb.Save(head,
|
|
ModelObjectConvert<WMSNewIN>.ToModelObjectList(WMSINBodyList),
|
|
ModelObjectConvert<WMSNewIN>.ToModelObjectList(WMSINBodyDelList)
|
|
);
|
|
|
|
jsonRespose.Success = result.Success;
|
|
jsonRespose.Message = result.Message;
|
|
jsonRespose.Data = WMSNewDAL.GetData_LTJY(" GID='" + head.GID + "'");
|
|
|
|
}
|
|
|
|
|
|
|
|
//p_op_gain(head.BXGID);
|
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
|
|
|
|
public ContentResult GetWMSINList ( int start, int limit, string sort, string condition )
|
|
{
|
|
var dataList = WMSNewDAL.GetWMSINList(condition, sort);
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据提单号和报关单号获取入库数据
|
|
/// </summary>
|
|
/// <param name="BLNO"></param>
|
|
/// <param name="CUSTOMNO"></param>
|
|
/// <returns></returns>
|
|
public ContentResult GetDataWithBLNOAndWMSNO ( string BLNO, string CUSTOMNO )
|
|
{
|
|
bool hasExist = WMSNewDAL.CheckHasExistWMSInWBLNO(BLNO);
|
|
|
|
if (hasExist)
|
|
{
|
|
var json = JsonConvert.Serialize(new { Success = false, Message = "提单号" + BLNO + "下已存在入库单,无法再次新建入库单!" });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
else
|
|
{
|
|
int count = 1;
|
|
string sMBLNO = "";//提单号
|
|
string sMCUSTOMNO = "";//报关单号、备案清单号
|
|
string sCONTRACTNO = "";//合同号
|
|
string sCUSTNO = "";//委托编号
|
|
string sCUSTOMERNAME = "";//客户名称
|
|
string sBSNO = ""; //海运进口业务gid
|
|
string sCTNALL = "";//箱型
|
|
string sCNTRNO = "";//箱号
|
|
string sSEALNO = "";//封号
|
|
string sISBONDED = "";//是否保税业务
|
|
int sPKGS = 0;
|
|
int sBAOGUANJIANSHU = 0;
|
|
var timeStamp = DateTime.Now.ToShortDateString();
|
|
WMSNewDAL.GetDataWithBLNOAndWMSNO(BLNO, CUSTOMNO, out sMBLNO, out sMCUSTOMNO, out sCONTRACTNO, out sCUSTNO, out sCUSTOMERNAME, out sBSNO, out sCTNALL, out sCNTRNO, out sBAOGUANJIANSHU, out sPKGS, out sSEALNO,out sISBONDED);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, CONTRACTNO = sCONTRACTNO, CUSTNO = sCUSTNO, CUSTOMERNAME = sCUSTOMERNAME, timeStamp = timeStamp, MBLNO = sMBLNO, MCUSTOMNO = sMCUSTOMNO, BSNO = sBSNO, CTNALL = sCTNALL, CNTRNO = sCNTRNO, BAOGUANJIANSHU = sBAOGUANJIANSHU, PKGS = sPKGS, SEALNO = sSEALNO,ISBONDED = sISBONDED });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
}
|
|
|
|
public ContentResult GetDetailsForGoodsName ( string codegoodsid )
|
|
{
|
|
var dataList = WMSNewDAL.GetGoodsDetailsWithGid(codegoodsid);
|
|
|
|
var list = dataList.Skip(0).Take(1000);
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据品牌名称和品名id查询件数
|
|
/// </summary>
|
|
/// <param name="goodsDetailsName"></param>
|
|
/// <param name="codeGoodsId"></param>
|
|
/// <returns></returns>
|
|
public ContentResult GetPKGWithGoodsDetailsNameAndCodeGoodsId ( string goodsDetailsName, string codeGoodsId )
|
|
{
|
|
string pkg = WMSNewDAL.GetPKGWithGoodsDetailsNameAndCodeGoodsId(goodsDetailsName,codeGoodsId);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = 1, data = pkg });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据提单号和报关单号,获取报关单号列表
|
|
/// </summary>
|
|
/// <param name="BLNO"></param>
|
|
/// <param name="CUSTOMNO"></param>
|
|
/// <returns></returns>
|
|
public ContentResult GetCustomsNoListWithBLNOAndCustomNo (string BLNO, string CUSTOMNO )
|
|
{
|
|
var dataList = WMSNewDAL.GetCustomsNoListWithBLNOAndCustomNo(BLNO,CUSTOMNO);
|
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetXMLMessageWithWMSNO (string WMSNO)
|
|
{
|
|
string USERID = CookieConfig.GetCookie_UserId(Request);
|
|
string message = "";
|
|
var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='QCKCBW'", Convert.ToString(Session["COMPANYID"]));
|
|
string trade_code = ftpset.SENDCOMPANYCODE;
|
|
string unit = ftpset.SENDSUBCOMPANYCODE;
|
|
string ip = ftpset.SERVERIP;
|
|
string xml = MSGDAL_HCHX_DATA.GetXMLMessageWithWMSNO(WMSNO, USERID, trade_code, unit,ip, out message);
|
|
var json = JsonConvert.Serialize(new { Success = message == "", Message = message ==""? "发送成功" : "发送失败,下列字段为空:"+message, totalCount = 1, data = xml });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发送报文
|
|
/// </summary>
|
|
/// <param name="WMSBSNO"></param>
|
|
/// <param name="type"></param>
|
|
/// <returns></returns>
|
|
public ContentResult GetXMLMessage4001WithWMSBSNO ( string WMSBSNO,int type )
|
|
{
|
|
string USERID = CookieConfig.GetCookie_UserId(Request);
|
|
string message = "";
|
|
var ftpset= MsCodeFtpSetDAL.GetData("EDINAME='CKRKBW'", Convert.ToString(Session["COMPANYID"]));
|
|
string trade_code = ftpset.SENDCOMPANYCODE;
|
|
string unit = ftpset.SENDSUBCOMPANYCODE;
|
|
string ip = ftpset.SERVERIP;
|
|
string xml = MSGDAL_HCHX_DATA2.GetXMLMessageWithWMSBSNO(WMSBSNO,USERID,out message,trade_code,unit,ip,type);
|
|
var json = JsonConvert.Serialize(new { Success = message=="", Message = message == "" ? "发送成功" : "发送失败,下列字段为空:" + message, totalCount = 1, data = xml });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
|
|
public ContentResult LockWMS (string wmsno,int type) {
|
|
string message = "";
|
|
bool rst = WMSNewDAL.LockWMS(wmsno, type, out message);
|
|
var json = JsonConvert.Serialize(new { Success = rst, Message = message, totalCount = 1 });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult LockWMS2 ( string wmsno, int type )
|
|
{
|
|
bool rst = WMSNewDAL.LockWMS2(wmsno, type);
|
|
var json = JsonConvert.Serialize(new { Success = rst, Message = rst ? "操作成功" : "操作失败", totalCount = 1 });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetCodeCtnList ( string mblno )
|
|
{
|
|
int count = 0;
|
|
var dataList = WMSNewDAL.GetCodeCtnList(mblno);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetCNTRNOList ( string mblno, string ctnall )
|
|
{
|
|
int count = 0;
|
|
var dataList = WMSNewDAL.GetCNTRNOList(mblno,ctnall);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据提单号,箱号 获取封号
|
|
/// </summary>
|
|
/// <param name="bsno"></param>
|
|
/// <param name="cntrno"></param>
|
|
/// <returns></returns>
|
|
public ContentResult GetSEALNOWithBLNOAndCNTRNO ( string bsno, string cntrno )
|
|
{
|
|
int pkgs = 0;
|
|
float cbm = 0.00f;
|
|
string SEALNO = WMSNewDAL.GetSEALNOWithBLNOAndCNTRNO(bsno, cntrno,out pkgs,out cbm);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = 1, data = SEALNO,pkgs=pkgs,cbm=cbm });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetGoodsNameWithGID ( string gid )
|
|
{
|
|
string goodsname = WMSNewDAL.GetGoodsNameWithGid(gid);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = 1, data=goodsname });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetZhuangXieGongList ()
|
|
{
|
|
List<Stevedores> zxglist = WMSNewDAL.GetZhuangXieGongList();
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = 999, data = zxglist });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetCheDuiList ( )
|
|
{
|
|
List<CheDui> zxglist = WMSNewDAL.GetCheDuiList();
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = 999, data = zxglist });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult CreateCost(string wmsno)
|
|
{
|
|
string msg = "";
|
|
string userid = Session["USERID"]==null?"":Session["USERID"].ToString();
|
|
bool rst= WMSNewDAL.CreateCost(wmsno,userid, out msg);
|
|
var json = JsonConvert.Serialize(new { Success = rst, Message =msg, totalCount = 1 });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
#region 仓储费费率相关
|
|
public ContentResult SaveRate ( string BSNONAME, string BSNO, string WMSRATEBody, string WMSRATEBodyDel )
|
|
{
|
|
var WMSRATEBodyList = JsonConvert.Deserialize<List<WMSRATEmb>>(WMSRATEBody);
|
|
var WMSRATEDelBodyList = JsonConvert.Deserialize<List<WMSRATEmb>>(WMSRATEBodyDel);
|
|
|
|
if (WMSRATEBodyList != null)
|
|
{
|
|
foreach (var _WR in WMSRATEBodyList)
|
|
{
|
|
_WR.MODIFIEDUSER = CookieConfig.GetCookie_UserName(Request);
|
|
_WR.MODIFIEDTIME = DateTime.Now.ToString();
|
|
}
|
|
}
|
|
|
|
var modb = new ModelObjectRepository();
|
|
DBResult result = modb.SaveComm(BSNONAME, BSNO,
|
|
ModelObjectConvert<WMSRATEmb>.ToModelObjectList(WMSRATEBodyList),
|
|
ModelObjectConvert<WMSRATEmb>.ToModelObjectList(WMSRATEDelBodyList)
|
|
);
|
|
|
|
//刷新父窗口上的父节点
|
|
var jsonRespose = new JsonResponse
|
|
{
|
|
Success = result.Success,
|
|
Message = result.Message,
|
|
//Data = XXHDAL.GetData("M.ContractNo='" + head.ContractNo + "'")
|
|
};
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
|
|
public ContentResult DelRate ( string BSNONAME, string BSNO, string WMSRATEBodyDel )
|
|
{
|
|
//var WMSRATEBodyList = JsonConvert.Deserialize<List<WMSRATEmb>>(WMSRATEBody);
|
|
var WMSRATEDelBodyList = JsonConvert.Deserialize<List<WMSRATEmb>>(WMSRATEBodyDel);
|
|
|
|
|
|
var modb = new ModelObjectRepository();
|
|
DBResult result = modb.SaveComm(BSNONAME, BSNO,
|
|
null,
|
|
ModelObjectConvert<WMSRATEmb>.ToModelObjectList(WMSRATEDelBodyList)
|
|
);
|
|
|
|
//刷新父窗口上的父节点
|
|
var jsonRespose = new JsonResponse
|
|
{
|
|
Success = result.Success,
|
|
Message = result.Message,
|
|
//Data = XXHDAL.GetData("M.ContractNo='" + head.ContractNo + "'")
|
|
};
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
}
|
|
|
|
public ContentResult GetWMSRATE ( int start, int limit, string sort, string condition )
|
|
{
|
|
var dataList = WMSNewDAL.GetWMSRATE(condition, sort);
|
|
|
|
var list = dataList.Skip(start).Take(limit);
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
#endregion
|
|
public ContentResult GetSysFeeConfig ( string userid )
|
|
{
|
|
var value = WMSNewDAL.GetSysFeeConfig("");
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount =1, data = value.ToString() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetImportFeeModel ( string custname,string goodnameid )
|
|
{
|
|
var list = WMSNewDAL.GetImportFeeModel(custname, goodnameid);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = list.Count, data = list });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetZhuangXieFeiWithZhuangXieGongID ( string gid)
|
|
{
|
|
int count = 0;
|
|
float feejian = 0;
|
|
float feeton = 0;
|
|
WMSNewDAL.GetZhuangXieFeiWithZhuangXieGongID(gid,out feejian,out feeton);
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data1 = feejian,data2 =feeton });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
}
|
|
} |