package org.jeecg.modules.newWarning.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.dataVue.service.IMasterService;
import org.jeecg.modules.newWarning.entity.NewWarnHistory;
import org.jeecg.modules.newWarning.entity.RecalculateWarn;
import org.jeecg.modules.newWarning.params.RecalculateWarnParams;
import org.jeecg.modules.newWarning.service.RecalculateWarnService;
import org.jeecg.modules.newWarning.service.TabQiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

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

@RestController
@RequestMapping("/recalculate")
public class RecalculateController {

    @Resource
    private RecalculateWarnService recalculateWarnService;

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    /**
     * 
     * @param jh
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("/getList")
    public Result<?> recalculateWarn(@RequestParam("jh")String jh,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
        QueryWrapper<RecalculateWarn> wrapper =new QueryWrapper<>();
        if(jh!=null&& !Objects.equals(jh, "")){
            wrapper.eq("jh",jh);
        }
        Page<RecalculateWarn> page=new Page<RecalculateWarn>(pageNo, pageSize);
        Page<RecalculateWarn> pagelist = recalculateWarnService.page(page, wrapper);
        return Result.OK(pagelist);
    }
}
