Sfoglia il codice sorgente

物业管理端评论

tjf 3 mesi fa
parent
commit
d60da7f257

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ProprietorCarMapper.java

@@ -29,6 +29,13 @@ public interface ProprietorCarMapper
      */
     public List<ProprietorCar> selectProprietorCarList(ProprietorCar proprietorCar);
 
+    /**
+     * 查询我的车辆数量
+     * @param residentPhone
+     * @return
+     */
+    public int  selectProprietorCarCount(String residentPhone);
+
     /**
      * 新增业主车辆管理
      * 

+ 18 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/StatisticsServiceImpl.java

@@ -45,6 +45,10 @@ public class StatisticsServiceImpl implements IStatisticsService {
     private VisitorManageMapper visitorManageMapper;
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private HouseInfoMapper houseInfoMapper;
+    @Autowired
+    private ProprietorCarMapper proprietorCarMapper;
 
 
     @Override
@@ -185,7 +189,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
      */
     @Override
     public AjaxResult yeZhuTips(ResidentInfo residentInfo) {
-        Map<String, Object> map = new HashMap<>(5);
+        Map<String, Object> map = new HashMap<>(7);
         Long userId = residentInfo.getUserId();
         //物业报修未完成的数量 投诉建议未回复的数量 社区资讯未读数量
         String userRepairKey = PROPERTY_REPAIR_NO + userId;
@@ -225,17 +229,17 @@ public class StatisticsServiceImpl implements IStatisticsService {
                 if (type.equals(TWO) || type.equals(FIV)) {
                     likeCount = likeCount + 1;
                 }
-                if (likeCount==99){
+                if (likeCount == 99) {
                     break;
                 }
             }
             for (String hKey : commentInteractionUserMap.keySet()) {
                 //找到所有评论的数量targetType = 2|5
                 String type = hKey.split(":")[0];
-                if (type.equals(ONE) || type.equals(FOR)){
+                if (type.equals(ONE) || type.equals(FOR)) {
                     contentCount = contentCount + 1;
                 }
-                if (contentCount==99){
+                if (contentCount == 99) {
                     break;
                 }
             }
@@ -243,6 +247,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
         }
         map.put("likeCount", likeCount);
         map.put("contentCount", contentCount);
+
+        //我的房屋
+        int houseCount = 0;
+        List<ResidentInfo> residentInfos = houseInfoMapper.selectHouseInfoListAndResidentInfo(residentInfo);
+        if (residentInfos != null && residentInfos.size() > 0) {
+            houseCount = residentInfos.size();
+        }
+        map.put("houseCount", houseCount);
+        //我的车辆
+        map.put("carCount", proprietorCarMapper.selectProprietorCarCount(residentInfo.getResidentPhone()));
         return AjaxResult.success(map);
     }
 

+ 3 - 0
ruoyi-system/src/main/resources/mapper/system/ProprietorCarMapper.xml

@@ -55,6 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectProprietorCarVo"/>
         where car_id = #{carId}
     </select>
+    <select id="selectProprietorCarCount" parameterType="string" resultType="java.lang.Integer">
+        select count(*) from proprietor_car where  resident_phone = #{residentPhone}
+    </select>
 
     <insert id="insertProprietorCar" parameterType="ProprietorCar" useGeneratedKeys="true" keyProperty="carId">
         insert into proprietor_car