diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/Lifter.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/Lifter.java index 4e26fa01b..e2c385af7 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/Lifter.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/Lifter.java @@ -1,217 +1,298 @@ package com.zhgd.xmgl.modules.bigdevice.entity; -import java.io.Serializable; -import java.util.List; - import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.List; + /** * @Description: 升降机基本信息 * @author: pds - * @date: 2020-12-16 + * @date: 2020-12-16 * @version: V1.0 */ @Data @TableName("lifter") -@ApiModel(value="Lifter实体类",description="Lifter") +@ApiModel(value = "Lifter实体类", description = "Lifter") public class Lifter implements Serializable { private static final long serialVersionUID = 1L; - /**id*/ + /** + * id + */ @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value="id") - private java.lang.Long id ; - /**设备名称*/ + @ApiModelProperty(value = "id") + private java.lang.Long id; + /** + * 设备名称 + */ @Excel(name = "设备名称", width = 15) - @ApiModelProperty(value="设备名称") - private java.lang.String devName ; - /**设备编号*/ + @ApiModelProperty(value = "设备名称") + private java.lang.String devName; + /** + * 设备编号 + */ @Excel(name = "设备编号", width = 15) - @ApiModelProperty(value="设备编号") - private java.lang.String devSn ; - /**升降机类型,0:单笼 1:多笼*/ + @ApiModelProperty(value = "设备编号") + private java.lang.String devSn; + /** + * 升降机类型,0:单笼 1:多笼 + */ @Excel(name = "升降机类型,0:单笼 1:多笼", width = 15) - @ApiModelProperty(value="升降机类型,0:单笼 1:多笼") - private java.lang.Integer elevatorType ; - /**多笼设备另一个设备编号*/ + @ApiModelProperty(value = "升降机类型,0:单笼 1:多笼") + private java.lang.Integer elevatorType; + /** + * 多笼设备另一个设备编号 + */ @Excel(name = "多笼设备另一个设备编号", width = 15) - @ApiModelProperty(value="多笼设备另一个设备编号") - private java.lang.String otherDevSn ; - /**升降机备案号*/ + @ApiModelProperty(value = "多笼设备另一个设备编号") + private java.lang.String otherDevSn; + /** + * 升降机备案号 + */ @Excel(name = "升降机备案号", width = 15) - @ApiModelProperty(value="升降机备案号") - private java.lang.String registNo ; - /**设备型号*/ + @ApiModelProperty(value = "升降机备案号") + private java.lang.String registNo; + /** + * 设备型号 + */ @Excel(name = "设备型号", width = 15) - @ApiModelProperty(value="设备型号") - private java.lang.String devModel ; - /**产权单位*/ + @ApiModelProperty(value = "设备型号") + private java.lang.String devModel; + /** + * 产权单位 + */ @Excel(name = "产权单位", width = 15) - @ApiModelProperty(value="产权单位") - private java.lang.String propertyUnit ; - /**产权编号*/ + @ApiModelProperty(value = "产权单位") + private java.lang.String propertyUnit; + /** + * 产权编号 + */ @Excel(name = "产权编号", width = 15) - @ApiModelProperty(value="产权编号") - private java.lang.String propertyNumber ; - /**安装单位*/ + @ApiModelProperty(value = "产权编号") + private java.lang.String propertyNumber; + /** + * 安装单位 + */ @Excel(name = "安装单位", width = 15) - @ApiModelProperty(value="安装单位") - private java.lang.String installationUnit ; - /**安装单位代码*/ + @ApiModelProperty(value = "安装单位") + private java.lang.String installationUnit; + /** + * 安装单位代码 + */ @Excel(name = "安装单位代码", width = 15) - @ApiModelProperty(value="安装单位代码") - private java.lang.String installationUnitCode ; - /**安装时间*/ + @ApiModelProperty(value = "安装单位代码") + private java.lang.String installationUnitCode; + /** + * 安装时间 + */ @Excel(name = "安装时间", width = 15) - @ApiModelProperty(value="安装时间") - private java.lang.String installationTime ; - /**安装图片*/ + @ApiModelProperty(value = "安装时间") + private java.lang.String installationTime; + /** + * 安装图片 + */ @Excel(name = "安装图片", width = 15) - @ApiModelProperty(value="安装图片") - private java.lang.String installationImage ; - /**制造单位*/ + @ApiModelProperty(value = "安装图片") + private java.lang.String installationImage; + /** + * 制造单位 + */ @Excel(name = "制造单位", width = 15) - @ApiModelProperty(value="制造单位") - private java.lang.String factoryName ; - /**出产日期*/ + @ApiModelProperty(value = "制造单位") + private java.lang.String factoryName; + /** + * 出产日期 + */ @Excel(name = "出产日期", width = 15) - @ApiModelProperty(value="出产日期") - private java.lang.String factoryTime ; - /**拆除单位*/ + @ApiModelProperty(value = "出产日期") + private java.lang.String factoryTime; + /** + * 拆除单位 + */ @Excel(name = "拆除单位", width = 15) - @ApiModelProperty(value="拆除单位") - private java.lang.String demolitionUnit ; - /**设备状态,1设备进场,2设备安装,3设备验收,4设备使用,5设备拆除,6设备退场*/ + @ApiModelProperty(value = "拆除单位") + private java.lang.String demolitionUnit; + /** + * 设备状态,1设备进场,2设备安装,3设备验收,4设备使用,5设备拆除,6设备退场 + */ @Excel(name = "设备状态,1设备进场,2设备安装,3设备验收,4设备使用,5设备拆除,6设备退场", width = 15) - @ApiModelProperty(value="设备状态,1设备进场,2设备安装,3设备验收,4设备使用,5设备拆除,6设备退场") - private java.lang.Integer devState ; - /**检测单位*/ + @ApiModelProperty(value = "设备状态,1设备进场,2设备安装,3设备验收,4设备使用,5设备拆除,6设备退场") + private java.lang.Integer devState; + /** + * 检测单位 + */ @Excel(name = "检测单位", width = 15) - @ApiModelProperty(value="检测单位") - private java.lang.String testingOrganization ; - /**检测合格时间*/ + @ApiModelProperty(value = "检测单位") + private java.lang.String testingOrganization; + /** + * 检测合格时间 + */ @Excel(name = "检测合格时间", width = 15) - @ApiModelProperty(value="检测合格时间") - private java.lang.String testQualifiedTime ; - /**检测编号*/ + @ApiModelProperty(value = "检测合格时间") + private java.lang.String testQualifiedTime; + /** + * 检测编号 + */ @Excel(name = "检测编号", width = 15) - @ApiModelProperty(value="检测编号") - private java.lang.String testNumber ; - /**检测证书照片*/ + @ApiModelProperty(value = "检测编号") + private java.lang.String testNumber; + /** + * 检测证书照片 + */ @Excel(name = "检测证书照片", width = 15) - @ApiModelProperty(value="检测证书照片") - private java.lang.String testCertificate ; - /**使用登记办理时间*/ + @ApiModelProperty(value = "检测证书照片") + private java.lang.String testCertificate; + /** + * 使用登记办理时间 + */ @Excel(name = "使用登记办理时间", width = 15) - @ApiModelProperty(value="使用登记办理时间") - private java.lang.String useRegistrationTime ; - /**使用登记办理编号*/ + @ApiModelProperty(value = "使用登记办理时间") + private java.lang.String useRegistrationTime; + /** + * 使用登记办理编号 + */ @Excel(name = "使用登记办理编号", width = 15) - @ApiModelProperty(value="使用登记办理编号") - private java.lang.String useRegistrationNumber ; - /**登记证书照片*/ + @ApiModelProperty(value = "使用登记办理编号") + private java.lang.String useRegistrationNumber; + /** + * 登记证书照片 + */ @Excel(name = "登记证书照片", width = 15) - @ApiModelProperty(value="登记证书照片") - private java.lang.String registrationCertificate ; - /**最大载重*/ + @ApiModelProperty(value = "登记证书照片") + private java.lang.String registrationCertificate; + /** + * 最大载重 + */ @Excel(name = "最大载重", width = 15) - @ApiModelProperty(value="最大载重") - private java.lang.String maxLoad ; - /**额定人数*/ + @ApiModelProperty(value = "最大载重") + private java.lang.String maxLoad; + /** + * 额定人数 + */ @Excel(name = "额定人数", width = 15) - @ApiModelProperty(value="额定人数") - private java.lang.Integer ratedPeopleNum ; - /**最大高度*/ + @ApiModelProperty(value = "额定人数") + private java.lang.Integer ratedPeopleNum; + /** + * 最大高度 + */ @Excel(name = "最大高度", width = 15) - @ApiModelProperty(value="最大高度") - private java.lang.String maxHeight ; - /**齿轮模数*/ + @ApiModelProperty(value = "最大高度") + private java.lang.String maxHeight; + /** + * 齿轮模数 + */ @Excel(name = "齿轮模数", width = 15) - @ApiModelProperty(value="齿轮模数") - private java.lang.String gearModule ; - /**创建时间*/ + @ApiModelProperty(value = "齿轮模数") + private java.lang.String gearModule; + /** + * 创建时间 + */ @Excel(name = "创建时间", width = 15) - @ApiModelProperty(value="创建时间") - private java.lang.String addTime ; - /**备案编号*/ + @ApiModelProperty(value = "创建时间") + private java.lang.String addTime; + /** + * 备案编号 + */ @Excel(name = "备案编号", width = 15) - @ApiModelProperty(value="备案编号") - private java.lang.String filingNo ; - /**设备标识码*/ + @ApiModelProperty(value = "备案编号") + private java.lang.String filingNo; + /** + * 设备标识码 + */ @Excel(name = "设备标识码", width = 15) - @ApiModelProperty(value="设备标识码") - private java.lang.String verifyCode ; - /**项目sn*/ + @ApiModelProperty(value = "设备标识码") + private java.lang.String verifyCode; + /** + * 项目sn + */ @Excel(name = "项目sn", width = 15) - @ApiModelProperty(value="项目sn") - private java.lang.String projectSn ; - /**地图X坐标*/ + @ApiModelProperty(value = "项目sn") + private java.lang.String projectSn; + /** + * 地图X坐标 + */ @Excel(name = "地图X坐标", width = 15) - @ApiModelProperty(value="地图X坐标") - private java.lang.String mapX ; - /**地图Y坐标*/ + @ApiModelProperty(value = "地图X坐标") + private java.lang.String mapX; + /** + * 地图Y坐标 + */ @Excel(name = "地图Y坐标", width = 15) - @ApiModelProperty(value="地图Y坐标") - private java.lang.String mapY ; - /**是否启用视频url,1不启用,2启用*/ + @ApiModelProperty(value = "地图Y坐标") + private java.lang.String mapY; + /** + * 是否启用视频url,1不启用,2启用 + */ @Excel(name = "是否启用视频url,1不启用,2启用", width = 15) - @ApiModelProperty(value="是否启用视频url,1不启用,2启用") - private java.lang.Integer enableVideoUrl ; - /**视频Url*/ + @ApiModelProperty(value = "是否启用视频url,1不启用,2启用") + private java.lang.Integer enableVideoUrl; + /** + * 视频Url + */ @Excel(name = "视频Url", width = 15) - @ApiModelProperty(value="视频Url") - private java.lang.String videoUrl ; - /**纬度*/ + @ApiModelProperty(value = "视频Url") + private java.lang.String videoUrl; + /** + * 纬度 + */ @Excel(name = "纬度", width = 15) - @ApiModelProperty(value="纬度") - private java.lang.String latitude ; - /**经度*/ + @ApiModelProperty(value = "纬度") + private java.lang.String latitude; + /** + * 经度 + */ @Excel(name = "经度", width = 15) - @ApiModelProperty(value="经度") - private java.lang.String longitude ; - /**接收实时数据时间,30分钟没接收到实时数据表示设备离线*/ + @ApiModelProperty(value = "经度") + private java.lang.String longitude; + /** + * 接收实时数据时间,30分钟没接收到实时数据表示设备离线 + */ @Excel(name = "接收实时数据时间,30分钟没接收到实时数据表示设备离线", width = 20, format = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value="接收实时数据时间,30分钟没接收到实时数据表示设备离线") - private java.util.Date realTime ; - /**是否创建数据,0否,1是*/ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "接收实时数据时间,30分钟没接收到实时数据表示设备离线") + private java.util.Date realTime; + /** + * 是否创建数据,0否,1是 + */ @Excel(name = "是否创建数据,0否,1是", width = 15) - @ApiModelProperty(value="是否创建数据,0否,1是") - private java.lang.Integer createDataType ; + @ApiModelProperty(value = "是否创建数据,0否,1是") + private java.lang.Integer createDataType; - @ApiModelProperty(value="升级机所在楼层总层数") + @ApiModelProperty(value = "升级机所在楼层总层数") private java.lang.Integer totalFloor; - @ApiModelProperty(value="报警推送人") + @ApiModelProperty(value = "报警推送人") private java.lang.String alarmPushWorkerId; - @ApiModelProperty(value="总承包单位企业ID") - private java.lang.Integer generalContractorsId ; + @ApiModelProperty(value = "总承包单位企业ID") + private java.lang.Integer generalContractorsId; + @ApiModelProperty(value = "品牌") + private java.lang.String brand; @TableField(exist = false) - @ApiModelProperty(value="总承包单位企业名称") - private java.lang.String generalContractorsName ; + @ApiModelProperty(value = "总承包单位企业名称") + private java.lang.String generalContractorsName; @TableField(exist = false) - @ApiModelProperty(value="设置是否在线,1在线,0离线") + @ApiModelProperty(value = "设置是否在线,1在线,0离线") private java.lang.Integer devOnline; @TableField(exist = false) - @ApiModelProperty(value="视频列表") + @ApiModelProperty(value = "视频列表") private List videoList; @TableField(exist = false) - @ApiModelProperty(value="司机列表") + @ApiModelProperty(value = "司机列表") private List driverList; } diff --git a/src/main/java/com/zhgd/xmgl/modules/checking/mapper/xml/CheckingPointMapper.xml b/src/main/java/com/zhgd/xmgl/modules/checking/mapper/xml/CheckingPointMapper.xml index b17174f1e..4c300b81c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/checking/mapper/xml/CheckingPointMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/checking/mapper/xml/CheckingPointMapper.xml @@ -34,8 +34,8 @@ notice_user_ids, frequency_num, frequency_type, - standArea, - remark, + stand_area, + remark, start_time, end_time, create_date, @@ -60,7 +60,7 @@ notice_user_ids, frequency_num, frequency_type, - standArea, + stand_area, remark, start_time, end_time, @@ -70,4 +70,4 @@ where end_time = DATE_SUB(CURDATE(), INTERVAL 1 DAY) and frequency_num is not null - \ No newline at end of file + diff --git a/src/main/java/com/zhgd/xmgl/modules/discharging/service/impl/DischargingPlatformAlarmServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/discharging/service/impl/DischargingPlatformAlarmServiceImpl.java index 5d557ab57..a73c31af0 100644 --- a/src/main/java/com/zhgd/xmgl/modules/discharging/service/impl/DischargingPlatformAlarmServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/discharging/service/impl/DischargingPlatformAlarmServiceImpl.java @@ -143,6 +143,7 @@ public class DischargingPlatformAlarmServiceImpl extends ServiceImpl getAlarmCycleTrendGraph(Map map) { //eg:[{time:2020-11-11,num:11}] - List p = deepExcavationCurrentDataMapper.getAlarmCycleTrendGraph(map); - dischargingPlatformAlarmService.fillEmptyDateData(p); - return p; + List list = deepExcavationCurrentDataMapper.getAlarmCycleTrendGraph(map); + dischargingPlatformAlarmService.fillEmptyDateData(list); + return list; } @Override diff --git a/src/main/java/com/zhgd/xmgl/modules/highformwork/controller/HighFormworkAlarmDataController.java b/src/main/java/com/zhgd/xmgl/modules/highformwork/controller/HighFormworkAlarmDataController.java index b7e805ee1..af31809e9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highformwork/controller/HighFormworkAlarmDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/highformwork/controller/HighFormworkAlarmDataController.java @@ -162,16 +162,6 @@ public class HighFormworkAlarmDataController { return result; } - @ApiOperation(value = "查询报警类型雷达图(近一月不同类型报警数量)", notes = "查询报警类型雷达图(近一月不同类型报警数量)", httpMethod = "GET") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), - @ApiImplicitParam(name = "measurePointId", value = "监测点ID", paramType = "query", required = true, dataType = "LONG"), - }) - @GetMapping(value = "/recent/month/radar") - public Result> getNumberDifferentTypesAlarmsRadarChartOneMonth(@RequestParam Map map) { - return Result.success(highFormworkAlarmDataService.getNumberDifferentTypesAlarmsRadarChartOneMonth(map)); - } - @ApiOperation(value = "查询报警周期趋势图(近一月不同类型报警数量)", notes = "查询报警周期趋势图(近一月不同类型报警数量)", httpMethod = "GET") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), @@ -181,4 +171,14 @@ public class HighFormworkAlarmDataController { public Result> getAlarmCycleTrendGraph(@RequestParam Map map) { return Result.success(highFormworkAlarmDataService.getAlarmCycleTrendGraph(map)); } + + @ApiOperation(value = "查询报警类型雷达图(近一月不同类型报警数量)", notes = "查询报警类型雷达图(近一月不同类型报警数量)", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), + @ApiImplicitParam(name = "measurePointId", value = "监测点ID", paramType = "query", required = true, dataType = "LONG"), + }) + @GetMapping(value = "/recent/month/radar") + public Result> getNumberDifferentTypesAlarmsRadarChartOneMonth(@RequestParam Map map) { + return Result.success(highFormworkAlarmDataService.getNumberDifferentTypesAlarmsRadarChartOneMonth(map)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkAlarmDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkAlarmDataServiceImpl.java index 66fcd5e70..fe647468c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkAlarmDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkAlarmDataServiceImpl.java @@ -52,9 +52,9 @@ public class HighFormworkAlarmDataServiceImpl extends ServiceImpl getAlarmCycleTrendGraph(Map map) { //eg:[{time:2020-11-11,num:11}] - List p = highFormworkAlarmDataMapper.getAlarmCycleTrendGraph(map); - dischargingPlatformAlarmService.fillEmptyDateData(p); - return p; + List list = highFormworkAlarmDataMapper.getAlarmCycleTrendGraph(map); + dischargingPlatformAlarmService.fillEmptyDateData(list); + return list; } /** diff --git a/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkMeasureCurrentDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkMeasureCurrentDataServiceImpl.java index 058f575e2..dd1b8ab23 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkMeasureCurrentDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/highformwork/service/impl/HighFormworkMeasureCurrentDataServiceImpl.java @@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -187,5 +184,6 @@ public class HighFormworkMeasureCurrentDataServiceImpl extends ServiceImpl queryWrapper = null; - try { - String paramsStr = request.getParameter("paramsStr"); - if (oConvertUtils.isNotEmpty(paramsStr)) { - String deString = URLDecoder.decode(paramsStr, "UTF-8"); - SjDeepFoundationEquipmentInformation sjDeepFoundationEquipmentInformation = JSON.parseObject(deString, SjDeepFoundationEquipmentInformation.class); - queryWrapper = QueryGenerator.initQueryWrapper(sjDeepFoundationEquipmentInformation, request.getParameterMap()); - } - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - //Step.2 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - List pageList = sjDeepFoundationEquipmentInformationService.list(queryWrapper); - //导出文件名称 - mv.addObject(NormalExcelConstants.FILE_NAME, "三江-深基坑设备信息列表"); - mv.addObject(NormalExcelConstants.CLASS, SjDeepFoundationEquipmentInformation.class); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("三江-深基坑设备信息列表数据", "导出人:Jeecg", "导出信息")); - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @ApiOperation(value = "通过excel导入三江-深基坑设备信息信息", notes = "通过excel导入三江-深基坑设备信息信息", httpMethod = "POST") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - MultipartFile file = entity.getValue();// 获取上传文件对象 - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List listSjDeepFoundationEquipmentInformations = ExcelImportUtil.importExcel(file.getInputStream(), SjDeepFoundationEquipmentInformation.class, params); - for (SjDeepFoundationEquipmentInformation sjDeepFoundationEquipmentInformationExcel : listSjDeepFoundationEquipmentInformations) { - sjDeepFoundationEquipmentInformationService.save(sjDeepFoundationEquipmentInformationExcel); - } - return Result.ok("文件导入成功!数据行数:" + listSjDeepFoundationEquipmentInformations.size()); - } catch (Exception e) { - log.error(e.getMessage()); - return Result.error("文件导入失败!"); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return Result.ok("文件导入失败!"); - } - } diff --git a/src/main/java/com/zhgd/xmgl/modules/sanjiang/controller/SjHighSupportMoldEquipmentInformationController.java b/src/main/java/com/zhgd/xmgl/modules/sanjiang/controller/SjHighSupportMoldEquipmentInformationController.java index 4feaf4232..377878333 100644 --- a/src/main/java/com/zhgd/xmgl/modules/sanjiang/controller/SjHighSupportMoldEquipmentInformationController.java +++ b/src/main/java/com/zhgd/xmgl/modules/sanjiang/controller/SjHighSupportMoldEquipmentInformationController.java @@ -207,75 +207,4 @@ public class SjHighSupportMoldEquipmentInformationController { return result; } - /** - * 导出excel - * - * @param request - * @param response - */ - @ApiOperation(value = "导出excel三江-高支模设备信息信息", notes = "导出excel三江-高支模设备信息信息", httpMethod = "POST") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { - // Step.1 组装查询条件 - QueryWrapper queryWrapper = null; - try { - String paramsStr = request.getParameter("paramsStr"); - if (oConvertUtils.isNotEmpty(paramsStr)) { - String deString = URLDecoder.decode(paramsStr, "UTF-8"); - SjHighSupportMoldEquipmentInformation sjHighSupportMoldEquipmentInformation = JSON.parseObject(deString, SjHighSupportMoldEquipmentInformation.class); - queryWrapper = QueryGenerator.initQueryWrapper(sjHighSupportMoldEquipmentInformation, request.getParameterMap()); - } - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - //Step.2 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - List pageList = sjHighSupportMoldEquipmentInformationService.list(queryWrapper); - //导出文件名称 - mv.addObject(NormalExcelConstants.FILE_NAME, "三江-高支模设备信息列表"); - mv.addObject(NormalExcelConstants.CLASS, SjHighSupportMoldEquipmentInformation.class); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("三江-高支模设备信息列表数据", "导出人:Jeecg", "导出信息")); - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @ApiOperation(value = "通过excel导入三江-高支模设备信息信息", notes = "通过excel导入三江-高支模设备信息信息", httpMethod = "POST") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - MultipartFile file = entity.getValue();// 获取上传文件对象 - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List listSjHighSupportMoldEquipmentInformations = ExcelImportUtil.importExcel(file.getInputStream(), SjHighSupportMoldEquipmentInformation.class, params); - for (SjHighSupportMoldEquipmentInformation sjHighSupportMoldEquipmentInformationExcel : listSjHighSupportMoldEquipmentInformations) { - sjHighSupportMoldEquipmentInformationService.save(sjHighSupportMoldEquipmentInformationExcel); - } - return Result.ok("文件导入成功!数据行数:" + listSjHighSupportMoldEquipmentInformations.size()); - } catch (Exception e) { - log.error(e.getMessage()); - return Result.error("文件导入失败!"); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return Result.ok("文件导入失败!"); - } - } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java index a5259b90c..2cebc1338 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java @@ -13,6 +13,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -74,7 +75,10 @@ public class WeighInfoController { */ @ApiOperation(value = " 添加称重记录表信息", notes = "添加称重记录表信息", httpMethod = "POST") @PostMapping(value = "/add") - public Result add(@RequestBody WeighInfo weighInfo) { + public Result add(@RequestBody WeighInfo weighInfo) { + if (StringUtils.isBlank(weighInfo.getProjectSn())) { + return Result.error("projectSn不能为空"); + } Result result = new Result(); try { weighInfoService.save(weighInfo);