diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/DeviceRepairOrder.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/DeviceRepairOrder.java new file mode 100644 index 00000000..033f36dc --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/DeviceRepairOrder.java @@ -0,0 +1,461 @@ +package com.op.system.api.domain.device; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +import java.util.Date; + +public class DeviceRepairOrder extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String orderId; + + /** 报修单号 */ + @Excel(name = "报修单号") + private String orderCode; + + /** 设备编码 */ + @Excel(name = "设备编码") + private String equipmentCode; + + /** 故障描述 */ + @Excel(name = "故障描述") + private String orderDesc; + + /** 故障时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "故障时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date orderBreakdownTime; + + /** 报修来源 */ + @Excel(name = "报修来源") + private String orderSource; + + /** 报修时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "报修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date orderTime; + + /** 是否立即处理 */ + @Excel(name = "是否立即处理") + private String orderHandle; + + /** 报修人编号 */ + @Excel(name = "报修人编号") + private String orderRepairmanCode; + + /** 报修人名字 */ + @Excel(name = "报修人名字") + private String orderRepairmanName; + + /** 联系方式 */ + @Excel(name = "联系方式") + private String orderConnection; + + /** 处理状态 */ + @Excel(name = "处理状态") + private String orderStatus; + + /** 关联计划 */ + @Excel(name = "关联计划") + private String orderRelevance; + + /** 故障图片 */ + @Excel(name = "故障图片") + private String orderPicture; + + /** 备用字段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; + + //设备 + /** 设备类型名称 */ + @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 createBy; + + /** 报修后去向 */ + @Excel(name = "报修去向") + private String repairDestination; + + /** 计划维修时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date workPlanTime; + + /** 计划停机时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date workPlanDownTime; + + /** 是否停机维修 */ + @Excel(name = "是否停机维修") + private String workDownMachine; + + /** 维修人员 */ + @Excel(name = "维修人员") + private String workPerson; + + /** 维修组 */ + @Excel(name = "维修组") + private String workTeam; + + + //委外 + /** 主键 */ + private String workId; + + /** 委外工单编码 */ + @Excel(name = "委外工单编码") + private String workCode; + + /** 维修人员 */ + @Excel(name = "委外维修人员") + private String outSourcePerson; + + /** 委外单位 */ + @Excel(name = "委外单位") + private String workOutsourcingUnit; + + /** 联系方式 */ + @Excel(name = "联系方式") + private String workConnection; + + /** 原因 */ + @Excel(name = "原因") + private String outSourceReason; + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getEquipmentCode() { + return equipmentCode; + } + + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getOrderDesc() { + return orderDesc; + } + + public void setOrderDesc(String orderDesc) { + this.orderDesc = orderDesc; + } + + public Date getOrderBreakdownTime() { + return orderBreakdownTime; + } + + public void setOrderBreakdownTime(Date orderBreakdownTime) { + this.orderBreakdownTime = orderBreakdownTime; + } + + public String getOrderSource() { + return orderSource; + } + + public void setOrderSource(String orderSource) { + this.orderSource = orderSource; + } + + public Date getOrderTime() { + return orderTime; + } + + public void setOrderTime(Date orderTime) { + this.orderTime = orderTime; + } + + public String getOrderHandle() { + return orderHandle; + } + + public void setOrderHandle(String orderHandle) { + this.orderHandle = orderHandle; + } + + public String getOrderRepairmanCode() { + return orderRepairmanCode; + } + + public void setOrderRepairmanCode(String orderRepairmanCode) { + this.orderRepairmanCode = orderRepairmanCode; + } + + public String getOrderRepairmanName() { + return orderRepairmanName; + } + + public void setOrderRepairmanName(String orderRepairmanName) { + this.orderRepairmanName = orderRepairmanName; + } + + public String getOrderConnection() { + return orderConnection; + } + + public void setOrderConnection(String orderConnection) { + this.orderConnection = orderConnection; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public String getOrderRelevance() { + return orderRelevance; + } + + public void setOrderRelevance(String orderRelevance) { + this.orderRelevance = orderRelevance; + } + + public String getOrderPicture() { + return orderPicture; + } + + public void setOrderPicture(String orderPicture) { + this.orderPicture = orderPicture; + } + + public String getAttr1() { + return attr1; + } + + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr2() { + return attr2; + } + + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr3() { + return attr3; + } + + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getEquipmentLocation() { + return equipmentLocation; + } + + public void setEquipmentLocation(String equipmentLocation) { + this.equipmentLocation = equipmentLocation; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getEquipmentSpec() { + return equipmentSpec; + } + + public void setEquipmentSpec(String equipmentSpec) { + this.equipmentSpec = equipmentSpec; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + @Override + public String getCreateBy() { + return createBy; + } + + @Override + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getRepairDestination() { + return repairDestination; + } + + public void setRepairDestination(String repairDestination) { + this.repairDestination = repairDestination; + } + + public Date getWorkPlanTime() { + return workPlanTime; + } + + public void setWorkPlanTime(Date workPlanTime) { + this.workPlanTime = workPlanTime; + } + + public Date getWorkPlanDownTime() { + return workPlanDownTime; + } + + public void setWorkPlanDownTime(Date workPlanDownTime) { + this.workPlanDownTime = workPlanDownTime; + } + + public String getWorkDownMachine() { + return workDownMachine; + } + + public void setWorkDownMachine(String workDownMachine) { + this.workDownMachine = workDownMachine; + } + + public String getWorkPerson() { + return workPerson; + } + + public void setWorkPerson(String workPerson) { + this.workPerson = workPerson; + } + + public String getWorkTeam() { + return workTeam; + } + + public void setWorkTeam(String workTeam) { + this.workTeam = workTeam; + } + + public String getWorkId() { + return workId; + } + + public void setWorkId(String workId) { + this.workId = workId; + } + + public String getWorkCode() { + return workCode; + } + + public void setWorkCode(String workCode) { + this.workCode = workCode; + } + + public String getOutSourcePerson() { + return outSourcePerson; + } + + public void setOutSourcePerson(String outSourcePerson) { + this.outSourcePerson = outSourcePerson; + } + + public String getWorkOutsourcingUnit() { + return workOutsourcingUnit; + } + + public void setWorkOutsourcingUnit(String workOutsourcingUnit) { + this.workOutsourcingUnit = workOutsourcingUnit; + } + + public String getWorkConnection() { + return workConnection; + } + + public void setWorkConnection(String workConnection) { + this.workConnection = workConnection; + } + + public String getOutSourceReason() { + return outSourceReason; + } + + public void setOutSourceReason(String outSourceReason) { + this.outSourceReason = outSourceReason; + } +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquRepairOrderDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquRepairOrderDTO.java new file mode 100644 index 00000000..434d1060 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/device/EquRepairOrderDTO.java @@ -0,0 +1,55 @@ +package com.op.system.api.domain.device; + +// 上位机报修DTO +public class EquRepairOrderDTO { + // 设备编码 + private String equipmentCode; + // 工厂数据源 + private String factory; + // 用户账号 + private String userName; + // 用户名称 + private String userNickName; + // 联系方式 + private String phoneNumber; + + public String getUserNickName() { + return userNickName; + } + + public void setUserNickName(String userNickName) { + this.userNickName = userNickName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getFactory() { + return factory; + } + + public void setFactory(String factory) { + this.factory = factory; + } + + public String getEquipmentCode() { + return equipmentCode; + } + + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepController.java index 3e61a08a..e9a6fa97 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepController.java @@ -46,6 +46,16 @@ public class EquUpkeepController extends BaseController { return equUpkeepService.formatEquItem(equPlanEquList); } + /** + * 处理计划设备信息(检查项获取全部) + * @param equPlanEquList + * @return + */ + @PostMapping("/formatEquItemNoCondition") + public AjaxResult formatEquItemNoCondition(@RequestBody List equPlanEquList) { + return equUpkeepService.formatEquItemNoCondition(equPlanEquList); + } + /** * 查询保养计划列表 */ diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java index a630e7d8..ea70141f 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java @@ -131,7 +131,7 @@ public class EquPlan extends BaseEntity { private List planTimeArray; - private List personListVO; + private List personListVO; private String workCenterName; @@ -285,11 +285,11 @@ public class EquPlan extends BaseEntity { this.workCenterName = workCenterName; } - public List getPersonListVO() { + public List getPersonListVO() { return personListVO; } - public void setPersonListVO(List personListVO) { + public void setPersonListVO(List personListVO) { this.personListVO = personListVO; } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/dto/PDADTO.java b/op-modules/op-device/src/main/java/com/op/device/domain/dto/PDADTO.java index 9f07ce35..ee1d6463 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/dto/PDADTO.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/dto/PDADTO.java @@ -2,6 +2,7 @@ package com.op.device.domain.dto; // 手持传参dto public class PDADTO { + // 用户名 private String userId; private String planType; diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/PersonMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/PersonMapper.java index 52d21b23..1da44559 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/PersonMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/PersonMapper.java @@ -19,7 +19,7 @@ public interface PersonMapper { * @return 用户信息 */ @DS("#master") - public SysUser selectSysUserByUserId(Long userId); + public SysUser selectSysUserByUserId(String userId); /** * 查询用户信息列表 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepService.java index 16cbe296..bc6b8ccf 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepService.java @@ -69,4 +69,6 @@ public interface IEquUpkeepService { * @return */ AjaxResult formatEquItem(List equPlanEquList); + + AjaxResult formatEquItemNoCondition(List equPlanEquList); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 74708c60..77e4a4af 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -160,7 +160,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { // 处理人员信息 List personList = new ArrayList<>(); for (String id : users) { - personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id))); + personList.add(personMapper.selectSysUserByUserId(id)); } // 将人员信息置入工单 order.setPersonList(personList); @@ -272,11 +272,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equOrder.setUpdateTime(DateUtils.getNowDate()); equOrder.setUpdateBy(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人 + equOrder.setOrderEnd(DateUtils.getNowDate());// 设置检查时间结束 + equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间开始 if (equOrder.getTimeArray().size() > 0) { equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间 equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间 } - equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间 // 是否存在报修单 boolean checkRepair = false; diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java index 05f59d12..76d2107f 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java @@ -128,11 +128,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { new LinkedBlockingQueue()); try { dateSources.forEach(dateSource -> { - //if("ds_1000".equals(dateSource.get("poolName"))){//TODO生产去掉 logger.info("++++++++++++" + dateSource.get("poolName") + "++++巡检开始++++++++++"); Runnable run = () -> createPatrolCheckPlanFunc(dateSource.get("poolName")); executorService.execute(run); - //} }); } catch (Exception e) { logger.error("service == dataClearTask == exception", e); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index ef1ade0b..02b69d0e 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -104,7 +104,7 @@ public class EquOrderServiceImpl implements IEquOrderService { List personList = new ArrayList<>(); for (String id : users) { - personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id))); + personList.add(personMapper.selectSysUserByUserId(id)); } order.setPersonList(personList); @@ -269,6 +269,7 @@ public class EquOrderServiceImpl implements IEquOrderService { equOrder.setUpdateTime(DateUtils.getNowDate()); equOrder.setUpdateBy(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人 + equOrder.setOrderEnd(DateUtils.getNowDate());// 设置结束时间 if (equOrder.getTimeArray().size() > 0) { equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间 equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java index 46265d98..80d08108 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java @@ -217,7 +217,7 @@ public class EquPlanServiceImpl implements IEquPlanService { equPlanDetailMapper.delEquPlanDetailByPlanCode(equPlan.getPlanCode());// 检查项 equPlanEquMapper.delEquPlanEquByPlanCode(equPlan.getPlanCode());// 设备 equPlanStandardMapper.delEquPlanStandardByPlanCode(equPlan.getPlanCode());// 标准 - equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode());// TODO 备件(没有删除成功?) + equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode());// 备件 } return success(); } @@ -306,9 +306,9 @@ public class EquPlanServiceImpl implements IEquPlanService { List personList = equPlanPersonMapper.selectEquPlanPersonByPlanCode(equPlan.getPlanCode()); // 处理人员信息列表信息用于前端穿梭框信息回填 - List persons = new ArrayList<>(); + List persons = new ArrayList<>(); for (EquPlanPerson person : personList) { - persons.add(person.getUserId()); + persons.add(person.getUserName()); } // 通过计划编码获取设备信息列表 @@ -378,7 +378,7 @@ public class EquPlanServiceImpl implements IEquPlanService { EquPlanPerson equPlanPerson = new EquPlanPerson(); equPlanPerson.setId(IdUtils.fastSimpleUUID());// id - equPlanPerson.setUserId(user.getUserId());// 用户id + equPlanPerson.setUserName(user.getUserName());// 用户名称 equPlanPerson.setPlanCode(equPlan.getPlanCode());// 计划编码 equPlanPerson.setFactoryCode(factory);// 工厂code equPlanPerson.setCreateBy(SecurityContextHolder.getUserName()); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java index 631077cf..5018203a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java @@ -185,7 +185,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService { equOrderPerson.setId(IdUtils.fastSimpleUUID());// id equOrderPerson.setOrderCode(equOrder.getOrderCode());// 工单编码 equOrderPerson.setFactoryCode(factory);// 工厂 - equOrderPerson.setUserId(user.getUserId());// 用户id + equOrderPerson.setUserName(user.getUserName());// 用户名称 equOrderPerson.setCreateBy(SecurityContextHolder.getUserName()); equOrderPerson.setCreateTime(DateUtils.getNowDate()); equOrderPerson.setUpdateBy(SecurityContextHolder.getUserName()); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java index 5c89d49c..62f53359 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java @@ -113,7 +113,13 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { @Override @DS("#header.poolName") public AjaxResult formatEquItem(List equPlanEquList) { - return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!"); + return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",true); + } + + @Override + @DS("#header.poolName") + public AjaxResult formatEquItemNoCondition(List equPlanEquList) { + return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",false); } /** @@ -124,7 +130,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { * @param message * @return */ - private AjaxResult formatEquItemCommon(List equPlanEquList, String planType, String message) { + private AjaxResult formatEquItemCommon(List equPlanEquList, String planType, String message,Boolean check) { for (EquPlanEqu data : equPlanEquList) { // 检查项名称临时对象 @@ -139,7 +145,33 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { // 处理检查项信息 for (EquCheckItem checkItem : equCheckItemList) { // 获取循环周期一致的检查项 - if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) { + if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType()) && check) { + // 创建检查项返回对象 + EquPlanDetail detail = new EquPlanDetail(); + BeanUtils.copyProperties(checkItem, detail); + + if (!detail.getItemCode().isEmpty()) { + // 累加检查项名称(前端信息回显) + itemTempName.append(detail.getItemName()).append(","); + // 通过检查项code获取标准信息列表 + List equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); + // 处理标准信息 + if (equCheckItemList.size() > 0) { + // 创建标准列表返回对象 + List standardList = new ArrayList<>(); + for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { + // 创建标准返回对象 + EquPlanStandard standard = new EquPlanStandard(); + BeanUtils.copyProperties(standardTemp, standard); + + standard.setShowFlag(true);// 设置默认值(用于前端) + standardList.add(standard);// 返回对象添加到返回列表对象 + } + detail.setEquPlanStandardList(standardList);// 标准列表信息置入检查项 + } + } + detailList.add(detail);// 返回对象添加到返回列表对象 + }else { // 创建检查项返回对象 EquPlanDetail detail = new EquPlanDetail(); BeanUtils.copyProperties(checkItem, detail); diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 67861b0f..549eed37 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -140,14 +140,14 @@ diff --git a/op-modules/op-device/src/main/resources/mapper/device/PersonMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/PersonMapper.xml index 48104b06..7bfcd381 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/PersonMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/PersonMapper.xml @@ -43,12 +43,13 @@ and status = #{status} and login_ip = #{loginIp} and login_date = #{loginDate} + and del_flag = '0' - - where user_id = #{userId} + where user_name = #{userId} diff --git a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java index 74c13d74..c3838b60 100644 --- a/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java +++ b/op-modules/op-open/src/main/java/com/op/open/controller/OpenController.java @@ -5,6 +5,7 @@ import com.op.common.core.utils.StringUtils; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.open.service.OpenService; +import com.op.system.api.domain.device.EquRepairOrderDTO; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -70,6 +71,15 @@ public class OpenController extends BaseController { return success(openService.getLGInfo(wcsDTO)); } + /** + * 上位机报修 + * @return + */ + @PostMapping("/machineRepair") + public AjaxResult machineRepair(@RequestBody EquRepairOrderDTO equRepairOrderDTO){ + return openService.machineRepair(equRepairOrderDTO); + } + public static void main(String args[]){ System.out.println(DateUtils.getDate()); } diff --git a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java index c7396d17..9b9106fc 100644 --- a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java +++ b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java @@ -1,6 +1,7 @@ package com.op.open.mapper; import com.op.system.api.domain.SysSapLog; +import com.op.system.api.domain.device.DeviceRepairOrder; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; @@ -46,5 +47,19 @@ public interface OpenMapper { List getSapWorkOrder(String workorderCode); List selectMesReportWorkConsumeList(MesReportWorkConsumeDTO consumeqo); + + /** + * 获取故障报修流水号 + * @return + */ + int selectOrderCodeSerialNumber(); + + /** + * 新增故障报修 + * + * @param equRepairOrder 故障报修 + * @return 结果 + */ + public int insertEquRepairOrder(DeviceRepairOrder equRepairOrder); } diff --git a/op-modules/op-open/src/main/java/com/op/open/service/OpenService.java b/op-modules/op-open/src/main/java/com/op/open/service/OpenService.java index c2a7d3f2..2c631c65 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/OpenService.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/OpenService.java @@ -1,6 +1,8 @@ package com.op.open.service; import com.op.common.core.domain.R; +import com.op.common.core.web.domain.AjaxResult; +import com.op.system.api.domain.device.EquRepairOrderDTO; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; @@ -19,4 +21,6 @@ public interface OpenService { // R reportWork(MesReportWorkDTO mesReportWork); List getLGInfo(WCSDTO wcsDTO); + + AjaxResult machineRepair(EquRepairOrderDTO equRepairOrderDTO); } diff --git a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java index c97ac09d..1e447812 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java @@ -3,14 +3,19 @@ package com.op.open.service.impl; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.security.utils.SecurityUtils; import com.op.open.mapper.OpenMapper; import com.op.open.service.OpenService; import com.op.system.api.RemoteSapService; import com.op.system.api.domain.SysSapLog; +import com.op.system.api.domain.device.DeviceRepairOrder; +import com.op.system.api.domain.device.EquRepairOrderDTO; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDataDTO; import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; @@ -25,7 +30,10 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -35,6 +43,8 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; +import static com.op.common.core.web.domain.AjaxResult.success; + /** * wcs接口业务层处理 * @@ -240,6 +250,34 @@ public class OpenServiceImpl implements OpenService { return openMapper.getLGInfo(wcsDTO); } + @Override + public AjaxResult machineRepair(EquRepairOrderDTO equRepairOrderDTO) { + + DynamicDataSourceContextHolder.push("ds_"+equRepairOrderDTO.getFactory());// 这是数据源的key + + // 创建报修单 + DeviceRepairOrder equRepairOrder = new DeviceRepairOrder(); + // 获取故障报修流水号 + String serialNum = String.format("%03d", openMapper.selectOrderCodeSerialNumber()); + equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+equRepairOrderDTO.getEquipmentCode()+serialNum);// 报修单号 + equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());// id + equRepairOrder.setEquipmentCode(equRepairOrderDTO.getEquipmentCode()); + equRepairOrder.setOrderSource("上位机");// 故障来源 + equRepairOrder.setOrderTime(DateUtils.getNowDate());// 报修时间 + equRepairOrder.setOrderBreakdownTime(DateUtils.getNowDate());// 故障时间 + equRepairOrder.setOrderRepairmanCode(equRepairOrderDTO.getUserName());// 用户账号 + equRepairOrder.setOrderRepairmanName(equRepairOrderDTO.getUserNickName());// 用户名称 + equRepairOrder.setCreateTime(DateUtils.getNowDate()); + equRepairOrder.setCreateBy(equRepairOrderDTO.getUserName()); + equRepairOrder.setOrderStatus("待审核");// 报修单状态 + equRepairOrder.setFactoryCode(equRepairOrderDTO.getFactory());// 工厂 + equRepairOrder.setOrderConnection(equRepairOrderDTO.getPhoneNumber());// 联系方式 + + openMapper.insertEquRepairOrder(equRepairOrder); + + return success(); + } + public static void main(String args[]){ DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate today = LocalDate.now(); diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index ec32eebf..71915875 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -111,15 +111,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from pro_order_workorder where workorder_code = #{workorderCode} + + + + + insert into equ_repair_order + + order_id, + order_code, + equipment_code, + order_desc, + order_breakdown_time, + order_source, + order_time, + order_handle, + order_repairman_code, + order_repairman_name, + 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, + + + #{orderId}, + #{orderCode}, + #{equipmentCode}, + #{orderDesc}, + #{orderBreakdownTime}, + #{orderSource}, + #{orderTime}, + #{orderHandle}, + #{orderRepairmanCode}, + #{orderRepairmanName}, + #{orderConnection}, + #{orderStatus}, + #{orderRelevance}, + #{orderPicture}, + #{attr1}, + #{attr2}, + #{attr3}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{repairDestination}, + + + diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java index 1ee83137..54c29ff6 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java @@ -11,6 +11,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.security.utils.SecurityUtils; import com.op.system.api.domain.SysUser; +import com.op.wms.domain.BaseTeamUser; import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.WmsSparePartsLedger; import com.op.wms.service.IBaseEquipmentService; @@ -230,4 +231,14 @@ public class BaseEquipmentController extends BaseController { return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment)); } + /** + * 查询人员列表 + */ + @GetMapping("/getPersonList") + public TableDataInfo getRepairPersonList(BaseTeamUser baseTeamUser) { + startPage(); + List list = baseEquipmentService.getPersonList(baseTeamUser); + return getDataTable(list); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java index 3aab7b21..05ebd03c 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java @@ -226,13 +226,25 @@ public class BaseEquipment extends BaseEntity { //右侧绑定备件 private List rightData; + //右侧绑定辅助设备 + private List auxiliaryEquipmentRightData; + //返回已经绑定备件列表 private List selectedData; + //返回已经绑定辅助设备列表 + private List selectedEquipmentData; + + public void setSelectedEquipmentData(List selectedEquipmentData) { + this.selectedEquipmentData = selectedEquipmentData; + } + public List getSelectedEquipmentData() { + return selectedEquipmentData; + } + public void setSelectedData(List selectedData) { this.selectedData = selectedData; } - public List getSelectedData() { return selectedData; } @@ -608,6 +620,14 @@ public class BaseEquipment extends BaseEntity { } //右侧的绑定备件 + public void setAuxiliaryEquipmentRightData(List auxiliaryEquipmentRightData) { + this.auxiliaryEquipmentRightData = auxiliaryEquipmentRightData; + } + public List getAuxiliaryEquipmentRightData() { + return auxiliaryEquipmentRightData; + } + + //右侧的绑定辅助设备 public void setRightData(List rightData) { this.rightData = rightData; } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseTeamUser.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseTeamUser.java index 2533d533..23f44053 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseTeamUser.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseTeamUser.java @@ -41,6 +41,9 @@ public class BaseTeamUser extends BaseEntity { @Excel(name = "人员拼接名字") private String teamUserName; + //电话 + private String phonenumber; + public void setId(String id) { this.id = id; } @@ -90,6 +93,14 @@ public class BaseTeamUser extends BaseEntity { this.teamUserName = teamUserName; } + public void setPhonenumber(String phonenumber) { + this.phonenumber = phonenumber; + } + + public String getPhonenumber() { + return phonenumber; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/EquBindAuxiliaryEquipment.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/EquBindAuxiliaryEquipment.java new file mode 100644 index 00000000..5af0a7e3 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/EquBindAuxiliaryEquipment.java @@ -0,0 +1,170 @@ +package com.op.wms.domain; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * 备件设备关联对象 equ_auxiliaryEquipment_equipment + * + * @author Open Platform + * @date 2023-10-24 + */ +public class EquBindAuxiliaryEquipment extends BaseEntity { + private static final long serialVersionUID = 1L; + + //主键 + private String id; + + /** 备件编码 */ + @Excel(name = "备件编码") + private String auxiliaryEquipmentCode; + + /** 备件类型 */ + @Excel(name = "备件类型") + private String auxiliaryEquipmentType; + + /** 备件名称 */ + @Excel(name = "备件名称") + private String auxiliaryEquipmentName; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String equipmentName; + + /** 设备编码 */ + @Excel(name = "设备编码") + private String equipmentCode; + + /** 备用字段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; + + private List rightData; + + public void setRightData(List rightData) { + this.rightData = rightData; + } + + public List getRightData() { + return rightData; + } + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void setAuxiliaryEquipmentCode(String auxiliaryEquipmentCode) { + this.auxiliaryEquipmentCode = auxiliaryEquipmentCode; + } + + public String getAuxiliaryEquipmentCode() { + return auxiliaryEquipmentCode; + } + public void setAuxiliaryEquipmentType(String auxiliaryEquipmentType) { + this.auxiliaryEquipmentType = auxiliaryEquipmentType; + } + + public String getAuxiliaryEquipmentType() { + return auxiliaryEquipmentType; + } + public void setAuxiliaryEquipmentName(String auxiliaryEquipmentName) { + this.auxiliaryEquipmentName = auxiliaryEquipmentName; + } + + public String getAuxiliaryEquipmentName() { + return auxiliaryEquipmentName; + } + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentName() { + return equipmentName; + } + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getEquipmentCode() { + return equipmentCode; + } + 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("id", getId()) + .append("auxiliaryEquipmentCode", getAuxiliaryEquipmentCode()) + .append("auxiliaryEquipmentType", getAuxiliaryEquipmentType()) + .append("auxiliaryEquipmentName", getAuxiliaryEquipmentName()) + .append("equipmentName", getEquipmentName()) + .append("equipmentCode", getEquipmentCode()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .toString(); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java index a2132e72..bd505a4e 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java @@ -5,9 +5,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.domain.BaseFileData; -import com.op.wms.domain.BaseEquipment; -import com.op.wms.domain.EquSpareEquipment; -import com.op.wms.domain.WmsSparePartsLedger; +import com.op.wms.domain.*; import org.apache.ibatis.annotations.Param; /** @@ -110,4 +108,13 @@ public interface BaseEquipmentMapper { //更新设备状态 Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment); + + //绑定辅助设备 + public void bindAuxiliaryEquipment(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment); + + //查询已经绑定的辅助设备 + List getAuxiliaryEquipmentCodeList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment); + + //删除 + void deleteAuxiliaryEquipmentByCode(String equipmentCode); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseTeamUserMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseTeamUserMapper.java index 7360832a..127ead27 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseTeamUserMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseTeamUserMapper.java @@ -73,4 +73,8 @@ public interface BaseTeamUserMapper { //批量删除 public void deleteBaseTeamUserByTeamId(String teamId); void deleteBaseTeamUserByTeamIds(String[] teamIds); + + //人员 + @DS("master") + List getPersonList(BaseTeamUser baseTeamUser); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java index a8562b48..a8180e81 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java @@ -4,6 +4,7 @@ import java.util.List; import com.op.common.core.web.domain.AjaxResult; import com.op.wms.domain.BaseEquipment; +import com.op.wms.domain.BaseTeamUser; import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.WmsSparePartsLedger; @@ -79,4 +80,7 @@ public interface IBaseEquipmentService { //更改设备状态 int updateBaseEquipmentStatus(BaseEquipment baseEquipment); + + //查询人员列表 + List getPersonList(BaseTeamUser baseTeamUser); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java index 472f40a9..47942426 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; +import com.op.wms.mapper.BaseTeamUserMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,6 +45,9 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { @Autowired private BaseEquipmentMapper baseEquipmentMapper; + @Autowired + private BaseTeamUserMapper baseTeamUserMapper; + /** * 查询设备管理 * @@ -100,11 +104,17 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { list.setBarCodeFiles(barcodeFiles); } - //查询备品备件列表 + //查询绑定备品备件列表 EquSpareEquipment equSpareEquipment = new EquSpareEquipment(); equSpareEquipment.setEquipmentCode(list.getEquipmentCode()); List spareCodeList = baseEquipmentMapper.getSpareCodeList(equSpareEquipment); list.setSelectedData(spareCodeList); + + //查询绑定辅助设备 + EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); + equBindAuxiliaryEquipment.setEquipmentCode(list.getEquipmentCode()); + List auxiliaryEquipmentCodeList = baseEquipmentMapper.getAuxiliaryEquipmentCodeList(equBindAuxiliaryEquipment); + list.setSelectedEquipmentData(auxiliaryEquipmentCodeList); return list; } @@ -192,6 +202,7 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { baseEquipmentMapper.insertBaseFileBatch(files3); } + //绑定备件 if(baseEquipment.getRightData().size() >0 ){ List rightSparePartsCodeList = baseEquipment.getRightData(); for(String code :rightSparePartsCodeList){ @@ -205,6 +216,21 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { baseEquipmentMapper.bindSpareParts(equSpareEquipment); } } + + //绑定辅助设备 + if(baseEquipment.getAuxiliaryEquipmentRightData().size() >0 ){ + List auxiliaryEquipmentRightList = baseEquipment.getAuxiliaryEquipmentRightData(); + for(String code :auxiliaryEquipmentRightList){ + EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code); + equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode()); + equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername()); + equBindAuxiliaryEquipment.setCreateTime(DateUtils.getNowDate()); + equBindAuxiliaryEquipment.setId(IdUtils.fastSimpleUUID()); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(baseEquipment.getEquipmentName()); + baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment); + } + } return list; } @@ -299,6 +325,24 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { baseEquipmentMapper.bindSpareParts(equSpareEquipment); } } + + //绑定辅助设备 + //先删除,后绑定 + baseEquipmentMapper.deleteAuxiliaryEquipmentByCode(baseEquipment.getEquipmentCode()); + if(baseEquipment.getAuxiliaryEquipmentRightData().size() > 0 ){ + List auxiliaryEquipmentRightList = baseEquipment.getAuxiliaryEquipmentRightData(); + for(String code :auxiliaryEquipmentRightList){ + EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code); + equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode()); + equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername()); + equBindAuxiliaryEquipment.setCreateTime(DateUtils.getNowDate()); + equBindAuxiliaryEquipment.setId(IdUtils.fastSimpleUUID()); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(baseEquipment.getEquipmentName()); + baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment); + } + } + return list; } @@ -496,4 +540,16 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { return list; } + /** + * 查询人员列表 + * + * @param baseTeamUser + * @return + */ + @Override + @DS("#header.poolName") + public List getPersonList(BaseTeamUser baseTeamUser) { + return baseTeamUserMapper.getPersonList(baseTeamUser); + } + } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index 97f14bfe..10c447e1 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -462,6 +462,38 @@ + + insert into equ_bind_auxiliary_equipment + + id, + auxiliary_equipment_code, + auxiliary_equipment_type, + auxiliary_equipment_name, + equipment_name, + equipment_code, + del_flag, + create_by, + create_time, + update_by, + update_time, + factory_code, + + + #{id}, + #{auxiliaryEquipmentCode}, + #{auxiliaryEquipmentType}, + #{auxiliaryEquipmentName}, + #{equipmentName}, + #{equipmentCode}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + + + INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time,image_type) VALUES @@ -515,6 +547,20 @@ where equipment_code = #{equipmentCode} + + + + delete from equ_bind_auxiliary_equipment where equipment_code = #{equipmentCode} + + + select + user_id AS userId, + user_name AS userName, + nick_name AS nickName, + CONCAT(nick_name,user_name) AS teamUserName, + phonenumber AS phonenumber + from sys_user + + and user_name like concat('%', #{userName}, '%') + and nick_name like concat('%', #{nickName}, '%') + and del_flag = '0' + + + \ No newline at end of file