| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.MeteringPlan; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.service.MeteringPlanService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private Jwt jwt; |
| | | @ApiOperation(value = "计量计划-->新增按钮") |
| | | @PostMapping("/add_plan") |
| | | public Result<?> addMeteringPlan(@RequestHeader("token") String token,@Validated @RequestBody MeteringPlan meteringPlan) throws Exception { |
| | | public Result<?> addMeteringPlan(@RequestHeader("token") String token, @Validated @RequestBody MeteringPlan meteringPlan) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | String id = data.get("id").replaceAll("\"", ""); |
| | | meteringPlan.setFounder(Integer.valueOf(id)); |
| | |
| | | }) |
| | | @GetMapping("/metering_table") |
| | | public Result<?> selectMeteringTable(Integer pageNo, Integer pageSize, String code, String meteringUnit){ |
| | | pageNo = (pageNo - 1) * pageSize; |
| | | Map<String, Object> maps = meteringPlanService.selectMeteringTable(pageNo, pageSize, code, meteringUnit); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation(value = "计量计划<-->计量台账:查看计量履历") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "条数/页", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "measureId", value = "计量Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "accountOrPlan", value = "true为台账|false为计划", dataTypeClass = Boolean.class, required = true), |
| | | }) |
| | | @GetMapping("/list_record") |
| | | public Result<?> standingBook(Integer measureId, Boolean accountOrPlan){ |
| | | Object maps = meteringPlanService.standingBook(measureId, accountOrPlan); |
| | | public Result<?> standingBook(Integer pageNo, Integer pageSize, Integer measureId, Boolean accountOrPlan){ |
| | | Object maps = meteringPlanService.standingBook(pageNo, pageSize, measureId, accountOrPlan); |
| | | return Result.success(maps); |
| | | } |
| | | |