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 4c1aae93..647e8b73 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 @@ -138,4 +138,7 @@ public interface BaseEquipmentMapper { //查询设备类型(维护在字典中的) List getEquipmentTypeDeptList(BaseEquipment baseEquipment); + + //根据设备名查询设备信息 + BaseEquipment selectBaseEquipmentByEquipmentCode(String code); } 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 6204554c..b8f9b583 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 @@ -235,6 +235,10 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { List auxiliaryEquipmentRightList = baseEquipment.getAuxiliaryEquipmentRightData(); for (String code : auxiliaryEquipmentRightList) { EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); + //查询绑定的名字 设备类型 + BaseEquipment dto = baseEquipmentMapper.selectBaseEquipmentByEquipmentCode(code); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(dto.getEquipmentName()); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentType(dto.getEquipmentTypeCode()); equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code); equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode()); equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername()); @@ -348,6 +352,10 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { for (String code : auxiliaryEquipmentRightList) { EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment(); equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code); + //查询名字 设备类型 + BaseEquipment dto = baseEquipmentMapper.selectBaseEquipmentByEquipmentCode(code); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(dto.getEquipmentName()); + equBindAuxiliaryEquipment.setAuxiliaryEquipmentType(dto.getEquipmentTypeCode()); equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode()); equBindAuxiliaryEquipment.setEquipmentName(baseEquipment.getEquipmentName()); equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername()); 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 49d20be1..2c38add5 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 @@ -222,6 +222,12 @@ and del_flag ='0' + + insert into base_equipment