新火炬后端单体项目初始化代码
zhangherong
2 天以前 34580ceb745eaeaf6f8a6188a779c0746a23b02d
src/main/java/org/jeecg/modules/base/service/impl/LineSideWarehouseServiceImpl.java
@@ -1,11 +1,15 @@
package org.jeecg.modules.base.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.base.entity.LineSideWarehouse;
import org.jeecg.modules.base.mapper.LineSideWarehouseMapper;
import org.jeecg.modules.base.service.ILineSideWarehouseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Collections;
import java.util.List;
/**
 * @Description: 线边仓库信息
@@ -16,4 +20,23 @@
@Service
public class LineSideWarehouseServiceImpl extends ServiceImpl<LineSideWarehouseMapper, LineSideWarehouse> implements ILineSideWarehouseService {
    @Override
    public LineSideWarehouse queryByFactoryId(String factoryId) {
        LambdaQueryWrapper<LineSideWarehouse> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(LineSideWarehouse::getFactoryId, factoryId);
        LineSideWarehouse entity = this.getBaseMapper().selectOne(wrapper);
        if(entity != null) {
            entity.setWarehouseName(entity.getWarehouseName() + "(" + entity.getWarehouseCode() + ")");
        }
        return entity;
    }
    @Override
    public List<LineSideWarehouse> queryByProductionType(String productionType) {
        if(StringUtils.isBlank(productionType)) {
            return Collections.emptyList();
        }
        String[] types = productionType.split(",");
        return this.getBaseMapper().queryByProductionType(types);
    }
}