Commit 40ff0fc6 zshaohui

1.neoteapi修改

2.mimo电子看板
1 个父辈 afbbc4b7
...@@ -115,7 +115,7 @@ public class MenuInit { ...@@ -115,7 +115,7 @@ public class MenuInit {
//设备看板 //设备看板
addDefaultFunctionMenu(1,null,"设备看板","lockMaterial", "lockMaterial/material/index","kanban",DEFAULT_SHOW_MENU); addDefaultFunctionMenu(1,null,"设备看板","lockMaterial", "lockMaterial/material/index","kanban",DEFAULT_SHOW_MENU);
addDefaultFunctionMenu(1,null,"电子看板","eleckanban", "elecKanban/index","kanban",DEFAULT_SHOW_MENU); addDefaultFunctionMenu(1,null,"电子看板","eleckanban", "elecKanban/index","kanban");
//设备互联 //设备互联
addDefaultFunctionMenu(2,null,"设备互联","equipmentView", "neolight/equipmentView/index","sKanban"); addDefaultFunctionMenu(2,null,"设备互联","equipmentView", "neolight/equipmentView/index","sKanban");
...@@ -218,6 +218,7 @@ public class MenuInit { ...@@ -218,6 +218,7 @@ public class MenuInit {
addDefaultFunctionMenu(99991, helpAbout, "说明书", "instruction", "system/instruction/index","aboutBook"); addDefaultFunctionMenu(99991, helpAbout, "说明书", "instruction", "system/instruction/index","aboutBook");
addDefaultFunctionMenu(99992, helpAbout, "关于","about", "system/about/index","message",DEFAULT_SHOW_MENU); addDefaultFunctionMenu(99992, helpAbout, "关于","about", "system/about/index","message",DEFAULT_SHOW_MENU);
addDefaultFunctionMenu(123,null,"LNB残数","LNBResidue", "neolight/lnbResidue/index","kanban");
return allMenuMap; return allMenuMap;
} }
......
...@@ -123,4 +123,45 @@ public class SmbUtil { ...@@ -123,4 +123,45 @@ public class SmbUtil {
} }
return false; return false;
} }
/**
* @Title smbGet
* @Param shareUrl 共享目录中的文件路径,如smb://132.20.2.33/CIMPublicTest/eg.txt
* @Param localDirectory 本地目录,如tempStore/smb
*/
public static boolean smbGetByAuth(String smbFile, NtlmPasswordAuthentication auth,String localDirectory){
InputStream in = null;
OutputStream out = null;
try {
Config.registerSmbURLHandler();
SmbFile remoteFile = new SmbFile(smbFile,auth);
if (!remoteFile.exists()) {
log.info("共享文件不存在");
return false;
}
// 有文件的时候再初始化输入输出流
log.info("下载共享目录的文件 "+smbFile+" 到 "+ localDirectory);
String fileName = remoteFile.getName();
File localFile = new File(localDirectory + File.separator + fileName);
File fileParent = localFile.getParentFile();
if (null != fileParent && !fileParent.exists()) {
fileParent.mkdirs();
}
in = new BufferedInputStream(new SmbFileInputStream(remoteFile));
out = new BufferedOutputStream(new FileOutputStream(localFile));
byte[] buffer = new byte[1024];
while (in.read(buffer) != -1) {
out.write(buffer);
buffer = new byte[1024];
}
out.flush(); //刷新缓冲区输出流
return true;
} catch (Exception e) {
log.error("获取 SMB 文件出错",e);
} finally {
close(in,out);
}
return false;
}
} }
...@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.csv.CsvReader; ...@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.csv.CsvReader;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.FileUtil; import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.QueryHelp; import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.barcode.bean.BarcodeRule;
import com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto; import com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto;
import com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeRuleDto; import com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeRuleDto;
import com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper; import com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper;
...@@ -179,6 +180,15 @@ public class BarcodeController { ...@@ -179,6 +180,15 @@ public class BarcodeController {
return ResultBean.newOkResult(resultMsg); return ResultBean.newOkResult(resultMsg);
} }
@ApiOperation("根据条码信息获取条码规则")
@PostMapping(value = "getBarcodeRule")
public ResultBean getBarcodeRule(@RequestBody Map<String, String> paramMap) {
String ruleStr = BarcodeRule.toCodeRule(paramMap.get("codeStr"), paramMap);
return ResultBean.newOkResult(ruleStr);
}
protected String handleBarcode(String fileURL) throws Exception { protected String handleBarcode(String fileURL) throws Exception {
log.info("开始读取文件:" + fileURL); log.info("开始读取文件:" + fileURL);
CsvReader csvRead =CsvReader.newReader(fileURL,"条码","RI"); CsvReader csvRead =CsvReader.newReader(fileURL,"条码","RI");
......
...@@ -8,6 +8,7 @@ import com.google.common.collect.Lists; ...@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants; import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component; import com.neotel.smfcore.core.barcode.service.po.Component;
...@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage; ...@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil; import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
...@@ -44,6 +46,7 @@ import org.springframework.stereotype.Repository; ...@@ -44,6 +46,7 @@ import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
/** /**
* 缓存 * 缓存
...@@ -942,4 +945,15 @@ public class DataCache { ...@@ -942,4 +945,15 @@ public class DataCache {
return inOutData; return inOutData;
} }
public List getCacheList(String keyStr) {
List<Object> list = new ArrayList<>();
for (Map.Entry<String, Object> entry : cacheMap.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
if (key.startsWith(keyStr)) {
list.add(value);
}
}
return list;
}
} }
...@@ -292,7 +292,7 @@ public class NeotelApi extends BaseSmfApiListener { ...@@ -292,7 +292,7 @@ public class NeotelApi extends BaseSmfApiListener {
log.error("日期转换出错", e); log.error("日期转换出错", e);
} }
barcode = barcodeManager.saveBarcode(barcode); barcode = barcodeManager.save(barcode);
return barcode; return barcode;
} else { } else {
return null; return null;
......
...@@ -2,7 +2,7 @@ server: ...@@ -2,7 +2,7 @@ server:
port: 8800 port: 8800
api: api:
name: name: neotel
inCheckUrl: inCheckUrl:
outNotifyUrl: outNotifyUrl:
inNotifyUrl: inNotifyUrl:
...@@ -48,3 +48,7 @@ menu: ...@@ -48,3 +48,7 @@ menu:
show: show:
hide: hide:
smd:
filePath:
userName:
password:
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!