|  | @@ -6,10 +6,15 @@ import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONArray;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.ruoyi.basicData.domain.FleetCarManage;
 | 
	
		
			
				|  |  | +import com.ruoyi.basicData.domain.TCorps;
 | 
	
		
			
				|  |  |  import com.ruoyi.basicData.mapper.FleetCarManageMapper;
 | 
	
		
			
				|  |  | +import com.ruoyi.basicData.mapper.TCorpsMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.AjaxResult;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.domain.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.model.LoginUser;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.redis.RedisCache;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.DateUtils;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.utils.SecurityUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.StringUtils;
 | 
	
		
			
				|  |  |  import com.ruoyi.orderPlan.domain.*;
 | 
	
		
			
				|  |  |  import com.ruoyi.orderPlan.mapper.*;
 | 
	
	
		
			
				|  | @@ -31,6 +36,9 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
 | 
	
		
			
				|  |  |  @Service
 | 
	
		
			
				|  |  |  public class FtmsorderbillsServiceImpl implements IftmsorderbillsService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | +    private TCorpsMapper tCorpsMapper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  |      private FtmsorderbillsMapper ftmsorderbillsMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
	
		
			
				|  | @@ -64,27 +72,35 @@ public class FtmsorderbillsServiceImpl implements IftmsorderbillsService {
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public AjaxResult queryHomeInfo() {
 | 
	
		
			
				|  |  |          Map<String, Object> map = new HashMap<>();
 | 
	
		
			
				|  |  | +        SysUser user = SecurityUtils.getLoginUser().getUser();
 | 
	
		
			
				|  |  | +        Ftmsorderbills ftmsorderbills = new Ftmsorderbills();
 | 
	
		
			
				|  |  | +        if ("22".equals(user.getUserType())) {
 | 
	
		
			
				|  |  | +            ftmsorderbills.setIsFleet("1");
 | 
	
		
			
				|  |  | +            TCorps corps = tCorpsMapper.selectTCorpsByFTel(user.getPhonenumber());
 | 
	
		
			
				|  |  | +            ftmsorderbills.setFleetId(corps.getfId());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          //  查询右上 所有已结单、未结单数据
 | 
	
		
			
				|  |  | -        map.put("upperRight", ftmsorderbillscarsMapper.selectHomeUpperRightMapList());
 | 
	
		
			
				|  |  | +        map.put("upperRight", ftmsorderbillscarsMapper.selectHomeUpperRightMapList(ftmsorderbills));
 | 
	
		
			
				|  |  |          // 查询右下 提醒数据
 | 
	
		
			
				|  |  |          map.put("lowerRight", null);
 | 
	
		
			
				|  |  |          // 查询左上
 | 
	
		
			
				|  |  |          List<String> currentDay = DateUtils.getCurrentDay();
 | 
	
		
			
				|  |  | -        map.put("upperLeftCntrs", ftmsorderbillscarsMapper.selectHomeUpperLeftCntrs(currentDay));
 | 
	
		
			
				|  |  | +        ftmsorderbills.setcurrentDay(currentDay);
 | 
	
		
			
				|  |  | +        map.put("upperLeftCntrs", ftmsorderbillscarsMapper.selectHomeUpperLeftCntrs(ftmsorderbills));
 | 
	
		
			
				|  |  |          // 今日派车数量
 | 
	
		
			
				|  |  | -        int carQuantity = ftmsorderbillscarsMapper.selectHomeUpperLeftCars(currentDay);
 | 
	
		
			
				|  |  | +        int carQuantity = ftmsorderbillscarsMapper.selectHomeUpperLeftCars(ftmsorderbills);
 | 
	
		
			
				|  |  |          map.put("upperLeftCarQuantity", carQuantity);
 | 
	
		
			
				|  |  |          FleetCarManage fleetCarManage = new FleetCarManage();
 | 
	
		
			
				|  |  | -        fleetCarManage.setBillStatus(6L);
 | 
	
		
			
				|  |  |          fleetCarManage.setDelFlag("0");
 | 
	
		
			
				|  |  | -        int carManageQuantity = fleetCarManageMapper.selectFleetCarManageCount(fleetCarManage);
 | 
	
		
			
				|  |  | +        fleetCarManage.setBillStatus(6L);
 | 
	
		
			
				|  |  | +        int carManageQuantity = fleetCarManageMapper.selectManageCount(ftmsorderbills);
 | 
	
		
			
				|  |  |          int carNumber = carManageQuantity - carQuantity;
 | 
	
		
			
				|  |  |          if (carNumber < 0) {
 | 
	
		
			
				|  |  |              carNumber = 0;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          map.put("upperLeftOldCarQuantity", carNumber);
 | 
	
		
			
				|  |  |          // 查询左下
 | 
	
		
			
				|  |  | -        map.put("lowerLeft", ftmsorderbillscarsMapper.selectHomeUpperRightMapList());
 | 
	
		
			
				|  |  | +        map.put("lowerLeft", ftmsorderbillscarsMapper.selectHomeUpperRightMapList(ftmsorderbills));
 | 
	
		
			
				|  |  |          return AjaxResult.success(map);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 |