| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.jfpt.animalheat.vo.AnimalHeatExcel; |
| | | import org.springblade.jfpt.animalheat.entity.BladeAnimalHeat; |
| | | import org.springblade.jfpt.animalheat.service.AnimalHeatService; |
| | | import org.springblade.jfpt.animalheat.vo.AnimalHeatVo; |
| | | import org.springblade.jfpt.animalheat.vo.StatisVo; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAnimalStatis") |
| | | public List<StatisVo> getAnimalStatis(AnimalHeatVo animalHeatVo){ |
| | | return animalHeatService.getAnimalStatis(animalHeatVo); |
| | | public R getAnimalStatis(AnimalHeatVo animalHeatVo,HttpServletResponse response){ |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(animalHeatService.getAnimalStatis(animalHeatVo)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 体温数据的分页数据 |
| | | * @param animalHeatVo 查询条件 |
| | | * 体温数据的分页数据--图表的点击事件 |
| | | * @param animalHeatVo 查询条件 包含时间状态type 0:本日 1:本周 2:本月 |
| | | * @param query 查询页码 |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | public R<IPage<BladeAnimalHeat>> page(AnimalHeatVo animalHeatVo, Query query) { |
| | | public R<IPage<BladeAnimalHeat>> page(AnimalHeatVo animalHeatVo, Query query,HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(animalHeatService.selectAnimalHeatPage(Condition.getPage(query), animalHeatVo)); |
| | | } |
| | | |
| | | /** |
| | | * 查询本周每天的体温数据数量 |
| | | * @return |
| | | */ |
| | | @GetMapping("/selWeekDayAnimalStatis") |
| | | public R selWeekDayAnimalStatis(HttpServletResponse response){ |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(animalHeatService.selWeekDayAnimalStatis()); |
| | | } |
| | | |
| | | /** |
| | | * 导出体温数据列表 |
| | | * @param animalHeatVo 条件 |
| | | * @param response 返回域 |
| | | */ |
| | | @GetMapping("/export-animalHeat") |
| | | public void exportAnimalHeat(AnimalHeatVo animalHeatVo,HttpServletResponse response){ |
| | | List<AnimalHeatExcel> list = animalHeatService.exportAnimalHeat(animalHeatVo); |
| | | ExcelUtil.export(response, "体温检测数据" + DateUtil.time(), "体温检测数据表", list, AnimalHeatExcel.class); |
| | | } |
| | | |
| | | } |