Selaa lähdekoodia

支队单位管理模块接口开发

jichaobo 2 vuotta sitten
vanhempi
commit
2467af74fc
18 muutettua tiedostoa jossa 1109 lisäystä ja 8 poistoa
  1. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java
  2. 21 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyAttach1Controller.java
  3. 21 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyAttach2Controller.java
  4. 49 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyController.java
  5. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompany.java
  6. 206 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach1.java
  7. 286 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach2.java
  8. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseCompanyAttach1Mapper.java
  9. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseCompanyAttach2Mapper.java
  10. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyAttach1Service.java
  11. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyAttach2Service.java
  12. 27 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyService.java
  13. 20 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyAttach1ServiceImpl.java
  14. 20 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyAttach2ServiceImpl.java
  15. 157 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyServiceImpl.java
  16. 130 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/CompanyDataVo.java
  17. 45 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseCompanyAttach1Mapper.xml
  18. 61 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseCompanyAttach2Mapper.xml

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("base_device_status");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("base_company_attach2");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyAttach1Controller.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 联网单位信息附表1 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Controller
+@RequestMapping("/baseCompanyAttach1")
+public class BaseCompanyAttach1Controller {
+
+}
+

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyAttach2Controller.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 联网单位信息附表2 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Controller
+@RequestMapping("/baseCompanyAttach2")
+public class BaseCompanyAttach2Controller {
+
+}
+

+ 49 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyController.java

@@ -2,12 +2,14 @@ package com.usky.fire.controller.web;
 
 
 import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 import com.usky.fire.domain.BaseCompany;
 import com.usky.fire.service.BaseCompanyService;
+import com.usky.fire.service.vo.CompanyDataVo;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -35,5 +37,49 @@ public class BaseCompanyController {
     public ApiResult<List<BaseCompany>> userCompanySelect() {
         return ApiResult.success(baseCompanyService.userCompanySelect());
     }
+
+    /**
+     * 单位管理-单位列表查询
+     *
+     * @param companyName  单位名称
+     * @param organization 组织机构编码
+     * @param pageNum      当前页
+     * @param pageSize     每页条数
+     * @return
+     */
+    @GetMapping("companyList")
+    public ApiResult<CommonPage<Object>> companyList(@RequestParam(value = "companyName", required = false) String companyName,
+                                                     @RequestParam(value = "organization", required = false) String organization,
+                                                     @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
+                                                     @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+        return ApiResult.success(baseCompanyService.companyList(companyName, organization, pageNum, pageSize));
+    }
+
+    /**
+     * 单位管理-修改
+     *
+     * @param companyDataVo
+     * @return
+     */
+    @Log(title = "单位管理-修改", businessType = BusinessType.UPDATE)
+    @PutMapping("updateCompany")
+    public ApiResult<Void> updateCompany(@RequestBody CompanyDataVo companyDataVo) {
+        baseCompanyService.updateCompany(companyDataVo);
+        return ApiResult.success();
+    }
+
+    /**
+     * 单位管理-删除
+     *
+     * @param id 主键ID
+     * @return
+     */
+    @Log(title = "单位管理-删除", businessType = BusinessType.DELETE)
+    @DeleteMapping("delCompany")
+    public ApiResult<Void> delCompany(@RequestParam(value = "id") Integer id) {
+        baseCompanyService.delCompany(id);
+        return ApiResult.success();
+    }
+
 }
 

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompany.java

@@ -70,7 +70,7 @@ public class BaseCompany implements Serializable {
     /**
      * 邮政编码
      */
-    private Integer postalCode;
+    private String postalCode;
 
     /**
      * 邮箱

+ 206 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach1.java

@@ -0,0 +1,206 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 联网单位信息附表1
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseCompanyAttach1 implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 单位ID
+     */
+    private String companyId;
+
+    /**
+     * 单位编号
+     */
+    private String companyCode;
+
+    /**
+     * 支队级机构简称
+     */
+    private String detachmentName;
+
+    /**
+     * 管辖机构(含大队)
+     */
+    private String governBody;
+
+    /**
+     * 单位属性主分类
+     */
+    private String mainAttributeType;
+
+    /**
+     * 单位主属性
+     */
+    private String mainAttribute;
+
+    /**
+     * 单位子属性
+     */
+    private String sonAttribute;
+
+    /**
+     * 固定资产(单位:万元)
+     */
+    private String fixedAssets;
+
+    /**
+     * 职工人数
+     */
+    private String employeeNum;
+
+    /**
+     * 营业时最大人数
+     */
+    private String businessMaxNum;
+
+    /**
+     * 占地面积
+     */
+    private String coverArea;
+
+    /**
+     * 建筑面积
+     */
+    private String buildArea;
+
+    /**
+     * 自动消防设施情况
+     */
+    private String autoFireFacilities;
+
+    /**
+     * 经度
+     */
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    private String latitude;
+
+    /**
+     * 地理情况
+     */
+    private String geography;
+
+    /**
+     * 有无避难层
+     */
+    private String refugeFloor;
+
+    /**
+     * 避难层数量
+     */
+    private String refugeFloorNum;
+
+    /**
+     * 避难层面积
+     */
+    private String refugeFloorArea;
+
+    /**
+     * 避难层位置
+     */
+    private String refugeFloorPosition;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 单位平面图名称
+     */
+    private String planName;
+
+    /**
+     * 单位平面图存放地址
+     */
+    private String planUrl;
+
+    /**
+     * 建筑数量
+     */
+    private String buildNum;
+
+    /**
+     * 上级消防管辖单位
+     */
+    private String superiorFireJurisdiction;
+
+    /**
+     * 实际单位ID
+     */
+    private String actualCompanyId;
+
+    /**
+     * GLID
+     */
+    private String glId;
+
+    /**
+     * 确定重点单位时间
+     */
+    private LocalDateTime determineKeyTime;
+
+    /**
+     * 取消重点单位时间
+     */
+    private LocalDateTime cancelKeyTime;
+
+    /**
+     * 操作类型
+     */
+    private String operationType;
+
+    /**
+     * 老的单位ID
+     */
+    private String oldCompanyId;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updatePerson;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+
+}

+ 286 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach2.java

@@ -0,0 +1,286 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 联网单位信息附表2
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseCompanyAttach2 implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 单位ID
+     */
+    private String companyId;
+
+    /**
+     * 单位编号
+     */
+    private String companyCode;
+
+    /**
+     * 义务消防员数
+     */
+    private String volunteerFiremanNum;
+
+    /**
+     * 消防自救措施
+     */
+    private String selfRescueMeasures;
+
+    /**
+     * 外围消防设施
+     */
+    private String peripheralFireFacilities;
+
+    /**
+     * 历史灾情
+     */
+    private String historicalDisaster;
+
+    /**
+     * 毗邻单位东
+     */
+    private String adjacentEast;
+
+    /**
+     * 毗邻单位南
+     */
+    private String adjacentSouth;
+
+    /**
+     * 毗邻单位西
+     */
+    private String adjacentWest;
+
+    /**
+     * 毗邻单位北
+     */
+    private String adjacentNorth;
+
+    /**
+     * 安全出口数
+     */
+    private String safetyExitsNum;
+
+    /**
+     * 消防车道数
+     */
+    private String fireLaneNum;
+
+    /**
+     * 消防车道位置
+     */
+    private String fireLanePosition;
+
+    /**
+     * 疏散电梯数
+     */
+    private String sparseElevatorNum;
+
+    /**
+     * 消防电梯数
+     */
+    private String fireElevatorNum;
+
+    /**
+     * 燃气类型
+     */
+    private String gasType;
+
+    /**
+     * 档案负责人
+     */
+    private String archivesPerson;
+
+    /**
+     * 消防监督监管(档案录入人)
+     */
+    private String archivesInputPerson;
+
+    /**
+     * 建档用户
+     */
+    private String filingPerson;
+
+    /**
+     * 建档用户姓名
+     */
+    private String filingPersonName;
+
+    /**
+     * 数据交换标记
+     */
+    private String dataExchangeMark;
+
+    /**
+     * 数据交换时间
+     */
+    private LocalDateTime dataExchangeTime;
+
+    /**
+     * 监督修改时间
+     */
+    private LocalDateTime superviModifyTime;
+
+    /**
+     * 总队机构ID
+     */
+    private String corpsId;
+
+    /**
+     * 是否派出所数据
+     */
+    private String policeData;
+
+    /**
+     * Row_Version
+     */
+    private String rowVersion;
+
+    /**
+     * 是否建筑管理单位
+     */
+    private String manageCompany;
+
+    /**
+     * SFHJHDW
+     */
+    private String sfhjhdw;
+
+    /**
+     * 是否高危单位
+     */
+    private String highRisk;
+
+    /**
+     * SFWBQY
+     */
+    private String sfwbqy;
+
+    /**
+     * HJHJZSL
+     */
+    private String hjhjzsl;
+
+    /**
+     * LGACC
+     */
+    private String lgacc;
+
+    /**
+     * LGACCName
+     */
+    private String lgaccName;
+
+    /**
+     * BZDZKGLID
+     */
+    private String bzdzkglid;
+
+    /**
+     * QRTime
+     */
+    private LocalDateTime qrtime;
+
+    /**
+     * QRAcc
+     */
+    private String qracc;
+
+    /**
+     * 重点单位确认人员姓名
+     */
+    private String determineKeyName;
+
+    /**
+     * QRYJ
+     */
+    private String qryj;
+
+    /**
+     * QRYJMS
+     */
+    private String qryjjms;
+
+    /**
+     * SCRKSJ
+     */
+    private String scrksj;
+
+    /**
+     * lawID
+     */
+    private String lawId;
+
+    /**
+     * 备用字段1
+     */
+    private String reserveField1;
+
+    /**
+     * 备用字段2
+     */
+    private String reserveField2;
+
+    /**
+     * 备用字段3
+     */
+    private String reserveField3;
+
+    /**
+     * 备用字段4
+     */
+    private String reserveField4;
+
+    /**
+     * BDP_AUDIT
+     */
+    private LocalDateTime bdpAudit;
+
+    /**
+     * unionKey
+     */
+    private String unionKey;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updatePerson;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseCompanyAttach1Mapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.BaseCompanyAttach1;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 联网单位信息附表1 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+public interface BaseCompanyAttach1Mapper extends CrudMapper<BaseCompanyAttach1> {
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseCompanyAttach2Mapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.BaseCompanyAttach2;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 联网单位信息附表2 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+public interface BaseCompanyAttach2Mapper extends CrudMapper<BaseCompanyAttach2> {
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyAttach1Service.java

@@ -0,0 +1,16 @@
+package com.usky.fire.service;
+
+import com.usky.fire.domain.BaseCompanyAttach1;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 联网单位信息附表1 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+public interface BaseCompanyAttach1Service extends CrudService<BaseCompanyAttach1> {
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyAttach2Service.java

@@ -0,0 +1,16 @@
+package com.usky.fire.service;
+
+import com.usky.fire.domain.BaseCompanyAttach2;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 联网单位信息附表2 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+public interface BaseCompanyAttach2Service extends CrudService<BaseCompanyAttach2> {
+
+}

+ 27 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyService.java

@@ -1,7 +1,9 @@
 package com.usky.fire.service;
 
+import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.BaseCompany;
+import com.usky.fire.service.vo.CompanyDataVo;
 
 import java.util.List;
 
@@ -36,4 +38,29 @@ public interface BaseCompanyService extends CrudService<BaseCompany> {
      * @return
      */
     List<BaseCompany> companyIdList();
+
+    /**
+     * 单位管理-单位列表查询
+     *
+     * @param companyName  单位名称
+     * @param organization 组织机构编码
+     * @param pageNum      当前页
+     * @param pageSize     每页条数
+     * @return
+     */
+    CommonPage<Object> companyList(String companyName, String organization, Integer pageNum, Integer pageSize);
+
+    /**
+     * 单位管理-修改
+     *
+     * @param companyDataVo
+     */
+    void updateCompany(CompanyDataVo companyDataVo);
+
+    /**
+     * 单位管理-删除
+     *
+     * @param id 主键ID
+     */
+    void delCompany(Integer id);
 }

+ 20 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyAttach1ServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.fire.service.impl;
+
+import com.usky.fire.domain.BaseCompanyAttach1;
+import com.usky.fire.mapper.BaseCompanyAttach1Mapper;
+import com.usky.fire.service.BaseCompanyAttach1Service;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 联网单位信息附表1 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Service
+public class BaseCompanyAttach1ServiceImpl extends AbstractCrudService<BaseCompanyAttach1Mapper, BaseCompanyAttach1> implements BaseCompanyAttach1Service {
+
+}

+ 20 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyAttach2ServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.fire.service.impl;
+
+import com.usky.fire.domain.BaseCompanyAttach2;
+import com.usky.fire.mapper.BaseCompanyAttach2Mapper;
+import com.usky.fire.service.BaseCompanyAttach2Service;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 联网单位信息附表2 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-09-20
+ */
+@Service
+public class BaseCompanyAttach2ServiceImpl extends AbstractCrudService<BaseCompanyAttach2Mapper, BaseCompanyAttach2> implements BaseCompanyAttach2Service {
+
+}

+ 157 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyServiceImpl.java

@@ -1,18 +1,32 @@
 package com.usky.fire.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.BaseCompany;
+import com.usky.fire.domain.BaseCompanyAttach1;
+import com.usky.fire.domain.BaseCompanyPerson;
 import com.usky.fire.mapper.BaseCompanyMapper;
+import com.usky.fire.service.BaseCompanyAttach1Service;
+import com.usky.fire.service.BaseCompanyPersonService;
 import com.usky.fire.service.BaseCompanyService;
 import com.usky.fire.service.BaseUserCompanyService;
+import com.usky.fire.service.vo.CompanyDataVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -28,6 +42,12 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
     @Autowired
     private BaseUserCompanyService baseUserCompanyService;
 
+    @Autowired
+    private BaseCompanyPersonService baseCompanyPersonService;
+
+    @Autowired
+    private BaseCompanyAttach1Service baseCompanyAttach1Service;
+
     @Override
     public List<BaseCompany> userCompanySelect() {
         List<String> companyIdList = baseUserCompanyService.companyIdList();
@@ -44,19 +64,153 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
         LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(BaseCompany::getCompanyId, BaseCompany::getCompanyName)
                 .in(BaseCompany::getCompanyId, companyIdList)
-                .eq(BaseCompany::getEnable, 1)
+                .eq(BaseCompany::getEnable, 0)
                 .orderByDesc(BaseCompany::getId);
         List<BaseCompany> list = this.list(queryWrapper);
         return list;
     }
 
     @Override
-    public List<BaseCompany> companyIdList(){
+    public List<BaseCompany> companyIdList() {
         LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(BaseCompany::getCompanyId)
-                .eq(BaseCompany::getEnable, 1);
+                .eq(BaseCompany::getEnable, 0);
         List<BaseCompany> list = this.list(queryWrapper);
         return list;
     }
 
+
+    @Override
+    public CommonPage<Object> companyList(String companyName, String organization, Integer pageNum, Integer pageSize) {
+        List<Object> list = new ArrayList<>();
+        IPage<BaseCompany> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName, BaseCompany::getOrganization,
+                BaseCompany::getAddress, BaseCompany::getCompanyType, BaseCompany::getFireHazard, BaseCompany::getLinkPhone,
+                BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getAdministrativeDivision)
+                .eq(BaseCompany::getEnable, 0)
+                .like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
+                .like(StringUtils.isNotBlank(organization), BaseCompany::getOrganization, organization)
+                .orderByDesc(BaseCompany::getId);
+        page = this.page(page, queryWrapper);
+        if (page.getTotal() > 0) {
+            List<String> companyIdList = new ArrayList<>();
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                companyIdList.add(page.getRecords().get(i).getCompanyId());
+            }
+            List<BaseCompanyPerson> list1 = new ArrayList<>();
+            List<BaseCompanyAttach1> list2 = new ArrayList<>();
+            if (CollectionUtils.isNotEmpty(companyIdList)) {
+                LambdaQueryWrapper<BaseCompanyPerson> queryWrapper1 = Wrappers.lambdaQuery();
+                queryWrapper1.select(BaseCompanyPerson::getId, BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getFireDutyName,
+                        BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getDelegateName)
+                        .in(BaseCompanyPerson::getCompanyId, companyIdList);
+                list1 = baseCompanyPersonService.list(queryWrapper1);
+                LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper2 = Wrappers.lambdaQuery();
+                queryWrapper2.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getFixedAssets,
+                        BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
+                        BaseCompanyAttach1::getMainAttribute, BaseCompanyAttach1::getGovernBody)
+                        .in(BaseCompanyAttach1::getCompanyId, companyIdList);
+                list2 = baseCompanyAttach1Service.list(queryWrapper2);
+            }
+
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", page.getRecords().get(i).getId());
+                map.put("companyName", page.getRecords().get(i).getCompanyName());
+                map.put("organization", page.getRecords().get(i).getOrganization());
+                map.put("delegateName", null);
+                map.put("address", page.getRecords().get(i).getAddress());
+                map.put("companyType", page.getRecords().get(i).getCompanyType());
+                map.put("fireHazard", page.getRecords().get(i).getFireHazard());
+                map.put("linkPhone", page.getRecords().get(i).getLinkPhone());
+                map.put("foundTime", page.getRecords().get(i).getFoundTime());
+                map.put("companyNature", page.getRecords().get(i).getCompanyNature());
+                map.put("administrativeDivision", page.getRecords().get(i).getAdministrativeDivision());
+                map.put("fixedAssets", null);
+                map.put("coverArea", null);
+                map.put("buildArea", null);
+                map.put("employeeNum", null);
+                map.put("mainAttribute", null);
+                map.put("governBody", null);
+                map.put("id2", null);
+                map.put("id1", null);
+                map.put("fireDutyName", null);
+                map.put("fireManageName", null);
+                for (int j = 0; j < list1.size(); j++) {
+                    if (page.getRecords().get(i).getCompanyId().equals(list1.get(j).getCompanyId())) {
+                        map.put("id1", list1.get(j).getId());
+                        map.put("fireDutyName", list1.get(j).getFireDutyName());
+                        map.put("fireManageName", list1.get(j).getFireManageName());
+                        map.put("delegateName", list1.get(j).getDelegateName());
+                    }
+                }
+                for (int j = 0; j < list2.size(); j++) {
+                    if (page.getRecords().get(i).getCompanyId().equals(list2.get(j).getCompanyId())) {
+                        map.put("fixedAssets", list2.get(j).getFixedAssets());
+                        map.put("coverArea", list2.get(j).getCoverArea());
+                        map.put("buildArea", list2.get(j).getBuildArea());
+                        map.put("employeeNum", list2.get(j).getEmployeeNum());
+                        map.put("mainAttribute", list2.get(j).getMainAttribute());
+                        map.put("governBody", list2.get(j).getGovernBody());
+                        map.put("id2", list2.get(j).getId());
+                    }
+                }
+                map.put("createTime", page.getRecords().get(i).getCreateTime());
+                list.add(map);
+            }
+        }
+        return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
+    }
+
+    @Transactional
+    @Override
+    public void updateCompany(CompanyDataVo companyDataVo) {
+        BaseCompany baseCompany = new BaseCompany();
+        baseCompany.setId(companyDataVo.getId());
+        baseCompany.setCompanyName(companyDataVo.getCompanyName());
+        baseCompany.setOrganization(companyDataVo.getOrganization());
+        baseCompany.setAddress(companyDataVo.getAddress());
+        baseCompany.setCompanyType(companyDataVo.getCompanyType());
+        baseCompany.setFireHazard(companyDataVo.getFireHazard());
+        baseCompany.setLinkPerson(companyDataVo.getLinkPhone());
+        baseCompany.setFoundTime(companyDataVo.getFoundTime());
+        baseCompany.setCompanyNature(companyDataVo.getCompanyNature());
+        baseCompany.setAdministrativeDivision(companyDataVo.getAdministrativeDivision());
+        baseCompany.setUpdatePerson(SecurityUtils.getUsername());
+        baseCompany.setUpdateTime(LocalDateTime.now());
+        this.updateById(baseCompany);
+        BaseCompanyPerson baseCompanyPerson = new BaseCompanyPerson();
+        baseCompanyPerson.setId(companyDataVo.getId1());
+        baseCompanyPerson.setCompanyName(companyDataVo.getCompanyName());
+        baseCompanyPerson.setFireDutyName(companyDataVo.getFireDutyName());
+        baseCompanyPerson.setFireManageName(companyDataVo.getFireManageName());
+        baseCompanyPerson.setDelegateName(companyDataVo.getDelegateName());
+        baseCompanyPerson.setUpdatePerson(SecurityUtils.getUsername());
+        baseCompanyPerson.setUpdateTime(LocalDateTime.now());
+        baseCompanyPersonService.updateById(baseCompanyPerson);
+        BaseCompanyAttach1 baseCompanyAttach1 = new BaseCompanyAttach1();
+        baseCompanyAttach1.setId(companyDataVo.getId2());
+        baseCompanyAttach1.setFixedAssets(companyDataVo.getFixedAssets());
+        baseCompanyAttach1.setCoverArea(companyDataVo.getCoverArea());
+        baseCompanyAttach1.setBuildArea(companyDataVo.getBuildArea());
+        baseCompanyAttach1.setEmployeeNum(companyDataVo.getEmployeeNum());
+        baseCompanyAttach1.setMainAttribute(companyDataVo.getMainAttribute());
+        baseCompanyAttach1.setGovernBody(companyDataVo.getGovernBody());
+        baseCompanyAttach1.setUpdatePerson(SecurityUtils.getUsername());
+        baseCompanyAttach1.setUpdateTime(LocalDateTime.now());
+        baseCompanyAttach1Service.updateById(baseCompanyAttach1);
+    }
+
+    @Override
+    public void delCompany(Integer id) {
+        BaseCompany baseCompany = new BaseCompany();
+        baseCompany.setId(id);
+        baseCompany.setEnable("1");
+        baseCompany.setUpdateTime(LocalDateTime.now());
+        baseCompany.setUpdatePerson(SecurityUtils.getUsername());
+        this.updateById(baseCompany);
+    }
+
+
 }

+ 130 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/CompanyDataVo.java

@@ -0,0 +1,130 @@
+package com.usky.fire.service.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-07-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class CompanyDataVo implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 单位ID
+     */
+    private String companyId;
+
+    /**
+     * 组织机构编码
+     */
+    private String organization;
+
+    /**
+     * 单位名称
+     */
+    private String companyName;
+
+    /**
+     * 单位类型
+     */
+    private String companyType;
+
+    /**
+     * 单位详细地址
+     */
+    private String address;
+
+    /**
+     * 火灾危险性
+     */
+    private String fireHazard;
+
+    /**
+     * 单位联系电话
+     */
+    private String linkPhone;
+
+    /**
+     * 单位成立时间
+     */
+    private LocalDateTime foundTime;
+
+    /**
+     * 单位性质
+     */
+    private Integer companyNature;
+
+    /**
+     * 行政区域
+     */
+    private String administrativeDivision;
+
+    private Integer id1;
+
+    /**
+     * 固定资产(单位:万元)
+     */
+    private String fixedAssets;
+
+    /**
+     * 占地面积
+     */
+    private String coverArea;
+
+    /**
+     * 建筑面积
+     */
+    private String buildArea;
+
+    /**
+     * 职工人数
+     */
+    private String employeeNum;
+
+    /**
+     * 单位主属性
+     */
+    private String mainAttribute;
+
+    /**
+     * 管辖机构(含大队)
+     */
+    private String governBody;
+
+    private Integer id2;
+
+    /**
+     * 消防安全责任人姓名
+     */
+    private String fireDutyName;
+
+    /**
+     * 消防安全管理人姓名
+     */
+    private String fireManageName;
+
+    /**
+     * 法人代表姓名
+     */
+    private String delegateName;
+
+}

+ 45 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseCompanyAttach1Mapper.xml

@@ -0,0 +1,45 @@
+<?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="com.usky.fire.mapper.BaseCompanyAttach1Mapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.BaseCompanyAttach1">
+        <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
+        <result column="company_code" property="companyCode" />
+        <result column="detachment_name" property="detachmentName" />
+        <result column="govern_body" property="governBody" />
+        <result column="main_attribute_type" property="mainAttributeType" />
+        <result column="main_attribute" property="mainAttribute" />
+        <result column="son_attribute" property="sonAttribute" />
+        <result column="fixed_assets" property="fixedAssets" />
+        <result column="employee_num" property="employeeNum" />
+        <result column="business_max_num" property="businessMaxNum" />
+        <result column="cover_area" property="coverArea" />
+        <result column="build_area" property="buildArea" />
+        <result column="auto_fire_facilities" property="autoFireFacilities" />
+        <result column="longitude" property="longitude" />
+        <result column="latitude" property="latitude" />
+        <result column="geography" property="geography" />
+        <result column="refuge_floor" property="refugeFloor" />
+        <result column="refuge_floor_num" property="refugeFloorNum" />
+        <result column="refuge_floor_area" property="refugeFloorArea" />
+        <result column="refuge_floor_position" property="refugeFloorPosition" />
+        <result column="remarks" property="remarks" />
+        <result column="plan_name" property="planName" />
+        <result column="plan_url" property="planUrl" />
+        <result column="build_num" property="buildNum" />
+        <result column="superior_fire_jurisdiction" property="superiorFireJurisdiction" />
+        <result column="actual_company_id" property="actualCompanyId" />
+        <result column="gl_id" property="glId" />
+        <result column="determine_key_time" property="determineKeyTime" />
+        <result column="cancel_key_time" property="cancelKeyTime" />
+        <result column="operation_type" property="operationType" />
+        <result column="old_company_id" property="oldCompanyId" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+        <result column="update_person" property="updatePerson" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>

+ 61 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseCompanyAttach2Mapper.xml

@@ -0,0 +1,61 @@
+<?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="com.usky.fire.mapper.BaseCompanyAttach2Mapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.BaseCompanyAttach2">
+        <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
+        <result column="company_code" property="companyCode" />
+        <result column="volunteer_fireman_num" property="volunteerFiremanNum" />
+        <result column="self_rescue_measures" property="selfRescueMeasures" />
+        <result column="peripheral_fire_facilities" property="peripheralFireFacilities" />
+        <result column="historical_disaster" property="historicalDisaster" />
+        <result column="adjacent_east" property="adjacentEast" />
+        <result column="adjacent_south" property="adjacentSouth" />
+        <result column="adjacent_west" property="adjacentWest" />
+        <result column="adjacent_north" property="adjacentNorth" />
+        <result column="safety_exits_num" property="safetyExitsNum" />
+        <result column="fire_lane_num" property="fireLaneNum" />
+        <result column="fire_lane_position" property="fireLanePosition" />
+        <result column="sparse_elevator_num" property="sparseElevatorNum" />
+        <result column="fire_elevator_num" property="fireElevatorNum" />
+        <result column="gas_type" property="gasType" />
+        <result column="archives_person" property="archivesPerson" />
+        <result column="archives_input_person" property="archivesInputPerson" />
+        <result column="filing_person" property="filingPerson" />
+        <result column="filing_person_name" property="filingPersonName" />
+        <result column="data_exchange_mark" property="dataExchangeMark" />
+        <result column="data_exchange_time" property="dataExchangeTime" />
+        <result column="supervi_modify_time" property="superviModifyTime" />
+        <result column="corps_id" property="corpsId" />
+        <result column="police_data" property="policeData" />
+        <result column="row_version" property="rowVersion" />
+        <result column="manage_company" property="manageCompany" />
+        <result column="sfhjhdw" property="sfhjhdw" />
+        <result column="high_risk" property="highRisk" />
+        <result column="sfwbqy" property="sfwbqy" />
+        <result column="hjhjzsl" property="hjhjzsl" />
+        <result column="lgacc" property="lgacc" />
+        <result column="lgacc_name" property="lgaccName" />
+        <result column="bzdzkglid" property="bzdzkglid" />
+        <result column="qrtime" property="qrtime" />
+        <result column="qracc" property="qracc" />
+        <result column="determine_key_name" property="determineKeyName" />
+        <result column="qryj" property="qryj" />
+        <result column="qryjjms" property="qryjjms" />
+        <result column="scrksj" property="scrksj" />
+        <result column="law_id" property="lawId" />
+        <result column="reserve_field1" property="reserveField1" />
+        <result column="reserve_field2" property="reserveField2" />
+        <result column="reserve_field3" property="reserveField3" />
+        <result column="reserve_field4" property="reserveField4" />
+        <result column="bdp_audit" property="bdpAudit" />
+        <result column="union_key" property="unionKey" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+        <result column="update_person" property="updatePerson" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>