erp库位、物料优化

This commit is contained in:
liss
2025-10-10 19:11:48 +08:00
parent 9011d8fc5a
commit 72a9dff7c3
18 changed files with 228 additions and 61 deletions

View File

@@ -13,6 +13,9 @@ public interface ErrorCodeConstants {
ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在"); ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在");
ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_002_000_001, "ERP物料数据不存在"); ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_002_000_001, "ERP物料数据不存在");
ErrorCode ERP_MATERIAL_NOT_ALLOW_UPDATE = new ErrorCode(1_002_000_001, "只允许编辑状态为“供应链”的数据");
ErrorCode ERP_MATERIAL_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "不允许删除状态为“ERP”的数据");
ErrorCode ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "只允许删除不存在配置关系的数据");
ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_003_000_001, "ERP公司数据不存在"); ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_003_000_001, "ERP公司数据不存在");
ErrorCode ERP_COMPANY_REDIS_NOT_EXISTS = new ErrorCode(1_003_000_002, "ERP公司代码缓存数据丢失,请重新同步公司代码"); ErrorCode ERP_COMPANY_REDIS_NOT_EXISTS = new ErrorCode(1_003_000_002, "ERP公司代码缓存数据丢失,请重新同步公司代码");
@@ -40,6 +43,7 @@ public interface ErrorCodeConstants {
ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_013_000_001, "ERP销售组织数据不存在"); ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_013_000_001, "ERP销售组织数据不存在");
ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_014_000_001, "ERP库位数据不存在"); ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_014_000_001, "ERP库位数据不存在");
ErrorCode ERP_WAREHOUSE_NOT_ALLOW_UPDATE = new ErrorCode(1_014_000_002, "只允许状态为“供应链”,且“禁用”的数据编辑");
ErrorCode ERP_ASSET_NOT_EXISTS = new ErrorCode(1_015_000_001, "ERP资产卡片数据不存在"); ErrorCode ERP_ASSET_NOT_EXISTS = new ErrorCode(1_015_000_001, "ERP资产卡片数据不存在");

View File

@@ -88,14 +88,6 @@ public class ErpFactoryController {
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class)); return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
} }
@GetMapping("/pageByCpn")
@Operation(summary = "获得ERP工厂分页")
@PreAuthorize("@ss.hasPermission('base:erp-factory:query')")
public CommonResult<PageResult<ErpFactoryRespVO>> getErpFactoryPageByCpn(@Valid ErpFactoryPageReqVO pageReqVO) {
PageResult<ErpFactoryDO> pageResult = erpFactoryService.getErpFactoryPageByCpn(pageReqVO);
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
}
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出ERP工厂 Excel") @Operation(summary = "导出ERP工厂 Excel")
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')") @PreAuthorize("@ss.hasPermission('base:erp-factory:export')")

View File

@@ -101,6 +101,14 @@ public class ErpWarehouseController {
BeanUtils.toBean(list, ErpWarehouseRespVO.class)); BeanUtils.toBean(list, ErpWarehouseRespVO.class));
} }
@PutMapping("/enable-list")
@Operation(summary = "批量更新")
@PreAuthorize("@ss.hasPermission('base:warehouse:update')")
public CommonResult<Boolean> enableWarehouseList(@RequestBody List<ErpWarehouseSaveReqVO> saveReqVOS) {
erpWarehouseService.enableWarehouseList(saveReqVOS);
return success(true);
}
@PostMapping("/getErpWarehouseTask") @PostMapping("/getErpWarehouseTask")
@Operation(summary = "定时获得erp更新库位") @Operation(summary = "定时获得erp更新库位")
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')") @PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")

View File

@@ -8,6 +8,9 @@ import lombok.Data;
@Data @Data
public class ErpWarehousePageReqVO extends PageParam { public class ErpWarehousePageReqVO extends PageParam {
@Schema(description = "工厂名称")
private String factoryName;
@Schema(description = "工厂编码;将查询参数存入") @Schema(description = "工厂编码;将查询参数存入")
private String factoryNumber; private String factoryNumber;
@@ -17,4 +20,8 @@ public class ErpWarehousePageReqVO extends PageParam {
@Schema(description = "库位编码") @Schema(description = "库位编码")
private String number; private String number;
@Schema(description = "类型")
private String type;
} }

View File

@@ -26,4 +26,16 @@ public class ErpWarehouseRespVO {
@ExcelProperty("库位编码") @ExcelProperty("库位编码")
private String number; private String number;
@Schema(description = "类别")
private String type;
@Schema(description = "绑定库位名")
private String relName;
@Schema(description = "绑定库位编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
} }

View File

@@ -22,4 +22,16 @@ public class ErpWarehouseSaveReqVO {
@NotEmpty(message = "库位编码不能为空") @NotEmpty(message = "库位编码不能为空")
private String number; private String number;
@Schema(description = "类别")
private String type;
@Schema(description = "绑定库位名")
private String relName;
@Schema(description = "绑定库位编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
} }

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.erp.dal.dataobject.erp; package com.zt.plat.module.erp.dal.dataobject.erp;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*; import lombok.*;
/** /**
* ERP库位 DO * ERP库位 DO
@@ -18,7 +19,7 @@ import lombok.*;
/** /**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO * 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/ */
public class ErpWarehouseDO { public class ErpWarehouseDO extends BusinessBaseDO {
/** /**
* 主键 * 主键
@@ -30,6 +31,11 @@ public class ErpWarehouseDO {
*/ */
@TableField("FACT_NUM") @TableField("FACT_NUM")
private String factoryNumber; private String factoryNumber;
/**
* 工厂名称;将查询参数存入
*/
@TableField(exist = false)
private String factoryName;
/** /**
* 库位描述 * 库位描述
*/ */
@@ -47,4 +53,22 @@ public class ErpWarehouseDO {
@TableField("TP") @TableField("TP")
private String type; private String type;
/**
* 绑定库位名
*/
@TableField("REL_NAME")
private String relName;
/**
* 绑定库位编码
*/
@TableField("REL_NUM")
private String relnumber;
/**
* 类型
*/
@TableField("IS_ENB")
private String isEnable;
} }

View File

@@ -18,14 +18,6 @@ import java.util.List;
@Mapper @Mapper
public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> { public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> {
default PageResult<ErpFactoryDO> selectPage(ErpFactoryPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
.eqIfPresent(ErpFactoryDO::getType, reqVO.getType())
.orderByDesc(ErpFactoryDO::getId));
}
String selectMaxCode(); String selectMaxCode();
List<ErpFactoryDO> getPageByReq(ErpFactoryPageReqVO pageReqVO); List<ErpFactoryDO> getPageByReq(ErpFactoryPageReqVO pageReqVO);

View File

@@ -37,4 +37,8 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
} }
void updateBatchByNumber(@Param("toUpdate") List<ErpMaterialDO> toUpdate); void updateBatchByNumber(@Param("toUpdate") List<ErpMaterialDO> toUpdate);
String selectMaxCode();
Integer selectByErpMNumbers(List<String> erpMNumber);
} }

View File

@@ -7,6 +7,8 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpWarehousePageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO; import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* ERP库位 Mapper * ERP库位 Mapper
* *
@@ -15,13 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> { public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> {
default PageResult<ErpWarehouseDO> selectPage(ErpWarehousePageReqVO reqVO) { String selectMaxCode();
return selectPage(reqVO, new LambdaQueryWrapperX<ErpWarehouseDO>()
.eqIfPresent(ErpWarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
.likeIfPresent(ErpWarehouseDO::getName, reqVO.getName())
// .betweenIfPresent(ErpWarehouseDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ErpWarehouseDO::getNumber, reqVO.getNumber())
.orderByDesc(ErpWarehouseDO::getId));
}
List<ErpWarehouseDO> getPageByReq(ErpWarehousePageReqVO pageReqVO);
} }

Some files were not shown because too many files have changed in this diff Show More