| | |
| | | DateTime now = DateTime.Now; |
| | | |
| | | // 创建一个表示晚上8点的时间(假定今天) |
| | | DateTime eveningTime = new DateTime(now.Year, now.Month, now.Day, 20, 0, 0); // 20:00:0 |
| | | DateTime eveningTime = new DateTime(orderBiddingDetailChecks[i].Checktime.Value.Year, orderBiddingDetailChecks[i].Checktime.Value.Month, orderBiddingDetailChecks[i].Checktime.Value.Day, 20, 0, 0); // 20:00:0 |
| | | //计算是否为晚上8点后的加班时间 |
| | | if (orderBiddingDetailChecks[i].Checktime.Value > eveningTime ) |
| | | { |
| | |
| | | DateTime now = DateTime.Now; |
| | | |
| | | // 创建一个表示晚上8点的时间(假定今天) |
| | | DateTime eveningTime = new DateTime(now.Year, now.Month, now.Day, 20, 0, 0); // 20:00:0 |
| | | DateTime eveningTime = new DateTime(orderBiddingDetailChecks[i].Checktime.Value.Year, orderBiddingDetailChecks[i].Checktime.Value.Month, orderBiddingDetailChecks[i].Checktime.Value.Day, 20, 0, 0); // 20:00:0 |
| | | //计算是否为晚上8点后的加班时间 |
| | | if (orderBiddingDetailChecks[i].Checktime.Value > eveningTime) |
| | | { |
| | |
| | | int hours = 0; |
| | | int minutes = 0; |
| | | |
| | | int jiabanhours = 0; |
| | | int jiabanminutes = 0; |
| | | |
| | | for (int i = 0; i < orderBiddingDetailChecks.Count; i++) |
| | | { |
| | | |
| | |
| | | hours += timeDifference.Hours; |
| | | minutes += timeDifference.Minutes; |
| | | |
| | | // 获取当前时间 |
| | | DateTime now = DateTime.Now; |
| | | |
| | | // 创建一个表示晚上8点的时间(假定今天) |
| | | DateTime eveningTime = new DateTime(orderBiddingDetailChecks[i].Checktime.Value.Year, orderBiddingDetailChecks[i].Checktime.Value.Month, orderBiddingDetailChecks[i].Checktime.Value.Day, 20, 0, 0); // 20:00:0 |
| | | //计算是否为晚上8点后的加班时间 |
| | | if (orderBiddingDetailChecks[i].Checktime.Value > eveningTime) |
| | | { |
| | | var timeDifferencejiaban = orderBiddingDetailChecks[i].Checktime.Value - eveningTime; |
| | | jiabanhours += timeDifferencejiaban.Hours; |
| | | jiabanminutes += timeDifferencejiaban.Minutes; |
| | | } |
| | | |
| | | } |
| | | } |
| | | //当前有效的工价 |
| | | var orderBiddingWorkPrice = (await orderBiddingWorkPriceRepository.GetListAsync(x => x.OrderBiddingId == orderBidding.Id && x.IsEn == true && x.IsDeleted == false && x.EffectTime <= orderDakaMingxiDto.WorkDate)).OrderByDescending(x => x.Id).FirstOrDefault(); |
| | | if (orderBiddingWorkPrice != null) |
| | | { |
| | | orderDakaMingxiDto.WorkPrice = orderBiddingWorkPrice.WorkPrice; |
| | | //如果为半固定的临时工,工价固定11块 |
| | | if (orderBidding != null && orderBidding.IsGuding.HasValue && orderBidding.IsGuding.Value == true) |
| | | { |
| | | orderDakaMingxiDto.WorkPrice = 11; |
| | | } |
| | | else |
| | | { |
| | | orderDakaMingxiDto.WorkPrice = orderBiddingWorkPrice.WorkPrice; |
| | | } |
| | | |
| | | } |
| | | orderDakaMingxiDto.WorkTime = hours + (minutes / 60); |
| | | if (orderDakaMingxiDto.WorkerType == 0) |
| | | { |
| | | orderDakaMingxiDto.TodaySalary = orderDakaMingxiDto.WorkTime * orderDakaMingxiDto.WorkPrice; |
| | | //如果为半固定的临时工,加班每个小时增加4块钱 |
| | | if (orderBidding != null && orderBidding.IsGuding.HasValue && orderBidding.IsGuding.Value == true) |
| | | { |
| | | var jiabanshijian = jiabanhours + (jiabanminutes / 60); |
| | | orderDakaMingxiDto.TodaySalary += (jiabanshijian * 4); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | IsGuDing = true; |
| | | } |
| | | } |
| | | userDto.userWorker.IsLingHuoYongGong = IsGuDing; |
| | | decimal ab = (userDto.userWorker.TiXianZonge ?? 0) - (userDto.userWorker.YiTiXianJine ?? 0 ); |
| | | userDto.userWorker.Balance =ab < 0 ? 0 : ab; |
| | | if (IsGuDing) |
| | | if (userDto.userWorker != null) |
| | | userDto.userWorker.IsLingHuoYongGong = IsGuDing; |
| | | |
| | | decimal ab = (userDto.userWorker?.TiXianZonge ?? 0) - (userDto.userWorker?.YiTiXianJine ?? 0); |
| | | if (userDto.userWorker != null) |
| | | { |
| | | |
| | | userDto.userWorker.AvailableBalance = (ab-300)<0 ? 0 : (ab - 300); |
| | | userDto.userWorker.Balance = ab < 0 ? 0 : ab; |
| | | if (IsGuDing) |
| | | { |
| | | |
| | | userDto.userWorker.AvailableBalance = (ab - 300) < 0 ? 0 : (ab - 300); |
| | | |
| | | } |
| | | else |
| | | |
| | | userDto.userWorker.AvailableBalance = userDto.userWorker?.Balance ?? 0; |
| | | } |
| | | else |
| | | |
| | | userDto.userWorker.AvailableBalance = userDto.userWorker.Balance; |
| | | |
| | | |
| | | |
| | | |
| | | var userCompany = await userCompanyRes.GetFirstAsync(p => p.UserId == userid); |
| | | if (userCompany != null) |
| | |
| | | IsGuDing = true; |
| | | } |
| | | } |
| | | if(userDto.userWorker != null) |
| | | userDto.userWorker.IsLingHuoYongGong = IsGuDing; |
| | | |
| | | decimal ab = (userDto.userWorker.TiXianZonge ?? 0) - (userDto.userWorker.YiTiXianJine ?? 0); |
| | | userDto.userWorker.Balance = ab < 0 ? 0 : ab; |
| | | if (IsGuDing) |
| | | decimal ab = (userDto.userWorker?.TiXianZonge ?? 0) - (userDto.userWorker?.YiTiXianJine ?? 0); |
| | | if (userDto.userWorker != null) |
| | | { |
| | | userDto.userWorker.Balance = ab < 0 ? 0 : ab; |
| | | if (IsGuDing) |
| | | { |
| | | |
| | | userDto.userWorker.AvailableBalance = (ab - 300) < 0 ? 0 : (ab - 300); |
| | | userDto.userWorker.AvailableBalance = (ab - 300) < 0 ? 0 : (ab - 300); |
| | | |
| | | } |
| | | else |
| | | |
| | | userDto.userWorker.AvailableBalance = userDto.userWorker?.Balance ?? 0; |
| | | } |
| | | else |
| | | |
| | | userDto.userWorker.AvailableBalance = userDto.userWorker.Balance; |
| | | |
| | | |
| | | |