username@email.com
2022-06-23 e0919683625f6a48699ed2c223f22366cc5bc949
积分
34个文件已修改
642 ■■■■■ 已修改文件
zhengcaioa/CommonToolsCore/AesClass.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/CommonToolsCore/HttpClientRequest.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/FiBookDTO.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/FiMemberDTO.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/FiServiceDTO.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/OrderBanciDTO.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/OrderBanciDtlDTO.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/OrderBanciOrderDTO.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/ProjectDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/ServiceChargeDTO.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IOrderBanciService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/FiBook.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/FiMember.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/FiService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/OrderBanciDtl.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/OrderBanciOrder.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/zhengcaioaContext.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/FiBookService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/FiMemberService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/FiServiceService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/OrderBanciDtlService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/OrderBanciOrderService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/OrderBanciService.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciController.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/ProjectController.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanci/EditDtl.cshtml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanci/Index.cshtml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanci/IndexDtl.cshtml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/Index.cshtml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/Indexzhuanjia.cshtml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/print.cshtml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/appsettings.Development.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/appsettings.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/CommonToolsCore/AesClass.cs
@@ -99,61 +99,27 @@
        /// 用户名,这个名字可能会被更改
        /// </summary>
        public string User { get; set; }
        /// <summary>
        /// 小采问答权限
        /// </summary>
        public bool XC { get; set; }
        /// <summary>
        /// 咨询权限
        /// </summary>
        public bool ZX { get; set; }
        /// <summary>
        /// 赠送书籍权限
        /// </summary>
        public bool SJ { get; set; }
        /// <summary>
        /// 政采课堂
        /// 授权的服务  用字符串表示,如果有  "CGGG"代表采购公告 "ZXDSFXLS" 代表竞争对手零时权限 没有该字符串,代表没有权限
        /// </summary>
        public bool KT { get; set; }
        public List<string> PrivilegeService { get; set; }
        /// <summary>
        /// 投诉案例处理 0时无权限
        /// </summary>
        public int TS { get; set; }
        ///// <summary>
        /////  采购公告
        ///// </summary>
        //public int CGGG { get; set; }
        /// <summary>
        /// 标书制作0时无权限
        /// </summary>
        public int BS { get; set; }
        //    /// <summary>
        //    ///  竞争对手分析 零时权限
        //    /// </summary>
        //    public int ZXDSFXLS { get; set; }
        //    /// <summary>
        //    ///  竞争对手分析
        //    /// </summary>
        //    public int ZXDSFX { get; set; }
        /// <summary>
        /// 纠纷 0时无权限
        /// </summary>
        public int JS { get; set; }
        /// <summary>
        /// 折扣 或者10无折扣 只能时0-9之间的数字
        /// </summary>
        public int DSoff { get; set; }
        /// <summary>
        ///  采购公告
        /// </summary>
        public int CGGG { get; set; }
        /// <summary>
        ///  竞争对手分析
        /// </summary>
        public int ZXDSFX { get; set; }
        /// <summary>
        ///  临时竞争对手分析
        /// </summary>
        public int ZXDSFXLS { get; set; }
    }
}
zhengcaioa/CommonToolsCore/HttpClientRequest.cs
@@ -23,7 +23,7 @@
            request.ContentLength = length;
            request.ServicePoint.Expect100Continue = false;
            //ServicePointManager.Expect100Continue = false;
            request.Timeout = 500; //是进行后续同步请求时使用 GetResponse 方法等待响应以及 GetRequestStream 方法等待流所允许的毫秒数
            request.Timeout = 5000; //是进行后续同步请求时使用 GetResponse 方法等待响应以及 GetRequestStream 方法等待流所允许的毫秒数
            var writer = request.GetRequestStream();
            writer.Write(byteData, 0, length);
            writer.Close();
@@ -48,7 +48,7 @@
            request.ContentLength = length;
            request.ServicePoint.Expect100Continue = false;
            //ServicePointManager.Expect100Continue = false;
            request.Timeout = 500; //是进行后续同步请求时使用 GetResponse 方法等待响应以及 GetRequestStream 方法等待流所允许的毫秒数
            request.Timeout = 5000; //是进行后续同步请求时使用 GetResponse 方法等待响应以及 GetRequestStream 方法等待流所允许的毫秒数
            var writer = request.GetRequestStream();
            writer.Write(byteData, 0, length);
            writer.Close();
zhengcaioa/DTO/FiBookDTO.cs
@@ -19,5 +19,6 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/DTO/FiMemberDTO.cs
@@ -16,5 +16,6 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/DTO/FiServiceDTO.cs
@@ -17,5 +17,6 @@
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public string ServiceTypeTop { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/DTO/OrderBanciDTO.cs
@@ -23,6 +23,28 @@
        public int? Renshu { get; set; }
        
        public string Shangxiawu { get; set; }
        public string ShangxiawuName { get; set; }
        public decimal? Jiage { get; set; }
        public decimal? Jifen { get; set; }
        public string JiageName { get; set; }
        public string JifenName { get; set; }
        public string Shixiamg { get; set; }
        public string Zhujiangren { get; set; }
        public int? Sort { get; set; }
        public string Shijiandtl { get; set; }
        public string img_url { get; set; }//图片
        public decimal? point { get; set; }//积分
        public decimal? sell_price { get; set; } //售价
        public string title { get; set; } //产品名称
        public string type { get; set; }
        public string id { get; set; }
    }
    public class OrderBanciDTOSearch : SearchEntity
zhengcaioa/DTO/OrderBanciDtlDTO.cs
@@ -19,6 +19,11 @@
        public DateTime Modifytime { get; set; }
        public string OrderBanciId { get; set; }
        public int? Sort { get; set; }
        public decimal? Jiage { get; set; }
        public decimal? Jifen { get; set; }
        public string JiageName { get; set; }
        public string JifenName { get; set; }
    }
    public class OrderBanciDtlDTOSearch : SearchEntity
zhengcaioa/DTO/OrderBanciOrderDTO.cs
@@ -28,6 +28,8 @@
        public string Shenfenzheng { get; set; }
        public string OrderId { get; set; }
        public decimal? Jifen { get; set; }
        public string JifenName { get; set; }
    }
    public class OrderBanciOrderDTOSearch : SearchEntity
zhengcaioa/DTO/ProjectDTO.cs
@@ -13,6 +13,9 @@
        public string Sheng { get; set; }
        public string City { get; set; }
        public string AreaId { get; set; }
        public string ShengName { get; set; }
        public string CityName { get; set; }
        public string AreaIdName { get; set; }
        public string Cgfs { get; set; }
        public string CgfsName { get; set; }
        public string Number { get; set; }
@@ -57,6 +60,7 @@
        public string NamesZhongbiao { get; set; }
        public string Fblx { get; set; }
        public string FblxName { get; set; }
        public string Fbyy { get; set; }
        public string Caigourenname { get; set; }
zhengcaioa/DTO/ServiceChargeDTO.cs
@@ -8,7 +8,11 @@
    {
        public string Dianhuazixun { get; set; }
        public string DianhuazixunJifen { get; set; }
        public string Dangmianzixun { get; set; }
        public string DangmianzixunJifen { get; set; }
        public string Xuqiulunzheng1 { get; set; }
        public string Xuqiulunzheng2 { get; set; }
        public string Xuqiulunzheng3 { get; set; }
@@ -55,6 +59,51 @@
        public string[] MemberId { get; set; }
        public string[] Huifei { get; set; }
        public string[] Jifen { get; set; }
        public string Xuqiulunzheng1Jifen { get; set; }
        public string Xuqiulunzheng2Jifen { get; set; }
        public string Xuqiulunzheng3Jifen { get; set; }
        public string Xuqiulunzheng4Jifen { get; set; }
        public string Xuqiulunzheng5Jifen { get; set; }
        public string Zhudaotoubiaowenjian1Jifen { get; set; }
        public string Zhudaotoubiaowenjian2Jifen { get; set; }
        public string Zhudaotoubiaowenjian3Jifen { get; set; }
        public string Zhudaotoubiaowenjian4Jifen { get; set; }
        public string Daishuzhiyi1Jifen { get; set; }
        public string Daishuzhiyi2Jifen { get; set; }
        public string Daishuzhiyi3Jifen { get; set; }
        public string Daishuzhiyi4Jifen { get; set; }
        public string Daushutousu1Jifen { get; set; }
        public string Daushutousu2Jifen { get; set; }
        public string Daushutousu3Jifen { get; set; }
        public string Daushutousu4Jifen { get; set; }
        public string DainizhiyiwendaJifen { get; set; }
        public string DainitousuchulijuedingJifen { get; set; }
        public string JinzhengfuishouJifen { get; set; }
        public string ZhengcaidaiJifen { get; set; }
        public string Biaoshuzhizuo1Jifen { get; set; }
        public string Biaoshuzhizuo2Jifen { get; set; }
        public string Biaoshuzhizuo3Jifen { get; set; }
        public string Biaoshuzhizuo4Jifen { get; set; }
        public string ZaixianjiangzuoJifen { get; set; }
        public string XianxiajiangzuoJifen { get; set; }
        public string GongyingshangpeixunJifen { get; set; }
        public string CaigourenpeixunJifen { get; set; }
        public string JubeitiaojianJifen { get; set; }
        public string ZengjiapinmuJifen { get; set; }
        public string BujubeitiaojianJifen { get; set; }
        public string Lvyuejiufen1Jifen { get; set; }
        public string Lvyuejiufen2Jifen { get; set; }
        public string Lvyuejiufen3Jifen { get; set; }
        public string Lvyuejiufen4Jifen { get; set; }
        public string Lvyuejiufen5Jifen { get; set; }
        public string Ruanjian1Jifen { get; set; }
        public string Ruanjian2Jifen { get; set; }
    }
}
zhengcaioa/IServices/IOrderBanciService.cs
@@ -20,5 +20,8 @@
        OrderBanciDTO GetAll(string id);
        List<OrderBanciDTO> GetJifenBanciList();
    }
}
zhengcaioa/Model/FiBook.cs
@@ -18,5 +18,6 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/Model/FiMember.cs
@@ -16,5 +16,6 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/Model/FiService.cs
@@ -17,5 +17,6 @@
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public string ServiceTypeTop { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/Model/OrderBanciDtl.cs
@@ -19,5 +19,7 @@
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public decimal? Jiage { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/Model/OrderBanciOrder.cs
@@ -26,5 +26,6 @@
        public DateTime Modifytime { get; set; }
        public string Shenfenzheng { get; set; }
        public string OrderId { get; set; }
        public decimal? Jifen { get; set; }
    }
}
zhengcaioa/Model/zhengcaioaContext.cs
@@ -3128,6 +3128,10 @@
                    .HasColumnName("danjia")
                    .HasComment("单价");
                entity.Property(e => e.Jifen)
                   .HasColumnType("money")
                   .HasColumnName("jifen");
                entity.Property(e => e.Modifier)
                    .IsRequired()
                    .HasMaxLength(50)
@@ -3167,6 +3171,10 @@
                    .HasColumnType("money")
                    .HasColumnName("huifei")
                    .HasComment("会费");
                entity.Property(e => e.Jifen)
                    .HasColumnType("money")
                    .HasColumnName("jifen");
                entity.Property(e => e.MemberAuthority)
                    .HasMaxLength(500)
@@ -3217,6 +3225,10 @@
                    .HasColumnType("money")
                    .HasColumnName("feiyong")
                    .HasComment("费用");
                entity.Property(e => e.Jifen)
                  .HasColumnType("money")
                  .HasColumnName("jifen");
                entity.Property(e => e.Modifier)
                    .IsRequired()
@@ -4663,6 +4675,14 @@
                entity.Property(e => e.Zhujiangren)
                    .HasMaxLength(100)
                    .HasColumnName("zhujiangren");
                entity.Property(e => e.Jiage)
                  .HasColumnType("numeric(18, 2)")
                  .HasColumnName("jiage");
                entity.Property(e => e.Jifen)
                  .HasColumnType("numeric(18, 2)")
                  .HasColumnName("Jifen");
            });
            modelBuilder.Entity<OrderBanciOrder>(entity =>
@@ -4696,6 +4716,10 @@
                    .HasColumnType("money")
                    .HasColumnName("jine");
                entity.Property(e => e.Jifen)
                 .HasColumnType("money")
                 .HasColumnName("jifen");
                entity.Property(e => e.Kechengleixing)
                    .HasMaxLength(100)
                    .HasColumnName("kechengleixing");
zhengcaioa/Services/FiBookService.cs
@@ -46,7 +46,7 @@
                    updateproject.Chubanshe = entity.Chubanshe;
                    updateproject.Chubantime = entity.Chubantime;
                    updateproject.Danjia = entity.Danjia;
                    updateproject.Jifen = entity.Jifen;
                    updateproject.RecStatus = entity.RecStatus;
zhengcaioa/Services/FiMemberService.cs
@@ -44,7 +44,7 @@
                    updateproject.MemberType = entity.MemberType;
                    updateproject.MemberAuthority = entity.MemberAuthority;
                    updateproject.Huifei = entity.Huifei;
                    updateproject.Jifen = entity.Jifen;
                    updateproject.RecStatus = entity.RecStatus;
zhengcaioa/Services/FiServiceService.cs
@@ -44,7 +44,7 @@
                    updateproject.ServiceType = entity.ServiceType;
                    updateproject.ServiceTypeTwo = entity.ServiceTypeTwo;
                    updateproject.Feiyong = entity.Feiyong;
                    updateproject.Jifen = entity.Jifen;
                    updateproject.RecStatus = entity.RecStatus;
zhengcaioa/Services/OrderBanciDtlService.cs
@@ -53,6 +53,8 @@
                    updateproject.Modifytime = entity.Modifytime;
                    updateproject.Sort = entity.Sort;
                    updateproject.OrderBanciId = entity.OrderBanciId;
                    updateproject.Jiage = entity.Jiage;
                    updateproject.Jifen = entity.Jifen;
                }
@@ -157,6 +159,10 @@
                             RecStatus = a.RecStatus,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
                             Jiage = a.Jiage,
                             Jifen = a.Jifen,
                             JiageName = a.Jiage.HasValue? a.Jiage.Value.ToString():"",
                             JifenName = a.Jifen.HasValue ? a.Jifen.Value.ToString() : "",
                         }
                ).OrderBy(x => x.Sort).ToList();
zhengcaioa/Services/OrderBanciOrderService.cs
@@ -36,6 +36,10 @@
                {
                    entity.Id = Guid.NewGuid().ToString();
                    dto.Id = entity.Id;
                    if (string.IsNullOrWhiteSpace(dto.OrderId))
                    {
                        entity.OrderId = dto.Id;
                    }
                    _context.OrderBanciOrders.Add(entity);
                }
                else
@@ -59,6 +63,7 @@
                    updateproject.Modifier = entity.Modifier;
                    updateproject.Modifytime = entity.Modifytime;
                    updateproject.Shenfenzheng = entity.Shenfenzheng;
                    updateproject.Jifen = entity.Jifen;
                    updateproject.OrderId = entity.OrderId;
                }
@@ -173,7 +178,7 @@
                             Xuefei = a.Xuefei??0,
                             Baomingrenshu = a.Baomingrenshu??0,
                             Jine = a.Jine??0,
                             Jifen = a.Jifen ?? 0,
                             Creater = a.Creater,
                             Createtime = a.Createtime,
zhengcaioa/Services/OrderBanciService.cs
@@ -230,5 +230,105 @@
            var list = _mapper.Map<List<OrderBanciDTO>>(listRole);
            return list;
        }
        public List<OrderBanciDTO> GetJifenBanciList()
        {
            ResultDataEntity<OrderBanciDTO> data = new ResultDataEntity<OrderBanciDTO>();
            List<OrderBanciDTO> list = new List<OrderBanciDTO>();
            var listCode = (from a in _context.SysCodeDtls
                            join b in _context.SysCodes
                            on a.CodeId equals b.Id
                            where a.RecStatus == "A"
                                          && b.RecStatus == "A"
                            select new CodeDataEntity()
                            {
                                CodeId = b.Id,
                                CodeTable = b.CodeTable,
                                CodeField = b.CodeField,
                                CodeSn = a.CodeSn,
                                Comments = a.Comments,
                                Contents = a.Contents,
                                RecStatus = a.RecStatus,
                                Sort = a.Sort
                            }
            );
            ///OrderBancis
            ///
            var query = (from a in _context.OrderBancis
                         join b in _context.OrderBanciDtls on a.Id equals b.OrderBanciId
                         join d in listCode.Where(x => x.CodeTable == "order_banci_order" && x.CodeField == "kechengleixing_id")
                        on b.Shangxiawu equals d.CodeSn
                         into dzsssss
                         from dzzzzz in dzsssss.DefaultIfEmpty()
                         where a.RecStatus == "A" && b.RecStatus == "A" && b.Jifen != null
                         && a.Shijianend >= DateTime.Now
                         select new OrderBanciDTO
                         {
                             img_url ="",
                             point = b.Jifen,
                             sell_price = b.Jiage,
                             type = "Train",
                             title = a.Mingcheng+"("+ dzzzzz.Comments+")",
                             Id = a.Id,
                             Banci = a.Banci,
                             Mingcheng = a.Mingcheng,
                             Shijian = a.Shijian,
                             ShijianName = a.Shijian.HasValue ? a.Shijian.Value.ToString("yyyy-MM-dd HH:mm") : "",
                             Shijianend = a.Shijianend,
                             ShijianendName = a.Shijianend.HasValue ? a.Shijianend.Value.ToString("yyyy-MM-dd HH:mm") : "",
                             Didian = a.Didian,
                             Renshu = a.Renshu ?? 0,
                             Creater = a.Creater,
                             Createtime = a.Createtime,
                             RecStatus = a.RecStatus,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
                             Shangxiawu = b.Shangxiawu,
                             Shijiandtl = b.Shijian,
                             Shixiamg = b.Shixiamg,
                             Zhujiangren = b.Zhujiangren,
                             Sort = b.Sort,
                             ShangxiawuName = dzzzzz.Comments,
                             Jiage = b.Jiage,
                             Jifen = b.Jifen,
                             JiageName = b.Jiage.HasValue ? b.Jiage.Value.ToString() : "",
                             JifenName = b.Jifen.HasValue ? b.Jifen.Value.ToString() : "",
                             id = a.Id,
                         }
                ).OrderByDescending(x => x.Shijian).ThenBy(x=>x.Sort).ToList();
            return query;
        }
    }
}
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciController.cs
@@ -359,5 +359,39 @@
          
        }
        //获取当前的培训
        public IActionResult GetJifenBanciList()
        {
            ReturnMsg<List<OrderBanciDTO>> returnMsg = new ReturnMsg<List<OrderBanciDTO>>();
            returnMsg.code = 2;
            try
            {
                List<OrderBanciDTO> orderBanciDTOs = _orderBanciService.GetJifenBanciList();
                    returnMsg.code = 1;
                    returnMsg.count = orderBanciDTOs.Count;
                    returnMsg.returnObj = orderBanciDTOs;
            }
            catch (Exception ex)
            {
                returnMsg.code = 2;
                returnMsg.error = "没有获取到token";
                returnMsg.count = 0;
            }
            return new JsonResult(returnMsg);
        }
    }
}
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs
@@ -18,6 +18,10 @@
using CommonToolsCore;
using Services;
using System.Transactions;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json.Linq;
using System.Net.Http.Headers;
using System.IdentityModel.Tokens.Jwt;
namespace zhengcaioa.Controllers.BusinessOrder
{
@@ -30,11 +34,15 @@
        private readonly IOrderBanciOrderService _orderBanciOrderService;
        private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
        private readonly ICooperOrderService _cooperOrderService;
        private readonly IConfiguration _configuration;
        private readonly IHttpClientFactory _clientFactory;
        public OrderBanciOrderController(ILogger<OrderBanciOrderController> logger, ILiaotianService liaotianService, IOrderBanciService orderBanciService, IOrderBanciDtlService orderBanciDtlService
            ,IOrderBanciOrderService orderBanciOrderService
            , IFiOrderrecievemoneyService fiOrderrecievemoneyService
            , ICooperOrderService cooperOrderService)
            , ICooperOrderService cooperOrderService
            , IConfiguration configuration
              , IHttpClientFactory clientFactory)
        {
            _logger = logger;
            _liaotianService = liaotianService;
@@ -43,6 +51,8 @@
            _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
            _orderBanciOrderService = orderBanciOrderService;
            _cooperOrderService = cooperOrderService;
            _configuration = configuration;
            _clientFactory = clientFactory;
        }
        [CheckLogin]
@@ -332,6 +342,196 @@
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="data">岗位实体类对象</param>
        /// <returns></returns>
        ///
        [HttpPost]
        public  IActionResult JifenSave([FromBody] OrderBanciOrderDTO data)
        {
            //var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            //ViewData["curentuser"] = curentuser;
            ReturnMsg<OrderBanciOrderDTO> returnMsg = new ReturnMsg<OrderBanciOrderDTO>();
            returnMsg.code = 2;
            try
            {
                string userid = "";
                var headers = Request.Headers;
                if (headers != null)
                {
                    //string SecurityKey = _configuration.GetSection("SecurityKey").Value;
                    var keyId = headers["Authorization"].FirstOrDefault();
                    if (string.IsNullOrEmpty("keyId"))
                    {
                        returnMsg.code = 2;
                        returnMsg.error = "没有获取到token";
                        returnMsg.count = 0;
                        return new JsonResult(returnMsg);
                    }
                    JwtSecurityToken jwt = null;
                    var handler = new JwtSecurityTokenHandler();
                    var key1 = keyId.Replace("Bearer", "").Trim();
                    jwt = handler.ReadJwtToken(key1);
                    System.Security.Claims.Claim sss = jwt.Claims.Where(x => x.Type == "id").FirstOrDefault();
                    userid = sss.Value;
                }
                else
                {
                    returnMsg.code = 2;
                    returnMsg.error = "没有获取到token";
                    returnMsg.count = 0;
                    return new JsonResult(returnMsg);
                }
                using (TransactionScope scope = new TransactionScope())
                {
                    data.RecStatus = "A";
                    if (String.IsNullOrEmpty(data.Id))
                    {
                        data.Creater = "1";
                        data.Createtime = DateTime.Now;
                    }
                    data.Modifier = "1";
                    data.Modifytime = DateTime.Now;
                    data.PersonId = userid;
                    //OrderBanciOrderDTOSearch search = new OrderBanciOrderDTOSearch();
                    //search.page = 1;
                    //search.rows = 1000;
                    //search.BanciId = data.BanciId;
                    //ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
                    if (data.Baomingrenshu.HasValue)
                    {
                        //if (resultDataEntity.DataList.Count > 0)
                        //{
                        //  var orderBanciOrderDTO =   resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
                        //    data.Baomingrenshu += orderBanciOrderDTO.Baomingrenshu;
                        //}
                    }
                    else
                    {
                        //if (resultDataEntity.DataList.Count > 0)
                        //{
                        //    var orderBanciOrderDTO = resultDataEntity.DataList.OrderByDescending(x => x.Baomingrenshu).FirstOrDefault();
                        //    data.Baomingrenshu = orderBanciOrderDTO.Baomingrenshu+1;
                        //}
                        //else
                        //{
                        data.Baomingrenshu = 1;
                        //}
                    }
                    //data.Jine = resultDataEntity.DataList.Sum(x => x.Xuefei);
                    //data.Jine += data.Xuefei;
                    ResultEntity resultEntity = _orderBanciOrderService.save(data);
                    if (resultEntity.Result)
                    {
                        returnMsg.code = 1;
                        returnMsg.count = 1;
                        returnMsg.returnObj = data;
                    }
                    else
                    {
                        returnMsg.error = resultEntity.Message;
                    }
                    int OnePorints = 0;
                   var orderBanciDTO = _orderBanciService.Get(data.BanciId);
                   var  orderBanciDtlDTO = _orderBanciDtlService.GetList(data.BanciId).Where(x=>x.Shangxiawu == data.KechengleixingId).FirstOrDefault();
                    if(orderBanciDtlDTO!=null&& orderBanciDtlDTO.Jifen.HasValue)
                    {
                        OnePorints = decimal.ToInt32(orderBanciDtlDTO.Jifen.Value); ;
                    }
                    else
                    {
                        returnMsg.code = 2;
                        returnMsg.error = "该班次不能积分兑换";
                        returnMsg.count = 0;
                        return new JsonResult(returnMsg);
                    }
                    string huiyuanurl = _configuration.GetSection("huiyuanurl").Value;
                    string GetYGYaoQingYonghu = _configuration.GetSection("PassPoints").Value;
                    Uri postUrl2 = new Uri(huiyuanurl + GetYGYaoQingYonghu);
                    JObject questions2 = new JObject();
                    questions2.Add("UserID", data.PersonId);
                    questions2.Add("GoodsName", data.Peixunbanci);
                    questions2.Add("Content", data.Peixunbanci);
                    questions2.Add("ToatlPorints", data.Baomingrenshu.Value* OnePorints);//计算
                    questions2.Add("OnePorints", OnePorints);//计算
                    questions2.Add("Count", data.Baomingrenshu);
                    questions2.Add("OderID", data.Id);
                    questions2.Add("describe", data.Peixunbanci +"积分报名");
                    string requestJson2 = questions2.ToString();
                    string result2 = string.Empty;
                    result2 = HttpClientRequest.HttpClientPost(postUrl2.ToString(), "POST", requestJson2);
                    //using (HttpContent httpContent = new StringContent(requestJson2))
                    //{
                    //    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    //    var httpClient2 = _clientFactory.CreateClient();
                    //    httpClient2.Timeout = new TimeSpan(0, 0, 60);
                    //    var Result2 = await httpClient2.PostAsync(postUrl2, httpContent);
                    //    result2 = Result2.Content.ReadAsStringAsync().Result;
                    //}
                    _logger.LogInformation("result2:" + result2);
                    JObject jobjectresult = (JObject)JsonConvert.DeserializeObject(result2);
                    if (jobjectresult["code"] != null && jobjectresult["code"].ToString() == "1")
                    {
                        string OaWriteTrainClassOder = _configuration.GetSection("OaWriteTrainClassOder").Value;
                        Uri postUrl = new Uri(huiyuanurl + OaWriteTrainClassOder);
                        JObject questions = new JObject();
                        questions.Add("UserID", data.PersonId);
                        questions.Add("TrainClass", data.Peixunbanci);
                        questions.Add("TrainClassType", int.Parse(data.KechengleixingId));
                        questions.Add("Name", data.Xingming);//计算
                        questions.Add("IdentificationNumber", data.Shenfenzheng);//计算
                        questions.Add("PhoneNo", data.Lianxidianhua);
                        questions.Add("StartTime", orderBanciDTO.Shijian.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                        questions.Add("BanciId", data.BanciId);
                        questions.Add("BanciAddr", orderBanciDTO.Didian);
                        questions.Add("PersonCount", data.Baomingrenshu);
                        questions.Add("Ptions", data.Baomingrenshu.Value * OnePorints);
                        string requestJson = questions.ToString();
                        string result = string.Empty;
                        result = HttpClientRequest.HttpClientPost(postUrl.ToString(), "POST", requestJson);
                        _logger.LogInformation("result:" + result);
                        scope.Complete();
                    }
                    else
                    {
                        returnMsg.code = 2;
                        returnMsg.error = jobjectresult["msg"].ToString();
                        returnMsg.count = 0;
                        return new JsonResult(returnMsg);
                    }
                }
            }
            catch (Exception ex)
            {
                returnMsg.code = 2;
                returnMsg.error = "没有获取到token";
                returnMsg.count = 0;
            }
            return new JsonResult(returnMsg);
        }
        //获取当前的报名的人数
        public IActionResult GetBaoMingRenShu([FromBody] OrderBanciOrderDTOSearch search)
zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
@@ -29,11 +29,13 @@
        private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
        private readonly ISysBaimingdanService _sysBaimingdanService;
        private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
        private readonly IAreaService _areaService;
        public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService
            , ICooperatecustomCustomerService cooperatecustomCustomerService
            , ISysBaimingdanService sysBaimingdanService
            , IFiOrderrecievemoneyService fiOrderrecievemoneyService)
            , IFiOrderrecievemoneyService fiOrderrecievemoneyService
            , IAreaService areaService)
        {
            _logger = logger;
            _projectService = projectService;
@@ -43,6 +45,7 @@
            _cooperatecustomCustomerService = cooperatecustomCustomerService;
            _sysBaimingdanService = sysBaimingdanService;
            _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
            _areaService = areaService;
        }
        [CheckLogin]
        public IActionResult Index()
@@ -903,7 +906,7 @@
                    //if (resultDataEntitys.DataList.Count > 0)
                    {
                        string token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1;
                        if (ruleCollection.ZXDSFXLS > 0)
                        if (ruleCollection.PrivilegeService.Count(x=>x== "ZXDSFXLS")>0)
                        //if (ruleCollection.ZXDSFXLS == 0)
                        {
                            DateTime yuechu = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
@@ -974,7 +977,7 @@
                                    return new JsonResult(returnMsg);
                                }
                            }
                            if ( token != zxdsfxlDTOsnowdate[0].Token)
                            if (zxdsfxlDTOsnowdate.Count == 0 || token != zxdsfxlDTOsnowdate[0].Token)
                            {
                                //存储本次的访问信息
                                ZxdsfxlDTO zxdsfxlDTO = new ZxdsfxlDTO();
@@ -1034,5 +1037,51 @@
            }
            return new JsonResult(returnMsg);
        }
        //获取项目详细信息
        public IActionResult GetProjectFenxiDtl(string id = null)
        {
            ReturnMsg<ProjectDTO> returnMsg = new ReturnMsg<ProjectDTO>();
            returnMsg.code = 2;
            var  projectDTO = _projectService.GetLiaotianEntity(id);
            var cgfs = _projectService.GetCgfs().Where(x=>x.Id == projectDTO.Cgfs).FirstOrDefault();
            var areaDTOs = _areaService.GetList();
            var flbx = _liaotianService.GetSYScode("Project", "flbx").Where(x => x.Id == projectDTO.Fblx).FirstOrDefault();
            projectDTO.StartTimestr = projectDTO.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
            var shengname = areaDTOs.Where(x => x.CodeId == projectDTO.Sheng).FirstOrDefault();
            if (shengname != null)
            {
                projectDTO.ShengName = shengname.Name;
            }
            var cityname = areaDTOs.Where(x => x.CodeId == projectDTO.City).FirstOrDefault();
            if (cityname != null)
            {
                projectDTO.CityName = cityname.Name;
            }
            var areaIdName = areaDTOs.Where(x => x.CodeId == projectDTO.AreaId).FirstOrDefault();
            if (areaIdName != null)
            {
                projectDTO.AreaIdName = areaIdName.Name;
            }
            if (cgfs != null)
            {
                projectDTO.CgfsName = cgfs.Name;
            }
            if (flbx != null)
            {
                projectDTO.FblxName = flbx.Comments;
            }
            returnMsg.code = 1;
            returnMsg.count = 1;
            returnMsg.returnObj = projectDTO;
            return new JsonResult(returnMsg);
        }
    }
}
zhengcaioa/zhengcaioa/Views/OrderBanci/EditDtl.cshtml
@@ -170,6 +170,34 @@
                                </div>
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">价格</label>
                                    <div class="col-sm-8 col-md-8" grouptype="Vdata">
                                        <input class="form-control" label="价格" name="Jiage" id="Jiage" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@(Model.Jiage.HasValue?Model.Jiage.Value.ToString():"")" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    </div>
                                </div>
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">积分</label>
                                    <div class="col-sm-8 col-md-8" grouptype="Vdata">
                                        <input class="form-control" label="积分" name="Jifen" id="Jifen" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@(Model.Jifen.HasValue?Model.Jifen.Value.ToString():"")" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    </div>
                                </div>
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
zhengcaioa/zhengcaioa/Views/OrderBanci/Index.cshtml
@@ -20,9 +20,9 @@
            { label: '地点', name: 'Didian', labtype: 'txt', hidden: false, width: 400 },
            { label: '人数', name: 'Renshu', labtype: 'txt', hidden: false, width: 200 },
            {
                label: '课程类型', name: 'Creater', labtype: 'txt', hidden: false, width: 100,
                label: '课程价格', name: 'Creater', labtype: 'txt', hidden: false, width: 100,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('" + rowObject.Banci.replace(/'/g, '') + "','98%','100%', '/OrderBanci/IndexDtl?OrderBanciId=" + rowObject.Id + "')\"  >培训时间</a>";
                    return "<a onclick=\"OpenWindow('" + rowObject.Banci.replace(/'/g, '') + "','98%','100%', '/OrderBanci/IndexDtl?OrderBanciId=" + rowObject.Id + "')\"  >课程价格</a>";
                }
            },
          
zhengcaioa/zhengcaioa/Views/OrderBanci/IndexDtl.cshtml
@@ -18,6 +18,8 @@
            { label: '时间', name: 'Shijian', labtype: 'txt', hidden: false, width: 100  },
            { label: '事项', name: 'Shixiamg', labtype: 'txt', hidden: false, width: 400 },
            { label: '价格', name: 'JiageName', labtype: 'txt', hidden: false, width: 100 },
            { label: '积分', name: 'JifenName', labtype: 'txt', hidden: false, width: 100 },
            { label: '主讲人', name: 'Zhujiangren', labtype: 'txt', hidden: false, width: 100 },
            { label: '排序', name: 'Sort', labtype: 'txt', hidden: false, width: 100 },
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/Index.cshtml
@@ -27,7 +27,7 @@
            { label: '学费', name: 'Xuefei', labtype: 'txt', hidden: false, width: 70 },
            { label: '报名人数', name: 'Baomingrenshu', labtype: 'txt', hidden: false, width: 50 },
            //{ label: '金额', name: 'Jine', labtype: 'txt', hidden: false, width: 100 },
            { label: '积分', name: 'Jifen', labtype: 'txt', hidden: false, width: 50 },
        ];
        dataUrl = "/OrderBanciOrder/GetList?Kechengleixings=3&Baomingtime=" + Baomingtimebegin + "|" + Baomingtimeend;
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/Indexzhuanjia.cshtml
@@ -26,6 +26,7 @@
            { label: '身份证', name: 'Shenfenzheng', labtype: 'txt', hidden: false, width: 70 },
            { label: '学费', name: 'Xuefei', labtype: 'txt', hidden: false, width: 70 },
            { label: '报名人数', name: 'Baomingrenshu', labtype: 'txt', hidden: false, width: 50 },
            { label: '积分', name: 'Jifen', labtype: 'txt', hidden: false, width: 50 },
            //{ label: '金额', name: 'Jine', labtype: 'txt', hidden: false, width: 100 },
            {
                label: '打印合同', name: 'dayin', labtype: 'txt', hidden: false, width: 70
zhengcaioa/zhengcaioa/Views/OrderBanciOrder/print.cshtml
@@ -82,7 +82,7 @@
                    <td style="width:7%;"> 学费</td>
                    <td style="width:7%;"> 报名人数</td>
                    <td style="width:7%;"> 金额</td>
                    <td style="width:7%;"> 积分</td>
                </tr>
                @foreach (var liaotianDTO in liaotianDTOs)
                {
@@ -98,6 +98,7 @@
                        <td>   @liaotianDTO.Xuefei.Value.ToString("F2")</td>
                        <td>   @liaotianDTO.Baomingrenshu</td>
                        <td>   @liaotianDTO.Jine.Value.ToString("F2")</td>
                <td>   @liaotianDTO.Jifen.Value.ToString("F2")</td>
                    </tr>
                    i++;
zhengcaioa/zhengcaioa/appsettings.Development.json
@@ -22,6 +22,8 @@
  "SetCaseOrder": "/api/ZCBackgRound/SetCaseOrder",
  "GetYGPromoteCode": "/api/ZCBackgRound/GetYGPromoteCode",
  "GetYGYaoQingYonghu": "/api/ZCBackgRound/GetYGYaoQingYonghu",
  "yaoqingma": "https://applet.51zhengcai.com:8088/code/"
  "yaoqingma": "https://applet.51zhengcai.com:8088/code/",
  "PassPoints": "/api/UserPoints/PassPoints",
  "OaWriteTrainClassOder": "/api/ZCBackgRound/OaWriteTrainClassOder"
}
zhengcaioa/zhengcaioa/appsettings.json
@@ -22,5 +22,7 @@
  "SetCaseOrder": "/api/ZCBackgRound/SetCaseOrder",
  "GetYGPromoteCode": "/api/ZCBackgRound/GetYGPromoteCode",
  "GetYGYaoQingYonghu": "/api/ZCBackgRound/GetYGYaoQingYonghu",
  "yaoqingma": "https://applet.51zhengcai.com:8088/code/"
  "yaoqingma": "https://applet.51zhengcai.com:8088/code/",
  "PassPoints": "/api/UserPoints/PassPoints",
  "OaWriteTrainClassOder": "/api/ZCBackgRound/OaWriteTrainClassOder"
}