|
@@ -1,30 +1,12 @@
|
|
using AutoMapper;
|
|
using AutoMapper;
|
|
-using Newtonsoft.Json;
|
|
|
|
-using NPOI.OpenXmlFormats.Wordprocessing;
|
|
|
|
-using NPOI.POIFS.Properties;
|
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
|
using OASystem.Domain;
|
|
using OASystem.Domain;
|
|
using OASystem.Domain.AesEncryption;
|
|
using OASystem.Domain.AesEncryption;
|
|
-using OASystem.Domain.Dtos;
|
|
|
|
using OASystem.Domain.Dtos.Financial;
|
|
using OASystem.Domain.Dtos.Financial;
|
|
using OASystem.Domain.Dtos.Groups;
|
|
using OASystem.Domain.Dtos.Groups;
|
|
-using OASystem.Domain.Dtos.UserDto;
|
|
|
|
using OASystem.Domain.Entities.Customer;
|
|
using OASystem.Domain.Entities.Customer;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.Entities.Groups;
|
|
-using OASystem.Domain.ViewModels.CRM;
|
|
|
|
-using OASystem.Domain.ViewModels.Financial;
|
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
-using Org.BouncyCastle.Asn1.Cms;
|
|
|
|
-using Org.BouncyCastle.Utilities.Collections;
|
|
|
|
-using Serilog;
|
|
|
|
-using SqlSugar;
|
|
|
|
-using System;
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
-using System.Linq;
|
|
|
|
-using System.Text;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
-using System.Xml.Linq;
|
|
|
|
|
|
|
|
namespace OASystem.Infrastructure.Repositories.Groups
|
|
namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
@@ -40,7 +22,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
//private readonly TeamRateRepository _teamRateRep;
|
|
//private readonly TeamRateRepository _teamRateRep;
|
|
//public readonly Logs _logs;
|
|
//public readonly Logs _logs;
|
|
|
|
|
|
- public DelegationInfoRepository(SqlSugarClient sqlSugar, SetDataRepository setDataRepository, UsersRepository usersRepository,
|
|
|
|
|
|
+ public DelegationInfoRepository(SqlSugarClient sqlSugar, SetDataRepository setDataRepository, UsersRepository usersRepository,
|
|
TaskAssignmentRepository taskAssignmentRep, IMapper mapper)
|
|
TaskAssignmentRepository taskAssignmentRep, IMapper mapper)
|
|
: base(sqlSugar)
|
|
: base(sqlSugar)
|
|
{
|
|
{
|
|
@@ -61,7 +43,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<JsonView> ListByCTableAndUserId(GroupListByCTableAndUserIdDto dto)
|
|
public async Task<JsonView> ListByCTableAndUserId(GroupListByCTableAndUserIdDto dto)
|
|
{
|
|
{
|
|
- var view = new JsonView() { Code = StatusCodes.Status400BadRequest,Msg="操作失败!" };
|
|
|
|
|
|
+ var view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
|
|
|
|
|
|
if (dto.CTable < 1)
|
|
if (dto.CTable < 1)
|
|
{
|
|
{
|
|
@@ -254,7 +236,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="teamName"></param>
|
|
/// <param name="teamName"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public string FormartTeamName(string? teamName)
|
|
|
|
|
|
+ public string FormartTeamName(string? teamName)
|
|
{
|
|
{
|
|
string str = "";
|
|
string str = "";
|
|
if (!string.IsNullOrEmpty(teamName))
|
|
if (!string.IsNullOrEmpty(teamName))
|
|
@@ -279,7 +261,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="teamName"></param>
|
|
/// <param name="teamName"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public List<string> GroupSplitCountry (string visitCountry)
|
|
|
|
|
|
+ public List<string> GroupSplitCountry(string visitCountry)
|
|
{
|
|
{
|
|
List<string> countrys = new List<string>();
|
|
List<string> countrys = new List<string>();
|
|
|
|
|
|
@@ -372,7 +354,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
- if (dto.PortType == 1) {
|
|
|
|
|
|
+ if (dto.PortType == 1)
|
|
|
|
+ {
|
|
string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
|
|
string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
|
|
,gs.Id as GrpScheduleId
|
|
,gs.Id as GrpScheduleId
|
|
From Grp_DelegationInfo gdi
|
|
From Grp_DelegationInfo gdi
|
|
@@ -460,12 +443,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
_DelegationInfo.CityName = "四川-成都";
|
|
_DelegationInfo.CityName = "四川-成都";
|
|
}
|
|
}
|
|
|
|
|
|
- //if (_DelegationInfo.TontractTime)
|
|
|
|
- //{
|
|
|
|
|
|
+ //if (_DelegationInfo.TontractTime)
|
|
|
|
+ //{
|
|
|
|
|
|
- //}
|
|
|
|
|
|
+ //}
|
|
|
|
|
|
- result.Code = 0;
|
|
|
|
|
|
+ result.Code = 0;
|
|
result.Msg = "成功!";
|
|
result.Msg = "成功!";
|
|
result.Data = _DelegationInfo;
|
|
result.Data = _DelegationInfo;
|
|
|
|
|
|
@@ -483,15 +466,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
var param = new TourClientListProcessInfo();
|
|
var param = new TourClientListProcessInfo();
|
|
var clientInfo = DeleClientArr.FirstOrDefault(x => x.Id == item.ClientId);
|
|
var clientInfo = DeleClientArr.FirstOrDefault(x => x.Id == item.ClientId);
|
|
- if (clientInfo == null) clientInfo = new Crm_DeleClient();
|
|
|
|
- var clientIDInfo = _CustomerCerts.FirstOrDefault(x=>x.DcId == item.ClientId); //身份证信息
|
|
|
|
|
|
+ if (clientInfo == null) clientInfo = new Crm_DeleClient();
|
|
|
|
+ var clientIDInfo = _CustomerCerts.FirstOrDefault(x => x.DcId == item.ClientId); //身份证信息
|
|
if (clientIDInfo == null) clientIDInfo = new Crm_CustomerCert();
|
|
if (clientIDInfo == null) clientIDInfo = new Crm_CustomerCert();
|
|
var Company = CompanyArr.FirstOrDefault(x => x.Id == clientInfo.CrmCompanyId);
|
|
var Company = CompanyArr.FirstOrDefault(x => x.Id == clientInfo.CrmCompanyId);
|
|
- if(Company == null) Company = new Crm_CustomerCompany();
|
|
|
|
|
|
+ if (Company == null) Company = new Crm_CustomerCompany();
|
|
|
|
|
|
param.IDCardNo = clientIDInfo.CertNo;
|
|
param.IDCardNo = clientIDInfo.CertNo;
|
|
param.Remark = item.Remark;
|
|
param.Remark = item.Remark;
|
|
- param.BirthDay = clientInfo.BirthDay == null ? "" : DateTime.TryParse(Convert.ToDateTime( clientInfo.BirthDay).ToString("yyyy-MM-dd"), out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
|
|
|
|
|
|
+ param.BirthDay = clientInfo.BirthDay == null ? "" : DateTime.TryParse(Convert.ToDateTime(clientInfo.BirthDay).ToString("yyyy-MM-dd"), out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
|
|
param.FirstName = clientInfo.FirstName;
|
|
param.FirstName = clientInfo.FirstName;
|
|
param.LastName = clientInfo.LastName;
|
|
param.LastName = clientInfo.LastName;
|
|
param.CompanyFullName = Company.CompanyFullName;
|
|
param.CompanyFullName = Company.CompanyFullName;
|
|
@@ -643,7 +626,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
foreach (var city in province.Child)
|
|
foreach (var city in province.Child)
|
|
{
|
|
{
|
|
- list.Add(new GroupCityBasicSourceView() {
|
|
|
|
|
|
+ list.Add(new GroupCityBasicSourceView()
|
|
|
|
+ {
|
|
Id = city.Id,
|
|
Id = city.Id,
|
|
Name = $"{province.Name_CN}-{city.Name_CN}"
|
|
Name = $"{province.Name_CN}-{city.Name_CN}"
|
|
});
|
|
});
|
|
@@ -778,7 +762,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public async Task<Result>GroupOperation(GroupOperationDto dto)
|
|
|
|
|
|
+ public async Task<Result> GroupOperation(GroupOperationDto dto)
|
|
{
|
|
{
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
@@ -800,8 +784,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
And TeamName = '{0}'
|
|
And TeamName = '{0}'
|
|
And ClientName = '{1}'
|
|
And ClientName = '{1}'
|
|
And ClientUnit ='{2}'
|
|
And ClientUnit ='{2}'
|
|
- And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
|
|
|
|
- var selectGroupInfo = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).First();
|
|
|
|
|
|
+ And VisitDate ='{3}'", dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
|
|
|
|
+ var selectGroupInfo = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).First();
|
|
if (selectGroupInfo != null)
|
|
if (selectGroupInfo != null)
|
|
{
|
|
{
|
|
result.Msg = "数据已存在,请勿重复添加!";
|
|
result.Msg = "数据已存在,请勿重复添加!";
|
|
@@ -822,9 +806,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
string countrys = string.Empty;
|
|
string countrys = string.Empty;
|
|
string countryReq = dto.VisitCountry;
|
|
string countryReq = dto.VisitCountry;
|
|
- if (!string.IsNullOrEmpty(countryReq))
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(countryReq))
|
|
{
|
|
{
|
|
- if (countryReq.Contains(",")) countrys = countryReq.Replace(',','|');
|
|
|
|
|
|
+ if (countryReq.Contains(",")) countrys = countryReq.Replace(',', '|');
|
|
else if (countryReq.Contains(",")) countrys = countryReq.Replace(',', '|');
|
|
else if (countryReq.Contains(",")) countrys = countryReq.Replace(',', '|');
|
|
else if (countryReq.Contains(" ")) countrys = countryReq.Replace(' ', '|');
|
|
else if (countryReq.Contains(" ")) countrys = countryReq.Replace(' ', '|');
|
|
else if (countryReq.Contains("、")) countrys = countryReq.Replace('、', '|');
|
|
else if (countryReq.Contains("、")) countrys = countryReq.Replace('、', '|');
|
|
@@ -833,7 +817,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
|
|
|
|
//建团时 默认出团 设置 团组code
|
|
//建团时 默认出团 设置 团组code
|
|
- string teamCode="";
|
|
|
|
|
|
+ string teamCode = "";
|
|
string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
|
|
var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
|
|
|
|
|
|
@@ -893,9 +877,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
DeleteUserId = null,
|
|
DeleteUserId = null,
|
|
DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
OpRoyaltyLv = dto.OpRoyaltyLv,
|
|
OpRoyaltyLv = dto.OpRoyaltyLv,
|
|
- OpRoyaltyRemark=dto.opRoyaltyRemark,
|
|
|
|
|
|
+ OpRoyaltyRemark = dto.opRoyaltyRemark,
|
|
Officialneeds = dto.Officialneeds,
|
|
Officialneeds = dto.Officialneeds,
|
|
- VisitStartDate = startTime,
|
|
|
|
|
|
+ VisitStartDate = startTime,
|
|
VisitEndDate = endTime,
|
|
VisitEndDate = endTime,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -912,7 +896,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
else if (dto.Status == 2) //修改
|
|
else if (dto.Status == 2) //修改
|
|
{
|
|
{
|
|
var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
|
|
var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
|
|
@@ -1170,9 +1154,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public async Task<JsonView> GetGroupNameList(int portType,int pageIndex,int pageSize, string groupName,int userId)
|
|
|
|
|
|
+ public async Task<JsonView> GetGroupNameList(int portType, int pageIndex, int pageSize, string groupName, int userId)
|
|
{
|
|
{
|
|
- var _res = new JsonView() { Code = 400 , Msg = MsgTips.Fail };
|
|
|
|
|
|
+ var _res = new JsonView() { Code = 400, Msg = MsgTips.Fail };
|
|
string sql = "";
|
|
string sql = "";
|
|
string sqlWhere = "";
|
|
string sqlWhere = "";
|
|
string mobileSqlWhere = "";
|
|
string mobileSqlWhere = "";
|
|
@@ -1253,11 +1237,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
Where TeamName != '' And IsDel = 0
|
|
Where TeamName != '' And IsDel = 0
|
|
Order By Id Desc");
|
|
Order By Id Desc");
|
|
var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
|
|
var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
|
|
-
|
|
|
|
|
|
+
|
|
string visaSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = 41 And IsDel = 0");
|
|
string visaSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = 41 And IsDel = 0");
|
|
var _setDataList = await _sqlSugar.SqlQueryable<SetDataInfoView>(visaSql).ToListAsync();
|
|
var _setDataList = await _sqlSugar.SqlQueryable<SetDataInfoView>(visaSql).ToListAsync();
|
|
|
|
|
|
- var data = new {
|
|
|
|
|
|
+ var data = new
|
|
|
|
+ {
|
|
groupNameData = _groupNameList,
|
|
groupNameData = _groupNameList,
|
|
visaNationalityData = _setDataList
|
|
visaNationalityData = _setDataList
|
|
};
|
|
};
|
|
@@ -1366,7 +1351,7 @@ ORDER BY
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return groupDatas;
|
|
return groupDatas;
|
|
}
|
|
}
|
|
|
|
|