修改
This commit is contained in:
Binary file not shown.
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.pda.st.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -43,4 +44,12 @@ public class PrintController {
|
||||
public ResponseEntity<Object> customerPrint(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(printService.customerPrint(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/printType")
|
||||
@Log("打印机下拉框")
|
||||
@ApiOperation("打印机下拉框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> printType(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(printService.printType(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,11 @@ public interface PrintService {
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject customerPrint(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取单据类型
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject printType(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ 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.NtlmPasswordAuthentication;
|
||||
import jcifs.smb.SmbFile;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -92,30 +90,13 @@ public class PrintServiceImpl implements PrintService {
|
||||
}
|
||||
|
||||
// 生成txt文件
|
||||
String filePath = "smb://10.1.3.21" + "/LMSPrinter" + "外包标签.txt";
|
||||
|
||||
String url = "smb://10.1.3.21/LMSPrinter/"+"外包标签.txt";
|
||||
String userName = "111";
|
||||
String password = "111";
|
||||
String filePath = "//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();
|
||||
}*/
|
||||
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, userName, password);
|
||||
SmbFile file = new SmbFile(url, auth);
|
||||
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");
|
||||
@@ -138,18 +119,24 @@ public class PrintServiceImpl implements PrintService {
|
||||
|
||||
bw.close();
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!" + e.getMessage());
|
||||
return jo;
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!" + e.getMessage());
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
}
|
||||
}
|
||||
jo.put("message", "打印成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject printType(JSONObject whereJson){
|
||||
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag","6").process().getResultJSONArray(0);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", rows);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,4 +163,15 @@
|
||||
sub.package_box_sn = 输入.box_no
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "6"
|
||||
QUERY
|
||||
SELECT
|
||||
print_id AS value,
|
||||
print_name AS text
|
||||
FROM
|
||||
pdm_bi_printinfo
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Binary file not shown.
Reference in New Issue
Block a user