Commit aee8ec8f authored by zhh's avatar zhh

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

parent c63b2e24
This diff is collapsed.
<?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
This diff is collapsed.
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();
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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