@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="libs/aspose-words-17.4.0-jdk16.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-examples-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-excelant-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-ooxml-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-ooxml-schemas-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/poi-scratchpad-3.17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/easyexcel-4.0.3.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/hutool-all-5.8.25.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axiom-api-1.2.20.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axiom-impl-1.2.20.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axis2-adb-1.7.8.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axis2-kernel-1.7.8.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axis2-transport-base-1.7.8.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axis2-transport-http-1.7.8.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/axis2-transport-local-1.7.8.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/classes12.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/com.kostech.DesignChickList_1.0.0.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-beanutils-1.7.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-codec-1.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-collections-3.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-httpclient-3.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-io-2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-lang-2.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/commons-logging-1.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/dom4j-1.6.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/ezmorph-1.0.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/httpcore-4.4.6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/jdom.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/json-lib-2.2.2-jdk15.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/json-lib-2.2.3-jdk13.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/log4j-1.2.15.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/neethi-3.0.3.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/ojdbc6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/soap-2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/woden-core-1.0M10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/wsdl4j-1.6.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/xmlbeans-2.5.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="libs/xmlschema-core-2.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="ojdbc6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="jxl.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="sqljdbc4.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="Z:/TC_install/YSR/eclipse-workspace/cn.com.ebewin.ysr/libs/jfxrt.jar"/>
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -0,0 +1 @@
|
||||
/bin/
|
@ -0,0 +1,8 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/cn/com/ebewin/ysr/dialog/SysCatalogRevisionMasterBean.java" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/src/cn/com/ebewin/ysr/dialog/systemdatadistribution/SystemDataDistributionDialog.java" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/src/cn/com/ebewin/ysr/dialog/systemdatadistribution/SystemDataDistributionHandler.java" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/src/cn/com/ebewin/ysr/dialog/systemdatadistribution/SystemDataEntity.java" charset="GBK" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ASMSmaliIdeaPluginConfiguration">
|
||||
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="openjdk-22" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/classes" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>cn.com.ebewin.ysr</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1737218542352</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/cn/com/ebewin/ysr/dialog/AssignProjectDialog.java=GBK
|
||||
encoding/<project>=GBK
|
@ -0,0 +1,26 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
|
||||
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
|
||||
org.eclipse.jdt.core.builder.invalidClasspath=abort
|
||||
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
|
||||
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
|
||||
org.eclipse.jdt.core.circularClasspath=error
|
||||
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
|
||||
org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error
|
||||
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
|
||||
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
|
||||
org.eclipse.jdt.core.incompleteClasspath=error
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning
|
||||
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,133 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: cn.com.ebewin.ysr
|
||||
Bundle-SymbolicName: cn.com.ebewin.ysr;singleton:=true
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Vendor: ebewin
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7,
|
||||
JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.ui;bundle-version="3.8.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||
com.teamcenter.rac.aifrcp;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.common;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.kernel;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.tcapps;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.util;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.external;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.ui;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.workflow;bundle-version="11000.2.0",
|
||||
org.apache.poi.39;bundle-version="3.9.0",
|
||||
com.teamcenter.rac.schedule;bundle-version="11000.2.0",
|
||||
TcSoaCoreRac;bundle-version="11000.2.0",
|
||||
TcSoaCoreTypes;bundle-version="11000.2.0",
|
||||
TcSoaWorkflowRac;bundle-version="11000.2.0",
|
||||
TcSoaWorkflowTypes;bundle-version="11000.2.0"
|
||||
Bundle-ClassPath: .,
|
||||
sqljdbc4.jar,
|
||||
jxl.jar,
|
||||
ojdbc6.jar,
|
||||
libs/axiom-api-1.2.20.jar,
|
||||
libs/axiom-impl-1.2.20.jar,
|
||||
libs/axis2-adb-1.7.8.jar,
|
||||
libs/axis2-kernel-1.7.8.jar,
|
||||
libs/axis2-transport-base-1.7.8.jar,
|
||||
libs/axis2-transport-http-1.7.8.jar,
|
||||
libs/axis2-transport-local-1.7.8.jar,
|
||||
libs/classes12.jar,
|
||||
libs/com.kostech.DesignChickList_1.0.0.0.jar,
|
||||
libs/commons-beanutils-1.7.0.jar,
|
||||
libs/commons-codec-1.2.jar,
|
||||
libs/commons-collections-3.2.jar,
|
||||
libs/commons-httpclient-3.1.jar,
|
||||
libs/commons-io-2.1.jar,
|
||||
libs/commons-lang-2.4.jar,
|
||||
libs/commons-logging-1.1.1.jar,
|
||||
libs/commons-logging-1.1.jar,
|
||||
libs/dom4j-1.6.1.jar,
|
||||
libs/ezmorph-1.0.4.jar,
|
||||
libs/httpcore-4.4.6.jar,
|
||||
libs/jdom.jar,
|
||||
libs/json-lib-2.2.2-jdk15.jar,
|
||||
libs/json-lib-2.2.3-jdk13.jar,
|
||||
libs/log4j-1.2.15.jar,
|
||||
libs/neethi-3.0.3.jar,
|
||||
libs/ojdbc6.jar,
|
||||
libs/soap-2.1.jar,
|
||||
libs/woden-core-1.0M10.jar,
|
||||
libs/wsdl4j-1.6.2.jar,
|
||||
libs/xmlbeans-2.5.0.jar,
|
||||
libs/xmlschema-core-2.2.1.jar,
|
||||
libs/hutool-all-5.8.25.jar,
|
||||
libs/easyexcel-4.0.3.jar,
|
||||
libs/aspose-words-17.4.0-jdk16.jar,
|
||||
libs/poi-3.17.jar,
|
||||
libs/poi-examples-3.17.jar,
|
||||
libs/poi-excelant-3.17.jar,
|
||||
libs/poi-ooxml-3.17.jar,
|
||||
libs/poi-ooxml-schemas-3.17.jar,
|
||||
libs/poi-scratchpad-3.17.jar
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: cn.com.ebewin.ysr.dialog,
|
||||
cn.com.ebewin.ysr.dialog.systemdatadistribution,
|
||||
cn.com.ebewin.ysr.form,
|
||||
cn.com.ebewin.ysr.handlers,
|
||||
cn.com.ebewin.ysr.util,
|
||||
cn.com.ebewin.ysr.view,
|
||||
com.microsoft.sqlserver.jdbc,
|
||||
common,
|
||||
common.log,
|
||||
jxl,
|
||||
jxl.biff,
|
||||
jxl.biff.drawing,
|
||||
jxl.biff.formula,
|
||||
jxl.demo,
|
||||
jxl.format,
|
||||
jxl.read.biff,
|
||||
jxl.write,
|
||||
jxl.write.biff,
|
||||
microsoft.sql,
|
||||
oracle.core.lmx,
|
||||
oracle.core.lvf,
|
||||
oracle.jdbc,
|
||||
oracle.jdbc.aq,
|
||||
oracle.jdbc.babelfish,
|
||||
oracle.jdbc.connector,
|
||||
oracle.jdbc.dcn,
|
||||
oracle.jdbc.diagnostics,
|
||||
oracle.jdbc.driver,
|
||||
oracle.jdbc.internal,
|
||||
oracle.jdbc.oci,
|
||||
oracle.jdbc.oracore,
|
||||
oracle.jdbc.pool,
|
||||
oracle.jdbc.pooling,
|
||||
oracle.jdbc.proxy,
|
||||
oracle.jdbc.proxy.annotation,
|
||||
oracle.jdbc.replay,
|
||||
oracle.jdbc.replay.driver,
|
||||
oracle.jdbc.replay.internal,
|
||||
oracle.jdbc.rowset,
|
||||
oracle.jdbc.util,
|
||||
oracle.jdbc.xa,
|
||||
oracle.jdbc.xa.client,
|
||||
oracle.jpub.runtime,
|
||||
oracle.net.ano,
|
||||
oracle.net.aso,
|
||||
oracle.net.jdbc.TNSAddress,
|
||||
oracle.net.jdbc.nl,
|
||||
oracle.net.jdbc.nl.mesg,
|
||||
oracle.net.jndi,
|
||||
oracle.net.ns,
|
||||
oracle.net.nt,
|
||||
oracle.net.resolver,
|
||||
oracle.security.o3logon,
|
||||
oracle.security.o5logon,
|
||||
oracle.sql,
|
||||
oracle.sql.converter
|
||||
Import-Package: com.teamcenter.services.internal.rac.projectmanagement._2007_01,
|
||||
com.teamcenter.services.internal.rac.projectmanagement._2011_06,
|
||||
com.teamcenter.services.internal.rac.projectmanagement._2014_10,
|
||||
com.teamcenter.services.rac.projectmanagement,
|
||||
com.teamcenter.services.rac.projectmanagement._2011_06,
|
||||
com.teamcenter.services.rac.projectmanagement._2012_02,
|
||||
com.teamcenter.soa.exceptions
|
||||
|
@ -0,0 +1,51 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
Image/,\
|
||||
Rendering.xml,\
|
||||
plugin.xml,\
|
||||
sqljdbc4.jar,\
|
||||
jxl.jar,\
|
||||
ojdbc6.jar,\
|
||||
libs/axiom-api-1.2.20.jar,\
|
||||
libs/axiom-impl-1.2.20.jar,\
|
||||
libs/axis2-adb-1.7.8.jar,\
|
||||
libs/axis2-kernel-1.7.8.jar,\
|
||||
libs/axis2-transport-base-1.7.8.jar,\
|
||||
libs/axis2-transport-http-1.7.8.jar,\
|
||||
libs/axis2-transport-local-1.7.8.jar,\
|
||||
libs/classes12.jar,\
|
||||
libs/com.kostech.DesignChickList_1.0.0.0.jar,\
|
||||
libs/commons-beanutils-1.7.0.jar,\
|
||||
libs/commons-codec-1.2.jar,\
|
||||
libs/commons-collections-3.2.jar,\
|
||||
libs/commons-httpclient-3.1.jar,\
|
||||
libs/commons-io-2.1.jar,\
|
||||
libs/commons-lang-2.4.jar,\
|
||||
libs/commons-logging-1.1.1.jar,\
|
||||
libs/commons-logging-1.1.jar,\
|
||||
libs/dom4j-1.6.1.jar,\
|
||||
libs/ezmorph-1.0.4.jar,\
|
||||
libs/httpcore-4.4.6.jar,\
|
||||
libs/jdom.jar,\
|
||||
libs/json-lib-2.2.2-jdk15.jar,\
|
||||
libs/json-lib-2.2.3-jdk13.jar,\
|
||||
libs/log4j-1.2.15.jar,\
|
||||
libs/neethi-3.0.3.jar,\
|
||||
libs/ojdbc6.jar,\
|
||||
libs/soap-2.1.jar,\
|
||||
libs/woden-core-1.0M10.jar,\
|
||||
libs/wsdl4j-1.6.2.jar,\
|
||||
libs/xmlbeans-2.5.0.jar,\
|
||||
libs/xmlschema-core-2.2.1.jar,\
|
||||
libs/hutool-all-5.8.25.jar,\
|
||||
libs/easyexcel-4.0.3.jar,\
|
||||
libs/aspose-words-17.4.0-jdk16.jar,\
|
||||
libs/poi-3.17.jar,\
|
||||
libs/poi-examples-3.17.jar,\
|
||||
libs/poi-excelant-3.17.jar,\
|
||||
libs/poi-ooxml-3.17.jar,\
|
||||
libs/poi-ooxml-schemas-3.17.jar,\
|
||||
libs/poi-scratchpad-3.17.jar
|
||||
jars.compile.order = .
|
@ -0,0 +1,411 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
|
||||
<extension point="org.eclipse.ui.commands">
|
||||
<category id="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="ebewinYSR命令"
|
||||
name="cn.com.ebewin.ysr.ui.commands.category">
|
||||
</category>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.MachiningDynamicsManage"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="加工动态管理"
|
||||
name="加工动态管理">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.PipingLinePlanningManagement"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="配管线计划管理"
|
||||
name="配管线计划管理">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.handlers.CustomizationHandler"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="定制件看板"
|
||||
name="定制件看板">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.MaterialPurchasingSearch"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="货品采购查询"
|
||||
name="货品采购查询">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.RectificationPurchasingImport"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="整改采购件到货导入"
|
||||
name="整改采购件到货导入">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.QualityManagementBoard"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="质检管理看板"
|
||||
name="质检管理看板">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.ProblemBoard"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="问题综合看板"
|
||||
name="问题综合看板">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_WorkHoursCreate"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="项目调试信息统计"
|
||||
name="工作日报创建">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_DebugingInfoDlg"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="项目调试信息统计"
|
||||
name="项目调试信息统计">
|
||||
</command>
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_TravelORDENCreate"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="项目调试信息统计"
|
||||
name="出差委托单创建">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_QERevisionSearchDialog"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="报价委托台账"
|
||||
name="报价委托台账">
|
||||
</command>
|
||||
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_TotalContentDialog"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="系统总目录台账"
|
||||
name="系统总目录台账">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_PMSBRevisionSearchDialog"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="项目管理台账"
|
||||
name="项目管理台账">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_ProjectFormExport"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="验收项目台账"
|
||||
name="验收项目台账">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.KBatchImport"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="啦啦啦"
|
||||
name="啦啦啦">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.ScheduleTaskEdit"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="编辑时间表任务属性"
|
||||
name="编辑属性">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.YSR8_DrawingListCreateDialog" name="图样目录"/>
|
||||
<command id="AssignProjectHandler" name="指派项目"/>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.ui.commands.ktest" name="测试"/>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.handlers.YSR8_wysjTimeHandler"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="外委设计时间统计看板"
|
||||
name="外委设计时间统计看板">
|
||||
</command>
|
||||
|
||||
<command id="cn.com.ebewin.ysr.dialog.systemdatadistribution.SystemDataDistributionHandler"
|
||||
categoryId="cn.com.ebewin.ysr.ui.commands.category"
|
||||
description="系统资料下发统计看板"
|
||||
name="系统资料下发统计看板">
|
||||
</command>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler class="cn.com.ebewin.ysr.handlers.MachiningDynamicsManageHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.MachiningDynamicsManage">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.PipingLinePlanningManagementHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.PipingLinePlanningManagement">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.CustomizationHandler"
|
||||
commandId="cn.com.ebewin.ysr.handlers.CustomizationHandler">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.MaterialPurchasingSearchHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.MaterialPurchasingSearch">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.RectificationPurchasingImportHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.RectificationPurchasingImport">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.QualityManagementBoardHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.QualityManagementBoard">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.ProblemBoardHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.ProblemBoard">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_WorkHoursCreateHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_WorkHoursCreate">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.DebugingInfoHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_DebugingInfoDlg">
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_TravelORDENCreateHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_TravelORDENCreate">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_TotalContentHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_TotalContentDialog">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_wysjTimeHandler"
|
||||
commandId="cn.com.ebewin.ysr.handlers.YSR8_wysjTimeHandler">
|
||||
</handler>
|
||||
|
||||
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.PMSBRevisionSearchHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_PMSBRevisionSearchDialog">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.QERevisionSearchHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_QERevisionSearchDialog">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_DrawingListCreateHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_DrawingListCreateDialog">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.YSR8_ProjectFormExportHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_ProjectFormExport">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.KTestHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.ktest">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.KBatchImportHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.KBatchImport">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.dialog.AssignProjectHandler"
|
||||
commandId="AssignProjectHandler">
|
||||
</handler>
|
||||
|
||||
<handler class="cn.com.ebewin.ysr.handlers.ScheduleTaskEditHandler"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.ScheduleTaskEdit">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.teamcenter.rac.schedule.inMainView"/>
|
||||
</activeWhen>
|
||||
<enabledWhen>
|
||||
<and>
|
||||
<reference definitionId="com.teamcenter.rac.schedule.SelectedTask_ScheduleView"/>
|
||||
<iterate ifEmpty="false" >
|
||||
<not>
|
||||
<or>
|
||||
<test property="com.teamcenter.rac.kernel.TCComponentScheduleTask.SM_Schedule_Task_Type"
|
||||
value="6">
|
||||
</test>
|
||||
<adapt type="com.teamcenter.rac.kernel.TCComponent">
|
||||
<and>
|
||||
<test property="com.teamcenter.rac.kernel.TCComponent.type" value="Fnd0ProxyTask"/>
|
||||
</and>
|
||||
</adapt>
|
||||
</or>
|
||||
</not>
|
||||
</iterate>
|
||||
</and>
|
||||
</enabledWhen>
|
||||
</handler>
|
||||
<handler class="cn.com.ebewin.ysr.dialog.systemdatadistribution.SystemDataDistributionHandler"
|
||||
commandId="cn.com.ebewin.ysr.dialog.systemdatadistribution.SystemDataDistributionHandler">
|
||||
</handler>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.bindings">
|
||||
<!--<key commandId="cn.com.ebewin.ysr.ui.commands.KBatchImport"
|
||||
sequence="M3+D"
|
||||
schemeId="com.teamcenter.rac.scheme">
|
||||
</key>-->
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=additions">
|
||||
<menu label="项目管理" id="cn.com.ebewin.ysr.ui.menus.ProjectManage">
|
||||
<separator name="ProjectManageStart" visible="true"></separator>
|
||||
<separator name="ProjectManageSep1" visible="true"></separator>
|
||||
<separator name="ProjectManageSep2" visible="true"></separator>
|
||||
<separator name="ProjectManageSep3" visible="true"></separator>
|
||||
<!--
|
||||
<menu label="采购管理" id="cn.com.ebewin.ysr.ui.menus.PurchManage"
|
||||
<separator name="PurchManageStart" visible="true"></separator>
|
||||
<separator name="PurchManageEnd" visible="true"></separator>
|
||||
</menu>
|
||||
-->
|
||||
<separator name="ProjectManageSep4" visible="true"></separator>
|
||||
<!--
|
||||
<menu label="质量问题管理" id="cn.com.ebewin.ysr.ui.menus.QualityManage"
|
||||
<separator name="QualityManageStart" visible="true"></separator>
|
||||
<separator name="QualityManageEnd" visible="true"></separator>
|
||||
</menu>
|
||||
-->
|
||||
<separator name="ProjectManageSep5" visible="true"></separator>
|
||||
<separator name="ProjectManageEnd" visible="true"></separator>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
|
||||
<menuContribution locationURI="menu:cn.com.ebewin.ysr.ui.menus.ProjectManage?after=ProjectManageStart">
|
||||
<command label="加工动态管理" id="cn.com.ebewin.ysr.ui.menus.MachiningDynamicsManage"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.MachiningDynamicsManage"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="配管线计划管理" id="cn.com.ebewin.ysr.ui.menus.PipingLinePlanningManagement"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.PipingLinePlanningManagement"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="定制件看板" id="cn.com.ebewin.ysr.handlers.CustomizationHandler"
|
||||
commandId="cn.com.ebewin.ysr.handlers.CustomizationHandler"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="货品采购查询" id="cn.com.ebewin.ysr.ui.menus.MaterialPurchasingSearch"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.MaterialPurchasingSearch"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="整改采购件到货导入" id="cn.com.ebewin.ysr.ui.menus.RectificationPurchasingImport"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.RectificationPurchasingImport"
|
||||
style="push">
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<menuContribution locationURI="menu:cn.com.ebewin.ysr.ui.menus.ProjectManage?after=ProjectManageSep1">
|
||||
<command label="质检管理看板" id="cn.com.ebewin.ysr.ui.menus.QualityManagementBoard"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.QualityManagementBoard"
|
||||
style="push">
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<menuContribution locationURI="menu:cn.com.ebewin.ysr.ui.menus.ProjectManage?after=ProjectManageSep2">
|
||||
<command label="问题综合看板" id="cn.com.ebewin.ysr.ui.menus.ProblemBoard"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.ProblemBoard"
|
||||
style="push">
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<menuContribution locationURI="menu:cn.com.ebewin.ysr.ui.menus.ProjectManage?after=ProjectManageSep3">
|
||||
<command label="工作日报创建" id="cn.com.ebewin.ysr.ui.menus.YSR8_WorkHoursCreate"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_WorkHoursCreate"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="项目调试信息统计" id="cn.com.ebewin.ysr.ui.menus.YSR8_DebugingInfoDlg"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_DebugingInfoDlg"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="出差委托单创建" id="cn.com.ebewin.ysr.ui.menus.YSR8_TravelORDENCreate"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_TravelORDENCreate"
|
||||
style="push">
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
<menuContribution locationURI="menu:cn.com.ebewin.ysr.ui.menus.ProjectManage?after=ProjectManageSep5">
|
||||
<command label="系统总目录台账" id="cn.com.ebewin.ysr.ui.commands.YSR8_TotalContentDialog"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_TotalContentDialog"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="项目管理台账" id="cn.com.ebewin.ysr.ui.menus.YSR8_PMSBRevisionSearchDialog"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_PMSBRevisionSearchDialog"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="报价委托台账" id="cn.com.ebewin.ysr.ui.menus.YSR8_QERevisionSearchDialog"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_QERevisionSearchDialog"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="验收项目台账" id="cn.com.ebewin.ysr.ui.commands.YSR8_ProjectFormExportCommand"
|
||||
commandId="cn.com.ebewin.ysr.ui.commands.YSR8_ProjectFormExport"
|
||||
style="push">
|
||||
</command>
|
||||
|
||||
<command label="外委设计时间统计看板" id="cn.com.ebewin.ysr.handlers.YSR8_wysjTimeHandler"
|
||||
commandId="cn.com.ebewin.ysr.handlers.YSR8_wysjTimeHandler"
|
||||
style="push">
|
||||
</command>
|
||||
<command label="系统资料下发统计看板" id="cn.com.ebewin.ysr.dialog.systemdatadistribution.SystemDataDistributionHandler"
|
||||
commandId="cn.com.ebewin.ysr.dialog.systemdatadistribution.SystemDataDistributionHandler"
|
||||
style="push">
|
||||
</command>
|
||||
</menuContribution>
|
||||
|
||||
|
||||
<menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
|
||||
<command label="创建图样目录" id="cn.com.ebewin.ysr.ui.menus.YSR8_DrawingListCreateDialog" commandId="cn.com.ebewin.ysr.ui.commands.YSR8_DrawingListCreateDialog">
|
||||
<visibleWhen>
|
||||
<and>
|
||||
<reference definitionId="com.teamcenter.rac.pse.inMainView"/>
|
||||
<with variable="rac_command_suppression">
|
||||
<not>
|
||||
<iterate operator="or">
|
||||
<equals value="cn.com.ebewin.ysr.ui.menus.YSR8_DrawingListCreateDialog"/>
|
||||
</iterate>
|
||||
</not>
|
||||
</with>
|
||||
</and>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
<!-- 编辑时间表任务 -->
|
||||
<command commandId="cn.com.ebewin.ysr.ui.commands.ScheduleTaskEdit" id="popups.ScheduleTaskEdit">
|
||||
<visibleWhen>
|
||||
<and>
|
||||
<reference
|
||||
definitionId="com.teamcenter.rac.schedule.inMainView">
|
||||
</reference>
|
||||
<with variable="rac_command_suppression">
|
||||
<not>
|
||||
<iterate operator="or">
|
||||
<equals
|
||||
value="cn.com.ebewin.ysr.ui.commands.ScheduleTaskEdit"/>
|
||||
</iterate>
|
||||
</not>
|
||||
</with>
|
||||
</and>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
<command commandId="AssignProjectHandler" id="AssignProjectHandler">
|
||||
<visibleWhen>
|
||||
<with variable="rac_command_suppression">
|
||||
<not>
|
||||
<iterate operator="or">
|
||||
<equals
|
||||
value="AssignProjectHandler"/>
|
||||
</iterate>
|
||||
</not>
|
||||
</with>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
|
||||
</menuContribution>
|
||||
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.views">
|
||||
<view
|
||||
allowMultiple="false"
|
||||
class="cn.com.ebewin.ysr.view.ebewinPartView"
|
||||
icon="icons/sample.gif"
|
||||
id="ebewinPartView"
|
||||
name="零部件浏览">
|
||||
</view>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
<extension
|
||||
point="com.teamcenter.rac.aifrcp.application">
|
||||
<aif_app_item
|
||||
id="cn.com.ebewin.ysr.aif_app_item1"
|
||||
name="name"
|
||||
perspective_id="com.teamcenter.rac.aifrcp.perspective">
|
||||
</aif_app_item>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectives">
|
||||
</extension>
|
||||
-->
|
||||
</plugin>
|
@ -0,0 +1,38 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
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.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class AssignProjectHandler extends AbstractHandler
|
||||
{
|
||||
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException
|
||||
{
|
||||
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
|
||||
try {
|
||||
final TCSession session = (TCSession) app.getSession();
|
||||
final InterfaceAIFComponent[] pasteTargets = app.getTargetComponents();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
new AssignProjectDialog(session, pasteTargets);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
MessageBox.post(exception, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
public class ConditionMapper {
|
||||
private String name;
|
||||
private String field;
|
||||
private String type;
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
public void setField(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
@ -0,0 +1,444 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableRowSorter;
|
||||
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentForm;
|
||||
import com.teamcenter.rac.kernel.TCComponentItem;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemType;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCProperty;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
import cn.com.ebewin.ysr.util.DialogUtil;
|
||||
import cn.com.ebewin.ysr.util.FormUtil;
|
||||
import cn.com.ebewin.ysr.util.TCUtil;
|
||||
import cn.com.ebewin.ysr.util.UIUtil.JTableInfo;
|
||||
import jxl.Workbook;
|
||||
import jxl.format.Alignment;
|
||||
import jxl.format.Border;
|
||||
import jxl.format.BorderLineStyle;
|
||||
import jxl.format.VerticalAlignment;
|
||||
import jxl.write.Label;
|
||||
import jxl.write.WritableCellFormat;
|
||||
import jxl.write.WritableFont;
|
||||
import jxl.write.WritableSheet;
|
||||
import jxl.write.WritableWorkbook;
|
||||
import jxl.write.WriteException;
|
||||
|
||||
public class CustomizationDialog extends JFrame {
|
||||
private static final long serialVersionUID = 1L;
|
||||
DialogUtil fu = new DialogUtil(this, "定制件看板", "YSR8_CustomizationDialog");
|
||||
|
||||
|
||||
TCSession session;
|
||||
HashMap<String, String> mcslMap = new HashMap<String, String>();//名称 数量map
|
||||
HashMap<String, ArrayList<String>> tymlMap = new HashMap<String, ArrayList<String>>();//图样目录 map
|
||||
protected String xmhStr;
|
||||
public CustomizationDialog(TCSession session) throws TCException {
|
||||
|
||||
fu.initializeUI(session);
|
||||
Comparator<Object> comparator = new Comparator<Object>() {
|
||||
public int compare(Object arg0, Object arg1) {
|
||||
try {
|
||||
int a = Integer.parseInt(arg0.toString());
|
||||
int b = Integer.parseInt(arg1.toString());
|
||||
return a - b;
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
// lidy20180824表格可排序且“序号”列按数值大小排序
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.21.11.11");
|
||||
JTableInfo ci = (FormUtil.JTableInfo) fu.allComponentInfos.get("a.21.11.11");
|
||||
final TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<DefaultTableModel>(ci.dataTableModel);
|
||||
sorter.setComparator(0, comparator);
|
||||
table.setRowSorter(sorter);
|
||||
|
||||
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
this.session = session;
|
||||
//loadRendering();
|
||||
addActionListener();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
// private void loadRendering() throws TCException {}
|
||||
//
|
||||
private void addActionListener() {
|
||||
//查询子项目
|
||||
JButton btn = (JButton)fu.allComponentMap.get("b.11.12");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JTextField xmhText = (JTextField)fu.allComponentMap.get("XMH");
|
||||
xmhStr = xmhText.getText();
|
||||
if(xmhStr == null || xmhStr.isEmpty()) {
|
||||
MessageBox.post("请填写项目号!","提示",2);
|
||||
return;
|
||||
}else {
|
||||
//查询子项目号
|
||||
String XTZML = xmhStr+"_XTZML";
|
||||
TCComponentItem item = null;
|
||||
try {
|
||||
|
||||
TCComponentItemType itemType = (TCComponentItemType) session
|
||||
.getTypeComponent("Item");
|
||||
item = itemType.find(XTZML);
|
||||
TCComponentForm form = TCUtil.getItemRevisionMasterForm(item.getLatestItemRevision());
|
||||
//获取代号
|
||||
TCProperty ysr8_ID = form.getTCProperty("ysr8_ID");
|
||||
String[] Ysr8_IDs = ysr8_ID.getStringArrayValue();
|
||||
//获取数量
|
||||
TCProperty ysr8_Quantity = form.getTCProperty("ysr8_Quantity");
|
||||
double[] ysr8_Quantitys = ysr8_Quantity.getDoubleArrayValue();
|
||||
JComboBox<String> zxmhCom = (JComboBox<String>)fu.allComponentMap.get("ZXMH");
|
||||
//清空原来的id号
|
||||
zxmhCom.removeAllItems();
|
||||
zxmhCom.setSelectedItem("");
|
||||
for (int i = 0; i < Ysr8_IDs.length; i++) {
|
||||
zxmhCom.addItem(Ysr8_IDs[i]);
|
||||
mcslMap.put(Ysr8_IDs[i], ysr8_Quantitys[i]+"");
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
if(item == null) {
|
||||
MessageBox.post("填写的项目号系统总目录未找到!","提示",2);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton)fu.allComponentMap.get("b.11.15");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JComboBox<String> zxmhCom = (JComboBox<String>)fu.allComponentMap.get("ZXMH");
|
||||
String selectZXMH = (String)zxmhCom.getSelectedItem();
|
||||
|
||||
if(selectZXMH == null || selectZXMH.isEmpty()) {//查询所有
|
||||
JTextField xmhText = (JTextField)fu.allComponentMap.get("XMH");
|
||||
xmhStr = xmhText.getText();
|
||||
String XTZML = xmhStr+"_XTZML";
|
||||
TCComponentItem item = null;
|
||||
String[] Ysr8_IDs= {};
|
||||
try {
|
||||
TCComponentItemType itemType = (TCComponentItemType) session
|
||||
.getTypeComponent("Item");
|
||||
item = itemType.find(XTZML);
|
||||
TCComponentForm tymlForm = TCUtil.getItemRevisionMasterForm(item.getLatestItemRevision());
|
||||
//获取代号
|
||||
TCProperty ysr8_ID = tymlForm.getTCProperty("ysr8_ID");
|
||||
Ysr8_IDs = ysr8_ID.getStringArrayValue();
|
||||
//获取数量
|
||||
TCProperty ysr8_Quantity = tymlForm.getTCProperty("ysr8_Quantity");
|
||||
double[] ysr8_Quantitys = ysr8_Quantity.getDoubleArrayValue();
|
||||
for (int i = 0; i < Ysr8_IDs.length; i++) {
|
||||
mcslMap.put(Ysr8_IDs[i], ysr8_Quantitys[i]+"");
|
||||
}
|
||||
}catch (Exception e1) {
|
||||
// TODO: handle exception
|
||||
e1.printStackTrace();
|
||||
}
|
||||
//清table
|
||||
FormUtil.JTableInfo ci = (FormUtil.JTableInfo)fu.allComponentInfos.get("a.21.11.11");
|
||||
int rowCount = ci.dataTableModel.getRowCount();
|
||||
for(int i = rowCount - 1; i >= 0; i--){
|
||||
ci.dataTableModel.removeRow(i);
|
||||
}
|
||||
ci.dataTableModel.getDataVector().clear();
|
||||
|
||||
for (String key : Ysr8_IDs) {
|
||||
//查询选择子项目号
|
||||
//获取 table
|
||||
System.out.println("111");
|
||||
|
||||
try {
|
||||
//查询图样目录
|
||||
TCComponentItem tyml= getTYML(key);
|
||||
//获取表单查询数据
|
||||
if(tyml != null) {
|
||||
TCComponentForm form = TCUtil.getItemRevisionMasterForm(tyml.getLatestItemRevision());
|
||||
//获取件号
|
||||
TCProperty th = form.getTCProperty("ysr8_Code");
|
||||
String[] ths = th.getStringArrayValue();
|
||||
//获取数量
|
||||
TCProperty sl = form.getTCProperty("ysr8_TotalCount");
|
||||
String[] sls = sl.getStringArrayValue();
|
||||
//获取备注
|
||||
TCProperty bz = form.getTCProperty("ysr8_DrawingRemark");
|
||||
String[] bzs = bz.getStringArrayValue();
|
||||
//获取名称
|
||||
TCProperty mc = form.getTCProperty("ysr8_Name");
|
||||
String[] mcs = mc.getStringArrayValue();
|
||||
//获取序号
|
||||
TCProperty xh = form.getTCProperty("ysr8_SerialNo");
|
||||
String[] xhs = mc.getStringArrayValue();
|
||||
|
||||
//通过备注过滤 不是定制件的
|
||||
System.out.println("222");
|
||||
for (int i = 0; i < ths.length; i++) {
|
||||
if(sls[i] != null && !(sls[i].equals("")) && xhs[i] != null && !(xhs[i].equals("0")) && bzs[i] != null && bzs[i].equals("定制件")) {
|
||||
Vector<String> vec = new Vector<>();
|
||||
vec.add(xmhStr);//项目号
|
||||
vec.add(key);//子项目号
|
||||
vec.add(ths[i]);//图号
|
||||
vec.add(mcs[i]);//名称
|
||||
vec.add(transform(mcslMap.get(key)));//夹具数量
|
||||
vec.add(transform(sls[i]));//单套数量
|
||||
vec.add(getTotal(mcslMap.get(key),sls[i]));//总数量 = 单套 * 夹具
|
||||
vec.add(getGc(ths[i]));//定制件工厂 通过图号查询属性ysr8_DZJCJ,最新版本表单
|
||||
ci.dataTableModel.addRow(vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e2) {
|
||||
// TODO: handle exception
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}else {//查询选择子项目号
|
||||
//获取 table
|
||||
System.out.println("111");
|
||||
FormUtil.JTableInfo ci = (FormUtil.JTableInfo)fu.allComponentInfos.get("a.21.11.11");
|
||||
int rowCount = ci.dataTableModel.getRowCount();
|
||||
for(int i = rowCount - 1; i >= 0; i--){
|
||||
ci.dataTableModel.removeRow(i);
|
||||
}
|
||||
ci.dataTableModel.getDataVector().clear();
|
||||
try {
|
||||
//查询图样目录
|
||||
TCComponentItem tyml= getTYML(selectZXMH);
|
||||
//获取表单查询数据
|
||||
if(tyml != null) {
|
||||
TCComponentForm form = TCUtil.getItemRevisionMasterForm(tyml.getLatestItemRevision());
|
||||
//获取件号
|
||||
TCProperty th = form.getTCProperty("ysr8_Code");
|
||||
String[] ths = th.getStringArrayValue();
|
||||
//获取数量
|
||||
TCProperty sl = form.getTCProperty("ysr8_TotalCount");
|
||||
String[] sls = sl.getStringArrayValue();
|
||||
//获取备注
|
||||
TCProperty bz = form.getTCProperty("ysr8_DrawingRemark");
|
||||
String[] bzs = bz.getStringArrayValue();
|
||||
//获取名称
|
||||
TCProperty mc = form.getTCProperty("ysr8_Name");
|
||||
String[] mcs = mc.getStringArrayValue();
|
||||
//获取序号
|
||||
TCProperty xh = form.getTCProperty("ysr8_SerialNo");
|
||||
String[] xhs = mc.getStringArrayValue();
|
||||
|
||||
//通过备注过滤 不是定制件的
|
||||
System.out.println("222");
|
||||
for (int i = 0; i < ths.length; i++) {
|
||||
if(sls[i] != null && !(sls[i].equals("")) && xhs[i] != null && !(xhs[i].equals("0")) && bzs[i] != null && bzs[i].equals("定制件")) {
|
||||
Vector<String> vec = new Vector<>();
|
||||
vec.add(xmhStr);//项目号
|
||||
vec.add(selectZXMH);//子项目号
|
||||
vec.add(ths[i]);//图号
|
||||
vec.add(mcs[i]);//名称
|
||||
vec.add(transform(mcslMap.get(selectZXMH)));//夹具数量
|
||||
vec.add(transform(sls[i]));//单套数量
|
||||
vec.add(getTotal(mcslMap.get(selectZXMH),sls[i]));//总数量 = 单套 * 夹具
|
||||
vec.add(getGc(ths[i]));//定制件工厂 通过图号查询属性ysr8_DZJCJ,最新版本表单
|
||||
ci.dataTableModel.addRow(vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e2) {
|
||||
// TODO: handle exception
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton)fu.allComponentMap.get("b.11.16");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
outputERPInfo();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected String getGc(String string) {
|
||||
// TODO Auto-generated method stub
|
||||
String stringProperty="";
|
||||
try{
|
||||
TCComponentItemType itemType = (TCComponentItemType) session
|
||||
.getTypeComponent("Item");
|
||||
TCComponentItem item = itemType.find(string);
|
||||
TCComponentForm form = TCUtil.getItemRevisionMasterForm(item.getLatestItemRevision());
|
||||
stringProperty = form.getStringProperty("ysr8_DZJCJ");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return stringProperty;
|
||||
}
|
||||
|
||||
//去掉小数点后面的数字
|
||||
public String transform(String str) {
|
||||
String intNumber=str;
|
||||
if(str.contains(".")) {
|
||||
intNumber = str.substring(0,str.indexOf("."));
|
||||
}
|
||||
return intNumber;
|
||||
}
|
||||
|
||||
protected String getTotal(String mc, String jj) {
|
||||
// TODO Auto-generated method stub
|
||||
double dMc = Double.parseDouble(mc);
|
||||
double dJj = Double.parseDouble(jj);
|
||||
int total = (int)(dMc*dJj);
|
||||
|
||||
return total+"";
|
||||
}
|
||||
|
||||
protected TCComponentItem getTYML(String selectZXMH) {
|
||||
// TODO Auto-generated method stub
|
||||
//拼接查询id
|
||||
String id = selectZXMH+"_TM*";
|
||||
TCComponent[] search;
|
||||
try {
|
||||
search = session.search("零组件 ID", new String[] { "零组件 ID" }, new String[] { id });
|
||||
for (int i = 0; i < search.length; i++) {
|
||||
TCComponentItem item = (TCComponentItem) search[i];
|
||||
//TCComponent referenceProperty = item.getLatestItemRevision().getReferenceProperty("release_status_list");
|
||||
|
||||
TCComponent[] statuss = item.getLatestItemRevision().getReferenceListProperty("release_status_list");
|
||||
for (int j = 0; j < statuss.length; j++) {
|
||||
String status = statuss[j].getStringProperty("name");
|
||||
//发布状态为 正式下发才行
|
||||
System.out.println("status==="+status);
|
||||
System.out.println("id==="+id);
|
||||
if(status != null && status.equals("YSR8_customY")) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void outputERPInfo() {
|
||||
final JTable table = (JTable)fu.allComponentMap.get("a.21.11.11");
|
||||
final JButton btn = (JButton)fu.allComponentMap.get("b.11.16");
|
||||
btn.setEnabled(false);
|
||||
final ProgressReporterDialog reporter = new ProgressReporterDialog();
|
||||
reporter.reportProgressMessage("正在导出,请稍候...");
|
||||
new Thread(reporter).start();
|
||||
new Thread() {
|
||||
public void run() {
|
||||
try {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String time = sdf.format(date);
|
||||
String toPath = System.getProperty("java.io.tmpdir") + "定制件看板" + time + ".xls";
|
||||
// 创建一个可写的Workbook
|
||||
WritableWorkbook writeWorkBook = Workbook.createWorkbook(new File(toPath));
|
||||
// 创建工作表
|
||||
WritableSheet wsheet = writeWorkBook.createSheet("定制件看板", 0);
|
||||
|
||||
//填写表格
|
||||
int columnCount = table.getColumnCount(); // 总列数
|
||||
int rowCount = table.getRowCount(); // 总行数
|
||||
String[] titles = new String[columnCount]; // 表头
|
||||
|
||||
// 获取表头
|
||||
for (int i = 0; i < columnCount; i++) {
|
||||
titles[i] = table.getColumnName(i);
|
||||
}
|
||||
|
||||
int current_row = 0; // 初始化当前行作为开始行
|
||||
|
||||
try {
|
||||
// 标题栏样式
|
||||
WritableFont titleFont = new WritableFont(WritableFont.createFont("宋体"), 13,WritableFont.BOLD);
|
||||
WritableCellFormat titleCellFormat = new WritableCellFormat(titleFont);
|
||||
titleCellFormat.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
|
||||
titleCellFormat.setAlignment(Alignment.CENTRE);
|
||||
titleCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
titleCellFormat.setWrap(true);
|
||||
|
||||
// 内容样式
|
||||
WritableFont contentFont = new WritableFont(WritableFont.createFont("宋体"), 12);
|
||||
WritableCellFormat contentCellFormat = new WritableCellFormat(contentFont);
|
||||
contentCellFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
|
||||
contentCellFormat.setAlignment(Alignment.CENTRE);
|
||||
contentCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
contentCellFormat.setWrap(true);
|
||||
|
||||
// 写首行标题
|
||||
for (int i = 0; i < columnCount; i++) {
|
||||
Label labelTitle = new Label(i, current_row, titles[i], titleCellFormat);
|
||||
wsheet.addCell(labelTitle);
|
||||
}
|
||||
|
||||
current_row = current_row + 1;
|
||||
// 写行数据
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
for (int j = 0; j < columnCount; j++) {
|
||||
Object objValue = table.getValueAt(i, j);
|
||||
Label labelContent = new Label(j, i + current_row, String.valueOf(objValue), contentCellFormat);
|
||||
wsheet.addCell(labelContent);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置格式
|
||||
wsheet.getSettings().setDefaultColumnWidth(20);
|
||||
writeWorkBook.write();
|
||||
writeWorkBook.close();
|
||||
} catch (WriteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 打开导出的报表文件
|
||||
Runtime.getRuntime().exec("cmd /c \"" + toPath + "\"");
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
reporter.requestCanceling();
|
||||
btn.setEnabled(true);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
public class FuzzySearchComboBox extends JComboBox<String> {
|
||||
|
||||
private DefaultComboBoxModel<String> model;
|
||||
private String currentText = "";
|
||||
private String[] items;
|
||||
public FuzzySearchComboBox(String[] items) {
|
||||
super(items);
|
||||
this.items = items;
|
||||
model = (DefaultComboBoxModel<String>) getModel();
|
||||
setEditable(true);
|
||||
final JTextField textField = (JTextField) getEditor().getEditorComponent();
|
||||
textField.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
currentText = textField.getText();
|
||||
filterItems(currentText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void filterItems(String text) {
|
||||
String[] filteredItems = new String[items.length];
|
||||
int count = 0;
|
||||
|
||||
for (String item : items) {
|
||||
if (item.toLowerCase().contains(text.toLowerCase())) {
|
||||
filteredItems[count++] = item;
|
||||
}
|
||||
}
|
||||
|
||||
String[] finalFilteredItems = new String[count];
|
||||
System.arraycopy(filteredItems, 0, finalFilteredItems, 0, count);
|
||||
|
||||
model.removeAllElements();
|
||||
for (String item : finalFilteredItems) {
|
||||
model.addElement(item);
|
||||
}
|
||||
|
||||
if (finalFilteredItems.length > 0) {
|
||||
setSelectedItem(finalFilteredItems[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String[] items = {"Apple", "Banana", "Cherry", "Date", "Elderberry", "Fig", "Grape"};
|
||||
// JFrame frame = new JFrame("Fuzzy Search ComboBox Example");
|
||||
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
// frame.setSize(300, 200);
|
||||
// frame.setLayout(new java.awt.FlowLayout());
|
||||
//
|
||||
// FuzzySearchComboBox comboBox = new FuzzySearchComboBox(items);
|
||||
// frame.add(comboBox);
|
||||
//
|
||||
// frame.setVisible(true);
|
||||
// }
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.Insets;
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.ListCellRenderer;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.FileFilter;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class KBatchImportDialog extends AbstractAIFDialog {
|
||||
|
||||
private static final long serialVersionUID = 2009624329447981859L;
|
||||
// private TCSession session;
|
||||
|
||||
public KBatchImportDialog(TCSession session) {
|
||||
super(false);
|
||||
// this.session=session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FileSystemView fsv=FileSystemView.getFileSystemView();
|
||||
String deskPath=fsv.getHomeDirectory().getPath();
|
||||
JFileChooser fileChooser = new JFileChooser();
|
||||
fileChooser.setCurrentDirectory(new File(deskPath));
|
||||
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
int state=fileChooser.showOpenDialog(this);
|
||||
if(state==1) {
|
||||
return;
|
||||
}else {
|
||||
File folder = fileChooser.getSelectedFile();
|
||||
System.out.println("选择路径:"+folder.getAbsolutePath());
|
||||
String[] filters=new String[] {"*.xlsx","*.txt"};
|
||||
Map<String, File[]> fileMap=readFiles(folder,filters);
|
||||
if(fileMap!=null&&fileMap.size()>0) {
|
||||
initUI(fileMap);
|
||||
}else {
|
||||
MessageBox.post("该路径下没有找到xxx文件","提示",MessageBox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initUI(Map<String, File[]> fileMap) {
|
||||
this.setTitle("导入文件");
|
||||
this.setPreferredSize(new Dimension(500, 300));
|
||||
this.setLayout(new BorderLayout());
|
||||
JTabbedPane tabPane=new JTabbedPane(JTabbedPane.LEFT);
|
||||
JPanel btnPanel=new JPanel(new FlowLayout(FlowLayout.CENTER,15,3));
|
||||
|
||||
GridBagConstraints s=new GridBagConstraints();
|
||||
s.gridwidth=1;
|
||||
s.gridheight=1;
|
||||
s.gridx=0;
|
||||
s.gridy=0;
|
||||
s.weightx=1;
|
||||
s.weighty=1;
|
||||
s.insets=new Insets(5, 5, 0, 5);
|
||||
//主界面
|
||||
for (String filter : fileMap.keySet()) {
|
||||
JPanel aPanel=new JPanel(new BorderLayout());
|
||||
tabPane.add(filter, aPanel);
|
||||
JList<KBatchImportBean> fileList = new JList<>();
|
||||
fileList.setPreferredSize(new Dimension(200, 200));
|
||||
//mainPanel.add(new JCheckBox(filter),s);
|
||||
//s.gridy++;
|
||||
File[] files = fileMap.get(filter);
|
||||
int len=files.length;
|
||||
KBatchImportBean[] listData=new KBatchImportBean[len];
|
||||
for(int i=0;i<len;i++) {
|
||||
listData[i]=new KBatchImportBean(files[i]);
|
||||
}
|
||||
fileList.setListData(listData);
|
||||
fileList.setCellRenderer(new CheckBoxRenderer());
|
||||
fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
JScrollPane scroll = new JScrollPane(fileList);
|
||||
scroll.setBackground(Color.WHITE);
|
||||
scroll.setBorder(BorderFactory.createEmptyBorder(5,10,5,0));
|
||||
aPanel.add(BorderLayout.CENTER,scroll);
|
||||
|
||||
}
|
||||
|
||||
//按钮
|
||||
JButton okBtn = new JButton("导入");
|
||||
JButton celBtn = new JButton("取消");
|
||||
btnPanel.add(okBtn);
|
||||
btnPanel.add(celBtn);
|
||||
this.add(BorderLayout.CENTER,tabPane);
|
||||
this.add(BorderLayout.SOUTH,btnPanel);
|
||||
this.showDialog();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户选择路径下所以符合要求的文件
|
||||
* @param folder 文件夹
|
||||
* @param filters *.xlsx之类的
|
||||
* @return
|
||||
*/
|
||||
private Map<String,File[]> readFiles(File folder,String[] filters) {
|
||||
Map<String,File[]> result=new LinkedHashMap<>();
|
||||
if(folder!=null&&folder.isDirectory()) {
|
||||
for (String filter : filters) {
|
||||
File[] files = folder.listFiles(new FileFilter(filter));
|
||||
if(files.length>0) {
|
||||
result.put(filter,files);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 在JList显示复选框 */
|
||||
@SuppressWarnings("serial")
|
||||
class CheckBoxRenderer extends JCheckBox implements ListCellRenderer<KBatchImportBean> {
|
||||
CheckBoxRenderer() {
|
||||
}
|
||||
|
||||
public Component getListCellRendererComponent(JList<? extends KBatchImportBean> listBox, KBatchImportBean obj, int currentindex, boolean isChecked, boolean hasFocus) {
|
||||
setSelected(obj.isSelected());
|
||||
if (isChecked) {
|
||||
setForeground(Color.WHITE);
|
||||
setBackground(new Color(51, 153, 255));
|
||||
if (obj.isDupicated()) {
|
||||
setText(obj.toString() + "---文件名重复:路径“" + obj.getPath() + "”");
|
||||
} else {
|
||||
setText(obj.toString());
|
||||
}
|
||||
} else {
|
||||
setBackground(Color.WHITE);
|
||||
if (obj.isDupicated()) {
|
||||
setForeground(new Color(51, 103, 205));
|
||||
setText(obj.toString() + "---文件名重复:路径“" + obj.getPath() + "”");
|
||||
} else {
|
||||
setForeground(Color.BLACK);
|
||||
setText(obj.toString());
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import javax.swing.JTable;
|
||||
import cn.com.ebewin.ysr.util.TableColorRender;
|
||||
|
||||
public class MachiningDynamicsColorRender extends TableColorRender {
|
||||
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
Component renderer = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
||||
if(isSelected)
|
||||
renderer.setBackground(Color.BLUE);
|
||||
else if(getTableVal(table, row, MachiningDynamicsManageDialog.BJ6).startsWith("×·¼ÓÌæ»»"))
|
||||
return renderer;
|
||||
else if(getTableVal(table, row, MachiningDynamicsManageDialog.BJ21).equals("ºÏ¸ñ"))
|
||||
renderer.setBackground(Color.GREEN);
|
||||
else if(getTableVal(table, row, MachiningDynamicsManageDialog.BJ22).equals("ºÏ¸ñ"))
|
||||
renderer.setBackground(Color.GREEN);
|
||||
|
||||
/*if (column == 15) {
|
||||
String ysr8_TechPlanDateVal = table.getValueAt(row, 15).toString();
|
||||
String ysr8_TechFinishDateVal = table.getValueAt(row, 16).toString();
|
||||
if (!ysr8_TechFinishDateVal.equals("-") && !ysr8_TechPlanDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, ysr8_TechFinishDateVal);
|
||||
System.out.println("ysr8_TechFinishDateVal-ysr8_TechPlanDateVal====" + ysr8_TechFinishDateVal + "====" +
|
||||
ysr8_TechPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_TechPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_TechPlanDateVal====" + currDate + "====" + ysr8_TechPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 18) {
|
||||
String ysr8_PurchPlanDateVal = table.getValueAt(row, 18).toString();
|
||||
String ysr8_PurchFinishDateVal = table.getValueAt(row, 19).toString();
|
||||
if (!ysr8_PurchPlanDateVal.equals("-") && !ysr8_PurchFinishDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_PurchPlanDateVal, ysr8_PurchFinishDateVal);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_PurchPlanDateVal====" + ysr8_PurchFinishDateVal + "====" +
|
||||
ysr8_PurchPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_PurchPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_PurchPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_PurchPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 21) {
|
||||
String ysr8_MachinPlanDateVal = table.getValueAt(row, 21).toString();
|
||||
String ysr8_PurchFinishDate2Val = table.getValueAt(row, 22).toString();
|
||||
if (!ysr8_MachinPlanDateVal.equals("-") && !ysr8_PurchFinishDate2Val.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_MachinPlanDateVal, ysr8_PurchFinishDate2Val);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_MachinPlanDateVal====" + ysr8_PurchFinishDate2Val + "====" +
|
||||
ysr8_MachinPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_MachinPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_MachinPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_MachinPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 25) {
|
||||
String ysr8_EnginePlanDateVal = table.getValueAt(row, 25).toString();
|
||||
String ysr8_FinishDateVal = table.getValueAt(row, 26).toString();
|
||||
if (!ysr8_EnginePlanDateVal.equals("-") && !ysr8_FinishDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_EnginePlanDateVal, ysr8_FinishDateVal);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_EnginePlanDateVal====" + ysr8_FinishDateVal + "====" +
|
||||
ysr8_EnginePlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_EnginePlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_EnginePlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_EnginePlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return renderer;
|
||||
}
|
||||
private String getTableVal(JTable table, int row, int col) {
|
||||
Object o = table.getValueAt(row, col);
|
||||
if(o == null)
|
||||
return "";
|
||||
else
|
||||
return o.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,774 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentForm;
|
||||
import com.teamcenter.rac.kernel.TCComponentSchedule;
|
||||
import com.teamcenter.rac.kernel.TCComponentScheduleTask;
|
||||
import com.teamcenter.rac.kernel.TCComponentTask;
|
||||
import com.teamcenter.rac.kernel.TCComponentUser;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCPreferenceService;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.DateButton;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.rac.util.iTextField;
|
||||
import com.teamcenter.services.rac.core.DataManagementService;
|
||||
|
||||
import cn.com.ebewin.ysr.util.CommonUtil;
|
||||
import cn.com.ebewin.ysr.util.DialogUtil;
|
||||
import cn.com.ebewin.ysr.util.FormUtil;
|
||||
import cn.com.ebewin.ysr.util.KUtil;
|
||||
import cn.com.ebewin.ysr.util.TCUtil;
|
||||
import cn.com.ebewin.ysr.util.UIUtil.JComboBoxInfo;
|
||||
import cn.com.ebewin.ysr.util.UIUtil.JTableInfo;
|
||||
import jxl.Workbook;
|
||||
import jxl.format.Alignment;
|
||||
import jxl.format.Border;
|
||||
import jxl.format.BorderLineStyle;
|
||||
import jxl.format.VerticalAlignment;
|
||||
import jxl.write.Label;
|
||||
import jxl.write.WritableCellFormat;
|
||||
import jxl.write.WritableFont;
|
||||
import jxl.write.WritableSheet;
|
||||
import jxl.write.WritableWorkbook;
|
||||
import jxl.write.WriteException;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PipingLinePlanningManagementDialog extends JFrame {
|
||||
private static final long serialVersionUID = 1L;
|
||||
DialogUtil fu = new DialogUtil(this, "配管线计划管理", "YSR8_PipingLinePlanningManagementDialog");
|
||||
HashMap<Integer, Object> allObjectMap1 = new HashMap<Integer, Object>();
|
||||
private static final int TASKSTATE_INDEX = 22;
|
||||
// private static final int T1_PROJECTID_INDEX = 1;
|
||||
private static final int WIRING_INDEX = 10; //本次配管线数量
|
||||
private static final int WIRED_INDEX = 11; //已配管线数量
|
||||
private static final int ARRIVED_INDEX = 8; // 已到货数量
|
||||
private static final int TOTAL_INDEX = 7; // 数量
|
||||
private static final int START_INDEX = 14; //配线开始时间
|
||||
private Date Date1 = null;
|
||||
private Date Date2 = null;
|
||||
|
||||
public PipingLinePlanningManagementDialog(TCSession session) throws TCException {
|
||||
// super(true);
|
||||
|
||||
fu.initializeUI(session);
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
table.setAutoCreateRowSorter(true);
|
||||
|
||||
// centerToScreen();
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
|
||||
loadRendering();
|
||||
addActionListener();
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
private void loadRendering() throws TCException {
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
table.setDefaultRenderer(Object.class, new ColorTableRenderer());
|
||||
@SuppressWarnings("unchecked")
|
||||
JComboBox<String> cbx = (JComboBox<String>) fu.allComponentMap.get("ysr8_TaskManuState");//lidy20190322
|
||||
// cbx.addItem("");
|
||||
cbx.addItem("配管线中");
|
||||
cbx.addItem("已完成配管线");
|
||||
cbx.addItem("已到货待配线");
|
||||
cbx.addItem("未到货");
|
||||
cbx.addItem("已检验");
|
||||
}
|
||||
|
||||
public class ColorTableRenderer extends DefaultTableCellRenderer {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Color DEFBLUE = new Color(51, 153, 255);
|
||||
// private Color DEFGREEN = new Color(158, 234, 106);
|
||||
// private Color DEFYELLOW = new Color(245, 245, 43);
|
||||
private Color DEFORANGE = new Color(249, 116, 7);
|
||||
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable t, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
if (hasFocus) {
|
||||
setBackground(DEFBLUE);
|
||||
} else {
|
||||
setBackground(Color.WHITE);
|
||||
String state = t.getValueAt(row, TASKSTATE_INDEX)==null?"":t.getValueAt(row, TASKSTATE_INDEX).toString();
|
||||
String WiringStartDate = t.getValueAt(row, START_INDEX)==null?"":t.getValueAt(row, START_INDEX).toString();
|
||||
String Quantity = t.getValueAt(row, TOTAL_INDEX)==null?"":t.getValueAt(row, TOTAL_INDEX).toString();
|
||||
String ArrivedQuantity = t.getValueAt(row, ARRIVED_INDEX)==null?"":t.getValueAt(row, ARRIVED_INDEX).toString();
|
||||
String WiredQuantity = t.getValueAt(row, WIRED_INDEX)==null?"":t.getValueAt(row, WIRED_INDEX).toString();
|
||||
String PurchFinishDate = t.getValueAt(row, 17)==null?"":t.getValueAt(row, 17).toString();
|
||||
if((state.equals("已报检") || state.equals("分批") || state.equals("已检验")) && Quantity.equals(WiredQuantity)) {//已完成配管线
|
||||
setBackground(Color.GREEN);
|
||||
} else if(!WiringStartDate.equals("") && PurchFinishDate.equals("")) {//配管线中
|
||||
setBackground(Color.YELLOW);
|
||||
} else if(!ArrivedQuantity.equals("") && !ArrivedQuantity.equals("0") && WiringStartDate.equals("")) {//已到货待配线
|
||||
setBackground(DEFORANGE);
|
||||
}
|
||||
// if(state!=null) {
|
||||
// String content=state.toString();
|
||||
// if(content.equals("已检验")) {
|
||||
// setBackground(DEFGREEN);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return super.getTableCellRendererComponent(t, value, isSelected, hasFocus, row, column);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addActionListener() {
|
||||
JButton btn = (JButton) fu.allComponentMap.get("b.11.110");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
searchMachiningInfo();
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton) fu.allComponentMap.get("b.11.111");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
editMachiningInfo();
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton) fu.allComponentMap.get("b.21.18");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
outputMachiningInfo();
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton) fu.allComponentMap.get("b.21.19");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
submitInspectionProcess2();
|
||||
} catch (Exception e1) {
|
||||
MessageBox.post(PipingLinePlanningManagementDialog.this,e.toString(),"出错了",MessageBox.ERROR);
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void searchMachiningInfo() {
|
||||
allObjectMap1.clear();
|
||||
|
||||
JTableInfo ci1 = (FormUtil.JTableInfo) fu.allComponentInfos.get("a.31.11.11");
|
||||
int rowCount = ci1.dataTableModel.getRowCount();
|
||||
for (int i = rowCount - 1; i >= 0; i--) {
|
||||
ci1.dataTableModel.removeRow(i);
|
||||
}
|
||||
ci1.dataTableModel.getDataVector().clear();
|
||||
|
||||
iTextField textField = (iTextField) fu.allComponentMap.get("XMH");
|
||||
String XMH = textField.getText().toString();
|
||||
|
||||
JComboBox<String> cbx = (JComboBox<String>) fu.allComponentMap.get("JGC");
|
||||
JComboBoxInfo cii = (JComboBoxInfo) fu.allComponentInfos.get("JGC");
|
||||
String JGC = cbx.getSelectedItem().toString();
|
||||
if (cii.lovVal != null) {
|
||||
Iterator<String> iter = cii.lovVal.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
String lovKey = iter.next();
|
||||
String lovValue = cii.lovVal.get(lovKey);
|
||||
if (lovValue.equalsIgnoreCase(JGC)) {
|
||||
JGC = lovKey;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Date1=null;
|
||||
Date2=null;
|
||||
DateButton db = (DateButton) fu.allComponentMap.get("ysr8_FixturePlanDate1");
|
||||
Date1 = db.getDate();
|
||||
String Date1s = "";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");
|
||||
if (Date1 != null) {
|
||||
Date1s = sdf.format(Date1) + " 00:00";
|
||||
}
|
||||
|
||||
db = (DateButton) fu.allComponentMap.get("ysr8_FixturePlanDate2");
|
||||
Date2 = db.getDate();
|
||||
String Date2s = "";
|
||||
if (Date2 != null) {
|
||||
Date2s = sdf.format(Date2) + " 23:59";
|
||||
}
|
||||
|
||||
textField = (iTextField) fu.allComponentMap.get("FZR");
|
||||
String FZR = textField.getText().toString();
|
||||
|
||||
textField = (iTextField) fu.allComponentMap.get("JJPXDD");
|
||||
String JJPXDD = textField.getText().toString();
|
||||
|
||||
cbx = (JComboBox<String>) fu.allComponentMap.get("ysr8_TaskManuState");
|
||||
// cii = (JComboBoxInfo) fu.allComponentInfos.get("ysr8_TaskManuState");
|
||||
final String ysr8_TaskManuState = cbx.getSelectedItem().toString();
|
||||
|
||||
Vector<String> attrVec = new Vector<String>();
|
||||
Vector<String> valVec = new Vector<String>();
|
||||
|
||||
attrVec.add("任务用途");
|
||||
valVec.add("6");
|
||||
|
||||
if (!XMH.equals("")) {
|
||||
attrVec.add("项目 ID");
|
||||
valVec.add(XMH);
|
||||
}
|
||||
if (!JGC.equals("")) {
|
||||
attrVec.add("加工厂1");
|
||||
valVec.add(JGC);
|
||||
}
|
||||
if (!FZR.equals("")) {
|
||||
attrVec.add("加工负责人");
|
||||
valVec.add(FZR);
|
||||
}
|
||||
if (!JJPXDD.equals("")) {
|
||||
attrVec.add("夹具配线担当");
|
||||
valVec.add(JJPXDD);
|
||||
}
|
||||
String type = "";
|
||||
if (!ysr8_TaskManuState.equals("")) {
|
||||
if(ysr8_TaskManuState.equals("配管线中")) {
|
||||
attrVec.add("任务加工状态");
|
||||
valVec.add("2;5");
|
||||
type = "配线开始";
|
||||
}else if(ysr8_TaskManuState.equals("已完成配管线")) {
|
||||
attrVec.add("任务加工状态");
|
||||
valVec.add("3;4");
|
||||
type = "配线完成";
|
||||
}else if(ysr8_TaskManuState.equals("已到货待配线")) {
|
||||
|
||||
}else if(ysr8_TaskManuState.equals("未到货")) {
|
||||
attrVec.add("任务加工状态");
|
||||
valVec.add("1");
|
||||
}else if(ysr8_TaskManuState.equals("已检验")) {
|
||||
attrVec.add("任务加工状态");
|
||||
valVec.add("4");
|
||||
type = "配线完成";
|
||||
}
|
||||
}
|
||||
if (!Date1s.equals("") && !type.equals("")) {
|
||||
attrVec.add(type+"1");
|
||||
valVec.add(Date1s);
|
||||
}
|
||||
if (!Date2s.equals("") && !type.equals("")) {
|
||||
attrVec.add(type+"2");
|
||||
valVec.add(Date2s);
|
||||
}
|
||||
|
||||
final String[] attrs = (String[]) attrVec.toArray(new String[attrVec.size()]);
|
||||
final String[] vals = (String[]) valVec.toArray(new String[attrVec.size()]);
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
JButton btn = (JButton) fu.allComponentMap.get("b.11.110");
|
||||
btn.setText("查询中...");
|
||||
setEnableBtns(false);
|
||||
searchMachiningInfo_SchedulTask(attrs, vals, ysr8_TaskManuState);
|
||||
setEnableBtns(true);
|
||||
btn.setText("查询");
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void setEnableBtns(boolean b) {
|
||||
JButton btn = (JButton) fu.allComponentMap.get("b.11.110");
|
||||
btn.setEnabled(b);
|
||||
btn = (JButton) fu.allComponentMap.get("b.11.111");
|
||||
btn.setEnabled(b);
|
||||
btn = (JButton) fu.allComponentMap.get("b.21.18");
|
||||
btn.setEnabled(b);
|
||||
btn = (JButton) fu.allComponentMap.get("b.21.19");
|
||||
btn.setEnabled(b);
|
||||
}
|
||||
|
||||
private void searchMachiningInfo_SchedulTask(String[] attrs, String[] vals, String ysr8_TaskManuState) {
|
||||
JTableInfo ci = (FormUtil.JTableInfo) fu.allComponentInfos.get("a.31.11.11");
|
||||
try {
|
||||
TCComponent[] tcComponents = TCUtil.query(fu.session, "SearchSchedulTaskPLP", attrs, vals);
|
||||
|
||||
HashMap<TCComponent,Date> map = new HashMap<>();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
HashMap<TCComponentScheduleTask,String> ysr8_ArrivedQuantitys = new HashMap<>();
|
||||
HashMap<TCComponentScheduleTask,String> ysr8_ArrivingQuantitys = new HashMap<>();
|
||||
HashMap<TCComponentScheduleTask,String> ysr8_PurchPlanDates = new HashMap<>();
|
||||
HashMap<TCComponentScheduleTask,String> ysr8_PurchFinishDates = new HashMap<>();
|
||||
for (int i = 0; i < tcComponents.length; i++) {
|
||||
TCComponentScheduleTask scheduTask = (TCComponentScheduleTask) tcComponents[i];
|
||||
TCComponentScheduleTask searScheduleTask = searchScheduleTask(scheduTask.getProperty("ysr8_ProjectCode"), "2", scheduTask.getProperty("object_name"));
|
||||
// System.out.println(Date1+"=="+Date2+"--"+ysr8_TaskManuState);
|
||||
Date MachPlanDate = null, MachFinishDate = null;
|
||||
String ArrivedQuantity = "";
|
||||
if(searScheduleTask != null) {
|
||||
MachPlanDate = searScheduleTask.getDateProperty("ysr8_PurchPlanDate");
|
||||
MachFinishDate = searScheduleTask.getDateProperty("ysr8_PurchFinishDate");
|
||||
ArrivedQuantity = searScheduleTask.getProperty("ysr8_ArrivedQuantity");
|
||||
}
|
||||
if(!ysr8_TaskManuState.equals("") && !ysr8_TaskManuState.equals("未到货") && !ysr8_TaskManuState.equals("已检验")) {
|
||||
String TaskManuState = scheduTask.getProperty("ysr8_TaskManuState");
|
||||
String Quantity = scheduTask.getProperty("ysr8_PartNumber");
|
||||
String WiredQuantity = scheduTask.getProperty("ysr8_WiredQuantity");
|
||||
String WiringStartDate = scheduTask.getProperty("ysr8_WiringStartDate");
|
||||
String PurchFinishDate = scheduTask.getProperty("ysr8_PurchFinishDate");
|
||||
if(ysr8_TaskManuState.equals("已完成配管线")) {
|
||||
// System.out.println(scheduTask.getProperty("object_name")+"=="+TaskManuState+"=="+Quantity+"=="+WiredQuantity);
|
||||
if((!TaskManuState.equals("已报检") && !TaskManuState.equals("已检验")) || !Quantity.equals(WiredQuantity))
|
||||
continue;
|
||||
} else if(ysr8_TaskManuState.equals("配管线中")) {
|
||||
// System.out.println(scheduTask.getProperty("object_name")+"=="+WiringStartDate+"=="+Quantity+"=="+WiredQuantity);
|
||||
if(WiringStartDate.equals("") || !PurchFinishDate.equals("") || (!WiringStartDate.equals("") && Quantity.equals(WiredQuantity))) {
|
||||
// System.out.println("continue");
|
||||
continue;
|
||||
}
|
||||
} else if(ysr8_TaskManuState.equals("已到货待配线")) {
|
||||
System.out.println(scheduTask.getProperty("object_name")+"=="+WiringStartDate+"=="+Quantity+"=="+ArrivedQuantity);
|
||||
if(ArrivedQuantity.equals("") || ArrivedQuantity.equals("0") || !WiringStartDate.equals("")) {
|
||||
// System.out.println("continue");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// System.out.println("add");
|
||||
}
|
||||
if(Date1 != null) {
|
||||
if(ysr8_TaskManuState.equals("已到货待配线") && (MachFinishDate==null || MachFinishDate.compareTo(Date1)<0))
|
||||
continue;
|
||||
else if(ysr8_TaskManuState.equals("未到货") && (MachPlanDate==null || MachPlanDate.compareTo(Date1)<0))
|
||||
continue;
|
||||
else if(ysr8_TaskManuState.equals("") && (MachPlanDate==null || MachPlanDate.compareTo(Date1)<0))
|
||||
continue;
|
||||
}
|
||||
if(Date2 != null) {
|
||||
if(ysr8_TaskManuState.equals("已到货待配线") && (MachFinishDate==null || MachFinishDate.compareTo(Date2)>0))
|
||||
continue;
|
||||
else if(ysr8_TaskManuState.equals("未到货") && (MachPlanDate==null || MachPlanDate.compareTo(Date2)>0))
|
||||
continue;
|
||||
else if(ysr8_TaskManuState.equals("") && (MachPlanDate==null || MachPlanDate.compareTo(Date2)>0)) {
|
||||
// System.out.println(MachPlanDate+"=="+Date2+"--"+MachPlanDate.compareTo(Date2));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Date ysr8_PurchFinishDate = null;
|
||||
if(searScheduleTask != null) {
|
||||
ysr8_PurchFinishDate = searScheduleTask.getDateProperty("ysr8_PurchFinishDate");// 按夹具到达时间排序
|
||||
ysr8_ArrivedQuantitys.put(scheduTask, ArrivedQuantity);
|
||||
ysr8_ArrivingQuantitys.put(scheduTask, searScheduleTask.getProperty("ysr8_ArrivingQuantity"));
|
||||
ysr8_PurchPlanDates.put(scheduTask, fu.getDateString(MachPlanDate));
|
||||
ysr8_PurchFinishDates.put(scheduTask, fu.getDateString(MachFinishDate));
|
||||
}else {
|
||||
ysr8_ArrivedQuantitys.put(scheduTask, "");
|
||||
ysr8_ArrivingQuantitys.put(scheduTask, "");
|
||||
ysr8_PurchPlanDates.put(scheduTask, "");
|
||||
ysr8_PurchFinishDates.put(scheduTask, "");
|
||||
}
|
||||
if(ysr8_PurchFinishDate==null)
|
||||
ysr8_PurchFinishDate = dateFormat.parse("9900-01-01");
|
||||
map.put(scheduTask, ysr8_PurchFinishDate);
|
||||
}
|
||||
TCComponent[] tcComponents2 = Pipingsort(map);
|
||||
|
||||
Integer idx = ci.dataTableModel.getRowCount();
|
||||
for (int i = 0; i < tcComponents2.length; i++) {
|
||||
TCComponentScheduleTask scheduTask = (TCComponentScheduleTask) tcComponents2[i];
|
||||
scheduTask.refresh();
|
||||
|
||||
String ysr8_ProjectCodeVal = scheduTask.getProperty("ysr8_ProjectCode");
|
||||
TCComponentSchedule schedule = TCUtil.findScheduleByID(fu.session, ysr8_ProjectCodeVal + "-00");
|
||||
TCComponentForm projectForm = null;
|
||||
if (schedule != null) {
|
||||
projectForm = (TCComponentForm) schedule.getRelatedComponent("IMAN_reference");
|
||||
}
|
||||
|
||||
Vector<String> vec = new Vector<>();
|
||||
vec.add((++idx) + "");// 序号
|
||||
vec.add(scheduTask.getProperty("ysr8_ProjectCode"));// 项目编号
|
||||
vec.add(scheduTask.getProperty("object_name"));// 任务名称
|
||||
if (projectForm != null) {// 加工负责人
|
||||
vec.add(projectForm.getProperty("ysr8_Machiner"));
|
||||
} else {
|
||||
vec.add("");
|
||||
}
|
||||
if (projectForm != null) {// 采购负责人
|
||||
vec.add(projectForm.getProperty("ysr8_Purcher"));
|
||||
} else {
|
||||
vec.add("");
|
||||
}
|
||||
vec.add(scheduTask.getProperty("ysr8_WiringPerson"));// 夹具配线担当
|
||||
vec.add(scheduTask.getProperty("ysr8_ManuFactory1"));// 加工厂
|
||||
vec.add(scheduTask.getProperty("ysr8_PartNumber"));// 数量
|
||||
|
||||
// kk 添加列 20180907
|
||||
vec.add(ysr8_ArrivedQuantitys.get(scheduTask));// 已到货数量
|
||||
vec.add(ysr8_ArrivingQuantitys.get(scheduTask));// 本次到货数量
|
||||
|
||||
vec.add(scheduTask.getProperty("ysr8_WiringQuantity"));// 本次配管线数量
|
||||
vec.add(scheduTask.getProperty("ysr8_WiredQuantity"));// 已配管线数量
|
||||
|
||||
// vec.add(scheduTask.getProperty("ysr8_FixturePlanDate"));//夹具预计到达时间
|
||||
vec.add(ysr8_PurchPlanDates.get(scheduTask));// 夹具预计到达时间//lidy20190429
|
||||
vec.add(ysr8_PurchFinishDates.get(scheduTask));// 夹具到达时间
|
||||
|
||||
vec.add(fu.getDateString(scheduTask.getDateProperty("ysr8_WiringStartDate")));// 配线开始时间
|
||||
vec.add(fu.getDateString(scheduTask.getDateProperty("finish_date")));// 计划完成日期
|
||||
vec.add(fu.getDateString(scheduTask.getDateProperty("ysr8_PurchPlanDate")));// 采购计划完成日期
|
||||
|
||||
// kk 20180905 添加列
|
||||
// vec.add(fu.getDateString(scheduTask.getDateProperty("ysr8_PurchPlanDate")));// 实际完成日期
|
||||
vec.add(fu.getDateString(scheduTask.getDateProperty("ysr8_PurchFinishDate")));// 实际完成日期
|
||||
|
||||
vec.add(scheduTask.getProperty("ysr8_GasWiring"));// 气路配线情况
|
||||
vec.add(scheduTask.getProperty("ysr8_CircuitWiring"));// 电路配线情况
|
||||
vec.add(scheduTask.getProperty("ysr8_Remark"));// 备注
|
||||
if (projectForm != null) {// 厂别
|
||||
vec.add(projectForm.getProperty("ysr8_Factory"));
|
||||
} else {
|
||||
vec.add("");
|
||||
}
|
||||
vec.add(scheduTask.getProperty("ysr8_TaskManuState"));// 任务状态
|
||||
vec.add(fu.getDateString(scheduTask.getDateProperty("ysr8_SubQualityFinishDate")));// 质检完成时间
|
||||
vec.add(scheduTask.getProperty("ysr8_SubQualityResult"));// 质检结论
|
||||
|
||||
ci.dataTableModel.addRow(vec);
|
||||
allObjectMap1.put(idx - 1, scheduTask);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
MessageBox.post(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private TCComponentScheduleTask searchScheduleTask(String projectCode, String taskUse, String name) throws TCException {
|
||||
Vector<String> attrVec = new Vector<String>();
|
||||
Vector<String> valVec = new Vector<String>();
|
||||
attrVec.add("项目编号");
|
||||
valVec.add(projectCode);
|
||||
attrVec.add("任务用途");
|
||||
valVec.add(taskUse);
|
||||
attrVec.add("名称");
|
||||
valVec.add(name);
|
||||
String[] attrs = (String[]) attrVec.toArray(new String[attrVec.size()]);
|
||||
String[] vals = (String[]) valVec.toArray(new String[attrVec.size()]);
|
||||
TCComponent[] tcComponents = TCUtil.query(fu.session, "SearchSchedulTaskPLP_02", attrs, vals);
|
||||
if (tcComponents == null) {
|
||||
return null;
|
||||
}
|
||||
// System.out.println(tcComponents.length);
|
||||
if (tcComponents.length > 0) {
|
||||
return (TCComponentScheduleTask) tcComponents[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void editMachiningInfo() {
|
||||
try {
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
int[] rows = table.getSelectedRows();
|
||||
if (rows == null || rows.length == 0) {
|
||||
MessageBox.post("请选择要编辑的数据!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
Object taskState = table.getValueAt(rows[0], TASKSTATE_INDEX);
|
||||
if (taskState != null && (taskState.toString().equals("已报检") || taskState.toString().equals("已检验"))) {
|
||||
MessageBox.post("任务状态不为[已报检、已检验]的数据才能进行编辑!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
TCComponentUser user = fu.session.getUser();
|
||||
String coordinationManager = TCUtil.getPreference2(fu.session, TCPreferenceService.TC_preference_site, "YSR8_MachiningDynamics_CoordinationManager");
|
||||
Boolean iscoordinationManager = false;
|
||||
if (coordinationManager.equals(user.getProperty("user_name"))) {
|
||||
iscoordinationManager = true;
|
||||
}
|
||||
if (!iscoordinationManager) {
|
||||
MessageBox.post("必须是外协施工管理人员才能进行编辑!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
int idx = Integer.parseInt(table.getValueAt(rows[0], 0).toString());
|
||||
TCComponentScheduleTask scheduTask = (TCComponentScheduleTask) allObjectMap1.get(idx - 1);
|
||||
new PipingLinePlanningManagementEditDialog(this, scheduTask);
|
||||
} catch (TCException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// searchMachiningInfo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void outputMachiningInfo() {
|
||||
final JButton btn = (JButton) fu.allComponentMap.get("b.21.18");
|
||||
btn.setEnabled(false);
|
||||
final JTable table1 = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
|
||||
final ProgressReporterDialog reporter = new ProgressReporterDialog();
|
||||
reporter.reportProgressMessage("正在导出,请稍候...");
|
||||
new Thread(reporter).start();
|
||||
new Thread() {
|
||||
public void run() {
|
||||
try {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String time = sdf.format(date);
|
||||
String toPath = System.getProperty("java.io.tmpdir") + "加工动态" + time + ".xls";
|
||||
// 创建一个可写的Workbook
|
||||
WritableWorkbook writeWorkBook = Workbook.createWorkbook(new File(toPath));
|
||||
// 创建工作表
|
||||
WritableSheet wsheet = writeWorkBook.createSheet("加工动态", 0);
|
||||
|
||||
// 填写表格
|
||||
int columnCount = table1.getColumnCount(); // 总列数
|
||||
int rowCount = table1.getRowCount(); // 总行数
|
||||
String[] titles = new String[columnCount]; // 表头
|
||||
|
||||
// 获取表头
|
||||
for (int i = 0; i < columnCount; i++) {
|
||||
titles[i] = table1.getColumnName(i);
|
||||
}
|
||||
|
||||
int current_row = 0; // 初始化当前行作为开始行
|
||||
|
||||
try {
|
||||
// 标题栏样式
|
||||
WritableFont titleFont = new WritableFont(WritableFont.createFont("宋体"), 13, WritableFont.BOLD);
|
||||
WritableCellFormat titleCellFormat = new WritableCellFormat(titleFont);
|
||||
titleCellFormat.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
|
||||
titleCellFormat.setAlignment(Alignment.CENTRE);
|
||||
titleCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
titleCellFormat.setWrap(true);
|
||||
|
||||
// 内容样式
|
||||
WritableFont contentFont = new WritableFont(WritableFont.createFont("宋体"), 12);
|
||||
WritableCellFormat contentCellFormat = new WritableCellFormat(contentFont);
|
||||
contentCellFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
|
||||
contentCellFormat.setAlignment(Alignment.CENTRE);
|
||||
contentCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
contentCellFormat.setWrap(true);
|
||||
|
||||
// 写首行标题
|
||||
for (int i = 0; i < columnCount; i++) {
|
||||
Label labelTitle = new Label(i, current_row, titles[i], titleCellFormat);
|
||||
wsheet.addCell(labelTitle);
|
||||
}
|
||||
|
||||
current_row = current_row + 1;
|
||||
// 写行数据
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
for (int j = 0; j < columnCount; j++) {
|
||||
Object objValue = table1.getValueAt(i, j);
|
||||
Label labelContent = new Label(j, i + current_row, String.valueOf(objValue), contentCellFormat);
|
||||
wsheet.addCell(labelContent);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置格式
|
||||
wsheet.getSettings().setDefaultColumnWidth(20);
|
||||
writeWorkBook.write();
|
||||
writeWorkBook.close();
|
||||
} catch (WriteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 打开导出的报表文件
|
||||
Runtime.getRuntime().exec("cmd /c \"" + toPath + "\"");
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
reporter.requestCanceling();
|
||||
btn.setEnabled(true);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
// kk 20180907 提交检验逻辑变更
|
||||
private void submitInspectionProcess2() throws Exception {
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
int[] rows = table.getSelectedRows();
|
||||
if (rows == null || rows.length == 0) {
|
||||
MessageBox.post(PipingLinePlanningManagementDialog.this,"请选择要编辑的数据!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
if (!table.getValueAt(rows[0], TASKSTATE_INDEX).toString().equals("已到货")&&!table.getValueAt(rows[0], TASKSTATE_INDEX).toString().equals("分批")) {
|
||||
MessageBox.post(PipingLinePlanningManagementDialog.this,"任务状态为[已到货]或[分批]的数据才能提交报检流程!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
TCComponentUser user = fu.session.getUser();
|
||||
String coordinationManager = TCUtil.getPreference2(fu.session, TCPreferenceService.TC_preference_site, "YSR8_MachiningDynamics_CoordinationManager");
|
||||
Boolean iscoordinationManager = false;
|
||||
if (coordinationManager.equals(user.getProperty("user_name"))) {
|
||||
iscoordinationManager = true;
|
||||
}
|
||||
if (!iscoordinationManager) {
|
||||
MessageBox.post(PipingLinePlanningManagementDialog.this,"必须是外协施工管理人员才能进行编辑!", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
//已配管线数量<已到货数量
|
||||
Object wiredNumStr=table.getValueAt(rows[0], WIRED_INDEX);
|
||||
Object arrivedNumStr=table.getValueAt(rows[0], ARRIVED_INDEX);
|
||||
Object totalNumStr=table.getValueAt(rows[0], TOTAL_INDEX);
|
||||
double wiredNum=KUtil.getDoubleFromString(wiredNumStr, "已配管线数量");
|
||||
double arrivedNum=KUtil.getDoubleFromString(arrivedNumStr, "已到货数量");
|
||||
double totalNum=KUtil.getDoubleFromString(totalNumStr, "数量");
|
||||
if(wiredNum>=arrivedNum) {
|
||||
MessageBox.post(PipingLinePlanningManagementDialog.this,"无法提交,需满足条件:“已配管线数量”<“已到货数量”","提示",MessageBox.WARNING);
|
||||
return;
|
||||
}
|
||||
//编辑本次配管线数量
|
||||
Object wiringNumStr=table.getValueAt(rows[0], WIRING_INDEX);
|
||||
double wiringNum=KUtil.getDoubleFromString(wiringNumStr, "本次配管线数量");
|
||||
double newNum=new PipingLinePlanningWiringDialog(wiringNum,wiredNum,arrivedNum).getWiringNum();
|
||||
if(newNum<=0) {
|
||||
System.out.println("未进行修改");
|
||||
return;
|
||||
}
|
||||
System.out.println("本次配管线数量:"+newNum);
|
||||
//修改属性
|
||||
int idx = Integer.parseInt(table.getValueAt(rows[0], 0).toString());
|
||||
TCComponentScheduleTask scheduTask = (TCComponentScheduleTask) allObjectMap1.get(idx - 1);
|
||||
wiredNum=wiredNum+newNum;
|
||||
CommonUtil.setByPass(true);
|
||||
scheduTask.setStringProperty("ysr8_WiringQuantity",fu.getDoubleString(newNum));// 本次配管线数量
|
||||
table.setValueAt(fu.getDoubleString(newNum), rows[0], WIRING_INDEX);
|
||||
scheduTask.setStringProperty("ysr8_WiredQuantity",fu.getDoubleString(wiredNum));// 已配管线数量
|
||||
table.setValueAt(fu.getDoubleString(wiredNum), rows[0], WIRED_INDEX);
|
||||
System.out.println("wiredNum:"+wiredNum+"&totalNum:"+totalNum);
|
||||
if(wiredNum==totalNum) {
|
||||
scheduTask.setStringProperty("ysr8_TaskManuState", "3");//已报检
|
||||
table.setValueAt("已报检", rows[0], TASKSTATE_INDEX);
|
||||
scheduTask.setDateProperty("ysr8_PurchFinishDate", new Date());//实际完成时间
|
||||
table.setValueAt(fu.getDateString(new Date()), rows[0], 17);
|
||||
completeTask(scheduTask);
|
||||
}else if(wiredNum<totalNum) {
|
||||
scheduTask.setStringProperty("ysr8_TaskManuState", "5");//分批
|
||||
table.setValueAt("分批", rows[0], TASKSTATE_INDEX);
|
||||
scheduTask.setDateProperty("ysr8_PurchFinishDate", new Date());//实际完成时间
|
||||
table.setValueAt(fu.getDateString(new Date()), rows[0], 17);
|
||||
}
|
||||
CommonUtil.setByPass(false);
|
||||
MessageBox.post(this, "报检成功!", "提示", MessageBox.INFORMATION);
|
||||
}
|
||||
|
||||
|
||||
private void completeTask(TCComponentScheduleTask scheduTask) throws Exception {
|
||||
scheduTask.setStringProperty("ysr8_TaskManuState", "3");
|
||||
TCComponent[] tasks = scheduTask.getRelatedComponents("fnd0ActuatedInteractiveTsks");
|
||||
if (tasks != null && tasks.length > 0) {
|
||||
TCComponent task1 = null;
|
||||
TCComponent task2 = null;
|
||||
for (int i = 0; i < tasks.length; i++) {
|
||||
TCComponent task = tasks[i];
|
||||
String object_type = task.getProperty("object_type");
|
||||
System.out.println("object_type object_name1======" + task.getUid() + "======" + task.getProperty("object_type") + "======" + task.getProperty("object_name"));
|
||||
if (object_type.equals("Signoff")) {
|
||||
task1 = task;
|
||||
} else if (object_type.equals("“认可”任务")) {
|
||||
task2 = task;
|
||||
}
|
||||
}
|
||||
if (task1 != null && task2 != null) {
|
||||
TCComponent[] childTasks = task2.getRelatedComponents("child_tasks");
|
||||
if (childTasks != null && childTasks.length > 0) {
|
||||
for (int j = 0; j < childTasks.length; j++) {
|
||||
TCComponent childTask = childTasks[j];
|
||||
String childObject_type = childTask.getProperty("object_type");
|
||||
System.out.println("object_type object_type2======" + childTask.getUid() + "======" + childTask.getProperty("object_type") + "======" + childTask.getProperty("object_name"));
|
||||
if (childObject_type.equals("执行签发任务")) {
|
||||
// kk 已完成任务直接将任务状态改为 已报检
|
||||
TCComponentTask targetTask = (TCComponentTask) childTask;
|
||||
String taskState = targetTask.getProperty("fnd0state");
|
||||
System.out.println("任务状态: " + taskState);
|
||||
if (!taskState.equals("完成")) {
|
||||
System.out.println("代码自动完成");
|
||||
TCComponentUser curUser = fu.session.getUser();
|
||||
TCComponent userBox =curUser.getReferenceProperty("userinbox");
|
||||
TCComponent taskBox = curUser.getReferenceProperty("taskinbox");
|
||||
System.out.println(taskBox);
|
||||
DataManagementService service=DataManagementService.getService(fu.session);
|
||||
service.refreshObjects(new TCComponent[] {taskBox,userBox});
|
||||
taskBox.refresh();
|
||||
userBox.refresh();
|
||||
System.out.println(childTask);
|
||||
|
||||
targetTask.performTaskAction(106, "代码自动完成", "", "认可", task1, null, null);
|
||||
|
||||
} else {
|
||||
System.out.println("跳过自动完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateValues(HashMap<String, String> tableMap) {
|
||||
JTable table = (JTable) fu.allComponentMap.get("a.31.11.11");
|
||||
int rows[] = table.getSelectedRows();
|
||||
for(int i : rows) {
|
||||
for(Entry<String, String> e : tableMap.entrySet()) {
|
||||
if(e.getKey().equals("ysr8_WiringPerson")) {
|
||||
table.setValueAt(e.getValue(), i, 5);
|
||||
} else if(e.getKey().equals("ysr8_ManuFactory1")) {
|
||||
table.setValueAt(e.getValue(), i, 6);
|
||||
} else if(e.getKey().equals("ysr8_WiringStartDate")) {
|
||||
table.setValueAt(e.getValue(), i, START_INDEX);
|
||||
} else if(e.getKey().equals("ysr8_PurchPlanDate")) {
|
||||
table.setValueAt(e.getValue(), i, 16);
|
||||
} else if(e.getKey().equals("ysr8_GasWiring")) {
|
||||
table.setValueAt(e.getValue(), i, 18);
|
||||
} else if(e.getKey().equals("ysr8_CircuitWiring")) {
|
||||
table.setValueAt(e.getValue(), i, 19);
|
||||
} else if(e.getKey().equals("ysr8_Remark")) {
|
||||
table.setValueAt(e.getValue(), i, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private TCComponent[] Pipingsort(HashMap<TCComponent,Date> map) {
|
||||
int count = map.size();
|
||||
// 通过ArrayList构造函数把map.entrySet()转换成list
|
||||
List<Map.Entry<TCComponent, Date>> list = new ArrayList<Map.Entry<TCComponent, Date>>(map.entrySet());
|
||||
// 通过比较器实现比较排序
|
||||
Collections.sort(list, new Comparator<Map.Entry<TCComponent, Date>>() {
|
||||
public int compare(Map.Entry<TCComponent, Date> mapping1, Map.Entry<TCComponent, Date> mapping2) {
|
||||
// System.out.println(mapping1.getValue()+"=="+mapping2.getValue()+"--"+mapping1.getValue().compareTo(mapping2.getValue()));
|
||||
return mapping1.getValue().compareTo(mapping2.getValue());
|
||||
}
|
||||
});
|
||||
TCComponent[] TCComponent = new TCComponent[count];
|
||||
int i=0;
|
||||
for(Map.Entry<TCComponent, Date> mapping : list) {
|
||||
TCComponent[i] = mapping.getKey();
|
||||
i++;
|
||||
}
|
||||
return TCComponent;
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.kernel.TCComponentScheduleTask;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCProperty;
|
||||
import com.teamcenter.rac.util.DateButton;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.rac.util.iTextField;
|
||||
|
||||
import cn.com.ebewin.ysr.util.DialogUtil;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PipingLinePlanningManagementEditDialog extends AbstractAIFDialog {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private DialogUtil fu = new DialogUtil(this, "Åä¹ÜÏßÈÎÎñ±à¼", "YSR8_PipingLinePlanningManagementEditDialog");
|
||||
|
||||
private TCComponentScheduleTask scheduTask = null;
|
||||
private PipingLinePlanningManagementDialog ppmDialog;
|
||||
//private Boolean setArrivalState = false;
|
||||
|
||||
public PipingLinePlanningManagementEditDialog(PipingLinePlanningManagementDialog ppmDialog, TCComponentScheduleTask scheduTask) throws TCException {
|
||||
super(true);
|
||||
|
||||
this.ppmDialog = ppmDialog;
|
||||
this.scheduTask = scheduTask;
|
||||
|
||||
fu.initializeUI(ppmDialog.fu.session);
|
||||
centerToScreen();
|
||||
loadRendering();
|
||||
addActionListener();
|
||||
getDefVal();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void loadRendering() throws TCException {
|
||||
iTextField ysr8_WiringPerson = (iTextField)fu.allComponentMap.get("ysr8_WiringPerson");
|
||||
ysr8_WiringPerson.setText(scheduTask.getStringProperty("ysr8_WiringPerson"));
|
||||
JComboBox<String> ysr8_ManuFactory1 = (JComboBox<String>)fu.allComponentMap.get("ysr8_ManuFactory1");
|
||||
ysr8_ManuFactory1.setSelectedItem(scheduTask.getStringProperty("ysr8_ManuFactory1"));
|
||||
|
||||
/*DateButton ysr8_FixturePlanDate = (DateButton)fu.allComponentMap.get("ysr8_FixturePlanDate");
|
||||
if (!scheduTask.getTCProperty("ysr8_FixturePlanDate").isPropValueNull()) {
|
||||
System.out.println(ysr8_FixturePlanDate);
|
||||
ysr8_FixturePlanDate.setDate(scheduTask.getTCProperty("ysr8_FixturePlanDate").getDateValue());
|
||||
}
|
||||
|
||||
DateButton ysr8_PurchFinishDate = (DateButton)fu.allComponentMap.get("ysr8_PurchFinishDate");
|
||||
if (!scheduTask.getTCProperty("ysr8_PurchFinishDate").isPropValueNull()) {
|
||||
ysr8_PurchFinishDate.setDate(scheduTask.getTCProperty("ysr8_PurchFinishDate").getDateValue());
|
||||
}*/
|
||||
|
||||
DateButton ysr8_WiringStartDate = (DateButton)fu.allComponentMap.get("ysr8_WiringStartDate");
|
||||
if (!scheduTask.getTCProperty("ysr8_WiringStartDate").isPropValueNull()) {
|
||||
ysr8_WiringStartDate.setDate(scheduTask.getTCProperty("ysr8_WiringStartDate").getDateValue());
|
||||
}
|
||||
DateButton ysr8_PurchPlanDate = (DateButton)fu.allComponentMap.get("ysr8_PurchPlanDate");
|
||||
if (!scheduTask.getTCProperty("ysr8_PurchPlanDate").isPropValueNull()) {
|
||||
ysr8_PurchPlanDate.setDate(scheduTask.getTCProperty("ysr8_PurchPlanDate").getDateValue());
|
||||
}
|
||||
|
||||
iTextField ysr8_GasWiring = (iTextField)fu.allComponentMap.get("ysr8_GasWiring");
|
||||
ysr8_GasWiring.setText(scheduTask.getStringProperty("ysr8_GasWiring"));
|
||||
iTextField ysr8_CircuitWiring = (iTextField)fu.allComponentMap.get("ysr8_CircuitWiring");
|
||||
ysr8_CircuitWiring.setText(scheduTask.getStringProperty("ysr8_CircuitWiring"));
|
||||
iTextField ysr8_Remark = (iTextField)fu.allComponentMap.get("ysr8_Remark");
|
||||
ysr8_Remark.setText(scheduTask.getStringProperty("ysr8_Remark"));
|
||||
}
|
||||
|
||||
private void addActionListener() {
|
||||
JButton btn = (JButton)fu.allComponentMap.get("b.81.12");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
saveRendering();
|
||||
}
|
||||
});
|
||||
|
||||
btn = (JButton)fu.allComponentMap.get("b.81.14");
|
||||
btn.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
disposeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void saveRendering() {
|
||||
if (!checkCanSave()) {
|
||||
return;
|
||||
}
|
||||
|
||||
HashMap<String, String> valMap1 = new HashMap<String, String>();
|
||||
// HashMap<String, String> tableMap = new HashMap<String, String>();
|
||||
|
||||
iTextField ysr8_WiringPerson = (iTextField)fu.allComponentMap.get("ysr8_WiringPerson");
|
||||
valMap1.put("ysr8_WiringPerson", ysr8_WiringPerson.getText().toString());
|
||||
JComboBox<String> ysr8_ManuFactory1 = (JComboBox<String>)fu.allComponentMap.get("ysr8_ManuFactory1");
|
||||
valMap1.put("ysr8_ManuFactory1", ysr8_ManuFactory1.getSelectedItem().toString());
|
||||
|
||||
/*DateButton ysr8_FixturePlanDate = (DateButton)fu.allComponentMap.get("ysr8_FixturePlanDate");
|
||||
valMap1.put("ysr8_FixturePlanDate", fu.getDateString(ysr8_FixturePlanDate.getDate()));
|
||||
|
||||
DateButton ysr8_PurchFinishDate = (DateButton)fu.allComponentMap.get("ysr8_PurchFinishDate");
|
||||
valMap1.put("ysr8_PurchFinishDate", fu.getDateString(ysr8_PurchFinishDate.getDate()));
|
||||
*/
|
||||
DateButton ysr8_WiringStartDate = (DateButton)fu.allComponentMap.get("ysr8_WiringStartDate");
|
||||
valMap1.put("ysr8_WiringStartDate", fu.getDateString(ysr8_WiringStartDate.getDate()));
|
||||
DateButton ysr8_PurchPlanDate = (DateButton)fu.allComponentMap.get("ysr8_PurchPlanDate");
|
||||
valMap1.put("ysr8_PurchPlanDate", fu.getDateString(ysr8_PurchPlanDate.getDate()));
|
||||
|
||||
iTextField ysr8_GasWiring = (iTextField)fu.allComponentMap.get("ysr8_GasWiring");
|
||||
valMap1.put("ysr8_GasWiring", ysr8_GasWiring.getText().toString());
|
||||
iTextField ysr8_CircuitWiring = (iTextField)fu.allComponentMap.get("ysr8_CircuitWiring");
|
||||
valMap1.put("ysr8_CircuitWiring", ysr8_CircuitWiring.getText().toString());
|
||||
iTextField ysr8_Remark = (iTextField)fu.allComponentMap.get("ysr8_Remark");
|
||||
valMap1.put("ysr8_Remark", ysr8_Remark.getText().toString());
|
||||
|
||||
try {
|
||||
for(Entry<String,String> entry: valMap1.entrySet()){
|
||||
String key1 = entry.getKey();
|
||||
String key2 = entry.getValue();
|
||||
TCProperty property = (TCProperty)scheduTask.getTCProperty(key1);
|
||||
switch (property.getPropertyType()) {
|
||||
case TCProperty.PROP_string:
|
||||
case TCProperty.PROP_long_string:
|
||||
scheduTask.setStringProperty(key1, key2);
|
||||
break;
|
||||
case TCProperty.PROP_short:
|
||||
case TCProperty.PROP_int:
|
||||
scheduTask.setIntProperty(key1, Integer.parseInt(key2));
|
||||
break;
|
||||
case TCProperty.PROP_double:
|
||||
case TCProperty.PROP_float:
|
||||
scheduTask.setDoubleProperty(key1, Double.parseDouble(key2));
|
||||
break;
|
||||
case TCProperty.PROP_date:
|
||||
if (!key2.equals("")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = sdf.parse(key2);
|
||||
if (date != null) {
|
||||
scheduTask.setDateProperty(key1, date);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
scheduTask.setStringProperty(key1, key2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ppmDialog.updateValues(valMap1);
|
||||
disposeDialog();
|
||||
} catch (TCException ex) {
|
||||
ex.printStackTrace();
|
||||
MessageBox.post(ex);
|
||||
return;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
MessageBox.post(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void getDefVal() {
|
||||
fu.getDefVal();
|
||||
}
|
||||
|
||||
public boolean checkCanSave() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class PipingLinePlanningWiringDialog extends AbstractAIFDialog {
|
||||
private static final long serialVersionUID = -8956889736040215103L;
|
||||
private JButton okBtn;
|
||||
private JButton celBtn;
|
||||
public boolean isChanged = false;
|
||||
public String wiringNumStr = "";
|
||||
private JTextField wiringNumField;
|
||||
private double res=-1;
|
||||
private double wiredNum;
|
||||
private double arrivedNum;
|
||||
|
||||
public PipingLinePlanningWiringDialog(double wiringNum, double wiredNum, double arrivedNum) {
|
||||
super(true);
|
||||
this.res=wiringNum;
|
||||
this.wiringNumStr = wiringNum+"";
|
||||
this.wiredNum=wiredNum;
|
||||
this.arrivedNum=arrivedNum;
|
||||
}
|
||||
|
||||
public double getWiringNum() throws Exception {
|
||||
initUI();
|
||||
return res;
|
||||
}
|
||||
|
||||
private void initUI() throws Exception {
|
||||
this.setTitle("编辑");
|
||||
this.setLayout(new BorderLayout());
|
||||
this.setPreferredSize(new Dimension(300, 150));
|
||||
JPanel mainPanel = new JPanel(new GridBagLayout());
|
||||
GridBagConstraints s = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
|
||||
mainPanel.add(new JLabel("本次配管线数量:"), s);
|
||||
s.gridx++;
|
||||
this.wiringNumField = new JTextField();
|
||||
//wiringNumField.setText(wiringNumStr);
|
||||
s.weightx = 1;
|
||||
s.insets = new Insets(5, 0, 5, 5);
|
||||
mainPanel.add(wiringNumField, s);
|
||||
JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 15, 5));
|
||||
okBtn = new JButton("确定");
|
||||
celBtn = new JButton("取消");
|
||||
okBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
if(checkWiringNum()) {
|
||||
disposeDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
celBtn.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
disposeDialog();
|
||||
}
|
||||
});
|
||||
btnPanel.add(okBtn);
|
||||
btnPanel.add(celBtn);
|
||||
this.add(BorderLayout.CENTER, mainPanel);
|
||||
this.add(BorderLayout.SOUTH, btnPanel);
|
||||
this.showDialog();
|
||||
}
|
||||
|
||||
protected boolean checkWiringNum() {
|
||||
wiringNumStr = wiringNumField.getText();
|
||||
double wiringNum;
|
||||
if(!"".equals(wiringNumStr)) {
|
||||
try {
|
||||
wiringNum=Double.parseDouble(wiringNumStr);
|
||||
} catch (NumberFormatException e) {
|
||||
MessageBox.post(PipingLinePlanningWiringDialog.this,"请填写正确的数字","提示",MessageBox.WARNING);
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
MessageBox.post(PipingLinePlanningWiringDialog.this,"请填写本次配管线数量","提示",MessageBox.WARNING);
|
||||
return false;
|
||||
}
|
||||
if(wiringNum<=0) {
|
||||
MessageBox.post(PipingLinePlanningWiringDialog.this,"请填写大于0的数量","提示",MessageBox.WARNING);
|
||||
return false;
|
||||
}
|
||||
if(wiringNum>(arrivedNum-wiredNum)) {
|
||||
MessageBox.post(PipingLinePlanningWiringDialog.this,"配管线数量不可大于(“已到货数量”-“已配管线数量”)","提示",MessageBox.WARNING);
|
||||
return false;
|
||||
}
|
||||
this.res=wiringNum;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import javax.swing.JTable;
|
||||
import cn.com.ebewin.ysr.util.TableColorRender;
|
||||
|
||||
public class ProblemBoardDialogTableColorRender extends TableColorRender {
|
||||
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
Component renderer = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
||||
|
||||
try {
|
||||
if (column == 16) {
|
||||
String result = table.getValueAt(row, 42).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}else if (column == 19) {
|
||||
String result = table.getValueAt(row, 45).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}else if (column == 22) {
|
||||
String result = table.getValueAt(row, 48).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}else if (column == 32) {
|
||||
String result = table.getValueAt(row, 52).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}else if (column == 25) {
|
||||
String result = table.getValueAt(row, 54).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}else if (column == 28) {
|
||||
String result = table.getValueAt(row, 57).toString();
|
||||
if(result.equals("NG"))
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
/*if (column == 15) {
|
||||
String ysr8_TechPlanDateVal = table.getValueAt(row, 15).toString();
|
||||
if(ysr8_TechPlanDateVal.equals("-"))
|
||||
return renderer;
|
||||
String ysr8_TechFinishDateVal = table.getValueAt(row, 16).toString();
|
||||
if (!ysr8_TechFinishDateVal.equals("-") && !ysr8_TechPlanDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, ysr8_TechFinishDateVal);
|
||||
System.out.println("ysr8_TechFinishDateVal-ysr8_TechPlanDateVal====" + ysr8_TechFinishDateVal
|
||||
+ "====" + ysr8_TechPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_TechPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_TechPlanDateVal====" + currDate + "====" + ysr8_TechPlanDateVal
|
||||
+ "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 18) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String ysr8_TechPlanDateVal = table.getValueAt(row, 15).toString();
|
||||
String ysr8_TechFinishDateVal = table.getValueAt(row, 16).toString();
|
||||
String ysr8_PurchPlanDateVal = table.getValueAt(row, 18).toString();
|
||||
if(ysr8_PurchPlanDateVal.equals("-"))
|
||||
return renderer;
|
||||
String ysr8_PurchFinishDateVal = table.getValueAt(row, 19).toString();
|
||||
|
||||
//TODO 采购计划时间顺延
|
||||
Calendar c = Calendar.getInstance();
|
||||
if(!ysr8_PurchPlanDateVal.equals("-") && !ysr8_TechPlanDateVal.equals("-") && !ysr8_TechFinishDateVal.equals("-")) {
|
||||
int techDay = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, ysr8_TechFinishDateVal);
|
||||
if (techDay > 0) {
|
||||
c.setTime(sdf.parse(ysr8_PurchPlanDateVal));
|
||||
c.add(Calendar.DAY_OF_MONTH, techDay);
|
||||
ysr8_PurchPlanDateVal = sdf.format(c.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (!ysr8_PurchPlanDateVal.equals("-") && !ysr8_PurchFinishDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_PurchPlanDateVal, ysr8_PurchFinishDateVal);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_PurchPlanDateVal====" + ysr8_PurchFinishDateVal
|
||||
+ "====" + ysr8_PurchPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_PurchPlanDateVal.equals("-") || ysr8_TechFinishDateVal.equals("-")&&!ysr8_TechPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_PurchPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_PurchPlanDateVal
|
||||
+ "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 21) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String ysr8_TechPlanDateVal = table.getValueAt(row, 15).toString();
|
||||
String ysr8_TechFinishDateVal = table.getValueAt(row, 16).toString();
|
||||
String ysr8_MachinPlanDateVal = table.getValueAt(row, 21).toString();
|
||||
if(ysr8_MachinPlanDateVal.equals("-"))
|
||||
return renderer;
|
||||
String ysr8_MachinFinishDateVal = table.getValueAt(row, 22).toString();
|
||||
|
||||
//TODO 加工计划时间顺延
|
||||
Calendar c = Calendar.getInstance();
|
||||
if(!ysr8_MachinPlanDateVal.equals("-") && !ysr8_TechPlanDateVal.equals("-") && !ysr8_TechFinishDateVal.equals("-")) {
|
||||
int techDay = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, ysr8_TechFinishDateVal);
|
||||
if (techDay > 0) {
|
||||
c.setTime(sdf.parse(ysr8_MachinPlanDateVal));
|
||||
c.add(Calendar.DAY_OF_MONTH, techDay);
|
||||
ysr8_MachinPlanDateVal = sdf.format(c.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (!ysr8_MachinPlanDateVal.equals("-") && !ysr8_MachinFinishDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_MachinPlanDateVal, ysr8_MachinFinishDateVal);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_MachinPlanDateVal====" + ysr8_MachinFinishDateVal
|
||||
+ "====" + ysr8_MachinPlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_MachinPlanDateVal.equals("-") || ysr8_TechFinishDateVal.equals("-")&&!ysr8_TechPlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_MachinPlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_MachinPlanDateVal
|
||||
+ "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (column == 25) {
|
||||
String ysr8_EnginePlanDateVal = table.getValueAt(row, 25).toString();
|
||||
if(ysr8_EnginePlanDateVal.equals("-"))
|
||||
return renderer;
|
||||
String ysr8_FinishDateVal = table.getValueAt(row, 26).toString();
|
||||
String ysr8_TechPlanDateVal = table.getValueAt(row, 15).toString();
|
||||
String ysr8_PurchPlanDateVal = table.getValueAt(row, 18).toString();
|
||||
String ysr8_MachinPlanDateVal = table.getValueAt(row, 21).toString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//TODO
|
||||
Calendar c = Calendar.getInstance();
|
||||
if(!ysr8_MachinPlanDateVal.equals("-")) {
|
||||
String ysr8_MachinFinishDateVal = table.getValueAt(row, 22).toString();
|
||||
if(!ysr8_MachinFinishDateVal.equals("-")) {
|
||||
int techDay = CommonUtil.getDaysBetween(ysr8_MachinPlanDateVal, ysr8_MachinFinishDateVal);
|
||||
if (techDay > 0) {
|
||||
c.setTime(sdf.parse(ysr8_EnginePlanDateVal));
|
||||
c.add(Calendar.DAY_OF_MONTH, techDay);
|
||||
ysr8_EnginePlanDateVal = sdf.format(c.getTime());
|
||||
}
|
||||
}
|
||||
}else if(!ysr8_PurchPlanDateVal.equals("-")) {
|
||||
String ysr8_PurchFinishDateVal = table.getValueAt(row, 19).toString();
|
||||
if(!ysr8_PurchFinishDateVal.equals("-")) {
|
||||
int techDay = CommonUtil.getDaysBetween(ysr8_PurchPlanDateVal, ysr8_PurchFinishDateVal);
|
||||
if (techDay > 0) {
|
||||
c.setTime(sdf.parse(ysr8_EnginePlanDateVal));
|
||||
c.add(Calendar.DAY_OF_MONTH, techDay);
|
||||
ysr8_EnginePlanDateVal = sdf.format(c.getTime());
|
||||
}
|
||||
}
|
||||
}else if(!ysr8_TechPlanDateVal.equals("-")) {
|
||||
String ysr8_TechFinishDateVal = table.getValueAt(row, 16).toString();
|
||||
if(!ysr8_TechFinishDateVal.equals("-")) {
|
||||
int techDay = CommonUtil.getDaysBetween(ysr8_TechPlanDateVal, ysr8_TechFinishDateVal);
|
||||
if (techDay > 0) {
|
||||
c.setTime(sdf.parse(ysr8_EnginePlanDateVal));
|
||||
c.add(Calendar.DAY_OF_MONTH, techDay);
|
||||
ysr8_EnginePlanDateVal = sdf.format(c.getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ysr8_EnginePlanDateVal.equals("-") && !ysr8_FinishDateVal.equals("-")) {
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_EnginePlanDateVal, ysr8_FinishDateVal);
|
||||
System.out.println("ysr8_PurchFinishDateVal-ysr8_EnginePlanDateVal====" + ysr8_FinishDateVal
|
||||
+ "====" + ysr8_EnginePlanDateVal + "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
if (ysr8_EnginePlanDateVal.equals("-")) {
|
||||
//renderer.setBackground(Color.RED);
|
||||
} else {
|
||||
String currDate = sdf.format(new Date());
|
||||
int nday = CommonUtil.getDaysBetween(ysr8_EnginePlanDateVal, currDate);
|
||||
System.out.println("currDate-ysr8_PurchPlanDateVal====" + currDate + "====" + ysr8_EnginePlanDateVal
|
||||
+ "====" + nday);
|
||||
if (nday > 0) {
|
||||
renderer.setBackground(Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return renderer;
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package cn.com.ebewin.ysr.dialog;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JProgressBar;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ProgressReporterDialog extends AbstractAIFDialog
|
||||
{
|
||||
|
||||
private JLabel messageLabel;
|
||||
|
||||
private JProgressBar progressBar;
|
||||
|
||||
private boolean requestCanceling;
|
||||
|
||||
private int percent;
|
||||
|
||||
public ProgressReporterDialog()
|
||||
{
|
||||
super(false);
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
setAlwaysOnTop(true);
|
||||
|
||||
initializeComponents();
|
||||
setTextPropertyForComponents();
|
||||
registerComponentsListeners();
|
||||
addComponents();
|
||||
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
}
|
||||
|
||||
private void initializeComponents()
|
||||
{
|
||||
messageLabel = new JLabel(" ", JLabel.LEFT);
|
||||
progressBar = new JProgressBar();
|
||||
}
|
||||
|
||||
private void setTextPropertyForComponents()
|
||||
{
|
||||
setTitle("½ø¶È");
|
||||
}
|
||||
|
||||
private void registerComponentsListeners()
|
||||
{
|
||||
}
|
||||
|
||||
private void addComponents()
|
||||
{
|
||||
add(messageLabel, BorderLayout.NORTH);
|
||||
add(progressBar, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
private void centerToClientScreen()
|
||||
{
|
||||
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
int x = screen.width - getWidth();
|
||||
int y = screen.height - getHeight();
|
||||
|
||||
setLocation(x / 2, y / 2);
|
||||
}
|
||||
|
||||
public void reportProgressMessage(String message)
|
||||
{
|
||||
messageLabel.setText(message);
|
||||
}
|
||||
|
||||
public void setProgressPercent(int percent)
|
||||
{
|
||||
this.percent = percent;
|
||||
}
|
||||
|
||||
public void requestCanceling()
|
||||
{
|
||||
requestCanceling = true;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
pack();
|
||||
setSize(400, getHeight());
|
||||
centerToClientScreen();
|
||||
setVisible(true);
|
||||
|
||||
while (!requestCanceling)
|
||||
{
|
||||
if(percent > progressBar.getMaximum())
|
||||
{
|
||||
percent = 0;
|
||||
}
|
||||
|
||||
progressBar.setValue(percent);
|
||||
|
||||
percent += 5;
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(100);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
dispose();
|
||||
}
|
||||
|
||||
public int getProgess()
|
||||
{
|
||||
return progressBar.getValue();
|
||||
}
|
||||
|
||||
public boolean isRequestCanceling()
|
||||
{
|
||||
return requestCanceling;
|
||||
}
|
||||
}
|