文件下载添加租金计划表

This commit is contained in:
tangfutang 2020-11-12 18:59:15 +08:00
parent 69666f4201
commit a8ee3258af
2 changed files with 40 additions and 6 deletions

View File

@ -57,19 +57,47 @@ public class CopyFileToOther {
StringBuffer docSb = new StringBuffer(); StringBuffer docSb = new StringBuffer();
for (String docName : docNameList) { for (String docName : docNameList) {
String[] docNames = docName.split("@"); String[] docNames = docName.split("@");
if("RentPlan".equals(docNames[0])){
String[] contractNoArray = contractNos.split("@");
String[] batchNoArray = batchNos.split("@");
for(int i=0;i<contractNoArray.length;i++){
String fileSavePath_xml = fileSavePath_temp+"/"+contractNoArray[i]+"/";
String templateParam = "{\"OBJECTTYPE\":\"租金支付表导出\"@\"CurUserId\":\""+userid+"\"@\"fileSavePath\":\""+fileSavePath_xml+"\"@\"CONTRACT_NO\":\""+contractNoArray[i]+"\"}";
System.out.println("路径为:"+fileSavePath_xml);
File temDir = new File(fileSavePath_xml);
if(!temDir.exists()){
temDir.mkdirs();
}
coa.setTemplateNo(templateNo);
coa.setTemplateParam(templateParam);
String result = coa.createOfficeByTemplate(tx);
if("success".equals(result)){
BizObjectManager bom = JBOFactory.getBizObjectManager(LC_COPYFILE_LOG.CLASS_NAME);
BizObject nbom = bom.newObject();
nbom.setAttributeValue("CONTRACT_NO", contractNoArray[i]);
nbom.setAttributeValue("BATCH_NO", batchNoArray[i]);
nbom.setAttributeValue("COPY_TYPE","租金计划");
nbom.setAttributeValue("INPUTTIME",StringFunction.getTodayNow());
nbom.setAttributeValue("INPUTUSERID",userid);
bom.saveObject(nbom);
}
}
}else{
if(docNames[0].length()>3){ if(docNames[0].length()>3){
docSb.append("'"); docSb.append("'");
docSb.append(docNames[1]); docSb.append(docNames[1]);
docSb.append("',"); docSb.append("',");
} }
} }
}
if(docSb!=null&&docSb.length()>0){ if(docSb!=null&&docSb.length()>0){
cp.copyFile(docSb.substring(0,docSb.length()-1).toString()); cp.copyFile(docSb.substring(0,docSb.length()-1).toString());
}else{ }else{
return "Êý¾ÝÓÐÎó£¡"; return "Êý¾ÝÓÐÎó£¡";
} }
} }
if(fileList.contains("RentPlan")){ /*if(fileList.contains("RentPlan")){
String[] contractNoArray = contractNos.split("@"); String[] contractNoArray = contractNos.split("@");
String[] batchNoArray = batchNos.split("@"); String[] batchNoArray = batchNos.split("@");
@ -94,7 +122,7 @@ public class CopyFileToOther {
bom.saveObject(nbom); bom.saveObject(nbom);
} }
} }
} }*/
tx.commit(); tx.commit();
//ѹËõ //ѹËõ
FileOutputStream fos1 = new FileOutputStream(new File(fileSavePath+"/"+time+".zip")); FileOutputStream fos1 = new FileOutputStream(new File(fileSavePath+"/"+time+".zip"));

View File

@ -39,6 +39,12 @@ public class FtpDownloadFile {
} }
} }
//Ìí¼Ó×â½ð¼Æ»®ÏÔʾ
BusinessObject docRent = BusinessObject.createBusinessObject();
docRent.setAttributeValue("ID", "RentPlan");
docRent.setAttributeValue("SortNo", "RentPlan");
docRent.setAttributeValue("Name","×â½ð¼Æ»®±í");
lst.add(docRent);
return lst; return lst;
} }