|
|
|
@ -351,9 +351,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder) {
|
|
|
|
|
try {
|
|
|
|
|
// equRepairOrder
|
|
|
|
|
//自动填入联系人 联系方式!!!!!
|
|
|
|
|
String id = IdUtils.fastSimpleUUID();
|
|
|
|
|
equRepairOrder.setOrderId(id);
|
|
|
|
|
// 获取故障报修流水号
|
|
|
|
|
// 新增 是需要获取故障报修流水号
|
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
|
String equipmentCode = equRepairOrder.getEquipmentCode();
|
|
|
|
|
//报修单号
|
|
|
|
@ -368,6 +370,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
|
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
|
|
|
|
|
|
|
|
|
|
//删除照片 不需要清照片 因为是新增
|
|
|
|
|
//新增文件
|
|
|
|
|
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
|
|
|
|
|
String[] ids1 = equRepairOrder.getFileList().split(",");
|
|
|
|
@ -485,7 +488,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取维修记录
|
|
|
|
|
* 获取维修人员
|
|
|
|
|
*
|
|
|
|
|
* @param equTeamUser
|
|
|
|
|
* @return
|
|
|
|
@ -573,6 +576,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
if (!CollectionUtils.isEmpty(files)) {
|
|
|
|
|
standardList.setPicturePaths(files);
|
|
|
|
|
}
|
|
|
|
|
standardList.setDetailReach(standardList.getRepairReach());
|
|
|
|
|
standardList.setActualValue(standardList.getRepairValue());
|
|
|
|
|
}
|
|
|
|
|
equOrder1.setStandardList(standardLists);
|
|
|
|
|
}
|
|
|
|
@ -604,17 +609,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
@Override
|
|
|
|
|
@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");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
|
|
|
|
|
//更新每一项点检/巡检检查项信息
|
|
|
|
|
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
|
|
|
|
|
for(EquOrder checkList:checkLists){
|
|
|
|
@ -643,7 +644,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
}
|
|
|
|
|
equOrderStandardMapper.insertBaseFileBatch(files);
|
|
|
|
|
}
|
|
|
|
|
equOrderStandardMapper.updateEquOrderStandard(standardList);
|
|
|
|
|
standardList.setRepairReach(standardList.getDetailReach());
|
|
|
|
|
standardList.setRepairValue(standardList.getActualValue());
|
|
|
|
|
standardList.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
standardList.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
equOrderStandardMapper.updateActualValues(standardList);
|
|
|
|
|
}
|
|
|
|
|
equOrderMapper.updateEquOrder(checkList);
|
|
|
|
|
}
|
|
|
|
@ -651,11 +656,27 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
//新建申领单 缺少code
|
|
|
|
|
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
|
|
|
|
|
for(EquSpareApply equSpareApply:equSpareApplies){
|
|
|
|
|
//生成领料单code
|
|
|
|
|
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
|
|
|
|
|
equSpareApply.setApplyCode("A" + code );
|
|
|
|
|
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
|
|
|
|
|
//备品备件规格型号!!!!!
|
|
|
|
|
//equSpareApply.setSpareModel(equSpareApply.getS);
|
|
|
|
|
equSpareApply.setSpareCode(equSpareApply.getMaterialCode());
|
|
|
|
|
equSpareApply.setSpareName(equSpareApply.getMaterialDesc());
|
|
|
|
|
equSpareApply.setApplyPeople(SecurityUtils.getUsername());
|
|
|
|
|
equSpareApply.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
equSpareApply.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
equSpareApply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
|
equSpareApply.setSpareUseEquipment(equRepairWorkOrder.getEquipmentCode());
|
|
|
|
|
equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode());
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
|
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
|
|
|
|
|
|
|
|
|
|
// SparePartsLedger sparePartsLedger = new SparePartsLedger();
|
|
|
|
|
// sparePartsLedger.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//图片
|
|
|
|
@ -679,14 +700,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
|
}
|
|
|
|
|
equRepairWorkOrderMapper.insertBaseFileBatch(files);
|
|
|
|
|
}
|
|
|
|
|
//维修人:当前登录人
|
|
|
|
|
//维修状态
|
|
|
|
|
equRepairWorkOrder.setWorkStatus("1");
|
|
|
|
|
//维修结束时间
|
|
|
|
|
equRepairWorkOrder.setWorkPerson(SecurityUtils.getUsername());
|
|
|
|
|
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
|
|
|
|
|
//需要更新设备状态????这里没做
|
|
|
|
|
return success("提交成功,维修完成!");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return error();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|