|
|
@@ -19,6 +19,7 @@ import com.xunmei.common.core.domain.registerbook.dto.CoreRegisterBookPdfPageDto
|
|
|
import com.xunmei.common.core.domain.registerbook.dto.ExportPdfDto;
|
|
|
import com.xunmei.common.core.domain.registerbook.vo.CoreRegisterBookPdfPageVo;
|
|
|
import com.xunmei.common.core.domain.registerbook.vo.PdfLocalFileTempVo;
|
|
|
+import com.xunmei.common.core.enums.OrgTypeEnum;
|
|
|
import com.xunmei.common.core.enums.RegisterBookType;
|
|
|
import com.xunmei.common.core.util.BeanHelper;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
@@ -215,22 +216,30 @@ public class CoreRegisterBookPdfServiceImpl extends ServiceImpl<CoreRegisterBook
|
|
|
|
|
|
@Override
|
|
|
public String getPdfFileName(RegisterBookType bookType, SysOrg org) {
|
|
|
- StringBuilder sb =new StringBuilder();
|
|
|
- if(!StringUtil.isNullOrEmpty(org.getAffiliatedArea()))
|
|
|
- {
|
|
|
- sb.append(org.getAffiliatedArea()).append("_");
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ String affiliatedArea = ObjectUtil.isEmpty(org.getAffiliatedArea()) ? "" : org.getAffiliatedArea();
|
|
|
+ String affiliatedBank = ObjectUtil.isEmpty(org.getAffiliatedBank()) ? "" : org.getAffiliatedBank();
|
|
|
+
|
|
|
+ if (OrgTypeEnum.DIQU_HANG_SHE.getCode().equals(org.getType())) {
|
|
|
+ return buildFileName(sb, org.getShortName(), bookType.getText());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (OrgTypeEnum.HANG_SHE.getCode().equals(org.getType())) {
|
|
|
+ return buildFileName(sb, affiliatedArea, org.getShortName(), bookType.getText());
|
|
|
}
|
|
|
- if(!StringUtil.isNullOrEmpty(org.getAffiliatedBank()))
|
|
|
- {
|
|
|
- sb.append(org.getAffiliatedBank()).append("_");
|
|
|
+
|
|
|
+ if (!StringUtil.isNullOrEmpty(org.getAffiliatedArea())) {
|
|
|
+ sb.append(affiliatedArea).append("_").append(affiliatedBank).append("_");
|
|
|
}
|
|
|
- sb.append(org.getShortName())
|
|
|
- .append("_")
|
|
|
- .append(bookType.getText())
|
|
|
- .append("_")
|
|
|
- .append(DateUtil.format(new Date(), Constants.HM_FORMAT))
|
|
|
- .append(".pdf");
|
|
|
|
|
|
+ return buildFileName(sb, org.getShortName(), bookType.getText());
|
|
|
+ }
|
|
|
+
|
|
|
+ private String buildFileName(StringBuilder sb, String... parts) {
|
|
|
+ for (String part : parts) {
|
|
|
+ sb.append(part).append("_");
|
|
|
+ }
|
|
|
+ sb.append(DateUtil.format(new Date(), Constants.HM_FORMAT)).append(".pdf");
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|