private void loadInit() throws Exception {
// 人员过滤 显示当前登录公司下面的职员
this.prmtAPPEmp.setCommitFormat("$name$;$number$");
this.prmtAPPEmp.setQueryInfo("com.kingdee.eas.basedata.person.app.PersonQuery");
SysContext ctx = SysContext.getSysContext();
EntityViewInfo material = new EntityViewInfo();
FilterInfo APPEmpfilterInfo = new FilterInfo();
APPEmpfilterInfo
.getFilterItems()
.add(
new FilterItemInfo(
"ADMINORGUNIT.DISPLAYNAME",
"%"+ctx.getCurrentAdminUnit().getDisplayName()+"%",
CompareType.LIKE));
material.setFilter(APPEmpfilterInfo);
this.prmtAPPEmp.setEntityViewInfo(material);
// 人员过滤 显示当前登录公司下面的职员
this.prmtAPPEmp_1.setEntityViewInfo(material);
}
//监听
//调研人发生变化
@Override
public void prmtAPPEmp_Changed() throws Exception {
this.pkBizDate.setValue(new Date()) ;
if(null==this.prmtAPPEmp.getValue())
return;
PersonInfo personInfo = (PersonInfo) this.prmtAPPEmp.getValue();
String fempid = "";
String fposid = "";
String fdeptid = "";
String fcompid = "";
String fcostcenterid = "";
this.prmtCreator.setValue(SysContext.getSysContext()
.getCurrentUserInfo());
String strSql = "";
strSql = "select a.FID as fempid, c.FID as fposid, d.FID as fdeptid, d.FControlUnitID as fcompid from T_BD_Person a left join T_ORG_PositionMember b on a.FID = b.FPersonID left join T_ORG_Position c on b.FPositionID = c.FID left join T_ORG_Admin d on c.FAdminOrgUnitID = d.FID left join T_PM_User e on a.FID = e.FPersonId where a.FNumber = '"
+
personInfo.getNumber()+ "' and d.FControlUnitID='"+SysContext.getSysContext()
.getCurrentAdminUnit().getId()+"' ";
IRowSet rs = SQLExecutorFactory.getRemoteInstance(strSql)
.executeSQL();
while (rs.next()) {
fempid = rs.getString("fempid");
fposid = rs.getString("fposid");
fdeptid = rs.getString("fdeptid");
fcompid = rs.getString("fcompid");
IPerson iEmp = PersonFactory.getRemoteInstance();
IPosition iPos = PositionFactory.getRemoteInstance();
IAdminOrgUnit iDept = AdminOrgUnitFactory.getRemoteInstance();
IAdminOrgUnit iComp = AdminOrgUnitFactory.getRemoteInstance();
ICostCenterOrgUnit iCostCenter = CostCenterOrgUnitFactory
.getRemoteInstance();
if (!fempid.equals("")) {
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(fempid));
//this.prmtAPPEmp.setValue(iEmp.getValue(pk));
EntityViewInfo evi = new EntityViewInfo();
FilterInfo filterInfo = new FilterInfo();
filterInfo
.getFilterItems()
.add(
new FilterItemInfo(
"id",
"select c.FID from T_BD_Person a left join T_ORG_PositionMember b on a.FID = b.FPersonID left join T_ORG_Position c on b.FPositionID = c.FID left join T_ORG_Admin d on c.FAdminOrgUnitID = d.FID left join T_PM_User e on a.FID = e.FPersonId where e.FNumber = '"
+
this.prmtAPPEmp.getValue()
.toString() + "' ",
CompareType.INNER));
evi.setFilter(filterInfo);
this.prmtAPPDuty.setEntityViewInfo(evi);
}
if (!fposid.equals("")) {
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(fposid));
this.prmtAPPDuty.setValue(iPos.getValue(pk));
EntityViewInfo evi = new EntityViewInfo();
FilterInfo filterInfo = new FilterInfo();
filterInfo
.getFilterItems()
.add(
new FilterItemInfo(
"id",
"select d.FID from T_BD_Person a left join T_ORG_PositionMember b on a.FID = b.FPersonID left join T_ORG_Position c on b.FPositionID = c.FID left join T_ORG_Admin d on c.FAdminOrgUnitID = d.FID left join T_PM_User e on a.FID = e.FPersonId where e.FNumber = '"
+
this.prmtAPPEmp.getValue()
.toString() + "' ",
CompareType.INNER));
evi.setFilter(filterInfo);
this.prmtAPPDept.setEntityViewInfo(evi);
}
if (!fdeptid.equals("")) {
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(fdeptid));
this.prmtAPPDept.setValue(iDept.getValue(pk));
EntityViewInfo evi = new EntityViewInfo();
FilterInfo filterInfo = new FilterInfo();
filterInfo
.getFilterItems()
.add(
new FilterItemInfo(
"id",
"select d.FControlUnitID from T_BD_Person a left join T_ORG_PositionMember b on a.FID = b.FPersonID left join T_ORG_Position c on b.FPositionID = c.FID left join T_ORG_Admin d on c.FAdminOrgUnitID = d.FID left join T_PM_User e on a.FID = e.FPersonId where e.FNumber = '"
+
this.prmtAPPEmp.getValue()
.toString() + "' ",
CompareType.INNER));
evi.setFilter(filterInfo);
this.prmtAPPCompany.setEntityViewInfo(evi);
}
if (!fcompid.equals("")) {
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(fcompid));
this.prmtAPPCompany.setValue(iComp.getValue(pk));
}
}
super.prmtAPPEmp_Changed();
}