Browse Source

物业管理端

tjf 4 months ago
parent
commit
3db2d254fd

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/propertyRepair/PropertyRepairController.java

@@ -100,4 +100,13 @@ public class PropertyRepairController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] repairIds) {
         return toAjax(propertyRepairService.deletePropertyRepairByRepairIds(repairIds));
     }
+
+    /**
+     * 指派物业报修人员
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:repair:assign')")
+    @PostMapping("/assign")
+    public AjaxResult assign(@RequestBody PropertyRepair propertyRepair) {
+        return propertyRepairService.assign(propertyRepair);
+    }
 }

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/staffManage/StaffManageController.java

@@ -38,6 +38,16 @@ public class StaffManageController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询员工管理列表不分页
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:staffManage:listNoPage')")
+    @GetMapping("/listNoPage")
+    public TableDataInfo listNoPage(StaffManage staffManage) {
+        List<StaffManage> list = staffManageService.selectStaffManageList(staffManage);
+        return getDataTable(list);
+    }
+
     /**
      * 导出员工管理列表
      */

+ 2 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@@ -173,4 +173,6 @@ public class Constants
             "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";
+    public static final String THR ="3";
+    public static final String FOR ="4";
 }

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/propertyRepair/PropertyRepair.java

@@ -54,8 +54,8 @@ public class PropertyRepair extends BaseEntity
     @Excel(name = "报修详情图片,存储图片路径或URL")
     private String repairImages;
 
-    /** 报修状态:字典值 */
-    @Excel(name = "报修状态:字典值")
+    /** 报修状态:1:待分派 2:待上门 3:处理中 4:已完成 */
+    @Excel(name = "报修状态:1:待分派 2:待上门 3:处理中 4:已完成")
     private String repairStatus;
 
     /** 维修人员姓名 */

+ 13 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/staffTrain/StaffTrainManual.java

@@ -65,8 +65,20 @@ public class StaffTrainManual extends BaseEntity
     /** 是否置顶:Y(置顶)、N(不置顶) */
     @Excel(name = "是否置顶:Y", readConverterExp = "Y=置顶,N=不置顶")
     private String isTop;
+    /**
+     * 进度
+     */
+    private String progress;
 
-    public void setManualId(Long manualId) 
+    public String getProgress() {
+        return progress;
+    }
+
+    public void setProgress(String progress) {
+        this.progress = progress;
+    }
+
+    public void setManualId(Long manualId)
     {
         this.manualId = manualId;
     }

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPropertyRepairService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.propertyRepair.PropertyRepair;
 
 import java.util.List;
@@ -45,6 +46,11 @@ public interface IPropertyRepairService
      */
     public int updatePropertyRepair(PropertyRepair propertyRepair);
 
+    /**
+     * 指派物业报修人员
+     */
+    public AjaxResult assign(PropertyRepair propertyRepair);
+
     /**
      * 批量删除物业报修
      * 

+ 39 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PropertyRepairServiceImpl.java

@@ -1,14 +1,19 @@
 package com.ruoyi.system.service.impl;
 
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.StaffManage;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.system.domain.propertyRepair.PropertyRepair;
 import com.ruoyi.system.mapper.PropertyRepairMapper;
+import com.ruoyi.system.mapper.StaffManageMapper;
 import com.ruoyi.system.service.IPropertyRepairService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
+import static com.ruoyi.common.constant.Constants.*;
+
 /**
  * 物业报修Service业务层处理
  * 
@@ -20,6 +25,8 @@ public class PropertyRepairServiceImpl implements IPropertyRepairService
 {
     @Autowired
     private PropertyRepairMapper propertyRepairMapper;
+    @Autowired
+    private StaffManageMapper staffManageMapper;
 
     /**
      * 查询物业报修
@@ -68,7 +75,38 @@ public class PropertyRepairServiceImpl implements IPropertyRepairService
     public int updatePropertyRepair(PropertyRepair propertyRepair)
     {
         propertyRepair.setUpdateTime(DateUtils.getNowDate());
-        return propertyRepairMapper.updatePropertyRepair(propertyRepair);
+        int i = propertyRepairMapper.updatePropertyRepair(propertyRepair);
+        String repairStatus = propertyRepair.getRepairStatus();
+        if (FOR.equals(repairStatus)){
+            //判断如果维修完成,把维修人员的状态改成空闲
+            StaffManage staffManage = new StaffManage();
+            staffManage.setStaffId(propertyRepair.getStaffId());
+            staffManage.setStatus(ONE);
+            staffManageMapper.updateStaffManage(staffManage);
+        }
+        return i;
+    }
+    /**
+     * 指派物业报修人员
+     */
+    @Override
+    public AjaxResult assign(PropertyRepair propertyRepair) {
+
+        Long staffId = propertyRepair.getStaffId();
+        StaffManage staffManageOld = staffManageMapper.selectStaffManageByStaffId(staffId);
+        if (TWO.equals(staffManageOld.getStatus())){
+            return AjaxResult.error("当前人员处于不在空闲状态无法指派");
+        }
+        //报修ID/维修人员姓名/维修人员ID/维修人员手机号
+        int i = propertyRepairMapper.updatePropertyRepair(propertyRepair);
+        //修改维修人员的状态
+        if (i > 0){
+            StaffManage staffManage = new StaffManage();
+            staffManage.setStaffId(propertyRepair.getStaffId());
+            staffManage.setStatus(TWO);
+            staffManageMapper.updateStaffManage(staffManage);
+        }
+        return AjaxResult.success();
     }
 
     /**

+ 5 - 1
ruoyi-system/src/main/resources/mapper/system/StaffTrainManualMapper.xml

@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="source"    column="source"    />
         <result property="viewCount"    column="view_count"    />
         <result property="isTop"    column="is_top"    />
+        <result property="progress"    column="progress"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectStaffTrainManualVo">
-        select manual_id, manual_title, manual_type, manual_content, status, publish_time, video_url, cover_image, author, source, view_count, is_top, create_by, create_time, update_by, update_time, remark from staff_train_manual
+        select manual_id, manual_title, manual_type, manual_content, status, progress,publish_time, video_url, cover_image, author, source, view_count, is_top, create_by, create_time, update_by, update_time, remark from staff_train_manual
     </sql>
 
     <select id="selectStaffTrainManualList" parameterType="StaffTrainManual" resultMap="StaffTrainManualResult">
@@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="source != null">source,</if>
             <if test="viewCount != null">view_count,</if>
             <if test="isTop != null">is_top,</if>
+            <if test="progress != null">progress,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -82,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="source != null">#{source},</if>
             <if test="viewCount != null">#{viewCount},</if>
             <if test="isTop != null">#{isTop},</if>
+            <if test="progress != null">#{progress},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -104,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="source != null">source = #{source},</if>
             <if test="viewCount != null">view_count = #{viewCount},</if>
             <if test="isTop != null">is_top = #{isTop},</if>
+            <if test="progress != null">progress = #{progress},</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>