1.修改查询仓库重名逻辑

2.修复第三方产品ID查询条件无效问题
master
x_z 3 years ago
parent 5ed0e12151
commit 4173a640d7

@ -82,6 +82,7 @@ public class UdiInfoService {
.like(StrUtil.isNotBlank(filterUdiInfoRequest.getUuid()), "uuid", filterUdiInfoRequest.getUuid())
.eq(StrUtil.isNotBlank(filterUdiInfoRequest.getCustomerId()), "customerId", filterUdiInfoRequest.getCustomerId())
.eq(null != filterUdiInfoRequest.getDiType(), "diType", filterUdiInfoRequest.getDiType())
.like(StrUtil.isNotBlank(filterUdiInfoRequest.getThirdId()),"thirdId", filterUdiInfoRequest.getThirdId())
.groupBy("uuid").orderByDesc("lastUpdateTime");
return wrapper;
}

@ -177,18 +177,29 @@ public class InvWarehouseService {
*/
public boolean checkNameExist(String name, String customerId, String 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;
} else if (count == 0 && StrUtil.isBlank(code)) {
return false;
} else if (count == 0 && StrUtil.isNotBlank(code)) {
return false;
wrapper.select("code").eq("name", name)
.eq("customerId", customerId);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseDao.selectList(wrapper);
if (StrUtil.isNotBlank(code)) {
//编辑校验若总数为0则表示没有重复总数 > 0,判断与仓库码是否相同,不同则重复
if (invWarehouseEntities.size() == 0) {
return false;
} else {
for (InvWarehouseEntity invWarehouseEntity : invWarehouseEntities) {
if (!invWarehouseEntity.getCode().equals(code)) {
return true;
}
}
return false;
}
} else {
//新增校验若总数为0则表示没有重复否则为重复
if (invWarehouseEntities.size() == 0) {
return false;
} else {
return true;
}
}
return true;
}
/**

Loading…
Cancel
Save