From d8c3936fae902251cb9837479e251b7840b8bcd6 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Mon, 25 Aug 2025 20:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=83=AD=E9=87=8F=E6=B0=B4?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlWaterFlowConfigController.java | 186 ++++++++++++++++++ .../entity/BlWaterFlowConfig.java | 97 +++++++++ .../mapper/BlWaterFlowConfigMapper.java | 17 ++ .../mapper/xml/BlWaterFlowConfigMapper.xml | 5 + .../service/IBlWaterFlowConfigService.java | 14 ++ .../impl/BlWaterFlowConfigServiceImpl.java | 19 ++ .../src/main/resources/application-dev.yml | 2 +- 7 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/controller/BlWaterFlowConfigController.java create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/entity/BlWaterFlowConfig.java create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/BlWaterFlowConfigMapper.java create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/xml/BlWaterFlowConfigMapper.xml create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/IBlWaterFlowConfigService.java create mode 100644 jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/impl/BlWaterFlowConfigServiceImpl.java diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/controller/BlWaterFlowConfigController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/controller/BlWaterFlowConfigController.java new file mode 100644 index 0000000..81f5dd5 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/controller/BlWaterFlowConfigController.java @@ -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 { + @Autowired + private IBlWaterFlowConfigService blWaterFlowConfigService; + + /** + * 分页列表查询 + * + * @param blWaterFlowConfig + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "热量水流量配置-分页列表查询") + @ApiOperation(value="热量水流量配置-分页列表查询", notes="热量水流量配置-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(BlWaterFlowConfig blWaterFlowConfig, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + // 自定义查询规则 + Map 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 queryWrapper = QueryGenerator.initQueryWrapper(blWaterFlowConfig, req.getParameterMap(),customeRuleMap); + Page page = new Page(pageNo, pageSize); + IPage 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 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 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 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 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 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); + } + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/entity/BlWaterFlowConfig.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/entity/BlWaterFlowConfig.java new file mode 100644 index 0000000..9c56fe2 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/entity/BlWaterFlowConfig.java @@ -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; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/BlWaterFlowConfigMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/BlWaterFlowConfigMapper.java new file mode 100644 index 0000000..97979e9 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/BlWaterFlowConfigMapper.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/xml/BlWaterFlowConfigMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/xml/BlWaterFlowConfigMapper.xml new file mode 100644 index 0000000..ffe2d74 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/mapper/xml/BlWaterFlowConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/IBlWaterFlowConfigService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/IBlWaterFlowConfigService.java new file mode 100644 index 0000000..f879490 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/IBlWaterFlowConfigService.java @@ -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 { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/impl/BlWaterFlowConfigServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/impl/BlWaterFlowConfigServiceImpl.java new file mode 100644 index 0000000..cfd6146 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/waterFlowConfig/service/impl/BlWaterFlowConfigServiceImpl.java @@ -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 implements IBlWaterFlowConfigService { + +} diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml b/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml index 6e98ca6..058d837 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml +++ b/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml @@ -1,5 +1,5 @@ server: - port: 8080 + port: 8086 tomcat: max-swallow-size: -1 error: