| | |
| | | */ |
| | | package org.springblade.jfpt.healthcode.controller; |
| | | |
| | | import com.alibaba.nacos.common.utils.JacksonUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.healthcode.vo.healthcodeVO; |
| | | import org.springblade.jfpt.healthcode.wrapper.healthcodeWrapper; |
| | | import org.springblade.jfpt.parcel.util.JacksonUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | * 统计接口 |
| | | */ |
| | | @PostMapping("/selectCount") |
| | | public R selectCount(@RequestBody String type) { |
| | | public R selectCount(@RequestBody String type,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"); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | Date time = new Date(now.getYear(), now.getMonth(), now.getDate()); |
| | |
| | | if (1 == dayWeek) { |
| | | cal.add(Calendar.DAY_OF_MONTH, -1); |
| | | } |
| | | String type1 = type; |
| | | String substring = type1.substring(9, 10); |
| | | System.out.println(substring); |
| | | switch(substring){ |
| | | String dataType = JacksonUtil.parseString(type, "type"); |
| | | switch(dataType){ |
| | | case "0" : |
| | | //日 |
| | | String times = sdf.format(cal.getTime()); |
| | | System.out.println("times = " + times); |
| | | list=ihealthcodeService.selectCountr(times); |
| | | break; |
| | | case "1" : |