Commit 3d0fa8e8 authored by zhonghonghui's avatar zhonghonghui

'更新年终备份'

parent 4f46d9fd
import java.text.SimpleDateFormat;
import java.util.Date;
public class Test {
public static void main(String[] args) {
SimpleDateFormat sdf=new SimpleDateFormat("yyMMdd");
System.out.println(sdf.format(new Date()));
// double s= (28.00 - 25.00) * 100000.0D / 3600.0D;
// double s= (1793.64 - 1793.36) * 100000.0D / 3600.0D;
System.out.println(27.78*3);
}
}
package clp.app.common.purchasing;
import java.rmi.RemoteException;
import psdi.app.common.purchasing.FldPurLineType;
import psdi.mbo.Mbo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class CustFldPurLineType extends FldPurLineType
{
public CustFldPurLineType(MboValue mbv)
throws MXException, RemoteException
{
super(mbv);
}
@Override
public void initValue() throws MXException, RemoteException {
super.initValue();
}
public MboSetRemote getList() throws MXException, RemoteException {
String sqlWhere = " and maxvalue in ('ITEM', 'SERVICE')";
MboSetRemote valueListSet = super.getList();
String relationWhere = valueListSet.getRelationship();
valueListSet.setRelationship(relationWhere + sqlWhere);
valueListSet.setOrderBy("maxvalue");
return valueListSet;
}
public void validate() throws RemoteException, MXException {
getMboValue().getMbo().setValue("GLDEBITACCT", "999-999-999", 2L);
getMboValue().getMbo().setFieldFlag("DESCRIPTION", 7L, false);
if ("ITEM".equals(getMboValue().getMbo().getString("linetype"))){
getMboValue().getMbo().setFieldFlag("DESCRIPTION", 7L, true);
}
else{
getMboValue().getMbo().setFieldFlag("DESCRIPTION", 7L, false);
}
}
@Override
public void action() throws MXException, RemoteException {
super.action();
}
}
\ No newline at end of file
package clp.app.crontask;
import clp.app.rtinspection.RTInspcPlan;
import clp.app.rtinspection.RTInspcPlanSet;
import java.io.PrintStream;
......@@ -47,7 +46,7 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask
MXServer mxserver = MXServer.getMXServer();
RTInspcPlanSet rtInspcPlanSet = (RTInspcPlanSet)mxserver.getMboSet("RTInspcPlan", getRunasUserInfo());
StringBuilder strBuffer = new StringBuilder();
strBuffer.append("status='已核准' and nextdate < dbo.GetLocalDate(DEFAULT) ").append(" and (frequnit not in ('NOON','6.乙','7.丙') ").append(" or (frequnit='NOON' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=12) ").append(" or (frequnit='6.乙' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=13) ").append(" or (frequnit='7.丙' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=19) ) ").append(" and (not exists(select 1 from timeline where num=rtinspcplan.rtinsplnum and siteid=rtinspcplan.siteid) ").append("\t\tor exists(select 1 from timeline where num=rtinspcplan.rtinsplnum and siteid=rtinspcplan.siteid ").append("\t\tand flag=0 and (rtinspcplan.nextdate-0.02084+substring( convert(varchar,starttime,120),12,16))<(dbo.GetLocalDate(DEFAULT))) ").append("\t) ");
strBuffer.append("status='已核准' and nextdate < dbo.GetLocalDate(DEFAULT) ").append(" and (frequnit not in ('NOON','6.乙','7.丙') ").append(" or (frequnit='NOON' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=12) ").append(" or (frequnit='6.乙' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=13) ").append(" or (frequnit='7.丙' and DATENAME(HOUR, dbo.GetLocalDate(DEFAULT))>=19) ) ").append(" and (not exists(select 1 from timeline where num=rtinspcplan.rtinsplnum and siteid=rtinspcplan.siteid) ").append("\t\tor exists(select 1 from timeline where num=rtinspcplan.rtinsplnum and siteid=rtinspcplan.siteid ").append("\t\tand flag=0 and (rtinspcplan.nextdate-0.02084+substring( convert(varchar,starttime,120),12,16))<(dbo.GetLocalDate(DEFAULT))) ").append("\t) ");
rtInspcPlanSet.setWhere(strBuffer.toString());
rtInspcPlanSet.reset();
RTInspcPlan rtInspcPlan = null;
......@@ -73,7 +72,7 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask
MXServer mxserver = MXServer.getMXServer();
WorkFlowServiceRemote wfsr = (WorkFlowServiceRemote)mxserver.lookup("WORKFLOW");
MboSetRemote rtInspcSet = mxserver.getMboSet("RTInspection", getRunasUserInfo());
rtInspcSet.setWhere("RTINSPLNUM is not null and not exists(select 1 from wfassignment where ownerid=rtinspection.routinginspectionid and ownertable='RTINSPECTION' and assignstatus='ACTIVE') and historyflag=0 and status in ('草稿','已核准') and datediff(day,rtinspcdate,dbo.GetLocalDate(DEFAULT))<=1");
rtInspcSet.setWhere("RTINSPLNUM is not null and not exists(select 1 from wfassignment where ownerid=rtinspection.routinginspectionid and ownertable='RTINSPECTION' and assignstatus='ACTIVE') and historyflag=0 and status in ('草稿','已核准') and datediff(day,rtinspcdate,dbo.GetLocalDate(DEFAULT))<=1");
rtInspcSet.reset();
MboRemote rtInspc = null;
......@@ -90,20 +89,20 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask
Date sysdate = MXServer.getMXServer().getDate();
if (!ft.format(sysdate).equalsIgnoreCase(ft.format(nextdate))) {
if (sysdate.compareTo(nextdate) < 0) {
throw new MXApplicationException("提示:", "巡检日期为:" + ft.format(nextdate) + ",还没到期!");
throw new MXApplicationException("提示:", "巡检日期为:" + ft.format(nextdate) + ",还没到期!");
}
if (sysdate.compareTo(nextdate) > 0) {
nextdate = sysdate;
}
}
//将历史单据任务改为取消状态
//将历史单据任务改为取消状态
MXServer mxserver = MXServer.getMXServer();
MboSetRemote rtSet = mxserver.getMboSet("RTINSPECTION", getRunasUserInfo());
rtSet.setWhere("status='已核准' and ROUTE='"+rtInspcPlan.getString("ROUTE")+"'");
rtSet.setWhere("status='已核准' and ROUTE='"+rtInspcPlan.getString("ROUTE")+"'");
for (int i = 0; i < rtSet.count(); i++) {
rtSet.getMbo(i).setValue("status", "过期",11L);;
rtSet.getMbo(i).setValue("status", "已过期",11L);;
}
rtSet.save(11L);
......@@ -116,7 +115,7 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask
rtinspc.setValue("ROUTE", rtInspcPlan.getString("ROUTE"));
rtinspc.setValue("RTINSPLNUM", rtInspcPlan.getString("RTINSPLNUM"));
rtinspc.setValue("endtime", rtInspcPlan.getDate("endtime"));
rtinspc.setValue("status", "已核准");
rtinspc.setValue("status", "已核准");
MboSetRemote PersonGrpTeamSet = rtInspcPlan.getMboSet("$personGroupTeam", "personGroupTeam", "persongroup='" + rtInspcPlan.getString("OWNERGROUP") + "'");
MboSetRemote leadGrpSet = rtinspc.getMboSet("LEADGROUP");
MboRemote personGrpTeam = null;
......
package clp.app.invoice;
import java.io.PrintStream;
import java.rmi.RemoteException;
import psdi.app.invoice.FldInvoicePONum;
import psdi.mbo.Mbo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.security.ProfileRemote;
import psdi.util.MXException;
public class CLPFldInvoicePONum extends FldInvoicePONum
{
public CLPFldInvoicePONum(MboValue mbv)
throws MXException, RemoteException
{
super(mbv);
}
public MboSetRemote getList() throws MXException, RemoteException {
String sqlWhere = " and ponum not in(select ponum from po join (select ponum as inv_ponum, sum(custqkje) as sum_custqkje from invoice where siteid = '" +
getMboValue().getMbo().getString("siteid") + "' and status != 'CANCEL' group by ponum) " +
" as inv on ponum = inv_ponum " +
" where siteid = '" + getMboValue().getMbo().getString("siteid") + "' and totalcost <= sum_custqkje)";
MboSetRemote valueListSet = super.getList();
String relationWhere = valueListSet.getRelationship();
valueListSet.setRelationship(relationWhere + sqlWhere);
valueListSet.setOrderBy("ponum");
System.out.println("valueListSet.getRelationship() = " + valueListSet.getRelationship());
return valueListSet;
}
public void action()
throws RemoteException, MXException
{
super.action();
String ponum = getMboValue().getString();
Mbo localMbo = getMboValue().getMbo();
// if ((ponum == null) || (ponum.equals(""))) {
localMbo.setFieldFlag("custfklx", 7L, false);
localMbo.setValue("CUSTQKJE", 0, 11L);
localMbo.setValue("CUSTCYFK", 0, 11L);
localMbo.setValue("CUSTLZBJ", 0, 11L);
localMbo.setValue("CUSTYLZBJ", 0, 11L);
localMbo.setValue("CUSTYFKJE", 0, 11L);
// } else {
if (!localMbo.isNew()) {
localMbo.setFieldFlag("custfklx", 7L, true);
}
MboSetRemote invoiceSet = localMbo.getMboSet("$invoice", "invoice",
"ponum='" + ponum + "' and invoicenum!='" +
localMbo.getString("invoicenum") +
"' and siteid='" +
localMbo.getProfile().getDefaultSite() + "'" +
" and status != 'CANCEL'");
if (!invoiceSet.isEmpty()) {
localMbo.setValue("CUSTYFKJE", invoiceSet.sum("CUSTQKJE"), 11L);
localMbo.setValue("CUSTYLZBJ", invoiceSet.sum("CUSTLZBJ"), 11L);
if ("01".equals(localMbo.getString("custfklx"))) {
MboSetRemote invoice0203Set = localMbo.getMboSet("$invoice1",
"invoice", "ponum='" + ponum + "' and invoicenum!='" +
localMbo.getString("invoicenum") +
"' and siteid='" +
localMbo.getProfile().getDefaultSite() +
"' and custfklx in('02','03')" +
" and status != 'CANCEL'");
localMbo.setValue("CUSTCYFK", invoiceSet.sum("CUSTQKJE") - (
!invoice0203Set.isEmpty() ? invoice0203Set.sum("CUSTCYFK") : 0.0D), 11L);
}
// }
}
}
}
\ No newline at end of file
package clp.app.invoice;
import java.rmi.RemoteException;
import java.util.Date;
import psdi.app.invoice.Invoice;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class CLPInvoice
extends Invoice
implements CLPInvoiceRemote
{
public CLPInvoice(MboSet paramMboSet)
throws MXException, RemoteException
{
super(paramMboSet);
}
public void init()
throws MXException
{
super.init();
try
{
String status = getString("status");
String[] as = { "DESCRIPTION", "PONUM", "CUSTGKBM", "CUSTLZBJ", "CONTACT", "PAYMENTTERMS", "CHECKCODE",
"CHECKNUM", "BANKACCOUNT", "BANKNUM", "INCLUSIVE1", "VENDORINVOICENUM", "INVOICEDATE", "DUEDATE",
"CUSTPAYTYPE", "CUSTMEMO", "CUSTTYPE" };
if (isNew())
{
setFieldFlag("custfklx", 7L, false);
return;
}
if ((getString("enterby").equalsIgnoreCase(getUserName())) && (status.equals("WAPPR"))) {
return;
}
setFieldFlag(as, 7L, true);
MboSetRemote INVOICELINE = getMboSet("INVOICELINE");
INVOICELINE.setFlag(7L, true);
MboSetRemote wfment = getMboSet("$wfassignment", "wfassignment",
"ownerid='" + getInt("invoiceid") + "' and assignstatus='ACTIVE' and assigncode='" +
getUserInfo().getPersonId().toUpperCase() + "' and ownertable='" + getName().toUpperCase() +
"'");
int i = wfment.count();
if ((i > 0) && (status.equals("WAPPR")))
{
setFieldFlag(as, 7L, false);
INVOICELINE.setFlag(7L, false);
setFieldFlag("TOTALCOST", 7L, false);
}
else
{
setFieldFlag(as, 7L, true);
setFieldFlag("custfklx", 7L, true);
setFieldFlag("TOTALCOST", 7L, true);
}
}
catch (RemoteException localRemoteException) {}
}
public void add()
throws MXException, RemoteException
{
super.add();
setValue("status", "WAPPR", 2L);
setValue("CUSTQKJE", 0, 11L);
setValue("CUSTCYFK", 0, 11L);
setValue("CUSTLZBJ", 0, 11L);
setValue("CUSTYLZBJ", 0, 11L);
setValue("CUSTYFKJE", 0, 11L);
}
public void changeStatus(String status, Date asOfDate, String memo, long accessModifier)
throws MXException, RemoteException
{
if ("COMP".equals(status))
{
String bankAcct = getString("BANKACCOUNT");
String bankNum = getString("BANKNUM");
MboSetRemote vendors = getMboSet("COMPANIES");
if (!vendors.isEmpty())
{
MboRemote vendor = vendors.getMbo(0);
if (!"".equals(bankAcct)) {
vendor.setValue("BANKACCOUNT", bankAcct);
}
if (!"".equals(bankNum)) {
vendor.setValue("BANKNUM", bankNum);
}
}
}
super.changeStatus(status, asOfDate, memo, accessModifier);
}
}
......@@ -121,14 +121,13 @@ public class GenRtinspcTask implements ActionCustomClass {
dir.mkdirs();
}
File checkFile = new File(fileName);
File checkFile = new File(fileName,"");
FileWriter writer = null;
try {
if (!checkFile.exists()) {
checkFile.createNewFile();
}
writer = new FileWriter(checkFile, false);
writer.append(rtinspcJson);
writer.flush();
......
......@@ -37,7 +37,7 @@ public void add() throws MXException, RemoteException
{
super.add();
this.log.debug("RtInspection.add");
setValue("status", "稿", 11L);
setValue("status", "草稿", 11L);
setValue("createdby", getUserInfo().getUserName(), 11L);
setValue("createdate", MXServer.getMXServer().getDate(), 11L);
setValue("statusdate", MXServer.getMXServer().getDate(), 11L);
......@@ -61,7 +61,7 @@ public void add() throws MXException, RemoteException
return;
}
if ((getString("CREATEDBY").equalsIgnoreCase(getUserName())) &&
(status.equals("稿"))) {
(status.equals("草稿"))) {
return;
}
setFieldFlag(as, 7L, true);
......@@ -79,12 +79,12 @@ public void add() throws MXException, RemoteException
"' and ownertable='" + getName().toUpperCase() +
"'");
int i = wfment.count();
if ((i > 0) && ("稿".equals(status))) {
if ((i > 0) && ("草稿".equals(status))) {
setFieldFlag(as, 7L, false);
leadGrp.setFlag(7L, false);
rtInspcStops.setFlag(7L, false);
}
if ((i > 0) && (("已核准".equals(status)) || ("验收不合格".equals(status))))
if ((i > 0) && (("已核准".equals(status)) || ("验收不合格".equals(status))))
setFieldFlag(as2, 7L, false);
}
catch (RemoteException localRemoteException) {
......
package clp.app.workorder;
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.security.ProfileRemote;
import psdi.util.MXException;
public class CLPCustprojectid
extends MAXTableDomain
{
public CLPCustprojectid(MboValue mbovalue)
throws RemoteException, MXException
{
super(mbovalue);
String s = getMboValue().getAttributeName();
setRelationship("fincntrl", "projectid=:" + s);
setLookupKeyMapInOrder(new String[] { s }, new String[] { "projectid" });
String custdept = getMboValue().getMbo().getString("custdept");
String sqlStr = "";
String PCARDNUM = "";
MboSetRemote custdeptSet = getMboValue().getMbo().getMboSet("$person", "person",
"personid='" + getMboValue().getMbo().getUserName() + "'");
if (custdeptSet.count() == 1) {
PCARDNUM = custdeptSet.getMbo(0).getString("PCARDNUM");
}
if (getMboValue().getMbo().getString("siteid").equals("CLP-HJ-HJ"))
{
if ((custdept.equals("01")) || (custdept.equals("02")) || (custdept.equals("03")) || (custdept.equals("04")) ||
(custdept.equals("05")) || (custdept.equals("06")) || (custdept.equals("07")) || (custdept.equals("14")) ||
(custdept.equals("22"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept is null or custdept='" + custdept + "')";
} else if ((custdept.equals("12")) || (custdept.equals("13")))
{
if ("A".equals(PCARDNUM)) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and custdept in('12','13')";
}
}
else if ((custdept.equals("20")) || (custdept.equals("21"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and custdept in('20','21')";
} else {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and custdept='" + custdept + "'";
}
}
else if (getMboValue().getMbo().getString("siteid").equals("CLP-YN-YE"))
{
if ((custdept.equals("01")) || (custdept.equals("02")) || (custdept.equals("03"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept is null or custdept='" + custdept + "')";
} else if (custdept.equals("04")) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept like '04%' or custdept is null)";
} else if ((custdept.equals("0401")) || (custdept.equals("0402"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept like '04%' or custdept is null)";
} else {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept='" + custdept + "' or custdept is null or custdept='04')";
}
}
else if (getMboValue().getMbo().getString("siteid").equals("CLP-HY-BX")) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and custdept='" + custdept + "'";
} else if (getMboValue().getMbo().getString("siteid").equals("CLP-QA-WX")) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and custdept='" + custdept + "'";
} else if (getMboValue().getMbo().getString("siteid").equals("CLP-JB-JBZB"))
{
if ((custdept.equals("01")) || (custdept.equals("02")) || (custdept.equals("03")) || (custdept.equals("04")) ||
(custdept.equals("05")) || (custdept.equals("06"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept is null or custdept='" + custdept + "')";
} else if (custdept.equals("07")) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept like '07%' or custdept is null)";
} else if ((custdept.equals("0701")) || (custdept.equals("0702")) || (custdept.equals("0703")) ||
(custdept.equals("0704")) || (custdept.equals("0705"))) {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept like '07%' or custdept is null)";
} else {
sqlStr =
"siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "' and (custdept='" + custdept + "' or custdept is null or custdept like '07%')";
}
}
else {
sqlStr = "siteid='" + getMboValue().getMbo().getProfile().getDefaultSite() + "'";
}
System.out.println(sqlStr + " and FCSTATUS='APPR'");
setListCriteria(sqlStr + " and FCSTATUS='APPR'");
}
}
package clpui.webclient.beans.assetcat;
import java.rmi.RemoteException;
import psdi.app.assetcatalog.ClassStructureSetRemote;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
import psdi.webclient.beans.assetcat.SearchClassificationBean;
import psdi.webclient.system.beans.DataBean;
public class CustSearchClassificationItemsBean
extends SearchClassificationBean
{
public void initialize()
throws MXException, RemoteException
{
super.initialize();
ClassStructureSetRemote classstructuresetremote = (ClassStructureSetRemote)getMboSet();
classstructuresetremote.setWhere("custty=0");
}
public int selectnode()
throws MXException
{
super.selectnode();
try
{
if (getMbo() != null)
{
String classificationid = getMbo()
.getString("classificationid");
if ((classificationid.length() == 4) &&
(getOriginatingDataBean() != null) &&
(getOriginatingDataBean().getMbo() != null))
{
getOriginatingDataBean().setValue("classstructureid",
classificationid, 11L);
getOriginatingDataBean().fireDataChangedEvent();
}
}
}
catch (RemoteException e)
{
e.printStackTrace();
}
return 1;
}
public MboSetRemote getResultSetForReturn()
throws MXException, RemoteException
{
MboRemote mboremote = getSelectedClassStructure();
MboSetRemote mbosetremote = mboremote.getMboSet("ITEM");
return mbosetremote;
}
public String getAttributeForReturn()
throws MXException, RemoteException
{
return "itemnum";
}
public String getResultObjectName()
throws MXException, RemoteException
{
return "ITEM";
}
}
package clpui.webclient.beans.assetcat;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetInfo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.SqlFormat;
import psdi.security.ProfileRemote;
import psdi.util.MXException;
import psdi.webclient.beans.assetcat.SearchClassificationBean;
import psdi.webclient.beans.assetcat.SearchClassificationItemsBean;
import psdi.webclient.beans.assetcat.SearchClassificationTicketsBean;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.AppInstance;
import psdi.webclient.system.controller.SessionContext;
import psdi.webclient.system.controller.Utility;
import psdi.webclient.system.controller.WebClientEvent;
public class CustSelectValueBean
extends DataBean
{
protected MboSetRemote getMboSetRemote()
throws MXException, RemoteException
{
MboSetRemote mboSetRemote = super.getMboSetRemote();
if (this.parent != null)
{
SearchClassificationBean parentBean = (SearchClassificationBean)this.parent;
DataBean origBean = parentBean.getOriginatingDataBean();
parentBean.setSelectValueBean(this);
String objectName = origBean.getMboSet().getName().toLowerCase();
String where = "";
if (((objectName.equals("incident")) || (objectName.equals("problem")) ||
(objectName.equals("sr"))) &&
(mboSetRemote != null) &&
((parentBean instanceof SearchClassificationTicketsBean)))
{
where = mboSetRemote.getCompleteWhere();
String sql =
" and ticketid in (select ticketid from " +
objectName +
" b where b.ticketid=ticket.ticketid and b.class=ticket.class)";
String sql2 = "";
String attr = parentBean.getOriginatingDataBean()
.getReturnAttribute().toLowerCase();
if (attr.equals("globalticketid")) {
sql2 = " and isglobal =1";
}
mboSetRemote.setRelationship(
where + sql2 + sql);
mboSetRemote.reset();
SearchClassificationTicketsBean ticketBean = (SearchClassificationTicketsBean)parentBean;
ticketBean.setNewMboSet(mboSetRemote);
}
if ((mboSetRemote != null) &&
(mboSetRemote.getName().equalsIgnoreCase("ITEM")))
{
where = mboSetRemote.getCompleteWhere();
MboRemote mbo = origBean.getMbo();
String itemSetid = null;
if (mbo != null) {
try
{
itemSetid = mbo.getString("itemsetid");
}
catch (Exception localException) {}
}
if (itemSetid != null)
{
if (itemSetid.equals("")) {
itemSetid = mbo.getInsertItemSetId();
}
if ((itemSetid != null) && (!itemSetid.equals("")))
{
String sql = " and itemsetid = :1";
SqlFormat sqf = new SqlFormat(mbo.getUserInfo(), sql);
sqf.setObject(1, "SETS", "SETID", itemSetid);
mboSetRemote.setRelationship(
where + sqf.format());
}
else
{
mboSetRemote.setRelationship(where);
}
mboSetRemote.reset();
SearchClassificationItemsBean itemsBean = (SearchClassificationItemsBean)parentBean;
itemsBean.setNewMboSet(mboSetRemote);
}
}
if ((objectName.equals("route_stop")) && (mboSetRemote != null))
{
String siteid = origBean.getMbo().getOwner()
.getString("siteid");
String sql = "siteid = :1";
SqlFormat sqf = new SqlFormat(
origBean.getMbo().getOwner().getUserInfo(), sql);
sqf.setObject(1, "SITE", "SITEID", siteid);
mboSetRemote.setWhere(sqf.format());
mboSetRemote.reset();
}
int siteOrgType = mboSetRemote.getMboSetInfo().getSiteOrgType();
if (siteOrgType == 1)
{
ProfileRemote profile = mboSetRemote.getProfile();
if (!profile.oneGroupHasAllSites())
{
String siteString = profile.getSitesString();
String completeWhere = mboSetRemote.getCompleteWhere();
String sql = " siteid in " +
siteString;
if ((completeWhere != null) && (!completeWhere.equals(""))) {
sql =
completeWhere + " and " + sql;
}
mboSetRemote.setWhere(sql);
mboSetRemote.reset();
}
}
}
return mboSetRemote;
}
public int selectrecord()
throws MXException
{
try
{
super.selectrecord();
SearchClassificationBean searchclassificationbean = (SearchClassificationBean)this.parent;
DataBean mainMboBean = searchclassificationbean
.getOriginatingDataBean();
MboRemote custitem = mainMboBean.getMbo();
if (!"WAPPR".equals(custitem.getString("status")))
{
Utility.showMessageBox(this.sessionContext.getCurrentEvent(), "",
"在此状态下不能修改物资分类!", 0);
}
else
{
MboRemote selectedMbo = getMbo();
String itemnum = selectedMbo.getString("itemnum").substring(0,
4);
mainMboBean.setValue("classstructureid", itemnum, 11L);
mainMboBean.setValue("description",
selectedMbo.getString("description"), 11L);
mainMboBean.setValue("custdwg",
selectedMbo.getString("custdwg"), 11L);
mainMboBean.setValue("custmodel",
selectedMbo.getString("custmodel"), 11L);
mainMboBean.setValue("custspcf",
selectedMbo.getString("custspcf"), 11L);
mainMboBean.setValue("custjldw",
selectedMbo.getString("orderunit"), 11L);
mainMboBean.fireDataChangedEvent();
}
Utility.sendEvent(new WebClientEvent("dialogclose",
this.app.getCurrentPageId(), null, this.sessionContext));
}
catch (RemoteException e)
{
e.printStackTrace();
}
return 1;
}
}
package clpui.webclient.beans.worksheet;
import clp.app.worksheet.CLPWorksheetRemote;
import java.rmi.RemoteException;
import psdi.mbo.MboConstants;
import psdi.mbo.MboRemote;
import psdi.security.UserInfo;
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;
import psdi.webclient.system.session.WebClientSession;
import psdi.workflow.WFAssignmentRemote;
import psdi.workflow.WFAssignmentSetRemote;
import psdi.workflow.WorkFlowServiceRemote;
public class CLPWorksheetAppBean
extends AppBean
implements MboConstants
{
public void initializeApp()
throws MXException, RemoteException
{
if (!this.app.inAppLinkMode())
{
DataBean resultsBean = this.app.getResultsBean();
resultsBean.setQbe("HISTORYFLAG", "0");
resultsBean.reset();
}
super.initializeApp();
}
public int SAVE()
throws MXException, RemoteException
{
CLPWorksheetRemote ws = (CLPWorksheetRemote)getMbo();
if ((ws.getBoolean("WS29")) && (("".equals(ws.getString("FIREPERSONNAME"))) || (ws.isNull("FIREPERSONNAME")))) {
throw new MXApplicationException("worksheet", "firePersonNameNull");
}
if ((ws.getBoolean("WS38")) && (ws.isNull("WATCHMINUTES"))) {
throw new MXApplicationException("worksheet", "watchMinutesNull");
}
return super.SAVE();
}
public int REPLACECP()
throws MXException, RemoteException
{
CLPWorksheetRemote wsRemote = (CLPWorksheetRemote)getMbo();
String status = wsRemote.getString("STATUS");
int acceptedByReplCount = wsRemote.getInt("ACCEPTEDBYREPLCOUNT");
int evacuatedByReplCount = wsRemote.getInt("EVACUATEDBYREPLCOUNT");
if ("ISSUE".equalsIgnoreCase(status))
{
if (acceptedByReplCount >= 2) {
throw new MXApplicationException("worksheet", "acceptedByReplCount");
}
}
else if ("ACCEPT".equalsIgnoreCase(status))
{
if (evacuatedByReplCount >= 2) {
throw new MXApplicationException("worksheet", "evacuatedByReplCount");
}
}
else {
return 0;
}
String assignCode = wsRemote.getString("WFASSIGNMENT.ASSIGNCODE");
String roleId = wsRemote.getString("WFASSIGNMENT.ROLEID");
if ((!"WSACCEPT".equalsIgnoreCase(roleId)) && (!"WSEVACUATE".equalsIgnoreCase(roleId))) {
throw new MXApplicationException("worksheet", "CPNotAssigned");
}
if ((assignCode == null) || (!assignCode.equalsIgnoreCase(wsRemote.getUserInfo().getPersonId()))) {
throw new MXApplicationException("worksheet", "userNotAssignedCP");
}
SAVE();
String replCP = wsRemote.getString("REPLCP");
String SAP1 = wsRemote.getString("REPLCP_SAP1");
String SAP2 = wsRemote.getString("REPLCP_SAP2");
if ((replCP == null) || ("".equals(replCP))) {
throw new MXApplicationException("worksheet", "replaceCPEmpty");
}
if ((SAP1 == null) || ("".equals(SAP1))) {
throw new MXApplicationException("worksheet", "replaceSAP1Empty");
}
if ((SAP2 == null) || ("".equals(SAP2))) {
throw new MXApplicationException("worksheet", "replaceSAP2Empty");
}
if (SAP1.equals(SAP2)) {
throw new MXApplicationException("worksheet", "replaceSAP1equalsSAP2");
}
if ("ISSUE".equalsIgnoreCase(wsRemote.getString("STATUS")))
{
if (replCP.equals(wsRemote.getString("ACCEPTEDBY"))) {
throw new MXApplicationException("worksheet", "replaceCPEqualsAcceptedBy");
}
}
else if (("ACCEPT".equalsIgnoreCase(wsRemote.getString("STATUS"))) &&
(replCP.equals(wsRemote.getString("EVACUATEDBY")))) {
throw new MXApplicationException("worksheet", "replaceCPEqualsEvacuatedBy");
}
WFAssignmentSetRemote wfasRemote = (WFAssignmentSetRemote)wsRemote.getMboSet("WFASSIGNMENT");
if (!wfasRemote.isEmpty())
{
String CPName = "";
if ("WSACCEPT".equalsIgnoreCase(roleId)) {
CPName = wsRemote.getString("ACCEPTEDBY_PERSON.DISPLAYNAME");
} else if ("WSEVACUATE".equalsIgnoreCase(roleId)) {
CPName = wsRemote.getString("EVACUATEDBY_PERSON.DISPLAYNAME");
}
String[] params = { assignCode, CPName, wsRemote.getString("REPLCP"), wsRemote.getString("REPLCP_PERSON.DISPLAYNAME") };
this.clientSession.showMessageBox(this.clientSession.getCurrentEvent(), "worksheet", "replaceCPmessage", params);
WorkFlowServiceRemote wfsr = (WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW");
wfsr.completeAssignment((WFAssignmentRemote)wfasRemote.getMbo(0), "替换干练人员", true);
SAVE();
}
return 1;
}
public int ROUTEWF()
throws MXException, RemoteException
{
CLPWorksheetRemote wsRemote = (CLPWorksheetRemote)getMbo();
if (("P".equalsIgnoreCase(getString("WSTYPE"))) || ("L".equalsIgnoreCase(getString("WSTYPE"))))
{
String assignCode = wsRemote.getString("WFASSIGNMENT.ASSIGNCODE");
String roleId = wsRemote.getString("WFASSIGNMENT.ROLEID");
SAVE();
String replCP = wsRemote.getString("REPLCP");
String SAP1 = wsRemote.getString("REPLCP_SAP1");
String SAP2 = wsRemote.getString("REPLCP_SAP2");
if ((("WSACCEPT".equalsIgnoreCase(roleId)) || ("WSEVACUATE".equalsIgnoreCase(roleId))) && (assignCode != null) &&
(assignCode.equalsIgnoreCase(wsRemote.getUserInfo().getPersonId())) && (((replCP != null) &&
(!"".equals(replCP))) || ((SAP1 != null) && (!"".equals(SAP1))) || ((SAP2 != null) &&
(!"".equals(SAP2))))) {
throw new MXApplicationException("worksheet", "replaceCPFieldsNotEmpty");
}
}
return super.ROUTEWF();
}
public void sendWFJK() {
try {
MboRemote mbo = getMbo();
String wsnum=mbo.getString("WSNUM");
String workdesc=mbo.getString("WORKDESC");
this.app.openURL("http://172.17.6.230:9080/maximo/service/MaximoAppService?&method=sendWorkSheetUrl&wsnum="+wsnum+"&workdesc="+workdesc+"", false);
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
package com.tohi.common.dto;
public class MaxDocInfo {
public String ownertable;//所属对象
public String ownerid;//所属对象ID
public String document;//文档标识
public String description;//文档描述
public String urlname;//文档链接
public String createby;//创建人
public String createdate;//创建时间
/**
* @return the ownertable
*/
public String getOwnertable() {
return ownertable;
}
/**
* @param ownertable the ownertable to set
*/
public void setOwnertable(String ownertable) {
this.ownertable = ownertable;
}
/**
* @return the ownerid
*/
public String getOwnerid() {
return ownerid;
}
/**
* @param ownerid the ownerid to set
*/
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
/**
* @return the document
*/
public String getDocument() {
return document;
}
/**
* @param document the document to set
*/
public void setDocument(String document) {
this.document = document;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the urlname
*/
public String getUrlname() {
return urlname;
}
/**
* @param urlname the urlname to set
*/
public void setUrlname(String urlname) {
this.urlname = urlname;
}
/**
* @return the createby
*/
public String getCreateby() {
return createby;
}
/**
* @param createby the createby to set
*/
public void setCreateby(String createby) {
this.createby = createby;
}
/**
* @return the createdate
*/
public String getCreatedate() {
return createdate;
}
/**
* @param createdate the createdate to set
*/
public void setCreatedate(String createdate) {
this.createdate = createdate;
}
}
package com.tohi.common.dto;
public class MaxUser {
public String US_USERID;//USERID
public String US_PERSONID;//PERSONID
public String US_DEPT;//部门编码
public String US_DEPTNAME;//部门名称
public String US_CODE;//用户登录ID
public String US_NAME;//用户名称
public String US_ALIAS;//用户别名
public String US_COMPANY_ID;//所属公司
public String US_COMPANY_NAME;//所属公司名称
public String US_PHONE_NUMBER;//联系电话
public String US_PWD;//密码
/**
* @return the uS_USERID
*/
public String getUS_USERID() {
return US_USERID;
}
/**
* @param uS_USERID the uS_USERID to set
*/
public void setUS_USERID(String uS_USERID) {
US_USERID = uS_USERID;
}
/**
* @return the uS_PERSONID
*/
public String getUS_PERSONID() {
return US_PERSONID;
}
/**
* @param uS_PERSONID the uS_PERSONID to set
*/
public void setUS_PERSONID(String uS_PERSONID) {
US_PERSONID = uS_PERSONID;
}
/**
* @return the uS_CODE
*/
public String getUS_CODE() {
return US_CODE;
}
/**
* @param uS_CODE the uS_CODE to set
*/
public void setUS_CODE(String uS_CODE) {
US_CODE = uS_CODE;
}
/**
* @return the uS_NAME
*/
public String getUS_NAME() {
return US_NAME;
}
/**
* @param uS_NAME the uS_NAME to set
*/
public void setUS_NAME(String uS_NAME) {
US_NAME = uS_NAME;
}
/**
* @return the uS_ALIAS
*/
public String getUS_ALIAS() {
return US_ALIAS;
}
/**
* @param uS_ALIAS the uS_ALIAS to set
*/
public void setUS_ALIAS(String uS_ALIAS) {
US_ALIAS = uS_ALIAS;
}
/**
* @return the uS_COMPANY_ID
*/
public String getUS_COMPANY_ID() {
return US_COMPANY_ID;
}
/**
* @param uS_COMPANY_ID the uS_COMPANY_ID to set
*/
public void setUS_COMPANY_ID(String uS_COMPANY_ID) {
US_COMPANY_ID = uS_COMPANY_ID;
}
/**
* @return the uS_COMPANY_NAME
*/
public String getUS_COMPANY_NAME() {
return US_COMPANY_NAME;
}
/**
* @param uS_COMPANY_NAME the uS_COMPANY_NAME to set
*/
public void setUS_COMPANY_NAME(String uS_COMPANY_NAME) {
US_COMPANY_NAME = uS_COMPANY_NAME;
}
/**
* @return the uS_PHONE_NUMBER
*/
public String getUS_PHONE_NUMBER() {
return US_PHONE_NUMBER;
}
/**
* @param uS_PHONE_NUMBER the uS_PHONE_NUMBER to set
*/
public void setUS_PHONE_NUMBER(String uS_PHONE_NUMBER) {
US_PHONE_NUMBER = uS_PHONE_NUMBER;
}
/**
* @return the uS_PWD
*/
public String getUS_PWD() {
return US_PWD;
}
/**
* @param uS_PWD the uS_PWD to set
*/
public void setUS_PWD(String uS_PWD) {
US_PWD = uS_PWD;
}
/**
* @return the uS_DEPT
*/
public String getUS_DEPT() {
return US_DEPT;
}
/**
* @param uS_DEPT the uS_DEPT to set
*/
public void setUS_DEPT(String uS_DEPT) {
US_DEPT = uS_DEPT;
}
/**
* @return the uS_DEPTNAME
*/
public String getUS_DEPTNAME() {
return US_DEPTNAME;
}
/**
* @param uS_DEPTNAME the uS_DEPTNAME to set
*/
public void setUS_DEPTNAME(String uS_DEPTNAME) {
US_DEPTNAME = uS_DEPTNAME;
}
}
package com.tohi.common.dto;
public class MaxWFAction {
public String ownertable;//表名--隐藏
public String ownerid;//数据ID--隐藏
public String actionid;//工作流操作ID--隐藏
public String instruction;//工作流操作描述
public String sfxzz;//是否选择值--隐藏
public String ispositve;//正反向操作
public String getSfxzz() {
return sfxzz;
}
public void setSfxzz(String sfxzz) {
this.sfxzz = sfxzz;
}
public String getOwnertable() {
return ownertable;
}
public void setOwnertable(String ownertable) {
this.ownertable = ownertable;
}
public String getOwnerid() {
return ownerid;
}
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
public String getActionid() {
return actionid;
}
public void setActionid(String actionid) {
this.actionid = actionid;
}
public String getInstruction() {
return instruction;
}
public void setInstruction(String instruction) {
this.instruction = instruction;
}
public String getIspositve() {
return ispositve;
}
public void setIspositve(String ispositve) {
this.ispositve = ispositve;
}
}
package com.tohi.common.dto;
public class MaxWFAssignment {
public String ownertable;//主对象
public String ownerid;//主对象ID
public String app;//应用名
public String description;//工作流操作描述
public String startdate;//流程到达时间
public String status;
/**
* @return the ownertable
*/
public String getOwnertable() {
return ownertable;
}
/**
* @param ownertable the ownertable to set
*/
public void setOwnertable(String ownertable) {
this.ownertable = ownertable;
}
/**
* @return the ownerid
*/
public String getOwnerid() {
return ownerid;
}
/**
* @param ownerid the ownerid to set
*/
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
/**
* @return the app
*/
public String getApp() {
return app;
}
/**
* @param app the app to set
*/
public void setApp(String app) {
this.app = app;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the startdate
*/
public String getStartdate() {
return startdate;
}
/**
* @return the status
*/
public String getStatus() {
return status;
}
/**
* @param status the status to set
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @param startdate the startdate to set
*/
public void setStartdate(String startdate) {
this.startdate = startdate;
}
}
package com.tohi.common.dto;
public class MaxWFTrans {
public String ownertable;
public String ownerid;
public String nodedesc;
public String transby;
public String transdate;
public String memo;
/**
* @return the ownertable
*/
public String getOwnertable() {
return ownertable;
}
/**
* @param ownertable the ownertable to set
*/
public void setOwnertable(String ownertable) {
this.ownertable = ownertable;
}
/**
* @return the ownerid
*/
public String getOwnerid() {
return ownerid;
}
/**
* @param ownerid the ownerid to set
*/
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
/**
* @return the nodedesc
*/
public String getNodedesc() {
return nodedesc;
}
/**
* @param nodedesc the nodedesc to set
*/
public void setNodedesc(String nodedesc) {
this.nodedesc = nodedesc;
}
/**
* @return the transby
*/
public String getTransby() {
return transby;
}
/**
* @param transby the transby to set
*/
public void setTransby(String transby) {
this.transby = transby;
}
/**
* @return the transdate
*/
public String getTransdate() {
return transdate;
}
/**
* @param transdate the transdate to set
*/
public void setTransdate(String transdate) {
this.transdate = transdate;
}
/**
* @return the memo
*/
public String getMemo() {
return memo;
}
/**
* @param memo the memo to set
*/
public void setMemo(String memo) {
this.memo = memo;
}
}
package com.tohi.common.dto;
public class MboInfo {
public String ownertable;//表名--隐藏
public String ownerid;//数据ID--隐藏
public String app;//数据ID--隐藏
/**
* @return the ownertable
*/
public String getOwnertable() {
return ownertable;
}
/**
* @param ownertable the ownertable to set
*/
public void setOwnertable(String ownertable) {
this.ownertable = ownertable;
}
/**
* @return the ownerid
*/
public String getOwnerid() {
return ownerid;
}
/**
* @param ownerid the ownerid to set
*/
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
/**
* @return the app
*/
public String getApp() {
return app;
}
/**
* @param app the app to set
*/
public void setApp(String app) {
this.app = app;
}
}
package com.tohi.common.dto;
import java.util.List;
public class MboPage {
public int rsStart ;//起始行
public int rsCount;//每页显示行数
public int rsTotal;//返回总数
public List list;
/**
* @return the rsStart
*/
public int getRsStart() {
return rsStart;
}
/**
* @param rsStart the rsStart to set
*/
public void setRsStart(int rsStart) {
this.rsStart = rsStart;
}
/**
* @return the rsCount
*/
public int getRsCount() {
return rsCount;
}
/**
* @param rsCount the rsCount to set
*/
public void setRsCount(int rsCount) {
this.rsCount = rsCount;
}
/**
* @return the rsTotal
*/
public int getRsTotal() {
return rsTotal;
}
/**
* @param rsTotal the rsTotal to set
*/
public void setRsTotal(int rsTotal) {
this.rsTotal = rsTotal;
}
/**
* @return the list
*/
public List<MaxDocInfo> getList() {
return list;
}
/**
* @param list the list to set
*/
public void setList(List list) {
this.list = list;
}
}
package com.tohi.common.dto;
import java.util.List;
import java.util.ArrayList;
public class Result {
private String code;
private String msg;
private List<User> data =new ArrayList<User>();
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List<User> getData() {
return data;
}
public void setData(List<User> data) {
this.data = data;
}
}
package com.tohi.common.dto;
public class User {
private String US_CODE;//人员工号
private String US_NAME;//人员姓名
private String ACCOUNT_ALIAS;//登录别名(域名)
private String ACCOUNT_PWD;//登录密码
private String US_DEPARTID;//部门ID
private String US_DE_NM;//部门名称
private String US_TM_ID;//班组ID
private String US_TM_NM;//班组名称
private String STATUS;//人员状态
private String CHANGEDATE;//更新时间
public String getUS_CODE() {
return US_CODE;
}
public void setUS_CODE(String uS_CODE) {
US_CODE = uS_CODE;
}
public String getUS_NAME() {
return US_NAME;
}
public void setUS_NAME(String uS_NAME) {
US_NAME = uS_NAME;
}
public String getACCOUNT_ALIAS() {
return ACCOUNT_ALIAS;
}
public void setACCOUNT_ALIAS(String aCCOUNT_ALIAS) {
ACCOUNT_ALIAS = aCCOUNT_ALIAS;
}
public String getACCOUNT_PWD() {
return ACCOUNT_PWD;
}
public void setACCOUNT_PWD(String aCCOUNT_PWD) {
ACCOUNT_PWD = aCCOUNT_PWD;
}
public String getUS_DEPARTID() {
return US_DEPARTID;
}
public void setUS_DEPARTID(String uS_DEPARTID) {
US_DEPARTID = uS_DEPARTID;
}
public String getUS_DE_NM() {
return US_DE_NM;
}
public void setUS_DE_NM(String uS_DE_NM) {
US_DE_NM = uS_DE_NM;
}
public String getUS_TM_ID() {
return US_TM_ID;
}
public void setUS_TM_ID(String uS_TM_ID) {
US_TM_ID = uS_TM_ID;
}
public String getUS_TM_NM() {
return US_TM_NM;
}
public void setUS_TM_NM(String uS_TM_NM) {
US_TM_NM = uS_TM_NM;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String sTATUS) {
STATUS = sTATUS;
}
public String getCHANGEDATE() {
return CHANGEDATE;
}
public void setCHANGEDATE(String cHANGEDATE) {
CHANGEDATE = cHANGEDATE;
}
}
package com.tohi.common.dto;
public class Worksheet {
private Long worksheetId;
private String WSNUM;
private String WORKDESC;
public Long getWorksheetId() {
return worksheetId;
}
public void setWorksheetId(Long worksheetId) {
this.worksheetId = worksheetId;
}
public String getWSNUM() {
return WSNUM;
}
public void setWSNUM(String wSNUM) {
WSNUM = wSNUM;
}
public String getWORKDESC() {
return WORKDESC;
}
public void setWORKDESC(String wORKDESC) {
WORKDESC = wORKDESC;
}
}
package com.tohi.common.dto.person;
public class Person {
private String PERSONID;
private String DISPLAYNAME;
public String getPERSONID() {
return PERSONID;
}
public void setPERSONID(String pERSONID) {
PERSONID = pERSONID;
}
public String getDISPLAYNAME() {
return DISPLAYNAME;
}
public void setDISPLAYNAME(String dISPLAYNAME) {
DISPLAYNAME = dISPLAYNAME;
}
}
package com.tohi.common.util;
import java.text.SimpleDateFormat;
import net.sf.json.JSONArray;
import java.util.Date;
import net.sf.json.JSONObject;
public class JSONUtil
{
public static String MAXIMO_MSG = "MAXIMO_MSG";
public static int PAGESIZE = 10;
public static final String JAVA_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String JAVA_DATE_YMD = "yyyy-MM-dd";
public static String msg(String msg)
{
JSONArray jsonArray = new JSONArray();
JSONObject jsonObj = new JSONObject();
jsonObj.put(MAXIMO_MSG, msg);
jsonArray.add(jsonObj);
return jsonArray.toString();
}
public static String SimpleStringToJson(String msg)
{
return JSONArray.fromObject("["+msg+"]").toString();
}
public static boolean isNull(String str)
{
if (str == null) {
return true;
}
if (str.trim().length() <= 0) {
return true;
}
return false;
}
static public String toDateString(Date date){
String ret = null;
if(date != null){
try{
SimpleDateFormat dateFormat = new SimpleDateFormat(JAVA_DATE_FORMAT);
ret = dateFormat.format(date);
}catch(Exception e){
return null;
}
}
return ret;
}
static public Date StringtoDate(String date){
Date ret = null;
try{
SimpleDateFormat dateFormat = new SimpleDateFormat(JAVA_DATE_YMD);
ret = dateFormat.parse(date);
}catch(Exception e){
return null;
}
return ret;
}
}
This diff is collapsed.
......@@ -13,7 +13,7 @@ import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.beans.DataBean;
/**
* 运行管理BEAN类
* 运行管理BEAN类
*
*/
public class CustRLShiftsAppBean extends AppBean{
......@@ -24,13 +24,13 @@ public class CustRLShiftsAppBean extends AppBean{
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd");
String num=sdf.format(new Date());
String MARKSIGN=getString("MARKSIGN");
num=num+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("日志", "当天已经产生运行交接班记录,无法再次产生!!!");
throw new MXApplicationException("日志", "当天已经产生运行交接班记录,无法再次产生!!!");
}
super.insert();
}
......@@ -46,22 +46,22 @@ public class CustRLShiftsAppBean extends AppBean{
@Override
public synchronized void save() throws MXException {
super.save();
System.out.println("保存方法APPBEAN");
System.out.println("保存方法APPBEAN");
}
/**
* 先接班再交班
* 先接班再交班
* @throws RemoteException
* @throws MXException
*/
public void jiaoban() throws RemoteException, MXException {
System.out.println("交班");
System.out.println("交班");
MboRemote mbo=this.getMbo();
if (!mbo.getString("FINISHSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前已交班,不允许重复执行此操作!");
throw new MXApplicationException("提示:", "当前已交班,不允许重复执行此操作!");
}
// if ( mbo.getString("NEXTSHIFTER").equalsIgnoreCase("")) {
// throw new MXApplicationException("提示:", "当前未接班,不允许执行此操作!");
// throw new MXApplicationException("提示:", "当前未接班,不允许执行此操作!");
// }
mbo.setValue("FINISHSHIFTER",mbo.getUserName(),11L);
mbo.setValue("FINISHSHIFTTIME",MXServer.getMXServer().getDate(),11L);
......@@ -69,21 +69,21 @@ public class CustRLShiftsAppBean extends AppBean{
this.app.getAppBean().save();
}
/**
* 先接班再交班
* 先接班再交班
* @throws RemoteException
* @throws MXException
*/
public void jieban() throws RemoteException, MXException {
System.out.println("接班");
System.out.println("接班");
MboRemote mbo=this.getMbo();
if ( !mbo.getString("NEXTSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前已接班,不允许重复执行此操作!");
throw new MXApplicationException("提示:", "当前已接班,不允许重复执行此操作!");
}
if ( mbo.getString("FINISHSHIFTER").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前未交班,不允许执行此操作!");
throw new MXApplicationException("提示:", "当前未交班,不允许执行此操作!");
}
if (getString("SHIFTER").equalsIgnoreCase(mbo.getUserName()) ) { //如果当前的操作人是当班运行工程师
throw new MXApplicationException("提示:", "当班运行控制工程师不允许操作接班!");
if (getString("SHIFTER").equalsIgnoreCase(mbo.getUserName()) ) { //如果当前的操作人是当班运行工程师
throw new MXApplicationException("提示:", "当班运行控制工程师不允许操作接班!");
}
......@@ -92,11 +92,11 @@ public class CustRLShiftsAppBean extends AppBean{
mbo.setValue("ISSHIFTED","Y",11L);
MboSetRemote RLSHIFTSMboSet=MXServer.getMXServer().getMboSet("RLSHIFTS", mbo.getUserInfo());
MboRemote newMbo=RLSHIFTSMboSet.add(11L); //创建接班记录
if (mbo.getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班
MboRemote newMbo=RLSHIFTSMboSet.add(11L); //创建接班记录
if (mbo.getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班
newMbo.setValue("MARKSIGN", "M",11L);
}
if (mbo.getString("MARKSIGN").equalsIgnoreCase("M")) { //如果是白班
if (mbo.getString("MARKSIGN").equalsIgnoreCase("M")) { //如果是白班
newMbo.setValue("MARKSIGN", "N",11L);
}
newMbo.setFieldFlag("RLDUTYNUM", 7L, false);
......
......@@ -12,22 +12,18 @@ import psdi.webclient.system.beans.AppBean;
public class CustSafetyadviceAppBean extends AppBean{
/**
* 创建工单
* @throws MXException
* @throws RemoteException
*/
public void CREATEWO() throws RemoteException, MXException{
MboRemote mbo=this.getMbo();
if (!mbo.getString("WONUM").equalsIgnoreCase("")) {
throw new MXApplicationException("提示:", "当前单据已经生成了工单,工单号为["+mbo.getString("WONUM")+"]!");
throw new MXApplicationException("提示:", "当前单据已经生成了工单,工单号为[" + mbo.getString("WONUM") + "]!");
}
MboSetRemote WORKORDERMboSet=MXServer.getMXServer().getMboSet("WORKORDER", mbo.getUserInfo());
MboRemote newWoMbo=WORKORDERMboSet.add(11L); //创建接班记录
MboRemote newWoMbo=WORKORDERMboSet.add(11L); //�����Ӱ��¼
newWoMbo.setValue("DESCRIPTION", mbo.getString("DESCRIPTION"),11L);
newWoMbo.setValue("CUSTDEPT", mbo.getString("DEPARTMENT"),11L); //部门
newWoMbo.setValue("CUSTFZR", mbo.getString("PERSONLIABLE"),11L);//责任人
newWoMbo.setValue("WORKTYPE","SHE",11L);//工单类型
newWoMbo.setValue("CUSTDEPT", mbo.getString("DEPARTMENT"),11L); //����
newWoMbo.setValue("CUSTFZR", mbo.getString("PERSONLIABLE"),11L);//������
newWoMbo.setValue("WORKTYPE","SHE",11L);//��������
mbo.setValue("WONUM", newWoMbo.getString("WONUM"));
WORKORDERMboSet.save();
WORKORDERMboSet.close();
......
......@@ -33,7 +33,7 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{
}
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++) {//遍历所有选择的值
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);
......@@ -55,8 +55,8 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{
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);//已整改
tempMbo.setValue("WONUM", wonum,11L);//回写工单号
tempMbo.setValue("TREATMENTMETHOD", "1",11L);//已整改
PJOBEHAVIORSet.save();
PJOBEHAVIORSet.close();
}
......
package com.tohi.webclient.beans.plateclose;
import java.rmi.RemoteException;
import java.util.Vector;
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 RlrelaymanagecAppBean extends AppBean {
/**
* 保护装置闭环管理
* @param mbo
* @throws MXException
* @throws RemoteException
*/
public int CLOSEINFO() throws MXException, RemoteException {
System.out.println("进入");
if ( this.app.getResultsBean().getSelection().size() <=0) {
throw new MXApplicationException("保护装置闭环管理", "请选择至少一条或多条记录!!!");
}
Vector<MboRemote> ver= this.app.getResultsBean().getSelection();
for (MboRemote m:ver) {
if (m.getString("NEEDCLOSE").equals("Y") ) {
throw new MXApplicationException("保护装置闭环管理", "已闭环的记录请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
for (MboRemote m:ver) {
m.setValue("NEEDCLOSE", "Y");
}
this.app.getResultsBean().save();
return 1;
}
}
......@@ -10,18 +10,18 @@ import psdi.webclient.beans.po.POAppBean;
public class CustPoAppBean extends POAppBean{
/**
// * 确认弹窗,在appbean内调用,不能在mbo内调用
// * 确认弹窗,在appbean内调用,不能在mbo内调用
// * @author juong
// * @throws MXException
// * @throws RemoteException
// * @return 当用户选择"是"时返回true;当用户选择"否"时返回false,
// * @return 当用户选择"是"时返回true;当用户选择"否"时返回false,
// */
public boolean confirm () throws RemoteException, MXException{
int userInput = MXApplicationYesNoCancelException.getUserInput("id",MXServer.getMXServer(), this.getMbo().getUserInfo());
System.out.println(userInput);
switch (userInput) {
case MXApplicationYesNoCancelException.NULL:{
Object params[] = {"确认要执行此操作吗?"};
Object params[] = {"确认要执行此操作吗?"};
throw new MXApplicationYesNoCancelException("id", "po", "showtotalcost", params);
}
case 2:{
......@@ -30,16 +30,17 @@ public class CustPoAppBean extends POAppBean{
}
return false;
}
@Override
public int SAVE() throws MXException, RemoteException {
System.out.println("保存");
public int ROUTEWF() throws MXException, RemoteException {
System.out.println("发起流程");
if (!this.getMbo().getMboSet("POline").isEmpty()) {
double d=this.getMbo().getDouble("PRLINE.PR.TOTALCOST");
double d1=this.getMbo().getDouble("TOTALCOST");
if (d==d1) { confirm (); }
}
return super.SAVE();
return super.ROUTEWF();
}
......
package com.tohi.webclient.beans.po;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
import psdi.webclient.system.beans.MultiselectDataBean;
public class CustpoitemtransDataBean extends MultiselectDataBean{
@Override
protected void initialize() throws MXException, RemoteException {
super.initialize();
}
@Override
public int addrow() throws MXException {
return super.addrow();
}
public synchronized int genGdAsset(MboSetRemote mboSet) throws MXException, RemoteException {
MboSetRemote ASSETSet= MXServer.getMXServer().getMboSet("ASSET", MXServer.getMXServer().getSystemUserInfo());
for (int i = 0; i < mboSet.count(); i++) {
MboRemote mbo=mboSet.getMbo(i);
if (mbo.isSelected()) {
//生产对应的资产台账信息
MboRemote assetMbo= ASSETSet.addAtEnd(11L);
assetMbo.setValue("ASSETNUM", getAssetNum() ,11L);
assetMbo.setValue("DESCRIPTION", mbo.getString("DESCRIPTION") ,11L);
assetMbo.setValue("STATUS", "SPARE",11L);
assetMbo.setValue("itemnum1", mbo.getString("itemnum") ,2L);
ASSETSet.save();
}
}
ASSETSet.close();
return super.execute();
}
public String getAssetNum()
{
String assetnum="";
Integer num=0;
String resultNum="";
try {
Connection conn=MXServer.getMXServer().getDBManager().getSequenceConnection();
PreparedStatement pstm = conn.prepareStatement(" select assetnum from ASSET where assetnum like '%GD%' order by assetnum desc ");
ResultSet rs= pstm.executeQuery();
if(rs.next()) {
assetnum = rs.getString("assetnum");
if (!"".equalsIgnoreCase(assetnum)) {
String numStr= assetnum.substring(2);
num=Integer.valueOf(numStr);
num++;
resultNum="GD"+num;
}else {
resultNum="GD100000";
}
}else {
resultNum="GD100000";
}
} catch (RemoteException e) {
} catch (SQLException e) {
e.printStackTrace();
}
return resultNum;
}
}
......@@ -23,7 +23,7 @@ public class CustRllogAppBean extends AppBean{
mboSet.setWhere("RUNDATE = '"+dateNow+"'");
if (mboSet.count()!=0) {
throw new MXApplicationException("日志", "当天已经产生运行日志,无法再次产生!!!");
throw new MXApplicationException("日志", "当天已经产生运行日志,无法再次产生!!!");
}
super.insert();
}
......
......@@ -5,11 +5,7 @@ import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
/**
* 字段绑定类,更改值进行累计
*
*/
public class FldTotalValue extends MboValueAdapter {
......
......@@ -60,26 +60,19 @@ public class UploadExcelBean extends DataBean {
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);
int maxrow = sheet.getRows();
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();
......@@ -87,10 +80,8 @@ public class UploadExcelBean extends DataBean {
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());
......@@ -127,13 +118,12 @@ public class UploadExcelBean extends DataBean {
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);
Utility.showMessageBox(event, "负荷登记导入错误", e.getMessage() + " 行--" + this.row, null);
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
......
......@@ -12,20 +12,20 @@ import psdi.webclient.system.beans.AppBean;
public class RtinspnrecorAppBean extends AppBean {
/**
* 异常巡检处理
* 异常巡检处理
* @param mbo
* @throws MXException
* @throws RemoteException
*/
public int CREATESR() throws MXException, RemoteException {
System.out.println("进入");
System.out.println("进入");
if ( this.app.getResultsBean().getSelection().size() <=0) {
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
}
Vector<MboRemote> ver= this.app.getResultsBean().getSelection();
for (MboRemote m:ver) {
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
......@@ -33,9 +33,9 @@ public class RtinspnrecorAppBean extends AppBean {
for (MboRemote m:ver) {
System.out.println(m.getString("TICKETID"));
MboRemote RECORDmbo=mboSet.add(11L);
RECORDmbo.setValue("DESCRIPTION", m.getString("METER.DESCRIPTION")+"---"+m.getString("POINTNUM"),11L);//旧班组
RECORDmbo.setValue("DESCRIPTION", m.getString("METER.DESCRIPTION")+"---"+m.getString("POINTNUM"),11L);//旧班组
m.setValue("ticketid", RECORDmbo.getString("TICKETID"),11L);
m.setValue("PROCESSRESULT","已处理" ,11L);
m.setValue("PROCESSRESULT","已处理" ,11L);
mboSet.save();
}
mboSet.close();
......@@ -45,40 +45,40 @@ public class RtinspnrecorAppBean extends AppBean {
public int CHANGENAPPR() throws MXException, RemoteException {
System.out.println("进入");
System.out.println("进入");
if ( this.app.getResultsBean().getSelection().size() <=0) {
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
}
Vector<MboRemote> ver= this.app.getResultsBean().getSelection();
for (MboRemote m:ver) {
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
for (MboRemote m:ver) {
m.setValue("PROCESSRESULT","无需处理" ,11L);
m.setValue("PROCESSRESULT","无需处理" ,11L);
}
this.app.getResultsBean().save();
return 1;
}
public int CHANGEAPPR() throws MXException, RemoteException {
System.out.println("进入");
System.out.println("进入");
if ( this.app.getResultsBean().getSelection().size() <=0) {
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
throw new MXApplicationException("异常巡检处理", "请选择至少一条或多条记录!!!");
}
Vector<MboRemote> ver= this.app.getResultsBean().getSelection();
for (MboRemote m:ver) {
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
if (m.getString("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
for (MboRemote m:ver) {
m.setValue("PROCESSRESULT","已处理" ,11L);
m.setValue("PROCESSRESULT","已处理" ,11L);
}
this.app.getResultsBean().save();
return 1;
......
package com.tohi.webclient.beans.trainmanage;
import java.rmi.RemoteException;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
public class CustTramanageAppBean extends AppBean {
public CustTramanageAppBean() {
super();
}
@Override
protected void initialize() throws MXException, RemoteException {
this.app.openURL("http://172.17.6.230:8004/Login.aspx?UserID=MAXADMIN&PWD=5A2C77169336887648A197DCCF798A4C", false);
super.initialize();
}
@Override
public void initializeApp() throws MXException, RemoteException {
this.app.openURL("http://172.17.6.230:8004/Login.aspx?UserID=MAXADMIN&PWD=5A2C77169336887648A197DCCF798A4C", false);
super.initializeApp();
}
}
This diff is collapsed.
package com.tohi.webclient.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MaximoAppService
extends HttpServlet
{
protected final void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
handleRequest(request, response);
}
protected final void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
handleRequest(request, response);
}
private void handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
// response.setContentType("application/x-www-form-urlencoded;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
MaximoAPPHandler.handRequest(request, response);
}
}
This diff is collapsed.
This diff is collapsed.
package psdi.webclient.beans.assetcat;
import java.rmi.RemoteException;
import psdi.app.assetcatalog.ClassStructureSet;
import psdi.app.assetcatalog.ClassStructureSetRemote;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class SearchClassificationItemsBean
extends SearchClassificationBean
{
MboSetRemote newMboSet = null;
public MboSetRemote getResultSetForReturn()
throws MXException, RemoteException
{
if (this.newMboSet != null) {
return this.newMboSet;
}
MboRemote selectedClassStructure = getSelectedClassStructure();
MboSetRemote itemSet = selectedClassStructure.getMboSet("ITEM");
return itemSet;
}
public String getAttributeForReturn()
throws MXException, RemoteException
{
return "itemnum";
}
public String getResultObjectName()
throws MXException, RemoteException
{
return "ITEM";
}
public void setNewMboSet(MboSetRemote newSet)
throws MXException, RemoteException
{
this.newMboSet = newSet;
}
public void initialize()
throws MXException, RemoteException
{
super.initialize();
ClassStructureSetRemote classStructSet = (ClassStructureSetRemote)getMboSet();
String useWith = ((ClassStructureSet)classStructSet).getbjectNameForUseWith();
if ((useWith == null) || (useWith.equals(""))) {
classStructSet.setOriginatingObject("ITEM");
}
}
}
package tohi.app.assetrecordsline;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldAssetNum extends MAXTableDomain{
public FldAssetNum(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "ASSETNUM" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("ASSET", "ASSETNUM=:" + thisname);
}
@Override
public void action() throws MXException, RemoteException { //选择带出位置location
super.action();
MboRemote mbo=getMboValue().getMbo();
MboSetRemote ASSETSet=MXServer.getMXServer().getMboSet("ASSET",MXServer.getMXServer().getSystemUserInfo());
ASSETSet.setWhere(" ASSETNUM= '"+getMboValue().getString()+"'");
MboRemote assetMbo=ASSETSet.getMbo(0);
mbo.setValue("FROMLOC", assetMbo.getString("LOCATION"));
}
}
package tohi.app.assetrecordsline;
import java.rmi.RemoteException;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.server.MXServer;
import psdi.util.MXException;
public class FldLocation extends MAXTableDomain{
/**
* @param mbv
*/
public FldLocation(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "LOCATION" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("LOCATIONS", "LOCATION=:" + thisname);
}
@Override
public void action() throws MXException, RemoteException { //选择带出位置ASSETNUM
super.action();
MboRemote mbo=getMboValue().getMbo();
if (getMboValue().getAttributeName().equalsIgnoreCase("FROMLOC") ) {
MboSetRemote ASSETSet=MXServer.getMXServer().getMboSet("ASSET",MXServer.getMXServer().getSystemUserInfo());
ASSETSet.setWhere(" LOCATION= '"+getMboValue().getString()+"'");
MboRemote assetMbo=ASSETSet.getMbo(0);
mbo.setValue("ASSETNUM", assetMbo.getString("ASSETNUM"));
}
if (getMboValue().getAttributeName().equalsIgnoreCase("TOLOC") ) {
}
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
if (getMboValue().getAttributeName().equalsIgnoreCase("FROMLOC") ) {
setListCriteria(" location in (select location from asset )");
}
return super.getList();
}
}
package tohi.app.assetrecordsline;
import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboValue;
public class FldStorageRoom extends MAXTableDomain{
public FldStorageRoom(MboValue mbv) {
super(mbv);
String thisname = getMboValue().getAttributeName();
String[] hz = { "LOCATION" };
String[] target ={thisname};
setLookupKeyMapInOrder(target, hz);
setRelationship("locauth", "LOCATION=:" + thisname);
setListCriteria(" groupname ='CLPJB01'");
}
}
......@@ -18,10 +18,7 @@ import psdi.server.SimpleCronTask;
import psdi.util.MXException;
import tohi.app.cron.common.MboDataHander;
/**
* 定期任务安排生成定期任务
*
*/
public class RunCromTask extends SimpleCronTask {
public void cronAction() {
......@@ -32,11 +29,11 @@ public class RunCromTask extends SimpleCronTask {
}
}
static class CronPojo {
Long cronmanageid;//实例ID
Long ownerid;//实例ID
String tbname;//表名
Long periodid;//周期id
int isinitflow;//是否开启工作流
Long cronmanageid;
Long ownerid;
String tbname;
Long periodid;
int isinitflow;
public CronPojo(Long ownerid, String tbname, Long periodid,
int isinitflow,Long cronmanageid) {
super();
......@@ -48,15 +45,10 @@ public class RunCromTask extends SimpleCronTask {
}
}
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 "; //获取所有代办任务信息
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());
......@@ -65,25 +57,23 @@ public class RunCromTask extends SimpleCronTask {
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()) { //不等于空且为启用状态
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
WORKTASTSETSet.setWhere("WORKTASTSETID="+c.ownerid);
MboRemote mbo=WORKTASTSETSet.getMbo(0);
MboDataHander.hander(mbo,c.tbname,c.isinitflow,c.periodid,c.cronmanageid);
}
......
This diff is collapsed.
package tohi.app.crontask;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.apache.http.HttpConnection;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.server.SimpleCronTask;
import psdi.util.MXException;
public class AutoWorkSheetCronTask extends SimpleCronTask {
@Override
public void cronAction() {
try {
MboSetRemote set = MXServer.getMXServer().getMboSet("worksheet",MXServer.getMXServer().getSystemUserInfo());
set.setWhere(" wstype in ('S','P','L','R') and issyn=0 ");
for (int i = 0; i < set.count(); i++) {
MboRemote mbo=set.getMbo(i);
String wsnum=mbo.getString("WSNUM");
String workdesc=mbo.getString("WORKDESC");
URL url = new URL("http://172.17.7.240/maximo/service/MaximoAppService?method=sendWorkSheetUrl&wsnum="+wsnum+"&workdesc="+workdesc+"");
URLConnection rulConnection = url.openConnection();// 此处的urlConnection对象实际上是根据URL的
// 请求协议(此处是http)生成的URLConnection类
// 的子类HttpURLConnection,故此处最好将其转化
// 为HttpURLConnection类型的对象,以便用到
// HttpURLConnection更多的API.如下:
HttpURLConnection httpUrlConnection = (HttpURLConnection) rulConnection;
// 设定请求的方法为"POST",默认是GET
httpUrlConnection.setRequestMethod("get");
// 设置是否向httpUrlConnection输出,因为这个是post请求,参数要放在
// http正文内,因此需要设为true, 默认情况下是false;
httpUrlConnection.setDoOutput(true);
// 设置是否从httpUrlConnection读入,默认情况下是true;
httpUrlConnection.setDoInput(true);
// Post 请求不能使用缓存
httpUrlConnection.setUseCaches(false);
// 设定传送的内容类型是可序列化的java对象
// (如果不设此项,在传送序列化对象时,当WEB服务默认的不是这种类型时可能抛java.io.EOFException)
httpUrlConnection.setRequestProperty("Content-type", "application/x-java-serialized-object");
// 连接,从上述url.openConnection()至此的配置必须要在connect之前完成,
httpUrlConnection.connect();
mbo.setValue("issyn",1,11L);
}
set.save();
set.close();
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
package tohi.app.crontask;
package tohi.app.crontask;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.lang.StringUtils;
/**
* MD5加密算法工具类
* @author bbo
*
*/
public class MD5Utils {
/*
* 为了提高安全性,我们又额外加了一串随机字符串
*/
// private static final String USER_PWD_ENCP_PREFIX = "LDHDSFHWRERHESLM";
/**
* 用户密码加密
* @param beforeEncp
* @return
*/
public static String encode(final String beforeEncp){
if(StringUtils.isBlank(beforeEncp)){
return beforeEncp;
}
return encryptMD5(beforeEncp);
}
/**
* md5加密
* @param strInput
* @return
*/
private static String encryptMD5(final String strInput) {
StringBuffer buf = null;
try {
// 拿到一个MD5转换器(如果想要SHA1参数换成”SHA1”)
MessageDigest md = MessageDigest.getInstance("MD5");
// 输入的字符串转换成字节数组
md.update(strInput.getBytes());
// 转换并返回结果,也是字节数组,包含16个元素
byte b[] = md.digest();
// new一个StringBuffer,这个就是用来组成结果字符串的(解释一下:一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方))
buf = new StringBuffer(b.length * 2);
//遍历
for (int i = 0; i < b.length; i++) {
if (((int) b[i] & 0xff) < 0x10) { //(int) b[i] & 0xff 转换成无符号整型
buf.append("0");
}
//Long.toHexString( 无符号长整数的十六进制字符串表示
buf.append(Long.toHexString((int) b[i] & 0xff));
}
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
}
return buf==null?null:buf.toString(); //返回加密后 的结果
}
}
\ No newline at end of file
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.lang.StringUtils;
public class MD5Utils
{
public static String encode(String beforeEncp)
{
if (StringUtils.isBlank(beforeEncp)) {
return beforeEncp;
}
return encryptMD5(beforeEncp);
}
private static String encryptMD5(String strInput)
{
StringBuffer buf = null;
try
{
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(strInput.getBytes());
byte[] b = md.digest();
buf = new StringBuffer(b.length * 2);
for (int i = 0; i < b.length; i++) {
if ((b[i] & 0xFF) < 16) {
buf.append("0");
}
buf.append(Long.toHexString(b[i] & 0xFF));
}
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
}
return buf == null ? null : buf.toString();
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -17,9 +17,9 @@ public class RunSumIssueCount extends SimpleCronTask {
@Override
public void cronAction() {
Calendar nowDate=Calendar.getInstance();
Calendar oldDate=Calendar.getInstance(); //前一年
Calendar old1Date=Calendar.getInstance();//前两年
Calendar old2Date=Calendar.getInstance();//前三年
Calendar oldDate=Calendar.getInstance(); //前一年
Calendar old1Date=Calendar.getInstance();//前两年
Calendar old2Date=Calendar.getInstance();//前三年
oldDate.add(Calendar.YEAR, -1);
old1Date.add(Calendar.YEAR, -2);
old2Date.add(Calendar.YEAR, -3);
......@@ -28,39 +28,39 @@ public class RunSumIssueCount extends SimpleCronTask {
String s1=sdf.format(oldDate.getTime());
String s2= sdf.format(old1Date.getTime());
String s3= sdf.format(old2Date.getTime());
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
PreparedStatement pre1 = null;
try {
con = MXServer.getMXServer().getDBManager().getSequenceConnection();
System.out.println("连接成功!");
System.out.println("连接成功!");
String sql=" select itemnum,sum(quantity) count,1 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s1+"' group by itemnum UNION " +
" select itemnum,sum(quantity) count,2 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s2+"' group by itemnum UNION " +
" select itemnum,sum(quantity) count,3 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s3+"' group by itemnum ";
pre = con.prepareStatement(sql);// 实例化预编译语句
result=pre.executeQuery();// 执行查询,注意括号中不需要再加参数
pre = con.prepareStatement(sql);// 实例化预编译语句
result=pre.executeQuery();// 执行查询,注意括号中不需要再加参数
while (result.next()) {
String itemnum= result.getString("itemnum");
Double count= result.getDouble("count");
Integer num= result.getInt("num");
String sql1="";
if (num==1) { //前一年
sql1="update matusetrans set ISSUE1YRAGO = "+count+" where itemnum='"+itemnum+"'";
if (num==1) { //前一年
sql1="update INVENTORY set ISSUE1YRAGO = "+count+" where itemnum='"+itemnum+"'";
}
if (num==2) {//前两年
sql1="update matusetrans set ISSUE2YRAGO = "+count+" where itemnum='"+itemnum+"'";
if (num==2) {//前两年
sql1="update INVENTORY set ISSUE2YRAGO = "+count+" where itemnum='"+itemnum+"'";
}
if (num==3) {//前三年
sql1="update matusetrans set ISSUE3YRAGO = "+count+" where itemnum='"+itemnum+"'";
if (num==3) {//前三年
sql1="update INVENTORY set ISSUE3YRAGO = "+count+" where itemnum='"+itemnum+"'";
}
pre1=con.prepareStatement(sql1);
pre1.execute();
}
System.out.println("库存近一二三年记录更新完成-----");
System.out.println("库存近一二三年记录更新完成-----");
} catch (RemoteException e) {
e.printStackTrace();
} catch (SQLException e) {
......@@ -69,11 +69,11 @@ public class RunSumIssueCount extends SimpleCronTask {
}
public static void main(String[] args) throws ClassNotFoundException {
//获取执行sql语句的statement对象
//获取执行sql语句的statement对象
Calendar nowDate=Calendar.getInstance();
Calendar oldDate=Calendar.getInstance(); //前一年
Calendar old1Date=Calendar.getInstance();//前两年
Calendar old2Date=Calendar.getInstance();//前三年
Calendar oldDate=Calendar.getInstance(); //前一年
Calendar old1Date=Calendar.getInstance();//前两年
Calendar old2Date=Calendar.getInstance();//前三年
System.out.println(nowDate.getTime());
oldDate.add(Calendar.YEAR, -1);
old1Date.add(Calendar.YEAR, -2);
......@@ -84,43 +84,43 @@ public class RunSumIssueCount extends SimpleCronTask {
String s1=sdf.format(oldDate.getTime());
String s2= sdf.format(old1Date.getTime());
String s3= sdf.format(old2Date.getTime());
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
PreparedStatement pre1 = null;
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//获取与数据库连接的对象-Connetcion
//获取与数据库连接的对象-Connetcion
con = DriverManager.getConnection("jdbc:sqlserver://;serverName=172.17.6.230;databaseName=maxdb;portNumber=1433;integratedSecurity=false;sendStringParametersAsUnicode=false;selectMethod=cursor;", "maximo", "maximo");
// con = MXServer.getMXServer().getDBManager().getSequenceConnection();
System.out.println("连接成功!");
System.out.println("连接成功!");
String sql=" select itemnum,sum(quantity) count,1 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s1+"' group by itemnum UNION " +
" select itemnum,sum(quantity) count,2 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s2+"' group by itemnum UNION " +
" select itemnum,sum(quantity) count,3 num from matusetrans m " +
" where transdate < '"+s+"' and transdate >='"+s3+"' group by itemnum ";
pre = con.prepareStatement(sql);// 实例化预编译语句
result=pre.executeQuery();// 执行查询,注意括号中不需要再加参数
pre = con.prepareStatement(sql);// 实例化预编译语句
result=pre.executeQuery();// 执行查询,注意括号中不需要再加参数
while (result.next()) {
String itemnum= result.getString("itemnum");
Double count= result.getDouble("count");
Integer num= result.getInt("num");
String sql1="";
if (num==1) { //前一年
if (num==1) { //前一年
sql1="update INVENTORY set ISSUE1YRAGO = "+-count+" where itemnum='"+itemnum+"'";
}
if (num==2) {//前两年
if (num==2) {//前两年
sql1="update INVENTORY set ISSUE2YRAGO = "+-count+" where itemnum='"+itemnum+"'";
}
if (num==3) {//前三年
if (num==3) {//前三年
sql1="update INVENTORY set ISSUE3YRAGO = "+-count+" where itemnum='"+itemnum+"'";
}
pre1=con.prepareStatement(sql1);
pre1.execute();
}
System.out.println("更新完成-----");
System.out.println("更新完成-----");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......
This diff is collapsed.
......@@ -10,6 +10,7 @@ import psdi.util.MXException;
public class CustRlmainthingMboSet extends MboSet implements MboSetRemote{
public CustRlmainthingMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
......
package tohi.app.invoice;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXApplicationYesNoCancelException;
import psdi.util.MXException;
public class FldBankAccountVal extends MboValueAdapter{
public FldBankAccountVal() {
super();
}
public FldBankAccountVal(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo= this.mboValue.getMbo();
String bankNum= mbo.getString("COMPANIES.BANKACCOUNT");//获取关联的银行账号
if (!bankNum.equalsIgnoreCase("")) {
if (!mboValue.getString().equalsIgnoreCase(bankNum)) {//比较两者是否一样
confirm ();
}
}
}
public boolean confirm () throws RemoteException, MXException{
int userInput = MXApplicationYesNoCancelException.getUserInput("id",MXServer.getMXServer(),this.mboValue.getMbo().getUserInfo());
System.out.println(userInput);
switch (userInput) {
case MXApplicationYesNoCancelException.NULL:{
Object params[] = {"确认要执行此操作吗?"};
throw new MXApplicationYesNoCancelException("id", "invoice", "bankiseq", params);
}
case 2:{
break;
}
}
return false;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,7 @@ public class FldBehaviorcategorylinId extends MAXTableDomain{
public MboSetRemote getList() throws MXException, RemoteException {
MboRemote mbo=mboValue.getMbo();
String BEHAVIORCATEGORY=mbo.getString("BEHAVIORCATEGORY");
setListCriteria("behaviorcategoryid = '"+BEHAVIORCATEGORY+"'"); //ɸѡֵ
setListCriteria("behaviorcategoryid = '"+BEHAVIORCATEGORY+"'");
return super.getList();
}
......
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.
......@@ -7,10 +7,7 @@ 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) {
......
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