master
郭宇航 4 years ago
parent ea7e6c9a8d
commit 8a5a879792

@ -92,7 +92,7 @@
</classpathentry>
<classpathentry kind="lib" path="lib/org.eclipse.osgi.services.nl_12000.2.0.jar"/>
<classpathentry kind="lib" path="lib/org.eclipse.osgi.services_3.7.100.v20180827-1536.jar"/>
<classpathentry kind="lib" path="lib/cn.com.origin.autocode_1.0.0.jar"/>
<classpathentry kind="lib" path="lib/cn.com.origin.autocodemanager_1.0.0.jar"/>
<classpathentry kind="lib" path="lib/cn.com.origin.autocode_1.0.0.jar" sourcepath="D:/eclipse/workspacejune24/6.21/com.connor.dfl.plm/lib/cn.com.origin.autocode_1.0.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

@ -232,6 +232,9 @@
<command name="创建标准Bom" id="com.connor.dfl.plm.dfl041.Dfl041Handler"/>
<command name="ERP队列" id="com.connor.dfl.plm.dfl042.Dfl042Handler"/>
<command name="自动填写作业编号" id="com.connor.dfl.plm.dfl043.Dfl043Handler"/>
<command name="查询零件库存和价格" id="com.connor.dfl.plm.dfl044.Dfl044Handler"/>
<command name="流程报表导出" id="com.connor.dfl.plm.dfl045.Dfl045Handler"/>
<command name="价格bom报表导出" id="com.connor.dfl.plm.dfl046.BOMExportHandler"/>
</extension>
<!--handlers-->
<extension point="org.eclipse.ui.handlers">
@ -447,6 +450,9 @@
<handler commandId="com.connor.dfl.plm.dfl041.Dfl041Handler" class="com.connor.dfl.plm.dfl041.Dfl041Handler"/>
<handler commandId="com.connor.dfl.plm.dfl042.Dfl042Handler" class="com.connor.dfl.plm.dfl042.Dfl042Handler"/>
<handler commandId="com.connor.dfl.plm.dfl043.Dfl043Handler" class="com.connor.dfl.plm.dfl043.Dfl043Handler"/>
<handler commandId="com.connor.dfl.plm.dfl044.Dfl044Handler" class="com.connor.dfl.plm.dfl044.Dfl044Handler"/>
<handler commandId="com.connor.dfl.plm.dfl045.Dfl045Handler" class="com.connor.dfl.plm.dfl045.Dfl045Handler"/>
<handler commandId="com.connor.dfl.plm.dfl046.BOMExportHandler" class="com.connor.dfl.plm.dfl046.BOMExportHandler"/>
<!--
<handler commandId="com.connor.dfl.plm.dfl030.Dfl030Handler" class="com.connor.dfl.plm.dfl030.Dfl030Handler"/>
@ -507,7 +513,19 @@
</and>
</visibleWhen>
</command>
<command commandId="com.connor.dfl.plm.dfl044.Dfl044Handler" id="com.connor.dfl.plm.dfl044.Dfl044Handler">
<visibleWhen>
<and>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.connor.dfl.plm.dfl044.Dfl044Handler"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
</menu>
@ -681,6 +699,35 @@
</and>
</visibleWhen>
</command>
<command commandId="com.connor.dfl.plm.dfl046.BOMExportHandler" id="com.connor.dfl.plm.dfl046.BOMExportHandler">
<visibleWhen>
<and>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.connor.dfl.plm.dfl046.BOMExportHandler"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
<command commandId="com.connor.dfl.plm.dfl045.Dfl045Handler" id="com.connor.dfl.plm.dfl045.Dfl045Handler">
<visibleWhen>
<and>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.connor.dfl.plm.dfl045.Dfl045Handler"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
</menu>
@ -711,19 +758,7 @@
</command>
<command commandId="com.connor.dfl.plm.dfl021.Dfl021Handler" id="com.connor.dfl.plm.dfl021.Dfl021Handler">
<visibleWhen>
<and>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.connor.dfl.plm.dfl021.Dfl021Handler"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
-->
<command commandId="com.connor.dfl.plm.dfl035.ShowMyViewHandler" mnemonic="S" id="com.connor.dfl.plm.dfl035.ShowMyViewHandler">
<visibleWhen>

@ -272,7 +272,7 @@ public class Dfl003AIFDialog extends AbstractAIFDialog {
e2.printStackTrace();
}
jtext1.setEnabled(false);
jtext2.setEnabled(false);
jtext2.setEnabled(true);
jcomname.setEnabled(false);
jp2.setLayout(null);
jl1.setBounds(20, 20, 30, 30);

@ -361,7 +361,9 @@ public class Dfl019Operation extends AbstractAIFOperation{
if("T2_outsourceRevision".equals(type) || "T2_OutBuyPartRevision".equals(type)
||"T2_VirtualRevision".equals(type) ||"T2_EquipmentRevision".equals(type)
||"T2_SystemSchemeRevision".equals(type)) {
if("T2_outsourceRevision".equals(type)||"T2_OutBuyPartRevision".equals(type) ) {
//判断是否有状态
if("T2_outsourceRevision".equals(type)||"T2_OutBuyPartRevision".equals(type)
) {
TCProperty tcProperty = rev.getTCProperty("release_status_list");
TCComponent[] targets = tcProperty.getReferenceValueArray();
String groupcode1 = rev.getStringProperty("t2_groupCode");
@ -373,16 +375,20 @@ public class Dfl019Operation extends AbstractAIFOperation{
"Ìáʾ", MessageBox.WARNING);
return true;
}
if(groupcode1.equals("")){
MessageBox.post(rev.getStringProperty("item_id")+"该物料没有分群码!!",
"提示", MessageBox.WARNING);
return true;
}
if(sourceCode1.equals("")){
MessageBox.post(rev.getStringProperty("item_id")+"该物料没有来源码!!",
"提示", MessageBox.WARNING);
return true;
if("T2_outsourceRevision".equals(type)||"T2_OutBuyPartRevision".equals(type)
) {
if(groupcode1.equals("")){
MessageBox.post(rev.getStringProperty("item_id")+"该物料没有分群码!!",
"提示", MessageBox.WARNING);
return true;
}
if(sourceCode1.equals("")){
MessageBox.post(rev.getStringProperty("item_id")+"该物料没有来源码!!",
"提示", MessageBox.WARNING);
return true;
}
}
}
}else {
MessageBox.post("¸ÃÎïÁϲ»ÔÊÐí´«µÝERP!!",
@ -830,6 +836,8 @@ public class Dfl019Operation extends AbstractAIFOperation{
String zong= tops + sss3SB.toString()+bottom;
System.out.println(zong);
String tempPath = System.getProperty("java.io.tmpdir");
System.out.println("10.20temp路径======="+tempPath);
//String path = "D:\\SENDTOERPLOG\\" + fileName + ".txt";
String path = tempPath + fileName + ".txt";
File file = new File(path);
if (!file.exists()) {
@ -872,6 +880,8 @@ public class Dfl019Operation extends AbstractAIFOperation{
String zong= tops + sss3SB.toString()+bottom;
System.out.println(zong);
String tempPath = System.getProperty("java.io.tmpdir");
System.out.println("10.20temp路径======="+tempPath);
//String path = "D:\\SENDTOERPLOG\\" + fileName + ".txt";
String path = tempPath + fileName + ".txt";
File file = new File(path);
if (!file.exists()) {

@ -178,6 +178,8 @@ public class Dfl020Operation extends AbstractAIFOperation{
if(comp[0] instanceof TCComponentItemRevision ) {
rev = (TCComponentItemRevision) comp[0];
String rve_id = rev.getStringProperty("current_revision_id");
System.out.println("11.17rve_id======"+rve_id);
}
if(comp[0] instanceof TCComponentBOMLine ) {
TCComponentBOMLine get_bom_line = (TCComponentBOMLine) comp[0];
@ -186,8 +188,10 @@ public class Dfl020Operation extends AbstractAIFOperation{
TCProperty tcProperty1 = rev.getTCProperty("release_status_list");
TCComponent[] targets1 = tcProperty1.getReferenceValueArray();
String item_type = rev.getType();
//限制没有发布状态的非虚拟件版本发起bom传递erp命令
// if(!("T2_VirtualRevision".equals(item_type))) {
//限制没有发布状态的设备虚拟件版本发起bom传递erp命令
// if("T2_VirtualRevision".equals(item_type)||"T2_EquipmentRevision".equals(item_type)) {
// if(targets1 == null || targets1.length <= 0) {
// MessageBox.post("您选中的版本对象没有发布状态","提示",MessageBox.INFORMATION);
// return;
@ -253,7 +257,7 @@ public class Dfl020Operation extends AbstractAIFOperation{
TCTypeService service = session.getTypeService();
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) service.getTypeComponent("BOMWindow");
TCComponentBOMWindow view = winType.create(null);
TCComponentBOMLine line = view.setWindowTopLine(item,item.getLatestItemRevision(), null, null);
TCComponentBOMLine line = view.setWindowTopLine(item,rev, null, null);
AIFComponentContext[] childs = line.getChildren();
if(childs != null && childs.length > 0) {
createXMLFile(line,zhangtao);
@ -286,6 +290,8 @@ public class Dfl020Operation extends AbstractAIFOperation{
//List<FatherBomLineBean> list = new ArrayList<FatherBomLineBean>();
StringBuilder uidSB = new StringBuilder();
try {
getBOMValue(line,list);
if(list.size() <=0) {
@ -295,7 +301,7 @@ public class Dfl020Operation extends AbstractAIFOperation{
}
} catch (Exception e) {
// TODO: handle exception
MessageBox.post("BOM 传递失败请检查BOM行是否正确" ,"提示",MessageBox.INFORMATION);
MessageBox.post("BOM 传递失败请检查BOM行是否正确!" ,"提示",MessageBox.INFORMATION);
return;
}
//获取父 属性
@ -414,6 +420,8 @@ public class Dfl020Operation extends AbstractAIFOperation{
String fileName ="BOM"+ plmls;
String tempPath = System.getProperty("java.io.tmpdir");
System.out.println("10.20temp路径======="+tempPath);
//String path = "D:\\SENDTOERPLOG\\" + fileName + ".txt";
String path = tempPath + fileName + ".txt";
File file = new File(path);
@ -531,8 +539,13 @@ public class Dfl020Operation extends AbstractAIFOperation{
list.add(fatherBean);
for (int i = 0; i < childrens.length; i++)
{
TCComponentBOMLine z_line = (TCComponentBOMLine)childrens[i].getComponent();
TCComponentItem item = z_line.getItem();
// String idString = item.getStringProperty("item_id");
// System.out.println("11.17id======"+idString);
System.out.println("11.17z_line======="+z_line);
System.out.println("11.17list======="+list);
String type = item.getType();
System.out.println("type=============" + type);
if (!("T2_OutBuyPart".equals(type)) && !("T2_outsource".equals(type)))

@ -78,6 +78,7 @@ public class Dfl025Operation extends AbstractAIFOperation{
File file = ((TCComponentDataset)excel).getTcFiles()[0].getFmsFile();
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");// 设置日期格式
String time = df.format(new Date());
System.out.println("11.12======"+lattetTime+"========"+EarlyTime);
String[] keys = new String[] {"创建时间晚于","创建时间早于"};
String[] values = new String[] {lattetTime,EarlyTime};
List<TCComponent> compList = queryObject("查找系统方案", keys, values);

File diff suppressed because it is too large Load Diff

@ -95,14 +95,14 @@ public class Dfl032Dialog extends AbstractAIFDialog{
@Override
public void run() {
ParseXMLUtil xml=new ParseXMLUtil();
File file=xml.getSXX("DFL_CLASS_Xml", session);
attrList =xml.parseXMLCode(file);
if(attrList == null || attrList.size() <= 0) {
MessageBox.post("首选项DFL_CLASS_Xml未配置请检查", "WARNING",
MessageBox.WARNING);
return;
}
// ParseXMLUtil xml=new ParseXMLUtil();
// File file=xml.getSXX("DFL_CLASS_Xml", session);
// attrList =xml.parseXMLCode(file);
// if(attrList == null || attrList.size() <= 0) {
// MessageBox.post("首选项DFL_CLASS_Xml未配置请检查", "WARNING",
// MessageBox.WARNING);
// return;
// }
InterfaceAIFComponent comp = app.getTargetComponent();
String compType = comp.getType();
System.out.println("compType=============="+compType);
@ -381,19 +381,19 @@ public class Dfl032Dialog extends AbstractAIFDialog{
classPropList.add(bean);
}
}
for (int i = 0; i < attrList.size(); i++) {
String classValue = attrList.get(i);
if(classValue.contains(";")) {
String[] classValues = classValue.split(";");
if(c.getId().equals(classValues[0])) {
attrName = new String [classValues.length -1];
for (int j = 0; j < attrName.length; j++) {
attrName[j] = classValues[j+1];
}
break;
}
}
}
// for (int i = 0; i < attrList.size(); i++) {
// String classValue = attrList.get(i);
// if(classValue.contains(";")) {
// String[] classValues = classValue.split(";");
// if(c.getId().equals(classValues[0])) {
// attrName = new String [classValues.length -1];
// for (int j = 0; j < attrName.length; j++) {
// attrName[j] = classValues[j+1];
// }
// break;
// }
// }
// }
String[] columnNames = new String[icsAttrS.length + 3];
columnNames[0] = "序号";
columnNames[1] = "品号";
@ -448,18 +448,18 @@ public class Dfl032Dialog extends AbstractAIFDialog{
model.setDataVector(cellData, columnNames);
//DefaultTableCellRenderer类可以绘制单元格的背景、字体颜色等功能
DefaultTableCellRenderer backGroundColor = new DefaultTableCellRenderer();
// DefaultTableCellRenderer backGroundColor = new DefaultTableCellRenderer();
//绘制部门列的背景为黄色
backGroundColor.setBackground(Color.yellow);
if(attrName != null && attrName.length > 0) {
for (int i = 0; i < attrName.length; i++) {
List<String> colList = Arrays.asList(columnNames);
if(colList.contains(attrName[i])) {
TableColumn tableColumn = qryTable.getColumn(attrName[i]);
tableColumn.setCellRenderer(backGroundColor);
}
}
}
// backGroundColor.setBackground(Color.yellow);
// if(attrName != null && attrName.length > 0) {
// for (int i = 0; i < attrName.length; i++) {
// List<String> colList = Arrays.asList(columnNames);
// if(colList.contains(attrName[i])) {
// TableColumn tableColumn = qryTable.getColumn(attrName[i]);
// tableColumn.setCellRenderer(backGroundColor);
// }
// }
// }
qryTable.getColumnModel().getColumn(0).setPreferredWidth(10);
qryTable.setDefaultRenderer(Object.class, new TableCellTextAreaRenderer());
JScrollPane scrollPane=new JScrollPane(qryTable);

@ -61,10 +61,12 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.jacorb.idl.runtime.int_token;
//import com.connor.dfl.plm.dfl038.MyComparator;
import com.connor.dfl.plm.util.DataBaseControl;
import com.connor.dfl.plm.util.ProgressBar;
import com.connor.dfl.plm.util.ProgressBarThread;
import com.lowagie.text.Row;
//import com.sun.javafx.image.IntPixelAccessor;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentQuery;
@ -142,7 +144,7 @@ public class DFL038Jframe extends JFrame {
private JButton cancelButton;
private JPanel centerPanel1;
private String[] title = new String[] { "产品部门", "产品名称", "变更通知单号", "产品型号", "客户名称", "更改类型", "更改原因", "图纸更改类型", "责任部门",
private String[] title = new String[] { "产品部门", "产品名称", "变更通知单号", "产品型号", "客户名称", "申请人","更改类型", "更改原因", "图纸更改类型", "责任部门",
"责任人", "品号", "品名", "原版本", "现版本", "变更数量", "产品类型", "错误类型", "价格预告", "销售分类", "是否产生成本损失", "项目阶段", "料件领用分类",
"图纸发至", "项目编号", "通知紧急程度", "申请时间", "账套", "流程阶段" };
@ -480,7 +482,7 @@ public class DFL038Jframe extends JFrame {
"jdbc:oracle:thin:@192.168.1.138:1521/tc12", "infodba", "infodba");
control.openDataBase();
String colString = " F.PRODUCTDEPARTMENT,F.PRODUCTNAME,F.CHANGELISTCODE,F.PROJECTMODEL,F.CLIENTNAME,F.CHANGETYPE,F.CHANGEREASON,F.TZGGLX,F.DUTYDEPARTMENT,F.DUTYMAN,D.PH,D.PM,D.YBB,D.XBB,D.BGSL,F.PRODUCTTYPE,F.ERRORTYPE,F.PRICEBOOKING,F.SALSECLASSIFY,F.ISNOTPRODUCTLOSS,F.XMJD,F.RECEIVECLASSIFY,F.DRAWINGTO,F.PROJECTCODE,F.NOTIFYEMERGENCYPROCEDURES,F.APPLYDATE,F.ACCOUNTSET ";
String colString = " F.PRODUCTDEPARTMENT,F.PRODUCTNAME,F.CHANGELISTCODE,F.PROJECTMODEL,F.CLIENTNAME,F.APPLYNAME,F.CHANGETYPE,F.CHANGEREASON,F.TZGGLX,F.DUTYDEPARTMENT,F.DUTYMAN,D.PH,D.PM,D.YBB,D.XBB,D.BGSL,F.PRODUCTTYPE,F.ERRORTYPE,F.PRICEBOOKING,F.SALSECLASSIFY,F.ISNOTPRODUCTLOSS,F.XMJD,F.RECEIVECLASSIFY,F.DRAWINGTO,F.PROJECTCODE,F.NOTIFYEMERGENCYPROCEDURES,F.APPLYDATE,F.ACCOUNTSET ";
// 获取需要判断的列
@ -491,21 +493,24 @@ public class DFL038Jframe extends JFrame {
+ " F.APPLYDATE IS NOT NULL AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') >= to_date('"
+ startTime
+ "','yyyy-MM-dd HH24:mi:ss') AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') <= to_date('"
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions+" order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions
+ " order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
if (depart == null || depart.trim().equals("")) {
sql1 = "select " + colString + " from DFL_CHANGEFORM F LEFT OUTER JOIN DFL_CHANGEDETAILS D ON " + leftConditions
+ " (F.OBJECTCODE like'ECN%' or F.OBJECTCODE like'QECN%') " + " AND "
sql1 = "select " + colString + " from DFL_CHANGEFORM F LEFT OUTER JOIN DFL_CHANGEDETAILS D ON "
+ leftConditions + " (F.OBJECTCODE like'ECN%' or F.OBJECTCODE like'QECN%') " + " AND "
+ " F.APPLYDATE IS NOT NULL AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') >= to_date('"
+ startTime
+ "','yyyy-MM-dd HH24:mi:ss') AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') <= to_date('"
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions+" order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions
+ " order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
} else if (depart != null && "全部".equals(depart)) {
sql1 = "select " + colString + " from DFL_CHANGEFORM F LEFT OUTER JOIN DFL_CHANGEDETAILS D ON " + leftConditions
+ " (F.OBJECTCODE like'ECN%' or F.OBJECTCODE like'QECN%') " + " AND "
sql1 = "select " + colString + " from DFL_CHANGEFORM F LEFT OUTER JOIN DFL_CHANGEDETAILS D ON "
+ leftConditions + " (F.OBJECTCODE like'ECN%' or F.OBJECTCODE like'QECN%') " + " AND "
+ " F.APPLYDATE IS NOT NULL AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') >= to_date('"
+ startTime
+ "','yyyy-MM-dd HH24:mi:ss') AND to_date(F.applydate,'yyyy-MM-dd HH24:mi:ss') <= to_date('"
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions+" order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
+ endTime + "','yyyy-MM-dd HH24:mi:ss') " + conditions
+ " order by F.PRODUCTDEPARTMENT,F.APPLYDATE";
}
System.out.println(sql1);
@ -584,11 +589,11 @@ public class DFL038Jframe extends JFrame {
i++;
XSSFRow Row = sheet2.createRow(i);
String changeFormId = dbQuery.getString(3);
if (changeFormId!=null && !changeFormId.equals(lastChangeFormId)) {
if (changeFormId != null && !changeFormId.equals(lastChangeFormId)) {
List<TCComponent> queryObject = queryObject("零组件 ID", new String[] { "零组件 ID" },
new String[] { changeFormId });
System.out.println(changeFormId);
if (queryObject!=null && queryObject.size() > 0) {
if (queryObject != null && queryObject.size() > 0) {
TCComponent component = queryObject.get(0);
AIFComponentContext[] versions = component.getChildren("revision_list");
TCComponent versionComponent = (TCComponent) versions[0].getComponent();
@ -623,8 +628,11 @@ public class DFL038Jframe extends JFrame {
}
Set<String> set = new HashSet<String>();
int db2 = 0;
while (dbQuery2.next()) {
set.add(dbQuery2.getString(3));
db2++;
}
dbQuery2.first();
dbQuery2.previous();
@ -664,29 +672,18 @@ public class DFL038Jframe extends JFrame {
}
}
System.out.println(dbQuery2.getRow()+"--1--"+changeType.length);
System.out.println(dbQuery2.getRow() + "--1--" + changeType.length);
int[][] CTN = new int[list.size()][changeType.length];
String year = list.get(0).substring(0,4);
int lastRN = list.size()+1;
int[] countNum = null;
int countYear = 0;
String year = list.get(0).substring(0, 4);
int rowY = 0;
int lastRN = list.size() + 1;
int current = 0;
while (dbQuery2.next()) {
current++;
for (int j = 0; j < list.size(); j++) {
// System.out.println(year+"-----2------"+rows[j].getCell(0).getStringCellValue().substring(0,4));
// if(!year.equals(rows[j].getCell(0).getStringCellValue().substring(0,4))) {
// System.out.println(year);
// year = rows[j].getCell(0).getStringCellValue().substring(0,4);
// System.out.println("after"+year);
// XSSFRow row = sheet1.createRow(lastRN++);
// row.createCell(0).setCellValue("合计:");
// for(int o=0;o<changeType.length;o++) {
// row.createCell(o+1).setCellValue(CTN[j][o]);
// }
// row.createCell(changeType.length+1).setCellValue(getArrayCount(CTN[j]));
// sheet1.shiftRows(j, lastRN-1, 1, true, false);
// }
if (dbQuery2.getString(3).equals(list.get(j))) {
System.out.println(dbQuery2.getString(3));
for (int n = 0; n < changeType.length; n++) {
@ -696,134 +693,80 @@ public class DFL038Jframe extends JFrame {
createCell.setCellStyle(cellStyle);
createCell.setCellValue(dbQuery2.getString(1));
num[n] += Integer.parseInt(dbQuery2.getString(1));
if (!year.equals(rows[j].getCell(0).getStringCellValue().substring(0, 4))) {
System.out.println(list);
System.out.println(year);
XSSFRow row = sheet1.createRow(lastRN++);
XSSFCell cell = row.createCell(0);
cell.setCellStyle(cellStyle);
cell.setCellValue(year + "合计:");
year = rows[j].getCell(0).getStringCellValue().substring(0, 4);
System.out.println("after" + year);
for (int o = 0; o < changeType.length; o++) {
cell = row.createCell(o + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(CTN[j - 1][o]);
}
cell = row.createCell(changeType.length + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(getArrayCount(CTN[j - 1]));
countNum = arrayAdd(CTN[j - 1], countNum);
// sheet1.shiftRows(j, lastRN-1, 1, true, false);
}
}
}
for (int n = 0; n < changeType.length; n++) {
CTN[j][n] = num[n];
}
}
}
}
int lastYearDetail[] = null;
int yearNum=1;
for (int j = 0; j <=list.size(); j++) {
if(j==list.size()) {
sheet1.shiftRows(j+yearNum, lastRN++, 1, true, false);
XSSFRow row = sheet1.createRow(j+yearNum);
XSSFCell createCell2 = row.createCell(0);
createCell2.setCellStyle(cellStyle);
createCell2.setCellValue("合计:");
if(lastYearDetail ==null) {
for(int o=0;o<changeType.length;o++) {
XSSFCell createCell = row.createCell(o+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(CTN[j-1][o]);
}
XSSFCell createCell = row.createCell(changeType.length+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(getArrayCount(CTN[j-1]));
lastYearDetail = CTN[j-1];
}else {
for(int o=0;o<changeType.length;o++) {
XSSFCell createCell = row.createCell(o+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(CTN[j-1][o]-lastYearDetail[o]);
}
XSSFCell createCell = row.createCell(changeType.length+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(getArrayCount(CTN[j-1])-getArrayCount(lastYearDetail));
lastYearDetail = CTN[j-1];
}
yearNum++;
break;
}
// System.out.println(year+"-----2------"+rows[j].getCell(0).getStringCellValue().substring(0,4));
if(!year.equals(rows[j].getCell(0).getStringCellValue().substring(0,4))) {
System.out.println(year);
year = rows[j].getCell(0).getStringCellValue().substring(0,4);
System.out.println("after"+year);
sheet1.shiftRows(j+1, lastRN++, 1, true, false);
XSSFRow row = sheet1.createRow(j+1);
XSSFCell createCell2 = row.createCell(0);
createCell2.setCellStyle(cellStyle);
createCell2.setCellValue("合计:");
if(lastYearDetail ==null) {
for(int o=0;o<changeType.length;o++) {
XSSFCell createCell = row.createCell(o+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(CTN[j][o]);
}
XSSFCell createCell = row.createCell(changeType.length+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(getArrayCount(CTN[j]));
lastYearDetail = CTN[j];
}else {
for(int o=0;o<changeType.length;o++) {
XSSFCell createCell = row.createCell(o+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(CTN[j][o]-lastYearDetail[o]);
if(current == db2) {
if(countNum!=null) {
XSSFRow row = sheet1.createRow(lastRN++);
XSSFCell cell = row.createCell(0);
cell.setCellStyle(cellStyle);
cell.setCellValue(list.get(list.size()-1).substring(0,4)+"合计:");
for (int o = 0; o < changeType.length; o++) {
cell = row.createCell(o + 1);
cell.setCellStyle(cellStyle);
System.out.println("cell=>"+(null==cell));
System.out.println("CTN[CTN.length-1]=>"+(null==CTN[CTN.length-1]));
System.out.println("CTN[CTN.length-1][o]=>"+CTN[CTN.length-1][o]);
System.out.println("countNum[o]=>"+countNum[o]);
cell.setCellValue(CTN[CTN.length-1][o]-countNum[o]);
}
XSSFCell createCell = row.createCell(changeType.length+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(getArrayCount(CTN[j])-getArrayCount(lastYearDetail));
lastYearDetail = CTN[j];
cell = row.createCell(changeType.length + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(getArrayCount(CTN[CTN.length-1])-getArrayCount(countNum));
}
// sheet1.createRow(j+1);
yearNum++;
XSSFRow row = sheet1.createRow(lastRN++);
XSSFCell cell = row.createCell(0);
cell.setCellStyle(cellStyle);
cell.setCellValue("合计:");
for (int o = 0; o < changeType.length; o++) {
cell = row.createCell(o + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(CTN[CTN.length-1][o]);
}
cell = row.createCell(changeType.length + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(getArrayCount(CTN[CTN.length-1]));
}
}
for(int p=0;p<list.size();p++) {
for (int p = 0; p < list.size(); p++) {
System.out.println(Arrays.toString(CTN[p]));
}
XSSFRow row = sheet1.createRow(list.size()+yearNum);
XSSFCell createCell2 = row.createCell(0);
createCell2.setCellStyle(cellStyle);
createCell2.setCellValue("合计:");
for (int j = 0; j < num.length; j++) {
XSSFCell cell = row.createCell(j + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(num[j]);
}
int count = 0;
for (int q : num) {
count += q;
}
XSSFCell createCell = row.createCell(num.length + 1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(count);
for (int m = 0; m <= changeType.length; m++) {
sheet1.setColumnWidth(m, 10 * 256);
// sheet1.autoSizeColumn(m);
}
for (int j = 0; j <= title.length; j++) {
sheet2.setColumnWidth(j, 20 * 256);
// sheet2.autoSizeColumn(j);
}
FileOutputStream fos = FileUtils.openOutputStream(new File(absoluteFilePath));
workbook.write(fos);
if (fos != null) {
fos.close();
}
// listByYear(CTN,list.size(),absoluteFilePath);
} catch (Exception e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
@ -992,28 +935,27 @@ public class DFL038Jframe extends JFrame {
XSSFSheet sheet = (XSSFSheet) workbook.getSheet("月份清单");
int lastRowNum = sheet.getLastRowNum();
int[] num = new int[changeType.length];
for(int i=0;i<changeType.length;i++) {
for (int i = 0; i < changeType.length; i++) {
num[i] = 0;
}
String year = sheet.getRow(1).getCell(0).getStringCellValue().substring(0,4);
String year = sheet.getRow(1).getCell(0).getStringCellValue().substring(0, 4);
for(int i=1;i<=lastRowNum;i++) {
for (int i = 1; i <= lastRowNum; i++) {
XSSFRow row = sheet.getRow(i);
if(!year.equals(row.getCell(0).getStringCellValue().substring(0,4))) {
sheet.shiftRows(i, lastRowNum, 1,true,false);
if (!year.equals(row.getCell(0).getStringCellValue().substring(0, 4))) {
sheet.shiftRows(i, lastRowNum, 1, true, false);
XSSFRow row2 = sheet.createRow(++lastRowNum);
for(int n=0;n<=changeType.length+1;n++) {
for (int n = 0; n <= changeType.length + 1; n++) {
XSSFCell cell = row2.createCell(n);
if(n==0) {
cell.setCellValue("合计:");
}else if(n<=changeType.length){
cell.setCellValue(num[n-1]);
}else {
if (n == 0) {
cell.setCellValue("合计1:");
} else if (n <= changeType.length) {
cell.setCellValue(num[n - 1]);
} else {
cell.setCellValue(getArrayCount(num));
}
}
}
}
@ -1026,7 +968,7 @@ public class DFL038Jframe extends JFrame {
int startRow = 1;
XSSFSheet sheet = (XSSFSheet) workbook.getSheet("详细清单");
int lastRowNum = sheet.getLastRowNum();
if(lastRowNum<=0) {
if (lastRowNum <= 0) {
return;
}
String merginId = sheet.getRow(1).getCell(2).getStringCellValue();
@ -1035,8 +977,8 @@ public class DFL038Jframe extends JFrame {
if (!merginId.equals(currentId)) {
CellRangeAddress region = new CellRangeAddress(startRow, i - 1, 0, 0);
sheet.addMergedRegion(region);
for(int j=1;j<title.length;j++) {
if(j==10 || j==11 || j==12 || j==13 || j==14) {
for (int j = 1; j < title.length; j++) {
if (j == 10 || j == 11 || j == 12 || j == 13 || j == 14) {
continue;
}
region = new CellRangeAddress(startRow, i - 1, j, j);
@ -1049,8 +991,8 @@ public class DFL038Jframe extends JFrame {
if (i == lastRowNum) {
CellRangeAddress region = new CellRangeAddress(startRow, lastRowNum, 0, 0);
sheet.addMergedRegion(region);
for(int j=1;j<title.length;j++) {
if(j==10 || j==11 || j==12 || j==13 || j==14) {
for (int j = 1; j < title.length; j++) {
if (j == 10 || j == 11 || j == 12 || j == 13 || j == 14) {
continue;
}
region = new CellRangeAddress(startRow, lastRowNum, j, j);
@ -1065,12 +1007,26 @@ public class DFL038Jframe extends JFrame {
public int getArrayCount(int[] args) {
int count = 0;
for(int i=0;i<args.length;i++) {
count+=args[i];
for (int i = 0; i < args.length; i++) {
count += args[i];
}
return count;
}
public static int[] arrayAdd(int[] array,int [] val) {
int[] back = new int[array.length];
for(int i=0;i<array.length;i++) {
if(val == null) {
back[i] = array[i];
}
else {
back[i] = array[i]+val[i];
}
}
return back;
}
public static void main(String[] args) {
new DFL038Jframe();
// Date date = new Date();

@ -270,8 +270,6 @@ public class CreateNoemBOMDialogs extends AbstractAIFDialog {
}
/**
*
*
@ -367,7 +365,6 @@ public class CreateNoemBOMDialogs extends AbstractAIFDialog {
}
}
if(vals != null) {
TCTypeService service = session.getTypeService();
//获取BOMWindowType
TCComponentBOMWindowType winType = (TCComponentBOMWindowType) service

@ -140,10 +140,13 @@ public class AddDialogApply_TZ extends AbstractAIFDialog {
if(!("".equals(s.trim()))) {
sb.append(";");
}
sb.append(list.get(i));
if(i < list.size()-1) {
if(sb.length()>0&&sb.charAt(sb.length()-1)!=';') {
sb.append(";");
}
sb.append(list.get(i));
// if(i < list.size()-1) {
// sb.append(";");
// }
}
//changeform.model1.setValueAt(proid, 8, 1);

@ -100,10 +100,13 @@ public class AddDialogNotify_TZ extends AbstractAIFDialog {
if(!("".equals(s.trim()))) {
sb.append(";");
}
sb.append(list.get(i));
if(i < list.size()-1) {
if(sb.length()>0&&sb.charAt(sb.length()-1)!=';') {
sb.append(";");
}
sb.append(list.get(i));
// if(i < list.size()-1) {
// sb.append(";");
// }
}
//changeform.model1.setValueAt(proid, 8, 1);

@ -442,10 +442,13 @@ public class AddDialogQuickChange_TZ extends AbstractAIFDialog {
if(!("".equals(s.trim()))) {
sb.append(";");
}
sb.append(list.get(i));
if(i < list.size()-1) {
if(sb.length()>0&&sb.charAt(sb.length()-1)!=';') {
sb.append(";");
}
sb.append(list.get(i));
// if(i < list.size()-1) {
// sb.append(";");
// }
}
//changeform.model1.setValueAt(proid, 8, 1);

File diff suppressed because it is too large Load Diff

@ -1,5 +1,7 @@
package com.connor.dfl.plm.forms;
import org.jacorb.idl.runtime.int_token;
/**
*
* @author ËïÒã
@ -14,6 +16,7 @@ public class ChangeDetils {
private String YSL;
private String XSL;
private String BGSL;
private String GGSM;
private String WZPSL;
private String WZPUJ;
private String ZZSL;
@ -30,7 +33,7 @@ public class ChangeDetils {
public ChangeDetils() {
}
public ChangeDetils(String objtctCode,String pH, String pM, String yBB, String xBB, String ySL, String xSL, String bGSL, String wZPSL,
public ChangeDetils(String objtctCode,String pH, String pM, String yBB, String xBB, String ySL, String xSL, String bGSL,String gGSM, String wZPSL,
String wZPUJ, String zZSL, String zZYJ, String sCSL, String sSYJ, String cKSL, String cLYJ) {
this.objectCode= objtctCode;
this.PH = pH;
@ -40,6 +43,7 @@ public class ChangeDetils {
this.YSL = ySL;
this.XSL = xSL;
this.BGSL = bGSL;
this.GGSM = gGSM;
this.WZPSL = wZPSL;
this.WZPUJ = wZPUJ;
this.ZZSL = zZSL;
@ -94,11 +98,19 @@ public class ChangeDetils {
XSL = xSL;
}
public String getBGSL() {
return BGSL;
}
public void setBGSL(String bGSL) {
BGSL = bGSL;
}
public String getGGSM() {
return GGSM;
}
public void setGGSM(String gGSM) {
GGSM = gGSM;
}
public String getWZPSL() {
return WZPSL;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -83,7 +83,7 @@ public class ClassValueUtil {
String kaitou1 = attrName.substring(0,2);
//前两个字是否为规格
if("规格".equals(kaitou1)) {
valueBean.setSpec(value);
valueBean.setSpec(lovValue);
}
}
else if(attrName.contains("订货码")){

Loading…
Cancel
Save