| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | List<DriverActivityHistory> historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",1).eq("activityId",driverActivityRegistered.getId()).eq("carryOut",2)); |
| | | Double totalMOney=0d; |
| | | Double money=0d; |
| | | Integer number=0; |
| | | Integer number=historyList.stream().map(DriverActivityHistory::getDriverId).collect(Collectors.toSet()).size(); |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money1",money); |
| | | map.put("number1",number); |
| | |
| | | //统计邀请用户注册 |
| | | historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",2).eq("activityId",driverActivityRegistered.getId()).eq("carryOut",2)); |
| | | money=0d; |
| | | number=0; |
| | | number=historyList.stream().map(DriverActivityHistory::getDriverId).collect(Collectors.toSet()).size(); |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money2",money); |
| | | map.put("number2",number); |
| | |
| | | //统计专车在线 |
| | | historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",3).eq("activityId",driverActivityOnline.getId()).eq("carryOut",2)); |
| | | money=0d; |
| | | number=0; |
| | | number=historyList.stream().map(DriverActivityHistory::getDriverId).collect(Collectors.toSet()).size(); |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money3",money); |
| | | map.put("number3",number); |
| | |
| | | //统计订单数 |
| | | historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",4).eq("activityId",driverActivityOrder.getId()).eq("carryOut",2)); |
| | | money=0d; |
| | | number=0; |
| | | number=historyList.stream().map(DriverActivityHistory::getDriverId).collect(Collectors.toSet()).size(); |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money6",money); |
| | | map.put("number6",number); |