代码更新

This commit is contained in:
2022-11-24 15:53:27 +08:00
parent a8f4077ff4
commit 3c5e788c49

View File

@@ -17,6 +17,10 @@ import org.nl.wms.st.inbill.service.CheckOutBillService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
/** /**
* @author liuxy * @author liuxy
* @description 服务实现 * @description 服务实现
@@ -39,6 +43,9 @@ public class PrintServiceImpl implements PrintService {
@Override @Override
public JSONObject customerPrint(JSONObject whereJson) { public JSONObject customerPrint(JSONObject whereJson) {
JSONObject jo = new JSONObject();
try {
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
JSONObject box_jo = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().uniqueResult(0); JSONObject box_jo = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().uniqueResult(0);
@@ -83,25 +90,38 @@ public class PrintServiceImpl implements PrintService {
weight += row.getDoubleValue("net_weight"); weight += row.getDoubleValue("net_weight");
} }
//净重 // 生成txt文件
String filePath = "\\\\10.1.3.21" + "\\LMSPrinter" + "外包标签.txt";
FileWriter fw = null;
JSONObject print_info = new JSONObject(); File file = new File(filePath);
print_info.put("package_box_sn",package_box_sn); if (!file.exists()) {
print_info.put("sale_order_name",sale_order_name); file.createNewFile();
print_info.put("product_description",product_description); }
print_info.put("product_name",product_name); fw = new FileWriter(filePath);
print_info.put("width",width); BufferedWriter bw = new BufferedWriter(fw);
print_info.put("pcsn",pcsn); 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");
print_info.put("sum_net_weight",weight);
print_info.put("date_of_FG_inbound",date_of_FG_inbound);
print_info.put("box_weight",box_weight);
print_info.put("date_of_production",date_of_production);
print_info.put("quanlity_in_box",quanlity_in_box);
print_info.put("quality_guaran_period",quality_guaran_period);
print_info.put("nspector",nspector);
print_info.put("storage_conditions",storage_conditions);
JSONObject jo = new JSONObject(); 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.close();
} catch (Exception e) {
jo.put("message", "打印失败!"+e.getMessage());
}
jo.put("message", "打印成功!"); jo.put("message", "打印成功!");
return jo; return jo;
} }