Merge remote-tracking branch 'origin/shoot-hand' into shoot-hand

This commit is contained in:
chenze 2024-08-20 08:49:08 +08:00
commit 2ad5208944
15 changed files with 83 additions and 28 deletions

View File

@ -78,12 +78,15 @@ public class RepairController extends BaseController {
/**
* 工单列表
* menu:1.报修查询3派单入口5维修入口, 7 管理员
* menu:1.报修查询3派单入口5维修入口, 7 管理员,9 楼层管理员
* <p>
* 报修查询全部处理中待评价已评价 type对应值allprocessevalingevaled
* 派单入口重新派单待派单已派单已关闭 type对应值anewwaitalreadyclose
* 报修查询全部处理中待评价已评价无效申请 type对应值allprocessevalingevaledinvalid
* 派单入口重新派单待派单已派单已关闭无效申请 type对应值anewwaitalreadyclose
* 维修入口待完成进行中已完成 type对应值waitworkingclose
* 管理员重派单全部 type对应值anewall 小程序暂时用不到
* 管理员重派单全部无效申请 type对应值anewallinvalid 小程序暂时用不到
* 楼层管理员全部无效申请 type对应值allinvalid
*
* name : 工单名称搜索关键字
* </p>
*/
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
@ -91,10 +94,11 @@ public class RepairController extends BaseController {
public R list(@RequestBody Map<String, String> map) {
String type = map.get("type");
String menu = map.get("menu");
String repairName = map.get("name");
if (StringUtils.isBlank(type) || StringUtils.isBlank(menu)) return R.error();
startPage();
Long userId = getLoginStaffId();
return result(repairService.repairList(menu, userId.toString(), type));
return result(repairService.repairList(menu, userId.toString(), type, repairName));
}
/**

View File

@ -39,6 +39,16 @@ public class RepairRemindController extends BaseController {
return result(repairRemindService.getRepairRemindList(userId));
}
/**
* 读取最新5条未读工单提醒
*/
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
@RequestMapping("latestList")
public R latestList() {
Long userId = getLoginStaffId();
return R.ok().put("data", repairRemindService.getLatestRepairRemind(userId, 5));
}
/**
* 工单提醒 变成已读
*/

View File

@ -47,7 +47,7 @@ public class RepairStatsController extends BaseController {
@RequestMapping("oneWorkerList")
public R oneWorkerList(String workerId) {
startPage();
return result(repairService.repairList("5", workerId, ""));
return result(repairService.repairList("5", workerId, "", null));
}
/**
@ -76,7 +76,8 @@ public class RepairStatsController extends BaseController {
@RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("repairAdminStats")
public R repairAdminStats() {
RepairAdminStatsVo repairAdminStatsVo = repairWorkerStatsService.repairAdminStats();
Long userId = getLoginStaffId();
RepairAdminStatsVo repairAdminStatsVo = repairWorkerStatsService.repairAdminStats(userId);
return R.ok().put("repairAdminStats", repairAdminStatsVo);
}

View File

@ -22,14 +22,13 @@ public interface RepairMapper {
*/
Repair selectRepairById(Long id);
List<Repair> normalRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName);
List<Repair> normalRepairList(@Param("userId") String userId, @Param("type") String type);
List<Repair> preRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName);
List<Repair> preRepairList(@Param("userId") String userId, @Param("type") String type);
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName);
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type);
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type);
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName);
/**
* 维修工 工单 数量统计
@ -41,10 +40,10 @@ public interface RepairMapper {
/**
* 楼层管理管工单列表
* @param floorerId 管理员id
* @param floorerId 楼层管理员id
* @return
*/
List<Repair> floorRepairList(@Param("floorerId")String floorerId);
List<Repair> floorRepairList(@Param("floorerId") String floorerId, @Param("type") String type, @Param("repairName") String repairName);
/**
* 新增工单
*

View File

@ -12,6 +12,7 @@ import com.ics.admin.domain.RepairRemind;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import javax.persistence.criteria.CriteriaBuilder;
import java.util.List;
/**
@ -37,6 +38,15 @@ public interface RepairRemindMapper {
* @return 工单提醒集合
*/
List<RepairRemind> getRepairRemindByUserId(Long userId);
/**
* 获取最新几条未读提醒
*
* @param userId 用户id
* @param number 条数
* @return 工单提醒集合
*/
List<RepairRemind> getLatestRepairRemind(@Param("userId") Long userId, @Param("number") Integer number);
/**
* 已读工单
* @param repairRemind

View File

@ -40,7 +40,7 @@ public interface RepairStatsMapper {
* 第一行 管理员 工单与 通知统计
* @return
*/
List<RepairAdminStatsVo> repairAdminStats();
List<RepairAdminStatsVo> repairAdminStats(Long userId);
/**
* 第二三行 工单统计工单完成情况评价情况

View File

@ -27,6 +27,15 @@ public interface IRepairRemindService {
*/
List<RepairRemind> getRepairRemindList(Long userId);
/**
* 获取最新几条未读提醒
*
* @param userId 用户id
* @param number 条数
* @return 工单提醒集合
*/
List<RepairRemind> getLatestRepairRemind(Long userId, Integer number);
/**
* 新增工单提醒
*

View File

@ -39,7 +39,7 @@ public interface IRepairService {
* @param menu 1.普通用户3派单员5维修人, 7管理员
* 查询工单列表
*/
List<Repair> repairList(String menu, String userId, String type);
List<Repair> repairList(String menu, String userId, String type ,String repairName);
/**
* 获取维修人员工单数量

View File

@ -38,7 +38,7 @@ public interface IRepairStatsService {
/**
* 第一行 管理员 工单与 通知统计
*/
RepairAdminStatsVo repairAdminStats();
RepairAdminStatsVo repairAdminStats(Long userId);
/**
* 第二三行 工单统计工单完成情况评价情况

View File

@ -53,6 +53,11 @@ public class RepairRemindServiceImpl implements IRepairRemindService {
return repairRemindMapper.insertRepairRemind(repairRemind);
}
@Override
public List<RepairRemind> getLatestRepairRemind(Long userId, Integer number) {
return repairRemindMapper.getLatestRepairRemind(userId, number);
}
/**
* 工单提醒 变为已读
*

View File

@ -337,13 +337,14 @@ public class RepairServiceImpl implements IRepairService {
* 查询工单列表
*/
@Override
public List<Repair> repairList(String menu, String userId, String type) {
public List<Repair> repairList(String menu, String userId, String type, String repairName) {
List<Repair> list = null;
//1.普通用户3派单员5维修人, 7管理员
if ("7".equals(menu)) list = repairMapper.adminRepairList(userId, type);
if ("5".equals(menu)) list = repairMapper.workRepairList(userId, type);
if ("3".equals(menu)) list = repairMapper.preRepairList(userId, type);
if ("1".equals(menu)) list = repairMapper.normalRepairList(userId, type);
//1.普通用户3派单员5维修人, 7管理员 ,9楼层管理员
if ("9".equals(menu)) list = repairMapper.floorRepairList(userId, type, repairName);
if ("7".equals(menu)) list = repairMapper.adminRepairList(userId, type, repairName);
if ("5".equals(menu)) list = repairMapper.workRepairList(userId, type, repairName);
if ("3".equals(menu)) list = repairMapper.preRepairList(userId, type, repairName);
if ("1".equals(menu)) list = repairMapper.normalRepairList(userId, type, repairName);
if (list != null && list.size() > 0) {
for (Repair repair : list) {
if (repair.getPerUserId() != null && repair.getPerUserId() > 0) {
@ -381,7 +382,7 @@ public class RepairServiceImpl implements IRepairService {
@Override
public List<Repair> floorRepairList(String floorerId) {
return repairMapper.floorRepairList(floorerId);
return repairMapper.floorRepairList(floorerId, "all", null);
}
/**

View File

@ -55,8 +55,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
}
@Override
public RepairAdminStatsVo repairAdminStats() {
List<RepairAdminStatsVo> list = repairStatsMapper.repairAdminStats();
public RepairAdminStatsVo repairAdminStats(Long userId) {
List<RepairAdminStatsVo> list = repairStatsMapper.repairAdminStats(userId);
if (list != null && list.size() > 0) return list.get(0);
return null;
}

View File

@ -209,6 +209,8 @@
<if test="type == 'process'">and status <![CDATA[ < ]]> 9 </if>
<if test="type == 'evaling'">and status = 9</if>
<if test="type == 'evaled'">and status = 13</if>
<if test="type == 'invalid'">and status = 11</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
<!--派单员-->
@ -219,6 +221,7 @@
<if test="type == 'wait'">and status = 1</if>
<if test="type == 'already'">and status <![CDATA[ > ]]> 3 and status <![CDATA[ <> ]]> 11</if>
<if test="type == 'close'">and status = 11</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
<!--维修人员-->
@ -228,6 +231,7 @@
<if test="type == 'wait'">and status = 5</if>
<if test="type == 'working'">and status = 7</if>
<if test="type == 'close'">and (status = 9 or status = 13)</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
<!--管理员-->
@ -235,7 +239,9 @@
<include refid="selectRepairVo"/>
where delete_flag = 0
<if test="type == 'anew'">and status = 3</if>
<if test="type == 'invalid'">and status = 11</if>
<if test="type == 'all'"></if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
@ -254,6 +260,9 @@
ics_repair rep,ics_repair_address_floor floor
where
rep.delete_flag=0 and floor.delete_flag=0 and floor.id=rep.floor_id and floor.admin_id= #{floorerId}
<if test="type == 'invalid'">and rep.status = 11</if>
<if test="type == 'all'"></if>
<if test="repairName != null and repairName != ''"> AND rep.repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>

View File

@ -33,6 +33,11 @@
where user_id=#{userId} and delete_flag=0 order by `read` asc,create_time desc
</select>
<select id="getLatestRepairRemind" parameterType="RepairRemind" resultMap="RepairRemindResult">
<include refid="selectRepairRemindVo"/>
where user_id=#{userId} and delete_flag=0 and `read`=0 order by create_time desc limit #{number}
</select>
<select id="selectRepairRemindById" parameterType="Long" resultMap="RepairRemindResult">
<include refid="selectRepairRemindVo"/>
WHERE id = #{id}

View File

@ -33,9 +33,11 @@
<!-- 第一行 管理员 工单与 通知统计 -->
<select id="repairAdminStats" resultType="com.ics.admin.vo.RepairAdminStatsVo">
<![CDATA[
SELECT `wait`,`anew`,0 as newnotice,0 as oldnotice FROM
SELECT `wait`,`anew`,newnotice,oldnotice FROM
(SELECT count(id) as `wait` FROM ics_repair where delete_flag=0 and status=3) as A,
(SELECT count(DISTINCT repair_id) as `anew` FROM ics_repair_log where delete_flag=0 and node_form=3) as B
(SELECT count(DISTINCT repair_id) as `anew` FROM ics_repair_log where delete_flag=0 and node_form=3) as B,
(select count(id) as newnotice from ics_repair_remind where `read`=0 and user_id= #{userId}) C,
(select count(id) as oldnotice from ics_repair_remind where `read`=1 and user_id= #{userId}) D
]]>
</select>