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>
|
||||
<version>3.17</version>
|
||||
</dependency>
|
||||
|
||||
<!--访问共享文件-->
|
||||
<dependency>
|
||||
<groupId>jcifs</groupId>
|
||||
<artifactId>jcifs</artifactId>
|
||||
<version>1.3.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jcifs.smb.SmbFile;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -90,13 +91,20 @@ public class PrintServiceImpl implements PrintService {
|
||||
}
|
||||
|
||||
// 生成txt文件
|
||||
String filePath = "//10.1.3.21" + "/LMSPrinter" + "外包标签.txt";
|
||||
String filePath = "smb://10.1.3.21" + "/LMSPrinter" + "外包标签.txt";
|
||||
FileWriter fw = null;
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
/* File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
// 判断此文件是否存在 不存在则创建 存在则覆盖
|
||||
file.createNewFile();
|
||||
}*/
|
||||
SmbFile file = new SmbFile(filePath);
|
||||
if (!file.exists()) {
|
||||
// 判断此文件是否存在 不存在则创建 存在则覆盖
|
||||
file.createNewFile();
|
||||
}
|
||||
|
||||
fw = new FileWriter(filePath);
|
||||
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");
|
||||
@@ -119,15 +127,18 @@ public class PrintServiceImpl implements PrintService {
|
||||
|
||||
bw.close();
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
jo.put("message", "打印失败!" + e.getMessage());
|
||||
return jo;
|
||||
} finally {
|
||||
try {
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
jo.put("message", "打印失败!" + e.getMessage());
|
||||
}
|
||||
}
|
||||
jo.put("message", "打印成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user