| | |
| | | import com.doumee.dao.business.model.Solutions; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import javax.servlet.ServletOutputStream; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.net.URL; |
| | | import java.net.URLDecoder; |
| | |
| | | public static final String TAXES_FILE = "TAXES_FILE"; |
| | | public static final String APPLY_FILE ="APPLY_FILE" ; |
| | | public static final String SETTLE_FILE ="SETTLE_FILE" ; |
| | | public static final String DU_FILE ="DU_FILE" ; |
| | | public static final String SIGN_DONE_NOTIFY_URL = "SIGN_DONE_NOTIFY_URL"; |
| | | |
| | | /** |
| | |
| | | Integer sex = 1; |
| | | if (matcher.matches()) { |
| | | int genderCode = Integer.parseInt(idCard.substring(16, 17)); // 从第17位开始提取性别编码(奇数为男性,偶数为女性) |
| | | |
| | | if ((genderCode % 2 == 1)) { |
| | | if ((genderCode % 2 == 1) ) { |
| | | sex = 1; |
| | | } else { |
| | | sex = 2; |
| | |
| | | BZZ(2, "保障中"), |
| | | YGQ(3, "已过期"), |
| | | YTH(4, "已退回"), |
| | | THSQZ(5, "退回申请中"), |
| | | THSQZ(5, "申请退回"), |
| | | YGB(6, "已关闭"), |
| | | DQYQZ(7, "待签署"), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | |
| | | public enum InsuranceApplyStatus { |
| | | UPLOAD(0, "提交投保","",0), |
| | | PLATFORM_RETURN(1, "审核不通过","提交意见:${param}",4), |
| | | WAIT_SIGNATURE(2, "已上传代签申请表待企业签章","",1), |
| | | WAIT_SIGNATURE(2, "已上传代签申请表待企业签章","",7), |
| | | SIGNATURE(3, "已签章待上传保险单","",1), |
| | | FAIL_RETURN(4, "保单出具失败退回","",0), |
| | | FAIL_RETURN(4, "保单出具失败退回","",4), |
| | | UPLOAD_INSURANCE(5, "保单完成","保险生效起期:${param}变更为${param1}",2), |
| | | COMPANY_BACK_APPLY_UPLOAD(6, "企业申请退回(提交投保)","提交意见:${param}",5), |
| | | COMPANY_BACK_APPLY_WAIT_SIGNATURE(7, "企业申请退回(待签章)","提交意见:${param}",5), |
| | |
| | | private String info; |
| | | private int key; |
| | | private int collectStatus; |
| | | |
| | | |
| | | // 构造方法 |
| | | InsuranceApplyStatus(int key, String name,String info,int collectStatus) { |
| | |
| | | } |
| | | return solutions.getPrice().multiply(new BigDecimal(cycle)); |
| | | } |
| | | |
| | | public static BigDecimal countDetailFee(int timeUnit ,BigDecimal price,Date startDate, Date endDate){ |
| | | //查询保险实际周期 |
| | | Integer cycle = DateUtil.calculateBetween(endDate,startDate,timeUnit); |
| | |
| | | InputStream inStream = null; |
| | | OutputStream os = null; |
| | | try { |
| | | file = File.createTempFile("", fileName); |
| | | String tempDir = System.getProperty("java.io.tmpdir")+fileName; |
| | | file = new File(tempDir); |
| | | //下载 |
| | | urlfile = new URL(url); |
| | | inStream = urlfile.openStream(); |
| | |
| | | |
| | | return file; |
| | | } |
| | | public static void packFilesToZip(List<File> files, ServletOutputStream os) throws IOException { |
| | | try (ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os)) { |
| | | for (File file : files) { |
| | | ZipArchiveEntry entry = new ZipArchiveEntry(file.getName()); |
| | | zipOutputStream.putArchiveEntry(entry); |
| | | try (FileInputStream fileInputStream = new FileInputStream(file)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = fileInputStream.read(buffer)) > 0) { |
| | | zipOutputStream.write(buffer, 0, length); |
| | | } |
| | | } |
| | | zipOutputStream.closeArchiveEntry(); |
| | | } |
| | | } |
| | | } |
| | | } |