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