柜号校验
This commit is contained in:
parent
bc6ddde0f6
commit
004586ecb4
@ -18,12 +18,9 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.officetempalte.importcallback.impl.BaseImportExcelCallBack;
|
||||
|
||||
public class MailingContainerNumberImport extends BaseImportExcelCallBack{
|
||||
|
||||
|
||||
@Override
|
||||
public void run(ASUser CurUser, BizObject importObject,Map<String, String> model, Integer rowIndex, JBOTransaction tx,Transaction Sqlca) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runBefore(ASUser CurUser, Map<String, String> model, List<BizObject> importObjects, JBOTransaction tx,Transaction Sqlca) throws Exception {
|
||||
Transaction Sqlca1 = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
@ -33,11 +30,8 @@ public class MailingContainerNumberImport extends BaseImportExcelCallBack{
|
||||
String error=""; // 错误描述
|
||||
boolean flag=false; // 错误描述
|
||||
String ARCHIVING_CABINET_NO=null; // 导入的邮寄柜号
|
||||
String CONTRACT_NUMBER=null;
|
||||
String sql1=""; // 原有的数据
|
||||
/**
|
||||
* 校验本次Excel是否有重复的
|
||||
*/
|
||||
|
||||
/**
|
||||
* 校验本次导入数据在导入表是否已有
|
||||
*/
|
||||
@ -49,11 +43,10 @@ public class MailingContainerNumberImport extends BaseImportExcelCallBack{
|
||||
ARCHIVING_CABINET_NO=bo.getAttribute("ARCHIVING_CABINET_NO").getString();
|
||||
arrayList.add(ARCHIVING_CABINET_NO);
|
||||
// 通过本次excel中的数据查询导入的表, 判断是否重复
|
||||
sql1="SELECT ARCHIVING_CABINET_NO FROM LB_FILE_MAILARCHIVING_INFO WHERE ARCHIVING_CABINET_NO='"+ARCHIVING_CABINET_NO+"'";
|
||||
sql1="SELECT ARCHIVING_CABINET_NO,CONTRACT_NUMBER FROM LB_FILE_ARCHIVING_INFO WHERE ARCHIVING_CABINET_NO='"+ARCHIVING_CABINET_NO+"'";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(Sqlca, sql1, null);
|
||||
// 有结果集, 说明重复
|
||||
if(dataList.size()>0){
|
||||
//error=",【邮寄柜号: "+ARCHIVING_CABINET_NO+"】";
|
||||
if(! exclarrayList.contains(ARCHIVING_CABINET_NO) ){
|
||||
exclarrayList.add(ARCHIVING_CABINET_NO);
|
||||
}
|
||||
@ -61,8 +54,6 @@ public class MailingContainerNumberImport extends BaseImportExcelCallBack{
|
||||
}
|
||||
}
|
||||
if(flag) {
|
||||
//error = error.substring(1);
|
||||
//throw new BusinessException(error+"已存在 !");
|
||||
throw new BusinessException(",excl中的邮寄柜号:"+String.join(", ", exclarrayList)+"已存在 !");
|
||||
}
|
||||
long count = arrayList.stream().distinct().count();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user