Commit aee8ec8f authored by zhh's avatar zhh

江边项目源码更新 2022-07-19 21:00

parent c63b2e24
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/businessobjects/classes"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/classes"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/ant.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/api-client.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/api-dep.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/api-dl.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/aspectjweaver.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/aws-java-sdk-core-1.11.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/aws-java-sdk-kms-1.11.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/aws-java-sdk-s3-1.11.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/axis.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/axis2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/axis-ant.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/balloontip-1.2.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/batik-constants-1.9.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/batik-css-1.9.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/batik-i18n-1.9.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/batik-util-1.9.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/bcel-5.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/cognos-axis.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/cognosClient.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/com.ibm.ws.admin.core.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/com.ibm.ws.admin.services.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/com.ibm.ws.emf_2.1.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/com.ibm.ws.runtime.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-codec.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-codec-1.9.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-collections4-4.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-discovery.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-httpclient.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-io-2.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-logging-1.1.3.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-net-1.4.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/commons-pool-1.5.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/contentloader.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/CTGPAEConfiguration.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/db2jcc.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/db2jcc_license_cu.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/decompat.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/docloud_api_java_client-1.0-STABLE-b221.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/docloud_api_java_client-1.0-STABLE-b277.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/docloud_api_java_client-1.0-STABLE-b277-javadoc.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/edm-server.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/freemarker-2.3.22.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/GroupDocs.Conversion.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/gson-2.2.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpclient-4.2.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpclient-4.5.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpcore-4.2.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpcore-4.4.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpmime-4.2.5.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/httpmime-4.5.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/icl.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/icu4j.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/iri-0.8.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/j2ee.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jackson-annotations-2.8.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jackson-core-2.8.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jackson-core-asl-1.9.13.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jackson-databind-2.8.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jaws.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jaxen-1.1-beta-8.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jaxrpc.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jdom.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jena-2.6.3-patched.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jhbasic-2.0_05.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/joda-time-2.8.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/json4j.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/json-20140107.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jsr181.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jviews-chart.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jviews-diagrammer.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jviews-framework-lib.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jviews-gantt.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/jython.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/LAPApp.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/ldapbp.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/ldapnov.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/lowagie.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/maxcom.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/maximo_client.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/maximo_registry.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/nekohtml-1.9.22.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oal-api.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oal-common.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oauth.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/odmeall.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oplall.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oraclethin.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/oslcquery.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/platform-model.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/poi-3.8-20120326.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/poi-excelant-3.8-20120326.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/pop3.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/remoteaccess.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/saaj.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/sdb-1.3.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/slf4j-api-1.6.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/slf4j-log4j12-1.6.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/soap.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/sqljdbc.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/ssh.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/tdb-0.8.7-patched.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/tools.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/wsdl4j.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/lib/xmlbeans-2.3.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/cms.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/COMMON.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-collections-3.2.2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-httpclient-3.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-lang-2.3.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/DCS.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/DIS.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/ezmorph-1.0.6.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/icl.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/isclite.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/iscportal.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/jaxen-1.1-beta-9.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/jdom-1.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/json-lib-2.2.3-jdk15.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/mail-1.4.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/METADATA.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/MxCMSClient.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/NRS.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/smack.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/spring-1.2.6.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/ssce.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/stax-api-1.0.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/stax-utils-20040917.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/stjavatk.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/WsaEJBDeployUtility.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/wsdl4j-1.6.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/wss4j-1.5.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/wstx-asl-3.2.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xbean-spring-2.8.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xfire-all-1.2.6.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xfire-jsr181-api-1.0-M1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xml-apis-1.0.b2.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/XmlSchema-1.1.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xmlsec-1.3.0.jar"/>
<classpathentry kind="lib" path="D:/SMP/maximojb/maximo/maximouiweb/webmodule/WEB-INF/lib/xp.jar"/>
<classpathentry kind="lib" path="jxl.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>maximoJB</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
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.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
File added
File added
File added
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Test {
public static void main(String[] args) {
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd");
Date date=new Date();
Calendar c=Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_MONTH, 1); //һ
System.out.println(sdf.format(c.getTime()));;
}
}
import java.text.SimpleDateFormat;
import java.util.Date;
public class Test2 {
public static void main(String[] args) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String d=sdf.format(new Date());
System.out.println(d +" 23:00:00");
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package clp.app.custapp;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueInfo;
import psdi.util.MXException;
public class UDCustomMbo extends Mbo implements UDCustomMboRemote {
private String appName = "";
public UDCustomMbo(MboSet ms) throws RemoteException {
super(ms);
}
public void init() throws MXException {
MboRemote owner = this.getOwner();
if (owner != null) {
try {
if (owner.getThisMboSet().getApp() != null) {
this.appName = owner.getThisMboSet().getApp();
}
} catch (RemoteException var3) {
var3.printStackTrace();
}
}
super.init();
}
public void add() throws MXException, RemoteException {
MboRemote owner = this.getOwner();
if (owner != null && !"".equals(this.appName) && this.appName != null) {
Map<String, String> attrMap = this.getParentInfo(owner.getName());
Set<Entry<String, String>> Attrs = attrMap.entrySet();
Iterator var4 = Attrs.iterator();
while(var4.hasNext()) {
Entry<String, String> attr = (Entry)var4.next();
String childColumn = (String)attr.getKey();
String parentColumn = (String)attr.getValue();
this.setValue(childColumn, owner.getString(parentColumn));
}
}
super.add();
}
public Map<String, String> getParentInfo(String parentmboName) throws RemoteException, MXException {
String pName = "";
String cName = "";
Map<String, String> attrMap = new HashMap();
MboSetRemote relationShipSet = this.getMboSet("$relation", "MAXRELATIONSHIP", " parent = '" + parentmboName + "' and child='" + this.getName() + "' and REMARKS ='app-" + this.appName.toUpperCase() + "'");
if (relationShipSet.count() > 0) {
MboRemote relationMbo = relationShipSet.getMbo(0);
String sqlWhere = relationMbo.getString("WHERECLAUSE");
String[] columnSet = sqlWhere.split(" ");
for(int i = 0; i < columnSet.length; ++i) {
String columns = columnSet[i];
if (columns.indexOf(":") > -1) {
String[] _columns = columns.split("=");
for(int j = 0; j < _columns.length; ++j) {
String column = _columns[j];
if (column.startsWith(":")) {
column = column.substring(1, column.length());
pName = column;
} else {
cName = column;
}
}
attrMap.put(cName, pName);
}
}
}
return attrMap;
}
public MboRemote duplicate() throws MXException, RemoteException {
return this.copy();
}
protected boolean skipCopyField(MboValueInfo mvi) throws RemoteException, MXException {
return !mvi.getAttributeName().equalsIgnoreCase("SITEID") && !mvi.getAttributeName().equalsIgnoreCase("ORGID") && mvi.isKey();
}
}
package clp.app.custapp;
public class a {
public static void main(String[] args) {
String s="aaaa";
String [] ss=s.split(",");
for (int i = 0; i < ss.length; i++) {
System.out.println(ss[i]);
}
}
}
package clp.app.location;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Properties;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldCustDesc extends MboValueAdapter
{
MboRemote mbo = null;
int length = 2;
public FldCustDesc(MboValue mbv) {
super(mbv);
this.mbo = getMboValue().getMbo();
try {
this.length = Integer.parseInt(MXServer.getMXServer().getConfig().getProperty("clp.locdesc.length", ""));
}
catch (NumberFormatException e) {
e.printStackTrace();
}
catch (RemoteException e) {
e.printStackTrace();
}
}
public void initValue() throws RemoteException, MXException
{
super.initValue();
this.mbo.setValue("custdesc", getCustDesc(this.length), 2L);
}
private String getCustDesc(int level) throws RemoteException, MXException {
StringBuilder custdesc = new StringBuilder();
ArrayList custdescList = new ArrayList();
custdescList.add(this.mbo.getString("description"));
String parent = "";
String tmp = null;
for (int i = 0; i < level; i++) {
parent = parent + "LOCATION_PARENT.";
tmp = this.mbo.getString(parent + "description");
if ((tmp == null) || (tmp.length() <= 0)) break;
custdescList.add(tmp);
}
for (int index = custdescList.size() - 1; index >= 0; index--) {
custdesc.append((String)custdescList.get(index));
if (index != 0) {
custdesc.append(" \\ ");
}
}
return custdesc.toString();
}
}
\ No newline at end of file
package clp.app.po;
import java.io.PrintStream;
import java.rmi.RemoteException;
import java.util.HashSet;
import psdi.app.po.PO;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.security.ProfileRemote;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CLPPO extends PO
implements CLPPORemote
{
private static HashSet<String> skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
public CLPPO(MboSet paramMboSet) throws MXException, RemoteException {
super(paramMboSet);
}
public void init() throws MXException {
super.init();
try {
String status = getString("status");
String[] as = { "DESCRIPTION" };
if (isNew()) {
return;
}
if (getUserName().equalsIgnoreCase("maxadmin")) {
return;
}
if ((getString("custenterby").equalsIgnoreCase(getUserName())) && (status.equals("WAPPR"))) {
return;
}
setFieldFlag(as, 7L, true);
MboSetRemote POLINE = getMboSet("POLINE");
MboSetRemote wfment = getMboSet("$wfassignment", "wfassignment",
"ownerid='" + getInt("poid") + "' and assignstatus='ACTIVE' and assigncode='" +
getUserInfo().getPersonId().toUpperCase() + "' and ownertable='" + getName().toUpperCase() +
"'");
int i = wfment.count();
if (i > 0) {
setFieldFlag(as, 7L, false);
POLINE.setFlag(7L, false);
}
} catch (RemoteException localRemoteException) {
}
}
public void add() throws MXException, RemoteException {
super.add();
if (("SPO".equals(getThisMboSet().getApp())) || ("SPO".equals(getThisMboSet().getParentApp()))) {
setValue("custyylb", "SPO", 11L);
}
else
{
setValue("custyylb", "PO", 11L);
}
setValue("custenterby", getUserInfo().getUserName(), 11L);
setValue("custenterdate", MXServer.getMXServer().getDate(), 11L);
if (getString("CUSTENTERBY.DEPARTMENT").equalsIgnoreCase(""))
return;
setValue("CUSTDEPT", getString("CUSTENTERBY.DEPARTMENT"), 11L);
}
public MboRemote createPOLineFromPR(MboRemote paramMboRemote1, MboRemote paramMboRemote2, MboSetRemote paramMboSetRemote) throws MXException, RemoteException
{
MboRemote localMboRemote = super.createPOLineFromPR(paramMboRemote1, paramMboRemote2, paramMboSetRemote);
localMboRemote.setValue("PL3", paramMboRemote2.getString("RL3"), 11L);
localMboRemote.setValue("PL2", paramMboRemote2.getString("RL2"), 11L);
localMboRemote.setValue("custdept", paramMboRemote2.getString("custdept"), 11L);
return localMboRemote;
}
public void selectVenQuo(MboSetRemote mbosetremote) throws MXException, RemoteException {
String[] as = { "itemnum", "RFQLINENUM", "ORDERQTY", "UNITCOST", "LINECOST", "ORDERUNIT", "MEMO", "linetype",
"description", "itemsetid", "CUSTDEPT" };
String[] as1 = { "itemnum", "POLINENUM", "ORDERQTY", "UNITCOST", "LINECOST", "ORDERUNIT", "REMARK", "linetype",
"description", "itemsetid", "CUSTDEPT" };
MboSetRemote mbosetremote1 = getMboSet("poline");
mbosetremote1.copy(mbosetremote, as, as1);
mbosetremote1.save();
}
public void getCustCode(String prtype, String year) throws MXException, RemoteException {
int count = 1;
int tmpNum1 = 0;
String custhtbh = null;
String siteid = getProfile().getDefaultSite();
String code = "JB-" + year + "-" + prtype + "-";
synchronized (this) {
MboSetRemote prSet = getMboSet("$po", "po",
"custhtbh=(select custhtbh from po,(select '%'+max(SUBSTRING(custhtbh,11,3)) b from po where siteid='" +
siteid + "')a where siteid='" + siteid + "' and custhtbh like a.b)");
System.out.println(
"custhtbh=(select custhtbh from po,(select '%'+max(SUBSTRING(custhtbh,11,3)) b from po where siteid='" +
siteid + "')a where siteid='CLP-JB-JBZB' and custhtbh like a.b)");
System.out.println("************* " + prSet.count());
if (prSet.count() == 1) {
MboRemote pr = prSet.getMbo(0);
tmpNum1 = Integer.parseInt(pr.getString("custhtbh").substring(11, 13));
System.out.println("------ tmpNum1 -----" + tmpNum1);
count = tmpNum1 + 1;
custhtbh = getMatId(code, count);
setValue("custhtbh", custhtbh, 11L);
} else {
setValue("custhtbh", code + "001", 11L);
}
}
}
private String getMatId(String code, int count) {
String num = getCharacterCountStringValue(count, 3);
return code + num;
}
private String getCharacterCountStringValue(int count, int maxDigit) {
int length = String.valueOf(count).length();
return getZeroString(maxDigit - length) + count;
}
private String getZeroString(int num) {
String zero = "";
for (int i = 0; i < num; i++)
zero = zero + "0";
return zero;
}
@Override
public MboRemote revisePO(String arg0, boolean arg1) throws MXException,
RemoteException {
setValue("POTYPE","CHG",11L);
return super.revisePO(arg0, arg1);
}
@Override
public MboRemote revisePO() throws MXException, RemoteException {
setValue("POTYPE","CHG",11L);
return super.revisePO();
}
@Override
public MboRemote revisePO(String revDescription) throws MXException,
RemoteException {
System.out.println("޶po ----1");
setValue("POTYPE","CHG",11L);
return super.revisePO(revDescription);
}
}
\ No newline at end of file
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package clp.app.rfq;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import psdi.app.rfq.RFQ;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CLPRFQ extends RFQ implements CLPRFQRemote {
private static final long serialVersionUID = 1L;
public CLPRFQ(MboSet paramMboSet) throws MXException, RemoteException {
super(paramMboSet);
}
public void init() throws MXException {
super.init();
try {
System.out.println("初始化--");
if (this.getString("siteid").equals("CLP-YN-YE")) {
this.setFieldFlag("CUSTDEPT", 7L, true);
}
String status = this.getString("status");
String[] as = new String[]{"DESCRIPTION", "CUSTSQLY", "PRIORITY", "REQUIREDDATE", "CUSTGKBM", "CURRENCYCODE"};
String[] as1 = new String[]{"CUSTZBRQ"};//招标日期
if (this.isNew()) {
return;
}
if (this.getUserName().equalsIgnoreCase("yeadmin") || this.getUserName().equalsIgnoreCase("hjadmin")) {
return;
}
if (this.getString("ENTERBY").equalsIgnoreCase(this.getUserName()) && status.equals("INPRG")) {
return;
}
this.setFieldFlag(as, 7L, false);
MboSetRemote RFQLINE = this.getMboSet("RFQLINE");
RFQLINE.setFlag(7L, true);
MboSetRemote wfment = this.getMboSet("$wfassignment", "wfassignment", "ownerid='" + this.getInt("rfqid") + "' and assignstatus='ACTIVE' and assigncode='" + this.getUserInfo().getPersonId().toUpperCase() + "' and ownertable='" + this.getName().toUpperCase() + "'");
int i = wfment.count();
if (i > 0) {
this.setFieldFlag(as, 7L, false);
this.setFieldFlag("CUSTTJGYS", 7L, false);
this.setFieldFlag("CUSTTJYY", 7L, false);
RFQLINE.setFlag(7L, false);
}
String personId = getUserInfo().getPersonId();
MXServer mxServer = MXServer.getMXServer();
MboSetRemote personSet = mxServer.getMboSet("GROUPUSER", getUserInfo());
personSet.setWhere(" userid='" + personId + "'");
for (int j = 0; j < personSet.count(); j++) {
MboRemote team = personSet.getMbo(j);
if (team.getString("groupname").equalsIgnoreCase("CLPJB15")) {
System.out.println("进入了商务控制!!");
setFlag(7L, false);
return;
}
}
} catch (RemoteException var6) {
}
}
public void add() throws MXException, RemoteException {
super.add();
if (this.getString("siteid").equals("CLP-YN-YE")) {
this.setValue("CUSTDEPT", "CLPYE", 2L);
} else if (this.getString("siteid").equals("CLP-HY-BX")) {
this.setValue("CUSTDEPT", "CLPHY", 2L);
} else if (this.getString("siteid").equals("CLP-JB-JBZB")) {
this.setValue("CUSTDEPT", this.getString("ENTERBY.DEPARTMENT"), 11L);
}
}
public void save() throws MXException, RemoteException {
super.save();
}
public void createRFQLineFromPR(MboRemote paramMboRemote1, MboRemote paramMboRemote2) throws MXException, RemoteException {
super.createRFQLineFromPR(paramMboRemote1, paramMboRemote2);
this.getMboSet("RFQLINE").setValue("custdept", paramMboRemote2.getString("custdept"), 11L);
this.getMboSet("RFQLINE").setValue("unitcost", paramMboRemote2.getString("unitcost"), 11L);
this.getMboSet("RFQLINE").setValue("linecost", paramMboRemote2.getString("linecost"), 11L);
}
public void getCustCode(String prtype, String year) throws MXException, RemoteException {
int count = 1;
int tmpNum1 = 0;
String custcode = null;
String siteid = this.getProfile().getDefaultSite();
String code = "JB-TR-" + year + "-" + prtype + "-";
synchronized(this) {
MboSetRemote prSet = this.getMboSet("$rfq", "rfq", "custcode=(select custcode from rfq,(select '%'+max(SUBSTRING(custcode,14,3)) b from rfq where siteid='" + siteid + "')a where custcode like a.b)");
System.out.println("custcode=(select custcode from rfq,(select '%'+max(SUBSTRING(custcode,14,3)) b from rfq where siteid='" + siteid + "')a where custcode like a.b)");
if (prSet.count() == 1) {
MboRemote pr = prSet.getMbo(0);
tmpNum1 = Integer.parseInt(pr.getString("custcode").substring(14, 16));
count = tmpNum1 + 1;
custcode = this.getMatId(code, count);
this.setValue("custcode", custcode, 11L);
} else {
this.setValue("custcode", code + "001", 11L);
}
}
}
private String getMatId(String code, int count) {
String num = this.getCharacterCountStringValue(count, 3);
return code + num;
}
private String getCharacterCountStringValue(int count, int maxDigit) {
int length = String.valueOf(count).length();
return this.getZeroString(maxDigit - length) + count;
}
private String getZeroString(int num) {
String zero = "";
for(int i = 0; i < num; ++i) {
zero = zero + "0";
}
return zero;
}
public void initFieldFlagsOnMbo(String attrName) throws MXException {
super.initFieldFlagsOnMbo(attrName);
try {
if (this.getString("siteid").equals("CLP-JB-JBZB") && this.getInternalStatus().equals("SENT") && this.getString("status").equals("WAPPR3")) {
this.setFieldFlag("custcode", 7L, false);
this.setFieldFlag("CUSTTYPE", 7L, false);
}
} catch (RemoteException var3) {
var3.printStackTrace();
}
}
}
package clp.app.workorder;
import java.rmi.RemoteException;
import java.util.Date;
import psdi.app.financial.FinancialServiceRemote;
import psdi.app.workorder.WO;
import psdi.app.workorder.WORemote;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.AppService;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.MXSession;
public class CLPCustWO extends WO
implements WORemote
{
public CLPCustWO(MboSet ms)
throws MXException, RemoteException
{
super(ms);
}
public void init() throws MXException {
super.init();
try {
if (getString("wopriority").equalsIgnoreCase("4")) {
setFieldFlag("fcg_priority", 7L, false);
} else {
setValue("fcg_priority", "", 2L);
setFieldFlag("fcg_priority", 7L, true);
}
if (isNew()) {
return;
}
String s_username = getUserName();
if (s_username.equalsIgnoreCase("maxadmin")) {
return;
}
long l_workorderid = getLong("workorderid");
MboSetRemote msr_instance = getMboSet("$instance", "WFINSTANCE", "ownertable='WORKORDER' and ownerid='" + l_workorderid + "' and active = 1");
if (msr_instance.isEmpty())
return;
String sqlexp = "ownerid='" + l_workorderid + "' and ownertable='WORKORDER' and assignstatus='ACTIVE' and assigncode='" + s_username + "'";
MboSetRemote mbosetremote = getMboSet("$assigncode", "WFASSIGNMENT", sqlexp);
if (!mbosetremote.isEmpty()) {
return;
}
String[] as = { "WONUM", "description", "LOCATION", "ASSETNUM", "FCG_SPECIALITY", "GLACCOUNT", "LEAD", "SUPERVISOR", "WORKTYPE", "FAILURECODE", "REPORTDATE", "PARENT", "PARENTCHGSSTATUS",
"VENDOR", "JPNUM", "PMNUM", "CONTRACT", "ASSETLOCPRIORITY", "WOPRIORITY", "FCG_PRIORITY", "JUSTIFYPRIORITY", "INTERRUPTIBLE", "FCG_GZZRS", "TARGSTARTDATE", "TARGCOMPDATE",
"FCG_CXSJ", "WS_P", "WS_R", "WS_L", "WS_S", "WS_C", "WS_H", "WS_V", "SCHEDSTART", "SCHEDFINISH", "FCG_ACTSTARTTIME", "FCG_ACTFINISHTIME", "PROBLEMCODE" };
setFieldFlag(as, 7L, true);
setAllRelatedMboReadonly("WPLABOR");
setAllRelatedMboReadonly("WPMATERIAL");
setAllRelatedMboReadonly("WPSERVICE");
setAllRelatedMboReadonly("WPTOOL");
setAllRelatedMboReadonly("CHILDREN");
setAllRelatedMboReadonly("WOACTIVITY");
setAllRelatedMboReadonly("WORELEASE");
setAllRelatedMboReadonly("WOCHANGE");
} catch (RemoteException localRemoteException) {
}
}
public void add() throws MXException, RemoteException {
super.add();
}
public void modify()
throws MXException, RemoteException
{
super.modify();
}
public void canDelete() throws MXException, RemoteException {
super.canDelete();
}
public void delete() throws MXException, RemoteException {
super.delete();
}
public void save() throws MXException, RemoteException {
super.save();
if ((getString("origrecordclass").equalsIgnoreCase("SR")) && (isNew())) {
MboRemote ticket = getMboSet("$TICKET", "TICKET", "ticketid=" + getString("origrecordid")).getMbo(0);
if (ticket != null) {
if (!ticket.isNull("fcg_speciality"))
setValue("fcg_speciality", ticket.getString("fcg_speciality"), 3L);
if (!ticket.isNull("failurecode"))
setValue("failurecode", ticket.getString("failurecode"), 3L);
if (!ticket.isNull("problemcode"))
setValue("problemcode", ticket.getString("problemcode"), 3L);
if (!ticket.isNull("glaccount"))
setValue("glaccount", ticket.getString("glaccount"), 3L);
if (!ticket.isNull("reportedpriority"))
setValue("wopriority", ticket.getInt("reportedpriority"), 3L);
if (!ticket.isNull("targetstart"))
setValue("targstartdate", ticket.getDate("targetstart"), 3L);
if (!ticket.isNull("FCG_ELECTGROUP")) {
setValue("FCG_ELECTGROUP", ticket.getString("FCG_ELECTGROUP"), 3L);
}
setValue("WORKTYPE", "CM", 3L);
}
}
if (!getString("status").equalsIgnoreCase("CAN"))
return;
String memo = getMboSet("wostatus").getMbo(0).getString("memo");
memo = "关联工单已被取消:" + memo;
if (getString("origrecordid").equalsIgnoreCase(""))
return;
MboSetRemote woSet = getMboSet("$wo", "WORKORDER", "status<>'CAN' and wonum<>'" + getString("wonum") + "' and origrecordid=" + getString("origrecordid"));
if (!woSet.isEmpty())
return;
MboSetRemote srSet = getMboSet("$sr", "TICKET", "ticketid=" + getString("origrecordid"));
if ((srSet.isEmpty()) || (srSet.getMbo(0).getString("status").equalsIgnoreCase("CANCEL")) || (srSet.getMbo(0).getString("status").equalsIgnoreCase("CLOSED")))
return;
MboSetRemote sr_instance = getMboSet("$srWf", "WFINSTANCE", "ownertable='SR' and ownerid=" + srSet.getMbo(0).getInt("ticketuid") + " and active = 1");
if (!sr_instance.isEmpty()) {
throw new MXApplicationException("工单", "警告 您取消的工单,有关联缺陷单,并且还在审批流程中无法取消!");
}
MboSetRemote tks = srSet.getMbo(0).getMboSet("tkstatus");
tks.add();
tks.setValue("status", "CANCEL", 3L);
tks.setValue("changeby", getUserName(), 3L);
tks.setValue("changedate", MXSession.getSession().getDate(), 3L);
tks.setValue("memo", memo, 3L);
srSet.getMbo(0).setValue("status", "CANCEL", 3L);
srSet.getMbo(0).setValue("historyflag", "Y", 3L);
}
public void appValidate() throws MXException, RemoteException {
super.appValidate();
MboSetRemote wpmaterialSet = getMboSet("WPMATERIAL");
if (!wpmaterialSet.isEmpty()) {
FinancialServiceRemote financialThingy = (FinancialServiceRemote)((AppService)getMboServer()).getMXServer().lookup("FINANCIAL");
String orgID = getString("orgid");
if ((getString("PARENT").equalsIgnoreCase("")) && (!financialThingy.validateFullGLAccount(getUserInfo(), getString("glaccount"), orgID))) {
throw new MXApplicationException("工单", "警告 您填写了物资领用,但科目填写不完整,请工单页面填写");
}
}
Date oldmindate = new Date();
Date oldmaxdate = new Date();
if (getString("status").equalsIgnoreCase("CLOSE")) {
MboSetRemote gzpwombosetremote = getMboSet("FCG_WONUM_WORKSHEET");
if (!gzpwombosetremote.isEmpty()) {
MboRemote gzpwomboremote = null;
int i = 0;
while ((gzpwomboremote = gzpwombosetremote.getMbo(i++)) != null) {
String gzpzt = gzpwomboremote.getString("STATUS");
if ((!gzpzt.equalsIgnoreCase("CANCEL")) && (!gzpzt.equalsIgnoreCase("DELETED"))) {
String s = "警告 编号为" + gzpwomboremote.getString("WSCOMBNUM") + "的工作票状态为'" + gzpzt + "',请先处理工作票!";
throw new MXApplicationException("工作票", s);
}
if (i == 0) {
oldmindate = gzpwomboremote.getDate("ACCEPTEDDATE");
oldmaxdate = gzpwomboremote.getDate("EVACUATEDDATE");
}
Date mindate = gzpwomboremote.getDate("ACCEPTEDDATE");
Date maxdate = gzpwomboremote.getDate("EVACUATEDDATE");
if ((oldmindate != null) && (oldmaxdate != null) && (mindate != null) && (maxdate != null))
{
if (mindate.before(oldmindate)) {
oldmindate = mindate;
oldmaxdate = maxdate;
}
if (maxdate.after(oldmaxdate))
{
oldmaxdate = maxdate;
}
}
}
if (oldmindate != null) {
setValue("FCG_ACTSTARTTIME", oldmindate, 3L);
}
if (oldmaxdate != null) {
setValue("FCG_ACTFINISHTIME", oldmaxdate, 3L);
}
}
}
if (!getString("STATUS").equalsIgnoreCase("CLOSE"))
return;
MboSetRemote wochildset = getMboSet("ALLCHILDWO");
MboRemote wochildmboremote = null;
int i = 0;
while ((wochildmboremote = wochildset.getMbo(i++)) != null)
if ((!wochildmboremote.getString("WO.STATUS").equalsIgnoreCase("CLOSE")) && (!wochildmboremote.getString("WO.STATUS").equalsIgnoreCase("CAN")) && (!wochildmboremote.getBoolean("wo.istask")))
{
String msgbox = "错误: 子工单:‘" + wochildmboremote.getString("wonum") + "’没有关闭,请先关闭子工单";
throw new MXApplicationException("workorder", msgbox);
}
}
public void setAllRelatedMboReadonly(String relationName) throws MXException, RemoteException {
MboSetRemote relatedSet = getMboSet(relationName);
relatedSet.setFlag(7L, true);
}
}
\ No newline at end of file
package clpui.webclient.beans.rfq;
import clp.app.rfq.CLPRFQRemote;
import java.rmi.RemoteException;
import javax.servlet.http.HttpServletRequest;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.beans.rfq.RFQAppBean;
import psdi.webclient.system.controller.AppInstance;
import psdi.webclient.system.controller.SessionContext;
import psdi.webclient.system.controller.WebClientEvent;
import psdi.webclient.system.session.WebClientSession;
public class CustRFQAppBean extends RFQAppBean
{
public void EXPORT()
throws MXException, RemoteException
{
WebClientEvent event = this.sessionContext.getCurrentEvent();
String base = this.sessionContext.getRequest().getScheme() + "://" +
this.sessionContext.getRequest().getServerName() + ":" +
this.sessionContext.getRequest().getServerPort() + this.sessionContext.getRequest().getContextPath();
String url = base + "/webclient/clpcust/bzbj.jsp?rfqnum=" + getString("rfqnum") + "&siteid=" +
getString("siteid");
System.out.println(url);
AppInstance curApp = this.clientSession.getCurrentApp();
curApp.openURL(url, true);
}
public int SAVE() throws MXException, RemoteException
{
CLPRFQRemote rfq = (CLPRFQRemote)getMbo();
MboSetRemote rfqline = rfq.getMboSet("rfqline");
rfq.setValue("TOTALCOST", rfqline.sum("linecost"), 3L);
return super.SAVE();
}
public int ROUTEWF()
throws MXException, RemoteException
{
MboRemote rfq = getMbo();
if ("INPRG1".equals(rfq.getString("status"))) {
MboSetRemote rfqSet = rfq.getMboSet("rfqvendor");
MboSetRemote rfqlineSet = rfq.getMboSet("rfqline");
if (rfqSet.isEmpty()) {
throw new MXApplicationException("温馨提示:", "招标/询价单尚未指定供应商,请先指定供应商!");
}
if (rfqlineSet.isEmpty()) {
throw new MXApplicationException("温馨提示:", "招标/询价单尚未添加明细行!");
}
}
return super.ROUTEWF();
}
}
\ No newline at end of file
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.tohi.app.po;
import com.tohi.util.Common;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import psdi.app.po.PO;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.security.ConnectionKey;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class CustPo extends PO implements CustPoRemote {
public CustPo(MboSet ms) throws MXException, RemoteException {
super(ms);
}
public void init() throws MXException {
super.init();
try {
if (this.getString("CUST_APPTYPE").equalsIgnoreCase("UDPO")) {
if (this.getString("STATUS").equalsIgnoreCase("已验收")) {
this.setFlag(7L, true);
} else if (this.getString("STATUS").equalsIgnoreCase("WAPPR12")) {
MboSetRemote polineSet = this.getMboSet("poline");
MboRemote poline = null;
String CUST_YSPERSON = null;
System.out.println("1111111");
int i = 0;
while(true) {
poline = polineSet.getMbo(i);
if (poline == null) {
System.out.println("2222222");
break;
}
System.out.println("-------" + poline.getString("CUST_YSPERSON"));
CUST_YSPERSON = poline.getString("CUST_YSPERSON");
int CUST_ISYS = poline.getInt("CUST_ISYS");
if (this.getUserInfo().getPersonId().equalsIgnoreCase(CUST_YSPERSON) && CUST_ISYS == 0) {
poline.setValue("CUST_ISYS", 1, 2L);
}
++i;
}
}
}
} catch (RemoteException var6) {
var6.printStackTrace();
}
}
public void add() throws MXException, RemoteException {
super.add();
this.setValue("CUST_APPTYPE", "PO", 2L);
this.setValue("PURCHASEAGENT", this.getUserInfo().getPersonId(), 2L);
if (this.getThisMboSet() != null) {
String app = this.getThisMboSet().getApp();
if (app != null && app.equalsIgnoreCase("UDMTRETURN")) {
Common.setDefaultDeptAndCrew(this, "CUST_ACTEAM", "CUST_ACDEPT");
this.setValue("VENDOR", "SU000888", 11L);
this.setValue("CUST_APPTYPE", "UDRETURN", 2L);
}
}
}
public void save() throws MXException, RemoteException {
super.save();
String appname = this.getThisMboSet().getApp();
if ("已验收".equalsIgnoreCase(this.getString("status")) && appname == null) {
MboSetRemote wpmaterialSet = this.getMboSet("POLINE");
MboRemote wpmaterial = null;
String CUST_PONUM = "";
String CUST_POLINENUM = "";
String ITEMNUM = "";
String STORELOC = "";
String sql = "";
ConnectionKey conKey = null;
Connection con = null;
Statement stmt = null;
Object rs = null;
try {
conKey = new ConnectionKey(MXServer.getMXServer().getSystemUserInfo());
con = MXServer.getMXServer().getDBManager().getConnection(conKey);
stmt = con.createStatement();
stmt.setQueryTimeout(10);
int i = 0;
while(true) {
wpmaterial = wpmaterialSet.getMbo(i);
if (wpmaterial == null) {
break;
}
if (!wpmaterial.toBeDeleted() && !"".equalsIgnoreCase(wpmaterial.getString("STORELOC"))) {
STORELOC = wpmaterial.getString("STORELOC");
CUST_PONUM = wpmaterial.getString("CUST_PONUM");
ITEMNUM = wpmaterial.getString("ITEMNUM");
CUST_POLINENUM = wpmaterial.getString("CUST_POLINENUM");
sql = "update POLINE set STORELOC='" + STORELOC + "' where ITEMNUM='" + ITEMNUM + "' and POLINENUM='" + CUST_POLINENUM + "' and PONUM='" + CUST_PONUM + "'";
stmt.executeUpdate(sql);
con.commit();
}
++i;
}
} catch (Exception var22) {
var22.printStackTrace();
} finally {
try {
if (stmt != null) {
stmt.close();
stmt = null;
}
if (con != null) {
con.close();
con = null;
}
if (rs != null) {
((ResultSet)rs).close();
rs = null;
}
} catch (SQLException var21) {
var21.printStackTrace();
}
}
}
}
public void copyPOLineToPOLine(MboSetRemote frompolineSet) throws MXException, RemoteException {
MboRemote poline = null;
String kf = null;
String ponumString = null;
for (int i = 0; ; i++) {
poline = frompolineSet.getMbo(i);
if (poline == null) {
break;
}
if (frompolineSet.getMbo(i).isSelected()) {
if (ponumString == null) {
ponumString = poline.getString("PONUM") + ",";
}
else if (ponumString.indexOf(poline.getString("PONUM")) == -1) {
ponumString = ponumString + poline.getString("PONUM") + ",";
}
if (kf == null) {
kf = poline.getString("storeloc");
}
if (!kf.equalsIgnoreCase(poline.getString("storeloc"))) {
Object[] params = { "(" + kf + "," + poline.getString("storeloc") + ")" };
throw new MXApplicationException("po", "POxzwltip", params); } } } System.out.println("------变更的单号前-----------" + ponumString);
String contnum = null;
String updatecontnum = null;
String itemnum = null;
String[] updatecontnumtoappr;
try { for (int i = 0; ; i++) {
poline = frompolineSet.getMbo(i);
if (poline == null) {
break;
}
if (frompolineSet.getMbo(i).isSelected()) {
itemnum = poline.getString("ITEMNUM");
if ((itemnum != null) && (!"".equals(itemnum))) {
MboSetRemote contractlineSet = MXServer.getMXServer().getMboSet("CONTRACTLINE", getUserInfo());
MboRemote contractline = null;
contractlineSet.setWhere("itemnum='" + itemnum + "'");
contractlineSet.reset();
if (!contractlineSet.isEmpty()) {
for (int k = 0; ; k++) {
contractline = contractlineSet.getMbo(k);
if (contractline == null) {
break;
}
contnum = contractline.getString("CONTRACTNUM");
if ((contnum != null) && (!"".equals(contnum))) {
MboSetRemote purchviewSet = MXServer.getMXServer().getMboSet("PURCHVIEW", getUserInfo());
MboRemote purchview = null;
purchviewSet.setWhere("CONTRACTNUM='" + contnum + "'");
purchviewSet.reset();
String status = null;
if (!purchviewSet.isEmpty()) {
purchview = purchviewSet.getMbo(0);
status = purchview.getString("STATUS");
if (status.equalsIgnoreCase("APPR")) {
if (updatecontnum == null)
updatecontnum = contnum + ",";
else {
updatecontnum = updatecontnum + contnum + ",";
}
purchview.setValue("STATUS", "DRAFT", 11L);
}
purchviewSet.save(11L);
purchviewSet.close();
}
}
}
}
}
}
}
MboSetRemote topolineSet = getMboSet("poline");
String[] srcAttributes = { "ItemSetId", "ItemNum", "LINETYPE", "CUST_DYSQTY", "ORDERUNIT", "CONVERSION", "UNITCOST", "LINECOST", "CUST_UNITCOST", "CUST_LINECOST", "PONUM", "POLINENUM", "STORELOC", "PRLINE.REQUESTEDBY" };
String[] destAttributes = { "ItemSetId", "ItemNum", "LINETYPE", "ORDERQTY", "ORDERUNIT", "CONVERSION", "UNITCOST", "LINECOST", "CUST_UNITCOST", "CUST_LINECOST", "CUST_PONUM", "CUST_POLINENUM", "STORELOC", "CUST_YSPERSON" };
topolineSet.copy(frompolineSet, srcAttributes, destAttributes);
} catch (Exception e) {
e.printStackTrace();
System.out.println("------------------------------复制失败----------------------");
}
finally
{
MboSetRemote purchviewSet;
MboRemote purchview;
System.out.println("------变更的单号后-----------" + updatecontnum);
if (updatecontnum != null) {
updatecontnumtoappr = updatecontnum.split(",");
for (int j = 0; j < updatecontnumtoappr.length; j++) {
purchviewSet = MXServer.getMXServer().getMboSet("PURCHVIEW", getUserInfo());
purchview = null;
purchviewSet.setWhere("CONTRACTNUM='" + updatecontnumtoappr[j] + "'");
purchviewSet.reset();
if (!purchviewSet.isEmpty()) {
purchview = purchviewSet.getMbo(0);
purchview.setValue("STATUS", "APPR", 11L);
purchviewSet.save(11L);
purchviewSet.close();
}
}
}
}
}
public void copyPRToCurrentPO(MboSetRemote sourcePRLineSet) throws MXException, RemoteException {
super.copyPRToCurrentPO(sourcePRLineSet);
String appname = this.getThisMboSet().getApp();
if ("PO".equals(appname)) {
MboSetRemote contractSet = MXServer.getMXServer().getMboSet("CONTRACT", this.getUserInfo());
contractSet.setWhere("contractnum in (select max(con.contractnum) from contractline con where con.itemnum='" + sourcePRLineSet.getMbo(0).getString("itemnum") + "')");
contractSet.reset();
if (contractSet.getMbo(0) != null) {
String vendor = contractSet.getMbo(0).getString("VENDOR");
String contractnum = contractSet.getMbo(0).getString("CONTRACTNUM");
contractSet.close();
this.setValue("vendor", vendor, 11L);
this.setValue("CUST_CONTRACTNUM", contractnum, 11L);
this.setValue("INCLUSIVE1", 1, 2L);
}
}
}
public MboRemote createPOLineFromPR(MboRemote fromPR, MboRemote fromPRLine, MboSetRemote poLines) throws MXException, RemoteException {
MboRemote toPOLine = super.createPOLineFromPR(fromPR, fromPRLine, poLines);
String appname = this.getThisMboSet().getApp();
if ("PO".equals(appname)) {
MboSetRemote contractlineSet = MXServer.getMXServer().getMboSet("CONTRACTLINE", this.getUserInfo());
contractlineSet.setWhere("contractnum in (select max(con.contractnum) from contractline con where con.itemnum='" + fromPRLine.getString("itemnum") + "' and contractnum in (SELECT CONTRACTNUM FROM CONTRACT c2 WHERE CONTRACTTYPE IN ('价格') )) and itemnum='" + fromPRLine.getString("itemnum") + "'");
contractlineSet.reset();
if (contractlineSet.getMbo(0) != null) {
double unitcost = contractlineSet.getMbo(0).getDouble("UNITCOST");
String cust_ponum = contractlineSet.getMbo(0).getString("CUST_PONUM");
contractlineSet.close();
MboSetRemote polineSet = MXServer.getMXServer().getMboSet("POLINE", this.getUserInfo());
//SELECT TAX1CODE,REVISIONNUM FROM poline WHERE PONUM ='21169' AND ITEMNUM ='020801001000037' AND REVISIONNUM = (SELECT max(REVISIONNUM) FROM poline WHERE PONUM ='21169' AND ITEMNUM ='020801001000037' )
polineSet.setWhere("ponum ='" + cust_ponum + "' and itemnum='" + fromPRLine.getString("itemnum") + "' AND REVISIONNUM = (SELECT max(REVISIONNUM) FROM poline WHERE PONUM ='" + cust_ponum + "' AND ITEMNUM ='" + fromPRLine.getString("itemnum") + "' ) ");
polineSet.reset();
String tax1code = "13";
if (polineSet.getMbo(0) != null) {
tax1code = polineSet.getMbo(0).getString("TAX1CODE");
polineSet.close();
}
toPOLine.setValue("TAX1CODE", tax1code);
toPOLine.setValue("CUST_UNITCOST", unitcost, 2L);
}
return toPOLine;
} else {
return toPOLine;
}
}
public void createContractFromPO(String contractNum, String description, String contractType) throws MXException, RemoteException {
super.createContractFromPO(contractNum, description, contractType);
if (!"".equalsIgnoreCase(this.getMboValue("CUST_CONTRACTNUM").toString())) {
throw new MXApplicationException("", "已经创建过合同,无需再次创建!");
}
}
}
package com.tohi.app.po;
import java.util.Calendar;
import java.util.Date;
public abstract class test {
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance(); // 如果不设置时间,则默认为当前时间
System.out.println(calendar.getTime());
//
// calendar.setTime(new Date()); // 将系统当前时间赋值给 Calendar 对象
// System.out.println("现在时刻:" + calendar.getTime()); // 获取当前时间
// int year = calendar.get(Calendar.YEAR); // 获取当前年份
// System.out.println("现在是" + year + "年");
// int month = calendar.get(Calendar.MONTH) + 1; // 获取当前月份(月份从 0 开始,所以加 1)
// System.out.print(month + "月");
// int day = calendar.get(Calendar.DATE); // 获取日
// System.out.print(day + "日");
// int week = calendar.get(Calendar.DAY_OF_WEEK) - 1; // 获取今天星期几(以星期日为第一天)
// System.out.print("星期" + week);
// int hour = calendar.get(Calendar.HOUR_OF_DAY); // 获取当前小时数(24 小时制)
// System.out.print(hour + "时");
// int minute = calendar.get(Calendar.MINUTE); // 获取当前分钟
// System.out.print(minute + "分");
// int second = calendar.get(Calendar.SECOND); // 获取当前秒数
// System.out.print(second + "秒");
// int millisecond = calendar.get(Calendar.MILLISECOND); // 获取毫秒数
// System.out.print(millisecond + "毫秒");
// int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH); // 获取今天是本月第几天
// System.out.println("今天是本月的第 " + dayOfMonth + " 天");
// int dayOfWeekInMonth = calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH); // 获取今天是本月第几周
// System.out.println("今天是本月第 " + dayOfWeekInMonth + " 周");
// int many = calendar.get(Calendar.DAY_OF_YEAR); // 获取今天是今年第几天
// System.out.println("今天是今年第 " + many + " 天");
// Calendar c = Calendar.getInstance();
// c.set(2012, 8, 8); // 设置年月日,时分秒将默认采用当前值
// System.out.println("设置日期为 2012-8-8 后的时间:" + c.getTime()); // 输出时
}
}
package com.tohi.app.udrunpm;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.Mbo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class FldCustPerson extends MAXTableDomain
{
public FldCustPerson(MboValue ms)
throws RemoteException
{
super(ms);
String thisname = getMboValue().getAttributeName();
String[] hz = { "PERSONID" };
String[] target = new String[1];
target[0] = thisname;
setLookupKeyMapInOrder(target, hz);
setRelationship("PERSON", "personid=:" + thisname);
}
public MboSetRemote getList() throws MXException, RemoteException
{
String where = "";
try
{
where = getMboValue().getMbo().getString("CUST_ISSUEDEPT");
// if (!getMboValue().getMbo().isNull("CUST_ISSUEDEPT"))
// where = getMboValue().getMbo().getString("CUST_ISSUEDEPT");
}
catch (MXException e) {
e.printStackTrace();
}
setListCriteria("CUST_CREW like '" + where + "%' and STATUS='活动' and CUST_POSITION in (select PERSONGROUP from PERSONGROUP where description like '%部长%' or description like '%分部主任%' or description like '%副部长%' or description like '%支部书记%' ) ");
return super.getList();
}
}
\ No newline at end of file
package com.tohi.app.udrunpm;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.Mbo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class FldLeadPerson extends MAXTableDomain
{
public FldLeadPerson(MboValue ms)
throws RemoteException
{
super(ms);
String thisname = getMboValue().getAttributeName();
String[] hz = { "PERSONID" };
String[] target = new String[1];
target[0] = thisname;
setLookupKeyMapInOrder(target, hz);
setRelationship("PERSON", "personid=:" + thisname);
}
public MboSetRemote getList() throws MXException, RemoteException
{
String where = "";
try
{
where = getMboValue().getMbo().getString("CUST_ISSUEDEPT");
// if (!getMboValue().getMbo().isNull("CUST_ISSUEDEPT"))
// where = getMboValue().getMbo().getString("CUST_ISSUEDEPT");
}
catch (MXException e) {
e.printStackTrace();
}
setListCriteria("CUST_CREW like '" + where + "%' and STATUS='活动' and CUST_POSITION in (select PERSONGROUP from PERSONGROUP where description like '%部长%' or description like '%分部主任%' or description like '%副部长%' or description like '%支部书记%' ) ");
return super.getList();
}
}
\ No newline at end of file
package com.tohi.app.udrunpm;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueInfo;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.util.MXException;
public class UdRunWO extends Mbo
implements MboRemote
{
private static HashSet skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
private boolean isModified = false;
public UdRunWO(MboSet ms) throws RemoteException {
super(ms);
}
public void init() throws MXException
{
super.init();
if (toBeAdded()) {
return;
}
String[] zr = { "SCJYBYJ", "JJYJ", "ZZYJ", "LDXZYJ", "ZZPERSON" };
String[] filed = { "DESCRIPTION", "PLANFROM", "CUST_ISSUEDEPT", "LEAD", "CUST_TYPE","UDJHSTADATE","UDJHENDDATE","UDGZNR" };
try
{
if (getString("CUST_APPTYPE").equalsIgnoreCase("A") ) {
if ((!getUserInfo().getPersonId().equalsIgnoreCase(getString("CREATEBY"))) && (getString("status").equalsIgnoreCase("草稿"))) {
setFlag(7L, true);
}
}
if (getString("CUST_APPTYPE").equalsIgnoreCase("B") ) { //计划任务
if (!getString("STATUS").equalsIgnoreCase("草稿") ) {
setFieldFlag(filed, 7L, true);
}
if (getString("STATUS").equalsIgnoreCase("执行中") ) {
setFieldFlag("UDZXQK", 7L, false);
setFieldFlag("UDZXQK", 128L, true);
}else{
setFieldFlag("UDZXQK", 7L, true);
}
}
boolean flag=false;
if (!getMboSet("WFASSIGNMENT").isEmpty()) {
ArrayList<String> persons=new ArrayList<String> ();
MboSetRemote mboSet= getMboSet("WFASSIGNMENT");
for (int i = 0; i < mboSet.count(); i++) {
MboRemote mbo=mboSet.getMbo(i);
persons.add(mbo.getString("ASSIGNCODE"));
}
if (persons.contains(getUserInfo().getPersonId())) {
flag=true;//可以进行修改
}
}
if (getString("STATUS").equalsIgnoreCase("工作终结") ) {
flag=false;
}
if (getString("STATUS").equalsIgnoreCase("草稿") ) {
flag=true;
}
//判断是否进行只读
if (flag) {
getMboSet("DOCLINKS").setFlag(7L,false);
}else{
getMboSet("DOCLINKS").setFlag(7L,true);
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
public void add() throws MXException, RemoteException
{
super.add();
Date currentDate = MXServer.getMXServer().getDate();
String personid = getUserInfo().getPersonId();
setValue("status", "草稿", 11L);
setValue("STATUSDATE", currentDate, 11L);
setValue("changeby", personid, 11L);
setValue("changedate", currentDate, 2L);
setValue("CREATEBY", getUserInfo().getPersonId(), 11L);
setValue("CREATEDATE", currentDate, 11L);
}
public void delete(long access)
throws MXException, RemoteException
{
getMboSet("DOCLINKS").deleteAll(access);
super.delete(access);
}
public void modify() throws MXException, RemoteException {
if (!this.isModified) {
this.isModified = true;
setValue("changedate", MXServer.getMXServer().getDate(), 11L);
setValue("changeby", getUserInfo().getPersonId(), 11L);
}
}
public void initRelationship(String relationName, MboSetRemote mboSet) throws RemoteException, MXException { if (getInt("HISTORYFLAG") == 1)
setFlag(7L, true); }
public MboRemote duplicate() throws MXException, RemoteException {
if (!isHashSetLoaded)
loadSkipFieldCopyHashSet();
MboRemote newTestRemote = copy();
return newTestRemote;
}
protected boolean skipCopyField(MboValueInfo mvi) throws MXException, RemoteException {
return skipFieldCopy.contains(mvi.getName());
}
private static void loadSkipFieldCopyHashSet() throws MXException, RemoteException {
isHashSetLoaded = true;
skipFieldCopy.add("ORGID");
skipFieldCopy.add("SITEID");
skipFieldCopy.add("CHANGEBY");
skipFieldCopy.add("CHANGEDATE");
skipFieldCopy.add("CREATEBY");
skipFieldCopy.add("CREATEDATE");
skipFieldCopy.add("UDRUNWONUM");
skipFieldCopy.add("STATUS");
}
}
\ No newline at end of file
package com.tohi.app.udwdstructure;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class CustFldUDWDSTRUCTUREParent extends MAXTableDomain
{
public CustFldUDWDSTRUCTUREParent(MboValue mbv)
{
super(mbv);
String thisAttr = getMboValue().getAttributeName();
String[] target = { thisAttr };
String[] source = { "UDWDNUM" };
setLookupKeyMapInOrder(target, source);
setRelationship("UDWDSTRUCTURE", "UDWDNUM=:" + thisAttr);
}
public MboSetRemote getList() throws RemoteException, MXException {
MboSetRemote mboSet = super.getList();
// String specialty = getMboValue("SPECIALTY").getString();
// System.out.println("ͨ-----");
// if (specialty.equalsIgnoreCase("TY"))
// {
// mboSet.setWhere("SPECIALTY ='TOP' and hasparent= 0 ");
// mboSet.reset();
// }
System.out.println("111");
return mboSet;
}
}
\ No newline at end of file
package com.tohi.app.udwdstructure;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
public class FldSpecialty extends MboValueAdapter{
public FldSpecialty() {
super();
}
public FldSpecialty(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=mboValue.getMbo();
String Specialty=mboValue.getString();//获取当前选择的类型
if (Specialty.equalsIgnoreCase("TOP")) {
//如果当前是通用
mbo.setFieldFlag("PARENT", 7L, true);
mbo.setValueNull("UDWDNUM",11L);
mbo.setFieldFlag("UDWDNUM", 7L, false);
mbo.setFieldFlag("UDWDNUM", 128L, true);
}
if (Specialty.equalsIgnoreCase("TY")) {
//如果当前是通用
mbo.setFieldFlag("PARENT", 7L, false);
mbo.setFieldFlag("PARENT", 128L, true);
mbo.setValue("UDWDNUM", "保存后生成", 11L);
mbo.setFieldFlag("UDWDNUM", 7L, true);
}
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.tohi.app.udwdstructure;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import psdi.mbo.HierarchicalMboRemote;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.security.ConnectionKey;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory;
public class UdWdStructure extends Mbo implements UdWdStructureRemote, HierarchicalMboRemote {
private final String APPLOGGER = "maximo.application.UDWDSTRUCTURE";
private MXLogger log = MXLoggerFactory.getLogger("maximo.application.UDWDSTRUCTURE");
public UdWdStructure(MboSet mboSet0) throws RemoteException {
super(mboSet0);
}
public void add() throws MXException, RemoteException {
super.add();
this.log.debug("UdWdStructure.add");
this.setValue("UDWDNUM", "保存后生成", 2L);
this.setValue("HASCHILDREN", "true", 2L);
this.setValue("CREATEDBY", this.getUserInfo().getPersonId(), 2L);
this.setValue("CREATEDDATE", MXServer.getMXServer().getDate(), 2L);
}
public void init() throws MXException {
super.init();
this.log.debug("UdWdStructure.init");
if (!this.toBeAdded()) {
try {
if (!this.getString("UDWDNUM").equalsIgnoreCase("保存后生成")) {
this.setFieldFlag("SPECIALTY", 7L, true);
this.setFieldFlag("PARENT", 7L, true);
}
} catch (RemoteException var2) {
var2.printStackTrace();
}
}
this.setFieldFlag("UDWDNUM", 7L, true);
}
protected void save() throws MXException, RemoteException {
ConnectionKey conKey = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
conKey = new ConnectionKey(MXServer.getMXServer().getSystemUserInfo());
con = MXServer.getMXServer().getDBManager().getConnection(conKey);
super.save();
// if (this.toBeAdded()) {
// this.getno();
// }
MboSetRemote udtreeqxglySet = MXServer.getMXServer().getMboSet("UDTREEQX", this.getUserInfo());
udtreeqxglySet.setWhere("PERSONGROUP='ZP1001' and UDWDSTRUCTUREID=" + this.getInt("UDWDSTRUCTUREID"));
udtreeqxglySet.reset();
MboRemote udtreeqxgly = null;
if (udtreeqxglySet.getMbo(0) == null) {
udtreeqxgly = udtreeqxglySet.addAtEnd(11L);
udtreeqxgly.setValue("PERSONGROUP", "ZP1001", 11L);
udtreeqxgly.setValue("UDWDSTRUCTUREID", this.getInt("UDWDSTRUCTUREID"), 11L);
udtreeqxglySet.save(11L);
udtreeqxglySet.close();
udtreeqxglySet = null;
}
MboSetRemote udtreeqxSet = this.getMboSet("UDTREEQX");
MboRemote udtreeqx = null;
Connection conndb = null;
ResultSet rs2 = null;
Statement staIns = null;
String sql;
try {
conndb = MXServer.getMXServer().getDBManager().getSequenceConnection();
staIns = conndb.createStatement();
sql = " WITH locs(udwdstructureid,UDWDNUM,parent,description) AS (SELECT udwdstructureid,UDWDNUM,parent,description FROM udwdstructure WHERE udwdstructureid=" + this.getInt("UDWDSTRUCTUREid") + " UNION all SELECT A.udwdstructureid,A.UDWDNUM,A.parent,A.description FROM udwdstructure A,locs B where A.UDWDNUM=B.parent )" + " select udwdstructureid,UDWDNUM,parent,description from locs where udwdstructureid <>" + this.getInt("UDWDSTRUCTUREid");
rs2 = staIns.executeQuery(sql);
String curpersongroup = "";
int i = 0;
while(true) {
udtreeqx = udtreeqxSet.getMbo(i);
if (udtreeqx == null) {
break;
}
MboSetRemote queudtreeqxSet;
for(curpersongroup = udtreeqx.getString("PERSONGROUP"); rs2.next(); queudtreeqxSet = null) {
queudtreeqxSet = MXServer.getMXServer().getMboSet("UDTREEQX", this.getUserInfo());
MboRemote custudtreeqxadd = null;
queudtreeqxSet.setWhere("PERSONGROUP = '" + curpersongroup + "' and UDWDSTRUCTUREID = " + rs2.getInt("udwdstructureid"));
queudtreeqxSet.reset();
if (queudtreeqxSet.getMbo(0) == null) {
custudtreeqxadd = queudtreeqxSet.addAtEnd(11L);
custudtreeqxadd.setValue("PERSONGROUP", curpersongroup, 11L);
custudtreeqxadd.setValue("UDWDSTRUCTUREID", rs2.getInt("udwdstructureid"), 11L);
}
queudtreeqxSet.save(11L);
queudtreeqxSet.close();
}
++i;
}
if (!getString("SPECIALTY").equalsIgnoreCase("TOP")) {
getno();//生成文档节点编号
}
} catch (SQLException var31) {
try {
if (rs2 != null) {
rs2.close();
}
if (staIns != null) {
staIns.close();
}
if (conndb != null) {
conndb.close();
}
} catch (SQLException var29) {
var29.printStackTrace();
}
} finally {
try {
if (rs2 != null) {
rs2.close();
}
if (staIns != null) {
staIns.close();
}
if (conndb != null) {
conndb.close();
}
} catch (SQLException var27) {
var27.printStackTrace();
}
}
try {
stmt = con.createStatement();
sql = " WITH locs(udwdstructureid,UDWDNUM,parent,description) AS (SELECT udwdstructureid,UDWDNUM,parent,description FROM udwdstructure WHERE UDWDNUM='" + this.getString("parent") + "'" + " UNION all SELECT A.udwdstructureid,A.UDWDNUM,A.parent,A.description FROM udwdstructure A,locs B where A.UDWDNUM = B.parent )" + " select udwdstructureid,UDWDNUM,parent,description from locs order by udwdstructureid desc";
System.out.println(sql + "-------------123");
rs = stmt.executeQuery(sql);
int k = 0;
while(rs.next()) {
if (!"".equalsIgnoreCase(rs.getString("parent")) && rs.getString("parent") != null) {
if (k < 4) {
String strPath = rs.getString("description");
this.setValue("nodepath", "/" + this.getString("description") + "/" + strPath);
}
++k;
}
}
} catch (SQLException var30) {
var30.printStackTrace();
}
try {
rs.close();
stmt.close();
con.close();
} catch (SQLException var28) {
var28.printStackTrace();
}
}
public void delete(long access) throws MXException, RemoteException {
MboSetRemote haschild = this.getMboSet("CHILDREN");
if (haschild.isEmpty()) {
this.getMboSet("UDTREEQX").deleteAll(access);
super.delete(access);
} else {
throw new MXApplicationException("温馨提示", "该节点有子节点,不能删除!");
}
}
public void getno() throws RemoteException, MXException {
String setnum = null;
String parent = this.getString("PARENT");//DG
try {
MboSetRemote mset = this.getMboSet("$this", "UDWDSTRUCTURE", "UDWDNUM=(select max(UDWDNUM) from UDWDSTRUCTURE where UDWDNUM like '" + parent + "%' and parent='" + parent + "')");
int num = 0;
if (!mset.isEmpty()) {
String s = mset.getMbo(0).getString("UDWDNUM");
String str = s.substring(parent.length());
num = Integer.parseInt(str) + 1;
String Numstr = null;
if (num > 99) {
throw new MXApplicationException("温馨提示", "编号产生异常,请联系管理员!");
}
Numstr = String.format("%1$,02d", num);
setnum = parent + Numstr;
} else {
setnum = parent + "01";
}
this.setValue("UDWDNUM", setnum, 11L);
} catch (RemoteException var8) {
var8.printStackTrace();
} catch (MXException var9) {
var9.printStackTrace();
}
}
public void modify() throws MXException, RemoteException {
super.modify();
this.setValue("changeby", this.getUserInfo().getPersonId(), 2L);
this.setValue("CHANGEDATE", MXServer.getMXServer().getDate(), 2L);
}
public boolean isTop() throws MXException, RemoteException {
return this.isNull("PARENT");
}
public boolean hasChildren() throws MXException, RemoteException {
return !this.getMboSet("CHILDREN").isEmpty();
}
public boolean hasParents() throws MXException, RemoteException {
return !this.isNull("PARENT");
}
}
package com.tohi.app.vendor;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldConDesction extends MboValueAdapter{
public FldConDesction() {
super();
}
public FldConDesction(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=this.getMboValue().getMbo();
String attrName=this.getMboValue().getAttributeName();
double desction=0.0;
if (mbo.getName().equals("CONTRACTLINE")) {
if (attrName.equalsIgnoreCase("DESCTION")) { //扣分
MboSetRemote mboSet=mbo.getThisMboSet();
desction=mboSet.sum("DESCTION");
mbo.getOwner().setValue("CONDESCTION", desction,2L);//将合同行统计后进行赋值
}
}
// if (mbo.getName().equals("VENDOR")) {//如果当前的是供应商
// if (attrName.equalsIgnoreCase("DESCTION")) {
// MboSetRemote OTHERVENDORSet= mbo.getMboSet("OTHERVENDOR");
// Double CONDESCTION= OTHERVENDORSet.sum("CONDESCTION");//合同扣分
// Double DESCTION =OTHERVENDORSet.sum("DESCTION");//其他扣分
// Double sumScore= mbo.getDouble("CONDESCTION")+this.getMboValue().getDouble();
// mbo.setValue("SCORE",75-(CONDESCTION+DESCTION+ sumScore),2L); //历史加当前的
// for (int i = 0; i < OTHERVENDORSet.count(); i++) {
// MboRemote OTHERVENDORmbo= OTHERVENDORSet.getMbo(i);
// OTHERVENDORmbo.setValue("SCORE",75-(CONDESCTION+DESCTION+sumScore),2L);
// }
// OTHERVENDORSet.save();
// }
// if (attrName.equalsIgnoreCase("CONDESCTION")) {
// MboSetRemote OTHERVENDORSet= mbo.getMboSet("OTHERVENDOR");
// Double CONDESCTION= OTHERVENDORSet.sum("CONDESCTION");//合同扣分
// Double DESCTION =OTHERVENDORSet.sum("DESCTION");//其他扣分
// Double sumScore= this.getMboValue().getDouble()+mbo.getDouble("DESCTION");
// mbo.setValue("SCORE",75-(CONDESCTION+DESCTION+ sumScore),2L); //历史加当前的
// for (int i = 0; i < OTHERVENDORSet.count(); i++) {
// MboRemote OTHERVENDORmbo= OTHERVENDORSet.getMbo(i);
// OTHERVENDORmbo.setValue("SCORE",75-(CONDESCTION+DESCTION+sumScore),2L);
// }
// OTHERVENDORSet.save();
// }
// }
}
}
package com.tohi.app.vendor;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class FldContractNum extends MAXTableDomain
{
public FldContractNum(MboValue mbv)
{
super(mbv);
String thisAttr = getMboValue().getAttributeName();
String[] target = { thisAttr };
String[] source = { "contractnum" };
setLookupKeyMapInOrder(target, source);
setRelationship("contract", "contractnum=:" + thisAttr);
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
//ѡӦ
MboRemote mbo=getMboValue().getMbo();
String VENDOR= mbo.getString("VENDOR");
setListCriteria("VENDOR='"+VENDOR+"'"); //ǰӦ
return super.getList();
}
}
package com.tohi.app.vendor;
import java.io.PrintStream;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.SqlFormat;
import psdi.security.ProfileRemote;
import psdi.util.MXException;
public class FldVendor extends MAXTableDomain
{
MboRemote mbo;
public FldVendor(MboValue mbv)
throws MXException
{
super(mbv);
this.mbo = null;
setRelationship("COMPANIES", "company =:vendor and orgid=:orgid and disabled=:no");
}
public MboSetRemote getList()
throws MXException, RemoteException
{
MboRemote mboRemote = getMboValue().getMbo();
String orgID = mboRemote.getString("orgid");
if (mboRemote.isZombie())
orgID = ((Mbo)mboRemote).getProfile().getDefaultOrg();
SqlFormat sqlf = new SqlFormat(mboRemote, "disabled = :NO and orgid = :1");
sqlf.setObject(1, "COMPANIES", "ORGID", orgID);
setListCriteria(sqlf.format());
return super.getList();
}
public void action() throws MXException, RemoteException
{
super.action();
Vendor vendor = (Vendor)getMboValue().getMbo();
if ((vendor == null) || (vendor.getString("vendor") == null) || ("".endsWith(vendor.getString("vendor")))) {
return;
}
System.out.println("ѡĹӦ̣" + vendor.getString("vendor"));
MboRemote companyMbo = vendor.getMboSet("COMPANIES").getMbo(0);
// vendor.setValue("DESCTION", companyMbo.getString("DESCTION"));
// vendor.setValue("DESCTIONREMARK", companyMbo.getString("DESCTIONREMARK"));
vendor.setValue("HOLDDATE", companyMbo.getDate("HOLDDATE"));
vendor.setValue("SCORE", companyMbo.getString("SCORE"));
}
}
\ No newline at end of file
package com.tohi.app.vendor;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class Vendor extends Mbo
implements VendorRemote
{
public Vendor(MboSet ms)
throws RemoteException
{
super(ms);
}
public void init() throws MXException {
super.init();
try {
if (getString("ISHISTORY").equalsIgnoreCase("1")) {
this.setFlag(7L,true); //如果是历史,则全部只读
}
} catch (RemoteException e) {
e.printStackTrace();
}
}
public void add() throws MXException, RemoteException {
super.add();
}
@Override
public void appValidate() throws MXException, RemoteException {
super.appValidate();
System.out.println("保存后触发效验");
MboSetRemote OTHERVENDORSet= getMboSet("OTHERVENDOR");
Double CONDESCTION= OTHERVENDORSet.sum("CONDESCTION");//合同扣分
Double DESCTION =OTHERVENDORSet.sum("DESCTION");//其他扣分
setValue("SCORE",75-(CONDESCTION+DESCTION+getDouble("CONDESCTION")+getDouble("DESCTION"))); //历史加当前的
}
@Override
protected void save() throws MXException, RemoteException {
super.save();
}
}
\ No newline at end of file
package com.tohi.app.vendor;
import psdi.mbo.MboRemote;
public abstract interface VendorRemote extends MboRemote
{
}
\ No newline at end of file
package com.tohi.webclient.beans.Rllinereg;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
public class CustRllineregAppBean extends AppBean{
//拆线
public void chaixian() throws RemoteException, MXException {
System.out.println("拆线");
MboRemote mbo=this.getMbo();
System.out.println(mbo.getString("UNINSTALLOK")+"==");
System.out.println(mbo.getString("UNINSTALLOK")!=null );
System.out.println(!mbo.getString("UNINSTALLOK").equalsIgnoreCase(""));
if ( !mbo.getString("UNINSTALLOK").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前已拆卸,不允许重复执行此操作!");
}
mbo.setValue("UNINSTALLOK",mbo.getUserName(),11L);
mbo.setValue("STATUS","WAPPR",11L);
mbo.getThisMboSet().save();
super.SAVE();
}
}
package com.tohi.webclient.beans.company;
import java.io.PrintStream;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.AppInstance;
public class CustCompanyAppBean extends AppBean
{
// public int SAVE()
// throws MXException, RemoteException
// {
// MboRemote mainMbo = this.app.getAppBean().getMbo();
//
// MboSetRemote compayfpSet = mainMbo.getMboSet("CONTRACTLINE");
//
// double fphstotalcost = 0.0D;
// double bonus = 0.0D;
// double desction = 0.0D;
//
// MboRemote compayfpMbo = null;
// for (int i = 0; (compayfpMbo = compayfpSet.getMbo(i)) != null; i++) {
// if (!compayfpMbo.toBeDeleted()) {
// fphstotalcost += compayfpMbo.getDouble("DESCTION");
// System.out.println(fphstotalcost);
// if (compayfpMbo.getDouble("DESCTION") > 0.0D) {
// compayfpMbo.setValue("OLDDESCTION", compayfpMbo.getDouble("DESCTION"), 11L);
// }
// }
// }
//
// for (int i = 0; (compayfpMbo = compayfpSet.getMbo(i)) != null; i++) {
// if (!compayfpMbo.toBeDeleted()) {
// bonus += compayfpMbo.getDouble("BONUS");
// }
// }
//
// desction = mainMbo.getDouble("DESCTION");
// mainMbo.setValue("SCORE", 75.0D - fphstotalcost - desction + bonus, 11L);
// System.out.println(75.0D - fphstotalcost - desction + bonus);
// super.SAVE();
// return 1;
// }
//
// public int SAVE()
// throws MXException, RemoteException
// {
// MboRemote mainMbo = this.app.getAppBean().getMbo();
// MboSetRemote compayfpSet = mainMbo.getMboSet("CONTRACTLINE");
// double fphstotalcost = 0.0D;
// double bonus = 0.0D;
// double desction = 0.0D;
// MboRemote compayfpMbo = null;
// for (int i = 0; (compayfpMbo = compayfpSet.getMbo(i)) != null; i++) {
// if (!compayfpMbo.toBeDeleted()) {
// fphstotalcost += compayfpMbo.getDouble("DESCTION");
// }
// }
// mainMbo.setValue("CONDESCTION", desction,2L);//将合同行统计后进行赋值
// super.SAVE();
// return 1;
// }
/**
* 启用
* @throws RemoteException
* @throws MXException
*/
public void inactive() throws RemoteException, MXException {
System.out.println("启用");
MboRemote mbo=this.getMbo();
mbo.setValue("ISACTIVE","启用",11L);
mbo.getThisMboSet().save();
super.SAVE();
}
/**
* 挂起
* @throws RemoteException
* @throws MXException
*/
public void disactive() throws RemoteException, MXException {
System.out.println("挂起");
MboRemote mbo=this.getMbo();
mbo.setValue("ISACTIVE","已挂起",11L);
mbo.setValue("HOLDDATE",MXServer.getMXServer().getDate(),11L);
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("VENDOR", mbo.getUserInfo());
mboSet.setWhere("VENDOR = '"+mbo.getString("company")+"' and ISHISTORY=0 and status='已批准'"); //获取相关的数据值
for (int i = 0; i < mboSet.count(); i++) {
MboRemote vendor=mboSet.getMbo(i);
vendor.setValue("ISHISTORY", "1"); //设置为历史
}
mboSet.save();
mbo.getThisMboSet().save();
super.SAVE();
}
}
\ No newline at end of file
package com.tohi.webclient.beans.generalapp;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Date;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.beans.DataBean;
/**
* 运行管理BEAN类
*
*/
public class CustRLShiftsAppBean extends AppBean{
@Override
public synchronized void insert() throws MXException, RemoteException {
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd");
String num=sdf.format(new Date());
String MARKSIGN=getString("MARKSIGN");
num=num+MARKSIGN;//时间+班次
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("RLSHIFTS",MXServer.getMXServer().getSystemUserInfo());
System.out.println("SHIFTNUM---"+num);
mboSet.setWhere("SHIFTNUM = '"+num+"'");
if (mboSet.count()!=0) {
throw new MXApplicationException("日志", "当天已经产生运行交接班记录,无法再次产生!!!");
}
super.insert();
}
@Override
protected void initialize() throws MXException, RemoteException {
super.initialize();
}
@Override
public void initializeApp() throws MXException, RemoteException {
super.initializeApp();
}
@Override
public synchronized void save() throws MXException {
super.save();
System.out.println("保存方法APPBEAN");
}
/**
* 先接班再交班
* @throws RemoteException
* @throws MXException
*/
public void jiaoban() throws RemoteException, MXException {
System.out.println("交班");
MboRemote mbo=this.getMbo();
if (!mbo.getString("FINISHSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前已交班,不允许重复执行此操作!");
}
// if ( mbo.getString("NEXTSHIFTER").equalsIgnoreCase("")) {
// throw new MXApplicationException("提示:", "当前未接班,不允许执行此操作!");
// }
mbo.setValue("FINISHSHIFTER",mbo.getUserName(),11L);
mbo.setValue("FINISHSHIFTTIME",MXServer.getMXServer().getDate(),11L);
this.app.getAppBean().save();
}
/**
* 先接班再交班
* @throws RemoteException
* @throws MXException
*/
public void jieban() throws RemoteException, MXException {
System.out.println("接班");
MboRemote mbo=this.getMbo();
if ( !mbo.getString("NEXTSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前已接班,不允许重复执行此操作!");
}
if ( mbo.getString("FINISHSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前未交班,不允许执行此操作!");
}
if (getString("SHIFTER").equalsIgnoreCase(mbo.getUserName()) ) { //如果当前的操作人是当班运行工程师
throw new MXApplicationException("提示:", "当班运行控制工程师不允许操作接班!");
}
mbo.setValue("NEXTSHIFTER",mbo.getUserName(),11L);
mbo.setValue("NEXTSHIFTERTIME",MXServer.getMXServer().getDate(),11L);
mbo.setValue("ISSHIFTED","Y",11L);
MboSetRemote RLSHIFTSMboSet=MXServer.getMXServer().getMboSet("RLSHIFTS", mbo.getUserInfo());
MboRemote newMbo=RLSHIFTSMboSet.add(11L); //创建接班记录
if (mbo.getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班
newMbo.setValue("MARKSIGN", "M",11L);
}
if (mbo.getString("MARKSIGN").equalsIgnoreCase("M")) { //如果是白班
newMbo.setValue("MARKSIGN", "N",11L);
}
newMbo.setFieldFlag("RLDUTYNUM", 7L, false);
newMbo.setValue("SHIFTTIME", MXServer.getMXServer().getDate(),2L);
RLSHIFTSMboSet.save();
RLSHIFTSMboSet.close();
this.app.getAppBean().save();
}
}
package com.tohi.webclient.beans.generalapp;
import java.rmi.RemoteException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
public class generalappDataBean extends DataBean{
@Override
public synchronized int execute() throws MXException, RemoteException {
return super.execute();
}
}
package com.tohi.webclient.beans.pjoobservation;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Set;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.beans.MultiselectDataBean;
public class CustPjobehaviornoDataBean extends MultiselectDataBean{
protected MboSetRemote getMboSetRemote() throws MXException,
RemoteException {
DataBean appBean = app.getAppBean();
MboRemote groupMbo = appBean.getMbo();
MboSetRemote ms = super.getMboSetRemote();;
System.out.println(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'");
ms.setWhere(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'");
return ms;
}
public int genWorkOrder(MboSetRemote mboSet) throws RemoteException, MXException {
if (mboSet.isEmpty()) {
return 1;
}
MboSetRemote woSet=MXServer.getMXServer().getMboSet("WORKORDER", MXServer.getMXServer().getSystemUserInfo());
HashMap<Long,String> map=new HashMap<Long,String>();
for (int i = 0; i < mboSet.count(); i++) {//遍历所有选择的值
MboRemote tempMbo=mboSet.getMbo(i);
if (tempMbo.isSelected() && tempMbo.getString("WONUM").equalsIgnoreCase("")) {
MboRemote wo=woSet.add(11L);
wo.setValue("DESCRIPTION", tempMbo.getString("ELABORATE"),11L);
wo.setValue("WORKTYPE", "EHS",11L);//
wo.setValue("CUSTFZR", tempMbo.getString("PROPOSER"),11L);
woSet.save(11L);
map.put(tempMbo.getLong("pjobehaviorid"),wo.getString("WONUM"));
}
}
Set<Long> set=map.keySet();
for (Long l:set) {
String wonum=map.get(l);
MboSetRemote PJOBEHAVIORSet=MXServer.getMXServer().getMboSet("PJOBEHAVIOR", MXServer.getMXServer().getSystemUserInfo());
PJOBEHAVIORSet.setWhere(" pjobehaviorid = '"+l+"'");
MboRemote tempMbo=PJOBEHAVIORSet.getMbo(0);
tempMbo.setValue("WONUM", wonum,11L);//回写工单号
tempMbo.setValue("TREATMENTMETHOD", "1",11L);//已整改
PJOBEHAVIORSet.save();
PJOBEHAVIORSet.close();
}
woSet.close();
DataBean appBean = app.getAppBean();
appBean.getMbo().getMboSet("PJOBEHAVIORNO").reset();
appBean.save();
return currentRow;
}
}
package com.tohi.webclient.beans.po;
import psdi.webclient.beans.po.POAppBean;
public class CustpoAppBean extends POAppBean{
}
package com.tohi.webclient.beans.rllog;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Date;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
public class CustRllogAppBean extends AppBean{
@Override
public synchronized void insert() throws MXException, RemoteException {
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
String dateNow=sdformat.format(new Date());
// MboRemote mbo=this.getMbo();
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("Rllog",MXServer.getMXServer().getSystemUserInfo());
System.out.println("dateNow"+dateNow);
mboSet.setWhere("RUNDATE = '"+dateNow+"'");
if (mboSet.count()!=0) {
throw new MXApplicationException("日志", "当天已经产生运行日志,无法再次产生!!!");
}
super.insert();
}
}
package com.tohi.webclient.beans.rllog;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
/**
* 字段绑定类,更改值进行累计
*
*/
public class FldTotalValue extends MboValueAdapter {
@Override
public void validate() throws MXException, RemoteException {
// TODO Auto-generated method stub
super.validate();
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=getMboValue().getMbo();
String valueName=getMboValue().getName();
if (valueName.equalsIgnoreCase("")) {
}
}
}
package com.tohi.webclient.beans.rllog;
import psdi.webclient.system.beans.DataBean;
import java.io.File;
import java.io.IOException;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import jxl.CellType;
import jxl.DateCell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.UploadFile;
import psdi.webclient.system.controller.Utility;
import psdi.webclient.system.controller.WebClientEvent;
public class UploadExcelBean extends DataBean {
String UpLoadType;
String dirName;
int row;
public UploadExcelBean() {
this.UpLoadType = "CLP-JB";
this.row = 0;
this.dirName = "D:\\UpLoadXLS\\RLLOG";
}
public synchronized int execute() throws MXException, RemoteException {
DataBean appBean = Utility.getDataSource(this.sessionContext, this.app.getAppHandler());
WebClientEvent event = this.sessionContext.getCurrentEvent();
UploadFile df = (UploadFile) this.app.get("doclinkfile");
if (df == null) {
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.getAppBean().save();
return 1;
}
try {
String filename = df.getFileName();
String subfilename = filename.substring(filename.indexOf(".") + 1);
if (!subfilename.equalsIgnoreCase("XLS")) {
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.remove("doclinkfile");
return 1;
}
df.setDirectoryName(this.dirName);
df.writeToDisk();
String fileNameInServer = df.getFileName();
df.save();
//上述保存至磁盘中
WorkbookSettings ws = new WorkbookSettings();
// 去除wookbook的读取excel时数据的有效性
ws.setCellValidationDisabled(true);
Workbook workbook = Workbook.getWorkbook(new File(this.dirName + "\\" + fileNameInServer), ws);
Sheet sheet = workbook.getSheet(0);
int maxrow = sheet.getRows();
System.out.println("最大行数为:"+maxrow);
if (maxrow<=0) {
return 1;
}
//获取供应商询价行集合
System.out.println("获取集合");
MboSetRemote MMLOADPLANLINESet = MXServer.getMXServer().getMboSet("MMLOADPLANLINE",
MXServer.getMXServer().getSystemUserInfo());
System.out.println("集合中数据长度为:"+MMLOADPLANLINESet.count());
// long maxID = 0;
System.out.println("遍历数据");
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
MboRemote mbo=appBean.getMbo();
for (this.row = 1; this.row < maxrow; this.row++) {
if (sheet.getCell(0, this.row).getContents().equals("") ) {
System.out.println("进入IF");
break;
}
System.out.println("添加数据");
MboRemote wo = MMLOADPLANLINESet.add();
System.out.println(sheet.getCell(1, row).getContents());
System.out.println(sheet.getCell(2, row).getContents());
System.out.println(sheet.getCell(3, row).getContents());
String startTimeStr= sheet.getCell(1, row).getContents();
String endTimeStr = sheet.getCell(2, row).getContents();
Date sdate=MXServer.getMXServer().getDate();
Date edate=MXServer.getMXServer().getDate();
Calendar start=Calendar.getInstance();
Calendar end=Calendar.getInstance();
start.setTime(sdate);
end.setTime(edate);
Calendar tempDate=Calendar.getInstance();
tempDate.setTime(mbo.getDate("LOADPLANDATE"));
start.set(tempDate.get(Calendar.YEAR), tempDate.get(Calendar.MONTH), tempDate.get(Calendar.DAY_OF_MONTH),
Integer.valueOf(startTimeStr.split(":")[0]),Integer.valueOf(startTimeStr.split(":")[1]),0);
if (this.row==96) {
end.set(tempDate.get(Calendar.YEAR), tempDate.get(Calendar.MONTH), tempDate.get(Calendar.DAY_OF_MONTH),
Integer.valueOf(endTimeStr.split(":")[0]),Integer.valueOf(endTimeStr.split(":")[1]),0);
end.add(5, 1);
}else{
end.set(tempDate.get(Calendar.YEAR), tempDate.get(Calendar.MONTH), tempDate.get(Calendar.DAY_OF_MONTH),
Integer.valueOf(endTimeStr.split(":")[0]),Integer.valueOf(endTimeStr.split(":")[1]),0);
}
String s=sdf.format(start.getTime());
String e=sdf.format(end.getTime());
wo.setValue("STARTTIME",s, 11L);
wo.setValue("ENDTIME", e, 11L);
wo.setValue("VALUE", sheet.getCell(3, row).getContents(), 11L);
wo.setValue("mmloadplanid",mbo.getLong("mmloadplanid"), 11L);
wo.setValue("loadplantype","PLAN", 11L);
}
System.out.println("导入完毕!!!");
MMLOADPLANLINESet.save();
MMLOADPLANLINESet.close();
workbook.close();
this.app.getAppBean().save();
} catch (MXException e) {
Utility.showMessageBox(event, "负荷登记导入错误", e.getMessage() + " 行--" + this.row, null);
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
this.app.remove("doclinkfile");
return 1;
}
// public void viewdetails(long uid) throws MXException, RemoteException {
// DataBean wocmapp = app.getResultsBean();
// wocmapp.resetQbe();
// wocmapp.setQbe("udsafepatrolid", ">=" + String.valueOf(uid));
// wocmapp.reset();
// fireStructureChangedEvent();
// }
}
package com.tohi.webclient.beans.rlrelaymanage;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.beans.MultiselectDataBean;
public class CustrRlreDataBean extends MultiselectDataBean {
@Override
protected MboSetRemote getMboSetRemote() throws MXException,
RemoteException {
DataBean appBean = app.getAppBean();
MboRemote groupMbo = appBean.getMbo();
String PROTEPLATENUM = groupMbo.getString("PROTEPLATENUM");
MboSetRemote ms = super.getMboSetRemote();
System.out.println("进入构造方法筛选===============");
ms.setWhere(" PROTEPLATENUM = '" + PROTEPLATENUM
+ "' and NEEDCLOSE = 0 and PROTEPLATENUM is not null ");
ms.reset();
return ms;
}
public int genRLRELAYMANAGE(MboSetRemote mbo) throws RemoteException,
MXException {// 提交后的位置到当前的方法中
if (mbo.isEmpty()) {
return 1;
}
DataBean appBean = app.getAppBean();
MboRemote groupMbo = appBean.getMbo();// 获取当前父级Mbo
if (groupMbo.getString("ISACTION").equalsIgnoreCase("1")) {
throw new MXApplicationException("温馨提示:", "当前是已生成的记录,无法继续生成");
}
// 执行生成方法
MboSetRemote thisMboSet = groupMbo.getThisMboSet();
// PLATECLOSE
MboSetRemote PLATECLOSESet = MXServer.getMXServer().getMboSet(
"PLATECLOSE", mbo.getUserInfo());
List<Long> list = new ArrayList<Long>();
List<Long> list1 = new ArrayList<Long>();
List<Long> list2 = new ArrayList<Long>();
for (int i = 0; i < mbo.count(); i++) {// 遍历所有选择的值
MboRemote tempMbo = mbo.getMbo(i);
if (tempMbo.isSelected()) {
MboRemote RLRELAYMANAGEmbo = thisMboSet.addAtEnd(11L);
System.out.println("id----------------"
+ RLRELAYMANAGEmbo.getLong("RLRELAYMANAGEID"));
RLRELAYMANAGEmbo.setValue("PROTEPLATELINEID",
tempMbo.getString("PROTEPLATELINEID"), 11L);
RLRELAYMANAGEmbo.setValue("BORDERPERSON",
groupMbo.getString("BORDERPERSON"), 11L);
RLRELAYMANAGEmbo.setValue("PROTEPLATENUM",
groupMbo.getString("PROTEPLATENUM"), 11L);
RLRELAYMANAGEmbo.setValue("BORDERTIME",
groupMbo.getString("BORDERTIME"), 11L);
RLRELAYMANAGEmbo.setValue("BCONTROLLER",
groupMbo.getString("BCONTROLLER"), 11L);
RLRELAYMANAGEmbo.setValue("BACTIONTIME",
groupMbo.getString("BACTIONTIME"), 11L);
RLRELAYMANAGEmbo.setValue("BOPPERSON",
groupMbo.getString("BOPPERSON"), 11L);
RLRELAYMANAGEmbo.setValue("CREATEDATE",
groupMbo.getString("CREATEDATE"), 11L);
RLRELAYMANAGEmbo.setValue("CREATEBY",
groupMbo.getString("CREATEBY"), 11L);
RLRELAYMANAGEmbo.setValue("DEVICENAME",
tempMbo.getString("DEVICENAME"), 11L);
RLRELAYMANAGEmbo.setValue("BREMARK",
groupMbo.getString("BREMARK"), 11L);
if (tempMbo.getString("SIGNOUT").equalsIgnoreCase("Y")) { // 退出
// proteplatelineMbo.setValue("SIGNOUT", 1,11L); //将压板表
// 需要关闭字段改为1
RLRELAYMANAGEmbo.setValue("BCONTENT",
"打开 " + tempMbo.getString("DEVICENAME"), 11L);
list1.add(tempMbo.getLong("PROTEPLATELINEID"));
}
if (tempMbo.getString("SIGNOUT").equalsIgnoreCase("N")) { // 投入
// proteplatelineMbo.setValue("SIGNOUT", 0,11L); //将压板表
// 需要关闭字段改为1
RLRELAYMANAGEmbo.setValue("BCONTENT",
"给上 " + tempMbo.getString("DEVICENAME"), 11L);
list2.add(tempMbo.getLong("PROTEPLATELINEID"));
}
RLRELAYMANAGEmbo.setValue("CHECKDATE1",
groupMbo.getString("CHECKDATE1"), 11L);
RLRELAYMANAGEmbo.setValue("BORDERPERSON1",
groupMbo.getString("BORDERPERSON1"), 11L);
RLRELAYMANAGEmbo.setValue("BORDERTIME1",
groupMbo.getString("BORDERTIME1"), 11L);
RLRELAYMANAGEmbo.setValue("BOPPERSON1",
groupMbo.getString("BOPPERSON1"), 11L);
RLRELAYMANAGEmbo.setValue("BACTIONTIME1",
groupMbo.getString("BACTIONTIME1"), 11L);
RLRELAYMANAGEmbo.setValue("BCONTROLLER1",
groupMbo.getString("BCONTROLLER1"), 11L);
RLRELAYMANAGEmbo.setValue("BCONTENT1",
groupMbo.getString("BCONTENT1"), 11L);
RLRELAYMANAGEmbo.setValue("ISACTION", 1, 11L);
groupMbo.setValue("ISPARENT", 1, 11L);
if (tempMbo.getString("NEEDTRACK").equalsIgnoreCase("Y")) { // 如果进行跟踪
System.out.println(tempMbo.getLong("PROTEPLATELINEID")
+ "~~~~~~~~~~~");
list.add(tempMbo.getLong("PROTEPLATELINEID"));
RLRELAYMANAGEmbo.setValue("NEEDTRACK", 1, 11L);// 将主表的变更为需要跟踪
MboRemote newPLATECLOSEMbo = PLATECLOSESet.add(11L);
newPLATECLOSEMbo.setValue("RLRELAYMANAGEID",
RLRELAYMANAGEmbo.getLong("RLRELAYMANAGEID"));
newPLATECLOSEMbo.setValue("PROTEPLATELINEID",
tempMbo.getString("PROTEPLATELINEID"), 11L);
newPLATECLOSEMbo.setValue("DEVICENAME",
RLRELAYMANAGEmbo.getString("DEVICENAME"));
newPLATECLOSEMbo.setValue("PROTEPLATENUM",
RLRELAYMANAGEmbo.getString("PROTEPLATENUM"));
newPLATECLOSEMbo.setValue("BCONTENT", "给上 "
+ RLRELAYMANAGEmbo.getString("DEVICENAME"));
System.out.println(newPLATECLOSEMbo
.getLong("RLRELAYMANAGEID") + "~~~~~~~~~~~");
}
PLATECLOSESet.save();
thisMboSet.save();
}
}
for (int i = 0; i < list.size(); i++) {
MboSetRemote PROTEPLATELINESet = MXServer.getMXServer().getMboSet(
"PROTEPLATELINE", mbo.getUserInfo());
PROTEPLATELINESet
.setWhere("PROTEPLATELINEID='" + list.get(i) + "'");
MboRemote tempMbo = PROTEPLATELINESet.getMbo(0);
System.out.println(tempMbo.getString("NEEDTRACK")
+ "---------------");
System.out.println("修改 NEEDCLOSE-----11111111");
tempMbo.setValue("NEEDCLOSE", 1, 2L);
PROTEPLATELINESet.save();
}
for (int i = 0; i < list1.size(); i++) {
MboSetRemote PROTEPLATELINESet = MXServer.getMXServer().getMboSet(
"PROTEPLATELINE", mbo.getUserInfo());
PROTEPLATELINESet.setWhere("PROTEPLATELINEID='" + list1.get(i)
+ "'");
MboRemote tempMbo = PROTEPLATELINESet.getMbo(0);
tempMbo.setValue("SIGNOUT", 1, 11L);
PROTEPLATELINESet.save();
}
for (int i = 0; i < list2.size(); i++) {
MboSetRemote PROTEPLATELINESet = MXServer.getMXServer().getMboSet(
"PROTEPLATELINE", mbo.getUserInfo());
PROTEPLATELINESet.setWhere("PROTEPLATELINEID='" + list2.get(i)
+ "'");
MboRemote tempMbo = PROTEPLATELINESet.getMbo(0);
tempMbo.setValue("SIGNOUT", 0, 11L);
PROTEPLATELINESet.save();
}
mbo.close();
PLATECLOSESet.close();
thisMboSet.close();
thisMboSet.reset();
return 1;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package psdi.workflow;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.Vector;
import psdi.app.person.PersonRemote;
import psdi.app.person.PersonSetRemote;
import psdi.app.persongroup.PersonGroupRemote;
import psdi.common.commtmplt.CommTemplateRemote;
import psdi.common.role.MaxRoleRemote;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetEnumeration;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueInfo;
import psdi.mbo.SqlFormat;
import psdi.security.SecurityService;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.server.MaxVarServiceRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.MXFormat;
import psdi.util.logging.MXLogger;
import psdi.workflow.virtual.ShowWFObject;
public class WFAssignment extends Mbo implements WFAssignmentRemote {
private WFInstance instance = null;
private final String[] skipFields = new String[]{"PROCESSNAME", "PROCESSREV", "OBJECTNAME", "DISPLAYONE", "USERSQL", "OWNERDESCRIPTION", "LASTMEMO"};
private OwnerSet ownerSet = null;
boolean personFound = true;
public WFAssignment(MboSet ms) throws RemoteException {
super(ms);
}
public void init() throws MXException {
super.init();
if (!this.toBeAdded()) {
try {
String appname = this.getThisMboSet().getApp();
if (!"WFASSIGNME".equalsIgnoreCase(appname) ) {
this.setFlag(7L, true);
}
if ( "WFASSIGNME".equalsIgnoreCase(appname)) {
this.setFlag(7L, false);
}
} catch (Exception var2) {
var2.printStackTrace();
}
}
}
public void add() throws MXException, RemoteException {
MboRemote ownerNode = this.getOwner();
MboRemote ultimateOwner = null;
MboRemote ownerTask = null;
if (ownerNode != null && ownerNode instanceof WFNodeRemote) {
ultimateOwner = ownerNode.getOwner();
ownerTask = ownerNode.getMboSet("TASK").getMbo(0);
}
if (ownerNode != null && ownerNode instanceof ShowWFObject) {
ownerTask = ownerNode;
ownerNode = ownerNode.getOwner();
ultimateOwner = ownerNode.getOwner();
}
if (ownerTask != null) {
int assignID = ((WFAssignmentSet)this.getThisMboSet()).getNextAssignID();
this.setValue("ASSIGNID", assignID, 11L);
this.setValue("APP", ownerTask.getString("APP"), 11L);
this.setValue("TIMELIMIT", ownerTask.getDouble("TIMELIMIT"), 11L);
this.setValue("EMAILNOTIFICATION", false, 11L);
this.setValue("NODEID", ownerTask.getString("NODEID"), 11L);
this.setValue("PROCESSNAME", ownerTask.getString("PROCESSNAME"), 11L);
this.setValue("PROCESSREV", ownerTask.getString("PROCESSREV"), 11L);
this.setValue("WFID", 0, 11L);
this.setValue("ASSIGNSTATUS", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "DEFAULT", this), 11L);
if (ownerTask instanceof ShowWFObject) {
this.setValue("DESCRIPTION", ownerTask.getString("DESCRIPTION"), 11L);
} else {
this.setValue("DESCRIPTION", ownerNode.getString("DESCRIPTION"), 11L);
}
}
if (ultimateOwner != null && ultimateOwner instanceof WFProcess) {
this.setValue("OWNERTABLE", ultimateOwner.getString("OBJECTNAME"), 11L);
} else if (ultimateOwner instanceof WFCallStack) {
ultimateOwner = ultimateOwner.getOwner();
this.setValue("OWNERTABLE", ultimateOwner.getString("OWNERTABLE"), 11L);
}
}
private void writeTransaction(String transType, String memo) throws MXException, RemoteException {
WFTransactionSet transactionSet = (WFTransactionSet)this.getWFInstance().getMboSet("TRANSACTIONS");
transactionSet.writeTransaction(this, transType, memo == null ? "" : memo);
}
public void complete(String memo) throws RemoteException, MXException {
this.setValue("assignstatus", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "COMPLETE", this), 2L);
this.writeTransaction("WFASSIGNCOMP", memo);
}
public void inactivate() throws RemoteException, MXException {
if (this.isActive()) {
this.setValue("assignstatus", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "INACTIVE", this), 2L);
}
}
public void cancel(String memo) throws RemoteException, MXException {
this.setValue("assignstatus", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "CANCELED", this), 2L);
this.writeTransaction("WFCANCELED", memo);
}
public void escalate() throws MXException, RemoteException {
this.setValue("assignstatus", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "ESCALATED", this), 2L);
this.writeTransaction("WFESCALATED", "");
}
public Date calcDueDate(PersonRemote person, Date startDate) throws RemoteException, MXException {
Date dueDate = null;
if (this.getString("timelimit").equals("0")) {
return startDate;
} else {
String siteOrgType = this.getWFInstance().getControlledMbo().getThisMboSet().getMboSetInfo().getSiteOrgTypeAsString();
if (this.getBoolean("CALENDARBASED") && !siteOrgType.equalsIgnoreCase("SYSTEM")) {
dueDate = person.getEndDateFromCalendar(startDate, this.getString("timelimit"), this.getWFInstance().getControlledMbo().getString("ORGID"));
}
if (dueDate == null) {
double duration = MXFormat.durationToDouble(this.getString("timelimit"));
GregorianCalendar dueCal = new GregorianCalendar();
dueCal.setTime(startDate);
dueCal.add(10, (int)duration);
dueCal.add(12, (int)((duration - (double)((int)duration)) * 60.0D));
dueDate = dueCal.getTime();
}
return dueDate;
}
}
public boolean isActive() throws RemoteException, MXException {
String currentStatus = this.getTranslator().toInternalString("WFASGNSTATUS", this.getString("ASSIGNSTATUS"));
return currentStatus.equals("ACTIVE");
}
public void wfValidate(Vector<MXException> errs) throws MXException, RemoteException {
try {
((WorkFlowService)this.getMboServer()).validateCondition(this, "CONDITIONCLASS", "CONDITION");
} catch (Throwable var5) {
MboRemote node = this.getNode();
Object[] param = new Object[]{this.getString("ASSIGNID"), node.getString("TITLE"), node.getString("DESCRIPTION")};
errs.addElement(new MXApplicationException("workflow", "ValNotValidAssignCond", param, var5));
}
}
public WFTask getTask() throws RemoteException, MXException {
if (this.getOwner() instanceof WFNode) {
return (WFTask)this.getOwner().getMboSet("TASK").getMbo(0);
} else {
return this.getOwner() instanceof WFTask ? (WFTask)this.getOwner() : (WFTask)this.getMboSet("$task", "WFTask", "processname = :processname and processrev=:processrev and nodeid=:nodeid").getMbo(0);
}
}
public WFInstanceRemote getWFInstance() throws MXException, RemoteException {
return this.getInstance();
}
public WFInstance getInstance() throws MXException, RemoteException {
if (this.instance == null) {
MboRemote owner = this.getOwner();
if (owner instanceof WFInstance) {
this.instance = (WFInstance)this.getOwner();
} else if (owner instanceof WFNode) {
this.instance = ((WFNode)owner).getWFInstance();
} else {
MboSetRemote instSet = MXServer.getMXServer().getMboSet("WFINSTANCE", this.getUserInfo());
SqlFormat sqf = new SqlFormat(this, "wfid = :wfid");
instSet.setWhere(sqf.format());
this.instance = (WFInstance)instSet.getMbo(0);
}
}
return this.instance;
}
public WFNodeRemote getNode() throws MXException, RemoteException {
if (this.getOwner() instanceof WFNode) {
return (WFNodeRemote)this.getOwner();
} else {
return (WFNodeRemote)(this.getOwner() instanceof WFTask ? this.getTask().getNode() : (WFNodeRemote)this.getMboSet("$node", "WFNode", "processname = :processname and processrev=:processrev and nodeid=:nodeid").getMbo(0));
}
}
public boolean evaluateAssignmentCondition() throws MXException, RemoteException {
if (this.isNull("CONDITION") && this.isNull("CONDITIONCLASS")) {
return true;
} else {
MboRemote target = this.getInstance().getControlledMbo();
return ((WorkFlowService)this.getMboServer()).evaluateCondition(this, this.getString("CONDITIONCLASS"), this.getString("CONDITION"), target);
}
}
public void generateAssignments() throws RemoteException, MXException {
MXLogger log = ((WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW")).getWFLogger();
if (!this.isNull("ROLEID")) {
log.info("Generating for role " + this.getString("ROLEID") + ".");
this.generateForRole((MaxRoleRemote)this.getMboSet("ROLE").getMbo(0));
} else {
log.info("Generating for relationship " + this.getString("RELATIONSHIP") + ".");
MboRemote controlled = this.getInstance().getControlledMbo();
List relatedList = controlled.getMboList(this.getString("RELATIONSHIP"));
this.generateForRelationship(relatedList);
}
log.info("Assignments generated.");
}
private void generateForRelationship(List<MboRemote> relatedList) throws RemoteException, MXException {
String templateDescription = this.getString("DESCRIPTION");
Iterator iterator = relatedList.iterator();
while(iterator.hasNext()) {
if (this.getBoolean("SEPARATEGROUPS")) {
MboSetRemote activeGroupSet = this.getInstance().getMboSet("NEWGROUPS");
int maxGroupNum = (int)activeGroupSet.max("GROUPNUM");
int groupNum = maxGroupNum + 1;
this.setValue("GROUPNUM", groupNum, 2L);
MboRemote newGroup = activeGroupSet.add();
newGroup.setValue("GROUPNUM", groupNum, 3L);
newGroup.setValue("FIRSTCOMPLETE", true, 3L);
}
MboRemote member = (MboRemote)iterator.next();
this.setValue("DESCRIPTION", templateDescription, 11L);
this.substituteValues("DESCRIPTION", member);
if (member.getName().equals("PERSON")) {
this.generateForPerson((PersonRemote)member);
} else if (member.getName().equals("PERSONGROUP")) {
this.generateForGroup((PersonGroupRemote)member);
} else if (member.getName().equals("MAXROLE")) {
this.generateForRole((MaxRoleRemote)member);
}
}
}
private boolean acceptingWFEmail(PersonRemote pr) throws RemoteException, MXException {
String wfMailElection;
if (pr.isNull("WFMAILELECTION")) {
wfMailElection = "PROCESS";
} else {
wfMailElection = this.getTranslator().toInternalString("WFMAILELECTION", pr.getString("WFMAILELECTION"));
}
if (wfMailElection.equalsIgnoreCase("NEVER")) {
return false;
} else {
if (wfMailElection.equalsIgnoreCase("CONDITIONAL")) {
if (!pr.getBoolean("ACCEPTINGWFMAIL")) {
return false;
}
pr.setValue("ACCEPTINGWFMAIL", false, 2L);
} else if (wfMailElection.equalsIgnoreCase("PROCESS") && !this.getBoolean("emailnotification")) {
return false;
}
return true;
}
}
private void activate(PersonRemote person) throws RemoteException, MXException {
MXServer mxServer = MXServer.getMXServer();
WFInstanceRemote wfInstance = this.getWFInstance();
wfInstance.getControlledMbo().setReferencedMbo("&WFASSIGNMENT&", this);
this.setValue("WFID", wfInstance.getLong("WFID"), 2L);
this.setValue("OWNERTABLE", wfInstance.getString("OWNERTABLE"), 2L);
this.setValue("OWNERID", wfInstance.getLong("OWNERID"), 2L);
Date startDate = mxServer.getDate();
this.setValue("STARTDATE", startDate, 2L);
this.setValue("DUEDATE", this.calcDueDate(person, startDate), 2L);
this.getMboValue("ASSIGNID").generateUniqueID();
this.setValue("ASSIGNSTATUS", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "ACTIVE", this), 2L);
this.setValue("ASSIGNCODE", person.getString("PERSONID"), 2L);
this.setValue("ORIGPERSON", person.getString("PERSONID"), 2L);
this.substituteValues("DESCRIPTION", wfInstance.getControlledMbo());
if (this.getBoolean("EMAILNOTIFICATION") && this.acceptingWFEmail(person)) {
this.sendNotification(person);
}
wfInstance.getControlledMbo().setReferencedMbo("&WFASSIGNMENT&", (Mbo)null);
}
private void substituteValues(String attr, MboRemote sourceMbo) throws RemoteException, MXException {
MboValueInfo mvi = this.getMboSetInfo().getAttribute(attr);
int attrLength = mvi.getLength();
MXServer mxServer = MXServer.getMXServer();
if (this.getMboValue(attr).getMboValueInfo().isMLInUse()) {
String baseLangCode = mxServer.getBaseLang();
String[][] langList = mxServer.getLanguageList();
for(int i = 0; i < langList.length; ++i) {
String langCode = langList[i][0];
String val = this.getString(attr, langCode);
if (val == null) {
val = "";
}
if (val.length() >= attrLength) {
val = val.substring(0, attrLength);
}
if (val.equals("") && langCode.equals(baseLangCode)) {
val = this.getString(attr);
}
if (!val.equals("")) {
SqlFormat sqf = new SqlFormat(sourceMbo, val);
sqf.setIgnoreUnresolved(true);
this.setMLValue(attr, langCode, sqf.resolveContent(), 11L);
}
}
} else {
SqlFormat sqf = new SqlFormat(sourceMbo, this.getString(attr));
sqf.setIgnoreUnresolved(true);
String val = sqf.resolveContent();
if (val.length() >= attrLength) {
val = val.substring(0, attrLength);
}
this.setValue(attr, val, 11L);
}
}
public void sendNotification(PersonRemote person) throws RemoteException, MXException {
MboSetRemote templateSet = null;
UserInfo ui = this.getUserInfo();
Locale l = null;
TimeZone tz = null;
try {
MaxVarServiceRemote maxvarServiceRemote = (MaxVarServiceRemote)MXServer.getMXServer().lookup("MAXVARS");
String targetLocale = maxvarServiceRemote.getString("BMXWFLOCALE", "");
if (targetLocale != null && !targetLocale.equals("")) {
l = ui.getLocale();
ui.setLocale(targetLocale);
}
String targetTZ = maxvarServiceRemote.getString("BMXWFTIMEZONE", "");
if (targetTZ != null && !targetTZ.equals("")) {
tz = ui.getTimeZone();
ui.setTimeZone(targetTZ);
}
templateSet = this.getMboSet("COMMTEMPLATE");
templateSet.setFlag(7L, false);
CommTemplateRemote template = (CommTemplateRemote)templateSet.getMbo(0);
MboSetRemote sendToSet = template.getMboSet("COMMTMPLT_TO");
MboRemote sendTo = sendToSet.add(2L);
sendTo.setValue("SENDTO", true, 2L);
sendTo.setValue("TYPE", "PERSON", 3L);
sendTo.setValue("SENDTOVALUE", person.getString("PERSONID"), 3L);
String subject = template.getString("SUBJECT");
SqlFormat sqf = new SqlFormat(this, subject);
sqf.setIgnoreUnresolved(true);
sqf.setNoSpaces(true);
subject = sqf.simpleFormat();
template.setValue("SUBJECT", subject, 2L);
String message = template.getString("MESSAGE");
SqlFormat sqf1 = new SqlFormat(this, message);
sqf1.setIgnoreUnresolved(true);
sqf1.setNoSpaces(true);
message = sqf1.simpleFormat();
template.setValue("MESSAGE", message, 2L);
String getProcessClause = "processname = :processname and processrev = (select processrev from wfrevision where mainprocess = :processname and revision = :revision and processname = :processname)";
MboRemote wfProcess = this.getInstance().getMboSet("$GetProcess", "WFPROCESS", getProcessClause).getMbo(0);
template.sendMessage(this.getInstance().getControlledMbo(), wfProcess);
} catch (Throwable var21) {
MXServer mxServer = MXServer.getMXServer();
MXLogger log = ((WorkFlowServiceRemote)mxServer.lookup("WORKFLOW")).getWFLogger();
if (log.isErrorEnabled()) {
Object[] param = new Object[]{this.getString("PROCESSNAME"), this.getString("PROCESSREV")};
log.error(new MXApplicationException("workflow", "EmailNotSentAsgn", param, var21));
}
} finally {
if (templateSet != null) {
templateSet.reset();
}
if (l != null) {
ui.setLocale(l);
}
if (tz != null) {
ui.setTimeZone(tz);
}
}
}
public void escalate(String memo) throws MXException, RemoteException {
if (!this.isNull("ESCROLE") && this.isActive()) {
if (!this.getString("ASSIGNCODE").equals(this.getUserInfo().getPersonId())) {
SecurityService ssr = (SecurityService)MXServer.getMXServer().lookup("SECURITY");
UserInfo assignedUser = ssr.authenticateUser(this.getUserID(this.getString("ASSIGNCODE")), true);
MboSetRemote instSet = MXServer.getMXServer().getMboSet("WFINSTANCE", assignedUser);
SqlFormat sqf = new SqlFormat(this, "wfid = :wfid");
this.getMXTransaction().add(instSet.getMXTransaction());
instSet.setWhere(sqf.format());
this.instance = (WFInstance)instSet.getMbo(0);
this.instance.escalateAssignment(this.getString("ASSIGNID"), memo);
} else if (this.getOwner() instanceof WFInstance) {
WFAssignment escAssign = (WFAssignment)this.copy();
escAssign.getMboValue("ASSIGNID").generateUniqueID();
escAssign.setValue("PROCESSNAME", this.getString("PROCESSNAME"), 2L);
escAssign.setValue("PROCESSREV", this.getString("PROCESSREV"), 2L);
escAssign.setValue("ROLEID", this.getString("ESCROLE"), 2L);
escAssign.setValueNull("ESCROLE", 2L);
escAssign.setValue("ORIGPERSON", this.getString("ORIGPERSON"), 2L);
escAssign.setValueNull("CONDITION", 2L);
escAssign.setValueNull("CONDITIONCLASS", 2L);
escAssign.generateForRole((MaxRoleRemote)escAssign.getMboSet("ROLE").getMbo(0));
escAssign.delete();
this.setValue("ASSIGNSTATUS", this.getTranslator().toExternalDefaultValue("WFASGNSTATUS", "ESCALATED", this), 2L);
this.writeTransaction("WFESCALATED", memo);
} else {
this.getInstance().escalateAssignment(this.getString("ASSIGNID"), memo);
}
} else {
throw new MXApplicationException("workflow", "NoEscalate");
}
}
protected boolean skipCopyField(MboValueInfo mvi) throws RemoteException, MXException {
String copyField = mvi.getName();
int nf = this.skipFields.length;
for(int x = 0; x < nf; ++x) {
if (copyField.equals(this.skipFields[x])) {
return true;
}
}
return false;
}
public MboSetRemote getMboSet(String name) throws MXException, RemoteException {
if (name.equalsIgnoreCase("OWNER")) {
if (this.ownerSet == null) {
this.ownerSet = new OwnerSet(this);
this.ownerSet.setOwner(this);
}
return this.ownerSet;
} else {
return super.getMboSet(name);
}
}
private String getUserID(String personid) throws MXException, RemoteException {
String sql = "personid = :1";
SqlFormat sqf = new SqlFormat(sql);
sqf.setObject(1, "MAXUSER", "personid", personid);
String userid = "";
MboSetRemote userSet = this.getMboSet("$GETMAXUSER1", "MAXUSER", sqf.format());
if (!userSet.isEmpty()) {
userid = userSet.getMbo(0).getString("USERID");
}
return userid;
}
public void generateForRole(MaxRoleRemote role) throws RemoteException, MXException {
WFInstance instanceMbo = this.getInstance();
PersonSetRemote people = role.resolveRole(instanceMbo.getControlledMbo());
if (people != null && !people.isEmpty()) {
MboSetEnumeration mse = new MboSetEnumeration(people);
while(mse.hasMoreElements()) {
PersonRemote person = (PersonRemote)mse.nextMbo();
this.generateForPerson(person);
}
} else {
if (this.isNull("groupnum")) {
this.personFound = false;
}
}
}
public void generateForGroup(PersonGroupRemote group) throws RemoteException, MXException {
this.setValue("ROLEID", group.getString("PERSONGROUP"), 11L);
MboSetRemote people = group.getMboSet("ALLPEOPLEINPERSONGROUP");
MboSetEnumeration mse = new MboSetEnumeration(people);
while(mse.hasMoreElements()) {
PersonRemote person = (PersonRemote)mse.nextMbo();
this.generateForPerson(person);
}
}
public void generateForPerson(PersonRemote person) throws RemoteException, MXException {
WFInstance instanceMbo = this.getInstance();
WFAssignmentSet activeSet = (WFAssignmentSet)instanceMbo.getMboSet("ACTIVEASSIGNMENTS");
PersonRemote personLast = person.getLastDelegate(person, (Date)null);
this.activeAssignment(personLast, activeSet);
if (this.getBoolean("KEEPORIGASSGN") && personLast.getLong("personuid") != person.getLong("personuid")) {
this.activeAssignment(person, activeSet);
}
}
public void activeAssignment(PersonRemote person, WFAssignmentSet activeSet) throws RemoteException, MXException {
MXServer.getBulletinBoard().post("MultiLangCopy");
WFAssignment activeAssignment = null;
try {
activeAssignment = (WFAssignment)this.copy(activeSet);
} finally {
MXServer.getBulletinBoard().remove("MultiLangCopy");
}
activeAssignment.setValue("PROCESSNAME", this.getString("PROCESSNAME"), 3L);
activeAssignment.setValue("PROCESSREV", this.getString("PROCESSREV"), 3L);
activeAssignment.activate(person);
}
public boolean foundPersonToAssignForRole() throws MXException, RemoteException {
return this.personFound;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package psdi.workflow;
import java.rmi.RemoteException;
import psdi.common.condition.CustomCondition;
import psdi.common.parse.ParserServiceRemote;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.SqlFormat;
import psdi.security.UserInfo;
import psdi.server.AppService;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory;
import psdi.workflow.virtual.InitiateWorkflowMboSetRemote;
public class WorkFlowService extends AppService implements WorkFlowServiceRemote {
public WorkFlowService() throws RemoteException {
}
public WorkFlowService(MXServer mxServer) throws RemoteException {
super(mxServer);
}
public void init() {
super.init();
try {
AutoInitCacheFactory autoInitCachefactory = AutoInitCacheFactory.getInstance();
this.getMXServer().addToMaximoCache(autoInitCachefactory.getName(), autoInitCachefactory);
WorkflowCacheFactory workflowCacheFactory = WorkflowCacheFactory.getInstance();
this.getMXServer().addToMaximoCache(workflowCacheFactory.getName(), workflowCacheFactory);
WFInstanceListener.init();
} catch (Throwable var3) {
MXException mxe = new MXApplicationException("system", "ServiceInitFailed", var3);
this.getServiceLogger().fatal(mxe);
}
}
public void destroy() {
super.destroy();
WFInstanceListener.destroy();
}
public WFInstanceSetRemote getActiveInstances(MboRemote mbo) throws MXException, RemoteException {
WFInstanceSetRemote pSet = (WFInstanceSetRemote)this.getMboSet("WFINSTANCE", mbo.getUserInfo());
SqlFormat sql = new SqlFormat(mbo.getUserInfo(), "ownertable = :1 and ownerid = :2 and active = :yes");
sql.setObject(1, "WFINSTANCE", "OWNERTABLE", mbo.getName());
sql.setLong(2, mbo.getUniqueIDValue());
pSet.setWhere(sql.format());
return pSet;
}
public void validateCondition(MboRemote onBehalfOf, String customAttr, String condAttr) throws RemoteException, MXException {
if (!onBehalfOf.isNull(condAttr)) {
ParserServiceRemote psr = (ParserServiceRemote)MXServer.getMXServer().lookup("PARSER");
MboRemote owner;
for(owner = onBehalfOf.getOwner(); !(owner instanceof WFProcess); owner = owner.getOwner()) {
}
MboSetRemote mboset = this.getMXServer().getMboSet(owner.getString("objectname"), owner.getUserInfo());
MboRemote mbo = mboset.getZombie();
psr.parse(onBehalfOf.getString(condAttr), mbo);
} else if (!onBehalfOf.isNull(customAttr)) {
String customclass = onBehalfOf.getString(customAttr);
try {
Object cc = Class.forName(customclass).newInstance();
if (!(cc instanceof CustomCondition)) {
throw new MXApplicationException("workflow", "NotCCI", new Object[]{customclass});
}
} catch (Throwable var8) {
MboRemote owner;
for(owner = onBehalfOf.getOwner(); !(owner instanceof WFProcess); owner = owner.getOwner()) {
}
Object[] param = new Object[]{customclass, owner.getString("PROCESSNAME")};
throw new MXApplicationException("workflow", "LoadConditionCustomClass", param);
}
}
}
public boolean evaluateCondition(Mbo onBehalfOf, String customclass, String condition, MboRemote mbo) throws MXException, RemoteException {
return customclass != null && !customclass.equals("") ? this.evaluateCustomCondition(onBehalfOf, customclass, mbo) : this.evaluateMboCondition(condition, mbo);
}
private boolean evaluateCustomCondition(Mbo onBehalfOf, String classname, MboRemote mbo) throws MXException, RemoteException {
try {
CustomCondition cc = (CustomCondition)Class.forName(classname).newInstance();
return cc.evaluateCondition(mbo, onBehalfOf);
} catch (Exception var10) {
MXLogger log = this.getWFLogger(onBehalfOf);
String behalfOf;
Object instance;
if (onBehalfOf instanceof WFAssignment) {
instance = ((WFAssignment)onBehalfOf).getWFInstance();
behalfOf = "condition assignment with AssignID of " + onBehalfOf.getString("ASSIGNID");
} else {
MboRemote node = ((WFCondition)onBehalfOf).getNode();
instance = ((WFCondition)onBehalfOf).getWFInstance();
behalfOf = "node " + node.getString("TITLE");
}
String processName = ((MboRemote)instance).getString("PROCESSNAME");
if (log.isFatalEnabled()) {
log.fatal("Unable to load custom condition class " + classname + " for workflow process " + processName + ", " + behalfOf + ", on " + ((MboRemote)instance).getString("OWNERTABLE") + " Mbo with key of " + ((MboRemote)instance).getString("OWNERID"), var10);
}
Object[] params = new Object[]{classname, processName};
throw new MXApplicationException("workflow", "LoadConditionCustomClass", params, var10);
}
}
private boolean evaluateMboCondition(String condition, MboRemote mbo) throws MXException, RemoteException {
ParserServiceRemote psr = (ParserServiceRemote)MXServer.getMXServer().lookup("PARSER");
return psr.getBoolean(condition, mbo);
}
public void initiateWorkflow(String processName, MboRemote target) throws MXException, RemoteException {
WFInstanceRemote instanceCreated = null;
MboRemote paramMbo = null;
try {
UserInfo ui = target.getUserInfo();
InitiateWorkflowMboSetRemote iwSet = (InitiateWorkflowMboSetRemote)this.getMboSet("INITIATEWORKFLOW", ui);
iwSet.setControlee(target);
paramMbo = iwSet.setup();
paramMbo.setValue("PROCESSNAME", processName);
iwSet.execute();
instanceCreated = iwSet.getInstance();
if (!instanceCreated.atStoppingPoint()) {
throw new MXApplicationException("workflow", "BgFailure");
}
} catch (MXException var8) {
MXLogger log = this.getWFLogger((Mbo)paramMbo);
if (!var8.getErrorGroup().equalsIgnoreCase("workflow") || !var8.getErrorKey().equalsIgnoreCase("InstanceActive")) {
if (log.isErrorEnabled()) {
log.error("Workflow " + processName + " started in background threw an exception, unable to initiate.", var8);
}
Object[] param = new Object[]{processName};
throw new MXApplicationException("workflow", "BgInitFailure", param, var8);
}
MXException warning = new MXApplicationException("workflow", "InstanceAlready", new Object[]{processName});
log.warn(warning.getMessage());
target.getThisMboSet().addWarning(warning);
}
}
public MXLogger getWFLogger() throws MXException, RemoteException {
return MXLoggerFactory.getLogger("maximo.workflow");
}
public MXLogger getWFLogger(Mbo mbo) throws MXException, RemoteException {
MXLogger newWFLogger = null;
StringBuffer buf = new StringBuffer();
buf.append("maximo.workflow");
buf.append(".");
buf.append(mbo.getThisMboSet().getMboSetInfo().getServiceName());
buf.append(".");
buf.append(mbo.getName());
String loggerName = buf.toString();
newWFLogger = MXLoggerFactory.getLogger(loggerName);
return newWFLogger;
}
public void completeAssignmentapp(WFAssignmentRemote assign, String memo, boolean accepted, String actionid, String sfxzz) throws MXException, RemoteException {
WFInstanceRemote instance = null;
try {
if (!assign.isActive()) {
throw new MXApplicationException("workflow", "NotActiveNoComplete");
} else {
instance = assign.getWFInstance();
WFActionSetRemote actionSet = (WFActionSetRemote)assign.getMboSet("ACTIONS");
if ("Y".equalsIgnoreCase(sfxzz)) {
MboRemote actionTaken = actionSet.getAction(true);
instance.completeWorkflowAssignment(assign.getString("ASSIGNID"), actionTaken.getInt("ACTIONID"), memo);
instance.completeWorkflowAssignment(assign.getString("ASSIGNID"), Integer.parseInt(actionid), memo);
} else {
instance.completeWorkflowAssignment(assign.getString("ASSIGNID"), Integer.parseInt(actionid), memo);
}
if (!instance.atStoppingPoint()) {
throw new MXApplicationException("workflow", "BgFailure");
}
}
} catch (MXException var11) {
if (instance != null) {
instance.getThisMboSet().getMXTransaction().rollback();
}
MXLogger log = this.getWFLogger();
String processName = assign.getString("PROCESSNAME");
if (log.isErrorEnabled()) {
log.error("Completing an assignment on an instance of Workflow " + processName + " in background threw an exception.", var11);
}
Object[] param = new Object[]{processName};
throw new MXApplicationException("workflow", "BgCompFailure", param, var11);
}
}
public void completeAssignment(WFAssignmentRemote assign, String memo, boolean accepted) throws MXException, RemoteException {
WFInstanceRemote instance = null;
try {
if (!assign.isActive()) {
throw new MXApplicationException("workflow", "NotActiveNoComplete");
} else {
instance = assign.getWFInstance();
WFActionSetRemote actionSet = (WFActionSetRemote)assign.getMboSet("ACTIONS");
MboRemote actionTaken = actionSet.getAction(accepted);
instance.completeWorkflowAssignment(assign.getString("ASSIGNID"), actionTaken.getInt("ACTIONID"), memo);
if (!instance.atStoppingPoint()) {
throw new MXApplicationException("workflow", "BgFailure");
}
}
} catch (MXException var9) {
if (instance != null) {
instance.getThisMboSet().getMXTransaction().rollback();
}
MXLogger log = this.getWFLogger();
String processName = assign.getString("PROCESSNAME");
if (log.isErrorEnabled()) {
log.error("Completing an assignment on an instance of Workflow " + processName + " in background threw an exception.", var9);
}
Object[] param = new Object[]{processName};
throw new MXApplicationException("workflow", "BgCompFailure", param, var9);
}
}
public boolean isActiveProcess(String processName, String mboName, UserInfo ui) throws MXException, RemoteException {
SqlFormat sqf = new SqlFormat("processname = :1 and objectname = :2 and active = :yes");
sqf.setObject(1, "WFPROCESS", "PROCESSNAME", processName);
sqf.setObject(2, "WFPROCESS", "OBJECTNAME", mboName);
MboSetRemote wfProcessSet = this.getMboSet("WFPROCESS", ui);
wfProcessSet.setWhere(sqf.format());
return !wfProcessSet.notExist();
}
public String getDefaultAppForObject(UserInfo ui, String objectName) throws MXException, RemoteException {
String hardCodedDefault = null;
if (objectName.equals("WORKORDER")) {
hardCodedDefault = "WOTRACK";
} else if (objectName.equals("SR")) {
hardCodedDefault = "SR";
} else if (objectName.equals("SOLUTION")) {
hardCodedDefault = "SOLUTION";
} else if (objectName.equals("PO")) {
hardCodedDefault = "PO";
} else if (objectName.equals("LOCATIONS")) {
hardCodedDefault = "LOCATION";
} else if (objectName.equals("MR")) {
hardCodedDefault = "VIEWDR";
} else if (objectName.equals("REPORT")) {
hardCodedDefault = "REPORT";
} else if (objectName.equals("CONTRACT")) {
hardCodedDefault = "CONTMASTER";
} else if (objectName.equals("WFPROCESS")) {
hardCodedDefault = "WFDESIGN";
} else if (objectName.equals("SCCONFIG")) {
hardCodedDefault = "SCCONFIG";
}
MboSetRemote apps;
SqlFormat sqf;
if (hardCodedDefault != null) {
apps = this.getMboSet("MAXAPPS", ui);
sqf = new SqlFormat(ui, "maintbname = :1 and app = :2");
sqf.setObject(1, "MAXAPPS", "MAINTBNAME", objectName);
sqf.setObject(2, "MAXAPPS", "APP", hardCodedDefault);
apps.setWhere(sqf.format());
if (!apps.isEmpty()) {
return apps.getMbo(0).getString("APP");
}
}
apps = this.getMboSet("MAXAPPS", ui);
sqf = new SqlFormat(ui, "maintbname = :1");
sqf.setObject(1, "MAXAPPS", "MAINTBNAME", objectName);
apps.setWhere(sqf.format());
return apps.isEmpty() ? null : apps.getMbo(0).getString("APP");
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package psdi.workflow;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.security.UserInfo;
import psdi.server.AppServiceRemote;
import psdi.util.MXException;
import psdi.util.logging.MXLogger;
public interface WorkFlowServiceRemote extends AppServiceRemote {
String LOGGERNAME_WORKFLOW = "maximo.workflow";
WFInstanceSetRemote getActiveInstances(MboRemote var1) throws MXException, RemoteException;
void initiateWorkflow(String var1, MboRemote var2) throws MXException, RemoteException;
MXLogger getWFLogger() throws MXException, RemoteException;
MXLogger getWFLogger(Mbo var1) throws MXException, RemoteException;
void completeAssignment(WFAssignmentRemote var1, String var2, boolean var3) throws MXException, RemoteException;
void completeAssignmentapp(WFAssignmentRemote var1, String var2, boolean var3, String var4, String var5) throws MXException, RemoteException;
boolean isActiveProcess(String var1, String var2, UserInfo var3) throws MXException, RemoteException;
String getDefaultAppForObject(UserInfo var1, String var2) throws MXException, RemoteException;
}
package tohi.app.basemanage;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CyclemanagementMbo extends Mbo implements MboRemote{
public CyclemanagementMbo(MboSet ms) throws RemoteException {
super(ms);
}
//定时任务执行方法
public void runTask(MboRemote createMbo) throws RemoteException, MXException {
System.out.println("执行任务实例");
MXServer mxservers = MXServer.getMXServer();
MboSetRemote WORKTASTSETSet=mxservers.getMboSet("WORKTASK", this.getUserInfo());
MboRemote mboWo = WORKTASTSETSet.add(); // 新增任务
// 获取
mboWo.setValue("PLANMAN", createMbo.getString("CREATEBY"), 11L);// 创建人
mboWo.setValue("WORKMAN", createMbo.getString("WORKMAN"), 11L);// 工作负责人
mboWo.setValue("STATUSDATE", mxservers.getDate(), 11L);// 状态时间
mboWo.setValue("NAME", createMbo.getString("NAME"), 11L);// 工作名称
mboWo.setValue("CONTENT", createMbo.getString("CONTENT"), 11L);// 工作内容
WORKTASTSETSet.save();
}
}
package tohi.app.basemanage;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CyclemanagementMboSet extends MboSet implements MboSetRemote{
public CyclemanagementMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
// TODO Auto-generated method stub
return new CyclemanagementMbo(arg0);
}
}
package tohi.app.cron;
public class C_Tikuser {
private String TU_TYPE;
private String TU_PRCODE;
private String TU_PRID;
private String TU_PRINID;
private String TU_PRNO;
private String TU_PRNAME;
private String TU_USID;
private String TU_USNAME;
private String TU_IDCARDS;
private String TU_CODE;
private String TU_NAME;
private String TU_MOBILE;
private String TU_BIRTHDAY;
private String TU_EDUCATION;
private String TU_JOBTITLE;
private String TU_SCORE1;
private String TU_SCORE2;
private String TU_SCORE3;
private String TU_JOBS;
private String TU_JOBNMS;
private String TU_TYEAM;
private String TU_TYNM;
private String TU_SCORE;
private String TU_START;
private String TU_END;
private String TU_SUCODE;
private String TU_SUNAME;
private String TU_SHORTNAME;
private String TU_IFPASS;
private String TU_UPDATE;
private String TU_SYNC;
private String TU_SYNCTIME;
private String TU_COMPANY;
public String getTU_TYPE() {
return TU_TYPE;
}
public void setTU_TYPE(String tU_TYPE) {
TU_TYPE = tU_TYPE;
}
public String getTU_PRCODE() {
return TU_PRCODE;
}
public void setTU_PRCODE(String tU_PRCODE) {
TU_PRCODE = tU_PRCODE;
}
public String getTU_PRID() {
return TU_PRID;
}
public void setTU_PRID(String tU_PRID) {
TU_PRID = tU_PRID;
}
public String getTU_PRINID() {
return TU_PRINID;
}
public void setTU_PRINID(String tU_PRINID) {
TU_PRINID = tU_PRINID;
}
public String getTU_PRNO() {
return TU_PRNO;
}
public void setTU_PRNO(String tU_PRNO) {
TU_PRNO = tU_PRNO;
}
public String getTU_PRNAME() {
return TU_PRNAME;
}
public void setTU_PRNAME(String tU_PRNAME) {
TU_PRNAME = tU_PRNAME;
}
public String getTU_USID() {
return TU_USID;
}
public void setTU_USID(String tU_USID) {
TU_USID = tU_USID;
}
public String getTU_USNAME() {
return TU_USNAME;
}
public void setTU_USNAME(String tU_USNAME) {
TU_USNAME = tU_USNAME;
}
public String getTU_IDCARDS() {
return TU_IDCARDS;
}
public void setTU_IDCARDS(String tU_IDCARDS) {
TU_IDCARDS = tU_IDCARDS;
}
public String getTU_CODE() {
return TU_CODE;
}
public void setTU_CODE(String tU_CODE) {
TU_CODE = tU_CODE;
}
public String getTU_NAME() {
return TU_NAME;
}
public void setTU_NAME(String tU_NAME) {
TU_NAME = tU_NAME;
}
public String getTU_MOBILE() {
return TU_MOBILE;
}
public void setTU_MOBILE(String tU_MOBILE) {
TU_MOBILE = tU_MOBILE;
}
public String getTU_BIRTHDAY() {
return TU_BIRTHDAY;
}
public void setTU_BIRTHDAY(String tU_BIRTHDAY) {
TU_BIRTHDAY = tU_BIRTHDAY;
}
public String getTU_EDUCATION() {
return TU_EDUCATION;
}
public void setTU_EDUCATION(String tU_EDUCATION) {
TU_EDUCATION = tU_EDUCATION;
}
public String getTU_JOBTITLE() {
return TU_JOBTITLE;
}
public void setTU_JOBTITLE(String tU_JOBTITLE) {
TU_JOBTITLE = tU_JOBTITLE;
}
public String getTU_SCORE1() {
return TU_SCORE1;
}
public void setTU_SCORE1(String tU_SCORE1) {
TU_SCORE1 = tU_SCORE1;
}
public String getTU_SCORE2() {
return TU_SCORE2;
}
public void setTU_SCORE2(String tU_SCORE2) {
TU_SCORE2 = tU_SCORE2;
}
public String getTU_SCORE3() {
return TU_SCORE3;
}
public void setTU_SCORE3(String tU_SCORE3) {
TU_SCORE3 = tU_SCORE3;
}
public String getTU_JOBS() {
return TU_JOBS;
}
public void setTU_JOBS(String tU_JOBS) {
TU_JOBS = tU_JOBS;
}
public String getTU_JOBNMS() {
return TU_JOBNMS;
}
public void setTU_JOBNMS(String tU_JOBNMS) {
TU_JOBNMS = tU_JOBNMS;
}
public String getTU_TYEAM() {
return TU_TYEAM;
}
public void setTU_TYEAM(String tU_TYEAM) {
TU_TYEAM = tU_TYEAM;
}
public String getTU_TYNM() {
return TU_TYNM;
}
public void setTU_TYNM(String tU_TYNM) {
TU_TYNM = tU_TYNM;
}
public String getTU_SCORE() {
return TU_SCORE;
}
public void setTU_SCORE(String tU_SCORE) {
TU_SCORE = tU_SCORE;
}
public String getTU_START() {
return TU_START;
}
public void setTU_START(String tU_START) {
TU_START = tU_START;
}
public String getTU_END() {
return TU_END;
}
public void setTU_END(String tU_END) {
TU_END = tU_END;
}
public String getTU_SUCODE() {
return TU_SUCODE;
}
public void setTU_SUCODE(String tU_SUCODE) {
TU_SUCODE = tU_SUCODE;
}
public String getTU_SUNAME() {
return TU_SUNAME;
}
public void setTU_SUNAME(String tU_SUNAME) {
TU_SUNAME = tU_SUNAME;
}
public String getTU_SHORTNAME() {
return TU_SHORTNAME;
}
public void setTU_SHORTNAME(String tU_SHORTNAME) {
TU_SHORTNAME = tU_SHORTNAME;
}
public String getTU_IFPASS() {
return TU_IFPASS;
}
public void setTU_IFPASS(String tU_IFPASS) {
TU_IFPASS = tU_IFPASS;
}
public String getTU_UPDATE() {
return TU_UPDATE;
}
public void setTU_UPDATE(String tU_UPDATE) {
TU_UPDATE = tU_UPDATE;
}
public String getTU_SYNC() {
return TU_SYNC;
}
public void setTU_SYNC(String tU_SYNC) {
TU_SYNC = tU_SYNC;
}
public String getTU_SYNCTIME() {
return TU_SYNCTIME;
}
public void setTU_SYNCTIME(String tU_SYNCTIME) {
TU_SYNCTIME = tU_SYNCTIME;
}
public String getTU_COMPANY() {
return TU_COMPANY;
}
public void setTU_COMPANY(String tU_COMPANY) {
TU_COMPANY = tU_COMPANY;
}
}
package tohi.app.cron;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.util.MXException;
public class CustCronManageMbo extends Mbo implements MboRemote{
public CustCronManageMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void add() throws MXException, RemoteException {
super.add();
MboRemote ownerMbo=this.getOwner();
if (ownerMbo==null) { //如果父级不为空
return;
}
String tbName=ownerMbo.getName();//父级表名
setValue("tbname", tbName,2L);
setValue("ownerid", ownerMbo.getLong(tbName+"ID"),2L); //获取父级表的ID值
}
}
package tohi.app.cron;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustCronManageMboSet extends MboSet implements MboSetRemote{
public CustCronManageMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new CustCronManageMbo(arg0);
}
}
package tohi.app.cron;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.security.ConnectionKey;
import psdi.server.MXServer;
import psdi.server.SimpleCronTask;
import psdi.util.MXException;
import tohi.app.cron.common.MboDataHander;
/**
* 定期任务安排生成定期任务
*
*/
public class RunCromTask extends SimpleCronTask {
public void cronAction() {
try {
processData();
} catch (Exception e) {
e.printStackTrace();
}
}
static class CronPojo {
Long cronmanageid;//实例ID
Long ownerid;//实例ID
String tbname;//表名
Long periodid;//周期id
int isinitflow;//是否开启工作流
public CronPojo(Long ownerid, String tbname, Long periodid,
int isinitflow,Long cronmanageid) {
super();
this.ownerid = ownerid;
this.tbname = tbname;
this.periodid = periodid;
this.isinitflow = isinitflow;
this.cronmanageid = cronmanageid;
}
}
private void processData() {
// 定期任务安排生成定期任务
System.out.println("===============================开始执行定时任务");
MboSetRemote WORKTASTSETSet;
try {
//定时任务开始 --任务计划表 得到mbo -> 时间 频率
//处理业务逻辑 方法
//更改频率时间 下次生成时间
// WORKTASTSETSet.setWhere(sql);
String sql = "select c.periodid ,ownerid,tbname,isinitflow,cronmanageid from cronmanage c,worktastset w where c.ownerid =w.worktastsetid and c.nextdate <=getdate() and w.ifuser=1 "; //获取所有代办任务信息
MXServer mxservers = MXServer.getMXServer();
ConnectionKey connectionKeySession = new ConnectionKey(
getRunasUserInfo());
Connection webServiceCon = mxservers.getDBManager().getConnection(
connectionKeySession);
PreparedStatement pre = webServiceCon.prepareStatement(sql);
ResultSet rs = pre.executeQuery();
ArrayList<CronPojo> list=new ArrayList<CronPojo>();
//遍历所有代办任务记录
while (rs.next()){
Long ownerid=rs.getLong("ownerid");
String tbname=rs.getString("tbname");
Long periodid =rs.getLong("periodid");
MboSetRemote mboSet=mxservers.getMboSet("PERIODDATE",mxservers.getSystemUserInfo());
mboSet.setWhere("periodid ='"+periodid+"'");
if (!mboSet.isEmpty()) { //不等于空且为启用状态
CronPojo c=new CronPojo(ownerid,tbname,periodid, rs.getInt("isinitflow"),rs.getLong("cronmanageid"));
list.add(c);
}
}
//开始处理工作流任务信息
for (int i = 0; i < list.size(); i++) {
CronPojo c=list.get(i);
WORKTASTSETSet = MXServer.getMXServer().getMboSet("WORKTASTSET",
getRunasUserInfo());
WORKTASTSETSet.setWhere("WORKTASTSETID="+c.ownerid);//获取具体的实例表ID
MboRemote mbo=WORKTASTSETSet.getMbo(0);
MboDataHander.hander(mbo,c.tbname,c.isinitflow,c.periodid,c.cronmanageid);
}
if (rs!=null) {
rs.close();
}
if (pre!=null) {
pre.close();
}
if (webServiceCon!=null) {
webServiceCon.close();
}
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
package tohi.app.cron;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.server.SimpleCronTask;
import psdi.util.MXException;
public class RunLoadopeningSumCron extends SimpleCronTask {
@Override
public void cronAction() {
try {
MXServer mxservers = MXServer.getMXServer();
MboSetRemote mboSet = mxservers.getMboSet("RLLOG",
mxservers.getSystemUserInfo());
for (int i = 0; i < mboSet.count(); i++) {
MboRemote m = mboSet.getMbo(i);
runtask(m,m.getMboSet("LOADOPENING") );
}
mboSet.save();
mboSet.close();
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
}
}
protected void runtask(MboRemote m, MboSetRemote mboSetRemote ) throws MXException, RemoteException {
System.out.println("========");
MboSetRemote MboSet=mboSetRemote;
m.setValue("LOAD1TOTAL", MboSet.sum("LOAD1"),2L);
m.setValue("LOAD1MAX", MboSet.max("LOAD1"),2L);
m.setValue("LOAD1MIN", MboSet.min("LOAD1"),2L);
m.setValue("LOAD1AVERAGE", MboSet.sum("LOAD1") / MboSet.count(),2L);
m.setValue("LOAD2TOTAL", MboSet.sum("LOAD2"),2L);
m.setValue("LOAD2MAX", MboSet.max("LOAD2"),2L);
m.setValue("LOAD2MIN", MboSet.min("LOAD2"),2L);
m.setValue("LOAD2AVERAGE", MboSet.sum("LOAD2") / MboSet.count(),2L);
m.setValue("LOAD3TOTAL", MboSet.sum("LOAD3"),2L);
m.setValue("LOAD3MAX", MboSet.max("LOAD3"),2L);
m.setValue("LOAD3MIN", MboSet.min("LOAD3"),2L);
m.setValue("LOAD3AVERAGE", MboSet.sum("LOAD3") / MboSet.count(),2L);
m.setValue("OPENING1MAX", MboSet.max("OPENING1"),2L);
m.setValue("OPENING1MIN", MboSet.min("OPENING1"),2L);
m.setValue("OPENING1AVERAGE", MboSet.sum("OPENING1"),2L);
m.setValue("OPENING2MAX", MboSet.max("OPENING2"),2L);
m.setValue("OPENING2MIN", MboSet.min("OPENING2"),2L);
m.setValue("OPENING2AVERAGE", MboSet.sum("OPENING2") / MboSet.count(),2L);
m.setValue("OPENING3MAX", MboSet.max("OPENING3"),2L);
m.setValue("OPENING3MIN", MboSet.min("OPENING3"),2L);
m.setValue("OPENING3AVERAGE", MboSet.sum("OPENING3") / MboSet.count(),2L);
m.setValue("OUTBOUNDTRAFFICTOTAL", MboSet.sum("OUTBOUNDTRAFFIC"),2L);
m.setValue("OUTBOUNDTRAFFICMAX", MboSet.max("OUTBOUNDTRAFFIC"),2L);
m.setValue("OUTBOUNDTRAFFICMIN", MboSet.min("OUTBOUNDTRAFFIC"),2L);
m.setValue("OUTBOUNDTRAFFICAVERAGE", MboSet.sum("OUTBOUNDTRAFFIC") / MboSet.count(),2L);
m.setValue("RIPARIANZONEMAX", MboSet.max("RIPARIANZONE"),2L);
m.setValue("RIPARIANZONEMIN", MboSet.min("RIPARIANZONE"),2L);
m.setValue("RIPARIANZONEAVERAGE", MboSet.sum("RIPARIANZONE") / MboSet.count(),2L);
m.setValue("FLOWORDRAINTOTAL", MboSet.sum("FLOWORDRAIN"),2L);
m.setValue("FLOWORDRAINMAX", MboSet.max("FLOWORDRAIN"),2L);
m.setValue("FLOWORDRAINMIN", MboSet.min("FLOWORDRAIN"),2L);
m.setValue("FLOWORDRAINAVERAGE", MboSet.sum("FLOWORDRAIN") / MboSet.count(),2L);
m.setValue("BEFOREGATE1MAX", MboSet.max("BEFOREGATE1"),2L);
m.setValue("BEFOREGATE1MIN", MboSet.min("BEFOREGATE1"),2L);
m.setValue("BEFOREGATE1AVERAGE", MboSet.sum("BEFOREGATE1") / MboSet.count(),2L);
m.setValue("AFTERGATEMAX", MboSet.max("AFTERGATE"),2L);
m.setValue("AFTERGATEMIN", MboSet.min("AFTERGATE"),2L);
m.setValue("AFTERGATEAVERAGE", MboSet.sum("AFTERGATE") / MboSet.count(),2L);
m.setValue("SPILLWAYGATE1FLOWTOTAL", MboSet.sum("SPILLWAYGATE1FLOW"),2L);
m.setValue("SPILLWAYGATE1FLOWMAX", MboSet.max("SPILLWAYGATE1FLOW"),2L);
m.setValue("SPILLWAYGATE1FLOWMIN", MboSet.min("SPILLWAYGATE1FLOW"),2L);
m.setValue("SPILLWAYGATE1FLOWAVERAGE", MboSet.sum("SPILLWAYGATE1FLOW") / MboSet.count(),2L);
m.setValue("SPILLWAYGATE2FLOWTOTAL", MboSet.sum("SPILLWAYGATE2FLOW"),2L);
m.setValue("SPILLWAYGATE2FLOWMAX", MboSet.max("SPILLWAYGATE2FLOW"),2L);
m.setValue("SPILLWAYGATE2FLOWMIN", MboSet.min("SPILLWAYGATE2FLOW"),2L);
m.setValue("SPILLWAYGATE2FLOWAVERAGE", MboSet.sum("SPILLWAYGATE2FLOW") / MboSet.count(),2L);
m.setValue("SCOURINGFLOWTOTAL", MboSet.sum("SCOURINGFLOW"),2L);
m.setValue("SCOURINGFLOWMAX", MboSet.max("SCOURINGFLOW"),2L);
m.setValue("SCOURINGFLOWMIN", MboSet.min("SCOURINGFLOW"),2L);
m.setValue("SCOURINGFLOWAVERAGE", MboSet.sum("SCOURINGFLOW") / MboSet.count(),2L);
m.setValue("ECOLOGICALTOTAL", MboSet.sum("ECOLOGICAL"),2L);
m.setValue("ECOLOGICALMAX", MboSet.max("ECOLOGICAL"),2L);
m.setValue("ECOLOGICALMIN", MboSet.min("ECOLOGICAL"),2L);
m.setValue("ECOLOGICALAVERAGE", MboSet.sum("ECOLOGICAL") / MboSet.count(),2L);
m.setValue("POWERFLOWTOTAL", MboSet.sum("POWERFLOW"),2L);
m.setValue("POWERFLOWMAX", MboSet.max("POWERFLOW"),2L);
m.setValue("POWERFLOWMIN", MboSet.min("POWERFLOW"),2L);
m.setValue("POWERFLOWAVERAGE", MboSet.sum("POWERFLOW") / MboSet.count(),2L);
m.setValue("POWERLOADTOTAL", MboSet.sum("POWERLOAD"),2L);
m.setValue("POWERLOADMAX", MboSet.max("POWERLOAD"),2L);
m.setValue("POWERLOADMIN", MboSet.min("POWERLOAD"),2L);
m.setValue("POWERLOADAVERAGE", MboSet.sum("POWERLOAD") / MboSet.count(),2L);
m.setValue("INFLOWDISCHARGETOTAL", MboSet.sum("INFLOWDISCHARGE"),2L);
m.setValue("INFLOWDISCHARGEMAX", MboSet.max("INFLOWDISCHARGE"),2L);
m. setValue("INFLOWDISCHARGEMIN", MboSet.min("INFLOWDISCHARGE"),2L);
m. setValue("INFLOWDISCHARGEAVERAGE", MboSet.sum("INFLOWDISCHARGE") / MboSet.count(),2L);
m. setValue("GATEMAX", MboSet.max("GATE"),2L);
m.setValue("GATEMIN", MboSet.min("GATE"),2L);
m.setValue("GATEAVERAGE", MboSet.sum("GATE") / MboSet.count(),2L);
m.setValue("WATERDEPRIVATIONMAX", MboSet.max("WATERDEPRIVATION"),2L);
m.setValue("WATERDEPRIVATIONMIN", MboSet.min("WATERDEPRIVATION"),2L);
m.setValue("WATERDEPRIVATIONAVERAGE", MboSet.sum("WATERDEPRIVATION") / MboSet.count(),2L);
m.setValue("BEFOREGATE2MAX", MboSet.max("BEFOREGATE2"),2L);
m.setValue("BEFOREGATE2MIN", MboSet.min("BEFOREGATE2"),2L);
m.setValue("BEFOREGATE2AVERAGE", MboSet.sum("BEFOREGATE2") / MboSet.count(),2L);
m.setValue("TAILWATERMAX", MboSet.max("TAILWATER"),2L);
m.setValue("TAILWATERMIN", MboSet.min("TAILWATER"),2L);
m.setValue("TAILWATERAVERAGE", MboSet.sum("TAILWATER") / MboSet.count(),2L);
m.setValue("SPILLWAYGATE1OPENMAX", MboSet.max("SPILLWAYGATE1OPEN"),2L);
m.setValue("SPILLWAYGATE1OPENMIN", MboSet.min("SPILLWAYGATE1OPEN"),2L);
m.setValue("SPILLWAYGATE1OPENAVERAGE", MboSet.sum("SPILLWAYGATE1OPEN") / MboSet.count(),2L);
m. setValue("SPILLWAYGATE2OPENMAX", MboSet.max("SPILLWAYGATE2OPEN"),2L);
m. setValue("SPILLWAYGATE2OPENMIN", MboSet.min("SPILLWAYGATE2OPEN"),2L);
m.setValue("SPILLWAYGATE2OPENAVERAGE", MboSet.sum("SPILLWAYGATE2OPEN") / MboSet.count(),2L);
m.setValue("SCOURINGOPENMAX", MboSet.max("SCOURINGOPEN"),2L);
m.setValue("SCOURINGOPENMIN", MboSet.min("SCOURINGOPEN"),2L);
m.setValue("SCOURINGOPENAVERAGE", MboSet.sum("SCOURINGOPEN") / MboSet.count(),2L);
}
}
package tohi.app.cron;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.server.SimpleCronTask;
import psdi.util.MXException;
public class RunRllogSumCron extends SimpleCronTask {
@Override
public void cronAction() {
try {
MXServer mxservers = MXServer.getMXServer();
MboSetRemote mboSet = mxservers.getMboSet("RLLOGEQ",
mxservers.getSystemUserInfo());
MboSetRemote maxattributecfgSet = mxservers.getMboSet(
"maxattributecfg", mxservers.getSystemUserInfo());
maxattributecfgSet.setWhere("objectname ='RLLOGEQ'");
for (int i = 0; i < mboSet.count(); i++) {
MboRemote m = mboSet.getMbo(i);
runtask(m, maxattributecfgSet);
}
mboSet.save();
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
}
}
/**
* 判断属性进行计算相关数值
*
* @param maxattributecfgSet
* @param m
*/
public void runtask(MboRemote mbo, MboSetRemote maxattributecfgSet)
throws MXException, RemoteException {
for (int i = 0; i < maxattributecfgSet.count(); i++) {
MboRemote attrMbo = maxattributecfgSet.getMbo(i);
String attrName = attrMbo.getString("attributename"); //获取属性表
if (attrName.equalsIgnoreCase("USEFULM1END")) { // 1\#机有功本次读数
if (mbo.getDouble("USEFULM1END") > mbo.getDouble("USEFULM1START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM1",
(mbo.getDouble("USEFULM1END") - parseDoubleValue(mbo
.getDouble("USEFULM1START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM1", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USEFULM2END")) { // 2#机有功本次读数
if (mbo.getDouble("USEFULM2END") > mbo.getDouble("USEFULM2START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM2",
(mbo.getDouble("USEFULM2END") - parseDoubleValue(mbo
.getDouble("USEFULM2START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM2", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USEFULM3END")) { // 3#机有功本次读数
if (mbo.getDouble("USEFULM3END") > mbo.getDouble("USEFULM3START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM3",
(mbo.getDouble("USEFULM3END") - parseDoubleValue(mbo
.getDouble("USEFULM3START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM3", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM1END")) { // 1#机无功本次读数
if (mbo.getDouble("USELESSM1END") > mbo.getDouble("USELESSM1START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM1",
(mbo.getDouble("USELESSM1END") - parseDoubleValue(mbo
.getDouble("USELESSM1START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM1", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM2END")) { // 2#机无功本次读数
if (mbo.getDouble("USELESSM2END") > mbo.getDouble("USELESSM2START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM2",
(mbo.getDouble("USELESSM2END")- parseDoubleValue(mbo
.getDouble("USELESSM2START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM2", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM3END")) { // 3#机无功本次读数
if (mbo.getDouble("USELESSM3END") > mbo.getDouble("USELESSM3START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM3",
(mbo.getDouble("USELESSM3END")- parseDoubleValue(mbo
.getDouble("USELESSM3START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM3", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("FACTORYUSE11BEND")) { // 厂用电11B上次读数
if (mbo.getDouble("FACTORYUSE11BEND") > mbo
.getDouble("FACTORYUSE11BSTART")) { // 判断当前今日大于昨日
mbo.setValue("FACTORYUSE11B",
(mbo.getDouble("FACTORYUSE11BEND") - parseDoubleValue(mbo
.getDouble("FACTORYUSE11BSTART"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("FACTORYUSE11B", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("FACTORYUSE12BEND")) { // 厂用电12B上次读数
if (mbo.getDouble("FACTORYUSE12BEND") > mbo
.getDouble("FACTORYUSE12BSTART")) { // 判断当前今日大于昨日
mbo.setValue("FACTORYUSE12B",
(mbo.getDouble("FACTORYUSE12BEND") - parseDoubleValue(mbo
.getDouble("FACTORYUSE12BSTART"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("FACTORYUSE12B", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("SWITCH1003")) { // 厂用电1003上次读数
if (mbo.getDouble("SWITCH1003") > mbo.getDouble("SWITCH1003PRE")) { // 判断当前今日大于昨日
mbo.setValue("PAIDPOWER",
(mbo.getDouble("SWITCH1003") - parseDoubleValue(mbo
.getDouble("SWITCH1003PRE"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("PAIDPOWER", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USEFULPOSITIVE1U")) { // 江里线有功正
System.out.println("计算综合厂用电量");
countTotalALL(mbo);
} else if (attrName.equalsIgnoreCase("USEFULLOSS1E")) { // 江九线有功反
countTotalALL(mbo);
} else if (attrName.equalsIgnoreCase("USEFULPOSITIVE1E")) { // 江九线有功正
mbo.getOwner().setValue(
"DATEUSEFULUP",
(mbo.getDouble("USEFULPOSITIVE1E") - parseDoubleValue(mbo
.getDouble("USEFULLOSS1Y"))), 2L);
countTotalALL(mbo);
} else if (attrName.equalsIgnoreCase("USEFULLOSS1Y")) { // 垭江线有功反
mbo.getOwner()
.setValue(
"DATEUSEFULUP",
(parseDoubleValue(mbo
.getDouble("USEFULPOSITIVE1E")) -mbo.getDouble("USEFULLOSS1Y")), 2L);
System.out.println(mbo.getOwner().getDouble("DATEUSEFULUP"));
countTotalALL(mbo);
}
}
}
// 计算日有功发电
public void CountDATEUSEFUL(MboRemote mbo) throws RemoteException,
MXException {
mbo.getOwner().setValue(
"DATEUSEFUL",
parseDoubleValue(mbo.getDouble("USEFULM1"))
+ parseDoubleValue(mbo.getDouble("USEFULM2"))
+ parseDoubleValue(mbo.getDouble("USEFULM3")), 2L);
}
// 计算日无功发电
public void CountDATEUSELESS(MboRemote mbo) throws RemoteException,
MXException {
mbo.getOwner().setValue(
"DATEUSELESS",
parseDoubleValue(mbo.getDouble("USELESSM1"))
+ parseDoubleValue(mbo.getDouble("USELESSM2"))
+ parseDoubleValue(mbo.getDouble("USELESSM3")), 2L);
}
// 统计数值
public void CountDATECOUSE(MboRemote mbo) throws RemoteException,
MXException {
System.out.println(mbo.getOwner().getDouble("DATECOUSE")
+ "-------------------");
System.out.println(mbo.getOwner().getDouble("DATEUSEFUL")
+ "-------------------222222");
if (mbo.getOwner().getDouble("DATEUSEFUL") != 0) {
mbo.getOwner().setValue(
"DATECOUSEPERC",
(parseDoubleValue(mbo.getOwner().getDouble("DATECOUSE"))
/ parseDoubleValue(mbo.getOwner().getDouble(
"DATEUSEFUL")) * 100), 2L);// 日厂用电率(%)
mbo.getOwner()
.setValue(
"DATESYNTHESISUSEPERC",
((mbo.getOwner().getDouble("DATESYNTHESISUSE")) / parseDoubleValue(mbo
.getOwner().getDouble("DATEUSEFUL"))), 2L);// 日综合厂用电率(%)
} else {
mbo.getOwner().setValue("DATECOUSEPERC", 0, 2L);// 日厂用电率(%)
mbo.getOwner().setValue("DATESYNTHESISUSEPERC", 0, 2L);// 日综合厂用电率(%)
}
}
/**
* 日综合厂用电量
*
* @param mbo
* @throws RemoteException
* @throws MXException
*/
public void DATESYNTHESISUSE(MboRemote mbo) throws RemoteException,
MXException {
// 综合厂用电量=日有功发电量—日送出电量—江里线电量+江九线有功反+外购1003电量
// DATEUSEFUL - DATEUSEFULUP -USEFULPOSITIVE1U + USEFULLOSS1E +
// PAIDPOWER
mbo.getOwner().setValue(
"DATECOUSE",
(mbo.getDouble("FACTORYUSE11B")
+ mbo.getDouble("FACTORYUSE12B") + mbo
.getDouble("PAIDPOWER")), 2L); // 日厂用电量
mbo.getOwner()
.setValue(
"DATESYNTHESISUSE",
(parseDoubleValue(mbo.getOwner()
.getDouble("DATEUSEFUL"))
- parseDoubleValue(mbo.getOwner().getDouble(
"DATEUSEFULUP"))
- parseDoubleValue(mbo
.getDouble("USEFULPOSITIVE1U"))
+ parseDoubleValue(mbo
.getDouble("USEFULLOSS1E")) + parseDoubleValue(mbo
.getDouble("PAIDPOWER"))), 2L);
}
public void countTotalALL(MboRemote mbo) throws RemoteException,
MXException {
CountDATEUSELESS(mbo);
CountDATEUSEFUL(mbo);
DATESYNTHESISUSE(mbo);// 日综合厂用电量
CountDATECOUSE(mbo);
}
public Double parseDoubleValue(Double d) {
if (d != null) {
return d;
}
return 0d;
}
}
package tohi.app.cron.common;
public interface DataHander {
void hander();
}
package tohi.app.cron.common;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
import psdi.workflow.WorkFlowServiceRemote;
import tohi.app.basemanage.CyclemanagementMbo;
public class MboDataHander {
public MboDataHander(){
}
public static void hander(MboRemote mbo,String tbname, int isinitflow, Long periodid, Long cronmanageid){
System.out.println(tbname+"======tbname===========");
// if (tbname.equalsIgnoreCase("WORKTASK")) { //如果是定期任务安排
System.out.println("进入执行-----");
MboRemote workTaskmbo = null;
try {
workTaskmbo=runTask(mbo);
} catch (RemoteException e1) {
e1.printStackTrace();
} catch (MXException e1) {
e1.printStackTrace();
}
//计算下一个到期日
MXServer mxservers;
try {
mxservers = MXServer.getMXServer();
MboSetRemote WORKTASTSETSet=mxservers.getMboSet("CRONMANAGE", mbo.getUserInfo());
WORKTASTSETSet.setWhere("cronmanageid ="+cronmanageid+" "); //获取关联的任务
MboRemote CRONMANAGEMbo=WORKTASTSETSet.getMbo(0);//获取当前关联的定时信息
MboRemote PERIODMbo=CRONMANAGEMbo.getMboSet("PERIOD").getMbo(0);
String unit=PERIODMbo.getString("unit");//获取周期信息
MboSetRemote PERIODDATEMboSet=PERIODMbo.getMboSet("PERIODDATE");//获取周期管理信息
PERIODDATEMboSet.setOrderBy("RUNTIME asc");
Calendar calendar =null;
Calendar calendar1 = null;
if (unit.equalsIgnoreCase("DAY")) { //日
boolean flag=false;
calendar = Calendar.getInstance();
calendar1 = Calendar.getInstance();
for (int i = 0; i < PERIODDATEMboSet.count(); i++) { //每天几次 获取时间
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(i);
Calendar calendar2 = Calendar.getInstance();
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar2.set(Calendar.HOUR_OF_DAY, runtime.getHours());
calendar2.set(Calendar.MINUTE, runtime.getMinutes());
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
calendar.get(Calendar.DATE), calendar2.get(Calendar.HOUR_OF_DAY), calendar2.get(Calendar.MINUTE));//将获取的小时放入到对象内
if (calendar.after(calendar1)) {//如果生成日期在当前日期之后 ,为下一个到期日
System.out.println("下一个到期日为===="+calendar.getTime());
flag=true;//标记是否有大于当前时间的计划
break;
}
}
if (flag) {
System.out.println("设置日期1111---"+calendar.getTime());
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}else{
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(0); //获取第二天初始时间
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar.set(calendar.get(calendar.YEAR), calendar.get(calendar.MONTH), calendar.get(calendar.DAY_OF_MONTH)+1,runtime.getHours(),runtime.getMinutes()); //天数加1
System.out.println("设置日期3333---"+calendar.getTime());
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}
}else if (unit.equalsIgnoreCase("WEEK")) {//周 每周多次
boolean flag=false;
calendar = Calendar.getInstance();
calendar1 = Calendar.getInstance();
for (int i = 0; i < PERIODDATEMboSet.count(); i++) { //每天几次 获取时间
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(i);
Calendar calendar2 = Calendar.getInstance();
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar2.set(Calendar.HOUR_OF_DAY, runtime.getHours());
calendar2.set(Calendar.MINUTE, runtime.getMinutes());
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
calendar.get(Calendar.DATE), calendar2.get(Calendar.HOUR_OF_DAY), calendar2.get(Calendar.MINUTE));//将获取的小时放入到对象内 一周后的时间
System.out.println("下一个到期日为===="+calendar.getTime());
if (calendar.after(calendar1)) {//如果生成日期在当前日期之后 ,为下一个到期日
flag=true;//标记是否有大于当前时间的计划
break;
}
}
if (flag) {
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}else{
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(0); //获取第二天初始时间
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar.set(calendar.get(calendar.YEAR), calendar.get(calendar.MONTH), calendar.get(calendar.DAY_OF_MONTH)+7,runtime.getHours(),runtime.getMinutes()); //天数加1
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}
}else if (unit.equalsIgnoreCase("MONTH")) {//月
boolean flag=false;
calendar = Calendar.getInstance();
calendar1 = Calendar.getInstance();
for (int i = 0; i < PERIODDATEMboSet.count(); i++) { //每天几次 获取时间
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(i);
Calendar calendar2 = Calendar.getInstance();
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar2.set(Calendar.HOUR_OF_DAY, runtime.getHours());
calendar2.set(Calendar.MINUTE, runtime.getMinutes());
int DAYVALUE=PERIODDATEMbo.getInt("DAYVALUE"); //获取日
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
DAYVALUE, calendar2.get(Calendar.HOUR_OF_DAY), calendar2.get(Calendar.MINUTE));//将获取的小时放入到对象内 一周后的时间
System.out.println("下一个到期日为===="+calendar.getTime());
if (calendar.after(calendar1)) {//如果生成日期在当前日期之后 ,为下一个到期日
flag=true;//标记是否有大于当前时间的计划
break;
}
}
if (flag) {
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}else{
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(0); //获取第二天初始时间
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar.set(calendar.get(calendar.YEAR), calendar.get(calendar.MONTH)+1, calendar.get(calendar.DAY_OF_MONTH),runtime.getHours(),runtime.getMinutes()); //天数加1
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}
}else if (unit.equalsIgnoreCase("YEAR")) {//年
boolean flag=false;
calendar = Calendar.getInstance();
calendar1 = Calendar.getInstance();
for (int i = 0; i < PERIODDATEMboSet.count(); i++) { //每天几次 获取时间
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(i);
Calendar calendar2 = Calendar.getInstance();
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar2.set(Calendar.HOUR_OF_DAY, runtime.getHours());
calendar2.set(Calendar.MINUTE, runtime.getMinutes());
int DAYVALUE=PERIODDATEMbo.getInt("DAYVALUE"); //获取日
int MONTHVALUE=PERIODDATEMbo.getInt("MONTHVALUE"); //获取日
calendar.set(calendar.get(Calendar.YEAR), MONTHVALUE,
DAYVALUE, calendar2.get(Calendar.HOUR_OF_DAY), calendar2.get(Calendar.MINUTE));//将获取的小时放入到对象内 一周后的时间
System.out.println("下一个到期日为===="+calendar.getTime());
if (calendar.after(calendar1)) {//如果生成日期在当前日期之后 ,为下一个到期日
flag=true;//标记是否有大于当前时间的计划
break;
}
}
if (flag) {
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}else{
MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(0); //获取第二天初始时间
Date runtime=PERIODDATEMbo.getDate("RUNTIME");
calendar.set(calendar.get(calendar.YEAR)+1, calendar.get(calendar.MONTH)+1, calendar.get(calendar.DAY_OF_MONTH),runtime.getHours(),runtime.getMinutes()); //天数加1
CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
}
}
WORKTASTSETSet.save();
System.out.println("任务创建完成");
if (isinitflow==1) {
try {
((WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW")).initiateWorkflow("WORKTASK", workTaskmbo);
System.out.println("工作流开启完成-------");
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
}
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//运行定时任务功能
// }
}
//定时任务执行方法
public static MboRemote runTask(MboRemote createMbo) throws RemoteException, MXException {
System.out.println("执行任务实例");
MXServer mxservers = MXServer.getMXServer();
MboSetRemote WORKTASTSETSet=mxservers.getMboSet("WORKTASK", createMbo.getUserInfo());
MboRemote mboWo = WORKTASTSETSet.add(); // 新增任务
// 获取
// mboWo.setValue("PLANMAN", createMbo.getString("CREATEBY"), 11L);// 创建人
mboWo.setValue("WORKMAN", createMbo.getString("WORKMAN"), 11L);// 工作负责人
// mboWo.setValue("PLANMAN", createMbo.getString("NEXTSHIFTER"), 11L);// 工作安排人
mboWo.setValue("STATUSDATE", mxservers.getDate(), 11L);// 状态时间
mboWo.setValue("NAME", createMbo.getString("NAME"), 11L);// 工作名称
mboWo.setValue("CONTENT", createMbo.getString("CONTENT"), 11L);// 工作内容
mboWo.setValue("STATUS", "APPR1", 11L);// 状态
WORKTASTSETSet.save();
return mboWo;
}
}
package tohi.app.generalapp;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CustRlmainthingMbo extends Mbo implements MboRemote{
public CustRlmainthingMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void init() throws MXException {
super.init();
}
@Override
public void add() throws MXException, RemoteException {
super.add();
MboRemote owner = this.getOwner();
if (owner!=null) {
setValue("SHIFTNUM", owner.getString("SHIFTNUM"));
}
}
@Override
public void modify() throws MXException, RemoteException {
super.modify();
setValue("CHANGEBY", this.getUserName());
setValue("CHANGEDATE",MXServer.getMXServer().getDate());
}
}
package tohi.app.generalapp;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustRlmainthingMboSet extends MboSet implements MboSetRemote{
public CustRlmainthingMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new CustRlmainthingMbo(arg0);
}
}
package tohi.app.perioddate;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldperioddateAction extends MboValueAdapter {
public FldperioddateAction() {
super();
}
public FldperioddateAction(MboValue mbv) {
super(mbv);
}
//选择班次带出日期
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=this.getMboValue().getMbo();
if (this.getMboValue().getAttributeName().equalsIgnoreCase("RLSCHEDULEID")) { //如果当前是班次
MboSetRemote bcmboSet = MXServer.getMXServer().getMboSet("RLSCHEDULE",mbo.getUserInfo());
bcmboSet.setWhere("RLSCHEDULEID='"+this.getMboValue().getLong()+"'");
if (!bcmboSet.isEmpty()) {
mbo.setValue("RUNTIME", bcmboSet.getMbo(0).getDate("STARTTIME"),2L);//将值赋值给运行小时
}else {
mbo.setValueNull("RUNTIME");
}
}
}
}
package tohi.app.pjobehavior;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class FldBehaviorcategorylinId extends MAXTableDomain{
public FldBehaviorcategorylinId(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "behaviorcategorylinid" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("BEHAVIORCATEGORYLIN", "behaviorcategorylinid=:" + thisname);
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
MboRemote mbo=mboValue.getMbo();
String BEHAVIORCATEGORY=mbo.getString("BEHAVIORCATEGORY");
setListCriteria("behaviorcategoryid = '"+BEHAVIORCATEGORY+"'"); //ɸѡֵ
return super.getList();
}
}
package tohi.app.pjobehavior;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboValue;
public class FldPjobehavior extends MAXTableDomain{
public FldPjobehavior(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "BEHAVIORCATEGORYID" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("BEHAVIORCATEGORY", "BEHAVIORCATEGORYID=:" + thisname);
}
}
package tohi.app.pjoobservation;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldPjoType extends MboValueAdapter{
public FldPjoType() {
super();
}
public FldPjoType(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
MboRemote mbo=mboValue.getMbo();
MboSetRemote PJOOBSERVATIONLINSet=mbo.getMboSet("PJOOBSERVATIONLIN");
PJOOBSERVATIONLINSet.deleteAll(11L);
String pjoType=mboValue.getString();
MboSetRemote pjoContentSet=MXServer.getMXServer().getMboSet("PJOCONTENT",mbo.getUserInfo());
pjoContentSet.setWhere("pjotype = '"+pjoType+"'");
for (int i = 0; i < pjoContentSet.count(); i++) {
MboRemote contentMbo=pjoContentSet.getMbo(i);
MboRemote PJOOBSERVATIONLIN=PJOOBSERVATIONLINSet.add(11L);
PJOOBSERVATIONLIN.setValue("PJOOBSERVATIONID", mbo.getLong("PJOOBSERVATIONID"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("pjocontent", contentMbo.getString("pjocontent"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("PJOTYPE", contentMbo.getString("PJOTYPE"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("PJONUM", contentMbo.getString("PJONUM"),11L);//设定关系
}
System.out.println("保存完毕--");
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustLoadopeningMbo extends Mbo implements MboRemote{
public CustLoadopeningMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
protected void save() throws MXException, RemoteException {
super.save();
System.out.println("========");
MboSetRemote MboSet=this.getThisMboSet();
this.getOwner().setValue("LOAD1TOTAL", MboSet.sum("LOAD1"),2L);
this.getOwner().setValue("LOAD1MAX", MboSet.max("LOAD1"),2L);
this.getOwner().setValue("LOAD1MIN", MboSet.min("LOAD1"),2L);
this.getOwner().setValue("LOAD1AVERAGE", MboSet.sum("LOAD1") / MboSet.count(),2L);
this.getOwner().setValue("LOAD2TOTAL", MboSet.sum("LOAD2"),2L);
this.getOwner().setValue("LOAD2MAX", MboSet.max("LOAD2"),2L);
this.getOwner().setValue("LOAD2MIN", MboSet.min("LOAD2"),2L);
this.getOwner().setValue("LOAD2AVERAGE", MboSet.sum("LOAD2") / MboSet.count(),2L);
this.getOwner().setValue("LOAD3TOTAL", MboSet.sum("LOAD3"),2L);
this.getOwner().setValue("LOAD3MAX", MboSet.max("LOAD3"),2L);
this.getOwner().setValue("LOAD3MIN", MboSet.min("LOAD3"),2L);
this.getOwner().setValue("LOAD3AVERAGE", MboSet.sum("LOAD3") / MboSet.count(),2L);
this.getOwner().setValue("OPENING1MAX", MboSet.max("OPENING1"),2L);
this.getOwner().setValue("OPENING1MIN", MboSet.min("OPENING1"),2L);
this.getOwner().setValue("OPENING1AVERAGE", MboSet.sum("OPENING1"),2L);
this.getOwner().setValue("OPENING2MAX", MboSet.max("OPENING2"),2L);
this.getOwner().setValue("OPENING2MIN", MboSet.min("OPENING2"),2L);
this.getOwner().setValue("OPENING2AVERAGE", MboSet.sum("OPENING2") / MboSet.count(),2L);
this.getOwner().setValue("OPENING3MAX", MboSet.max("OPENING3"),2L);
this.getOwner().setValue("OPENING3MIN", MboSet.min("OPENING3"),2L);
this.getOwner().setValue("OPENING3AVERAGE", MboSet.sum("OPENING3") / MboSet.count(),2L);
this.getOwner().setValue("OUTBOUNDTRAFFICTOTAL", MboSet.sum("OUTBOUNDTRAFFIC"),2L);
this.getOwner().setValue("OUTBOUNDTRAFFICMAX", MboSet.max("OUTBOUNDTRAFFIC"),2L);
this.getOwner().setValue("OUTBOUNDTRAFFICMIN", MboSet.min("OUTBOUNDTRAFFIC"),2L);
this.getOwner().setValue("OUTBOUNDTRAFFICAVERAGE", MboSet.sum("OUTBOUNDTRAFFIC") / MboSet.count(),2L);
this.getOwner().setValue("RIPARIANZONEMAX", MboSet.max("RIPARIANZONE"),2L);
this.getOwner().setValue("RIPARIANZONEMIN", MboSet.min("RIPARIANZONE"),2L);
this.getOwner().setValue("RIPARIANZONEAVERAGE", MboSet.sum("RIPARIANZONE") / MboSet.count(),2L);
this.getOwner().setValue("FLOWORDRAINTOTAL", MboSet.sum("FLOWORDRAIN"),2L);
this.getOwner().setValue("FLOWORDRAINMAX", MboSet.max("FLOWORDRAIN"),2L);
this.getOwner().setValue("FLOWORDRAINMIN", MboSet.min("FLOWORDRAIN"),2L);
this.getOwner().setValue("FLOWORDRAINAVERAGE", MboSet.sum("FLOWORDRAIN") / MboSet.count(),2L);
this.getOwner().setValue("BEFOREGATE1MAX", MboSet.max("BEFOREGATE1"),2L);
this.getOwner().setValue("BEFOREGATE1MIN", MboSet.min("BEFOREGATE1"),2L);
this.getOwner().setValue("BEFOREGATE1AVERAGE", MboSet.sum("BEFOREGATE1") / MboSet.count(),2L);
this.getOwner().setValue("AFTERGATEMAX", MboSet.max("AFTERGATE"),2L);
this.getOwner().setValue("AFTERGATEMIN", MboSet.min("AFTERGATE"),2L);
this.getOwner().setValue("AFTERGATEAVERAGE", MboSet.sum("AFTERGATE") / MboSet.count(),2L);
this.getOwner().setValue("SPILLWAYGATE1FLOWTOTAL", MboSet.sum("SPILLWAYGATE1FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE1FLOWMAX", MboSet.max("SPILLWAYGATE1FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE1FLOWMIN", MboSet.min("SPILLWAYGATE1FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE1FLOWAVERAGE", MboSet.sum("SPILLWAYGATE1FLOW") / MboSet.count(),2L);
this.getOwner().setValue("SPILLWAYGATE2FLOWTOTAL", MboSet.sum("SPILLWAYGATE2FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE2FLOWMAX", MboSet.max("SPILLWAYGATE2FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE2FLOWMIN", MboSet.min("SPILLWAYGATE2FLOW"),2L);
this.getOwner().setValue("SPILLWAYGATE2FLOWAVERAGE", MboSet.sum("SPILLWAYGATE2FLOW") / MboSet.count(),2L);
this.getOwner().setValue("SCOURINGFLOWTOTAL", MboSet.sum("SCOURINGFLOW"),2L);
this.getOwner().setValue("SCOURINGFLOWMAX", MboSet.max("SCOURINGFLOW"),2L);
this.getOwner().setValue("SCOURINGFLOWMIN", MboSet.min("SCOURINGFLOW"),2L);
this.getOwner().setValue("SCOURINGFLOWAVERAGE", MboSet.sum("SCOURINGFLOW") / MboSet.count(),2L);
this.getOwner().setValue("ECOLOGICALTOTAL", MboSet.sum("ECOLOGICAL"),2L);
this.getOwner().setValue("ECOLOGICALMAX", MboSet.max("ECOLOGICAL"),2L);
this.getOwner().setValue("ECOLOGICALMIN", MboSet.min("ECOLOGICAL"),2L);
this.getOwner().setValue("ECOLOGICALAVERAGE", MboSet.sum("ECOLOGICAL") / MboSet.count(),2L);
this.getOwner().setValue("POWERFLOWTOTAL", MboSet.sum("POWERFLOW"),2L);
this.getOwner().setValue("POWERFLOWMAX", MboSet.max("POWERFLOW"),2L);
this.getOwner().setValue("POWERFLOWMIN", MboSet.min("POWERFLOW"),2L);
this.getOwner().setValue("POWERFLOWAVERAGE", MboSet.sum("POWERFLOW") / MboSet.count(),2L);
this.getOwner().setValue("POWERLOADTOTAL", MboSet.sum("POWERLOAD"),2L);
this.getOwner().setValue("POWERLOADMAX", MboSet.max("POWERLOAD"),2L);
this.getOwner().setValue("POWERLOADMIN", MboSet.min("POWERLOAD"),2L);
this.getOwner().setValue("POWERLOADAVERAGE", MboSet.sum("POWERLOAD") / MboSet.count(),2L);
this.getOwner().setValue("INFLOWDISCHARGETOTAL", MboSet.sum("INFLOWDISCHARGE"),2L);
this.getOwner().setValue("INFLOWDISCHARGEMAX", MboSet.max("INFLOWDISCHARGE"),2L);
this.getOwner(). setValue("INFLOWDISCHARGEMIN", MboSet.min("INFLOWDISCHARGE"),2L);
this.getOwner(). setValue("INFLOWDISCHARGEAVERAGE", MboSet.sum("INFLOWDISCHARGE") / MboSet.count(),2L);
this.getOwner(). setValue("GATEMAX", MboSet.max("GATE"),2L);
this.getOwner().setValue("GATEMIN", MboSet.min("GATE"),2L);
this.getOwner().setValue("GATEAVERAGE", MboSet.sum("GATE") / MboSet.count(),2L);
this.getOwner().setValue("WATERDEPRIVATIONMAX", MboSet.max("WATERDEPRIVATION"),2L);
this.getOwner().setValue("WATERDEPRIVATIONMIN", MboSet.min("WATERDEPRIVATION"),2L);
this.getOwner().setValue("WATERDEPRIVATIONAVERAGE", MboSet.sum("WATERDEPRIVATION") / MboSet.count(),2L);
this.getOwner().setValue("BEFOREGATE2MAX", MboSet.max("BEFOREGATE2"),2L);
this.getOwner().setValue("BEFOREGATE2MIN", MboSet.min("BEFOREGATE2"),2L);
this.getOwner().setValue("BEFOREGATE2AVERAGE", MboSet.sum("BEFOREGATE2") / MboSet.count(),2L);
this.getOwner().setValue("TAILWATERMAX", MboSet.max("TAILWATER"),2L);
this.getOwner().setValue("TAILWATERMIN", MboSet.min("TAILWATER"),2L);
this.getOwner().setValue("TAILWATERAVERAGE", MboSet.sum("TAILWATER") / MboSet.count(),2L);
this.getOwner().setValue("SPILLWAYGATE1OPENMAX", MboSet.max("SPILLWAYGATE1OPEN"),2L);
this.getOwner().setValue("SPILLWAYGATE1OPENMIN", MboSet.min("SPILLWAYGATE1OPEN"),2L);
this.getOwner().setValue("SPILLWAYGATE1OPENAVERAGE", MboSet.sum("SPILLWAYGATE1OPEN") / MboSet.count(),2L);
this.getOwner(). setValue("SPILLWAYGATE2OPENMAX", MboSet.max("SPILLWAYGATE2OPEN"),2L);
this.getOwner(). setValue("SPILLWAYGATE2OPENMIN", MboSet.min("SPILLWAYGATE2OPEN"),2L);
this.getOwner().setValue("SPILLWAYGATE2OPENAVERAGE", MboSet.sum("SPILLWAYGATE2OPEN") / MboSet.count(),2L);
this.getOwner().setValue("SCOURINGOPENMAX", MboSet.max("SCOURINGOPEN"),2L);
this.getOwner().setValue("SCOURINGOPENMIN", MboSet.min("SCOURINGOPEN"),2L);
this.getOwner().setValue("SCOURINGOPENAVERAGE", MboSet.sum("SCOURINGOPEN") / MboSet.count(),2L);
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustLoadopeningMboSet extends MboSet implements MboSetRemote{
public CustLoadopeningMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new CustLoadopeningMbo(arg0);
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class CustLogMbo extends Mbo implements MboRemote{
public CustLogMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void init() throws MXException {
super.init();
}
@Override
public void add() throws MXException, RemoteException {
super.add();
System.out.println("新增rllog记录");
setValue("RUNDATE", new Date());
setValue("Hasld", 0);
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("rllog", MXServer.getMXServer().getSystemUserInfo());
//将上条记录的信息赋值给当前记录
mboSet.setOrderBy("RUNDATE desc");
if (!mboSet.isEmpty()) {
MboRemote mbo=mboSet.getMbo(0);
MboSetRemote RLLOGEQSet=getMboSet("RLLOGEQ");
MboRemote RLLOGEQ=RLLOGEQSet.addAtEnd(11L);
RLLOGEQ.setValue("USEFULM1START",mbo.getDouble("RLLOGEQ.USEFULM1END"),11L);
RLLOGEQ.setValue("USEFULM2START",mbo.getDouble("RLLOGEQ.USEFULM2END"),11L);
RLLOGEQ.setValue("USEFULM3START",mbo.getDouble("RLLOGEQ.USEFULM3END"),11L);
RLLOGEQ.setValue("USELESSM1START",mbo.getDouble("RLLOGEQ.USELESSM1END"),11L);
RLLOGEQ.setValue("USELESSM2START",mbo.getDouble("RLLOGEQ.USELESSM2END"),11L);
RLLOGEQ.setValue("USELESSM3START",mbo.getDouble("RLLOGEQ.USELESSM3END"),11L);
RLLOGEQ.setValue("FACTORYUSE11BSTART",mbo.getDouble("RLLOGEQ.FACTORYUSE11BEND"),11L);
RLLOGEQ.setValue("FACTORYUSE12BSTART",mbo.getDouble("RLLOGEQ.FACTORYUSE12BEND"),11L);
RLLOGEQ.setValue("SWITCH1003PRE",mbo.getDouble("RLLOGEQ.SWITCH1003"));
RLLOGEQ.setValue("rllogID",getLong("rllogID"),11L);
setValue("SECDATECOUNT",mbo.getDouble("SECDATECOUNT")+1,11L);
}
try {
createRLLOGLINE();
System.out.println("日志产生总有功无功成功");
createRLLOGDATA() ;
System.out.println("电压、水压和最高温度检查");
createRLLOGGISAP() ;
System.out.println("GIS开关设备SF6气体压力");
createLOADOPENING() ;
System.out.println("负荷开度统计");
} catch (ParseException e) {
e.printStackTrace();
}
}
//产生总有功无功
public void createRLLOGLINE() throws RemoteException, MXException, ParseException{
MboSetRemote RLLOGLINESet =this.getMboSet("RLLOGLINE");
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdformat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i <= 23; i++) {
MboRemote RllogLine=RLLOGLINESet.addAtEnd(11L);
Date runDate=sdformat.parse(getString("RUNDATE"));
runDate.setHours(runDate.getHours()+i);
RllogLine.setValue("logtime",sdformat1.format(runDate),11L);
}
}
//电压、水压和最高温度检查
public void createRLLOGDATA() throws RemoteException, MXException, ParseException{
MboSetRemote RLLOGDATASet =this.getMboSet("RLLOGDATA");
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdformat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < 3; i++) {
MboRemote RLLOGDATA=RLLOGDATASet.addAtEnd(11L);
Date runDate=sdformat.parse(getString("RUNDATE"));
if (i==0) {
runDate.setHours(runDate.getHours()+7);
}else if (i==1) {
runDate.setHours(runDate.getHours()+15);
}else if (i==2){
runDate.setHours(runDate.getHours()+23);
}
RLLOGDATA.setValue("logtime", sdformat1.format(runDate),11L);
}
}
//GIS开关设备SF6气体压力
public void createRLLOGGISAP() throws RemoteException, MXException, ParseException{
MboSetRemote RLLOGGISAPSet =this.getMboSet("RLLOGGISAP");
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdformat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
MboRemote RLLOGGISAP=RLLOGGISAPSet.addAtEnd(11L);
Date runDate=sdformat.parse(getString("RUNDATE"));
runDate.setHours(runDate.getHours()+15);
RLLOGGISAP.setValue("logtime", sdformat1.format(runDate),11L);
}
//负荷开度统计
public void createLOADOPENING() throws RemoteException, MXException, ParseException{
MboSetRemote LOADOPENINGSet =this.getMboSet("LOADOPENING");
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdformat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
MboSetRemote PREVIOUSDATASet=MXServer.getMXServer().getMboSet("LOADOPENING",this.getUserInfo());
PREVIOUSDATASet.setWhere("logtime < getDate() and DATENAME(HOUR ,logtime)=23 and DATENAME(MINUTE,logtime)=00 ");
PREVIOUSDATASet.setOrderBy(" logtime desc ");
for (int i = 0; i <= 23; i++) {
MboRemote LOADOPENING=LOADOPENINGSet.addAtEnd(11L);
Date runDate=sdformat.parse(getString("RUNDATE"));
runDate.setHours(runDate.getHours()+i);
if (i==0) { //需要获取前一天的数据
Double BEFOREGATE1=PREVIOUSDATASet.getMbo(0).getDouble("BEFOREGATE1");
LOADOPENING.setValue("lastlogtime", BEFOREGATE1,11L);
}
LOADOPENING.setValue("logtime", sdformat1.format(runDate),11L);
}
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustLogMboSet extends MboSet implements MboSetRemote{
public CustLogMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new CustLogMbo(arg0);
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CustRlcentShutMbo extends Mbo implements MboRemote{
public CustRlcentShutMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void add() throws MXException, RemoteException {
super.add();
MboSetRemote RLRELAYMANAGESet=MXServer.getMXServer().getMboSet("RLSHIFTS",this.getUserInfo());
RLRELAYMANAGESet.setOrderBy(" RLSHIFTSID desc ");
String SHIFTNUM=RLRELAYMANAGESet.getMbo(0).getString("SHIFTNUM");
setValue("SHIFTNUM", SHIFTNUM,11L);
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustRlcentShutMboSet extends MboSet implements MboSetRemote{
public CustRlcentShutMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
// TODO Auto-generated constructor stub
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new CustRlcentShutMbo(arg0);
}
}
package tohi.app.rllog;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldRldutynum extends MAXTableDomain{
public FldRldutynum(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "RLDUTYNUM" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("RLDUTY", "RLDUTYNUM=:" + thisname);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=mboValue.getMbo();
MboSetRemote RLDUTYSet=MXServer.getMXServer().getMboSet("RLDUTY", mbo.getUserInfo());
RLDUTYSet.setWhere("RLDUTYNUM='"+mboValue.getString()+"'");
if (!mboValue.isNull()) {
if (!RLDUTYSet.isEmpty()) {
mbo.setValue("SHIFTER", RLDUTYSet.getMbo(0).getString("SHIFTER"),11L);//将值长放置当前的值班人员中
mbo.setValue("POSITION1", RLDUTYSet.getMbo(0).getString("POSITION1"),11L);//将值长放置当前的值班人员中
mbo.setValue("POSITION2", RLDUTYSet.getMbo(0).getString("POSITION2"),11L);//将值长放置当前的值班人员中
}
}else{
mbo.setValue("SHIFTER", "",11L);//将值长放置当前的值班人员中
mbo.setValue("POSITION1", "",11L);//将值长放置当前的值班人员中
mbo.setValue("POSITION2", "",11L);//将值长放置当前的值班人员中
}
}
}
package tohi.app.rllogeq;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import org.joda.time.LocalDateTime;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
/**
* 负荷开度统计计算公式
*
*/
public class FldRllogFhCount extends MboValueAdapter {
public FldRllogFhCount() {
super();
}
public FldRllogFhCount(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
String attrName = this.mboValue.getAttributeName();
MboRemote mbo = getMboValue().getMbo();
DateFormat dateFormat1 = new SimpleDateFormat("HH");
// 库区消落换算流量m3/s 获取前一天23点的值
if (attrName.equals("BEFOREGATE1")) { // 闸前监控水位1(m)
System.out.println("闸前监控水位1(m)" + dateFormat1.format(mbo.getDate("logtime")));
if (dateFormat1.format(mbo.getDate("logtime")).equalsIgnoreCase(
"00")) {
mbo.setValue(
"RIPARIANZONE", (mbo.getDouble("BEFOREGATE1") - mbo.getDouble("lastlogtime")) * 100000 / 3600);
} else {
MboSetRemote set = mbo.getThisMboSet();// 获取当前集合相关的值
int hour = Integer.parseInt(dateFormat1.format(mbo
.getDate("logtime")));
set.setWhere(" DATENAME(HOUR ,logtime)=" + (hour - 1) + " "); // 获取上一个小时的数据
double BEFOREGATE1 = set.getMbo(0).getDouble("BEFOREGATE1");
mbo.setValue(
"RIPARIANZONE",
(this.getMboValue().getDouble() - BEFOREGATE1) * 100000 / 3600);
}
}
if (attrName.equals("LOAD1")) { // 如果当前字段是发电负荷字段
// //发电负荷=1F负荷MW+2F负荷MW+3F负荷MW=LOAD1+LOAD2+LOAD3
mbo.setValue("POWERLOAD",
this.getMboValue().getDouble() + mbo.getDouble("LOAD2")
+ mbo.getDouble("LOAD3"), 2L);
}
if (attrName.equals("LOAD2")) {
mbo.setValue("POWERLOAD",
this.getMboValue().getDouble() + mbo.getDouble("LOAD1")
+ mbo.getDouble("LOAD3"), 2L);
}
if (attrName.equals("LOAD3")) {
mbo.setValue("POWERLOAD",
this.getMboValue().getDouble() + mbo.getDouble("LOAD2")
+ mbo.getDouble("LOAD1"), 2L);
}
if (attrName.equals("OPENING1")) { // 如果当前字段是开度字段
// //发电流量=(1F开度+2F开度+3F开度)*45.2=(OPENING1+OPENING2+OPENING3)*45.2
mbo.setValue(
"POWERFLOW",
(this.getMboValue().getDouble() + mbo.getDouble("OPENING2") + mbo
.getDouble("OPENING3")) * 45.2, 2L);
}
if (attrName.equals("OPENING2")) {
mbo.setValue(
"POWERFLOW",
(this.getMboValue().getDouble() + mbo.getDouble("OPENING1") + mbo
.getDouble("OPENING3")) * 45.2, 2L);
}
if (attrName.equals("OPENING3")) {
mbo.setValue(
"POWERFLOW",
(this.getMboValue().getDouble() + mbo.getDouble("OPENING1") + mbo
.getDouble("OPENING2")) * 45.2, 2L);
}
if (attrName.equals("OUTBOUNDTRAFFIC")) { // 总入库流量=出库流量+库区消落换算流量=
// OUTBOUNDTRAFFIC+RIPARIANZONE
mbo.setValue("INFLOWDISCHARGE", this.getMboValue().getDouble()
+ mbo.getDouble("RIPARIANZONE"), 2L);
}
if (attrName.equals("RIPARIANZONE")) {
mbo.setValue("INFLOWDISCHARGE", this.getMboValue().getDouble()
+ mbo.getDouble("OUTBOUNDTRAFFIC"), 2L);
}
if (attrName.equals("FLOWORDRAIN")) { // 出库流量=下泄流量+发电流量=FLOWORDRAIN+POWERFLOW
mbo.setValue("OUTBOUNDTRAFFIC", this.getMboValue().getDouble()
+ mbo.getDouble("POWERFLOW"), 2L);
}
if (attrName.equals("POWERFLOW")) {// 库区消落换算流量
mbo.setValue("OUTBOUNDTRAFFIC", this.getMboValue().getDouble()
+ mbo.getDouble("FLOWORDRAIN"), 2L);
}
if (attrName.equals("BEFOREGATE1")) { // 栅
// 差m=闸前监控水位1-栅后监控水位=BEFOREGATE1-AFTERGATE
mbo.setValue(
"GATE",
this.getMboValue().getDouble() - mbo.getDouble("AFTERGATE"),
2L);
}
if (attrName.equals("AFTERGATE")) {//
mbo.setValue("GATE", mbo.getDouble("BEFOREGATE1")
- this.getMboValue().getDouble(), 2L);
}
if (attrName.equals("SPILLWAYGATE1FLOW")) { // 下泄流量=1#泄洪闸流量+2#泄洪闸流量+冲砂闸流量+生态阀流量=SPILLWAYGATE1FLOW+SPILLWAYGATE2FLOW+SCOURINGFLOW+ECOLOGICAL
mbo.setValue(
"FLOWORDRAIN",
this.getMboValue().getDouble()
+ mbo.getDouble("SPILLWAYGATE2FLOW")
+ mbo.getDouble("SCOURINGFLOW")
+ mbo.getDouble("ECOLOGICAL"), 2L);
}
if (attrName.equals("SPILLWAYGATE2FLOW")) {
mbo.setValue(
"FLOWORDRAIN",
this.getMboValue().getDouble()
+ mbo.getDouble("SPILLWAYGATE1FLOW")
+ mbo.getDouble("SCOURINGFLOW")
+ mbo.getDouble("ECOLOGICAL"), 2L);
}
if (attrName.equals("SCOURINGFLOW")) {
mbo.setValue(
"FLOWORDRAIN",
this.getMboValue().getDouble()
+ mbo.getDouble("SPILLWAYGATE1FLOW")
+ mbo.getDouble("SPILLWAYGATE2FLOW")
+ mbo.getDouble("ECOLOGICAL"), 2L);
}
if (attrName.equals("ECOLOGICAL")) {
mbo.setValue(
"FLOWORDRAIN",
this.getMboValue().getDouble()
+ mbo.getDouble("SPILLWAYGATE1FLOW")
+ mbo.getDouble("SPILLWAYGATE2FLOW")
+ mbo.getDouble("SCOURINGFLOW"), 2L);
}
if (attrName.equals("POWERFLOW")) { // 耗水率=(发电流量*3600)/(发电负荷*1000)=(POWERFLOW*3600)/(POWERLOAD*1000)
mbo.setValue("WATERDEPRIVATION",
((this.getMboValue().getDouble() * 3600) / (mbo
.getDouble("POWERLOAD") * 1000)), 2L);
}
if (attrName.equals("POWERLOAD")) {
mbo.setValue("WATERDEPRIVATION",
((mbo.getDouble("POWERFLOW") * 3600) / (this.getMboValue()
.getDouble() * 1000)), 2L);
}
}
}
package tohi.app.rllogeq;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
/**
* 负荷开度统计
*
*/
public class FldRllogFhTotalCount extends MboValueAdapter {
public FldRllogFhTotalCount() {
super();
}
public FldRllogFhTotalCount(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=getMboValue().getMbo();
String attrName = this.mboValue.getAttributeName();
double sum=0.0d;
double max=0.0d;
double min=0.0d;
double avg=0.0d;
MboSetRemote mboSet=mbo.getThisMboSet();
if (attrName.equals("POWERLOAD")) { //如果当前字段是发电负荷字段
sum=mboSet.sum("POWERLOAD");
max=mboSet.max("POWERLOAD");
min=mboSet.min("POWERLOAD");
avg=mboSet.sum("POWERLOAD")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("POWERLOADTOTAL", sum);
mbo.getOwner().setValue("POWERLOADMAX", max);
mbo.getOwner().setValue("POWERLOADMIN", min);
mbo.getOwner().setValue("POWERLOADAVERAGE", avg);
}
else if (attrName.equals("POWERFLOW")) { //发电流量(m3/s)
sum=mboSet.sum("POWERFLOW");
max=mboSet.max("POWERFLOW");
min=mboSet.min("POWERFLOW");
avg=mboSet.sum("POWERFLOW")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("POWERFLOWTOTAL", sum);
mbo.getOwner().setValue("POWERFLOWMAX", max);
mbo.getOwner().setValue("POWERFLOWMIN", min);
mbo.getOwner().setValue("POWERLOADAVERAGE", avg);
}
else if (attrName.equals("INFLOWDISCHARGE")) { //总入库流量(m3/s)
sum=mboSet.sum("INFLOWDISCHARGE");
max=mboSet.max("INFLOWDISCHARGE");
min=mboSet.min("INFLOWDISCHARGE");
avg=mboSet.sum("INFLOWDISCHARGE")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("INFLOWDISCHARGETOTAL", sum);
mbo.getOwner().setValue("INFLOWDISCHARGEMAX", max);
mbo.getOwner().setValue("INFLOWDISCHARGEMIN", min);
mbo.getOwner().setValue("INFLOWDISCHARGEAVERAGE", avg);
}
else if (attrName.equals("OUTBOUNDTRAFFIC")) { //出库流量(m3/s)
sum=mboSet.sum("OUTBOUNDTRAFFIC");
max=mboSet.max("OUTBOUNDTRAFFIC");
min=mboSet.min("OUTBOUNDTRAFFIC");
avg=mboSet.sum("OUTBOUNDTRAFFIC")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("OUTBOUNDTRAFFICTOTAL", sum);
mbo.getOwner().setValue("OUTBOUNDTRAFFICMAX", max);
mbo.getOwner().setValue("OUTBOUNDTRAFFICMIN", min);
mbo.getOwner().setValue("OUTBOUNDTRAFFICAVERAGE", avg);
}
else if (attrName.equals("GATE")) { //栅差(m)
sum=mboSet.sum("GATE");
max=mboSet.max("GATE");
min=mboSet.min("GATE");
avg=mboSet.sum("GATE")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("GATEMAX", max);
mbo.getOwner().setValue("GATEMIN", min);
mbo.getOwner().setValue("GATEAVERAGE", avg);
}
else if (attrName.equals("WATERDEPRIVATION")) { //耗水率(m3/kW.h)
sum=mboSet.sum("WATERDEPRIVATION");
max=mboSet.max("WATERDEPRIVATION");
min=mboSet.min("WATERDEPRIVATION");
avg=mboSet.sum("WATERDEPRIVATION")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("WATERDEPRIVATIONMAX", max);
mbo.getOwner().setValue("WATERDEPRIVATIONMIN", min);
mbo.getOwner().setValue("WATERDEPRIVATIONAVERAGE", avg);
}
else if (attrName.equals("FLOWORDRAIN")) { //下泄流量(m3/s)
sum=mboSet.sum("FLOWORDRAIN");
max=mboSet.max("FLOWORDRAIN");
min=mboSet.min("FLOWORDRAIN");
avg=mboSet.sum("FLOWORDRAIN")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("FLOWORDRAINTOTAL", sum);
mbo.getOwner().setValue("FLOWORDRAINMAX", max);
mbo.getOwner().setValue("FLOWORDRAINMIN", min);
mbo.getOwner().setValue("FLOWORDRAINAVERAGE", avg);
}
else if (attrName.equals("RIPARIANZONE")) { //库区消落换算流量(m3/s)
sum=mboSet.sum("RIPARIANZONE");
max=mboSet.max("RIPARIANZONE");
min=mboSet.min("RIPARIANZONE");
avg=mboSet.sum("RIPARIANZONE")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("RIPARIANZONEMAX", max);
mbo.getOwner().setValue("RIPARIANZONEMIN", min);
mbo.getOwner().setValue("RIPARIANZONEAVERAGE", avg);
}
else if (attrName.equals("BEFOREGATE1")) { //闸前监控水位1(m)
sum=mboSet.sum("BEFOREGATE1");
max=mboSet.max("BEFOREGATE1");
min=mboSet.min("BEFOREGATE1");
avg=mboSet.sum("BEFOREGATE1")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("BEFOREGATE1MAX", max);
mbo.getOwner().setValue("BEFOREGATE1MIN", min);
mbo.getOwner().setValue("BEFOREGATE1AVERAGE", avg);
}
else if (attrName.equals("BEFOREGATE2")) { //闸前监控水位2(m)
sum=mboSet.sum("BEFOREGATE2");
max=mboSet.max("BEFOREGATE2");
min=mboSet.min("BEFOREGATE2");
avg=mboSet.sum("BEFOREGATE2")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("BEFOREGATE2MAX", max);
mbo.getOwner().setValue("BEFOREGATE2MIN", min);
mbo.getOwner().setValue("BEFOREGATE2AVERAGE", avg);
}
else if (attrName.equals("AFTERGATE")) { //栅后监控水位(m)
sum=mboSet.sum("AFTERGATE");
max=mboSet.max("AFTERGATE");
min=mboSet.min("AFTERGATE");
avg=mboSet.sum("AFTERGATE")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("AFTERGATEMAX", max);
mbo.getOwner().setValue("AFTERGATEMIN", min);
mbo.getOwner().setValue("AFTERGATEAVERAGE", avg);
}
else if (attrName.equals("TAILWATER")) { //尾水监控水位(m)
sum=mboSet.sum("TAILWATER");
max=mboSet.max("TAILWATER");
min=mboSet.min("TAILWATER");
avg=mboSet.sum("TAILWATER")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("TAILWATERMAX", max);
mbo.getOwner().setValue("TAILWATERMIN", min);
mbo.getOwner().setValue("TAILWATERAVERAGE", avg);
}
else if (attrName.equals("ECOLOGICAL")) { //生态阀流量(m3/s)
sum=mboSet.sum("ECOLOGICAL");
max=mboSet.max("ECOLOGICAL");
min=mboSet.min("ECOLOGICAL");
avg=mboSet.sum("ECOLOGICAL")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("ECOLOGICALTOTAL", sum);
mbo.getOwner().setValue("ECOLOGICALMAX", max);
mbo.getOwner().setValue("ECOLOGICALMIN", min);
mbo.getOwner().setValue("ECOLOGICALAVERAGE", avg);
}
else if (attrName.equals("SPILLWAYGATE1OPEN")) { //1\#泄洪闸开度(mm)
sum=mboSet.sum("SPILLWAYGATE1OPEN");
max=mboSet.max("SPILLWAYGATE1OPEN");
min=mboSet.min("SPILLWAYGATE1OPEN");
avg=mboSet.sum("SPILLWAYGATE1OPEN")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SPILLWAYGATE1OPENMAX", max);
mbo.getOwner().setValue("SPILLWAYGATE1OPENMIN", min);
mbo.getOwner().setValue("SPILLWAYGATE1OPENAVERAGE", avg);
}
else if (attrName.equals("SPILLWAYGATE1FLOW")) { //1\#泄洪闸流量(m3/s)
sum=mboSet.sum("SPILLWAYGATE1FLOW");
max=mboSet.max("SPILLWAYGATE1FLOW");
min=mboSet.min("SPILLWAYGATE1FLOW");
avg=mboSet.sum("SPILLWAYGATE1FLOW")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SPILLWAYGATE1FLOWTOTAL", sum);
mbo.getOwner().setValue("SPILLWAYGATE1FLOWMAX", max);
mbo.getOwner().setValue("SPILLWAYGATE1FLOWMIN", min);
mbo.getOwner().setValue("SPILLWAYGATE1FLOWAVERAGE", avg);
}
else if (attrName.equals("SPILLWAYGATE2OPEN")) { //2\#泄洪闸开度(mm)
sum=mboSet.sum("SPILLWAYGATE2OPEN");
max=mboSet.max("SPILLWAYGATE2OPEN");
min=mboSet.min("SPILLWAYGATE2OPEN");
avg=mboSet.sum("SPILLWAYGATE2OPEN")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SPILLWAYGATE2OPENMAX", max);
mbo.getOwner().setValue("SPILLWAYGATE2OPENMIN", min);
mbo.getOwner().setValue("SPILLWAYGATE2OPENAVERAGE", avg);
}
else if (attrName.equals("SPILLWAYGATE2FLOW")) { //2\#泄洪闸流量(m3/s)
sum=mboSet.sum("SPILLWAYGATE2FLOW");
max=mboSet.max("SPILLWAYGATE2FLOW");
min=mboSet.min("SPILLWAYGATE2FLOW");
avg=mboSet.sum("SPILLWAYGATE2FLOW")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SPILLWAYGATE2FLOWTOTAL", sum);
mbo.getOwner().setValue("SPILLWAYGATE2FLOWMAX", max);
mbo.getOwner().setValue("SPILLWAYGATE2FLOWMIN", min);
mbo.getOwner().setValue("SPILLWAYGATE2FLOWAVERAGE", avg);
}
else if (attrName.equals("SCOURINGOPEN")) { //冲砂闸开度(mm)
sum=mboSet.sum("SCOURINGOPEN");
max=mboSet.max("SCOURINGOPEN");
min=mboSet.min("SCOURINGOPEN");
avg=mboSet.sum("SCOURINGOPEN")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SCOURINGOPENMAX", max);
mbo.getOwner().setValue("SCOURINGOPENMIN", min);
mbo.getOwner().setValue("SCOURINGOPENAVERAGE", avg);
}
else if (attrName.equals("SCOURINGFLOW")) { //冲砂闸流量(m3/s)
sum=mboSet.sum("SCOURINGFLOW");
max=mboSet.max("SCOURINGFLOW");
min=mboSet.min("SCOURINGFLOW");
avg=mboSet.sum("SCOURINGFLOW")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("SCOURINGFLOWTOTAL", sum);
mbo.getOwner().setValue("SCOURINGFLOWMAX", max);
mbo.getOwner().setValue("SCOURINGFLOWMIN", min);
mbo.getOwner().setValue("SCOURINGFLOWAVERAGE", avg);
}
else if (attrName.equals("LOAD1")) { //1F负荷(MW)
sum=mboSet.sum("LOAD1");
max=mboSet.max("LOAD1");
min=mboSet.min("LOAD1");
avg=mboSet.sum("LOAD1")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("LOAD1TOTAL", sum);
mbo.getOwner().setValue("LOAD1MAX", max);
mbo.getOwner().setValue("LOAD1MIN", min);
mbo.getOwner().setValue("LOAD1AVERAGE", avg);
}
else if (attrName.equals("OPENING1")) { //1F开度
sum=mboSet.sum("OPENING1");
max=mboSet.max("OPENING1");
min=mboSet.min("OPENING1");
avg=mboSet.sum("OPENING1")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("OPENING1MAX", max);
mbo.getOwner().setValue("OPENING1MIN", min);
mbo.getOwner().setValue("OPENING1AVERAGE", avg);
}
else if (attrName.equals("LOAD2")) { //2F负荷(MW)
sum=mboSet.sum("LOAD2");
max=mboSet.max("LOAD2");
min=mboSet.min("LOAD2");
avg=mboSet.sum("LOAD2")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("LOAD2TOTAL", sum);
mbo.getOwner().setValue("LOAD2MAX", max);
mbo.getOwner().setValue("LOAD2MIN", min);
mbo.getOwner().setValue("LOAD2AVERAGE", avg);
}
else if (attrName.equals("OPENING2")) { //2F开度
sum=mboSet.sum("OPENING2");
max=mboSet.max("OPENING2");
min=mboSet.min("OPENING2");
avg=mboSet.sum("OPENING2")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("OPENING2MAX", max);
mbo.getOwner().setValue("OPENING2MIN", min);
mbo.getOwner().setValue("OPENING2AVERAGE", avg);
}
else if (attrName.equals("LOAD3")) { //3F负荷(MW)
sum=mboSet.sum("LOAD3");
max=mboSet.max("LOAD3");
min=mboSet.min("LOAD3");
avg=mboSet.sum("LOAD3")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("LOAD3TOTAL", sum);
mbo.getOwner().setValue("LOAD3MAX", max);
mbo.getOwner().setValue("LOAD3MIN", min);
mbo.getOwner().setValue("LOAD3AVERAGE", avg);
}
else if (attrName.equals("OPENING3")) { //3F开度
sum=mboSet.sum("OPENING3");
max=mboSet.max("OPENING3");
min=mboSet.min("OPENING3");
avg=mboSet.sum("OPENING3")/mboSet.count() ; //当前的求和除以数量
mbo.getOwner().setValue("OPENING3MAX", max);
mbo.getOwner().setValue("OPENING3MIN", min);
mbo.getOwner().setValue("OPENING3AVERAGE", avg);
}
}
}
package tohi.app.rllogeq;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
/**
* 电量计算绑定类
*
* @author 74644
*
*/
public class FldRllogTotalCount extends MboValueAdapter {
public FldRllogTotalCount() {
super();
}
public FldRllogTotalCount(MboValue mbv) {
super(mbv);
}
@Override
public void init() throws MXException, RemoteException {
super.init();
}
/**
* 判断属性进行计算相关数值
*/
@Override
public void action() throws MXException, RemoteException {
super.action();
String attrName = this.mboValue.getAttributeName();
MboRemote mbo = this.mboValue.getMbo();
if (attrName.equalsIgnoreCase("USEFULM1END")) { // 1\#机有功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USEFULM1START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM1", (this.mboValue.getDouble() - parseDoubleValue(mbo.getDouble("USEFULM1START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM1", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USEFULM2END")) { // 2#机有功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USEFULM2START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM2", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("USEFULM2START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM2", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USEFULM3END")) { // 3#机有功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USEFULM3START")) { // 判断当前今日大于昨日
mbo.setValue("USEFULM3", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("USEFULM3START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USEFULM3", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM1END")) { // 1#机无功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USELESSM1START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM1", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("USELESSM1START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM1", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM2END")) { // 2#机无功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USELESSM2START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM2", (this.mboValue.getDouble() -parseDoubleValue( mbo
.getDouble("USELESSM2START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM2", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("USELESSM3END")) { // 3#机无功本次读数
if (this.mboValue.getDouble() > mbo.getDouble("USELESSM3START")) { // 判断当前今日大于昨日
mbo.setValue("USELESSM3", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("USELESSM3START"))) * 82.8, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("USELESSM3", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("FACTORYUSE11BEND")) { // 厂用电11B上次读数
if (this.mboValue.getDouble() > mbo.getDouble("FACTORYUSE11BSTART")) { // 判断当前今日大于昨日
mbo.setValue("FACTORYUSE11B", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("FACTORYUSE11BSTART"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("FACTORYUSE11B", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("FACTORYUSE12BEND")) { // 厂用电12B上次读数
if (this.mboValue.getDouble() > mbo.getDouble("FACTORYUSE12BSTART")) { // 判断当前今日大于昨日
mbo.setValue("FACTORYUSE12B", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("FACTORYUSE12BSTART"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("FACTORYUSE12B", 0, 2L);
countTotalALL(mbo);
}
} else if (attrName.equalsIgnoreCase("SWITCH1003")) { // 厂用电1003上次读数
if (this.mboValue.getDouble() > mbo.getDouble("SWITCH1003PRE")) { // 判断当前今日大于昨日
mbo.setValue("PAIDPOWER", (this.mboValue.getDouble() - parseDoubleValue(mbo
.getDouble("SWITCH1003PRE"))) * 2, 2L);
countTotalALL(mbo);
} else {
mbo.setValue("PAIDPOWER", 0, 2L);
countTotalALL(mbo);
}
}else if (attrName.equalsIgnoreCase("USEFULPOSITIVE1U")) { // 江里线有功正
System.out.println("计算综合厂用电量");
countTotalALL(mbo);
}else if (attrName.equalsIgnoreCase("USEFULLOSS1E")) { // 江九线有功反
countTotalALL(mbo);
} else if (attrName.equalsIgnoreCase("USEFULPOSITIVE1E")) { // 江九线有功正
mbo.getOwner().setValue("DATEUSEFULUP",(this.mboValue.getDouble()-parseDoubleValue(mbo.getDouble("USEFULLOSS1Y"))),2L);
countTotalALL(mbo);
} else if (attrName.equalsIgnoreCase("USEFULLOSS1Y")) { // 垭江线有功反
mbo.getOwner().setValue("DATEUSEFULUP",(parseDoubleValue(mbo.getDouble("USEFULPOSITIVE1E")) - this.mboValue.getDouble()),2L);
System.out.println(mbo.getOwner().getDouble("DATEUSEFULUP"));
countTotalALL(mbo);
}
}
//计算日有功发电
public void CountDATEUSEFUL(MboRemote mbo) throws RemoteException, MXException{
mbo.getOwner().setValue("DATEUSEFUL",
parseDoubleValue(mbo.getDouble("USEFULM1")) + parseDoubleValue(mbo.getDouble("USEFULM2"))
+ parseDoubleValue(mbo.getDouble("USEFULM3")), 2L);
}
//计算日无功发电
public void CountDATEUSELESS(MboRemote mbo) throws RemoteException, MXException{
mbo.getOwner().setValue("DATEUSELESS",
parseDoubleValue(mbo.getDouble("USELESSM1")) + parseDoubleValue(mbo.getDouble("USELESSM2"))
+ parseDoubleValue(mbo.getDouble("USELESSM3")), 2L);
}
//统计数值
public void CountDATECOUSE(MboRemote mbo) throws RemoteException, MXException{
System.out.println(mbo.getOwner().getDouble("DATECOUSE")+"-------------------");
System.out.println(mbo.getOwner().getDouble("DATEUSEFUL")+"-------------------222222");
if (mbo.getOwner().getDouble("DATEUSEFUL")!=0) {
mbo.getOwner().setValue("DATECOUSEPERC",(parseDoubleValue(mbo.getOwner().getDouble("DATECOUSE")) / parseDoubleValue(mbo.getOwner().getDouble("DATEUSEFUL")) *100),2L);// 日厂用电率(%)
mbo.getOwner().setValue("DATESYNTHESISUSEPERC",((mbo.getOwner().getDouble("DATESYNTHESISUSE")) / parseDoubleValue(mbo.getOwner().getDouble("DATEUSEFUL"))),2L);//日综合厂用电率(%)
}else {
mbo.getOwner().setValue("DATECOUSEPERC",0,2L);// 日厂用电率(%)
mbo.getOwner().setValue("DATESYNTHESISUSEPERC",0,2L);//日综合厂用电率(%)
}
}
/**
* 日综合厂用电量
* @param mbo
* @throws RemoteException
* @throws MXException
*/
public void DATESYNTHESISUSE(MboRemote mbo) throws RemoteException, MXException{
//综合厂用电量=日有功发电量—日送出电量—江里线电量+江九线有功反+外购1003电量
//DATEUSEFUL - DATEUSEFULUP -USEFULPOSITIVE1U + USEFULLOSS1E + PAIDPOWER
mbo.getOwner().setValue("DATECOUSE",(mbo.getDouble("FACTORYUSE11B") +
mbo.getDouble("FACTORYUSE12B") + mbo.getDouble("PAIDPOWER")),2L); //日厂用电量
mbo.getOwner().setValue("DATESYNTHESISUSE",(
parseDoubleValue(mbo.getOwner().getDouble("DATEUSEFUL"))-parseDoubleValue(mbo.getOwner().getDouble("DATEUSEFULUP")) - parseDoubleValue(mbo.getDouble("USEFULPOSITIVE1U"))
+ parseDoubleValue(mbo.getDouble("USEFULLOSS1E"))+ parseDoubleValue(mbo.getDouble("PAIDPOWER"))
),2L);
}
public void countTotalALL(MboRemote mbo) throws RemoteException, MXException{
CountDATEUSELESS( mbo);
CountDATEUSEFUL( mbo);
DATESYNTHESISUSE(mbo);//日综合厂用电量
CountDATECOUSE(mbo);
}
public Double parseDoubleValue(Double d){
if (d!=null) {
return d;
}
return 0d;
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CustPlatecloseMbo extends Mbo
implements MboRemote{
public CustPlatecloseMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void init() throws MXException {
super.init();
try {
if (getString("ISACTION").equalsIgnoreCase("Y")) {
setFieldFlag("PROTEPLATENUM", 7L, true);
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void save() throws MXException, RemoteException {
super.save();
System.out.println("开始保存----");
System.out.println("init===");
if (getString("NEEDCLOSE").equalsIgnoreCase("Y")) { //更新投退表中的数据
MboSetRemote RLRELAYMANAGESet=MXServer.getMXServer().getMboSet("RLRELAYMANAGE",this.getUserInfo());
RLRELAYMANAGESet.setWhere("rlrelaymanageid='"+getLong("rlrelaymanageid")+"'");
MboRemote RLRELAYMANAGEmbo=RLRELAYMANAGESet.getMbo(0);
RLRELAYMANAGEmbo.setValue("BACTIONTIME1",getString("BACTIONTIME") ,11L);
RLRELAYMANAGEmbo.setValue("BOPPERSON1",getString("BOPPERSON"),11L );
RLRELAYMANAGEmbo.setValue("BORDERPERSON1",getString("BORDERPERSON"),11L );
RLRELAYMANAGEmbo.setValue("BORDERTIME1",getString("BORDERTIME"),11L );
RLRELAYMANAGEmbo.setValue("BCONTROLLER1",getString("BCONTROLLER") ,11L);
RLRELAYMANAGEmbo.setValue("BCONTENT1",getString("BCONTENT"),11L );
RLRELAYMANAGEmbo.setValue("NEEDCLOSE",getString("NEEDCLOSE") ,11L);
RLRELAYMANAGESet.save();
MboSetRemote PROTEPLATELINESet=MXServer.getMXServer().getMboSet("PROTEPLATELINE",this.getUserInfo());
System.out.println(getString("PROTEPLATENUM"));
PROTEPLATELINESet.setWhere("PROTEPLATELINEID='"+getLong("PROTEPLATELINEID")+"'");
PROTEPLATELINESet.getMbo(0).setValue("NEEDCLOSE",0,2L );
PROTEPLATELINESet.getMbo(0).setValue("SIGNOUT",0,2L );
PROTEPLATELINESet.save();
}
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustPlatecloseMboSet extends MboSet implements MboSetRemote{
public CustPlatecloseMboSet(MboServerInterface ms)
throws RemoteException {
super(ms);
// TODO Auto-generated constructor stub
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
// TODO Auto-generated method stub
return new CustPlatecloseMbo(arg0);
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.util.MXException;
public class CustRlrelaymanageMbo extends Mbo
implements MboRemote{
public CustRlrelaymanageMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void init() throws MXException {
super.init();
try {
if (getString("ISACTION").equalsIgnoreCase("Y")) {
setFieldFlag("PROTEPLATENUM", 7L, true);
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CustRlrelaymanageMboSet extends MboSet implements MboSetRemote{
public CustRlrelaymanageMboSet(MboServerInterface ms)
throws RemoteException {
super(ms);
// TODO Auto-generated constructor stub
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
// TODO Auto-generated method stub
return new CustRlrelaymanageMbo(arg0);
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
/**
* 获取相关联的二级菜单信息
*
*/
public class FldplateNum extends MAXTableDomain{
public FldplateNum(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "PLATENUM" };
String[] target = new String[1];
target[0] = thisname;
setLookupKeyMapInOrder(target, hz);
setRelationship("PROTEPLATELINE", "PLATENUM=:" + thisname +" ");
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
MboRemote mbo=getMboValue().getMbo();
String PROTEPLATENUM=mbo.getString("PROTEPLATENUM");
System.out.println("PROTEP"+PROTEPLATENUM);
setListCriteria("PROTEPLATENUM = '"+PROTEPLATENUM+"'");
return super.getList();
}
}
package tohi.app.rlrelaymanage;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
/**
* 获取相关联的一级菜单信息
*
*/
public class FldproteplateNum extends MAXTableDomain{
public FldproteplateNum(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "PROTEPLATENUM" };
String[] target = new String[1];
target[0] = thisname;
setLookupKeyMapInOrder(target, hz);
setRelationship("PROTEPLATE", "PROTEPLATENUM=:" + thisname +" " ); //选择已经闭环的装置
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
//and PROTEPLATENUM in (select PROTEPLATENUM from RLRELAYMANAGE where NEEDCLOSE = 1 and PROTEPLATENUM is not null )
//and PROTEPLATENUM in (select PROTEPLATENUM from PLATECLOSE where NEEDCLOSE = 1 and PROTEPLATENUM is not null )
// MboRemote mbo=getMboValue().getMbo();
// if (mbo.getName().equalsIgnoreCase("RLRELAYMANAGE")) { //如果是投退,需要找已闭环的装置
// setListCriteria(" PROTEPLATENUM in (select PROTEPLATENUM from PLATECLOSE where NEEDCLOSE = 1 and PROTEPLATENUM is not null ) ");
// }
// if (mbo.getName().equalsIgnoreCase("PLATECLOSE")) { // 如果是闭环,需要找已投退的装置
// setListCriteria(" PROTEPLATENUM in (select PROTEPLATENUM from RLRELAYMANAGE where NEEDCLOSE = 1 and PROTEPLATENUM is not null )");
// }
return super.getList();
}
@Override
public void initValue() throws MXException, RemoteException {
MboRemote mbo=getMboValue().getMbo();
super.initValue();
if (mbo.getString("ISACTION").equalsIgnoreCase("Y")) {
mbo.setFieldFlag("PROTEPLATENUM", 7L, true);
}
if (mbo.getString("ISACTION").equalsIgnoreCase("N")) {
mbo.setFieldFlag("PROTEPLATENUM", 7L, false);
}
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=getMboValue().getMbo();
mbo.setValueNull("PLATENUM");
if (mbo.getString("ISACTION").equalsIgnoreCase("1")) {
mbo.setFieldFlag("PROTEPLATENUM", 7L, true);
}
}
}
package tohi.app.rlshifts;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueInfo;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import tohi.app.tools.MboService;
public class RlshiftsMbo extends Mbo implements MboRemote{
public RlshiftsMbo(MboSet ms) throws RemoteException {
super(ms);
}
public void add() throws MXException, RemoteException {
MboService.create(this).setValuesByRelationship();
super.add();
System.out.println("添加单号");
setValue("SHIFTNUM", "保存后生成", 11L);
}
@Override
protected void save() throws MXException, RemoteException {
super.save();
if (toBeAdded()) {
String num=genKeyNum();
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("RLSHIFTS",MXServer.getMXServer().getSystemUserInfo());
mboSet.setWhere("SHIFTNUM = '"+num+"'");
if (mboSet.count()!=0) {
throw new MXApplicationException("日志", "当天已经产生运行交接班记录,无法再次产生!!!");
}
setValue("SHIFTNUM", num, 11L);
}
}
public String genKeyNum() throws RemoteException, MXException{
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd");
String num="";
if ( getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班
Date date=new Date();
Calendar c=Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_MONTH, 1); //输出一天后的日期
num=sdf.format(c.getTime());
}
if ( getString("MARKSIGN").equalsIgnoreCase("M")) { //如果是白班
num=sdf.format(new Date());
}
String MARKSIGN=getString("MARKSIGN");
num=num+MARKSIGN;//时间+班次
return num;
}
}
package tohi.app.rlshifts;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class RlshiftsMboSet extends MboSet implements MboSetRemote{
public RlshiftsMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new RlshiftsMbo(arg0);
}
}
package tohi.app.workflow;
import java.rmi.RemoteException;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class CustWorkSheetAction implements ActionCustomClass {
public CustWorkSheetAction() {
super();
}
@Override
public void applyCustomAction(MboRemote mbo, Object[] arg1)
throws MXException, RemoteException {
MXServer mxServer = MXServer.getMXServer();
MboSetRemote PJOOBSERVATIONSet = mxServer.getMboSet("PJOOBSERVATION",
mbo.getUserInfo());
if (mbo.getString("PJOTYPE").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE1").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE1", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE2").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE2", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE3").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE3", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE4").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE4", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE5").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE5", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE6").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE6", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE7").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE7", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE8").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE8", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE9").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE9", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
if (mbo.getString("PJOTYPE10").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE10", 11L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
PJOOBSERVATIONSet.save();
}
PJOOBSERVATIONSet.close();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment