ソースを参照

开栓与民用工程关系查询、手机用户权限功能

wang_xy 1 年間 前
コミット
3f585d87f3

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZComprehensiveController.java

@@ -42,7 +42,6 @@ public class ZComprehensiveController extends BaseController {
     /**
      * 查询开栓|安检|维修列表
      */
-//    @SaCheckPermission("zdsz:openbolt:list")
     @GetMapping("/list")
     public TableDataInfo<ZComprehensiveVo> list(@Validated(QueryGroup.class) ZComprehensiveBo bo, PageQuery pageQuery) {
         return iZComprehensiveService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class ZComprehensiveController extends BaseController {
     /**
      * 导出开栓|安检|维修列表
      */
-//    @SaCheckPermission("zdsz:openbolt:export")
     @Log(title = "开栓|安检|维修", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(ZComprehensiveBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class ZComprehensiveController extends BaseController {
      *
      * @param id 主键
      */
-//    @SaCheckPermission("zdsz:openbolt:query")
     @GetMapping("/{id}")
     public R<ZComprehensiveVo> getInfo(@NotNull(message = "主键不能为空")
                                      @PathVariable String id) {
@@ -74,7 +71,6 @@ public class ZComprehensiveController extends BaseController {
     /**
      * 新增开栓|安检|维修
      */
-//    @SaCheckPermission("zdsz:openbolt:add")
     @Log(title = "开栓|安检|维修", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -88,7 +84,6 @@ public class ZComprehensiveController extends BaseController {
     /**
      * 修改开栓|安检|维修
      */
-//    @SaCheckPermission("zdsz:openbolt:edit")
     @Log(title = "开栓|安检|维修", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -104,7 +99,6 @@ public class ZComprehensiveController extends BaseController {
      *
      * @param ids 主键串
      */
-//    @SaCheckPermission("zdsz:openbolt:remove")
     @Log(title = "开栓|安检|维修", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public R<Void> remove(@NotEmpty(message = "主键不能为空")

+ 2 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java

@@ -114,6 +114,8 @@ public class SysRole extends BaseEntity {
     @TableField(exist = false)
     private Long[] deptIds;
 
+    private String enginTypeList;
+
     public SysRole(Long roleId) {
         this.roleId = roleId;
     }

+ 2 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -45,6 +45,7 @@
         <result property="roleSort" column="role_sort"/>
         <result property="dataScope" column="data_scope"/>
         <result property="status" column="role_status"/>
+        <result property="enginTypeList" column="engin_type_list"/>
     </resultMap>
 
     <sql id="selectUserVo">
@@ -77,6 +78,7 @@
                r.role_key,
                r.role_sort,
                r.data_scope,
+               r.engin_type_list,
                r.status as role_status
         from sys_user u
             left join sys_dept d on u.dept_id = d.dept_id

+ 0 - 4
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/ZComprehensive.java

@@ -55,10 +55,6 @@ public class ZComprehensive extends BaseEntity {
      */
     private String isQualified;
     /**
-     * 是否维修
-     */
-    private String isMaintenance;
-    /**
      * 备注
      */
     private String remark;

+ 0 - 6
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/bo/ZComprehensiveBo.java

@@ -75,12 +75,6 @@ public class ZComprehensiveBo extends BaseEntity {
 //    @NotBlank(message = "安检是否合格不能为空", groups = {AddGroup.class, EditGroup.class})
     private String isQualified;
 
-    /**
-     * 是否维修
-     */
-//    @NotBlank(message = "是否维修不能为空", groups = {AddGroup.class, EditGroup.class})
-    private String isMaintenance;
-
 //    public List<String> getPicIds() {
 //        return picIds;
 //    }

+ 0 - 6
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZComprehensiveVo.java

@@ -72,12 +72,6 @@ public class ZComprehensiveVo extends BaseEntity implements Serializable {
     private String isQualified;
 
     /**
-     * 是否维修
-     */
-    @ExcelProperty(value = "是否维修")
-    private String isMaintenance;
-
-    /**
      * 备注
      */
     @ExcelProperty(value = "备注")

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

@@ -21,5 +21,6 @@ public interface ZComprehensiveMapper extends BaseMapperPlus<ZComprehensiveMappe
 
 //    Page<ZComprehensiveVo> getPageList(@Param("p") ZComprehensiveBo bo, Page<?> page);
     Page<ZComprehensiveVo> queryPageList(@Param("p") ZComprehensiveBo bo, @Param("pa")Page<?> page, @Param("page") Integer pages, @Param("size") Integer size);
+    String getIsQualifiedString(String houseId);
 
 }

+ 0 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZComprehensiveServiceImpl.java

@@ -96,7 +96,6 @@ public class ZComprehensiveServiceImpl implements IZComprehensiveService {
         lqw.eq(StringUtils.isNotBlank(bo.getHouseId()), ZComprehensive::getHouseId, bo.getHouseId());
         lqw.eq(StringUtils.isNotBlank(bo.getType()), ZComprehensive::getType, bo.getType());
         lqw.eq(StringUtils.isNotBlank(bo.getIsQualified()), ZComprehensive::getIsQualified, bo.getIsQualified());
-        lqw.eq(StringUtils.isNotBlank(bo.getIsMaintenance()), ZComprehensive::getIsMaintenance, bo.getIsMaintenance());
         return lqw;
     }
 

+ 20 - 10
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringNodeServiceImpl.java

@@ -21,10 +21,14 @@ import com.ruoyi.zdsz.domain.bo.*;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringNodeVo;
 import com.ruoyi.zdsz.domain.vo.areaMessageVo;
+import com.ruoyi.zdsz.mapper.ZComprehensiveMapper;
 import com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper;
 import com.ruoyi.zdsz.mapper.ZEngineeringNodeMapper;
 import com.ruoyi.zdsz.mapper.ZEngineeringReviewMapper;
-import com.ruoyi.zdsz.service.*;
+import com.ruoyi.zdsz.service.IZEngiineeringPhotoService;
+import com.ruoyi.zdsz.service.IZEngineeringInfoService;
+import com.ruoyi.zdsz.service.IZEngineeringNodeService;
+import com.ruoyi.zdsz.service.IZEngineeringReviewService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -67,6 +71,8 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
     private ZEngineeringCivilMapper zEngineeringCivilMapper;
     @Resource
     private  ZEngineeringReviewMapper zEngineeringReviewMapper;
+    @Resource
+    private ZComprehensiveMapper zComprehensiveMapper;
 
 
     /**
@@ -666,18 +672,22 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
             List stateList=new ArrayList();
             sysDictMap.get(item.getEnginType()+"_"+item.getEnginClassification()).stream().forEach(item3 -> {
                 Map<String,Object> map=new HashMap<>();
-                        if (nodeList.size()>0&&nodeList.stream().anyMatch(x->x.getType().equals(item3.getDictValue())))
-                        {
-                map.put("Type",item3.getDictValue());
-                map.put("state",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewStatus():"0");
-                        }
-                        else {
-                            map.put("Type",item3.getDictValue());
-                            map.put("state","0");
-                        }
+                if (nodeList.size()>0&&nodeList.stream().anyMatch(x->x.getType().equals(item3.getDictValue()))){
+                    map.put("Type",item3.getDictValue());
+                    map.put("state",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewStatus():"0");
+                }else {
+                    map.put("Type",item3.getDictValue());
+                    map.put("state","0");
+                }
                 stateList.add(map);
                 ReViewStateMap.set(stateList);;
             });
+            if(item.getEnginClassification().contains("indoor_engin")){
+                Map<String,Object> map=new HashMap<>();
+                map.put("Type","开栓");
+                map.put("state",zComprehensiveMapper.getIsQualifiedString(item.getHouseId()));
+                ReViewStateMap.get().add(map);
+            }
             statemap.put(item.getId(),ReViewStateMap.get());
             MonthTableNameHandler.removeData();
 

+ 4 - 2
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZBuildingMapper.xml

@@ -40,10 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         a.name as name,
         a.remark as remark,
         a.source,
-        (select b.name from z_area b where b.id = a.area_id) as areaName
+        b.name as areaName
         from z_building a
+        left join z_area b on b.id = a.area_id
         <where>
             a.del_flag = '0'
+            and b.del_flag = '0'
             <if test="p.name != null  and p.name != ''">
                 and a.name LIKE CONCAT('%',#{p.name},'%')
             </if>
@@ -51,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.area_id = #{p.areaId}
             </if>
         </where>
-        order by a.name asc
+        order by b.name,a.name asc
     </select>
 
 </mapper>

+ 11 - 2
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZComprehensiveMapper.xml

@@ -13,7 +13,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="district" column="district"/>
         <result property="type" column="type"/>
         <result property="isQualified" column="is_qualified"/>
-        <result property="isMaintenance" column="is_maintenance"/>
         <result property="remark" column="remark"/>
         <result property="delFlag" column="del_flag"/>
         <result property="createBy" column="create_by"/>
@@ -90,5 +89,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
         order by zc.create_time desc
     </select>
-
+    <select id="getIsQualifiedString" resultType="java.lang.String" parameterType="java.lang.String">
+        SELECT
+            CASE is_qualified WHEN 'N' THEN 0 ELSE 1 END as isQualified
+        FROM
+            z_comprehensive
+        WHERE
+            house_id = #{houseId}
+        AND type = '1' AND del_flag =0
+        order by create_time desc ,update_time desc
+            LIMIT 1
+    </select>
 </mapper>

+ 10 - 4
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZHouseMapper.xml

@@ -32,16 +32,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         a.name as name,
         a.remark as remark,
         a.source,
-        (select b.name from z_area b where b.id = a.area_id) as areaName,
-        (select c.name from z_building c where c.id = a.building_id) as buildingName,
-        (select d.name from z_unit d where d.id = a.unit_id) as unitName,
+        b.name as areaName,
+        c.name as buildingName,
+        d.name as unitName,
         a.house_user_name as houseUserName,
         a.id_card as idCard,
         a.phone,
         a.new_phone as newPhone
         from z_house a
+        left join z_area b on b.id = a.area_id
+        left join z_building c on c.id = a.building_id
+        left join z_unit d on d.id = a.unit_id
         <where>
             a.del_flag = '0'
+            and b.del_flag = '0'
+            and c.del_flag = '0'
+            and d.del_flag = '0'
             <if test="p.name != null  and p.name != ''">
                 and a.name LIKE CONCAT('%',#{p.name},'%')
             </if>
@@ -67,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.new_phone LIKE CONCAT('%',#{p.newPhone},'%')
             </if>
         </where>
-        order by a.name asc
+        order by b.name,c.name,d.name,a.name asc
     </select>
 
 

+ 7 - 3
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZUnitMapper.xml

@@ -41,11 +41,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         a.name as name,
         a.remark as remark,
         a.source,
-        (select b.name from z_area b where b.id = a.area_id) as areaName,
-        (select c.name from z_building c where c.id = a.building_id) as buildingName
+        b.name as areaName,
+        c.name as buildingName
         from z_unit a
+        left join z_area b on b.id = a.area_id
+        left join z_building c on c.id = a.building_id
         <where>
             a.del_flag = '0'
+            and b.del_flag = '0'
+            and c.del_flag = '0'
             <if test="p.name != null  and p.name != ''">
                 and a.name LIKE CONCAT('%',#{p.name},'%')
             </if>
@@ -56,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and a.building_id = #{p.buildingId}
             </if>
         </where>
-        order by a.name asc
+        order by b.name,c.name,a.name asc
     </select>
 
 </mapper>