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