|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.op.device.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -66,19 +67,6 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
list.setFiles(files);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //查询对应检查项信息
|
|
|
|
|
// EquOrder equOrder = new EquOrder();
|
|
|
|
|
// equOrder.setOrderCode(list.getOrderCode());
|
|
|
|
|
// List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
|
|
|
|
|
// //每个检查项对应文件
|
|
|
|
|
// for(EquOrderStandard equOrderStandard :checkLists){
|
|
|
|
|
// List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(equOrderStandard.getId());
|
|
|
|
|
// if (!CollectionUtils.isEmpty(file)) {
|
|
|
|
|
// equOrderStandard.setPicturePaths(file);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// list.setCheckList(checkLists);
|
|
|
|
|
|
|
|
|
|
//查询对应检查项信息
|
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
|
//报修单号
|
|
|
|
@ -112,6 +100,22 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List<EquRepairOrder> selectEquRepairOrderList(EquRepairOrder equRepairOrder) {
|
|
|
|
|
if (equRepairOrder.getOrderBreakdownTimeArray() != null) {
|
|
|
|
|
// 设置故障开始时间、结束时间
|
|
|
|
|
if (equRepairOrder.getOrderBreakdownTimeArray().size() == 2) {
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
equRepairOrder.setOrderBreakdownTimeStart(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(0)));
|
|
|
|
|
equRepairOrder.setOrderBreakdownTimeEnd(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(1)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (equRepairOrder.getOrderTimeArray() != null) {
|
|
|
|
|
// 设置更新日期开始和结束
|
|
|
|
|
if (equRepairOrder.getOrderTimeArray().size() == 2) {
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
equRepairOrder.setOrderTimeStart(formatter.format(equRepairOrder.getOrderTimeArray().get(0)));
|
|
|
|
|
equRepairOrder.setOrderTimeEnd(formatter.format(equRepairOrder.getOrderTimeArray().get(1)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return equRepairOrderMapper.selectEquRepairOrderList(equRepairOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -166,14 +170,31 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int checkEquRepairOrder(EquRepairOrder equRepairOrder) {
|
|
|
|
|
//改了,不生成流水号,从第十位开始切割
|
|
|
|
|
String code = equRepairOrder.getOrderCode().substring(10);
|
|
|
|
|
String workCode = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + code;
|
|
|
|
|
//判断是否是点检、巡检过来的
|
|
|
|
|
if(equRepairOrder.getOrderSource().equals("点检") || equRepairOrder.getOrderSource().equals("巡检")){
|
|
|
|
|
//更新检查项信息
|
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
|
List<String> ids = equOrderMapper.getIdsByOrderCode(equRepairOrder.getOrderCode());
|
|
|
|
|
for(String id :ids){
|
|
|
|
|
EquOrder one = new EquOrder();
|
|
|
|
|
one.setOrderId(id);
|
|
|
|
|
one.setWorkCode("WX" + workCode);
|
|
|
|
|
one.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
one.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
//只更新其中一个信息
|
|
|
|
|
equOrderMapper.updateEquOrderRepairCode(one);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(equRepairOrder.getRepairDestination().equals("计划性维修")){
|
|
|
|
|
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
|
|
|
|
|
//报修单号
|
|
|
|
|
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
|
|
|
|
|
//维修单号
|
|
|
|
|
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
|
|
|
|
|
String equipmentCode = equRepairOrder.getEquipmentCode();
|
|
|
|
|
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
|
equRepairWorkOrder.setWorkCode("WX" + workCode);
|
|
|
|
|
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
|
|
|
|
|
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
|
|
|
|
|
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
|
|
|
|
@ -202,17 +223,17 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
|
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
|
equRepairOrder.setOrderStatus("审核通过");
|
|
|
|
|
|
|
|
|
|
}else if(equRepairOrder.getRepairDestination().equals("不维修")){
|
|
|
|
|
equRepairOrder.setOrderStatus("驳回");
|
|
|
|
|
|
|
|
|
|
}else if(equRepairOrder.getRepairDestination().equals("委外维修")){
|
|
|
|
|
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
|
|
|
|
|
//委外工单编码、id、联系方式、委外单位、委外人员、委外原因
|
|
|
|
|
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
|
|
|
|
|
equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode());
|
|
|
|
|
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
|
|
|
|
|
String equipmentCode = equRepairOrder.getEquipmentCode();
|
|
|
|
|
equOutsourceWork.setEquipmentCode(equipmentCode);
|
|
|
|
|
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
|
equOutsourceWork.setEquipmentCode(equRepairOrder.getEquipmentCode());
|
|
|
|
|
equOutsourceWork.setWorkCode("WW" + workCode);
|
|
|
|
|
equOutsourceWork.setRepairCode("无");
|
|
|
|
|
equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection());
|
|
|
|
|
equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit());
|
|
|
|
@ -226,10 +247,38 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
|
|
|
|
|
equRepairOrder.setOrderStatus("审核通过");
|
|
|
|
|
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){
|
|
|
|
|
//立即维修
|
|
|
|
|
//是否立即维修 1是 0 否
|
|
|
|
|
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
|
|
|
|
|
//报修单号
|
|
|
|
|
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
|
|
|
|
|
//维修单号
|
|
|
|
|
equRepairWorkOrder.setWorkCode("WX"+workCode);
|
|
|
|
|
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
|
|
|
|
|
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
|
|
|
|
|
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
|
|
|
|
|
//不委外
|
|
|
|
|
equRepairWorkOrder.setWorkOutsource("0");
|
|
|
|
|
equRepairWorkOrder.setOutWorkCode("无");
|
|
|
|
|
//是否立即维修 1是 0 否
|
|
|
|
|
equRepairWorkOrder.setWorkHandle("0");
|
|
|
|
|
//计划维修时间
|
|
|
|
|
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
|
|
|
|
|
//是否停机维修 停机维修时间
|
|
|
|
|
if(equRepairOrder.getWorkPlanDownTime() != null){
|
|
|
|
|
equRepairWorkOrder.setWorkDownMachine("1");
|
|
|
|
|
equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime());
|
|
|
|
|
}else{
|
|
|
|
|
equRepairWorkOrder.setWorkDownMachine("0");
|
|
|
|
|
}
|
|
|
|
|
equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc());
|
|
|
|
|
equRepairWorkOrder.setWorkStatus("0");
|
|
|
|
|
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
|
|
|
|
|
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
//工厂
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
|
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
|
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
|
equRepairOrder.setOrderStatus("审核通过");
|
|
|
|
|
}
|
|
|
|
|
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
@ -326,12 +375,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
|
|
|
|
|
/**
|
|
|
|
|
* 查询报修人员列表
|
|
|
|
|
*
|
|
|
|
|
* @param equEquipment
|
|
|
|
|
* @param equTeamUser
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List<EquEquipment> getRepairPersonList(EquEquipment equEquipment) {
|
|
|
|
|
return equRepairOrderMapper.getRepairPersonList(equEquipment);
|
|
|
|
|
public List<EquTeamUser> getRepairPersonList(EquTeamUser equTeamUser) {
|
|
|
|
|
return equRepairOrderMapper.getRepairPersonList(equTeamUser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|