| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCompany; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityDiscount1Service; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserRedPacketRecordService; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private IUserActivityDiscount1Service userActivityDiscount1Service; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/showOperationalData") |
| | | public String showOperationalData(Model model){ |
| | | List<TCompany> tCompanies = companyService.selectList(new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3)); |
| | | Wrapper<TCompany> wrapper = new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3); |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(user.getRoleType() != 1){ |
| | | wrapper.eq("id", user.getObjectId()); |
| | | } |
| | | List<TCompany> tCompanies = companyService.selectList(wrapper); |
| | | model.addAttribute("company", tCompanies); |
| | | return PREFIX + "operationalData.html"; |
| | | } |
| | |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | | } |
| | | return companyService.queryOperationalData(type, start, end, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | | } |
| | | HSSFWorkbook hssfWorkbook = companyService.downloadOperationalData(type, start, end, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("日常运营数据汇总表.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |