Merge remote-tracking branch 'origin/master'

orign^2
wws 1 year ago
commit 13bd0c69f5

@ -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<BaseTeamUser> list = baseEquipmentService.getPersonList(baseTeamUser);
return getDataTable(list);
}
}

@ -226,13 +226,25 @@ public class BaseEquipment extends BaseEntity {
//右侧绑定备件
private List<String> rightData;
//右侧绑定辅助设备
private List<String> auxiliaryEquipmentRightData;
//返回已经绑定备件列表
private List<EquSpareEquipment> selectedData;
//返回已经绑定辅助设备列表
private List<EquBindAuxiliaryEquipment> selectedEquipmentData;
public void setSelectedEquipmentData(List<EquBindAuxiliaryEquipment> selectedEquipmentData) {
this.selectedEquipmentData = selectedEquipmentData;
}
public List<EquBindAuxiliaryEquipment> getSelectedEquipmentData() {
return selectedEquipmentData;
}
public void setSelectedData(List<EquSpareEquipment> selectedData) {
this.selectedData = selectedData;
}
public List<EquSpareEquipment> getSelectedData() {
return selectedData;
}
@ -608,6 +620,14 @@ public class BaseEquipment extends BaseEntity {
}
//右侧的绑定备件
public void setAuxiliaryEquipmentRightData(List<String> auxiliaryEquipmentRightData) {
this.auxiliaryEquipmentRightData = auxiliaryEquipmentRightData;
}
public List<String> getAuxiliaryEquipmentRightData() {
return auxiliaryEquipmentRightData;
}
//右侧的绑定辅助设备
public void setRightData(List<String> rightData) {
this.rightData = rightData;
}

@ -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)

@ -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<String> rightData;
public void setRightData(List<String> rightData) {
this.rightData = rightData;
}
public List<String> 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();
}
}

@ -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<EquBindAuxiliaryEquipment> getAuxiliaryEquipmentCodeList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment);
//删除
void deleteAuxiliaryEquipmentByCode(String equipmentCode);
}

@ -73,4 +73,8 @@ public interface BaseTeamUserMapper {
//批量删除
public void deleteBaseTeamUserByTeamId(String teamId);
void deleteBaseTeamUserByTeamIds(String[] teamIds);
//人员
@DS("master")
List<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser);
}

@ -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<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser);
}

@ -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<EquSpareEquipment> spareCodeList = baseEquipmentMapper.getSpareCodeList(equSpareEquipment);
list.setSelectedData(spareCodeList);
//查询绑定辅助设备
EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment();
equBindAuxiliaryEquipment.setEquipmentCode(list.getEquipmentCode());
List<EquBindAuxiliaryEquipment> 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<String> 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<String> 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<String> 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<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser) {
return baseTeamUserMapper.getPersonList(baseTeamUser);
}
}

@ -462,6 +462,38 @@
</trim>
</insert>
<insert id="bindAuxiliaryEquipment" parameterType="com.op.wms.domain.EquBindAuxiliaryEquipment">
insert into equ_bind_auxiliary_equipment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="auxiliaryEquipmentCode != null">auxiliary_equipment_code,</if>
<if test="auxiliaryEquipmentType != null">auxiliary_equipment_type,</if>
<if test="auxiliaryEquipmentName != null">auxiliary_equipment_name,</if>
<if test="equipmentName != null">equipment_name,</if>
<if test="equipmentCode != null">equipment_code,</if>
<if test="delFlag != null">del_flag,</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="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="auxiliaryEquipmentCode != null">#{auxiliaryEquipmentCode},</if>
<if test="auxiliaryEquipmentType != null">#{auxiliaryEquipmentType},</if>
<if test="auxiliaryEquipmentName != null">#{auxiliaryEquipmentName},</if>
<if test="equipmentName != null">#{equipmentName},</if>
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="delFlag != null">#{delFlag},</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="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<insert id="insertBaseFileBatch">
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}
</select>
<select id="getAuxiliaryEquipmentCodeList" parameterType="com.op.wms.domain.EquBindAuxiliaryEquipment" resultType="com.op.wms.domain.EquBindAuxiliaryEquipment">
select
id,
auxiliary_equipment_code AS auxiliaryEquipmentCode,
auxiliary_equipment_name AS auxiliaryEquipmentName
from
equ_bind_auxiliary_equipment
where equipment_code = #{equipmentCode}
</select>
<delete id="deleteAuxiliaryEquipmentByCode" parameterType="String">
delete from equ_bind_auxiliary_equipment where equipment_code = #{equipmentCode}
</delete>
<select id="selectExistByEquipmentCode" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
<include refid="selectBaseEquipmentVo"/>
where equipment_code = #{equipmentCode}

@ -131,4 +131,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="getPersonList" parameterType="BaseTeamUser" resultType="com.op.wms.domain.BaseTeamUser">
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
<where>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
and del_flag = '0'
</where>
</select>
</mapper>
Loading…
Cancel
Save