package com.steerinfo.meterwork.meterworkparammap.controller;

import com.steerinfo.framework.controller.BaseRESTfulController;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.service.pagehelper.PageHelper;
import com.steerinfo.framework.service.pagehelper.PageList;
import com.steerinfo.meterwork.meterworkparammap.service.impl.MeterWorkParamMapService;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/${api.version}/meterworkparammaps")
public class MeterWorkParamMap extends BaseRESTfulController {

    @Resource
    private MeterWorkParamMapService meterWorkParamMapService;

    @ApiOperation(value="查询监控表信息、最近一次计量数据、未使用和使用中的委托、结净数据、委托信息", notes="返回List<HashMap>对象")
    @PostMapping(value = "combinationByParams")
    public RESTfulResult combinationByParams(@RequestBody HashMap params) {
        RESTfulResult rm = failed();
        try {
            rm = meterWorkParamMapService.combinationByParams(params);
        }catch (Exception e) {
            e.printStackTrace();
            rm.setMessage("操作异常:>>>" + e.getMessage());
        }
        return rm;
    }
}
