|
@@ -1,6 +1,7 @@
|
|
|
using AutoMapper;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using OASystem.Domain;
|
|
|
+using OASystem.Domain.AesEncryption;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
@@ -253,6 +254,36 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
|
|
|
if (cId > 1)
|
|
|
{
|
|
|
+
|
|
|
+ #region 策划部内容同步添加至资料库
|
|
|
+ var userInfo = _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .LeftJoin<Sys_Department>((u,d)=> d.IsDel == 0 && u.DepId == d.Id )
|
|
|
+ .Where((u, d) => u.Id == dto.CreateUserId && d.DepName == "策划部" && u.IsDel == 0)
|
|
|
+ .First();
|
|
|
+
|
|
|
+ if (userInfo != null)
|
|
|
+ {
|
|
|
+ Res_MediaSuppliers mediaSuppliersData = new Res_MediaSuppliers
|
|
|
+ {
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
+ CreateUserId = dto.CreateUserId,
|
|
|
+ UnitName = dto.SupplierName,
|
|
|
+ TypeId = dto.SupplierTypeId,
|
|
|
+ UnitAddress = dto.SupplierAddress,
|
|
|
+ Contact = dto.SupplierContact,
|
|
|
+ Tel = dto.SupplierContactNumber,
|
|
|
+ Email = dto.SupplierEmail,
|
|
|
+ Privince = dto.SupplierArea == 1 ? "国内" :"国外",
|
|
|
+ };
|
|
|
+
|
|
|
+ EncryptionProcessor.EncryptProperties(mediaSuppliersData);
|
|
|
+ _sqlSugar.Insertable(mediaSuppliersData).ExecuteCommand();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
CommitTran();
|
|
|
var data = new { ccpId = cId, sign = 1,dataId = id };
|
|
|
return new JsonView() { Code = 200, Msg = "添加成功!", Data = data };
|