| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.OptimizeGlassinfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | |
| | | public class GlassInfoServiceImpl extends MPJBaseServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | @Autowired |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | |
| | | @Override |
| | | @DS("pp") |
| | | public List<GlassInfo> selectGlassInfo(String engineeringId) { |
| | | List<OptimizeGlassinfo> optimizeGlassinfos=null; |
| | | List<OptimizeGlassinfo> optimizeGlassinfos = null; |
| | | if (engineeringId != null) { |
| | | optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("b.process_id,t.type,b.width,b.height,t.glass_thickness,t.glass_type,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,b.x_axis,b.y_axis,b.project_no,b.glass_id") |
| | | .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") |
| | | .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") |
| | | //.eq("t.state",100) |
| | | .eq("t.project_no", engineeringId)); |
| | | } |
| | | |
| | | //order_sort,o_width,o_height |
| | | // 创建一个 List 用于保存映射后的实体对象 |
| | | List<GlassInfo> resultList = new ArrayList<>(); |
| | | |
| | | if(optimizeGlassinfos!=null){ |
| | | if (optimizeGlassinfos != null) { |
| | | for (OptimizeGlassinfo map : optimizeGlassinfos) { |
| | | // 创建一个新的 OptimizeGlassinfo 对象 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | |
| | | glassInfo.setEngineerId(map.getProjectNo()); |
| | | glassInfo.setFlowCardId(map.getProcessId()); |
| | | glassInfo.setFilmsid(map.getGlassType()); |
| | | glassInfo.setGlassType(map.getType()); |
| | | glassInfo.setWidth(map.getWidth()); |
| | | glassInfo.setHeight(map.getHeight()); |
| | | glassInfo.setGlassType(map.getOrderSort());//订单序号 |
| | | glassInfo.setWidth(map.getOWidth());//订单宽 |
| | | glassInfo.setHeight(map.getOHeight());//订单高 |
| | | glassInfo.setEdgWidth(map.getPWidth()); |
| | | glassInfo.setLayer(map.getLayer()); |
| | | glassInfo.setTotalLayer(map.getTotalLayer()); |
| | |
| | | glassInfo.setTemperingFeedSequence(map.getHeatLayoutSort());//钢化版图顺序 |
| | | glassInfo.setXCoordinate(map.getXAxis()); |
| | | glassInfo.setYCoordinate(map.getYAxis()); |
| | | |
| | | glassInfo.setAngle(map.getRotateAngle()); |
| | | glassInfo.setGlassId(map.getGlassId()); |
| | | // 将映射后的对象添加到结果列表中 |
| | | resultList.add(glassInfo); |
| | | } |
| | | } |
| | | log.info("查询出glassinfo的数据{}:",resultList); |
| | | log.info("查询出glassinfopro的数据{}:",optimizeGlassinfos); |
| | | log.info("查询出glassinfo的数据{}:", resultList); |
| | | log.info("查询出glassinfopro的数据{}:", optimizeGlassinfos); |
| | | return resultList; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | return map; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | log.info("result: {}", result); |
| | | log.info("result: {}", result); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |