| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITCarBrandService carBrandService; |
| | | |
| | | @Autowired |
| | | private ITCarModelService carModelService; |
| | | |
| | | private List<TCompany> companys = null; |
| | | |
| | | |
| | | @Autowired |
| | | private ITOrderPrivateCarService itOrderPrivateCarService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private IDriverOnlineService driverOnlineService; |
| | | |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | |
| | | @RequestMapping("/openNetCarInfo") |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getSumData") |
| | | public Object getSumData(Integer companyId, Date addDate, Date start, Date end){ |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | Integer id = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(companyId == null && user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getDriverPosition") |
| | | public Object getDriverPosition(Integer companyId){ |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | Integer id = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(companyId == null && user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getCompanyInfoByUserId") |
| | | public Object getCompanyInfoByUserId(){ |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | companys = new ArrayList<>(); |
| | | List<TCompany> ids = new ArrayList<>(); |
| | | TCompany tCompany = null; |
| | | if(user.getRoleType() == 1 && user.getObjectId() == null){ |
| | | tCompany = tCompanyService.selectById(1); |
| | | }else{ |
| | | tCompany = tCompanyService.selectById(user.getObjectId()); |
| | | } |
| | | ids.add(tCompany); |
| | | companys.addAll(ids); |
| | | this.getCompanyIds(ids); |
| | | return companys; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | map.put("carModel", null != tCarModel ? tCarModel.getName() : ""); |
| | | map.put("order", tOrderTaxis); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | public void getCompanyIds(List<TCompany> ids){ |
| | | List<TCompany> ids_ = new ArrayList<>(); |
| | | for(TCompany id : ids){ |
| | | if(id.getId() == 1){ |
| | | List<TCompany> tCompanies = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("superiorId", id.getId()).or().isNull("superiorId").eq("state", 0).ne("flag", 3).ne("type", 1)); |
| | | ids_.addAll(tCompanies); |
| | | companys.addAll(tCompanies); |
| | | }else{ |
| | | List<TCompany> tCompanies = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("superiorId", id.getId()).eq("state", 0).ne("flag", 3)); |
| | | ids_.addAll(tCompanies); |
| | | companys.addAll(tCompanies); |
| | | } |
| | | } |
| | | if(ids_.size() == 0){ |
| | | return; |
| | | } |
| | | this.getCompanyIds(ids_); |
| | | } |
| | | |
| | | |