From 120215455f4fb2e5a1447f3ecda87f36aca1f38f Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 27 二月 2026 08:54:22 +0800
Subject: [PATCH] 1)有到期时间的,到期前3个月变成红色(像人事管理那样);没有到期时间的,从建档时间起算,9个月后变成红色。完成 (2)建档后1个月没有下单,变成血红色。 完成 (3)列表中删除“完结状态”;操作中删除“订单关联” 完成 (4)在“应收款订单”后面增加“未收款金额” 、“逾期收款”完成
---
CY_ECommercePlatform/CY.BLL/OA/OA_CorporateClientsBLL.cs | 250 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 246 insertions(+), 4 deletions(-)
diff --git a/CY_ECommercePlatform/CY.BLL/OA/OA_CorporateClientsBLL.cs b/CY_ECommercePlatform/CY.BLL/OA/OA_CorporateClientsBLL.cs
index f9d15c8..762800b 100644
--- a/CY_ECommercePlatform/CY.BLL/OA/OA_CorporateClientsBLL.cs
+++ b/CY_ECommercePlatform/CY.BLL/OA/OA_CorporateClientsBLL.cs
@@ -85,6 +85,24 @@
}
}
+
+ /// <summary>
+ /// 淇敼鍚堜綔瀹㈡埛
+ /// </summary>
+ /// <param name="rType"></param>
+ /// <returns></returns>
+ public bool UpdateWanjie(CY.Model.OA_CorporateClients m_OA_CorporateClients)
+ {
+ try
+ {
+ return _IOA_CorporateClientsDal.UpdateWanjie(m_OA_CorporateClients);
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
/// <summary>
/// 璁剧疆鑷姩澶栧崗
/// </summary>
@@ -139,17 +157,32 @@
}
/// <summary>
- /// 鏌ヨ鍚堜綔瀹㈡埛鍒嗛〉鍒楄〃
+ /// 鏌ヨ鍚堜綔瀹㈡埛鍒嗛〉鍒楄〃 鎵�鏈夐潪蹇呰鍙傛暟璁剧疆榛樿鍊�
+ /// //寤� 鏂板鍔犳槸鍚﹂渶瑕佷緥琛岀淮鎶わ紝鏄惁闇�瑕佽妭鍋囨棩缁存姢涓や釜瀛楁鏌ヨ 20210913
/// </summary>
/// <param name="pa"></param>
/// <returns></returns>
- public IEnumerable<OA_CorporateClients> GetModelPageList(Pagination pa, Guid FirmId, string UserName, DateTime? beginTime,
-DateTime? endTime, string AccountManagerId, string BusinessManagerId, string CustomerIndustriesId, string CustomerTypeId, string DegreeImportanId,string LastOrderTime, string selOrderCount, string selOrderMoney, string SourcesInfoId, string TurnoverIntentionId, string OrderCount, string OrderMoney, string UserNum, string selLastOrderTime, string Province, string City, string County, bool IsStaff, Guid StaffMemberId,int? StaffId,string Shifouwanjie=null)
+ public IEnumerable<OA_CorporateClients> GetModelPageListEx(Pagination pa, Guid FirmId, string UserName = "", DateTime? beginTime = null,
+DateTime? endTime = null, string AccountManagerId = "", string BusinessManagerId = "", string CustomerIndustriesId = "", string CustomerTypeId = "", string DegreeImportanId = "", string LastOrderTime = "", string selOrderCount = "", string selOrderMoney = "", string SourcesInfoId = "", string TurnoverIntentionId = "",
+string OrderCount = "", string OrderMoney = "", string UserNum = "", string selLastOrderTime = "", string Province = "", string City = "", string County = "", bool IsStaff = true, Guid? StaffMemberId = null, int? StaffId = null, string Shifouwanjie = null,
+bool? NeedWeifu = null, bool? NeedJiejiaRiWeiFu = null)
{
string Condition = " and a.FirmId ='" + FirmId + "'";
if (!string.IsNullOrEmpty(UserNum))
Condition += " and CustomerId = " + UserNum;
+
+ //寤� 鏂板鍔犳槸鍚﹂渶瑕佷緥琛岀淮鎶わ紝鏄惁闇�瑕佽妭鍋囨棩缁存姢涓や釜瀛楁鏌ヨ 20210913
+ if (NeedWeifu != null)
+
+ Condition += string.Format(" and NeedWiHu='{0}'", NeedWeifu);
+
+ if (NeedJiejiaRiWeiFu != null)
+
+ Condition += string.Format(" and JieJiaRiWiHu='{0}'", NeedJiejiaRiWeiFu);
+
+
+
if (!string.IsNullOrEmpty(UserName))
Condition += " and CompanyName like '%" + UserName + "%'";
@@ -200,7 +233,126 @@
else if (!string.IsNullOrEmpty(Province) && !string.IsNullOrEmpty(City))
Condition += string.Format(" and Province='{0}' and City='{1}' and (( ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{2}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{2}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{3}' or BusinessManagerId='{3}' )", Province, City, StaffMemberId, StaffId);
else if (!string.IsNullOrEmpty(Province))
- Condition += string.Format(" and Province='{0}' and (( City IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageCity FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) and ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{2}' or BusinessManagerId='{2}' )", Province, StaffMemberId, StaffId);
+ Condition += string.Format(" and Province='{0}' and (( City IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageCity FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) and ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{2}' or BusinessManagerId='{2}' )", Province, StaffMemberId, StaffId);
+ else
+ Condition += string.Format(" and (( Province IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageProvince FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) and City IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageCity FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) and ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{1}' or BusinessManagerId='{1}' ) ", StaffMemberId, StaffId);
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(Province))
+ Condition += string.Format(" and Province='{0}'", Province);
+
+ if (!string.IsNullOrEmpty(City))
+ Condition += string.Format(" and City='{0}'", City);
+
+ if (!string.IsNullOrEmpty(County))
+ Condition += string.Format(" and County='{0}'", County);
+ }
+
+ Query query = new Query();
+ IList<Criterion> criterias = new List<Criterion>()
+ {
+ new Criterion("", Condition),
+
+ new Criterion("orderBy"," CustomerId DESC ")
+ };
+ query.Criteria = criterias;
+ return _IOA_CorporateClientsDal.SelectModelPage(query, pa);
+ }
+
+
+ /// <summary>
+ /// 鏌ヨ鍚堜綔瀹㈡埛鍒嗛〉鍒楄〃
+ /// //寤� 鏂板鍔犳槸鍚﹂渶瑕佷緥琛岀淮鎶わ紝鏄惁闇�瑕佽妭鍋囨棩缁存姢涓や釜瀛楁鏌ヨ 20210913
+ /// </summary>
+ /// <param name="pa"></param>
+ /// <returns></returns>
+ public IEnumerable<OA_CorporateClients> GetModelPageList(Pagination pa, Guid FirmId, string UserName, DateTime? beginTime,
+DateTime? endTime, string AccountManagerId, string BusinessManagerId, string CustomerIndustriesId, string CustomerTypeId, string DegreeImportanId,string LastOrderTime, string selOrderCount, string selOrderMoney, string SourcesInfoId, string TurnoverIntentionId,
+string OrderCount, string OrderMoney, string UserNum, string selLastOrderTime, string Province, string City, string County, bool IsStaff, Guid StaffMemberId,int? StaffId,string Shifouwanjie=null,
+bool? NeedWeifu=null,bool?NeedJiejiaRiWeiFu=null, string selHetongshangchuan = null)
+ {
+ string Condition = " and a.FirmId ='" + FirmId + "'";
+
+ if (!string.IsNullOrEmpty(UserNum))
+ Condition += " and CustomerId = " + UserNum;
+
+ //寤� 鏂板鍔犳槸鍚﹂渶瑕佷緥琛岀淮鎶わ紝鏄惁闇�瑕佽妭鍋囨棩缁存姢涓や釜瀛楁鏌ヨ 20210913
+ if (NeedWeifu!=null)
+
+ Condition += string.Format(" and NeedWiHu='{0}'", NeedWeifu);
+
+ if (NeedJiejiaRiWeiFu != null)
+
+ Condition += string.Format(" and JieJiaRiWiHu='{0}'", NeedJiejiaRiWeiFu);
+
+
+
+
+ if (!string.IsNullOrEmpty(UserName))
+ Condition += " and CompanyName like '%" + UserName + "%'";
+
+ if (beginTime.HasValue)
+ Condition += string.Format(" and CAST(CreateTime AS DATE) >='{0}'", beginTime);
+
+ if (endTime.HasValue)
+ Condition += string.Format(" and CAST(CreateTime AS DATE) <='{0}'", endTime);
+
+ if (!string.IsNullOrEmpty(SourcesInfoId))
+ Condition += string.Format(" and SourcesInfoId='{0}'", SourcesInfoId);
+
+ if (!string.IsNullOrEmpty(CustomerIndustriesId))
+ Condition += string.Format(" and CustomerIndustriesId='{0}'", CustomerIndustriesId);
+
+ if (!string.IsNullOrEmpty(AccountManagerId))
+ Condition += string.Format(" and AccountManagerId='{0}'", AccountManagerId);
+
+ if (!string.IsNullOrEmpty(Shifouwanjie))
+ Condition += string.Format(" and Shifouwanjie='{0}'", Shifouwanjie);
+
+ if (!string.IsNullOrEmpty(BusinessManagerId))
+ Condition += string.Format(" and BusinessManagerId='{0}'", BusinessManagerId);
+
+ if (!string.IsNullOrEmpty(CustomerTypeId))
+ Condition += string.Format(" and CustomerTypeId='{0}'", CustomerTypeId);
+
+ if (!string.IsNullOrEmpty(TurnoverIntentionId))
+ Condition += string.Format(" and CreditId='{0}'", TurnoverIntentionId);
+
+ if (!string.IsNullOrEmpty(DegreeImportanId))
+ Condition += string.Format(" and DegreeImportanId='{0}'", DegreeImportanId);
+
+ if (!string.IsNullOrEmpty(selOrderCount) && !string.IsNullOrEmpty(OrderCount))
+ Condition += string.Format(" and OrderCount{0}'{1}'", selOrderCount, OrderCount);
+
+ if (!string.IsNullOrEmpty(selOrderMoney) && !string.IsNullOrEmpty(OrderMoney))
+ Condition += string.Format(" and OrderMoney{0}'{1}'", selOrderMoney, OrderMoney);
+
+ if (!string.IsNullOrEmpty(selHetongshangchuan))
+ {
+ if (selHetongshangchuan == "1")
+ {
+ Condition += string.Format(" and a.Keyid in ( select CorporateClientsid from [dbo].[OA_CorporateClientContract] ) ");
+ }
+ else
+ {
+ Condition += string.Format(" and a.Keyid not in ( select CorporateClientsid from [dbo].[OA_CorporateClientContract] ) ");
+ }
+ }
+
+
+
+ if (!string.IsNullOrEmpty(selLastOrderTime) && !string.IsNullOrEmpty(LastOrderTime))
+ Condition += string.Format(" and CAST(LastOrderTime AS DATE) {0} CAST(getdate()-{1} AS date)", LastOrderTime, selLastOrderTime);
+
+ if (IsStaff)
+ {
+ if (!string.IsNullOrEmpty(Province) && !string.IsNullOrEmpty(City) && !string.IsNullOrEmpty(County))
+ Condition += string.Format(" and Province='{0}' and City='{1}' and County='{2}'", Province, City, County);
+ else if (!string.IsNullOrEmpty(Province) && !string.IsNullOrEmpty(City))
+ Condition += string.Format(" and Province='{0}' and City='{1}' and (( ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{2}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{2}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{3}' or BusinessManagerId='{3}' )", Province, City, StaffMemberId, StaffId);
+ else if (!string.IsNullOrEmpty(Province))
+ Condition += string.Format(" and Province='{0}' and (( City IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageCity FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) and ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{1}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{2}' or BusinessManagerId='{2}' )", Province, StaffMemberId, StaffId);
else
Condition += string.Format(" and (( Province IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageProvince FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) and City IN (SELECT Name FROM dbo.Sys_CitySite WHERE Keyid IN (SELECT value FROM dbo.SplitString(CAST((SELECT ManageCity FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) and ((SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry,'') FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1)) OR (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=County AND CityId = (SELECT TOP(1) Keyid FROM dbo.Sys_CitySite WHERE Name=City )) IN (SELECT value FROM dbo.SplitString(CAST((SELECT ISNULL(ManageCountry1,'') FROM dbo.OA_Staff WHERE MemberId='{0}') AS VARCHAR(MAX)),',',1))) ) or AccountManagerId='{1}' or BusinessManagerId='{1}' ) ", StaffMemberId, StaffId);
}
@@ -226,6 +378,13 @@
query.Criteria = criterias;
return _IOA_CorporateClientsDal.SelectModelPage(query, pa);
}
+
+
+
+
+
+
+
/// <summary>
/// 鏌ヨ瀹㈡埛棰勪粯娆惧垪琛�
@@ -904,6 +1063,37 @@
+
+ /// <summary>
+ /// 鏂板鍚堜綔瀹㈡埛璁捐娌熼��
+ /// </summary>
+ /// <param name="trueModel"></param>
+ /// <returns></returns>
+ public bool InsertModelSheji(CY.Model.OA_CorporateClientsSheji trueModel)
+ {
+ try
+ {
+ return _IOA_CorporateClientsDal.InsertModelSheji(trueModel);
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁瀹㈡埛id鏌ヨ璁捐娌熼��
+ /// </summary>
+ /// <param name="CustomId">瀹㈡埛id</param>
+ /// <returns></returns>
+ public IEnumerable<OA_CorporateClientsSheji> SelectShejiListByCorId(Guid CustomId)
+ {
+ return _IOA_CorporateClientsDal.SelectShejiListByCorId(CustomId);
+ }
+
+
+
/// <summary>
/// 鏂板鍚堜綔瀹㈡埛璁㈠崟闇�姹�
/// </summary>
@@ -1044,5 +1234,57 @@
{
return _IOA_CorporateClientsDal.SelectVisitListByBuzAndTime(BusinessManagerId, chaxuntime);
}
+
+
+ /// <summary>
+ /// 娣诲姞闄勪欢
+ /// </summary>
+ /// <param name="rType"></param>
+ /// <returns></returns>
+ public bool Insertattachment(OA_attachment a_Attachment)
+ {
+ try
+ {
+ _IOA_CorporateClientsDal.Insertattachment(a_Attachment);
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ return true;
+ }
+
+
+ /// <summary>
+ /// 鑾峰彇闄勪欢
+ /// </summary>
+ /// <param name="Keyid">涓婚敭id</param>
+ /// <returns></returns>
+ public IEnumerable<OA_attachment> GetattachmentlList(string OA_Id)
+ {
+
+ return _IOA_CorporateClientsDal.GetattachmentlList(OA_Id);
+ }
+
+ /// <summary>
+ /// 鍗曚釜鏌ヨ璁块棶
+ /// </summary>
+ /// <param name="Keyid">缂栧彿</param>
+ /// <returns></returns>
+ public OA_CorporateClientsVisit SelectVisitByKeyid(Guid Keyid)
+ {
+ return _IOA_CorporateClientsDal.SelectVisitByKeyid(Keyid);
+ }
+
+
+ /// <summary>
+ /// 鍗曚釜鏌ヨ璁捐娌熼��
+ /// </summary>
+ /// <param name="Keyid">缂栧彿</param>
+ /// <returns></returns>
+ public OA_CorporateClientsSheji SelectShejiByKeyid(Guid Keyid)
+ {
+ return _IOA_CorporateClientsDal.SelectShejiByKeyid(Keyid);
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1