diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index 3463889a..49a89b94 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -4389,6 +4389,15 @@ namespace DSWeb.Common.DB public string Type { get; set; } } - - + /// + /// 云港通 码头 回执状态 type= YGT,YARD,CARRIER + /// + [Table("user_attribute")] + public class user_attribute_md + { + [Key] + public string GID { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + } } \ No newline at end of file diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 70d0e4cf..dde42d5c 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -152,6 +152,7 @@ namespace DSWeb.Common.DB public DbSet op_seae_vgm_history { get; set; } public DbSet op_seae_vgm_state { get; set; } + public DbSet user_attribute { get; set; } diff --git a/DSWeb/Areas/CommMng/Controllers/BasicDataRefController.cs b/DSWeb/Areas/CommMng/Controllers/BasicDataRefController.cs index 048314b2..e027cf1c 100644 --- a/DSWeb/Areas/CommMng/Controllers/BasicDataRefController.cs +++ b/DSWeb/Areas/CommMng/Controllers/BasicDataRefController.cs @@ -84,6 +84,44 @@ namespace DSWeb.Areas.CommMng.Controllers return Json(new { success = true, data = evList.ToList() }); } } + + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 + public JsonResult GetUserByAttribute(string AttributeName, string dbname = "") + { + + /*是否允许使用本系统 +是否操作 +是否销售 +是否司机 +是否报关员 +是否单证 +是否财务 +是否停用 +是否客服 +是否派车调度人员*/ + var cdc = new CommonDataContext(); + + var 角色属性 = cdc.user_attribute.Where(x => x.DESCRIPTION.IndexOf(AttributeName) >= 0).ToList(); + + if (角色属性 == null || 角色属性.Count == 0) { + return Json(new { success = false }); + } + + var condition = $" u.GID IN (SELECT USERID FROM user_userattribute WHERE ATTRIBUTEID='{角色属性[0].GID}' and VALUE='true' ) "; + + + List evList = BasicDataRefDAL.GetUserRefList(condition, dbname); + + if (evList.Count == 0) + { + return Json(new { success = false }); + } + else + { + return Json(new { success = true, data = evList.ToList() }); + } + } + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 public JsonResult GetUserActionRefListRm(string CODENAME,string MODULENAME, string condition = "") { diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index 77296ce0..173aaabd 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -7868,6 +7868,7 @@ namespace DSWeb.Areas.CommMng.DAL /// Unicode编码后的字符串 public static string String2Unicode(string source) { + if (string.IsNullOrWhiteSpace(source)) return ""; byte[] bytes = Encoding.Unicode.GetBytes(source); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < bytes.Length; i += 2) @@ -7884,6 +7885,7 @@ namespace DSWeb.Areas.CommMng.DAL /// 正常字符串 public static string Unicode2String(string source) { + if (string.IsNullOrWhiteSpace(source)) return ""; return new Regex(@"\\u([0-9A-F]{4})", RegexOptions.IgnoreCase | RegexOptions.Compiled).Replace( source, x => string.Empty + Convert.ToChar(Convert.ToUInt16(x.Result("$1"), 16))); } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsSeaeOrderController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsSeaeOrderController.cs index b503bb2c..e37b80e0 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsSeaeOrderController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsSeaeOrderController.cs @@ -484,9 +484,10 @@ namespace DSWeb.MvcShipping.Controllers [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 public ContentResult GetAuditDataList(int start, int limit, string sort, string condition) { - var dataList = MsSeaeOrderDAL.GetAuditDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort); - var list = dataList.Skip(start).Take(limit); - var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() }); + 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"])); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = list.ToList() }); return new ContentResult() { Content = json }; } diff --git a/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs index 2599c0cb..ba0c50c9 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsSeaeOrder/MsSeaeOrderDAL.cs @@ -789,7 +789,7 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL #region 审核通过处理 - static public List GetAuditDataList(string strCondition, string userid, string usercode, string companyid, string sort = null) + static public List GetAuditDataList(string strCondition, string userid, string usercode, string companyid, int start, int limit,string sort = null ) { var rangstr = ""; @@ -813,9 +813,24 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL strCondition = rangstr; } } - // + var strSql = new StringBuilder(); - strSql.Append("SELECT ORDNO,BSNO,ORSTATUS,ORREASON,BSDATE,MBLNO,CUSTOMERNAME,ORDTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,YARD"); + + strSql.Append(@"SELECT * from (SELECT row_number() over ("); + + var sortstring = DatasetSort.Getsortstring(sort); + if (!string.IsNullOrEmpty(sortstring)) + { + strSql.Append(" order by " + sortstring); + } + else + { + strSql.Append(" order by BSDATE desc"); + } + strSql.Append(@") as num , "); + //strSql.Append(" SELECT "); + + strSql.Append(" ORDNO,BSNO,ORSTATUS,ORREASON,BSDATE,MBLNO,CUSTOMERNAME,ORDTYPE,SHIPPERID,CONSIGNEEID,NOTIFYPARTYID,YARD"); strSql.Append(",SHIPPER,CONSIGNEE,NOTIFYPARTY,VESSEL,VOYNO,ETD,PlACERECEIPT,PlACERECEIPTID,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE"); strSql.Append(",PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,ISSUEPLACEID,BLFRT"); strSql.Append(",PREPARDAT,PAYABLEAT,[SERVICE],MARKS,NOPKGS,[DESCRIPTION],GOODSNAME,GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS"); @@ -838,15 +853,19 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL strSql.Append(" where " + strCondition); } // - var sortstring = DatasetSort.Getsortstring(sort); - if (!string.IsNullOrEmpty(sortstring)) - { - strSql.Append(" order by " + sortstring); - } - else - { - strSql.Append(" order by BSDATE desc"); - } + //var sortstring = DatasetSort.Getsortstring(sort); + //if (!string.IsNullOrEmpty(sortstring)) + //{ + // strSql.Append(" order by " + sortstring); + //} + //else + //{ + // strSql.Append(" order by BSDATE desc"); + //} + + strSql.Append(@")as t "); + strSql.Append(string.Format("where t.num>{0} and t.num<={1} order by t.num ", start, start + limit)); + return SetData(strSql); } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGrid.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGrid.js index fce32ebe..eaa105a7 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGrid.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGrid.js @@ -8771,6 +8771,19 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, { return; } + + var taxrate = selectedRecords[0].data.TaxRate; + var acctaxrate = selectedRecords[0].data.AccTaxRate; + for (var i = 0; i < selectedRecords.length; i++) { + var rec = selectedRecords[i].data; + + if (rec.TaxRate != taxrate || rec.AccTaxRate != acctaxrate) { + Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '税率不同的费用不能同时申请开票!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + } + + var invcurr = ''; var invcurrusd = ''; var invcust = ''; diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsSeaeOrder/MsSeaeOrderEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsSeaeOrder/MsSeaeOrderEdit.js index 36530882..1528d7de 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsSeaeOrder/MsSeaeOrderEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsSeaeOrder/MsSeaeOrderEdit.js @@ -814,8 +814,7 @@ Ext.extend(Shipping.MsSeaeOrderEdit, Ext.Panel, { }); - - + //服务项目 this.myCheckboxService = new Ext.form.CheckboxGroup({ id: 'myService', xtype: 'checkboxgroup', @@ -943,8 +942,6 @@ Ext.extend(Shipping.MsSeaeOrderEdit, Ext.Panel, { }); - - //#endregion //运输条款 this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', { model: 'CODE_SERVICE', @@ -1061,6 +1058,7 @@ Ext.extend(Shipping.MsSeaeOrderEdit, Ext.Panel, { name: 'TRADETERM' }); + //#endregion //#region 编辑formHead 基本信息 this.formHead = Ext.widget('form', {