|
|
@ -23,10 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.Calendar;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.error;
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.error;
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.success;
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.success;
|
|
|
@ -63,6 +60,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquFileMapper equFileMapper;
|
|
|
|
private EquFileMapper equFileMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EquFaultTypeMapper equFaultTypeMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取今日巡检任务工单list-状态不为已完成
|
|
|
|
* 获取今日巡检任务工单list-状态不为已完成
|
|
|
@ -266,7 +266,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
equTeamUser.setUserName(SecurityUtils.getUsername());
|
|
|
|
equTeamUser.setUserName(SecurityUtils.getUsername());
|
|
|
|
EquTeamUser equTeamUserList = equRepairOrderMapper.getRepairPhoneNumber(equTeamUser);
|
|
|
|
EquTeamUser equTeamUserList = equRepairOrderMapper.getRepairPhoneNumber(equTeamUser);
|
|
|
|
equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber());
|
|
|
|
equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber());
|
|
|
|
|
|
|
|
equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName());
|
|
|
|
// 报修来源
|
|
|
|
// 报修来源
|
|
|
|
if (equOrder.getPlanType().equals("inspection")){
|
|
|
|
if (equOrder.getPlanType().equals("inspection")){
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
@ -414,7 +414,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取待维修记录(除了待维修)
|
|
|
|
* 获取维修记录(除了待维修)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param equRepairWorkOrder
|
|
|
|
* @param equRepairWorkOrder
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
@ -474,7 +474,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//不停机 那么实际停机开始时间和实际停机结束时间都没有
|
|
|
|
//不停机 那么实际停机开始时间和实际停机结束时间都没有
|
|
|
|
//如果停机 那么实际停机时间就是传入的时间 停机时间必须选择校验
|
|
|
|
//如果停机 那么实际停机时间就是传入的时间
|
|
|
|
|
|
|
|
equRepairWorkOrder.setWorkStartTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
if(equRepairWorkOrder.getWorkDownMachine().equals("1")){
|
|
|
|
|
|
|
|
equRepairWorkOrder.setActualDownStartTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
}
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
//维修中
|
|
|
|
//维修中
|
|
|
@ -518,11 +522,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
EquOrder equOrder = new EquOrder();
|
|
|
|
equOrder.setWorkCode(list.getWorkCode());
|
|
|
|
equOrder.setWorkCode(list.getWorkCode());
|
|
|
|
//检查项
|
|
|
|
//检查项
|
|
|
|
List<EquOrder> checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder);
|
|
|
|
List<EquOrder> checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder);
|
|
|
|
//每个检查项对应的检测标准
|
|
|
|
//每个检查项对应的检测标准
|
|
|
|
for(EquOrder equOrder1 :checkLists){
|
|
|
|
for(EquOrder equOrder1 :checkLists){
|
|
|
|
EquOrderStandard equOrderStandard = new EquOrderStandard();
|
|
|
|
EquOrderStandard equOrderStandard = new EquOrderStandard();
|
|
|
|
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
|
|
|
|
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
|
|
|
|
|
|
|
|
equOrderStandard.setParentCode(equOrder1.getId());
|
|
|
|
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
|
|
|
|
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
|
|
|
|
for(EquOrderStandard standardList :standardLists){
|
|
|
|
for(EquOrderStandard standardList :standardLists){
|
|
|
|
//每个检查标准里面的照片
|
|
|
|
//每个检查标准里面的照片
|
|
|
@ -562,6 +567,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
//判断是否停机
|
|
|
|
|
|
|
|
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
|
|
|
|
|
|
|
|
if(list.getWorkDownMachine().equals("1")){
|
|
|
|
|
|
|
|
//维修结束时间、维修真正停机时间
|
|
|
|
|
|
|
|
equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
//维修完成
|
|
|
|
|
|
|
|
equRepairWorkOrder.setWorkStatus("1");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新每一项点检/巡检检查项信息
|
|
|
|
//更新每一项点检/巡检检查项信息
|
|
|
|
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
|
|
|
|
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
|
|
|
|
for(EquOrder checkList:checkLists){
|
|
|
|
for(EquOrder checkList:checkLists){
|
|
|
@ -594,6 +609,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
equOrderMapper.updateEquOrder(checkList);
|
|
|
|
equOrderMapper.updateEquOrder(checkList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//新建申领单 缺少code
|
|
|
|
//新建申领单 缺少code
|
|
|
|
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
|
|
|
|
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
|
|
|
|
for(EquSpareApply equSpareApply:equSpareApplies){
|
|
|
|
for(EquSpareApply equSpareApply:equSpareApplies){
|
|
|
@ -603,7 +619,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
equSpareApply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
equSpareApply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//维修人员名字????前端能够提供吗???
|
|
|
|
|
|
|
|
//图片
|
|
|
|
//图片
|
|
|
|
//先删除每个维修工单对应图片
|
|
|
|
//先删除每个维修工单对应图片
|
|
|
|
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
|
|
|
|
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
|
|
|
@ -628,10 +644,33 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
//需要更新设备状态
|
|
|
|
//需要更新设备状态????这里没做
|
|
|
|
return success("提交成功,维修完成!");
|
|
|
|
return success("提交成功,维修完成!");
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
return error();
|
|
|
|
return error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询故障树
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param equRepairWorkOrder
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
|
|
|
// @DS("#header.poolName")
|
|
|
|
|
|
|
|
// public AjaxResult queryEquFaultTypeTree(EquRepairWorkOrder equRepairWorkOrder) {
|
|
|
|
|
|
|
|
// // 查询一级数据
|
|
|
|
|
|
|
|
// List<EquFaultType> firstLevel = equFaultTypeMapper.selectFirstLevelList(equRepairWorkOrder);
|
|
|
|
|
|
|
|
// // 一级list
|
|
|
|
|
|
|
|
// List<EquFaultTypeTree> firstTree = new ArrayList<>();
|
|
|
|
|
|
|
|
// // 判空
|
|
|
|
|
|
|
|
// if (!CollectionUtils.isEmpty(firstLevel)) {
|
|
|
|
|
|
|
|
// for(EquFaultType equFaultType : firstLevel){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// return treeAll;
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|