JX.Li vor 1 Jahr
Ursprung
Commit
417d452283

+ 66 - 5
ruoyi-gas/src/main/java/com/ruoyi/gas/controller/GPressureRegulatingBoxController.java

@@ -1,9 +1,11 @@
 package com.ruoyi.gas.controller;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
@@ -11,7 +13,9 @@ import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.gas.domain.bo.GPressureRegulatingBoxBo;
+import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxExcelVo;
 import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxVo;
+import com.ruoyi.gas.service.IGPressureRegulatingBoxDetailsService;
 import com.ruoyi.gas.service.IGPressureRegulatingBoxService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -20,12 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 
 /**
  * 调压箱管理Controller
@@ -51,6 +55,8 @@ public class GPressureRegulatingBoxController extends BaseController {
     public TableDataInfo<GPressureRegulatingBoxVo> list(@Validated(QueryGroup.class) GPressureRegulatingBoxBo bo) {
         return iGPressureRegulatingBoxService.queryPageList(bo);
     }
+    @Autowired
+    private IGPressureRegulatingBoxDetailsService pressureRegulatingBoxDetailsService;
 
     /**
      * 导出调压箱管理列表
@@ -60,10 +66,65 @@ public class GPressureRegulatingBoxController extends BaseController {
     @Log(title = "调压箱管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated GPressureRegulatingBoxBo bo, HttpServletResponse response) {
-        List<GPressureRegulatingBoxVo> list = iGPressureRegulatingBoxService.queryList(bo);
-        ExcelUtil.exportExcel(list, "调压箱管理", GPressureRegulatingBoxVo.class, response);
+        List<GPressureRegulatingBoxExcelVo> excelList = iGPressureRegulatingBoxService.getExcelList();
+        ExcelUtil.exportExcel(excelList, "调压箱管理", GPressureRegulatingBoxExcelVo.class, response);
+    }
+    private String bfb="0";
+    private String message;
+    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        List<GPressureRegulatingBoxExcelVo> listVo = ExcelUtil.importExcel(file.getInputStream(), GPressureRegulatingBoxExcelVo.class);
+        List<GPressureRegulatingBoxExcelVo> list = BeanUtil.copyToList(listVo, GPressureRegulatingBoxExcelVo.class);
+        LoginUser loginUser = getLoginUser();
+        String operName = loginUser.getUsername();
+        if(Double.valueOf(bfb)<=0){
+            forImportData(list,true,operName,0,0);
+        }
+        return AjaxResult.success(message);
+    }
+    private void forImportData(List<GPressureRegulatingBoxExcelVo> list, Boolean isUpdateSupport, String operName,int n,int successNum) throws Exception
+    {
+        try{
+            Map<String,Object> ret = iGPressureRegulatingBoxService.importVo(list, isUpdateSupport, operName,n,successNum); //list, updateSupport, operName,第几条
+            if(Boolean.valueOf(ret.get("is_success").toString())){
+                bfb = ret.get("bfb").toString();
+                forImportData(list,isUpdateSupport,operName,Integer.valueOf(ret.get("n").toString()),Integer.valueOf(ret.get("successNum").toString()));
+            }else{
+                message = ret.get("successMsg").toString();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            message = e.getMessage();
+        }
+    }
+    @GetMapping("/importTemplate")
+    @Log(title = "下载导入模板", businessType = BusinessType.EXPORT)
+    public void importTemplate(HttpServletResponse response) {
+        ExcelUtil.exportExcel(new ArrayList<>(), "调压箱", GPressureRegulatingBoxExcelVo.class, response);
+    }
+    /**
+     * 进度条刷新,
+     */
+    @GetMapping(value = "/flushProgress")
+    public AjaxResult<Map> flushProgress() throws Exception
+    {
+        Map<String,String> ret = new HashMap<>();
+        ret.put("bfb",bfb);
+        ret.put("message",message);
+        return AjaxResult.success(ret);
+    }
+    /**
+     * 结束进度条刷新,
+     */
+    @GetMapping(value = "/clearFlushProgress")
+    public AjaxResult<Void> clearFlushProgress() throws Exception
+    {
+        bfb="0";
+        message="";
+        return AjaxResult.success();
     }
-
     /**
      * 获取调压箱管理详细信息
      */

+ 2 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/GPressureRegulatingBox.java

@@ -45,6 +45,8 @@ public class GPressureRegulatingBox extends BaseEntity {
      * 编号
      */
     private String number;
+    private String inspectionFrequency;
+    private String inspector;
     /**
      * 名称
      */

+ 3 - 5
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/GPressureRegulatingBoxDetails.java

@@ -7,8 +7,6 @@ import com.ruoyi.common.core.domain.BaseEntity;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
-import java.util.Date;
-
 /**
  * 调压箱详情对象 g_pressure_regulating_box_details
  *
@@ -27,15 +25,15 @@ public class GPressureRegulatingBoxDetails extends BaseEntity {
      */
     @TableId(value = "id")
     private Long id;
-    private Date receivingTime;
-    private Long totalNumberOfHouseholds;
+    private String receivingTime;
+    private String totalNumberOfHouseholds;
     private String positionOfPressureRegulatingBox;
     private String controlRange;
     private String mainPowerSupplyPosition;
     /**
      * 调压箱id
      */
-    private Long regulatingBoxId;
+    private String regulatingBoxId;
     /**
      * 阀井位置
      */

+ 2 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/bo/GPressureRegulatingBoxBo.java

@@ -75,6 +75,8 @@ public class GPressureRegulatingBoxBo extends BaseEntity {
     @ApiModelProperty(value = "经度", required = true)
     @NotBlank(message = "经度不能为空", groups = { AddGroup.class, EditGroup.class })
     private String longitude;
+    private String inspectionFrequency;
+    private String inspector;
 
     /**
      * 纬度

+ 3 - 7
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/bo/GPressureRegulatingBoxDetailsBo.java

@@ -1,16 +1,13 @@
 package com.ruoyi.gas.domain.bo;
 
 import com.ruoyi.common.core.domain.BaseEntity;
-import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
-import java.util.Date;
 
 /**
  * 调压箱详情业务对象 g_pressure_regulating_box_details
@@ -30,7 +27,7 @@ public class GPressureRegulatingBoxDetailsBo extends BaseEntity {
     @ApiModelProperty(value = "序号", required = true)
     @NotNull(message = "序号不能为空", groups = { EditGroup.class })
     private Long id;
-    private Long totalNumberOfHouseholds;
+    private String totalNumberOfHouseholds;
     private String positionOfPressureRegulatingBox;
     private String controlRange;
     private String mainPowerSupplyPosition;
@@ -39,10 +36,9 @@ public class GPressureRegulatingBoxDetailsBo extends BaseEntity {
      * 调压箱id
      */
     @ApiModelProperty(value = "调压箱id", required = true)
-    @NotNull(message = "调压箱id不能为空", groups = { AddGroup.class, EditGroup.class })
-    private Long regulatingBoxId;
+    private String regulatingBoxId;
 
-    private Date receivingTime;
+    private String receivingTime;
 
     /**
      * 阀井位置

+ 3 - 6
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/vo/GPressureRegulatingBoxDetailsVo.java

@@ -6,8 +6,6 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.util.Date;
-
 
 
 /**
@@ -29,8 +27,8 @@ public class GPressureRegulatingBoxDetailsVo {
 	@ExcelProperty(value = "序号")
 	@ApiModelProperty("序号")
 	private Long id;
-	private Date receivingTime;
-	private Long totalNumberOfHouseholds;
+	private String receivingTime;
+	private String totalNumberOfHouseholds;
 	private String positionOfPressureRegulatingBox;
 	private String controlRange;
 	private String mainPowerSupplyPosition;
@@ -38,8 +36,7 @@ public class GPressureRegulatingBoxDetailsVo {
      * 调压箱id
      */
 	@ExcelProperty(value = "调压箱id")
-	@ApiModelProperty("调压箱id")
-	private Long regulatingBoxId;
+	private String regulatingBoxId;
 
     /**
      * 阀井位置

+ 151 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/vo/GPressureRegulatingBoxExcelVo.java

@@ -0,0 +1,151 @@
+package com.ruoyi.gas.domain.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ExcelIgnoreUnannotated
+public class GPressureRegulatingBoxExcelVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @ExcelProperty(value = "序号")
+    private String id;
+    /**
+     * 性质
+     */
+    @ExcelProperty(value = "性质")
+    private String nature;
+
+    /**
+     * 类型
+     */
+    @ExcelProperty(value = "类型")
+    private String type;
+
+    /**
+     * 路数
+     */
+    @ExcelProperty(value = "路数")
+    private String numberOfRoutes;
+
+    /**
+     * 管理所
+     */
+    @ExcelProperty(value = "管理所")
+    private String managementOffice;
+
+    /**
+     * 编号
+     */
+    @ExcelProperty(value = "编号")
+    private String number;
+
+    /**
+     * 名称
+     */
+    @ExcelProperty(value = "名称")
+    private String name;
+
+    @ExcelProperty(value = "接收时间")
+    private String receivingTime;
+    @ExcelProperty(value = "总户数")
+    private String totalNumberOfHouseholds;
+    @ExcelProperty(value = "调压箱位置")
+    private String positionOfPressureRegulatingBox;
+    @ExcelProperty(value = "控制范围")
+    private String controlRange;
+    @ExcelProperty(value = "主电源位置")
+    private String mainPowerSupplyPosition;
+    /**
+     * 阀井位置
+     */
+    @ExcelProperty(value = "阀井位置")
+    private String valveWellPosition;
+
+    /**
+     * 阀井钥匙形状
+     */
+    @ExcelProperty(value = "阀井钥匙形状")
+    private String valveWellKeyShape;
+
+    /**
+     * 厂家
+     */
+    @ExcelProperty(value = "厂家")
+    private String manufacturer;
+
+    /**
+     * 流量
+     */
+    @ExcelProperty(value = "流量")
+    private String flow;
+
+    /**
+     * 进口管径
+     */
+    @ExcelProperty(value = "进口管径")
+    private String importPipeDiameter;
+
+    /**
+     * 出口管径
+     */
+    @ExcelProperty(value = "出口管径")
+    private String outletPipeDiameter;
+
+    /**
+     * 旁通管径
+     */
+    @ExcelProperty(value = "旁通管径")
+    private String bypassPipeDiameter;
+
+    /**
+     * 调压器
+     */
+    @ExcelProperty(value = "调压器")
+    private String voltageRegulator;
+
+    /**
+     * 设施规格型号
+     */
+    @ExcelProperty(value = "设施规格型号")
+    private String facilitySpecificationsAndModels;
+
+    /**
+     * 入口压力
+     */
+    @ExcelProperty(value = "入口压力")
+    private String inletPressure;
+
+    /**
+     * 出口压力
+     */
+    @ExcelProperty(value = "出口压力")
+    private String outletPressure;
+
+    /**
+     * 切断压力
+     */
+    @ExcelProperty(value = "切断压力")
+    private String cutOffPressure;
+
+    /**
+     * 放散压力
+     */
+    @ExcelProperty(value = "放散压力")
+    private String releasePressure;
+
+    /**
+     * 出厂编号
+     */
+    @ExcelProperty(value = "出厂编号")
+    private String factoryNumber;
+
+    /**
+     * 出厂日期
+     */
+    @ExcelProperty(value = "出厂日期")
+    private String factoryDate;
+
+}

+ 3 - 1
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/vo/GPressureRegulatingBoxVo.java

@@ -91,6 +91,8 @@ public class GPressureRegulatingBoxVo {
 	@ExcelProperty(value = "备注")
 	@ApiModelProperty("备注")
 	private String remark;
-
 	private List<GPressureRegulatingBoxDetailsVo> pressureRegulatingBoxDetailsVo;
+	private GPressureRegulatingBoxDetailsVo gPressureRegulatingBoxDetailsVo;
+	private String inspectionFrequency;
+	private String inspector;
 }

+ 5 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/mapper/GPressureRegulatingBoxMapper.java

@@ -2,6 +2,9 @@ package com.ruoyi.gas.mapper;
 
 import com.ruoyi.gas.domain.GPressureRegulatingBox;
 import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
+import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxExcelVo;
+
+import java.util.List;
 
 /**
  * 调压箱管理Mapper接口
@@ -10,5 +13,7 @@ import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
  * @date 2024-03-25
  */
 public interface GPressureRegulatingBoxMapper extends BaseMapperPlus<GPressureRegulatingBox> {
+    GPressureRegulatingBox getByNumber(String number);
+    List<GPressureRegulatingBoxExcelVo> getExcelList();
 
 }

+ 9 - 3
ruoyi-gas/src/main/java/com/ruoyi/gas/service/IGPressureRegulatingBoxService.java

@@ -1,13 +1,15 @@
 package com.ruoyi.gas.service;
 
-import com.ruoyi.gas.domain.GPressureRegulatingBox;
-import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxVo;
-import com.ruoyi.gas.domain.bo.GPressureRegulatingBoxBo;
 import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.gas.domain.GPressureRegulatingBox;
+import com.ruoyi.gas.domain.bo.GPressureRegulatingBoxBo;
+import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxExcelVo;
+import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxVo;
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 调压箱管理Service接口
@@ -16,6 +18,10 @@ import java.util.List;
  * @date 2024-03-25
  */
 public interface IGPressureRegulatingBoxService extends IServicePlus<GPressureRegulatingBox, GPressureRegulatingBoxVo> {
+	Map<String,Object> importVo(List<GPressureRegulatingBoxExcelVo> list, Boolean isUpdateSupport, String operName, int n, int successNum);
+
+	List<GPressureRegulatingBoxExcelVo> getExcelList();
+
 	/**
 	 * 查询单个
 	 * @return

+ 71 - 6
ruoyi-gas/src/main/java/com/ruoyi/gas/service/impl/GPressureRegulatingBoxServiceImpl.java

@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 import com.ruoyi.common.core.page.PagePlus;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.gas.domain.GPressureRegulatingBox;
 import com.ruoyi.gas.domain.bo.GPressureRegulatingBoxBo;
 import com.ruoyi.gas.domain.bo.GPressureRegulatingBoxDetailsBo;
 import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxDetailsVo;
+import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxExcelVo;
 import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxVo;
 import com.ruoyi.gas.mapper.GPressureRegulatingBoxMapper;
 import com.ruoyi.gas.service.IGPressureRegulatingBoxDetailsService;
@@ -19,8 +21,10 @@ import com.ruoyi.gas.service.IGPressureRegulatingBoxService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -32,25 +36,86 @@ import java.util.Map;
  */
 @Service
 public class GPressureRegulatingBoxServiceImpl extends ServicePlusImpl<GPressureRegulatingBoxMapper, GPressureRegulatingBox, GPressureRegulatingBoxVo> implements IGPressureRegulatingBoxService {
+    @Autowired
+    private IGPressureRegulatingBoxDetailsService igPressureRegulatingBoxDetailsService;
+
+    @Override
+    public Map<String, Object> importVo(List<GPressureRegulatingBoxExcelVo> list, Boolean isUpdateSupport, String operName, int n, int successNum) {
+        if (ObjectUtils.isEmpty(list) || list.size() == 0) {
+            throw new ServiceException("导入数据不能为空!");
+        }
+        Map<String, Object> ret = new HashMap<>();
+        StringBuilder successMsg = new StringBuilder();
+        for (int i = n; i < list.size(); i++) {
+            GPressureRegulatingBoxExcelVo vo = list.get(i);
+            try {
+                n++;
+                if (StringUtils.isNotEmpty(vo.getNumber())) {
+                    GPressureRegulatingBox gPressureRegulatingBox = baseMapper.getByNumber(vo.getNumber());
+                    if (ObjectUtils.isEmpty(gPressureRegulatingBox)) {
+                        GPressureRegulatingBox bean = BeanUtil.toBean(vo, GPressureRegulatingBox.class);
+                        bean.setId(null);
+                        baseMapper.insert(bean);
+                        Long id = bean.getId();
+                        GPressureRegulatingBoxDetailsBo bean1 = BeanUtil.toBean(vo, GPressureRegulatingBoxDetailsBo.class);
+                        bean1.setRegulatingBoxId(id.toString());
+                        igPressureRegulatingBoxDetailsService.insertByBo(bean1);
+                    } else {
+                        Long id = gPressureRegulatingBox.getId();
+                        GPressureRegulatingBoxDetailsBo bean1 = BeanUtil.toBean(vo, GPressureRegulatingBoxDetailsBo.class);
+                        bean1.setRegulatingBoxId(id.toString());
+                        bean1.setId(null);
+                        igPressureRegulatingBoxDetailsService.insertByBo(bean1);
+                    }
+                }else {
+                    throw new ServiceException("第" + (n + 1) + "行格式错误,导入失败!");
+                }
+            } catch (Exception e) {
+                throw new ServiceException("第" + (n + 1) + "行格式错误,导入失败!");
+            }
+            ret.put("bfb", String.format("%.2f", (Double.valueOf((n + 1)) / Double.valueOf(list.size())) * 100));
+            ret.put("n", n);
+            ret.put("is_success", true);
+            ret.put("successMsg", "");
+            ret.put("successNum", successNum);
+            return ret;
+        }
+        successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + list.size() + " 条");
+        ret.put("bfb", String.format("%.2f", (Double.valueOf((n + 1)) / Double.valueOf(list.size())) * 100));
+        ret.put("n", n);
+        ret.put("is_success", false);
+        ret.put("successMsg", successMsg.toString());
+        return ret;
+    }
 
     @Override
-    public GPressureRegulatingBoxVo queryById(Long id){
+    public GPressureRegulatingBoxVo queryById(Long id) {
         GPressureRegulatingBoxVo voById = getVoById(id);
         GPressureRegulatingBoxDetailsBo gPressureRegulatingBoxDetailsBo = new GPressureRegulatingBoxDetailsBo();
-        gPressureRegulatingBoxDetailsBo.setRegulatingBoxId(voById.getId());
+        gPressureRegulatingBoxDetailsBo.setRegulatingBoxId(voById.getId().toString());
         TableDataInfo<GPressureRegulatingBoxDetailsVo> queriedPageList = pressureRegulatingBoxDetailsService.queryPageList(gPressureRegulatingBoxDetailsBo);
         voById.setPressureRegulatingBoxDetailsVo(queriedPageList.getRows());
         return voById;
     }
 
+    @Override
+    public List<GPressureRegulatingBoxExcelVo> getExcelList() {
+        List<GPressureRegulatingBoxExcelVo> excelList = baseMapper.getExcelList();
+        for (int i = 1; i <= excelList.size(); i++) {
+            excelList.get(i - 1).setId(String.valueOf(i));
+        }
+        return excelList;
+    }
+
     @Autowired
     private IGPressureRegulatingBoxDetailsService pressureRegulatingBoxDetailsService;
+
     @Override
     public TableDataInfo<GPressureRegulatingBoxVo> queryPageList(GPressureRegulatingBoxBo bo) {
         PagePlus<GPressureRegulatingBox, GPressureRegulatingBoxVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
         result.getRecordsVo().forEach(item -> {
             GPressureRegulatingBoxDetailsBo gPressureRegulatingBoxDetailsBo = new GPressureRegulatingBoxDetailsBo();
-            gPressureRegulatingBoxDetailsBo.setRegulatingBoxId(item.getId());
+            gPressureRegulatingBoxDetailsBo.setRegulatingBoxId(item.getId().toString());
             TableDataInfo<GPressureRegulatingBoxDetailsVo> queriedPageList = pressureRegulatingBoxDetailsService.queryPageList(gPressureRegulatingBoxDetailsBo);
             item.setPressureRegulatingBoxDetailsVo(queriedPageList.getRows());
         });
@@ -84,7 +149,7 @@ public class GPressureRegulatingBoxServiceImpl extends ServicePlusImpl<GPressure
         boolean flag = save(add);
         if (flag) {
             bo.setId(add.getId());
-            bo.getPressureRegulatingBoxDetailsBo().setRegulatingBoxId(add.getId());
+            bo.getPressureRegulatingBoxDetailsBo().setRegulatingBoxId(add.getId().toString());
             pressureRegulatingBoxDetailsService.insertByBo(bo.getPressureRegulatingBoxDetailsBo());
         }
         return flag;
@@ -103,13 +168,13 @@ public class GPressureRegulatingBoxServiceImpl extends ServicePlusImpl<GPressure
      *
      * @param entity 实体类数据
      */
-    private void validEntityBeforeSave(GPressureRegulatingBox entity){
+    private void validEntityBeforeSave(GPressureRegulatingBox entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return removeByIds(ids);

+ 38 - 0
ruoyi-gas/src/main/resources/mapper/GPressureRegulatingBoxMapper.xml

@@ -22,5 +22,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+	<select id="getByNumber" resultType="com.ruoyi.gas.domain.GPressureRegulatingBox">
+		SELECT * FROM `g_pressure_regulating_box` WHERE number = #{number}
+	</select>
+
+    <select id="getExcelList" resultType="com.ruoyi.gas.domain.vo.GPressureRegulatingBoxExcelVo">
+        SELECT
+			b.nature,
+			b.type,
+			b.number_of_routes,
+			b.management_office,
+			b.name,
+			b.inspection_frequency,
+			b.inspector,
+			bd.total_number_of_households,
+			bd.position_of_pressure_regulating_box,
+			bd.control_range,
+			bd.main_power_supply_position,
+			bd.receiving_time,
+			bd.regulating_box_id,
+			bd.valve_well_position,
+			bd.valve_well_key_shape,
+			bd.manufacturer,
+			bd.flow,
+			bd.import_pipe_diameter,
+			bd.outlet_pipe_diameter,
+			bd.bypass_pipe_diameter,
+			bd.voltage_regulator,
+			bd.facility_specifications_and_models,
+			bd.inlet_pressure,
+			bd.outlet_pressure,
+			bd.cut_off_pressure,
+			bd.release_pressure,
+			bd.factory_number,
+			bd.factory_date
+        FROM
+            `g_pressure_regulating_box` b
+            LEFT JOIN g_pressure_regulating_box_details bd ON b.id = bd.regulating_box_id
+    </select>
 
 </mapper>