Browse Source

修改异步不调用问题

LAPTOP-BJJ3IV5R\SIWEI 1 year ago
parent
commit
2575dccce3

+ 5 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fzss/HgxfxServiceImpl.java

@@ -6,6 +6,7 @@ import com.onemap.apply.mapper.fzss.*;
 import com.onemap.apply.service.fzss.IHgxfxService;
 import com.onemap.apply.service.fzss.IHgxfxService;
 import com.onemap.apply.service.impl.fzss.hgxfxjg.HgxfxHandleService;
 import com.onemap.apply.service.impl.fzss.hgxfxjg.HgxfxHandleService;
 import com.onemap.apply.service.impl.fzss.hgxfxjg.HgxfxJgService;
 import com.onemap.apply.service.impl.fzss.hgxfxjg.HgxfxJgService;
+import com.onemap.apply.utils.FixedThreadUtil;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.system.api.AnalyseService;
 import com.onemap.system.api.AnalyseService;
@@ -96,7 +97,7 @@ public class HgxfxServiceImpl implements IHgxfxService {
         if (StringUtils.isEmpty(xzfw)) {
         if (StringUtils.isEmpty(xzfw)) {
             return RequestResult.error("选址范围参数为空");
             return RequestResult.error("选址范围参数为空");
         }
         }
-        Double area = Double.valueOf( xzfw.get("area").toString());
+        Double area = Double.valueOf(xzfw.get("area").toString());
         String ewkt = (String) xzfw.get("geom");
         String ewkt = (String) xzfw.get("geom");
         if (StringUtils.isEmpty(ewkt)) {
         if (StringUtils.isEmpty(ewkt)) {
             return RequestResult.error("选址范围参数为空");
             return RequestResult.error("选址范围参数为空");
@@ -118,8 +119,9 @@ public class HgxfxServiceImpl implements IHgxfxService {
             scxRw.setBsm(StringUtils.getUUID());
             scxRw.setBsm(StringUtils.getUUID());
             hgxfxScxRwMapper.insert(scxRw);
             hgxfxScxRwMapper.insert(scxRw);
         }
         }
-
-        hxfxHandleService.hgxfxHandle(hgxfxDTO.getBsm(), ewkt);
+        FixedThreadUtil.FIXED_THREAD_POOL.execute(() -> {
+            hxfxHandleService.hgxfxHandle(hgxfxDTO.getBsm(), ewkt);
+        });
         return RequestResult.success(hgxfxDTO.getBsm());
         return RequestResult.success(hgxfxDTO.getBsm());
     }
     }
 
 

+ 3 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fzss/hgxfxjg/HgxfxHandleService.java

@@ -33,6 +33,9 @@ public class HgxfxHandleService {
 
 
     @Async
     @Async
     public void hgxfxHandle(String bsm, String ewkt) {
     public void hgxfxHandle(String bsm, String ewkt) {
+        System.out.println("进入hgxfxHandle.....................");
+        System.out.println("进入hgxfxHandle.....................");
+        System.out.println("进入hgxfxHandle.....................");
         QueryWrapper<HgxfxDTO> hgxfxWrapper = new QueryWrapper<HgxfxDTO>();
         QueryWrapper<HgxfxDTO> hgxfxWrapper = new QueryWrapper<HgxfxDTO>();
         hgxfxWrapper.eq("bsm", bsm);
         hgxfxWrapper.eq("bsm", bsm);
         HgxfxDTO hgxfxDTO = hgxfxMapper.selectOne(hgxfxWrapper);
         HgxfxDTO hgxfxDTO = hgxfxMapper.selectOne(hgxfxWrapper);