|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package org.jeecg.modules.demo.ttelectricmeter.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -25,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.jeecg.modules.demo.tteqtbase.entity.TtEqtBase;
|
|
|
|
|
import org.jeecg.modules.demo.tteqtbase.service.ITtEqtBaseService;
|
|
|
|
|
import org.jeecg.modules.demo.ttfeedingequip.entity.TtFeedingEquip;
|
|
|
|
|
import org.jeecg.modules.demo.ttmoldtemperatureequip.entity.TtMoldTemperatureEquip;
|
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
|
@ -59,7 +61,6 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
|
|
|
|
|
private ITtEqtBaseService ttEqtBaseService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "tt列表查询", notes = "tt列表查询")
|
|
|
|
|
@GetMapping(value = "/QueryElectricMeterList")
|
|
|
|
|
public Result<IPage<TtElectricMeter>> QueryElectricMeterList(TtElectricMeter ttElectricMeter,
|
|
|
|
@ -93,16 +94,18 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
|
|
|
|
|
Page<TtElectricMeter> page = new Page<TtElectricMeter>(pageNo, pageSize);
|
|
|
|
|
IPage<TtElectricMeter> pageList = ttElectricMeterService.page(page, queryWrapper);
|
|
|
|
|
List<TtElectricMeter> list = pageList.getRecords();
|
|
|
|
|
|
|
|
|
|
if (list.size() > 0) {
|
|
|
|
|
for (TtElectricMeter meter : list) {
|
|
|
|
|
QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>();
|
|
|
|
|
eqtBase.eq("eqt_no", meter.getEqtNo());
|
|
|
|
|
eqtBase.eq("eqt_type", 6);
|
|
|
|
|
eqtBase.eq("location", "数字电表");
|
|
|
|
|
TtEqtBase ttEqtBase = ttEqtBaseService.getOne(eqtBase);
|
|
|
|
|
if (ttEqtBase != null) {
|
|
|
|
|
meter.setLocation(ttEqtBase.getLocation());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Result.OK(pageList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -190,9 +193,33 @@ public class TtElectricMeterController extends JeecgController<TtElectricMeter,
|
|
|
|
|
* @param ttElectricMeter
|
|
|
|
|
*/
|
|
|
|
|
//@RequiresPermissions("ttelectricmeter:tt_electric_meter:exportXls")
|
|
|
|
|
// @RequestMapping(value = "/exportXls")
|
|
|
|
|
// public ModelAndView exportXls(HttpServletRequest request, TtElectricMeter ttElectricMeter) {
|
|
|
|
|
// return super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter");
|
|
|
|
|
// }
|
|
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, TtElectricMeter ttElectricMeter) {
|
|
|
|
|
return super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter");
|
|
|
|
|
ModelAndView modelAndView = super.exportXls(request, ttElectricMeter, TtElectricMeter.class, "tt_electric_meter");
|
|
|
|
|
Object model = modelAndView.getModel().get("data");
|
|
|
|
|
List<TtElectricMeter> list = new ArrayList<>();
|
|
|
|
|
if (model instanceof ArrayList<?>) {
|
|
|
|
|
for (Object o : (List<?>) model) {
|
|
|
|
|
list.add((TtElectricMeter) o);
|
|
|
|
|
}
|
|
|
|
|
if (list.size() > 0) {
|
|
|
|
|
for (TtElectricMeter Electric : list) {
|
|
|
|
|
QueryWrapper<TtEqtBase> eqtBase = new QueryWrapper<>();
|
|
|
|
|
eqtBase.eq("eqt_no", Electric.getEqtNo());
|
|
|
|
|
eqtBase.eq("eqt_type", 6);
|
|
|
|
|
eqtBase.eq("location", "数字电表");
|
|
|
|
|
TtEqtBase ttEqtBase = ttEqtBaseService.getOne(eqtBase);
|
|
|
|
|
if (ttEqtBase != null) {
|
|
|
|
|
Electric.setLocation(ttEqtBase.getLocation());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return modelAndView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|