This commit is contained in:
Vinjor 2024-10-18 17:50:45 +08:00
parent 524a66e6f1
commit 457c896ce8
6 changed files with 91 additions and 11 deletions

View File

@ -1,2 +1,14 @@
package cn.iocoder.yudao.common;public class RepairCons {
package cn.iocoder.yudao.common;
/**
* 维修系统常量
* @author vinjor-M
* @date 17:44 2024/10/18
**/
public class RepairCons {
/**工单-待处理*/
public static final String TICKETS_WAITING = "waiting";
/**工单-所有*/
public static final String TICKETS_ALL = "all";
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.tickets.controller.admin;
import cn.iocoder.yudao.common.RepairCons;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
@ -9,6 +10,7 @@ import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -171,6 +173,10 @@ public class DlRepairTicketsController {
@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
Page<DlRepairTickets> page = new Page<>(pageNo, pageSize);
if(StringUtils.isEmpty(repairTicketsReqVO.getSelectType())){
//查询类型为空默认查待处理的
repairTicketsReqVO.setSelectType(RepairCons.TICKETS_WAITING);
}
return success(dlRepairTicketsService.getPageType(repairTicketsReqVO, page));
}

View File

@ -27,13 +27,21 @@ public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
IPage<DlRepairTickets> getTicketsPage(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
/**
* 分类查询工单分页
* 分类查询工单分页----待处理的
*
* @author 小李
* @date 16:26 2024/10/12
* @param repairTicketsReqVO 查询对象
**/
IPage<DlRepairTickets> getPageType(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
/**
* 分类查询工单分页----所有记录
*
* @author 小李
* @date 16:26 2024/10/12
* @param repairTicketsReqVO 查询对象
**/
IPage<DlRepairTickets> getPageTypeAll(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
}

View File

@ -421,7 +421,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
}else{
return null;
}
return baseMapper.getPageType(repairTicketsReqVO, page);
if(RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())){
return baseMapper.getPageType(repairTicketsReqVO, page);
}else{
return baseMapper.getPageTypeAll(repairTicketsReqVO, page);
}
}
/**

View File

@ -25,4 +25,6 @@ public class DlRepairTicketsReqVO extends DlRepairTickets {
/** 工单中项目指定的施工人员的ids */
private List<Long> userIds;
/** 查询类型(waiting 待处理的 | all 所有数据) */
private String selectType;
}

View File

@ -203,17 +203,65 @@
and drt.is_finish = #{map.isFinish}
</if>
<if test="map.userIds != null and map.userIds.size > 0">
and (
<foreach item="item" collection="map.userIds" index="index" open="" separator="or" close="">
find_in_set(#{item}, drti.repair_ids) > 0
and (drt.tickets_status = '05')
and (drt.now_repair_id in
<foreach collection="map.userIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="map.isFinish != null and map.isFinish != '' and map.isFinish == 0 and map.userIds != null and map.userIds.size > 0">
and (drt.now_repair_id in
<foreach collection="map.userIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
order by drt.create_time desc
</select>
<select id="getPageTypeAll" resultMap="BaseResultMap">
select drt.*,
drti.id AS item_id,
drti.ticket_id AS item_ticket_id,
drti.item_name AS item_item_name,
drti.item_count AS item_item_count,
drti.item_unit AS item_item_unit,
drti.item_price AS item_item_price,
drti.item_discount AS item_item_discount,
drti.item_money AS item_item_money,
drti.repair_ids AS item_repair_ids,
drti.repair_names AS item_repair_names,
drti.sale_id AS item_sale_id,
drti.sale_name AS item_sale_name,
drti.item_type AS item_item_type,
drti.project_id AS item_project_id,
drti.part_id AS item_part_id,
drti.other_id AS item_other_id,
drti.item_type_id AS item_type_id,
drti.item_status AS item_item_status,
drti.remark AS item_remark
from dl_repair_tickets drt
left join dl_repair_titem drti
on drt.id = drti.ticket_id AND drti.deleted = '0'
where drt.deleted = '0'
<if test="map.ticketNo != null and map.ticketNo != ''">
and (
drt.ticket_no like concat('%', #{map.ticketNo}, '%')
or
drt.car_no like concat('%', #{map.ticketNo}, '%')
or
drt.user_name like concat('%', #{map.ticketNo}, '%')
or
drt.user_mobile like concat('%', #{map.ticketNo}, '%')
or
drt.remark like concat('%', #{map.ticketNo}, '%')
)
</if>
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
</if>
<if test="map.adviserId != null and map.adviserId != ''">
and drt.adviser_id = #{map.adviserId}
</if>
<if test="map.userIds != null and map.userIds.size > 0">
and (
<foreach item="item" collection="map.userIds" index="index" open="" separator="or" close="">
find_in_set(#{item}, drt.now_repair_id) > 0
</foreach>
)
</if>
order by drt.create_time desc