新增物料查询接口

This commit is contained in:
潘荣晟
2026-01-04 17:44:10 +08:00
parent 3c29066d5c
commit 7a05d1bd3f
17 changed files with 705 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.erp.framework.rpc.config;
import com.zt.plat.module.api.InternalSupplyFactoryApi;
import com.zt.plat.module.base.api.materialinfomation.MaterialInfomationApi;
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
import com.zt.plat.module.infra.api.file.FileApi;
@@ -11,6 +12,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(value = "erpRpcConfiguration", proxyBeanMethods = false)
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, AdminUserApi.class, BusinessFileApi.class, FileApi.class, MaterialInfomationApi.class})
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, AdminUserApi.class, BusinessFileApi.class, FileApi.class, MaterialInfomationApi.class, InternalSupplyFactoryApi.class})
public class RpcConfiguration {
}

View File

@@ -7,6 +7,8 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.api.InternalSupplyFactoryApi;
import com.zt.plat.module.api.dto.internalsupplyfactory.InternalSupplyFactoryDTO;
import com.zt.plat.module.erp.utils.ErpConfig;
import com.zt.plat.module.erp.utils.MyRedisConfig;
import com.zt.plat.module.erp.enums.OftenEnum;
@@ -47,6 +49,8 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
private MyRedisConfig myRedisConfig;
@Resource
private ErpConfig erpConfig;
@Resource
private InternalSupplyFactoryApi internalSupplyFactoryApi;
@Override
public ErpFactoryRespVO createErpFactory(ErpFactorySaveReqVO createReqVO) {
@@ -98,13 +102,8 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
if (updateObj.getType().equals("ERP") || updateObj.getIsEnable().equals("1")) {
throw exception(ERP_FACTORY_NOT_ALLOW_UPDATE);
}
//不允许修改除了绑定工厂名称、绑定工厂编码和操作以外的信息
ErpFactoryDO erpFactoryDO = new ErpFactoryDO();
erpFactoryDO.setId(updateObj.getId());
erpFactoryDO.setRelnumber(updateObj.getRelnumber());
erpFactoryDO.setRelnumber(updateObj.getRelnumber());
erpFactoryDO.setOperationType(updateObj.getOperationType());
erpFactoryMapper.updateById(erpFactoryDO);
erpFactoryMapper.updateById(updateObj);
}
@Override
@@ -276,11 +275,9 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
// 批量新增和更新
if (!result.toInsert.isEmpty()) {
//自动绑定工厂
result.toInsert.forEach(r->{
r.setRelName(r.getName());
r.setRelnumber(r.getNumber());
});
erpFactoryMapper.insertBatch(result.toInsert);
//工厂绑定
internalSupplyFactoryApi.batchCreate(BeanUtils.toBean(result.toInsert, InternalSupplyFactoryDTO.class));
// 批量查询刚插入数据的id提升效率
List<String> insertedNumbers = result.toInsert.stream()
.map(ErpFactoryDO::getNumber)