报修+维修+设备班组+委外

highway
A0010407 1 year ago
parent cca83e6511
commit 1d5b107814

@ -107,8 +107,8 @@ public class EquRepairWorkOrderController extends BaseController {
*/ */
@RequiresPermissions("device:repairOrder:apply") @RequiresPermissions("device:repairOrder:apply")
@PostMapping("/apply") @PostMapping("/apply")
public AjaxResult apply(@RequestBody EquOutsourceWork equOutsourceWork) { public AjaxResult apply(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return toAjax(equOutsourceWorkService.insertEquOutsourceWork(equOutsourceWork)); return toAjax(equRepairWorkOrderService.applyEquOutsourceWork(equRepairWorkOrder));
} }
/** /**
@ -117,7 +117,7 @@ public class EquRepairWorkOrderController extends BaseController {
@RequiresPermissions("device:repairOrder:write") @RequiresPermissions("device:repairOrder:write")
@PostMapping("/write") @PostMapping("/write")
public AjaxResult write(@RequestBody EquRepairWorkOrder equRepairWorkOrder) { public AjaxResult write(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setWorkCost(equRepairWorkOrder.getWorkCost()+"元"); equRepairWorkOrder.setWorkCost(equRepairWorkOrder.getWorkCost());
return toAjax(equRepairWorkOrderService.updateEquRepairWorkOrder(equRepairWorkOrder)); return toAjax(equRepairWorkOrderService.updateEquRepairWorkOrder(equRepairWorkOrder));
} }

@ -94,4 +94,12 @@ public class EquTeamController extends BaseController {
public AjaxResult remove(@PathVariable String[] ids) { public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(equTeamService.deleteEquTeamByIds(ids)); return toAjax(equTeamService.deleteEquTeamByIds(ids));
} }
//查询设备维修班组
@GetMapping("/getMaintenanceTeamList")
public TableDataInfo getMaintenanceTeamList(EquTeam equTeam) {
startPage();
List<EquTeam> list = equTeamService.getMaintenanceTeamList(equTeam);
return getDataTable(list);
}
} }

@ -25,8 +25,12 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "报修编码") @Excel(name = "报修编码")
private String orderCode; private String orderCode;
/** 维修人员 */ /** 维修编码 */
@Excel(name = "维修人员") @Excel(name = "维修编码")
private String repairCode;
/** 委外维修人员 */
@Excel(name = "委外维修人员")
private String workPerson; private String workPerson;
/** 委外单位 */ /** 委外单位 */
@ -41,16 +45,12 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "原因") @Excel(name = "原因")
private String workReason; private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 委外类型 */ /** 委外类型 */
@Excel(name = "委外类型") @Excel(name = "委外类型")
private String workType; private String workType;
/** 管理单号 */ /** 设备编码 */
@Excel(name = "管理单号") @Excel(name = "设备编码")
private String equipmentCode; private String equipmentCode;
/** 委外费用 */ /** 委外费用 */
@ -80,10 +80,30 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "工厂编码") @Excel(name = "工厂编码")
private String factoryCode; private String factoryCode;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 规格型号 */
@Excel(name = "规格型号")
private String equipmentSpec;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/** 设备位置 */
@Excel(name = "设备位置")
private String equipmentLocation;
/** 部门 */
@Excel(name = "部门")
private String department;
public void setWorkId(String workId) { public void setWorkId(String workId) {
this.workId = workId; this.workId = workId;
} }
public String getWorkId() { public String getWorkId() {
return workId; return workId;
} }
@ -91,7 +111,6 @@ public class EquOutsourceWork extends BaseEntity {
public void setOrderCode(String orderCode) { public void setOrderCode(String orderCode) {
this.orderCode = orderCode; this.orderCode = orderCode;
} }
public String getOrderCode() { public String getOrderCode() {
return orderCode; return orderCode;
} }
@ -99,107 +118,142 @@ public class EquOutsourceWork extends BaseEntity {
public void setWorkCode(String workCode) { public void setWorkCode(String workCode) {
this.workCode = workCode; this.workCode = workCode;
} }
public String getWorkCode() { public String getWorkCode() {
return workCode; return workCode;
} }
public void setRepairCode(String repairCode) {
this.repairCode = repairCode;
}
public String getRepairCode() {
return repairCode;
}
public void setWorkPerson(String workPerson) { public void setWorkPerson(String workPerson) {
this.workPerson = workPerson; this.workPerson = workPerson;
} }
public String getWorkPerson() { public String getWorkPerson() {
return workPerson; return workPerson;
} }
public void setWorkOutsourcingUnit(String workOutsourcingUnit) { public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit; this.workOutsourcingUnit = workOutsourcingUnit;
} }
public String getWorkOutsourcingUnit() { public String getWorkOutsourcingUnit() {
return workOutsourcingUnit; return workOutsourcingUnit;
} }
public void setWorkConnection(String workConnection) { public void setWorkConnection(String workConnection) {
this.workConnection = workConnection; this.workConnection = workConnection;
} }
public String getWorkConnection() { public String getWorkConnection() {
return workConnection; return workConnection;
} }
public void setWorkReason(String workReason) { public void setWorkReason(String workReason) {
this.workReason = workReason; this.workReason = workReason;
} }
public String getWorkReason() { public String getWorkReason() {
return workReason; return workReason;
} }
public void setWorkType(String workType) { public void setWorkType(String workType) {
this.workType = workType; this.workType = workType;
} }
public String getWorkType() { public String getWorkType() {
return workType; return workType;
} }
public void setEquipmentCode(String equipmentCode) { public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode; this.equipmentCode = equipmentCode;
} }
public String getEquipmentCode() { public String getEquipmentCode() {
return equipmentCode; return equipmentCode;
} }
public void setWorkCost(String workCost) { public void setWorkCost(String workCost) {
this.workCost = workCost; this.workCost = workCost;
} }
public String getWorkCost() { public String getWorkCost() {
return workCost; return workCost;
} }
public void setWorkCostTime(String workCostTime) { public void setWorkCostTime(String workCostTime) {
this.workCostTime = workCostTime; this.workCostTime = workCostTime;
} }
public String getWorkCostTime() { public String getWorkCostTime() {
return workCostTime; return workCostTime;
} }
public void setAttr1(String attr1) { public void setAttr1(String attr1) {
this.attr1 = attr1; this.attr1 = attr1;
} }
public String getAttr1() { public String getAttr1() {
return attr1; return attr1;
} }
public void setAttr2(String attr2) { public void setAttr2(String attr2) {
this.attr2 = attr2; this.attr2 = attr2;
} }
public String getAttr2() { public String getAttr2() {
return attr2; return attr2;
} }
public void setAttr3(String attr3) { public void setAttr3(String attr3) {
this.attr3 = attr3; this.attr3 = attr3;
} }
public String getAttr3() { public String getAttr3() {
return attr3; return attr3;
} }
public void setDelFlag(String delFlag) { public void setDelFlag(String delFlag) {
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getDelFlag() { public String getDelFlag() {
return delFlag; return delFlag;
} }
public void setFactoryCode(String factoryCode) { public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode; this.factoryCode = factoryCode;
} }
public String getFactoryCode() { public String getFactoryCode() {
return factoryCode; return factoryCode;
} }
public void setOutSourceReason(String outSourceReason) { //设备
this.outSourceReason = outSourceReason; public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setDepartment(String department) {
this.department = department;
} }
public String getOutSourceReason() { public String getDepartment() {
return outSourceReason; return department;
} }
@Override @Override
@ -208,6 +262,7 @@ public class EquOutsourceWork extends BaseEntity {
.append("workId", getWorkId()) .append("workId", getWorkId())
.append("orderCode", getWorkCode()) .append("orderCode", getWorkCode())
.append("workCode", getWorkCode()) .append("workCode", getWorkCode())
.append("repairCode", getRepairCode())
.append("workPerson", getWorkPerson()) .append("workPerson", getWorkPerson())
.append("workOutsourcingUnit", getWorkOutsourcingUnit()) .append("workOutsourcingUnit", getWorkOutsourcingUnit())
.append("workConnection", getWorkConnection()) .append("workConnection", getWorkConnection())

@ -84,6 +84,10 @@ public class EquRepairOrder extends BaseEntity {
/** 删除标志 */ /** 删除标志 */
private String delFlag; private String delFlag;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
//设备 //设备
/** 设备类型名称 */ /** 设备类型名称 */
@Excel(name = "设备类型名称") @Excel(name = "设备类型名称")
@ -410,6 +414,13 @@ public class EquRepairOrder extends BaseEntity {
return workDownMachine; return workDownMachine;
} }
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,6 +1,8 @@
package com.op.device.domain; package com.op.device.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -73,10 +75,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "原因分析") @Excel(name = "原因分析")
private String workReason; private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 故障描述 */ /** 故障描述 */
@Excel(name = "故障描述") @Excel(name = "故障描述")
private String workFaultDesc; private String workFaultDesc;
@ -131,7 +129,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String workEndTime; private String workEndTime;
// 设备 // 设备
/** 设备名称 */ /** 设备名称 */
@Excel(name = "设备名称") @Excel(name = "设备名称")
@ -153,7 +150,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "部门") @Excel(name = "部门")
private String department; private String department;
//报修 //报修
/** 故障描述 */ /** 故障描述 */
@Excel(name = "故障描述") @Excel(name = "故障描述")
@ -181,6 +177,35 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "联系方式") @Excel(name = "联系方式")
private String orderConnection; private String orderConnection;
//班组
/** 班组名称 */
@Excel(name = "班组名称")
private String teamName;
/** 班组人员 */
@Excel(name = "班组人员")
private String teamPerson;
//时间列表 虚拟字段
private List<Date> workPlanTimeArray;
private List<Date> workPlanDownTimeArray;
//计划开始时间、结束时间
private String workPlanTimeStart;
private String workPlanTimeEnd;
//计划停机开始时间、结束时间
private String workPlanDownTimeStart;
private String workPlanDownTimeEnd;
//委外虚拟字段
/** 委外维修人员 */
private String outSourcePerson;
/** 委外维修原因 */
private String outSourceReason;
/** 委外单位 */
private String workOutsourcingUnit;
/** 联系方式 */
private String workConnection;
//报修 //报修
public void setOrderDesc(String orderDesc) { public void setOrderDesc(String orderDesc) {
@ -263,14 +288,13 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkId(String workId) { public void setWorkId(String workId) {
this.workId = workId; this.workId = workId;
} }
public String getWorkId() { public String getWorkId() {
return workId; return workId;
} }
public void setOrderId(String orderId) { public void setOrderId(String orderId) {
this.orderId = orderId; this.orderId = orderId;
} }
public String getOrderId() { public String getOrderId() {
return orderId; return orderId;
} }
@ -278,7 +302,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCode(String workCode) { public void setWorkCode(String workCode) {
this.workCode = workCode; this.workCode = workCode;
} }
public String getWorkCode() { public String getWorkCode() {
return workCode; return workCode;
} }
@ -286,155 +309,146 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderCode(String orderCode) { public void setOrderCode(String orderCode) {
this.orderCode = orderCode; this.orderCode = orderCode;
} }
public String getOrderCode() { public String getOrderCode() {
return orderCode; return orderCode;
} }
public void setWorkHandle(String workHandle) { public void setWorkHandle(String workHandle) {
this.workHandle = workHandle; this.workHandle = workHandle;
} }
public String getWorkHandle() { public String getWorkHandle() {
return workHandle; return workHandle;
} }
public void setWorkPlanTime(Date workPlanTime) { public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime; this.workPlanTime = workPlanTime;
} }
public Date getWorkPlanTime() { public Date getWorkPlanTime() {
return workPlanTime; return workPlanTime;
} }
public void setWorkPlanDownTime(Date workPlanDownTime) { public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime; this.workPlanDownTime = workPlanDownTime;
} }
public Date getWorkPlanDownTime() { public Date getWorkPlanDownTime() {
return workPlanDownTime; return workPlanDownTime;
} }
public void setOrderRelevance(String orderRelevance) { public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance; this.orderRelevance = orderRelevance;
} }
public String getOrderRelevance() { public String getOrderRelevance() {
return orderRelevance; return orderRelevance;
} }
public void setWorkPerson(String workPerson) { public void setWorkPerson(String workPerson) {
this.workPerson = workPerson; this.workPerson = workPerson;
} }
public String getWorkPerson() { public String getWorkPerson() {
return workPerson; return workPerson;
} }
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setWorkTeam(String workTeam) { public void setWorkTeam(String workTeam) {
this.workTeam = workTeam; this.workTeam = workTeam;
} }
public String getWorkTeam() { public String getWorkTeam() {
return workTeam; return workTeam;
} }
public void setWorkOutsource(String workOutsource) { public void setWorkOutsource(String workOutsource) {
this.workOutsource = workOutsource; this.workOutsource = workOutsource;
} }
public String getWorkOutsource() { public String getWorkOutsource() {
return workOutsource; return workOutsource;
} }
public void setWorkDownMachine(String workDownMachine) { public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine; this.workDownMachine = workDownMachine;
} }
public String getWorkDownMachine() { public String getWorkDownMachine() {
return workDownMachine; return workDownMachine;
} }
public void setEquipmentCode(String equipmentCode) { public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode; this.equipmentCode = equipmentCode;
} }
public String getEquipmentCode() { public String getEquipmentCode() {
return equipmentCode; return equipmentCode;
} }
public void setWorkReason(String workReason) { public void setWorkReason(String workReason) {
this.workReason = workReason; this.workReason = workReason;
} }
public String getWorkReason() { public String getWorkReason() {
return workReason; return workReason;
} }
public void setWorkFaultDesc(String workFaultDesc) { public void setWorkFaultDesc(String workFaultDesc) {
this.workFaultDesc = workFaultDesc; this.workFaultDesc = workFaultDesc;
} }
public String getWorkFaultDesc() { public String getWorkFaultDesc() {
return workFaultDesc; return workFaultDesc;
} }
public void setWorkCostTime(Date workCostTime) { public void setWorkCostTime(Date workCostTime) {
this.workCostTime = workCostTime; this.workCostTime = workCostTime;
} }
public Date getWorkCostTime() { public Date getWorkCostTime() {
return workCostTime; return workCostTime;
} }
public void setWorkCost(String workCost) { public void setWorkCost(String workCost) {
this.workCost = workCost; this.workCost = workCost;
} }
public String getWorkCost() { public String getWorkCost() {
return workCost; return workCost;
} }
public void setOutWorkId(String outWorkId) { public void setOutWorkId(String outWorkId) {
this.outWorkId = outWorkId; this.outWorkId = outWorkId;
} }
public String getOutWorkId() { public String getOutWorkId() {
return outWorkId; return outWorkId;
} }
public void setOutWorkCode(String outWorkCode) { public void setOutWorkCode(String outWorkCode) {
this.outWorkCode = outWorkCode; this.outWorkCode = outWorkCode;
} }
public String getOutWorkCode() { public String getOutWorkCode() {
return outWorkCode; return outWorkCode;
} }
public void setAttr1(String attr1) { public void setAttr1(String attr1) {
this.attr1 = attr1; this.attr1 = attr1;
} }
public String getAttr1() { public String getAttr1() {
return attr1; return attr1;
} }
public void setAttr2(String attr2) { public void setAttr2(String attr2) {
this.attr2 = attr2; this.attr2 = attr2;
} }
public String getAttr2() { public String getAttr2() {
return attr2; return attr2;
} }
public void setAttr3(String attr3) { public void setAttr3(String attr3) {
this.attr3 = attr3; this.attr3 = attr3;
} }
public String getAttr3() { public String getAttr3() {
return attr3; return attr3;
} }
public void setDelFlag(String delFlag) { public void setDelFlag(String delFlag) {
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getDelFlag() { public String getDelFlag() {
return delFlag; return delFlag;
} }
public void setFactoryCode(String factoryCode) { public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode; this.factoryCode = factoryCode;
} }
public String getFactoryCode() { public String getFactoryCode() {
return factoryCode; return factoryCode;
} }
@ -443,7 +457,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkStatus(String workStatus) { public void setWorkStatus(String workStatus) {
this.workStatus = workStatus; this.workStatus = workStatus;
} }
public String getWorkStatus() { public String getWorkStatus() {
return workStatus; return workStatus;
} }
@ -452,7 +465,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkStartTime(String workStartTime) { public void setWorkStartTime(String workStartTime) {
this.workStartTime = workStartTime; this.workStartTime = workStartTime;
} }
public String getWorkStartTime() { public String getWorkStartTime() {
return workStartTime; return workStartTime;
} }
@ -460,11 +472,97 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkEndTime(String workEndTime) { public void setWorkEndTime(String workEndTime) {
this.workEndTime = workEndTime; this.workEndTime = workEndTime;
} }
public String getWorkEndTime() { public String getWorkEndTime() {
return workEndTime; return workEndTime;
} }
//班组
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getTeamName() {
return teamName;
}
public void setTeamPerson(String teamPerson) {
this.teamPerson = teamPerson;
}
public String getTeamPerson() {
return teamPerson;
}
//时间列表
public List<Date> getWorkPlanTimeArray() {
return workPlanTimeArray;
}
public void setWorkPlanTimeArray(List<Date> workPlanTimeArray) {
this.workPlanTimeArray = workPlanTimeArray;
}
public List<Date> getWorkPlanDownTimeArray() {
return workPlanDownTimeArray;
}
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) {
this.workPlanDownTimeArray = workPlanDownTimeArray;
}
//计划开始时间、结束时间
public String getWorkPlanDownTimeStart() {
return workPlanDownTimeStart;
}
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) {
this.workPlanDownTimeStart = workPlanDownTimeStart;
}
public String getWorkPlanDownTimeEnd() {
return workPlanDownTimeEnd;
}
public void setWorkPlanDownTimeEnd(String workPlanDownTimeEnd) {
this.workPlanDownTimeEnd = workPlanDownTimeEnd;
}
//计划停机开始时间、结束时间
public String getWorkPlanTimeStart() {
return workPlanTimeStart;
}
public void setWorkPlanTimeStart(String workPlanTimeStart) {
this.workPlanTimeStart = workPlanTimeStart;
}
public String getWorkPlanTimeEnd() {
return workPlanTimeEnd;
}
public void setWorkPlanTimeEnd(String workPlanTimeEnd) {
this.workPlanTimeEnd = workPlanTimeEnd;
}
//委外维修人员/委外维修原因 虚拟字段
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setOutSourcePerson(String outSourcePerson) {
this.outSourcePerson = outSourcePerson;
}
public String getOutSourcePerson() {
return outSourcePerson;
}
public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit;
}
public String getWorkOutsourcingUnit() {
return workOutsourcingUnit;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getWorkConnection() {
return workConnection;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -58,4 +58,7 @@ public interface EquTeamMapper {
* @return * @return
*/ */
public int deleteEquTeamByIds(String[] ids); public int deleteEquTeamByIds(String[] ids);
//查询设备维修组列表
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
} }

@ -2,6 +2,7 @@ package com.op.device.service;
import java.util.List; import java.util.List;
import com.op.device.domain.EquOutsourceWork; import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquRepairWorkOrder;
/** /**
* Service * Service

@ -62,4 +62,7 @@ public interface IEquRepairWorkOrderService {
//获取维修人员列表 //获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment); public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
//委外申请
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder);
} }

@ -57,4 +57,7 @@ public interface IEquTeamService {
* @return * @return
*/ */
public int deleteEquTeamById(String id); public int deleteEquTeamById(String id);
//维修组列表
List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
} }

@ -13,6 +13,10 @@ import org.springframework.stereotype.Service;
import com.op.device.mapper.EquOutsourceWorkMapper; import com.op.device.mapper.EquOutsourceWorkMapper;
import com.op.device.domain.EquOutsourceWork; import com.op.device.domain.EquOutsourceWork;
import com.op.device.service.IEquOutsourceWorkService; import com.op.device.service.IEquOutsourceWorkService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
@ -61,22 +65,18 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int insertEquOutsourceWork(EquOutsourceWork equOutsourceWork) { public int insertEquOutsourceWork(EquOutsourceWork equOutsourceWork) {
//转委外 equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber()); String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equOutsourceWork.getEquipmentCode(); String equipmentCode = equOutsourceWork.getEquipmentCode();
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
if(equOutsourceWork.getWorkId()!= null){
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkId(equOutsourceWork.getWorkId());
equRepairWorkOrder.setWorkOutsource("1");
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
equOutsourceWork.setWorkId("");
}
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setWorkReason(equOutsourceWork.getOutSourceReason());
equOutsourceWork.setCreateTime(DateUtils.getNowDate()); equOutsourceWork.setCreateTime(DateUtils.getNowDate());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername()); equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
equOutsourceWork.setOrderCode("无");
equOutsourceWork.setRepairCode("无");
//工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
} }

@ -17,6 +17,10 @@ import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairOrderMapper; import com.op.device.mapper.EquRepairOrderMapper;
import com.op.device.domain.EquRepairOrder; import com.op.device.domain.EquRepairOrder;
import com.op.device.service.IEquRepairOrderService; import com.op.device.service.IEquRepairOrderService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
@ -79,6 +83,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairOrder.setCreateTime(DateUtils.getNowDate()); equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername()); equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核"); equRepairOrder.setOrderStatus("待审核");
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// equRepairOrder.setFactory(request.getHeader(key.substring(8)).replace("ds_",""));
return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder); return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
} }
@ -115,9 +122,14 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairWorkOrder.setWorkDownMachine("0"); equRepairWorkOrder.setWorkDownMachine("0");
} }
equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc()); equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc());
equRepairWorkOrder.setWorkStatus("0");
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID()); equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
//工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder); equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
equRepairOrder.setOrderStatus("审核通过"); equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("不维修")){ }else if(equRepairOrder.getRepairDestination().equals("不维修")){
@ -129,11 +141,18 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode()); equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber()); String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode(); String equipmentCode = equRepairOrder.getEquipmentCode();
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setRepairCode("无");
equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection()); equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection());
equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit()); equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit());
equOutsourceWork.setWorkPerson(equRepairOrder.getOutSourcePerson()); equOutsourceWork.setWorkPerson(equRepairOrder.getOutSourcePerson());
equOutsourceWork.setWorkReason(equRepairOrder.getOutSourceReason()); equOutsourceWork.setWorkReason(equRepairOrder.getOutSourceReason());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
equOutsourceWork.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
equRepairOrder.setOrderStatus("审核通过"); equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){ }else if(equRepairOrder.getRepairDestination().equals("立即维修")){

@ -1,5 +1,6 @@
package com.op.device.service.impl; package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
@ -7,11 +8,17 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment; import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.mapper.EquOutsourceWorkMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper; import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.domain.EquRepairWorkOrder; import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.service.IEquRepairWorkOrderService; import com.op.device.service.IEquRepairWorkOrderService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
@ -24,6 +31,9 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Autowired @Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper; private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
/** /**
* *
* *
@ -45,6 +55,22 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder) { public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder) {
if (equRepairWorkOrder.getWorkPlanTimeArray() != null) {
// 设置创建日期开始和结束值
if (equRepairWorkOrder.getWorkPlanTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(1)));
}
}
if (equRepairWorkOrder.getWorkPlanDownTimeArray() != null) {
// 设置更新日期开始和结束
if (equRepairWorkOrder.getWorkPlanDownTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanDownTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanDownTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(1)));
}
}
return equRepairWorkOrderMapper.selectEquRepairWorkOrderList(equRepairWorkOrder); return equRepairWorkOrderMapper.selectEquRepairWorkOrderList(equRepairWorkOrder);
} }
@ -62,9 +88,16 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber()); String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode(); String equipmentCode = equRepairWorkOrder.getEquipmentCode();
//维修单号 //维修单号
equRepairWorkOrder.setOrderCode("无");
equRepairWorkOrder.setOutWorkCode("无");
equRepairWorkOrder.setWorkStatus("待维修");
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder); return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
} }
@ -72,11 +105,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
* *
* *
* @param equRepairWorkOrder * @param equRepairWorkOrder
* @return * @return outSourcePerson
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) { public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
if(equRepairWorkOrder.getWorkDownMachine().equals("0")){
equRepairWorkOrder.setWorkPlanDownTime(null);
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate()); equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
return equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder); return equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
} }
@ -110,4 +147,32 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment) { public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment) {
return equRepairWorkOrderMapper.getMaintenancePersonList(equEquipment); return equRepairWorkOrderMapper.getMaintenancePersonList(equEquipment);
} }
//委外申请
@Override
@DS("#header.poolName")
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder) {
//转委外
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
//委外工单号
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
equOutsourceWork.setOrderCode("无");
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setRepairCode(equRepairWorkOrder.getWorkCode());
equOutsourceWork.setWorkReason(equRepairWorkOrder.getOutSourceReason());
equOutsourceWork.setWorkPerson(equRepairWorkOrder.getOutSourcePerson());
equOutsourceWork.setWorkOutsourcingUnit(equRepairWorkOrder.getWorkOutsourcingUnit());
equOutsourceWork.setWorkConnection(equRepairWorkOrder.getWorkConnection());
equOutsourceWork.setCreateTime(DateUtils.getNowDate());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
if(equRepairWorkOrder.getWorkId()!= null){
equRepairWorkOrder.setWorkOutsource("1");
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
}
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
}
} }

@ -99,4 +99,13 @@ public class EquTeamServiceImpl implements IEquTeamService {
public int deleteEquTeamById(String id) { public int deleteEquTeamById(String id) {
return equTeamMapper.deleteEquTeamById(id); return equTeamMapper.deleteEquTeamById(id);
} }
/**
*
*/
@Override
@DS("#header.poolName")
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam) {
return equTeamMapper.getMaintenanceTeamList(equTeam);
}
} }

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workId" column="work_id" /> <result property="workId" column="work_id" />
<result property="workCode" column="work_code" /> <result property="workCode" column="work_code" />
<result property="orderCode" column="order_code" /> <result property="orderCode" column="order_code" />
<result property="repairCode" column="repair_code" />
<result property="workPerson" column="work_person" /> <result property="workPerson" column="work_person" />
<result property="workOutsourcingUnit" column="work_outsourcing_unit" /> <result property="workOutsourcingUnit" column="work_outsourcing_unit" />
<result property="workConnection" column="work_connection" /> <result property="workConnection" column="work_connection" />
@ -25,24 +26,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<!--设备-->
<result property="equipmentName" column="equipment_name" />
<result property="equipmentSpec" column="equipment_spec" />
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
</resultMap> </resultMap>
<sql id="selectEquOutsourceWorkVo"> <sql id="selectEquOutsourceWorkVo">
select work_id, work_code,order_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work select work_id, work_code,order_code, repair_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work
</sql> </sql>
<select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult"> <select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult">
<include refid="selectEquOutsourceWorkVo"/> select
eow.work_id,
eow.work_code,
eow.order_code,
eow.repair_code,
eow.work_person,
eow.work_outsourcing_unit,
eow.work_connection,
eow.work_reason,
eow.work_type,
eow.equipment_code,
eow.work_cost,
eow.work_cost_time,
eow.attr1,
eow.attr2,
eow.attr3,
eow.del_flag,
eow.create_by,
eow.create_time,
eow.update_by,
eow.update_time,
eow.factory_code,
be.equipment_name,
be.equipment_type_name,
be.equipment_spec,
be.department,
be.equipment_location
from equ_outsource_work eow
left join base_equipment be on eow.equipment_code = be.equipment_code
<where> <where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if> <if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if> <if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if> <if test="repairCode != null and repairCode != ''"> and repair_code like concat('%', #{repairCode}, '%')</if>
<if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit = #{workOutsourcingUnit}</if> <if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
<if test="workConnection != null and workConnection != ''"> and work_connection = #{workConnection}</if> <if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit like concat('%', #{workOutsourcingUnit}, '%')</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if> <if test="workConnection != null and workConnection != ''"> and work_connection like concat('%', #{workConnection}, '%')</if>
<if test="workReason != null and workReason != ''"> and work_reason like concat('%', #{workReason}, '%')</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if> <if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if> <if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if> <if test="workCost != null and workCost != ''"> and work_cost like concat('%', #{workCost}, '%')</if>
<if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</if> <if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
@ -50,8 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if> <if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0' and eow.del_flag = '0'
ORDER BY create_time DESC ORDER BY eow.create_time DESC
</where> </where>
</select> </select>
@ -66,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">work_id,</if> <if test="workId != null">work_id,</if>
<if test="workCode != null">work_code,</if> <if test="workCode != null">work_code,</if>
<if test="orderCode != null">order_code,</if> <if test="orderCode != null">order_code,</if>
<if test="repairCode != null">repair_code,</if>
<if test="workPerson != null">work_person,</if> <if test="workPerson != null">work_person,</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit,</if> <if test="workOutsourcingUnit != null">work_outsourcing_unit,</if>
<if test="workConnection != null">work_connection,</if> <if test="workConnection != null">work_connection,</if>
@ -88,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">#{workId},</if> <if test="workId != null">#{workId},</if>
<if test="workCode != null">#{workCode},</if> <if test="workCode != null">#{workCode},</if>
<if test="orderCode != null">#{orderCode},</if> <if test="orderCode != null">#{orderCode},</if>
<if test="repairCode != null">#{repairCode},</if>
<if test="workPerson != null">#{workPerson},</if> <if test="workPerson != null">#{workPerson},</if>
<if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if> <if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if>
<if test="workConnection != null">#{workConnection},</if> <if test="workConnection != null">#{workConnection},</if>
@ -113,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="workCode != null">work_code = #{workCode},</if> <if test="workCode != null">work_code = #{workCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if> <if test="orderCode != null">order_code = #{orderCode},</if>
<if test="repairCode != null">repair_code = #{repairCode},</if>
<if test="workPerson != null">work_person = #{workPerson},</if> <if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if> <if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if>
<if test="workConnection != null">work_connection = #{workConnection},</if> <if test="workConnection != null">work_connection = #{workConnection},</if>

@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="repairDestination" column="repair_destination" /> <result property="repairDestination" column="repair_destination" />
<!-- 设备 --> <!-- 设备 -->
<result property="equipmentTypeName" column="equipment_type_name" /> <result property="equipmentTypeName" column="equipment_type_name" />
@ -46,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectEquRepairOrderVo"> <sql id="selectEquRepairOrderVo">
select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,repair_destination from equ_repair_order select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,factory_code,repair_destination from equ_repair_order
</sql> </sql>
<select id="selectEquRepairOrderList" parameterType="EquRepairOrder" resultMap="EquRepairOrderResult"> <select id="selectEquRepairOrderList" parameterType="EquRepairOrder" resultMap="EquRepairOrderResult">
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if> <if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if> <if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if>
and del_flag = '0' and del_flag = '0'
ORDER BY create_time DESC ORDER BY create_time DESC
@ -94,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.create_time, ero.create_time,
ero.update_by, ero.update_by,
ero.update_time, ero.update_time,
ero.factory_code,
ero.repair_destination, ero.repair_destination,
be.equipment_name, be.equipment_name,
be.equipment_type_name, be.equipment_type_name,
@ -141,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="repairDestination != null">repair_destination,</if> <if test="repairDestination != null">repair_destination,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -165,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="repairDestination != null">#{repairDestination},</if> <if test="repairDestination != null">#{repairDestination},</if>
</trim> </trim>
</insert> </insert>
@ -192,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="repairDestination != null">repair_destination = #{repairDestination},</if> <if test="repairDestination != null">repair_destination = #{repairDestination},</if>
</trim> </trim>
where order_id = #{orderId} where order_id = #{orderId}

@ -50,6 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderTime" column="order_time" /> <result property="orderTime" column="order_time" />
<result property="orderRepairman" column="order_repairman" /> <result property="orderRepairman" column="order_repairman" />
<result property="orderConnection" column="order_connection" /> <result property="orderConnection" column="order_connection" />
<!--班组-->
<result property="teamName" column="team_name" />
<result property="teamPerson" column="team_person" />
</resultMap> </resultMap>
<sql id="selectEquRepairWorkOrderVo"> <sql id="selectEquRepairWorkOrderVo">
@ -57,38 +60,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult"> <select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/> select
erwo.work_id,
erwo.order_id,
erwo.order_code,
erwo.work_code,
erwo.work_handle,
erwo.work_plan_time,
erwo.work_plan_down_time,
erwo.order_relevance,
erwo.work_person,
erwo.work_team,
erwo.work_outsource,
erwo.work_down_machine,
erwo.equipment_code,
erwo.work_reason,
erwo.work_fault_desc,
erwo.work_start_time,
erwo.work_end_time,
erwo.work_cost_time,
erwo.work_cost,
erwo.work_status,
erwo.out_work_id,
erwo.out_work_code,
erwo.attr1,
erwo.attr2,
erwo.attr3,
erwo.create_by,
erwo.create_time,
erwo.update_time,
erwo.update_by,
erwo.del_flag,
erwo.factory_code,
be.equipment_name,
et.team_name,
et.team_person
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_team et on erwo.work_team = et.team_code
<where> <where>
<!--报修id 维修code 报修code--> <!--报修id 维修code 报修code-->
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and erwo.order_id = #{orderId}</if>
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if> <if test="workCode != null and workCode != ''"> and erwo.work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if> <if test="orderCode != null and orderCode != ''"> and erwo.order_code like concat('%', #{orderCode}, '%')</if>
<!--设备code 设备故障描述 计划维修时间 是否停机 计划停机时间--> <!--设备code 设备故障描述 计划维修时间 是否停机 计划停机时间-->
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if> <if test="equipmentCode != null and equipmentCode != ''"> and erwo.equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if> <if test="workFaultDesc != null and workFaultDesc != ''"> and erwo.work_fault_desc = #{workFaultDesc}</if>
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if> <if test="workPlanTimeStart != null "> and CONVERT(date,work_plan_time) >= #{workPlanTimeStart}</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if> <if test="workPlanTimeEnd != null "> and #{workPlanTimeEnd} >= CONVERT(date,erwo.work_plan_time)</if>
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if> <if test="workDownMachine != null and workDownMachine != ''"> and erwo.work_down_machine = #{workDownMachine}</if>
<if test="workPlanDownTimeStart != null "> and CONVERT(date,work_plan_down_time) >= #{workPlanDownTimeStart}</if>
<if test="workPlanDownTimeEnd != null "> and #{workPlanDownTimeEnd} >= CONVERT(date,erwo.work_plan_down_time)</if>
<!--维修人员 维修组--> <!--维修人员 维修组-->
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if> <if test="workPerson != null and workPerson != ''"> and erwo.work_person like concat('%', #{workPerson}, '%')</if>
<if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if> <if test="workTeam != null and workTeam != ''"> and erwo.work_team like concat('%', #{workTeam}, '%')</if>
<!--是否委外 委外工单编码--> <!--是否委外 委外工单编码-->
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if> <if test="workOutsource != null and workOutsource != ''"> and erwo.work_outsource = #{workOutsource}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if> <if test="outWorkCode != null and outWorkCode != ''"> and erwo.out_work_code like concat('%', #{outWorkCode}, '%')</if>
<!--故障原因 维修开始时间 维修结束时间 花费时间 费用 维修状态 --> <!--故障原因 维修开始时间 维修结束时间 花费时间 费用 维修状态 -->
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if> <if test="workReason != null and workReason != ''"> and erwo.work_reason = #{workReason}</if>
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if> <if test="workStartTime != null "> and erwo.work_start_time = #{workStartTime}</if>
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if> <if test="workEndTime != null "> and erwo.work_end_time = #{workEndTime}</if>
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if> <if test="workCostTime != null "> and erwo.work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if> <if test="workCost != null and workCost != ''"> and erwo.work_cost = #{workCost}</if>
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if> <if test="workStatus != null and workStatus != ''"> and erwo.work_status = #{workStatus}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and erwo.factory_code = #{factoryCode}</if>
<!--没有用上--> <!--没有用上-->
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if> <if test="workHandle != null and workHandle != ''"> and erwo.work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if> <if test="orderRelevance != null and orderRelevance != ''"> and erwo.order_relevance = #{orderRelevance}</if>
and del_flag = '0' and erwo.del_flag = '0'
</where> </where>
ORDER BY create_time DESC ORDER BY erwo.create_time DESC
</select> </select>
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult"> <select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
@ -133,10 +175,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.order_source, ero.order_source,
ero.order_time, ero.order_time,
ero.order_repairman, ero.order_repairman,
ero.order_connection ero.order_connection,
eow.work_person AS outSourcePerson,
eow.work_outsourcing_unit AS workOutsourcingUnit,
eow.work_connection AS workConnection,
eow.work_reason AS outSourceReason
from equ_repair_work_order erwo from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_repair_order ero on erwo.order_code = ero.order_code left join equ_repair_order ero on erwo.order_code = ero.order_code
left join equ_outsource_work eow on erwo.out_work_code = eow.work_code
where erwo.work_id = #{workId} where erwo.work_id = #{workId}
and erwo.del_flag = '0' and erwo.del_flag = '0'
ORDER BY create_time DESC ORDER BY create_time DESC
@ -220,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderCode != null">order_code = #{orderCode},</if> <if test="orderCode != null">order_code = #{orderCode},</if>
<if test="workHandle != null">work_handle = #{workHandle},</if> <if test="workHandle != null">work_handle = #{workHandle},</if>
<if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if> <if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if>
<if test="workPlanDownTime != null">work_plan_down_time = #{workPlanDownTime},</if> work_plan_down_time = #{workPlanDownTime},
<if test="orderRelevance != null">order_relevance = #{orderRelevance},</if> <if test="orderRelevance != null">order_relevance = #{orderRelevance},</if>
<if test="workPerson != null">work_person = #{workPerson},</if> <if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workTeam != null">work_team = #{workTeam},</if> <if test="workTeam != null">work_team = #{workTeam},</if>

@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult"> <select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/> <include refid="selectEquTeamVo"/>
where id = #{id} where id = #{id}
where del_flag = '0' and del_flag = '0'
</select> </select>
<insert id="insertEquTeam" parameterType="EquTeam"> <insert id="insertEquTeam" parameterType="EquTeam">
@ -98,4 +98,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="getMaintenanceTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/>
where del_flag = '0'
and team_type = '维修班组'
</select>
</mapper> </mapper>
Loading…
Cancel
Save