Compare commits

..

No commits in common. '66926b393cee33cc156728ea194cd8e79318b684' and 'ea7e6c9a8ddb72f898f6423611bcd53e596a9c8b' have entirely different histories.

@ -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,9 +232,6 @@
<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">
@ -450,10 +447,7 @@
<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"/>
-->
@ -513,19 +507,7 @@
</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>
@ -698,36 +680,7 @@
</with>
</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>
</command>
</menu>
@ -758,7 +711,19 @@
</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>
@ -826,7 +791,7 @@
</and>
</visibleWhen>
</command>
<command commandId="com.connor.dfl.plm.dfl007.Dfl007Handler" id="com.connor.dfl.plm.dfl007.Dfl007Handler">
<visibleWhen>

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

@ -361,9 +361,7 @@ 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");
@ -375,20 +373,16 @@ public class Dfl019Operation extends AbstractAIFOperation{
"Ìáʾ", 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;
}
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!!",
@ -836,8 +830,6 @@ 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()) {
@ -880,8 +872,6 @@ 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,8 +178,6 @@ 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];
@ -188,10 +186,8 @@ 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)||"T2_EquipmentRevision".equals(item_type)) {
//限制没有发布状态的非虚拟件版本发起bom传递erp命令
// if(!("T2_VirtualRevision".equals(item_type))) {
// if(targets1 == null || targets1.length <= 0) {
// MessageBox.post("您选中的版本对象没有发布状态","提示",MessageBox.INFORMATION);
// return;
@ -257,7 +253,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,rev, null, null);
TCComponentBOMLine line = view.setWindowTopLine(item,item.getLatestItemRevision(), null, null);
AIFComponentContext[] childs = line.getChildren();
if(childs != null && childs.length > 0) {
createXMLFile(line,zhangtao);
@ -290,8 +286,6 @@ public class Dfl020Operation extends AbstractAIFOperation{
//List<FatherBomLineBean> list = new ArrayList<FatherBomLineBean>();
StringBuilder uidSB = new StringBuilder();
try {
getBOMValue(line,list);
if(list.size() <=0) {
@ -301,7 +295,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;
}
//获取父 属性
@ -420,8 +414,6 @@ 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);
@ -539,13 +531,8 @@ 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,7 +78,6 @@ 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,12 +61,10 @@ 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;
@ -144,7 +142,7 @@ public class DFL038Jframe extends JFrame {
private JButton cancelButton;
private JPanel centerPanel1;
private String[] title = new String[] { "产品部门", "产品名称", "变更通知单号", "产品型号", "客户名称", "申请人","更改类型", "更改原因", "图纸更改类型", "责任部门",
private String[] title = new String[] { "产品部门", "产品名称", "变更通知单号", "产品型号", "客户名称", "更改类型", "更改原因", "图纸更改类型", "责任部门",
"责任人", "品号", "品名", "原版本", "现版本", "变更数量", "产品类型", "错误类型", "价格预告", "销售分类", "是否产生成本损失", "项目阶段", "料件领用分类",
"图纸发至", "项目编号", "通知紧急程度", "申请时间", "账套", "流程阶段" };
@ -482,7 +480,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.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 ";
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 ";
// 获取需要判断的列
@ -493,24 +491,21 @@ 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);
@ -589,11 +584,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();
@ -628,11 +623,8 @@ 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();
@ -644,7 +636,7 @@ public class DFL038Jframe extends JFrame {
// Collections.sort(list,new MyComparator());
Collections.sort(list);
// 创建列头
XSSFRow[] rows = new XSSFRow[list.size()];
@ -671,19 +663,30 @@ public class DFL038Jframe extends JFrame {
createCell.setCellValue(0);
}
}
System.out.println(dbQuery2.getRow() + "--1--" + changeType.length);
System.out.println(dbQuery2.getRow()+"--1--"+changeType.length);
int[][] CTN = new int[list.size()][changeType.length];
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;
String year = list.get(0).substring(0,4);
int lastRN = list.size()+1;
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++) {
@ -693,79 +696,133 @@ 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];
}
}
}
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]);
}
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]);
}
cell = row.createCell(changeType.length + 1);
cell.setCellStyle(cellStyle);
cell.setCellValue(getArrayCount(CTN[CTN.length-1])-getArrayCount(countNum));
XSSFCell createCell = row.createCell(changeType.length+1);
createCell.setCellStyle(cellStyle);
createCell.setCellValue(getArrayCount(CTN[j-1])-getArrayCount(lastYearDetail));
lastYearDetail = CTN[j-1];
}
yearNum++;
break;
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]);
}
// 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]);
}
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]));
// sheet1.createRow(j+1);
yearNum++;
}
}
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
@ -918,7 +975,7 @@ public class DFL038Jframe extends JFrame {
return null;
}
}
private void listByYear(String filePath) throws Exception {
// TODO Auto-generated method stub
FileInputStream fis = FileUtils.openInputStream(new File(filePath));
@ -935,30 +992,31 @@ 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);
for (int i = 1; i <= lastRowNum; i++) {
String year = sheet.getRow(1).getCell(0).getStringCellValue().substring(0,4);
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("合计1:");
} else if (n <= changeType.length) {
cell.setCellValue(num[n - 1]);
} else {
if(n==0) {
cell.setCellValue("合计:");
}else if(n<=changeType.length){
cell.setCellValue(num[n-1]);
}else {
cell.setCellValue(getArrayCount(num));
}
}
}
}
}
public void merge(String filePath) throws Exception {
@ -968,7 +1026,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();
@ -977,8 +1035,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);
@ -991,8 +1049,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);
@ -1004,28 +1062,14 @@ public class DFL038Jframe extends JFrame {
FileOutputStream fos = FileUtils.openOutputStream(new File(filePath));
workbook.write(fos);
}
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();

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

@ -1,734 +0,0 @@
package com.connor.dfl.plm.dfl044;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import com.connor.dfl.plm.dfl027.ChangeOwnerbean;
import com.connor.dfl.plm.dfl038.ChangeBean;
import com.connor.dfl.plm.forms.ChangeOrderBean;
import com.connor.dfl.plm.util.CodeBean;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
public class DataBaseControl2 {
/** ************************数据库类调用:声明部分*********************************** */
/**
* kelsen ....
*/
Connection conn;
ResultSet rs;
PreparedStatement pstmt;
Statement stmt;
String strSQLQuery;
public String str_Information = "";
private String strDriver = "oracle.jdbc.driver.OracleDriver";
private String strUrl = "";
private String strUserName = "";
private String strPassword = "";
/**
*
*/
public DataBaseControl2(String strDriver, String strUrl, String strUserName,
String strPassword) {
// this.strDriver ="oracle.jdbc.driver.OracleDriver";//驱动
// this.strUrl = "jdbc:oracle:thin:@127.0.0.1:1521:tc";//连接路径
// this.strUserName = "infodba";//数据库用户
// this.strPassword = "infodba";//数据库密码
this.strDriver = strDriver; // "oracle.jdbc.driver.OracleDriver";//驱动
this.strUrl = strUrl; // "jdbc:oracle:thin:@127.0.0.1:1521:tceng";//连接路径
this.strUserName = strUserName; // "infodba";//数据库用户
this.strPassword = strPassword; // "infodba";//数据库密码
// 加载驱动
try {
Class.forName(strDriver);// 通过反射加载驱动到内存
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
}
// try {
// Class.forName("org.objectweb.rmijdbc.Driver").newInstance();
// } catch (InstantiationException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (ClassNotFoundException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
/**
*
*/
public DataBaseControl2(TCSession session) {
String[] stringArray = session.getPreferenceService().getStringArray(4,
"DFL2_ERP_SQL_Connect2");
if (stringArray != null && stringArray.length == 3) {
strUrl = "jdbc:oracle:thin:@" + stringArray[0];
strUserName = stringArray[1];
strPassword = stringArray[2];
} else {
MessageBox.post("未配置DFL2_ERP_SQL_Connect2首选项无法获得连接信息!", "错误",
MessageBox.ERROR);
}
// 加载驱动
try {
Class.forName(strDriver);// 通过反射加载驱动到内存
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
}
}
/**
*
*/
public DataBaseControl2(TCSession session,String connect) {
String[] stringArray = session.getPreferenceService().getStringArray(4,
connect);
if (stringArray != null && stringArray.length == 3) {
strUrl = "jdbc:oracle:thin:@" + stringArray[0];
strUserName = stringArray[1];
strPassword = stringArray[2];
} else {
MessageBox.post("未配置"+connect+"首选项,无法获得连接信息!", "错误",
MessageBox.ERROR);
}
// 加载驱动
try {
Class.forName(strDriver);// 通过反射加载驱动到内存
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
}
}
/**
*
*
* @param strSQLQuery
*/
public void dbModify(String strSQLQuery) {
openDataBase();
try {
stmt = conn.createStatement();
stmt.executeUpdate(strSQLQuery);
} catch (SQLException sqle2) {
sqle2.printStackTrace();
}
closeDataBase();
}
/**
*
*
* @param strSQLQuery
* @return
*/
public ResultSet dbQuery(String strSQLQuery) {
ResultSet rs_result = null;
if (conn == null)
openDataBase();
try {
stmt = conn.createStatement();
rs_result = stmt.executeQuery(strSQLQuery);
} catch (SQLException sqle2) {
sqle2.printStackTrace();
}
return rs_result;
}
/**
* 2
*
* @param strSQLQuery
* @return
*/
public ResultSet dbQuery2(String strSQLQuery, Object[] strs) {
ResultSet rs_result = null;
if (conn == null)
openDataBase();
try {
// stmt = conn.createStatement();
PreparedStatement ps = conn.prepareStatement(strSQLQuery);
for (int i = 0; i < strs.length; i++) {
ps.setObject(i + 1, strs[i]);
}
rs_result = ps.executeQuery();
} catch (SQLException sqle2) {
sqle2.printStackTrace();
}
return rs_result;
}
/**
* 3
*
* @param strSQLQuery
* @return
*/
public ResultSet dbQuery3(String strSQLQuery) {
ResultSet rs_result = null;
if (conn == null)
openDataBase();
try {
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs_result = stmt.executeQuery(strSQLQuery);
} catch (SQLException sqle2) {
sqle2.printStackTrace();
}
return rs_result;
}
/**
* 2
*
* @param strSQLQuery
*/
public void dbModify2(String strSQLQuery, Object[] strs) {
openDataBase();
try {
// stmt = conn.createStatement();
PreparedStatement ps = conn.prepareStatement(strSQLQuery);
for (int i = 0; i < strs.length; i++) {
ps.setObject(i + 1, strs[i]);
}
ps.executeUpdate();
} catch (SQLException sqle2) {
sqle2.printStackTrace();
}
closeDataBase();
}
/**
*
*
*/
public void openDataBase() {
try {
// this.strUrl="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.29)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=tcprod)))";
if (conn == null || conn.isClosed())
conn = DriverManager.getConnection(strUrl, strUserName,
strPassword);
} catch (SQLException sqle) {
sqle.printStackTrace();
MessageBox.post("数据库连接错误" + sqle.getMessage(), "错误", 1);
}
}
/**
*
*
*/
public void closeDataBase() {
try {
if (rs != null) {
try {
rs.close();
} catch (SQLException sqlec) {
sqlec.printStackTrace();
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException sqlec) {
sqlec.printStackTrace();
}
}
if (conn != null && !conn.isClosed()) {
try {
conn.close();
} catch (SQLException sqlecon) {
sqlecon.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* HashMap,key
* VectorHasnMap
*
* @param strSQLQuery
* @return
* @author xuk
*/
public Vector orgQuery(String strSQLQuery) {
openDataBase();
Vector v_result = new Vector();
try {
ResultSet rs_get = dbQuery(strSQLQuery);
// System.out.println("RS_GET:"+rs_get);
if (rs_get != null) {
ResultSetMetaData metaData = rs_get.getMetaData();
int i_ColumnCount = metaData.getColumnCount();
// System.out.println("i_ColumnCount:"+i_ColumnCount);
while (rs_get.next()) {
// System.out.println("【BJZJ2】"+rs_get.getString("BJZJ2"));;
HashMap<String, String> hm_unit = new HashMap<String, String>();
for (int i = 1; i <= i_ColumnCount; i++) {
hm_unit.put(metaData.getColumnName(i),
rs_get.getString(i));
// System.out.println("metaData.getColumnName(i):"+metaData.getColumnName(i));
// System.out.println("rs_get.getString(i):"+rs_get.getString(i));
}
v_result.add(hm_unit);
}
} else {
str_Information = "【" + strSQLQuery + "】" + "查询的结果集为空\n";
}
} catch (Exception e) {
e.printStackTrace();
}
return v_result;
}
public String getTaskIdea(String uid)
throws Exception {
openDataBase();
String query = "select IDEA from PLM_Perform_Task where PUID= ?";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery2(query, new Object[] { uid});
String taskIdea = "";
if (rs.next()) {
taskIdea = rs.getString(1);
System.out.println("taskIdea=" + taskIdea);
}
closeDataBase();
return taskIdea;
}
public void setTaskIdea(String uid,String idea)
throws Exception {
openDataBase();
String query = "select IDEA from PLM_Perform_Task where PUID= ?";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery2(query, new Object[] { uid});
if(rs.next()) {
String upin = "update PLM_Perform_Task set IDEA= ? where PUID= ?";
dbModify2(upin, new Object[] { idea, uid });
}else {
String upin = "insert into PLM_Perform_Task(PUID,IDEA) values ( ? , ? )";
dbModify2(upin, new Object[] { uid, idea });
}
closeDataBase();
}
/**
*
*
* @param type
*
* @param prefix
*
* @param col
* 4"0000"
* @return
* @throws Exception
*/
public String getNewCode(String type, String prefix, String col)
throws Exception {
openDataBase();
String query = "select PREFIX,LSH from PLM_LSH where PLMTYPE= ? and PREFIX= ?";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery2(query, new Object[] { type, prefix });
String lshstr = col;
String pre = "";
String lsh = "";
if (rs.next()) {
pre = rs.getString(1);
lsh = rs.getString(2);
System.out.println("sspre=" + pre);
System.out.println("sslsh=" + lsh);
if ("".equals(lsh)) {
throw new Exception("流水码为空!");
}
int ls = Integer.parseInt(lsh) + 1;// 新的流水码数
lshstr = ls + "";
if (col != null) {
DecimalFormat df = new DecimalFormat(col);
lshstr = df.format(ls);
}
String upin = "update PLM_LSH set LSH= ? where PLMTYPE= ? and PREFIX= ? ";
dbModify2(upin, new Object[] { lshstr, type, prefix });
} else {
String upin = "insert into PLM_LSH(PLMTYPE,PREFIX,LSH) values ( ? , ? , ? )";
dbModify2(upin, new Object[] { type, prefix, lshstr });
}
closeDataBase();
String newId = prefix + lshstr;
return newId;
}
//获取变更单信息
public List<ChangeBean> getChangeMesg(String product,String time1,String time2) throws SQLException {
List<ChangeBean> list = new ArrayList<ChangeBean>();
if("全部".equals(product)) {
product = "";
}
String sql = "select * from DFL_CHANGEFORM where PRODUCTDEPARTMENT like '%"+product+"%'";//
SimpleDateFormat df = new SimpleDateFormat("yyyy-M-d HH:mm");
openDataBase();
System.out.println("sql============"+sql);
ResultSet rs = dbQuery(sql);
while(rs.next()){
try {
String dateStr = rs.getString(3);
System.out.println("date========"+rs.getString(3));
if(dateStr == null) {
continue;
}
Date date = df.parse(rs.getString(3));
Date date1 = df.parse(time1);
Date date2 = df.parse(time2);
if(date.after(date2) && date.before(date1)) {
System.out.println("date2========"+rs.getString(3));
}
if(date.after(date1) && date.before(date2)) {
ChangeBean bn = new ChangeBean();
bn.setApplyName(rs.getString(2));
bn.setApplyDate(rs.getString(3));
bn.setProjectCode(rs.getString(4));
bn.setClientNae(rs.getString(5));
bn.setProductName(rs.getString(7));
bn.setProjectModel(rs.getString(8));
bn.setChangeType(rs.getString(10));
bn.setProductType(rs.getString(11));
bn.setErrorType(rs.getString(12));
bn.setDutyDepartment(rs.getString(13));
bn.setDutyMan(rs.getString(14));
bn.setChangeReason(rs.getString(15));
bn.setSalseClassify(rs.getString(16));
bn.setPriceBooking(rs.getString(17));
bn.setIsNotProductLoss(rs.getString(18));
bn.setReceiveClassify(rs.getString(19));
bn.setWarehouseCode(rs.getString(20));
bn.setAccountSet(rs.getString(21));
bn.setNotifyEmergencyProcedures(rs.getString(22));
bn.setDrawingTo(rs.getString(23));
bn.setChangeListCode(rs.getString(24));
bn.setTZChangeType(rs.getString(25));
bn.setSUOSU_ProductDepartment(rs.getString(26));
bn.setProjectState(rs.getString(27));
list.add(bn);
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
closeDataBase();
return list;
}
/**
*
*
* @param type
*
* @param prefix
*
* @param col
* 4"0000"
* @return
* @throws Exception
*/
public String getNewCode(String type,CodeBean selCodeBean)
throws Exception {
String prefix = selCodeBean.getCode();
String col = selCodeBean.getNum();
String min = selCodeBean.getMin();
String max = selCodeBean.getMax();
openDataBase();
String query = "select PREFIX,LSH from PLM_LSH where PLMTYPE= ? and PREFIX= ?";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery2(query, new Object[] { type, prefix });
String lshstr = col;
String pre = "";
String lsh = "";
if (rs.next()) {
pre = rs.getString(1);
lsh = rs.getString(2);
System.out.println("sspre=" + pre);
System.out.println("sslsh=" + lsh);
if ("".equals(lsh)) {
throw new Exception("流水码为空!");
}
int ls = Integer.parseInt(lsh) + 1;// 新的流水码数
int minls = Integer.parseInt(min);
int maxls = Integer.parseInt(max);
if (minls>ls) {
ls=minls;
}
if (ls>maxls) {
System.out.println("错误:流水码最已超过最大值");
return "MAXERR";
}
lshstr = ls + "";
if (col != null) {
DecimalFormat df = new DecimalFormat(col);
lshstr = df.format(ls);
}
String upin = "update PLM_LSH set LSH= ? where PLMTYPE= ? and PREFIX= ? ";
dbModify2(upin, new Object[] { lshstr, type, prefix });
} else {
if (col != null) {
int minls = Integer.parseInt(min);
DecimalFormat df = new DecimalFormat(col);
lshstr = df.format(minls);
}
String upin = "insert into PLM_LSH(PLMTYPE,PREFIX,LSH) values ( ? , ? , ? )";
dbModify2(upin, new Object[] { type, prefix, lshstr });
}
closeDataBase();
String newId = prefix + lshstr;
return newId;
}
/**
*
*
*/
public String getMaxCode(String type,CodeBean selCodeBean)throws Exception {
String prefix = selCodeBean.getCode();
String col = selCodeBean.getNum();
String min = selCodeBean.getMin();
String max = selCodeBean.getMax();
openDataBase();
String query = "select * from (select * from pitem where pitem_id like '"+prefix+"%' order by pitem_id desc) where rownum<=1";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery(query);
String lshstr = col;
String lsh = "";
if (rs.next()) {
lsh = rs.getString(2);
System.out.println("sslsh=" + lsh);
if ("".equals(lsh)) {
throw new Exception("流水码为空!");
}
lsh = lsh.substring(6);
int ls = Integer.parseInt(lsh) + 1;// 新的流水码数
lshstr = ls + "";
System.out.println("lshstr=" + lshstr);
if (col != null) {
DecimalFormat df = new DecimalFormat(col);
lshstr = df.format(ls);
}
}
String upin = "update PLM_LSH set LSH= ? where PLMTYPE= ? and PREFIX= ? ";
dbModify2(upin, new Object[] { lshstr, type, prefix });
closeDataBase();
String newId = prefix + lshstr;
return newId;
}
/**
*
* @param v3
* @param v16
* @param time
* @param user
* @throws Exception
*/
public void setSqlConn(String v3, String v16, String time, String user)
throws Exception {
openDataBase();
// WF_MJID varchar2(200),--编码
// WF_YXJ varchar2(200),--已下机数
// WF_DATE varchar2(200),--上传日期
// WF_USER varchar2(200),--上传人员
String query = "select WF_MJID from WF_MJ_XJ_T where WF_MJID = ? ";
// 查询该id在数据库中的内容
ResultSet rs = dbQuery2(query, new Object[] {v3});
String wfmjid = "";
if (rs.next()) {
System.out.println("更新");
wfmjid = rs.getString(1);
System.out.println("wfmjid=" + wfmjid);
String upup = "UPDATE WF_MJ_XJ_T set WF_YXJ = ? ,WF_DATE= ?, WF_USER = ? WHERE WF_MJID = ? ";
dbModify2(upup, new Object[] {v16, time, user ,v3});
} else {
System.out.println("插入");
System.out.println("wfmjid=" + v3);
String upin = "insert into WF_MJ_XJ_T(WF_MJID,WF_YXJ,WF_DATE,WF_USER) values ( ?,? , ? , ? )";
dbModify2(upin, new Object[] {v3, v16, time, user});
}
closeDataBase();
return ;
}
/**
* ERP
*
* @param value
*
* @param sql
*
* @return
* @throws Exception
*/
public String getRecord(String sql)
throws Exception {
String result=null;
openDataBase();
// 查询该id在数据库中的内容
ResultSet rs = dbQuery(sql);
while (rs.next()) {
// ERPStockandPrice bean = new ERPStockandPrice();
// bean.setID(rs.getInt(1));
// bean.setfun(rs.getString(2));
// bean.setitem_id(rs.getString(3));
// bean.setzhangtao(rs.getString(4));
// bean.setUser_id(rs.getString(5));
// list.add(bean);
result = rs.getString(1);
}
closeDataBase();
return result;
}
// public List<ChangeOwnerbean> getRecord2(String value,String zhangT,String cangK,String sql)
// throws Exception {
// List<ChangeOwnerbean> list=new ArrayList<>();
// openDataBase();
// // 查询该id在数据库中的内容
// ResultSet rs = dbQuery2(sql, new Object[] {value,zhangT,cangK});
// while (rs.next()) {
// ChangeOwnerbean bean = new ChangeOwnerbean();
// bean.setId(rs.getString(1));
// bean.setCustomerName(rs.getString(2));
// bean.setSpec(rs.getString(3));
// bean.setZhangt(rs.getString(4));
// bean.setCangk(rs.getString(5));
// bean.setNum(rs.getString(6));
// bean.setUnit(rs.getString(7));
// list.add(bean);
// }
// closeDataBase();
// return list;
// }
public String getNum(Object[] values)
throws Exception {
openDataBase();
// 查询该id在数据库中的内容
String sql = "select NUM from DFL_OLD_ITEM where ITEM_ID= ? and ZHANGTAO= ? and WAREHOUSE= ?";
String num = "";
ResultSet rs = dbQuery2(sql, values);
if (rs.next()) {
num = rs.getString(1);
}
closeDataBase();
return num;
}
public double getNums(String sql)
throws Exception {
openDataBase();
// 查询该id在数据库中的内容
double nums = 0;
ResultSet rs = dbQuery(sql);
if (rs.next()) {
nums = rs.getInt(1);
}
closeDataBase();
return nums;
}
/**
*
*
* @param args
*/
public static void main(String args[]) {
try {
String str_DataBaseDriver = "oracle.jdbc.driver.OracleDriver";
String str_URL = "jdbc:oracle:thin:@localhost:1521:tc12";
String str_UserName = "infodba";
String str_Password = "infodba";
DataBaseControl2 dbc = new DataBaseControl2(str_DataBaseDriver,
str_URL, str_UserName, str_Password);
// dbc.openDataBase();
System.out.println("连接成功");
// dbc.stmt = dbc.conn.createStatement();
// String sql = "select * from PLM_LSH";
// Vector rs_result = dbc.orgQuery(sql);
// for (int i = 0; i < rs_result.size(); i++) {
// HashMap<String, String> map = (HashMap<String, String>)
// rs_result.get(i);
//
// for (Map.Entry<String, String> entry: map.entrySet()) {
// System.out.println(entry.getKey()+"---"+entry.getValue());
// }
// }
String newid = dbc.getNewCode("PLMITEMID", "pz", "0000");
System.out.println(newid);
// dbc.closeDataBase();
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -1,24 +0,0 @@
package com.connor.dfl.plm.dfl044;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.common.actions.AbstractAIFAction;
public class Dfl044Action extends AbstractAIFAction {
private AbstractAIFUIApplication app;
public Dfl044Action(AbstractAIFUIApplication app, String string) {
super(app,string);
this.app=app;
}
@Override
public void run() {
try {
new Dfl044Command(app).executeModal();
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -1,20 +0,0 @@
package com.connor.dfl.plm.dfl044;
import com.teamcenter.rac.aif.AbstractAIFCommand;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.kernel.TCSession;
public class Dfl044Command extends AbstractAIFCommand {
private TCSession session;
public Dfl044Command(AbstractAIFUIApplication app) {
this.session=(TCSession)app.getSession();
}
@Override
public void executeModal() throws Exception {
new Thread(new Dfl044Dialog(session)).start();
}
}

@ -1,296 +0,0 @@
package com.connor.dfl.plm.dfl044;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.lang.reflect.InvocationTargetException;
import java.time.Year;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.MissingResourceException;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableRowSorter;
import org.jacorb.idl.runtime.int_token;
import com.connor.dfl.plm.dfl042.ERPTransferStatusbean;
import com.connor.dfl.plm.util.DataBaseControl;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import com.teamcenter.rac.aif.commands.open.OpenCommand;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentGroup;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.ButtonLayout;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PropertyLayout;
import com.teamcenter.rac.util.Registry;
import com.teamcenter.soaictstubs.stringSeq_tHolder;
import sun.awt.www.content.audio.x_aiff;
public class Dfl044Dialog extends AbstractAIFDialog {
private static final long serialVersionUID = 6130114042631785757L;
private static final int width=800;
DefaultTableModel model;
private TCSession session;
private JButton qryBtn2;
private JTextField idField;
private JTextField useridField;
private JComboBox<String> zt_combobox; //账套选择下拉框
private JLabel StockwriteLabel=new JLabel("");//库存显示文本框
private JLabel PricewriteLabel=new JLabel("");//价格显示文本框
private HashMap<String, String> account_set = new HashMap();
private StringBuilder sb = new StringBuilder("select sum(img10) from ");
private StringBuilder numsSb = new StringBuilder("select ccc23a from ");
private String sql2 = "";
private String zhangtao = ""; //SQL语句中的账套
private String zhangtao1 = ""; //SQL语句中的账套
private String cangku = "";//SQL语句中的仓库号
private String cangku1 = "";
private String group = "";
private JComboBox<String> zhangTBox;
private DataBaseControl2 data;
public Dfl044Dialog(TCSession session) {
super(false);
this.session=session;
//this.service = session.getPreferenceService();
this.data = new DataBaseControl2(session,"DFL2_ERP_SQL_Connect");
String[] BOMZT = session.getPreferenceService().getStringValues("DFL2_ZHANGTAO_WAREHOUSE");
if (BOMZT == null || BOMZT.length <= 0 ) {
MessageBox.post("首选项DFL2_ZHANGTAO_WAREHOUSE未配置,请联系管理员!!",
"错误", MessageBox.ERROR);
return;
}
TCComponentGroup group = session.getCurrentGroup();
try {
String group_name = group.getStringProperty("display_name");
System.out.println("11.04group_name=============="+group_name);
if(group_name.contains(".")) {
String[] names = group_name.split("\\.");
if(names != null && names.length >=2) {
for (int i = 0; i < BOMZT.length; i++) {
if(BOMZT[i].contains(";")) {
String[] zts = BOMZT[i].split(";");
if(names[names.length-2].equals(zts[0])) {
this.zhangtao = zts[1];
System.out.println("11.04账套======"+zhangtao);
this.cangku = zts[2];
System.out.println("11.04仓库======"+cangku);
break;
}
}
}
}
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void run() {
//显示窗口
initUI();
}
@SuppressWarnings("serial")
private void initUI() {
this.setTitle("仓库库存和价格查询");
this.setLayout(new FlowLayout(FlowLayout.CENTER,2,3));
this.setPreferredSize(new Dimension(width, 150));
this.setLocation(2, 5);
model = new DefaultTableModel() {
private static final long serialVersionUID = 6905817304437097181L;
public boolean isCellEditable(int row, int column) {
return true;
}
};
JPanel qryPanel=new JPanel(new PropertyLayout());
JLabel idLabel=new JLabel("请在右边框中输入零件号");
JLabel ztLabel=new JLabel("选择账套");
zhangTBox = new JComboBox<String>();
JLabel useridLabel=new JLabel(" 零件号:");
JLabel StockLabel=new JLabel("库存量:");
JLabel PriceLabel=new JLabel(" 单 价:");
useridField = new JTextField(10);
//new下拉框对象
zt_combobox = new JComboBox();
zt_combobox.addItem(" ");
String[] BOMZT = session.getPreferenceService().getStringValues("DFL2_ZHANGTAO_WAREHOUSE");
for(int i = 0 ;i<BOMZT.length;i++) {
String s2 = BOMZT[i].split(";")[2];
String s1 = BOMZT[i].split(";")[1];
String s0 = BOMZT[i].split(";")[0];
account_set.put(s1, s0);
zt_combobox.addItem(s0+":"+s1);
}
//获取下拉框的值
qryBtn2=new JButton("查询");
qryPanel.add("1.1.center.top",idLabel);//添加零件id文本
qryPanel.add("1.2.center.top",useridLabel);//添加品名文本
qryPanel.add("1.3.center.top",useridField);//添加品名写入框
qryPanel.add("1.4.center.top",ztLabel);//查询按钮
qryPanel.add("1.5.center.top",zt_combobox);//查询按钮
qryPanel.add("1.6.center.top",qryBtn2);//查询按钮
qryPanel.add("2.1.center.top",StockLabel);//添加库存文本框
qryPanel.add("2.2.center.top",StockwriteLabel);//添加库存写入框
qryPanel.add("2.3.center.top",PriceLabel);//添加价格文本框
qryPanel.add("2.4.center.top",PricewriteLabel);//添加品名写入框
JPanel southPanel = new JPanel(new FlowLayout());
JButton celBtn = new JButton("取消");
celBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
disposeDialog();
}
});
southPanel.add(celBtn);
JPanel rootPanel=new JPanel(new ButtonLayout());
qryBtn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
//下拉值对比
getdropdown();
StockwriteLabel.setText(StockResult());
PricewriteLabel.setText(PriceResult(useridField.getText()));
}
});
this.add(qryPanel);
this.add(rootPanel);
this.setResizable(false);
this.setAlwaysOnTop(false);
this.showDialog();
}
//返回库存数量
public String StockResult() {
String Stock = null;
String Select = null; //选择下拉的值
String userid = useridField.getText();//获取零件号
Select = (String) zt_combobox.getSelectedItem();//获取账套文本框的值
System.out.println("11.05选择的下拉值库存======="+Select);
//sql语句拼接账套
if("".equals(Select) || " ".equals(Select) || "null".equals(Select)) {
sb.append(zhangtao+".img_file where img01='");
//如果零件号不为空,则拼接
if(!("".equals(userid.trim()))) {
sb.append(userid+"' and img02='"+cangku+"' and img02<>'Z1'");
}
}else {
sb.append(zhangtao1+".img_file where img01='");
//如果零件号不为空,则拼接
if(!("".equals(userid.trim()))) {
sb.append(userid+"' and img02='"+cangku1+"' and img02<>'Z1'");
}
}
sql2 = sb.toString();
System.out.println("sql===================="+sql2);
Stock = getRecords(sql2);
System.out.println("11.04Stock==================="+Stock);
return Stock;
}
//返回单价
public String PriceResult(String userid) {
String Price = null;
String Select = null; //选择下拉的值
//如果零件号不为空,则拼接
Select = (String) zt_combobox.getSelectedItem();
System.out.println("11.05选择的下拉值单价======="+Select);
if(!("".equals(userid.trim()))) {
if("".equals(Select) || " ".equals(Select) || "null".equals(Select)) {
numsSb.append(zhangtao + ".ccc_file inner join "+zhangtao+".ccz_file on ccz01=ccc02 and ccz02=ccc03 where ccc01='"+userid+"'");
}else {
numsSb.append(zhangtao1 + ".ccc_file inner join "+zhangtao1+".ccz_file on ccz01=ccc02 and ccz02=ccc03 where ccc01='"+userid+"'");
}
}
String numsSql = numsSb.toString();
System.out.println("numsSql===================="+numsSql);
Price = getRecords(numsSql);
System.out.println("11.04Price==================="+Price);
return Price;
}
/**
*
* @return tabledataVector
*/
private String getRecords(String sql){
String result =null;
try {
result = data.getRecord(sql);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("11.04获得的结果======"+result);
if(result == null ) {
MessageBox.post("数据库中未查找到相应的数据!! 该零件没有库存或单价!!",
"错误", MessageBox.ERROR);
}
return result;
}
private void getdropdown () {
String[] BOMZT = session.getPreferenceService().getStringValues("DFL2_ZHANGTAO_WAREHOUSE");
String combobox = (String) zt_combobox.getSelectedItem();
boolean flag = true;
for (int i = 0; i < BOMZT.length; i++) {
String s2 = BOMZT[i].split(";")[2];
String s1 = BOMZT[i].split(";")[1];
String s0 = BOMZT[i].split(";")[0];
cangku1 = s2;
System.out.println("11.05-cangku1====="+cangku1);
zhangtao1 = s1;
System.out.println("11.05-zhangtao1====="+zhangtao1);
group = s0;
System.out.println("11.05-group====="+group);
//判断选中的是否和首选项中的一致,是就跳出循环,不再赋值
if(combobox.equals(s0+":"+s1)) {
flag = false;
break;
}
}
}
}

@ -1,19 +0,0 @@
package com.connor.dfl.plm.dfl044;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
public class Dfl044Handler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
new Thread(new Dfl044Action(app,"")).start();
return null;
}
}

@ -1,46 +0,0 @@
package com.connor.dfl.plm.dfl044;
import javax.swing.JTextField;
public class ERPStockandPrice {
private Integer ID; //ID
private String fun; //Àà±ð
private String item_id;//Æ·ºÅ
private String zhangtao;//ÕËÌ×
private String User_id;//Óû§id
public Integer getID() {
return ID;
}
public void setID(Integer ID) {
this.ID = ID;
}
public String getfun() {
return fun;
}
public void setfun(String fun) {
this.fun = fun;
}
public String getitem_id() {
return item_id;
}
public void setitem_id(String item_id) {
this.item_id = item_id;
}
public String getzhangtao() {
return zhangtao;
}
public void setzhangtao(String zhangtao) {
this.zhangtao = zhangtao;
}
public String getUser_id() {
return User_id;
}
public void setUser_id(String User_id) {
this.User_id = User_id;
}
}

@ -1,24 +0,0 @@
package com.connor.dfl.plm.dfl045;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.common.actions.AbstractAIFAction;
public class Dfl045Action extends AbstractAIFAction {
private AbstractAIFUIApplication app;
public Dfl045Action(AbstractAIFUIApplication app, String string) {
super(app,string);
this.app=app;
}
@Override
public void run() {
try {
new Dfl045Command(app).executeModal();
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -1,20 +0,0 @@
package com.connor.dfl.plm.dfl045;
import com.teamcenter.rac.aif.AbstractAIFCommand;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.kernel.TCSession;
public class Dfl045Command extends AbstractAIFCommand {
private TCSession session;
public Dfl045Command(AbstractAIFUIApplication app) {
this.session=(TCSession)app.getSession();
}
@Override
public void executeModal() throws Exception {
new Thread(new Dfl045Dialog(session)).start();
}
}

@ -1,229 +0,0 @@
package com.connor.dfl.plm.dfl045;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.time.Year;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.MissingResourceException;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.filechooser.FileSystemView;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableRowSorter;
import org.jacorb.idl.runtime.int_token;
import com.connor.dfl.plm.dfl025.Dfl025Operation;
import com.connor.dfl.plm.dfl028.Dfl028AIFDialog;
import com.connor.dfl.plm.dfl040.DateChooser;
import com.connor.dfl.plm.dfl042.ERPTransferStatusbean;
import com.connor.dfl.plm.util.DataBaseControl;
import com.teamcenter.rac.aif.AbstractAIFDialog;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.commands.open.OpenCommand;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentGroup;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.ButtonLayout;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.PropertyLayout;
import com.teamcenter.rac.util.Registry;
import com.teamcenter.soaictstubs.stringSeq_tHolder;
import sun.awt.www.content.audio.x_aiff;
public class Dfl045Dialog extends AbstractAIFDialog {
private static final long serialVersionUID = 6130114042631785757L;
private static final int width=800;
DefaultTableModel model;
private AbstractAIFUIApplication app;
private TCSession session;
private JFileChooser jFileChooser;
private JButton bowBtn = new JButton("浏览");
private JButton qryBtn = new JButton("导出");
private JButton celBtn = new JButton("取消");
private JLabel StarttimeLabel = new JLabel("流程统计开始时间:");//文本
private JLabel endtimeLabel=new JLabel("流程统计结束时间:"); //文本
private JLabel exportLabel=new JLabel("导出目录:"); //文本
private JTextField starttimeField; //开始时间框
private JTextField endtimeField; //结束时间框
private JTextField jtf = new JTextField(15); //浏览文件路径
private HashMap<String, String> account_set = new HashMap();
private String starttime = ""; //SQL语句中的账套
private String endtime = "";//SQL语句中的仓库号
//private DataBaseControl2 data;
public Dfl045Dialog(TCSession session) {
super(false);
this.app = app;
this.session=session;
//this.service = session.getPreferenceService();
//this.data = new DataBaseControl2(session,"DFL2_ERP_SQL_Connect");
String[] BOMZT = session.getPreferenceService().getStringValues("DFL2_ZHANGTAO_WAREHOUSE");
}
@Override
public void run() {
//显示窗口
initUI();
}
@SuppressWarnings("serial")
private void initUI() {
//设置整体界面
this.setTitle("导出流程报表");
this.setLayout(new FlowLayout(FlowLayout.CENTER,2,3));
this.setPreferredSize(new Dimension(width, 150));
this.setLocation(2, 5);
model = new DefaultTableModel() {
private static final long serialVersionUID = 6905817304437097181L;
public boolean isCellEditable(int row, int column) {
return true;
}
};
//定义容器
JPanel qryPanel=new JPanel(new PropertyLayout());
//设置控件
FileSystemView fsv = FileSystemView.getFileSystemView();
String deskPath = fsv.getHomeDirectory().getPath();
this.jtf.setText(deskPath);
// 初始化日期控件
Date date = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String time = df.format(date);
//设置时间选择框
starttimeField = new JTextField(15);
starttimeField.setText(time);
endtimeField = new JTextField(15);
endtimeField.setText(time);
//初始化赋值
jFileChooser = new JFileChooser();
this.jFileChooser.setCurrentDirectory(new File(deskPath));// 文件选择器的初始目录定为当前用户桌面
this.jFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
// 注册日期面板
DateChooser dateChooser1 = DateChooser.getInstance("yyyy-M-d");
DateChooser dateChooser2 = DateChooser.getInstance("yyyy-M-d");
dateChooser1.register(starttimeField);
dateChooser2.register(endtimeField);
qryPanel.add("1.1.center.top",StarttimeLabel);//添加开始时间文本框
qryPanel.add("1.2.center.top",starttimeField);//添加开始时间框
qryPanel.add("2.1.center.top",endtimeLabel);//添加结束时间文本框
qryPanel.add("2.2.center.top",endtimeField);//添加结束时间框
qryPanel.add("3.1.center.top",exportLabel);//导出目录文本框
qryPanel.add("3.2.center.top",jtf);//导出目录选择框
qryPanel.add("3.3.center.top",bowBtn);//浏览按钮
qryPanel.add("3.4.center.top",qryBtn);//导出按钮
qryPanel.add("3.5.center.top",celBtn);//取消按钮
//JPanel southPanel = new JPanel(new FlowLayout());
//浏览按钮监听事件
bowBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
selectFileButtonEvent();
}
});
//导出按钮监听事件
qryBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
//下拉值对比
okEvent();
}
});
//取消按钮监听事件
celBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
disposeDialog();
}
});
//southPanel.add(celBtn);
JPanel rootPanel=new JPanel(new ButtonLayout());
this.add(qryPanel);
this.add(rootPanel);
this.setResizable(false);
this.setAlwaysOnTop(false);
this.showDialog();
}
public void okEvent() {
try {
String path = jtf.getText();
if("".equals(path) || " ".equals(path)) {
MessageBox.post("请选择要导出的路径!!",
"提示", MessageBox.INFORMATION);
return;
}
System.out.println("ok");
starttime = starttimeField.getText()+" 00:00";
endtime = endtimeField.getText()+" 00:00";
Dfl045Operation operation = new Dfl045Operation(session,starttime,endtime,path);
session.queueOperation(operation);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.disposeDialog();
this.dispose();
}
//获取文件选择路径
public void selectFileButtonEvent() {
int state = jFileChooser.showOpenDialog(null);// 此句是打开文件选择器界面的触发语句
if (state == 1) {
return;
} else {
File f = jFileChooser.getSelectedFile();// f为选择到的目录
jtf.setText(f.getAbsolutePath());
}
}
/**
*
* @return tabledataVector
*/
}

@ -1,19 +0,0 @@
package com.connor.dfl.plm.dfl045;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
public class Dfl045Handler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
new Thread(new Dfl045Action(app,"")).start();
return null;
}
}

File diff suppressed because it is too large Load Diff

@ -1,77 +0,0 @@
package com.connor.dfl.plm.dfl046;
public class AutoCreateBean {
private String item_id;//品号
private String name;//名称
private String spec;//规格
private String unit;//单位
private String design_num;//设计用量
private String brand;//品牌
private String weihao;//编号
private String importance;//重要度
private String num;//序号
private int level;//等级
public String getItem_id() {
return item_id;
}
public void setItem_id(String item_id) {
this.item_id = item_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getDesign_num() {
return design_num;
}
public void setDesign_num(String design_num) {
this.design_num = design_num;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public String getWeihao() {
return weihao;
}
public void setWeihao(String weihao) {
this.weihao = weihao;
}
public String getImportance() {
return importance;
}
public void setImportance(String importance) {
this.importance = importance;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
}

@ -1,52 +0,0 @@
package com.connor.dfl.plm.dfl046;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.pse.common.BOMLineNode;
import com.teamcenter.rac.pse.common.BOMTreeTableModel;
import com.teamcenter.rac.pse.operations.ExpandBelowOperation;
import com.teamcenter.rac.psebase.AbstractBOMLineViewerApplication;
import com.teamcenter.rac.psebase.common.AbstractViewableTreeTable;
import com.teamcenter.rac.util.AdapterUtil;
import com.teamcenter.rac.util.MessageBox;
/**
* Our sample handler extends AbstractHandler, an IHandler base class.
* @see org.eclipse.core.commands.IHandler
* @see org.eclipse.core.commands.AbstractHandler
*/
public class BOMExportHandler extends AbstractHandler {
/**
* The constructor.
*/
public BOMExportHandler() {
}
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
AbstractAIFApplication app=AIFUtility.getCurrentApplication();
//DL2_VehicleRevision DL2_EBOM
if(app.getTargetComponent() instanceof TCComponentBOMLine){
TCSession session=(TCSession) app.getSession();
test operation=new test(app, session);
session.queueOperation(operation);
}else{
MessageBox.post("ÇëÑ¡ÔñBOMLine","",2);
}
return null;
}
}

@ -1,56 +0,0 @@
package com.connor.dfl.plm.dfl046;
import java.util.List;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentBOMViewRevision;
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
import com.teamcenter.rac.kernel.TCComponentContextList;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCComponentQuery;
import com.teamcenter.rac.kernel.TCComponentQueryType;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCQueryClause;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TCTextService;
import com.teamcenter.rac.kernel.TCTypeService;
import com.teamcenter.rac.kernel.TCUserService;
import com.teamcenter.rac.util.MessageBox;
public class ChangeDbomUtil {
public static TCPreferenceService service;
public static TCSession session;
public static TCUserService userservice;;
static {
if (session == null) {
session = (TCSession) (AIFUtility.getCurrentApplication()
.getSession());
}
if (service == null)
service = session.getPreferenceService();
}
public static void setByPass(boolean val) throws TCException {
if (userservice == null) {
userservice = session.getUserService();
}
Object[] obj = new Object[1];
obj[0] = "origin";
if (val) {
// userservice.call("ORIGIN_set_bypass", obj);
userservice.call("Connor_set_bypass", obj);
} else {
// userservice.call("ORIGIN_close_bypass", obj);
userservice.call("Connor_close_bypass", obj);
}
}
}

File diff suppressed because it is too large Load Diff

@ -24,7 +24,6 @@ import org.jacorb.idl.runtime.int_token;
import com.connor.dfl.plm.dfl019.ClassPropBean;
import com.connor.dfl.plm.dfl019.ItemBean;
import com.connor.dfl.plm.dfl019.ParseXMLUtil;
import com.connor.dfl.plm.dfl044.DataBaseControl2;
import com.connor.dfl.plm.util.ClassValueBean;
import com.connor.dfl.plm.util.ClassValueUtil;
import com.connor.dfl.plm.util.ProgressBarThread;
@ -45,7 +44,7 @@ import com.teamcenter.rac.treetable.TreeTableNode;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.soaictstubs.stringSeq_tHolder;
public class test extends AbstractAIFOperation {
public class BOMExportOperation extends AbstractAIFOperation {
private AbstractAIFApplication app;
private TCSession session;
private ProgressBarThread wait;
@ -56,11 +55,10 @@ public class test extends AbstractAIFOperation {
private String xuninum = "1";
private String xuanzhongid = null;
private DataBaseControl2 data;
private String item_id1 = "";//品号 item_id
private String rev_id1 = ""; //版本 item_revision_id
private String name1 = "";//名称 object_name
private String oldid1 = "";//旧品号
private String spec1 = "";//规格
private String unit1 = "";//单位 t2_unit
private String design_num1;//设计用量 bl_quantity
@ -69,45 +67,11 @@ public class test extends AbstractAIFOperation {
private String source1 = "";//来源码
private String weihao1 = "";//编号 T2_weihao
private String importance1 = "";//重要度 t2_BOMImportance
private String price1 = "";//单价
private String total1 = "";//总价
private int xuhao1 ;
private String zhangtao = "";
public test(AbstractAIFApplication app, TCSession session) {
private String lev1 = "";
public BOMExportOperation(AbstractAIFApplication app, TCSession session) {
this.app = app;
this.session = session;
this.data = new DataBaseControl2(session,"DFL2_ERP_SQL_Connect");
String[] BOMZT = session.getPreferenceService().getStringValues("DFL2_ZHANGTAO_WAREHOUSE");
if (BOMZT == null || BOMZT.length <= 0 ) {
MessageBox.post("首选项DFL2_ZHANGTAO_WAREHOUSE未配置,请联系管理员!!",
"错误", MessageBox.ERROR);
return;
}
TCComponentGroup group = session.getCurrentGroup();
try {
String group_name = group.getStringProperty("display_name");
System.out.println("11.04group_name=============="+group_name);
if(group_name.contains(".")) {
String[] names = group_name.split("\\.");
if(names != null && names.length >=2) {
for (int i = 0; i < BOMZT.length; i++) {
if(BOMZT[i].contains(";")) {
String[] zts = BOMZT[i].split(";");
if(names[names.length-2].equals(zts[0])) {
this.zhangtao = zts[1];
System.out.println("11.04账套======"+zhangtao);
break;
}
}
}
}
}
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void executeOperation() throws Exception {
@ -123,10 +87,10 @@ public class test extends AbstractAIFOperation {
}
try {
System.out.println("开始获取BOM模板");
String puid = session.getPreferenceService().getStringValue("DFL3_BOM_UID");
String puid = session.getPreferenceService().getStringValue("DFL_BOM_UID");
System.out.println("puid======================"+puid);
if (puid == null||"".equals(puid)) {
MessageBox.post("首选项DFL3_BOM_UID未配置,请联系管理员!!",
MessageBox.post("首选项DFL_BOM_UID未配置,请联系管理员!!",
"错误", MessageBox.ERROR);
return;
}
@ -180,11 +144,6 @@ public class test extends AbstractAIFOperation {
//对照表的获取方法
private void getAndSetValue1(TCComponentBOMLine bomLine,int level,int num) {
//定义一个集合,将外购、外协存在一个集合内
List<TCComponentBOMLine> wai = new ArrayList<TCComponentBOMLine>();
//定义一个集合,将虚拟存在一个集合内
List<TCComponentBOMLine> xu = new ArrayList<TCComponentBOMLine>();
// TODO Auto-generated method stub
try {
//通过解包方法来解包
@ -227,142 +186,126 @@ public class test extends AbstractAIFOperation {
{
//如果版本类型是外购件版本或者外协件版本则获取属性
if("T2_outsourceRevision".equals(type) || "T2_OutBuyPartRevision".equals(type)) {
//序号+1
num++;
//将遍历的对象强转类型为bomline
TCComponentBOMLine ziLine = (TCComponentBOMLine) comp;
wai.add(ziLine);
getItemValue1(ziLine,level,num);
List<String> beanList1 = new ArrayList<String>();
double a = Double.valueOf(xuninum).doubleValue();
System.out.println("a--915======"+a);
double b = Double.valueOf(design_num1).doubleValue();
System.out.println("b--915======"+b);
// double c = Double.valueOf(firstnum).doubleValue();
// System.out.println("c--915======"+c);
double d = a*b;
design_num1 = ""+d;
System.out.println("design_num9.15======"+design_num1);
String xuhao2 = xuhao1+"";
//添加属性到字符串集合中
beanList1.add(xuhao2);
beanList1.add(item_id1);
beanList1.add(rev_id1);
beanList1.add(name1);
//beanList1.add(lev1); //不要层级
beanList1.add(spec1);
beanList1.add(unit1);
beanList1.add(design_num1);
beanList1.add(brand1);
beanList1.add(group1);
beanList1.add(source1);
beanList1.add(weihao1);
beanList1.add(importance1);
System.out.println("beanList19.15====="+beanList1);
//先做布尔逻辑判断
boolean include=idlist.contains(item_id1);//true
//System.out.println("测试是否包含9.18====="+include);
boolean panduan = true;
//再将id存放在idlist
idlist.add(item_id1);
//System.out.println("idlist9.18====="+idlist);
//添加字符串集合到集合中
if (include == panduan) {
//遍历集合list
for (int j = 0; j < list.size(); j++) {
int m = list.size();
//System.out.println("9.18list的长度"+m);
List<String> beanList2 = new ArrayList<String>();
beanList2 = list.get(j);
//System.out.println("9.18beanList2====="+beanList2);
boolean include1=beanList2.contains(item_id1);//true
//如果为真,则修改数量
if(include1 == panduan) {
String numString = null;
for(int k = 0 ; k<=beanList2.size() ; k++) {
numString = beanList2.get(6);
System.out.println("数量9.18====="+numString);
}
double before = Double.valueOf(numString).doubleValue();
double add = Double.valueOf(design_num1).doubleValue();
double sum = before+add;
//String sum = ""+before+add;
System.out.println("9.18sum====="+sum);
beanList2.set(6, ""+sum);
list.set(j, beanList2);
}
}
}else if(include!=panduan){
list.add(beanList1);
System.out.println("list9.15====="+list);
}
}
//如果不是外购外协件
else {
//如果不是外购外协件则递归此方法
else {
TCComponentBOMLine ziLine = (TCComponentBOMLine) comp;
xu.add(ziLine);
String xuniid = ziLine.getStringProperty("awb0BomLineItemId");
//判断如果没有该虚拟件下没有物料,则跳出此循环
AIFComponentContext[] childs23 = ziLine.getChildren();
int geshu = childs23.length;
System.out.println("个数为9.22====="+geshu+"====="+xuniid);
if (childs23.length <= 0 ) {
System.out.println("9.22执行跳出操作");
continue;
}
}
}
}
//处理外购外协的数据
if(wai.size()>0) {
for (int i = 0;i<wai.size();i++) {
num++;
TCComponentBOMLine waiLine = wai.get(i);
getItemValue1(waiLine,level,num);
List<String> beanList1 = new ArrayList<String>();
double a = Double.valueOf(xuninum).doubleValue();
System.out.println("a--915======"+a);
double b = Double.valueOf(design_num1).doubleValue();
System.out.println("b--915======"+b);
// double c = Double.valueOf(firstnum).doubleValue();
// System.out.println("c--915======"+c);
double d = a*b;
design_num1 = ""+d;
System.out.println("design_num9.15======"+design_num1);
String xuhao2 = xuhao1+"";
//添加属性到字符串集合中
beanList1.add(xuhao2);
beanList1.add(item_id1);
beanList1.add(rev_id1);
beanList1.add(name1);
beanList1.add(oldid1);
//beanList1.add(lev1); //不要层级
beanList1.add(spec1);
beanList1.add(unit1);
beanList1.add(design_num1);
beanList1.add(brand1);
beanList1.add(group1);
beanList1.add(source1);
beanList1.add(weihao1);
beanList1.add(importance1);
// beanList1.add(price1);
// beanList1.add(total1);
System.out.println("beanList19.15====="+beanList1);
//先做布尔逻辑判断
boolean include=idlist.contains(item_id1);//true
//System.out.println("测试是否包含9.18====="+include);
boolean panduan = true;
//再将id存放在idlist
idlist.add(item_id1);
//System.out.println("idlist9.18====="+idlist);
//添加字符串集合到集合中
if (include == panduan) {
//遍历集合list
//System.out.println("9.22虚拟件id === ==="+xuniid);
design_num1 = "1";
//先将虚拟件(xuninum)的值设为获取到的值
xuninum = design_num1;
System.out.println("8.12虚拟件数量"+xuninum+"===9.22虚拟件id==="+xuniid);
//设置虚拟件数量为double类型a
double a = Double.valueOf(xuninum).doubleValue();
System.out.println("8.12虚拟件的double数量a"+a+"===9.22虚拟件id==="+xuniid);
getItemValue1(ziLine,level,xuhao1);
//设置获取的数量为double类型b
System.out.println("9.22运行方法后获得design_num1的值====="+design_num1);
double b = Double.valueOf(design_num1).doubleValue();
System.out.println("8.12虚拟件的double数量b"+b+"===9.22虚拟件id==="+xuniid);
for (int j = 0; j < list.size(); j++) {
int m = list.size();
//System.out.println("9.18list的长度"+m);
List<String> beanList2 = new ArrayList<String>();
beanList2 = list.get(j);
//System.out.println("9.18beanList2====="+beanList2);
boolean include1=beanList2.contains(item_id1);//true
//如果为真,则修改数量
if(include1 == panduan) {
String numString = null;
for(int k = 0 ; k<=beanList2.size() ; k++) {
numString = beanList2.get(7);
System.out.println("数量9.18====="+numString);
}
double before = Double.valueOf(numString).doubleValue();
double add = Double.valueOf(design_num1).doubleValue();
double sum = before+add;
//String sum = ""+before+add;
System.out.println("9.18sum====="+sum);
beanList2.set(7, ""+sum);
list.set(j, beanList2);
//double c = a*b;
double c = Double.valueOf(firstnum).doubleValue();
System.out.println("c--915======"+c);
//得到相乘的数量
double d = a*b*c;
System.out.println("8.12虚拟件的double数量c"+d+"===9.22虚拟件id==="+xuniid);
design_num1 = ""+d;
//而后获得一个乘积的值赋予给xuninum
xuninum = design_num1;
System.out.println("8.12第一个虚拟件"+xuninum+"===9.22虚拟件id==="+xuniid);
//递归
getAndSetValue1(ziLine,level,xuhao1);
}
}
}else if(include!=panduan){
list.add(beanList1);
System.out.println("list9.15====="+list);
}
}
}
//处理虚拟件的数据
if(xu.size()>0) {
for (int i = 0;i<xu.size();i++) {
TCComponentBOMLine xuLine = xu.get(i);
String xuniid = xuLine.getStringProperty("awb0BomLineItemId");
//判断如果没有该虚拟件下没有物料,则跳出此循环
AIFComponentContext[] childs23 = xuLine.getChildren();
int geshu = childs23.length;
System.out.println("个数为9.22====="+geshu+"====="+xuniid);
if (childs23.length <= 0 ) {
System.out.println("9.22执行跳出操作");
continue;
}
}
//System.out.println("9.22虚拟件id === ==="+xuniid);
design_num1 = "1";
//先将虚拟件(xuninum)的值设为获取到的值
xuninum = design_num1;
System.out.println("8.12虚拟件数量"+xuninum+"===9.22虚拟件id==="+xuniid);
//设置虚拟件数量为double类型a
double a = Double.valueOf(xuninum).doubleValue();
System.out.println("8.12虚拟件的double数量a"+a+"===9.22虚拟件id==="+xuniid);
getItemValue1(xuLine,level,xuhao1);
//设置获取的数量为double类型b
System.out.println("9.22运行方法后获得design_num1的值====="+design_num1);
double b = Double.valueOf(design_num1).doubleValue();
System.out.println("8.12虚拟件的double数量b"+b+"===9.22虚拟件id==="+xuniid);
//double c = a*b;
double c = Double.valueOf(firstnum).doubleValue();
System.out.println("c--915======"+c);
//得到相乘的数量
double d = a*b*c;
System.out.println("8.12虚拟件的double数量c"+d+"===9.22虚拟件id==="+xuniid);
design_num1 = ""+d;
//而后获得一个乘积的值赋予给xuninum
xuninum = design_num1;
System.out.println("8.12第一个虚拟件"+xuninum+"===9.22虚拟件id==="+xuniid);
//递归
getAndSetValue1(xuLine,level,xuhao1);
}
}
//level--;
}
@ -765,13 +708,10 @@ public class test extends AbstractAIFOperation {
item_id1 = rev.getStringProperty("item_id");
rev_id1 = rev.getStringProperty("item_revision_id");
name1 = rev.getStringProperty("object_name");
price1 = getPrice();
total1 = getTotal(design_num1,price1);
if("T2_outsourceRevision".equals(type)) {
xuhao1 = num ;
String classID = item_id1.substring(0, 2);
item_id1 = item_id1+rev_id1;
oldid1 = rev.getStringProperty("t2_OldId");
System.out.println("classID==============="+classID);
if("51".equals(classID) || "72".equals(classID) || "76".equals(classID)) {
@ -785,13 +725,10 @@ public class test extends AbstractAIFOperation {
spec1 = getOutsourceValue(rev);
}
unit1 = rev.getStringProperty("t2_unit");
brand1 = "";
}else if("T2_OutBuyPartRevision".equals(type)) {
xuhao1 = num;
ClassValueBean valueBean = ClassValueUtil.getOutBuyPartValue(rev,errList);
oldid1 = rev.getStringProperty("t2_OldID");
if(valueBean != null) {
spec1 = valueBean.getSpecs();
unit1 = valueBean.getUnit();
@ -863,39 +800,6 @@ public class test extends AbstractAIFOperation {
e.printStackTrace();
}
}
private String getPrice () {
String price = null;
String sql = null;
sql = "select ccc23a from " +zhangtao + ".ccc_file inner join "+zhangtao+".ccz_file on ccz01=ccc02 and ccz02=ccc03 where ccc01='"+item_id1+"'";
System.out.println("sql======"+sql);
try {
price = data.getRecord(sql);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("11.08==price=="+price);
if(price == null ) {
price ="";
}
return price;
}
private String getTotal(String quantity,String price) {
// TODO Auto-generated method stub
if("".equals(price)||" ".equals(price)||"null".equals(price)) {
price = "0";
}
String total;
double amount = Double.valueOf(quantity).doubleValue();
double tariff = Double.valueOf(price).doubleValue();
double product = amount * tariff ;
total = ""+product;
System.out.println("11.08==总价====="+total);
return total;
}
//匹配分群码
private void getgroup() {
if("F10".equals(group1)) {

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

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

@ -442,13 +442,10 @@ public class AddDialogQuickChange_TZ extends AbstractAIFDialog {
if(!("".equals(s.trim()))) {
sb.append(";");
}
if(sb.length()>0&&sb.charAt(sb.length()-1)!=';') {
sb.append(list.get(i));
if(i < list.size()-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,7 +1,5 @@
package com.connor.dfl.plm.forms;
import org.jacorb.idl.runtime.int_token;
/**
*
* @author ËïÒã
@ -16,7 +14,6 @@ public class ChangeDetils {
private String YSL;
private String XSL;
private String BGSL;
private String GGSM;
private String WZPSL;
private String WZPUJ;
private String ZZSL;
@ -33,7 +30,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 gGSM, String wZPSL,
public ChangeDetils(String objtctCode,String pH, String pM, String yBB, String xBB, String ySL, String xSL, String bGSL, String wZPSL,
String wZPUJ, String zZSL, String zZYJ, String sCSL, String sSYJ, String cKSL, String cLYJ) {
this.objectCode= objtctCode;
this.PH = pH;
@ -43,7 +40,6 @@ public class ChangeDetils {
this.YSL = ySL;
this.XSL = xSL;
this.BGSL = bGSL;
this.GGSM = gGSM;
this.WZPSL = wZPSL;
this.WZPUJ = wZPUJ;
this.ZZSL = zZSL;
@ -98,19 +94,11 @@ 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(lovValue);
valueBean.setSpec(value);
}
}
else if(attrName.contains("订货码")){

Loading…
Cancel
Save