username@email.com
2025-07-01 5856a6e5de198436bc112923609db21c9a45fd10
增加公司收藏工人的功能
4个文件已修改
78 ■■■■■ 已修改文件
cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Model/OrderModel/OrderBidding.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cylsg/cylsg.Application/Orders/Dtos/OrderDto.cs
@@ -353,6 +353,12 @@
        public decimal? WorkPrice { get; set; }
        /// <summary>
        /// 是否收藏
        /// </summary>
        public bool? IsCollect { get; set; }
        /// <summary>
        /// 历史工价
        /// </summary>
        public List<OrderBiddingWorkPrice> orderBiddingWorkPrices { get; set; }
@@ -391,6 +397,23 @@
    }
    public class ShoucangDto
    {
        /// <summary>
        /// 招工明细OrderBiddingId
        /// </summary>
        public int OrderBiddingId { get; set; }
        /// <summary>
        /// 是否收藏
        /// </summary>
        public bool IsCollect { get; set; }
    }
    public class WorkPriceDto
    {
cylsg/cylsg.Application/Orders/OrderCompanyAppService.cs
@@ -337,6 +337,53 @@
        /// <summary>
        /// 公司收藏工人
        /// </summary>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        public async Task<bool> ShoucangGongren(ShoucangDto shoucangDto)
        {
            var UserID = App.User?.FindFirstValue("UserID");
            int userid = 0;
            string NickName = App.User?.FindFirstValue("NickName");
            if (!string.IsNullOrEmpty(UserID))
            {
                userid = int.Parse(UserID);
            }
            var orderBiddingRes = new BaseRepository<OrderBidding>();
            var orderBidding = await orderBiddingRes.GetByIdAsync(shoucangDto.OrderBiddingId);
            if (orderBidding == null || orderBidding.IsEn != true || orderBidding.IsDeleted == true)
            {
                throw Oops.Oh("该投递已经无效!");
            }
            bool res;
            orderBidding.IsCollect = shoucangDto.IsCollect;
            orderBidding.UpDataBy = NickName;
            orderBidding.UpDataTime = DateTime.Now;
            res = await orderBiddingRes.UpdateAsync(orderBidding);
            return res;
        }
        /// <summary>
        /// 公司修改工人工价
cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs
@@ -314,7 +314,7 @@
                }
            }
            orderBiddings = orderBiddings.Where(x => (x.IsSelected == null || x.IsSelected != false)).OrderBy(x=>x.IsSelected).ToList();
            orderBiddings = orderBiddings.Where(x => (x.IsSelected == null || x.IsSelected != false)).OrderBy(x=>x.IsSelected).ThenByDescending(x=>x.IsCollect).ToList();
            var orderBiddingDtos = _mapper.Map<List<OrderBiddingDto>>(orderBiddings);
            if(orderBiddingDtos != null&& orderBiddingDtos.Count > 0)
            {
cylsg/cylsg.Model/OrderModel/OrderBidding.cs
@@ -59,5 +59,11 @@
        /// </summary>
        [SugarColumn(ColumnDescription = "工资总额", Length = 18, DecimalDigits = 2, IsNullable = true)]
        public decimal? Salary { get; set; }
        /// <summary>
        /// 是否收藏
        /// </summary>
        [SugarColumn(ColumnDescription = "是否收藏", IsNullable = true)]
        public bool? IsCollect { get; set; }
    }
}