chenlu
2025-11-21 d473c7b2b07cfeee3740f40dfdc95d722d8da3c2
north-glass-erp/src/main/java/com/example/erp/service/pp/GlassOptimizeService.java
@@ -18,6 +18,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -45,6 +46,9 @@
    GlassOptimizeMapper glassOptimizeMapper;
    @Autowired
    SysErrorService sysErrorService;
    @Value("${mesIp:localhost}")  // 注入mesIp配置,默认值为10.153.19.31
    private String mesIp;
    RabbitMQUtil rabbitMQUtil;
    //模拟计算
@@ -653,7 +657,10 @@
                }
            }
        }
        map.put("optimizeState", Integer.parseInt(stringObjectMap.get("optimize_state").toString()));
        map.put("data", dataList);
        map.put("project", glassOptimizeMapper.selectProjectCount(projectNo));
        map.put("grindingTrimming", glassOptimizeMapper.getGrindingTrimming(username));
        return map;
    }
@@ -1243,8 +1250,7 @@
        boolean  saveState=false;
        try {
            // 1. 创建URL对象
            URL url = new URL("http://10.153.19.31:88/api/loadGlass/engineering/importEngineer");
//            URL url = new URL("http://localhost:88/api/loadGlass/engineering/importEngineer");
            URL url = new URL("http://" + mesIp + ":88/api/loadGlass/engineering/importEngineer");
            // 2. 打开连接
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
@@ -1482,7 +1488,7 @@
        try {
            // 1. 创建URL对象
            URL url = new URL("http://10.153.19.31:88/api/loadGlass/engineering/optimizeCancelTask");
            URL url = new URL("http://" + mesIp + ":88/api/loadGlass/engineering/optimizeCancelTask");
//            URL url = new URL("http://localhost:88/api/loadGlass/engineering/optimizeCancelTask");