|
@@ -1,8 +1,6 @@
|
|
|
package org.jeecg.modules.splfi.controller;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.IOException;
|
|
|
+import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.*;
|
|
@@ -16,6 +14,7 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.GsonBuilder;
|
|
@@ -1167,12 +1166,30 @@ public class SyPackingListFabricController implements Job {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public static String getExceptionStr(Exception e) throws IOException {
|
|
|
+ //读取异常栈信息
|
|
|
+ ByteArrayOutputStream arrayOutputStream=new ByteArrayOutputStream();
|
|
|
+ e.printStackTrace(new PrintStream(arrayOutputStream));
|
|
|
+ //通过ByteArray转换输入输出流
|
|
|
+ BufferedReader fr=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(arrayOutputStream.toByteArray())));
|
|
|
+ String str;
|
|
|
+ StringBuilder exceptionStr=new StringBuilder();
|
|
|
+ while ((str=fr.readLine())!=null){
|
|
|
+ exceptionStr.append(str);
|
|
|
+ }
|
|
|
+ //关闭流
|
|
|
+ fr.close();
|
|
|
+ return exceptionStr.toString();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void execute(JobExecutionContext context) throws JobExecutionException {
|
|
|
|
|
|
QueryWrapper<SyPackingListFabric> queryWrapper=new QueryWrapper();
|
|
|
queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or()
|
|
|
- .like("recording_Error","超时").or().like("recording_Error","null"))) ;//推送中
|
|
|
+ .like("recording_Error","超时").or().eq("recording_Error","null")
|
|
|
+ .or().eq("recording_Error","nullnull")
|
|
|
+ .or().eq("recording_Error","nullnullnull"))) ;//推送中
|
|
|
//queryWrapper.or();
|
|
|
//queryWrapper.like();//超时
|
|
|
List<SyPackingListFabric> syPackingListFabrics=syPackingListFabricService.list(queryWrapper);//修改调整
|
|
@@ -1296,6 +1313,9 @@ public class SyPackingListFabricController implements Job {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
message+=e.getMessage();
|
|
|
+ System.out.println("面辅料批量推送报错");
|
|
|
+ String msg2=getExceptionStr(e);
|
|
|
+ log.info("面辅料批量推送报错\t"+msg2);
|
|
|
if(map.get("account").equals(account)){
|
|
|
break;
|
|
|
}
|
|
@@ -1650,11 +1670,12 @@ public class SyPackingListFabricController implements Job {
|
|
|
return Result.ok("更新了"+num+"条数据");
|
|
|
}
|
|
|
|
|
|
- /*@AutoLog(value = "获取数据")
|
|
|
+ @AutoLog(value = "获取数据")
|
|
|
@ApiOperation(value="获取数据", notes="获取数据")
|
|
|
- @GetMapping(value = "/getMessage")*/
|
|
|
- public String getMessage( ) {
|
|
|
- return "更新了6条数据";
|
|
|
+ @GetMapping(value = "/getMessage2")
|
|
|
+ public List<String> getMessage(int max) {
|
|
|
+ List<String> codes=syPackingListTailoringService.getRedisSno(max);
|
|
|
+ return codes;
|
|
|
}
|
|
|
|
|
|
}
|