|
|
|
@ -16,6 +16,7 @@ import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService;
|
|
|
|
|
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
|
|
|
|
|
import com.foreverwin.mesnac.equip.service.ResourceRepairTaskService;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.mapper.NcCodeMapper;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.DataField;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.NwaUser;
|
|
|
|
@ -27,6 +28,7 @@ import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.i18n.LocaleContextHolder;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -74,6 +76,8 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
|
|
|
|
|
private ResourceInspectTaskMapper resourceInspectTaskMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ResourceInspectPlanService resourceInspectPlanService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private NcCodeMapper ncCodeMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public HashMap<String, Object> init() {
|
|
|
|
@ -128,12 +132,8 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
|
|
|
|
|
throw BusinessException.build("不良代码错误!!!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<NcCodeDto> ncCodeDescriptionByNcCode = ncCodeService.findNcCodeDescriptionByNcCode(ncCodeNo);
|
|
|
|
|
StringBuffer ncCodeDescription = new StringBuffer("");
|
|
|
|
|
for (NcCodeDto ncCode:ncCodeDescriptionByNcCode) {
|
|
|
|
|
ncCodeDescription.append(ncCode.getDescription()).append(";");
|
|
|
|
|
}
|
|
|
|
|
resourceRepairTask.setOther(ncCodeDescription.toString());
|
|
|
|
|
String ncCodeDescription = ncCodeMapper.findNcCodeDescriptionByNcCodeList(site,ncSplit);
|
|
|
|
|
resourceRepairTask.setOther(ncCodeDescription);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 维修单号、维修HANDLE
|
|
|
|
@ -166,11 +166,11 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
|
|
|
|
|
@Override
|
|
|
|
|
public ResourceRepairTask selOrStartRepairTask(ResourceRepairTask resourceRepairTask) {
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
// 根据HANDLE查询维修任务
|
|
|
|
|
String handle = resourceRepairTask.getHandle();
|
|
|
|
|
String stopMachine = resourceRepairTask.getStopMachine();
|
|
|
|
|
ResourceRepairTask repairTask = resourceRepairTaskService.getById(handle);
|
|
|
|
|
String site = repairTask.getSite();
|
|
|
|
|
ResourceRepairTask repairTask = resourceRepairTaskMapper.findResourceRepairTaskByHandleAndSite(site,handle);
|
|
|
|
|
String statusBo = repairTask.getStatus();
|
|
|
|
|
if (repairTask == null){
|
|
|
|
|
throw BusinessException.build("维修任务查询失败!!!");
|
|
|
|
@ -192,10 +192,10 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
|
|
|
|
|
repairTask.setRepairUserName(userByUserName.getFullName());
|
|
|
|
|
resourceRepairTaskService.updateById(repairTask);
|
|
|
|
|
// 修改设备状态---若stopMachie=Y,则状态改为非预定停机
|
|
|
|
|
if (stopMachine.equals("Y")){
|
|
|
|
|
/*if (stopMachine.equals("Y")){
|
|
|
|
|
String resourceNo = repairTask.getResourceNo();
|
|
|
|
|
resrceService.updateResourceStatus(site, resourceNo ,"5");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
return repairTask;
|
|
|
|
|
}
|
|
|
|
@ -243,10 +243,10 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
|
|
|
|
|
// 修改设备状态:判断维修前和维修结束的stopMachie字段是否修改
|
|
|
|
|
String stopMachine = resourceRepairTask.getStopMachine();
|
|
|
|
|
String stopMachineT = repairTask.getStopMachine();
|
|
|
|
|
if (!stopMachine.equals(stopMachineT)){
|
|
|
|
|
/*if (!stopMachine.equals(stopMachineT)){
|
|
|
|
|
String resourceNo = repairTask.getResourceNo();
|
|
|
|
|
resrceService.updateResourceStatus(site, resourceNo, stopMachineT.equals("N")?"301":"5");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
// 创建点检任务:维修完成时,若当前设备当日有点检不通过的任务,则为设备创建新的点检任务;
|
|
|
|
|
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
|
|
|
|
|