格式修改
This commit is contained in:
+10
-6
@@ -9,6 +9,8 @@ import com.baiyue.warehouse.service.PalletLocationAllocationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -25,13 +27,15 @@ import java.util.List;
|
||||
@RequestMapping("/internal/warehouse/v1/pallet-locations")
|
||||
@Tag(name = "托盘库位内部接口", description = "内部服务令牌保护的预占、确认和补偿释放")
|
||||
public class InternalPalletLocationController {
|
||||
private final PalletLocationAllocationService service;
|
||||
private final byte[] expectedToken;
|
||||
@Resource
|
||||
private PalletLocationAllocationService service;
|
||||
@Value("${baiyue.security.internal-service-token}")
|
||||
private String internalToken;
|
||||
private byte[] expectedToken;
|
||||
|
||||
public InternalPalletLocationController(PalletLocationAllocationService service,
|
||||
@Value("${baiyue.security.internal-service-token}") String token) {
|
||||
this.service = service;
|
||||
this.expectedToken = token.getBytes(StandardCharsets.UTF_8);
|
||||
@PostConstruct
|
||||
void initializeToken() {
|
||||
this.expectedToken = internalToken.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@PostMapping("/reservations")
|
||||
|
||||
+7
-4
@@ -6,6 +6,7 @@ import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.service.PartnerQueryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -17,11 +18,13 @@ public class InternalPartnerController {
|
||||
@Resource
|
||||
private PartnerQueryService service;
|
||||
|
||||
private final byte[] expected;
|
||||
@Value("${baiyue.security.internal-service-token}")
|
||||
private String internalToken;
|
||||
private byte[] expected;
|
||||
|
||||
public InternalPartnerController(
|
||||
@Value("${baiyue.security.internal-service-token}") String token) {
|
||||
this.expected=token.getBytes(StandardCharsets.UTF_8);
|
||||
@PostConstruct
|
||||
void initializeToken() {
|
||||
this.expected = internalToken.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
@GetMapping("/{tenantId}/{id}/active")
|
||||
public ApiResponse<PartnerEntity> active(@RequestHeader(value="X-Internal-Service-Token",required=false) String token,
|
||||
|
||||
+7
-4
@@ -6,6 +6,7 @@ import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.dto.WarehouseDetailResponse;
|
||||
import com.baiyue.warehouse.service.WarehouseApplicationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -17,11 +18,13 @@ public class InternalWarehouseController {
|
||||
@Resource
|
||||
private WarehouseApplicationService service;
|
||||
|
||||
private final byte[] expected;
|
||||
@Value("${baiyue.security.internal-service-token}")
|
||||
private String internalToken;
|
||||
private byte[] expected;
|
||||
|
||||
public InternalWarehouseController(
|
||||
@Value("${baiyue.security.internal-service-token}") String token) {
|
||||
this.expected = token.getBytes(StandardCharsets.UTF_8);
|
||||
@PostConstruct
|
||||
void initializeToken() {
|
||||
this.expected = internalToken.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
@GetMapping("/{tenantId}/{id}/active")
|
||||
public ApiResponse<WarehouseDetailResponse> active(
|
||||
|
||||
+5
-7
@@ -11,6 +11,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanySaveRequest;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.StatusRequest;
|
||||
import com.baiyue.warehouse.entity.ExpressCompanyEntity;
|
||||
import com.baiyue.warehouse.service.ExpressCompanyQueryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import com.baiyue.warehouse.service.ExpressCompanyImportService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -47,13 +48,10 @@ import java.nio.charset.StandardCharsets;
|
||||
@RestController
|
||||
@RequestMapping("/api/platform/v1/express-companies")
|
||||
public class PlatformExpressCompanyController {
|
||||
private final ExpressCompanyQueryService service;
|
||||
private final ExpressCompanyImportService importService;
|
||||
|
||||
public PlatformExpressCompanyController(ExpressCompanyQueryService service, ExpressCompanyImportService importService) {
|
||||
this.service = service;
|
||||
this.importService = importService;
|
||||
}
|
||||
@Resource
|
||||
private ExpressCompanyQueryService service;
|
||||
@Resource
|
||||
private ExpressCompanyImportService importService;
|
||||
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAuthority('platform:express:list')")
|
||||
|
||||
+3
-5
@@ -11,6 +11,7 @@ import com.baiyue.warehouse.dto.LocationDtos.SaveRequest;
|
||||
import com.baiyue.warehouse.dto.LocationDtos.StatusRequest;
|
||||
import com.baiyue.warehouse.entity.LocationEntity;
|
||||
import com.baiyue.warehouse.service.LocationApplicationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
@@ -41,11 +42,8 @@ import java.util.List;
|
||||
@RequestMapping("/api/platform/v1/locations")
|
||||
@Tag(name = "平台库位管理", description = "按企业租户和仓库数据范围管理库位基础资料")
|
||||
public class PlatformLocationController {
|
||||
private final LocationApplicationService service;
|
||||
|
||||
public PlatformLocationController(LocationApplicationService service) {
|
||||
this.service = service;
|
||||
}
|
||||
@Resource
|
||||
private LocationApplicationService service;
|
||||
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAuthority('platform:location:list')")
|
||||
|
||||
+3
-5
@@ -7,6 +7,7 @@ import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.common.security.AuthenticatedUser;
|
||||
import com.baiyue.warehouse.dto.PalletRequests;
|
||||
import com.baiyue.warehouse.service.PalletApplicationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
@@ -33,11 +34,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/platform/v1/pallets")
|
||||
@Tag(name = "平台托盘管理", description = "按租户和仓库维护托盘主数据")
|
||||
public class PlatformPalletController {
|
||||
private final PalletApplicationService service;
|
||||
|
||||
public PlatformPalletController(PalletApplicationService service) {
|
||||
this.service = service;
|
||||
}
|
||||
@Resource
|
||||
private PalletApplicationService service;
|
||||
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAuthority('platform:pallet:list')")
|
||||
|
||||
+5
-7
@@ -11,6 +11,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.PartnerImportResult;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.StatusRequest;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.service.PlatformPartnerQueryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import com.baiyue.warehouse.service.PartnerImportService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -47,13 +48,10 @@ import java.nio.charset.StandardCharsets;
|
||||
@RestController
|
||||
@RequestMapping("/api/platform/v1/partners")
|
||||
public class PlatformPartnerController {
|
||||
private final PlatformPartnerQueryService service;
|
||||
private final PartnerImportService importService;
|
||||
|
||||
public PlatformPartnerController(PlatformPartnerQueryService service, PartnerImportService importService) {
|
||||
this.service = service;
|
||||
this.importService = importService;
|
||||
}
|
||||
@Resource
|
||||
private PlatformPartnerQueryService service;
|
||||
@Resource
|
||||
private PartnerImportService importService;
|
||||
|
||||
@GetMapping("/import-template")
|
||||
@PreAuthorize("hasAuthority('platform:counterparty:import')")
|
||||
|
||||
+3
-5
@@ -2,6 +2,7 @@ package com.baiyue.warehouse.controller;
|
||||
|
||||
import com.baiyue.common.core.api.ApiResponse;
|
||||
import com.baiyue.warehouse.service.WarehouseSchemaReadinessService;
|
||||
import jakarta.annotation.Resource;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -18,11 +19,8 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/api/platform/v1/warehouses")
|
||||
public class WarehouseHealthController {
|
||||
private final WarehouseSchemaReadinessService readinessService;
|
||||
|
||||
public WarehouseHealthController(WarehouseSchemaReadinessService readinessService) {
|
||||
this.readinessService = readinessService;
|
||||
}
|
||||
@Resource
|
||||
private WarehouseSchemaReadinessService readinessService;
|
||||
|
||||
@Operation(summary = "Get service status / 查询服务状态", description = "Returns the logical status of warehouse-service. / 返回 warehouse-service 的逻辑运行状态。")
|
||||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "200", description = "Service is available / 服务可用")
|
||||
|
||||
+3
-5
@@ -6,17 +6,15 @@ import com.baiyue.common.core.api.PageResult;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanyPageQuery;
|
||||
import com.baiyue.warehouse.entity.ExpressCompanyEntity;
|
||||
import com.baiyue.warehouse.mapper.ExpressCompanyMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/** 快递公司主数据仓储;平台分页租户条件可选,资源读写仍强制租户边界。 */
|
||||
@Repository
|
||||
public class ExpressCompanyRepository {
|
||||
private final ExpressCompanyMapper mapper;
|
||||
|
||||
public ExpressCompanyRepository(ExpressCompanyMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
@Resource
|
||||
private ExpressCompanyMapper mapper;
|
||||
|
||||
public PageResult<ExpressCompanyEntity> page(Long tenantId, ExpressCompanyPageQuery query) {
|
||||
LambdaQueryWrapper<ExpressCompanyEntity> wrapper = new LambdaQueryWrapper<ExpressCompanyEntity>()
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.baiyue.warehouse.mapper.LocationMapper;
|
||||
import com.baiyue.warehouse.mapper.LocationOccupancyMapper;
|
||||
import com.baiyue.warehouse.mapper.LocationReservationMapper;
|
||||
import com.baiyue.warehouse.mapper.WarehouseMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -21,18 +22,14 @@ import java.util.List;
|
||||
/** 库位持久化边界;平台分页条件可选,资源读写继续强制租户、仓库联合条件。 */
|
||||
@Repository
|
||||
public class LocationRepository {
|
||||
private final LocationMapper locations;
|
||||
private final LocationReservationMapper reservations;
|
||||
private final LocationOccupancyMapper occupancies;
|
||||
private final WarehouseMapper warehouses;
|
||||
|
||||
public LocationRepository(LocationMapper locations, LocationReservationMapper reservations,
|
||||
LocationOccupancyMapper occupancies, WarehouseMapper warehouses) {
|
||||
this.locations = locations;
|
||||
this.reservations = reservations;
|
||||
this.occupancies = occupancies;
|
||||
this.warehouses = warehouses;
|
||||
}
|
||||
@Resource
|
||||
private LocationMapper locations;
|
||||
@Resource
|
||||
private LocationReservationMapper reservations;
|
||||
@Resource
|
||||
private LocationOccupancyMapper occupancies;
|
||||
@Resource
|
||||
private WarehouseMapper warehouses;
|
||||
|
||||
public WarehouseEntity findWarehouse(long tenantId, long warehouseId) {
|
||||
return warehouses.selectOne(new LambdaQueryWrapper<WarehouseEntity>()
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baiyue.common.core.api.PageResult;
|
||||
import com.baiyue.warehouse.dto.PalletRequests;
|
||||
import com.baiyue.warehouse.entity.PalletEntity;
|
||||
import com.baiyue.warehouse.mapper.PalletMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -16,11 +17,8 @@ import java.util.List;
|
||||
/** 托盘持久化仓储;平台分页支持跨租户筛选,资源操作始终包含租户和仓库边界。 */
|
||||
@Repository
|
||||
public class PalletRepository {
|
||||
private final PalletMapper mapper;
|
||||
|
||||
public PalletRepository(PalletMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
@Resource
|
||||
private PalletMapper mapper;
|
||||
|
||||
public PageResult<PalletEntity> page(Long tenantId, PalletRequests.PageQuery query) {
|
||||
LambdaQueryWrapper<PalletEntity> wrapper = new LambdaQueryWrapper<PalletEntity>()
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baiyue.common.core.api.PageResult;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.PartnerPageQuery;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.mapper.PartnerMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.StringUtils;
|
||||
import java.util.List;
|
||||
@@ -15,8 +16,8 @@ import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public class PartnerRepository {
|
||||
private final PartnerMapper mapper;
|
||||
public PartnerRepository(PartnerMapper mapper) { this.mapper = mapper; }
|
||||
@Resource
|
||||
private PartnerMapper mapper;
|
||||
public List<PartnerEntity> activeCandidates(long tenantId, String keyword, String type) {
|
||||
List<Long> typedIds = StringUtils.hasText(type)
|
||||
? typedIds(tenantId, type)
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
import com.baiyue.warehouse.mapper.ServiceCapabilityMapper;
|
||||
import com.baiyue.warehouse.mapper.WarehouseAddressMapper;
|
||||
import com.baiyue.warehouse.mapper.WarehouseMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -20,17 +21,12 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public class WarehouseRepository {
|
||||
private final WarehouseMapper warehouses;
|
||||
private final WarehouseAddressMapper addresses;
|
||||
private final ServiceCapabilityMapper capabilities;
|
||||
|
||||
public WarehouseRepository(WarehouseMapper warehouses,
|
||||
WarehouseAddressMapper addresses,
|
||||
ServiceCapabilityMapper capabilities) {
|
||||
this.warehouses = warehouses;
|
||||
this.addresses = addresses;
|
||||
this.capabilities = capabilities;
|
||||
}
|
||||
@Resource
|
||||
private WarehouseMapper warehouses;
|
||||
@Resource
|
||||
private WarehouseAddressMapper addresses;
|
||||
@Resource
|
||||
private ServiceCapabilityMapper capabilities;
|
||||
|
||||
public void insertWarehouse(WarehouseEntity warehouse) {
|
||||
warehouses.insert(warehouse);
|
||||
|
||||
+3
-5
@@ -5,6 +5,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanyImportError;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanyImportResult;
|
||||
import com.baiyue.warehouse.entity.ExpressCompanyEntity;
|
||||
import com.baiyue.warehouse.repository.ExpressCompanyRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.DataFormatter;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
@@ -34,11 +35,8 @@ public class ExpressCompanyImportService {
|
||||
"快递公司编码*", "快递公司名称*", "客服电话", "官方网站", "轨迹查询地址模板", "状态*", "备注"
|
||||
};
|
||||
|
||||
private final ExpressCompanyRepository repository;
|
||||
|
||||
public ExpressCompanyImportService(ExpressCompanyRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private ExpressCompanyRepository repository;
|
||||
|
||||
public byte[] template() {
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook(); ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||
|
||||
+3
-5
@@ -8,6 +8,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanyPageQuery;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.ExpressCompanySaveRequest;
|
||||
import com.baiyue.warehouse.entity.ExpressCompanyEntity;
|
||||
import com.baiyue.warehouse.repository.ExpressCompanyRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -15,11 +16,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
/** 平台快递公司管理服务。 */
|
||||
@Service
|
||||
public class ExpressCompanyQueryService {
|
||||
private final ExpressCompanyRepository repository;
|
||||
|
||||
public ExpressCompanyQueryService(ExpressCompanyRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private ExpressCompanyRepository repository;
|
||||
|
||||
public PageResult<ExpressCompanyEntity> page(Long tenantId, ExpressCompanyPageQuery query) {
|
||||
return repository.page(tenantId, query);
|
||||
|
||||
+3
-5
@@ -10,6 +10,7 @@ import com.baiyue.warehouse.dto.LocationDtos.SaveRequest;
|
||||
import com.baiyue.warehouse.entity.LocationEntity;
|
||||
import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
import com.baiyue.warehouse.repository.LocationRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -19,11 +20,8 @@ import java.util.List;
|
||||
/** 库位基础资料应用服务,负责平台分页、CRUD、租户仓库隔离和启停/删除约束。 */
|
||||
@Service
|
||||
public class LocationApplicationService {
|
||||
private final LocationRepository repository;
|
||||
|
||||
public LocationApplicationService(LocationRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private LocationRepository repository;
|
||||
|
||||
public PageResult<LocationEntity> page(Long tenantId, PageQuery query) {
|
||||
return repository.page(tenantId, query);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.baiyue.warehouse.entity.LocationOccupancyEntity;
|
||||
import com.baiyue.warehouse.entity.LocationReservationEntity;
|
||||
import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
import com.baiyue.warehouse.repository.LocationRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -43,11 +44,8 @@ import java.util.Set;
|
||||
@Service
|
||||
@Validated
|
||||
public class LocationResourceService {
|
||||
private final LocationRepository repository;
|
||||
|
||||
public LocationResourceService(LocationRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private LocationRepository repository;
|
||||
|
||||
public List<LocationEntity> findAvailable(@Min(1) long tenantId, @Min(1) long warehouseId,
|
||||
@Min(1) @Max(200) int limit) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.baiyue.warehouse.dto.PalletRequests;
|
||||
import com.baiyue.warehouse.entity.PalletEntity;
|
||||
import com.baiyue.warehouse.repository.PalletRepository;
|
||||
import com.baiyue.warehouse.repository.WarehouseRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -15,13 +16,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
/** 托盘主数据应用服务。 */
|
||||
@Service
|
||||
public class PalletApplicationService {
|
||||
private final PalletRepository repository;
|
||||
private final WarehouseRepository warehouseRepository;
|
||||
|
||||
public PalletApplicationService(PalletRepository repository, WarehouseRepository warehouseRepository) {
|
||||
this.repository = repository;
|
||||
this.warehouseRepository = warehouseRepository;
|
||||
}
|
||||
@Resource
|
||||
private PalletRepository repository;
|
||||
@Resource
|
||||
private WarehouseRepository warehouseRepository;
|
||||
|
||||
public PageResult<PalletRequests.View> page(Long tenantId, PalletRequests.PageQuery query) {
|
||||
PageResult<PalletEntity> source = repository.page(tenantId, query);
|
||||
|
||||
+7
-11
@@ -7,6 +7,7 @@ import com.baiyue.warehouse.dto.LocationDtos;
|
||||
import com.baiyue.warehouse.dto.PalletAllocationDtos;
|
||||
import com.baiyue.warehouse.entity.PalletEntity;
|
||||
import com.baiyue.warehouse.repository.PalletRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -21,17 +22,12 @@ import java.util.List;
|
||||
public class PalletLocationAllocationService {
|
||||
/** 测量完成后默认推荐的普通托盘类型编码。 */
|
||||
public static final String DEFAULT_PALLET_TYPE = "STANDARD";
|
||||
private final PalletRepository palletRepository;
|
||||
private final PalletVolumeSplitter splitter;
|
||||
private final LocationResourceService locationResourceService;
|
||||
|
||||
public PalletLocationAllocationService(PalletRepository palletRepository,
|
||||
PalletVolumeSplitter splitter,
|
||||
LocationResourceService locationResourceService) {
|
||||
this.palletRepository = palletRepository;
|
||||
this.splitter = splitter;
|
||||
this.locationResourceService = locationResourceService;
|
||||
}
|
||||
@Resource
|
||||
private PalletRepository palletRepository;
|
||||
@Resource
|
||||
private PalletVolumeSplitter splitter;
|
||||
@Resource
|
||||
private LocationResourceService locationResourceService;
|
||||
|
||||
@Transactional
|
||||
@BusinessAudit(event = "PALLET_LOCATION_RESERVE", resourceType = "INBOUND", resourceId = "#request.businessId", description = "预占托盘和库位", captureBefore = false)
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.PartnerImportError;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.PartnerImportResult;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.repository.PartnerRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.DataFormatter;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
@@ -39,11 +40,8 @@ public class PartnerImportService {
|
||||
"国家二字码*", "省/州", "城市*", "区/县", "详细地址*", "邮政编码", "状态*", "备注"
|
||||
};
|
||||
|
||||
private final PartnerRepository repository;
|
||||
|
||||
public PartnerImportService(PartnerRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private PartnerRepository repository;
|
||||
|
||||
public byte[] template() {
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook(); ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||
|
||||
@@ -4,13 +4,14 @@ import com.baiyue.common.core.api.ResultCode;
|
||||
import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.repository.PartnerRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PartnerQueryService {
|
||||
private final PartnerRepository repository;
|
||||
public PartnerQueryService(PartnerRepository repository) { this.repository = repository; }
|
||||
@Resource
|
||||
private PartnerRepository repository;
|
||||
public List<PartnerEntity> candidates(long tenantId, String keyword, String type) {
|
||||
if (type != null && !type.isBlank() && !"SHIPPER".equals(type) && !"CONSIGNEE".equals(type)) {
|
||||
throw new BizException(ResultCode.BAD_REQUEST, "候选类型只能是 SHIPPER 或 CONSIGNEE");
|
||||
|
||||
+3
-5
@@ -8,6 +8,7 @@ import com.baiyue.warehouse.dto.MasterDataQueries.PartnerPageQuery;
|
||||
import com.baiyue.warehouse.dto.MasterDataQueries.PartnerSaveRequest;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.repository.PartnerRepository;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -19,11 +20,8 @@ import java.util.Set;
|
||||
/** 平台往来单位管理服务。 */
|
||||
@Service
|
||||
public class PlatformPartnerQueryService {
|
||||
private final PartnerRepository repository;
|
||||
|
||||
public PlatformPartnerQueryService(PartnerRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
@Resource
|
||||
private PartnerRepository repository;
|
||||
|
||||
public PageResult<PartnerEntity> page(Long tenantId, PartnerPageQuery query) {
|
||||
return repository.page(tenantId, query);
|
||||
|
||||
+3
-5
@@ -2,6 +2,7 @@ package com.baiyue.warehouse.service;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,11 +25,8 @@ public class WarehouseSchemaReadinessService {
|
||||
"SELECT id, tenant_id, warehouse_id, pallet_id, location_id, shared_overflow, occupancy_status, active_location_occupancy, active_pallet_occupancy, version FROM wh_location_occupancy LIMIT 0"
|
||||
);
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
public WarehouseSchemaReadinessService(JdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
@Resource
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public Readiness readiness() {
|
||||
try {
|
||||
|
||||
@@ -35,6 +35,6 @@ logging:
|
||||
rollingpolicy:
|
||||
file-name-pattern: "${LOGGING_ROLLING_FILE_NAME_PATTERN:${LOG_PATH:./logs}/${spring.application.name}.%d{yyyy-MM-dd}.%i.log.gz}"
|
||||
max-file-size: "${LOGGING_ROLLING_MAX_FILE_SIZE:100MB}"
|
||||
max-history: "${LOGGING_ROLLING_MAX_HISTORY:30}"
|
||||
max-history: "${LOGGING_ROLLING_MAX_HISTORY:7}"
|
||||
total-size-cap: "${LOGGING_ROLLING_TOTAL_SIZE_CAP:5GB}"
|
||||
clean-history-on-start: "${LOGGING_ROLLING_CLEAN_HISTORY_ON_START:false}"
|
||||
|
||||
Reference in New Issue
Block a user