Merge remote-tracking branch 'origin/master'

highway
zhaoxiaolin 1 year ago
commit 4a5d01c25c

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

@ -0,0 +1,173 @@
package com.op.device.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* equ_operation_record
*
* @author Open Platform
* @date 2023-11-27
*/
public class EquOperationRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 类型(on开机、off关机) */
@Excel(name = "类型(on开机、off关机)")
private String type;
/** 维护类型upkeep保养、repair维修 */
@Excel(name = "维护类型", readConverterExp = "u=pkeep保养、repair维修")
private String maintenanceType;
/** 关联记录id */
@Excel(name = "关联记录id")
private String parentId;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getStartTime() {
return startTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setMaintenanceType(String maintenanceType) {
this.maintenanceType = maintenanceType;
}
public String getMaintenanceType() {
return maintenanceType;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getParentId() {
return parentId;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("equipmentCode", getEquipmentCode())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("type", getType())
.append("maintenanceType", getMaintenanceType())
.append("parentId", getParentId())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

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

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOperationRecord;
/**
* Mapper
*
* @author Open Platform
* @date 2023-11-27
*/
public interface EquOperationRecordMapper {
/**
*
*
* @param id
* @return
*/
public EquOperationRecord selectEquOperationRecordById(String id);
/**
*
*
* @param equOperationRecord
* @return
*/
public List<EquOperationRecord> selectEquOperationRecordList(EquOperationRecord equOperationRecord);
/**
*
*
* @param equOperationRecord
* @return
*/
public int insertEquOperationRecord(EquOperationRecord equOperationRecord);
/**
*
*
* @param equOperationRecord
* @return
*/
public int updateEquOperationRecord(EquOperationRecord equOperationRecord);
/**
*
*
* @param id
* @return
*/
public int deleteEquOperationRecordById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteEquOperationRecordByIds(String[] ids);
}

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

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

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

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

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOperationRecordMapper">
<resultMap type="EquOperationRecord" id="EquOperationRecordResult">
<result property="id" column="id" />
<result property="equipmentCode" column="equipment_code" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="type" column="type" />
<result property="maintenanceType" column="maintenance_type" />
<result property="parentId" column="parent_id" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEquOperationRecordVo">
select id, equipment_code, start_time, end_time, type, maintenance_type, parent_id, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_operation_record
</sql>
<select id="selectEquOperationRecordList" parameterType="EquOperationRecord" resultMap="EquOperationRecordResult">
<include refid="selectEquOperationRecordVo"/>
<where>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="maintenanceType != null and maintenanceType != ''"> and maintenance_type = #{maintenanceType}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
</where>
</select>
<select id="selectEquOperationRecordById" parameterType="String" resultMap="EquOperationRecordResult">
<include refid="selectEquOperationRecordVo"/>
where id = #{id}
</select>
<insert id="insertEquOperationRecord" parameterType="EquOperationRecord">
insert into equ_operation_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="equipmentCode != null">equipment_code,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="type != null">type,</if>
<if test="maintenanceType != null">maintenance_type,</if>
<if test="parentId != null">parent_id,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="type != null">#{type},</if>
<if test="maintenanceType != null">#{maintenanceType},</if>
<if test="parentId != null">#{parentId},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOperationRecord" parameterType="EquOperationRecord">
update equ_operation_record
<trim prefix="SET" suffixOverrides=",">
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="type != null">type = #{type},</if>
<if test="maintenanceType != null">maintenance_type = #{maintenanceType},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOperationRecordById" parameterType="String">
delete from equ_operation_record where id = #{id}
</delete>
<delete id="deleteEquOperationRecordByIds" parameterType="String">
delete from equ_operation_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -7,7 +7,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol; import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysUser;
import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger; import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.service.IBaseEquipmentService; import com.op.wms.service.IBaseEquipmentService;
@ -114,7 +117,6 @@ public class BaseEquipmentController extends BaseController {
/** /**
* *
*/ */
// @RequiresPermissions("wms:equipment:getEquipmentTypeList")
@GetMapping("/getEquipmentTypeList") @GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) { public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) {
List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment); List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment);
@ -125,8 +127,8 @@ public class BaseEquipmentController extends BaseController {
* *
*/ */
@GetMapping("/getSparePartsList") @GetMapping("/getSparePartsList")
public TableDataInfo getSparePartsList(BaseEquipment baseEquipment) { public TableDataInfo getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(baseEquipment); List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(wmsSparePartsLedger);
return getDataTable(list); return getDataTable(list);
} }
@ -218,4 +220,14 @@ public class BaseEquipmentController extends BaseController {
return baseEquipmentService.importFile(orderList); return baseEquipmentService.importFile(orderList);
} }
/**
*
*/
@RequiresPermissions("wms:equipment:edit")
@Log(title = "修改设备状态", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody BaseEquipment baseEquipment) {
return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment));
}
} }

@ -61,7 +61,7 @@ public class BaseEquipment extends BaseEntity {
private String workshopName; private String workshopName;
/** 设备状态 */ /** 设备状态 */
@Excel(name = "设备状态") @Excel(name = "设备是否启用")
private String status; private String status;
/** 预留字段1 */ /** 预留字段1 */
@ -207,6 +207,10 @@ public class BaseEquipment extends BaseEntity {
@Excel(name = "工厂号") @Excel(name = "工厂号")
private String factoryCode; private String factoryCode;
/** 设备状态 */
@Excel(name = "设备状态")
private String equipmentStatus;
private String imageFileList; private String imageFileList;
private String barCodeFileList; private String barCodeFileList;
@ -619,6 +623,14 @@ public class BaseEquipment extends BaseEntity {
return factoryCode; return factoryCode;
} }
//设备状态
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public String getEquipmentStatus() {
return equipmentStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -81,7 +81,7 @@ public interface BaseEquipmentMapper {
Long getEquipmentId(String equipmentCode); Long getEquipmentId(String equipmentCode);
//查询备件 //查询备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//绑定备品备件 //绑定备品备件
public int bindSpareParts(EquSpareEquipment equSpareEquipment); public int bindSpareParts(EquSpareEquipment equSpareEquipment);
@ -107,4 +107,7 @@ public interface BaseEquipmentMapper {
//设备 //设备
BaseEquipment selectExistByEquipmentCode(String equipmentCode); BaseEquipment selectExistByEquipmentCode(String equipmentCode);
//更新设备状态
Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -69,11 +69,14 @@ public interface IBaseEquipmentService {
List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment); List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment);
//查询设备备品备件 //查询设备备品备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//查询设备备品备件右侧列表 //查询设备备品备件右侧列表
public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment); public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment);
//导入设备基础数据文件 //导入设备基础数据文件
AjaxResult importFile(List<BaseEquipment> equipmentList); AjaxResult importFile(List<BaseEquipment> equipmentList);
//更改设备状态
int updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -372,8 +372,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment) { public List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
return baseEquipmentMapper.getSparePartsList(baseEquipment); return baseEquipmentMapper.getSparePartsList(wmsSparePartsLedger);
} }
/** /**
@ -481,4 +481,19 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return failEquipment; return failEquipment;
} }
/**
*
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public int updateBaseEquipmentStatus(BaseEquipment baseEquipment) {
baseEquipment.setUpdateBy(SecurityUtils.getUsername());
baseEquipment.setUpdateTime(DateUtils.getNowDate());
Integer list = baseEquipmentMapper.updateBaseEquipmentStatus(baseEquipment);
return list;
}
} }

@ -47,6 +47,7 @@
<result property="sapAsset" column="sap_asset" /> <result property="sapAsset" column="sap_asset" />
<result property="equipmentHead" column="equipment_head" /> <result property="equipmentHead" column="equipment_head" />
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<result property="equipmentStatus" column="equipment_status" />
</resultMap> </resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult"> <resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -159,7 +160,9 @@
asset_head, asset_head,
fixed_asset_code, fixed_asset_code,
department, department,
equipment_head equipment_head,
factory_code,
equipment_status
from base_equipment from base_equipment
</sql> </sql>
@ -201,6 +204,7 @@
<if test="department != null and department != ''"> and department = #{department}</if> <if test="department != null and department != ''"> and department = #{department}</if>
<if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if> <if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if>
and del_flag ='0' and del_flag ='0'
</where> </where>
</select> </select>
@ -254,6 +258,7 @@
<if test="sapAsset != null">sap_asset,</if> <if test="sapAsset != null">sap_asset,</if>
<if test="equipmentHead != null">equipment_head,</if> <if test="equipmentHead != null">equipment_head,</if>
<if test="factoryCode != null">factory_code,</if> <if test="factoryCode != null">factory_code,</if>
<if test="equipmentStatus != null">equipment_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if> <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -296,6 +301,7 @@
<if test="sapAsset != null">#{sapAsset},</if> <if test="sapAsset != null">#{sapAsset},</if>
<if test="equipmentHead != null">#{equipmentHead},</if> <if test="equipmentHead != null">#{equipmentHead},</if>
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">equipmentStatus,</if>
</trim> </trim>
</insert> </insert>
@ -342,6 +348,7 @@
<if test="sapAsset != null">sap_asset = #{sapAsset},</if> <if test="sapAsset != null">sap_asset = #{sapAsset},</if>
<if test="equipmentHead != null">equipment_head = #{equipmentHead},</if> <if test="equipmentHead != null">equipment_head = #{equipmentHead},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
</trim> </trim>
where equipment_id = #{equipmentId} where equipment_id = #{equipmentId}
</update> </update>
@ -514,4 +521,12 @@
and del_flag ='0' and del_flag ='0'
</select> </select>
<update id="updateBaseEquipmentStatus" parameterType="BaseEquipment">
update base_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
</trim>
where equipment_id = #{equipmentId}
</update>
</mapper> </mapper>
Loading…
Cancel
Save