| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ServiceModel; |
| | | import com.whyc.dto.paramter.DateTimePar; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.BattInfService; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.HttpUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | return service.findBattProducerInfoByYearCode(yearCode,userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @PostMapping("/findBattProducerInfoByTime") |
| | | @ApiOperation(value = "根据电池使用时间段查询站点及电池品牌基础信息",notes = "") |
| | | public Response findBattProducerInfoByTime(@RequestBody DateTimePar dateTimePar){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | return service.findBattProducerInfoByTime(dateTimePar.getStartTime(),dateTimePar.getEndTime(),userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @GetMapping("/findBattInfByStationId") |
| | | @ApiOperation("根据机房id获取电池信息") |
| | | public Response findBattInfByStationId(@RequestParam String stationId){ |
| | |
| | | // } |
| | | // return response; |
| | | //} |
| | | @PostMapping("/uploadPicOfStation") |
| | | @ApiOperation("上传图片") |
| | | @ApiImplicitParam(name = "file", value = "上传的文件", dataTypeClass = MultipartFile.class, required = true,paramType = "form") |
| | | public Response uploadPicOfStation(@RequestPart("file") List<MultipartFile> file, @RequestParam String stationId){ |
| | | return service.uploadPicOfStation(file,stationId); |
| | | } |
| | | @PostMapping("/deletePic") |
| | | @ApiOperation("删除图片") |
| | | public Response deletePic(@RequestParam String stationId,@RequestParam List<String> fileNames){ |
| | | return service.deletePic(stationId,fileNames); |
| | | } |
| | | @PostMapping("/getStationPic") |
| | | @ApiOperation("获取站点图片") |
| | | public Response getStationPic(@RequestParam String stationId){ |
| | | return service.getStationPic(stationId); |
| | | } |
| | | |
| | | @GetMapping("getDeviceId") |
| | | @ApiOperation(value = "获取最大的设备id", notes = "旧:BattInfAction!getDeviceId") |
| | | public Response getDeviceId(@RequestParam Integer devId) { |
| | | return new Response().set(1, service.searchMaxDevId(devId)); |
| | | } |
| | | |
| | | @PutMapping("monCapWH") |
| | | @ApiModelProperty(value = "标称容量KWH修改", notes = "传入battGroupId和nomCapWH") |
| | | public Response updateMonCapWH(@RequestBody Battinf inf) { |
| | | return service.updateMonCapWH(inf); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询标称电压类别") |
| | | @GetMapping("searchMonVol") |
| | | public Response searchMonVol() { |
| | | return service.searchMonVol(); |
| | | } |
| | | |
| | | @GetMapping("searchBattGroupIdByDevId") |
| | | @ApiOperation(value = "根据设备id查询电池组id(取第一个)") |
| | | public Response searchBattGroupIdByDevId(@RequestParam int devId) { |
| | | return service.searchBattGroupIdByDevId(devId); |
| | | } |
| | | } |