Quellcode durchsuchen

Merge branch 'master' of http://git.xt.wenhq.top:8083/hs/zhny_bg

hsshuxian vor 10 Monaten
Ursprung
Commit
938a16d48e

+ 6 - 6
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AreaController.java

@@ -51,13 +51,13 @@ public class AreaController extends BaseController {
     /**
      * 查询服务区列表(根据下挂设施)
      *
-     * @param facsType    设施类型
-     * @param facsSubType 设施子类型
+     * @param facsCategory    设施类别
+     * @param facsSubCategory 设施子类别
      */
-    @GetMapping("/listWithFacsType")
-    public AjaxResult listWithFacsType(@RequestParam(name = "facsType") String facsType,
-        @RequestParam(name = "facsSubType", required = false) String facsSubType) {
-        List<Area> list = areaService.selectWithFacsType(facsType, facsSubType);
+    @GetMapping("/listWithFacsCategory")
+    public AjaxResult listWithFacsCategory(@RequestParam(name = "facsCategory") String facsCategory,
+        @RequestParam(name = "facsSubCategory", required = false) String facsSubCategory) {
+        List<Area> list = areaService.selectWithFacsCategory(facsCategory, facsSubCategory);
         return success(list);
     }
 

+ 3 - 3
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecUseHController.java

@@ -131,9 +131,9 @@ public class ElecUseHController extends BaseController {
      * @param area
      * @return
      */
-    @GetMapping("/area/thisday/fac/type/elec/use")
-    public AjaxResult getAreaThisDayFacTypeElecUse(@RequestParam(value = "area", required = false) String area) {
-        return success(elecUseHService.selectThisDayFacsTypeElecUse(area));
+    @GetMapping("/area/thisday/fac/category/elec/use")
+    public AjaxResult getAreaThisDayFacCategoryElecUse(@RequestParam(value = "area", required = false) String area) {
+        return success(elecUseHService.selectThisDayFacsCategoryElecUse(area));
     }
 
     /**

+ 8 - 8
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/FacsCategoryController.java

@@ -42,10 +42,10 @@ public class FacsCategoryController extends BaseController
      */
     @RequiresPermissions("basecfg:facscategory:list")
     @GetMapping("/list")
-    public TableDataInfo list(FacsCategory emsFacsType)
+    public TableDataInfo list(FacsCategory category)
     {
         startPage();
-        List<FacsCategory> list = facsCategoryService.selectCategoryList(emsFacsType);
+        List<FacsCategory> list = facsCategoryService.selectCategoryList(category);
         return getDataTable(list);
     }
 
@@ -65,9 +65,9 @@ public class FacsCategoryController extends BaseController
     @RequiresPermissions("basecfg:facscategory:export")
     @Log(title = "能源设施/系统分类", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, FacsCategory emsFacsType)
+    public void export(HttpServletResponse response, FacsCategory category)
     {
-        List<FacsCategory> list = facsCategoryService.selectCategoryList(emsFacsType);
+        List<FacsCategory> list = facsCategoryService.selectCategoryList(category);
         ExcelUtil<FacsCategory> util = new ExcelUtil<FacsCategory>(FacsCategory.class);
         util.exportExcel(response, list, "能源设施/系统分类数据");
     }
@@ -88,9 +88,9 @@ public class FacsCategoryController extends BaseController
     @RequiresPermissions("basecfg:facscategory:add")
     @Log(title = "能源设施/系统分类", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody FacsCategory emsFacsType)
+    public AjaxResult add(@RequestBody FacsCategory category)
     {
-        return toAjax(facsCategoryService.insertCategory(emsFacsType));
+        return toAjax(facsCategoryService.insertCategory(category));
     }
 
     /**
@@ -99,9 +99,9 @@ public class FacsCategoryController extends BaseController
     @RequiresPermissions("basecfg:facscategory:edit")
     @Log(title = "能源设施/系统分类", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody FacsCategory emsFacsType)
+    public AjaxResult edit(@RequestBody FacsCategory category)
     {
-        return toAjax(facsCategoryService.updateCategory(emsFacsType));
+        return toAjax(facsCategoryService.updateCategory(category));
     }
 
     /**

+ 14 - 14
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElecUseH.java

@@ -36,12 +36,12 @@ public class ElecUseH extends BaseEntity
     private String facsName;
 
     /** 设施类型 */
-    @Excel(name = "设施类")
-    private String facsType;
+    @Excel(name = "设施类")
+    private String facsCategory;
 
     /** 设施子类 */
-    @Excel(name = "设施子类")
-    private String facsSubtype;
+    @Excel(name = "设施子类")
+    private String facsSubCategory;
 
     /** 记录时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -114,20 +114,20 @@ public class ElecUseH extends BaseEntity
         this.facsName = facsName;
     }
 
-    public String getFacsType() {
-        return facsType;
+    public String getFacsCategory() {
+        return facsCategory;
     }
 
-    public void setFacsType(String facsType) {
-        this.facsType = facsType;
+    public void setFacsCategory(String facsCategory) {
+        this.facsCategory = facsCategory;
     }
 
-    public String getFacsSubtype() {
-        return facsSubtype;
+    public String getFacsSubCategory() {
+        return facsSubCategory;
     }
 
-    public void setFacsSubtype(String facsSubtype) {
-        this.facsSubtype = facsSubtype;
+    public void setFacsSubCategory(String facsSubCategory) {
+        this.facsSubCategory = facsSubCategory;
     }
 
     public Date getRecordTime() {
@@ -176,8 +176,8 @@ public class ElecUseH extends BaseEntity
             .append("id", getId())
             .append("areaCode", getAreaCode())
             .append("facsCode", getFacsCode())
-            .append("facsType", getFacsType())
-            .append("facsSubtype", getFacsSubtype())
+            .append("facsCategory", getFacsCategory())
+            .append("facsSubCategory", getFacsSubCategory())
             .append("date", getDate())
             .append("time", getTime())
             .append("timeIndex", getTimeIndex())

+ 3 - 3
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AreaMapper.java

@@ -40,10 +40,10 @@ public interface AreaMapper {
     /**
      * 查询服务区列表(根据下挂设施)
      *
-     * @param facsType    设施类型
-     * @param facsSubType 设施子类型
+     * @param facsCategory    设施类别
+     * @param facsSubCategory 设施子类别
      */
-    List<Area> selectWithFacsType(@Param("facsType") String facsType, @Param("facsSubType") String facsSubType);
+    List<Area> selectWithFacsCategory(@Param("facsCategory") String facsCategory, @Param("facsSubCategory") String facsSubCategory);
 
     /**
      * 新增服务区

+ 1 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElecUseHMapper.java

@@ -71,5 +71,5 @@ public interface ElecUseHMapper
 
     List<Map<String, Object>> selectMonthElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
 
-    List<Map<String, Object>> selectThisDayFacsTypeElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
+    List<Map<String, Object>> selectThisDayFacsCategoryElecUse(@Param("areaCode") String areaCode, @Param("date") String date);
 }

+ 3 - 3
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAreaService.java

@@ -39,10 +39,10 @@ public interface IAreaService {
     /**
      * 查询服务区列表(根据下挂设施)
      *
-     * @param facsType    设施类型
-     * @param facsSubType 设施子类型
+     * @param facsCategory    设施类型
+     * @param facsSubCategory 设施子类型
      */
-    List<Area> selectWithFacsType(String facsType, String facsSubType);
+    List<Area> selectWithFacsCategory(String facsCategory, String facsSubCategory);
 
     /**
      * 查询区域位置树

+ 1 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElecUseHService.java

@@ -67,7 +67,7 @@ public interface IElecUseHService {
 
     Map<String, List<Map<String, Object>>> selectMonthElecUse(String areaCode);
 
-    List<Map<String, Object>> selectThisDayFacsTypeElecUse(String areaCode);
+    List<Map<String, Object>> selectThisDayFacsCategoryElecUse(String areaCode);
 
     Map<String, Object> selectThisDayAreaElecUse(String areaCode);
 }

+ 4 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AreaServiceImpl.java

@@ -72,12 +72,12 @@ public class AreaServiceImpl implements IAreaService {
     /**
      * 查询服务区列表(根据下挂设施)
      *
-     * @param facsType    设施类型
-     * @param facsSubType 设施子类型
+     * @param facsCategory    设施类别
+     * @param facsSubCategory 设施子类别
      */
     @Override
-    public List<Area> selectWithFacsType(String facsType, String facsSubType) {
-        return areaMapper.selectWithFacsType(facsType, facsSubType);
+    public List<Area> selectWithFacsCategory(String facsCategory, String facsSubCategory) {
+        return areaMapper.selectWithFacsCategory(facsCategory, facsSubCategory);
     }
 
     /**

+ 2 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElecUseHServiceImpl.java

@@ -131,9 +131,9 @@ public class ElecUseHServiceImpl implements IElecUseHService {
     }
 
     @Override
-    public List<Map<String, Object>> selectThisDayFacsTypeElecUse(String areaCode) {
+    public List<Map<String, Object>> selectThisDayFacsCategoryElecUse(String areaCode) {
         String date = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
-        return elecUseHMapper.selectThisDayFacsTypeElecUse(areaCode, date);
+        return elecUseHMapper.selectThisDayFacsCategoryElecUse(areaCode, date);
     }
 
     @Override

+ 31 - 31
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/FacsCategoryServiceImpl.java

@@ -34,31 +34,31 @@ public class FacsCategoryServiceImpl implements IFacsCategoryService {
     @Override
     public FacsCategory selectCategoryById(Long id) {
         // 查询主分类
-        FacsCategory facsType = categoryMapper.selectCategoryById(id);
+        FacsCategory category = categoryMapper.selectCategoryById(id);
 
         // 查询子分类
-        if (null != facsType) {
-            facsType.setSubtypeList(getFacsSubtypes(facsType));
+        if (null != category) {
+            category.setSubtypeList(getFacsSubtypes(category));
         }
 
-        return facsType;
+        return category;
     }
 
     /**
      * 查询能源设施/系统分类列表
      *
-     * @param emsFacsType 能源设施/系统分类
+     * @param param 能源设施/系统分类
      * @return 能源设施/系统分类
      */
     @Override
-    public List<FacsCategory> selectCategoryList(FacsCategory emsFacsType) {
+    public List<FacsCategory> selectCategoryList(FacsCategory param) {
         // 查询主分类
-        List<FacsCategory> list = categoryMapper.selectCategoryList(emsFacsType);
+        List<FacsCategory> list = categoryMapper.selectCategoryList(param);
 
         // 查询子分类
         if (CollectionUtils.isNotEmpty(list)) {
-            list.forEach(facsType -> {
-                facsType.setSubtypeList(getFacsSubtypes(facsType));
+            list.forEach(category -> {
+                category.setSubtypeList(getFacsSubtypes(category));
             });
         }
 
@@ -68,19 +68,19 @@ public class FacsCategoryServiceImpl implements IFacsCategoryService {
     /**
      * 新增能源设施/系统分类
      *
-     * @param emsFacsType 能源设施/系统分类
+     * @param category 能源设施/系统分类
      * @return 结果
      */
     @Override
-    public int insertCategory(FacsCategory emsFacsType) {
-        int count = categoryMapper.insertCategory(emsFacsType);
+    public int insertCategory(FacsCategory category) {
+        int count = categoryMapper.insertCategory(category);
 
-        if (CollectionUtils.isNotEmpty(emsFacsType.getSubtypeList())) {
-            subCategoryService.deleteSubCategoryByParentCode(emsFacsType.getCode());
-            subCategoryService.insertSubCategoryBatch(emsFacsType.getSubtypeList());
+        if (CollectionUtils.isNotEmpty(category.getSubtypeList())) {
+            subCategoryService.deleteSubCategoryByParentCode(category.getCode());
+            subCategoryService.insertSubCategoryBatch(category.getSubtypeList());
         }
         else {
-            subCategoryService.deleteSubCategoryByParentCode(emsFacsType.getCode());
+            subCategoryService.deleteSubCategoryByParentCode(category.getCode());
         }
 
         return count;
@@ -89,19 +89,19 @@ public class FacsCategoryServiceImpl implements IFacsCategoryService {
     /**
      * 修改能源设施/系统分类
      *
-     * @param emsFacsType 能源设施/系统分类
+     * @param category 能源设施/系统分类
      * @return 结果
      */
     @Override
-    public int updateCategory(FacsCategory emsFacsType) {
-        int count = categoryMapper.updateCategory(emsFacsType);
+    public int updateCategory(FacsCategory category) {
+        int count = categoryMapper.updateCategory(category);
 
-        if (CollectionUtils.isNotEmpty(emsFacsType.getSubtypeList())) {
-            subCategoryService.deleteSubCategoryByParentCode(emsFacsType.getCode());
-            subCategoryService.insertSubCategoryBatch(emsFacsType.getSubtypeList());
+        if (CollectionUtils.isNotEmpty(category.getSubtypeList())) {
+            subCategoryService.deleteSubCategoryByParentCode(category.getCode());
+            subCategoryService.insertSubCategoryBatch(category.getSubtypeList());
         }
         else {
-            subCategoryService.deleteSubCategoryByParentCode(emsFacsType.getCode());
+            subCategoryService.deleteSubCategoryByParentCode(category.getCode());
         }
 
         return count;
@@ -116,11 +116,11 @@ public class FacsCategoryServiceImpl implements IFacsCategoryService {
     @Override
     public int deleteCategoryByIds(Long[] ids) {
         for (Long id : ids) {
-            FacsCategory facsType = categoryMapper.selectCategoryById(id);
+            FacsCategory category = categoryMapper.selectCategoryById(id);
 
             // 查询扩展属性
-            if (null != facsType) {
-                subCategoryService.deleteSubCategoryByParentCode(facsType.getCode());
+            if (null != category) {
+                subCategoryService.deleteSubCategoryByParentCode(category.getCode());
             }
         }
 
@@ -135,19 +135,19 @@ public class FacsCategoryServiceImpl implements IFacsCategoryService {
      */
     @Override
     public int deleteCategoryById(Long id) {
-        FacsCategory facsType = categoryMapper.selectCategoryById(id);
+        FacsCategory category = categoryMapper.selectCategoryById(id);
 
         // 查询扩展属性
-        if (null != facsType) {
-            subCategoryService.deleteSubCategoryByParentCode(facsType.getCode());
+        if (null != category) {
+            subCategoryService.deleteSubCategoryByParentCode(category.getCode());
         }
 
         return categoryMapper.deleteCategoryById(id);
     }
 
-    private List<FacsSubCategory> getFacsSubtypes(FacsCategory emsFacsType) {
+    private List<FacsSubCategory> getFacsSubtypes(FacsCategory category) {
         FacsSubCategory param = new FacsSubCategory();
-        param.setParentCode(emsFacsType.getCode());
+        param.setParentCode(category.getCode());
 
         return subCategoryService.selectSubCategoryList(param);
     }

+ 6 - 4
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AreaMapper.xml

@@ -48,12 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-    <select id="selectWithFacsType"  resultMap="AdmServiceAreaResult">
-        select a.id, a.area_code, a.area_name, a.short_name, a.service_star, a.city, a.highway, a.direction, a.address, a.attr_org, a.mgr_org, a.open_date, a.land_area, a.floor_area, a.longitude, a.latitude from adm_service_area a
+    <select id="selectWithFacsCategory"  resultMap="AdmServiceAreaResult">
+        select
+            a.id, a.area_code, a.area_name, a.short_name, a.service_star, a.city, a.highway, a.direction, a.address, a.attr_org, a.mgr_org, a.open_date, a.land_area, a.floor_area, a.longitude, a.latitude
+        from adm_service_area a
         INNER JOIN adm_ems_facs f ON f.ref_area = a.area_code
         <where>
-            <if test="facsType != null  and facsType != ''"> and f.facs_type = #{facsType}</if>
-            <if test="facsSubType != null  and facsSubType != ''"> and f.facs_subtype = #{facsSubType}</if>
+            <if test="facsCategory != null  and facsCategory != ''"> and f.facs_category = #{facsCategory}</if>
+            <if test="facsSubCategory != null  and facsSubCategory != ''"> and f.facs_subcategory = #{facsSubCategory}</if>
         </where>
     </select>
     

+ 9 - 9
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElecUseHMapper.xml

@@ -25,8 +25,8 @@
                a.short_name as area_short_name,
                u.facs_code,
                f.facs_name,
-               f.facs_type,
-               f.facs_subtype,
+               f.facs_category,
+               f.facs_subcategory,
                u.record_time,
                u.`date`,
                u.`time`,
@@ -42,8 +42,8 @@
         <where>
             <if test="areaCode != null  and areaCode != ''">and u.area_code = #{areaCode}</if>
             <if test="facsCode != null  and facsCode != ''">and u.facs_code = #{facsCode}</if>
-            <if test="facsType != null  and facsType != ''">and f.facs_type = #{facsType}</if>
-            <if test="facsSubtype != null  and facsSubtype != ''">and f.facs_subtype = #{facsSubtype}</if>
+            <if test="facsCategory != null  and facsCategory != ''">and f.facs_category = #{facsCategory}</if>
+            <if test="facsSubCategory != null  and facsSubCategory != ''">and f.facs_subcategory = #{facsSubCategory}</if>
             <if test="date != null ">and u.`date` = #{date}</if>
             <if test="time != null ">and u.`time` = #{time}</if>
             <if test="timeIndex != null ">and u.time_index = #{timeIndex}</if>
@@ -141,8 +141,8 @@
         dateIndex
     </select>
 
-    <select id="selectThisDayFacsTypeElecUse" resultType="Map">
-        SELECT subtype.`name`,
+    <select id="selectThisDayFacsCategoryElecUse" resultType="Map">
+        SELECT subcategory.`name`,
         DATE_FORMAT(DATE, '%Y-%m-%d') AS dateIndex,
         SUM(elec_quantity) AS elecQuantity
         FROM adm_ems_facs_use_h facUse
@@ -150,12 +150,12 @@
         <if test="areaCode != null and areaCode != ''">
             and facUse.area_code = #{areaCode}
         </if>
-        LEFT JOIN dim_ems_facs_subtype subtype ON facs.facs_subtype = subtype.`code`
-        AND subtype.parent_code = 'Z'
+        LEFT JOIN dim_ems_facs_subcategory subcategory ON facs.facs_subcategory = subcategory.`code`
+        AND subcategory.parent_code = 'Z'
         WHERE
         DATE >= #{date}
         GROUP BY
-        subtype.`name`,
+        subcategory.`name`,
         dateIndex
     </select>
 

+ 2 - 2
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsMapper.xml

@@ -58,8 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="facsCode != null and facsCode != ''">facs_code,</if>
             <if test="facsName != null and facsName != ''">facs_name,</if>
-            <if test="facsCategory != null and facsType != ''">facs_category,</if>
-            <if test="facsSubCategory != null and facsSubtype != ''">facs_subcategory,</if>
+            <if test="facsCategory != null and facsCategory != ''">facs_category,</if>
+            <if test="facsSubCategory != null and facsSubCategory != ''">facs_subcategory,</if>
             <if test="enable != null">enable,</if>
             <if test="refArea != null and refArea != ''">ref_area,</if>
             <if test="createTime != null">create_time,</if>