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.

1704 lines
54 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.RptMng.Comm;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.SoftMng.BLL;
using DSWeb.MvcShipping.Comm.Cookie;
using DSWeb.MvcShipping.Helper;
using HcUtility.Comm;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web.Mvc;
namespace DSWeb.Areas.CommMng.Controllers
{
[JsonRequestBehavior]
public class BasicDataRefController : Controller
{
//
// GET: /CommMng/BasicDataRef/GetFeeTypeRefList
#region 费用名称 费用分组
public JsonResult GetFeeTypeRefList(string condition)
{
List<FeeTypeRefModel> evList = BasicDataRefDAL.GetFeeTypeRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetFeeGroupRefList ( string condition )
{
List<FeeTypeRefModel> evList = BasicDataRefDAL.GetFeeGroupRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
//
// GET: /CommMng/BasicDataRef/GetUserRefList
public JsonResult GetUserRefList(string condition, string dbname = "")
{
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList(condition, dbname);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
/// <summary>
/// 根据国家代码获取企业代码类型
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public JsonResult GetEnterpriseCodetype(string code)
{
t_sys_country_codeBLL bll = new t_sys_country_codeBLL();
var list = bll.GetModelList("c_country_code='" + code + "'");
return Json(list);
}
#region 国家
public JsonResult GetCountryList(string condition)
{
var evList = BasicDataRefDAL.GetCountryList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
public JsonResult GetUser_0 ()
{
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList("", "");
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserLinkRefList(string condition)
{
List<UserLinkRefModel> evList = BasicDataRefDAL.GetUserLinkRefList(condition,Convert.ToString(Session["COMPANYID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserLinkRefListRm(string CODENAME,string condition="")
{
if (CODENAME == "")
{
}
else
{
if (condition=="")
condition = " (u.CODENAME like '" + CODENAME + "%' or u.SHOWNAME like '%" + CODENAME + "%') ";
else
condition = condition+ " and (u.CODENAME like '" + CODENAME + "%' or u.SHOWNAME like '%" + CODENAME + "%') ";
}
List<UserLinkRefModel> evList = BasicDataRefDAL.GetUserLinkRefList(condition, Convert.ToString(Session["COMPANYID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetUserRefList
public JsonResult GetPluRefList(string condition)
{
List<PluRefModel> evList = BasicDataRefDAL.GetPluRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public ContentResult GetCustomRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE,userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json =JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListRm(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
} else
condition = " (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%"+CODENAME+"%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE ="0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListController(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISCONTROLLER=1 ";
}
else condition = " ISCONTROLLER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListCARRIER(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISCARRIER=1 ";
}
else condition = " ISCARRIER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListYARD(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISYARD=1 ";
}
else condition = " ISYARD=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
//var userid = CookieConfig.GetCookie_UserId(Request);
//var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListFORWARDER(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISBOOKING=1 ";
}
else condition = " ISBOOKING=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListTRUCK(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISTRUCK=1 ";
}
else condition = " ISTRUCK=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListCUSTOM(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISCUSTOM=1 ";
}
else condition = " ISCUSTOM=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListSHIPAGENCY(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISSHIPAGENCY=1 ";
}
else condition = " ISSHIPAGENCY=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListWAREHOUSE(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISWAREHOUSE=1 ";
}
else condition = " ISWAREHOUSE=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListEnterp(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " ISENTERP=1 ";
}
else condition = " ISENTERP=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetCustom_SPPrice ( string condition )
{
var evList = BasicDataRefDAL.GetCustom_SPPrice(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public ContentResult GetCustomYardRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomYardRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomInvRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomInvRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomInvRefListRm(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = "";
}
else condition = " (CODENAME like '" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = "0";
var evList = BasicDataRefDAL.GetCustomInvRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetCustomContact(string linkId)
{
var evList = BasicDataRefDAL.GetCustomContactRefList("LinkId='"+linkId+"'");
if (evList.Count == 0)
{
return Json(new { success = true,data=new CustomContactRefModel() });
}
else
{
return Json(new { success = true, data = evList[0] });
}
}
public JsonResult GetCustomContactList(string custCode)
{
var evList =
BasicDataRefDAL.GetCustomContactRefList("LINKID in (select gid from info_client where CODENAME='" +
custCode + "')");
return Json(new { success = true, data = evList.ToList() });
}
public ContentResult GetCustomACCOUNTList(string condition)
{
var evList = BasicDataRefDAL.GetMsClientAccount(condition);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetAirLinesList ( string condition )
{
var evList = BasicDataRefDAL.GetAirLinesList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSource()
{
var evList = BasicDataRefDAL.GetSourceList("1=1");
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptList(string condition)
{
if (!string.IsNullOrEmpty(condition))
{
condition += " and LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
else
{
condition = "LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
var evList = BasicDataRefDAL.GetDeptList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptListRm(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = "";
}
else condition = " (DEPTNAME like '" + CODENAME + "%') ";
if (!string.IsNullOrEmpty(condition))
{
condition += " and LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
else
{
condition = "LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
var evList = BasicDataRefDAL.GetDeptList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSourceDetail(string SourceId)
{
var evList = BasicDataRefDAL.GetSourceDetailList("SOURCEID='" + SourceId + "'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSourceDetail2(string condition)
{
var evList = BasicDataRefDAL.GetSourceDetailList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetVoyRefList
public JsonResult GetVoyRefList(string condition)
{
var evList = BasicDataRefDAL.GetVoyRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetVoyRefList
public JsonResult GetCtnRefList(string condition)
{
var evList = BasicDataRefDAL.GetCtnRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCtnDispList ( string condition )
{
var evList = BasicDataRefDAL.GetCtnDispList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCountryRefList(string condition)
{
var evList = BasicDataRefDAL.GetCountryRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult GetCargoRefList(string condition)
{
var evList = BasicDataRefDAL.GetCargoRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
/// <summary>
/// 根据条件 查询HS代码对应的税率
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public JsonResult GetCargoTax(string condition)
{
var evList = BasicDataRefDAL.GetCargoTax(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCargociqRefList(string condition)
{
var evList = BasicDataRefDAL.GetCargociqRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult GetcompanyList(string condition)
{
var evList = BasicDataRefDAL.GetcompanyList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult Getimportremind(string condition)
{
var evList = BasicDataRefDAL.GetRemindList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetcurrRefList
/// <summary>
/// 币别信息 和币别的默认汇率
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public JsonResult GetcurrRefList(string condition)
{
var evList = BasicDataRefDAL.GetcurrRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetTrader
public JsonResult GetTrader(string condition)
{
var evList = BasicDataRefDAL.GetTrader(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetPCTrader ( string condition )
{
var evList = BasicDataRefDAL.GetPCTrader(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetBank
public JsonResult GetBank(string condition)
{
var evList = BasicDataRefDAL.GetBank(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetAccitems
public JsonResult GetAccitems(string condition)
{
var evList = BasicDataRefDAL.GetAccitems(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetMngAccitems(string condition)
{
var evList = BasicDataRefDAL.GetMngAccitems(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//获取权限范围
public ContentResult GetAuthorityRange(string modName, string USERID)
{
var evList = BasicDataRefDAL.GetAR( modName, USERID);
AuthorityRangemb head = null;
if (evList.Count > 0)
head = evList[0];
if (head == null)
{
head = new AuthorityRangemb();
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
#region 获取本部门领取且未支取的支票号
public JsonResult GetUnusedCHEQUENUM(string DEPTID, string BXGID)
{
var evList = BasicDataRefDAL.GetUnusedCHEQUENUM(DEPTID, BXGID);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 键值维护表 crm_key_code
public JsonResult GetCrmKeyCodeList(string condition)
{
var evList = BasicDataRefDAL.GetCrmKeyCodeList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CrmKeyCodeModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 品名
public JsonResult GetCodeGoodsList(string condition)
{
var evList = BasicDataRefDAL.GetCodeGoodsList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeGoodsListRm(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = " 1=1 ";
}
else condition = " (GOODCODE like '%" + CODENAME + "%' or GOODNAME like '%" + CODENAME + "%') ";
var evList = BasicDataRefDAL.GetCodeGoodsList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeGoodsListWmsRm(string CODENAME)
{
var condition = "";
var evList = new List<CodeGoodsModel>();
var WMSGOODNAMEIMPORTTRADE = MsSysParamSetDAL.GetData("PARAMNAME='WMSGOODNAMEIMPORTTRADE'");
if (WMSGOODNAMEIMPORTTRADE.PARAMVALUE == "1")
{
if (CODENAME == "")
{
condition = " 1=1 ";
}
else condition = " CNNAME like '%" + CODENAME + "%' ";
evList = BasicDataRefDAL.GetImportCodeGoodsList(condition);
}
else {
if (CODENAME == "")
{
condition = " 1=1 ";
}
else condition = " (GOODCODE like '%" + CODENAME + "%' or GOODNAME like '%" + CODENAME + "%') ";
evList = BasicDataRefDAL.GetCodeGoodsList(condition);
}
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
public ContentResult GetInvTemplateList(string condition)
{
var evList = BasicDataRefDAL.Getsys_templateList();
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
#region 品名明细表
public JsonResult GetCodeGoodsDetailList(string condition)
{
var evList = BasicDataRefDAL.GetCodeGoodsDetailList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 新版键值维护表 tSysEnumValue
public JsonResult GetTSysEnumValueList(string condition)
{
var evList = BasicDataRefDAL.GetTSysEnumValueList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new TSysEnumValueDataModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 国际港口(进口装货港、出口卸货港)
public JsonResult GetCodeDisportList()
{
var evList = BasicDataRefDAL.GetCodeDisportList("");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeDisportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeDisportListRm(string PORT)
{
if (PORT == "")
{
return Json(new { success = true, data = new CodeDisportModel() });
}
var evList = BasicDataRefDAL.GetCodeDisportList(" PORT LIKE '%" + PORT + "%' or CNAME like '%"+PORT+"%'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeDisportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 国内港口(出口装货港、进口卸货港)
public JsonResult GetCodeLoadportListRm(string PORT)
{
if (PORT == "")
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
var evList = BasicDataRefDAL.GetCodeLoadportList(" PORT LIKE '%" + PORT + "%' or CNAME like '%" + PORT + "%'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeLoadportList()
{
var evList = BasicDataRefDAL.GetCodeLoadportList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 品名类型
public JsonResult GetCodeGoodsTypeList()
{
var evList = BasicDataRefDAL.GetCodeGoodsTypeList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 箱型
public JsonResult GetCodeCtnList()
{
var evList = BasicDataRefDAL.GetCodeCtnList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeCtnModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 集装箱显示
public JsonResult GetCtnDisp()
{
var evList = BasicDataRefDAL.GetCtnDisp();
if (evList == null)
{
return Json(new { success = true, data = new CtnDispModel() });
}
else
{
return Json(new { success = true, data = evList });
}
}
#endregion
#region 航线
public JsonResult GetCodeLaneList()
{
var evList = BasicDataRefDAL.GetCodeLaneList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new LaneModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 付费方式
public JsonResult GetCodeFrtList()
{
var evList = BasicDataRefDAL.GetCodeFrtList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeFrtModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 签单方式
public JsonResult GetCodeBLTYPEList()
{
var evList = BasicDataRefDAL.GetCodeBLTYPEList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeBLTYPEModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 运输条款
public JsonResult GetCodeSERVICEList()
{
var evList = BasicDataRefDAL.GetCodeSERVICEList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeSERVICEModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 提单模板
public JsonResult GetCodeTemplateList()
{
var evList = BasicDataRefDAL.GetCodeTemplateList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeTemplateModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 船名
public JsonResult GetVesselList(string condition)
{
var evList = BasicDataRefDAL.GetVesselList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new VesselModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetVoyNoList(string condition)
{
var evList = BasicDataRefDAL.GetVoyNoList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new VesselModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 件数包装
public JsonResult GetCodePackageList()
{
var evList = BasicDataRefDAL.GetCodePackageList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodePackageModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 币别
public JsonResult GetCodeCurrencyList(string condition)
{
var evList = BasicDataRefDAL.GetCodeCurrencyList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeCurrencyModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 委托单位_联系人
public JsonResult GetInfoClientContactList(string condition)
{
var evList = BasicDataRefDAL.GetInfoClientContactList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new InfoClientContactModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 项目
public JsonResult GetCwItemList(string condition)
{
var evList = BasicDataRefDAL.GetCwItemList(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = true, data = new CwItemModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 科目币别表
public ContentResult GetCwAccitemsCurrencyList(string condition)
{
var dataList = BasicDataRefDAL.GetCwAccitemsCurrencyList(condition, Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataList.ToList() });
return new ContentResult() { Content = json };
}
#endregion
#region 业务类型
public JsonResult GetOPLBList(string condition)
{
var evList = BasicDataRefDAL.GetOPLBList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new OPLBModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 总账科目信息
public JsonResult GetCwAccitemsGl(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitemsGl(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 总账科目信息(包含上级科目)
public JsonResult GetCwAccitemsGlAll(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitemsGlAll(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 接口科目信息
public JsonResult GetCwAccitems(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitems(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 获取指定表内,符合条件的行的数量,主要用于防止删除主表
public ContentResult GetExist ( string tablename, string condition )
{
var _count = BasicDataRefDAL.GetExist(tablename,condition);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = _count });
return new ContentResult() { Content = json };
}
public ContentResult GetExist2 ( string tablename, string condition, string tablename2, string condition2 )
{
var _count = BasicDataRefDAL.GetExist(tablename, condition);
_count = _count+ BasicDataRefDAL.GetExist(tablename2, condition2);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = _count });
return new ContentResult() { Content = json };
}
#endregion
#region 通用上传文件方法 20191008重构
#region 典型调用方法
/*
URLINFO = { KeyValue: record.data.GID}; //该列数据主键值
UrlType = _this.PicUploadType; //在FileUrlModel当中设定的某个类型
onUpLoadFileClick: function(URLINFO, UrlType)
{
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 40,
frame: true,
//bodyStyle: 'padding:5px 5px 0',
//autoScroll: true,
border: false,
fileUpload: true,
items: [
{
xtype: 'fileuploadfield',
id: 'LoadFile',
name: 'LoadFile',
emptyText: '请选择文件',
fieldLabel: '文件',
buttonText: '选择文件',
//20191008 对上传的文件扩展名暂时不做限制
//regex: /^.+\.(jpg|jpeg|png|pdf|gif|bmp|tiff)$/,
//regexText: "只能选择jpg|jpeg|png|pdf|gif|bmp|tiff格式的文件",
allowBlank: false,
buttonCfg: { iconCls: 'uploaddialog' },
anchor: '99%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function() {
var UserFilePath = Ext.getCmp('LoadFile').getValue();
//if (!CheckFileExt(UserFilePath, /.frx/i)) {
// Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为frx文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/CommMng/BasicDataRef/FileUpload',
waitMsg: '正在上传',
method: 'POST',
submitEmptyText: false,
async: false,
params: {
URLINFO: Ext.JSON.encode(URLINFO),
UrlType: UrlType
},
success: function(form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
failure: function(form, action) {
form.reset();
win.close(this);
// if (action.failureType == Ext.form.Action.SERVER_INVALID) {
// Ext.MessageBox.alert('警告', action.result.errors.msg);
// }
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function() {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传文件",
width: 360,
height: 200,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
}*/
#endregion
[HttpPost]
public ContentResult FileUpload ( string URLINFO , string UrlType = "")
{
//UrlType形如 'CargoName' 用于在FileUrlModel当中标示某个表名与字段名的组合
//如果没有就必须在URLINFO中写清所有信息
// KeyValue在URLINFO中是必须的
var URLInfo = new FileUrlModel(URLINFO,UrlType);
jsonresponse result = new jsonresponse();
if (Request.Files.Count != 1)
{
result.success = false;
result.message = "请选择上传的文件";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
//FilePath
var file = Request.Files["LoadFile"];
if (file == null)
{
result.success = false;
result.message = "上传文件发生未知错误,请重新上传";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
var _r = URLInfo.SaveFile(file);
if (string.IsNullOrEmpty( _r))
{
result.success = false;
result.message = "没有正确上传文件";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
else {
result.success = true;
result.message = "文件上传成功";
result.data = _r;
ContentResult r = new ContentResult();
r.Content = JsonConvert.Serialize(result);
return r;
}
}
#endregion
#region 获取指定表内,符合条件的第一行
public ContentResult GetField(string tablename, string condition)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(" top 1 * ");
strSql.Append(" from " + tablename + " ");
if (!string.IsNullOrEmpty(condition))
{
strSql.Append(" where " + condition );
}
var dbparams = new List<CustomDbParamter>();
var paramps_sSQL = new CustomDbParamter();
paramps_sSQL.ParameterName = "@sSQL";
paramps_sSQL.DbType = DbType.String;
paramps_sSQL.Direction = ParameterDirection.Input;
paramps_sSQL.Value = strSql.ToString();
dbparams.Add(paramps_sSQL);
var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("sMsExesqlQry", dbparams, "Result_Set");
var json = RptHelper.GetRptJsonResult(0, 1, dbRptResult, "Result_Set", true);
return new ContentResult() { Content = json };
}
#endregion
#region 出纳摘要信息
public JsonResult GetEXPLAN(string condition)
{
var evList = BasicDataRefDAL.GetEXPLAN(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 通用查询方法 参数是查询语句必须把GID和值as成GID和GValue
public JsonResult GeneralSelect ( string condition )
{
var evList = BasicDataRefDAL.GeneralSelect(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region InfoClass管理分类表
public JsonResult GetMsInfoClass(string condition)
{
var evList = BasicDataRefDAL.GetMsInfoClass(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 客户子项目
public JsonResult GetMsInfoClientItem(string condition)
{
var evList = BasicDataRefDAL.GetMsInfoClientItem(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
}
}