Przeglądaj źródła

审核bug修复

wangtong 1 rok temu
rodzic
commit
dc4344a126

+ 4 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringCivilController.java

@@ -17,6 +17,7 @@ import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringReviewBo;
 import com.ruoyi.zdsz.domain.bo.switchBo;
 import com.ruoyi.zdsz.domain.vo.BulidingStatusVo;
+import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo;
 import com.ruoyi.zdsz.domain.vo.areaStatusVo;
 import com.ruoyi.zdsz.service.IZEngineeringCivilService;
@@ -73,9 +74,9 @@ public class ZEngineeringCivilController extends BaseController {
 //    @SaCheckPermission("zdsz:engineeringCivil:export")
     @Log(title = "民用工程", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(ZEngineeringCivilBo bo, HttpServletResponse response) {
-        List<ZEngineeringCivilVo> list = iZEngineeringCivilService.queryList(bo);
-        ExcelUtil.exportExcel(list, "民用工程", ZEngineeringCivilVo.class, response);
+    public void export(ZEngineeringCivilBo bo, PageQuery pageQuery, HttpServletResponse response) {
+        List<ZEngineeringCivilExportVo> list = iZEngineeringCivilService.exportList(bo);
+        ExcelUtil.exportExcel(list, "民用工程", ZEngineeringCivilExportVo.class, response);
     }
 
     /**

+ 2 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/bo/ZEngineeringNodeBo.java

@@ -1,5 +1,6 @@
 package com.ruoyi.zdsz.domain.bo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.Version;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
@@ -40,6 +41,7 @@ public class ZEngineeringNodeBo extends BaseEntity {
      * 节点类型
      */
     @NotBlank(message = "节点类型不能为空", groups = { AddGroup.class, EditGroup.class })
+//    @ExcelProperty(value = "节点类型")
     private String type;
 
     /**

+ 276 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZEngineeringCivilExportVo.java

@@ -0,0 +1,276 @@
+package com.ruoyi.zdsz.domain.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.ruoyi.common.annotation.ExcelDictFormat;
+import com.ruoyi.common.convert.ExcelDictConvert;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.core.validate.AddGroup;
+import com.ruoyi.common.core.validate.EditGroup;
+import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 民用工程视图对象 z_engineering_civil
+ *
+ * @author ruoyi
+ * @date 2023-12-27
+ */
+@Data
+@ExcelIgnoreUnannotated
+public class ZEngineeringCivilExportVo extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+//    /**
+//     * 主键
+//     */
+//    @ExcelProperty(value = "主键")
+//    private String id;
+
+    /**
+     * 行政区
+     */
+    @ExcelProperty(value = "行政区", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "district")
+    private String district;
+
+    /**
+     * 小区id
+     */
+    @ExcelProperty(value = "小区")
+    private String areaId;
+
+    private String areaName;
+
+    /**
+     * 楼宇id
+     */
+    @ExcelProperty(value = "楼宇")
+    private String buildingId;
+
+    private String buildingName;
+
+    /**
+     * 单元id
+     */
+    @ExcelProperty(value = "单元")
+    private String unitId;
+    private String unitName;
+
+    /**
+     * 房间id
+     */
+    @ExcelProperty(value = "房间")
+    private String houseId;
+    private String houseName;
+
+    /**
+     * 工程类型
+     */
+    @ExcelProperty(value = "工程类型")
+    private String enginType;
+
+    /**
+     * 工程分类
+     */
+    @ExcelProperty(value = "工程分类")
+    private String enginClassification;
+
+    private String enginClassificationName;
+
+    /**
+     * 工程周期
+     */
+//    @ExcelProperty(value = "工程周期")
+    private String enginCycle;
+
+    /**
+     * 完工状态
+     */
+    @ExcelProperty(value = "完工状态")
+    private String completionStatus;
+
+    /**
+     * 默认图片地址
+     */
+//    @ExcelProperty(value = "默认图片地址")
+    private String imgUrl;
+
+    /**
+     * 备注
+     */
+//    @ExcelProperty(value = "备注")
+    private String remark;
+
+    /**
+     *
+     */
+    @NotBlank(message = "不能为空", groups = { EditGroup.class })
+    private String id;
+
+    /**
+     * 民用工程id
+     */
+    @NotBlank(message = "民用工程id不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String civliId;
+
+    /**
+     * 节点类型
+     */
+    @NotBlank(message = "节点类型不能为空", groups = { AddGroup.class, EditGroup.class })
+    @ExcelProperty(value = "节点类型")
+    private String type;
+
+    /**
+     * 审核状态(未审核、未通过-0 审核通过-1 无需审核-null)
+     */
+//    @NotBlank(message = "审核状态不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String reviewStatus;
+    /**
+     * 审核内容
+     */
+    private String reviewContent;
+
+    /**
+     * 备注
+     */
+//    @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
+//    private String remark;
+
+    /**
+     * 民用工程id
+     */
+    @NotBlank(message = "民用工程id不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String engInfoId;
+
+    /**
+     * 施工地址
+     */
+    @ExcelProperty(value = "施工地址")
+    private String constructAddre;
+
+    /**
+     * 是否按图纸施工
+     */
+    @ExcelProperty(value = "是否按图纸施工")
+    private String constructAccordingDrawings;
+
+    /**
+     * 分段打压是否合格
+     */
+    @ExcelProperty(value = "分段打压是否合格")
+    private String segmentedCompressionQualified;
+
+    /**
+     * 回填时间
+     */
+    @ExcelProperty(value = "回填时间")
+    private Date backfillTime;
+
+    /**
+     * 施工人电话
+     */
+    @ExcelProperty(value = "施工人电话")
+    private String constructPhone;
+
+    /**
+     * 施工人
+     */
+    @ExcelProperty(value = "施工人")
+    private String constructUser;
+
+    /**
+     * 施工时间
+     */
+    @ExcelProperty(value = "施工时间")
+    private Date constructTime;
+
+    /**
+     * 负责人名称
+     */
+    @ExcelProperty(value = "负责人名称")
+    private String headName;
+
+    /**
+     * 负责人电话
+     */
+    @ExcelProperty(value = "负责人电话")
+    private String headPhone;
+
+//
+//    /**
+//     * 备注
+//     */
+//    private String remark;
+
+
+    /**
+     * 详情id
+     */
+    @NotBlank(message = "详情id不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String detailsId;
+    /**
+     * 上门类型
+     */@ExcelProperty(value = "上门类型")
+    private String visitType;
+
+    /**
+     * 自闭阀类型
+     */
+    @ExcelProperty(value = "自闭阀类型")
+    private String selfClosingValveType;
+    /**
+     * 腐蚀等级
+     */
+    @ExcelProperty(value = "腐蚀等级")
+    private String corrosionLevel;
+
+    /**
+     * 品牌
+     */
+    @ExcelProperty(value = "品牌")
+    private String brand;
+
+    /**
+     * 材质
+     */
+    @ExcelProperty(value = "材质")
+    private String materialQuality;
+    private String materialQualityName;
+
+    /**
+     * 规格
+     */
+    @ExcelProperty(value = "规格")
+    private String specifications;
+    private String specificationsName;
+
+    /**
+     * 数量
+     */
+    @ExcelProperty(value = "数量")
+    private Double number;
+
+//    /**
+//     * 备注
+//     */
+//    private String remark;
+//@TableField(fill = FieldFill.INSERT_UPDATE)
+//@TableField(exist = false)
+@ExcelProperty(value = "施工时间")
+private Date updateInfoTime;
+    /**
+     * 创建者
+     */
+   // @TableField(fill = FieldFill.INSERT)
+    @ExcelProperty(value = "施工人")
+    private String createBy;
+}

+ 15 - 9
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZEngineeringCivilVo.java

@@ -27,7 +27,7 @@ public class ZEngineeringCivilVo extends BaseEntity implements Serializable {
     /**
      * 主键
      */
-    @ExcelProperty(value = "主键")
+//    @ExcelProperty(value = "主键")
     private String id;
 
     /**
@@ -40,49 +40,55 @@ public class ZEngineeringCivilVo extends BaseEntity implements Serializable {
     /**
      * 小区id
      */
-    @ExcelProperty(value = "小区id")
+
     private String areaId;
+    @ExcelProperty(value = "小区")
     private String areaName;
 
     /**
      * 楼宇id
      */
-    @ExcelProperty(value = "楼宇id")
+//    @ExcelProperty(value = "楼宇id")
     private String buildingId;
+    @ExcelProperty(value = "楼宇")
     private String buildingName;
 
     /**
      * 单元id
      */
-    @ExcelProperty(value = "单元id")
+    //@ExcelProperty(value = "单元id")
     private String unitId;
+    @ExcelProperty(value = "单元")
     private String unitName;
 
     /**
      * 房间id
      */
-    @ExcelProperty(value = "房间id")
+
     private String houseId;
+    @ExcelProperty(value = "房间")
     private String houseName;
 
     /**
      * 工程类型
      */
     @ExcelProperty(value = "工程类型")
+
     private String enginType;
 
     /**
      * 工程分类
      */
-    @ExcelProperty(value = "工程分类")
+    //@ExcelProperty(value = "工程分类")
     private String enginClassification;
 
+    @ExcelProperty(value = "工程分类")
     private String enginClassificationName;
 
     /**
      * 工程周期
      */
-    @ExcelProperty(value = "工程周期")
+    //@ExcelProperty(value = "工程周期")
     private String enginCycle;
 
     /**
@@ -94,13 +100,13 @@ public class ZEngineeringCivilVo extends BaseEntity implements Serializable {
     /**
      * 默认图片地址
      */
-    @ExcelProperty(value = "默认图片地址")
+   // @ExcelProperty(value = "默认图片地址")
     private String imgUrl;
 
     /**
      * 备注
      */
-    @ExcelProperty(value = "备注")
+    //@ExcelProperty(value = "备注")
     private String remark;
 
     private List<ZEngineeringNodeBo> zEngineeringNodeBoList;

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringCivilMapper.java

@@ -33,4 +33,5 @@ public interface ZEngineeringCivilMapper extends BaseMapperPlus<ZEngineeringCivi
     areaMessageVo getAreaName(String Id);
     LinkedList<String> getTableNames(String tableName);
     List<ZEngineeringInfoBo> getsumId(@Param("tableNames") List tableNames, @Param("createTime")List createTime, @Param("UserName") String UserName);
+    List<ZEngineeringCivilExportVo> getexportList(@Param("tableNames") List tableNames,@Param("createTime") String createTime,@Param("p") ZEngineeringCivilBo bo);
 }

+ 2 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZEngineeringCivilService.java

@@ -5,6 +5,7 @@ import com.ruoyi.zdsz.domain.ZEngineeringCivil;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringReviewBo;
 import com.ruoyi.zdsz.domain.bo.switchBo;
+import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo;
 import com.ruoyi.zdsz.domain.bo.ZEngineeringCivilBo;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -38,6 +39,7 @@ public interface IZEngineeringCivilService {
      * 查询民用工程列表
      */
     TableDataInfo<ZEngineeringCivilVo> queryPageList(ZEngineeringCivilBo bo, PageQuery pageQuery);
+    List<ZEngineeringCivilExportVo> exportList(ZEngineeringCivilBo bo);
 
     /**
      * 查询民用工程列表

+ 15 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringCivilServiceImpl.java

@@ -212,10 +212,24 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
                 item.setNodeReViewStateList(ReviewList.get(item.getId()));
         });
         page.setTotal(!ObjectUtils.isEmpty(result.getRecords()) ? result.getRecords().get(0).getTotal() : 0);
-
         return TableDataInfo.build(result);
     }
 
+    @Override
+    public List<ZEngineeringCivilExportVo> exportList(ZEngineeringCivilBo bo) {
+              SimpleDateFormat format=new SimpleDateFormat("yyyy_MM");
+              LinkedList <String>list=baseMapper.getTableNames("z_engineering_info");
+              list.removeLast();
+              List DateList=new ArrayList();
+              list.stream().forEach(item->{
+
+                  DateList.add(item.substring(item.indexOf("2")));
+              });
+
+              List<ZEngineeringCivilExportVo> zEngineeringCivilExportVoList=baseMapper.getexportList(DateList,format.format(new Date()),bo);
+        return zEngineeringCivilExportVoList;
+    }
+
     /**
      * 查询民用工程列表
      */

+ 153 - 2
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringCivilMapper.xml

@@ -266,7 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and update_info_time between #{createTime[0]} and #{createTime[1]}
         </if>
         <if test="UserName != null and UserName != ''">
-        and create_by like CONCAT(#{UserName},'%')
+        and create_by like CONCAT('%',#{UserName},'%')
         </if>
         <foreach collection="tableNames" item="name">
             union
@@ -280,9 +280,160 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
               and  update_info_time between #{createTime[0]} and #{createTime[1]}
             </if>
             <if test="UserName != null and UserName != ''">
-                and create_by like CONCAT(#{UserName},'%')
+                and create_by like CONCAT('%',#{UserName},'%')
             </if>
         </foreach>
 
     </select>
+    <select id="getexportList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
+        SELECT
+            a.district,
+            g.`name` AS area_id,
+            h.`name` AS building_id,
+            i.`name` AS unit_id,
+            j.`name` AS house_id,
+            k.dict_label AS engin_classification,
+            CASE
+                a.engin_type
+                WHEN 'new_built' THEN
+                    '新建' ELSE '旧改'
+                END AS engin_type,
+            a.completion_status,
+            b.type,
+            c.construct_addre,
+            c.construct_according_drawings,
+            c.segmented_compression_qualified,
+            c.backfill_time,
+            c.construct_phone,
+            c.construct_time,
+            c.head_name,
+            c.head_phone,
+            d.corrosion_level,
+            d.visit_type,
+            d.self_closing_valve_type,
+            d.brand,
+            e.`name` AS material_quality,
+            f.`name` AS specifications,
+            d.number,
+        c.update_info_time as updateInfoTime,
+        c.create_by as createBy
+        FROM
+            z_engineering_civil a
+        LEFT JOIN z_engineering_node b ON a.id = b.civli_id
+        LEFT JOIN z_engineering_info c ON b.id = c.eng_info_id
+        LEFT JOIN z_engineering_material d ON c.id = d.details_id
+        LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
+        LEFT JOIN z_engin_specifications f ON f.id = d.specifications
+        LEFT JOIN z_area g ON g.id = a.area_id
+        LEFT JOIN z_building h ON h.id = a.building_id
+        LEFT JOIN z_unit i ON i.id = a.unit_id
+        LEFT JOIN z_house j ON j.id = a.house_id
+        LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
+        AND k.dict_value = a.engin_classification
+        WHERE
+         a.create_time LIKE CONCAT(REPLACE(#{createTime}, '_', '-'),'%')
+        <if test="p.district != null and p.district != ''">
+            and a.district = #{p.district}
+        </if>
+        <if test="p.areaId != null and p.areaId != ''">
+            and a.area_id = #{p.areaId}
+        </if>
+        <if test="p.buildingId != null and p.buildingId != ''">
+            and a.building_id = #{p.buildingId}
+        </if>
+        <if test="p.unitId != null and p.unitId != ''">
+            and a.unit_id = #{p.unitId}
+        </if>
+        <if test="p.enginType != null and p.enginType != ''">
+            and engin_type = #{p.enginType}
+        </if>
+        <if test="p.enginClassification != null and p.enginClassification != ''">
+            and engin_classification = #{p.enginClassification}
+        </if>
+        <if test="p.enginCycle != null and p.enginCycle != ''">
+            and engin_cycle = 0
+        </if>
+        <if test="p.beginTime != null and p.beginTime != ''">
+            and  update_info_time between #{beginTime[0]} and #{beginTime[1]}
+        </if>
+        <if test="p.createBy != null and p.createBy != ''">
+            and create_by like CONCAT(#{p.createBy},'%')
+        </if>
+        <foreach collection="tableNames" item="name">
+            union
+            SELECT
+            a.district,
+            g.`name` AS area_id,
+            h.`name` AS building_id,
+            i.`name` AS unit_id,
+            j.`name` AS house_id,
+            k.dict_label AS engin_classification,
+            CASE
+            a.engin_type
+            WHEN 'new_built' THEN
+            '新建' ELSE '旧改'
+            END AS engin_type,
+            a.completion_status,
+            b.type,
+            c.construct_addre,
+            c.construct_according_drawings,
+            c.segmented_compression_qualified,
+            c.backfill_time,
+            c.construct_phone,
+            c.construct_time,
+            c.head_name,
+            c.head_phone,
+            d.corrosion_level,
+            d.visit_type,
+            d.self_closing_valve_type,
+            d.brand,
+            e.`name` AS material_quality,
+            f.`name` AS specifications,
+            d.number,
+            c.update_info_time as updateInfoTime,
+            c.create_by as createBy
+            FROM
+            z_engineering_civil a
+            LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
+            LEFT JOIN z_engineering_info_${name} c ON b.id = c.eng_info_id
+            LEFT JOIN z_engineering_material_${name} d ON c.id = d.details_id
+            LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
+            LEFT JOIN z_engin_specifications f ON f.id = d.specifications
+            LEFT JOIN z_area g ON g.id = a.area_id
+            LEFT JOIN z_building h ON h.id = a.building_id
+            LEFT JOIN z_unit i ON i.id = a.unit_id
+            LEFT JOIN z_house j ON j.id = a.house_id
+            LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
+            AND k.dict_value = a.engin_classification
+            WHERE
+             a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
+            <if test="p.district != null and p.district != ''">
+                and a.district = #{p.district}
+            </if>
+            <if test="p.areaId != null and p.areaId != ''">
+                and a.area_id = #{p.areaId}
+            </if>
+            <if test="p.buildingId != null and p.buildingId != ''">
+                and a.building_id = #{p.buildingId}
+            </if>
+            <if test="p.unitId != null and p.unitId != ''">
+                and a.unit_id = #{p.unitId}
+            </if>
+            <if test="p.enginType != null and p.enginType != ''">
+                and engin_type = #{p.enginType}
+            </if>
+            <if test="p.enginClassification != null and p.enginClassification != ''">
+                and engin_classification = #{p.enginClassification}
+            </if>
+            <if test="p.enginCycle != null and p.enginCycle != ''">
+                and engin_cycle = 0
+            </if>
+            <if test="p.beginTime != null and p.beginTime != ''">
+                and  update_info_time between #{beginTime[0]} and #{beginTime[1]}
+            </if>
+            <if test="p.createBy != null and p.createBy != ''">
+                and create_by like CONCAT(#{p.createBy},'%')
+            </if>
+        </foreach>
+    </select>
 </mapper>