zhoushihao
2025-04-15 c6cb57f307b0c62a05cac78cfd828c313f10e611
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,10 +11,9 @@
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;
@@ -26,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;
@@ -74,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));
@@ -106,7 +112,18 @@
                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
@@ -116,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;
    }
@@ -339,6 +359,11 @@
    }
    @Override
    public EdgStorageCageDetails queryEdgStorageDetailsByLimitSize(int deviceId, Integer currentCell, double width, double height, int cell, int minOneFirstLength, int minOneSecondLength, int maxTwoFirstLength, int maxTwoSecondLength) {
        return baseMapper.queryEdgStorageDetailsByLimitSize(deviceId, currentCell, width, height, cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength);
    }
    @Override
    public String edgDetailsOperate(DamageRequest request) {
        //卧式理片笼爆破损
        damageService.autoSubmitReport(request.getGlassId(), request.getLine(), request.getWorkingProcedure(), "卧式理片笼", request.getState());
@@ -350,4 +375,9 @@
    public List<EdgSlotRemainVO> querySlotRemainWidth(int cellLength, int glassGap) {
        return this.baseMapper.querySlotRemainWidth(cellLength, glassGap);
    }
    @Override
    public List<PieChartVO> queryPieChart(){
        return this.baseMapper.queryPieChart();
    }
}