修改:能够对供应端的管理人员修改的支持

This commit is contained in:
tiezx 2025-07-17 12:56:33 +08:00
parent b94f223861
commit 7ff2ed6246

View File

@ -6,18 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import net.ferrum.business.domain.QsSupplier;
import net.ferrum.business.domain.QsUserSupplier;
import net.ferrum.business.domain.bo.QsSupplierBo;
import net.ferrum.business.domain.vo.QsSupplierVo;
import net.ferrum.business.domain.vo.QsUserSupplierVo;
import net.ferrum.business.mapper.QsSupplierMapper;
import net.ferrum.business.mapper.QsUserSupplierMapper;
import net.ferrum.business.service.IQsSupplierService;
import net.ferrum.common.core.domain.PageQuery;
import net.ferrum.common.core.page.TableDataInfo;
import net.ferrum.common.utils.StringUtils;
import net.ferrum.system.domain.SysUserRole;
import net.ferrum.system.domain.vo.SysUserBasicInfoVo;
import net.ferrum.system.mapper.SysUserMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -48,14 +52,16 @@ public class QsSupplierServiceImpl implements IQsSupplierService {
@Override
public QsSupplierVo queryById(Long supplierId){
QsSupplierVo result = supplierMapper.selectVoById(supplierId);
List<QsUserSupplier> relations = userSupplierMapper.selectList(new LambdaQueryWrapper<QsUserSupplier>().eq(QsUserSupplier::getSupplierId, supplierId));
List<SysUserBasicInfoVo> userInfos = new ArrayList<>();
if (!CollectionUtils.isEmpty(relations)) {
relations.forEach(relation -> {
userInfos.add(userMapper.selectUserBasicInfoById(relation.getUserId()));
});
}
result.setDockerUsers(userInfos);
List<QsUserSupplierVo> relations = userSupplierMapper.selectUsersbySupplierId(supplierId);
// List<QsUserSupplier> relations = userSupplierMapper.selectList(new LambdaQueryWrapper<QsUserSupplier>().eq(QsUserSupplier::getSupplierId, supplierId));
// List<SysUserBasicInfoVo> userInfos = new ArrayList<>();
// if (!CollectionUtils.isEmpty(relations)) {
// relations.forEach(relation -> {
// userInfos.add(userMapper.selectUserBasicInfoById(relation.getUserId()));
// });
// }
// result.setDockerUsers(userInfos);
result.setDockerUsers(relations);
return result;
}
@ -66,6 +72,7 @@ public class QsSupplierServiceImpl implements IQsSupplierService {
public TableDataInfo<QsSupplierVo> queryPageList(QsSupplierBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<QsSupplier> lqw = buildQueryWrapper(bo);
Page<QsSupplierVo> result = supplierMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@ -141,7 +148,13 @@ public class QsSupplierServiceImpl implements IQsSupplierService {
public Boolean claimSuppliers(Collection<Long> supplierIds, Long userId) {
List<QsUserSupplier> relations = new ArrayList<>(0);
supplierIds.forEach(id -> {
relations.add(new QsUserSupplier(userId, id));
//relations.add(new QsUserSupplier(userId, id));
QsUserSupplier t = new QsUserSupplier();
t.setUserId(userId);
t.setSupplierId(id);
relations.add(t);
});
return userSupplierMapper.insertBatch(relations);
}
@ -150,7 +163,12 @@ public class QsSupplierServiceImpl implements IQsSupplierService {
public Boolean resignSuppliers(Collection<Long> userIds, Long supplierId) {
List<QsUserSupplier> relations = new ArrayList<>(0);
userIds.forEach(id -> {
relations.add(new QsUserSupplier(id, supplierId));
//relations.add(new QsUserSupplier(id, supplierId));
QsUserSupplier t = new QsUserSupplier();
t.setUserId(id);
t.setSupplierId(supplierId);
relations.add(t);
});
return userSupplierMapper.insertBatch(relations);
}