| | |
| | | |
| | | 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; |
| | | |
| | | @RequestMapping("battInf") |
| | | @RestController |
| | | @Api(tags = "数据管理-电池信息") |
| | | public class BattInfController { |
| | | public class BattInfController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private BattInfService service; |
| | |
| | | UserInf userInf = (UserInf) ActionUtil.getUser(); |
| | | return service.searchStationNameInGroup(userInf.getUId().intValue(), stationName1); |
| | | } |
| | | @GetMapping("/searchStationNameInGroup2") |
| | | @ApiOperation(value = "查询用户管理下的机房",notes = "原serchStationNameInGroup接口,返回stationName") |
| | | public Response searchBattGroupByStationName2(@RequestParam(required = false)String stationName1){ |
| | | UserInf userInf = (UserInf) ActionUtil.getUser(); |
| | | return service.searchStationNameInGroup2(userInf.getUId().intValue(), stationName1); |
| | | } |
| | | |
| | | @GetMapping("/searchInform") |
| | | @ApiOperation(value = "电池组信息配置中查询所有的电池组信息") |
| | | public Response searchInform(@RequestParam int pageNum,@RequestParam int pageSize,@RequestParam(required = false)String stationName1,@RequestParam(required = false)String stationName2,@RequestParam(required = false)String stationName5,@RequestParam(required = false)String stationName3){ |
| | |
| | | return service.add(battinf,userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @PostMapping("delete") |
| | | @ApiOperation(value = "删除电池组") |
| | | public Response delete(@RequestParam Integer battgroupId){ |
| | | service.deleteByBattgroupId(battgroupId); |
| | | return new Response().setII(1,"删除成功"); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PostMapping("update") |
| | | @ApiOperation(value = "更新电池组") |
| | | public Response update(@RequestBody Battinf battinf){ |
| | | return service.update(battinf); |
| | | } |
| | | |
| | | @PutMapping("/updateList") |
| | | @PostMapping("/updateList") |
| | | @ApiOperation(value = "更新电池组List") |
| | | public Response updateList(@RequestBody List<Battinf> battinfs){ |
| | | return service.updateList(battinfs); |
| | | } |
| | | |
| | | |
| | | @PutMapping("/updatePubByDevId") |
| | | @PostMapping("/updatePubByDevId") |
| | | @ApiOperation(value = "根据设备id修改PublicKeyY值") |
| | | public Response updatePubByDevId(@RequestParam String publicKeyY,@RequestParam Integer deviceId){ |
| | | return service.updatePublicKeyByDevId(publicKeyY,deviceId); |
| | | } |
| | | |
| | | @PutMapping("/updateIP") |
| | | @PostMapping("/updateIP") |
| | | @ApiOperation(value = "更新电池组网关等信息",notes = "todo还需向设备发送相关指令和服务需重启") |
| | | public Response updateIp(@RequestBody Battinf battinf){ |
| | | //todo Fbs9100_setparamImpl().sendCmdToFBS9100Dev |
| | |
| | | public Response findBattProducerInfoByYearCode(@RequestParam int yearCode){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | 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") |
| | |
| | | // } |
| | | // 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)); |
| | | } |
| | | |
| | | @GetMapping("setKeyIdWithDeviceId") |
| | | @ApiOperation(value = "keyid绑定设备id", notes = "旧:BattInfAction!getDeviceId") |
| | | public Response setKeyIdWithDeviceId(@RequestParam Integer devId,@RequestParam String keyId) { |
| | | return service.setKeyIdWithDeviceId(devId,keyId); |
| | | } |
| | | |
| | | @PostMapping("updateMonCapWH") |
| | | @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); |
| | | } |
| | | } |