rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java
@@ -24,7 +24,7 @@ generator.table="man_loc_area_mat_rela"; generator.tableDesc="loc areas mats rela"; generator.packagePath="com.vincent.rsf.server.manager"; generator.packagePath="com.vincent.rsf.server.test"; generator.build(); } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocAreaMatRelaController.java
@@ -122,12 +122,12 @@ if (Objects.isNull(param.getAreaId())) { throw new CoolException("库区不能为空!!"); } if (param.getLocId().isEmpty() || param.getTypeId().isEmpty()) { throw new CoolException("库位类型或库位不能为空!!"); } if (Objects.isNull(param.getGroupId()) || param.getMatnrId().isEmpty()) { throw new CoolException("物料或物料分类不能为空!!"); } // if (Objects.isNull(param.getTypeId()) || Objects.isNull(param.getLocId()) || param.getLocId().isEmpty() || param.getTypeId().isEmpty()) { // throw new CoolException("库位类型或库位不能为空!!"); // } // if (Objects.isNull(param.getGroupId()) || Objects.isNull(param.getMatnrId()) || param.getMatnrId().isEmpty()) { // throw new CoolException("物料或物料分类不能为空!!"); // } return locAreaMatRelaService.binMatnrs(param); } rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/LocAreaMatRela.java
@@ -4,6 +4,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import com.vincent.rsf.server.manager.service.*; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; import java.text.SimpleDateFormat; @@ -160,6 +161,52 @@ // null // 备注 // ); public String getAreaId$(){ WarehouseAreasService service = SpringUtils.getBean(WarehouseAreasService.class); WarehouseAreas warehouseAreas = service.getById(this.areaId); if (!Cools.isEmpty(warehouseAreas)){ return String.valueOf(warehouseAreas.getCode()); } return null; } public String getMatnrId$(){ MatnrService service = SpringUtils.getBean(MatnrService.class); Matnr matnr = service.getById(this.matnrId); if (!Cools.isEmpty(matnr)){ return String.valueOf(matnr.getUnit()); } return null; } public String getGroupId$(){ MatnrGroupService service = SpringUtils.getBean(MatnrGroupService.class); MatnrGroup matnrGroup = service.getById(this.groupId); if (!Cools.isEmpty(matnrGroup)){ return String.valueOf(matnrGroup.getCode()); } return null; } public String getLocTypeId$(){ LocTypeService service = SpringUtils.getBean(LocTypeService.class); LocType locType = service.getById(this.locTypeId); if (!Cools.isEmpty(locType)){ return String.valueOf(locType.getName()); } return null; } public String getLocId$(){ LocService service = SpringUtils.getBean(LocService.class); Loc loc = service.getById(this.locId); if (!Cools.isEmpty(loc)){ return String.valueOf(loc.getWarehouseId()); } return null; } public String getStatus$(){ if (null == this.status){ return null; } switch (this.status){ rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocAreaMatRelaServiceImpl.java
@@ -51,7 +51,7 @@ } matnrIds.addAll(list); } if (!param.getMatnrId().isEmpty()) { if (!Objects.isNull(param.getMatnrId()) && !param.getMatnrId().isEmpty()) { List<Matnr> matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>() .select(Matnr::getId, Matnr::getGroupId) .in(Matnr::getId, param.getMatnrId())); @@ -61,7 +61,7 @@ matnrIds.addAll(matnrs); } List<LocAreaMatRela> locAreaMatRelas = new ArrayList<>(); if (!param.getTypeId().isEmpty()) { if (!Objects.isNull(param.getTypeId()) && !param.getTypeId().isEmpty()) { for (Long typeId : param.getTypeId()) { List<LocTypeRela> list = locTypeRelaService.list(new LambdaQueryWrapper<LocTypeRela>() .select(LocTypeRela::getLocId).eq(LocTypeRela::getTypeId, typeId)); @@ -84,8 +84,8 @@ } } if (!param.getLocId().isEmpty()) { List<LocTypeRela> list = locTypeRelaService.list(new LambdaQueryWrapper<LocTypeRela>().in(LocTypeRela::getLocId, param.getTypeId()).select(LocTypeRela::getTypeId, LocTypeRela::getLocId)); if (!Objects.isNull(param.getLocId()) && !param.getLocId().isEmpty()) { List<LocTypeRela> list = locTypeRelaService.list(new LambdaQueryWrapper<LocTypeRela>().in(LocTypeRela::getLocId, param.getLocId()).select(LocTypeRela::getTypeId, LocTypeRela::getLocId)); if (list.isEmpty()) { throw new CoolException("数据错误:库位未绑定库位类型!!"); } rsf-server/src/main/resources/mapper/test/LocAreaMatRelaMapper.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.vincent.rsf.server.test.mapper.LocAreaMatRelaMapper"> </mapper>