新增能耗目标,能耗定额

liweidong
ShiJiuZhou 2 months ago
parent 1f7e71f88b
commit 0178e1e25c
  1. 161
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/EnergyQuotaController.java
  2. 161
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/controller/EnergyTargetController.java
  3. 116
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/excel/BsEnergyQuotaExcel.java
  4. 93
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/excel/BsEnergyTargetExcel.java
  5. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/EnergyQuotaMapper.java
  6. 35
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/EnergyQuotaMapper.xml
  7. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/EnergyTargetMapper.java
  8. 31
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/EnergyTargetMapper.xml
  9. 45
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/dto/BsEnergyQuotaDTO.java
  10. 45
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/dto/BsEnergyTargetDTO.java
  11. 93
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsEnergyQuotaEntity.java
  12. 74
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsEnergyTargetEntity.java
  13. 54
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/vo/BsEnergyQuotaVO.java
  14. 45
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/vo/BsEnergyTargetVO.java
  15. 61
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/IBsEnergyQuotaService.java
  16. 61
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/IBsEnergyTargetService.java
  17. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/EnergyQuotaServiceImpl.java
  18. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/EnergyTargetServiceImpl.java
  19. 73
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/wrapper/BsEnergyQuotaWrapper.java
  20. 59
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/wrapper/BsEnergyTargetWrapper.java

@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyQuotaVO;
import org.springblade.desk.energy.excel.BsEnergyQuotaExcel;
import org.springblade.desk.energy.wrapper.BsEnergyQuotaWrapper;
import org.springblade.desk.energy.service.IBsEnergyQuotaService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 能源定额 控制器
*
* @author BladeX
* @since 2026-03-02
*/
@RestController
@AllArgsConstructor
@RequestMapping("/bsEnergyQuota")
@Tag(name = "能源定额", description = "能源定额接口")
public class BsEnergyQuotaController extends BladeController {
private final IBsEnergyQuotaService bsEnergyQuotaService;
/**
* 能源定额 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入bsEnergyQuota")
public R<BsEnergyQuotaVO> detail(BsEnergyQuotaEntity bsEnergyQuota) {
BsEnergyQuotaEntity detail = bsEnergyQuotaService.getOne(Condition.getQueryWrapper(bsEnergyQuota));
return R.data(BsEnergyQuotaWrapper.build().entityVO(detail));
}
/**
* 能源定额 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入bsEnergyQuota")
public R<IPage<BsEnergyQuotaVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> bsEnergyQuota, Query query) {
IPage<BsEnergyQuotaEntity> pages = bsEnergyQuotaService.page(Condition.getPage(query), Condition.getQueryWrapper(bsEnergyQuota, BsEnergyQuotaEntity.class));
return R.data(BsEnergyQuotaWrapper.build().pageVO(pages));
}
/**
* 能源定额 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入bsEnergyQuota")
public R<IPage<BsEnergyQuotaVO>> page(BsEnergyQuotaVO bsEnergyQuota, Query query) {
IPage<BsEnergyQuotaVO> pages = bsEnergyQuotaService.selectBsEnergyQuotaPage(Condition.getPage(query), bsEnergyQuota);
return R.data(pages);
}
/**
* 能源定额 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入bsEnergyQuota")
public R save(@Valid @RequestBody BsEnergyQuotaEntity bsEnergyQuota) {
return R.status(bsEnergyQuotaService.save(bsEnergyQuota));
}
/**
* 能源定额 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入bsEnergyQuota")
public R update(@Valid @RequestBody BsEnergyQuotaEntity bsEnergyQuota) {
return R.status(bsEnergyQuotaService.updateById(bsEnergyQuota));
}
/**
* 能源定额 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入bsEnergyQuota")
public R submit(@Valid @RequestBody BsEnergyQuotaEntity bsEnergyQuota) {
return R.status(bsEnergyQuotaService.saveOrUpdate(bsEnergyQuota));
}
/**
* 能源定额 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(bsEnergyQuotaService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-bsEnergyQuota")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入bsEnergyQuota")
public void exportBsEnergyQuota(@Parameter(hidden = true) @RequestParam Map<String, Object> bsEnergyQuota, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BsEnergyQuotaEntity> queryWrapper = Condition.getQueryWrapper(bsEnergyQuota, BsEnergyQuotaEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(BsEnergyQuota::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(BsEnergyQuotaEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BsEnergyQuotaExcel> list = bsEnergyQuotaService.exportBsEnergyQuota(queryWrapper);
ExcelUtil.export(response, "能源定额数据" + DateUtil.time(), "能源定额数据表", list, BsEnergyQuotaExcel.class);
}
}

@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyTargetVO;
import org.springblade.desk.energy.excel.BsEnergyTargetExcel;
import org.springblade.desk.energy.wrapper.BsEnergyTargetWrapper;
import org.springblade.desk.energy.service.IBsEnergyTargetService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 能耗目标表 控制器
*
* @author BladeX
* @since 2026-03-02
*/
@RestController
@AllArgsConstructor
@RequestMapping("/bsEnergyTarget")
@Tag(name = "能耗目标表", description = "能耗目标表接口")
public class BsEnergyTargetController extends BladeController {
private final IBsEnergyTargetService bsEnergyTargetService;
/**
* 能耗目标表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入bsEnergyTarget")
public R<BsEnergyTargetVO> detail(BsEnergyTargetEntity bsEnergyTarget) {
BsEnergyTargetEntity detail = bsEnergyTargetService.getOne(Condition.getQueryWrapper(bsEnergyTarget));
return R.data(BsEnergyTargetWrapper.build().entityVO(detail));
}
/**
* 能耗目标表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入bsEnergyTarget")
public R<IPage<BsEnergyTargetVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> bsEnergyTarget, Query query) {
IPage<BsEnergyTargetEntity> pages = bsEnergyTargetService.page(Condition.getPage(query), Condition.getQueryWrapper(bsEnergyTarget, BsEnergyTargetEntity.class));
return R.data(BsEnergyTargetWrapper.build().pageVO(pages));
}
/**
* 能耗目标表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入bsEnergyTarget")
public R<IPage<BsEnergyTargetVO>> page(BsEnergyTargetVO bsEnergyTarget, Query query) {
IPage<BsEnergyTargetVO> pages = bsEnergyTargetService.selectBsEnergyTargetPage(Condition.getPage(query), bsEnergyTarget);
return R.data(pages);
}
/**
* 能耗目标表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入bsEnergyTarget")
public R save(@Valid @RequestBody BsEnergyTargetEntity bsEnergyTarget) {
return R.status(bsEnergyTargetService.save(bsEnergyTarget));
}
/**
* 能耗目标表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入bsEnergyTarget")
public R update(@Valid @RequestBody BsEnergyTargetEntity bsEnergyTarget) {
return R.status(bsEnergyTargetService.updateById(bsEnergyTarget));
}
/**
* 能耗目标表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入bsEnergyTarget")
public R submit(@Valid @RequestBody BsEnergyTargetEntity bsEnergyTarget) {
return R.status(bsEnergyTargetService.saveOrUpdate(bsEnergyTarget));
}
/**
* 能耗目标表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(bsEnergyTargetService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-bsEnergyTarget")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入bsEnergyTarget")
public void exportBsEnergyTarget(@Parameter(hidden = true) @RequestParam Map<String, Object> bsEnergyTarget, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BsEnergyTargetEntity> queryWrapper = Condition.getQueryWrapper(bsEnergyTarget, BsEnergyTargetEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(BsEnergyTarget::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(BsEnergyTargetEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BsEnergyTargetExcel> list = bsEnergyTargetService.exportBsEnergyTarget(queryWrapper);
ExcelUtil.export(response, "能耗目标表数据" + DateUtil.time(), "能耗目标表数据表", list, BsEnergyTargetExcel.class);
}
}

@ -0,0 +1,116 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.excel;
import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 能源定额 Excel实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BsEnergyQuotaExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ColumnWidth(20)
@ExcelProperty("ID")
private Long id;
/**
* 类型 1-用水 2-用电
*/
@ColumnWidth(20)
@ExcelProperty("类型 1-用水 2-用电")
private String type;
/**
* 作业中心ID
*/
@ColumnWidth(20)
@ExcelProperty("作业中心ID")
private Long workCenterId;
/**
* 设备ID
*/
@ColumnWidth(20)
@ExcelProperty("设备ID")
private Long equipmentId;
/**
* 月份
*/
@ColumnWidth(20)
@ExcelProperty("月份")
private String month;
/**
* 日期
*/
@ColumnWidth(20)
@ExcelProperty("日期")
private String date;
/**
* 自来水用水量
*/
@ColumnWidth(20)
@ExcelProperty("自来水用水量")
private Long tapWaterNum;
/**
* 纯水用水量
*/
@ColumnWidth(20)
@ExcelProperty("纯水用水量")
private Long pureWaterNum;
/**
* 用电量
*/
@ColumnWidth(20)
@ExcelProperty("用电量")
private Long electricNum;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Long isDeleted;
}

@ -0,0 +1,93 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 能耗目标表 Excel实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BsEnergyTargetExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ColumnWidth(20)
@ExcelProperty("ID")
private Long id;
/**
* 类型 1-用水 2-用电
*/
@ColumnWidth(20)
@ExcelProperty("类型 1-用水 2-用电")
private String type;
/**
* 月份
*/
@ColumnWidth(20)
@ExcelProperty("月份")
private String month;
/**
* 日期
*/
@ColumnWidth(20)
@ExcelProperty("日期")
private String date;
/**
* 目标
*/
@ColumnWidth(20)
@ExcelProperty("目标")
private Long target;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Long isDeleted;
}

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.mapper;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyQuotaVO;
import org.springblade.desk.energy.excel.BsEnergyQuotaExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 能源定额 Mapper 接口
*
* @author BladeX
* @since 2026-03-02
*/
public interface BsEnergyQuotaMapper extends BaseMapper<BsEnergyQuotaEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param bsEnergyQuota 查询参数
* @return List<BsEnergyQuotaVO>
*/
List<BsEnergyQuotaVO> selectBsEnergyQuotaPage(IPage page, BsEnergyQuotaVO bsEnergyQuota);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<BsEnergyQuotaExcel>
*/
List<BsEnergyQuotaExcel> exportBsEnergyQuota(@Param("ew") Wrapper<BsEnergyQuotaEntity> queryWrapper);
}

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.desk.energy.mapper.BsEnergyQuotaMapper">
<!-- 通用查询映射结果 -->
<resultMap id="bsEnergyQuotaResultMap" type="org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity">
<result column="ID" property="id"/>
<result column="TYPE" property="type"/>
<result column="WORK_CENTER_ID" property="workCenterId"/>
<result column="EQUIPMENT_ID" property="equipmentId"/>
<result column="MONTH" property="month"/>
<result column="DATE" property="date"/>
<result column="TAP_WATER_NUM" property="tapWaterNum"/>
<result column="PURE_WATER_NUM" property="pureWaterNum"/>
<result column="ELECTRIC_NUM" property="electricNum"/>
<result column="CREATE_USER" property="createUser"/>
<result column="CREATE_DEPT" property="createDept"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="STATUS" property="status"/>
<result column="IS_DELETED" property="isDeleted"/>
</resultMap>
<select id="selectBsEnergyQuotaPage" resultMap="bsEnergyQuotaResultMap">
select * from BS_ENERGY_QUOTA where is_deleted = 0
</select>
<select id="exportBsEnergyQuota" resultType="org.springblade.desk.energy.excel.BsEnergyQuotaExcel">
SELECT * FROM BS_ENERGY_QUOTA ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.mapper;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyTargetVO;
import org.springblade.desk.energy.excel.BsEnergyTargetExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 能耗目标表 Mapper 接口
*
* @author BladeX
* @since 2026-03-02
*/
public interface BsEnergyTargetMapper extends BaseMapper<BsEnergyTargetEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param bsEnergyTarget 查询参数
* @return List<BsEnergyTargetVO>
*/
List<BsEnergyTargetVO> selectBsEnergyTargetPage(IPage page, BsEnergyTargetVO bsEnergyTarget);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<BsEnergyTargetExcel>
*/
List<BsEnergyTargetExcel> exportBsEnergyTarget(@Param("ew") Wrapper<BsEnergyTargetEntity> queryWrapper);
}

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.desk.energy.mapper.BsEnergyTargetMapper">
<!-- 通用查询映射结果 -->
<resultMap id="bsEnergyTargetResultMap" type="org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity">
<result column="ID" property="id"/>
<result column="TYPE" property="type"/>
<result column="MONTH" property="month"/>
<result column="DATE" property="date"/>
<result column="TARGET" property="target"/>
<result column="CREATE_USER" property="createUser"/>
<result column="CREATE_DEPT" property="createDept"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="STATUS" property="status"/>
<result column="IS_DELETED" property="isDeleted"/>
</resultMap>
<select id="selectBsEnergyTargetPage" resultMap="bsEnergyTargetResultMap">
select * from BS_ENERGY_TARGET where is_deleted = 0
</select>
<select id="exportBsEnergyTarget" resultType="org.springblade.desk.energy.excel.BsEnergyTargetExcel">
SELECT * FROM BS_ENERGY_TARGET ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.dto;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 能源定额 数据传输对象实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BsEnergyQuotaDTO extends BsEnergyQuotaEntity {
@Serial
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.dto;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 能耗目标表 数据传输对象实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BsEnergyTargetDTO extends BsEnergyTargetEntity {
@Serial
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,93 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 能源定额 实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@TableName("BS_ENERGY_QUOTA")
@Schema(description = "BsEnergyQuota对象")
@EqualsAndHashCode(callSuper = true)
public class BsEnergyQuotaEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 类型 1-用水 2-用电
*/
@Schema(description = "类型 1-用水 2-用电")
private String type;
/**
* 作业中心ID
*/
@Schema(description = "作业中心ID")
private Long workCenterId;
/**
* 设备ID
*/
@Schema(description = "设备ID")
private Long equipmentId;
/**
* 月份
*/
@Schema(description = "月份")
private String month;
/**
* 日期
*/
@Schema(description = "日期")
private String date;
/**
* 自来水用水量
*/
@Schema(description = "自来水用水量")
private Long tapWaterNum;
/**
* 纯水用水量
*/
@Schema(description = "纯水用水量")
private Long pureWaterNum;
/**
* 用电量
*/
@Schema(description = "用电量")
private Long electricNum;
}

@ -0,0 +1,74 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 能耗目标表 实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@TableName("BS_ENERGY_TARGET")
@Schema(description = "BsEnergyTarget对象")
@EqualsAndHashCode(callSuper = true)
public class BsEnergyTargetEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 类型 1-用水 2-用电
*/
@Schema(description = "类型 1-用水 2-用电")
private String type;
/**
* 月份
*/
@Schema(description = "月份")
private String month;
/**
* 日期
*/
@Schema(description = "日期")
private String date;
/**
* 目标
*/
@Schema(description = "目标")
private Long target;
}

@ -0,0 +1,54 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.vo;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 能源定额 视图实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BsEnergyQuotaVO extends BsEnergyQuotaEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 作业中心名称
*/
private String workCenterName;
/**
* 设备名称
*/
private String equipmentName;
}

@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.pojo.vo;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 能耗目标表 视图实体类
*
* @author BladeX
* @since 2026-03-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BsEnergyTargetVO extends BsEnergyTargetEntity {
@Serial
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyQuotaVO;
import org.springblade.desk.energy.excel.BsEnergyQuotaExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 能源定额 服务类
*
* @author BladeX
* @since 2026-03-02
*/
public interface IBsEnergyQuotaService extends BaseService<BsEnergyQuotaEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param bsEnergyQuota 查询参数
* @return IPage<BsEnergyQuotaVO>
*/
IPage<BsEnergyQuotaVO> selectBsEnergyQuotaPage(IPage<BsEnergyQuotaVO> page, BsEnergyQuotaVO bsEnergyQuota);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<BsEnergyQuotaExcel>
*/
List<BsEnergyQuotaExcel> exportBsEnergyQuota(Wrapper<BsEnergyQuotaEntity> queryWrapper);
}

@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyTargetVO;
import org.springblade.desk.energy.excel.BsEnergyTargetExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 能耗目标表 服务类
*
* @author BladeX
* @since 2026-03-02
*/
public interface IBsEnergyTargetService extends BaseService<BsEnergyTargetEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param bsEnergyTarget 查询参数
* @return IPage<BsEnergyTargetVO>
*/
IPage<BsEnergyTargetVO> selectBsEnergyTargetPage(IPage<BsEnergyTargetVO> page, BsEnergyTargetVO bsEnergyTarget);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<BsEnergyTargetExcel>
*/
List<BsEnergyTargetExcel> exportBsEnergyTarget(Wrapper<BsEnergyTargetEntity> queryWrapper);
}

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.service.impl;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyQuotaVO;
import org.springblade.desk.energy.excel.BsEnergyQuotaExcel;
import org.springblade.desk.energy.mapper.BsEnergyQuotaMapper;
import org.springblade.desk.energy.service.IBsEnergyQuotaService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 能源定额 服务实现类
*
* @author BladeX
* @since 2026-03-02
*/
@Service
public class BsEnergyQuotaServiceImpl extends BaseServiceImpl<BsEnergyQuotaMapper, BsEnergyQuotaEntity> implements IBsEnergyQuotaService {
@Override
public IPage<BsEnergyQuotaVO> selectBsEnergyQuotaPage(IPage<BsEnergyQuotaVO> page, BsEnergyQuotaVO bsEnergyQuota) {
return page.setRecords(baseMapper.selectBsEnergyQuotaPage(page, bsEnergyQuota));
}
@Override
public List<BsEnergyQuotaExcel> exportBsEnergyQuota(Wrapper<BsEnergyQuotaEntity> queryWrapper) {
List<BsEnergyQuotaExcel> bsEnergyQuotaList = baseMapper.exportBsEnergyQuota(queryWrapper);
//bsEnergyQuotaList.forEach(bsEnergyQuota -> {
// bsEnergyQuota.setTypeName(DictCache.getValue(DictEnum.YES_NO, BsEnergyQuota.getType()));
//});
return bsEnergyQuotaList;
}
}

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.service.impl;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyTargetVO;
import org.springblade.desk.energy.excel.BsEnergyTargetExcel;
import org.springblade.desk.energy.mapper.BsEnergyTargetMapper;
import org.springblade.desk.energy.service.IBsEnergyTargetService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 能耗目标表 服务实现类
*
* @author BladeX
* @since 2026-03-02
*/
@Service
public class BsEnergyTargetServiceImpl extends BaseServiceImpl<BsEnergyTargetMapper, BsEnergyTargetEntity> implements IBsEnergyTargetService {
@Override
public IPage<BsEnergyTargetVO> selectBsEnergyTargetPage(IPage<BsEnergyTargetVO> page, BsEnergyTargetVO bsEnergyTarget) {
return page.setRecords(baseMapper.selectBsEnergyTargetPage(page, bsEnergyTarget));
}
@Override
public List<BsEnergyTargetExcel> exportBsEnergyTarget(Wrapper<BsEnergyTargetEntity> queryWrapper) {
List<BsEnergyTargetExcel> bsEnergyTargetList = baseMapper.exportBsEnergyTarget(queryWrapper);
//bsEnergyTargetList.forEach(bsEnergyTarget -> {
// bsEnergyTarget.setTypeName(DictCache.getValue(DictEnum.YES_NO, BsEnergyTarget.getType()));
//});
return bsEnergyTargetList;
}
}

@ -0,0 +1,73 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.wrapper;
import jakarta.annotation.Resource;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.desk.basic.pojo.entity.WorkCenter;
import org.springblade.desk.basic.service.IWorkCenterService;
import org.springblade.desk.device.pojo.entity.EquipmentEntity;
import org.springblade.desk.device.service.IEquipmentService;
import org.springblade.desk.energy.pojo.entity.BsEnergyQuotaEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyQuotaVO;
import java.util.Objects;
import java.util.Optional;
/**
* 能源定额 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-03-02
*/
public class BsEnergyQuotaWrapper extends BaseEntityWrapper<BsEnergyQuotaEntity, BsEnergyQuotaVO> {
@Resource
private IWorkCenterService iWorkCenterService;
@Resource
private IEquipmentService iEquipmentService;
public static BsEnergyQuotaWrapper build() {
return new BsEnergyQuotaWrapper();
}
@Override
public BsEnergyQuotaVO entityVO(BsEnergyQuotaEntity bsEnergyQuota) {
BsEnergyQuotaVO bsEnergyQuotaVO = Objects.requireNonNull(BeanUtil.copyProperties(bsEnergyQuota, BsEnergyQuotaVO.class));
WorkCenter workCenter = iWorkCenterService.getById(bsEnergyQuota.getWorkCenterId());
if (workCenter != null) {
bsEnergyQuotaVO.setWorkCenterName(workCenter.getWcName());
}
EquipmentEntity equipmentEntity = iEquipmentService.getById(bsEnergyQuota.getEquipmentId());
if (equipmentEntity != null) {
bsEnergyQuotaVO.setEquipmentName(equipmentEntity.getDeviceName());
}
return bsEnergyQuotaVO;
}
}

@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.desk.energy.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.desk.energy.pojo.entity.BsEnergyTargetEntity;
import org.springblade.desk.energy.pojo.vo.BsEnergyTargetVO;
import java.util.Objects;
/**
* 能耗目标表 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-03-02
*/
public class BsEnergyTargetWrapper extends BaseEntityWrapper<BsEnergyTargetEntity, BsEnergyTargetVO> {
public static BsEnergyTargetWrapper build() {
return new BsEnergyTargetWrapper();
}
@Override
public BsEnergyTargetVO entityVO(BsEnergyTargetEntity bsEnergyTarget) {
BsEnergyTargetVO bsEnergyTargetVO = Objects.requireNonNull(BeanUtil.copyProperties(bsEnergyTarget, BsEnergyTargetVO.class));
//User createUser = UserCache.getUser(bsEnergyTarget.getCreateUser());
//User updateUser = UserCache.getUser(bsEnergyTarget.getUpdateUser());
//bsEnergyTargetVO.setCreateUserName(createUser.getName());
//bsEnergyTargetVO.setUpdateUserName(updateUser.getName());
return bsEnergyTargetVO;
}
}
Loading…
Cancel
Save