Explorar o código

物业管理端

tjf hai 4 meses
pai
achega
53ef572580

+ 13 - 19
ruoyi-admin/src/main/java/com/ruoyi/web/controller/assets/CommunityAssetsController.java

@@ -11,6 +11,7 @@ import com.ruoyi.system.service.ICommunityAssetsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
@@ -22,18 +23,16 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/wuYe/assets")
-public class CommunityAssetsController extends BaseController
-{
+public class CommunityAssetsController extends BaseController {
     @Autowired
     private ICommunityAssetsService communityAssetsService;
 
-/**
- * 查询社区资产列表
- */
-@PreAuthorize("@ss.hasPermi('system:assets:list')")
-@GetMapping("/list")
-    public TableDataInfo list(CommunityAssets communityAssets)
-    {
+    /**
+     * 查询社区资产列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:assets:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CommunityAssets communityAssets) {
         startPage();
         List<CommunityAssets> list = communityAssetsService.selectCommunityAssetsList(communityAssets);
         return getDataTable(list);
@@ -45,8 +44,7 @@ public class CommunityAssetsController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:assets:export')")
     @Log(title = "社区资产", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, CommunityAssets communityAssets)
-    {
+    public void export(HttpServletResponse response, CommunityAssets communityAssets) {
         List<CommunityAssets> list = communityAssetsService.selectCommunityAssetsList(communityAssets);
         ExcelUtil<CommunityAssets> util = new ExcelUtil<CommunityAssets>(CommunityAssets.class);
         util.exportExcel(response, list, "社区资产数据");
@@ -57,8 +55,7 @@ public class CommunityAssetsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:assets:query')")
     @GetMapping(value = "/{assetId}")
-    public AjaxResult getInfo(@PathVariable("assetId") Long assetId)
-    {
+    public AjaxResult getInfo(@PathVariable("assetId") Long assetId) {
         return success(communityAssetsService.selectCommunityAssetsByAssetId(assetId));
     }
 
@@ -68,8 +65,7 @@ public class CommunityAssetsController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:assets:add')")
     @Log(title = "社区资产", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody CommunityAssets communityAssets)
-    {
+    public AjaxResult add(@RequestBody CommunityAssets communityAssets) {
         return toAjax(communityAssetsService.insertCommunityAssets(communityAssets));
     }
 
@@ -79,8 +75,7 @@ public class CommunityAssetsController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:assets:edit')")
     @Log(title = "社区资产", businessType = BusinessType.UPDATE)
     @PostMapping("/put")
-    public AjaxResult edit(@RequestBody CommunityAssets communityAssets)
-    {
+    public AjaxResult edit(@RequestBody CommunityAssets communityAssets) {
         return toAjax(communityAssetsService.updateCommunityAssets(communityAssets));
     }
 
@@ -90,8 +85,7 @@ public class CommunityAssetsController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:assets:remove')")
     @Log(title = "社区资产", businessType = BusinessType.DELETE)
     @GetMapping("/delete/{assetIds}")
-    public AjaxResult remove(@PathVariable Long[] assetIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] assetIds) {
         return toAjax(communityAssetsService.deleteCommunityAssetsByAssetIds(assetIds));
     }
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/checkPoint/CheckPointRecordController.java

@@ -94,7 +94,7 @@ public class CheckPointRecordController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('wuYe:checkPointRecord:count')")
     @PostMapping("/count")
-    public AjaxResult count(@RequestBody CheckPointRecord checkPointRecord) {
+    public AjaxResult count( CheckPointRecord checkPointRecord) {
         return AjaxResult.success(checkPointRecordService.getCheckPointRecordCount(checkPointRecord));
     }
 }

+ 4 - 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@@ -1,8 +1,9 @@
 package com.ruoyi.common.constant;
 
-import java.util.Locale;
 import io.jsonwebtoken.Claims;
 
+import java.util.Locale;
+
 /**
  * 通用常量信息
  * 
@@ -170,4 +171,6 @@ public class Constants
      */
     public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
             "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" };
+    public static final String ONE ="1";
+    public static final String TWO ="2";
 }

+ 36 - 21
ruoyi-system/src/main/java/com/ruoyi/system/domain/checkPoint/CheckPointRecord.java

@@ -1,18 +1,17 @@
 package com.ruoyi.system.domain.checkPoint;
 
+import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.common.annotation.Excel;
-import com.ruoyi.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
-
-import java.util.Date;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 巡更点记录对象 check_point_record
  * 
  * @author boman
- * @date 2025-02-14
+ * @date 2025-02-21
  */
 public class CheckPointRecord extends BaseEntity
 {
@@ -34,8 +33,8 @@ public class CheckPointRecord extends BaseEntity
     private String checkType;
 
     /** 巡更时间 */
-    @JsonFormat(pattern = "HH:mm:ss")
-    @Excel(name = "巡更时间", width = 30, dateFormat = "HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "巡更时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkTime;
 
     /** 巡更路线 */
@@ -53,15 +52,15 @@ public class CheckPointRecord extends BaseEntity
     /** 巡更人姓名 */
     @Excel(name = "巡更人姓名")
     private String checkUserName;
-    /**
-     * 巡更人手机号
-     */
-    private String checkUsePhone;
 
     /** 巡更人id */
     @Excel(name = "巡更人id")
     private Long checkUseId;
 
+    /** 巡更人手机号 */
+    @Excel(name = "巡更人手机号")
+    private String checkUsePhone;
+
     /** 巡更结果 1:正常 2:损坏 */
     @Excel(name = "巡更结果 1:正常 2:损坏")
     private String checkResult;
@@ -75,19 +74,15 @@ public class CheckPointRecord extends BaseEntity
     private String checkResultPhoto;
 
     /** 巡更时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "巡更时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "巡更时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkResultTime;
 
-    public String getCheckUsePhone() {
-        return checkUsePhone;
-    }
+    /** 是否巡更 1:未巡更 2:已巡更 */
+    @Excel(name = "是否巡更 1:未巡更 2:已巡更")
+    private String checkStatus;
 
-    public void setCheckUsePhone(String checkUsePhone) {
-        this.checkUsePhone = checkUsePhone;
-    }
-
-    public void setCheckPointRecordId(Long checkPointRecordId)
+    public void setCheckPointRecordId(Long checkPointRecordId) 
     {
         this.checkPointRecordId = checkPointRecordId;
     }
@@ -177,6 +172,15 @@ public class CheckPointRecord extends BaseEntity
     {
         return checkUseId;
     }
+    public void setCheckUsePhone(String checkUsePhone) 
+    {
+        this.checkUsePhone = checkUsePhone;
+    }
+
+    public String getCheckUsePhone() 
+    {
+        return checkUsePhone;
+    }
     public void setCheckResult(String checkResult) 
     {
         this.checkResult = checkResult;
@@ -213,6 +217,15 @@ public class CheckPointRecord extends BaseEntity
     {
         return checkResultTime;
     }
+    public void setCheckStatus(String checkStatus) 
+    {
+        this.checkStatus = checkStatus;
+    }
+
+    public String getCheckStatus() 
+    {
+        return checkStatus;
+    }
 
     @Override
     public String toString() {
@@ -227,10 +240,12 @@ public class CheckPointRecord extends BaseEntity
             .append("useId", getUseId())
             .append("checkUserName", getCheckUserName())
             .append("checkUseId", getCheckUseId())
+            .append("checkUsePhone", getCheckUsePhone())
             .append("checkResult", getCheckResult())
             .append("checkResultDetails", getCheckResultDetails())
             .append("checkResultPhoto", getCheckResultPhoto())
             .append("checkResultTime", getCheckResultTime())
+            .append("checkStatus", getCheckStatus())
             .append("createBy", getCreateBy())
             .append("createTime", getCreateTime())
             .append("updateBy", getUpdateBy())

+ 9 - 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CheckPointRecordServiceImpl.java

@@ -12,6 +12,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static com.ruoyi.common.constant.Constants.TWO;
+
 /**
  * 巡更点记录Service业务层处理
  * 
@@ -106,18 +108,18 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService
     @Override
     public AjaxResult getCheckPointRecordCount(CheckPointRecord checkPointRecord) {
         Map<String,Object> resultMap = new HashMap<>(3);
-        resultMap.put("巡更点",0);
-        resultMap.put("已巡更",0);
-        resultMap.put("未巡更",0);
+        resultMap.put("checkPoint",0);
+        resultMap.put("yCheckPoint",0);
+        resultMap.put("wCheckPoint",0);
         checkPointRecord.setCreateTime(DateUtils.getNowDate());
         //查询出今日所有巡更点记录
         List<CheckPointRecord> checkPointRecords = checkPointRecordMapper.selectCheckPointRecordList(checkPointRecord);
         if (checkPointRecords != null && checkPointRecords.size() > 0){
             //判断巡更时间不为null的代表已经巡更
-            resultMap.put("巡更点",checkPointRecords.size());
-            long checkCount = checkPointRecords.stream().filter(e -> e.getCheckResultTime() != null).count();
-            resultMap.put("已巡更",checkCount);
-            resultMap.put("未巡更",checkPointRecords.size()-checkCount);
+            resultMap.put("checkPoint",checkPointRecords.size());
+            long checkCount = checkPointRecords.stream().filter(e -> TWO.equals(e.getCheckStatus())).count();
+            resultMap.put("yCheckPoint",checkCount);
+            resultMap.put("wCheckPoint",checkPointRecords.size()-checkCount);
         }
         return AjaxResult.success(resultMap);
     }

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProprietorCarServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.service.impl;
 
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.proprietorCar.ProprietorCar;
 import com.ruoyi.system.mapper.ProprietorCarMapper;
 import com.ruoyi.system.service.IProprietorCarService;
@@ -54,8 +55,6 @@ public class ProprietorCarServiceImpl implements IProprietorCarService
     @Override
     public int insertProprietorCar(ProprietorCar proprietorCar)
     {
-
-
         //根据车牌号判断是否是新能源
         proprietorCar.setCreateTime(DateUtils.getNowDate());
         String plateNumber = proprietorCar.getPlateNumber();
@@ -64,6 +63,7 @@ public class ProprietorCarServiceImpl implements IProprietorCarService
             vehicleType = "新能源";
         }
         proprietorCar.setVehicleType(vehicleType);
+        proprietorCar.setUserId(SecurityUtils.getUserId());
         return proprietorCarMapper.insertProprietorCar(proprietorCar);
     }
 

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ResidentInfoServiceImpl.java

@@ -103,7 +103,6 @@ public class ResidentInfoServiceImpl implements IResidentInfoService
      */
     @Override
     public ResidentInfo selectResidentInfoByUserId(Long userId) {
-        residentInfoMapper.selectResidentInfoByUserId(userId);
-        return null;
+        return residentInfoMapper.selectResidentInfoByUserId(userId);
     }
 }

+ 11 - 7
ruoyi-system/src/main/resources/mapper/system/CheckPointRecordMapper.xml

@@ -14,12 +14,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userName"    column="user_name"    />
         <result property="useId"    column="use_id"    />
         <result property="checkUserName"    column="check_user_name"    />
-        <result property="checkUsePhone"    column="check_user_phone"    />
         <result property="checkUseId"    column="check_use_id"    />
+        <result property="checkUsePhone"    column="check_use_phone"    />
         <result property="checkResult"    column="check_result"    />
         <result property="checkResultDetails"    column="check_result_details"    />
         <result property="checkResultPhoto"    column="check_result_photo"    />
         <result property="checkResultTime"    column="check_result_time"    />
+        <result property="checkStatus"    column="check_status"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectCheckPointRecordVo">
-        select check_point_record_id, check_point_manage_id, check_user_phone,date_time_num, check_type, check_time, check_address, user_name, use_id, check_user_name, check_use_id, check_result, check_result_details, check_result_photo, check_result_time, create_by, create_time, update_by, update_time, remark from check_point_record
+        select check_point_record_id, check_point_manage_id, date_time_num, check_type, check_time, check_address, user_name, use_id, check_user_name, check_use_id, check_use_phone, check_result, check_result_details, check_result_photo, check_result_time, check_status, create_by, create_time, update_by, update_time, remark from check_point_record
     </sql>
 
     <select id="selectCheckPointRecordList" parameterType="CheckPointRecord" resultMap="CheckPointRecordResult">
@@ -42,13 +43,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
             <if test="useId != null "> and use_id = #{useId}</if>
             <if test="checkUserName != null  and checkUserName != ''"> and check_user_name like concat('%', #{checkUserName}, '%')</if>
-            <if test="checkUsePhone != null  and checkUsePhone != ''"> and check_user_phone = #{checkUsePhone}</if>
             <if test="checkUseId != null "> and check_use_id = #{checkUseId}</if>
+            <if test="checkUsePhone != null  and checkUsePhone != ''"> and check_use_phone = #{checkUsePhone}</if>
             <if test="checkResult != null  and checkResult != ''"> and check_result = #{checkResult}</if>
             <if test="checkResultDetails != null  and checkResultDetails != ''"> and check_result_details = #{checkResultDetails}</if>
             <if test="checkResultPhoto != null  and checkResultPhoto != ''"> and check_result_photo = #{checkResultPhoto}</if>
             <if test="checkResultTime != null "> and check_result_time = #{checkResultTime}</if>
-            <if test="params.createTime != null  and params.createTime != ''"> AND date_format(create_time,'%Y%m%d') = date_format(#{params.createTime},'%Y%m%d')</if>
+            <if test="checkStatus != null  and checkStatus != ''"> and check_status = #{checkStatus}</if>
         </where>
     </select>
     
@@ -68,12 +69,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userName != null">user_name,</if>
             <if test="useId != null">use_id,</if>
             <if test="checkUserName != null">check_user_name,</if>
-            <if test="checkUsePhone != null">check_user_phone,</if>
             <if test="checkUseId != null">check_use_id,</if>
+            <if test="checkUsePhone != null">check_use_phone,</if>
             <if test="checkResult != null">check_result,</if>
             <if test="checkResultDetails != null">check_result_details,</if>
             <if test="checkResultPhoto != null">check_result_photo,</if>
             <if test="checkResultTime != null">check_result_time,</if>
+            <if test="checkStatus != null">check_status,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -89,12 +91,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userName != null">#{userName},</if>
             <if test="useId != null">#{useId},</if>
             <if test="checkUserName != null">#{checkUserName},</if>
-            <if test="checkUsePhone != null">#{checkUsePhone},</if>
             <if test="checkUseId != null">#{checkUseId},</if>
+            <if test="checkUsePhone != null">#{checkUsePhone},</if>
             <if test="checkResult != null">#{checkResult},</if>
             <if test="checkResultDetails != null">#{checkResultDetails},</if>
             <if test="checkResultPhoto != null">#{checkResultPhoto},</if>
             <if test="checkResultTime != null">#{checkResultTime},</if>
+            <if test="checkStatus != null">#{checkStatus},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -114,12 +117,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userName != null">user_name = #{userName},</if>
             <if test="useId != null">use_id = #{useId},</if>
             <if test="checkUserName != null">check_user_name = #{checkUserName},</if>
-            <if test="checkUsePhone != null">check_user_phone = #{checkUsePhone},</if>
             <if test="checkUseId != null">check_use_id = #{checkUseId},</if>
+            <if test="checkUsePhone != null">check_use_phone = #{checkUsePhone},</if>
             <if test="checkResult != null">check_result = #{checkResult},</if>
             <if test="checkResultDetails != null">check_result_details = #{checkResultDetails},</if>
             <if test="checkResultPhoto != null">check_result_photo = #{checkResultPhoto},</if>
             <if test="checkResultTime != null">check_result_time = #{checkResultTime},</if>
+            <if test="checkStatus != null">check_status = #{checkStatus},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>

+ 4 - 0
ruoyi-system/src/main/resources/mapper/system/ResidentInfoMapper.xml

@@ -53,6 +53,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectResidentInfoVo"/>
         where resident_id = #{residentId}
     </select>
+    <select id="selectResidentInfoByUserId" parameterType="Long" resultMap="ResidentInfoResult">
+        <include refid="selectResidentInfoVo"/>
+        where user_id = #{userId}
+    </select>
 
     <insert id="insertResidentInfo" parameterType="ResidentInfo" useGeneratedKeys="true" keyProperty="residentId">
         insert into resident_info