相关bug修改

master
anthonywj 2 years ago
parent ba410331a5
commit a9fd3f2c2b

@ -267,13 +267,16 @@ public class InvWarehouseController extends BaseController {
if (invWarehouseEntity.getId() == null) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
InvWarehouseEntity originEntity = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getCode());
Integer userCount = warehouseUserService.countUserBySubInvCode(invWarehouseEntity.getCode());
if (userCount > 0) {
return ResultVOUtils.error(500, "修改失败,请先移除该仓库关联用户!");
if (!originEntity.getParentId().equals(invWarehouseEntity.getParentId()) || !originEntity.getParentCode().equals(invWarehouseEntity.getParentCode())) {
Integer userCount = warehouseUserService.countUserBySubInvCode(invWarehouseEntity.getCode());
if (userCount > 0) {
return ResultVOUtils.error(500, "修改部门或上级仓库时,请先移除该仓库关联用户!");
}
}
// 先判断是否有相同名字的仓库
boolean checkResult = invWarehouseService.checkDuplicateName(invWarehouseEntity.getParentId(), invWarehouseEntity.getName());
boolean checkResult = invWarehouseService.updateCheckExit(invWarehouseEntity);
if (checkResult) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "仓库名称重复!");
}

@ -66,7 +66,7 @@ public class BasicBusTypeChangeController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean result = basicBusTypeChangeService.verifyExists(basicBusTypeChangeEntity);
boolean result = basicBusTypeChangeService.insertVerifyExists(basicBusTypeChangeEntity);
if (result) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "重复添加");
}

@ -57,6 +57,9 @@ public class ioCodeRelController {
if (StrUtil.isNotEmpty(code)) {
UdiEntity udiEntity = FilterUdiUtils.getGS1Udi(code);
if (udiEntity == null) {
return ResultVOUtils.error(500, "UDI码格式错误");
}
UdiProductEntity udiProductEntity = udiProductService.findByNameCode(udiEntity.getUdi());
if (udiProductEntity.getPackLevel() != null) {
if (Integer.valueOf(udiProductEntity.getPackLevel()) > 1) {

@ -1,5 +1,6 @@
package com.glxp.api.controller.inv;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum;
@ -78,6 +79,8 @@ public class InvPlaceController {
@GetMapping("/spms/inv/product/getInvProductInfo")
private BaseResponse getInvProductInfo(FilterInvPlaceRequest filterInvPlaceRequest) {
List<InvPlaceDetailResponse> list = invPlaceService.getInvProductInfo(filterInvPlaceRequest);
if (CollUtil.isEmpty(list))
return ResultVOUtils.error(500, "库存未找到产品信息!");
return ResultVOUtils.success(list);
}

@ -13,7 +13,7 @@ import java.util.List;
public interface InvWarehouseService extends IService<InvWarehouseEntity> {
InvWarehouseEntity getByWareId( String id);
InvWarehouseEntity getByWareId(String id);
List<InvWarehouseEntity> getByWarePcode(@Param("parentCode") String parentCode);
@ -42,6 +42,8 @@ public interface InvWarehouseService extends IService<InvWarehouseEntity> {
public boolean checkDuplicateName(String parentId, String name);
boolean updateCheckExit(InvWarehouseEntity invWarehouseEntity);
/**
*
*

@ -149,6 +149,12 @@ public class InvWarehouseServiceImpl extends ServiceImpl<InvWarehouseDao, InvWar
return false;
}
@Override
public boolean updateCheckExit(InvWarehouseEntity invWarehouseEntity) {
return invWarehouseDao.exists(new QueryWrapper<InvWarehouseEntity>().eq("parentId", invWarehouseEntity.getParentId())
.eq("name", invWarehouseEntity.getName()).ne("id", invWarehouseEntity.getId()));
}
@Override
public String getSubInvName(String subInvCode) {
if (StrUtil.isBlank(subInvCode)) {

@ -56,4 +56,8 @@ public interface IBasicBusTypeChangeService extends IService<BasicBusTypeChangeE
List<BasicBusTypeChangeEntity> findByLastTime(Date lastUpdateTime);
boolean insertVerifyExists(BasicBusTypeChangeEntity basicBusTypeChangeEntity);
}

@ -68,19 +68,17 @@ public class BasicBusTypeChangeServiceImpl extends ServiceImpl<BasicBusTypeChang
wrapper.eq("originAction", basicBusTypeChangeEntity.getOriginAction())
.eq("targetAction", basicBusTypeChangeEntity.getTargetAction())
.eq("originName", basicBusTypeChangeEntity.getOriginName()).ne("id", basicBusTypeChangeEntity.getId());
List<BasicBusTypeChangeEntity> list = basicBusTypeChangeDao.selectList(wrapper);
if (CollUtil.isNotEmpty(list)) {
if (null != basicBusTypeChangeEntity.getId()) {
for (BasicBusTypeChangeEntity busTypeChangeEntity : list) {
if (busTypeChangeEntity.getId() != basicBusTypeChangeEntity.getId()) {
return true;
}
}
} else {
return true;
}
}
return false;
return basicBusTypeChangeDao.exists(wrapper);
}
@Override
public boolean insertVerifyExists(BasicBusTypeChangeEntity basicBusTypeChangeEntity) {
QueryWrapper<BasicBusTypeChangeEntity> wrapper = new QueryWrapper<>();
wrapper.eq("originAction", basicBusTypeChangeEntity.getOriginAction())
.eq("targetAction", basicBusTypeChangeEntity.getTargetAction())
.eq("originName", basicBusTypeChangeEntity.getOriginName());
return basicBusTypeChangeDao.exists(wrapper);
}
@Override

Loading…
Cancel
Save