highway
wws 1 year ago
parent cc55155055
commit 116c224f45

@ -31,6 +31,7 @@ public class DevicePDAController extends BaseController {
/**
* list
*
* @param pdadto
* @return
*/
@ -41,6 +42,7 @@ public class DevicePDAController extends BaseController {
/**
*
*
* @param pdadto
* @return
*/
@ -51,6 +53,7 @@ public class DevicePDAController extends BaseController {
/**
*
*
* @param equOrder
* @return
*/
@ -60,7 +63,8 @@ public class DevicePDAController extends BaseController {
}
/**
*
*
*
* @param equOrder
* @return
*/
@ -70,8 +74,10 @@ public class DevicePDAController extends BaseController {
}
//报修
/**
*
*
* @param equRepairOrder
* @return
*/
@ -81,6 +87,7 @@ public class DevicePDAController extends BaseController {
}
//维修
/**
*
*
@ -143,6 +150,7 @@ public class DevicePDAController extends BaseController {
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@ -159,6 +167,7 @@ public class DevicePDAController extends BaseController {
/**
*
*
* @param pdadto
* @return
*/

@ -8,14 +8,22 @@ public class IEquipmentVO {
private String equipmentCode;
// 所在部门
private String department;
// 状态
private String status;
// 设备故障率
private Double failureRate;
// 设备有效利用率
private Double utilizationRatio;
// 设备维修质量
private Double rapairQuantity;
// 设备状态
private String equipmentStatus;
public String getEquipmentStatus() {
return equipmentStatus;
}
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public Double getRapairQuantity() {
return rapairQuantity;
@ -49,14 +57,6 @@ public class IEquipmentVO {
this.department = department;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Double getFailureRate() {
return failureRate;
}

@ -16,12 +16,14 @@ public interface IDevicePDAService {
/**
* list
*
* @return
*/
AjaxResult getTodayTask(PDADTO pdadto);
/**
*
*
* @param pdadto
* @return
*/
@ -29,37 +31,45 @@ public interface IDevicePDAService {
/**
*
*
* @param equOrder
* @return
*/
AjaxResult getInspectionOrderInfo(EquOrder equOrder);
/**
*
*
*
* @param equOrder
* @return
*/
AjaxResult updateInspectionRecord(EquOrder equOrder);
//报修
/**
*
*
* @param equRepairOrder
* @return
*/
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder);
//维修
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder);
//班组
/**
*
*
* @param equTeamUser
* @return
*/
@ -67,6 +77,7 @@ public interface IDevicePDAService {
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@ -74,6 +85,7 @@ public interface IDevicePDAService {
/**
*
*
* @param equipmentId
* @return
*/
@ -81,6 +93,7 @@ public interface IDevicePDAService {
/**
*
*
* @param workId
* @return
*/
@ -88,6 +101,7 @@ public interface IDevicePDAService {
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@ -101,6 +115,7 @@ public interface IDevicePDAService {
/**
*
*
* @param pdadto
* @return
*/

@ -58,14 +58,15 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
// 获取所有设备信息
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList();
for (IEquipmentVO equipmentVO : equipmentVOList) {
// TODO 设备状态待修改
if (equipmentVO.getStatus().equals("1")) {
equipmentVO.setStatus("正常");
// 设备状态
if (equipmentVO.getEquipmentStatus().equals("1")) {
equipmentVO.setEquipmentStatus("正常");
} else {
equipmentVO.setStatus("停用");
equipmentVO.setEquipmentStatus("停用");
}
// TODO 设备故障停机率
equipmentVO.setFailureRate(0.90);
equipmentVO.setFailureRate(0.10);
// TODO 设备有效利用率
equipmentVO.setUtilizationRatio(0.80);
}

@ -165,7 +165,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
/**
*
*
*
* @param equOrder
* @return
@ -178,11 +178,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
if (equOrder.getRepairCode() != null) {
if (!equOrder.getRepairCode().isEmpty()) {
EquRepairOrder repairOrder = equRepairOrderMapper.selectEquRepairOrderByRepairCode(equOrder.getRepairCode());
if (repairOrder==null) {
return error(500,"未查询到报修单信息!");
}else {
if (!repairOrder.getOrderStatus().equals("待审核")){
return error(500,"报修单已审核,不可修改记录!");
if (repairOrder == null) {
return error(500, "未查询到报修单信息!");
} else {
if (!repairOrder.getOrderStatus().equals("待审核")) {
return error(500, "报修单已审核,不可修改记录!");
}
}
}
@ -228,7 +228,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
hasError = true;
standard.setDetailReach("0");
}
}else {
} else {
// 未达标
standard.setErrorFlag("0");
if (standard.getDetailReach().equals("0")) {
@ -255,10 +255,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
boolean checkRepair = false;
if (equOrder.getRepairCode() == null){
if (equOrder.getRepairCode() == null) {
checkRepair = true;
}else {
if (equOrder.getRepairCode().isEmpty()){
} else {
if (equOrder.getRepairCode().isEmpty()) {
checkRepair = true;
}
}
@ -270,7 +270,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode());
@ -289,19 +289,19 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber());
equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName());
// 报修来源
if (equOrder.getPlanType().equals("inspection")){
if (equOrder.getPlanType().equals("inspection")) {
equRepairOrder.setOrderSource("巡检");
}
if (equOrder.getPlanType().equals("spotInspection")){
if (equOrder.getPlanType().equals("spotInspection")) {
equRepairOrder.setOrderSource("点检");
}
if (equOrder.getPlanType().equals("maintenance")){
if (equOrder.getPlanType().equals("maintenance")) {
equRepairOrder.setOrderSource("保养");
}
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
@ -344,6 +344,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
//////////////////////报修
/**
*
*
@ -362,7 +363,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderRepairmanCode(SecurityUtils.getUsername());
@ -370,7 +371,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
//删除照片 不需要清照片 因为是新增
@ -435,6 +436,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
/**
*
* TODO
*
* @param pdadto
* @return
*/
@ -490,6 +493,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
return error();
}
}
/**
*
*
@ -520,7 +524,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//不停机 那么实际停机开始时间和实际停机结束时间都没有
//如果停机 那么实际停机时间就是传入的时间
equRepairWorkOrder.setWorkStartTime(DateUtils.getNowDate());
if(equRepairWorkOrder.getWorkDownMachine().equals("1")){
if (equRepairWorkOrder.getWorkDownMachine().equals("1")) {
equRepairWorkOrder.setActualDownStartTime(DateUtils.getNowDate());
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
@ -535,8 +539,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
/**
*
*
* @param equipmentId
* @return
*/
@ -568,12 +570,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//检查项
List<EquOrder> checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder);
//每个检查项对应的检测标准
for(EquOrder equOrder1 :checkLists){
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){
for (EquOrderStandard standardList : standardLists) {
//每个检查标准里面的照片
List<BaseFileData> files = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
if (!CollectionUtils.isEmpty(files)) {
@ -614,18 +616,18 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
//判断是否停机
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
if(list.getWorkDownMachine().equals("1")){
if (list.getWorkDownMachine().equals("1")) {
//维修结束时间、维修真正停机时间
equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate());
}
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//更新每一项点检/巡检检查项信息
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
for(EquOrder checkList:checkLists){
for (EquOrder checkList : checkLists) {
checkList.setUpdateBy(SecurityUtils.getUsername());
checkList.setUpdateTime(DateUtils.getNowDate());
List<EquOrderStandard> standardLists = checkList.getStandardList();
for(EquOrderStandard standardList :standardLists){
for (EquOrderStandard standardList : standardLists) {
//先删除每个检查项标准图片
equOrderStandardMapper.deleteBaseFileBySourceId(standardList.getId());
//图片
@ -658,7 +660,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//新建申领单
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for(EquSpareApply equSpareApply:equSpareApplies){
for (EquSpareApply equSpareApply : equSpareApplies) {
//生成领料单code
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
@ -677,7 +679,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
//更新完备品申领单后,更新库存

@ -24,7 +24,7 @@
select be.equipment_code AS "equipmentCode",
be.equipment_name AS "equipmentName",
be.department AS "department",
be.status AS "status"
be.equipment_status AS "equipmentStatus"
from base_equipment be
where del_flag = '0'
</select>

Loading…
Cancel
Save