This commit is contained in:
1378012178@qq.com 2025-08-25 21:16:04 +08:00
commit 2c27a70312
7 changed files with 339 additions and 1 deletions

View File

@ -0,0 +1,186 @@
package org.jeecg.modules.waterFlowConfig.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.waterFlowConfig.entity.BlWaterFlowConfig;
import org.jeecg.modules.waterFlowConfig.service.IBlWaterFlowConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 热量水流量配置
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Version: V1.0
*/
@Api(tags="热量水流量配置")
@RestController
@RequestMapping("/waterFlowConfig/blWaterFlowConfig")
@Slf4j
public class BlWaterFlowConfigController extends JeecgController<BlWaterFlowConfig, IBlWaterFlowConfigService> {
@Autowired
private IBlWaterFlowConfigService blWaterFlowConfigService;
/**
* 分页列表查询
*
* @param blWaterFlowConfig
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "热量水流量配置-分页列表查询")
@ApiOperation(value="热量水流量配置-分页列表查询", notes="热量水流量配置-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<BlWaterFlowConfig>> queryPageList(BlWaterFlowConfig blWaterFlowConfig,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("companyCompanyId", QueryRuleEnum.LIKE_WITH_OR);
customeRuleMap.put("sourceSourceId", QueryRuleEnum.LIKE_WITH_OR);
customeRuleMap.put("stationStationId", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<BlWaterFlowConfig> queryWrapper = QueryGenerator.initQueryWrapper(blWaterFlowConfig, req.getParameterMap(),customeRuleMap);
Page<BlWaterFlowConfig> page = new Page<BlWaterFlowConfig>(pageNo, pageSize);
IPage<BlWaterFlowConfig> pageList = blWaterFlowConfigService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param blWaterFlowConfig
* @return
*/
@AutoLog(value = "热量水流量配置-添加")
@ApiOperation(value="热量水流量配置-添加", notes="热量水流量配置-添加")
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody BlWaterFlowConfig blWaterFlowConfig) {
blWaterFlowConfigService.save(blWaterFlowConfig);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param blWaterFlowConfig
* @return
*/
@AutoLog(value = "热量水流量配置-编辑")
@ApiOperation(value="热量水流量配置-编辑", notes="热量水流量配置-编辑")
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody BlWaterFlowConfig blWaterFlowConfig) {
blWaterFlowConfigService.updateById(blWaterFlowConfig);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "热量水流量配置-通过id删除")
@ApiOperation(value="热量水流量配置-通过id删除", notes="热量水流量配置-通过id删除")
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
blWaterFlowConfigService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "热量水流量配置-批量删除")
@ApiOperation(value="热量水流量配置-批量删除", notes="热量水流量配置-批量删除")
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.blWaterFlowConfigService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "热量水流量配置-通过id查询")
@ApiOperation(value="热量水流量配置-通过id查询", notes="热量水流量配置-通过id查询")
@GetMapping(value = "/queryById")
public Result<BlWaterFlowConfig> queryById(@RequestParam(name="id",required=true) String id) {
BlWaterFlowConfig blWaterFlowConfig = blWaterFlowConfigService.getById(id);
if(blWaterFlowConfig==null) {
return Result.error("未找到对应数据");
}
return Result.OK(blWaterFlowConfig);
}
/**
* 导出excel
*
* @param request
* @param blWaterFlowConfig
*/
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, BlWaterFlowConfig blWaterFlowConfig) {
return super.exportXls(request, blWaterFlowConfig, BlWaterFlowConfig.class, "热量水流量配置");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("waterFlowConfig:bl_water_flow_config:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, BlWaterFlowConfig.class);
}
}

View File

@ -0,0 +1,97 @@
package org.jeecg.modules.waterFlowConfig.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 热量水流量配置
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Version: V1.0
*/
@Data
@TableName("bl_water_flow_config")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="bl_water_flow_config对象", description="热量水流量配置")
public class BlWaterFlowConfig implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.Integer id;
/**sn*/
@Excel(name = "sn", width = 15)
@ApiModelProperty(value = "sn")
private java.lang.String sn;
/**注册设备时间*/
@Excel(name = "注册设备时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "注册设备时间")
private java.util.Date occurtime;
/**公司名称*/
@Excel(name = "公司名称", width = 15, dictTable = "bl_thermalcompany", dicText = "company_name", dicCode = "id")
@Dict(dictTable = "bl_thermalcompany", dicText = "company_name", dicCode = "id")
@ApiModelProperty(value = "公司名称")
private java.lang.Integer companyCompanyId;
/**热源名称*/
@Excel(name = "热源名称", width = 15, dictTable = "bl_heatsource", dicText = "source_name", dicCode = "id")
@Dict(dictTable = "bl_heatsource", dicText = "source_name", dicCode = "id")
@ApiModelProperty(value = "热源名称")
private java.lang.Integer sourceSourceId;
/**换热站名称*/
@Excel(name = "换热站名称", width = 15, dictTable = "bl_heatsourcestation", dicText = "station_name", dicCode = "id")
@Dict(dictTable = "bl_heatsourcestation", dicText = "station_name", dicCode = "id")
@ApiModelProperty(value = "换热站名称")
private java.lang.Integer stationStationId;
/**热力分所名称*/
@Excel(name = "热力分所名称", width = 15)
@ApiModelProperty(value = "热力分所名称")
private java.lang.Integer substationId;
/**创建者*/
@ApiModelProperty(value = "创建者")
private java.lang.String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private java.util.Date createDate;
/**更改者*/
@ApiModelProperty(value = "更改者")
private java.lang.String updateBy;
/**更改时间*/
@Excel(name = "更改时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更改时间")
private java.util.Date updateDate;
/**删除标识*/
@Excel(name = "删除标识", width = 15)
@ApiModelProperty(value = "删除标识")
@TableLogic
private java.lang.String delFlag;
/**地区类型*/
@Excel(name = "地区类型", width = 15)
@ApiModelProperty(value = "地区类型")
private java.lang.String regionType;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.waterFlowConfig.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.waterFlowConfig.entity.BlWaterFlowConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 热量水流量配置
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Version: V1.0
*/
public interface BlWaterFlowConfigMapper extends BaseMapper<BlWaterFlowConfig> {
}

View File

@ -0,0 +1,5 @@
<?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.jeecg.modules.waterFlowConfig.mapper.BlWaterFlowConfigMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.waterFlowConfig.service;
import org.jeecg.modules.waterFlowConfig.entity.BlWaterFlowConfig;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 热量水流量配置
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Version: V1.0
*/
public interface IBlWaterFlowConfigService extends IService<BlWaterFlowConfig> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.waterFlowConfig.service.impl;
import org.jeecg.modules.waterFlowConfig.entity.BlWaterFlowConfig;
import org.jeecg.modules.waterFlowConfig.mapper.BlWaterFlowConfigMapper;
import org.jeecg.modules.waterFlowConfig.service.IBlWaterFlowConfigService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 热量水流量配置
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Version: V1.0
*/
@Service
public class BlWaterFlowConfigServiceImpl extends ServiceImpl<BlWaterFlowConfigMapper, BlWaterFlowConfig> implements IBlWaterFlowConfigService {
}

View File

@ -1,5 +1,5 @@
server:
port: 8080
port: 8086
tomcat:
max-swallow-size: -1
error: