This commit is contained in:
Vinjor 2024-10-18 16:52:30 +08:00
parent b0df9941d9
commit 764d7eee0d
3 changed files with 18 additions and 22 deletions

View File

@ -105,21 +105,6 @@ public class BaseConstants {
/**维修记录*/ /**维修记录*/
public static final String REPAIR_RECORD_TYPE_RECORD = "record"; 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";
} }

View File

@ -46,7 +46,11 @@ public enum RecordTypeEnum {
/** /**
* 施工中 * 施工中
*/ */
SGZ("sgz","施工中"); SGZ("sgz","施工中"),
/**
* 接单
*/
jd("jd","接单");
/** /**
* code * code

View File

@ -3,12 +3,10 @@ package cn.iocoder.yudao.module.tickets.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.RepairErrorCodeConstants; import cn.iocoder.yudao.common.*;
import cn.iocoder.yudao.common.RepairRoleEnum;
import cn.iocoder.yudao.common.TicketsStatusEnum;
import cn.iocoder.yudao.common.TicketsWorkStatusEnum;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.entity.RepairWorker;
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.base.service.RepairWorkerService;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
@ -52,6 +50,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -135,6 +134,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
private RepairWorkerService repairWorkerService; private RepairWorkerService repairWorkerService;
@Resource @Resource
private RepairWorkerService workerService; private RepairWorkerService workerService;
@Autowired
private RepairRecordsService repairRecordsService;
/** /**
* 维修工单表 新增 * 维修工单表 新增
@ -220,6 +221,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
bookingService.updateById(dlRepairBooking); bookingService.updateById(dlRepairBooking);
} }
repairOrderInfoService.saveOrderInfo(repairOrderInfo); repairOrderInfoService.saveOrderInfo(repairOrderInfo);
//最后记录操作日志--创建工单
repairRecordsService.saveRepairRecord(ticketsRespVO.getId(),null, RecordTypeEnum.CJGD.getCode(),"创建工单",null);
} }
/** /**
@ -477,14 +480,16 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
public void updateTake(String id){ public void updateTake(String id){
// 改变时看看是否已经被接了 // 改变时看看是否已经被接了
int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>() int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
.set(DlRepairTickets::getTicketsWorkStatus, "02") .set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.RECEIVED)
.and(item -> { .and(item -> {
item.eq(DlRepairTickets::getId, id) item.eq(DlRepairTickets::getId, id)
.eq(DlRepairTickets::getTicketsWorkStatus, "01"); .eq(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.WAITING_RECEIVING);
})); }));
if (update != 1){ if (update != 1){
throw exception0(500, "工单已被其他人接单了"); throw exception0(500, "工单已被其他人接单了");
} }
//最后记录操作日志--接单
repairRecordsService.saveRepairRecord(id,null, RecordTypeEnum.jd.getCode(), "接单",null);
} }
/** /**
@ -509,6 +514,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
if (update != 1) { if (update != 1) {
throw exception0(500, "工单已开始"); throw exception0(500, "工单已开始");
} }
//最后记录操作日志--指派施工
repairRecordsService.saveRepairRecord(reqVO.getId(),null, RecordTypeEnum.ZPSG.getCode(),"指派施工",null);
} }
} }