Pārlūkot izejas kodu

1.其他款项 增加字段 供应商类型,供应商地区,数量,费用总计

leiy 9 mēneši atpakaļ
vecāks
revīzija
36b583386c

+ 11 - 27
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2892,38 +2892,22 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DecreasePaymentsSelect(DecreasePaymentsDto dto)
         {
-            try
-            {
-                #region 参数验证
 
-                if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
-                if (dto.CTId < 1) return Ok(JsonView(false, "请传入有效的CTId参数!"));
-
-                #endregion
-
-                //var groupData = await GeneralMethod.PostOperationAuthReturnGroupInfosAsync(dto.UserId, dto.CTId);
-                ////支付方式
-                //List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
-                //List<SetDataInfoView> _Payment = _mapper.Map<List<SetDataInfoView>>(Payment);
+            #region 参数验证
 
-                //var data = new
-                //{
-                //    Payment = _Payment,
-                //    GroupName = groupData,
-                //};
+            if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
+            if (dto.CTId < 1) return Ok(JsonView(false, "请传入有效的CTId参数!"));
 
-                var res = await _decreasePaymentsRep.DecreasePaymentsSelect(dto);
-                if (res.Code != 0)
-                {
-                    return Ok(JsonView(false, res.Msg));
-                }
+            #endregion
 
-                return Ok(JsonView(true, "操作成功!", res.Data));
-            }
-            catch (Exception ex)
+            var res = await _decreasePaymentsRep.DecreasePaymentsSelect(dto);
+            if (res.Code != 0)
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(false, res.Msg));
             }
+
+            return Ok(JsonView(true, "操作成功!", res.Data));
+
         }
 
         /// <summary>
@@ -2980,7 +2964,7 @@ namespace OASystem.API.Controllers
                     int ccpId = groupData.Data.GetType().GetProperty("ccpId").GetValue(groupData.Data, null);
                     int sign = groupData.Data.GetType().GetProperty("sign").GetValue(groupData.Data, null);
 
-                    //await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
+                    await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
                 }
                 catch (Exception ex)
                 {

+ 24 - 2
OASystem/OASystem.Domain/Dtos/Groups/DecreasePaymentsDto.cs

@@ -39,7 +39,7 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int PayDId { get; set; }
         /// <summary>
-        /// 费用表示
+        /// 费用标识
         /// </summary>
         public int OrbitalPrivateTransfer { get; set; }
         /// <summary>
@@ -54,15 +54,37 @@ namespace OASystem.Domain.Dtos.Groups
         /// 团组外键编号
         /// </summary>
         public int DiId { get; set; }
+
+        /// <summary>
+        /// 供应商地区
+        /// 0 未选择 1 国内(默认) 2 国外
+        /// </summary>
+        public int SupplierArea { get; set; }
+
+        /// <summary>
+        /// 供应商类型
+        /// </summary>
+        public int SupplierTypeId { get; set; }
+
         /// <summary>
         /// 费用名称
         /// </summary>
         public string PriceName { get; set; }
         /// <summary>
-        /// 费用金额
+        /// 单价
         /// </summary>
         public decimal Price { get; set; }
 
+        /// <summary>
+        /// 数量
+        /// </summary>
+        public decimal Quantity { get; set; }
+
+        /// <summary>
+        /// 费用总计
+        /// </summary>
+        public decimal FeeTotal { get; set; }
+
         /// <summary>
         /// 费用币种
         /// </summary>

+ 29 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_DecreasePayments.cs

@@ -18,17 +18,45 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable =true,ColumnDataType ="int")]
         public int DiId { get; set; }
+
+        /// <summary>
+        /// 供应商地区
+        /// 0 未选择 1 国内(默认) 2 国外
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SupplierArea { get; set; } = 0;
+
+        /// <summary>
+        /// 供应商类型
+        /// setdata 外键Id  StID = 21
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SupplierTypeId { get; set; }
+
         /// <summary>
         /// 费用名称
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(225)")]
         public string PriceName { get; set; }
+
         /// <summary>
-        /// 费用金额
+        /// 单价
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
         public decimal Price { get; set; }
 
+        /// <summary>
+        /// 数量
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Quantity { get; set; }
+
+        /// <summary>
+        /// 费用总计
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal FeeTotal { get; set; }
+
         /// <summary>
         /// 费用币种
         /// </summary>

+ 20 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -153,13 +153,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
 
             }
+            List<dynamic> _supplierArea = new List<dynamic>() {
+                new { id=0,name = "未选择" },
+                new { id=1,name = "国内" },
+                new { id=2,name = "国外" },
+            };
+
             #endregion
 
             var data = new
             {
                 payment = _Payment,
                 groupName = _Delegations,
-                supplier = _supplier
+                supplier = _supplier,
+                supplierArea = _supplierArea
             };
             return result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
 
@@ -173,6 +180,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 int id = 0;
                 Grp_DecreasePayments grp_Decrease = _mapper.Map<Grp_DecreasePayments>(dto);
+                //处理费用总计
+                if (grp_Decrease.FeeTotal == 0.00M)
+                {
+                    grp_Decrease.FeeTotal = grp_Decrease.Price * grp_Decrease.Price;
+                }
+
                 List<TeamRateDescAddCurrencyIdView> teamRates = await _teamRateRep.PostGroupTeamRateItemByDiIdAndCTableId(1, dto.DiId, 98);
                 if (dto.Status == 1)//添加
                 {
@@ -200,7 +213,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         C.CTDId = 0;
                         C.BankNo = "";
                         C.CardholderName = "";
-                        C.PayMoney = grp_Decrease.Price;
+                        C.PayMoney = grp_Decrease.FeeTotal;
                         C.PaymentCurrency = grp_Decrease.Currency;
                         //当天汇率
                         //if (!string.IsNullOrEmpty(hfRate.Value))
@@ -284,8 +297,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     bool res = await UpdateAsync(a => a.Id == grp_Decrease.Id, a => new Grp_DecreasePayments
                     {
                         DiId = grp_Decrease.DiId,
+                        SupplierArea = grp_Decrease.SupplierArea,
+                        SupplierTypeId = grp_Decrease.SupplierTypeId,
                         PriceName = grp_Decrease.PriceName,
                         Price = grp_Decrease.Price,
+                        Quantity    = grp_Decrease.Quantity,
+                        FeeTotal = grp_Decrease.FeeTotal,
                         Currency = grp_Decrease.Currency,
                         FilePath = grp_Decrease.FilePath,
                         Remark = grp_Decrease.Remark,
@@ -328,7 +345,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                                         {
                                                             PayDId = dto.PayDId,
                                                             IsPay = ispay,
-                                                            PayMoney = grp_Decrease.Price,
+                                                            PayMoney = grp_Decrease.FeeTotal,
                                                             PaymentCurrency = grp_Decrease.Currency,
                                                             Payee = dto.Payee,
                                                             OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,