rev:工单下发接口兼容暂停工单;opt:删除useragent
This commit is contained in:
@@ -405,17 +405,17 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 解析客户端操作系统、浏览器信息 -->
|
<!-- 解析客户端操作系统、浏览器信息 -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>nl.basjes.parse.useragent</groupId>
|
<!-- <groupId>nl.basjes.parse.useragent</groupId>-->
|
||||||
<artifactId>yauaa</artifactId>
|
<!-- <artifactId>yauaa</artifactId>-->
|
||||||
<version>5.23</version>
|
<!-- <version>5.23</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>eu.bitwalker</groupId>
|
<!-- <groupId>eu.bitwalker</groupId>-->
|
||||||
<artifactId>UserAgentUtils</artifactId>
|
<!-- <artifactId>UserAgentUtils</artifactId>-->
|
||||||
<version>1.21</version>
|
<!-- <version>1.21</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<!-- Lucence核心包 -->
|
<!-- Lucence核心包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -427,11 +427,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
errArr.add(json);
|
errArr.add(json);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(produceshiftorderService.findByCode(workorder_code))) {
|
ProduceshiftorderDto byCode = produceshiftorderService.findByCode(workorder_code);
|
||||||
JSONObject json = new JSONObject();
|
if (ObjectUtil.isNotEmpty(byCode)) {
|
||||||
json.put("workorder_id", workorder_id);
|
if (!byCode.getOrder_status().equals(WorkerOrderEnum.FORCEFINISH.getCode())&&!byCode.getOrder_status().equals(WorkerOrderEnum.COMPLETE.getCode())){
|
||||||
json.put("message", "工单编码不能重复");
|
JSONObject json = new JSONObject();
|
||||||
errArr.add(json);
|
json.put("workorder_id", workorder_id);
|
||||||
|
json.put("message", "下发执行工单不是完成状态");
|
||||||
|
errArr.add(json);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(material_code)) {
|
if (StrUtil.isEmpty(material_code)) {
|
||||||
@@ -506,7 +509,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resultJson.put("status", 400);
|
resultJson.put("status", 400);
|
||||||
}
|
}
|
||||||
resultJson.put("errArr", errArr);
|
resultJson.put("errArr", errArr);
|
||||||
resultJson.put("message", errArr.size() > 0 ? "存在下发未成功的工单!" : "下发成功!");
|
resultJson.put("message", errArr.size() > 0 ? "工单下发失败:"+errArr.getJSONObject(0).getString("message") : "下发成功!");
|
||||||
resultJson.put("data", new JSONObject());
|
resultJson.put("data", new JSONObject());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
resultJson.put("status", 400);
|
resultJson.put("status", 400);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.nl.acs.opc;
|
package org.nl.acs.opc;
|
||||||
|
|
||||||
import eu.bitwalker.useragentutils.DeviceType;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|||||||
@@ -256,6 +256,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
|
wo.delete("workorder_code = '"+dto.getOrder_code()+"'");
|
||||||
|
this.order.removeIf(o -> o.getOrder_code().equals(dto.getOrder_code()));
|
||||||
wo.insert(json);
|
wo.insert(json);
|
||||||
order.add(dto);
|
order.add(dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
|
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
|
||||||
import net.dreamlu.mica.ip2region.core.IpInfo;
|
import net.dreamlu.mica.ip2region.core.IpInfo;
|
||||||
import nl.basjes.parse.useragent.UserAgent;
|
//import nl.basjes.parse.useragent.UserAgent;
|
||||||
import nl.basjes.parse.useragent.UserAgentAnalyzer;
|
//import nl.basjes.parse.useragent.UserAgentAnalyzer;
|
||||||
import org.nl.modules.common.config.ElAdminProperties;
|
import org.nl.modules.common.config.ElAdminProperties;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
|
||||||
@@ -50,13 +50,13 @@ public class StringUtils {
|
|||||||
private final static Ip2regionSearcher IP_SEARCHER = SpringContextHolder.getBean(Ip2regionSearcher.class);
|
private final static Ip2regionSearcher IP_SEARCHER = SpringContextHolder.getBean(Ip2regionSearcher.class);
|
||||||
|
|
||||||
|
|
||||||
private static final UserAgentAnalyzer USER_AGENT_ANALYZER = UserAgentAnalyzer
|
// private static final UserAgentAnalyzer USER_AGENT_ANALYZER = UserAgentAnalyzer
|
||||||
.newBuilder()
|
// .newBuilder()
|
||||||
.hideMatcherLoadStats()
|
// .hideMatcherLoadStats()
|
||||||
.withCache(1)
|
// .withCache(1)
|
||||||
// .withCache(10000)
|
//// .withCache(10000)
|
||||||
.withField(UserAgent.AGENT_NAME_VERSION)
|
// .withField(UserAgent.AGENT_NAME_VERSION)
|
||||||
.build();
|
// .build();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驼峰命名法工具
|
* 驼峰命名法工具
|
||||||
@@ -213,8 +213,8 @@ public class StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getBrowser(HttpServletRequest request) {
|
public static String getBrowser(HttpServletRequest request) {
|
||||||
UserAgent.ImmutableUserAgent userAgent = USER_AGENT_ANALYZER.parse(request.getHeader("User-Agent"));
|
// UserAgent.ImmutableUserAgent userAgent = USER_AGENT_ANALYZER.parse(request.getHeader("User-Agent"));
|
||||||
return userAgent.get(UserAgent.AGENT_NAME_VERSION).getValue();
|
return "user-Agent";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user