导出修改

下一个修改
bug修改
bozhou-古井贡酒
LAPTOP-S9HJSOEB\昊天 4 months ago
parent 47a2a00c66
commit 59fe298f24

@ -79,11 +79,10 @@
<artifactId>filter</artifactId> <artifactId>filter</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>2.1.1</version> <version>3.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sun.jna</groupId> <groupId>com.sun.jna</groupId>

@ -92,6 +92,10 @@ public class OrderController {
return ResultResp.success(ksecDataInfos); return ResultResp.success(ksecDataInfos);
} }
public static void main(String[] args) {
String i = "KsecInfos(header=BQ, Type=C, data=[KsecDataInfo(SRMNumber=SRM01, cmdName=C1, taskId=96d2c9a0e6664cc88e9b97c5aba02808, fromColumn=0, fromRow=0, fromStorey=0, fromDirection=2, fromSide=null, fromSeparation=0, toColumn=25, toRow=1, toStorey=6, toDirection=1, toSide=null, toSeparation=2, code=, warnCode=, ackStatus=null, trayCode=100132049539, goodsType=, goodsNumber=0, goodsTypeResult=, goodsNumberResult=0, result=0, lotnum=, fromAround=1), KsecDataInfo(SRMNumber=SRM01, cmdName=C1, taskId=f5ed012f8d92418387b4b57462928bce, fromColumn=0, fromRow=0, fromStorey=0, fromDirection=2, fromSide=null, fromSeparation=0, toColumn=26, toRow=1, toStorey=6, toDirection=1, toSide=null, toSeparation=2, code=, warnCode=, ackStatus=null, trayCode=100132049539, goodsType=, goodsNumber=0, goodsTypeResult=, goodsNumberResult=0, result=0, lotnum=, fromAround=2)])";
}
@ApiOperation("发生告警") @ApiOperation("发生告警")
@GetMapping("/error") @GetMapping("/error")
public Result orderError(@ApiParam("plc") @RequestParam String plcId){ public Result orderError(@ApiParam("plc") @RequestParam String plcId){

@ -27,7 +27,7 @@ public class Category {
@TableField(value = "`number`") @TableField(value = "`number`")
private Integer number; private Integer number;
private Integer degree; private Double degree;
private Integer milliliter; private Integer milliliter;
private String image; private String image;

@ -12,6 +12,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Data @Data
@TableName("`stock`") @TableName("`stock`")
@ -108,4 +109,12 @@ public class Stock {
@TableField(exist=false) @TableField(exist=false)
private String sidePic4; private String sidePic4;
// 获取格式化后的字符串
public String getFormattedExportTime() {
if (exportTime != null) {
return exportTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}
return null;
}
} }

@ -2,8 +2,8 @@ package com.zhehekeji.web.pojo.stock;
import com.alibaba.excel.converters.Converter; import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration; import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.CellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -20,21 +20,5 @@ public class LocalDateTimeConvert implements Converter<LocalDateTime> {
return null; return null;
} }
@Override
public LocalDateTime convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
return null;
}
@Override
public CellData convertToExcelData(LocalDateTime localDateTime, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
if (localDateTime != null) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
String time = localDateTime.format(formatter);
return new CellData(time);
}
return null;
}
} }

@ -1,6 +1,7 @@
package com.zhehekeji.web.pojo.stock; package com.zhehekeji.web.pojo.stock;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -11,37 +12,54 @@ public class StockExportExcel {
@ExcelProperty(index = 0, value = "巷道名称") @ExcelProperty(index = 0, value = "巷道名称")
private String streetName; private String streetName;
@ExcelProperty(index = 8, value = "盘点批次号") @ExcelProperty(index = 1, value = "盘点批次号")
private String lotnum; private String lotnum;
@ExcelProperty(index = 5, value = "条码")
private String code;
@ExcelProperty(index = 6, value = "WMS条码") @ExcelProperty(index = 2, value = "位置" )
private String wmsCode; @ColumnWidth(30) // 设置列宽为25个字符宽度
private String direction;
//
// @ExcelProperty(index = 2, value = "深浅,1:浅货位,2:深货位")
// private String side;
//
//// @ExcelProperty(index = 1, value = "货架号")
//// private String shelveId;
//
//// @ExcelProperty(index = 5, value = "数量")
//// private Integer count;
//
// @ExcelProperty(index = 3, value = "行")
// private String row;
//
// @ExcelProperty(index = 4, value = "列")
// private String column;
@ExcelProperty(index = 1, value = "左右,1:左侧,2:右侧")
private Integer direction;
@ExcelProperty(index = 2, value = "深浅,1:浅货位,2:深货位")
private Integer side;
// @ExcelProperty(index = 1, value = "货架号") @ExcelProperty(index = 3, value = "上位品规")
// private String shelveId; private String wmsCategory;
// @ExcelProperty(index = 5, value = "数量")
// private Integer count;
@ExcelProperty(index = 3, value = "行") @ExcelProperty(index = 4, value = "核对品规结果")
private Integer row; private String category;
@ExcelProperty(index = 4, value = "列")
private Integer column;
@ExcelProperty(index = 7, value = "盘点结果", converter = StockStatusConvert.class) @ExcelProperty(index = 5, value = "上位个数")
private Integer status; private Integer wmsCount;
@ExcelProperty(index = 9, value = "时间", converter = LocalDateTimeConvert.class)
private LocalDateTime exportTime;
@ExcelProperty(index = 6, value = "核对个数")
private Integer count;
@ExcelProperty(index = 7, value = "盘点结果")
private String status;
@ExcelProperty(index = 8, value = "时间")
private String exportTime;
} }

@ -2,8 +2,8 @@ package com.zhehekeji.web.pojo.stock;
import com.alibaba.excel.converters.Converter; import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration; import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.CellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.metadata.property.ExcelContentProperty;
public class StockStatusConvert implements Converter<Integer> { public class StockStatusConvert implements Converter<Integer> {
@ -17,20 +17,6 @@ public class StockStatusConvert implements Converter<Integer> {
return null; return null;
} }
@Override
public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
return null;
}
@Override
public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
for (StockStatus orderStatus : StockStatus.values()) {
if (orderStatus.getStatus().equals(integer)) {
return new CellData(orderStatus.getName());
}
}
return null;
}
} }

@ -16,7 +16,6 @@ import com.zhehekeji.web.service.damLightSource.JYDamHelper;
import com.zhehekeji.web.service.hikLightSource.HikControlSocket; import com.zhehekeji.web.service.hikLightSource.HikControlSocket;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.cglib.core.Local;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

@ -53,10 +53,7 @@ import java.nio.charset.StandardCharsets;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.*;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -121,7 +118,6 @@ public class PlcService {
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Resource @Resource
private Environment environment; private Environment environment;
@ -264,7 +260,6 @@ public class PlcService {
} }
public void orderStopByWarn(String orderNum) { public void orderStopByWarn(String orderNum) {
Order order = orderMapper.getOneByOrderNum(orderNum); Order order = orderMapper.getOneByOrderNum(orderNum);
if (order == null) { if (order == null) {
@ -278,6 +273,7 @@ public class PlcService {
upd.setStatus(1); upd.setStatus(1);
orderMapper.updateById(upd); orderMapper.updateById(upd);
} }
@Resource @Resource
private TaskDelayExecutor taskDelayExecutor; private TaskDelayExecutor taskDelayExecutor;
@ -682,6 +678,8 @@ public class PlcService {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId()); Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
//打开光源
streetController.openStreetLightSource(street.getId());
if (checkLogMapper.selectCount(new QueryWrapper<CheckLog>() if (checkLogMapper.selectCount(new QueryWrapper<CheckLog>()
.eq("street_Id", street.getId()) .eq("street_Id", street.getId())
.eq("check_Num", plcCmdInfo.getOrderNum())) > 0) { .eq("check_Num", plcCmdInfo.getOrderNum())) > 0) {
@ -700,8 +698,6 @@ public class PlcService {
pojo.setGoodsNumberResult(checkLog.getCount()); pojo.setGoodsNumberResult(checkLog.getCount());
return pojo; return pojo;
} }
//打开光源
streetController.openStreetLightSource( street.getId());
CronTab.putTime(street.getId()); CronTab.putTime(street.getId());
plcCmdInfo.setStreetName(street.getName()); plcCmdInfo.setStreetName(street.getName());
// List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id", street.getId())); // List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id", street.getId()));
@ -871,6 +867,10 @@ public class PlcService {
return configProperties; return configProperties;
} }
// 在PlcService类中添加以下静态成员
private static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
private static ConcurrentHashMap<String, ScheduledFuture<?>> scheduledTasks = new ConcurrentHashMap<>();
public KsecDataInfo orderDecoder(KsecInfo ksecInfo) { public KsecDataInfo orderDecoder(KsecInfo ksecInfo) {
log.info("收到命令:{}", ksecInfo.toString()); log.info("收到命令:{}", ksecInfo.toString());
KsecDataInfo dataInfo = ksecInfo.getData(); KsecDataInfo dataInfo = ksecInfo.getData();
@ -944,10 +944,25 @@ public class PlcService {
//任务开始 旋转到原点位 //任务开始 旋转到原点位
gyrateCamera(plcCmdInfo, Cmd.C5.name()); gyrateCamera(plcCmdInfo, Cmd.C5.name());
orderStart(plcCmdInfo); orderStart(plcCmdInfo);
// 添加延时任务
PlcCmdInfo finalPlcCmdInfo = plcCmdInfo;
ScheduledFuture<?> future = scheduler.schedule(() -> {
// 执行orderStop
orderStop(finalPlcCmdInfo);
// 从map中移除已执行的任务
scheduledTasks.remove(finalPlcCmdInfo.getTaskId());
}, 5, TimeUnit.MINUTES);
// 将future放入map中便于后续取消
scheduledTasks.put(plcCmdInfo.getTaskId(), future);
} else if (Cmd.B2.name().equals(cmdName)) { } else if (Cmd.B2.name().equals(cmdName)) {
// 取消对应的计划任务(如果存在)
ScheduledFuture<?> existingTask = scheduledTasks.remove(plcCmdInfo.getTaskId());
if (existingTask != null && !existingTask.isDone()) {
existingTask.cancel(false); // 取消尚未执行的任务
}
orderStop(plcCmdInfo); orderStop(plcCmdInfo);
} }
} else if (Cmd.C.name().equals(ksecInfo.getType())) { } else if (Cmd.C.name().equals(ksecInfo.getType())) {

@ -273,23 +273,34 @@ public class StockService {
* @return * @return
*/ */
public List<StockExportExcel> exportExcels(Integer streetId) { public List<StockExportExcel> exportExcels(Integer streetId) {
String[] status = {"未盘点","盘点异常","盘点正确","人工盘点正确","待人工盘点"};
List<Stock> stocks = list(streetId); List<Stock> stocks = list(streetId);
Street street = streetService.streetById(streetId); Street street = streetService.streetById(streetId);
List<StockExportExcel> stockExportExcels = new ArrayList<>(stocks.size()); List<StockExportExcel> stockExportExcels = new ArrayList<>(stocks.size());
stocks.forEach(stock -> { stocks.forEach(stock -> {
StockExportExcel stockExportExcel = new StockExportExcel(); StockExportExcel stockExportExcel = new StockExportExcel();
stockExportExcel.setCode(stock.getTrayCode());
stockExportExcel.setLotnum(stock.getLotnum());
stockExportExcel.setColumn(stock.getColumn());
stockExportExcel.setWmsCode(stock.getWmsTrayCode());
//stockExportExcel.setCount(stock.getCount());
stockExportExcel.setRow(stock.getRow());
stockExportExcel.setStreetName(street.getName()); stockExportExcel.setStreetName(street.getName());
stockExportExcel.setExportTime(stock.getExportTime()); stockExportExcel.setLotnum(stock.getLotnum());
stockExportExcel.setDirection(stock.getDirection()); stockExportExcel.setDirection((stock.getDirection() == 1 ? "左侧" : "右侧")+"-"+(stock.getSide()==1?"浅货位":"深货位")+"-"+stock.getRow()+"层"+"-"+stock.getColumn()+"列");
stockExportExcel.setSide(stock.getSide()); stockExportExcel.setWmsCategory(stock.getWmsCategory());
//stockExportExcel.setShelveId(stock.getShelveId()); stockExportExcel.setCategory((stock.getCategory() == null||stock.getWmsCategory() == null) ? "无" : (stock.getWmsCategory().equals(stock.getCategory())?"一致":"不一致"));
stockExportExcel.setStatus(stock.getStatus());
stockExportExcel.setWmsCount(stock.getWmsCount());
stockExportExcel.setCount(stock.getCount()+stock.getCountTop());
stockExportExcel.setStatus(status[stock.getStatus()]);
stockExportExcel.setExportTime(stock.getFormattedExportTime());
// stockExportExcel.setCode(stock.getTrayCode());
// stockExportExcel.setLotnum(stock.getLotnum());
// stockExportExcel.setColumn(stock.getColumn());
// stockExportExcel.setWmsCode(stock.getWmsTrayCode());
// //stockExportExcel.setCount(stock.getCount());
// stockExportExcel.setRow(stock.getRow());
// stockExportExcel.setStreetName(street.getName());
// stockExportExcel.setExportTime(stock.getExportTime());
// stockExportExcel.setDirection(stock.getDirection());
// stockExportExcel.setSide(stock.getSide());
// //stockExportExcel.setShelveId(stock.getShelveId());
// stockExportExcel.setStatus(stock.getStatus());
stockExportExcels.add(stockExportExcel); stockExportExcels.add(stockExportExcel);
}); });
return stockExportExcels; return stockExportExcels;
@ -297,6 +308,7 @@ public class StockService {
public List<StockExportExcel> exportAllExcels() { public List<StockExportExcel> exportAllExcels() {
String[] status = {"未盘点","盘点异常","盘点正确","人工盘点正确","待人工盘点"};
List<Stock> stocks = stockMapper.selectByMap(new HashMap<>()); List<Stock> stocks = stockMapper.selectByMap(new HashMap<>());
List<Street> streets = streetMapper.selectByMap(new HashMap<>()); List<Street> streets = streetMapper.selectByMap(new HashMap<>());
Map<Integer,String> streetMap = new HashMap<>(); Map<Integer,String> streetMap = new HashMap<>();
@ -307,16 +319,27 @@ public class StockService {
List<StockExportExcel> stockExportExcels = new ArrayList<>(stocks.size()); List<StockExportExcel> stockExportExcels = new ArrayList<>(stocks.size());
stocks.forEach(stock -> { stocks.forEach(stock -> {
StockExportExcel stockExportExcel = new StockExportExcel(); StockExportExcel stockExportExcel = new StockExportExcel();
stockExportExcel.setCode(stock.getTrayCode());
stockExportExcel.setLotnum(stock.getLotnum());
stockExportExcel.setColumn(stock.getColumn());
//stockExportExcel.setCount(stock.getCount());
stockExportExcel.setRow(stock.getRow());
stockExportExcel.setStreetName(streetMap.get(stock.getStreetId())); stockExportExcel.setStreetName(streetMap.get(stock.getStreetId()));
stockExportExcel.setExportTime(stock.getExportTime()); stockExportExcel.setLotnum(stock.getLotnum());
stockExportExcel.setDirection(stock.getDirection()); stockExportExcel.setDirection((stock.getDirection() == 1 ? "左侧" : "右侧")+"-"+(stock.getSide()==1?"浅货位":"深货位")+"-"+stock.getRow()+"层"+"-"+stock.getColumn()+"列");
stockExportExcel.setSide(stock.getSide()); stockExportExcel.setWmsCategory(stock.getWmsCategory());
stockExportExcel.setStatus(stock.getStatus()); stockExportExcel.setCategory((stock.getCategory() == null||stock.getWmsCategory() == null) ? "无" : (stock.getWmsCategory().equals(stock.getCategory())?"一致":"不一致"));
stockExportExcel.setWmsCount(stock.getWmsCount());
stockExportExcel.setCount(stock.getCount()+stock.getCountTop());
stockExportExcel.setStatus(status[stock.getStatus()]);
stockExportExcel.setExportTime(stock.getFormattedExportTime());
// stockExportExcel.setCode(stock.getTrayCode());
// stockExportExcel.setLotnum(stock.getLotnum());
// stockExportExcel.setColumn(stock.getColumn());
// stockExportExcel.setWmsCode(stock.getWmsTrayCode());
// //stockExportExcel.setCount(stock.getCount());
// stockExportExcel.setRow(stock.getRow());
// stockExportExcel.setStreetName(street.getName());
// stockExportExcel.setExportTime(stock.getExportTime());
// stockExportExcel.setDirection(stock.getDirection());
// stockExportExcel.setSide(stock.getSide());
// //stockExportExcel.setShelveId(stock.getShelveId());
// stockExportExcel.setStatus(stock.getStatus());
stockExportExcels.add(stockExportExcel); stockExportExcels.add(stockExportExcel);
}); });
return stockExportExcels; return stockExportExcels;
@ -342,8 +365,6 @@ public class StockService {
}else { }else {
stock.setStreetName(street.getName()); stock.setStreetName(street.getName());
} }
//不再需要操作照片
List<StockLog> stockLogs = stockLogMapper.selectList(new QueryWrapper<StockLog>().eq("`row`",stockCheck.getRow()).eq("`column`",stockCheck.getColumn()).eq("street_id",stockCheck.getStreetId()).eq("direction",stockCheck.getDirection()).eq("side",stockCheck.getSide()).orderByDesc("create_time").last(" limit 2"));
// if(stockLogs.size() == 1){ // if(stockLogs.size() == 1){
// stock.setOveroperationPic(stockLogs.get(0).getPic()); // stock.setOveroperationPic(stockLogs.get(0).getPic());
// }else if(stockLogs.size() == 2){ // }else if(stockLogs.size() == 2){
@ -417,7 +438,7 @@ public class StockService {
log.info("check stock correct, street_id:{},direction:{},side:{},row:{},column:{}", stockCheck.getStreetId(),stockCheck.getDirection(),stockCheck.getSide(), stockCheck.getRow(), stockCheck.getColumn()); log.info("check stock correct, street_id:{},direction:{},side:{},row:{},column:{}", stockCheck.getStreetId(),stockCheck.getDirection(),stockCheck.getSide(), stockCheck.getRow(), stockCheck.getColumn());
int count =(stock.getCount() != null) ? stock.getCount() : 0; int count =(stock.getCount() != null) ? stock.getCount() : 0;
if(stockCheck.getCountTop()+ count == stock.getWmsCount() && stock.getWmsCategory().equals(stockCheck.getCategory())){ if(stockCheck.getCountTop()+ count == stock.getWmsCount() ){
stock.setStatus(StockStatus.MANUAL.getStatus()); stock.setStatus(StockStatus.MANUAL.getStatus());
}else { }else {
@ -483,26 +504,12 @@ public class StockService {
public Stock nextOne(Long id) { public Stock nextOne(Long id) {
QueryWrapper<Stock> stockQueryWrapper = new QueryWrapper<>(); QueryWrapper<Stock> stockQueryWrapper = new QueryWrapper<>();
stockQueryWrapper.eq("status","0").or().eq("status","1") stockQueryWrapper.eq("status","0").or().eq("status","1").or().eq("status","4")
.ne(ToolUtil.isNotEmpty(id),"id",id) .ne(ToolUtil.isNotEmpty(id),"id",id)
.orderByDesc("export_time").last("limit 1"); .orderByDesc("export_time").last("limit 1");
Stock stock =stockMapper.selectOne(stockQueryWrapper); Stock stock =stockMapper.selectOne(stockQueryWrapper);
if (stock != null) { Street street = streetService.getById(stock.getStreetId());
Street street = streetMapper.selectById(stock.getStreetId());
stock.setStreetName(street.getName());
List<StockLog> stockLogs = stockLogMapper.selectList(new QueryWrapper<StockLog>()
.eq("`row`",stock.getRow())
.eq("`column`",stock.getColumn())
.eq("street_id",stock.getStreetId())
.eq("direction",stock.getDirection())
.eq("side",stock.getSide())
.orderByDesc("create_time").last(" limit 2"));
if(stockLogs.size() == 1){
stock.setOveroperationPic(stockLogs.get(0).getPic());
}else if(stockLogs.size() == 2){
stock.setOveroperationPic(stockLogs.get(0).getPic());
stock.setPreoperationPic(stockLogs.get(1).getPic());
}
String ip ="http://"+ street.getPlcIp()+":9002/pic/"; String ip ="http://"+ street.getPlcIp()+":9002/pic/";
if (stock.getPreoperationPic() != null&& stock.getPreoperationPic().length() > 0) { if (stock.getPreoperationPic() != null&& stock.getPreoperationPic().length() > 0) {
@ -518,8 +525,6 @@ public class StockService {
stock.setTopPic1(String.format("%s%s", ip, pics[0])); stock.setTopPic1(String.format("%s%s", ip, pics[0]));
if (pics.length>1) if (pics.length>1)
stock.setTopPic2(String.format("%s%s", ip, pics[1])); stock.setTopPic2(String.format("%s%s", ip, pics[1]));
}
} }
return stock; return stock;

@ -75,7 +75,7 @@ public class AlgorithmService {
public static List<String> readJsonArrayFile(String fileName) { public static List<String> readJsonArrayFile(String fileName) {
try { try {
String content = new String(Files.readAllBytes(Paths.get(fileName))); String content = new String(Files.readAllBytes(Paths.get(fileName)), "UTF-8");
return JSON.parseArray(content, String.class); return JSON.parseArray(content, String.class);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

@ -1,6 +1,5 @@
package com.zhehekeji.web.util; package com.zhehekeji.web.util;
import com.alibaba.excel.util.CollectionUtils;
import org.apache.poi.util.ArrayUtil; import org.apache.poi.util.ArrayUtil;
import java.lang.reflect.Array; import java.lang.reflect.Array;

Loading…
Cancel
Save