| | |
| | | import com.fgkj.services.User_logService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @RequestMapping("battDevDischarge") |
| | | @RestController |
| | | @Api(tags = "battDevDischarge接口") |
| | | @Api(tags = "battDevDischarge接口 TODO") |
| | | public class Batt_DevdischargeController{ |
| | | |
| | | @Resource |
| | |
| | | private User_logService uservice; |
| | | |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="新增") |
| | | @ApiOperation(notes = "{ \"dev_id\": 0, \"dev_name\": \"dev_name\", \"dev_recordtime\": \"2021-01-07 08:16:26\", \"dev_vol\": 0.0, \"dev_curr\": 0.0, \"dev_power\": 0.0, \"note\": \"c\" }",value="新增") |
| | | public ServiceModel add(@RequestBody Batt_Devdischarge bd){ |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.add(bd); |
| | | { |
| | | String msg="添加对"+bd.getDev_name()+"设备的记录"; |
| | |
| | | } |
| | | |
| | | @PutMapping("/") |
| | | @ApiOperation(notes = "",value="修改") |
| | | @ApiOperation(notes = "{ \"num\": 33308, \"dev_id\": 0, \"dev_name\": \"\", \"dev_recordtime\": \"2021-01-07 08:16:26\", \"dev_vol\": 0.0, \"dev_curr\": 0.0, \"dev_power\": 0.0, \"note\": \"\" }",value="修改") |
| | | public ServiceModel update(@RequestBody Batt_Devdischarge bd){ |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.update(bd); |
| | |
| | | |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "",value="删除") |
| | | public ServiceModel del(@RequestBody Batt_Devdischarge bd){ |
| | | public ServiceModel del(@RequestParam Integer num){ |
| | | Batt_Devdischarge bd= new Batt_Devdischarge(); |
| | | bd.setNum(num); |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.del(bd); |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("all") |
| | | @ApiOperation(notes = "",value="all") |
| | | @ApiOperation(notes = "数据较大,是否分页?Total: 33297",value="all") |
| | | public ServiceModel searchAll(){ |
| | | ServiceModel model = service.searchAll(); |
| | | |
| | |
| | | /* |
| | | * 记录时间放在battinf的battproducer |
| | | * 统计类型放在moncount中: 1:电压,2电流,3功率*/ |
| | | @GetMapping("byCondition") |
| | | public ServiceModel serchByCondition(@RequestBody BattInf binf){ |
| | | // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "记录时间放在battinf的battproducer 统计类型放在moncount中:1:电压,2电流,3功率", value = "设备id连battinf和batt_devdischarge表") |
| | | public ServiceModel serchByCondition(@ApiParam(value = "设备id 42010007", required = true) @RequestParam String stationId, @ApiParam(value = "生产日期段 格式2000/01/28 08:22:34", required = true) @RequestParam Date battProductDate, @ApiParam(value = "生产日期段", required = true) @RequestParam Date battProductDate1) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationId(stationId); |
| | | binf.setBattProductDate(battProductDate); |
| | | binf.setBattProductDate1(battProductDate1); |
| | | //System.out.println(binf); |
| | | ServiceModel model = service.serchByCondition(binf); |
| | | |