wu
2024-09-09 39074eeb5b58bbb20637401bfb41b96fd27cec8c
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -11,9 +11,9 @@
import com.mes.pp.entity.OptimizeProject;
import com.mes.pp.mapper.OptimizeProjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -31,7 +31,7 @@
@Service
@Slf4j
public class GlassInfoServiceImpl extends MPJBaseServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
    @Autowired
    @Resource
    OptimizeProjectMapper optimizeProjectMapper;
    @Override
@@ -40,13 +40,13 @@
        List<OptimizeGlassinfo> optimizeGlassinfos = null;
        if (engineeringId != null) {
            optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>()
                    .select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle")
                    .select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle,d.merge")
                    .leftJoin("optimize_detail b on t.project_no=b.project_no")
                                    .leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort")
                    .leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort")
                    .leftJoin("flow_card d on d.process_id=b.process_id and d.technology_number=b.layer and  d.order_number=b.order_sort ")
                    //.eq("t.state",100)
                    .eq("t.project_no", engineeringId));
        }
        //order_sort,o_width,o_height
        // 创建一个 List 用于保存映射后的实体对象
        List<GlassInfo> resultList = new ArrayList<>();
@@ -73,6 +73,7 @@
                glassInfo.setYCoordinate(map.getYAxis());
                glassInfo.setAngle(map.getRotateAngle());
                glassInfo.setGlassId(map.getGlassId());
                glassInfo.setCombine(map.getMerge());
                // 将映射后的对象添加到结果列表中
                resultList.add(glassInfo);
            }
@@ -89,7 +90,7 @@
    @Override
    public int getGlassInfoCountByFlowCardId(String flowCardId,int layer) {
    public int getGlassInfoCountByFlowCardId(String flowCardId, int layer) {
        return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda()
                .eq(GlassInfo::getFlowCardId, flowCardId)
                .eq(GlassInfo::getLayer, layer));
@@ -121,7 +122,7 @@
        List<Map<String, Object>> result = glassInfos.stream()
                .map(glassInfo -> {
                    Map<String, Object> map = new HashMap<>();
                    map.put("flow_card_id", glassInfo.getFlowCardId()+" | "+glassInfo.getLayer());
                    map.put("flow_card_id", glassInfo.getFlowCardId() + " | " + glassInfo.getLayer());
                    // 如果还有其他字段需要添加到 map 中,在这里继续添加
                    return map;
                })