wuxw пре 2 година
родитељ
комит
7e654f0bdb

+ 10 - 1
service-job/src/main/java/com/java110/job/databus/DatabusDataExecutor.java

@@ -1,11 +1,15 @@
 package com.java110.job.databus;
 
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.data.DatabusQueueDataDto;
+import com.java110.dto.log.LogSystemErrorDto;
 import com.java110.job.adapt.IDatabusAdapt;
 import com.java110.job.importData.ImportDataQueue;
+import com.java110.po.log.LogSystemErrorPo;
 import com.java110.utils.factory.ApplicationContextFactory;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.ExceptionUtil;
 import org.slf4j.Logger;
 
 import java.util.concurrent.*;
@@ -70,7 +74,12 @@ public class DatabusDataExecutor implements Runnable {
         FutureTask<String> futureTask = new FutureTask<>(new Callable<String>() {
             @Override
             public String call() throws Exception {
-                databusAdaptImpl.execute(databusQueueDataDto.getBusiness(), databusQueueDataDto.getBusinesses());
+                try {
+                    databusAdaptImpl.execute(databusQueueDataDto.getBusiness(), databusQueueDataDto.getBusinesses());
+                }catch (Exception e){
+                    e.printStackTrace();
+                    log.error("执行databus失败", e);
+                }
                 return "";
             }
         });

+ 1 - 4
service-job/src/main/java/com/java110/job/msgNotify/wechat/WechatMsgNotifyImpl.java

@@ -82,7 +82,6 @@ public class WechatMsgNotifyImpl implements IMsgNotify {
     private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
 
 
-
     @Autowired
     private RestTemplate outRestTemplate;
 
@@ -239,8 +238,6 @@ public class WechatMsgNotifyImpl implements IMsgNotify {
             }
 
 
-
-
             openId = staffAppAuthDtos.get(0).getOpenId();
         }
         JSONObject data = new JSONObject();
@@ -340,7 +337,7 @@ public class WechatMsgNotifyImpl implements IMsgNotify {
         staffAppAuthDto.setStaffId(userId);
         staffAppAuthDto.setAppType("WECHAT");
         List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto);
-        if (staffAppAuthDtos == null || staffAppAuthDtos.size() < 1) {
+        if (ListUtil.isNull(staffAppAuthDtos)) {
             throw new IllegalArgumentException("员工未认证,没有获取到微信openId");
         }
         String openId = staffAppAuthDtos.get(0).getOpenId();

+ 11 - 10
service-order/src/main/java/com/java110/order/smo/impl/AsynNotifySubServiceImpl.java

@@ -16,6 +16,7 @@ import com.java110.order.smo.IAsynNotifySubService;
 import com.java110.utils.cache.DatabusCache;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.DomainContant;
+import com.java110.utils.util.ListUtil;
 import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
 import com.java110.core.log.LoggerFactory;
@@ -66,9 +67,9 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
             httpEntity = new HttpEntity<String>(params.toJSONString(), header);
             //通过fallBack 的方式生成Business
 
-            if(Environment.isStartBootWay()){
+            if (Environment.isStartBootWay()) {
                 outRestTemplate.exchange(BOOT_FALLBACK_URL, HttpMethod.POST, httpEntity, String.class);
-            }else {
+            } else {
                 restTemplate.exchange(FALLBACK_URL.replace(SERVICE_NAME, orderItemDto.getServiceName()), HttpMethod.POST, httpEntity, String.class);
             }
         } catch (Exception e) {
@@ -81,8 +82,8 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
     public void notifyDatabus(List<Map> orderItemMaps, OrderDto orderDto) {
 
 
-        if (orderItemMaps == null || orderItemMaps.size() < 1) {
-            return ;
+        if (ListUtil.isNull(orderItemMaps)) {
+            return;
         }
         //触发databug
         //查询 事务项
@@ -96,12 +97,12 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
         String databusSwitch = MappingCache.getValue(DomainContant.COMMON_DOMAIN, DATABUS_SWITCH);
 
         if (!DATABUS_SWITCH_ON.equals(databusSwitch)) {
-            return ;
+            return;
         }
         List<BusinessDatabusDto> databusDtos = DatabusCache.getDatabuss();
 
         if (!hasTypeCd(databusDtos, businesses) || !SecureInvocation.secure(this.getClass())) {
-            return ;
+            return;
         }
 
         try {
@@ -188,11 +189,11 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
             case "MOD":
                 params = new JSONArray();
                 JSONArray paramDels = generateBusinessDelInsertSql(orderItemDto, businessTableHisDto);
-                for(int delIndex = 0 ; delIndex < paramDels.size(); delIndex ++){
+                for (int delIndex = 0; delIndex < paramDels.size(); delIndex++) {
                     params.add(paramDels.getJSONObject(delIndex));
                 }
                 JSONArray paramAdds = generateBusinessInsertInsertSql(orderItemDto, businessTableHisDto);
-                for(int addIndex = 0 ; addIndex < paramAdds.size(); addIndex ++){
+                for (int addIndex = 0; addIndex < paramAdds.size(); addIndex++) {
                     params.add(paramAdds.getJSONObject(addIndex));
                 }
                 break;
@@ -223,7 +224,7 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
         JSONArray afterValues = logTextObj.getJSONArray("afterValue");
         for (int afterValueIndex = 0; afterValueIndex < afterValues.size(); afterValueIndex++) {
             sql = "insert into " + businessTableHisDto.getActionObjHis() + " ";
-            updateSql = "update " + businessTableHisDto.getActionObj() +" set b_id='"+orderItemDto.getbId()+"' where 1=1 ";
+            updateSql = "update " + businessTableHisDto.getActionObj() + " set b_id='" + orderItemDto.getbId() + "' where 1=1 ";
 
             param = new JSONObject();
             updateParam = new JSONObject();
@@ -240,7 +241,7 @@ public class AsynNotifySubServiceImpl implements IAsynNotifySubService {
                 keySql += (key + ",");
                 valueSql += (keyValue.getString(key) + ",");
 
-                updateSql += (" and "+key +"=" + keyValue.getString(key));
+                updateSql += (" and " + key + "=" + keyValue.getString(key));
             }
             keySql += "operate,b_id";
             valueSql += "'ADD','" + orderItemDto.getbId() + "'";