// cjj 获取认购单的认购日期
UFDate dsubscdate = (UFDate) AppPsUtil.getAppSession().getAttribute(
"dsubscdate");
// cjj 如果是认购,则执行下面代码,验证认购单创建时间是否比客户创建时间晚,不是认购,执行原代码
if (dsubscdate != null) {
for (BDCustomerVO bdCustomer : selectedCusList) {
if (bdCustomer.getDregdate().beforeDate(dsubscdate)) {
//由单据,如排号,认购单据上的客户表体带过来的客户数据
existedCusVOList=AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList")==null?new ArrayList<BDCustomerVO>():(ArrayList<BDCustomerVO>)AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList");
List<String> existedCusVOPKList = new ArrayList<String>();
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempcusvo:existedCusVOList)
{
existedCusVOPKList.add(tempcusvo.getPk_customer());
}
}
//本次所选客户和由单据传过来的已存在客户对比后,过滤掉重复客户,需新增加的客户数据
List<BDCustomerVO> needAddCusList = new ArrayList<BDCustomerVO>();
//由单据传过来有客户信息,进行过滤
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempvo:selectedCusList){
if(!existedCusVOPKList.contains(tempvo.getPk_customer()))
{
needAddCusList.add(tempvo);
}
}
}else{ //如无传来的客户数据,无需校验,则将本次所选客户加入即可
for(BDCustomerVO tempvo:selectedCusList)
{
needAddCusList.add(tempvo);
}
}
if(null!=needAddCusList && needAddCusList.size()>0){
selectedCusVO=(BDCustomerVO[])needAddCusList.toArray(new BDCustomerVO[0]);
//更新已存在客户队列信息,将本次新增加的客户数据加入。
for(BDCustomerVO tempcusvo:needAddCusList)
{
existedCusVOList.add(tempcusvo);
}
}else
{
selectedCusVO=null;
}
} else
{
AppInteractionUtil.showErrorDialog(bdCustomer.getVcname()
+ "客户未在" + dsubscdate.toString().substring(0, 10) + "前报备,请关闭认购单后重新打开!");
return;
}
}
} else {
//由单据,如排号,认购单据上的客户表体带过来的客户数据
existedCusVOList=AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList")==null?new ArrayList<BDCustomerVO>():(ArrayList<BDCustomerVO>)AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList");
List<String> existedCusVOPKList = new ArrayList<String>();
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempcusvo:existedCusVOList)
{
existedCusVOPKList.add(tempcusvo.getPk_customer());
}
}
//本次所选客户和由单据传过来的已存在客户对比后,过滤掉重复客户,需新增加的客户数据
List<BDCustomerVO> needAddCusList = new ArrayList<BDCustomerVO>();
//由单据传过来有客户信息,进行过滤
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempvo:selectedCusList){
if(!existedCusVOPKList.contains(tempvo.getPk_customer()))
{
needAddCusList.add(tempvo);
}
}
}else{ //如无传来的客户数据,无需校验,则将本次所选客户加入即可
for(BDCustomerVO tempvo:selectedCusList)
{
needAddCusList.add(tempvo);
}
}
if(null!=needAddCusList && needAddCusList.size()>0){
selectedCusVO=(BDCustomerVO[])needAddCusList.toArray(new BDCustomerVO[0]);
//更新已存在客户队列信息,将本次新增加的客户数据加入。
for(BDCustomerVO tempcusvo:needAddCusList)
{
existedCusVOList.add(tempcusvo);
}
}else
{
selectedCusVO=null;
}
}
// cjj 获取认购单的认购日期
UFDate dsubscdate = (UFDate) AppPsUtil.getAppSession().getAttribute(
"dsubscdate");
// cjj 如果是认购,则执行下面代码,验证认购单创建时间是否比客户创建时间晚,不是认购,执行原代码
if (dsubscdate != null) {
for (BDCustomerVO bdCustomer : selectedCusList) {
if (bdCustomer.getDregdate().beforeDate(dsubscdate)) {
//由单据,如排号,认购单据上的客户表体带过来的客户数据
{ existedCusVOPKList.add(tempcusvo.getPk_customer()); }existedCusVOList=AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList")==null?new ArrayList<BDCustomerVO>():(ArrayList<BDCustomerVO>)AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList");
List<String> existedCusVOPKList = new ArrayList<String>();
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempcusvo:existedCusVOList)
}
{ needAddCusList.add(tempvo); }//本次所选客户和由单据传过来的已存在客户对比后,过滤掉重复客户,需新增加的客户数据
List<BDCustomerVO> needAddCusList = new ArrayList<BDCustomerVO>();
//由单据传过来有客户信息,进行过滤
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempvo:selectedCusList){
if(!existedCusVOPKList.contains(tempvo.getPk_customer()))
}
{ needAddCusList.add(tempvo); }}else{ //如无传来的客户数据,无需校验,则将本次所选客户加入即可
for(BDCustomerVO tempvo:selectedCusList)
}
{ existedCusVOList.add(tempcusvo); }if(null!=needAddCusList && needAddCusList.size()>0){
selectedCusVO=(BDCustomerVO[])needAddCusList.toArray(new BDCustomerVO[0]);
//更新已存在客户队列信息,将本次新增加的客户数据加入。
for(BDCustomerVO tempcusvo:needAddCusList)
}else
{ selectedCusVO=null; }} else
{ AppInteractionUtil.showErrorDialog(bdCustomer.getVcname() + "客户未在" + dsubscdate.toString().substring(0, 10) + "前报备,请关闭认购单后重新打开!"); return; }}
} else {
//由单据,如排号,认购单据上的客户表体带过来的客户数据
{ existedCusVOPKList.add(tempcusvo.getPk_customer()); }existedCusVOList=AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList")==null?new ArrayList<BDCustomerVO>():(ArrayList<BDCustomerVO>)AppPsUtil.getAppSession().getAttribute("selectedCustomerVOList");
List<String> existedCusVOPKList = new ArrayList<String>();
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempcusvo:existedCusVOList)
}
{ needAddCusList.add(tempvo); }//本次所选客户和由单据传过来的已存在客户对比后,过滤掉重复客户,需新增加的客户数据
List<BDCustomerVO> needAddCusList = new ArrayList<BDCustomerVO>();
//由单据传过来有客户信息,进行过滤
if(null!=existedCusVOList && existedCusVOList.size()>0){
for(BDCustomerVO tempvo:selectedCusList){
if(!existedCusVOPKList.contains(tempvo.getPk_customer()))
}
{ needAddCusList.add(tempvo); }}else{ //如无传来的客户数据,无需校验,则将本次所选客户加入即可
for(BDCustomerVO tempvo:selectedCusList)
}
{ existedCusVOList.add(tempcusvo); }if(null!=needAddCusList && needAddCusList.size()>0){
selectedCusVO=(BDCustomerVO[])needAddCusList.toArray(new BDCustomerVO[0]);
//更新已存在客户队列信息,将本次新增加的客户数据加入。
for(BDCustomerVO tempcusvo:needAddCusList)
}else
{ selectedCusVO=null; }}