机构修改及银行账户 用户添加字段

usertest
ZR20090193-陈敬勇 5 months ago
parent f459ad554e
commit c8801d194f

@ -154,6 +154,9 @@ public static class MultiLanguageConst
[Description("系统参数已存在")]
public const string ConfigExist = "Config_Exist";
[Description("银行信息已存在")]
public const string BankExist = "Bank_Exist";
[Description("业务参数已存在")]
public const string CodeConfigExist = "CodeConfig_Exist";

@ -569,7 +569,7 @@ namespace DS.WMS.Core.Check.Method
}
/// <summary>
/// 客户对账模板打印数据
/// TODO 客户对账模板打印数据
/// </summary>
/// <returns></returns>
public DataResult<CheckBillTemplatePrintRes> GetCheckBillTemplatePrintInfo(string id)
@ -615,10 +615,33 @@ namespace DS.WMS.Core.Check.Method
).First();
var businessList = tenantDb.Queryable<VW_CheckBill_Business>().Where(x => x.CheckId == checkId).ToList();
//foreach (var item in businessList)
var businessList1 = tenantDb.Queryable<dynamic>().AS("VW_CheckBill_Business").Where("CheckId=@id", new { CheckId = 1 }).ToList();
//foreach (var item in businessList1)
//{
// item.CreateProperty
// for (global::System.Int32 i = 0; i < feeList.Count; i++)
// {
// var fee = feeList[i];
// var str = fee.FeeName + "-" + fee.FeeType + "-" + fee.Currency;
// var sumFee = tenantDb.Queryable<FeeRecord>().Where(x => x.BusinessId == item.BusinessId && x.FeeId == fee.FeeId).Sum(x=>x.Amount);
// item[str] = sumFee;
// //var value = db.DynamicBuilder().CreateObjectByType(type, new Dictionary<string, object>() { { "Id", 1 }, { "Name", "jack" } })
// }
// //item.CreateProperty
//}
var otherList = new List<KeyValuePair<string, decimal>>();
for (global::System.Int32 i = 0; i < feeList.Count; i++)
{
var fee = feeList[i];
var str = fee.FeeName + "-" + fee.FeeType + "-" + fee.Currency;
//var sumFee = tenantDb.Queryable<FeeRecord>().Where(x => x.BusinessId == item.BusinessId && x.FeeId == fee.FeeId).Sum(x => x.Amount);
//item[str] = sumFee;
//var value = db.DynamicBuilder().CreateObjectByType(type, new Dictionary<string, object>() { { "Id", 1 }, { "Name", "jack" } })
}
return DataResult<CheckBillTemplatePrintRes>.Success(data);
}

@ -0,0 +1,91 @@
using System.ComponentModel.DataAnnotations;
using DS.Module.Core;
using FluentValidation;
using SqlSugar;
namespace DS.WMS.Core.Sys.Dtos;
/// <summary>
/// 银行信息请求实体
/// </summary>
public class BankReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 关联Id
/// </summary>
public long LinkId { get; set; }
/// <summary>
/// 代码
/// </summary>
public string CodeName { get; set; }
/// <summary>
/// 币别
/// </summary>
public string Currency { get; set; }
/// <summary>
/// 银行名称
/// </summary>
public string BankName { get; set; }
/// <summary>
/// 银行名称2
/// </summary>
public string BankName2 { get; set; }
/// <summary>
/// Desc:银行账户
/// </summary>
public string BankAccountNo { get; set; }
/// <summary>
/// Desc:户头名称
/// </summary>
public string AccountName { get; set; }
/// <summary>
/// 科目代码
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
/// <summary>
/// 是否默认 0否 1是
/// </summary>
public bool IsDefault { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>
/// 验证
/// </summary>
public class BankReqValidator : AbstractValidator<BankReq>
{
/// <summary>
/// 构造函数
/// </summary>
public BankReqValidator()
{
this.RuleFor(o => o.CodeName)
.NotEmpty().WithName("银行代码");
// this.RuleFor(o => o.ColumnView)
// .NotEmpty().WithName("中文视图名");
}
}

@ -0,0 +1,75 @@
using DS.Module.Core;
namespace DS.WMS.Core.Sys.Dtos;
/// <summary>
/// 银行信息返回实体
/// </summary>
public class BankRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 关联Id
/// </summary>
public long LinkId { get; set; }
/// <summary>
/// 代码
/// </summary>
public string CodeName { get; set; }
/// <summary>
/// 币别
/// </summary>
public string Currency { get; set; }
/// <summary>
/// 银行名称
/// </summary>
public string BankName { get; set; }
/// <summary>
/// 银行名称2
/// </summary>
public string BankName2 { get; set; }
/// <summary>
/// Desc:银行账户
/// </summary>
public string BankAccountNo { get; set; }
/// <summary>
/// Desc:户头名称
/// </summary>
public string AccountName { get; set; }
/// <summary>
/// 科目代码
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
/// <summary>
/// 是否默认 0否 1是
/// </summary>
public bool IsDefault { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}

@ -45,4 +45,77 @@ public class SysOrgReq
/// 状态
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 机构名称 -全称
/// </summary>
public string OrgFullName { get; set; }
/// <summary>
/// 机构英文名称
/// </summary>
public string OrgEnName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 英文地址
/// </summary>
public string EnAddress { get; set; }
/// <summary>
/// 邮政编码
/// </summary>
public string PostCode { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 电子邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 公司网址
/// </summary>
public string WebSiteUrl { get; set; }
/// <summary>
/// 工商登记号
/// </summary>
public string LicenseCode { get; set; }
/// <summary>
/// 税务登记号
/// </summary>
public string TaxCode { get; set; }
/// <summary>
/// 票号头字符
/// </summary>
public string BanksHead { get; set; }
/// <summary>
/// 本地货币
/// </summary>
public string LocalCurrency { get; set; }
/// <summary>
/// 发票抬头
/// </summary>
public string InvoiceTitle { get; set; }
/// <summary>
/// 支票抬头
/// </summary>
public string ChequeTitle { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
}

@ -48,4 +48,76 @@ public class SysOrgRes
/// 状态
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 机构名称 -全称
/// </summary>
public string OrgFullName { get; set; }
/// <summary>
/// 机构英文名称
/// </summary>
public string OrgEnName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 英文地址
/// </summary>
public string EnAddress { get; set; }
/// <summary>
/// 邮政编码
/// </summary>
public string PostCode { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 电子邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 公司网址
/// </summary>
public string WebSiteUrl { get; set; }
/// <summary>
/// 工商登记号
/// </summary>
public string LicenseCode { get; set; }
/// <summary>
/// 税务登记号
/// </summary>
public string TaxCode { get; set; }
/// <summary>
/// 票号头字符
/// </summary>
public string BanksHead { get; set; }
/// <summary>
/// 本地货币
/// </summary>
public string LocalCurrency { get; set; }
/// <summary>
/// 发票抬头
/// </summary>
public string InvoiceTitle { get; set; }
/// <summary>
/// 支票抬头
/// </summary>
public string ChequeTitle { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
}

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using DS.Module.Core.Extensions;
using FluentValidation;
@ -52,7 +53,7 @@ public class UserReq
public DateTime? Birthday { get; set; } = DateTime.MinValue;
/// <summary>
/// 电话
/// 手机号码
/// </summary>
public string Phone { get; set; } = "";
@ -60,7 +61,22 @@ public class UserReq
/// 邮箱
/// </summary>
public string Email { get; set; } = "";
/// <summary>
/// 电话
/// </summary>
public string Tel { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
/// <summary>
/// 职位
/// </summary>

@ -58,7 +58,7 @@ public class UserViewModel
public string MD5Password { get; set; }
/// <summary>
/// 电话
/// 手机号码
/// </summary>
public string Phone { get; set; }
@ -144,4 +144,21 @@ public class UserViewModel
/// 默认机构Id
/// </summary>
public long DefaultOrgId { get; set; }
/// <summary>
/// 电话
/// </summary>
public string Tel { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
}

@ -0,0 +1,82 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Sys.Entity
{
/// <summary>
/// 银行账户信息
/// </summary>
[SqlSugar.SugarTable("sys_bank", "银行账户信息")]
public class SysBank : BaseTenantModel<long>
{
/// <summary>
/// 关联Id
/// </summary>
[SugarColumn(ColumnDescription = "关联Id")]
public long LinkId { get; set; }
/// <summary>
/// 代码
/// </summary>
[SugarColumn(ColumnDescription = "代码", IsNullable = true, Length = 50)]
public string CodeName { get; set; }
/// <summary>
/// 币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", IsNullable = true, Length = 20)]
public string Currency { get; set; }
/// <summary>
/// 银行名称
/// </summary>
[SugarColumn(ColumnDescription = "银行名称", IsNullable = true, Length = 100)]
public string BankName { get; set; }
/// <summary>
/// 银行名称2
/// </summary>
[SugarColumn(ColumnDescription = "银行名称2", IsNullable = true, Length = 100)]
public string BankName2 { get; set; }
/// <summary>
/// Desc:银行账户
/// </summary>
[SugarColumn(ColumnDescription = "银行账户", Length = 40, IsNullable = true)]
public string BankAccountNo { get; set; }
/// <summary>
/// Desc:户头名称
/// </summary>
[SugarColumn(ColumnDescription = "户头名称", Length = 100, IsNullable = true)]
public string AccountName { get; set; }
/// <summary>
/// 科目代码
/// </summary>
[SugarColumn(ColumnDescription = "科目代码", IsNullable = true, Length = 100)]
public string SubjectCode { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
[SugarColumn(ColumnDescription = "财务软件代码", IsNullable = true, Length = 50)]
public string FinanceSoftCode { get; set; }
/// <summary>
/// 是否默认 0否 1是
/// </summary>
[SugarColumn(ColumnDescription = "是否默认")]
public bool IsDefault { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnDescription = "状态")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}
}

@ -16,10 +16,10 @@ public class SysOrg: BaseTenantModel<long>
public long ParentId { get; set; }
/// <summary>
/// 机构名称
/// 机构名称 -简称
/// </summary>
public string OrgName { get; set; }
/// <summary>
/// Desc:负责人
/// Default:
@ -51,4 +51,77 @@ public class SysOrg: BaseTenantModel<long>
/// </summary>
[SugarColumn(ColumnDescription = "状态")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 机构名称 -全称
/// </summary>
public string OrgFullName { get; set; }
/// <summary>
/// 机构英文名称
/// </summary>
public string OrgEnName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 英文地址
/// </summary>
public string EnAddress { get; set; }
/// <summary>
/// 邮政编码
/// </summary>
public string PostCode { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 电子邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 公司网址
/// </summary>
public string WebSiteUrl { get; set; }
/// <summary>
/// 工商登记号
/// </summary>
public string LicenseCode { get; set; }
/// <summary>
/// 税务登记号
/// </summary>
public string TaxCode { get; set; }
/// <summary>
/// 票号头字符
/// </summary>
public string BanksHead { get; set; }
/// <summary>
/// 本地货币
/// </summary>
public string LocalCurrency { get; set; }
/// <summary>
/// 发票抬头
/// </summary>
public string InvoiceTitle { get; set; }
/// <summary>
/// 支票抬头
/// </summary>
public string ChequeTitle { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
}

@ -70,11 +70,28 @@ public class SysUser : UserTenantModel<long>
public string MD5Password { get; set; }
/// <summary>
/// 电话
/// 手机
/// </summary>
[Description("电话")]
[Description("手机")]
public string Phone { get; set; }
/// <summary>
/// 电话
/// </summary>
[Description("电话")]
public string Tel { get; set; }
/// <summary>
/// 办公电话
/// </summary>
public string OfficePhone { get; set; }
/// <summary>
/// 传真
/// </summary>
public string Fax { get; set; }
/// <summary>
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
/// <summary>
/// 邮箱
/// </summary>

@ -0,0 +1,30 @@
using DS.Module.Core;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
namespace DS.WMS.Core.Sys.Interface;
public interface IBankService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<BankRes>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DataResult EditBank(BankReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<BankRes> GetBankInfo(string id);
}

@ -0,0 +1,88 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.UserModule;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Sys.Method;
public class BankService : IBankService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public BankService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<BankRes>> GetListByPage(PageRequest request)
{
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = db.Queryable<SysBank>()
.Where(whereList)
.Select<BankRes>().ToQueryPage(request.PageCondition);
return data;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult EditBank(BankReq req)
{
if (req.Id == 0)
{
if (db.Queryable<SysBank>().Where(x=>x.CodeName == req.CodeName && x.LinkId == req.LinkId).Any())
{
return DataResult.Failed("银行信息已存在!",MultiLanguageConst.BankExist);
}
var data = req.Adapt<SysBank>();
var entity = db.Insertable(data).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = db.Queryable<SysBank>().Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataResult<BankRes> GetBankInfo(string id)
{
var data = db.Queryable<SysBank>()
.Where(a => a.Id == long.Parse(id))
.Select<BankRes>()
.First();
return DataResult<BankRes>.Success(data,MultiLanguageConst.DataQuerySuccess);
}
}

@ -0,0 +1,64 @@
using DS.Module.Core;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 业务参数配置模块
/// </summary>
public class BankController : ApiController
{
private readonly IBankService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public BankController(IBankService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBankList")]
public DataResult<List<BankRes>> GetBankList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("EditBank")]
public DataResult EditBank([FromBody] BankReq req)
{
var res = _invokeService.EditBank(req);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetBankInfo")]
public DataResult<BankRes> GetBankInfo([FromQuery] string id)
{
var res = _invokeService.GetBankInfo(id);
return res;
}
}

@ -61,9 +61,10 @@ public class SaasTest
[Fact]
public void InitTableTest()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
//var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
tenantDb.CodeFirst.InitTables(typeof(SeaExport));
//tenantDb.CodeFirst.InitTables(typeof(SeaExport));
db.CodeFirst.InitTables(typeof(SysBank));
Assert.True(true);
}

Loading…
Cancel
Save