Jelajahi Sumber

港区陆域状态刷新封装定时任务封装统一返回结果

zoro 10 bulan lalu
induk
melakukan
cf8a5039e5

+ 3 - 2
src/main/java/tech/powerjob/work/service/impl/PortDrawFlashServiceImpl.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
 import tech.powerjob.work.mapper.PortDrawFlashMapper;
 import tech.powerjob.work.service.PortDrawFlashService;
 import tech.powerjob.work.util.DateUtils;
+import tech.powerjob.work.util.ReturnMsg;
 import tech.powerjob.worker.core.processor.ProcessResult;
 
 import javax.annotation.Resource;
@@ -24,11 +25,11 @@ public class PortDrawFlashServiceImpl implements PortDrawFlashService {
         List<String> drawIds = portDrawFlashMapper.getAllNeedRemoveData();
         if (drawIds.isEmpty()){
             log.info(DateUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:SS") + "不需要移除港区陆域数据");
-            return new ProcessResult(true,"无需删除");
+            return ReturnMsg.returnMsg(true,"无需删除");
         }else {
             log.info(DateUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:SS") + "移除的港区陆域数据为{}", drawIds);
             portDrawFlashMapper.removeAllByIds(drawIds);
-            return new ProcessResult(true,"删除成功");
+            return ReturnMsg.returnMsg(true,"删除成功");
         }
     }
 }

+ 14 - 0
src/main/java/tech/powerjob/work/util/ReturnMsg.java

@@ -0,0 +1,14 @@
+package tech.powerjob.work.util;
+
+import tech.powerjob.worker.core.processor.ProcessResult;
+
+public class ReturnMsg extends ProcessResult {
+
+    public static ProcessResult returnMsg(Boolean isSuccess, String msg) {
+        return new ProcessResult(isSuccess, msg);
+    }
+
+    public static ProcessResult returnMsg(Boolean isSuccess) {
+        return new ProcessResult(isSuccess);
+    }
+}

+ 2 - 2
src/main/resources/application.properties

@@ -19,9 +19,9 @@ powerjob.worker.protocol=http
 powerjob.worker.max-result-length=4096
 # Max length of appended workflow context . Appended workflow context value that is longer than the value will be ignore.
 powerjob.worker.max-appended-wf-context-length=4096
-spring.datasource.url=jdbc:kingbase8://10.83.240.181:54322/kingbase
+spring.datasource.url=jdbc:kingbase8://174.0.123.203:54323/kingbase
 spring.datasource.username=system
-spring.datasource.password=Ghzx2023!
+spring.datasource.password=12345678ab
 spring.datasource.driver-class-name=com.kingbase8.Driver
 spring.datasource.hikari.maximum-pool-size=60
 spring.datasource.hikari.maximum-idle=15

+ 2 - 2
src/main/resources/mapper/PortDrawFlashMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="tech.powerjob.work.mapper.PortDrawFlashMapper">
     <delete id="removeAllByIds">
-        delete from GHJG_BUSSINESS.PORT_UNIT_DRAW_NEW where id in
+        delete from GHJG_PORT_MANAGE.PORT_UNIT_DRAW_NEW where id in
         <foreach collection="drawIds" open="(" close=")" separator="," index="index" item="item">
             #{item}
         </foreach>
@@ -10,7 +10,7 @@
 
     <select id="getAllNeedRemoveData" resultType="java.lang.String">
         select distinct p.id
-        from GHJG_BUSSINESS.PORT_UNIT_DRAW_NEW p
+        from GHJG_PORT_MANAGE.PORT_UNIT_DRAW_NEW p
                  left join GHJG_BASICS.VW_CERT_INFO v
                            on p.UNITNAME = v.CNAME and p.CERTNUMBER = v.CERTNUMBER
         where v.STATUS_STR = '注销'