Merge branch 'refs/heads/dev' into test
This commit is contained in:
@@ -51,6 +51,12 @@ spring:
|
|||||||
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
|
||||||
username: SYSDBA
|
username: SYSDBA
|
||||||
password: P@ssword25
|
password: P@ssword25
|
||||||
|
mdm: # 主数据同步专用数据源(使用已引入的旧版 MySQL JDBC)
|
||||||
|
url: jdbc:mysql://172.16.38.10:3306/mdmdev?useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
|
||||||
|
username: iworker
|
||||||
|
password: iwork_87871A
|
||||||
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -90,6 +90,9 @@
|
|||||||
<logger name="com.zt.plat.module.base.dal.mysql" level="DEBUG" additivity="false">
|
<logger name="com.zt.plat.module.base.dal.mysql" level="DEBUG" additivity="false">
|
||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="STDOUT"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
<logger name="com.zt.plat.module.base.dal.dao" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</logger>
|
||||||
<logger name="com.zt.plat.module.contractorder.dal.mysql" level="DEBUG" additivity="false">
|
<logger name="com.zt.plat.module.contractorder.dal.mysql" level="DEBUG" additivity="false">
|
||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="STDOUT"/>
|
||||||
</logger>
|
</logger>
|
||||||
@@ -107,5 +110,4 @@
|
|||||||
<appender-ref ref="GRPC"/>
|
<appender-ref ref="GRPC"/>
|
||||||
</root>
|
</root>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
29
sql/dm/2026-1-14物料相关表增加索引.sql
Normal file
29
sql/dm/2026-1-14物料相关表增加索引.sql
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
CREATE INDEX idx_hs_cls_tenant_deleted_cls
|
||||||
|
ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID, INF_ID);
|
||||||
|
|
||||||
|
CREATE INDEX idx_hs_cls_composite
|
||||||
|
ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mtrl_inf_tenant_deleted_id
|
||||||
|
ON bse_mtrl_inf(tenant_id, deleted, id);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mtrl_inf_tenant_deleted_cd
|
||||||
|
ON bse_mtrl_inf(tenant_id, deleted, CD, id);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mtrl_inf_cover
|
||||||
|
ON bse_mtrl_inf(tenant_id, deleted, CD, id, NAME, RMK, create_time, update_time, creator, updater);
|
||||||
|
|
||||||
|
CREATE INDEX idx_hs_prps_tenant_deleted_inf
|
||||||
|
ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID);
|
||||||
|
|
||||||
|
CREATE INDEX idx_hs_prps_tenant_inf_deleted
|
||||||
|
ON bse_mtrl_hs_prps(tenant_id, INF_ID, deleted);
|
||||||
|
|
||||||
|
CREATE INDEX idx_hs_prps_cover
|
||||||
|
ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID, UNT_ID, IS_KY, IS_MTNG, SRT, DEPT_ID);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mtrl_prps_tenant_deleted_id
|
||||||
|
ON bse_mtrl_prps(tenant_id, deleted, id);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mtrl_prps_cover
|
||||||
|
ON bse_mtrl_prps(tenant_id, deleted, id, CD, NAME, UNT_QTY_ID, DIC_DAT_VAL, DAT_TP, RMK, DEPT_ID);
|
||||||
@@ -52,7 +52,7 @@ public class MaterialHasPropertiesDeptController {
|
|||||||
public CommonResult<MaterialHasPropertiesBatchSaveRespVO> batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
|
public CommonResult<MaterialHasPropertiesBatchSaveRespVO> batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
|
||||||
Long deptId = reqVO.getDeptId();
|
Long deptId = reqVO.getDeptId();
|
||||||
if (deptId == null) {
|
if (deptId == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
|
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
|
||||||
return success(resp);
|
return success(resp);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
|
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
|
||||||
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
|
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
|
||||||
if (materialProperties.getDeptId() == null) {
|
if (materialProperties.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "没有权限");
|
throw new ServiceException(500, "没有权限");
|
||||||
}
|
}
|
||||||
return success(materialProperties);
|
return success(materialProperties);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
||||||
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
|
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
|
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
|
||||||
return success(pageResult);
|
return success(pageResult);
|
||||||
@@ -118,7 +118,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
||||||
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
|
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
|
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
|
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
|
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
|
||||||
|
|||||||
@@ -58,41 +58,41 @@ public class MaterialDestroyDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("OPTN")
|
@TableField("OPTN")
|
||||||
private String operation;
|
private String operation;
|
||||||
/**
|
// /**
|
||||||
* 公司编号
|
// * 公司编号
|
||||||
*/
|
// */
|
||||||
@TableField("COMPANY_ID")
|
// @TableField("COMPANY_ID")
|
||||||
private Long companyId;
|
// private Long companyId;
|
||||||
/**
|
// /**
|
||||||
* 公司名称
|
// * 公司名称
|
||||||
*/
|
// */
|
||||||
@TableField("COMPANY_NAME")
|
// @TableField("COMPANY_NAME")
|
||||||
private String companyName;
|
// private String companyName;
|
||||||
/**
|
// /**
|
||||||
* 部门编号
|
// * 部门编号
|
||||||
*/
|
// */
|
||||||
@TableField("DEPT_ID")
|
// @TableField("DEPT_ID")
|
||||||
private Long deptId;
|
// private Long deptId;
|
||||||
/**
|
// /**
|
||||||
* 部门名称
|
// * 部门名称
|
||||||
*/
|
// */
|
||||||
@TableField("DEPT_NAME")
|
// @TableField("DEPT_NAME")
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
/**
|
// /**
|
||||||
* 岗位编号
|
// * 岗位编号
|
||||||
*/
|
// */
|
||||||
@TableField("POST_ID")
|
// @TableField("POST_ID")
|
||||||
private Long postId;
|
// private Long postId;
|
||||||
/**
|
// /**
|
||||||
* 创建人名称
|
// * 创建人名称
|
||||||
*/
|
// */
|
||||||
@TableField("CREATOR_NAME")
|
// @TableField("CREATOR_NAME")
|
||||||
private String creatorName;
|
// private String creatorName;
|
||||||
/**
|
// /**
|
||||||
* 更新人名称
|
// * 更新人名称
|
||||||
*/
|
// */
|
||||||
@TableField("UPDATER_NAME")
|
// @TableField("UPDATER_NAME")
|
||||||
private String updaterName;
|
// private String updaterName;
|
||||||
/**
|
/**
|
||||||
* 供应商编码
|
* 供应商编码
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
// 插入
|
// 插入
|
||||||
ElementDO element = BeanUtils.toBean(createReqVO, ElementDO.class);
|
ElementDO element = BeanUtils.toBean(createReqVO, ElementDO.class);
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateElementCodeExists(createReqVO.getAbbreviation());
|
validateElementCodeExists(createReqVO.getAbbreviation(),"insert",null);
|
||||||
//金属编码自动生成,格式 JSYS-00001,依次新增
|
//金属编码自动生成,格式 JSYS-00001,依次新增
|
||||||
String maxCode = elementMapper.selectMaxCode();
|
String maxCode = elementMapper.selectMaxCode();
|
||||||
if (maxCode == null) {
|
if (maxCode == null) {
|
||||||
@@ -59,7 +59,7 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateElementExists(updateReqVO.getId());
|
validateElementExists(updateReqVO.getId());
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateElementCodeExists(updateReqVO.getAbbreviation());
|
validateElementCodeExists(updateReqVO.getAbbreviation(),"update",updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
|
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
|
||||||
elementMapper.updateById(updateObj);
|
elementMapper.updateById(updateObj);
|
||||||
@@ -94,9 +94,11 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateElementCodeExists(String code) {
|
private void validateElementCodeExists(String code,String type,Long id) {
|
||||||
ElementDO elementDO = elementMapper.getElementName(code);
|
ElementDO elementDO = elementMapper.getElementName(code);
|
||||||
if (elementDO != null) {
|
if (elementDO != null&&type.equals("insert")) {
|
||||||
|
throw exception(ELEMENT_EXISTS);
|
||||||
|
}else if (elementDO != null&&type.equals("update")&& !elementDO.getId().equals(id)) {
|
||||||
throw exception(ELEMENT_EXISTS);
|
throw exception(ELEMENT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ public class MaterialDestroyServiceImpl implements MaterialDestroyService {
|
|||||||
public MaterialDestroyRespVO createMaterialDestroy(MaterialDestroySaveReqVO createReqVO) {
|
public MaterialDestroyRespVO createMaterialDestroy(MaterialDestroySaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
MaterialDestroyDO materialDestroy = BeanUtils.toBean(createReqVO, MaterialDestroyDO.class);
|
MaterialDestroyDO materialDestroy = BeanUtils.toBean(createReqVO, MaterialDestroyDO.class);
|
||||||
|
if (materialDestroy.getIsEnable()==null||materialDestroy.getIsEnable().isEmpty()) {
|
||||||
|
materialDestroy.setIsEnable("1");
|
||||||
|
}
|
||||||
materialDestroyMapper.insert(materialDestroy);
|
materialDestroyMapper.insert(materialDestroy);
|
||||||
// 返回
|
// 返回
|
||||||
return BeanUtils.toBean(materialDestroy, MaterialDestroyRespVO.class);
|
return BeanUtils.toBean(materialDestroy, MaterialDestroyRespVO.class);
|
||||||
|
|||||||
@@ -114,8 +114,14 @@ public class MaterialHasPropertiesServiceImpl implements MaterialHasPropertiesSe
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
// 全量替换:先删除该物料的已有属性
|
// 全量替换:先删除该物料的已有属性
|
||||||
materialHasPropertiesMapper.delete(new LambdaQueryWrapperX<MaterialHasPropertiesDO>()
|
LambdaQueryWrapperX<MaterialHasPropertiesDO> delQuery = new LambdaQueryWrapperX<>();
|
||||||
.eq(MaterialHasPropertiesDO::getInfomationId, infoId));
|
delQuery.eq(MaterialHasPropertiesDO::getInfomationId, infoId);
|
||||||
|
if (deptId == null) {
|
||||||
|
delQuery.isNull(MaterialHasPropertiesDO::getDeptId);
|
||||||
|
} else {
|
||||||
|
delQuery.eq(MaterialHasPropertiesDO::getDeptId, deptId);
|
||||||
|
}
|
||||||
|
materialHasPropertiesMapper.delete(delQuery);
|
||||||
|
|
||||||
List<MaterialHasPropertiesBatchItemReqVO> properties = batchReqVO.getProperties();
|
List<MaterialHasPropertiesBatchItemReqVO> properties = batchReqVO.getProperties();
|
||||||
if (CollUtil.isEmpty(properties)) {
|
if (CollUtil.isEmpty(properties)) {
|
||||||
|
|||||||
@@ -59,6 +59,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_ERROR = new ErrorCode( 1_017_000_009, "主物料信息错误");
|
ErrorCode MATERIAL_ERROR = new ErrorCode( 1_017_000_009, "主物料信息错误");
|
||||||
|
|
||||||
ErrorCode INTERNAL_WAREHOUSE_NOT_EXISTS= new ErrorCode(1_017_000_011,"内部仓库不存在");
|
ErrorCode INTERNAL_WAREHOUSE_NOT_EXISTS= new ErrorCode(1_017_000_011,"内部仓库不存在");
|
||||||
|
ErrorCode INTERNAL_WAREHOUSE_EXISTS=new ErrorCode(1_017_000_012,"内部仓库已存在");
|
||||||
ErrorCode WAREHOUSE_FACTORY_NOT_EXISTS=new ErrorCode(1_017_000_010,"库位与工厂信息不存在");
|
ErrorCode WAREHOUSE_FACTORY_NOT_EXISTS=new ErrorCode(1_017_000_010,"库位与工厂信息不存在");
|
||||||
}
|
}
|
||||||
@@ -155,17 +155,15 @@ public class ErpMaterialController {
|
|||||||
@PostMapping("/api-erp-material")
|
@PostMapping("/api-erp-material")
|
||||||
@Operation(summary = "通过接口查询物料")
|
@Operation(summary = "通过接口查询物料")
|
||||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:query')")
|
@PreAuthorize("@ss.hasPermission('sply:erp-material:query')")
|
||||||
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByApi(@RequestBody MaterialInfomationApiVO vo) {
|
public CommonResult<PageResult<ErpMaterialRespVO>> getErpMaterialByApi(@RequestBody MaterialInfomationApiVO vo) {
|
||||||
MaterialInfomationPageReqDTO material = new MaterialInfomationPageReqDTO();
|
MaterialInfomationPageReqDTO material = new MaterialInfomationPageReqDTO();
|
||||||
material.setCode(vo.getMaterialNumber());
|
material.setCode(vo.getMaterialNumber());
|
||||||
material.setName(vo.getMaterialName());
|
material.setName(vo.getMaterialName());
|
||||||
material.setPageSize(vo.getPageSize());
|
material.setPageSize(vo.getPageSize());
|
||||||
material.setPageNo(vo.getPageNo());
|
material.setPageNo(vo.getPageNo());
|
||||||
List<ErpMaterialDO> erpMaterial = erpMaterialService.getErpMaterialByApi(material);
|
PageResult<ErpMaterialDO> erpMaterialByApi = erpMaterialService.getErpMaterialByApi(material);
|
||||||
return success(BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class));
|
return success(BeanUtils.toBean(erpMaterialByApi, ErpMaterialRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//通过主物料查询子物料信息
|
//通过主物料查询子物料信息
|
||||||
@GetMapping("/erpMaterial-mainMaterial-code")
|
@GetMapping("/erpMaterial-mainMaterial-code")
|
||||||
@Operation(summary = "通过主物料编号查询子物料信息")
|
@Operation(summary = "通过主物料编号查询子物料信息")
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
|||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
|
||||||
import com.zt.plat.module.erp.dal.dataobject.erp.internalwarehouse.InternalWarehouseDO;
|
import com.zt.plat.module.erp.dal.dataobject.erp.internalwarehouse.InternalWarehouseDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,5 +35,8 @@ public interface InternalWarehouseMapper extends BaseMapperX<InternalWarehouseDO
|
|||||||
.eqIfPresent(InternalWarehouseDO::getCompanyNameCustom, reqVO.getCompanyNameCustom())
|
.eqIfPresent(InternalWarehouseDO::getCompanyNameCustom, reqVO.getCompanyNameCustom())
|
||||||
.orderByDesc(InternalWarehouseDO::getId));
|
.orderByDesc(InternalWarehouseDO::getId));
|
||||||
}
|
}
|
||||||
|
@Select("SELECT COUNT(*) AS total FROM bse_intl_wrh WHERE NUM = #{number}")
|
||||||
|
@TenantIgnore
|
||||||
|
Long selectCountByNumber(String number);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ public interface ErpMaterialService {
|
|||||||
|
|
||||||
List<ErpMaterialDO> getErpMaterialByMainMaterial(Long mainMaterialId);
|
List<ErpMaterialDO> getErpMaterialByMainMaterial(Long mainMaterialId);
|
||||||
|
|
||||||
List<ErpMaterialDO> getErpMaterialByApi( MaterialInfomationPageReqDTO material);
|
PageResult<ErpMaterialDO> getErpMaterialByApi( MaterialInfomationPageReqDTO material);
|
||||||
|
|
||||||
ErpMaterialDO getErpMaterialByMainMaterialByCode(String code);
|
ErpMaterialDO getErpMaterialByMainMaterialByCode(String code);
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ErpMaterialDO> getErpMaterialByApi(MaterialInfomationPageReqDTO material) {
|
public PageResult<ErpMaterialDO> getErpMaterialByApi(MaterialInfomationPageReqDTO material) {
|
||||||
CommonResult<PageResult<MaterialInfomationRespDTO>> materialInfomationPage = materialInfomationApi.getMaterialInfomationPage(material);
|
CommonResult<PageResult<MaterialInfomationRespDTO>> materialInfomationPage = materialInfomationApi.getMaterialInfomationPage(material);
|
||||||
List<ErpMaterialDO> erpMaterialDOList = new ArrayList<>();
|
List<ErpMaterialDO> erpMaterialDOList = new ArrayList<>();
|
||||||
if (materialInfomationPage.getData() != null && materialInfomationPage.getData().getList() != null && !materialInfomationPage.getData().getList().isEmpty()) {
|
if (materialInfomationPage.getData() != null && materialInfomationPage.getData().getList() != null && !materialInfomationPage.getData().getList().isEmpty()) {
|
||||||
@@ -290,7 +290,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return erpMaterialDOList;
|
return new PageResult<>(erpMaterialDOList, materialInfomationPage.getData().getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.zt.plat.module.erp.service.erp.internalwarehouse;
|
package com.zt.plat.module.erp.service.erp.internalwarehouse;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseEnableDisableReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseEnableDisableReqVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseRespVO;
|
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseRespVO;
|
||||||
@@ -23,6 +25,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
|||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.INTERNAL_WAREHOUSE_EXISTS;
|
||||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.INTERNAL_WAREHOUSE_NOT_EXISTS;
|
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.INTERNAL_WAREHOUSE_NOT_EXISTS;
|
||||||
|
|
||||||
|
|
||||||
@@ -42,11 +45,20 @@ public class InternalWarehouseServiceImpl implements InternalWarehouseService {
|
|||||||
public InternalWarehouseRespVO createInternalWarehouse(InternalWarehouseSaveReqVO createReqVO) {
|
public InternalWarehouseRespVO createInternalWarehouse(InternalWarehouseSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
InternalWarehouseDO internalWarehouse = BeanUtils.toBean(createReqVO, InternalWarehouseDO.class);
|
InternalWarehouseDO internalWarehouse = BeanUtils.toBean(createReqVO, InternalWarehouseDO.class);
|
||||||
|
//校验所绑定的库位是否已经存在
|
||||||
|
validateInternalWarehouseExists(createReqVO.getNumber());
|
||||||
internalWarehouseMapper.insert(internalWarehouse);
|
internalWarehouseMapper.insert(internalWarehouse);
|
||||||
// 返回
|
// 返回
|
||||||
return BeanUtils.toBean(internalWarehouse, InternalWarehouseRespVO.class);
|
return BeanUtils.toBean(internalWarehouse, InternalWarehouseRespVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void validateInternalWarehouseExists(String number){
|
||||||
|
if (internalWarehouseMapper.selectCountByNumber(number)>0) {
|
||||||
|
throw exception(INTERNAL_WAREHOUSE_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void updateInternalWarehouse(InternalWarehouseSaveReqVO updateReqVO) {
|
public void updateInternalWarehouse(InternalWarehouseSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
|
|||||||
Reference in New Issue
Block a user