ZengTao
4 小时以前 982bc1e3eb588021b2f73dfb04bfc78beb462db7
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
@@ -2,6 +2,7 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -10,14 +11,14 @@
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.damage.entity.Damage;
import com.mes.damage.mapper.DamageMapper;
import com.mes.damage.entity.request.DamageRequest;
import com.mes.damage.service.DamageService;
import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
import com.mes.damage.entity.request.DamageRequest;
import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.entity.vo.CutDrawingVO;
import com.mes.edgstoragecage.entity.vo.EdgSlotRemainVO;
import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper;
import com.mes.edgstoragecage.mapper.EdgStorageCageMapper;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
@@ -25,12 +26,15 @@
import com.mes.engineering.mapper.EngineeringMapper;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.largenscreen.entity.PieChartVO;
import com.mes.pp.entity.OptimizeHeatDetail;
import com.mes.pp.entity.OptimizeHeatLayout;
import com.mes.pp.entity.OptimizeProject;
import com.mes.pp.mapper.OptimizeHeatDetailMapper;
import com.mes.taskcache.entity.TaskCache;
import com.mes.taskcache.service.TaskCacheService;
import com.mes.uppattenusage.entity.UpPattenUsage;
import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -73,11 +77,14 @@
    @Autowired
    DamageService damageService;
    @Resource
    UpPattenUsageMapper upPattenUsageMapper;
    @Autowired
    EdgGlassTaskInfoService edgGlassTaskInfoService;
    @Override
    public List<CutDrawingVO> queryCurrentCutDrawing(int deviceId, int stationCell) {
    public JSONObject queryCurrentCutDrawing(int deviceId, int stationCell) {
//         获取本条线当前正在执行的工程
        Engineering engineering = engineeringMapper.selectOne(new LambdaQueryWrapper<Engineering>()
                .eq(Engineering::getState, 1).eq(Engineering::getStationCell, stationCell));
@@ -102,9 +109,21 @@
                patternSequence = lastGlass.getPatternSequence() + 1;
            } else {
                //当前版图是否有剩余,有剩余显示当前版图
                patternSequence = lastGlass.getPatternSequence();            }
                patternSequence = lastGlass.getPatternSequence();
            }
        }
        return baseMapper.queryCutDrawingByEngineerId(engineering.getEngineerId(), patternSequence, 0);
        JSONObject jsonObject = new JSONObject();
        List<CutDrawingVO> currentCutDrawings = baseMapper.queryCutDrawingByEngineerId(engineering.getEngineerId(), patternSequence, 0);
        jsonObject.append("currentCutTerritory", currentCutDrawings);
        if (CollectionUtil.isNotEmpty(currentCutDrawings)) {
            jsonObject.append("engineer", engineering.getEngineerId());
            jsonObject.append("sequence", patternSequence);
            UpPattenUsage upPattenUsage = upPattenUsageMapper.selectOne(new LambdaQueryWrapper<UpPattenUsage>()
                    .eq(UpPattenUsage::getEngineeringId, engineering.getEngineerId())
                    .eq(UpPattenUsage::getLayoutSequence, patternSequence));
            jsonObject.append("upPattenUsage", upPattenUsage);
        }
        return jsonObject;
    }
    @Override
@@ -114,6 +133,9 @@
        List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getEngineerId, engineerId));
        long totalPatternSequence = glassInfoList.stream().map(GlassInfo::getPatternSequence).distinct().count();
        map.put("totalPatternSequence", totalPatternSequence);
        UpPattenUsage upPattenUsage = upPattenUsageMapper.selectOne(new LambdaQueryWrapper<UpPattenUsage>().eq(UpPattenUsage::getEngineeringId, engineerId)
                .eq(UpPattenUsage::getLayoutSequence, patternSequence));
        map.put("upPattenUsage", upPattenUsage);
        return map;
    }
@@ -332,15 +354,30 @@
    }
    @Override
    public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height) {
        return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height);
    public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height, int cell, int maxThickness) {
        return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height, cell, maxThickness);
    }
    @Override
    public EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength, int maxThickness) {
        return baseMapper.queryEdgStorageDetailsByLimitSize(deviceId, currentCell, width, height, cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength, maxThickness);
    }
    @Override
    public String edgDetailsOperate(DamageRequest request) {
        //卧式理片笼爆破损
        damageService.autoSubmitReport(request.getGlassId(), request.getLine(), request.getWorkingProcedure(), "卧式理片笼", request.getState());
        this.remove(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId,request.getGlassId()));
        this.remove(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, request.getGlassId()));
        return "success";
    }
    @Override
    public List<EdgSlotRemainVO> querySlotRemainWidth(int cellLength, int glassGap) {
        return this.baseMapper.querySlotRemainWidth(cellLength, glassGap);
    }
    @Override
    public List<PieChartVO> queryPieChart() {
        return this.baseMapper.queryPieChart();
    }
}