Commit 2abd90dc sunke

接口异常查询增加类型过滤,模糊查询增加唯一码查询

全部重发时根据过滤条件重发, 增加重发进度提示
1 个父辈 f946ddce
......@@ -98,8 +98,17 @@ public class InterfaceExceptionController {
}
@ApiOperation("全部重发")
@PostMapping("/reSendAll")
public ResultBean reSend() {
HikApiCache.sendFailedRequest();
return ResultBean.newOkResult("smfcore.api.reSendAll", "已全部重发", "");
public ResultBean reSend(InterfaceExCriteria criteria) {
Query query= QueryHelp.getQuery(criteria);
List<HikApiRequestError> requests = hikApiRequestErrorDao.findByQuery(query);
HikApiCache.sendFailedRequest(requests);
return ResultBean.newOkResult("smfcore.api.reSendAll", "操作成功", "");
}
@ApiOperation("获取重发进度")
@RequestMapping("/resendProcessMsg")
public String resendProcessMsg() {
return HikApiCache.resendProcessMsg;
}
}
......@@ -9,9 +9,12 @@ import java.util.Date;
@Data
public class InterfaceExCriteria {
@QueryCondition(blurry = "param.reqCode,param.userCode,param.data,responseParam.message,responseParam.data")
@QueryCondition(blurry = "apiType, param.reqCode,param.userCode,param.data.trayId")
private String blurry;
@QueryCondition
private String apiType;
@QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "createDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private BetweenData<Date> createDate;
......
......@@ -302,13 +302,17 @@ public class HikApi {
int inType=0;
if(param.getInType().equals(2)){
//入库类型(1=普通入库,2=并盘入库,3=截料入库,4=退料入库)
inType=2;
}else if(param.getInType().equals(3)){
inType=3;
}else if(param.getInType().equals(4)){
inType=1;
//paramInType为1=普通入库,2=并盘入库,3=截料入库,4=退料入库, 5=转储单入库
//入库类型inType(0普通入库1退料入库2并盘入库3截料入库 4 线边仓间转储入库)
int paramType = param.getInType();
if(paramType == 1){
inType = 0;//普通入库
}else if(paramType == 2){
inType = 2; //并盘入库
}else if(paramType == 3){
inType = 3; //截料入库
}else if(paramType == 4){
inType = 1; //退料入库
}
param.setInType(inType);
......@@ -494,7 +498,10 @@ public class HikApi {
dataMap.put("lgort", lgort);//库位
String businessType = "";
if(inType == 1){
//0普通入库 3截料入库
businessType = "0";
}else if(inType == 3){
businessType = "3";
}
dataMap.put("businessType", businessType);//库位
......
......@@ -92,14 +92,29 @@ public class HikApiCache {
}
public static String resendProcessMsg = "";
/**
* 获取失败列表,进行定时发送
*/
public static void sendFailedRequest() {
List<HikApiRequestError> failedList = hikApiRequestErrorDao.findAllFailedList();
public static void sendFailedRequest(List<HikApiRequestError> failedList) {
resendProcessMsg = "";
int total = failedList.size();
int ok = 0;
int failed = 0;
for (HikApiRequestError apiRequest : failedList) {
reSendRequest(apiRequest);
int index = ok + failed;
resendProcessMsg = "共["+total+"]个重发任务,已重发["+index+"]个,其中成功["+ok+"]个,NG["+failed+"]个";
ResponseParam responseParam = reSendRequest(apiRequest);
if(responseParam != null && responseParam.getCode() == 0){
ok = ok + 1;
}else{
failed = failed + 1;
}
index = index + 1;
resendProcessMsg = "共["+total+"]个重发任务,已重发["+index+"]个,其中成功["+ok+"]个,NG["+failed+"]个";
}
resendProcessMsg = "";
}
public static ResponseParam reSendRequest(HikApiRequestError apiRequest) {
......
......@@ -94,8 +94,8 @@ spring:
host: localhost # 主机地址
port: 27017 # 端口
database: hikvision # 数据库
minConSize: 10
maxConSize: 20
minConSize: 5
maxConSize: 5
messages:
encoding: utf-8
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!