# Conflicts:
#	dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java
This commit is contained in:
PQZ 2024-10-18 19:56:32 +08:00
commit e29a5ec1ef
12 changed files with 213 additions and 10 deletions

View File

@ -107,6 +107,24 @@ public class BaseConstants {
/**维修记录*/
public static final String REPAIR_RECORD_TYPE_RECORD = "record";
/**创建工单*/
public static final String REPAIR_RECORD_TYPE_CJGD = "cjgd";
/**指派施工*/
public static final String REPAIR_RECORD_TYPE_ZPSG = "zpsg";
/**领料*/
public static final String REPAIR_RECORD_TYPE_LL = "ll";
/**退料*/
public static final String REPAIR_RECORD_TYPE_TL = "tl";
/**施工完成(自检)*/
public static final String REPAIR_RECORD_TYPE_SGWCZJ = "sgwczj";
/**总检*/
public static final String REPAIR_RECORD_TYPE_ZJ = "zj";
/**结束工单*/
public static final String REPAIR_RECORD_TYPE_JSGD = "jsgd";
/** 开始施工 */
public static final String REPAIR_RECORD_TYPE_KSSG = "kssg";
/** 施工中 */
public static final String REPAIR_RECORD_TYPE_SGZ = "sgz";
}

View File

@ -0,0 +1,14 @@
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));
}
@ -213,5 +219,19 @@ public class DlRepairTicketsController {
dlRepairTicketsService.updateRepair(reqVO);
return CommonResult.ok();
}
/**
* 更新工单状态
*
* @author 小李
* @date 15:46 2024/10/18
* @param respVO 请求对象
**/
@PostMapping("/updateStatus")
@Operation(summary = "更新工单状态")
public CommonResult<?> updateStatus(@RequestBody DlRepairTicketsRespVO respVO){
dlRepairTicketsService.updateStatus(respVO);
return CommonResult.ok();
}
}

View File

@ -48,5 +48,18 @@ public class DlRepairTitemController {
Page<DlRepairTitemRespVO> page = new Page<>(pageNo, pageSize);
return success(dlRepairTitemService.getTItemPage(repairTitemRespVO, page));
}
/**
* 获取当前操作人操作的工单中的项目
*
* @author 小李
* @date 15:01 2024/10/18
* @param ticketId 工单ID
**/
@GetMapping("/listProject")
@Operation(summary = "获取当前操作人操作的工单中的项目")
public CommonResult<?> getProjectList(@RequestParam("ticketId") String ticketId){
return success(dlRepairTitemService.getProjectList(ticketId));
}
}

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

@ -116,4 +116,14 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
* @param reqVO 请求对象
**/
void updateRepair(DlRepairTicketsReqVO reqVO);
/**
* 更新工单状态
*
* @param respVO 请求对象
* @author 小李
* @date 15:46 2024/10/18
**/
void updateStatus(DlRepairTicketsRespVO respVO);
}

View File

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 针对表dl_repair_titem(维修工单子表)的数据库操作Service
*
@ -22,4 +24,14 @@ public interface DlRepairTitemService extends IService<DlRepairTitem> {
* @param repairTitemRespVO 查询对象
**/
IPage<DlRepairTitemRespVO> getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page<DlRepairTitemRespVO> page);
/**
* 获取当前操作人操作的工单中的项目
*
* @param ticketId 工单ID
* @author 小李
* @date 15:01 2024/10/18
**/
List<DlRepairTitem> getProjectList(String ticketId);
}

View File

@ -138,6 +138,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
private RepairWorkerService repairWorkerService;
@Resource
private RepairWorkerService workerService;
@Resource
@Lazy
private RepairRecordsService recordsService;
@Autowired
private RepairRecordsService repairRecordsService;
@ -437,7 +440,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);
}
}
/**
@ -534,6 +541,30 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
//最后记录操作日志--指派施工
repairRecordsService.saveRepairRecord(reqVO.getId(),null, RecordTypeEnum.ZPSG.getCode(),"指派施工",null);
}
/**
* 更新工单状态
*
* @param respVO 请求对象
* @author 小李
* @date 15:46 2024/10/18
**/
@Override
@DSTransactional
public void updateStatus(DlRepairTicketsRespVO respVO){
// 更新工单主表
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
.set(DlRepairTickets::getTicketsWorkStatus, respVO.getTicketsWorkStatus())
.eq(DlRepairTickets::getId, respVO.getId())
);
// 更新工单子表
titemService.update(new LambdaUpdateWrapper<DlRepairTitem>()
.set(DlRepairTitem::getItemStatus, respVO.getItem().getItemStatus())
.eq(DlRepairTitem::getId, respVO.getItem().getId())
);
// 记录日志
recordsService.saveRepairRecord(respVO.getId(), respVO.getItem().getId(), respVO.getRecordType(), respVO.getRemark(), respVO.getImage());
}
}

View File

@ -4,11 +4,14 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
import cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper;
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 针对表dl_repair_titem(维修工单子表)的数据库操作Service实现
*
@ -30,6 +33,21 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
public IPage<DlRepairTitemRespVO> getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page<DlRepairTitemRespVO> page){
return baseMapper.getTItemPage(repairTitemRespVO, page);
}
/**
* 获取当前操作人操作的工单中的项目
*
* @param ticketId 工单ID
* @author 小李
* @date 15:01 2024/10/18
**/
@Override
public List<DlRepairTitem> getProjectList(String ticketId){
return baseMapper.selectList(new LambdaQueryWrapper<DlRepairTitem>().and(item -> {
item.eq(DlRepairTitem::getItemType, "01")
.eq(DlRepairTitem::getTicketId, ticketId);
}));
}
}

View File

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

View File

@ -31,6 +31,15 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
/** 预约记录ID */
private String bookingId;
/** 图片路径 */
private String image;
/** 子表单条数据 */
private DlRepairTitem item;
/** 记录类型 */
private String recordType;
/** 客户信息 */
private CustomerMain customerInfo;

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