Commit 537b4191 authored by liudong1993's avatar liudong1993

1

parent 9bdcd6ce
......@@ -2866,76 +2866,77 @@ namespace Property.Module.FixedAssets
if (Id > 0)
{
#region 生成财务单据
var detailList = applyModel.DetailList.Select(x => new
{
CostTypeId = applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? 225 : 226,
Number = x.ReportLossNum,
OriginalMoney = (x.ReportLossPrice ?? 0),
UnitPrice = Math.Round((x.ReportLossPrice ?? 0) / (x.ReportLossNum ?? 1), 2, MidpointRounding.AwayFromZero),
Remark = x.GoodsName + x.SpecificationName
});
string sign = "";
if (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses)
{
var financeObj = new
{
demodel.CreateBy,
IsPublic = 0,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType,
ClientType = 10,
ClientID = 3170,
CurrencyId = Config.OutCurrencyId,
WBMoney = applyModel.DetailList.Sum(x => (x.ReportLossPrice ?? 0)),
RB_Branch_Id = Config.ExpendBranchId,
PayDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
TemplateId = 129,
OrderSource = 16,
OtherType = 17,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "生成" + (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? "盘亏" : "盘盈") + "财务单据",
detailList,
RB_Depart_Id = RB_Department_Id,
ReFinanceId = Id
};
sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
}
else if (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryProfit)
{
var financeObj = new
{
applyModel.CreateBy,
IsPublic = 0,
BType = 4,
AccountId = 27,
WBMoney = applyModel.DetailList.Sum(x => (x.ReportLossPrice ?? 0)),
RB_Branch_Id = Config.ExpendBranchId,
RemitterName = "商品盘点-盘盈",
TradeDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"),
AccountNumber = System.DateTime.Now.AddDays(-1).ToString("yyyyMMdd"),
TemplateId = 130,
OrderSource = 16,
OtherType = 17,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
detailList,
RB_Depart_Id = RB_Department_Id,
ReFinanceId = Id
};
sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
}
var resultInfo = new
{
msg = sign,
};
string apiResult = HttpHelper.HttpPost(applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? Config.PaymentFinanceApi : Config.IncomeFinanceApi, JsonHelper.Serialize(resultInfo), "");
JObject parmsJob = JObject.Parse(apiResult);
string resultCode = parmsJob.GetStringValue("resultCode");
int frid = parmsJob.GetInt("data", 0);
#region 生成财务单据 2021-04-14 ld 教育暂不生成
//var detailList = applyModel.DetailList.Select(x => new
//{
// CostTypeId = applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? 225 : 226,
// Number = x.ReportLossNum,
// OriginalMoney = (x.ReportLossPrice ?? 0),
// UnitPrice = Math.Round((x.ReportLossPrice ?? 0) / (x.ReportLossNum ?? 1), 2, MidpointRounding.AwayFromZero),
// Remark = x.GoodsName + x.SpecificationName
//});
//string sign = "";
//if (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses)
//{
// var financeObj = new
// {
// demodel.CreateBy,
// IsPublic = 0,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType,
// ClientType = 10,
// ClientID = 3170,
// CurrencyId = Config.OutCurrencyId,
// WBMoney = applyModel.DetailList.Sum(x => (x.ReportLossPrice ?? 0)),
// RB_Branch_Id = Config.ExpendBranchId,
// PayDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
// TemplateId = 129,
// OrderSource = 16,
// OtherType = 17,
// Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "生成" + (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? "盘亏" : "盘盈") + "财务单据",
// detailList,
// RB_Depart_Id = RB_Department_Id,
// ReFinanceId = Id
// };
// sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
//}
//else if (applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryProfit)
//{
// var financeObj = new
// {
// applyModel.CreateBy,
// IsPublic = 0,
// BType = 4,
// AccountId = 27,
// WBMoney = applyModel.DetailList.Sum(x => (x.ReportLossPrice ?? 0)),
// RB_Branch_Id = Config.ExpendBranchId,
// RemitterName = "商品盘点-盘盈",
// TradeDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"),
// AccountNumber = System.DateTime.Now.AddDays(-1).ToString("yyyyMMdd"),
// TemplateId = 130,
// OrderSource = 16,
// OtherType = 17,
// Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
// detailList,
// RB_Depart_Id = RB_Department_Id,
// ReFinanceId = Id
// };
// sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
//}
//var resultInfo = new
//{
// msg = sign,
//};
//string apiResult = HttpHelper.HttpPost(applyModel.CheckStatus == PropertyCheckStatusEnum.InventoryLosses ? Config.PaymentFinanceApi : Config.IncomeFinanceApi, JsonHelper.Serialize(resultInfo), "");
//JObject parmsJob = JObject.Parse(apiResult);
//string resultCode = parmsJob.GetStringValue("resultCode");
//int frid = parmsJob.GetInt("data", 0);
#endregion
if (resultCode == "1" && frid > 0)//新增记录
string resultCode = "1";
int frid = 0;
if (resultCode == "1" && frid >= 0)//新增记录
{
applyModel.FinanceId = frid;
applyModel.DetailList.ForEach(x => x.ReportLossRecordId = Id);
......@@ -2955,7 +2956,7 @@ namespace Property.Module.FixedAssets
{ nameof(RB_Supplies_CheckDetail.UpdateBy),applyModel.CreateBy},
{ nameof(RB_Supplies_CheckDetail.UpdateDate),applyModel.CreateDate},
{ nameof(RB_Supplies_CheckDetail.FinanceId),frid},
{ nameof(RB_Supplies_CheckDetail.Remark),item.Remark+(string.IsNullOrWhiteSpace(item.Remark)?"":",")+ " 自动生成财务单据:"+frid+",制单单价:"+Math.Round((item.ReportLossPrice ?? 0) / (item.ReportLossNum ?? 1), 2, MidpointRounding.AwayFromZero)},
{ nameof(RB_Supplies_CheckDetail.Remark),item.Remark},
};
List<WhereHelper> wheresApplyGoods = new List<WhereHelper>() {
new WhereHelper(){
......
......@@ -166,7 +166,6 @@ WHERE 1=1 {1}
public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
{
StringBuilder where = new StringBuilder();
StringBuilder where2 = new StringBuilder();
if (query != null)
{
if (query.Group_Id > 0)
......
......@@ -110,7 +110,7 @@ namespace Property.WebApi.Controllers.Login
{
{"iat",secondsSinceEpoch },
{"exp",secondsSinceEpoch+Config.JwtExpirTime},
{"pro_userInfo",userInfo }
{"edu_userInfo",userInfo }
};
IJwtAlgorithm algorithm = new HMACSHA256Algorithm();
IJsonSerializer serializer = new JsonNetSerializer();
......
......@@ -19,6 +19,11 @@ namespace Property.WebApi.Controllers.User
private readonly SchoolModule schoolModule = new SchoolModule();
//部门
private readonly DepartmentModule departmentModule = new DepartmentModule();
/// <summary>
/// 菜单处理类对象
/// </summary>
private readonly MenuModule menuModule = new MenuModule();
/// <summary>
/// 获取公司列表
......@@ -57,7 +62,8 @@ namespace Property.WebApi.Controllers.User
var robj = list.Select(x => new
{
EmployeeId = x.Id,
EmName = x.EmployeeName
EmName = x.EmployeeName,
x.AccountType
});
return ApiResult.Success("", robj);
}
......@@ -83,5 +89,28 @@ namespace Property.WebApi.Controllers.User
return ApiResult.Success("", list);
}
/// <summary>
/// 获取用户登录菜单(教育直接跳转资产管理)
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetUserLoginMenu()
{
var requestParm = GetRequestParm();
UserInfo userInfo = CacheManager.User.UserReidsCache.GetUserLoginInfo(requestParm.uid);
JObject parms = JObject.Parse(requestParm.msg.ToString());
int accountType = parms.GetInt("AccountType", 1);
var treeList = menuModule.GetPostMenuTreeModule(new RB_Menu_ViewModel()
{
MenuType = accountType
}, out List<RB_Menu_ViewModel> userCenterList, postIds: userInfo.RB_Post_Id.ToString());
userInfo.UserMenu = treeList;
userInfo.token = requestParm.token;
return ApiResult.Success(data: userInfo);
}
}
}
......@@ -144,7 +144,7 @@ namespace Property.WebApi.Filter
string secret = Config.JwtSecretKey;
var json = decoder.Decode(token, secret, verify: true);//token为之前生成的字符串
JObject jwtJson = JObject.Parse(json);
actionContext.HttpContext.Items[GlobalKey.TokenUserInfo] = jwtJson["pro_userInfo"];
actionContext.HttpContext.Items[GlobalKey.TokenUserInfo] = jwtJson["edu_userInfo"];
}
catch (SignatureVerificationException sve)
{
......
......@@ -56,15 +56,7 @@ namespace Property.WebApi
"http://localhost:8080",
"http://localhost:8081",
"http://localhost:8082",
"http://testzcyx.oytour.com:8080",
"http://testzcyx.oytour.com:8081",
"http://testzcyx.oytour.com",
"http://testzcerp.oytour.com",
"http://zcyx.oytour.com",
"http://yx.oytour.com",
"http://mall.oytour.com",
"http://mallapi.oytour.com",
"http://www.oytour.com"
"http://zcedu.oytour.com",
};
if (!string.IsNullOrEmpty(accessSiteStr))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment