导出功能
This commit is contained in:
parent
d66f30d91e
commit
77e7c3b414
|
|
@ -16,7 +16,7 @@ public class DeviceExportVo {
|
|||
private String id;
|
||||
|
||||
@Excel(name = "设备类型", width = 20.0,height = 15.0,orderNum = "1")
|
||||
private String deviceType;
|
||||
private String deviceTypeName;
|
||||
|
||||
@Excel(name = "设备名称", width = 20.0,height = 15.0,orderNum = "2")
|
||||
private String deviceName;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class AttributeVo
|
|||
|
||||
/** 数据采集日期 */
|
||||
@Excel(name = "数据采集日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dataTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bonus.bracelet.mapper.BaseProjectMapper;
|
||||
import com.bonus.bracelet.service.IBaseProjectService;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.ProjectExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.BaseProject;
|
||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
|
|
@ -13,14 +19,18 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -37,6 +47,8 @@ public class BaseProjectController extends BaseController
|
|||
@Autowired
|
||||
private IBaseProjectService projectService;
|
||||
|
||||
@Autowired
|
||||
private BaseProjectMapper projectMapper;
|
||||
/**
|
||||
* 获取项目列表
|
||||
*/
|
||||
|
|
@ -125,4 +137,35 @@ public class BaseProjectController extends BaseController
|
|||
log.error(e.toString(),e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("exportProjectSome")
|
||||
public void exportProjectSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids) {
|
||||
try {
|
||||
List<ProjectExportVo> projectExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
int[] num = new int[idAll.length];
|
||||
for (int i = 0; i < idAll.length; i++) {
|
||||
num[i] = Integer.parseInt(idAll[i]);
|
||||
}
|
||||
List<BaseProject> projectLists = projectMapper.getProjectSomeLists(num);
|
||||
for (int i = 0; i < projectLists.size(); i++) {
|
||||
ProjectExportVo exportVo = new ProjectExportVo();
|
||||
BaseProject vo = projectLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
projectExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("项目部管理表", "项目部管理表", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ProjectExportVo.class, projectExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("项目部管理表" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,33 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.bracelet.mapper.BraceletMapper;
|
||||
import com.bonus.bracelet.service.IBraceletService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.ShExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.*;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +41,8 @@ public class BraceletController extends BaseController {
|
|||
@Resource(name = "IBraceletService")
|
||||
private IBraceletService braceletservice;
|
||||
|
||||
@Resource(name = "BraceletMapper")
|
||||
private BraceletMapper braceletMapper;
|
||||
|
||||
/**
|
||||
* 展示手环列表
|
||||
|
|
@ -288,4 +303,46 @@ public class BraceletController extends BaseController {
|
|||
return braceletservice.delDeviceAttribute(vo.getId());
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("exportShSome")
|
||||
public void exportShSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids) {
|
||||
try {
|
||||
List<ShExportVo> shExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
int[] num = new int[idAll.length];
|
||||
for (int i = 0; i < idAll.length; i++) {
|
||||
num[i] = Integer.parseInt(idAll[i]);
|
||||
}
|
||||
List<BraceletVo> shLists = braceletMapper.getShSomeLists(num);
|
||||
for (int i = 0; i < shLists.size(); i++) {
|
||||
if(shLists.get(i).getShPersonType()==0){
|
||||
String name = braceletMapper.getBraceletPersonName(shLists.get(i).getShPersonId());
|
||||
shLists.get(i).setShPersonName(name);
|
||||
}else if(shLists.get(i).getShPersonType()==1){
|
||||
String name = braceletMapper.getDeviceLyPersonNameTemp(shLists.get(i).getShPersonId());
|
||||
shLists.get(i).setShPersonName(name);
|
||||
}
|
||||
if(shLists.get(i).getShboxName()==null || shLists.get(i).getShboxName().equals("")){
|
||||
shLists.get(i).setShboxName("未绑定");
|
||||
}
|
||||
ShExportVo exportVo = new ShExportVo();
|
||||
BraceletVo vo = shLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setShStatus(vo.getShStatus() == BusinessConstants.TYPE3 ? "在用" : vo.getShStatus() == BusinessConstants.TYPE ? "未用" : "其他");
|
||||
shExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("手环", "手环", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ShExportVo.class, shExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("手环" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,34 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.bracelet.mapper.DeviceMapper;
|
||||
import com.bonus.bracelet.service.IDeviceService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.exportVo.DeviceExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.*;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +42,8 @@ public class DeviceController extends BaseController {
|
|||
@Resource(name = "IDeviceService")
|
||||
private IDeviceService deviceservice;
|
||||
|
||||
|
||||
@Resource(name = "DeviceMapper")
|
||||
private DeviceMapper deviceMapper;
|
||||
/**
|
||||
* 展示设备列表
|
||||
* @param data
|
||||
|
|
@ -143,4 +157,43 @@ public class DeviceController extends BaseController {
|
|||
return deviceservice.delDeviceAttribute(vo.getId());
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("exportDeviceSome")
|
||||
public void exportDeviceSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids) {
|
||||
try {
|
||||
List<DeviceExportVo> deviceExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
List<DeviceVo> deviceLists = deviceMapper.getDeviceSomeLists(idAll);
|
||||
for (int i = 0; i < deviceLists.size(); i++) {
|
||||
DeviceExportVo exportVo = new DeviceExportVo();
|
||||
if(deviceLists.get(i).getLyType()==0){
|
||||
String name = deviceMapper.getDeviceLyName(deviceLists.get(i).getLyId());
|
||||
deviceLists.get(i).setLyName(name);
|
||||
}else if(deviceLists.get(i).getLyType()==1){
|
||||
String name = deviceMapper.getDeviceLyNameTemp(deviceLists.get(i).getLyId());
|
||||
deviceLists.get(i).setLyName(name);
|
||||
}
|
||||
DeviceVo vo = deviceLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setDeviceName(vo.getDeviceName());
|
||||
exportVo.setDeviceTypeName(vo.getDeviceTypeName());
|
||||
exportVo.setDeviceCode(vo.getDeviceCode());
|
||||
exportVo.setLyName(vo.getLyName());
|
||||
exportVo.setDeviceStatus(vo.getDeviceStatus() == BusinessConstants.TYPE3 ? "在用" : vo.getDeviceStatus() == BusinessConstants.TYPE ? "未用" : "其他");
|
||||
deviceExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("设备", "设备", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, DeviceExportVo.class, deviceExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("设备" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.bracelet.mapper.EngineeringMapper;
|
||||
import com.bonus.bracelet.service.IEngineeringService;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.utils.UploadCheckUtils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.EngineeringExportVo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.GtExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.DeviceVo;
|
||||
import com.bonus.common.entity.bracelet.vo.EngineeringVo;
|
||||
import com.bonus.common.entity.bracelet.vo.GtVo;
|
||||
|
|
@ -13,13 +20,17 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -34,6 +45,8 @@ public class EngineeringController extends BaseController {
|
|||
@Resource(name = "IEngineeringService")
|
||||
private IEngineeringService service;
|
||||
|
||||
@Resource(name = "EngineeringMapper")
|
||||
private EngineeringMapper Mapper;
|
||||
|
||||
/**
|
||||
* 工程列表
|
||||
|
|
@ -147,4 +160,66 @@ public class EngineeringController extends BaseController {
|
|||
return service.excelUpload(file, request, response,proId);
|
||||
}
|
||||
|
||||
@GetMapping("exportEngineeringSome")
|
||||
public void exportEngineeringSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids) {
|
||||
try {
|
||||
List<EngineeringExportVo> engineeringExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
int[] num = new int[idAll.length];
|
||||
for (int i = 0; i < idAll.length; i++) {
|
||||
num[i] = Integer.parseInt(idAll[i]);
|
||||
}
|
||||
List<EngineeringVo> engineeringLists = Mapper.getEngineeringSomeLists(num);
|
||||
for (int i = 0; i < engineeringLists.size(); i++) {
|
||||
EngineeringExportVo exportVo = new EngineeringExportVo();
|
||||
EngineeringVo vo = engineeringLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
engineeringExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("工程", "工程", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, EngineeringExportVo.class, engineeringExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("工程" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("exportGtSome")
|
||||
public void exportGtSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids, @RequestParam(value = "proId") String proId ) {
|
||||
try {
|
||||
List<GtExportVo> gtExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
int[] num = new int[idAll.length];
|
||||
for (int i = 0; i < idAll.length; i++) {
|
||||
num[i] = Integer.parseInt(idAll[i]);
|
||||
}
|
||||
int pro = Integer.parseInt(proId);
|
||||
List<GtVo> gtLists = Mapper.getExportGtSomeLists(num,pro);
|
||||
for (int i = 0; i < gtLists.size(); i++) {
|
||||
GtExportVo exportVo = new GtExportVo();
|
||||
GtVo vo = gtLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
gtExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("杆塔", "杆塔", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, GtExportVo.class, gtExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("杆塔" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,34 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.bracelet.mapper.EngineeringMapper;
|
||||
import com.bonus.bracelet.service.IEquipmentReqService;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.exportVo.EngineeringExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.EngineeringVo;
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqDataVo;
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -32,7 +46,8 @@ public class EquipmentReqController extends BaseController {
|
|||
@Resource(name = "IEquipmentReqService")
|
||||
private IEquipmentReqService service;
|
||||
|
||||
// @RequiresPermissions("basic:equipmentReq:list")
|
||||
|
||||
// @RequiresPermissions("basic:equipmentReq:list")
|
||||
@GetMapping("list")
|
||||
@SysLog(title = "施工管控", businessType = OperaType.QUERY,logType = 0,module = "施工管控->设备领用",details ="查询设备领用列表")
|
||||
public TableDataInfo list(BraceletParamsDto dto) {
|
||||
|
|
@ -66,4 +81,5 @@ public class EquipmentReqController extends BaseController {
|
|||
public AjaxResult returnDevice(@RequestBody BraceletParamsDto dto) {
|
||||
return service.returnDevice(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class ExportFileController {
|
|||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setDeviceName(vo.getDeviceName());
|
||||
exportVo.setDeviceType(vo.getDeviceType());
|
||||
exportVo.setDeviceTypeName(vo.getDeviceTypeName());
|
||||
exportVo.setDeviceCode(vo.getDeviceCode());
|
||||
exportVo.setLyName(vo.getLyName());
|
||||
exportVo.setDeviceStatus(vo.getDeviceStatus() == BusinessConstants.TYPE3 ? "在用" : vo.getDeviceStatus() == BusinessConstants.TYPE ? "未用" : "其他");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.bracelet.mapper.QueryConstructionMapper;
|
||||
import com.bonus.bracelet.service.IQueryConstructionService;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.QueryConstructionExportVo;
|
||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
import com.bonus.common.entity.bracelet.vo.SidebandDeviceVo;
|
||||
|
|
@ -13,13 +19,16 @@ import com.bonus.common.log.annotation.SysLog;
|
|||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -36,6 +45,8 @@ public class QueryConstructionController extends BaseController
|
|||
@Autowired
|
||||
private IQueryConstructionService constructionService;
|
||||
|
||||
@Autowired
|
||||
private QueryConstructionMapper constructionMapper;
|
||||
/**
|
||||
* 获取项目列表
|
||||
*/
|
||||
|
|
@ -105,4 +116,37 @@ public class QueryConstructionController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("exportConstructionRecordSome")
|
||||
public void exportConstructionRecordSome(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "ids") String ids) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
List<QueryConstructionExportVo> queryConstructionExportVoList = new ArrayList<>();
|
||||
String[] idAll = ids.split(",");
|
||||
int[] num = new int[idAll.length];
|
||||
for (int i = 0; i < idAll.length; i++) {
|
||||
num[i] = Integer.parseInt(idAll[i]);
|
||||
}
|
||||
List<QueryConstruction> queryConstructionLists = constructionMapper.getConstructionSomeLists(num);
|
||||
for (int i = 0; i < queryConstructionLists.size(); i++) {
|
||||
QueryConstructionExportVo exportVo = new QueryConstructionExportVo();
|
||||
QueryConstruction vo = queryConstructionLists.get(i);
|
||||
BeanUtils.copyProperties(vo, exportVo);
|
||||
exportVo.setId((i + 1) + "");
|
||||
exportVo.setTeamLeader(vo.getTeamLeader()+ "\\" +vo.getTeamPhone());
|
||||
exportVo.setLyTime(sdf.format(vo.getLyTime()));
|
||||
queryConstructionExportVoList.add(exportVo);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams("施工记录", "施工记录", ExcelType.XSSF);
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, QueryConstructionExportVo.class, queryConstructionExportVoList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("施工记录" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bracelet.mapper;
|
||||
|
||||
import com.bonus.common.entity.bracelet.vo.BaseProject;
|
||||
import com.bonus.common.entity.bracelet.vo.EngineeringVo;
|
||||
import com.bonus.common.entity.file.ResourceFileVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
|
@ -68,4 +69,11 @@ public interface BaseProjectMapper
|
|||
public void deleteFileId(String filePath);
|
||||
|
||||
public List<String> selectFilePathById(int projectId);
|
||||
|
||||
/**
|
||||
* 批量导出项目部数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<BaseProject> getProjectSomeLists(int[] ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,4 +263,10 @@ public interface BraceletMapper {
|
|||
|
||||
void deleFileSource(Long id);
|
||||
|
||||
/**
|
||||
* 批量导出手环数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<BraceletVo> getShSomeLists(int[] ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,4 +170,10 @@ public interface DeviceMapper {
|
|||
|
||||
void deleFileSource(Long id);
|
||||
|
||||
/**
|
||||
* 批量导出设备数据
|
||||
* @param deviceCodes
|
||||
* @return
|
||||
*/
|
||||
public List<DeviceVo> getDeviceSomeLists(String[] deviceCodes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.bracelet.mapper;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.bracelet.vo.*;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -126,5 +127,17 @@ public interface EngineeringMapper {
|
|||
@MapKey("id")
|
||||
List<Map<String, String>> gtCodeIsExist(GtVo vo);
|
||||
|
||||
/**
|
||||
* 批量导出工程数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<EngineeringVo> getEngineeringSomeLists(int[] ids);
|
||||
|
||||
/**
|
||||
* 批量导出杆塔数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<GtVo> getExportGtSomeLists(@Param("ids") int[] ids, @Param("proId") int proId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package com.bonus.bracelet.mapper;
|
||||
|
||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||
import com.bonus.common.entity.bracelet.vo.QueryConstruction;
|
||||
import com.bonus.common.entity.bracelet.vo.SidebandDeviceVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.common.entity.bracelet.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -43,5 +40,10 @@ public interface QueryConstructionMapper
|
|||
*/
|
||||
List<WarnInfoVo> getWarnLists(QueryConstruction data);
|
||||
|
||||
|
||||
/**
|
||||
* 批量导出施工记录数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public List<QueryConstruction> getConstructionSomeLists(int[] ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
package com.bonus.bracelet.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.bracelet.mapper.EngineeringMapper;
|
||||
import com.bonus.bracelet.service.IEngineeringService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.utils.ExcelStyleUtil;
|
||||
import com.bonus.common.core.utils.ImportExcelUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.bracelet.exportVo.EngineeringExportVo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.GtExportVo;
|
||||
import com.bonus.common.entity.bracelet.exportVo.PersonExportVo;
|
||||
import com.bonus.common.entity.bracelet.importVo.GtImportVo;
|
||||
|
|
@ -16,16 +21,21 @@ import com.bonus.common.security.utils.ValidatorsUtils;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
|
@ -388,4 +398,5 @@ public class EngineeringServiceImpl implements IEngineeringService {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,4 +119,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_file_source
|
||||
where source_id = #{projectId} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="getProjectSomeLists" resultMap="BaseProjectResult">
|
||||
select a.id, depart_name, head_name, contact_information,count(b.source_id) as appnum, remarks,a.create_user,a.update_user
|
||||
from tb_project_depart a
|
||||
left join sys_file_source b on a.id = b.source_id and b.source_type = 5 and b.del_flag = 0
|
||||
where
|
||||
a.del_flag = 0
|
||||
and a.id in
|
||||
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
group by a.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -193,20 +193,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into tb_dev_details(
|
||||
<if test="shId != null">dev_id,</if>
|
||||
<if test="dataName != null and dataName != ''">data_name,</if>
|
||||
<if test="dataVal != null and dataVal != ''">data_val,</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">data_val,</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">data_unit,</if>
|
||||
<if test="dataCode != null and dataCode != ''">data_code,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="dataTime != null ">data_time,</if>
|
||||
<!-- <if test="dataTime != null ">data_time,</if>-->
|
||||
dev_type,del_flag
|
||||
)values(
|
||||
<if test="shId != null">#{shId},</if>
|
||||
<if test="dataName != null and dataName != ''">#{dataName},</if>
|
||||
<if test="dataVal != null and dataVal != ''">#{dataVal},</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">#{dataVal},</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">#{dataUnit},</if>
|
||||
<if test="dataCode != null and dataCode != ''">#{dataCode},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="dataTime != null ">#{dataTime},</if>
|
||||
<!-- <if test="dataTime != null ">#{dataTime},</if>-->
|
||||
0,0
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -217,11 +217,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<set>
|
||||
<if test="shId != null">dev_id = #{shId},</if>
|
||||
<if test="dataName != null and dataName != ''">data_name = #{dataName},</if>
|
||||
<if test="dataVal != null and dataVal != ''">data_val = #{dataVal},</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">data_val = #{dataVal},</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">data_unit = #{dataUnit},</if>
|
||||
<if test="dataCode != null and dataCode != ''">data_code = #{dataCode},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="dataTime != null ">data_time = #{dataTime},</if>
|
||||
<!-- <if test="dataTime != null ">data_time = #{dataTime},</if>-->
|
||||
del_flag = 0
|
||||
</set>
|
||||
where id = #{id}
|
||||
|
|
@ -363,4 +363,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
set del_flag = 1
|
||||
where source_id = #{id} and source_type = 7 and del_flag = 0
|
||||
</update>
|
||||
|
||||
<!--批量导出手环-->
|
||||
<select id="getShSomeLists" resultType="com.bonus.common.entity.bracelet.vo.BraceletVo">
|
||||
select tb.id as shId,tb.sh_code as shCode,sh_status as shStatus,tsb.box_name as shboxName,
|
||||
tsb.box_code as shboxCode,tb.peopel_type as shPersonType,tb.bid_id as shPersonId,tsb.id as shboxId
|
||||
from tb_bracelet tb
|
||||
left join tb_sh_box tsb on tb.box_id = tsb.id and tsb.del_flag = 0
|
||||
where tb.del_flag = 0
|
||||
and tb.id in
|
||||
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by tb.id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -111,20 +111,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into tb_dev_details(
|
||||
<if test="deviceId != null">dev_id,</if>
|
||||
<if test="dataName != null and dataName != ''">data_name,</if>
|
||||
<if test="dataVal != null and dataVal != ''">data_val,</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">data_val,</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">data_unit,</if>
|
||||
<if test="dataCode != null and dataCode != ''">data_code,</if>
|
||||
<if test="dataType != null and dataType != ''">data_type,</if>
|
||||
<if test="dataTime != null ">data_time,</if>
|
||||
<!-- <if test="dataTime != null ">data_time,</if>-->
|
||||
dev_type,del_flag
|
||||
)values(
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="dataName != null and dataName != ''">#{dataName},</if>
|
||||
<if test="dataVal != null and dataVal != ''">#{dataVal},</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">#{dataVal},</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">#{dataUnit},</if>
|
||||
<if test="dataCode != null and dataCode != ''">#{dataCode},</if>
|
||||
<if test="dataType != null and dataType != ''">#{dataType},</if>
|
||||
<if test="dataTime != null ">#{dataTime},</if>
|
||||
<!-- <if test="dataTime != null ">#{dataTime},</if>-->
|
||||
1,0
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -135,11 +135,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<set>
|
||||
<if test="deviceId != null">dev_id = #{deviceId},</if>
|
||||
<if test="dataName != null and dataName != ''">data_name = #{dataName},</if>
|
||||
<if test="dataVal != null and dataVal != ''">data_val = #{dataVal},</if>
|
||||
<!-- <if test="dataVal != null and dataVal != ''">data_val = #{dataVal},</if>-->
|
||||
<if test="dataUnit != null and dataUnit != ''">data_unit = #{dataUnit},</if>
|
||||
<if test="dataCode != null and dataCode != ''">data_code = #{dataCode},</if>
|
||||
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||
<if test="dataTime != null ">data_time = #{dataTime},</if>
|
||||
<!-- <if test="dataTime != null ">data_time = #{dataTime},</if>-->
|
||||
del_flag = 0
|
||||
</set>
|
||||
where id = #{id}
|
||||
|
|
@ -237,4 +237,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
set del_flag = 1
|
||||
where source_id = #{id} and source_type = 7 and del_flag = 0
|
||||
</update>
|
||||
|
||||
<!--批量导出-->
|
||||
<select id="getDeviceSomeLists" resultType="com.bonus.common.entity.bracelet.vo.DeviceVo">
|
||||
select td.id as deviceId,td.dev_type as deviceType,td.dev_name as deviceName,td.dev_code as deviceCode,td.dev_status as deviceStatus,
|
||||
tdl.ly_user as lyId,tdl.user_type as lyType,tdd.dict_label AS deviceTypeName,td.dev_index as deviceIndex
|
||||
from tb_device td
|
||||
left join sys_dict_data tdd on tdd.dict_value=td.dev_type AND tdd .dict_type='sys_device_type'
|
||||
left join tb_dev_ly tdl on td.id = tdl.dev_id
|
||||
where td.del_flag = 0
|
||||
and td.dev_code in
|
||||
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by td.id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -194,4 +194,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT id as gtId,power_name as gtCode,lon,lat FROM tb_project_power WHERE id != #{gtId} AND del_flag = 0
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getEngineeringSomeLists" resultType="com.bonus.common.entity.bracelet.vo.EngineeringVo">
|
||||
select tb.id as proId,tpd.depart_name as departName,tb.pro_name as proName,count(tpp.id) as gtNum,sddlevel.dict_label as vlevel,sddorg.dict_label as orgName,
|
||||
sddpro.dict_label as proType,sddstatus.dict_label as proStatus,sddyz.dict_label as yzManage,sddsg.dict_label as sgManage,
|
||||
sddjl.dict_label as jlManage
|
||||
from tb_project tb
|
||||
left join tb_project_depart tpd on tb.depart_id = tpd.id and tpd.del_flag = 0
|
||||
left join tb_project_power tpp on tb.id = tpp.pro_id and tpp.del_flag = 0
|
||||
left join sys_dict_data sddlevel on sddlevel.dict_value=tb.voltage_level and sddlevel.dict_type = 'sys_voltage_level'
|
||||
left join sys_dict_data sddorg on sddorg.dict_value=tb.org_id and sddorg.dict_type = 'sys_org_name'
|
||||
left join sys_dict_data sddpro on sddpro.dict_value=tb.pro_type and sddpro.dict_type = 'sys_pro_type'
|
||||
left join sys_dict_data sddstatus on sddstatus.dict_value=tb.pro_status and sddstatus.dict_type = 'sys_pro_status'
|
||||
left join sys_dict_data sddyz on sddyz.dict_value=tb.yz_manage and sddyz.dict_type = 'sys_yz_manage'
|
||||
left join sys_dict_data sddsg on sddsg.dict_value=tb.sg_manage and sddsg.dict_type = 'sys_sg_manage'
|
||||
left join sys_dict_data sddjl on sddjl.dict_value=tb.jl_manage and sddjl.dict_type = 'sys_jl_manage'
|
||||
where
|
||||
tb.del_flag = 0
|
||||
and tb.id in
|
||||
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
group by tb.id,tpd.depart_name,tb.pro_name,sddlevel.dict_label,sddorg.dict_label,sddpro.dict_label,sddstatus.dict_label,
|
||||
sddyz.dict_label,sddsg.dict_label,sddjl.dict_label
|
||||
order by tb.id ASC
|
||||
</select>
|
||||
|
||||
<select id="getExportGtSomeLists" resultType="com.bonus.common.entity.bracelet.vo.GtVo">
|
||||
select tpp.pro_id as proId,tpp.id as gtId,tpp.power_name as gtCode,tpp.lon as lon,tpp.lat as lat
|
||||
from tb_project_power tpp
|
||||
<where>
|
||||
tpp.del_flag = 0
|
||||
<if test="proId != null and proId!=''">
|
||||
AND tpp.pro_id = #{proId}
|
||||
</if>
|
||||
and tpp.id in
|
||||
<foreach collection="ids" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</where>
|
||||
order by tpp.id ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -81,9 +81,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dict_data sdd on sdd.dict_value = tb.dev_type and sdd.dict_type = 'sys_device_type'
|
||||
where tw.team_id = #{teamId} and tw.dev_type = 1 and tw.del_flag = 0
|
||||
union all
|
||||
select '手环箱' as warnType,'\\' as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
select '手环箱' as warnType,tbb.sh_code as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_bracelet tbb on tw.dev_id = tbb.id and tbb.del_flag = 0
|
||||
where tw.team_id = #{teamId} and tw.dev_type = 0 and tw.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="getConstructionSomeLists" resultType="com.bonus.common.entity.bracelet.vo.QueryConstruction">
|
||||
select tp.pro_name as proName,tpd.depart_name as departName,twt.team_name as teamName,twt.team_leader as teamLeader,twt.leader_phone as teamPhone,
|
||||
count(DISTINCT tbp.id) as teamNum,count(DISTINCT tlu.id) as tempNum,a.lytime as lyTime,count(DISTINCT tw.id) as warnNum,a.teamid as teamId
|
||||
from
|
||||
(select tdu.pro_id as proid,tdu.team_id as teamid,tdub.ly_time as lytime
|
||||
from tb_dev_use tdu
|
||||
left join tb_dev_use_bid tdub on tdub.id = tdu.id and tdub.dev_type = 'shx'
|
||||
where tdu.del_flag = 0) a
|
||||
left join tb_project tp on tp.id = a.proid and tp.del_flag = 0
|
||||
left join t_work_team twt on twt.team_id = a.teamid and twt.pro_id = tp.id and twt.del_flag = 0
|
||||
left join tb_project_depart tpd on tpd.id = tp.depart_id
|
||||
left join tb_people tbp on tbp.team_id = a.teamid and tbp.del_flag = 0
|
||||
left join tb_ls_user tlu on tlu.team_id = a.teamid
|
||||
left join tb_warn tw on tw.team_id = a.teamid and tw.del_flag = 0
|
||||
where
|
||||
twt.team_id in
|
||||
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
group by proName,departName,teamName,teamLeader,teamPhone,a.lytime,a.teamid
|
||||
order by a.lytime desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND tb.id = -1
|
||||
</if>
|
||||
union all
|
||||
select '手环箱' as warnType,'\\' as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
select '手环箱' as warnType,tbb.sh_code as deviceName,tw.warn_time as warnTime,tw.warn_content as warnContent
|
||||
from tb_warn tw
|
||||
left join tb_bracelet tbb on tw.dev_id = tbb.id and tbb.del_flag = 0
|
||||
where tw.dev_type = 0 and tw.del_flag = 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue