报修+维修工单

highway
A0010407 1 year ago
parent 08879199ae
commit dd8a332ae6

@ -82,11 +82,20 @@ public class EquRepairOrderController extends BaseController {
*/
@RequiresPermissions("device:faultReport:edit")
@Log(title = "故障报修", businessType = BusinessType.UPDATE)
@PutMapping
@PutMapping("/edit")
public AjaxResult edit(@RequestBody EquRepairOrder equRepairOrder) {
return toAjax(equRepairOrderService.updateEquRepairOrder(equRepairOrder));
}
/**
*
*/
@RequiresPermissions("device:faultReport:check")
@PutMapping("/check")
public AjaxResult check(@RequestBody EquRepairOrder equRepairOrder) {
return toAjax(equRepairOrderService.checkEquRepairOrder(equRepairOrder));
}
/**
*
*/
@ -107,4 +116,15 @@ public class EquRepairOrderController extends BaseController {
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(EquEquipment equEquipment) {
startPage();
List<EquEquipment> list = equRepairOrderService.getEquipmentTypeList(equEquipment);
return getDataTable(list);
}
}

@ -0,0 +1,97 @@
package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.service.IEquRepairWorkOrderService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-10-19
*/
@RestController
@RequestMapping("/repairOrder")
public class EquRepairWorkOrderController extends BaseController {
@Autowired
private IEquRepairWorkOrderService equRepairWorkOrderService;
/**
*
*/
@RequiresPermissions("device:repairOrder:list")
@GetMapping("/list")
public TableDataInfo list(EquRepairWorkOrder equRepairWorkOrder) {
startPage();
List<EquRepairWorkOrder> list = equRepairWorkOrderService.selectEquRepairWorkOrderList(equRepairWorkOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:repairOrder:export")
@Log(title = "维修工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquRepairWorkOrder equRepairWorkOrder) {
List<EquRepairWorkOrder> list = equRepairWorkOrderService.selectEquRepairWorkOrderList(equRepairWorkOrder);
ExcelUtil<EquRepairWorkOrder> util = new ExcelUtil<EquRepairWorkOrder>(EquRepairWorkOrder.class);
util.exportExcel(response, list, "维修工单数据");
}
/**
*
*/
@RequiresPermissions("device:repairOrder:query")
@GetMapping(value = "/{workId}")
public AjaxResult getInfo(@PathVariable("workId") String workId) {
return success(equRepairWorkOrderService.selectEquRepairWorkOrderByWorkId(workId));
}
/**
*
*/
@RequiresPermissions("device:repairOrder:add")
@Log(title = "维修工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return toAjax(equRepairWorkOrderService.insertEquRepairWorkOrder(equRepairWorkOrder));
}
/**
*
*/
@RequiresPermissions("device:repairOrder:edit")
@Log(title = "维修工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return toAjax(equRepairWorkOrderService.updateEquRepairWorkOrder(equRepairWorkOrder));
}
/**
*
*/
@RequiresPermissions("device:repairOrder:remove")
@Log(title = "维修工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{workIds}")
public AjaxResult remove(@PathVariable String[] workIds) {
return toAjax(equRepairWorkOrderService.deleteEquRepairWorkOrderByWorkIds(workIds));
}
}

@ -84,9 +84,121 @@ public class EquRepairOrder extends BaseEntity {
/** 删除标志 */
private String delFlag;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/** 设备位置 */
@Excel(name = "设备位置")
private String equipmentLocation;
/** 部门 */
@Excel(name = "部门")
private String department;
/** 规格型号 */
@Excel(name = "规格型号")
private String equipmentSpec;
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 创建人 */
@Excel(name = "创建人")
private String craeteBy;
private String createBy;
/** 报修后去向 */
@Excel(name = "报修去向")
private String repairDestination;
/** 计划维修时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date workPlanTime;
/** 计划停机时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date workPlanDownTime;
/** 维修人员 */
@Excel(name = "维修人员")
private String workPerson;
/** 维修组 */
@Excel(name = "维修组")
private String workTeam;
public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime;
}
public Date getWorkPlanTime() {
return workPlanTime;
}
public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime;
}
public Date getWorkPlanDownTime() {
return workPlanDownTime;
}
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkPerson() {
return workPerson;
}
public void setWorkTeam(String workTeam) {
this.workTeam = workTeam;
}
public String getWorkTeam() {
return workTeam;
}
public void setRepairDestination(String repairDestination) {
this.repairDestination = repairDestination;
}
public String getRepairDestination() {
return repairDestination;
}
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 getDepartment() {
return department;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
@ -207,12 +319,12 @@ public class EquRepairOrder extends BaseEntity {
public String getDelFlag() {
return delFlag;
}
public void setCraeteBy(String craeteBy) {
this.craeteBy = craeteBy;
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCraeteBy() {
return craeteBy;
public String getCreateBy() {
return createBy;
}
@Override
@ -235,7 +347,7 @@ public class EquRepairOrder extends BaseEntity {
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("craeteBy", getCraeteBy())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())

@ -0,0 +1,306 @@
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_repair_work_order
*
* @author Open Platform
* @date 2023-10-19
*/
public class EquRepairWorkOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String workId;
/** 报修主键 */
@Excel(name = "报修主键")
private String orderId;
/** 报修单号 */
@Excel(name = "报修单号")
private String orderCode;
/** 是否立即处理 */
@Excel(name = "是否立即处理")
private String workHandle;
/** 计划维修时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date workPlanTime;
/** 计划停机时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date workPlanDownTime;
/** 关联计划 */
@Excel(name = "关联计划")
private String orderRelevance;
/** 维修人员 */
@Excel(name = "维修人员")
private String workPerson;
/** 维修组 */
@Excel(name = "维修组")
private String workTeam;
/** 是否委外 */
@Excel(name = "是否委外")
private String workOutsource;
/** 是否停机维修 */
@Excel(name = "是否停机维修")
private String workDownMachine;
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 原因分析 */
@Excel(name = "原因分析")
private String workReason;
/** 故障描述 */
@Excel(name = "故障描述")
private String workFaultDesc;
/** 维修用时 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "维修用时", width = 30, dateFormat = "yyyy-MM-dd")
private Date workCostTime;
/** 维修费用 */
@Excel(name = "维修费用")
private String workCost;
/** 委外工单id */
@Excel(name = "委外工单id")
private String outWorkId;
/** 委外工单编码 */
@Excel(name = "委外工单编码")
private String outWorkCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
private String delFlag;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
public void setWorkId(String workId) {
this.workId = workId;
}
public String getWorkId() {
return workId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setWorkHandle(String workHandle) {
this.workHandle = workHandle;
}
public String getWorkHandle() {
return workHandle;
}
public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime;
}
public Date getWorkPlanTime() {
return workPlanTime;
}
public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime;
}
public Date getWorkPlanDownTime() {
return workPlanDownTime;
}
public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance;
}
public String getOrderRelevance() {
return orderRelevance;
}
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkPerson() {
return workPerson;
}
public void setWorkTeam(String workTeam) {
this.workTeam = workTeam;
}
public String getWorkTeam() {
return workTeam;
}
public void setWorkOutsource(String workOutsource) {
this.workOutsource = workOutsource;
}
public String getWorkOutsource() {
return workOutsource;
}
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkDownMachine() {
return workDownMachine;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setWorkReason(String workReason) {
this.workReason = workReason;
}
public String getWorkReason() {
return workReason;
}
public void setWorkFaultDesc(String workFaultDesc) {
this.workFaultDesc = workFaultDesc;
}
public String getWorkFaultDesc() {
return workFaultDesc;
}
public void setWorkCostTime(Date workCostTime) {
this.workCostTime = workCostTime;
}
public Date getWorkCostTime() {
return workCostTime;
}
public void setWorkCost(String workCost) {
this.workCost = workCost;
}
public String getWorkCost() {
return workCost;
}
public void setOutWorkId(String outWorkId) {
this.outWorkId = outWorkId;
}
public String getOutWorkId() {
return outWorkId;
}
public void setOutWorkCode(String outWorkCode) {
this.outWorkCode = outWorkCode;
}
public String getOutWorkCode() {
return outWorkCode;
}
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;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("workId", getWorkId())
.append("orderId", getOrderId())
.append("orderCode", getOrderCode())
.append("workHandle", getWorkHandle())
.append("workPlanTime", getWorkPlanTime())
.append("workPlanDownTime", getWorkPlanDownTime())
.append("orderRelevance", getOrderRelevance())
.append("workPerson", getWorkPerson())
.append("workTeam", getWorkTeam())
.append("workOutsource", getWorkOutsource())
.append("workDownMachine", getWorkDownMachine())
.append("equipmentCode", getEquipmentCode())
.append("workReason", getWorkReason())
.append("workFaultDesc", getWorkFaultDesc())
.append("workCostTime", getWorkCostTime())
.append("workCost", getWorkCost())
.append("outWorkId", getOutWorkId())
.append("outWorkCode", getOutWorkCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("delFlag", getDelFlag())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -58,4 +58,7 @@ public interface EquEquipmentMapper {
* @return
*/
public int deleteEquEquipmentByEquipmentIds(Long[] equipmentIds);
//查询设备类型
List<EquEquipment> getEquipmentTypeList(EquEquipment equEquipment);
}

@ -57,4 +57,10 @@ public interface EquRepairOrderMapper {
* @return
*/
public int deleteEquRepairOrderByOrderIds(String[] orderIds);
/**
*
* @return
*/
int selectSerialNumber();
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquRepairWorkOrder;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-19
*/
public interface EquRepairWorkOrderMapper {
/**
*
*
* @param workId
* @return
*/
public EquRepairWorkOrder selectEquRepairWorkOrderByWorkId(String workId);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param workId
* @return
*/
public int deleteEquRepairWorkOrderByWorkId(String workId);
/**
*
*
* @param workIds
* @return
*/
public int deleteEquRepairWorkOrderByWorkIds(String[] workIds);
}

@ -5,6 +5,7 @@ import java.util.List;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.EquRepairWorkOrder;
/**
* Service
@ -68,4 +69,10 @@ public interface IEquRepairOrderService {
* @return
*/
List<EquEquipment> selectEquEquipmentList(EquEquipment equEquipment);
//查询设备类型
List<EquEquipment> getEquipmentTypeList(EquEquipment equEquipment);
//审核
public int checkEquRepairOrder(EquRepairOrder equRepairOrder);
}

@ -0,0 +1,60 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquRepairWorkOrder;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
public interface IEquRepairWorkOrderService {
/**
*
*
* @param workId
* @return
*/
public EquRepairWorkOrder selectEquRepairWorkOrderByWorkId(String workId);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param workIds
* @return
*/
public int deleteEquRepairWorkOrderByWorkIds(String[] workIds);
/**
*
*
* @param workId
* @return
*/
public int deleteEquRepairWorkOrderByWorkId(String workId);
}

@ -4,8 +4,12 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.mapper.EquEquipmentMapper;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairOrderMapper;
@ -26,6 +30,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Autowired
private EquEquipmentMapper equEquipmentMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/**
*
*
@ -51,7 +58,7 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
}
/**
*
* PC
*
* @param equRepairOrder
* @return
@ -59,7 +66,14 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public int insertEquRepairOrder(EquRepairOrder equRepairOrder) {
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
// 获取故障报修流水号
String serialNum = String.format("%03d", equRepairOrderMapper.selectSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equRepairOrder.setOrderCode(DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核");
return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
@ -71,8 +85,51 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
*/
@Override
@DS("#header.poolName")
public int checkEquRepairOrder(EquRepairOrder equRepairOrder) {
if(equRepairOrder.getRepairDestination().equals("计划性维修")){
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
//报修单号
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime());
//是否停机维修
if(equRepairOrder.getWorkPlanTime() != null){
equRepairWorkOrder.setWorkDownMachine("1");
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
}else{
equRepairWorkOrder.setWorkDownMachine("0");
}
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("不维修")){
equRepairOrder.setOrderStatus("驳回");
}else if(equRepairOrder.getRepairDestination().equals("委外维修")){
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){
//立即维修
equRepairOrder.setOrderStatus("审核通过");
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
equRepairOrder.setUpdateBy(SecurityUtils.getUsername());
return equRepairOrderMapper.updateEquRepairOrder(equRepairOrder);
}
/**
*
*
* @param equRepairOrder
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquRepairOrder(EquRepairOrder equRepairOrder) {
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
equRepairOrder.setUpdateBy(SecurityUtils.getUsername());
return equRepairOrderMapper.updateEquRepairOrder(equRepairOrder);
}
@ -103,12 +160,24 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
/**
*
*
* @param equEquipment
* @return
* @param equEquipment
* @return
*/
@Override
@DS("#header.poolName")
public List<EquEquipment> selectEquEquipmentList(EquEquipment equEquipment) {
return equEquipmentMapper.selectEquEquipmentList(equEquipment);
}
/**
*
*
* @param equEquipment
* @return
*/
@Override
@DS("#header.poolName")
public List<EquEquipment> getEquipmentTypeList(EquEquipment equEquipment) {
return equEquipmentMapper.getEquipmentTypeList(equEquipment);
}
}

@ -0,0 +1,97 @@
package com.op.device.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.service.IEquRepairWorkOrderService;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
@Service
public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService {
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/**
*
*
* @param workId
* @return
*/
@Override
@DS("#header.poolName")
public EquRepairWorkOrder selectEquRepairWorkOrderByWorkId(String workId) {
return equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder) {
return equRepairWorkOrderMapper.selectEquRepairWorkOrderList(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
return equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
}
/**
*
*
* @param workIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquRepairWorkOrderByWorkIds(String[] workIds) {
return equRepairWorkOrderMapper.deleteEquRepairWorkOrderByWorkIds(workIds);
}
/**
*
*
* @param workId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquRepairWorkOrderByWorkId(String workId) {
return equRepairWorkOrderMapper.deleteEquRepairWorkOrderByWorkId(workId);
}
}

@ -239,4 +239,12 @@
#{equipmentId}
</foreach>
</delete>
<select id="getEquipmentTypeList" parameterType="EquEquipment" resultMap="EquEquipmentResult">
select equipment_type_code,equipment_type_name
from base_equipment
where del_flag = '0'
group by equipment_type_code,equipment_type_name
</select>
</mapper>

@ -22,14 +22,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="craeteBy" column="craete_by" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="repairDestination" column="repair_destination" />
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentName" column="equipment_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
<result property="equipmentSpec" column="equipment_spec" />
</resultMap>
<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, craete_by, create_time, update_by, update_time 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,repair_destination from equ_repair_order
</sql>
<select id="selectEquRepairOrderList" parameterType="EquRepairOrder" resultMap="EquRepairOrderResult">
@ -50,15 +57,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if test="craeteBy != null and craeteBy != ''"> and craete_by = #{craeteBy}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if>
and del_flag = '0'
</where>
</select>
<select id="selectEquRepairOrderByOrderId" parameterType="String" resultMap="EquRepairOrderResult">
<include refid="selectEquRepairOrderVo"/>
where order_id = #{orderId}
and del_flag = '0'
select
ero.order_id,
ero.order_code,
ero.equipment_code,
ero.order_desc,
ero.order_breakdown_time,
ero.order_source,
ero.order_time,
ero.order_handle,
ero.order_repairman,
ero.order_connection,
ero.order_status,
ero.order_relevance,
ero.order_picture,
ero.create_by,
ero.create_time,
ero.update_by,
ero.update_time,
ero.repair_destination,
be.equipment_name,
be.equipment_type_name,
be.equipment_spec,
be.department,
be.equipment_location
from equ_repair_order ero
left join base_equipment be on ero.equipment_code = be.equipment_code
where ero.order_id = #{orderId}
and ero.del_flag = '0'
</select>
<insert id="insertEquRepairOrder" parameterType="EquRepairOrder">
@ -81,10 +114,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null">del_flag,</if>
<if test="craeteBy != null">craete_by,</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>
<if test="repairDestination != null">repair_destination,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
@ -104,10 +138,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="craeteBy != null">#{craeteBy},</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>
<if test="repairDestination != null">#{repairDestination},</if>
</trim>
</insert>
@ -130,10 +165,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="craeteBy != null">craete_by = #{craeteBy},</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>
<if test="repairDestination != null">repair_destination = #{repairDestination},</if>
</trim>
where order_id = #{orderId}
</update>
@ -149,4 +185,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(order_id)+1 AS serialNum
FROM equ_repair_order
WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time)
and del_flag = '0'
</select>
</mapper>

@ -0,0 +1,178 @@
<?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.EquRepairWorkOrderMapper">
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
<result property="workId" column="work_id" />
<result property="orderId" column="order_id" />
<result property="orderCode" column="order_code" />
<result property="workHandle" column="work_handle" />
<result property="workPlanTime" column="work_plan_time" />
<result property="workPlanDownTime" column="work_plan_down_time" />
<result property="orderRelevance" column="order_relevance" />
<result property="workPerson" column="work_person" />
<result property="workTeam" column="work_team" />
<result property="workOutsource" column="work_outsource" />
<result property="workDownMachine" column="work_down_machine" />
<result property="equipmentCode" column="equipment_code" />
<result property="workReason" column="work_reason" />
<result property="workFaultDesc" column="work_fault_desc" />
<result property="workCostTime" column="work_cost_time" />
<result property="workCost" column="work_cost" />
<result property="outWorkId" column="out_work_id" />
<result property="outWorkCode" column="out_work_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_code, work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_cost_time, work_cost, out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
</sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/>
<where>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if>
<if test="workTeam != null and workTeam != ''"> and work_team = #{workTeam}</if>
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="outWorkId != null and outWorkId != ''"> and out_work_id = #{outWorkId}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</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>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/>
where work_id = #{workId}
</select>
<insert id="insertEquRepairWorkOrder" parameterType="EquRepairWorkOrder">
insert into equ_repair_work_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workId != null">work_id,</if>
<if test="orderId != null">order_id,</if>
<if test="orderCode != null">order_code,</if>
<if test="workHandle != null">work_handle,</if>
<if test="workPlanTime != null">work_plan_time,</if>
<if test="workPlanDownTime != null">work_plan_down_time,</if>
<if test="orderRelevance != null">order_relevance,</if>
<if test="workPerson != null">work_person,</if>
<if test="workTeam != null">work_team,</if>
<if test="workOutsource != null">work_outsource,</if>
<if test="workDownMachine != null">work_down_machine,</if>
<if test="equipmentCode != null">equipment_code,</if>
<if test="workReason != null">work_reason,</if>
<if test="workFaultDesc != null">work_fault_desc,</if>
<if test="workCostTime != null">work_cost_time,</if>
<if test="workCost != null">work_cost,</if>
<if test="outWorkId != null">out_work_id,</if>
<if test="outWorkCode != null">out_work_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="workHandle != null">#{workHandle},</if>
<if test="workPlanTime != null">#{workPlanTime},</if>
<if test="workPlanDownTime != null">#{workPlanDownTime},</if>
<if test="orderRelevance != null">#{orderRelevance},</if>
<if test="workPerson != null">#{workPerson},</if>
<if test="workTeam != null">#{workTeam},</if>
<if test="workOutsource != null">#{workOutsource},</if>
<if test="workDownMachine != null">#{workDownMachine},</if>
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="workReason != null">#{workReason},</if>
<if test="workFaultDesc != null">#{workFaultDesc},</if>
<if test="workCostTime != null">#{workCostTime},</if>
<if test="workCost != null">#{workCost},</if>
<if test="outWorkId != null">#{outWorkId},</if>
<if test="outWorkCode != null">#{outWorkCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateEquRepairWorkOrder" parameterType="EquRepairWorkOrder">
update equ_repair_work_order
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="workHandle != null">work_handle = #{workHandle},</if>
<if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if>
<if test="workPlanDownTime != null">work_plan_down_time = #{workPlanDownTime},</if>
<if test="orderRelevance != null">order_relevance = #{orderRelevance},</if>
<if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workTeam != null">work_team = #{workTeam},</if>
<if test="workOutsource != null">work_outsource = #{workOutsource},</if>
<if test="workDownMachine != null">work_down_machine = #{workDownMachine},</if>
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
<if test="workReason != null">work_reason = #{workReason},</if>
<if test="workFaultDesc != null">work_fault_desc = #{workFaultDesc},</if>
<if test="workCostTime != null">work_cost_time = #{workCostTime},</if>
<if test="workCost != null">work_cost = #{workCost},</if>
<if test="outWorkId != null">out_work_id = #{outWorkId},</if>
<if test="outWorkCode != null">out_work_code = #{outWorkCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where work_id = #{workId}
</update>
<delete id="deleteEquRepairWorkOrderByWorkId" parameterType="String">
delete from equ_repair_work_order where work_id = #{workId}
</delete>
<delete id="deleteEquRepairWorkOrderByWorkIds" parameterType="String">
delete from equ_repair_work_order where work_id in
<foreach item="workId" collection="array" open="(" separator="," close=")">
#{workId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save