| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SocreHehaviorDto; |
| | | import com.whyc.dto.Statistic.BattCompareStic; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.AppParamService; |
| | | import com.whyc.service.BattresdataInfService; |
| | | import com.whyc.service.BatttestdataInfService; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | @Autowired |
| | | private BattresdataInfService battRinfService; |
| | | |
| | | @Autowired |
| | | private AppParamService appParamService; |
| | | |
| | | @ApiOperation(value = "蓄电池组对比分析界面(同一时间同一品牌/同一时间不同一品牌/不同一时间同一品牌)(1.2.15/16/17)") |
| | | @ApiOperation(value = "蓄电池组对比分析界面(同一时间同一品牌/同一时间不同一品牌/不同一时间同一品牌)(2.5.1/2/3)") |
| | | @PostMapping("getBattCompare15Statistic") |
| | | public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic) throws ParseException { |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | if(stic.getInuserYear()!=null){ |
| | | if(stic.getInuseYear()!=null){ |
| | | int year=ActionUtil.getNowYear(); |
| | | stic.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-stic.getInuserYear(),0,1,5))); |
| | | stic.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-stic.getInuseYear(),0,1,5))); |
| | | stic.setInuseEndTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year,11,31,5))); |
| | | } |
| | | return battTinfService.getBattCompare15Statistic(stic); |
| | |
| | | public Response getMonResChangeByBattgroupId(@RequestParam Integer battgroupId,@RequestParam Integer monNum){ |
| | | return battRinfService.getMonResChangeByBattgroupId(battgroupId,monNum); |
| | | } |
| | | |
| | | @ApiOperation(value = "弹窗根据设置的权重表格评分") |
| | | @PostMapping("getScoreByHehavior") |
| | | public Response getScoreByHehavior(@RequestBody SocreHehaviorDto dto) throws ParseException { |
| | | User uinf= ActionUtil.getUser(); |
| | | dto.setUid(uinf.getId()); |
| | | if(dto.getInuseYear()!=null){ |
| | | int year=ActionUtil.getNowYear(); |
| | | dto.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-dto.getInuseYear(),0,1,5))); |
| | | dto.setInuseEndTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year,11,31,5))); |
| | | } |
| | | if (dto.getProduct()!=null) { |
| | | if(dto.getInuseYear()!=null){ |
| | | dto.setSelectType(1); |
| | | }else{ |
| | | dto.setSelectType(2); |
| | | } |
| | | }else{ |
| | | if(dto.getInuseYear()!=null){ |
| | | dto.setSelectType(3); |
| | | }else{ |
| | | dto.setSelectType(4); |
| | | } |
| | | } |
| | | return battTinfService.getScoreByHehavior(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置权重(1.2.16)") |
| | | @PostMapping("setHehavior") |
| | | public Response setHehavior(@RequestBody List<AppParam> List){ |
| | | return appParamService.setHehavior(List); |
| | | } |
| | | |
| | | @ApiOperation(value = "读取权重(1.2.16)") |
| | | @GetMapping("getHehavior") |
| | | public Response getHehavior(){ |
| | | return appParamService.getHehavior(); |
| | | } |
| | | } |