Beispiel #1
0
 /// <summary>
 /// 营收推送营收金额时只推送(司机而且欠款的人员),其他人员不推送
 /// </summary>
 /// <param name="orgVguid"></param>
 ///  <param name="labName"></param>
 /// <returns></returns>
 public string[] GetRevenuePerson(Guid orgVguid, string labName)
 {
     using (var db = SugarDao_MsSql.GetInstance())
     {
         var            listUser       = new List <string>();
         ShortMsgServer shortMsgServer = new ShortMsgServer();
         var            list           = db.SqlQuery <Business_Personnel_Information>("exec usp_getOrganization_UserID @orgvguid", new { orgvguid = orgVguid }); //查找该部门下所有的司机
         if (!string.IsNullOrEmpty(labName))
         {
             var labArr = labName.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
             var query  = db.Queryable <Business_PersonnelLabel_Information>().In(i => i.LabelName, labArr).GroupBy(i => i.PersonnelVVGUID).Select(i => i.PersonnelVVGUID).ToList();
             list = list.Where(i => query.Contains(i.Vguid)).ToList();
         }
         foreach (var personModel in list)
         {
             var driverModel  = shortMsgServer.GetDriverMsg(personModel);
             var paymentModel = shortMsgServer.GetRevenueMsg(driverModel);
             if (paymentModel != null)
             {
                 var accountBalance = (paymentModel.PaidAmount - paymentModel.DueAmount + (paymentModel.DebtAmount * -1)).ToString("F2"); //本期结余
                 if (decimal.Parse(accountBalance) < 0)
                 {
                     listUser.Add(personModel.UserID);
                 }
             }
         }
         return(listUser.ToArray());
     }
 }
Beispiel #2
0
 /// <summary>
 ///  获取司机ID和车辆ID
 /// </summary>
 /// <param name="personModel"></param>
 /// <returns></returns>
 public Driver GetDriverMsg(Business_Personnel_Information personModel)
 {
     return(_ss.GetDriverMsg(personModel));
 }