add:增加升级版本信息和文件路径接口。
This commit is contained in:
@@ -9,8 +9,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.anno.Log;
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.utils.api.CommonResult;
|
|
||||||
import org.nl.common.utils.api.RestBusinessTemplate;
|
|
||||||
import org.nl.common.utils.api.ResultCode;
|
import org.nl.common.utils.api.ResultCode;
|
||||||
import org.nl.modules.common.exception.BizCoreException;
|
import org.nl.modules.common.exception.BizCoreException;
|
||||||
import org.nl.wms.pda.dto.MaterialDto;
|
import org.nl.wms.pda.dto.MaterialDto;
|
||||||
@@ -19,7 +17,6 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -45,7 +42,7 @@ public class CacheLineHandController{
|
|||||||
public ResponseEntity<List<MaterialDto>> queryMaterial(@RequestBody JSONObject form) {
|
public ResponseEntity<List<MaterialDto>> queryMaterial(@RequestBody JSONObject form) {
|
||||||
log.info("海亮缓存线手持服务 [查询物料] 接口被请求, 请求参数-{}", form);
|
log.info("海亮缓存线手持服务 [查询物料] 接口被请求, 请求参数-{}", form);
|
||||||
String params = form.getString("search_bar");
|
String params = form.getString("search_bar");
|
||||||
//checkLength(params);
|
checkLength(params);
|
||||||
return new ResponseEntity<>(cacheLineHandService.queryMaterial(params), HttpStatus.OK);
|
return new ResponseEntity<>(cacheLineHandService.queryMaterial(params), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,11 +51,20 @@ public class CacheLineHandController{
|
|||||||
@ApiOperation("物料模糊查询")
|
@ApiOperation("物料模糊查询")
|
||||||
public ResponseEntity<JSONArray> materialQuery(@RequestBody JSONObject form) {
|
public ResponseEntity<JSONArray> materialQuery(@RequestBody JSONObject form) {
|
||||||
log.info("海亮缓存线手持服务 [查询物料] 接口被请求, 请求参数-{}", form);
|
log.info("海亮缓存线手持服务 [查询物料] 接口被请求, 请求参数-{}", form);
|
||||||
String params = form.getString("search_bar");
|
//String params = form.getString("search_bar");
|
||||||
//checkLength(params);
|
//checkLength(params);
|
||||||
return new ResponseEntity<>(cacheLineHandService.materialQuery(form.getString("search_bar")), HttpStatus.OK);
|
return new ResponseEntity<>(cacheLineHandService.materialQuery(form.getString("search_bar")), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/appUpdate")
|
||||||
|
@Log("app更新")
|
||||||
|
@ApiOperation("app更新")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<JSONArray> appUpdate() {
|
||||||
|
log.info("海亮缓存线手持服务 [app更新] 接口被请求");
|
||||||
|
return new ResponseEntity<>(cacheLineHandService.appUpdate(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 输入搜索条件校验,限制查询参数过短,模糊力度大
|
* 输入搜索条件校验,限制查询参数过短,模糊力度大
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import org.nl.common.utils.api.CommonResult;
|
import org.nl.common.utils.api.CommonResult;
|
||||||
import org.nl.wms.pda.dto.MaterialDto;
|
import org.nl.wms.pda.dto.MaterialDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 海亮缓存线手持服务
|
* 海亮缓存线手持服务
|
||||||
*
|
*
|
||||||
@@ -37,13 +37,21 @@ public interface CacheLineHandService{
|
|||||||
*/
|
*/
|
||||||
List<MaterialDto> queryMaterial(String param);
|
List<MaterialDto> queryMaterial(String param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app更新
|
||||||
|
* @return: app路径和版本
|
||||||
|
* @author gbx
|
||||||
|
* @date 2023/3/25
|
||||||
|
*/
|
||||||
|
JSONArray appUpdate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料模糊查询
|
* 物料模糊查询
|
||||||
*
|
*
|
||||||
* @Param: param 查询条件
|
* @Param: param 查询条件
|
||||||
* @return: 物料列表
|
* @return: 物料列表
|
||||||
* @author gbx
|
* @author gbx
|
||||||
* @date 2023/3/25
|
* @date 2023/4/3
|
||||||
*/
|
*/
|
||||||
JSONArray materialQuery(String param);
|
JSONArray materialQuery(String param);
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,8 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.*;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -65,6 +63,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
return WQL.getWO("PDA_QUERY").addParam("flag", "6").addParam("condition", param).process().getResultJSONArray(0);
|
return WQL.getWO("PDA_QUERY").addParam("flag", "6").addParam("condition", param).process().getResultJSONArray(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONArray appUpdate() {
|
||||||
|
return WQL.getWO("PDA_QUERY").addParam("flag", "11").process().getResultJSONArray(0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaterialDto> queryMaterial(String param) {
|
public List<MaterialDto> queryMaterial(String param) {
|
||||||
// StopWatch stopWatch = new StopWatch();
|
// StopWatch stopWatch = new StopWatch();
|
||||||
@@ -113,7 +115,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
private List<MaterialDto> getMaterialDto(List<MaterialDto> materialList, String param) {
|
private List<MaterialDto> getMaterialDto(List<MaterialDto> materialList, String param) {
|
||||||
if(StringUtils.isNotEmpty(param)) {
|
if(StringUtils.isNotEmpty(param)) {
|
||||||
//按条件搜索
|
//按条件搜索
|
||||||
materialList = materialList.stream().filter(m -> (m.getMaterial_name().indexOf(param) > -1) || (m.getMaterial_code().indexOf(param)) > -1 || (m.getMaterial_spec().indexOf(param)) > -1 || (m.getClass_name().indexOf(param)) > -1).collect(Collectors.toList());
|
materialList = materialList.stream().filter(m -> (m.getMaterial_name().contains(param)) || m.getMaterial_code().contains(param) || m.getMaterial_spec().contains(param) || m.getClass_name().contains(param)).collect(Collectors.toList());
|
||||||
return materialList;
|
return materialList;
|
||||||
}
|
}
|
||||||
return materialList;
|
return materialList;
|
||||||
@@ -189,6 +191,11 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
if(StrUtil.isNotEmpty(whereJson.getString("page")) && StrUtil.isNotEmpty(whereJson.getString("size"))) {
|
if(StrUtil.isNotEmpty(whereJson.getString("page")) && StrUtil.isNotEmpty(whereJson.getString("size"))) {
|
||||||
pageNumber = whereJson.getInteger("page");
|
pageNumber = whereJson.getInteger("page");
|
||||||
pageSize = whereJson.getInteger("size");
|
pageSize = whereJson.getInteger("size");
|
||||||
|
//平板暂时无分页
|
||||||
|
if(pageNumber == 1) {
|
||||||
|
pageNumber = 0;
|
||||||
|
pageSize = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = WQL.getWO("PDA_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageNumber, pageSize), "task.update_time desc");
|
JSONObject jsonObject = WQL.getWO("PDA_QUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageNumber, pageSize), "task.update_time desc");
|
||||||
String size = jsonObject.getString("totalElements");
|
String size = jsonObject.getString("totalElements");
|
||||||
@@ -210,7 +217,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
//8-取消、7-完成、5-任务下发,根据操作类型执行相关操作
|
//8-取消、7-完成、5-任务下发,根据操作类型执行相关操作
|
||||||
if(StatusEnum.TASK_CANNEL.getCode().equals(optType) || StatusEnum.TASK_FINISH.getCode().equals(optType)) {
|
if(StatusEnum.TASK_CANNEL.getCode().equals(optType) || StatusEnum.TASK_FINISH.getCode().equals(optType)) {
|
||||||
return RestBusinessTemplate.execute(() -> updateTaskStatus(taskObject, optType));
|
//无取消这个状态了,取消和完成操作对应状态都是完成
|
||||||
|
optType = StatusEnum.TASK_FINISH.getCode();
|
||||||
|
String finalOptType = optType;
|
||||||
|
return RestBusinessTemplate.execute(() -> updateTaskStatus(taskObject, finalOptType));
|
||||||
}
|
}
|
||||||
//任务下发
|
//任务下发
|
||||||
else if(StatusEnum.TASK_PUBLISH.getCode().equals(optType)) {
|
else if(StatusEnum.TASK_PUBLISH.getCode().equals(optType)) {
|
||||||
@@ -258,7 +268,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
Collection<String> cacheLineVehilesSub = CollectionUtils.subtract(cacheLineVehiles, relationVehiles);
|
Collection<String> cacheLineVehilesSub = CollectionUtils.subtract(cacheLineVehiles, relationVehiles);
|
||||||
Collection<String> relationVehilesSub = CollectionUtils.subtract(relationVehiles, cacheLineVehiles);
|
Collection<String> relationVehilesSub = CollectionUtils.subtract(relationVehiles, cacheLineVehiles);
|
||||||
if(!CollectionUtils.isEmpty(relationVehilesSub)) {
|
if(!CollectionUtils.isEmpty(relationVehilesSub)) {
|
||||||
String sql = relationVehilesSub.stream().collect(Collectors.joining("','"));
|
String sql = String.join("','", relationVehilesSub);
|
||||||
ivtTab.delete("cacheline_code = '" + cachelineCode + "' and vehicle_code in ('" + sql + "')");
|
ivtTab.delete("cacheline_code = '" + cachelineCode + "' and vehicle_code in ('" + sql + "')");
|
||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(cacheLineVehilesSub)) {
|
if(!CollectionUtils.isEmpty(cacheLineVehilesSub)) {
|
||||||
@@ -652,7 +662,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
@Override
|
@Override
|
||||||
public CommonResult<Integer> cacheLineOutBoxExceptionConfirm(JSONObject param) {
|
public CommonResult<Integer> cacheLineOutBoxExceptionConfirm(JSONObject param) {
|
||||||
String inOut_type = param.getString("inOut_type");
|
String inOut_type = param.getString("inOut_type");
|
||||||
inOut_type = "1";
|
|
||||||
String cacheLine_code = param.getString("wcsdevice_code");
|
String cacheLine_code = param.getString("wcsdevice_code");
|
||||||
String position_code = param.getString("position_code");
|
String position_code = param.getString("position_code");
|
||||||
String vehicle_code = param.getString("vehicle_code");
|
String vehicle_code = param.getString("vehicle_code");
|
||||||
@@ -848,8 +857,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
public JSONArray getCacheLine(JSONObject param) {
|
public JSONArray getCacheLine(JSONObject param) {
|
||||||
// 生产区域
|
// 生产区域
|
||||||
String product_area = param.getString("product_area");
|
String product_area = param.getString("product_area");
|
||||||
JSONArray resultJSONArray = WQL.getWO("PDA_QUERY").addParamMap(MapOf.of("flag", "7", "product_area", product_area)).process().getResultJSONArray(0);
|
return WQL.getWO("PDA_QUERY").addParamMap(MapOf.of("flag", "7", "product_area", product_area)).process().getResultJSONArray(0);
|
||||||
return resultJSONArray;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -867,8 +875,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONArray getProductArea() {
|
public JSONArray getProductArea() {
|
||||||
JSONArray res = WQL.getWO("PDA_QUERY").addParamMap(MapOf.of("flag", "9")).process().getResultJSONArray(0);
|
return WQL.getWO("PDA_QUERY").addParamMap(MapOf.of("flag", "9")).process().getResultJSONArray(0);
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -292,6 +292,18 @@
|
|||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "11"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
a.`value` url,
|
||||||
|
b.`value` versionName
|
||||||
|
FROM
|
||||||
|
( SELECT `value` FROM `sys_param` WHERE `code` = 'APP_URL' ) a
|
||||||
|
INNER JOIN ( SELECT `value` FROM `sys_param` WHERE `code` = 'APP_VERSION' ) b
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user