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