|
|
|
@ -87,10 +87,11 @@ public class InvWarehouseService {
|
|
|
|
|
if (filterInvWarehouseRequest == null) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
Page<WarehouseUserEntity> page = new Page<>(filterInvWarehouseRequest.getPage(), filterInvWarehouseRequest.getLimit());
|
|
|
|
|
Page<WarehouseUserEntity> pageResult = warehouseUserDao.selectCodeByUser(page, String.valueOf(filterInvWarehouseRequest.getUserId()));
|
|
|
|
|
QueryWrapper<WarehouseUserEntity> wrapper = new QueryWrapper<>();
|
|
|
|
|
wrapper.eq("userId", filterInvWarehouseRequest.getUserId());
|
|
|
|
|
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserDao.selectList(wrapper);
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities = new ArrayList<>();
|
|
|
|
|
for (WarehouseUserEntity warehouseUserEntity : pageResult.getRecords()) {
|
|
|
|
|
for (WarehouseUserEntity warehouseUserEntity : warehouseUserEntities) {
|
|
|
|
|
filterInvWarehouseRequest.setCode(warehouseUserEntity.getCode());
|
|
|
|
|
invWarehouseEntities.addAll(invWarehouseDao.filterGroupInvWarehouse(filterInvWarehouseRequest));
|
|
|
|
|
}
|
|
|
|
@ -175,11 +176,16 @@ public class InvWarehouseService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public boolean checkNameExist(String name, String customerId, String code) {
|
|
|
|
|
if (StrUtil.isBlank(code)) {
|
|
|
|
|
QueryWrapper<InvWarehouseEntity> wrapper = new QueryWrapper<>();
|
|
|
|
|
wrapper.eq(StrUtil.isNotBlank(name), "name", name)
|
|
|
|
|
.eq(StrUtil.isNotBlank(customerId), "customerId", customerId)
|
|
|
|
|
.eq(StrUtil.isNotBlank(code), "code", code);
|
|
|
|
|
long count = invWarehouseDao.selectCount(wrapper);
|
|
|
|
|
if (count == 1 && StrUtil.isNotBlank(code)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
int count = invWarehouseDao.count(name, customerId, code);
|
|
|
|
|
if (count == 1) {
|
|
|
|
|
} else if (count == 0 && StrUtil.isBlank(code)) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if (count == 0 && StrUtil.isNotBlank(code)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|