资产转出导入,已存在的不允许导入

This commit is contained in:
liuzhao 2019-04-10 09:47:17 +08:00
parent 970584681a
commit 0dcb369d64

View File

@ -14,7 +14,6 @@ import com.tenwa.comm.exception.BusinessException;
import com.tenwa.officetempalte.importcallback.impl.BaseImportExcelCallBack;
public class AssetsOffCallBack extends BaseImportExcelCallBack{
@Override
public void run(ASUser CurUser, BizObject importObject,
Map<String, String> model, Integer rowIndex, JBOTransaction tx,
@ -93,15 +92,19 @@ public class AssetsOffCallBack extends BaseImportExcelCallBack{
throw new BusinessException(e.getMessage());
}
//importObject.setAttributeValue("stores_day", stores_day);
//查询该合同号是否存在
BizObjectManager contractInfoManager = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx);
BizObject contractInfo = contractInfoManager.createQuery("CONTRACT_NO=:CONTRACT_NO").setParameter("CONTRACT_NO", contractNo).getSingleResult(true);
if (contractInfo==null) {
throw new BusinessException("该合同号 "+contractNo+" 不存在!");
}
}
//已经存在资产转出方的不允许导入
String ass = contractInfo.getAttribute("ASSETTRANSFERER")==null? "" : contractInfo.getAttribute("ASSETTRANSFERER").toString();
if (!"".equals(ass)) {
throw new BusinessException("该合同号 "+contractNo+" 已存在<<资产转出方>> 请勿重复导入!");
}
contractInfo.setAttributeValue("ASSETTRANSFERER", assettransferer);
contractInfo.setAttributeValue("TRANSFERDATE", transferdate);
contractInfo.setAttributeValue("TURNOUTREMARKS", turnoutremarks);