修改软件版本功能

master
zhanghai 2 years ago
parent ad2174a673
commit 7533b76ef2

@ -81,5 +81,8 @@ public class Document {
this.dpi = 300; this.dpi = 300;
} }
this.rollModel = rollModel; this.rollModel = rollModel;
if(rollModel==null){
this.rollModel = "16mm规格";
}
} }
} }

@ -32,7 +32,9 @@ public class FenpanService {
private String zongPrefix; private String zongPrefix;
public FenpanService(String rollModel,String zongPrefix){ private Integer num;
public FenpanService(String rollModel,String zongPrefix,Integer num){
if(rollModel.equals("16mm规格")){ if(rollModel.equals("16mm规格")){
plateSize = Integer.parseInt(Config.getParam("plate.size")); plateSize = Integer.parseInt(Config.getParam("plate.size"));
}else{ }else{
@ -40,6 +42,7 @@ public class FenpanService {
} }
this.rollModel = rollModel; this.rollModel = rollModel;
this.zongPrefix = zongPrefix; this.zongPrefix = zongPrefix;
this.num = num;
} }
public void fenpan(String saveUrl, String readUrl) { public void fenpan(String saveUrl, String readUrl) {
@ -48,7 +51,7 @@ public class FenpanService {
Map<Zong, List<Plate>> zongListMap = new HashMap<>(); Map<Zong, List<Plate>> zongListMap = new HashMap<>();
//读取需要转宗的文件夹 //读取需要转宗的文件夹
Integer i = 0; Integer i = num;
for (String key : zongMap.keySet()) { for (String key : zongMap.keySet()) {
List<Plate> plateList = new ArrayList<>(); List<Plate> plateList = new ArrayList<>();
Zong zong = zongMap.get(key); Zong zong = zongMap.get(key);

@ -110,7 +110,7 @@ public class MyApplication {
gbc.gridy = 3; gbc.gridy = 3;
gbc.gridwidth = 1; gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.WEST; gbc.anchor = GridBagConstraints.WEST;
paramPanel.add(new JLabel("16mm规格盘大小:"), gbc); paramPanel.add(new JLabel("16mm规格画幅数量A4合计:"), gbc);
gbc.gridx = 1; gbc.gridx = 1;
gbc.anchor = GridBagConstraints.CENTER; gbc.anchor = GridBagConstraints.CENTER;
JTextField plateSizeJtf = new JTextField(20); JTextField plateSizeJtf = new JTextField(20);
@ -121,7 +121,7 @@ public class MyApplication {
gbc.gridy = 4; gbc.gridy = 4;
gbc.gridwidth = 1; gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.WEST; gbc.anchor = GridBagConstraints.WEST;
paramPanel.add(new JLabel("33mm规格盘大小:"), gbc); paramPanel.add(new JLabel("35mm规格画幅数量:"), gbc);
gbc.gridx = 1; gbc.gridx = 1;
gbc.anchor = GridBagConstraints.CENTER; gbc.anchor = GridBagConstraints.CENTER;
JTextField plateSizeJtf33 = new JTextField(20); JTextField plateSizeJtf33 = new JTextField(20);
@ -175,7 +175,7 @@ public class MyApplication {
leftGbc.gridx = 0; leftGbc.gridx = 0;
leftGbc.gridy = 0; leftGbc.gridy = 0;
leftPanel.add(new JLabel("模式选择:")); leftPanel.add(new JLabel("规格选择:"));
String[] rollmodes = {"16mm规格", "35mm规格"}; String[] rollmodes = {"16mm规格", "35mm规格"};
JComboBox<String> rollmodeComboBox = new JComboBox<>(rollmodes); JComboBox<String> rollmodeComboBox = new JComboBox<>(rollmodes);
leftGbc.gridx = 1; leftGbc.gridx = 1;
@ -190,7 +190,7 @@ public class MyApplication {
leftGbc.gridwidth = 1; leftGbc.gridwidth = 1;
leftPanel.add(folderField, leftGbc); leftPanel.add(folderField, leftGbc);
JButton folderChooserButton = new JButton("选择文件夹"); JButton folderChooserButton = new JButton("选择目录");
folderChooserButton.addActionListener(new ActionListener() { folderChooserButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -218,7 +218,7 @@ public class MyApplication {
JButton savePathChooserButton = new JButton("选择文件夹"); JButton savePathChooserButton = new JButton("选择目录");
savePathChooserButton.addActionListener(new ActionListener() { savePathChooserButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -242,8 +242,18 @@ public class MyApplication {
leftGbc.gridx = 1; leftGbc.gridx = 1;
leftPanel.add(zongFiled, leftGbc); leftPanel.add(zongFiled, leftGbc);
leftGbc.gridx = 0; leftGbc.gridx = 0;
leftGbc.gridy = 4; leftGbc.gridy = 4;
leftPanel.add(new JLabel("起始分盘号:"), leftGbc);
JTextField spiltNum = new JTextField(20);
leftGbc.gridx = 1;
leftPanel.add(spiltNum, leftGbc);
leftGbc.gridx = 0;
leftGbc.gridy = 5;
leftGbc.gridwidth = 2; leftGbc.gridwidth = 2;
leftGbc.anchor = GridBagConstraints.CENTER; leftGbc.anchor = GridBagConstraints.CENTER;
JButton fenpanJbtn = new JButton("开始分盘"); JButton fenpanJbtn = new JButton("开始分盘");
@ -282,7 +292,7 @@ public class MyApplication {
String readUrl = folderField.getText(); String readUrl = folderField.getText();
String s = Objects.requireNonNull(rollmodeComboBox.getSelectedItem()).toString(); String s = Objects.requireNonNull(rollmodeComboBox.getSelectedItem()).toString();
System.out.println(s); System.out.println(s);
new FenpanService(s,zongFiled.getText()).fenpan(saveUrl,readUrl); new FenpanService(s,zongFiled.getText(),Integer.parseInt(spiltNum.getText())).fenpan(saveUrl,readUrl);
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
@ -343,7 +353,7 @@ public class MyApplication {
leftGbc.gridwidth = 1; leftGbc.gridwidth = 1;
leftPanel.add(filePathField, leftGbc); leftPanel.add(filePathField, leftGbc);
JButton fileChooserButton = new JButton("选择文件夹"); JButton fileChooserButton = new JButton("选择目录");
leftGbc.gridx = 2; leftGbc.gridx = 2;
leftPanel.add(fileChooserButton, leftGbc); leftPanel.add(fileChooserButton, leftGbc);
@ -468,7 +478,7 @@ public class MyApplication {
leftIndexGbc.gridwidth = 1; leftIndexGbc.gridwidth = 1;
leftIndexPanel.add(filePathField, leftIndexGbc); leftIndexPanel.add(filePathField, leftIndexGbc);
JButton fileChooserButton = new JButton("选择文件"); JButton fileChooserButton = new JButton("选择目录");
leftIndexGbc.gridx = 2; leftIndexGbc.gridx = 2;
leftIndexPanel.add(fileChooserButton, leftIndexGbc); leftIndexPanel.add(fileChooserButton, leftIndexGbc);

Loading…
Cancel
Save