Commit 4f46d9fd authored by zhh's avatar zhh

zhh update

parent 8509ea2b
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class Test { public class Test {
public static void main(String[] args) { public static void main(String[] args) {
SimpleDateFormat sdf=new SimpleDateFormat("yyMMdd");
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd"); System.out.println(sdf.format(new Date()));
SimpleDateFormat sdf1 =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()));;
//DAY_OF_WEEK
// System.out.println(c.get(Calendar.DAY_OF_WEEK));
Calendar calendar1 = Calendar.getInstance(); //当前时间
System.out.println(calendar1.get(Calendar.DAY_OF_WEEK));
calendar1.add(Calendar.DAY_OF_MONTH,10);
System.out.println(calendar1.getTime());
// int weekNowNum=calendar1.get(Calendar.DAY_OF_WEEK);//获取当前星期
// System.out.println(weekNowNum);
String s=new String("\u5df2");
System.out.println(s);
} }
} }
...@@ -38,7 +38,7 @@ public class Test3 { ...@@ -38,7 +38,7 @@ public class Test3 {
System.out.println("原来"+pwd); System.out.println("原来"+pwd);
//String spwd = mx.decData("05D3E4AE66BD4C6D0A934D9896EB2187"); //String spwd = mx.decData("05D3E4AE66BD4C6D0A934D9896EB2187");
String spwd1 = mx.encData("clpjbdev"); String spwd1 = mx.encData("clpjbdev");
String spwd = mx.decData("170DB79B4BEE2D9670C8C117EE7862D7"); String spwd = mx.decData("500C7C9864165AD6E8A35E1EFC5279C2");
// System.out.println("spwd:"+spwd); // System.out.println("spwd:"+spwd);
System.out.println("加密"+spwd1); System.out.println("加密"+spwd1);
// System.out.println("解密"+new String(spwd.getBytes("UTF-8"))); // System.out.println("解密"+new String(spwd.getBytes("UTF-8")));
......
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.StringUtility;
public class Testjdbc {
public static void main(String[] args) throws ClassNotFoundException, SQLException {
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");//实例化oracle数据库驱动程序(建立中间件)
String url ="jdbc:sqlserver://;serverName=172.17.6.230;databaseName=maxdb;portNumber=1433;integratedSecurity=false;sendStringParametersAsUnicode=false;selectMethod=cursor;";//@localhost为服务器名,sjzwish为数据库实例名
con = DriverManager.getConnection(url, "maximo", "maximo");//连接数据库,a代表帐户,a代表密码
System.out.println("连接成功!");
String sql = " select LOCATIONMETER.metername, "
+ " METER.METERTYPE, LOCATIONMETER.normalvalue, "
+ " LOCATIONMETER.maxvalue , "
+ " LOCATIONMETER.minvalue, "
+ " MEASUREMENT.observation , "
+ " MEASUREMENT.measurementid , "
+ " MEASUREMENT.ifsynchronous , "
+ " MEASUREMENT.location , "
+ " MEASUREMENT.measurementvalue , "
+ " MEASUREMENT.pointnum , "
+ " MEASUREMENT.inspector , "
+ " MEASUREMENT.measuredate , MEASUREMENT.rtinspcnum , "
+ " MEASUREMENT.siteid , MEASUREMENT.orgid " + " from "
+ " LOCATIONMETER,METER,MEASUREMENT "
+ " where LOCATIONMETER.metername= METER.metername "
+ " and MEASUREMENT.metername= METER.metername "
+ " and IFSYNCHRONOUS=0 ";
pre = con.prepareStatement(sql);// 实例化预编译语句
result = pre.executeQuery();// 执行查询,注意括号中不需要再加参数
int count =0;
while (result.next()) {
String metername = result.getString("metername");
String metertype = result.getString("metertype");
String normalvalue = result.getString("normalvalue");
String maxvalue = result.getString("maxvalue");
String minvalue = result.getString("minvalue");
String observation = result.getString("observation");
Long measurementid = result.getLong("measurementid");
// 需要新增变量
String location = result.getString("location");
Double measurementvalue = result.getDouble("measurementvalue");
String inspector = result.getString("inspector");
Date measuredate = result.getDate("measuredate");
String rtinspcnum = result.getString("rtinspcnum");
String siteid = result.getString("siteid");
String orgid = result.getString("orgid");
boolean flag = false;
if (metertype.equalsIgnoreCase("CHARACTERISTIC")) { // 非数值类型
if (!StringUtility.isEmpty(normalvalue)) {
if (!normalvalue.equalsIgnoreCase(observation)) { // 如果是相同类型则正常
System.out.println(normalvalue+"---"+observation);
count++;
flag=true;
}
}
}
if (metertype.equalsIgnoreCase("GAUGE")) { // 数值类型
if (StringUtility.isEmpty(minvalue)
&& StringUtility.isEmpty(maxvalue)) {
continue;
}
if ( !StringUtility.isEmpty(minvalue)
&& !StringUtility.isEmpty(maxvalue)) {
if (measurementvalue < Double.parseDouble(minvalue)
|| measurementvalue > Double.parseDouble(maxvalue)) { // 生成记录
flag = true;
}
} else if (!StringUtility.isEmpty(minvalue)
&& StringUtility.isEmpty(maxvalue)) {
if (measurementvalue < Double.parseDouble(minvalue)) { // 生成记录
flag = true;
}
} else if (StringUtility.isEmpty(minvalue)
&& !StringUtility.isEmpty(maxvalue)) {
if (measurementvalue > Double.parseDouble(maxvalue)) { // 生成记录
flag = true;
}
}
if (flag) {
System.out.println(measurementid+"--zzz--"+minvalue+"---"+maxvalue +"---"+ measurementvalue);
count++;
}
}
}
System.out.println(count);
}
}
package clp.app.crontask; package clp.app.crontask;
import clp.app.rtinspection.RTInspcPlan; import clp.app.rtinspection.RTInspcPlan;
import clp.app.rtinspection.RTInspcPlanSet; import clp.app.rtinspection.RTInspcPlanSet;
import java.io.PrintStream;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -14,14 +16,14 @@ import psdi.util.logging.MXLogger; ...@@ -14,14 +16,14 @@ import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory; import psdi.util.logging.MXLoggerFactory;
import psdi.workflow.WorkFlowServiceRemote; import psdi.workflow.WorkFlowServiceRemote;
public class CLPRTInspcGenCronTask extends SimpleCronTask { public class CLPRTInspcGenCronTask extends SimpleCronTask
{
private boolean ready = false; private boolean ready = false;
MXLogger logger; MXLogger logger;
public CLPRTInspcGenCronTask() { public void init()
} throws MXException
{
public void init() throws MXException {
super.init(); super.init();
this.logger = MXLoggerFactory.getLogger("maximo.crontask.CLPRTInspcGenCronTask"); this.logger = MXLoggerFactory.getLogger("maximo.crontask.CLPRTInspcGenCronTask");
} }
...@@ -32,7 +34,7 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -32,7 +34,7 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
public void cronAction() { public void cronAction() {
try { try {
this.startwf(); startwf();
} catch (RemoteException var6) { } catch (RemoteException var6) {
var6.printStackTrace(); var6.printStackTrace();
} catch (MXException var7) { } catch (MXException var7) {
...@@ -43,23 +45,26 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -43,23 +45,26 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
this.logger.info("-- Start CLPRTInspcGenCronTask -------------------- "); this.logger.info("-- Start CLPRTInspcGenCronTask -------------------- ");
try { try {
MXServer mxserver = MXServer.getMXServer(); MXServer mxserver = MXServer.getMXServer();
RTInspcPlanSet rtInspcPlanSet = (RTInspcPlanSet)mxserver.getMboSet("RTInspcPlan", this.getRunasUserInfo()); RTInspcPlanSet rtInspcPlanSet = (RTInspcPlanSet)mxserver.getMboSet("RTInspcPlan", getRunasUserInfo());
StringBuilder strBuffer = new StringBuilder(); 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.setWhere(strBuffer.toString());
rtInspcPlanSet.reset(); rtInspcPlanSet.reset();
RTInspcPlan rtInspcPlan = null; RTInspcPlan rtInspcPlan = null;
for(int i = 0; (rtInspcPlan = (RTInspcPlan)rtInspcPlanSet.getMbo(i)) != null; ++i) {
this.genRTInspc(rtInspcPlan); for (int i = 0; (rtInspcPlan = (RTInspcPlan)rtInspcPlanSet.getMbo(i)) != null; i++) {
genRTInspc(rtInspcPlan);
} }
rtInspcPlanSet.save(); rtInspcPlanSet.save();
rtInspcPlanSet.close(); rtInspcPlanSet.close();
this.startwf(); startwf();
} catch (Exception var8) { } catch (Exception var8) {
var8.printStackTrace(); var8.printStackTrace();
System.out.println(var8.getStackTrace()); System.out.println(var8.getStackTrace());
this.logger.error(var8.getStackTrace()); this.logger.error(var8.getStackTrace());
} }
this.logger.info("-- End CLPRTInspcGenCronTask ------------------------- "); this.logger.info("-- End CLPRTInspcGenCronTask ------------------------- ");
} }
} }
...@@ -67,12 +72,12 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -67,12 +72,12 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
private void startwf() throws RemoteException, MXException { private void startwf() throws RemoteException, MXException {
MXServer mxserver = MXServer.getMXServer(); MXServer mxserver = MXServer.getMXServer();
WorkFlowServiceRemote wfsr = (WorkFlowServiceRemote)mxserver.lookup("WORKFLOW"); WorkFlowServiceRemote wfsr = (WorkFlowServiceRemote)mxserver.lookup("WORKFLOW");
MboSetRemote rtInspcSet = mxserver.getMboSet("RTInspection", this.getRunasUserInfo()); 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(); rtInspcSet.reset();
MboRemote rtInspc = null; MboRemote rtInspc = null;
for(int i = 0; (rtInspc = rtInspcSet.getMbo(i)) != null; ++i) { for (int i = 0; (rtInspc = rtInspcSet.getMbo(i)) != null; i++) {
wfsr.initiateWorkflow("CLPRTINSPC", rtInspc); wfsr.initiateWorkflow("CLPRTINSPC", rtInspc);
} }
...@@ -85,29 +90,39 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -85,29 +90,39 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
Date sysdate = MXServer.getMXServer().getDate(); Date sysdate = MXServer.getMXServer().getDate();
if (!ft.format(sysdate).equalsIgnoreCase(ft.format(nextdate))) { if (!ft.format(sysdate).equalsIgnoreCase(ft.format(nextdate))) {
if (sysdate.compareTo(nextdate) < 0) { if (sysdate.compareTo(nextdate) < 0) {
throw new MXApplicationException("提示:", "巡检日期为:" + ft.format(nextdate) + ",还没到期!"); throw new MXApplicationException("提示:", "巡检日期为:" + ft.format(nextdate) + ",还没到期!");
} }
if (sysdate.compareTo(nextdate) > 0) { if (sysdate.compareTo(nextdate) > 0) {
nextdate = sysdate; nextdate = sysdate;
} }
} }
//将历史单据任务改为取消状态
MXServer mxserver = MXServer.getMXServer();
MboSetRemote rtSet = mxserver.getMboSet("RTINSPECTION", getRunasUserInfo());
rtSet.setWhere("status='已核准' and ROUTE='"+rtInspcPlan.getString("ROUTE")+"'");
for (int i = 0; i < rtSet.count(); i++) {
rtSet.getMbo(i).setValue("status", "已过期",11L);;
}
rtSet.save(11L);
MboSetRemote rtinspcSet = rtInspcPlan.getMboSet("NEWRTINSPECTION"); MboSetRemote rtinspcSet = rtInspcPlan.getMboSet("NEWRTINSPECTION");
MboRemote rtinspc = rtinspcSet.add(); MboRemote rtinspc = rtinspcSet.add();
rtinspc.setValue("description", rtInspcPlan.getString("description")); SimpleDateFormat sdf=new SimpleDateFormat("yyMMdd");
rtinspc.setValue("description",sdf.format(nextdate)+ "--"+rtInspcPlan.getString("description"));
rtinspc.setValue("RTINSPCDATE", nextdate); rtinspc.setValue("RTINSPCDATE", nextdate);
rtinspc.setValue("RTINSPECTYPE", rtInspcPlan.getString("TYPE")); rtinspc.setValue("RTINSPECTYPE", rtInspcPlan.getString("TYPE"));
rtinspc.setValue("ROUTE", rtInspcPlan.getString("ROUTE")); rtinspc.setValue("ROUTE", rtInspcPlan.getString("ROUTE"));
rtinspc.setValue("RTINSPLNUM", rtInspcPlan.getString("RTINSPLNUM")); rtinspc.setValue("RTINSPLNUM", rtInspcPlan.getString("RTINSPLNUM"));
rtinspc.setValue("endtime", rtInspcPlan.getDate("endtime")); rtinspc.setValue("endtime", rtInspcPlan.getDate("endtime"));
rtinspc.setValue("status", "已核准"); rtinspc.setValue("status", "已核准");
MboSetRemote PersonGrpTeamSet = rtInspcPlan.getMboSet("$personGroupTeam", "personGroupTeam", "persongroup='" + rtInspcPlan.getString("OWNERGROUP") + "'"); MboSetRemote PersonGrpTeamSet = rtInspcPlan.getMboSet("$personGroupTeam", "personGroupTeam", "persongroup='" + rtInspcPlan.getString("OWNERGROUP") + "'");
MboSetRemote leadGrpSet = rtinspc.getMboSet("LEADGROUP"); MboSetRemote leadGrpSet = rtinspc.getMboSet("LEADGROUP");
MboRemote personGrpTeam = null; MboRemote personGrpTeam = null;
MboRemote leadGrp = null; MboRemote leadGrp = null;
for(int i = 0; (personGrpTeam = PersonGrpTeamSet.getMbo(i)) != null; ++i) { for (int i = 0; (personGrpTeam = PersonGrpTeamSet.getMbo(i)) != null; i++) {
leadGrp = leadGrpSet.add(); leadGrp = leadGrpSet.add();
leadGrp.setValue("personid", personGrpTeam.getString("RESPPARTYGROUP")); leadGrp.setValue("personid", personGrpTeam.getString("RESPPARTYGROUP"));
} }
...@@ -118,13 +133,13 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -118,13 +133,13 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
} else { } else {
MboSetRemote timelineSet = rtInspcPlan.getMboSet("STARTTIMEBTCT"); MboSetRemote timelineSet = rtInspcPlan.getMboSet("STARTTIMEBTCT");
MboRemote timeline = null; MboRemote timeline = null;
int j;
if (timelineSet.isEmpty()) { if (timelineSet.isEmpty()) {
rtInspcPlan.setValue("nextdate", rtInspcPlan.getNextDate(nextdate)); rtInspcPlan.setValue("nextdate", rtInspcPlan.getNextDate(nextdate));
timelineSet0.setOrderBy("starttime asc"); timelineSet0.setOrderBy("starttime asc");
timelineSet0.reset(); timelineSet0.reset();
for(j = 0; (timeline = timelineSet0.getMbo(j)) != null; ++j) { for (int j = 0; (timeline = timelineSet0.getMbo(j)) != null; j++) {
timeline.setValue("flag", false); timeline.setValue("flag", false);
rtinspc.setValue("endtime", timeline.getDate("endtime")); rtinspc.setValue("endtime", timeline.getDate("endtime"));
rtinspc.setValue("description", timeline.getString("description")); rtinspc.setValue("description", timeline.getString("description"));
...@@ -132,13 +147,12 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask { ...@@ -132,13 +147,12 @@ public class CLPRTInspcGenCronTask extends SimpleCronTask {
} else { } else {
timelineSet = rtInspcPlan.getMboSet("STARTTIMELTCT"); timelineSet = rtInspcPlan.getMboSet("STARTTIMELTCT");
for(j = 0; (timeline = timelineSet.getMbo(j)) != null; ++j) { for (int j = 0; (timeline = timelineSet.getMbo(j)) != null; j++) {
rtinspc.setValue("endtime", timeline.getDate("endtime")); rtinspc.setValue("endtime", timeline.getDate("endtime"));
rtinspc.setValue("description", timeline.getString("description")); rtinspc.setValue("description", timeline.getString("description"));
timeline.setValue("flag", true); timeline.setValue("flag", true);
} }
} }
} }
} }
} }
\ No newline at end of file
package clp.app.po; package clp.app.po;
import java.io.PrintStream; import java.io.PrintStream;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.HashSet; import java.util.HashSet;
...@@ -11,7 +10,11 @@ import psdi.mbo.MboSetRemote; ...@@ -11,7 +10,11 @@ import psdi.mbo.MboSetRemote;
import psdi.security.ProfileRemote; import psdi.security.ProfileRemote;
import psdi.security.UserInfo; import psdi.security.UserInfo;
import psdi.server.MXServer; import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXApplicationWarningException;
import psdi.util.MXApplicationYesNoCancelException;
import psdi.util.MXException; import psdi.util.MXException;
import psdi.webclient.system.controller.MXApplicationLiteralWarningException;
public class CLPPO extends PO public class CLPPO extends PO
implements CLPPORemote implements CLPPORemote
...@@ -23,9 +26,16 @@ public class CLPPO extends PO ...@@ -23,9 +26,16 @@ public class CLPPO extends PO
super(paramMboSet); super(paramMboSet);
} }
public void init() throws MXException {
super.init();
@Override
public void appValidate() throws MXException, RemoteException {
super.appValidate();
}
public void init() throws MXException {
super.init();
try { try {
String status = getString("status"); String status = getString("status");
String[] as = { "DESCRIPTION" }; String[] as = { "DESCRIPTION" };
...@@ -50,7 +60,6 @@ public class CLPPO extends PO ...@@ -50,7 +60,6 @@ public class CLPPO extends PO
POLINE.setFlag(7L, false); POLINE.setFlag(7L, false);
} }
} catch (RemoteException localRemoteException) { } catch (RemoteException localRemoteException) {
} }
} }
...@@ -132,25 +141,4 @@ public class CLPPO extends PO ...@@ -132,25 +141,4 @@ public class CLPPO extends PO
zero = zero + "0"; zero = zero + "0";
return zero; 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
package clp.app.po;
public interface CLPPORemote {
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package clp.app.rfq; package clp.app.rfq;
import java.io.PrintStream;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import psdi.app.rfq.RFQ; import psdi.app.rfq.RFQ;
import psdi.mbo.MboRemote; import psdi.mbo.MboRemote;
import psdi.mbo.MboSet; import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote; import psdi.mbo.MboSetRemote;
import psdi.server.MXServer; import psdi.security.ProfileRemote;
import psdi.util.MXException; import psdi.util.MXException;
public class CLPRFQ extends RFQ implements CLPRFQRemote { public class CLPRFQ extends RFQ
implements CLPRFQRemote
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public CLPRFQ(MboSet paramMboSet) throws MXException, RemoteException { public CLPRFQ(MboSet paramMboSet)
throws MXException, RemoteException
{
super(paramMboSet); super(paramMboSet);
} }
public void init() throws MXException { @Override
public void init() throws MXException {
super.init(); 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 { public void add()
throws MXException, RemoteException
{
super.add(); super.add();
if (this.getString("siteid").equals("CLP-YN-YE")) { if (getString("siteid").equals("CLP-YN-YE"))
this.setValue("CUSTDEPT", "CLPYE", 2L); setValue("CUSTDEPT", "CLPYE", 2L);
} else if (this.getString("siteid").equals("CLP-HY-BX")) { else if (getString("siteid").equals("CLP-HY-BX"))
this.setValue("CUSTDEPT", "CLPHY", 2L); setValue("CUSTDEPT", "CLPHY", 2L);
} else if (this.getString("siteid").equals("CLP-JB-JBZB")) { else if (getString("siteid").equals("CLP-JB-JBZB"))
this.setValue("CUSTDEPT", this.getString("ENTERBY.DEPARTMENT"), 11L); setValue("CUSTDEPT", getString("ENTERBY.DEPARTMENT"), 11L);
}
} }
public void save() throws MXException, RemoteException { public void save()
throws MXException, RemoteException
{
super.save(); super.save();
} }
public void createRFQLineFromPR(MboRemote paramMboRemote1, MboRemote paramMboRemote2) throws MXException, RemoteException { public void createRFQLineFromPR(MboRemote paramMboRemote1, MboRemote paramMboRemote2) throws MXException, RemoteException {
super.createRFQLineFromPR(paramMboRemote1, paramMboRemote2); super.createRFQLineFromPR(paramMboRemote1, paramMboRemote2);
this.getMboSet("RFQLINE").setValue("custdept", paramMboRemote2.getString("custdept"), 11L); getMboSet("RFQLINE").setValue("custdept", paramMboRemote2.getString("custdept"), 11L);
this.getMboSet("RFQLINE").setValue("unitcost", paramMboRemote2.getString("unitcost"), 11L); getMboSet("RFQLINE").setValue("unitcost", paramMboRemote2.getString("unitcost"), 11L);
this.getMboSet("RFQLINE").setValue("linecost", paramMboRemote2.getString("linecost"), 11L); getMboSet("RFQLINE").setValue("linecost", paramMboRemote2.getString("linecost"), 11L);
} }
public void getCustCode(String prtype, String year) throws MXException, RemoteException { public void getCustCode(String prtype, String year) throws MXException, RemoteException {
int count = 1; int count = 1;
int tmpNum1 = 0; int tmpNum1 = 0;
String custcode = null; String custcode = null;
String siteid = this.getProfile().getDefaultSite(); String siteid = getProfile().getDefaultSite();
String code = "JB-TR-" + year + "-" + prtype + "-"; String code = "JB-TR-" + year + "-" + prtype + "-";
synchronized(this) { 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)"); MboSetRemote prSet = 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)"); 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) { if (prSet.count() == 1) {
MboRemote pr = prSet.getMbo(0); MboRemote pr = prSet.getMbo(0);
tmpNum1 = Integer.parseInt(pr.getString("custcode").substring(14, 16)); tmpNum1 = Integer.parseInt(pr.getString("custcode").substring(14, 16));
count = tmpNum1 + 1; count = tmpNum1 + 1;
custcode = this.getMatId(code, count); custcode = getMatId(code, count);
this.setValue("custcode", custcode, 11L); setValue("custcode", custcode, 11L);
} else { } else {
this.setValue("custcode", code + "001", 11L); setValue("custcode", code + "001", 11L);
} }
} }
} }
private String getMatId(String code, int count) { private String getMatId(String code, int count)
String num = this.getCharacterCountStringValue(count, 3); {
String num = getCharacterCountStringValue(count, 3);
return code + num; return code + num;
} }
private String getCharacterCountStringValue(int count, int maxDigit) { private String getCharacterCountStringValue(int count, int maxDigit) {
int length = String.valueOf(count).length(); int length = String.valueOf(count).length();
return this.getZeroString(maxDigit - length) + count; return getZeroString(maxDigit - length) + count;
} }
private String getZeroString(int num) { private String getZeroString(int num) {
String zero = ""; String zero = "";
for(int i = 0; i < num; ++i) { for (int i = 0; i < num; i++) {
zero = zero + "0"; zero = zero + "0";
} }
...@@ -144,15 +95,14 @@ public class CLPRFQ extends RFQ implements CLPRFQRemote { ...@@ -144,15 +95,14 @@ public class CLPRFQ extends RFQ implements CLPRFQRemote {
public void initFieldFlagsOnMbo(String attrName) throws MXException { public void initFieldFlagsOnMbo(String attrName) throws MXException {
super.initFieldFlagsOnMbo(attrName); super.initFieldFlagsOnMbo(attrName);
try
try { {
if (this.getString("siteid").equals("CLP-JB-JBZB") && this.getInternalStatus().equals("SENT") && this.getString("status").equals("WAPPR3")) { if ((getString("siteid").equals("CLP-JB-JBZB")) && (getInternalStatus().equals("SENT")) && (getString("status").equals("WAPPR3"))) {
this.setFieldFlag("custcode", 7L, false); setFieldFlag("custcode", 7L, false);
this.setFieldFlag("CUSTTYPE", 7L, false); setFieldFlag("CUSTTYPE", 7L, false);
} }
} catch (RemoteException var3) { } catch (RemoteException var3) {
var3.printStackTrace(); var3.printStackTrace();
} }
} }
} }
\ No newline at end of file
package clp.app.rfq;
import psdi.app.rfq.RFQRemote;
public abstract interface CLPRFQRemote extends RFQRemote
{
}
\ No newline at end of file
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package clp.app.rtinspection;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;
import org.json.JSONException;
import org.json.JSONObject;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class GenRtinspcTask implements ActionCustomClass {
public GenRtinspcTask() {
}
public void applyCustomAction(MboRemote rtInspc, Object[] aobj) throws MXException, RemoteException {
Properties properties = MXServer.getMXServer().getConfig();
String apikey = properties.getProperty("clp.maxadmin.apikey", "").trim();
String filepath = properties.getProperty("clp.rtinspc.storepath", "").trim();
String loadTaskURL = properties.getProperty("clp.rtinspc.loadTask.url", "").trim();
String rtinspcnum = rtInspc.getString("rtinspcnum");
String route = rtInspc.getString("route");
String siteid = rtInspc.getString("siteid");
String inspcTaskJson = this.getInspcTaskJson(apikey, loadTaskURL, rtinspcnum, route, siteid);
this.write2File(inspcTaskJson, filepath, rtinspcnum + "-" + siteid);
rtInspc.setValue("flag", true);
}
private String getInspcTaskJson(String apikey, String url, String rtinspcnum, String route, String siteid) throws MXException {
HttpURLConnection con = null;
try {
URL u = new URL(url);
con = (HttpURLConnection)u.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "*/*");
con.setRequestProperty("Accept-Charset", "UTF-8");
con.setRequestProperty("apikey", apikey);
Map<String, String> parameters = new HashMap();
parameters.put("oslc.select", "rel.activertinspc{rtinspcnum,description,status,route,rtinspectype,siteid},rel.rtinspcstops{rtinspcstopsid,rtinspcnum,location,description,siteid,flag,route_stop.files--files,route_stop.area--area}");
parameters.put("site.activertinspc.where", "rtinspcnum in [\"" + rtinspcnum + "\"]");
parameters.put("site.rtinspcstops.where", "rtinspcnum in [\"" + rtinspcnum + "\"]");
parameters.put("oslc.where", "siteid=\"" + siteid + "\"");
parameters.put("ignorecollectionref", "1");
parameters.put("lean", "1");
con.setDoOutput(true);
DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.writeBytes(this.getParamsString(parameters));
out.flush();
out.close();
con.setConnectTimeout(5000);
con.setReadTimeout(5000);
int status = con.getResponseCode();
Reader streamReader = null;
if (status > 299) {
streamReader = new InputStreamReader(con.getErrorStream(), "UTF-8");
} else {
streamReader = new InputStreamReader(con.getInputStream(), "UTF-8");
}
BufferedReader br = new BufferedReader(streamReader);
StringBuilder sb = new StringBuilder();
String line;
while((line = br.readLine()) != null) {
sb.append(line + "\n");
}
br.close();
con.disconnect();
try {
String var17 = (new JSONObject(sb.toString())).toString();
return var17;
} catch (JSONException var29) {
var29.printStackTrace();
}
} catch (MalformedURLException var30) {
var30.printStackTrace();
} catch (IOException var31) {
var31.printStackTrace();
} finally {
if (con != null) {
try {
con.disconnect();
} catch (Exception var28) {
var28.printStackTrace();
}
}
}
return null;
}
private void write2File(String rtinspcJson, String filePath, String filename) throws MXException, RemoteException {
String fileName = filePath + filename + ".json";
File dir = new File(filePath);
if (!dir.exists()) {
dir.mkdirs();
}
File checkFile = new File(fileName);
FileWriter writer = null;
try {
if (!checkFile.exists()) {
checkFile.createNewFile();
}
writer = new FileWriter(checkFile, false);
writer.append(rtinspcJson);
writer.flush();
} catch (IOException var17) {
var17.printStackTrace();
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException var16) {
var16.printStackTrace();
}
}
}
}
private String getParamsString(Map<String, String> params) throws UnsupportedEncodingException {
StringBuilder result = new StringBuilder();
Iterator var4 = params.entrySet().iterator();
while(var4.hasNext()) {
Entry<String, String> entry = (Entry)var4.next();
result.append(URLEncoder.encode((String)entry.getKey(), "UTF-8"));
result.append("=");
result.append(URLEncoder.encode((String)entry.getValue(), "UTF-8"));
result.append("&");
}
String resultString = result.toString();
return resultString.length() > 0 ? resultString.substring(0, resultString.length() - 1) : resultString;
}
}
package clp.app.rtinspection;
import java.rmi.RemoteException;
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;
import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory;
public class RtInspection extends Mbo
implements RtInspectionRemote
{
private static HashSet skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
private boolean isModified = false;
private final String APPLOGGER = "maximo.application.RTINSPECTION";
private MXLogger log;
public RtInspection(MboSet mboSet0)
throws RemoteException
{
super(mboSet0);
this.log = MXLoggerFactory.getLogger("maximo.application.RTINSPECTION");
}
public void add() throws MXException, RemoteException
{
super.add();
this.log.debug("RtInspection.add");
setValue("status", "草稿", 11L);
setValue("createdby", getUserInfo().getUserName(), 11L);
setValue("createdate", MXServer.getMXServer().getDate(), 11L);
setValue("statusdate", MXServer.getMXServer().getDate(), 11L);
}
public void init()
throws MXException
{
super.init();
this.log.debug("RtInspection.init");
try
{
String status = getString("status");
String[] as = { "DESCRIPTION", "MEMO", "RTINSPCDATE",
"RTINSPECTYPE", "ROUTE", "ENDTIME" };
String[] as2 = { "MEMO", "ENDTIME" };
if (isNew()) {
return;
}
if (getUserName().equalsIgnoreCase("maxadmin")) {
return;
}
if ((getString("CREATEDBY").equalsIgnoreCase(getUserName())) &&
(status.equals("草稿"))) {
return;
}
setFieldFlag(as, 7L, true);
MboSetRemote leadGrp = getMboSet("LEADGROUP");
leadGrp.setFlag(7L, true);
MboSetRemote rtInspcStops = getMboSet("RTINSPCSTOPS");
rtInspcStops.setFlag(7L, true);
MboSetRemote wfment = getMboSet("$wfassignment", "wfassignment",
"ownerid='" + getInt("ROUTINGINSPECTIONID") +
"' and assignstatus='ACTIVE' and assigncode='" +
getUserInfo().getPersonId().toUpperCase() +
"' and ownertable='" + getName().toUpperCase() +
"'");
int i = wfment.count();
if ((i > 0) && ("草稿".equals(status))) {
setFieldFlag(as, 7L, false);
leadGrp.setFlag(7L, false);
rtInspcStops.setFlag(7L, false);
}
if ((i > 0) && (("已核准".equals(status)) || ("验收不合格".equals(status))))
setFieldFlag(as2, 7L, false);
}
catch (RemoteException localRemoteException) {
}
}
public void copyStops() throws RemoteException, MXException {
MboSetRemote routesSet = getMboSet("routes");
if (routesSet.isEmpty()) {
return;
}
MboRemote route = routesSet.getMbo(0);
MboSetRemote rtInspcStops = getMboSet("RTINSPCSTOPS");
rtInspcStops.deleteAll(2L);
MboSetRemote routeStops = route.getMboSet("ROUTE_STOP");
MboRemote routeStop = null;
MboRemote rtInspecStop = null;
for (int i = 0; (routeStop = routeStops.getMbo(i)) != null; i++) {
rtInspecStop = rtInspcStops.add();
rtInspecStop.setValue("location", routeStop.getString("location"));
}
}
public void delete(long access) throws MXException, RemoteException
{
getMboSet("LEADGROUP").deleteAll(access);
getMboSet("RTINSPCSTOPS").deleteAll(access);
super.delete(access);
}
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("CREATEDBY");
skipFieldCopy.add("CREATEDATE");
skipFieldCopy.add("STATUS");
skipFieldCopy.add("STATUSDATE");
skipFieldCopy.add("HISTORYFLAG");
skipFieldCopy.add("RTINSPCNUM");
skipFieldCopy.add("MEMO");
}
public void initRelationship(String relationName, MboSetRemote mboSet) throws RemoteException, MXException
{
if (getInt("HISTORYFLAG") == 1)
setFlag(7L, true);
}
}
\ No newline at end of file
package clp.app.rtinspection;
import java.rmi.RemoteException;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class UpdateComprate
implements ActionCustomClass
{
public void applyCustomAction(MboRemote rtInspc, Object[] aobj)
throws MXException, RemoteException
{
MboSetRemote stopsSet = rtInspc.getMboSet("RTINSPCSTOPS");
if (!stopsSet.isEmpty()) {
int compRate = Math.round(rtInspc.getMboSet("RTINSPCSTOPS2").count() / stopsSet.count() * 100.0F);
rtInspc.setValue("compRate", compRate, 2L);
rtInspc.setValue("compRateStr2", rtInspc.getMboSet("RTINSPCSTOPS2").count() + "/" + stopsSet.count(), 2L);
}
}
}
\ No newline at end of file
...@@ -27,7 +27,7 @@ public class CustSafetyadviceAppBean extends AppBean{ ...@@ -27,7 +27,7 @@ public class CustSafetyadviceAppBean extends AppBean{
newWoMbo.setValue("DESCRIPTION", mbo.getString("DESCRIPTION"),11L); newWoMbo.setValue("DESCRIPTION", mbo.getString("DESCRIPTION"),11L);
newWoMbo.setValue("CUSTDEPT", mbo.getString("DEPARTMENT"),11L); //部门 newWoMbo.setValue("CUSTDEPT", mbo.getString("DEPARTMENT"),11L); //部门
newWoMbo.setValue("CUSTFZR", mbo.getString("PERSONLIABLE"),11L);//责任人 newWoMbo.setValue("CUSTFZR", mbo.getString("PERSONLIABLE"),11L);//责任人
newWoMbo.setValue("WORKTYPE","HSE",11L);//工单类型 newWoMbo.setValue("WORKTYPE","SHE",11L);//工单类型
mbo.setValue("WONUM", newWoMbo.getString("WONUM")); mbo.setValue("WONUM", newWoMbo.getString("WONUM"));
WORKORDERMboSet.save(); WORKORDERMboSet.save();
WORKORDERMboSet.close(); WORKORDERMboSet.close();
......
...@@ -22,7 +22,7 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{ ...@@ -22,7 +22,7 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{
RemoteException { RemoteException {
DataBean appBean = app.getAppBean(); DataBean appBean = app.getAppBean();
MboRemote groupMbo = appBean.getMbo(); MboRemote groupMbo = appBean.getMbo();
MboSetRemote ms = super.getMboSetRemote();; MboSetRemote ms = super.getMboSetRemote();
System.out.println(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'"); System.out.println(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'");
ms.setWhere(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'"); ms.setWhere(" behaviortype=2 and TREATMENTMETHOD = 2 and (wonum is NULL or wonum ='') and pjoobservationid ='"+groupMbo.getLong("PJOOBSERVATIONID")+"'");
return ms; return ms;
...@@ -37,8 +37,13 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{ ...@@ -37,8 +37,13 @@ public class CustPjobehaviornoDataBean extends MultiselectDataBean{
MboRemote tempMbo=mboSet.getMbo(i); MboRemote tempMbo=mboSet.getMbo(i);
if (tempMbo.isSelected() && tempMbo.getString("WONUM").equalsIgnoreCase("")) { if (tempMbo.isSelected() && tempMbo.getString("WONUM").equalsIgnoreCase("")) {
MboRemote wo=woSet.add(11L); MboRemote wo=woSet.add(11L);
wo.setValue("BEHAVIORCATEGORY", tempMbo.getString("BEHAVIORCATEGORY"),11L);
wo.setValue("BEHAVIORCATEGORYLINID", tempMbo.getString("BEHAVIORCATEGORYLINID"),11L);
wo.setValue("TREATMENTMETHOD", tempMbo.getString("TREATMENTMETHOD"),11L);
wo.setValue("PJOREGION", tempMbo.getString("PJOREGION"),11L);
wo.setValue("SOURCE", tempMbo.getString("SOURCE"),11L);
wo.setValue("DESCRIPTION", tempMbo.getString("ELABORATE"),11L); wo.setValue("DESCRIPTION", tempMbo.getString("ELABORATE"),11L);
wo.setValue("WORKTYPE", "HSE",11L);// wo.setValue("WORKTYPE", "SHE",11L);
wo.setValue("CUSTFZR", tempMbo.getString("PROPOSER"),11L); wo.setValue("CUSTFZR", tempMbo.getString("PROPOSER"),11L);
woSet.save(11L); woSet.save(11L);
map.put(tempMbo.getLong("pjobehaviorid"),wo.getString("WONUM")); map.put(tempMbo.getLong("pjobehaviorid"),wo.getString("WONUM"));
......
package com.tohi.webclient.beans.po;
import java.rmi.RemoteException;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXApplicationYesNoCancelException;
import psdi.util.MXException;
import psdi.webclient.beans.po.POAppBean;
public class CustPoAppBean extends POAppBean{
/**
// * 确认弹窗,在appbean内调用,不能在mbo内调用
// * @author juong
// * @throws MXException
// * @throws RemoteException
// * @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[] = {"确认要执行此操作吗?"};
throw new MXApplicationYesNoCancelException("id", "po", "showtotalcost", params);
}
case 2:{
break;
}
}
return false;
}
@Override
public int SAVE() 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();
}
}
package com.tohi.webclient.beans.po;
import psdi.webclient.beans.po.POAppBean;
public class CustpoAppBean extends POAppBean{
}
package com.tohi.webclient.beans.rtinspnrecor;
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 RtinspnrecorAppBean extends AppBean {
/**
* 异常巡检处理
* @param mbo
* @throws MXException
* @throws RemoteException
*/
public int CREATESR() 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("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("SR", MXServer.getMXServer().getSystemUserInfo());
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);//旧班组
m.setValue("ticketid", RECORDmbo.getString("TICKETID"),11L);
m.setValue("PROCESSRESULT","已处理" ,11L);
mboSet.save();
}
mboSet.close();
this.app.getResultsBean().save();
return 1;
}
public int CHANGENAPPR() 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("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
for (MboRemote m:ver) {
m.setValue("PROCESSRESULT","无需处理" ,11L);
}
this.app.getResultsBean().save();
return 1;
}
public int CHANGEAPPR() 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("PROCESSRESULT").equals("已处理") || m.getString("PROCESSRESULT").equals("无需处理")) {
throw new MXApplicationException("异常巡检处理", "已处理和无需处理的请勿勾选!!!!");
}
}
System.out.println(ver.size()+"-------");
for (MboRemote m:ver) {
m.setValue("PROCESSRESULT","已处理" ,11L);
}
this.app.getResultsBean().save();
return 1;
}
}
package psdi.app.rfq;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.HashSet;
import java.util.Vector;
import psdi.app.common.TaxUtility;
import psdi.app.person.PersonRemote;
import psdi.app.po.POServiceRemote;
import psdi.app.rfq.virtual.RFQChangeStatusSet;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueInfo;
import psdi.mbo.SqlFormat;
import psdi.mbo.StatefulMbo;
import psdi.mbo.StatusHandler;
import psdi.mbo.Translate;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.util.BidiUtils;
import psdi.util.MXAccessException;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class RFQ extends StatefulMbo
implements RFQRemote
{
boolean isModified = false;
private Vector rfqVendorList = null;
private static HashSet skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
public RFQ(MboSet ms)
throws MXException, RemoteException
{
super(ms);
}
public String getProcess()
{
return "RFQ";
}
protected MboSetRemote getStatusHistory()
throws MXException, RemoteException
{
return getMboSet("RFQSTATUS");
}
protected StatusHandler getStatusHandler()
{
return new RFQStatusHandler(this);
}
public String getStatusListName()
{
return "RFQSTAT";
}
public void init()
throws MXException
{
super.init();
String[] alwaysReadOnly = { "status", "enterby", "statusdate", "historyflag", "siteid" };
setFieldFlag(alwaysReadOnly, 7L, true);
}
public void add()
throws MXException, RemoteException
{
setValue("status", getTranslator().toExternalDefaultValue("RFQSTAT", "INPRG", this), 2L);
setValue("requestedby", getUserInfo().getPersonId(), 11L);
setValue("changeby", getUserInfo().getUserName(), 11L);
setValue("enterby", getUserInfo().getUserName(), 11L);
String priority = getMboValue("priority").getMboValueInfo().getDefaultValue();
if (priority == null)
setValue("priority", 0, 11L);
else
setValue("priority", priority, 11L);
setValue("enterdate", MXServer.getMXServer().getDate(), 11L);
setValue("statusdate", MXServer.getMXServer().getDate(), 11L);
setValue("changedate", MXServer.getMXServer().getDate(), 11L);
setValue("historyflag", false, 11L);
SqlFormat sqf = new SqlFormat(getUserInfo(), "personid = :1");
String personID = getUserInfo().getPersonId();
sqf.setObject(1, "PERSON", "personid", personID);
MboRemote personRemote = getMboSet("$person", "PERSON", sqf.format()).getMbo(0);
if ((personRemote != null) && (((PersonRemote)personRemote).getInternalStatus().equals("ACTIVE")))
{
setValue("shipto", personRemote.getString("shiptoaddress"), 11L);
setValue("shiptoattn", personRemote.getString("personid"), 11L);
setValue("replyto", personRemote.getString("billtoaddress"), 11L);
}
MboSetRemote siteSet = getMboSet("SITE");
if (!siteSet.isEmpty())
{
MboRemote siteMbo = siteSet.getMbo(0);
MboRemote billtoShiptoBillingMbo = siteMbo.getMboSet("BILLTODEFAULT").getMbo(0);
MboRemote billtoShiptoShippingMbo = siteMbo.getMboSet("SHIPTODEFAULT").getMbo(0);
if ((getString("replyto").equals("")) && (billtoShiptoBillingMbo != null)) {
setValue("replyto", billtoShiptoBillingMbo.getString("addresscode"), 11L);
}
if ((getString("shipto").equals("")) && (billtoShiptoShippingMbo != null))
{
setValue("shipto", billtoShiptoShippingMbo.getString("addresscode"), 11L);
setValue("shiptoattn", billtoShiptoShippingMbo.getString("shiptocontact"), 11L);
}
if ((getString("replytoattn").equals("")) && (billtoShiptoBillingMbo != null))
setValue("replytoattn", billtoShiptoBillingMbo.getString("billtocontact"), 11L);
}
}
public void modify()
throws MXException, RemoteException
{
if (!this.isModified)
{
this.isModified = true;
setValue("changedate", MXServer.getMXServer().getDate(), 2L);
setValue("changeby", getUserInfo().getUserName(), 2L);
}
}
public void generateAutoKey()
throws RemoteException, MXException
{
if (toBeAdded())
{
getMboValue("rfqnum").autoKey();
}
else
{
Object[] param = { getName() };
throw new MXAccessException("access", "CantGenAutoKey", param);
}
}
public void delete()
throws MXException, RemoteException
{
getMboSet("RFQLINE").deleteAll(2L);
getMboSet("RFQVENDOR").deleteAll(2L);
super.delete();
}
public void canDelete()
throws MXException, RemoteException
{
checkInprgStatus("cannotdeleterfq");
}
public void createRFQLineFromPR(MboRemote fromPR, MboRemote fromPRLine)
throws MXException, RemoteException
{
MboRemote newRFQLine = getMboSet("RFQLINE").add();
newRFQLine.setValue("linetype", fromPRLine.getString("linetype"), 2L);
newRFQLine.setValue("category", fromPRLine.getString("category"), 11L);
newRFQLine.setValue("chargestore", fromPRLine.getString("chargestore"), 11L);
newRFQLine.setValue("commodity", fromPRLine.getString("commodity"), 11L);
newRFQLine.setValue("commoditygroup", fromPRLine.getString("commoditygroup"), 11L);
newRFQLine.setValue("conditioncode", fromPRLine.getString("conditioncode"), 11L);
newRFQLine.setValue("conversion", fromPRLine.getString("conversion"), 3L);
newRFQLine.setValue("converttocontract", fromPRLine.getString("converttocontract"), 11L);
newRFQLine.setValue("description", fromPRLine.getString("description"), 11L);
newRFQLine.setValue("description_longdescription", fromPRLine.getString("description_longdescription"), 11L);
newRFQLine.setValue("assetnum", fromPRLine.getString("assetnum"), 11L);
newRFQLine.setValue("fincntrlid", fromPRLine.getString("fincntrlid"), 11L);
newRFQLine.setValue("gldebitacct", fromPRLine.getString("gldebitacct"), 11L);
newRFQLine.setValue("inspectionrequired", fromPRLine.getString("inspectionrequired"), 11L);
newRFQLine.setValue("issue", fromPRLine.getString("issue"), 11L);
newRFQLine.setValue("itemnum", fromPRLine.getString("itemnum"), 11L);
newRFQLine.setValue("itemsetid", fromPRLine.getString("itemsetid"), 11L);
newRFQLine.setValue("classstructureid", fromPRLine.getString("classstructureid"), 11L);
newRFQLine.setValue("location", fromPRLine.getString("location"), 11L);
newRFQLine.setValue("manufacturer", fromPRLine.getString("manufacturer"), 11L);
newRFQLine.setValue("modelnum", fromPRLine.getString("modelnum"), 11L);
newRFQLine.setValue("mrnum", fromPRLine.getString("mrnum"), 11L);
newRFQLine.setValue("mrlinenum", fromPRLine.getString("mrlinenum"), 11L);
newRFQLine.setValue("orderqty", fromPRLine.getString("orderqty"), 11L);
newRFQLine.setValue("orderunit", fromPRLine.getString("orderunit"), 11L);
newRFQLine.setValue("prorateservice", fromPRLine.getString("prorateservice"), 11L);
newRFQLine.setValue("receiptreqd", fromPRLine.getString("receiptreqd"), 11L);
newRFQLine.setValue("remark", fromPRLine.getString("remark"), 11L);
newRFQLine.setValue("remark_longdescription", fromPRLine.getString("remark_longdescription"), 11L);
newRFQLine.setValue("reqdeliverydate", fromPRLine.getString("reqdeliverydate"), 11L);
newRFQLine.setValue("requestedby", fromPRLine.getString("requestedby"), 11L);
newRFQLine.setValue("prnum", fromPRLine.getString("prnum"), 2L);
newRFQLine.setValue("prlinenum", fromPRLine.getString("prlinenum"), 2L);
newRFQLine.setValue("rfql1", fromPRLine.getString("rl1"), 2L);
newRFQLine.setValue("rfql2", fromPRLine.getString("rl2"), 2L);
newRFQLine.setValue("rfql3", fromPRLine.getString("rl3"), 2L);
newRFQLine.setValue("rfql4", fromPRLine.getString("rl4"), 2L);
newRFQLine.setValue("rfql5", fromPRLine.getString("rl5"), 2L);
newRFQLine.setValue("rfql6", fromPRLine.getString("rl6"), 2L);
newRFQLine.setValue("rfql7", fromPRLine.getString("rl7"), 2L);
newRFQLine.setValue("rfql8", fromPRLine.getString("rl8"), 2L);
newRFQLine.setValue("rfql9", fromPRLine.getString("rl9"), 2L);
newRFQLine.setValue("rfqlin1", fromPRLine.getString("rlin1"), 2L);
newRFQLine.setValue("rfqlin2", fromPRLine.getString("rlin2"), 2L);
newRFQLine.setValue("rfqlin3", fromPRLine.getString("rlin3"), 2L);
newRFQLine.setValue("rfqlin4", fromPRLine.getString("rlin4"), 2L);
newRFQLine.setValue("rfqlin5", fromPRLine.getString("rlin5"), 2L);
newRFQLine.setValue("rfqlin6", fromPRLine.getString("rlin6"), 2L);
newRFQLine.setValue("rfqlin7", fromPRLine.getString("rlin7"), 2L);
newRFQLine.setValue("rfqlin8", fromPRLine.getString("rlin8"), 2L);
newRFQLine.setValue("rfqlin9", fromPRLine.getString("rlin9"), 2L);
newRFQLine.setValue("storeloc", fromPRLine.getString("storeloc"), 11L);
newRFQLine.setValue("supervisor", fromPR.getString("supervisor"), 11L);
newRFQLine.setValue("wonum", fromPRLine.getString("wonum"), 11L);
newRFQLine.setValue("refwo", fromPRLine.getString("refwo"), 11L);
newRFQLine.setValue("taskid", fromPRLine.getString("taskid"), 11L);
fromPRLine.setValue("rfqnum", newRFQLine.getString("rfqnum"), 11L);
fromPRLine.setValue("rfqlinenum", newRFQLine.getString("rfqlinenum"), 11L);
fromPRLine.setValue("rfqlineid", newRFQLine.getLong("rfqlineid"), 11L);
MboSetRemote rfqSpecSetRemote = newRFQLine.getMboSet("RFQLINESPECCLASS");
rfqSpecSetRemote.deleteAll();
MboSetRemote myPRSpecSetRemote = fromPRLine.getMboSet("PRLINESPECCLASS");
if (!myPRSpecSetRemote.isEmpty())
myPRSpecSetRemote.copy(rfqSpecSetRemote);
}
public void createRFQVendorFromPR(MboRemote fromPR)
throws MXException, RemoteException
{
MboRemote newRFQVendor = getMboSet("RFQVENDOR").add(2L);
newRFQVendor.setValue("buyahead", fromPR.getString("buyahead"), 11L);
newRFQVendor.setValue("contact", fromPR.getString("contact"), 11L);
newRFQVendor.setFieldFlag("currencycode", 512L, true);
newRFQVendor.setValue("currencycode", fromPR.getString("currencycode"), 2L);
newRFQVendor.setValue("customernum", fromPR.getString("customernum"), 11L);
if (fromPR.getBoolean("buyahead"))
{
newRFQVendor.setValue("exchangedate", fromPR.getString("exchangedate"), 11L);
newRFQVendor.setValue("exchangerate", fromPR.getString("exchangerate"), 11L);
}
newRFQVendor.setValue("fob", fromPR.getString("fob"), 11L);
newRFQVendor.setValue("freightterms", fromPR.getString("freightterms"), 11L);
newRFQVendor.setValue("freightterms_longdescription", fromPR.getString("freightterms_longdescription"), 11L);
TaxUtility taxUtility = TaxUtility.getTaxUtility();
taxUtility.setTaxattrValue(newRFQVendor, "INCLUSIVE", fromPR, 11L);
try
{
taxUtility.setTaxesReadonly(this, "TOTALTAX", true);
}
catch (RemoteException ignore)
{
ignore.printStackTrace();
}
newRFQVendor.setValue("internal", fromPR.getString("internal"), 11L);
newRFQVendor.setValue("paymentterms", fromPR.getString("paymentterms"), 11L);
newRFQVendor.setValue("shipvia", fromPR.getString("shipvia"), 11L);
newRFQVendor.setValue("vendor", fromPR.getString("vendor"), 11L);
MboSetRemote compContactSet = newRFQVendor.getMboSet("COMPCONTACT");
if (!compContactSet.isEmpty())
{
MboRemote compContact = compContactSet.getMbo(0);
newRFQVendor.setValue("email", compContact.getString("email"), 11L);
}
MboSetRemote companySet = newRFQVendor.getMboSet("COMPANIES");
if (!companySet.isEmpty())
{
MboRemote company = companySet.getMbo(0);
newRFQVendor.setValue("faxphone", company.getString("fax"), 11L);
newRFQVendor.setValue("phone", company.getString("phone"), 11L);
}
}
public void copyPRToCurrentRFQ(MboSetRemote sourcePRLineSet)
throws MXException, RemoteException
{
if (sourcePRLineSet.isEmpty()) {
return;
}
Vector prLineSize = sourcePRLineSet.getSelection();
if (prLineSize.size() == 0) {
return;
}
checkInprgStatus("cannotCopyPRToRFQ");
sourcePRLineSet.resetWithSelection();
MboSetRemote prLineSet = null;
MboRemote prMbo = null;
String olderPRNum = null;
String newerPRNum = null;
setUpVendorLookup(null);
for (int i = 0; ; i++)
{
MboRemote sourcePRLine = sourcePRLineSet.getMbo(i);
if (sourcePRLine == null) {
break;
}
newerPRNum = sourcePRLine.getString("prnum");
String sourcePRLineNum = sourcePRLine.getString("prlinenum");
if (!newerPRNum.equals(olderPRNum))
{
SqlFormat sql = new SqlFormat(this, "prnum=:1 and siteid=:2");
sql.setObject(1, "PR", "prnum", newerPRNum);
sql.setObject(2, "PR", "siteid", sourcePRLine.getString("siteid"));
prMbo = getMboSet("$getprfromrfq" + i, "PR", sql.format()).getMbo(0);
prLineSet = prMbo.getMboSet("PRLINE");
prLineSet.setFlag(7L, false);
if (addVendorList(prMbo.getString("vendor"))) {
createRFQVendorFromPR(prMbo);
}
olderPRNum = newerPRNum;
}
if (i == 0) {
copyRFQFromPR(prMbo);
}
compareCopyTerms(prMbo);
for (int k = 0; ; k++)
{
MboRemote prLine = prLineSet.getMbo(k);
if (prLine == null) {
break;
}
if (sourcePRLineNum.equals(prLine.getString("prlinenum")))
{
createRFQLineFromPR(prMbo, prLine);
break;
}
}
}
}
public void copyTerms(MboSetRemote termsSet)
throws MXException, RemoteException
{
if (termsSet.isEmpty()) {
return;
}
Vector setSize = termsSet.getSelection();
if (setSize.size() == 0) {
return;
}
termsSet.resetWithSelection();
MboSetRemote toTermSet = null;
if ((this instanceof RFQRemote)) {
toTermSet = getMboSet("RFQTERM");
}
POServiceRemote poService = (POServiceRemote)MXServer.getMXServer().lookup("PO");
poService.compareCopyTerms(termsSet, toTermSet, this);
}
public void compareCopyTerms(MboRemote prMbo)
throws MXException, RemoteException
{
MboSetRemote rfqTerms = null;
MboSetRemote prTerms = prMbo.getMboSet("PRTERM");
if (prMbo.getString("vendor").equals("")) {
rfqTerms = getMboSet("RFQTERM");
}
else
{
MboRemote vendorRemote = getMboSet("RFQVENDOR").getMbo(0);
rfqTerms = vendorRemote.getMboSet("RFQVENDORTERM");
}
POServiceRemote poService = (POServiceRemote)MXServer.getMXServer().lookup("PO");
poService.compareCopyTerms(prTerms, rfqTerms);
}
private void setUpVendorLookup(MboRemote newRFQMbo)
throws MXException, RemoteException
{
this.rfqVendorList = new Vector();
MboSetRemote rfqVendorSet = null;
if (newRFQMbo == null)
{
rfqVendorSet = getMboSet("RFQVENDOR");
}
else
{
rfqVendorSet = newRFQMbo.getMboSet("RFQVENDOR");
}
for (int i = 0; ; i++)
{
MboRemote rfqVendor = rfqVendorSet.getMbo(i);
if (rfqVendor == null) {
break;
}
String vendor = rfqVendor.getString("vendor");
if (!this.rfqVendorList.contains(vendor))
this.rfqVendorList.addElement(vendor);
}
}
private boolean addVendorList(String vendor)
throws MXException, RemoteException
{
if (vendor.equals("")) {
return false;
}
if (!this.rfqVendorList.contains(vendor))
{
this.rfqVendorList.addElement(vendor);
return true;
}
return false;
}
public MboRemote duplicate()
throws MXException, RemoteException
{
if (!isHashSetLoaded) {
loadSkipFieldCopyHashSet();
}
MboRemote newRFQRemote = copy();
MboSetRemote currentDoclinksSetRemote = getMboSet("DOCLINKS");
if (!currentDoclinksSetRemote.isEmpty()) {
currentDoclinksSetRemote.copy(newRFQRemote.getMboSet("DOCLINKS"));
}
MboSetRemote myRFQLineSetRemote = getMboSet("RFQLINE");
if (!myRFQLineSetRemote.isEmpty()) {
myRFQLineSetRemote.copy(newRFQRemote.getMboSet("RFQLINE"));
}
MboSetRemote myRFQVendorSetRemote = getMboSet("RFQVENDOR");
if (!myRFQVendorSetRemote.isEmpty()) {
myRFQVendorSetRemote.copy(newRFQRemote.getMboSet("RFQVENDOR"));
}
MboSetRemote myRFQTermSetRemote = getMboSet("RFQTERM");
if (!myRFQTermSetRemote.isEmpty()) {
myRFQTermSetRemote.copy(newRFQRemote.getMboSet("RFQTERM"));
}
return newRFQRemote;
}
private static void loadSkipFieldCopyHashSet()
throws MXException, RemoteException
{
isHashSetLoaded = true;
skipFieldCopy.add("CHANGEBY");
skipFieldCopy.add("CHANGEDATE");
skipFieldCopy.add("CLOSEONDATE");
skipFieldCopy.add("ENTERBY");
skipFieldCopy.add("ENTERDATE");
skipFieldCopy.add("HISTORYFLAG");
skipFieldCopy.add("ORGID");
skipFieldCopy.add("PRINTDATE");
skipFieldCopy.add("REPLYDATE");
skipFieldCopy.add("REQUESTEDBY");
skipFieldCopy.add("REQUIREDDATE");
skipFieldCopy.add("RFQNUM");
skipFieldCopy.add("SITEID");
skipFieldCopy.add("STATUS");
skipFieldCopy.add("STATUSDATE");
}
protected boolean skipCopyField(MboValueInfo mvi)
throws RemoteException, MXException
{
if (skipFieldCopy.contains(mvi.getName()))
return true;
return false;
}
public void copySpareParts(MboSetRemote sparePartSet)
throws MXException, RemoteException
{
String[] srcAttr = { "itemnum", "itemsetid" };
String[] destAttr = { "itemnum", "itemsetid" };
MboSetRemote rfqLineSet = getMboSet("RFQLINE");
rfqLineSet.copy(sparePartSet, srcAttr, destAttr);
}
private void checkInprgStatus(String message)
throws MXException, RemoteException
{
String status = "INPRG";
String currentStat = getTranslator().toInternalString("RFQSTAT", getString("status"));
if (!currentStat.equalsIgnoreCase(status))
{
Object[] params = { status };
throw new MXApplicationException("rfq", message, params);
}
}
public void initRelationship(String relationName, MboSetRemote mboSet)
throws MXException, RemoteException
{
if (toBeAdded()) {
return;
}
super.initRelationship(relationName, mboSet);
setRelatedMboEditibility(relationName, mboSet);
}
public void setRelatedMboEditibility(String relationName, MboSetRemote mboSet)
throws MXException, RemoteException
{
if (getBoolean("HistoryFlag"))
{
setFlag(7L, true);
if (!(mboSet instanceof RFQChangeStatusSet))
mboSet.setFlag(7L, true);
}
}
private boolean canEditRelatedRFQ()
throws MXException, RemoteException
{
String internalRFQStatus = getInternalStatus();
if (internalRFQStatus.equalsIgnoreCase("INPRG")) {
return true;
}
return false;
}
public void changeStatus(String status, Date date, String memo, long accessModifier)
throws MXException, RemoteException
{
MXException caughtException = null;
MboSet thisMboSet = (MboSet)getThisMboSet();
Object[] params = { getString("RFQNUM"), status };
if (BidiUtils.isBidiEnabled()) {
params[0] = BidiUtils.buildAndPush(getMboSetInfo(), "RFQNUM", (String)params[0], getUserInfo().getLangCode());
params[1] = BidiUtils.buildAndPush("", "", status, getUserInfo().getLangCode());
}
try
{
super.changeStatus(status, date, memo, accessModifier);
}
catch (Throwable thrownObject)
{
caughtException = new MXApplicationException("rfq", "StatusChangeFailure", params, thrownObject);
throw caughtException;
}
thisMboSet.addWarning(new MXApplicationException("rfq", "StatusChangeSuccess", params));
}
private void copyRFQFromPR(MboRemote fromPR)
throws MXException, RemoteException
{
if (getString("description").equals(""))
setValue("description", fromPR.getString("description"), 2L);
if (getString("description_longdescription").equals(""))
setValue("description_longdescription", fromPR.getString("description_longdescription"), 2L);
if (getDouble("priority") == 0.0D)
setValue("priority", fromPR.getString("priority"), 2L);
if (getString("requestedby").equals(getUserInfo().getPersonId()))
setValue("requestedby", fromPR.getString("requestedby"), 2L);
if (getString("requireddate").equals(""))
setValue("requireddate", fromPR.getString("requireddate"), 2L);
if (getString("fob").equals(""))
setValue("fob", fromPR.getString("fob"), 2L);
if (getString("freightterms").equals(""))
setValue("freightterms", fromPR.getString("freightterms"), 2L);
if (getString("freightterms_longdescription").equals(""))
setValue("freightterms_longdescription", fromPR.getString("freightterms_longdescription"), 2L);
if (getString("paymentterms").equals(""))
setValue("paymentterms", fromPR.getString("paymentterms"), 2L);
if (getString("shipvia").equals(""))
setValue("shipvia", fromPR.getString("shipvia"), 2L);
if (getString("rfq1").equals(""))
setValue("rfq1", fromPR.getString("pr1"), 2L);
if (getString("rfq2").equals(""))
setValue("rfq2", fromPR.getString("pr2"), 2L);
if (getString("rfq3").equals(""))
setValue("rfq3", fromPR.getString("pr3"), 2L);
if (getString("rfq4").equals(""))
setValue("rfq4", fromPR.getString("pr4"), 2L);
if (getString("rfq5").equals(""))
setValue("rfq5", fromPR.getString("pr5"), 2L);
if (getString("rfq6").equals(""))
setValue("rfq6", fromPR.getString("pr6"), 2L);
if (getString("rfq7").equals(""))
setValue("rfq7", fromPR.getString("pr7"), 2L);
if (getString("rfq8").equals(""))
setValue("rfq8", fromPR.getString("pr8"), 2L);
if (getString("rfq9").equals(""))
setValue("rfq9", fromPR.getString("pr9"), 2L);
if (getString("rfq10").equals(""))
setValue("rfq10", fromPR.getString("pr10"), 2L);
}
public void initFieldFlagsOnMbo(String attrName)
throws MXException
{
if (toBeAdded())
return;
if (getOwner() != null)
return;
try
{
super.initFieldFlagsOnMbo(attrName);
if ((!getInternalStatus().equals("SENT")) && (!getInternalStatus().equals("READY")) && (!getInternalStatus().equals("COMP")))
return;
if (getInternalStatus().equals("COMP") &&
(this.getUserName().equalsIgnoreCase(getString("ENTERBY")) || this.getUserName().equalsIgnoreCase("MAXADMIN"))) { //߼
return;
}
setFieldFlag(attrName, 7L, true);
}
catch (RemoteException rx)
{
rx.printStackTrace();
}
}
}
\ No newline at end of file
...@@ -41,7 +41,6 @@ public class ImgLib extends Mbo ...@@ -41,7 +41,6 @@ public class ImgLib extends Mbo
getMboValue("imglibid").generateUniqueID(); getMboValue("imglibid").generateUniqueID();
if ("WORKORDER".equalsIgnoreCase(ownerMbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(ownerMbo.getName())) { if ("WORKORDER".equalsIgnoreCase(ownerMbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(ownerMbo.getName())) {
MboSetRemote msr1 = ownerMbo.getMboSet("IMGLIB1"); MboSetRemote msr1 = ownerMbo.getMboSet("IMGLIB1");
MboSetRemote msr2 = ownerMbo.getMboSet("IMGLIB2"); MboSetRemote msr2 = ownerMbo.getMboSet("IMGLIB2");
if (!msr1.isEmpty()) { if (!msr1.isEmpty()) {
......
...@@ -147,14 +147,22 @@ public class RecordImage extends BoundComponentInstance { ...@@ -147,14 +147,22 @@ public class RecordImage extends BoundComponentInstance {
} }
if ("WORKORDER".equalsIgnoreCase(mbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(mbo.getName())) { if ("WORKORDER".equalsIgnoreCase(mbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(mbo.getName())) {
String udimageCount = this.getProperty("udimagecount"); // String udimageCount = this.getProperty("udimagecount");
if ("1".equals(udimageCount)) { // if ("1".equals(udimageCount)) {
mimetype = mbo.getString("IMGLIB1.MIMETYPE"); // mimetype = mbo.getString("IMGLIB1.MIMETYPE");
} else if ("2".equals(udimageCount)) { // } else if ("2".equals(udimageCount)) {
mimetype = mbo.getString("IMGLIB2.MIMETYPE"); // mimetype = mbo.getString("IMGLIB2.MIMETYPE");
} else { // } else {
mimetype = mbo.getString("IMGLIB1.MIMETYPE"); // mimetype = mbo.getString("IMGLIB1.MIMETYPE");
// }
String reName =this.getId();
if(reName.indexOf("-")>=0){
reName = reName.split("-")[0];
} }
System.out.println("reName:"+reName);
mimetype = mbo.getString(reName+".MIMETYPE");
} else { } else {
mimetype = imagedb.getMbo().getString("IMGLIB.MIMETYPE"); mimetype = imagedb.getMbo().getString("IMGLIB.MIMETYPE");
} }
...@@ -179,14 +187,21 @@ public class RecordImage extends BoundComponentInstance { ...@@ -179,14 +187,21 @@ public class RecordImage extends BoundComponentInstance {
if (!imagedb.getMbo().isNull("IMGLIB.IMAGE")) { if (!imagedb.getMbo().isNull("IMGLIB.IMAGE")) {
MboRemote mbo = imagedb.getMbo(); MboRemote mbo = imagedb.getMbo();
if ("WORKORDER".equalsIgnoreCase(mbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(mbo.getName())) { if ("WORKORDER".equalsIgnoreCase(mbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(mbo.getName())) {
udimageCount = this.getProperty("udimagecount"); // udimageCount = this.getProperty("udimagecount");
if ("1".equals(udimageCount)) { // if ("1".equals(udimageCount)) {
image = mbo.getBytes("IMGLIB1.IMAGE"); // image = mbo.getBytes("IMGLIB1.IMAGE");
} else if ("2".equals(udimageCount)) { // } else if ("2".equals(udimageCount)) {
image = mbo.getBytes("IMGLIB2.IMAGE"); // image = mbo.getBytes("IMGLIB2.IMAGE");
} else { // } else {
image = mbo.getBytes("IMGLIB1.IMAGE"); // image = mbo.getBytes("IMGLIB1.IMAGE");
// }
String reName =this.getId();
if(reName.indexOf("-")>=0){
reName = reName.split("-")[0];
} }
System.out.println("reName:"+reName);
image = mbo.getBytes(reName+".IMAGE");
} else { } else {
image = imagedb.getMbo().getBytes("IMGLIB.IMAGE"); image = imagedb.getMbo().getBytes("IMGLIB.IMAGE");
} }
...@@ -222,14 +237,21 @@ public class RecordImage extends BoundComponentInstance { ...@@ -222,14 +237,21 @@ public class RecordImage extends BoundComponentInstance {
String udimageCount; String udimageCount;
if (!e.isNull("IMGLIB.IMAGE")) { if (!e.isNull("IMGLIB.IMAGE")) {
if ("WORKORDER".equalsIgnoreCase(e.getName()) || "SAFETYADVICE".equalsIgnoreCase(e.getName())) { if ("WORKORDER".equalsIgnoreCase(e.getName()) || "SAFETYADVICE".equalsIgnoreCase(e.getName())) {
udimageCount = this.getProperty("udimagecount"); // udimageCount = this.getProperty("udimagecount");
if ("1".equals(udimageCount)) { // if ("1".equals(udimageCount)) {
image = e.getBytes("IMGLIB1.IMAGE"); // image = e.getBytes("IMGLIB1.IMAGE");
} else if ("2".equals(udimageCount)) { // } else if ("2".equals(udimageCount)) {
image = e.getBytes("IMGLIB2.IMAGE"); // image = e.getBytes("IMGLIB2.IMAGE");
} else { // } else {
image = e.getBytes("IMGLIB1.IMAGE"); // image = e.getBytes("IMGLIB1.IMAGE");
// }
String reName =this.getId();
if(reName.indexOf("-")>=0){
reName = reName.split("-")[0];
} }
System.out.println("reName:"+reName);
image = e.getBytes(reName+".IMAGE");
} else { } else {
image = e.getBytes("IMGLIB.IMAGE"); image = e.getBytes("IMGLIB.IMAGE");
} }
...@@ -259,7 +281,7 @@ public class RecordImage extends BoundComponentInstance { ...@@ -259,7 +281,7 @@ public class RecordImage extends BoundComponentInstance {
AppInstance app = clientSession.getCurrentApp(); AppInstance app = clientSession.getCurrentApp();
DataBean imagedb = app.getDataBean(dataSrc); DataBean imagedb = app.getDataBean(dataSrc);
MboRemote mbo = imagedb.getMbo(); MboRemote mbo = imagedb.getMbo();
if ("WORKORDER".equalsIgnoreCase(mbo.getName())) { if ("WORKORDER".equalsIgnoreCase(mbo.getName()) || "SAFETYADVICE".equalsIgnoreCase(mbo.getName())) {
if (!"".equals(this.cachedImageSrc)) { if (!"".equals(this.cachedImageSrc)) {
app.openURL(clientSession.getMaximoRequestContextURL() + this.cachedImageSrc + "?" + clientSession.getUISessionUrlParameter(), true); app.openURL(clientSession.getMaximoRequestContextURL() + this.cachedImageSrc + "?" + clientSession.getUISessionUrlParameter(), true);
} }
......
package tohi.app.crontask;
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 psdi.server.MXServer;
import psdi.server.SimpleCronTask;
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();//前三年
oldDate.add(Calendar.YEAR, -1);
old1Date.add(Calendar.YEAR, -2);
old2Date.add(Calendar.YEAR, -3);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String s=sdf.format(nowDate.getTime());
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;// 创建一个结果集对象
PreparedStatement pre1 = null;
try {
con = MXServer.getMXServer().getDBManager().getSequenceConnection();
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();// 执行查询,注意括号中不需要再加参数
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==2) {//前两年
sql1="update matusetrans set ISSUE2YRAGO = "+count+" where itemnum='"+itemnum+"'";
}
if (num==3) {//前三年
sql1="update matusetrans set ISSUE3YRAGO = "+count+" where itemnum='"+itemnum+"'";
}
pre1=con.prepareStatement(sql1);
pre1.execute();
}
System.out.println("库存近一二三年记录更新完成-----");
} catch (RemoteException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws ClassNotFoundException {
//获取执行sql语句的statement对象
Calendar nowDate=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);
old2Date.add(Calendar.YEAR, -3);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String s=sdf.format(nowDate.getTime());
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;// 创建一个结果集对象
PreparedStatement pre1 = null;
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//获取与数据库连接的对象-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("连接成功!");
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();// 执行查询,注意括号中不需要再加参数
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 INVENTORY set ISSUE1YRAGO = "+-count+" where itemnum='"+itemnum+"'";
}
if (num==2) {//前两年
sql1="update INVENTORY set ISSUE2YRAGO = "+-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("更新完成-----");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
package tohi.app.crontask;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Date;
import org.springframework.util.StringUtils;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.server.SimpleCronTask;
import psdi.util.StringUtility;
/**
* 同步巡检异常结果
*
*/
public class SynTime_XJYCJG extends SimpleCronTask {
@Override
public void cronAction() {
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象,一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
PreparedStatement pre1 = null;
try {
con = MXServer.getMXServer().getDBManager().getSequenceConnection();// 获取连接
System.out.println("连接成功!");
String sql = " select MEASUREPOINT.metername, "
+ " METER.METERTYPE, " + " MEASUREPOINT.NORMALVALUE, "
+ " MEASUREPOINT.UPPERWARNING , "
+ " MEASUREPOINT.LOWERWARNING, "
+ " MEASUREMENT.observation , "
+ " MEASUREMENT.measurementid , "
+ " MEASUREMENT.ifsynchronous , "
+ " MEASUREMENT.location , "
+ " MEASUREMENT.measurementvalue , "
+ " MEASUREMENT.pointnum , "
+ " MEASUREMENT.inspector , "
+ " MEASUREMENT.measuredate , MEASUREMENT.rtinspcnum , "
+ " MEASUREMENT.siteid , MEASUREMENT.orgid " + " from "
+ " MEASUREPOINT,METER,MEASUREMENT "
+ " where MEASUREPOINT.metername= METER.metername "
+ " and MEASUREMENT.metername= METER.metername "
+ " and IFSYNCHRONOUS=0 ";
pre = con.prepareStatement(sql);// 实例化预编译语句
result = pre.executeQuery();// 执行查询,注意括号中不需要再加参数
while (result.next()) {
String metername = result.getString("metername");
String metertype = result.getString("metertype");
String normalvalue = result.getString("NORMALVALUE");
String maxvalue = result.getString("UPPERWARNING");
String minvalue = result.getString("LOWERWARNING");
String observation = result.getString("observation");
Long measurementid = result.getLong("measurementid");
// 需要新增变量
String location = result.getString("location");
Double measurementvalue = result.getDouble("measurementvalue");
String inspector = result.getString("inspector");
Date measuredate = result.getDate("measuredate");
String rtinspcnum = result.getString("rtinspcnum");
String siteid = result.getString("siteid");
String orgid = result.getString("orgid");
boolean flag = false;
if (metertype.equalsIgnoreCase("CHARACTERISTIC")) { // 非数值类型
if (!StringUtility.isEmpty(normalvalue)) {
if (!normalvalue.equalsIgnoreCase(observation)) { // 如果是相同类型则正常
flag = true;
}
}
}
if (metertype.equalsIgnoreCase("GAUGE")) { // 数值类型
if (StringUtility.isEmpty(minvalue)
&& StringUtility.isEmpty(maxvalue)) {
continue;
}
if ( !StringUtility.isEmpty(minvalue)
&& !StringUtility.isEmpty(maxvalue)) {
if (measurementvalue < Double.parseDouble(minvalue)
|| measurementvalue > Double
.parseDouble(maxvalue)) { // 生成记录
flag = true;
}
} else if (!StringUtility.isEmpty(minvalue)
&& StringUtility.isEmpty(maxvalue)) {
if (measurementvalue < Double.parseDouble(minvalue)) { // 生成记录
flag = true;
}
} else if (StringUtility.isEmpty(minvalue)
&& !StringUtility.isEmpty(maxvalue)) {
if (measurementvalue > Double.parseDouble(maxvalue)) { // 生成记录
flag = true;
}
}
}
if (flag) {
MboSetRemote mboSet = MXServer.getMXServer().getMboSet(
"RTINSPNRECOR",
MXServer.getMXServer().getSystemUserInfo());
MboRemote mbo = mboSet.add();
mbo.setValue("observation", observation, 11L);
mbo.setValue("metername", metername, 11L);
mbo.setValue("location", location, 11L);
mbo.setValue("measurementvalue", measurementvalue, 11L);
mbo.setValue("inspector", inspector, 11L);
mbo.setValue("measuredate", measuredate, 11L);
mbo.setValue("rtinspcnum", rtinspcnum, 11L);
mbo.setValue("siteid", siteid, 11L);
mbo.setValue("orgid", orgid, 11L);
mbo.setValue("PROCESSRESULT", "待处理", 11L);
mboSet.save();
mboSet.close();
MboSetRemote mboSet1 = MXServer.getMXServer().getMboSet(
"MEASUREMENT",
MXServer.getMXServer().getSystemUserInfo());
mboSet1.setWhere(" MEASUREMENTID="+ measurementid + " ");
mboSet1.getMbo(0).setValue("IFSYNCHRONOUS", "1");
mboSet1.save();
System.out.println(measurementid + "完成同步,修改状态");
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// 逐一将上面的几个对象关闭,因为不关闭的话会影响性能、并且占用资源
// 注意关闭的顺序,最后使用的最先关闭
if (result != null)
result.close();
if (pre != null)
pre.close();
if (pre1 != null)
pre1.close();
if (con != null)
con.close();
System.out.println("数据库连接已关闭!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
package tohi.app.measurement;
import java.rmi.RemoteException;
import psdi.mbo.ALNDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;
public class FldObservation extends ALNDomain
{
public FldObservation(MboValue mbv)
throws MXException
{
super(mbv);
String thisAttr = getMboValue().getAttributeName();
MboRemote mbo=this.mboValue.getMbo();
String DOMAINID="";
try {
DOMAINID= mbo.getString("METER.DOMAINID");
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setRelationship("ALNDOMAIN", "domainid = '"+DOMAINID+"' and value = :" + thisAttr);
setErrorMessage("meter", "invalidForMeterDomain");
}
public MboSetRemote getList()
throws MXException, RemoteException
{
MboRemote mbo=this.mboValue.getMbo();
String DOMAINID="";
try {
DOMAINID= mbo.getString("METER.DOMAINID");
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setListCriteria("(domainid = '"+DOMAINID+"')");
return super.getList();
}
}
\ No newline at end of file
...@@ -26,4 +26,5 @@ public class FloodpreventionMbo extends Mbo implements MboRemote{ ...@@ -26,4 +26,5 @@ public class FloodpreventionMbo extends Mbo implements MboRemote{
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
package tohi.app.rlmainthing;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
public class FldrlmainthingType extends MboValueAdapter{
public FldrlmainthingType() {
super();
}
public FldrlmainthingType(MboValue mbv) {
super(mbv);
}
@Override
public void initValue() throws MXException, RemoteException {
super.initValue();
MboRemote mbo=this.mboValue.getMbo();
if (this.mboValue.getString().equalsIgnoreCase("INSPECTION")) {
mbo.setFieldFlag("CONTENT1",this.HIDDEN, false);
System.out.println("in----1");
}else{
mbo.setFieldFlag("CONTENT1",this.HIDDEN, true);
System.out.println("in----2");}
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo=this.mboValue.getMbo();
if (this.mboValue.getString().equalsIgnoreCase("INSPECTION")) {
mbo.setFieldFlag("CONTENT1",this.HIDDEN, false);
System.out.println("in----1");
}else{
mbo.setFieldFlag("CONTENT1",this.HIDDEN, true);
System.out.println("in----2");}
}
}
...@@ -30,7 +30,7 @@ public class RlshiftsMbo extends Mbo implements MboRemote{ ...@@ -30,7 +30,7 @@ public class RlshiftsMbo extends Mbo implements MboRemote{
protected void save() throws MXException, RemoteException { protected void save() throws MXException, RemoteException {
super.save(); super.save();
if (toBeAdded()) { if (toBeAdded()) {
String num=genKeyNum(); String num=genKeyNum();//202208
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("RLSHIFTS",MXServer.getMXServer().getSystemUserInfo()); MboSetRemote mboSet=MXServer.getMXServer().getMboSet("RLSHIFTS",MXServer.getMXServer().getSystemUserInfo());
mboSet.setWhere("SHIFTNUM = '"+num+"'"); mboSet.setWhere("SHIFTNUM = '"+num+"'");
if (mboSet.count()!=0) { if (mboSet.count()!=0) {
...@@ -40,7 +40,7 @@ public class RlshiftsMbo extends Mbo implements MboRemote{ ...@@ -40,7 +40,7 @@ public class RlshiftsMbo extends Mbo implements MboRemote{
} }
} }
public String genKeyNum() throws RemoteException, MXException{ public String genKeyNum() throws RemoteException, MXException{
SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat sdf =new SimpleDateFormat("yyyyMMdd"); //202208
String num=""; String num="";
if ( getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班 if ( getString("MARKSIGN").equalsIgnoreCase("N")) { //如果是夜班
Date date=new Date(); Date date=new Date();
......
package tohi.app.rtinspnrecor;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
public class FldPerformance extends MboValueAdapter{
public FldPerformance() {
super();
}
public FldPerformance(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
MboRemote mbo= this.mboValue.getMbo();
MboSetRemote mboSet=mbo.getThisMboSet();
boolean flag=false;
for (int i = 0; i < mboSet.count(); i++) {
MboRemote m=mboSet.getMbo(i);
if (m.getString("PERFORMANCE").equalsIgnoreCase("NO") && m.getString("CRUXMEASURES").equalsIgnoreCase("Y") ) {
flag=true;
break;
}
}
if (flag) {
System.out.println("");
mbo.getOwner().setValue("ISSIF", "1",11L);
}else{
System.out.println("");
mbo.getOwner().setValue("ISSIF", "0",11L);
}
}
}
package tohi.app.workflow;
/**
* 判断相关工单记录是否关闭
*/
import java.rmi.RemoteException;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class CustIsCloseWorkAction implements ActionCustomClass {
public CustIsCloseWorkAction() {
super();
}
@Override
public void applyCustomAction(MboRemote mbo, Object[] arg1)
throws MXException, RemoteException {
MboSetRemote mboSet=mbo.getMboSet("EXISTSWORKINFO");
if (!mboSet.isEmpty()) {
throw new MXApplicationException("许可证", "产生相关的日常行为观察或巡查记录未全部关闭!!!!");
}
}
}
package tohi.app.workflow; package tohi.app.workflow;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import psdi.common.action.ActionCustomClass; import psdi.common.action.ActionCustomClass;
...@@ -22,131 +24,167 @@ public class CustWorkSheetAction implements ActionCustomClass { ...@@ -22,131 +24,167 @@ public class CustWorkSheetAction implements ActionCustomClass {
mbo.getUserInfo()); mbo.getUserInfo());
if (mbo.getString("PJOTYPE").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR" , 11L);// 观察地点
genTypeInfo("PJOTYPE", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE1").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE1").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE1", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE1", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE1", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE2").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE2").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE2", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE2", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE2", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE3").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE3").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE3", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE3", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE3", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE4").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE4").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE4", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE4", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE4", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE5").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE5").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE5", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE5", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE5", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE6").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE6").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE6", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE6", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE6", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE7").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE7").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE7", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE7", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE7", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE8").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE8").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE8", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE8", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE8", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE9").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE9").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE9", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE9", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE9", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
if (mbo.getString("PJOTYPE10").equalsIgnoreCase("Y")) { if (mbo.getString("PJOTYPE10").equalsIgnoreCase("Y")) {
MboRemote pjombo = PJOOBSERVATIONSet.add(11L); MboRemote pjombo = PJOOBSERVATIONSet.add(11L);
pjombo.setValue("PJOTYPE", "PJOTYPE10", 11L); pjombo.setValue("PJOTYPE", "PJOTYPE10", 2L);
pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L); pjombo.setValue("WSNUM", mbo.getString("WSNUM"), 11L);
pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容 pjombo.setValue("JOBCONTENT", mbo.getString("WORKDESC"), 11L);// 工作内容
pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人 pjombo.setValue("WORKTASK", mbo.getString("EVACUATEDBY"), 11L);// 工作负责人
pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点 pjombo.setValue("PJOPLACE", mbo.getString("WORKPLACE"), 11L);// 观察地点
pjombo.setValue("STATUS", "WAPPR", 11L);// 观察地点
genTypeInfo("PJOTYPE10", pjombo);
PJOOBSERVATIONSet.save(); PJOOBSERVATIONSet.save();
} }
PJOOBSERVATIONSet.close(); PJOOBSERVATIONSet.close();
} }
public void genTypeInfo(String pjoType,MboRemote mbo) throws RemoteException, MXException{
MboSetRemote PJOOBSERVATIONLINSet=mbo.getMboSet("PJOOBSERVATIONLIN");
PJOOBSERVATIONLINSet.deleteAll(11L);
MboSetRemote pjoContentSet=MXServer.getMXServer().getMboSet("PJOCONTENT",mbo.getUserInfo());
pjoContentSet.setWhere("pjotype = '"+pjoType+"'");
for (int i = 0; i < pjoContentSet.count(); i++) {
MboRemote contentMbo=pjoContentSet.getMbo(i);
MboRemote PJOOBSERVATIONLIN=PJOOBSERVATIONLINSet.add(11L);
PJOOBSERVATIONLIN.setValue("PJOOBSERVATIONID", mbo.getLong("PJOOBSERVATIONID"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("pjocontent", contentMbo.getString("pjocontent"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("PJOTYPE", contentMbo.getString("PJOTYPE"),11L);//设定关系
PJOOBSERVATIONLIN.setValue("PJONUM", contentMbo.getString("PJONUM"),11L);//设定关系
pjoContentSet.save();
}
pjoContentSet.close();
System.out.println("保存完毕--");
}
} }
package tohi.app.worksheet;
import java.rmi.RemoteException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class FldworksheetPjotype extends MboValueAdapter{
public FldworksheetPjotype() {
super();
}
public FldworksheetPjotype(MboValue mbv) {
super(mbv);
}
@Override
public void init() throws MXException, RemoteException {
// TODO Auto-generated method stub
super.init();
MboRemote mbo=this.getMboValue().getMbo();
System.out.println(this.getMboValue().getString());
if (this.getMboValue().getAttributeName().equalsIgnoreCase("PJOTYPE11") ) {
if ( this.getMboValue().getString().equalsIgnoreCase("Y")) {
System.out.println("1111111");
for (int i = 0; i < 11; i++) {
if (i==0) {
mbo.setFieldFlag("PJOTYPE", 7L,true);
}else{
mbo.setFieldFlag("PJOTYPE"+i, 7L,true);
}
}
}
if ( this.getMboValue().getString().equalsIgnoreCase("N")) {
System.out.println("2222222");
for (int i = 0; i < 11; i++) {
if (i==0) {
mbo.setFieldFlag("PJOTYPE", 7L,false);
}else{
mbo.setFieldFlag("PJOTYPE"+i, 7L,false);
}
}
}
}else {
boolean flag=false;
for (int i = 0; i < 11; i++) {
if (i==0) {
if (mbo.getString("PJOTYPE").equalsIgnoreCase("Y")) {
flag=true;
break;
}
}else{
if (mbo.getString("PJOTYPE"+i).equalsIgnoreCase("Y")) {
flag=true;
break;
}
}
}
if (flag) {
mbo.setFieldFlag("PJOTYPE11", 7L,true);
}else{
mbo.setFieldFlag("PJOTYPE11", 7L,false);
}
}
}
@Override
public void action() throws MXException, RemoteException {
super.action();
String name=this.getMboValue().getAttributeName();
MboRemote mbo=this.getMboValue().getMbo();
if (!name.equalsIgnoreCase("PJOTYPE11") ) {
if (mbo.getString("PJOTYPE11").equalsIgnoreCase("Y")) {
throw new MXApplicationException("异常巡检处理", "不适用请勿勾选!!!");
}
}else{
boolean flag=false;
for (int i = 0; i < 11; i++) {
if (i==0) {
if (mbo.getString("PJOTYPE").equalsIgnoreCase("Y")) {
flag=true;
break;
}
}else{
if (mbo.getString("PJOTYPE"+i).equalsIgnoreCase("Y")) {
flag=true;
break;
}
}
}
if (flag) {
throw new MXApplicationException("异常巡检处理", "已勾选其他项,请勿勾选不适用!!!");
}
}
}
}
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