liweidong
张乾翔 2 days ago
parent cebcfb50f4
commit 96ca75390e
  1. 17
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsDischargeRecController.java
  2. 56
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsDosingRecController.java
  3. 12
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsEpciuInspectionPointController.java
  4. 16
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsInsTestController.java
  5. 18
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsSafeInspectionPointController.java
  6. 16
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/BsTowerController.java
  7. 8
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/DosingRecMapper.xml
  8. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/InsTestMapper.xml
  9. 8
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/TowerMapper.xml
  10. 12
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/TowerReportMapper.xml
  11. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/WasteGasRunRecMapper.xml
  12. 24
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsTowerEntity.java
  13. 1
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsDosingRecServiceImpl.java

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -46,6 +47,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.desk.basic.util.ExcelExtUtil;
import org.springblade.desk.energy.excel.BsDischargeRecExcel;
import org.springblade.desk.energy.pojo.entity.BsDischargeRecEntity;
import org.springblade.desk.energy.pojo.entity.BsTowerEntity;
import org.springblade.desk.energy.pojo.vo.BsDischargeRecVO;
import org.springblade.desk.energy.service.IBsDischargeRecService;
import org.springblade.desk.energy.wrapper.BsDischargeRecWrapper;
@ -192,9 +194,18 @@ public class BsDischargeRecController extends BladeController {
if (checkR != null) {
return checkR;
}
List<BsDischargeRecEntity> importList = ExcelUtil.read(
file, 0, 1, BsDischargeRecEntity.class
);
List<BsDischargeRecEntity> importList;
try {
importList = ExcelUtil.read(
file, 0, 1, BsDischargeRecEntity.class
);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
//return R.status(bsDischargeRecService.saveBatch(importList));
bsDischargeRecService.save(importList);
return R.success();

@ -25,6 +25,8 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -185,12 +187,54 @@ public class BsDosingRecController extends BladeController {
if (checkR != null) {
return checkR;
}
List<BsDosingRecEntity> importList = ExcelUtil.read(
file, 0, 1, BsDosingRecEntity.class
);
importList.forEach(x->{
x.setDorType(dorType);
});
List<BsDosingRecEntity> importList;
try {
importList = ExcelUtil.read(
file, 0, 1, BsDosingRecEntity.class
);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
if (CollUtil.isEmpty(importList)){
return R.fail("导入数据为空");
}
// 数据校验
StringBuilder errorMsg = new StringBuilder();
for (int i = 0; i < importList.size(); i++) {
BsDosingRecEntity entity = importList.get(i);
int rowNum = i + 2; // Excel行号(从第2行开始,第1行是表头)
// 校验设施字段
if (entity.getDevice() == null || entity.getDevice().trim().isEmpty()) {
errorMsg.append("第").append(rowNum).append("行:设施不能为空;\n");
}
// 校验药品字段
if (entity.getDrug() == null || entity.getDrug().trim().isEmpty()) {
errorMsg.append("第").append(rowNum).append("行:药品不能为空;\n");
}
// 校验剂量字段
if (entity.getDose() == null) {
errorMsg.append("第").append(rowNum).append("行:剂量不能为空;\n");
}
// 校验加药时间字段
if (entity.getDosingTime() == null) {
errorMsg.append("第").append(rowNum).append("行:加药时间不能为空或格式不正确(应为:yyyy-MM-dd HH:mm:ss);\n");
}
entity.setDorType(dorType);
}
if (errorMsg.length() > 0) {
throw new RuntimeException("数据格式错误:\n" + errorMsg);
}
return R.status(bsDosingRecService.saveBatch(importList));
}
/**

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -50,6 +51,7 @@ import org.springblade.desk.basic.pojo.entity.CoatingThickness;
import org.springblade.desk.basic.util.ExcelExtUtil;
import org.springblade.desk.energy.excel.BsEpciuInspectionPointExcel;
import org.springblade.desk.energy.pojo.entity.BsEpciuInspectionPointEntity;
import org.springblade.desk.energy.pojo.entity.BsSafeInspectionPointEntity;
import org.springblade.desk.energy.pojo.vo.BsEpciuInspectionPointVO;
import org.springblade.desk.energy.service.IBsEpciuInspectionPointService;
import org.springblade.desk.energy.wrapper.BsEpciuInspectionPointWrapper;
@ -186,8 +188,16 @@ public class BsEpciuInspectionPointController extends BladeController {
public R importExcel(@RequestParam("file") MultipartFile file) {
List<BsEpciuInspectionPointEntity> noticeList = new ArrayList<>();
List<BsEpciuInspectionPointExcel> list;
try {
list = ExcelUtil.read(file, BsEpciuInspectionPointExcel.class);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
List<BsEpciuInspectionPointExcel> list = ExcelUtil.read(file, BsEpciuInspectionPointExcel.class);
list.forEach(noticeExcel -> {
if (cn.hutool.core.bean.BeanUtil.isEmpty(noticeExcel) || StrUtil.isEmpty(noticeExcel.getInsNum())
|| noticeExcel.getInsNum().contains("注")){

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -45,6 +46,7 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.desk.basic.util.ExcelExtUtil;
import org.springblade.desk.energy.excel.BsInsTestExcel;
import org.springblade.desk.energy.pojo.entity.BsDosingRecEntity;
import org.springblade.desk.energy.pojo.entity.BsInsTestEntity;
import org.springblade.desk.energy.pojo.vo.BsInsTestVO;
import org.springblade.desk.energy.service.IBsInsTestService;
@ -193,9 +195,17 @@ public class BsInsTestController extends BladeController {
if (checkR != null) {
return checkR;
}
List<BsInsTestEntity> importList = ExcelUtil.read(
file, 0, 1, BsInsTestEntity.class
);
List<BsInsTestEntity> importList;
try {
importList = ExcelUtil.read(
file, 0, 1, BsInsTestEntity.class
);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
return R.status(bsInsTestService.saveBatch(importList));
}

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -45,6 +46,7 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.desk.basic.util.ExcelExtUtil;
import org.springblade.desk.energy.excel.BsSafeInspectionPointExcel;
import org.springblade.desk.energy.pojo.entity.BsDosingRecEntity;
import org.springblade.desk.energy.pojo.entity.BsSafeInspectionPointEntity;
import org.springblade.desk.energy.pojo.vo.BsSafeInspectionPointVO;
import org.springblade.desk.energy.service.IBsSafeInspectionPointService;
@ -190,10 +192,18 @@ public class BsSafeInspectionPointController {
if (checkR != null) {
return checkR;
}
List<BsSafeInspectionPointEntity> importList = ExcelUtil.read(
file, 0, 1, BsSafeInspectionPointEntity.class
);
List<BsSafeInspectionPointEntity> importList;
try {
importList = ExcelUtil.read(
file, 0, 1, BsSafeInspectionPointEntity.class
);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
// 过滤空行和说明文字行(包含"注"字符的行)
importList = importList.stream()
.filter(item -> item != null

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.controller;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -184,9 +185,18 @@ public class BsTowerController extends BladeController {
if (checkR != null) {
return checkR;
}
List<BsTowerEntity> importList = ExcelUtil.read(
file, 0, 1, BsTowerEntity.class
);
List<BsTowerEntity> importList;
try {
importList = ExcelUtil.read(
file, 0, 1, BsTowerEntity.class
);
} catch (Exception e) {
// 捕获Excel读取时的类型转换异常
String errorMsg = ExceptionUtil.getMessage(e);
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确");
}
return R.status(bsTowerService.saveBatch(importList));
}
/**

@ -31,11 +31,11 @@
<if test="bsDosingRec.dorType!=null">
and n.DOR_TYPE = #{bsDosingRec.dorType}
</if>
<if test="bsDosingRec.device!=null">
and n.device = #{bsDosingRec.device}
<if test="bsDosingRec.device!=null and bsDosingRec.device!=''">
and n.device like '%' || #{bsDosingRec.device} || '%'
</if>
<if test="bsDosingRec.drug!=null">
and n.drug = #{bsDosingRec.drug}
<if test="bsDosingRec.drug!=null and bsDosingRec.drug!=''">
and n.drug like '%' || #{bsDosingRec.drug} || '%'
</if>
<if test="bsDosingRec.dose!=null">
and n.dose = #{bsDosingRec.dose}

@ -28,8 +28,8 @@
select * from BS_INS_TEST n
<where>
n.is_deleted = 0
<if test="bsInsTest.device!=null">
and n.DEVICE = #{bsInsTest.device}
<if test="bsInsTest.device!=null and bsInsTest.device!=''">
and n.DEVICE like '%' || #{bsInsTest.device} || '%'
</if>
<if test="bsInsTest.dosingMan!=null">
and n.DOSING_MAN = #{bsInsTest.dosingMan}

@ -27,11 +27,11 @@
select * from BS_TOWER n
<where>
n.is_deleted = 0
<if test="bsTower.btCode!=null">
and n.BT_CODE = #{bsTower.btCode}
<if test="bsTower.btCode!=null and bsTower.btCode!=''">
and n.BT_CODE like '%' || #{bsTower.btCode} || '%'
</if>
<if test="bsTower.btName!=null">
and n.BT_NAME = #{bsTower.btName}
<if test="bsTower.btName!=null and bsTower.btName!=''">
and n.BT_NAME like '%' || #{bsTower.btName} || '%'
</if>
<if test="bsTower.threshold!=null">
and n.THRESHOLD = #{bsTower.threshold}

@ -29,14 +29,14 @@
<if test="bsTowerReport.dealStatus!=null">
and n.DEAL_STATUS = #{bsTowerReport.dealStatus}
</if>
<if test="bsTowerReport.btCode!=null">
and n.BT_CODE = #{bsTowerReport.btCode}
<if test="bsTowerReport.btCode!=null and bsTowerReport.btCode!=''">
and n.BT_CODE like '%' || #{bsTowerReport.btCode} || '%'
</if>
<if test="bsTowerReport.errorPoint!=null">
and n.ERROR_POINT = #{bsTowerReport.errorPoint}
<if test="bsTowerReport.errorPoint!=null and bsTowerReport.errorPoint!=''">
and n.ERROR_POINT like '%' || #{bsTowerReport.errorPoint} || '%'
</if>
<if test="bsTowerReport.messText!=null">
and n.MESS_TEXT = #{bsTowerReport.messText}
<if test="bsTowerReport.messText!=null and bsTowerReport.messText!=''">
and n.MESS_TEXT like '%' || #{bsTowerReport.messText} || '%'
</if>
<if test="bsTowerReport.consLong!=null">
and n.CONS_LONG = #{bsTowerReport.consLong}

@ -36,8 +36,8 @@
select * from BS_WASTE_GAS_RUN_REC n
<where>
n.is_deleted = 0
<if test="bsWasteGasRunRec.deviceNum!=null">
and n.DEVICE_NUM = #{bsWasteGasRunRec.deviceNum}
<if test="bsWasteGasRunRec.deviceNum!=null and bsWasteGasRunRec.deviceNum!=''">
and n.DEVICE_NUM like '%' || #{bsWasteGasRunRec.deviceNum} || '%'
</if>
<if test="bsWasteGasRunRec.startTime !=null">
and n.START_TIME <![CDATA[ >= ]]> to_date(#{bsWasteGasRunRec.startTime},'YYYY-MM-DD HH24:MI:SS')

@ -48,17 +48,17 @@ public class BsTowerEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 名称
*/
@Schema(description = "名称")
private String btName;
/**
* 编码
*/
@Schema(description = "编码")
private String btCode;
/**
* 名称
*/
@Schema(description = "名称")
private String btName;
/**
* 药品名称
*/
@ -79,15 +79,17 @@ public class BsTowerEntity extends BaseEntity {
*/
@Schema(description = "风机报警点位")
private String fanPoint;
/**
* 风机运行点位
*/
@Schema(description = "风机运行点位")
private String fanRunPoint;
/**
* 循环泵报警点位
*/
@Schema(description = "循环泵报警点位")
private String pumpPoint;
/**
* 风机运行点位
*/
@Schema(description = "风机运行点位")
private String fanRunPoint;
}

@ -132,6 +132,7 @@ public class BsDosingRecServiceImpl extends BaseServiceImpl<BsDosingRecMapper, B
.orderByDesc(BsDosingRecEntity::getDosingTime));
if (bsDosingRecEntities.size() > 0) {
BsDosingRecEntity bsDosingRecEntity = bsDosingRecEntities.get(0);
//前端回显
bsDosingRecEntity.setBtCode(code);
return bsDosingRecEntity;
} else {

Loading…
Cancel
Save