'往来单位快速限制人员'

临时发布20240103
ddlucky 2 years ago
parent 0694e1d230
commit 79018479fa

18
.gitignore vendored

@ -22,4 +22,20 @@ Job_JieFeng_FTP/obj
JsonHelper/obj
OfficeHelper/obj
ToolProject/FastDBF/obj
WebSqlHelper/obj
WebSqlHelper/obj
DSWeb.Common/bin/Debug/DSWeb.Common.dll
DSWeb.Common/bin/Debug/DSWeb.Common.pdb
DSWeb.Common/obj/Debug/DSWeb.Common.dll
DSWeb.Common/obj/Debug/DSWeb.Common.pdb
DSWeb.Interface/bin/Debug/DSWeb.Common.dll
DSWeb.Interface/bin/Debug/DSWeb.Common.pdb
DSWeb.Interface/obj/Debug/DSWeb.Interface.csproj.AssemblyReference.cache
DSWeb/bin/DSWeb.Common.dll
DSWeb/bin/DSWeb.Common.pdb
DSWeb/bin/DSWeb.dll
DSWeb/bin/DSWeb.pdb
DSWeb/bin/DSWebComponent.dll
DSWeb/bin/FrmHttpHelper.dll
DSWeb/bin/FrmHttpHelper.pdb
DSWeb/bin/SocialExplorer.FastDBF.dll
DSWeb/bin/SocialExplorer.FastDBF.pdb

@ -1271,4 +1271,30 @@ namespace DSWeb.Common.DB
#endregion
}
/// <summary>
///2E5E6066-1C5D-4B04-BF8C-56637C20FC8C 是否允许使用本系统
///31AC11C1-D005-46EC-A0EE-05BC211AE1B7 是否操作
///3C91140E-6FB6-4B5A-B5AB-30E59E3CBBED 是否销售
///3CF26819-B519-4595-89E3-9F46A205218E 是否司机
///4211AD22-FBF5-4A74-8A53-6AC05E598982 是否报关员
///A879800D-1CDC-4248-8120-7854431F2BE3 是否单证
///D22315B2-3612-491A-B9E5-937E5E2CF310 是否财务
///D4BF2204-F0AC-4F12-B02C-6520D57BF800 是否停用
///D4BF2204-F0AC-4F12-B02C-6520D57BF806 是否客服
///DFF42726-A0BA-4264-BFDF-2500A35E89C7 是否派车调度人员
/// </summary>
[Table("user_userattribute")]
public partial class user_userattribute_md
{
[Key]
public string GID { get; set; }
public string USERID { get; set; }
public string ATTRIBUTEID { get; set; }
public string VALUE { get; set; }
}
}

@ -54,7 +54,10 @@ namespace DSWeb.Common.DB
public DbSet<v_ch_fee_settlementinfo_md> v_ch_fee_settlementinfo { get; set; }
public DbSet<VW_user_md> VW_user { get; set; }
public DbSet<user_userattribute_md> user_userattribute { get; set; }
}

@ -34,6 +34,7 @@ using DSWeb.SoftMng.Filter;
using DSWeb.MvcShipping.DAL.MsBaseInfoDAL;
using DSWeb.MvcShipping.DAL.MsOpRailwayDAL;
using DSWeb.MvcShipping.Models.MsOpRailway;
using DSWeb.Common.DB;
namespace DSWeb.MvcShipping.Controllers
{
@ -409,9 +410,6 @@ namespace DSWeb.MvcShipping.Controllers
}
public ContentResult Delete ( string data )
{
var headData = JsonConvert.Deserialize<MsClient>(data);
@ -441,7 +439,6 @@ namespace DSWeb.MvcShipping.Controllers
}
}
public ContentResult ISREPEAT(string cust,string codename,string draccid,string craccid)
{
@ -1659,6 +1656,31 @@ namespace DSWeb.MvcShipping.Controllers
#endregion
#region 独立版本功能 设定往来单位权限
/// <summary>
/// //1集团 2分公司 3个人
//1集团 即清空所有往来单位人员权限
//2分公司 效果为选中所有该往来单位录入人的本公司人员
//3个人 效果为选中录入人本人 和他所在公司的操作部、财务
/// </summary>
/// <param name="RANGETYPE"></param>
/// <param name="data"></param>
/// <returns></returns>
public ContentResult SetRange(string RANGETYPE, string data)
{
var result = MsInfoClientDAL.SetRange(RANGETYPE, data, Convert.ToString(Session["USERID"]));
//var result = MsInfoClientDAL.InsertClientRange(dataList, op, seltype, Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse(result);
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
}
}

@ -22,6 +22,8 @@ using System.Text.RegularExpressions;
using System.Linq;
using System.Data.Common;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.Common.DB;
using DSWeb.MvcShipping.Helper;
namespace DSWeb.MvcShipping.DAL.MsInfoClient
{
@ -110,19 +112,19 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
//未作指定的单位全都能看
//指定过userid的单位 只有指定的人才能看到
//高级管理员任何时候不受限制
var InfoClintRange = MsSysParamSetDAL.GetData("PARAMNAME='ISENABLECUSTRANGE'");
if (InfoClintRange.PARAMVALUE != "")
{
if (InfoClintRange.PARAMVALUE == "1" && userid!= "1BEC90E1-9780-472F-90C2-0C6390C044A4")
{
//var InfoClintRange = MsSysParamSetDAL.GetData("PARAMNAME='ISENABLECUSTRANGE'");
//if (InfoClintRange.PARAMVALUE != "")
//{
// if (InfoClintRange.PARAMVALUE == "1" && userid!= "1BEC90E1-9780-472F-90C2-0C6390C044A4")
// {
strSql.Append("and (not exists(select 1 from info_client_range where SHORTNAME=info_Client.SHORTNAME )");
// strSql.Append("and (not exists(select 1 from info_client_range where SHORTNAME=info_Client.SHORTNAME )");
strSql.Append(" or exists(select 1 from info_client_range where SHORTNAME=info_Client.SHORTNAME and userid='" + userid + "'))");
// strSql.Append(" or exists(select 1 from info_client_range where SHORTNAME=info_Client.SHORTNAME and userid='" + userid + "'))");
}
}
// }
//}
if (!string.IsNullOrEmpty(strCondition))
@ -1741,7 +1743,11 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
var cmddeletefeedo = db.GetSqlStringCommand("delete from info_client_range where userid in (select userid from VW_user where companyid IN (" + op + ")) and SHORTNAME='" + enumValue.SHORTNAME + "' ");
db.ExecuteNonQuery(cmddeletefeedo, tran);
}
else if (seltype == "3")
{
var cmddeletefeedo = db.GetSqlStringCommand("delete from info_client_range where SHORTNAME='" + enumValue.SHORTNAME + "' ");
db.ExecuteNonQuery(cmddeletefeedo, tran);
}
}
result = new DBResult();
result.Success = true;
@ -1764,6 +1770,7 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
return result;
}
#endregion
@ -2507,7 +2514,6 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
#endregion
#region 往来单位审核
public static DBResult IC_Start ( List<MsClient> _List, string USERID ) //申请签入
{
@ -2808,8 +2814,102 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
#endregion
#region 独立版本功能 设定往来单位权限
public static DBResult SetRange(string RANGETYPE, string data,string USERID)
{
//1集团 2分公司 3个人
//1集团 即清空所有往来单位人员权限
//2分公司 效果为选中所有该往来单位录入人的本公司人员
//3个人 效果为选中录入人本人 和他所在公司的操作部、财务
var dataList = JsonConvert.Deserialize<List<MsClient>>(data);
var result = new DBResult();
//op为一串用逗号隔开的带单引号userid 形如 'aaaaa','bbbbb'
var op = "";
var seltype = "2";
var cdc = new CommonDataContext();
if (RANGETYPE == "1")
{
result = MsInfoClientDAL.DelClientRange(dataList, op, seltype, USERID);
}
if (RANGETYPE == "2")
{
result = MsInfoClientDAL.DelClientRange(dataList, op, seltype, USERID);
//获取本公司的所有人gid
var = new List<VW_user_md>();
foreach (var item in dataList)
{
= cdc.VW_user.Where(x => x.COMPANYID == item.CORPID).ToList();
op = GetUseridStr();
var templist = dataList.Where(x => x.GID == item.GID).ToList();
result = MsInfoClientDAL.InsertClientRange(templist, op, seltype, USERID);
if (!result.Success) return result;
}
}
if (RANGETYPE == "3")
{
result = MsInfoClientDAL.DelClientRange(dataList, op, "3", USERID);
//获取本公司非销售人员
//user_userattribute.userid属于本公司 且attri 3C91140E-6FB6-4B5A-B5AB-30E59E3CBBED
var = new List<VW_user_md>();
foreach (var item in dataList)
{
= cdc.VW_user.Where(x => x.COMPANYID == item.CORPID).ToList();
var = .FirstOrDefault(x => x.SHOWNAME == item.OPNAME);
op = str();
if (op != "") op += ",";
op += $"'{本人.USERID}'";
result = MsInfoClientDAL.InsertClientRange(dataList, op, seltype, USERID);
if (!result.Success) return result;
}
}
return result;
}
private static string GetUseridStr(List<VW_user_md> vwuserlist)
{
var result = "";
foreach (var user in vwuserlist)
{
if (result != "") result += ",";
result += $"'{user.USERID}'";
}
return result;
}
private static string str(List<VW_user_md> vwuserlist)
{
var cdc = new CommonDataContext();
var useridlist = vwuserlist.Select(s => s.USERID).ToList();
var List = cdc.user_userattribute.Where(x => useridlist.Contains(x.USERID) && x.ATTRIBUTEID == "3C91140E-6FB6-4B5A-B5AB-30E59E3CBBED" && x.VALUE == "false").ToList();
var UseridList = List.Select(s => s.USERID).ToList();
var result = "";
foreach (var userid in UseridList)
{
if (result != "") result += ",";
result += $"'{userid}'";
}
return result;
}
#endregion
#region 参照部分

@ -618,7 +618,30 @@ Ext.extend(Shipping.MsInfoClientIndex, Ext.Panel, {
window.open(openUrl, openType, openSet);
},
scope: this
}, '-',
}, '-',
{
text: Zi.LAN.SetRange, //"打印",
iconCls: 'btnexportexcel',
menu: [
{
text: Zi.LAN.SetRange_All, //"全部",
handler: function (menu, event) {
_this.onSetRange(1);
}
}, {
text: Zi.LAN.SetRange_Company, //"全部",
handler: function (menu, event) {
_this.onSetRange(2);
}
}, {
text: Zi.LAN.SetRange_Personal, //"全部",
handler: function (menu, event) {
_this.onSetRange(3);
}
}],
scope: this
}, '-',
{
text: Zi.LAN.btnReset, //"重置条件",
iconCls: "btnreset",
@ -1307,7 +1330,54 @@ Ext.extend(Shipping.MsInfoClientIndex, Ext.Panel, {
scope: this
}); //end Ext.Ajax.request
}
, onSetRange: function (RANGETYPE) {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
alert("请先选择至少一个往来单位");
} else {
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
bodyList.push(member);
//if (member.data.BLSTATUSREF != "录入状态" && member.data.BLSTATUSREF != "驳回提交") {
// //alert(Zi.LAN.ZhiNengTiJiaoLuRuZhuangTaiHuoBoHuiTiJiaoDeWangLaiDanWei); //"只能提交 录入状态 或 驳回提交 的往来单位"
//} else {
// bodyList.push(member);
//}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsInfoClient/SetRange',
params: {
RANGETYPE: RANGETYPE,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
this.onRefreshClick();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}
});

@ -44,6 +44,11 @@ Zi.LAN.SaveGridPanel = "Initial";
Zi.LAN.SWIFT = "Agent Bank SWIFT";
Zi.LAN.UpdateCustomersWith = "Change Info";
Zi.LAN.SetRange = "设置范围";
Zi.LAN.SetRange_All = "设为集团";
Zi.LAN.SetRange_Company = "设为分公司";
Zi.LAN.SetRange_Personal = "设为个人";
Zi.LAN.ACCDAYS = "Interval Days";//间隔日
Zi.LAN.ACCMONTH = "Interval Month";//间隔月
Zi.LAN.ACCSTARTDATE = "Beginning Date";//账期起算日

@ -45,6 +45,11 @@ Zi.LAN.SaveGridPanel = "初始化";
Zi.LAN.SWIFT = "代理银行SWIFT";
Zi.LAN.UpdateCustomersWith = "客户名称更改";
Zi.LAN.SetRange = "设置范围";
Zi.LAN.SetRange_All = "设为集团";
Zi.LAN.SetRange_Company = "设为分公司";
Zi.LAN.SetRange_Personal = "设为个人";
Zi.LAN.ACCDAYS = "间隔日";
Zi.LAN.ACCMONTH = "间隔月份";
Zi.LAN.ACCSTARTDATE = "账期起算日";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save