|
|
@ -27,9 +27,9 @@ import com.epmet.commons.tools.validator.group.AddGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|
|
|
import com.epmet.dto.form.IcPartyMemberFormDTO; |
|
|
|
import com.epmet.dto.form.IcPartyMemberListFormDTO; |
|
|
|
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|
|
|
import com.epmet.dto.result.PartyMemberAgeResultDTO; |
|
|
|
import com.epmet.dto.result.PartyMemberEducationResultDTO; |
|
|
|
import com.epmet.modules.partymember.excel.IcPartyMemberExcel; |
|
|
@ -43,14 +43,17 @@ import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.io.IOUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.PrintWriter; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
@ -284,4 +287,24 @@ public class IcPartyMemberController implements ResultDataResolver { |
|
|
|
} |
|
|
|
return new Result<List<OptionDataResultDTO>>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "downloadTemplate", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
public void downloadTemplate(HttpServletResponse response) throws IOException { |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); |
|
|
|
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("党员信息导入模板", "UTF-8") + ".xlsx"); |
|
|
|
|
|
|
|
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/ic_party_member.xlsx"); |
|
|
|
try { |
|
|
|
ServletOutputStream os = response.getOutputStream(); |
|
|
|
IOUtils.copy(is, os); |
|
|
|
} finally { |
|
|
|
if (is != null) { |
|
|
|
is.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|