Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -373,6 +373,13 @@
|
|||||||
<artifactId>poi-ooxml-schemas</artifactId>
|
<artifactId>poi-ooxml-schemas</artifactId>
|
||||||
<version>3.17</version>
|
<version>3.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--访问共享文件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>jcifs</groupId>
|
||||||
|
<artifactId>jcifs</artifactId>
|
||||||
|
<version>1.3.17</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import jcifs.smb.SmbFile;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -90,13 +91,20 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 生成txt文件
|
// 生成txt文件
|
||||||
String filePath = "//10.1.3.21" + "/LMSPrinter" + "外包标签.txt";
|
String filePath = "smb://10.1.3.21" + "/LMSPrinter" + "外包标签.txt";
|
||||||
FileWriter fw = null;
|
FileWriter fw = null;
|
||||||
try {
|
try {
|
||||||
File file = new File(filePath);
|
/* File file = new File(filePath);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
// 判断此文件是否存在 不存在则创建 存在则覆盖
|
||||||
|
file.createNewFile();
|
||||||
|
}*/
|
||||||
|
SmbFile file = new SmbFile(filePath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
// 判断此文件是否存在 不存在则创建 存在则覆盖
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
fw = new FileWriter(filePath);
|
fw = new FileWriter(filePath);
|
||||||
BufferedWriter bw = new BufferedWriter(fw);
|
BufferedWriter bw = new BufferedWriter(fw);
|
||||||
bw.write("package_box_sn,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight\n");
|
bw.write("package_box_sn,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight\n");
|
||||||
@@ -120,6 +128,7 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
bw.close();
|
bw.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
jo.put("message", "打印失败!" + e.getMessage());
|
jo.put("message", "打印失败!" + e.getMessage());
|
||||||
|
return jo;
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
fw.close();
|
fw.close();
|
||||||
@@ -130,4 +139,6 @@ public class PrintServiceImpl implements PrintService {
|
|||||||
jo.put("message", "打印成功!");
|
jo.put("message", "打印成功!");
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user