优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.baiyue.warehouse;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -7,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
/**
|
||||
* 仓库微服务启动入口,启用 Spring Boot 自动配置并扫描仓库服务的 MyBatis Mapper。
|
||||
*/
|
||||
@MapperScan({"com.baiyue.warehouse.mapper", "com.baiyue.warehouse.domesticcontainer.mapper"})
|
||||
@MapperScan(basePackages = "com.baiyue.warehouse", annotationClass = Mapper.class)
|
||||
@SpringBootApplication(scanBasePackages = "com.baiyue")
|
||||
public class BaiyueWarehouseApplication {
|
||||
public static void main(String[] args) { SpringApplication.run(BaiyueWarehouseApplication.class, args); }
|
||||
|
||||
+3
@@ -1,5 +1,7 @@
|
||||
package com.baiyue.warehouse.domesticcontainer.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.domesticcontainer.entity.DomesticContainerIdempotencyEntity;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
@@ -7,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
@Mapper
|
||||
public interface DomesticContainerIdempotencyMapper extends BaseMapper<DomesticContainerIdempotencyEntity> {
|
||||
@Insert("INSERT IGNORE INTO wh_domestic_container_idempotency (id,tenant_id,operation_type,idempotency_key,request_hash,operation_status,created_at) VALUES (#{id},0,#{operationType},#{idempotencyKey},#{requestHash},'PROCESSING',CURRENT_TIMESTAMP(3))")
|
||||
int claim(@Param("id") long id, @Param("operationType") String operationType,
|
||||
|
||||
+3
@@ -1,10 +1,13 @@
|
||||
package com.baiyue.warehouse.domesticcontainer.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.domesticcontainer.entity.DomesticContainerInventoryEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
public interface DomesticContainerInventoryMapper extends BaseMapper<DomesticContainerInventoryEntity> {
|
||||
@Select("SELECT id FROM wh_warehouse WHERE tenant_id=0 AND id=#{warehouseId} AND warehouse_type='DOMESTIC' AND status='ACTIVE' AND deleted=0 FOR UPDATE")
|
||||
Long lockWarehouse(@Param("warehouseId") long warehouseId);
|
||||
|
||||
+3
@@ -1,7 +1,10 @@
|
||||
package com.baiyue.warehouse.domesticcontainer.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.domesticcontainer.entity.DomesticContainerOrderEntity;
|
||||
|
||||
@Mapper
|
||||
public interface DomesticContainerOrderMapper extends BaseMapper<DomesticContainerOrderEntity> {
|
||||
}
|
||||
|
||||
+3
@@ -1,7 +1,10 @@
|
||||
package com.baiyue.warehouse.domesticcontainer.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.domesticcontainer.entity.DomesticContainerTransactionEntity;
|
||||
|
||||
@Mapper
|
||||
public interface DomesticContainerTransactionMapper extends BaseMapper<DomesticContainerTransactionEntity> {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.ExpressCompanyEntity;
|
||||
|
||||
/** 快递公司持久化映射。 */
|
||||
@Mapper
|
||||
public interface ExpressCompanyMapper extends BaseMapper<ExpressCompanyEntity> {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.OverseasStorageFeeRuleEntity;
|
||||
|
||||
/** 海外仓阶梯费用主记录 Mapper。 */
|
||||
@Mapper
|
||||
public interface OverseasStorageFeeRuleMapper extends BaseMapper<OverseasStorageFeeRuleEntity> {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.OverseasStorageFeeTierEntity;
|
||||
|
||||
/** 海外仓阶梯费用明细 Mapper。 */
|
||||
@Mapper
|
||||
public interface OverseasStorageFeeTierMapper extends BaseMapper<OverseasStorageFeeTierEntity> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.PalletEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -8,6 +10,7 @@ import org.apache.ibatis.annotations.Select;
|
||||
import java.util.List;
|
||||
|
||||
/** 托盘主数据 Mapper。 */
|
||||
@Mapper
|
||||
public interface PalletMapper extends BaseMapper<PalletEntity> {
|
||||
/** 编码序列必须包含逻辑删除记录,避免历史编码被复用。 */
|
||||
@Select("SELECT pallet_code FROM wh_pallet WHERE tenant_id = #{tenantId} AND pallet_code LIKE 'TP-%'")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
@@ -11,6 +13,7 @@ import org.apache.ibatis.annotations.Select;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PartnerMapper extends BaseMapper<PartnerEntity> {
|
||||
@Select("""
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.ServiceCapabilityEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
@@ -8,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 仓库服务能力 MyBatis-Plus Mapper,负责 {@code wh_service_capability} 表访问及仓库子记录的物理清理。
|
||||
*/
|
||||
@Mapper
|
||||
public interface ServiceCapabilityMapper extends BaseMapper<ServiceCapabilityEntity> {
|
||||
|
||||
@Delete("DELETE FROM wh_service_capability WHERE tenant_id = #{tenantId} AND warehouse_id = #{warehouseId}")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.SupplierEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
@@ -9,6 +11,7 @@ import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupplierMapper extends BaseMapper<SupplierEntity> {
|
||||
@Select("""
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.baiyue.warehouse.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.WarehouseAddressEntity;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
@@ -8,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 仓库地址 MyBatis-Plus Mapper,负责 {@code wh_warehouse_address} 表访问及仓库子记录的物理清理。
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehouseAddressMapper extends BaseMapper<WarehouseAddressEntity> {
|
||||
|
||||
@Delete("DELETE FROM wh_warehouse_address WHERE tenant_id = #{tenantId} AND warehouse_id = #{warehouseId}")
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.baiyue.warehouse.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
package com.baiyue.warehouse.mapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
|
||||
/**
|
||||
* 仓库主数据 MyBatis-Plus Mapper,提供 {@code wh_warehouse} 表的单表持久化访问。
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehouseMapper extends BaseMapper<WarehouseEntity> {}
|
||||
|
||||
Reference in New Issue
Block a user