Commit 1048cc5e authored by zhonghonghui's avatar zhonghonghui

'更新xxx'

parent 8e5b5f76
package com.tohi.app.compaccept;
import java.rmi.RemoteException;
import java.util.HashSet;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboValueInfo;
import psdi.util.MXException;
public class CompAcceptLineMbo extends Mbo implements MboRemote {
private static HashSet skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
public CompAcceptLineMbo(MboSet ms) throws RemoteException {
super(ms);
......@@ -23,5 +27,18 @@ public class CompAcceptLineMbo extends Mbo implements MboRemote {
setValue("UDCOMPACCEPTID",owner.getUniqueIDValue(),2L);
setValue("linenum",String.valueOf(this.getThisMboSet().count(16)+1),2L);
}
protected boolean skipCopyField(MboValueInfo mvi) throws MXException, RemoteException {
loadSkipFieldCopyHashSet();
return skipFieldCopy.contains(mvi.getName());
}
private static void loadSkipFieldCopyHashSet() throws MXException, RemoteException {
isHashSetLoaded = true;
skipFieldCopy.add("ORGID");
skipFieldCopy.add("SITEID");
skipFieldCopy.add("UDCOMPACCEPTID");
}
public static HashSet getHashSet() throws MXException, RemoteException {
return skipFieldCopy;
}
}
\ No newline at end of file
package com.tohi.app.compaccept;
import java.rmi.RemoteException;
import java.util.HashSet;
import com.tohi.util.Common;
......@@ -8,6 +9,7 @@ import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueInfo;
import psdi.mbo.SqlFormat;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
......@@ -15,6 +17,8 @@ import psdi.util.MXException;
public class CompAcceptMbo extends Mbo implements MboRemote {
private boolean isModified = false;
private static HashSet skipFieldCopy = new HashSet();
private static boolean isHashSetLoaded = false;
public CompAcceptMbo(MboSet ms) throws RemoteException {
super(ms);
......@@ -182,4 +186,67 @@ public class CompAcceptMbo extends Mbo implements MboRemote {
mbosetremote.close();
return flag;
}
public MboRemote duplicate() throws MXException, RemoteException {
if (!isHashSetLoaded) {
loadSkipFieldCopyHashSet();
}
MboRemote mboremote = copy();
MboSetRemote toollogline = getMboSet("UDCOMPACCEPTLINE");
if (!toollogline.isEmpty()) {
toollogline.copy(mboremote.getMboSet("UDCOMPACCEPTLINE"));
}
return mboremote;
}
protected boolean skipCopyField(MboValueInfo mvi) throws MXException, RemoteException {
return skipFieldCopy.contains(mvi.getName());
}
private static void loadSkipFieldCopyHashSet() throws MXException, RemoteException {
isHashSetLoaded = true;
skipFieldCopy.add("ORGID");
skipFieldCopy.add("SITEID");
skipFieldCopy.add("CHANGEBY");
skipFieldCopy.add("CHANGEDATE");
skipFieldCopy.add("ACCEPTBY");
skipFieldCopy.add("CREATEDATE");
skipFieldCopy.add("STATUS");
skipFieldCopy.add("DEPT");
skipFieldCopy.add("HISTORYFLAG");
// skipFieldCopy.add("CONTNUM");
// skipFieldCopy.add("PONUM");
// skipFieldCopy.add("VENDOR");
skipFieldCopy.add("ACCEPTTOTAL1");
skipFieldCopy.add("ACCEPTCOST");
skipFieldCopy.add("PAYTOTAL1");
skipFieldCopy.add("PAYCOST");
// skipFieldCopy.add("CONCLUSION");
skipFieldCopy.add("SIGNPERSON1");
skipFieldCopy.add("SIGNPERSON2");
skipFieldCopy.add("SIGNPERSON3");
skipFieldCopy.add("SIGNPERSON4");
skipFieldCopy.add("SIGNPERSON8");
skipFieldCopy.add("SIGNDATE1");
skipFieldCopy.add("SIGNDATE2");
skipFieldCopy.add("SIGNDATE3");
skipFieldCopy.add("SIGNDATE4");
skipFieldCopy.add("SIGNDATE8");
// skipFieldCopy.add("STARTDATE");
// skipFieldCopy.add("ENDDATE");
skipFieldCopy.add("LINEADVISE1");
skipFieldCopy.add("LINEADVISE2");
skipFieldCopy.add("SIGNPERSON6");
skipFieldCopy.add("SIGNDATE6");
skipFieldCopy.add("SHEAPPRBY");
skipFieldCopy.add("LINEADVISE3");
// skipFieldCopy.add("LINEADVISE4");
skipFieldCopy.add("LINEADVISE5");
}
public static HashSet getHashSet() throws MXException, RemoteException {
return skipFieldCopy;
}
}
\ No newline at end of file
package com.tohi.app.crontask.fincntrl;
public class Fincntrl {
private Long fincntrlid;
private String projectid;
private Long parentfincntrlid;
public Long getFincntrlid() {
return fincntrlid;
}
public void setFincntrlid(Long fincntrlid) {
this.fincntrlid = fincntrlid;
}
public String getProjectid() {
return projectid;
}
public void setProjectid(String projectid) {
this.projectid = projectid;
}
public Long getParentfincntrlid() {
return parentfincntrlid;
}
public void setParentfincntrlid(Long parentfincntrlid) {
this.parentfincntrlid = parentfincntrlid;
}
}
package com.tohi.app.crontask.fincntrl;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import psdi.server.SimpleCronTask;
public class UpdateFinCrontask extends SimpleCronTask{
private static Connection conn=null;
private static Statement stat=null;
private static ResultSet rs=null;
// public static Connection getConn() throws RemoteException, MXException {
// List<Fincntrl> list=new ArrayList<Fincntrl>();
// MboSetRemote FincntrlSet=MXServer.getMXServer().getMboSet("FINCNTRL",MXServer.getMXServer().getSystemUserInfo() );
// FincntrlSet.setWhere(" startdate is not null and fcstatus ='APPR' and parentfincntrlid is not null ");
//
// for (int i = 0; i < FincntrlSet.count(); i++) {
// MboRemote finMbo=FincntrlSet.getMbo(i);
// Fincntrl f=new Fincntrl();
// f.setProjectid(finMbo.getString("Projectid"));
// f.setFincntrlid(finMbo.getLong("Fincntrlid"));
// f.setParentfincntrlid(finMbo.getLong("Parentfincntrlid"));
// list.add(f);
// }
// for (int i = 0; i < list.size(); i++) {
// Fincntrl f=list.get(i);//获取费用预算ID
// String sql="";
// sql = "UPDATE fincntrl SET pendingcost = ISNULL((SELECT SUM(ISNULL(prline.linecost, 0)) AS COST FROM prline INNER JOIN pr ON prline.prnum = pr.prnum INNER JOIN fincntrl AS a ON prline.rl2 = a.projectid "
// + " WHERE " + " prline.rl2 in ('"+f.getProjectid()+"') and prline.rl3 in ('" + f.getFincntrlid() + "')"
// + " AND ( pr.CONTRACTREFNUM is null and pr.status NOT IN ('CAN', 'CLOSE') and pr.prnum not in (select prnum from pr pr1 where pr1.prnum=pr.prnum and status in ('COMP','CAN') ) ) AND "
// + "(a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') AND "
// + "(prline.ponum IS NULL ) AND (prline.contractnum IS NULL )), 0) "
// + " FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE "
// + " (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND"
// + " (p.custcalmethod = 'DETAIL') AND p.projectid in ('"
// + f.getProjectid() + "') and fincntrl.fincntrlid in ( '" +f.getFincntrlid() + "'); \n";
//
//
//
// sql =sql+ "UPDATE fincntrl SET usecost =(SELECT SUM(ISNULL(poline.linecost, 0) + ISNULL(poline.tax1, 0)) AS "
// + "COST FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN fincntrl AS a ON "
// + "poline.pl2 = a.projectid WHERE "
// + " (po.status <> 'CAN') AND (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') AND"
// + " poline.pl2 in ( '"+f.getProjectid() +"' ) and poline.pl3 in ( '"+ f.getFincntrlid() +"' )),";
//
//
// sql = sql + "CONpendingcost = ISNULL ((SELECT SUM(ISNULL(contract.cost2, 0)) AS COST FROM " +
// " (SELECT a.contractnum, a.contractlinenum, a.enterdate, a.fcg_projectid,a.fcg_taskid, a.linecost AS cost, a1.linecost AS cost1,"
// + " (CASE WHEN (ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)) > 0 THEN ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)"
// + " ELSE 0 END) AS cost2 FROM (SELECT c.contractnum, cl1.contractlinenum,"
// + " cl1.enterdate, cl1.fcg_projectid,cl1.fcg_taskid,cl1.linecost FROM "
// + " contract AS c LEFT OUTER JOIN (SELECT contractnum, revisionnum, contractlinenum, enterdate,"
// + " linecost+custtax1 linecost, fcg_projectid ,fcg_taskid FROM contractline) AS cl1 ON c.contractnum = "
// + "cl1.contractnum AND c.revisionnum = cl1.revisionnum WHERE (c.status in('DRAFT','WSTART','APPR','WAPPR'))) "
// + "AS a LEFT OUTER JOIN (SELECT poline.contractrefnum AS contractnum, CL1.contractlinenum AS CONTRACTLINENUM,"
// + " SUM(poline.linecost+poline.tax1) AS linecost FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN"
// + " contractline AS CL1 ON poline.contreflineid = CL1.contractlineid WHERE (po.status <> 'CAN') GROUP BY poline.contractrefnum, "
// + "CL1.contractlinenum) AS a1 ON a.contractnum = a1.contractnum AND a.contractlinenum = a1.CONTRACTLINENUM) AS contract INNER JOIN "
// + "fincntrl AS a ON contract.fcg_projectid = a.projectid WHERE "+
// " (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') and contract.fcg_projectid in ("
// +" '"+ f.getProjectid() +"' ) and contract.fcg_taskid in ('" + f.getFincntrlid() + "')), 0) " +
// " FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE "+
// " (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND"
// + " p.projectid in ( '"+ f.getProjectid() +"') and fincntrl.fincntrlid in ( '" + f.getFincntrlid() + "'); \n";
//
// sql = sql + " UPDATE fincntrl SET fincntrl.netcost = ISNULL(fincntrl.budgetcost, 0) + ISNULL(fincntrl.altercost, 0) " +
// " - ISNULL(fincntrl.pendingcost, 0) - ISNULL(fincntrl.conpendingcost, 0) - ISNULL(fincntrl.usecost, 0) FROM fincntrl " +
// " LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE (fincntrl.custbugettype = 'PURCHASE') " +
// " AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND p.projectid in ( '" + f.getProjectid() + "') "
// + "and fincntrl.fincntrlid in ( '"+ f.getFincntrlid() +"'); \n";
//
// System.out.println(sql);
// }
//
// return conn;
// }
public static Connection getConn1() throws RemoteException, ClassNotFoundException, SQLException {
List<Fincntrl> list=new ArrayList<Fincntrl>();
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn=DriverManager.getConnection("jdbc:sqlserver://172.17.16.31:1433;DatabaseName=maxdb7", "maximosql","Max60fcg");
String sql_2=" select fincntrlid , (select projectid from FINCNTRL where fincntrlid=f.parentfincntrlid) projectid, parentfincntrlid from "
+ " FINCNTRL f where startdate is not null and fcstatus ='APPR' and parentfincntrlid is not null ";
stat=conn.createStatement();
rs=stat.executeQuery(sql_2);
while(rs.next()){
Fincntrl f=new Fincntrl();
f.setProjectid(rs.getString("Projectid"));
f.setFincntrlid(rs.getLong("Fincntrlid"));
f.setParentfincntrlid(rs.getLong("Parentfincntrlid"));
list.add(f);
}
for (int i = 0; i < list.size(); i++) {
Fincntrl f=list.get(i);//获取费用预算ID
String sql="";
sql = "UPDATE fincntrl SET pendingcost = ISNULL((SELECT SUM(ISNULL(prline.linecost, 0)) AS COST FROM prline INNER JOIN pr ON prline.prnum = pr.prnum INNER JOIN fincntrl AS a ON prline.rl2 = a.projectid "
+ " WHERE " + " prline.rl2 in ('"+f.getProjectid()+"') and prline.rl3 in ('" + f.getFincntrlid() + "')"
+ " AND ( pr.CONTRACTREFNUM is null and pr.status NOT IN ('CAN', 'CLOSE') and pr.prnum not in (select prnum from pr pr1 where pr1.prnum=pr.prnum and status in ('COMP','CAN') ) ) AND "
+ "(a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') AND "
+ "(prline.ponum IS NULL ) AND (prline.contractnum IS NULL )), 0) "
+ " FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE "
+ " (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND"
+ " (p.custcalmethod = 'DETAIL') AND p.projectid in ('"
+ f.getProjectid() + "') and fincntrl.fincntrlid in ( '" +f.getFincntrlid() + "'); \n";
sql =sql+ "UPDATE fincntrl SET usecost =(SELECT SUM(ISNULL(poline.linecost, 0) + ISNULL(poline.tax1, 0)) AS "
+ "COST FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN fincntrl AS a ON "
+ "poline.pl2 = a.projectid WHERE "
+ " (po.status <> 'CAN') AND (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') AND"
+ " poline.pl2 in ( '"+f.getProjectid() +"' ) and poline.pl3 in ( '"+ f.getFincntrlid() +"' )),";
sql = sql + "CONpendingcost = ISNULL ((SELECT SUM(ISNULL(contract.cost2, 0)) AS COST FROM " +
" (SELECT a.contractnum, a.contractlinenum, a.enterdate, a.fcg_projectid,a.fcg_taskid, a.linecost AS cost, a1.linecost AS cost1,"
+ " (CASE WHEN (ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)) > 0 THEN ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)"
+ " ELSE 0 END) AS cost2 FROM (SELECT c.contractnum, cl1.contractlinenum,"
+ " cl1.enterdate, cl1.fcg_projectid,cl1.fcg_taskid,cl1.linecost FROM "
+ " contract AS c LEFT OUTER JOIN (SELECT contractnum, revisionnum, contractlinenum, enterdate,"
+ " linecost+custtax1 linecost, fcg_projectid ,fcg_taskid FROM contractline) AS cl1 ON c.contractnum = "
+ "cl1.contractnum AND c.revisionnum = cl1.revisionnum WHERE (c.status in('DRAFT','WSTART','APPR','WAPPR'))) "
+ "AS a LEFT OUTER JOIN (SELECT poline.contractrefnum AS contractnum, CL1.contractlinenum AS CONTRACTLINENUM,"
+ " SUM(poline.linecost+poline.tax1) AS linecost FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN"
+ " contractline AS CL1 ON poline.contreflineid = CL1.contractlineid WHERE (po.status <> 'CAN') GROUP BY poline.contractrefnum, "
+ "CL1.contractlinenum) AS a1 ON a.contractnum = a1.contractnum AND a.contractlinenum = a1.CONTRACTLINENUM) AS contract INNER JOIN "
+ "fincntrl AS a ON contract.fcg_projectid = a.projectid WHERE "+
" (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') and contract.fcg_projectid in ("
+" '"+ f.getProjectid() +"' ) and contract.fcg_taskid in ('" + f.getFincntrlid() + "')), 0) " +
" FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE "+
" (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND"
+ " p.projectid in ( '"+ f.getProjectid() +"') and fincntrl.fincntrlid in ( '" + f.getFincntrlid() + "'); \n";
sql = sql + " UPDATE fincntrl SET fincntrl.netcost = ISNULL(fincntrl.budgetcost, 0) + ISNULL(fincntrl.altercost, 0) " +
" - ISNULL(fincntrl.pendingcost, 0) - ISNULL(fincntrl.conpendingcost, 0) - ISNULL(fincntrl.usecost, 0) FROM fincntrl " +
" LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE (fincntrl.custbugettype = 'PURCHASE') " +
" AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND p.projectid in ( '" + f.getProjectid() + "') "
+ "and fincntrl.fincntrlid in ( '"+ f.getFincntrlid() +"'); \n";
stat=conn.createStatement();
stat.execute(sql);
// System.out.println(sql);
}
return conn;
}
// public static void main(String[] args) {
// try {
// getConn1();
// } catch (RemoteException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (ClassNotFoundException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (SQLException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// System.out.println("采购预算定时更新完成!!!");
// }
public void cronAction() {
try {
getConn1();
System.out.println("采购预算定时更新完成!!!");
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
......@@ -345,12 +345,12 @@ public class DltjMbo extends Mbo implements MboRemote {
// --------------------------------------------------------------------报总调-低谷----------------------------------------------------
// 报总调 (低谷)1A高厂变 = (今日7点-昨日23点)×88
public void setBZD_DG_GCB1A() throws RemoteException, MXException {
setValue("BZD_DG_GCB1A", (getDouble("DL3_7") - getDouble("LASTDAY.DL3_23")) * 88, 2L);
setValue("BZD_DG_GCB1A", (getDouble("DL3_7") - getDouble("LASTDAY.DL3_23")) * 55, 2L);
}
// 报总调 (低谷)1B高厂变 = (今日7点-昨日23点)×88
public void setBZD_DG_GCB1B() throws RemoteException, MXException {
setValue("BZD_DG_GCB1B", (getDouble("DL4_7") - getDouble("LASTDAY.DL4_23")) * 88, 2L);
setValue("BZD_DG_GCB1B", (getDouble("DL4_7") - getDouble("LASTDAY.DL4_23")) * 55, 2L);
}
// 报总调 (低谷)#1主变 = (今日7点-昨日23点)×1250
......@@ -453,12 +453,12 @@ public class DltjMbo extends Mbo implements MboRemote {
// 报总调 (高峰)1A高厂变 = (今日23点-今日7点)×88
public void setBZD_GF_GCB1A() throws RemoteException, MXException {
setValue("BZD_GF_GCB1A", (getDouble("DL3_23") - getDouble("DL3_7")) * 88, 2L);
setValue("BZD_GF_GCB1A", (getDouble("DL3_23") - getDouble("DL3_7")) * 55, 2L);
}
// 报总调 (高峰)1B高厂变 = (今日23点-今日7点)×88
public void setBZD_GF_GCB1B() throws RemoteException, MXException {
setValue("BZD_GF_GCB1B", (getDouble("DL4_23") - getDouble("DL4_7")) * 88, 2L);
setValue("BZD_GF_GCB1B", (getDouble("DL4_23") - getDouble("DL4_7")) * 55, 2L);
}
// 报总调 (低谷)#1厂用电量 = 1A高厂变+1B高厂变
......@@ -652,12 +652,12 @@ public class DltjMbo extends Mbo implements MboRemote {
// 24时-----------------------------------------------
// 报中调 1A高厂变 = (今日24点-昨日24点)×88
public void setBZD_GCB1A() throws RemoteException, MXException {
setValue("BZD_GCB1A", (getDouble("DL3_24") - getDouble("LASTDAY.DL3_24")) * 88, 2L);
setValue("BZD_GCB1A", (getDouble("DL3_24") - getDouble("LASTDAY.DL3_24")) * 55, 2L);
}
// 报中调 1B高厂变 = (今日24点-昨日24点)×88
public void setBZD_GCB1B() throws RemoteException, MXException {
setValue("BZD_GCB1B", (getDouble("DL4_24") - getDouble("LASTDAY.DL4_24")) * 88, 2L);
setValue("BZD_GCB1B", (getDouble("DL4_24") - getDouble("LASTDAY.DL4_24")) * 55, 2L);
}
// 报中调#1主变 = (今日24点-昨日24点)×1250
......
......@@ -38,7 +38,7 @@ public class FinExpenseMbo extends Mbo implements MboRemote {
if(line.toBeSaved())
{
line.setValue("actualcost", line.getDouble("budgetcost")+line.getDouble("ALTERCOST"));
line.setValue("netcost", line.getDouble("actualcost") - line.getDouble("PROJECTCOST"));
line.setValue("netcost", line.getDouble("actualcost") - line.getDouble("PROJECTCOST") - line.getDouble("pendingcost"));
}
}
......@@ -69,5 +69,5 @@ public class FinExpenseMbo extends Mbo implements MboRemote {
setValue("changeby", getUserInfo().getPersonId(), 11L);
}
}
}
\ No newline at end of file
package com.tohi.app.inbxconfig;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
import psdi.app.inbxconfig.InbxConfig;
import psdi.app.inbxconfig.InbxConfigRemote;
//import psdi.app.inbxconfig.InbxConfigSet;
import psdi.app.inbxconfig.InbxConfigSetRemote;
import psdi.app.scconfig.Layout;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetInfo;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValueData;
import psdi.mbo.MboValueInfo;
import psdi.mbo.SqlFormat;
import psdi.server.MXServer;
import psdi.util.MXException;
import psdi.util.MXFormat;
import psdi.workflow.WFAssignmentSetRemote;
public class FcgInbxConfigSet extends MboSet implements InbxConfigSetRemote {
private Vector inboxColumns;
private MboValueData[][] keyAttribData = (MboValueData[][])null;
private int noOfAssignments = 0;
private String latestDate = "";
private String inboxDescTitle = "";
public FcgInbxConfigSet(MboServerInterface ms) throws MXException, RemoteException {
super(ms);
}
protected Mbo getMboInstance(MboSet ms) throws MXException, RemoteException {
return (Mbo)new InbxConfig(ms);
}
public void setInboxColumns() throws RemoteException, MXException {
try {
Hashtable vecAttributes = getWFAssignmentColumns();
int size = vecAttributes.size();
Enumeration<String> e = vecAttributes.keys();
int i = 0;
while (e.hasMoreElements()) {
String key = e.nextElement();
MboRemote inboxconfigMbo = add();
inboxconfigMbo.setValue("INBXCOLUMN", key);
inboxconfigMbo.setValue("DESCRIPTION", (String)vecAttributes.get(key));
inboxconfigMbo.setValue("DISPLAY", false);
i++;
}
} catch (Throwable t) {
t.printStackTrace();
}
}
public Vector getColumns() throws RemoteException, MXException {
Vector<String[]> vecAttributes = new Vector();
setOrderBy("ordernum asc,description asc");
for (int i = 0;; i++) {
InbxConfigRemote inbx = (InbxConfigRemote)getMbo(i);
if (inbx == null)
break;
String[] arrColumn = new String[2];
arrColumn[0] = inbx.getString("inbxcolumn");
arrColumn[1] = inbx.getString("description");
vecAttributes.add(arrColumn);
}
return vecAttributes;
}
private Hashtable getWFAssignmentColumns() throws RemoteException, MXException {
Hashtable<Object, Object> attibutes = new Hashtable<Object, Object>();
MboSetRemote msr = MXServer.getMXServer().getMboSet("WFASSIGNMENT", getUserInfo());
MboSetInfo msi = msr.getMboSetInfo();
Iterator<MboValueInfo> fields = msi.getAttributes();
while (fields.hasNext()) {
MboValueInfo mvi = fields.next();
String sAttribute = mvi.getAttributeName();
String sTitle = mvi.getTitle();
if (sTitle == null)
sTitle = "";
attibutes.put(sAttribute, sTitle);
}
return attibutes;
}
public MboValueData[][] getAssignments(int start, int rowcount, String sortBy) throws RemoteException, MXException {
Vector columns = getInboxColumns();
String[] arrColumns = new String[columns.size()];
String[] keyColumns = { "description", "app", "assignid", "ownerid", "isownerlocked", "ownerlockedby" };
for (int i = 0; i < columns.size(); i++)
arrColumns[i] = ((String[])columns.elementAt(i))[0];
WFAssignmentSetRemote wf = (WFAssignmentSetRemote)MXServer.getMXServer().getMboSet("WFASSIGNMENT", getUserInfo());
if (!sortBy.equals(""))
wf.setOrderBy(sortBy);
wf.getInboxAssignments();
processGroupOROrder(wf,sortBy);
this.inboxDescTitle = wf.getMboValueInfoStatic("description").getTitle();
Date date = wf.latestDate("duedate");
if (date != null)
this.latestDate = MXFormat.dateTimeToString(date, getUserInfo().getLocale(), getUserInfo().getTimeZone());
this.noOfAssignments = wf.count();
MboValueData[][] keyData = wf.getMboValueData(start, rowcount, keyColumns);
this.keyAttribData = keyData;
MboValueData[][] mvd = wf.getMboValueData(start, rowcount, arrColumns);
return mvd;
}
private void processGroupOROrder(WFAssignmentSetRemote wf, String sortBy)
throws RemoteException, MXException
{
if ((wf == null) || (wf.isEmpty()))
return;
MboRemote layout = getOwner();
if ((layout == null) || (!(layout instanceof Layout)))
return;
String desc = layout.getString("description");
String orderby = "startdate";
String type = "desc";
String completeWhere = wf.getCompleteWhere();
String where = "";
if(desc.startsWith("ú̿")){
where = " app in ('COALPR1','COALRFQ1','COALPO1','COALPURCH','COALINV')";
}
else
where = " app not in ('COALPR1','COALRFQ1','COALPO1','COALPURCH','COALINV')";
SqlFormat s = new SqlFormat(where);
if ((completeWhere != null) && (!"".equals(completeWhere.trim())))
completeWhere = s.format() + " and " + completeWhere;
else
completeWhere = s.format();
wf.setWhere(completeWhere);
wf.setOrderBy(orderby + " " + type);
wf.reset();
}
public Vector getInboxColumns() throws RemoteException, MXException {
if (this.inboxColumns != null && !this.inboxColumns.isEmpty())
return this.inboxColumns;
this.inboxColumns = new Vector();
String sql = "display=:yes";
SqlFormat sqf = new SqlFormat(sql);
setWhere(sqf.format());
setOrderBy("ordernum asc,description asc");
reset();
for (int i = 0;; i++) {
InbxConfigRemote inbx = (InbxConfigRemote)getMbo(i);
if (inbx == null)
break;
if (!"description".equalsIgnoreCase(inbx.getString("inbxcolumn"))) {
String[] arrColumn = new String[2];
arrColumn[0] = inbx.getString("inbxcolumn");
arrColumn[1] = inbx.getString("description");
this.inboxColumns.add(arrColumn);
}
}
return this.inboxColumns;
}
public void resetInboxColumns() throws RemoteException, MXException {
this.inboxColumns = null;
}
public MboValueData[][] getKeyAttributeData() throws RemoteException, MXException {
return this.keyAttribData;
}
public int getNoOfAssignments() throws RemoteException, MXException {
if (this.noOfAssignments == 0) {
WFAssignmentSetRemote wf = (WFAssignmentSetRemote)MXServer.getMXServer().getMboSet("WFASSIGNMENT", getUserInfo());
wf.getInboxAssignments();
processGroupOROrder(wf,"");
this.noOfAssignments = wf.count();
return this.noOfAssignments;
}
return this.noOfAssignments;
}
public String latestDate() throws RemoteException, MXException {
return this.latestDate;
}
public String getInboxDescTitle() throws RemoteException, MXException {
return this.inboxDescTitle;
}
public ArrayList getNonPersistentAttributes() throws RemoteException, MXException {
ArrayList<String> npAttributes = new ArrayList();
MboSetRemote msr = MXServer.getMXServer().getMboSet("WFASSIGNMENT", getUserInfo());
MboSetInfo msi = msr.getMboSetInfo();
Iterator<MboValueInfo> allFields = msi.getAttributes();
while (allFields.hasNext()) {
MboValueInfo mvi = allFields.next();
if (!mvi.isPersistent())
npAttributes.add(mvi.getAttributeName());
}
return npAttributes;
}
}
......@@ -20,8 +20,12 @@ public class FldFcgBJSF extends MboValueAdapter {
super.action();
MboValue FldValue = getMboValue();
MboRemote mbo = FldValue.getMbo();
if(getMboValue().getDouble() < 0)
if(getMboValue().getDouble() < 0) {
throw new MXApplicationException("\nʾ:", "\n ֧С0!");
}
mbo.setValue("FCG_FINALCOST", mbo.getDouble("FCG_RATE") * getMboValue().getDouble(),11L);
mbo.setValue("FCG_COSTWORDS", MoneyUtil.amountToChinese(mbo.getDouble("FCG_FINALCOST")),11L);
}
......
......@@ -15,29 +15,38 @@ import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
public class FcgLocation extends Location implements LocationRemote, HierarchicalMboRemote, AddressableMbo{
public class FcgLocation extends Location implements LocationRemote,
HierarchicalMboRemote, AddressableMbo {
public FcgLocation(MboSet ms) throws MXException, RemoteException {
super(ms);
}
private void MatusetransProject(MboSetRemote servrecSet) throws MXException, RemoteException, MXApplicationException {
private void MatusetransProject(MboSetRemote servrecSet)
throws MXException, RemoteException, MXApplicationException {
MboRemote servrec = null;
if(servrecSet.isEmpty())
if (servrecSet.isEmpty())
return;
if(!servrecSet.toBeSaved())
if (!servrecSet.toBeSaved())
return;
HashMap<String, Double> servhashMap = new HashMap<>();
HashMap<String, String> pohashMap = new HashMap<>();
for (int i = 0; (servrec = servrecSet.getMbo(i)) != null; i++) {
System.out.println(i + "===i===" +servrecSet.getName()+" "+ servrec.toBeAdded());
if (servrecSet.getName().equalsIgnoreCase("MATUSETRANS") && servrec.toBeAdded() && "ITEM".equalsIgnoreCase(servrec.getString("LINETYPE")) ) {
if(!servrec.isNull("WORKORDER.FCG_taskid.fcg_projectid")){
String pid = servrec.getString("WORKORDER.FCG_taskid.fcg_projectid");
System.out.println(i + "===i===" + servrecSet.getName() + " "
+ servrec.toBeAdded());
if (servrecSet.getName().equalsIgnoreCase("MATUSETRANS")
&& servrec.toBeAdded()
&& "ITEM".equalsIgnoreCase(servrec.getString("LINETYPE"))) {
if (!servrec.isNull("WORKORDER.FCG_taskid.fcg_projectid")) {
String pid = servrec
.getString("WORKORDER.FCG_taskid.fcg_projectid");
servrec.setValue("fcg_projectid", pid, 2L);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + pid
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ pid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSetp = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
MboSetRemote finSetp = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSetp.setWhere(sql);
finSetp.setOrderBy("startdate desc");
finSetp.reset();
......@@ -45,7 +54,8 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
finSetp.close();
} else {
MboRemote fincntrl = finSetp.getMbo(0);
String fincntrlid = String.valueOf(fincntrl.getLong("finexpenselineid"));
String fincntrlid = String.valueOf(fincntrl
.getLong("finexpenselineid"));
servrec.setValue("fcg_taskid", fincntrlid, 2L);
finSetp.close();
}
......@@ -53,11 +63,18 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
if (!servhashMap.containsKey(wonum))
servhashMap.put(wonum, servrec.getDouble("linecost"));
else
servhashMap.put(wonum, servhashMap.get(wonum) + servrec.getDouble("linecost"));
System.out.println(wonum + "===servhashMap===" + servhashMap.get(wonum));
servhashMap.put(
wonum,
servhashMap.get(wonum)
+ servrec.getDouble("linecost"));
System.out.println(wonum + "===servhashMap==="
+ servhashMap.get(wonum));
if (!pohashMap.containsKey(wonum))
pohashMap.put(wonum, servrec.getString("WORKORDER.FCG_taskid.fcg_projectid"));
System.out.println(wonum + "===pohashMap===" + pohashMap.get(wonum));
pohashMap
.put(wonum,
servrec.getString("WORKORDER.FCG_taskid.fcg_projectid"));
System.out.println(wonum + "===pohashMap==="
+ pohashMap.get(wonum));
}
}
}
......@@ -68,10 +85,12 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
String key = (String) iterator1.next();
String projectid = pohashMap.get(key);
if (!"".equals(projectid) && !projectHashMap.containsKey(projectid)) {
projectHashMap.put(projectid, projectid);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + projectid
projectHashMap.put(key, projectid);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ projectid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSet = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
MboSetRemote finSet = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSet.setWhere(sql);
finSet.setOrderBy("startdate desc");
finSet.reset();
......@@ -79,7 +98,8 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
finSet.close();
} else {
MboRemote fincntrl = finSet.getMbo(0);
String fincntrlid = String.valueOf(fincntrl.getLong("finexpenselineid"));
String fincntrlid = String.valueOf(fincntrl
.getLong("finexpenselineid"));
Iterator iterator2 = servhashMap.keySet().iterator();
double toalcost = 0;
while (iterator2.hasNext()) {
......@@ -87,30 +107,57 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
if (pohashMap.get(key2).equals(projectid))
toalcost += servhashMap.get(key2);
}
MboSetRemote woSet = MXServer.getMXServer().getMboSet(
"workorder", getUserInfo());
System.out.println("KEY====="+key);
woSet.setWhere("wonum='" + key + "'");
woSet.reset();
if (woSet.isEmpty()) {
woSet.close();
continue;
}
double estcost = woSet.getMbo(0).getDouble("estmatcost")
- woSet.getMbo(0).getDouble("actmatcost");
System.out.println("===toalcost===" + toalcost);
double netcost = fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST");
System.out.println("===estmatcost===" + estcost);
double pendingcost = fincntrl.getDouble("PENDINGCOST");
if (toalcost > estcost)
pendingcost = pendingcost - estcost;
else
pendingcost = pendingcost - toalcost;
if (pendingcost <= 0)
pendingcost = 0;
double netcost = fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST") - pendingcost;
System.out.println("netcost:" + netcost);
if (netcost < toalcost) {
finSet.close();
errorMSG += "\n 工单号:" + key + " 超预算,费用预算编码:" + projectid + ",预算行ID:" + fincntrlid+"\n 超预算金额:"+(netcost-toalcost);
errorMSG += "\n 领料单号:" + key + " 超预算,费用预算编码:"
+ projectid + ",预算行ID:" + fincntrlid
+ "\n 超预算金额:" + (netcost - toalcost);
} else
finSet.close();
woSet.close();
}
}
}
if("".equals(errorMSG)){
if ("".equals(errorMSG)) {
System.out.println("===errorMSG===" + errorMSG);
Iterator iterator3 = pohashMap.keySet().iterator();
Iterator iterator3 = pohashMap.keySet().iterator();
// Iterator iterator3 = projectHashMap.keySet().iterator();
while (iterator3.hasNext()) {
String key = (String) iterator3.next();
String projectid = pohashMap.get(key);
String projectid = projectHashMap.get(key);
System.out.println("===key===" + key);
System.out.println("===projectid===" + projectid);
if (!"".equals(projectid) && projectHashMap.containsKey(projectid)) {
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + projectid
if (!"".equals(projectid)) {
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ projectid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSet = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
MboSetRemote finSet = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSet.setWhere(sql);
finSet.setOrderBy("startdate desc");
finSet.reset();
......@@ -125,22 +172,60 @@ public class FcgLocation extends Location implements LocationRemote, Hierarchica
if (pohashMap.get(key2).equals(projectid))
toalcost += servhashMap.get(key2);
}
System.out.println("===fincntrlID===" + fincntrl.getString("finexpenselineid"));
fincntrl.setValue("PROJECTCOST", fincntrl.getDouble("PROJECTCOST")+toalcost);
fincntrl.setValue("netcost", fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST"));
MboSetRemote woSet =
MXServer.getMXServer().getMboSet("workorder",
getUserInfo());
System.out.println("KEY====="+key);
woSet.setWhere("wonum='"+key+"'");
woSet.reset();
if(woSet.isEmpty()){
woSet.close();
continue;
}
double estcost =
woSet.getMbo(0).getDouble("estmatcost") -
woSet.getMbo(0).getDouble("actmatcost");
System.out.println("===toalcost===" + toalcost);
System.out.println("===estmatcost===" + estcost);
double pendingcost = fincntrl.getDouble("PENDINGCOST");
if (toalcost > estcost)
pendingcost = pendingcost - estcost;
else
pendingcost = pendingcost - toalcost;
if (pendingcost <= 0)
pendingcost = 0;
fincntrl.setValue("PENDINGCOST", pendingcost);
fincntrl.setValue("PROJECTCOST",
fincntrl.getDouble("PROJECTCOST") + toalcost);
fincntrl.setValue(
"netcost",
fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST")
- fincntrl.getDouble("PENDINGCOST"));
finSet.save();
finSet.close();
woSet.close();
}
}
}
}
else
throw new MXApplicationException("\n*************警告!警告!警告!**************",errorMSG);
} else
throw new MXApplicationException(
"\n*************警告!警告!警告!**************", errorMSG);
}
public void appValidate() throws MXException, RemoteException {
super.appValidate();
MatusetransProject(getMboSet("MATUSETRANSISSUE"));
}
// @Override
// public void copyMatUseTransSetForReturn(MboSetRemote matUseSet)
// throws RemoteException, MXException {
// super.copyMatUseTransSetForReturn(matUseSet);
//// MatusetransProject(matUseSet);
// }
}
......@@ -37,8 +37,8 @@ public class FldDateValidate extends MboValueAdapter {
if(day > 0)
result = result + 1;
int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
if (Math.abs(month + result) > 6)
throw new MXApplicationException("\n提示:", "\n 临时变更的最长时间不能超过6个月!");
if (Math.abs(month + result) > 12)
throw new MXApplicationException("\n提示:", "\n 临时变更的最长时间不能超过12个月!");
}
}
......@@ -55,8 +55,8 @@ public class FldDateValidate extends MboValueAdapter {
if(day > 0)
result = result + 1;
int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
if (Math.abs(month + result) > 6)
throw new MXApplicationException("\n提示:", "\n 临时变更的最长时间不能超过6个月!");
if (Math.abs(month + result) > 12)
throw new MXApplicationException("\n提示:", "\n 临时变更的最长时间不能超过12个月!");
}
if(!mbo.isNull("B4_DIRECTORDATE")){
end.setTime(mbo.getDate("B4_DIRECTORDATE"));
......
......@@ -316,15 +316,18 @@ public class ShtjMbo extends Mbo implements MboRemote {
}
// --------------------------------------------------------------------柳钢----------------------------------------------------
// 柳钢供汽日流量 = 今日(柳钢供汽累计流量)- 昨日(柳钢供汽累计流量)
// 累计供热量 --手填
public void setLG_GQRLL() throws RemoteException, MXException {
setValue("LG_GQRLL",
getDouble("SH70") - getDouble("LASTDAY.SH70") + getDouble("SH75") - getDouble("LASTDAY.SH75"), 2L);
// setValue("LG_GQRLL",
// getDouble("SH70") - getDouble("LASTDAY.SH70") + getDouble("SH75") - getDouble("LASTDAY.SH75"), 2L);
}
// 柳钢供汽水流量 = 今日(柳钢供水累计流量)- 昨日(柳钢供水累计流量)
// 日供热量 = 今日累计供热-昨日累计供热
public void setLG_GSRLL() throws RemoteException, MXException {
setValue("LG_GSRLL", getDouble("SH71") - getDouble("LASTDAY.SH71"), 2L);
// setValue("LG_GSRLL", getDouble("SH71") - getDouble("LASTDAY.SH71"), 2L);
setValue("LG_GSRLL", getDouble("LG_GQRLL") - getDouble("LASTDAY.LG_GQRLL"), 2L);
}
// --------------------------------------------------------------------淡水----------------------------------------------------
......
......@@ -21,7 +21,7 @@ public class StockTaking
public void add() throws MXException, RemoteException {
super.add();
setValue("STATUS","WAPPR",2L);
setValue("LOCATION","CENTRAL",2L);
// setValue("LOCATION","CENTRAL",2L);
}
public void modify() throws MXException, RemoteException {
if (!this.isModified) {
......
package com.tohi.app.tenderbond;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.server.MXServer;
import psdi.util.MXException;
/**
* 付款金额定义类
* @author assessment
*
*/
public class FldFcgFkje extends MboValueAdapter {
public FldFcgFkje(MboValue mbv) {
super(mbv);
}
@Override
public void initValue() throws MXException, RemoteException {
// TODO 自动生成的方法存根
super.initValue();
}
@Override
public void action() throws MXException, RemoteException {
Mbo mboRemote = this.getMboValue().getMbo();
if (!this.getMboValue().isNull()) {
System.out.println("进入FldFcgFkje进行赋值----"+mboRemote.getUserInfo().getLoginUserName());
mboRemote.setValue("PAYBY",mboRemote.getUserInfo().getLoginUserName());
mboRemote.setValue("PAYDATE",MXServer.getMXServer().getDate());
}
}
}
package com.tohi.common.dto.mt;
import java.util.*;
public class Contract {
private Long CONTRACTID;
private String CONTRACTNUM;
private String DESCRIPTION;
private String FCG_HTBH;
private String FCG_SWJBR;
private String DISPLAYNAME;
private String FCG_MZ;
private String FCG_DJFS;
private String FCG_CJFS;
private String CURR_CODE;
private String CONTRACT_PRICE;
private String CALORIFIC_VALUE;
private String DELIVERY_DATE;
private String DELIVERY_DATE2;
private String FCG_DSHDATA;
private String FCG_GLADATE;
private String CONTRACT_SUPPLY;
private String FLD_2;
private String FLD_1;
private String RATIFY_BUDGET_AMOUNT;
private String MARGIN_AMOUNT;
private String ACTPOQTY;
private String CUSTMAXVOL;
private String MAXRELVOL;
List<ContractLine> contractLineList=new ArrayList<ContractLine>();
public List<ContractLine> getContractLineList() {
return contractLineList;
}
public void setContractLineList(List<ContractLine> contractLineList) {
this.contractLineList = contractLineList;
}
public Long getCONTRACTID() {
return CONTRACTID;
}
public void setCONTRACTID(Long cONTRACTID) {
CONTRACTID = cONTRACTID;
}
public String getCONTRACTNUM() {
return CONTRACTNUM;
}
public void setCONTRACTNUM(String cONTRACTNUM) {
CONTRACTNUM = cONTRACTNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getFCG_HTBH() {
return FCG_HTBH;
}
public void setFCG_HTBH(String fCG_HTBH) {
FCG_HTBH = fCG_HTBH;
}
public String getFCG_SWJBR() {
return FCG_SWJBR;
}
public void setFCG_SWJBR(String fCG_SWJBR) {
FCG_SWJBR = fCG_SWJBR;
}
public String getDISPLAYNAME() {
return DISPLAYNAME;
}
public void setDISPLAYNAME(String dISPLAYNAME) {
DISPLAYNAME = dISPLAYNAME;
}
public String getFCG_MZ() {
return FCG_MZ;
}
public void setFCG_MZ(String fCG_MZ) {
FCG_MZ = fCG_MZ;
}
public String getFCG_DJFS() {
return FCG_DJFS;
}
public void setFCG_DJFS(String fCG_DJFS) {
FCG_DJFS = fCG_DJFS;
}
public String getFCG_CJFS() {
return FCG_CJFS;
}
public void setFCG_CJFS(String fCG_CJFS) {
FCG_CJFS = fCG_CJFS;
}
public String getCURR_CODE() {
return CURR_CODE;
}
public void setCURR_CODE(String cURR_CODE) {
CURR_CODE = cURR_CODE;
}
public String getCONTRACT_PRICE() {
return CONTRACT_PRICE;
}
public void setCONTRACT_PRICE(String cONTRACT_PRICE) {
CONTRACT_PRICE = cONTRACT_PRICE;
}
public String getCALORIFIC_VALUE() {
return CALORIFIC_VALUE;
}
public void setCALORIFIC_VALUE(String cALORIFIC_VALUE) {
CALORIFIC_VALUE = cALORIFIC_VALUE;
}
public String getDELIVERY_DATE() {
return DELIVERY_DATE;
}
public void setDELIVERY_DATE(String dELIVERY_DATE) {
DELIVERY_DATE = dELIVERY_DATE;
}
public String getDELIVERY_DATE2() {
return DELIVERY_DATE2;
}
public void setDELIVERY_DATE2(String dELIVERY_DATE2) {
DELIVERY_DATE2 = dELIVERY_DATE2;
}
public String getFCG_DSHDATA() {
return FCG_DSHDATA;
}
public void setFCG_DSHDATA(String fCG_DSHDATA) {
FCG_DSHDATA = fCG_DSHDATA;
}
public String getFCG_GLADATE() {
return FCG_GLADATE;
}
public void setFCG_GLADATE(String fCG_GLADATE) {
FCG_GLADATE = fCG_GLADATE;
}
public String getCONTRACT_SUPPLY() {
return CONTRACT_SUPPLY;
}
public void setCONTRACT_SUPPLY(String cONTRACT_SUPPLY) {
CONTRACT_SUPPLY = cONTRACT_SUPPLY;
}
public String getFLD_2() {
return FLD_2;
}
public void setFLD_2(String fLD_2) {
FLD_2 = fLD_2;
}
public String getFLD_1() {
return FLD_1;
}
public void setFLD_1(String fLD_1) {
FLD_1 = fLD_1;
}
public String getRATIFY_BUDGET_AMOUNT() {
return RATIFY_BUDGET_AMOUNT;
}
public void setRATIFY_BUDGET_AMOUNT(String rATIFY_BUDGET_AMOUNT) {
RATIFY_BUDGET_AMOUNT = rATIFY_BUDGET_AMOUNT;
}
public String getMARGIN_AMOUNT() {
return MARGIN_AMOUNT;
}
public void setMARGIN_AMOUNT(String mARGIN_AMOUNT) {
MARGIN_AMOUNT = mARGIN_AMOUNT;
}
public String getACTPOQTY() {
return ACTPOQTY;
}
public void setACTPOQTY(String aCTPOQTY) {
ACTPOQTY = aCTPOQTY;
}
public String getCUSTMAXVOL() {
return CUSTMAXVOL;
}
public void setCUSTMAXVOL(String cUSTMAXVOL) {
CUSTMAXVOL = cUSTMAXVOL;
}
public String getMAXRELVOL() {
return MAXRELVOL;
}
public void setMAXRELVOL(String mAXRELVOL) {
MAXRELVOL = mAXRELVOL;
}
}
package com.tohi.common.dto.mt;
public class ContractLine {
private String ITEMNUM;
private String DESCRIPTION;
private String ENTERBY;
private String ENTERDATE;
private String ORDERQTY;
private String ORDERUNIT;
private String CUSTUNITCOST;
private String CUSTTAX1;
private String CUSTTAX1CODE;
private String CUSTUSD;
private String UNITCOST;
private String LINECOST;
public String getITEMNUM() {
return ITEMNUM;
}
public void setITEMNUM(String iTEMNUM) {
ITEMNUM = iTEMNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getENTERBY() {
return ENTERBY;
}
public void setENTERBY(String eNTERBY) {
ENTERBY = eNTERBY;
}
public String getENTERDATE() {
return ENTERDATE;
}
public void setENTERDATE(String eNTERDATE) {
ENTERDATE = eNTERDATE;
}
public String getORDERQTY() {
return ORDERQTY;
}
public void setORDERQTY(String oRDERQTY) {
ORDERQTY = oRDERQTY;
}
public String getORDERUNIT() {
return ORDERUNIT;
}
public void setORDERUNIT(String oRDERUNIT) {
ORDERUNIT = oRDERUNIT;
}
public String getCUSTUNITCOST() {
return CUSTUNITCOST;
}
public void setCUSTUNITCOST(String cUSTUNITCOST) {
CUSTUNITCOST = cUSTUNITCOST;
}
public String getCUSTTAX1() {
return CUSTTAX1;
}
public void setCUSTTAX1(String cUSTTAX1) {
CUSTTAX1 = cUSTTAX1;
}
public String getCUSTTAX1CODE() {
return CUSTTAX1CODE;
}
public void setCUSTTAX1CODE(String cUSTTAX1CODE) {
CUSTTAX1CODE = cUSTTAX1CODE;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getUNITCOST() {
return UNITCOST;
}
public void setUNITCOST(String uNITCOST) {
UNITCOST = uNITCOST;
}
public String getLINECOST() {
return LINECOST;
}
public void setLINECOST(String lINECOST) {
LINECOST = lINECOST;
}
}
package com.tohi.common.dto.mt;
import java.util.*;
public class Invoice {
private Long INVOICEID;
private String INVOICENUM;
private String DESCRIPTION;
private String FCG_PAYTYPE;
private String LCNO;
private String FCG_PAYCLASS;
private String COALTYPE;
private String FCG_SHIPPERIOD;
private String CUSTUSD;
private String FCG_RATE;
private String DESCRIPTION_LONGDESCRIPTION;
private String FCG_TOTALCOSTPLAN;
private String FCG_BJSF;
private String COAL;
private String TRANSMODE;
private String CONTRACTNATURE;
private String STATUSDESC_DESCRIPTION;
private String VENDOR;
private String NAME;
private List<InvoiceLine> InvoiceLine=new ArrayList<InvoiceLine>();
public List<InvoiceLine> getInvoiceLine() {
return InvoiceLine;
}
public void setInvoiceLine(List<InvoiceLine> invoiceLine) {
InvoiceLine = invoiceLine;
}
public Long getINVOICEID() {
return INVOICEID;
}
public void setINVOICEID(Long iNVOICEID) {
INVOICEID = iNVOICEID;
}
public String getINVOICENUM() {
return INVOICENUM;
}
public void setINVOICENUM(String iNVOICENUM) {
INVOICENUM = iNVOICENUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getFCG_PAYTYPE() {
return FCG_PAYTYPE;
}
public void setFCG_PAYTYPE(String fCG_PAYTYPE) {
FCG_PAYTYPE = fCG_PAYTYPE;
}
public String getLCNO() {
return LCNO;
}
public void setLCNO(String lCNO) {
LCNO = lCNO;
}
public String getFCG_PAYCLASS() {
return FCG_PAYCLASS;
}
public void setFCG_PAYCLASS(String fCG_PAYCLASS) {
FCG_PAYCLASS = fCG_PAYCLASS;
}
public String getCOALTYPE() {
return COALTYPE;
}
public void setCOALTYPE(String cOALTYPE) {
COALTYPE = cOALTYPE;
}
public String getFCG_SHIPPERIOD() {
return FCG_SHIPPERIOD;
}
public void setFCG_SHIPPERIOD(String fCG_SHIPPERIOD) {
FCG_SHIPPERIOD = fCG_SHIPPERIOD;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getFCG_RATE() {
return FCG_RATE;
}
public void setFCG_RATE(String fCG_RATE) {
FCG_RATE = fCG_RATE;
}
public String getDESCRIPTION_LONGDESCRIPTION() {
return DESCRIPTION_LONGDESCRIPTION;
}
public void setDESCRIPTION_LONGDESCRIPTION(String dESCRIPTION_LONGDESCRIPTION) {
DESCRIPTION_LONGDESCRIPTION = dESCRIPTION_LONGDESCRIPTION;
}
public String getFCG_TOTALCOSTPLAN() {
return FCG_TOTALCOSTPLAN;
}
public void setFCG_TOTALCOSTPLAN(String fCG_TOTALCOSTPLAN) {
FCG_TOTALCOSTPLAN = fCG_TOTALCOSTPLAN;
}
public String getFCG_BJSF() {
return FCG_BJSF;
}
public void setFCG_BJSF(String fCG_BJSF) {
FCG_BJSF = fCG_BJSF;
}
public String getCOAL() {
return COAL;
}
public void setCOAL(String cOAL) {
COAL = cOAL;
}
public String getTRANSMODE() {
return TRANSMODE;
}
public void setTRANSMODE(String tRANSMODE) {
TRANSMODE = tRANSMODE;
}
public String getCONTRACTNATURE() {
return CONTRACTNATURE;
}
public void setCONTRACTNATURE(String cONTRACTNATURE) {
CONTRACTNATURE = cONTRACTNATURE;
}
public String getSTATUSDESC_DESCRIPTION() {
return STATUSDESC_DESCRIPTION;
}
public void setSTATUSDESC_DESCRIPTION(String sTATUSDESC_DESCRIPTION) {
STATUSDESC_DESCRIPTION = sTATUSDESC_DESCRIPTION;
}
public String getVENDOR() {
return VENDOR;
}
public void setVENDOR(String vENDOR) {
VENDOR = vENDOR;
}
public String getNAME() {
return NAME;
}
public void setNAME(String nAME) {
NAME = nAME;
}
}
package com.tohi.common.dto.mt;
public class InvoiceLine {
private String DESCRIPTION;
private String QTYFORUI;
private String INVOICEUNIT;
private String UNITCOST;
private String LINECOSTFORUI;
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getQTYFORUI() {
return QTYFORUI;
}
public void setQTYFORUI(String qTYFORUI) {
QTYFORUI = qTYFORUI;
}
public String getINVOICEUNIT() {
return INVOICEUNIT;
}
public void setINVOICEUNIT(String iNVOICEUNIT) {
INVOICEUNIT = iNVOICEUNIT;
}
public String getUNITCOST() {
return UNITCOST;
}
public void setUNITCOST(String uNITCOST) {
UNITCOST = uNITCOST;
}
public String getLINECOSTFORUI() {
return LINECOSTFORUI;
}
public void setLINECOSTFORUI(String lINECOSTFORUI) {
LINECOSTFORUI = lINECOSTFORUI;
}
}
package com.tohi.common.dto.mt;
import java.util.ArrayList;
import java.util.List;
public class Po {
private Long POID;
private String PONUM;
private String DESCRIPTION;
private String CUSTSHIP;
private String CUSTUSD;
private String FCG_HTBH;
private String PURCHASEAGENT;
private String CONTRACTREFNUM;
private String TOTALCOST;
private String VENDOR;
private String NAME;
List<Poline> polineList=new ArrayList<Poline>();
public List<Poline> getPolineList() {
return polineList;
}
public void setPolineList(List<Poline> polineList) {
this.polineList = polineList;
}
public Long getPOID() {
return POID;
}
public void setPOID(Long pOID) {
POID = pOID;
}
public String getPONUM() {
return PONUM;
}
public void setPONUM(String pONUM) {
PONUM = pONUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getCUSTSHIP() {
return CUSTSHIP;
}
public void setCUSTSHIP(String cUSTSHIP) {
CUSTSHIP = cUSTSHIP;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getFCG_HTBH() {
return FCG_HTBH;
}
public void setFCG_HTBH(String fCG_HTBH) {
FCG_HTBH = fCG_HTBH;
}
public String getPURCHASEAGENT() {
return PURCHASEAGENT;
}
public void setPURCHASEAGENT(String pURCHASEAGENT) {
PURCHASEAGENT = pURCHASEAGENT;
}
public String getCONTRACTREFNUM() {
return CONTRACTREFNUM;
}
public void setCONTRACTREFNUM(String cONTRACTREFNUM) {
CONTRACTREFNUM = cONTRACTREFNUM;
}
public String getTOTALCOST() {
return TOTALCOST;
}
public void setTOTALCOST(String tOTALCOST) {
TOTALCOST = tOTALCOST;
}
public String getVENDOR() {
return VENDOR;
}
public void setVENDOR(String vENDOR) {
VENDOR = vENDOR;
}
public String getNAME() {
return NAME;
}
public void setNAME(String nAME) {
NAME = nAME;
}
}
package com.tohi.common.dto.mt;
public class Poline {
private String DESCRIPTION;
private String ORDERQTY;
private String ORDERUNIT;
private String CUSTUSD;
private String PLIN1;
private String TAX1CODE;
private String UNITCOST;
private String LINECOST;
private String TAX1;
private String ENTERBY;
private String ENTERDATE;
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getORDERQTY() {
return ORDERQTY;
}
public void setORDERQTY(String oRDERQTY) {
ORDERQTY = oRDERQTY;
}
public String getORDERUNIT() {
return ORDERUNIT;
}
public void setORDERUNIT(String oRDERUNIT) {
ORDERUNIT = oRDERUNIT;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getPLIN1() {
return PLIN1;
}
public void setPLIN1(String pLIN1) {
PLIN1 = pLIN1;
}
public String getTAX1CODE() {
return TAX1CODE;
}
public void setTAX1CODE(String tAX1CODE) {
TAX1CODE = tAX1CODE;
}
public String getUNITCOST() {
return UNITCOST;
}
public void setUNITCOST(String uNITCOST) {
UNITCOST = uNITCOST;
}
public String getLINECOST() {
return LINECOST;
}
public void setLINECOST(String lINECOST) {
LINECOST = lINECOST;
}
public String getTAX1() {
return TAX1;
}
public void setTAX1(String tAX1) {
TAX1 = tAX1;
}
public String getENTERBY() {
return ENTERBY;
}
public void setENTERBY(String eNTERBY) {
ENTERBY = eNTERBY;
}
public String getENTERDATE() {
return ENTERDATE;
}
public void setENTERDATE(String eNTERDATE) {
ENTERDATE = eNTERDATE;
}
}
package com.tohi.common.dto.mt;
import java.util.*;
public class Pr {
private Long PRID ;
private String PRNUM ;
private String DESCRIPTION ;
private String CUSTTYPE ;
private String FCG_SQLY ;
private String REQUESTEDBY ;
private String DISPLAYNAME ;
private String FCG_GJDH ;
private String FCG_MEMO ;
private String FCG_YGJE ;
private String FCG_PURCHASEMODE ;
private String FCG_SWJBR ;
private List<PrLine> prLineList=new ArrayList<>();
public List<PrLine> getPrLineList() {
return prLineList;
}
public void setPrLineList(List<PrLine> prLineList) {
this.prLineList = prLineList;
}
public Long getPRID() {
return PRID;
}
public void setPRID(Long pRID) {
PRID = pRID;
}
public String getPRNUM() {
return PRNUM;
}
public void setPRNUM(String pRNUM) {
PRNUM = pRNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getCUSTTYPE() {
return CUSTTYPE;
}
public void setCUSTTYPE(String cUSTTYPE) {
CUSTTYPE = cUSTTYPE;
}
public String getFCG_SQLY() {
return FCG_SQLY;
}
public void setFCG_SQLY(String fCG_SQLY) {
FCG_SQLY = fCG_SQLY;
}
public String getREQUESTEDBY() {
return REQUESTEDBY;
}
public void setREQUESTEDBY(String rEQUESTEDBY) {
REQUESTEDBY = rEQUESTEDBY;
}
public String getDISPLAYNAME() {
return DISPLAYNAME;
}
public void setDISPLAYNAME(String dISPLAYNAME) {
DISPLAYNAME = dISPLAYNAME;
}
public String getFCG_GJDH() {
return FCG_GJDH;
}
public void setFCG_GJDH(String fCG_GJDH) {
FCG_GJDH = fCG_GJDH;
}
public String getFCG_MEMO() {
return FCG_MEMO;
}
public void setFCG_MEMO(String fCG_MEMO) {
FCG_MEMO = fCG_MEMO;
}
public String getFCG_YGJE() {
return FCG_YGJE;
}
public void setFCG_YGJE(String fCG_YGJE) {
FCG_YGJE = fCG_YGJE;
}
public String getFCG_PURCHASEMODE() {
return FCG_PURCHASEMODE;
}
public void setFCG_PURCHASEMODE(String fCG_PURCHASEMODE) {
FCG_PURCHASEMODE = fCG_PURCHASEMODE;
}
public String getFCG_SWJBR() {
return FCG_SWJBR;
}
public void setFCG_SWJBR(String fCG_SWJBR) {
FCG_SWJBR = fCG_SWJBR;
}
}
package com.tohi.common.dto.mt;
public class PrLine {
private String ITEMNUM;
private String DESCRIPTION;
private String JSSX;
private String CUSTUSD;
private String ORDERQTY;
private String ORDERUNIT;
private String UNITCOST;
private String LINECOST;
public String getITEMNUM() {
return ITEMNUM;
}
public void setITEMNUM(String iTEMNUM) {
ITEMNUM = iTEMNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getJSSX() {
return JSSX;
}
public void setJSSX(String jSSX) {
JSSX = jSSX;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getORDERQTY() {
return ORDERQTY;
}
public void setORDERQTY(String oRDERQTY) {
ORDERQTY = oRDERQTY;
}
public String getORDERUNIT() {
return ORDERUNIT;
}
public void setORDERUNIT(String oRDERUNIT) {
ORDERUNIT = oRDERUNIT;
}
public String getUNITCOST() {
return UNITCOST;
}
public void setUNITCOST(String uNITCOST) {
UNITCOST = uNITCOST;
}
public String getLINECOST() {
return LINECOST;
}
public void setLINECOST(String lINECOST) {
LINECOST = lINECOST;
}
}
package com.tohi.common.dto.mt;
import java.util.ArrayList;
import java.util.List;
public class Rfq {
private Long RFQID;
private String RFQNUM;
private String DESCRIPTION;
private String STATUS;
private String REQUIREDDATE;
private String FCG_MEMO;
private String SHIPTOATTN;
private String DISPLAYNAME;
private String FCG_PURCHASEMODE;
private String FCG_REASON;
private String FCG_ZHAOBIAODATE;
private String FCG_ZHAOBIAODATE2;
private String FCG_JIEBIAODATE;
private String FCG_JIEBIAODATE2;
private String FCG_DINGBIAODATE;
private String FCG_DINGBIAODATE2;
List<RfqFCG_RFQ_EXT_LINE> RfqFCG_RFQ_EXT_LINEList=new ArrayList<RfqFCG_RFQ_EXT_LINE>();//合同推荐书
List<RfqLine> RfqLineList=new ArrayList<RfqLine>();//询价单行
List<RfqVENDOR> RfqVENDORList=new ArrayList<RfqVENDOR>();//推荐供应商信息
public List<RfqFCG_RFQ_EXT_LINE> getRfqFCG_RFQ_EXT_LINEList() {
return RfqFCG_RFQ_EXT_LINEList;
}
public void setRfqFCG_RFQ_EXT_LINEList(
List<RfqFCG_RFQ_EXT_LINE> rfqFCG_RFQ_EXT_LINEList) {
RfqFCG_RFQ_EXT_LINEList = rfqFCG_RFQ_EXT_LINEList;
}
public List<RfqLine> getRfqLineList() {
return RfqLineList;
}
public void setRfqLineList(List<RfqLine> rfqLineList) {
RfqLineList = rfqLineList;
}
public List<RfqVENDOR> getRfqVENDORList() {
return RfqVENDORList;
}
public void setRfqVENDORList(List<RfqVENDOR> rfqVENDORList) {
RfqVENDORList = rfqVENDORList;
}
public Long getRFQID() {
return RFQID;
}
public void setRFQID(Long rFQID) {
RFQID = rFQID;
}
public String getRFQNUM() {
return RFQNUM;
}
public void setRFQNUM(String rFQNUM) {
RFQNUM = rFQNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String sTATUS) {
STATUS = sTATUS;
}
public String getREQUIREDDATE() {
return REQUIREDDATE;
}
public void setREQUIREDDATE(String rEQUIREDDATE) {
REQUIREDDATE = rEQUIREDDATE;
}
public String getFCG_MEMO() {
return FCG_MEMO;
}
public void setFCG_MEMO(String fCG_MEMO) {
FCG_MEMO = fCG_MEMO;
}
public String getSHIPTOATTN() {
return SHIPTOATTN;
}
public void setSHIPTOATTN(String sHIPTOATTN) {
SHIPTOATTN = sHIPTOATTN;
}
public String getDISPLAYNAME() {
return DISPLAYNAME;
}
public void setDISPLAYNAME(String dISPLAYNAME) {
DISPLAYNAME = dISPLAYNAME;
}
public String getFCG_PURCHASEMODE() {
return FCG_PURCHASEMODE;
}
public void setFCG_PURCHASEMODE(String fCG_PURCHASEMODE) {
FCG_PURCHASEMODE = fCG_PURCHASEMODE;
}
public String getFCG_REASON() {
return FCG_REASON;
}
public void setFCG_REASON(String fCG_REASON) {
FCG_REASON = fCG_REASON;
}
public String getFCG_ZHAOBIAODATE() {
return FCG_ZHAOBIAODATE;
}
public void setFCG_ZHAOBIAODATE(String fCG_ZHAOBIAODATE) {
FCG_ZHAOBIAODATE = fCG_ZHAOBIAODATE;
}
public String getFCG_ZHAOBIAODATE2() {
return FCG_ZHAOBIAODATE2;
}
public void setFCG_ZHAOBIAODATE2(String fCG_ZHAOBIAODATE2) {
FCG_ZHAOBIAODATE2 = fCG_ZHAOBIAODATE2;
}
public String getFCG_JIEBIAODATE() {
return FCG_JIEBIAODATE;
}
public void setFCG_JIEBIAODATE(String fCG_JIEBIAODATE) {
FCG_JIEBIAODATE = fCG_JIEBIAODATE;
}
public String getFCG_JIEBIAODATE2() {
return FCG_JIEBIAODATE2;
}
public void setFCG_JIEBIAODATE2(String fCG_JIEBIAODATE2) {
FCG_JIEBIAODATE2 = fCG_JIEBIAODATE2;
}
public String getFCG_DINGBIAODATE() {
return FCG_DINGBIAODATE;
}
public void setFCG_DINGBIAODATE(String fCG_DINGBIAODATE) {
FCG_DINGBIAODATE = fCG_DINGBIAODATE;
}
public String getFCG_DINGBIAODATE2() {
return FCG_DINGBIAODATE2;
}
public void setFCG_DINGBIAODATE2(String fCG_DINGBIAODATE2) {
FCG_DINGBIAODATE2 = fCG_DINGBIAODATE2;
}
}
package com.tohi.common.dto.mt;
public class RfqFCG_RFQ_EXT_LINE {
private String FCG_TJ_YJ;
private String FCG_TJ_TJGYS;
private String NAME;
private String FCG_DHRQ;
private String FCG_TJ_CNJE;
private String FCG_TJ_HTJ;
public String getFCG_TJ_YJ() {
return FCG_TJ_YJ;
}
public void setFCG_TJ_YJ(String fCG_TJ_YJ) {
FCG_TJ_YJ = fCG_TJ_YJ;
}
public String getFCG_TJ_TJGYS() {
return FCG_TJ_TJGYS;
}
public void setFCG_TJ_TJGYS(String fCG_TJ_TJGYS) {
FCG_TJ_TJGYS = fCG_TJ_TJGYS;
}
public String getNAME() {
return NAME;
}
public void setNAME(String nAME) {
NAME = nAME;
}
public String getFCG_DHRQ() {
return FCG_DHRQ;
}
public void setFCG_DHRQ(String fCG_DHRQ) {
FCG_DHRQ = fCG_DHRQ;
}
public String getFCG_TJ_CNJE() {
return FCG_TJ_CNJE;
}
public void setFCG_TJ_CNJE(String fCG_TJ_CNJE) {
FCG_TJ_CNJE = fCG_TJ_CNJE;
}
public String getFCG_TJ_HTJ() {
return FCG_TJ_HTJ;
}
public void setFCG_TJ_HTJ(String fCG_TJ_HTJ) {
FCG_TJ_HTJ = fCG_TJ_HTJ;
}
}
package com.tohi.common.dto.mt;
public class RfqLine {
private String ITEMNUM;
private String DESCRIPTION;
private String JSSX;
private String CUSTUSD;
private String ORDERQTY;
private String ORDERUNIT;
public String getITEMNUM() {
return ITEMNUM;
}
public void setITEMNUM(String iTEMNUM) {
ITEMNUM = iTEMNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getJSSX() {
return JSSX;
}
public void setJSSX(String jSSX) {
JSSX = jSSX;
}
public String getCUSTUSD() {
return CUSTUSD;
}
public void setCUSTUSD(String cUSTUSD) {
CUSTUSD = cUSTUSD;
}
public String getORDERQTY() {
return ORDERQTY;
}
public void setORDERQTY(String oRDERQTY) {
ORDERQTY = oRDERQTY;
}
public String getORDERUNIT() {
return ORDERUNIT;
}
public void setORDERUNIT(String oRDERUNIT) {
ORDERUNIT = oRDERUNIT;
}
}
package com.tohi.common.dto.mt;
public class RfqQuotationlinevendor {
private String RFQLINENUM;
private String ITEMNUM;
private String DESCRIPTION;
private String ORDERQTY;
private String ORDERUNIT;
private String QUNITCOST;
private String QL5;
private String TAX1CODE;
private String UNITCOST;
private String FCG_ZQFL;
private String ISAWARDED;
public String getRFQLINENUM() {
return RFQLINENUM;
}
public void setRFQLINENUM(String rFQLINENUM) {
RFQLINENUM = rFQLINENUM;
}
public String getITEMNUM() {
return ITEMNUM;
}
public void setITEMNUM(String iTEMNUM) {
ITEMNUM = iTEMNUM;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getORDERQTY() {
return ORDERQTY;
}
public void setORDERQTY(String oRDERQTY) {
ORDERQTY = oRDERQTY;
}
public String getORDERUNIT() {
return ORDERUNIT;
}
public void setORDERUNIT(String oRDERUNIT) {
ORDERUNIT = oRDERUNIT;
}
public String getQUNITCOST() {
return QUNITCOST;
}
public void setQUNITCOST(String qUNITCOST) {
QUNITCOST = qUNITCOST;
}
public String getQL5() {
return QL5;
}
public void setQL5(String qL5) {
QL5 = qL5;
}
public String getTAX1CODE() {
return TAX1CODE;
}
public void setTAX1CODE(String tAX1CODE) {
TAX1CODE = tAX1CODE;
}
public String getUNITCOST() {
return UNITCOST;
}
public void setUNITCOST(String uNITCOST) {
UNITCOST = uNITCOST;
}
public String getFCG_ZQFL() {
return FCG_ZQFL;
}
public void setFCG_ZQFL(String fCG_ZQFL) {
FCG_ZQFL = fCG_ZQFL;
}
public String getISAWARDED() {
return ISAWARDED;
}
public void setISAWARDED(String iSAWARDED) {
ISAWARDED = iSAWARDED;
}
}
package com.tohi.common.dto.mt;
import java.util.ArrayList;
import java.util.List;
public class RfqVENDOR {
private String VENDOR;
private String NAME;
List<RfqQuotationlinevendor> RfqQuotationlinevendorList=new ArrayList<RfqQuotationlinevendor>();
public List<RfqQuotationlinevendor> getRfqQuotationlinevendorList() {
return RfqQuotationlinevendorList;
}
public void setRfqQuotationlinevendorList(
List<RfqQuotationlinevendor> rfqQuotationlinevendorList) {
RfqQuotationlinevendorList = rfqQuotationlinevendorList;
}
//QUOTATIONLINEVENDOR
public String getVENDOR() {
return VENDOR;
}
public void setVENDOR(String vENDOR) {
VENDOR = vENDOR;
}
public String getNAME() {
return NAME;
}
public void setNAME(String nAME) {
NAME = nAME;
}
}
......@@ -20,6 +20,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import net.sf.json.JSONObject;
import com.ibm.tivoli.maximo.report.birt.session.WebAppSessionProvider;
import com.tohi.common.dto.FCG_WONUM_WORKSHEET;
import com.tohi.common.dto.MaxDocInfo;
......@@ -32,8 +34,22 @@ import com.tohi.common.dto.MboInfo;
import com.tohi.common.dto.MboPage;
import com.tohi.common.dto.POYsPerson;
import com.tohi.common.dto.WORKORDER;
import com.tohi.common.dto.mt.Contract;
import com.tohi.common.dto.mt.ContractLine;
import com.tohi.common.dto.mt.Invoice;
import com.tohi.common.dto.mt.InvoiceLine;
import com.tohi.common.dto.mt.Po;
import com.tohi.common.dto.mt.Poline;
import com.tohi.common.dto.mt.Pr;
import com.tohi.common.dto.mt.PrLine;
import com.tohi.common.dto.mt.Rfq;
import com.tohi.common.dto.mt.RfqFCG_RFQ_EXT_LINE;
import com.tohi.common.dto.mt.RfqLine;
import com.tohi.common.dto.mt.RfqQuotationlinevendor;
import com.tohi.common.dto.mt.RfqVENDOR;
import fcg.app.rfq.CustRFQ;
import psdi.dm.collection.DmCollAsyncJobHandler.mboReference;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
......@@ -1525,4 +1541,547 @@ public class MaximoUtil {
pagelist.add(page);
return pagelist;
}
//===========================================================================================
//===========================================================================================
//===========================================================================================
//===========================================================================================
//===========================================================================================
//===========================================================================================
//===========================================================================================
//煤炭采购申请
public static List getMtPr(String prid, String prnum, String description,
String rscount, String rsstart) throws RemoteException, MXException {
List<MboPage> pagelist = new ArrayList<MboPage>();
MXServer mxserver = MXServer.getMXServer();
MboSetRemote PRSet = mxserver.getMboSet("PR", mxserver.getSystemUserInfo());
String sql="";
if (!JSONUtil.isNull(prid)){
sql+=" prid = "+prid+" and ";
}
if (!JSONUtil.isNull(prnum)) {
sql+=" prnum like '%"+prnum+"%' and ";
}
if (!JSONUtil.isNull(description)) {
sql+=" description like '%"+description+"%' and ";
}
sql+=" CUSTTYPE2 ='COAL' ";
System.out.println("sql===="+sql);
PRSet.setWhere(sql);
PRSet.setOrderBy(" prid desc ");
PRSet.reset();
if (PRSet.isEmpty()) {
PRSet.close();
MboPage page = new MboPage();
page.setRsStart(0);
page.setRsCount(0);
page.setRsTotal(0);
List<Pr> list = new ArrayList<Pr>();
Pr pr=new Pr();
pr.getPrLineList().add(new PrLine());
list.add(pr);
page.setList(list);
pagelist.add(page);
return pagelist;
}
MboRemote mbo = null;
rsstart = JSONUtil.isNull(rsstart) ? "0" : rsstart;
rscount = JSONUtil.isNull(rscount) ? Integer.toString(JSONUtil.PAGESIZE) : rscount;
int startrow = Integer.parseInt(rsstart);
int endrow = startrow + Integer.parseInt(rscount);
int count = PRSet.count();
if (endrow > count) {
endrow = count - startrow;
if (endrow < 0)
endrow = 0;
}
MboPage page = new MboPage();
page.setRsStart(startrow);
page.setRsCount(endrow);
page.setRsTotal(count);
List<Pr> list = new ArrayList<Pr>();
for (int i = startrow; i < endrow; i++) {
mbo = PRSet.getMbo(i);
Pr pr=new Pr();
pr.setCUSTTYPE(mbo.getString("CUSTTYPE"));
pr.setDESCRIPTION(mbo.getString("DESCRIPTION"));
pr.setDISPLAYNAME(mbo.getString("FCG_REQUESTEDBY_PERSONID.DISPLAYNAME"));
pr.setFCG_GJDH(mbo.getString("FCG_GJDH"));
pr.setFCG_MEMO(mbo.getString("FCG_MEMO"));
pr.setFCG_PURCHASEMODE(mbo.getString("FCG_PURCHASEMODE"));
pr.setFCG_SQLY(mbo.getString("FCG_SQLY"));
pr.setFCG_SWJBR(mbo.getString("FCG_SWJBR"));
pr.setFCG_YGJE(mbo.getString("FCG_YGJE"));
pr.setPRID(mbo.getLong("PRID"));
pr.setPRNUM(mbo.getString("PRNUM"));
pr.setREQUESTEDBY(mbo.getString("REQUESTEDBY"));
MboSetRemote PrLineSet=mbo.getMboSet("PRLINE");
// if (PrLineSet.isEmpty()) {
// pr.getPrLineList().add(new PrLine());
// }
for (int j = 0; j < PrLineSet.count(); j++) {
MboRemote prlineMbo=PrLineSet.getMbo(j);
PrLine prline=new PrLine();
prline.setCUSTUSD(prlineMbo.getString("CUSTUSD"));
prline.setDESCRIPTION(prlineMbo.getString("DESCRIPTION"));
prline.setITEMNUM(prlineMbo.getString("ITEMNUM"));
prline.setJSSX(prlineMbo.getString("JSSX"));
prline.setLINECOST(prlineMbo.getString("LINECOST"));
prline.setORDERQTY(prlineMbo.getString("ORDERQTY"));
prline.setORDERUNIT(prlineMbo.getString("ORDERUNIT"));
prline.setUNITCOST(prlineMbo.getString("UNITCOST"));
pr.getPrLineList().add(prline);
}
list.add(pr);
}
PRSet.close();
page.setList(list);
pagelist.add(page);
return pagelist;
}
//煤炭框架合同
public static List getMtCon(String contractid, String contractnum, String description,
String rscount, String rsstart) throws RemoteException, MXException {
List<MboPage> pagelist = new ArrayList<MboPage>();
MXServer mxserver = MXServer.getMXServer();
MboSetRemote contractSet = mxserver.getMboSet("PURCHVIEW", mxserver.getSystemUserInfo());
String sql="";
if (!JSONUtil.isNull(contractid)){
sql+=" contractid = "+contractid+" and ";
}
if (!JSONUtil.isNull(contractnum)) {
sql+=" contractnum like '%"+contractnum+"%' and ";
}
if (!JSONUtil.isNull(description)) {
sql+=" description like '%"+description+"%' and ";
}
sql+=" CUSTTYPE='COAL' " ;
System.out.println("sql===="+sql);
contractSet.setWhere(sql);
contractSet.setOrderBy(" contractid desc ");
contractSet.reset();
if (contractSet.isEmpty()) {
contractSet.close();
MboPage page = new MboPage();
page.setRsStart(0);
page.setRsCount(0);
page.setRsTotal(0);
List<Contract> list = new ArrayList<Contract>();
Contract c=new Contract();
c.getContractLineList().add(new ContractLine());
list.add(c);
page.setList(list);
pagelist.add(page);
return pagelist;
}
rsstart = JSONUtil.isNull(rsstart) ? "0" : rsstart;
rscount = JSONUtil.isNull(rscount) ? Integer.toString(JSONUtil.PAGESIZE) : rscount;
int startrow = Integer.parseInt(rsstart);
int endrow = startrow + Integer.parseInt(rscount);
int count = contractSet.count();
if (endrow > count) {
endrow = count - startrow;
if (endrow < 0)
endrow = 0;
}
MboPage page = new MboPage();
page.setRsStart(startrow);
page.setRsCount(endrow);
page.setRsTotal(count);
List<Contract> list = new ArrayList<Contract>();
for (int i = startrow; i < endrow; i++) {
MboRemote contractMbo = contractSet.getMbo(i);
Contract c=new Contract();
c.setACTPOQTY(contractMbo.getString("ACTPOQTY"));
c.setCALORIFIC_VALUE(contractMbo.getString("CALORIFIC_VALUE"));
c.setCONTRACT_PRICE(contractMbo.getString("CONTRACT_PRICE"));
c.setCONTRACT_SUPPLY(contractMbo.getString("CONTRACT_SUPPLY"));
c.setCONTRACTID(contractMbo.getLong("CONTRACTID"));
c.setCONTRACTNUM(contractMbo.getString("CONTRACTNUM"));
c.setCURR_CODE(contractMbo.getString("CURR_CODE"));
c.setCUSTMAXVOL(contractMbo.getString("CUSTMAXVOL"));
c.setDELIVERY_DATE(contractMbo.getString("DELIVERY_DATE"));
c.setDELIVERY_DATE2(contractMbo.getString("DELIVERY_DATE2"));
c.setDESCRIPTION(contractMbo.getString("DESCRIPTION"));
c.setDISPLAYNAME(contractMbo.getString("FCG_SWJBR.DISPLAYNAME"));
c.setFCG_CJFS(contractMbo.getString("FCG_CJFS"));
c.setFCG_DJFS(contractMbo.getString("FCG_DJFS"));
c.setFCG_DSHDATA(contractMbo.getString("FCG_DSHDATA"));
c.setFCG_GLADATE(contractMbo.getString("FCG_GLADATE"));
c.setFCG_HTBH(contractMbo.getString("FCG_HTBH"));
c.setFCG_MZ(contractMbo.getString("FCG_MZ"));
c.setFCG_SWJBR(contractMbo.getString("FCG_SWJBR"));
c.setFLD_1(contractMbo.getString("FLD_1"));
c.setFLD_2(contractMbo.getString("FLD_2"));
c.setMARGIN_AMOUNT(contractMbo.getString("MARGIN_AMOUNT"));
c.setMAXRELVOL(contractMbo.getString("MAXRELVOL"));
c.setRATIFY_BUDGET_AMOUNT(contractMbo.getString("RATIFY_BUDGET_AMOUNT"));
MboSetRemote CONTRACTLINESet=contractMbo.getMboSet("CONTRACTLINE");
// if (CONTRACTLINESet.isEmpty()) {
// c.getContractLineList().add(new ContractLine());
// }
for (int j = 0; j < CONTRACTLINESet.count(); j++) {
MboRemote CONTRACTLINEMbo=CONTRACTLINESet.getMbo(j);
ContractLine line=new ContractLine();
line.setCUSTTAX1(CONTRACTLINEMbo.getString("CUSTTAX1"));
line.setCUSTTAX1CODE(CONTRACTLINEMbo.getString("CUSTTAX1CODE"));
line.setCUSTUNITCOST(CONTRACTLINEMbo.getString("CUSTUNITCOST"));
line.setCUSTUSD(CONTRACTLINEMbo.getString("CUSTUSD"));
line.setDESCRIPTION(CONTRACTLINEMbo.getString("DESCRIPTION"));
line.setENTERBY(CONTRACTLINEMbo.getString("ENTERBY"));
line.setENTERDATE(CONTRACTLINEMbo.getString("ENTERDATE"));
line.setITEMNUM(CONTRACTLINEMbo.getString("ITEMNUM"));
line.setLINECOST(CONTRACTLINEMbo.getString("LINECOST"));
line.setORDERQTY(CONTRACTLINEMbo.getString("ORDERQTY"));
line.setORDERUNIT(CONTRACTLINEMbo.getString("ORDERUNIT"));
line.setUNITCOST(CONTRACTLINEMbo.getString("UNITCOST"));
c.getContractLineList().add(line);
}
list.add(c);
}
contractSet.close();
page.setList(list);
pagelist.add(page);
return pagelist;
}
//煤炭支付申请
public static List getMtInvoice(String invoiceid, String invoicenum,
String description, String rscount, String rsstart) throws RemoteException, MXException {
List<MboPage> pagelist = new ArrayList<MboPage>();
MXServer mxserver = MXServer.getMXServer();
MboSetRemote InvoiceSet = mxserver.getMboSet("Invoice", mxserver.getSystemUserInfo());
String sql="";
if (!JSONUtil.isNull(invoiceid)){
sql+=" invoiceid = "+invoiceid+" and ";
}
if (!JSONUtil.isNull(invoicenum)) {
sql+=" invoicenum like '%"+invoicenum+"%' and ";
}
if (!JSONUtil.isNull(description)) {
sql+=" description like '%"+description+"%' and ";
}
sql+=" CUSTTYPE='COAL' ";
System.out.println("sql===="+sql);
InvoiceSet.setWhere(sql);
InvoiceSet.setOrderBy(" invoiceid desc ");
InvoiceSet.reset();
if (InvoiceSet.isEmpty()) {
InvoiceSet.close();
MboPage page = new MboPage();
page.setRsStart(0);
page.setRsCount(0);
page.setRsTotal(0);
List<Invoice> list = new ArrayList<Invoice>();
Invoice invoice=new Invoice();
invoice.getInvoiceLine().add(new InvoiceLine());
list.add(invoice);
page.setList(list);
pagelist.add(page);
return pagelist;
}
rsstart = JSONUtil.isNull(rsstart) ? "0" : rsstart;
rscount = JSONUtil.isNull(rscount) ? Integer.toString(JSONUtil.PAGESIZE) : rscount;
int startrow = Integer.parseInt(rsstart);
int endrow = startrow + Integer.parseInt(rscount);
int count = InvoiceSet.count();
if (endrow > count) {
endrow = count - startrow;
if (endrow < 0)
endrow = 0;
}
MboPage page = new MboPage();
page.setRsStart(startrow);
page.setRsCount(endrow);
page.setRsTotal(count);
List<Invoice> list = new ArrayList<Invoice>();
for (int i = startrow; i < endrow; i++) {
MboRemote InvoiceMbo = InvoiceSet.getMbo(i);
Invoice invoice=new Invoice();
invoice.setCOAL(InvoiceMbo.getString("COAL"));
invoice.setCOALTYPE(InvoiceMbo.getString("COALTYPE"));
invoice.setCONTRACTNATURE(InvoiceMbo.getString("CONTRACTNATURE"));
invoice.setCUSTUSD(InvoiceMbo.getString("CUSTUSD"));
invoice.setDESCRIPTION(InvoiceMbo.getString("DESCRIPTION"));
invoice.setDESCRIPTION_LONGDESCRIPTION(InvoiceMbo.getString("DESCRIPTION_LONGDESCRIPTION"));
invoice.setFCG_BJSF(InvoiceMbo.getString("FCG_BJSF"));
invoice.setFCG_PAYCLASS(InvoiceMbo.getString("FCG_PAYCLASS"));
invoice.setFCG_PAYTYPE(InvoiceMbo.getString("FCG_PAYTYPE"));
invoice.setFCG_RATE(InvoiceMbo.getString("FCG_RATE"));
invoice.setFCG_SHIPPERIOD(InvoiceMbo.getString("FCG_SHIPPERIOD"));
invoice.setFCG_TOTALCOSTPLAN(InvoiceMbo.getString("FCG_TOTALCOSTPLAN"));
invoice.setINVOICEID(InvoiceMbo.getLong("INVOICEID"));
invoice.setINVOICENUM(InvoiceMbo.getString("INVOICENUM"));
invoice.setLCNO(InvoiceMbo.getString("LCNO"));
invoice.setNAME(InvoiceMbo.getString("companies.name"));
invoice.setSTATUSDESC_DESCRIPTION(InvoiceMbo.getString("STATUSDESC.DESCRIPTION"));
invoice.setTRANSMODE(InvoiceMbo.getString("TRANSMODE"));
invoice.setVENDOR(InvoiceMbo.getString("VENDOR"));
MboSetRemote INVOICELINESet=InvoiceMbo.getMboSet("INVOICELINE");
// if (INVOICELINESet.isEmpty()) {
// invoice.getInvoiceLine().add(new InvoiceLine());
// }
for (int j = 0; j < INVOICELINESet.count(); j++) {
MboRemote INVOICELINEMbo=INVOICELINESet.getMbo(j);
InvoiceLine line=new InvoiceLine();
line.setDESCRIPTION(INVOICELINEMbo.getString("DESCRIPTION"));
line.setINVOICEUNIT(INVOICELINEMbo.getString("INVOICEUNIT"));
line.setLINECOSTFORUI(INVOICELINEMbo.getString("LINECOSTFORUI"));
line.setQTYFORUI(INVOICELINEMbo.getString("QTYFORUI"));
line.setUNITCOST(INVOICELINEMbo.getString("UNITCOST"));
invoice.getInvoiceLine().add(line);
}
list.add(invoice);
}
InvoiceSet.close();
page.setList(list);
pagelist.add(page);
return pagelist;
}
//煤炭询价单
public static List getMtRfq(String rfqid, String rfqnum,
String description, String rscount, String rsstart) throws RemoteException, MXException {
List<MboPage> pagelist = new ArrayList<MboPage>();
MXServer mxserver = MXServer.getMXServer();
MboSetRemote RfqSet = mxserver.getMboSet("Rfq", mxserver.getSystemUserInfo());
String sql="";
if (!JSONUtil.isNull(rfqid)){
sql+=" rfqid = "+rfqid+" and ";
}
if (!JSONUtil.isNull(rfqnum)) {
sql+=" rfqnum like '%"+rfqnum+"%' and ";
}
if (!JSONUtil.isNull(description)) {
sql+=" description like '%"+description+"%' and ";
}
sql+=" CUSTTYPE ='COAL'";
System.out.println("sql===="+sql);
RfqSet.setWhere(sql);
RfqSet.setOrderBy(" rfqid desc ");
RfqSet.reset();
if (RfqSet.isEmpty()) {
RfqSet.close();
MboPage page = new MboPage();
page.setRsStart(0);
page.setRsCount(0);
page.setRsTotal(0);
List<Rfq> list = new ArrayList<Rfq>();
Rfq rfq=new Rfq();
rfq.getRfqLineList().add(new RfqLine());
rfq.getRfqVENDORList().add(new RfqVENDOR());
rfq.getRfqFCG_RFQ_EXT_LINEList().add(new RfqFCG_RFQ_EXT_LINE());
list.add(rfq);
page.setList(list);
pagelist.add(page);
return pagelist;
}
rsstart = JSONUtil.isNull(rsstart) ? "0" : rsstart;
rscount = JSONUtil.isNull(rscount) ? Integer.toString(JSONUtil.PAGESIZE) : rscount;
int startrow = Integer.parseInt(rsstart);
int endrow = startrow + Integer.parseInt(rscount);
int count = RfqSet.count();
if (endrow > count) {
endrow = count - startrow;
if (endrow < 0)
endrow = 0;
}
MboPage page = new MboPage();
page.setRsStart(startrow);
page.setRsCount(endrow);
page.setRsTotal(count);
List<Rfq> list = new ArrayList<Rfq>();
for (int i = startrow; i < endrow; i++) {
MboRemote Rfqmbo = RfqSet.getMbo(i);
Rfq rfq=new Rfq();
rfq.setDESCRIPTION(Rfqmbo.getString("DESCRIPTION"));
rfq.setDISPLAYNAME(Rfqmbo.getString("SHIPTOPERSON.DISPLAYNAME"));
rfq.setFCG_DINGBIAODATE(Rfqmbo.getString("FCG_DINGBIAODATE"));
rfq.setFCG_DINGBIAODATE2(Rfqmbo.getString("FCG_DINGBIAODATE2"));
rfq.setFCG_JIEBIAODATE(Rfqmbo.getString("FCG_JIEBIAODATE"));
rfq.setFCG_JIEBIAODATE2(Rfqmbo.getString("FCG_JIEBIAODATE2"));
rfq.setFCG_MEMO(Rfqmbo.getString("FCG_MEMO"));
rfq.setFCG_PURCHASEMODE(Rfqmbo.getString("FCG_PURCHASEMODE"));
rfq.setFCG_REASON(Rfqmbo.getString("FCG_REASON"));
rfq.setFCG_ZHAOBIAODATE(Rfqmbo.getString("FCG_ZHAOBIAODATE"));
rfq.setFCG_ZHAOBIAODATE2(Rfqmbo.getString("FCG_ZHAOBIAODATE2"));
rfq.setREQUIREDDATE(Rfqmbo.getString("REQUIREDDATE"));
rfq.setRFQID(Rfqmbo.getLong("RFQID"));
rfq.setRFQNUM(Rfqmbo.getString("RFQNUM"));
rfq.setSHIPTOATTN(Rfqmbo.getString("SHIPTOATTN"));
rfq.setSTATUS(Rfqmbo.getString("STATUS"));
MboSetRemote RFQLINESet=Rfqmbo.getMboSet("RFQLINE");
// if (RFQLINESet.isEmpty()) {
// rfq.getRfqLineList().add(new RfqLine());
// }
for (int j = 0; j < RFQLINESet.count(); j++) {
MboRemote rfqlineMbo=RFQLINESet.getMbo(j);
RfqLine rfqline=new RfqLine();
rfqline.setCUSTUSD(rfqlineMbo.getString("CUSTUSD"));
rfqline.setDESCRIPTION(rfqlineMbo.getString("DESCRIPTION"));
rfqline.setITEMNUM(rfqlineMbo.getString("ITEMNUM"));
rfqline.setJSSX(rfqlineMbo.getString("JSSX"));
rfqline.setORDERQTY(rfqlineMbo.getString("ORDERQTY"));
rfqline.setORDERUNIT(rfqlineMbo.getString("ORDERUNIT"));
rfq.getRfqLineList().add(rfqline);
}
MboSetRemote FCG_RFQ_EXT_LINESet=Rfqmbo.getMboSet("FCG_RFQ_EXT_LINE");
// if (RFQLINESet.isEmpty()) {
// rfq.getRfqFCG_RFQ_EXT_LINEList().add(new RfqFCG_RFQ_EXT_LINE());
// }
for (int j = 0; j < FCG_RFQ_EXT_LINESet.count(); j++) {
MboRemote FCG_RFQ_EXT_LINEMbo=FCG_RFQ_EXT_LINESet.getMbo(j);
RfqFCG_RFQ_EXT_LINE RfqFCG_RFQ_EXT_LINE=new RfqFCG_RFQ_EXT_LINE();
RfqFCG_RFQ_EXT_LINE.setFCG_DHRQ(FCG_RFQ_EXT_LINEMbo.getString("FCG_DHRQ"));
RfqFCG_RFQ_EXT_LINE.setFCG_TJ_CNJE(FCG_RFQ_EXT_LINEMbo.getString("FCG_TJ_CNJE"));
RfqFCG_RFQ_EXT_LINE.setFCG_TJ_HTJ(FCG_RFQ_EXT_LINEMbo.getString("FCG_TJ_HTJ"));
RfqFCG_RFQ_EXT_LINE.setFCG_TJ_TJGYS(FCG_RFQ_EXT_LINEMbo.getString("FCG_TJ_TJGYS"));
RfqFCG_RFQ_EXT_LINE.setFCG_TJ_YJ(FCG_RFQ_EXT_LINEMbo.getString("FCG_TJ_YJ"));
RfqFCG_RFQ_EXT_LINE.setNAME(FCG_RFQ_EXT_LINEMbo.getString("COMPANIES.NAME"));
rfq.getRfqFCG_RFQ_EXT_LINEList().add(RfqFCG_RFQ_EXT_LINE);
}
MboSetRemote VENDORSet=Rfqmbo.getMboSet("RFQVENDOR");
for (int j = 0; j < VENDORSet.count(); j++) {
MboRemote VENDORMbo=VENDORSet.getMbo(j);
RfqVENDOR vendor=new RfqVENDOR();
vendor.setNAME(VENDORMbo.getString("COMPANIES.NAME"));
vendor.setVENDOR(VENDORMbo.getString("VENDOR"));
MboSetRemote QUOTATIONLINEVENDORSet=VENDORMbo.getMboSet("QUOTATIONLINEVENDOR");
for (int k = 0; k < QUOTATIONLINEVENDORSet.count(); k++) {
MboRemote qlineMbo=QUOTATIONLINEVENDORSet.getMbo(k);
RfqQuotationlinevendor line=new RfqQuotationlinevendor();
line.setDESCRIPTION(qlineMbo.getString("DESCRIPTION"));
line.setFCG_ZQFL(qlineMbo.getString("FCG_ZQFL"));
line.setISAWARDED(qlineMbo.getString("ISAWARDED"));
line.setITEMNUM(qlineMbo.getString("ITEMNUM"));
line.setORDERQTY(qlineMbo.getString("ORDERQTY"));
line.setORDERUNIT(qlineMbo.getString("ORDERUNIT"));
line.setQL5(qlineMbo.getString("QL5"));
line.setQUNITCOST(qlineMbo.getString("QUNITCOST"));
line.setRFQLINENUM(qlineMbo.getString("RFQLINENUM"));
line.setTAX1CODE(qlineMbo.getString("TAX1CODE"));
line.setUNITCOST(qlineMbo.getString("UNITCOST"));
vendor.getRfqQuotationlinevendorList().add(line);
}
rfq.getRfqVENDORList().add(vendor);
}
list.add(rfq);
}
RfqSet.close();
page.setList(list);
pagelist.add(page);
return pagelist;
}
//煤炭采购合同
public static List getMtPo(String poid, String ponum, String description,
String rscount, String rsstart) throws RemoteException, MXException {
List<MboPage> pagelist = new ArrayList<MboPage>();
MXServer mxserver = MXServer.getMXServer();
MboSetRemote PoSet = mxserver.getMboSet("Po", mxserver.getSystemUserInfo());
String sql="";
if (!JSONUtil.isNull(poid)){
sql+=" poid = "+poid+" and ";
}
if (!JSONUtil.isNull(ponum)) {
sql+=" ponum like '%"+ponum+"%' and ";
}
if (!JSONUtil.isNull(description)) {
sql+=" description like '%"+description+"%' and ";
}
sql+=" CUSTTYPE='COAL'";
System.out.println("sql===="+sql);
PoSet.setWhere(sql);
PoSet.setOrderBy(" poid desc ");
PoSet.reset();
if (PoSet.isEmpty()) {
PoSet.close();
MboPage page = new MboPage();
page.setRsStart(0);
page.setRsCount(0);
page.setRsTotal(0);
List<Po> list = new ArrayList<Po>();
Po po=new Po();
po.getPolineList().add(new Poline());
list.add(po);
page.setList(list);
pagelist.add(page);
return pagelist;
}
MboRemote mbo = null;
rsstart = JSONUtil.isNull(rsstart) ? "0" : rsstart;
rscount = JSONUtil.isNull(rscount) ? Integer.toString(JSONUtil.PAGESIZE) : rscount;
int startrow = Integer.parseInt(rsstart);
int endrow = startrow + Integer.parseInt(rscount);
int count = PoSet.count();
if (endrow > count) {
endrow = count - startrow;
if (endrow < 0)
endrow = 0;
}
MboPage page = new MboPage();
page.setRsStart(startrow);
page.setRsCount(endrow);
page.setRsTotal(count);
List<Po> list = new ArrayList<Po>();
for (int i = startrow; i < endrow; i++) {
MboRemote poMbo = PoSet.getMbo(i);
Po po=new Po();
po.setCONTRACTREFNUM(poMbo.getString("CONTRACTREFNUM"));
po.setCUSTSHIP(poMbo.getString("CUSTSHIP"));
po.setCUSTUSD(poMbo.getString("CONTRACTREF.CUSTUSD"));
po.setDESCRIPTION(poMbo.getString("DESCRIPTION"));
po.setFCG_HTBH(poMbo.getString("FCG_HTBH"));
po.setNAME(poMbo.getString("PO_VENDOR.NAME"));
po.setPOID(poMbo.getLong("POID"));
po.setPONUM(poMbo.getString("PONUM"));
po.setPURCHASEAGENT(poMbo.getString("PURCHASEAGENT"));
po.setTOTALCOST(poMbo.getString("TOTALCOST"));
po.setVENDOR(poMbo.getString("VENDOR"));
MboSetRemote polineMboSet=poMbo.getMboSet("POLINE");
for (int j = 0; j < polineMboSet.count(); j++) {
MboRemote pollineMbo=polineMboSet.getMbo(j);
Poline poline=new Poline();
poline.setCUSTUSD(pollineMbo.getString("CUSTUSD"));
poline.setDESCRIPTION(pollineMbo.getString("DESCRIPTION"));
poline.setENTERBY(pollineMbo.getString("ENTERBY"));
poline.setENTERDATE(pollineMbo.getString("ENTERDATE"));
poline.setLINECOST(pollineMbo.getString("LINECOST"));
poline.setORDERQTY(pollineMbo.getString("ORDERQTY"));
poline.setORDERUNIT(pollineMbo.getString("ORDERUNIT"));
poline.setPLIN1(pollineMbo.getString("PLIN1"));
poline.setTAX1(pollineMbo.getString("TAX1"));
poline.setTAX1CODE(pollineMbo.getString("TAX1CODE"));
poline.setUNITCOST(pollineMbo.getString("UNITCOST"));
po.getPolineList().add(poline);
}
list.add(po);
}
PoSet.close();
page.setList(list);
pagelist.add(page);
return pagelist;
}
}
package com.tohi.security;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import psdi.util.MXAccessException;
/**
* 域验证
* @author ocean
*
*/
public class SSOValidate {
private String serverHost = "";
private String domain = "";
private String port = "";
public static final String ACTIVE_DIRECTORY= "AD";
private static SSOValidate ssoValidate= null;
private SSOValidate() {
}
public static SSOValidate getInstance(){
if(ssoValidate==null) {
synchronized(SSOValidate.class) {
if(ssoValidate==null) {
ssoValidate = new SSOValidate();
}
}
}
return ssoValidate;
}
public SSOValidate setADParams(String serverHost,String domain) {
this.serverHost= serverHost;
this.domain = domain;
return this;
}
public SSOValidate setADParams(String serverHost,String domain,String port) {
this.serverHost= serverHost;
this.domain = domain;
this.port=port;
return this;
}
public boolean verifySSO(String userName,String passWord,String ssoType) throws Exception{
if(ACTIVE_DIRECTORY.equals(ssoType))
return verifyAdDoMain(userName,passWord);
//其他支持待扩展
return verifyAdDoMain(userName,passWord);
}
private boolean verifyAdDoMain(String userName, String passWord) throws Exception {
boolean checkAdUserPwdResult = false;
if (!serverHost.equals("") && !domain.equals("")) {
// String url = new String("ldap://" + this.serverHost + ":" + this.port);
String url = new String("ldap://" + this.serverHost );
String user = userName.indexOf(domain) > 0 ? userName : userName + this.domain;
Hashtable<String, String> env = new Hashtable<String, String>();
DirContext ctx = null;
env.put(Context.SECURITY_AUTHENTICATION, "simple");// LDAP域访问安全级别(none,simple,strong)simple:一般模式
env.put(Context.SECURITY_PRINCIPAL, user);
env.put(Context.SECURITY_CREDENTIALS, passWord);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");// LDAP工厂类
env.put(Context.PROVIDER_URL, url);
try {
ctx = new InitialDirContext(env);// 初始化上下文
checkAdUserPwdResult = true;
} catch (Exception e) {
e.printStackTrace();
throw new MXAccessException("access", "域用户或密码验证失败!");
} finally {
if (null != ctx) {
try {
ctx.close();
ctx = null;
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return checkAdUserPwdResult;
}
}
package com.tohi.security;
import java.rmi.RemoteException;
import java.util.Hashtable;
import java.util.Locale;
import java.util.TimeZone;
import javax.naming.AuthenticationException;
import javax.naming.Context;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import com.amazonaws.util.Base64;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.SqlFormat;
import psdi.security.SecurityService;
import psdi.security.SecurityServiceRemote;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.server.Service;
import psdi.util.MXAccessException;
import psdi.util.MXException;
import psdi.util.MaxType;
import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory;
public class UDSecurityService extends SecurityService implements Service, SecurityServiceRemote {
private boolean adLogin = false;
private String serverHost;
private String domain;
private String port = "389";
public UDSecurityService(MXServer mxServer) throws RemoteException {
super(mxServer);
if(MXServer.getMXServer().getProperty("ssoconfig.serverhost")!=null) {
serverHost= MXServer.getMXServer().getProperty("ssoconfig.serverhost");
}
if(MXServer.getMXServer().getProperty("ssoconfig.domain")!=null) {
domain= MXServer.getMXServer().getProperty("ssoconfig.domain");
}
if(MXServer.getMXServer().getProperty("ssoconfig.port")!=null) {
port= MXServer.getMXServer().getProperty("ssoconfig.port");
}
}
public UserInfo authenticateUserM(String[] loginID, String password, Locale locale, TimeZone timeZone, String siteId, String clientHostAddr) throws MXException, RemoteException {
//checkAdUser((String)null, loginID[0]);
return super.authenticateUserM(loginID, password, locale, timeZone, siteId, clientHostAddr);
}
/**
* todo:预留方法(Maximo用户与域名不一样情况时处理方法)
* @param userId
* @param loginID
* @return
* @throws RemoteException
* @throws MXException
*/
public boolean checkAdUser(String userId, String loginID) throws RemoteException, MXException {
boolean checkAdResult =false;
return checkAdResult;
}
@Override
protected void verifyUser(String userName, String enteredPassword, MboRemote userMbo) throws Exception {
if (!userName.equals(userMbo.getString("userid"))) {
throw new MXAccessException("access", "invaliduser");
} else {
byte[] storedPassword = userMbo.getBytes("password");
MaxType storedMT = MaxType.createMaxType((Locale)null, (TimeZone)null, 16);
storedMT.setValue(storedPassword);
byte[] enteredPasswordBytes = this.getMXCipherX().encData(enteredPassword);
MaxType enteredMT = MaxType.createMaxType((Locale)null, (TimeZone)null, 16);
enteredMT.setValue(enteredPasswordBytes);
if (!storedMT.equals(enteredMT)) {
if(MXServer.getMXServer().getProperty("ssoconfig.type")!=null) {
String ssoType = MXServer.getMXServer().getProperty("ssoconfig.type");
if(!SSOValidate
.getInstance()
.setADParams(this.serverHost, this.domain, this.port)
.verifySSO(userName, enteredPassword, ssoType))
{
throw new MXAccessException("access", "invaliduser");
}
}else {
throw new MXAccessException("access", "invaliduser");
}
}
}
}
@Override
public boolean isUser(UserInfo userinfo, String loginCheck, String passCheck) throws RemoteException, MXException {
boolean userIsGood = true;
userIsGood = super.isUser(userinfo, loginCheck, passCheck);
if(!userIsGood) {
//1本地校验不通过,则进行域验证
try {
if(MXServer.getMXServer().getProperty("ssoconfig.type")!=null) {
String ssoType = MXServer.getMXServer().getProperty("ssoconfig.type");
if(!SSOValidate
.getInstance()
.setADParams(this.serverHost, this.domain, this.port)
.verifySSO(loginCheck, loginCheck, ssoType))
{
userIsGood =false;
}
}
} catch (Exception e) {
userIsGood =false;
e.printStackTrace();
}
}
return userIsGood;
}
}
package com.tohi.webclient.beans.finexpense;
import java.rmi.RemoteException;
import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.beans.ResultsBean;
public class FinexpenseAppBean extends AppBean{
public void initializeApp() throws MXException, RemoteException {
super.initializeApp();
}
public int DOWNLOADFILE() throws MXException, RemoteException {
app.openURL("http://172.17.16.22:7001/FINEXPENSE/Ԥģ.xls", true);
return 1;
}
}
package com.tohi.webclient.beans.finexpense;
import java.io.File;
import java.io.IOException;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import jxl.CellType;
import jxl.DateCell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.UploadFile;
import psdi.webclient.system.controller.Utility;
import psdi.webclient.system.controller.WebClientEvent;
/**
* 费用预算变更批量导入
*/
public class UploadBGExcelBean extends DataBean {
String UpLoadType;
String dirName;
int row;
public UploadBGExcelBean() {
this.UpLoadType = "CLP-FCG";
this.row = 0;
this.dirName = "D:\\UpLoadXLS\\FINEXPENSE";
}
public synchronized int execute() throws MXException, RemoteException {
DataBean appBean = Utility.getDataSource(this.sessionContext, this.app.getAppHandler());
WebClientEvent event = this.sessionContext.getCurrentEvent();
UploadFile df = (UploadFile) this.app.get("doclinkfile");
if (df == null) {
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.getAppBean().save();
return 1;
}
try {
String filename = df.getFileName();
String subfilename = filename.substring(filename.indexOf(".") + 1);
if (!subfilename.equalsIgnoreCase("XLS")) {
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.remove("doclinkfile");
return 1;
}
df.setDirectoryName(this.dirName);
df.writeToDisk();
String fileNameInServer = df.getFileName();
df.save();
//上述保存至磁盘中
WorkbookSettings ws = new WorkbookSettings();
// 去除wookbook的读取excel时数据的有效性
ws.setCellValidationDisabled(true);
String url=this.dirName + "\\" + fileNameInServer;
System.out.println(url+"-------------------");
Workbook workbook = Workbook.getWorkbook(new File(url), ws);
Sheet sheet = workbook.getSheet(0);
int maxrow = sheet.getRows();
System.out.println("最大行数为:"+maxrow);
if (maxrow<=0) {
return 1;
}
//获取供应商询价行集合
System.out.println("获取集合");
MboSetRemote FINEXPENSELINESet = MXServer.getMXServer().getMboSet("FINEXPENSELINE",
MXServer.getMXServer().getSystemUserInfo());
System.out.println("集合中数据长度为:"+FINEXPENSELINESet.count());
// long maxID = 0;
System.out.println("遍历数据");
//遍历所有数据
String lineId="";
MboRemote wo =null;
for (this.row = 1; this.row < maxrow; this.row++) {
if (sheet.getCell(0, this.row).getContents().equals("") ) {
System.out.println("进入IF");
break;
}
String altercost=sheet.getCell(3, row).getContents();
System.out.println("altercost---"+altercost);
if (!lineId.equals(sheet.getCell(1, row).getContents())) {
FINEXPENSELINESet.setWhere("FINEXPENSELINEID='"+sheet.getCell(2, row).getContents()+"'");
if (!FINEXPENSELINESet.isEmpty()) {
wo = FINEXPENSELINESet.getMbo(0);
wo.setValue("ALTERCOST",wo.getDouble("ALTERCOST") + Double.parseDouble(altercost) , 11L);
wo.setValue("ACTUALCOST",wo.getDouble("ALTERCOST") +wo.getDouble("BUDGETCOST") );
wo.setValue("NETCOST",wo.getDouble("ACTUALCOST") - wo.getDouble("PROJECTCOST") );
System.out.println("ALTERCOST"+wo.getDouble("ALTERCOST"));
}
}
FINEXPENSELINESet.save();
}
System.out.println("导入完毕!!!");
FINEXPENSELINESet.save();
FINEXPENSELINESet.close();
workbook.close();
this.app.getAppBean().save();
} catch (MXException e) {
Utility.showMessageBox(event, "费用预算变更导入错误", e.getMessage() + " 行--" + this.row, null);
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
this.app.remove("doclinkfile");
return 1;
}
private Date formatStr2Date(String str) throws ParseException {
if (str == null || str.trim().equals(""))
return null;
String par = "yyyy-MM-dd hh:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(par);
Date date = sdf.parse(str);
return date;
}
}
......@@ -26,7 +26,6 @@ import psdi.webclient.system.controller.UploadFile;
import psdi.webclient.system.controller.Utility;
import psdi.webclient.system.controller.WebClientEvent;
/**
* 采购预算批量导入
*
*
*/
......
......@@ -8,6 +8,7 @@ import com.ibm.tivoli.maximo.report.birt.admin.ReportAdminServiceRemote;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.beans.invoice.InvoiceAppBean;
import psdi.webclient.system.controller.WebClientEvent;
......@@ -69,6 +70,22 @@ public class InvoiceClassAppBean extends InvoiceAppBean{
}
return super.RUNAREPORT();
}
@Override
public int ROUTEWF() throws MXException, RemoteException {
double num = getMbo().getDouble("FCG_BJSF")+getMbo().getDouble("FCG_LJSQJE");
double num1=getMbo().getDouble("PO.PURCHVIEW.CUSTMAXVOL");
System.out.println(num +"FldFcgBJSF-----"+num1);
if (num1!=0) {
if(num>num1) {
throw new MXApplicationException("\n提示:", "\n 累计支付申请金额+本次申请付款金额不能大于关联合同最大含税金额!");
}
}
return super.ROUTEWF();
}
......
......@@ -130,19 +130,23 @@ public class UploadExcelBean extends DataBean {
String QL5=sheet.getCell(10, row).getContents();
wo.setValue("QL5", QUNITCOST, 2L);
System.out.println(wo.getDouble("UNITCOST"));
double LINECOST=Double.parseDouble(QL5)/(1+(Double.parseDouble(TAX1CODE)*0.01));// 含税单价
System.out.println("含税总价==========="+LINECOST);
System.out.println("UNITCOST-----"+wo.getDouble("UNITCOST"));
wo.setValue("LINECOST",LINECOST, 2L);
System.out.println("UNITCOST111111-----"+wo.getDouble("UNITCOST"));
wo.setValue("MEMO", sheet.getCell(11, row).getContents(), 2L);
wo.setValue("RFQLINENUM", sheet.getCell(12, row).getContents(), 2L);
wo.setValue("TAX2", 0, 11L);
wo.setValue("TAX3", 0, 11L);
wo.setValue("TAX4", 0, 11L);
wo.setValue("TAX5", 0, 11L);
wo.setValue("GLCREDITACCT","9999-#-#", 2L);
wo.setValue("ITEMSETID","FCGITEM", 2L);
wo.setValue("COMMODITYGROUP", COMMODITYGROUP, 2L);
System.out.println(COMMODITYGROUP+"------------------------");
// wo.setValue("TAX2", 0, 11L);
// wo.setValue("TAX3", 0, 11L);
// wo.setValue("TAX4", 0, 11L);
// wo.setValue("TAX5", 0, 11L);
// wo.setValue("GLCREDITACCT","9999-#-#", 2L);
// wo.setValue("ITEMSETID","FCGITEM", 2L);
// wo.setValue("COMMODITYGROUP", COMMODITYGROUP, 2L);
}
System.out.println("导入完毕!!!");
QUOTATIONLINESet.save();
......
......@@ -24,7 +24,7 @@ public class StockAppBean extends AppBean {
if (!status.equalsIgnoreCase("WAPPR")) {
throw new MXApplicationException("", "当前状态不允许更改状态为盘点中!");
}
if(mainmbo.getMboSet("STOCKTAKINGLINE1").isEmpty())
if(mainmbo.getMboSet("STOCKTAKINGLINE").isEmpty())
throw new MXApplicationException("", "请添加盘点物资明细!");
mainmbo.setValue("status", "INPRG", 11L);
SAVE();
......@@ -34,10 +34,10 @@ public class StockAppBean extends AppBean {
MboRemote mainmbo = getMbo();
String status = mainmbo.getString("status");
if (!status.equalsIgnoreCase("INPRG")) {
throw new MXApplicationException("", "当前状态不允许更改状态为已盘点!");
}
// String status = mainmbo.getString("status");
// if (!status.equalsIgnoreCase("INPRG")) {
// throw new MXApplicationException("", "当前状态不允许更改状态为已盘点!");
// }
if(!mainmbo.getMboSet("STOCKTAKINGLINE1").isEmpty())
throw new MXApplicationException("", "存在未盘点完成的物资!");
mainmbo.setValue("status", "APPR", 11L);
......
package com.tohi.webclient.beans.stock;
import java.io.PrintStream;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
public class StockTakingDataBean
extends DataBean
{
public int dotaking()
throws RemoteException, MXException
{
MboRemote stocktaking = this.parent.getMbo();
// if (!stocktaking.toBeAdded()) {
// throw new MXApplicationException("", "盘点单已经保存,禁止更新系统盘点信息!");
// }
String status = stocktaking.getString("status");
if (!status.equalsIgnoreCase("WAPPR")) {
throw new MXApplicationException("", "当前状态已不能执行系统盘点!");
public class StockTakingDataBean extends DataBean {
public int dotaking() throws RemoteException, MXException {
MboRemote stocktaking = this.parent.getMbo();
if (stocktaking.isNull("SPECIALITY")) {
throw new MXApplicationException("", "请选择盘点专业!");
}
if (stocktaking.toBeAdded()) {
throw new MXApplicationException("", "请先保存盘点单后,再执行系统盘点!");
}
String status = stocktaking.getString("status");
if (status.equalsIgnoreCase("APPR")) {
throw new MXApplicationException("", "当前状态已不能执行系统盘点!");
}
if (stocktaking.getBoolean("HASTAKING")) {
throw new MXApplicationException("", "系统盘点已执行,如需重新盘点,请先执行清除操作!");
}
String sql = "curbal > 0 ";
if (!stocktaking.isNull("location"))
sql += " and location = '" + stocktaking.getString("location") + "'";
if (!stocktaking.isNull("commodity"))
sql += " and itemnum in (select itemnum from item where COMMODITYGROUP ='"
+ stocktaking.getString("commodity") + "')";
if (!stocktaking.isNull("SPECIALITY"))
sql += " and itemnum in (select itemnum from item where FCG_SPECIALITY ='"
+ stocktaking.getString("SPECIALITY") + "')";
if (!stocktaking.isNull("WXGROUP"))
sql += " and itemnum in (select itemnum from item where FCG_WXZ ='" + stocktaking.getString("WXGROUP")
+ "')";
System.out.println("-----StockTakingDataBean-01 sql: " + sql.toString());
MboSetRemote invbalancesmsr = stocktaking.getMboSet("$temp_invbalances", "INVBALANCES", sql.toString());
invbalancesmsr.setOrderBy("location,BINNUM");
invbalancesmsr.reset();
if (invbalancesmsr.isEmpty()) {
throw new MXApplicationException("", "未查询到数据!");
}
int i = 0;
MboRemote invbalances = null;
MboRemote stocktakingline = null;
MboSetRemote stocktakinglinemsr = stocktaking.getMboSet("stocktakingline");
if (!stocktakinglinemsr.isEmpty()) {
stocktakinglinemsr.deleteAll();
}
while ((invbalances = invbalancesmsr.getMbo(i)) != null) {
stocktakingline = stocktakinglinemsr.add();
stocktakingline.setValue("location", invbalances.getString("location"), 11L);
stocktakingline.setValue("ITEMNUM", invbalances.getString("itemnum"), 11L);
stocktakingline.setValue("BINNUM", invbalances.getString("BINNUM"), 11L);
stocktakingline.setValue("CURBAL", invbalances.getDouble("CURBAL"), 11L);
stocktakingline.setValue("UNITCOST", stocktakingline.getDouble("INVCOST.avgcost"), 11L);
stocktakingline.setValue("LINECOST", stocktakingline.getDouble("CURBAL")*stocktakingline.getDouble("UNITCOST"), 11L);
i++;
}
invbalancesmsr.close();
stocktaking.setValue("HASTAKING", true, 11L);
stocktakinglinemsr.save();
stocktakinglinemsr.reset();
app.getAppBean().fireStructureChangedEvent();
return 1;
}
public int cleartaking() throws RemoteException, MXException {
MboRemote stocktaking = this.parent.getMbo();
// if (!stocktaking.toBeAdded()) {
// throw new MXApplicationException("", "盘点单已经保存,不能执行该操作!");
// }
if (!stocktaking.getString("status").equalsIgnoreCase("WAPPR")) {
throw new MXApplicationException("", "当前状态不能执行该操作!");
}
MboSetRemote stocktakinglinemsr = stocktaking.getMboSet("stocktakingline");
stocktakinglinemsr.deleteAll();
stocktaking.setValue("HASTAKING", false, 11L);
stocktakinglinemsr.save();
app.getAppBean().fireStructureChangedEvent();
return 1;
}
public int allcomp() throws RemoteException, MXException {
MboRemote stocktaking = this.parent.getMbo();
if (stocktaking.getString("status").equalsIgnoreCase("APPR")) {
throw new MXApplicationException("", "当前状态不能执行该操作!");
}
MboSetRemote stocktakinglinemsr = stocktaking.getMboSet("stocktakingline");
int i = 0;
MboRemote invbalances = null;
while ((invbalances = stocktakinglinemsr.getMbo(i)) != null) {
if(!invbalances.getBoolean("ISCOMPLETE"))
invbalances.setValue("STOCKBAL", invbalances.getDouble("CURBAL"), 2L);
i++;
}
stocktakinglinemsr.save();
app.getAppBean().fireStructureChangedEvent();
return 1;
}
public int addrow() throws MXException {
try {
MboSetRemote msr = getMboSet();
MboRemote mainmbo = msr.getOwner();
String status = mainmbo.getString("status");
if ((!"WAPPR".equals(status)) && (!"APPR".equals(status))) {
throw new MXApplicationException("", "只有盘点单状态为 新建或盘点中 时才能新建人工盘点行!");
}
super.addrow();
} catch (RemoteException e) {
e.printStackTrace();
}
return 1;
}
public int toggledeleterow() throws MXException {
// try
// {
// MboRemote mbo = getMbo();
// if (mbo.getBoolean("ISSYSTEM")) {
// throw new MXApplicationException("", "该行是系统盘点行,不能删除!");
// }
// String status = mbo.getOwner().getString("status");
// if ((!"盘点中".equals(status)) && (!"退回".equals(status))) {
// throw new MXApplicationException("", "只有盘点单状态为 盘点中 时才能执行删除操作!");
// }
// }
// catch (RemoteException e)
// {
// e.printStackTrace();
// }
return super.toggledeleterow();
}
if (stocktaking.isNull("location")) {
throw new MXApplicationException("", "请选择盘点库房!");
}
if (stocktaking.getBoolean("HASTAKING")) {
throw new MXApplicationException("", "系统盘点已执行,如需重新盘点,请先执行清除操作!");
}
String location = stocktaking.getString("location");
String sql = "curbal > 0 and location = '" + location + "'";
if(!stocktaking.isNull("commodity"))
sql +=" and itemnum in (select itemnum from item where COMMODITYGROUP ='"+stocktaking.getString("commodity")+"')";
if(!stocktaking.isNull("SPECIALITY"))
sql +=" and itemnum in (select itemnum from item where FCG_SPECIALITY ='"+stocktaking.getString("SPECIALITY")+"')";
if(!stocktaking.isNull("WXGROUP"))
sql +=" and itemnum in (select itemnum from item where FCG_WXZ ='"+stocktaking.getString("WXGROUP")+"')";
System.out.println("-----StockTakingDataBean-01 sql: " + sql.toString());
MboSetRemote invbalancesmsr = stocktaking.getMboSet("$temp_invbalances", "INVBALANCES", sql.toString());
//--------跟据库存编号排序--------
invbalancesmsr.setOrderBy("BINNUM");
invbalancesmsr.reset();
if (invbalancesmsr.isEmpty()) {
throw new MXApplicationException("", "未查询到数据!");
}
int i = 0;
MboRemote invbalances = null;
MboRemote stocktakingline = null;
MboSetRemote stocktakinglinemsr = stocktaking.getMboSet("stocktakingline");
if (!stocktakinglinemsr.isEmpty()) {
stocktakinglinemsr.deleteAll();
}
while ((invbalances = invbalancesmsr.getMbo(i)) != null)
{
stocktakingline = stocktakinglinemsr.add();
stocktakingline.setValue("location", location, 11L);
stocktakingline.setValue("ITEMNUM", invbalances.getString("itemnum"), 11L);
stocktakingline.setValue("BINNUM", invbalances.getString("BINNUM"), 11L);
stocktakingline.setValue("CURBAL", invbalances.getDouble("CURBAL"), 11L);
i++;
}
invbalancesmsr.close();
stocktaking.setValue("HASTAKING", true, 11L);
stocktakinglinemsr.save();
stocktakinglinemsr.reset();
app.getAppBean().fireStructureChangedEvent();
return 1;
}
public int cleartaking()
throws RemoteException, MXException
{
MboRemote stocktaking = this.parent.getMbo();
// if (!stocktaking.toBeAdded()) {
// throw new MXApplicationException("", "盘点单已经保存,不能执行该操作!");
// }
if (!stocktaking.getString("status").equalsIgnoreCase("WAPPR")) {
throw new MXApplicationException("", "当前状态不能执行该操作!");
}
MboSetRemote stocktakinglinemsr = stocktaking.getMboSet("stocktakingline");
stocktakinglinemsr.deleteAll();
stocktaking.setValue("HASTAKING", false, 11L);
stocktakinglinemsr.save();
app.getAppBean().fireStructureChangedEvent();
return 1;
}
public int addrow()
throws MXException
{
try
{
MboSetRemote msr = getMboSet();
MboRemote mainmbo = msr.getOwner();
String status = mainmbo.getString("status");
if ((!"WAPPR".equals(status)) && (!"APPR".equals(status))) {
throw new MXApplicationException("", "只有盘点单状态为 新建或盘点中 时才能新建人工盘点行!");
}
super.addrow();
}
catch (RemoteException e)
{
e.printStackTrace();
}
return 1;
}
public int toggledeleterow()
throws MXException
{
// try
// {
// MboRemote mbo = getMbo();
// if (mbo.getBoolean("ISSYSTEM")) {
// throw new MXApplicationException("", "该行是系统盘点行,不能删除!");
// }
// String status = mbo.getOwner().getString("status");
// if ((!"盘点中".equals(status)) && (!"退回".equals(status))) {
// throw new MXApplicationException("", "只有盘点单状态为 盘点中 时才能执行删除操作!");
// }
// }
// catch (RemoteException e)
// {
// e.printStackTrace();
// }
return super.toggledeleterow();
}
}
......@@ -104,6 +104,16 @@ public class MaximoAPPHandler {
getMAXGROUP(request, response);
}else if ("getWotrack".equals(method)) {//工单跟踪模块
getWotrack(request, response);
}else if ("getMtPr".equals(method)) {//煤炭采购申请
getMtPr(request, response);
}else if ("getMtPo".equals(method)) {//煤炭采购订单
getMtPo(request, response);
}else if ("getMtRfq".equals(method)) {//煤炭询价单
getMtRfq(request, response);
}else if ("getMtInvoice".equals(method)) {//煤炭支付申请
getMtInvoice(request, response);
}else if ("getMtCon".equals(method)) {//煤炭框架
getMtCon(request, response);
}else {
response.getWriter().println(JSONUtil.msg("错误:应用操作不存在!"));
}
......@@ -117,6 +127,88 @@ public class MaximoAPPHandler {
private static void getMtCon(HttpServletRequest request,
HttpServletResponse response) throws MXException, IOException{
String contractid = request.getParameter("contractid");
String contractnum = request.getParameter("contractnum");
String description = request.getParameter("description");
String _maxItem = request.getParameter("rscount");
String _rsStart = request.getParameter("rsstart");
List list=MaximoUtil.getMtCon(contractid,contractnum,description,_maxItem,_rsStart);
JSONArray o = JSONArray.fromObject(list);
response.getWriter().println(o.toString());
}
private static void getMtInvoice(HttpServletRequest request,
HttpServletResponse response) throws MXException, IOException{
String invoiceid = request.getParameter("invoiceid");
String invoicenum = request.getParameter("invoicenum");
String description = request.getParameter("description");
String _maxItem = request.getParameter("rscount");
String _rsStart = request.getParameter("rsstart");
List list=MaximoUtil.getMtInvoice(invoiceid,invoicenum,description,_maxItem,_rsStart);
JSONArray o = JSONArray.fromObject(list);
response.getWriter().println(o.toString());
}
private static void getMtRfq(HttpServletRequest request,
HttpServletResponse response)throws MXException, IOException {
String rfqid = request.getParameter("rfqid");
String rfqnum = request.getParameter("rfqnum");
String description = request.getParameter("description");
String _maxItem = request.getParameter("rscount");
String _rsStart = request.getParameter("rsstart");
List list=MaximoUtil.getMtRfq(rfqid,rfqnum,description,_maxItem,_rsStart);
JSONArray o = JSONArray.fromObject(list);
response.getWriter().println(o.toString());
}
private static void getMtPo(HttpServletRequest request,
HttpServletResponse response) throws MXException, IOException{
String poid = request.getParameter("poid");
String ponum = request.getParameter("ponum");
String description = request.getParameter("description");
String _maxItem = request.getParameter("rscount");
String _rsStart = request.getParameter("rsstart");
List list=MaximoUtil.getMtPo(poid,ponum,description,_maxItem,_rsStart);
JSONArray o = JSONArray.fromObject(list);
response.getWriter().println(o.toString());
}
//煤炭采购申请
private static void getMtPr(HttpServletRequest request,
HttpServletResponse response) throws MXException, IOException {
String prid = request.getParameter("prid");
String prnum = request.getParameter("prnum");
String description = request.getParameter("description");
String _maxItem = request.getParameter("rscount");
String _rsStart = request.getParameter("rsstart");
List list=MaximoUtil.getMtPr(prid,prnum,description,_maxItem,_rsStart);
JSONArray o = JSONArray.fromObject(list);
response.getWriter().println(o.toString());
}
public static void GetLoginMax(HttpServletRequest request, HttpServletResponse response)
throws IOException, MXException {
......
......@@ -44,7 +44,8 @@ public class CustContractLine
}
if(releasePOLineRemote.isNull("GLCREDITACCT"))
releasePOLineRemote.setValue("GLCREDITACCT", "9999-#-#", 2L);
releasePOLineRemote.setValue("CUSTUSD", getBoolean("CUSTUSD"),2L);
releasePOLineRemote.setValue("CUSTUSD", getBoolean("CUSTUSD"),2L);//是否美金
// releasePOLineRemote.setValue("FCG_LEADTIME", getString("FCG_LEADTIME"),2L);//交货期
if (releasePOLineRemote.getName().equalsIgnoreCase("PRLINE"))
{
releasePOLineRemote.setValue("RL2", getString("fcg_projectid"), 11L);
......@@ -80,12 +81,13 @@ public class CustContractLine
String description = contlines[2];
String custdept = contlines[3];
String fcg_projectid = contlines[4];
String orderqty = contlines[5];
String orderunit = contlines[6];
String custunitcost = contlines[7];
String custtax1code = contlines[8];
String chgqtyonuse = contlines[9];
String chgpriceonuse = contlines[10];
String fcg_taskid = contlines[5]; //改变此顺序
String orderqty = contlines[6];
String orderunit = contlines[7];
String custunitcost = contlines[8];
String custtax1code = contlines[9];
String chgqtyonuse = contlines[10];
String chgpriceonuse = contlines[11];
if (orderqty.equals("")) {
orderqty = "0";
}
......@@ -95,6 +97,7 @@ public class CustContractLine
try
{
setValue("LINETYPE", linetype);
setValue("FCG_TASKID", fcg_taskid);
setValue("COMMODITYGROUP", commoditygroup);
setValue("DESCRIPTION", description);
setValue("CUSTDEPT", custdept);
......
......@@ -36,33 +36,38 @@ public class CustFldFCG_HTFL extends MboValueAdapter implements MboConstants {
Mbo mbo = getMboValue().getMbo();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String a = mbo.getString("FCG_HTFL");
// String a = mbo.getString("FCG_HTFL");
String a =getMboValue().getString();
Date now = new Date();
String now1 = formatter.format(now);
String dt = now1.substring(0, 4);
String c = "FCG-" + dt + "-";
String htbh = c + a + "-";
System.out.println("htbh============="+htbh);
MboSetRemote num_mboset = mbo.getMboSet("$porecord", "CONTRACT", "FCG_HTBH LIKE '" + htbh
+ "%' and contractnum<>'" + mbo.getString("contractnum") + "' and STATUS<>'CAN'");
String num = String.valueOf(num_mboset.count() + 1);
num_mboset.setOrderBy("FCG_HTBH desc ");
String num ="";
if (!num_mboset.isEmpty()) {
num = num_mboset.getMbo(0).getString("FCG_HTBH").substring(12);
}else{
num ="0";
}
System.out.println(num);
num=String.valueOf(Integer.valueOf(num)+1);
// String num = String.valueOf(num);
int i_long = 3 - num.length();
if (i_long == 1) {
num = "0" + num;
}
//
if (i_long == 2) {
num = "00" + num;
}
//
if (i_long == 3) {
num = "000" + num;
}
......
package fcg.app.inventory;
import fcg.util.FCGUtil;
import java.rmi.RemoteException;
import psdi.app.inventory.MatUseTrans;
import psdi.app.inventory.MatUseTransRemote;
import psdi.mbo.Mbo;
import psdi.mbo.MboSet;
import psdi.util.MXException;
public class FCGMatUseTrans
extends MatUseTrans
implements MatUseTransRemote
{
private static final long serialVersionUID = 1L;
public FCGMatUseTrans(MboSet mboset)
throws MXException, RemoteException
{
super(mboset);
}
public void save()
throws MXException, RemoteException
{
FCGUtil fcgUtil = new FCGUtil();
Mbo mboCurrent = this;
String strISSUETYPE = getString("ISSUETYPE");
String strGLDEBITACCT = "9999-#-#";
String strGLCREDITACCT = "220201-#-#";
String strCOMMODITYGROUP = getString("COMMODITYGROUP");
String linetype = mboCurrent.getString("LINETYPE");
String dept = "";
String ISPROJECT = "";
String custdept = "";
String custprojectid = "";
String custtaskid = "";
String custsystem = "";
String strREFID = "";
if ((getString("COMMODITYGROUP") != null) && (getString("COMMODITYGROUP") != ""))
{
if (((linetype.equals("ITEM")) || (linetype.equals("MATERIAL"))) && (!getString("WONUM").equals("")))
{
dept = mboCurrent.getString("WORKORDER.custlldw.str1");
ISPROJECT = mboCurrent.getString("WORKORDER.FCG_TASKID.ISPROJECT");
custdept = mboCurrent.getString("WORKORDER.custlldw.str2");
custprojectid = mboCurrent.getString("WORKORDER.fcg_projectid");
custtaskid = mboCurrent.getString("WORKORDER.fcg_taskid");
custsystem = mboCurrent.getString("WORKORDER.FCG_KKS2_2");
strREFID = "W" + getString("WONUM");
}
else if (((linetype.equals("MATERIAL")) || (linetype.equals("SERVICE"))) && (!getString("PONUM").equals("")))
{
dept = mboCurrent.getString("poline.dept.str1");
ISPROJECT = mboCurrent.getString("poline.FCG_TASKID.ISPROJECT");
custdept = mboCurrent.getString("poline.dept.str2");
custprojectid = mboCurrent.getString("poline.pl2");
custtaskid = mboCurrent.getString("poline.pl3");
strREFID = "P" + getString("PONUM");
}
strGLDEBITACCT = fcgUtil.validateGldebitacct1(strGLDEBITACCT, strCOMMODITYGROUP, ISPROJECT, linetype, dept);
strGLCREDITACCT = fcgUtil.validateGlcreditacct1(strGLCREDITACCT, strCOMMODITYGROUP, linetype);
if ((strISSUETYPE.equalsIgnoreCase("ISSUE")) || (strISSUETYPE.equalsIgnoreCase("INVOICE")))
{
setValue("GLDEBITACCT", strGLDEBITACCT, 2L);
setValue("GLCREDITACCT", strGLCREDITACCT, 2L);
}
else if (strISSUETYPE.equalsIgnoreCase("RETURN"))
{
setValue("GLDEBITACCT", strGLCREDITACCT, 2L);
setValue("GLCREDITACCT", strGLDEBITACCT, 2L);
}
}
setValue("custdept", custdept, 2L);
setValue("custprojectid", custprojectid, 2L);
setValue("custtaskid", custtaskid, 2L);
setValue("custsystem", custsystem, 2L);
setValue("REFID", strREFID, 2L);
super.save();
}
}
......@@ -2,7 +2,7 @@ package fcg.app.invoice;
import java.rmi.RemoteException;
import psdi.app.contract.common.FldCommonContractVendor;
import psdi.app.invoice.FldInvoiceVendor;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
......@@ -10,7 +10,7 @@ import psdi.mbo.MboValue;
import psdi.util.MXException;
public class CustInvoiceVendor
extends FldCommonContractVendor
extends FldInvoiceVendor
{
MboRemote mbo = null;
public CustInvoiceVendor(MboValue mbv)
......
......@@ -213,7 +213,7 @@ public class CustPO extends PO implements CustPORemote {
}
//System.out.println("===toalcost===" + toalcost);
double netcost = fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST");
- fincntrl.getDouble("PROJECTCOST")- fincntrl.getDouble("PENDINGCOST");
//System.out.println("netcost:" + netcost);
if (netcost < toalcost) {
finSet.close();
......@@ -293,7 +293,7 @@ public class CustPO extends PO implements CustPORemote {
System.out.println("===fincntrlID===" + fincntrl.getString("finexpenselineid"));
fincntrl.setValue("PROJECTCOST", fincntrl.getDouble("PROJECTCOST")+toalcost);
fincntrl.setValue("netcost", fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST"));
- fincntrl.getDouble("PROJECTCOST")- fincntrl.getDouble("PENDINGCOST"));
finSet.save();
finSet.close();
}
......@@ -357,53 +357,56 @@ public class CustPO extends PO implements CustPORemote {
Date now = new Date();
setValue("apprdate", now);
}
if ((maxType.equals("REL")) && (status.equals("APPR"))) {
PurchViewRemote purchViewRemote = (PurchViewRemote) getMboSet("PURCHVIEW").getMbo(0);
CurrencyServiceRemote currServ = (CurrencyServiceRemote) MXServer.getMXServer().lookup("CURRENCY");
double totalReleaseCost = 0.0D;
if (purchViewRemote.getString("currencycode").equalsIgnoreCase(getString("currencycode"))) {
String contractnum = purchViewRemote.getString("contractnum");
totalReleaseCost = getInvoiceVariance(contractnum) + getAmountReceived(contractnum, poNum)
+ getAmountOnOrder(contractnum) + getDouble("TOTALCOST");
} else {
String contractnum = purchViewRemote.getString("contractnum");
totalReleaseCost = getInvoiceVariance(contractnum) + getAmountReceived(contractnum, poNum)
+ getAmountOnOrder(contractnum)
+ getDouble("pretaxtotal") * currServ.getCurrencyExchangeRate(getUserInfo(),
getString("currencycode"), purchViewRemote.getString("currencycode"), date,
purchViewRemote.getString("orgid"));
}
if ((!purchViewRemote.isNull("custmaxvol"))
&& (totalReleaseCost > purchViewRemote.getDouble("custmaxvol"))) {
Double diffInCosts = new Double(totalReleaseCost - purchViewRemote.getDouble("custmaxvol"));
if (purchViewRemote.getBoolean("canexceedvolume")) {
String[] params = { purchViewRemote.getString("custmaxvol"),
purchViewRemote.getString("currencycode"), purchViewRemote.getString("contractnum"),
MXFormat.doubleToString(diffInCosts.doubleValue(),
MXServer.getMXServer().getMaximoDD().getMboSetInfo("PURCHVIEW")
.getMboValueInfo("totalcost").getScale()),
purchViewRemote.getString("currencycode") };
UserInfo userInfo = getUserInfo();
if (true) {
int userInput = MXApplicationYesNoCancelException.getUserInput("exceedsMaxVolWarning",
MXServer.getMXServer(), userInfo);
switch (userInput) {
case -1:
throw new MXApplicationYesNoCancelException("exceedsMaxVolWarning", "contract",
"exceedsMaxVol", params);
if (! getString("CUSTTYPE").equalsIgnoreCase("COAL")) {
if ((maxType.equals("REL")) && (status.equals("APPR")) ) {
PurchViewRemote purchViewRemote = (PurchViewRemote) getMboSet("PURCHVIEW").getMbo(0);
CurrencyServiceRemote currServ = (CurrencyServiceRemote) MXServer.getMXServer().lookup("CURRENCY");
double totalReleaseCost = 0.0D;
if (purchViewRemote.getString("currencycode").equalsIgnoreCase(getString("currencycode"))) {
String contractnum = purchViewRemote.getString("contractnum");
totalReleaseCost = getInvoiceVariance(contractnum) + getAmountReceived(contractnum, poNum)
+ getAmountOnOrder(contractnum) + getDouble("TOTALCOST");
} else {
String contractnum = purchViewRemote.getString("contractnum");
totalReleaseCost = getInvoiceVariance(contractnum) + getAmountReceived(contractnum, poNum)
+ getAmountOnOrder(contractnum)
+ getDouble("pretaxtotal") * currServ.getCurrencyExchangeRate(getUserInfo(),
getString("currencycode"), purchViewRemote.getString("currencycode"), date,
purchViewRemote.getString("orgid"));
}
if ((!purchViewRemote.isNull("custmaxvol"))
&& (totalReleaseCost > purchViewRemote.getDouble("custmaxvol"))) {
Double diffInCosts = new Double(totalReleaseCost - purchViewRemote.getDouble("custmaxvol"));
if (purchViewRemote.getBoolean("canexceedvolume")) {
String[] params = { purchViewRemote.getString("custmaxvol"),
purchViewRemote.getString("currencycode"), purchViewRemote.getString("contractnum"),
MXFormat.doubleToString(diffInCosts.doubleValue(),
MXServer.getMXServer().getMaximoDD().getMboSetInfo("PURCHVIEW")
.getMboValueInfo("totalcost").getScale()),
purchViewRemote.getString("currencycode") };
UserInfo userInfo = getUserInfo();
if (true) {
int userInput = MXApplicationYesNoCancelException.getUserInput("exceedsMaxVolWarning",
MXServer.getMXServer(), userInfo);
switch (userInput) {
case -1:
throw new MXApplicationYesNoCancelException("exceedsMaxVolWarning", "contract",
"exceedsMaxVol", params);
}
}
} else {
String[] params2 = { purchViewRemote.getString("custmaxvol"),
purchViewRemote.getString("currencycode"),
MXFormat.doubleToString(diffInCosts.doubleValue(),
MXServer.getMXServer().getMaximoDD().getMboSetInfo("PURCHVIEW")
.getMboValueInfo("totalcost").getScale()),
purchViewRemote.getString("currencycode") };
throw new MXApplicationException("po", "exceededMaxVol", params2);
}
}
} else {
String[] params2 = { purchViewRemote.getString("custmaxvol"),
purchViewRemote.getString("currencycode"),
MXFormat.doubleToString(diffInCosts.doubleValue(),
MXServer.getMXServer().getMaximoDD().getMboSetInfo("PURCHVIEW")
.getMboValueInfo("totalcost").getScale()),
purchViewRemote.getString("currencycode") };
throw new MXApplicationException("po", "exceededMaxVol", params2);
}
}
}
super.changeStatus(status, date, memo, accessModifier);
Object aobj[] = { getString("PONUM"), status };
......@@ -449,13 +452,16 @@ public class CustPO extends PO implements CustPORemote {
String sql = "UPDATE fincntrl SET usecost =(SELECT SUM(ISNULL(poline.linecost, 0) + ISNULL(poline.tax1, 0)) AS COST FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN fincntrl AS a ON poline.pl2 = a.projectid WHERE (po.status <> 'CAN' "
+ statusSql + ") AND (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') "
+ " AND poline.pl2 in (" + projectids + ") and poline.pl3 in (" + finctrlid + ")),";
sql += "CONpendingcost = ISNULL ((SELECT SUM(ISNULL(contract.cost2, 0)) AS COST FROM (SELECT a.contractnum, a.contractlinenum, a.enterdate, a.fcg_projectid,a.fcg_taskid, a.linecost AS cost, a1.linecost AS cost1, (CASE WHEN (ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)) > 0 THEN ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0) ELSE 0 END) AS cost2 FROM (SELECT c.contractnum, cl1.contractlinenum, cl1.enterdate, cl1.fcg_projectid,cl1.fcg_taskid,cl1.linecost FROM contract AS c LEFT OUTER JOIN (SELECT contractnum, revisionnum, contractlinenum, enterdate, linecost+custtax1 linecost, fcg_projectid ,fcg_taskid FROM contractline) AS cl1 ON c.contractnum = cl1.contractnum AND c.revisionnum = cl1.revisionnum WHERE (c.status in('DRAFT','WSTART','APPR','WAPPR'))) AS a LEFT OUTER JOIN (SELECT poline.contractrefnum AS contractnum, CL1.contractlinenum AS CONTRACTLINENUM, SUM(poline.linecost+poline.tax1) AS linecost FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN contractline AS CL1 ON poline.contreflineid = CL1.contractlineid WHERE (po.status <> 'CAN'"
sql += "CONpendingcost = ISNULL ((SELECT SUM(ISNULL(contract.cost2, 0)) AS COST FROM (SELECT a.contractnum, a.contractlinenum, a.enterdate, a.fcg_projectid,a.fcg_taskid, a.linecost AS cost, a1.linecost AS cost1, (CASE WHEN (ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0)) > 0 THEN ISNULL(a.linecost, 0) - ISNULL(a1.linecost, 0) ELSE 0 END) AS cost2 FROM (SELECT c.contractnum, cl1.contractlinenum, cl1.enterdate, cl1.fcg_projectid,cl1.fcg_taskid,cl1.linecost FROM contract AS c LEFT OUTER JOIN (SELECT contractnum, revisionnum, contractlinenum, enterdate, linecost+custtax1 linecost, fcg_projectid ,fcg_taskid FROM contractline) AS cl1 ON c.contractnum = cl1.contractnum AND c.revisionnum = cl1.revisionnum WHERE (c.status in('DRAFT','WSTART','APPR','WAPPR'))and cl1.revisionnum = ( select max(c2.revisionnum) from contractline c2 "
+" where c2.contractnum =cl1.contractnum ) ) AS a LEFT OUTER JOIN (SELECT poline.contractrefnum AS contractnum, CL1.contractlinenum AS CONTRACTLINENUM, SUM(poline.linecost+poline.tax1) AS linecost FROM poline INNER JOIN po ON poline.ponum = po.ponum INNER JOIN contractline AS CL1 ON poline.contreflineid = CL1.contractlineid WHERE (po.status <> 'CAN'"
+ statusSql
+ ") GROUP BY poline.contractrefnum, CL1.contractlinenum) AS a1 ON a.contractnum = a1.contractnum AND a.contractlinenum = a1.CONTRACTLINENUM) AS contract INNER JOIN fincntrl AS a ON contract.fcg_projectid = a.projectid WHERE (a.fincntrlid = FINCNTRL.parentFINCNTRLid) AND (a.fcstatus = 'APPR') "
+ " and contract.fcg_projectid in (" + projectids + ") and contract.fcg_taskid in (" + finctrlid
+ ")), 0) "
+ "FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND p.projectid in ("
+ projectids + ") and fincntrl.fincntrlid in ( " + finctrlid + ");";
sql += "UPDATE fincntrl SET fincntrl.netcost = ISNULL(fincntrl.budgetcost, 0) + ISNULL(fincntrl.altercost, 0) - ISNULL(fincntrl.pendingcost, 0) - ISNULL(fincntrl.conpendingcost, 0) - ISNULL(fincntrl.usecost, 0) FROM fincntrl LEFT OUTER JOIN fincntrl AS p ON fincntrl.parentfincntrlid = p.fincntrlid WHERE (fincntrl.custbugettype = 'PURCHASE') AND (fincntrl.custcalmethod IS NULL) AND (p.custcalmethod = 'DETAIL') AND p.projectid in ("
+ projectids + ") and fincntrl.fincntrlid in ( " + finctrlid + ");";
System.out.print("\n --sql:" + sql);
......
......@@ -37,15 +37,15 @@ public class CustFldWOPriority
throws MXException, RemoteException
{
super.validate();
MboValue localMboValue = getMboValue();
Mbo localMbo = localMboValue.getMbo();
// MboValue localMboValue = getMboValue();
// Mbo localMbo = localMboValue.getMbo();
// if (localMboValue.getString().equalsIgnoreCase("4"))
// {
// localMbo.setFieldFlag("fcg_priority", 7L, false);
// }
// else
// {
localMbo.setValueNull("fcg_priority", 2L);;
// localMbo.setValueNull("fcg_priority", 2L);;
// localMbo.setFieldFlag("fcg_priority", 7L, true);
// }
}
......
......@@ -20,414 +20,401 @@ import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.MXSession;
public class CustWO
extends WO
implements CustWORemote
{
private static final long serialVersionUID = 1L;
public CustWO(MboSet ms)
throws MXException, RemoteException
{
super(ms);
}
public void init()
throws MXException
{
super.init();
}
public void add()
throws MXException, RemoteException
{
super.add();
if (getString("GLACCOUNT").equalsIgnoreCase("")) {
setValue("GLACCOUNT", "9999-#-#", 2L);
}
}
public void modify()
throws MXException, RemoteException
{
super.modify();
}
public void canDelete()
throws MXException, RemoteException
{
super.canDelete();
}
public void delete()
throws MXException, RemoteException
{
super.delete();
}
public class CustWO extends WO implements CustWORemote {
private static final long serialVersionUID = 1L;
//重写更改状态方法
public void changeStatus(String status, Date date, String memo, long accessModifier)
throws MXException, RemoteException {
String num= getString("ORIGRECORDID"); //获取缺陷单号
System.out.println("changestatus--------"+num);
MboSetRemote srSet =MXServer.getMXServer().getMboSet("SR", this.getUserInfo());
srSet.setWhere("TICKETID = '"+num+"'");
System.out.println("changestatus--------111"+getString("WORKTYPE"));
if (!srSet.isEmpty() && !getString("WORKTYPE").equalsIgnoreCase("LL")&&!getString("WORKTYPE").equalsIgnoreCase("MOC")) {
public CustWO(MboSet ms) throws MXException, RemoteException {
super(ms);
}
public void init() throws MXException {
super.init();
}
public void add() throws MXException, RemoteException {
super.add();
System.out.println("进入工单添加界面-----");
if (getString("GLACCOUNT").equalsIgnoreCase("")) {
setValue("GLACCOUNT", "9999-#-#", 2L);
}
}
public void modify() throws MXException, RemoteException {
super.modify();
}
public void canDelete() throws MXException, RemoteException {
super.canDelete();
}
System.out.println("进入if--------"+srSet.getMbo(0).getString("DESCRIPTION"));
if ((!"APPR".equalsIgnoreCase(status) || !"WAPPR".equalsIgnoreCase(status) )&&!getString("DESCRIPTION").equals(srSet.getMbo(0).getString("DESCRIPTION"))) {
System.out.println("changestatus--------222"+getString("DESCRIPTION"));
throw new MXApplicationException("工单", "工单描述与故障单不一致,无法将"+status+"状态修改为APPR状态");
public void delete() throws MXException, RemoteException {
super.delete();
}
// 重写更改状态方法
public void changeStatus(String status, Date date, String memo,
long accessModifier) throws MXException, RemoteException {
String num = getString("ORIGRECORDID"); // 获取缺陷单号
System.out.println("changestatus--------" + num);
MboSetRemote srSet = MXServer.getMXServer().getMboSet("SR",
this.getUserInfo());
srSet.setWhere("TICKETID = '" + num + "'");
System.out.println("changestatus--------111" + getString("WORKTYPE"));
if (!srSet.isEmpty() && !getString("WORKTYPE").equalsIgnoreCase("LL")
&& !getString("WORKTYPE").equalsIgnoreCase("MOC")) {
System.out.println("进入if--------"
+ srSet.getMbo(0).getString("DESCRIPTION"));
if ((!"APPR".equalsIgnoreCase(status) || !"WAPPR"
.equalsIgnoreCase(status))
&& (getString("DESCRIPTION").equals(
srSet.getMbo(0).getString("DESCRIPTION")) && !getString(
"WORKTYPE").startsWith("MG"))) {
System.out.println("changestatus--------222"
+ getString("DESCRIPTION"));
throw new MXApplicationException("提示:",
"工单描述与关联的缺陷单描述一致,无法将该工单状态修改为" + status);
}
}
System.out.println("更改状态-");
super.changeStatus(status, date, memo, accessModifier, false);
}
public void save()
throws MXException, RemoteException
{
super.save();
setValue("GLACCOUNT", "9999-#-#", 2L);
if (getString("status").equalsIgnoreCase("COMP"))
{
String FCG_ACTSTARTTIME = getString("FCG_ACTSTARTTIME");
String FCG_ACTFINISHTIME = getString("FCG_ACTFINISHTIME");
if ((FCG_ACTSTARTTIME.equals("")) || (FCG_ACTFINISHTIME.equals(""))) {
throw new MXApplicationException("工单", "警告 工单实际开工时间、实际结束时间必填!");
}
}
System.out.println("判断应用程序");
System.out.println("================" + getString("WORKTYPE").startsWith("MG"));
if ((getString("status").equalsIgnoreCase("COMP")) && (getString("WORKTYPE").startsWith("MG")) &&
(getMboSet("WORKLOG").isEmpty())) {
throw new MXApplicationException("MG工单", "警告 工作日志必填!");
}
if ((getString("status").equalsIgnoreCase("COMP")) && (isNull("FCG_PROJECTID")) && (getString("WORKTYPE").startsWith("MG"))) {
throw new MXApplicationException("MG工单", "警告 项目编号必填!");
}
if ((getThisMboSet().getApp() != null) &&
(getThisMboSet().getApp().equals("LLD")) && (
(getString("FCG_ELECTGROUP").equals("")) || (getString("FCG_KKS2_1").equals("")) ||
(getString("FCG_KKS2_2").equals("")) || (getString("FCG_KKS2_3").equals("")) ||
(getString("location").equals("")))) {
throw new MXApplicationException("领料单", "警告 领料单必须由工单创建!");
}
if ((getString("origrecordclass").equalsIgnoreCase("SR")) && (isNew()))
{
MboRemote ticket = getMboSet("$TICKET", "TICKET", "ticketid=" + getString("origrecordid")).getMbo(0);
if (ticket != null)
{
if (!ticket.isNull("custlldw")) {
setValue("custlldw", ticket.getString("custlldw"), 3L);
}
if (!ticket.isNull("fcg_speciality")) {
setValue("fcg_speciality", ticket.getString("fcg_speciality"), 3L);
}
if (!ticket.isNull("failurecode")) {
setValue("failurecode", ticket.getString("failurecode"), 3L);
}
if (!ticket.isNull("problemcode")) {
setValue("problemcode", ticket.getString("problemcode"), 3L);
}
if (!ticket.isNull("glaccount")) {
setValue("glaccount", ticket.getString("glaccount"), 3L);
}
if (!ticket.isNull("reportedpriority")) {
setValue("wopriority", ticket.getInt("reportedpriority"), 3L);
}
if (!ticket.isNull("targetstart")) {
setValue("targstartdate", ticket.getDate("targetstart"), 3L);
}
if (!ticket.isNull("FCG_ELECTGROUP")) {
setValue("FCG_ELECTGROUP", ticket.getString("FCG_ELECTGROUP"), 3L);
}
if (ticket.getString("FCG_ELECTGROUP").equalsIgnoreCase("MG")) {
setValue("WORKTYPE", "MGTCM", 3L);
} else {
setValue("WORKTYPE", "CM", 3L);
}
}
}
if (getString("status").equalsIgnoreCase("CAN"))
{
String memo = getMboSet("wostatus").getMbo(0).getString("memo");
memo = "关联工单已被取消:" + memo;
if (!getString("origrecordid").equalsIgnoreCase(""))
{
MboSetRemote woSet = getMboSet("$wo", "WORKORDER", "status<>'CAN' and wonum<>'" +
getString("wonum") + "' and origrecordid=" + getString("origrecordid"));
if (woSet.isEmpty())
{
MboSetRemote srSet = getMboSet("$sr", "TICKET", "ticketid=" + getString("origrecordid"));
if ((!srSet.isEmpty()) &&
(!srSet.getMbo(0).getString("status").equalsIgnoreCase("CANCEL")) &&
(!srSet.getMbo(0).getString("status").equalsIgnoreCase("CLOSED")))
{
MboSetRemote sr_instance = getMboSet("$srWf", "WFINSTANCE",
"ownertable='SR' and ownerid=" + srSet.getMbo(0).getInt("ticketuid") +
" and active = 1");
if (!sr_instance.isEmpty()) {
throw new MXApplicationException("工单", "警告 您取消的工单,有关联缺陷单,并且还在审批流程中无法取消!");
}
MboSetRemote tks = srSet.getMbo(0).getMboSet("tkstatus");
tks.add(11L);
tks.setValue("status", "CANCEL", 3L);
tks.setValue("changeby", getUserName(), 3L);
tks.setValue("changedate", MXSession.getSession().getDate(),
3L);
tks.setValue("memo", memo, 3L);
srSet.getMbo(0).setValue("status", "CANCEL", 3L);
srSet.getMbo(0).setValue("historyflag", "Y", 3L);
}
}
}
}
}
public void appValidate()
throws MXException, RemoteException
{
super.appValidate();
MboSetRemote wpmaterialSet = getMboSet("WPMATERIAL");
if (!wpmaterialSet.isEmpty())
{
FinancialServiceRemote financialThingy = (FinancialServiceRemote)((AppService)getMboServer())
.getMXServer().lookup("FINANCIAL");
String orgID = getString("orgid");
if ((getString("PARENT").equalsIgnoreCase("")) &&
(!financialThingy.validateFullGLAccount(getUserInfo(), getString("glaccount"), orgID))) {
throw new MXApplicationException("工单", "警告 您填写了物资领用,但科目填写不完整,请工单页面填写");
}
}
if (getString("worktype").equals("LL"))
{
MboRemote wpmaterial = null;
for (int n = 0; (wpmaterial = wpmaterialSet.getMbo(n)) != null; n++) {
if (!wpmaterial.toBeDeleted())
{
MboSetRemote matuseSet = wpmaterial.getMboSet("ISSUEMATUSETRANS");
if (matuseSet.isEmpty())
{
String requestnum = wpmaterial.getString("requestnum");
String siteid = wpmaterial.getString("siteid");
Long wpitemid = Long.valueOf(wpmaterial.getLong("wpitemid"));
if (("".equals(requestnum)) || ("0".equals(requestnum)))
{
MboSetRemote wpmSet = MXServer.getMXServer().getMboSet("WPMATERIAL", getUserInfo());
wpmSet.setWhere("wpitemid=" + wpitemid);
wpmSet.reset();
if (!wpmSet.isEmpty()) {
requestnum = wpmSet.getMbo(0).getString("requestnum");
}
wpmSet.close();
}
MboSetRemote invSet = MXServer.getMXServer().getMboSet("INVRESERVE", getUserInfo());
invSet.setWhere(
"requestnum='" + requestnum + "' and siteid='" + siteid + "' and restype='HARD'");
invSet.reset();
double invrerveQty = invSet.sum("reservedqty");
if (wpmaterial.getDouble("itemqty") > wpmaterial.getDouble("INVENTORY.AVBLBALANCE") + invrerveQty)
{
invSet.close();
throw new MXApplicationException("领料单: ", wpmaterial.getString("description") + " 库存余量不足!");
}
invSet.close();
}
}
}
}
Date oldmindate = new Date();
Date oldmaxdate = new Date();
if (getString("status").equalsIgnoreCase("CLOSE"))
{
MboSetRemote gzpwombosetremote = getMboSet("FCG_WONUM_WORKSHEET");
if (!gzpwombosetremote.isEmpty())
{
MboRemote gzpwomboremote = null;
int i = 0;
while ((gzpwomboremote = gzpwombosetremote.getMbo(i++)) != null)
{
String gzpzt = gzpwomboremote.getString("STATUS");
if ((!gzpzt.equalsIgnoreCase("CANCEL")) && (!gzpzt.equalsIgnoreCase("DELETED")))
{
String s = "警告 编号为" + gzpwomboremote.getString("WSCOMBNUM") + "的工作票状态为'" + gzpzt +
"',请先处理工作票!";
throw new MXApplicationException("工作票", s);
}
if (i == 0)
{
oldmindate = gzpwomboremote.getDate("ACCEPTEDDATE");
oldmaxdate = gzpwomboremote.getDate("EVACUATEDDATE");
}
Date mindate = gzpwomboremote.getDate("ACCEPTEDDATE");
Date maxdate = gzpwomboremote.getDate("EVACUATEDDATE");
if ((oldmindate != null) && (oldmaxdate != null) && (mindate != null) && (maxdate != null))
{
if (mindate.before(oldmindate))
{
oldmindate = mindate;
oldmaxdate = maxdate;
}
if (maxdate.after(oldmaxdate)) {
oldmaxdate = maxdate;
}
}
}
if (oldmindate != null) {
setValue("FCG_ACTSTARTTIME", oldmindate, 3L);
}
if (oldmaxdate != null) {
setValue("FCG_ACTFINISHTIME", oldmaxdate, 3L);
}
}
}
if (getString("STATUS").equalsIgnoreCase("CLOSE"))
{
MboSetRemote wochildset = getMboSet("ALLCHILDWO");
MboRemote wochildmboremote = null;
int i = 0;
while ((wochildmboremote = wochildset.getMbo(i++)) != null) {
if ((!wochildmboremote.getString("WO.STATUS").equalsIgnoreCase("CLOSE")) &&
(!wochildmboremote.getString("WO.STATUS").equalsIgnoreCase("CAN")) &&
(!wochildmboremote.getBoolean("wo.istask")))
{
String msgbox = "错误: 子工单:‘" + wochildmboremote.getString("wonum") + "’没有关闭,请先关闭子工单";
throw new MXApplicationException("workorder", msgbox);
}
}
if (getString("WORKTYPE").startsWith("MG"))
{
if (isNull("FCG_PROJECTID")) {
throw new MXApplicationException("", "MG工单提示:\t 请填写项目编码后,再关闭工单");
}
if (getMboSet("CUSTOMWOWORKLOG").isEmpty()) {
throw new MXApplicationException("", "MG工单提示:\t 请填写工作日志后,再关闭工单");
}
}
}
MatusetransProject(getMboSet("MATUSETRANS"));
}
private void MatusetransProject(MboSetRemote servrecSet)
throws MXException, RemoteException, MXApplicationException
{
MboRemote servrec = null;
if (servrecSet.isEmpty()) {
return;
}
if (!servrecSet.toBeSaved()) {
return;
}
HashMap<String, Double> servhashMap = new HashMap();
HashMap<String, String> pohashMap = new HashMap();
for (int i = 0; (servrec = servrecSet.getMbo(i)) != null; i++)
{
System.out.println(i + "===i===" + servrecSet.getName() + " " + servrec.toBeAdded());
if ((servrecSet.getName().equalsIgnoreCase("MATUSETRANS")) && (servrec.toBeAdded()) &&
("ITEM".equalsIgnoreCase(servrec.getString("LINETYPE"))))
{
if(!servrec.isNull("WORKORDER.FCG_taskid.fcg_projectid")){
String pid = servrec.getString("WORKORDER.FCG_taskid.fcg_projectid");
servrec.setValue("fcg_projectid", pid, 2L);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + pid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSetp = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
finSetp.setWhere(sql);
finSetp.setOrderBy("startdate desc");
finSetp.reset();
if (finSetp.isEmpty()) {
finSetp.close();
public void save() throws MXException, RemoteException {
super.save();
setValue("GLACCOUNT", "9999-#-#", 2L);
if (getString("status").equalsIgnoreCase("COMP")) {
String FCG_ACTSTARTTIME = getString("FCG_ACTSTARTTIME");
String FCG_ACTFINISHTIME = getString("FCG_ACTFINISHTIME");
if ((FCG_ACTSTARTTIME.equals("")) || (FCG_ACTFINISHTIME.equals(""))) {
throw new MXApplicationException("工单",
"警告 工单实际开工时间、实际结束时间必填!");
}
}
System.out.println("判断应用程序");
System.out.println("================"
+ getString("WORKTYPE").startsWith("MG"));
if ((getString("status").equalsIgnoreCase("COMP"))
&& (getString("WORKTYPE").startsWith("MG"))
&& (getMboSet("WORKLOG").isEmpty())) {
throw new MXApplicationException("MG工单", "警告 工作日志必填!");
}
if ((getString("status").equalsIgnoreCase("COMP"))
&& (isNull("FCG_PROJECTID"))
&& (getString("WORKTYPE").startsWith("MG"))) {
throw new MXApplicationException("MG工单", "警告 项目编号必填!");
}
if ((getThisMboSet().getApp() != null)
&& (getThisMboSet().getApp().equals("LLD"))
&& ((getString("FCG_ELECTGROUP").equals(""))
|| (getString("FCG_KKS2_1").equals(""))
|| (getString("FCG_KKS2_2").equals(""))
|| (getString("FCG_KKS2_3").equals("")) || (getString("location")
.equals("")))) {
throw new MXApplicationException("领料单",
"警告 领料单必须由工单创建!");
}
if ((getString("origrecordclass").equalsIgnoreCase("SR")) && (isNew())) {
MboRemote ticket = getMboSet("$TICKET", "TICKET",
"ticketid=" + getString("origrecordid")).getMbo(0);
if (ticket != null) {
if (!ticket.isNull("custlldw")) {
setValue("custlldw", ticket.getString("custlldw"), 3L);
}
if (!ticket.isNull("fcg_speciality")) {
setValue("fcg_speciality",
ticket.getString("fcg_speciality"), 3L);
}
if (!ticket.isNull("failurecode")) {
setValue("failurecode", ticket.getString("failurecode"), 3L);
}
if (!ticket.isNull("problemcode")) {
setValue("problemcode", ticket.getString("problemcode"), 3L);
}
if (!ticket.isNull("glaccount")) {
setValue("glaccount", ticket.getString("glaccount"), 3L);
}
if (!ticket.isNull("reportedpriority")) {
setValue("wopriority", ticket.getInt("reportedpriority"),
3L);
}
if (!ticket.isNull("targetstart")) {
setValue("targstartdate", ticket.getDate("targetstart"), 3L);
}
if (!ticket.isNull("FCG_ELECTGROUP")) {
setValue("FCG_ELECTGROUP",
ticket.getString("FCG_ELECTGROUP"), 3L);
}
if (ticket.getString("FCG_ELECTGROUP").equalsIgnoreCase("MG")) {
setValue("WORKTYPE", "MGTCM", 3L);
} else {
MboRemote fincntrl = finSetp.getMbo(0);
String fincntrlid = String.valueOf(fincntrl.getLong("finexpenselineid"));
servrec.setValue("fcg_taskid", fincntrlid, 2L);
finSetp.close();
setValue("WORKTYPE", "CM", 3L);
}
}
}
if (getString("status").equalsIgnoreCase("CAN")) {
String memo = getMboSet("wostatus").getMbo(0).getString("memo");
memo = "关联工单已被取消:" + memo;
if (!getString("origrecordid").equalsIgnoreCase("")) {
MboSetRemote woSet = getMboSet("$wo", "WORKORDER",
"status<>'CAN' and wonum<>'" + getString("wonum")
+ "' and origrecordid="
+ getString("origrecordid"));
if (woSet.isEmpty()) {
MboSetRemote srSet = getMboSet("$sr", "TICKET", "ticketid="
+ getString("origrecordid"));
if ((!srSet.isEmpty())
&& (!srSet.getMbo(0).getString("status")
.equalsIgnoreCase("CANCEL"))
&& (!srSet.getMbo(0).getString("status")
.equalsIgnoreCase("CLOSED"))) {
MboSetRemote sr_instance = getMboSet("$srWf",
"WFINSTANCE", "ownertable='SR' and ownerid="
+ srSet.getMbo(0).getInt("ticketuid")
+ " and active = 1");
System.out.println("111");
if (!sr_instance.isEmpty()) {
throw new MXApplicationException("工单",
"警告 您取消的工单,有关联缺陷单,并且还在审批流程中无法取消!");
}
MboSetRemote tks = srSet.getMbo(0)
.getMboSet("tkstatus");
tks.add(11L);
tks.setValue("status", "CANCEL", 3L);
tks.setValue("changeby", getUserName(), 3L);
tks.setValue("changedate", MXSession.getSession()
.getDate(), 3L);
tks.setValue("memo", memo, 3L);
srSet.getMbo(0).setValue("status", "CANCEL", 3L);
srSet.getMbo(0).setValue("historyflag", "Y", 3L);
}
}
}
}
}
public void appValidate() throws MXException, RemoteException {
super.appValidate();
MboSetRemote wpmaterialSet = getMboSet("WPMATERIAL");
if (!wpmaterialSet.isEmpty()) {
FinancialServiceRemote financialThingy = (FinancialServiceRemote) ((AppService) getMboServer())
.getMXServer().lookup("FINANCIAL");
String orgID = getString("orgid");
if ((getString("PARENT").equalsIgnoreCase(""))
&& (!financialThingy.validateFullGLAccount(getUserInfo(),
getString("glaccount"), orgID))) {
throw new MXApplicationException("工单",
"警告 您填写了物资领用,但科目填写不完整,请工单页面填写");
}
}
if (getString("worktype").equals("LL")) {
MboRemote wpmaterial = null;
for (int n = 0; (wpmaterial = wpmaterialSet.getMbo(n)) != null; n++) {
if (!wpmaterial.toBeDeleted()) {
MboSetRemote matuseSet = wpmaterial
.getMboSet("ISSUEMATUSETRANS");
if (matuseSet.isEmpty()) {
String requestnum = wpmaterial.getString("requestnum");
String siteid = wpmaterial.getString("siteid");
Long wpitemid = Long.valueOf(wpmaterial
.getLong("wpitemid"));
if (("".equals(requestnum)) || ("0".equals(requestnum))) {
MboSetRemote wpmSet = MXServer.getMXServer()
.getMboSet("WPMATERIAL", getUserInfo());
wpmSet.setWhere("wpitemid=" + wpitemid);
wpmSet.reset();
if (!wpmSet.isEmpty()) {
requestnum = wpmSet.getMbo(0).getString(
"requestnum");
}
wpmSet.close();
}
MboSetRemote invSet = MXServer.getMXServer().getMboSet(
"INVRESERVE", getUserInfo());
invSet.setWhere("requestnum='" + requestnum
+ "' and siteid='" + siteid
+ "' and restype='HARD'");
invSet.reset();
double invrerveQty = invSet.sum("reservedqty");
//SHOWACTUALMATERIAL
MboSetRemote SHOWACTUALMATERIALSet=getMboSet("SHOWACTUALMATERIAL");
SHOWACTUALMATERIALSet.setWhere(" ISSUETYPE='RETURN' and itemnum='"+wpmaterial.getString("ITEMNUM")+"'");
double quantity=0.0;
for (int i = 0; i < SHOWACTUALMATERIALSet.count(); i++) {
MboRemote m=SHOWACTUALMATERIALSet.getMbo(i);
if (m.toBeSaved()) {
quantity += m.getDouble("quantity");
}
}
if (quantity==0) {
if (wpmaterial.getDouble("itemqty") > wpmaterial
.getDouble("INVENTORY.AVBLBALANCE")
+ invrerveQty) {
invSet.close();
throw new MXApplicationException("领料单: ",
wpmaterial.getString("description")
+ " 库存余量不足!");
}
}
invSet.close();
}
}
String wonum = servrec.getString("wonum");
if (!servhashMap.containsKey(wonum))
servhashMap.put(wonum, servrec.getDouble("linecost"));
else
servhashMap.put(wonum, servhashMap.get(wonum) + servrec.getDouble("linecost"));
System.out.println(wonum + "===servhashMap===" + servhashMap.get(wonum));
if (!pohashMap.containsKey(wonum))
pohashMap.put(wonum, servrec.getString("WORKORDER.FCG_taskid.fcg_projectid"));
System.out.println(wonum + "===pohashMap===" + pohashMap.get(wonum));
}
}
}
Iterator iterator1 = pohashMap.keySet().iterator();
HashMap<String, String> projectHashMap = new HashMap();
String errorMSG = "";
while (iterator1.hasNext())
{
String key = (String)iterator1.next();
String projectid = (String)pohashMap.get(key);
if ((!"".equals(projectid)) && (!projectHashMap.containsKey(projectid)))
{
projectHashMap.put(projectid, projectid);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + projectid +
"') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSet = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
finSet.setWhere(sql);
finSet.setOrderBy("startdate desc");
finSet.reset();
if (finSet.isEmpty())
{
finSet.close();
}
else
{
MboRemote fincntrl = finSet.getMbo(0);
String fincntrlid = fincntrl.getString("finexpenselineid");
Iterator iterator2 = servhashMap.keySet().iterator();
double toalcost = 0.0D;
while (iterator2.hasNext())
{
String key2 = (String)iterator2.next();
if (((String)pohashMap.get(key2)).equals(projectid)) {
toalcost += ((Double)servhashMap.get(key2)).doubleValue();
}
}
System.out.println("===toalcost===" + toalcost);
double netcost = fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost") -
fincntrl.getDouble("PROJECTCOST");
System.out.println("netcost:" + netcost);
if (netcost < toalcost)
{
finSet.close();
errorMSG = errorMSG + "\n 工单号:" + key + " 超预算,费用预算编码:" + projectid + ",预算行ID:" + fincntrlid + "\n 超预算金额:" + (netcost - toalcost);
}
else
{
finSet.close();
}
}
}
}
//未超出预算,需要进行累计
if ("".equals(errorMSG)) {
System.out.println("===errorMSG===" + errorMSG);
Iterator iterator3 = pohashMap.keySet().iterator();
while (iterator3.hasNext()) {
String key = (String) iterator3.next();
String projectid = pohashMap.get(key);
System.out.println("===key===" + key);
System.out.println("===projectid===" + projectid);
if (!"".equals(projectid) && projectHashMap.containsKey(projectid)) {
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='" + projectid
}
}
Date oldmindate = new Date();
Date oldmaxdate = new Date();
if (getString("status").equalsIgnoreCase("CLOSE")) {
MboSetRemote gzpwombosetremote = getMboSet("FCG_WONUM_WORKSHEET");
if (!gzpwombosetremote.isEmpty()) {
MboRemote gzpwomboremote = null;
int i = 0;
while ((gzpwomboremote = gzpwombosetremote.getMbo(i++)) != null) {
String gzpzt = gzpwomboremote.getString("STATUS");
if ((!gzpzt.equalsIgnoreCase("CANCEL"))
&& (!gzpzt.equalsIgnoreCase("DELETED"))) {
String s = "警告 编号为"
+ gzpwomboremote.getString("WSCOMBNUM")
+ "的工作票状态为'" + gzpzt + "',请先处理工作票!";
throw new MXApplicationException("工作票", s);
}
if (i == 0) {
oldmindate = gzpwomboremote.getDate("ACCEPTEDDATE");
oldmaxdate = gzpwomboremote.getDate("EVACUATEDDATE");
}
Date mindate = gzpwomboremote.getDate("ACCEPTEDDATE");
Date maxdate = gzpwomboremote.getDate("EVACUATEDDATE");
if ((oldmindate != null) && (oldmaxdate != null)
&& (mindate != null) && (maxdate != null)) {
if (mindate.before(oldmindate)) {
oldmindate = mindate;
oldmaxdate = maxdate;
}
if (maxdate.after(oldmaxdate)) {
oldmaxdate = maxdate;
}
}
}
if (oldmindate != null) {
setValue("FCG_ACTSTARTTIME", oldmindate, 3L);
}
if (oldmaxdate != null) {
setValue("FCG_ACTFINISHTIME", oldmaxdate, 3L);
}
}
}
if (getString("STATUS").equalsIgnoreCase("CLOSE")) {
MboSetRemote wochildset = getMboSet("ALLCHILDWO");
MboRemote wochildmboremote = null;
int i = 0;
while ((wochildmboremote = wochildset.getMbo(i++)) != null) {
if ((!wochildmboremote.getString("WO.STATUS").equalsIgnoreCase(
"CLOSE"))
&& (!wochildmboremote.getString("WO.STATUS")
.equalsIgnoreCase("CAN"))
&& (!wochildmboremote.getBoolean("wo.istask"))) {
String msgbox = "错误: 子工单:‘"
+ wochildmboremote.getString("wonum")
+ "’没有关闭,请先关闭子工单";
throw new MXApplicationException("workorder", msgbox);
}
}
if (getString("WORKTYPE").startsWith("MG")) {
if (isNull("FCG_PROJECTID")) {
throw new MXApplicationException("",
"MG工单提示:\t 请填写项目编码后,再关闭工单");
}
if (getMboSet("CUSTOMWOWORKLOG").isEmpty()) {
throw new MXApplicationException("",
"MG工单提示:\t 请填写工作日志后,再关闭工单");
}
}
}
MatusetransProject(getMboSet("MATUSETRANS"));
}
private void MatusetransProject(MboSetRemote servrecSet)
throws MXException, RemoteException, MXApplicationException {
MboRemote servrec = null;
if (servrecSet.isEmpty()) {
return;
}
if (!servrecSet.toBeSaved()) {
return;
}
HashMap<String, Double> servhashMap = new HashMap();
HashMap<String, String> pohashMap = new HashMap();
for (int i = 0; (servrec = servrecSet.getMbo(i)) != null; i++) {
System.out.println(i + "===i===" + servrecSet.getName() + " "
+ servrec.toBeAdded());
if ((servrecSet.getName().equalsIgnoreCase("MATUSETRANS"))
&& (servrec.toBeAdded())
&& ("ITEM".equalsIgnoreCase(servrec.getString("LINETYPE")))) {
if (!servrec.isNull("WORKORDER.FCG_taskid.fcg_projectid")) {
String pid = servrec
.getString("WORKORDER.FCG_taskid.fcg_projectid");
servrec.setValue("fcg_projectid", pid, 2L);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ pid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSetp = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSetp.setWhere(sql);
finSetp.setOrderBy("startdate desc");
finSetp.reset();
if (finSetp.isEmpty()) {
finSetp.close();
} else {
MboRemote fincntrl = finSetp.getMbo(0);
String fincntrlid = String.valueOf(fincntrl
.getLong("finexpenselineid"));
servrec.setValue("fcg_taskid", fincntrlid, 2L);
finSetp.close();
}
String wonum = servrec.getString("wonum");
if (!servhashMap.containsKey(wonum))
servhashMap.put(wonum, servrec.getDouble("linecost"));
else
servhashMap.put(
wonum,
servhashMap.get(wonum)
+ servrec.getDouble("linecost"));
System.out.println(wonum + "===servhashMap==="
+ servhashMap.get(wonum));
if (!pohashMap.containsKey(wonum))
pohashMap
.put(wonum,
servrec.getString("WORKORDER.FCG_taskid.fcg_projectid"));
System.out.println(wonum + "===pohashMap==="
+ pohashMap.get(wonum));
}
}
}
Iterator iterator1 = pohashMap.keySet().iterator();
HashMap<String, String> projectHashMap = new HashMap();
String errorMSG = "";
while (iterator1.hasNext()) {
String key = (String) iterator1.next();
String projectid = (String) pohashMap.get(key);
if ((!"".equals(projectid))
&& (!projectHashMap.containsKey(projectid))) {
projectHashMap.put(key, projectid);
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ projectid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSet = MXServer.getMXServer().getMboSet("finexpenseline", getUserInfo());
MboSetRemote finSet = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSet.setWhere(sql);
finSet.setOrderBy("startdate desc");
finSet.reset();
......@@ -435,41 +422,223 @@ public class CustWO
finSet.close();
} else {
MboRemote fincntrl = finSet.getMbo(0);
String fincntrlid = fincntrl.getString("finexpenselineid");
Iterator iterator2 = servhashMap.keySet().iterator();
double toalcost = 0;
double toalcost = 0.0D;
while (iterator2.hasNext()) {
String key2 = (String) iterator2.next();
if (pohashMap.get(key2).equals(projectid))
toalcost += servhashMap.get(key2);
if (((String) pohashMap.get(key2)).equals(projectid)) {
toalcost += ((Double) servhashMap.get(key2))
.doubleValue();
}
}
double estcost = getDouble("estmatcost")
- getDouble("actmatcost");
System.out.println("===toalcost===" + toalcost);
System.out.println("===estmatcost===" + estcost);
double pendingcost = fincntrl.getDouble("PENDINGCOST");
if (toalcost > estcost)
pendingcost = pendingcost - estcost;
else
pendingcost = pendingcost - toalcost;
if (pendingcost <= 0)
pendingcost = 0;
double netcost = fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST") - pendingcost;
System.out.println("netcost:" + netcost);
if (netcost < toalcost) {
finSet.close();
errorMSG = errorMSG + "\n 工单号:" + key
+ " 超预算,费用预算编码:" + projectid + ",预算行ID:"
+ fincntrlid + "\n 超预算金额:"
+ (netcost - toalcost);
} else {
finSet.close();
}
}
}
}
// 未超出预算,需要进行累计
if ("".equals(errorMSG)) {
System.out.println("===errorMSG===" + errorMSG);
Iterator iterator3 = pohashMap.keySet().iterator();
// Iterator iterator3 = projectHashMap.keySet().iterator();
while (iterator3.hasNext()) {
String key = (String) iterator3.next();
String projectid = projectHashMap.get(key);
System.out.println("===key===" + key);
System.out.println("===projectid===" + projectid);
if (!"".equals(projectid)) {
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ projectid
+ "') and getdate()>=startdate and getdate() <= enddate ";
MboSetRemote finSet = MXServer.getMXServer().getMboSet(
"finexpenseline", getUserInfo());
finSet.setWhere(sql);
finSet.setOrderBy("startdate desc");
finSet.reset();
if (finSet.isEmpty()) {
finSet.close();
} else {
MboRemote fincntrl = finSet.getMbo(0);
Iterator iterator2 = servhashMap.keySet().iterator();
double toalcost = 0;
while (iterator2.hasNext()) {
String key2 = (String) iterator2.next();
if (pohashMap.get(key2).equals(projectid))
toalcost += servhashMap.get(key2);
}
double estcost = getDouble("estmatcost")
- getDouble("actmatcost");
System.out.println("===toalcost===" + toalcost);
System.out.println("===estmatcost===" + estcost);
double pendingcost = fincntrl.getDouble("PENDINGCOST");
if (toalcost > estcost)
pendingcost = pendingcost - estcost;
else
pendingcost = pendingcost - toalcost;
if (pendingcost <= 0)
pendingcost = 0;
fincntrl.setValue("PENDINGCOST", pendingcost);
fincntrl.setValue("PROJECTCOST",
fincntrl.getDouble("PROJECTCOST") + toalcost);
fincntrl.setValue(
"netcost",
fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST")
- fincntrl.getDouble("PENDINGCOST"));
finSet.save();
finSet.close();
}
System.out.println("===fincntrlID===" + fincntrl.getString("finexpenselineid"));
fincntrl.setValue("PROJECTCOST", fincntrl.getDouble("PROJECTCOST") + toalcost);
fincntrl.setValue("netcost", fincntrl.getDouble("budgetcost") + fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST"));
finSet.save();
finSet.close();
}
}
} else
throw new MXApplicationException(
"\n*************警告!警告!警告!**************", errorMSG);
}
public void AddPendingCost(MboSetRemote servrecSet) throws MXException,
RemoteException, MXApplicationException {
if (servrecSet.isEmpty()) {
return;
}
}
else
throw new MXApplicationException("\n*************警告!警告!警告!**************", errorMSG);
}
public void setAllRelatedMboReadonly(String relationName)
throws MXException, RemoteException
{
MboSetRemote relatedSet = getMboSet(relationName);
relatedSet.setFlag(7L, true);
}
//
// public void setAttrFromWoGen(MboRemote mboremote)
// throws RemoteException, MXException
// {
// super.setAttrFromWoGen(mboremote);
// setValue("FCG_ELECTGROUP", mboremote.getString("FCG_ELECTGROUP"), 2L);
// setValue("WS_REQUIRE", mboremote.getString("WS_REQUIRE"), 2L);
// setValue("FCG_SPECIALITY", mboremote.getString("FCG_SPECIALITY"), 2L);
// setValue("custlldw", mboremote.getString("custlldw"), 2L);
// }
String wonum = getString("wonum");
String pid = "";
String fincntrlid = "";
MboRemote fincntrl = null;
MboSetRemote finSetp = null;
double toalcost = getDouble("ESTMATCOST") - getDouble("ACTMATCOST");
if (toalcost <= 0)
toalcost = 0;
if (!isNull("FCG_taskid.fcg_projectid")) {
pid = getString("FCG_taskid.fcg_projectid");
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ pid
+ "') and getdate()>=startdate and getdate() <= enddate ";
finSetp = MXServer.getMXServer().getMboSet("finexpenseline",
getUserInfo());
finSetp.setWhere(sql);
finSetp.setOrderBy("startdate desc");
finSetp.reset();
if (finSetp.isEmpty()) {
finSetp.close();
} else {
fincntrl = finSetp.getMbo(0);
fincntrlid = String.valueOf(fincntrl
.getLong("finexpenselineid"));
// finSetp.close();
}
} else
return;
String errorMSG = "";
System.out.println("===toalcost===" + toalcost);
double netcost = fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST")
- fincntrl.getDouble("PENDINGCOST");
System.out.println("netcost:" + netcost);
if (netcost < toalcost) {
errorMSG = errorMSG + "\n 领料单号:" + wonum + " 超预算,费用预算编码:" + pid
+ ",预算行ID:" + fincntrlid + "\n 超预算金额:"
+ (netcost - toalcost);
}
// 未超出预算,需要累计占用预算
if ("".equals(errorMSG)) {
fincntrl.setValue("PENDINGCOST", fincntrl.getDouble("PENDINGCOST")
+ toalcost);
fincntrl.setValue(
"netcost",
fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST")
- fincntrl.getDouble("PENDINGCOST"));
finSetp.save();
finSetp.close();
} else
throw new MXApplicationException(
"\n*************警告!警告!警告!**************", errorMSG);
}
public void ReducePendingCost(MboSetRemote servrecSet) throws MXException,
RemoteException, MXApplicationException {
if (servrecSet.isEmpty()) {
return;
}
String pid = "";
MboRemote fincntrl = null;
MboSetRemote finSetp = null;
double toalcost = getDouble("ESTMATCOST") - getDouble("ACTMATCOST");
if (toalcost <= 0)
return;
if (!isNull("FCG_taskid.fcg_projectid")) {
pid = getString("FCG_taskid.fcg_projectid");
String sql = "finexpenseid =(select finexpenseid from finexpense where PROJECTID='"
+ pid
+ "') and getdate()>=startdate and getdate() <= enddate ";
finSetp = MXServer.getMXServer().getMboSet("finexpenseline",
getUserInfo());
finSetp.setWhere(sql);
finSetp.setOrderBy("startdate desc");
finSetp.reset();
if (finSetp.isEmpty()) {
finSetp.close();
} else {
fincntrl = finSetp.getMbo(0);
// finSetp.close();
}
} else
return;
System.out.println("===toalcost===" + toalcost);
// 退回,需要释放占用预算
double pendingcost = fincntrl.getDouble("PENDINGCOST") - toalcost;
if (pendingcost <= 0)
pendingcost = 0;
fincntrl.setValue("PENDINGCOST", pendingcost);
fincntrl.setValue(
"netcost",
fincntrl.getDouble("budgetcost")
+ fincntrl.getDouble("altercost")
- fincntrl.getDouble("PROJECTCOST")
- fincntrl.getDouble("PENDINGCOST"));
finSetp.save();
finSetp.close();
}
public void setAllRelatedMboReadonly(String relationName)
throws MXException, RemoteException {
MboSetRemote relatedSet = getMboSet(relationName);
relatedSet.setFlag(7L, true);
}
public void setAttrFromWoGen(MboRemote mboremote) throws RemoteException,
MXException {
super.setAttrFromWoGen(mboremote);
setValue("FCG_ELECTGROUP", mboremote.getString("FCG_ELECTGROUP"), 2L);
setValue("WS_REQUIRE", mboremote.getString("WS_REQUIRE"), 2L);
setValue("FCG_SPECIALITY", mboremote.getString("FCG_SPECIALITY"), 2L);
setValue("custlldw", mboremote.getString("custlldw"), 2L);
}
}
......@@ -24,9 +24,7 @@ public class CustWO2 extends WO implements CustWORemote {
super(ms);
}
public FldPOReceivedTotalCost(MboValue mbv) throws MXException {
super(mbv);
}
public void init() throws MXException {
super.init();
......
package fcg.workflow;
import java.rmi.RemoteException;
import fcg.app.workorder.CustWO;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.util.MXException;
/**
*
*/
public class LLApprAction implements ActionCustomClass{
@Override
public void applyCustomAction(MboRemote mbo, Object[] arg1) throws MXException, RemoteException {
((CustWO)mbo).AddPendingCost(mbo.getMboSet("SHOWPLANMATERIAL"));
}
}
package fcg.workflow;
import java.rmi.RemoteException;
import fcg.app.workorder.CustWO;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.util.MXException;
/**
*
*/
public class LLWapprAction implements ActionCustomClass{
@Override
public void applyCustomAction(MboRemote mbo, Object[] arg1) throws MXException, RemoteException {
((CustWO)mbo).ReducePendingCost(mbo.getMboSet("SHOWPLANMATERIAL"));
}
}
package fcgui.webclient.beans.contpurch;
import fcg.app.contract.CustContractLine;
import fcg.app.contract.CustContractLineRemote;
import fcg.app.contract.CustContractLineSetRemote;
import fcg.app.contract.purch.CustPurchViewRemote;
import fcg.app.contract.purch.CustPurchViewSetRemote;
import java.io.File;
import java.io.IOException;
import java.rmi.RemoteException;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import psdi.security.UserInfo;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.util.MXSession;
import psdi.webclient.system.beans.DataBean;
import psdi.webclient.system.controller.AppInstance;
import psdi.webclient.system.controller.SessionContext;
import psdi.webclient.system.controller.UploadFile;
import psdi.webclient.system.controller.Utility;
import psdi.webclient.system.controller.WebClientEvent;
public class CustUploadContLine
extends DataBean
{
String UpLoadType;
String dirName;
int row;
public CustUploadContLine()
{
this.UpLoadType = "CLP-FCG";
this.row = 0;
this.dirName = "C:\\UpLoadXLS\\CONTRACT";
}
public synchronized int execute()
throws MXException, RemoteException
{
DataBean appBean = Utility.getDataSource(this.sessionContext, this.app.getAppHandler());
CustPurchViewSetRemote contSet = (CustPurchViewSetRemote)appBean.getMboSet();
WebClientEvent event = this.sessionContext.getCurrentEvent();
CustPurchViewRemote contRemote = (CustPurchViewRemote)contSet.getMbo();
if ((contRemote.getString("status").equals("APPR")) || (contRemote.getString("status").equals("CAN")) || (contRemote.getString("status").equals("CLOSE"))) {
throw new MXApplicationException("uploadxls", "该合同已经审批通过/取消/关闭,不允许再导入合同行");
}
UploadFile df = (UploadFile)this.app.get("doclinkfile");
if (df == null)
{
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.getAppBean().save();
return 1;
}
try
{
String filename = df.getFileName();
String subfilename = filename.substring(filename.indexOf(".") + 1);
if (!subfilename.equalsIgnoreCase("XLS"))
{
Utility.showMessageBox(event, "uploadxls", "checkerror", null);
this.app.remove("doclinkfile");
return 1;
}
df.setDirectoryName(this.dirName);
df.writeToDisk();
String fileNameInServer = df.getFileName();
df.save();
Workbook workbook = Workbook.getWorkbook(new File(this.dirName + "\\" + fileNameInServer));
Sheet sheet = workbook.getSheet(0);
int maxrow = sheet.getRows();
int maxcolumn = sheet.getColumns();
String[][] contlines = new String[maxrow][maxcolumn];
for (this.row = 2; this.row <= maxrow; this.row += 1)
{
if (sheet.getCell(0, this.row - 1).getContents().equals("")) {
break;
}
for (int column = 0; column < maxcolumn; column++) {
contlines[(this.row - 2)][column] = sheet.getCell(column, this.row - 1).getContents();
}
}
workbook.close();
String contractnum = contRemote.getString("CONTRACTNUM");
String revisionnum = contRemote.getString("REVISIONNUM");
int uid = contRemote.getInt("contractid");
CustContractLineSetRemote contlineSet = (CustContractLineSetRemote)contRemote.getMboSet("CONTRACTLINE");
int seq = contlineSet.count();
for (int i = 0; i < this.row - 2; i++)
{
CustContractLineRemote contlineremote = (CustContractLineRemote)contlineSet.add();
if (seq > 0) {
contlineremote.setValue("CONTRACTLINENUM", i + seq + 1, 11L);
} else {
contlineremote.setValue("CONTRACTLINENUM", i + 1, 11L);
}
contlineremote.setValue("CONTRACTNUM", contractnum, 11L);
contlineremote.setValue("REVISIONNUM", revisionnum, 11L);
contlineremote.setValue("ENTERBY", contlineremote.getUserInfo().getPersonId(), 11L);
contlineremote.setValue("ENTERDATE", MXServer.getMXServer().getDate(), 11L);
contlineremote.setValue("REVISIONNUM", revisionnum, 11L);
((CustContractLine)contlineremote).ExcelUpLoad(contlines[i]);
}
this.app.getAppBean().save();
this.sessionContext.queueRefreshEvent();
viewdetails(uid);
}
catch (MXException e)
{
Utility.showMessageBox(event, "contract", e.getMessage() + " Line--" + this.row, null);
}
catch (BiffException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
this.app.remove("doclinkfile");
return 1;
}
public int viewdetails(long uid)
throws MXException, RemoteException
{
MXSession mxs = this.sessionContext.getMXSession();
UserInfo userInfo = mxs.getUserInfo();
String appValue = this.sessionContext.getCurrentEvent().getValueString();
DataBean appBean = Utility.getDataSource(this.sessionContext, this.app.getAppHandler());
this.sessionContext.queueEvent(new WebClientEvent("changeapp", this.app.getId(), "contpurch", null, null, uid, this.sessionContext));
return 1;
}
}
......@@ -22,7 +22,7 @@ public class JDBC
String sql_2=" select f.FINCNTRLID f1,t.projectid p1,f.FINCNTRLID p2,f.startdate from "
+ "( select FINCNTRLID, projectid from FINCNTRL f1 where CUSTBUGETTYPE='PURCHASE' "
+ "and fctype='PROJECT' ) t inner join FINCNTRL f on f.parentfincntrlid =t.FINCNTRLID where f.FINCNTRLID='1100340' ";
+ "and fctype='PROJECT' ) t inner join FINCNTRL f on f.parentfincntrlid =t.FINCNTRLID and parentfincntrlid='1101145' ";
stat=conn.createStatement();
rs=stat.executeQuery(sql_2);
while(rs.next()){
......@@ -31,11 +31,11 @@ public class JDBC
entity.setPolineNum(rs.getString("p2"));
entity.setTableId(rs.getString("f1"));
list.add(entity);
// System.out.println(entity.toString());
System.out.println(entity.toString());
}
//
for (int i = 0; i < list.size(); i++) {
Entity e=list.get(i);//获取费用预算ID
......@@ -89,7 +89,7 @@ public class JDBC
// stat1=conn.createStatement();
// stat1.execute(sql);
}
//
System.out.println("所有的更新完成");
System.out.println(conn);
} catch (ClassNotFoundException | SQLException e) {
......@@ -100,5 +100,6 @@ public class JDBC
}
public static void main(String[] args) {
getConn();
System.out.println("1111");
}
}
......@@ -20,7 +20,7 @@ public class JDBC
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn=DriverManager.getConnection("jdbc:sqlserver://172.17.16.31:1433;DatabaseName=maxdb7", "maximosql","Max60fcg");
String sql_2=" select finexpenselineid from finexpenseline ";
String sql_2=" select finexpenselineid from finexpenseline where finexpenselineid ='2203'";// where finexpenselineid ='1102'
stat=conn.createStatement();
rs=stat.executeQuery(sql_2);
while(rs.next()){
......@@ -40,9 +40,10 @@ public class JDBC
" where finexpenseline.finexpenselineid ='"+e.getPoNum()+"'" +
" ) t " +
" ) where finexpenselineid ='"+e.getPoNum()+"'";
// stat=conn.createStatement();
stat=conn.createStatement();
System.out.println(sql1);
// stat.executeUpdate(sql1);
stat.executeUpdate(sql1);
}
System.out.println("所有的更新完成");
System.out.println(conn);
......
......@@ -36,7 +36,7 @@ public class JDBC
for (int i = 0; i < list.size(); i++) {
Entity e= list.get(i);
String sql_4=" select projectid ,finexpenselineid from finexpense fi left join finexpenseline f on fi.finexpenseid =f.finexpenseid where fi.projectid='"+e.getPolineNum()+"' and f.startdate >='2022-01-01 00:00:00' and f.enddate <='2022-12-31 23:59:59' and finexpenselineid=248 ";
String sql_4=" select projectid ,finexpenselineid from finexpense fi left join finexpenseline f on fi.finexpenseid =f.finexpenseid where fi.projectid='"+e.getPolineNum()+"' and f.startdate >='2022-01-01 00:00:00' and f.enddate <='2022-12-31 23:59:59' ";
rs=stat.executeQuery(sql_4);
if(rs.next()){
Entity2 entity2=new Entity2();
......
package test;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
public class JDBC更新领料占用信息 {
private static Connection conn=null;
private static Statement stat=null;
private static ResultSet rs=null;
public static Connection getConn() {
List<Entity> list=new ArrayList<Entity>();
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn=DriverManager.getConnection("jdbc:sqlserver://172.17.16.31:1433;DatabaseName=maxdb7", "maximosql","Max60fcg");
String sql_2="select f.projectid ,f2.finexpenselineid from finexpense f,finexpenseline f2 where f.finexpenseid =f2.finexpenseid and finexpenselineid ='2203' ";
stat=conn.createStatement();
rs=stat.executeQuery(sql_2);
while(rs.next()){
Entity entity=new Entity();
entity.setPolineNum(rs.getString("finexpenselineid"));
entity.setPoNum(rs.getString("projectid"));
// entity.setTableId(rs.getString("tableid"));
list.add(entity);
}
for (int i = 0; i < list.size(); i++) {
Entity e= list.get(i);
String sql2=" select sum(linecost) linecont from ( select ( case when (WPMATERIAL.linecost - ( select isnull(sum(linecost),0) from matusetrans where "
+ " refwo=WPMATERIAL.wonum and wpitemid=WPMATERIAL.wpitemid)) <=0 "
+ " then 0 else (WPMATERIAL.linecost - ( select isnull(sum(linecost),0) "
+ " from matusetrans where refwo=WPMATERIAL.wonum and wpitemid=WPMATERIAL.wpitemid)) end) linecost from WPMATERIAL "
+ " inner join workorder on workorder.wonum=WPMATERIAL.wonum "
+ " where WPMATERIAL.wonum in ( select wonum from workorder where FCG_PROJECTID in ('"+e.getPoNum()+"') "
+ " and reportdate >='2022-01-01' and WORKTYPE='LL' "
+ " and exists(select 1 from wfassignment where ownertable='WORKORDER' "
+ " AND NODEID IN (24,38,40) and ownerid=workorder.workorderid and ASSIGNSTATUS='ACTIVE')) ) temp ";
Statement stat1=conn.createStatement();
System.out.println(sql2);
ResultSet rs1= stat1.executeQuery(sql2);
if(rs1.next()){
// System.out.println(e.getPoNum()+"---"+e.getPolineNum()+"---"+rs1.getDouble("linecont"));
double line=rs1.getDouble("linecont");
String sql333=" update finexpenseline set PENDINGCOST="+line+" where finexpenselineid="+e.getPolineNum()+"";
String sql444=" update finexpenseline set NETCOST=ACTUALCOST-PROJECTCOST where finexpenselineid="+e.getPolineNum()+"";
System.out.println(sql333);
System.out.println(sql444);
// Statement stat2=conn.createStatement();
// stat2.execute(sql333);
// Statement stat3=conn.createStatement();
// stat3.execute(sql444);
}
// stat=conn.createStatement();
// stat.execute(sql3);
}
System.out.println("所有的更新完成");
System.out.println(conn);
} catch (ClassNotFoundException | SQLException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
return conn;
}
public static void main(String[] args) {
getConn();
}
}
package test;
public class Test111 {
public static void main(String[] args) {
String num ="FCG-2022-A5-1060".substring(12);
num=String.valueOf(Integer.valueOf(num)+1);
// String num = String.valueOf(num);
int i_long = 3 - num.length();
if (i_long == 1) {
num = "0" + num;
}
//
if (i_long == 2) {
num = "00" + num;
}
//
if (i_long == 3) {
num = "000" + num;
}
System.out.println(num);
}
}
package test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
public class 更新采购预算行的PROJECTID {
private static Connection conn=null;
private static Statement stat=null;
private static ResultSet rs=null;
public static Connection getConn() {
DecimalFormat df = new DecimalFormat("######0.00");
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn=DriverManager.getConnection("jdbc:sqlserver://172.17.16.31:1433;DatabaseName=maxdb7", "maximosql","Max60fcg");
String sql_1=" select projectid from fincntrl where parentfincntrlid is NULL ";
stat=conn.createStatement();
rs=stat.executeQuery(sql_1);
int i=0;
while(rs.next()){
int fincntrlid=rs.getInt("parentfincntrlid");
String projectid=rs.getString("projectid");
// String sql=" UPDATE finexpenseline set NETCOST=(select (BUDGETCOST-PROJECTCOST) " +
// " from finexpenseline where finexpenselineid='"+finexpenselineid+"') where finexpenselineid='"+finexpenselineid+"'";
System.out.println(++i+"-----"+fincntrlid);
System.out.println("-----"+projectid);
// stat=conn.createStatement();
// stat.executeUpdate(sql);
}
System.out.println("--------更新已用预算完毕");
System.out.println(conn);
} catch (ClassNotFoundException | SQLException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
return conn;
}
public static void main(String[] args) {
getConn();
}
}
package tohi.app.class1;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXException;
public class ClassMbo extends Mbo implements MboRemote{
public ClassMbo(MboSet ms) throws RemoteException {
super(ms);
}
@Override
public void init() throws MXException {
super.init();
// try {
// if (getString("STATUS").equalsIgnoreCase("APPR")) {
// this.setFlag(7L,true);
// }else{
// this.setFlag(7L,false);
// }
// } catch (RemoteException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public void add() throws MXException, RemoteException {
super.add();
setValue("CREATEBY", this.getUserInfo().getUserName());
setValue("CREATEDATE", MXServer.getMXServer().getDate());
setValue("CLASSNUM", genClassNum());
}
private String genClassNum() throws RemoteException, MXException {
MboSetRemote mboSet=MXServer.getMXServer().getMboSet("CLASS", this.getUserInfo());
mboSet.setOrderBy("CLASSID desc");
String pre="BJ";
String n="";
try {
n = mboSet.getMbo(0).getString("CLASSNUM");
} catch (RemoteException e) {
e.printStackTrace();
} catch (MXException e) {
e.printStackTrace();
}
String tempnum=n.substring(1);
return pre+Integer.parseInt(tempnum)+1;
}
@Override
public void modify() throws MXException, RemoteException {
super.modify();
setValue("CHANGEBY", this.getUserInfo().getUserName());
setValue("CHANGEDATE", MXServer.getMXServer().getDate());
}
//保存前发生的操作
@Override
public void appValidate() throws MXException, RemoteException {
super.appValidate();
// MboSetRemote mboSet=this.getMboSet("XXX");
// double d=mboSet.sum("COL1");//此字段求和
// setValue("col1sum", d);
// for (int i = 0; i < mboSet.count(); i++) {
// MboRemote mbo=mboSet.getMbo(i);
// //逻辑
// }
}
//保存后发生操作
@Override
protected void save() throws MXException, RemoteException {
super.save();
}
}
package tohi.app.class1;
import java.rmi.RemoteException;
import psdi.mbo.Mbo;
import psdi.mbo.MboServerInterface;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.util.MXException;
public class ClassMboSet extends MboSet implements MboSetRemote{
public ClassMboSet(MboServerInterface ms) throws RemoteException {
super(ms);
}
@Override
protected Mbo getMboInstance(MboSet arg0) throws MXException,
RemoteException {
return new ClassMbo(arg0);
}
}
package tohi.app.class1;
import java.rmi.RemoteException;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.mbo.MboValueAdapter;
import psdi.util.MXException;
//ֶΰ
public class FldCol1 extends MboValueAdapter{
public FldCol1() {
super();
}
public FldCol1(MboValue mbv) {
super(mbv);
}
@Override
public void action() throws MXException, RemoteException {
super.action();
if (this.getMboValue().getString().equals("APPR")) {
this.mboValue.getMbo().setFlag(7L,true);
}else if (this.getMboValue().getString().equals("WAPPR")) {
this.mboValue.getMbo().setFlag(7L,false);
}else if (this.getMboValue().getString().equals("WAPPR1")) {
this.mboValue.getMbo().setFieldFlag("", 7L, true);
}
}
@Override
public MboSetRemote getList() throws MXException, RemoteException {
// TODO Auto-generated method stub
return super.getList();
}
@Override
public void init() throws MXException, RemoteException {
// TODO Auto-generated method stub
super.init();
}
@Override
public void initValue() throws MXException, RemoteException {
// TODO Auto-generated method stub
super.initValue();
}
}
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