|
@@ -1,2345 +0,0 @@
|
|
-package com.jpsoft.supervision.modules.base.controller;
|
|
|
|
-
|
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
|
-import com.github.pagehelper.Page;
|
|
|
|
-import com.jpsoft.supervision.config.OSSConfig;
|
|
|
|
-import com.jpsoft.supervision.config.WechatConfig;
|
|
|
|
-import com.jpsoft.supervision.modules.base.dto.ApplicationPrimaryDTO;
|
|
|
|
-import com.jpsoft.supervision.modules.base.dto.AttachmentDTO;
|
|
|
|
-import com.jpsoft.supervision.modules.base.entity.*;
|
|
|
|
-import com.jpsoft.supervision.modules.base.service.*;
|
|
|
|
-import com.jpsoft.supervision.modules.common.dto.Sort;
|
|
|
|
-import com.jpsoft.supervision.modules.common.dto.MessageResult;
|
|
|
|
-import com.jpsoft.supervision.modules.common.utils.*;
|
|
|
|
-import com.jpsoft.supervision.modules.sys.entity.DataDictionary;
|
|
|
|
-import com.jpsoft.supervision.modules.sys.entity.User;
|
|
|
|
-import com.jpsoft.supervision.modules.sys.service.DataDictionaryService;
|
|
|
|
-import com.jpsoft.supervision.modules.sys.service.UserRoleService;
|
|
|
|
-import com.jpsoft.supervision.modules.sys.service.UserService;
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.core.io.Resource;
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
-
|
|
|
|
-import javax.imageio.ImageIO;
|
|
|
|
-import java.awt.*;
|
|
|
|
-import java.awt.image.BufferedImage;
|
|
|
|
-import java.io.*;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.util.*;
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
-@RestController
|
|
|
|
-@RequestMapping("/base/applicationPrimary")
|
|
|
|
-@Api(description = "applicationPrimary")
|
|
|
|
-public class ApplicationPrimaryController {
|
|
|
|
- private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ApplicationPrimaryService applicationPrimaryService;
|
|
|
|
- @Autowired
|
|
|
|
- private StudentInfoService studentInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private PersonInfoService personInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private StudentFilesService studentFilesService;
|
|
|
|
- @Autowired
|
|
|
|
- private DataDictionaryService dataDictionaryService;
|
|
|
|
- @Autowired
|
|
|
|
- private ApprovalInfoService approvalInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private PersonStudentService personStudentService;
|
|
|
|
- @Autowired
|
|
|
|
- private SchoolInfoService schoolInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private UserService userService;
|
|
|
|
- @Autowired
|
|
|
|
- private UserRoleService userRoleService;
|
|
|
|
- @Autowired
|
|
|
|
- private OfferInfoService offerInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- private OSSConfig ossConfig;
|
|
|
|
- @Autowired
|
|
|
|
- private WechatConfig wechatConfig;
|
|
|
|
- @Autowired
|
|
|
|
- private ApportionDetailService apportionDetailService;
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="创建空记录")
|
|
|
|
- @GetMapping("create")
|
|
|
|
- public MessageResult<ApplicationPrimary> create(){
|
|
|
|
- MessageResult<ApplicationPrimary> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- ApplicationPrimary applicationPrimary = new ApplicationPrimary();
|
|
|
|
-
|
|
|
|
- msgResult.setData(applicationPrimary);
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="添加信息")
|
|
|
|
- @PostMapping("add")
|
|
|
|
- public MessageResult<ApplicationPrimary> add(@RequestBody ApplicationPrimary applicationPrimary,@RequestAttribute String subject){
|
|
|
|
- MessageResult<ApplicationPrimary> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- //applicationPrimary.setId(UUID.randomUUID().toString());
|
|
|
|
- applicationPrimary.setDelFlag(false);
|
|
|
|
- applicationPrimary.setCreateBy(subject);
|
|
|
|
- applicationPrimary.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = applicationPrimaryService.insert(applicationPrimary);
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(applicationPrimary);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="获取信息")
|
|
|
|
- @GetMapping("edit/{id}")
|
|
|
|
- public MessageResult<ApplicationPrimary> edit(@PathVariable("id") String id){
|
|
|
|
- MessageResult<ApplicationPrimary> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
-
|
|
|
|
- if (applicationPrimary != null) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(applicationPrimary);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库不存在该记录!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="更新用户")
|
|
|
|
- @PostMapping("update")
|
|
|
|
- public MessageResult<ApplicationPrimary> update(@RequestBody ApplicationPrimary applicationPrimary,@RequestAttribute String subject){
|
|
|
|
- MessageResult<ApplicationPrimary> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = applicationPrimaryService.update(applicationPrimary);
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(applicationPrimary);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库更新失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="删除")
|
|
|
|
- @PostMapping("delete/{id}")
|
|
|
|
- public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
- applicationPrimary.setDelFlag(true);
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = applicationPrimaryService.update(applicationPrimary);
|
|
|
|
-
|
|
|
|
- //添加审批记录
|
|
|
|
- ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
|
- approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- approvalInfo.setApplicationId(applicationPrimary.getId());
|
|
|
|
- approvalInfo.setOperation("后端删除");
|
|
|
|
- approvalInfo.setCreateBy(subject);
|
|
|
|
- approvalInfo.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- approvalInfoService.insert(approvalInfo);
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(affectCount);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("删除失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="批量删除")
|
|
|
|
- @PostMapping("batchDelete")
|
|
|
|
- public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- int affectCount = 0;
|
|
|
|
-
|
|
|
|
- for (String id : idList) {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
- applicationPrimary.setDelFlag(true);
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- affectCount += applicationPrimaryService.update(applicationPrimary);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(affectCount);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("删除失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="列表")
|
|
|
|
- @RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> pageList(
|
|
|
|
- String tabStatus,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String schoolId,
|
|
|
|
- String offerId,
|
|
|
|
- @RequestParam(value="isSend",defaultValue="") String isSend,
|
|
|
|
- @RequestParam(value="categoryId",defaultValue="") String categoryId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
- @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
-
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.school_id","asc"));
|
|
|
|
- sortList.add(new Sort("a.type_","asc"));
|
|
|
|
- sortList.add(new Sort("a.category_id","desc"));
|
|
|
|
- sortList.add(new Sort("a.offer_code","asc"));
|
|
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
|
- searchParams.put("tabStatus",tabStatus);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }else{
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("categoryId", type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(isSend)){
|
|
|
|
- searchParams.put("isSend", isSend);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(offerId)){
|
|
|
|
- searchParams.put("offerId", offerId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //查询范围
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(categoryId)) {
|
|
|
|
- searchParams.put("categoryId",categoryId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
- for(ApplicationPrimaryDTO applicationPrimaryDTO : page.getResult()){
|
|
|
|
- List<AttachmentDTO> attachmentDTOList = new ArrayList<>();
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- DataDictionary dataDictionary = dataDictionaryService.findByParentIdAndValue(DataDictionary.STUDENT_RELATED_CERT_ID,"3");
|
|
|
|
- attachmentDTO.setId(dataDictionary.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionary.getName());
|
|
|
|
-
|
|
|
|
- List<String> studentFilesList = studentFilesService.findUrlByApplicationIdAndFileType(applicationPrimaryDTO.getApplicationId(),attachmentDTO.getId());
|
|
|
|
- attachmentDTO.setFiles(studentFilesList);
|
|
|
|
- attachmentDTOList.add(attachmentDTO);
|
|
|
|
-
|
|
|
|
- applicationPrimaryDTO.setStudentCertificationFileList(attachmentDTOList);
|
|
|
|
- applicationPrimaryDTO.setRelationshipName(dataDictionaryService.getName(applicationPrimaryDTO.getRelationship()));
|
|
|
|
- applicationPrimaryDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("报名类型",applicationPrimaryDTO.getType()));
|
|
|
|
- applicationPrimaryDTO.setStatusName(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimaryDTO.getStatus()));
|
|
|
|
- applicationPrimaryDTO.setCardType(dataDictionaryService.findNameByCatalogNameAndValue("证件类型",applicationPrimaryDTO.getCardType()));
|
|
|
|
- applicationPrimaryDTO.setCategoryName(dataDictionaryService.getValue(applicationPrimaryDTO.getCategoryId()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="审核分类数")
|
|
|
|
- @RequestMapping(value = "statusCount",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> statusCount(
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String schoolId,
|
|
|
|
- @RequestParam(value="isSend",defaultValue="") String isSend,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- Integer sum = 0;
|
|
|
|
- List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("小学招生审核流程");
|
|
|
|
- for(DataDictionary dataDictionary : dataDictionaryList){
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
- searchParams.put("tabStatus",dataDictionary.getValue());
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }else{
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("categoryId", type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(isSend)){
|
|
|
|
- searchParams.put("isSend", isSend);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,1,10000,false,sortList);
|
|
|
|
- map.put(dataDictionary.getValue(),page.size());
|
|
|
|
- sum += page.size();
|
|
|
|
- }
|
|
|
|
- map.put("all",sum);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(map);
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="根据学校查询数量")
|
|
|
|
- @RequestMapping(value = "schoolCount",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> schoolCount(
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String schoolId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList2 = new ArrayList<>();
|
|
|
|
- sortList2.add(new Sort("parent_id","asc"));
|
|
|
|
- sortList2.add(new Sort("code_","asc"));
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams2 = new HashMap<>();
|
|
|
|
-
|
|
|
|
- Integer sum = 0;
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- searchParams2.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- searchParams2.put("type", "1");//查学校
|
|
|
|
- Page<SchoolInfo> scPage = schoolInfoService.pageSearch(searchParams2,0,10000,false,sortList2);
|
|
|
|
-
|
|
|
|
- for(SchoolInfo sc : scPage.getResult()){
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
- schoolId = sc.getId();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }else{
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("categoryId", type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,1,10000,false,sortList);
|
|
|
|
- map.put(sc.getId(),page.size());
|
|
|
|
- sum += page.size();
|
|
|
|
- }
|
|
|
|
- map.put("all",sum);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(map);
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="根据报名类型查询数量")
|
|
|
|
- @RequestMapping(value = "categoryCount",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> categoryCount(
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String schoolId,
|
|
|
|
- String categoryId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList2 = new ArrayList<>();
|
|
|
|
- sortList2.add(new Sort("parent_id","asc"));
|
|
|
|
- sortList2.add(new Sort("code_","asc"));
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams2 = new HashMap<>();
|
|
|
|
-
|
|
|
|
- Integer sum = 0;
|
|
|
|
- List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("C类生证明");
|
|
|
|
- for(DataDictionary dataDictionary : dataDictionaryList){
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
- categoryId = dataDictionary.getId();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }else{
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("categoryId", type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(categoryId)) {
|
|
|
|
- searchParams.put("categoryId",categoryId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,1,10000,false,sortList);
|
|
|
|
- map.put(categoryId,page.size());
|
|
|
|
- sum += page.size();
|
|
|
|
- }
|
|
|
|
- map.put("all",sum);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(map);
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="获取详情")
|
|
|
|
- @GetMapping("datail/{id}")
|
|
|
|
- public MessageResult<Map> datail(@PathVariable("id") String id){
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
-
|
|
|
|
- if (applicationPrimary != null) {
|
|
|
|
- //学生信息
|
|
|
|
- StudentInfo studentInfo = studentInfoService.get(applicationPrimary.getStudentId());
|
|
|
|
- map.put("studentName",studentInfo.getName());
|
|
|
|
- map.put("studentCardType",dataDictionaryService.findNameByCatalogNameAndValue("证件类型",studentInfo.getCardType()));
|
|
|
|
- map.put("studentIdCard",studentInfo.getIdCard());
|
|
|
|
- String sexName = studentInfo.getSex() == 1 ? "男" : "女";
|
|
|
|
- map.put("studentSex",sexName);
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- map.put("studentBirthday",sdf.format(studentInfo.getBirthday()));
|
|
|
|
- PersonStudent personStudent = personStudentService.findByPersonIdAndStudentId(applicationPrimary.getPersonId(),applicationPrimary.getStudentId());
|
|
|
|
- if(personStudent != null) {
|
|
|
|
- DataDictionary dataDictionary = dataDictionaryService.get(personStudent.getRelationship());
|
|
|
|
- map.put("relationship",dataDictionary.getName());
|
|
|
|
- }
|
|
|
|
- map.put("studentFilesList",fileMap2(applicationPrimary.getId(),"学生相关证明"));
|
|
|
|
-
|
|
|
|
- //申报人信息
|
|
|
|
- PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
- map.put("personPhone",personInfo.getPhone());
|
|
|
|
- map.put("typeName",dataDictionaryService.findNameByCatalogNameAndValue("报名类型",applicationPrimary.getType()));
|
|
|
|
- map.put("status",applicationPrimary.getStatus());
|
|
|
|
- map.put("statusName",dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus()));
|
|
|
|
-// map.put("statusName","");正式居住房类型
|
|
|
|
- map.put("address",studentInfo.getAddress());
|
|
|
|
- SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
- map.put("schoolName",schoolInfo.getName());
|
|
|
|
-// map.put("statusName","");正式居住房所有人与学生关系
|
|
|
|
-// map.put("statusName","");不动产合同号
|
|
|
|
- map.put("personName",personInfo.getName());
|
|
|
|
- map.put("personIdCard",personInfo.getIdCard());
|
|
|
|
- map.put("personFilesList",fileMap1(applicationPrimary.getId(),applicationPrimary.getType()+"类生证明"));
|
|
|
|
- SchoolInfo offSchoolInfo = schoolInfoService.get(applicationPrimary.getOfferId());
|
|
|
|
- if(offSchoolInfo != null) {
|
|
|
|
- map.put("offerName",offSchoolInfo.getName());
|
|
|
|
- }else{
|
|
|
|
- map.put("offerName","");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- map.put("offerCode",applicationPrimary.getOfferCode());
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //审核记录
|
|
|
|
- List<ApprovalInfo> approvalInfoList = approvalInfoService.findByApplicationId(applicationPrimary.getId());
|
|
|
|
- for(ApprovalInfo approvalInfo : approvalInfoList){
|
|
|
|
- User user = userService.get(approvalInfo.getCreateBy());
|
|
|
|
- if(user != null) {
|
|
|
|
- approvalInfo.setCreateBy(user.getRealName());
|
|
|
|
- }else {
|
|
|
|
- approvalInfo.setCreateBy(personInfo.getName());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(approvalInfo.getFileUrl())) {
|
|
|
|
- approvalInfo.setFileUrlList(new ArrayList<>(Arrays.asList(approvalInfo.getFileUrl().split(","))));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- map.put("approvalInfoList",approvalInfoList);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(map);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库不存在该记录!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private Map<String,Object> fileMap1(String applicationId,String catalogName){
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(applicationId);
|
|
|
|
-
|
|
|
|
- List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName(catalogName);
|
|
|
|
- for(DataDictionary dataDictionary : dataDictionaryList){
|
|
|
|
- //A,B,C类证明附件查找,先判断字典类型ID与申请表的保存的类型相同
|
|
|
|
- if(applicationPrimary.getCategoryId().equals(dataDictionary.getId())){
|
|
|
|
- if(dataDictionary.getDataType().equals("2")) {
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- attachmentDTO.setId(dataDictionary.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionary.getName());
|
|
|
|
- attachmentDTO.setFiles(studentFilesService.findUrlByApplicationIdAndFileType(applicationId, dataDictionary.getId()));
|
|
|
|
- map.put(dataDictionary.getSortNo().toString(), attachmentDTO);
|
|
|
|
- }else{
|
|
|
|
- Map<String,Object> mapEx = new HashMap<>();
|
|
|
|
- List<DataDictionary> dataDictionaryListEx = dataDictionaryService.findByParentId(dataDictionary.getId());
|
|
|
|
- for(DataDictionary dataDictionaryEx : dataDictionaryListEx) {
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- attachmentDTO.setId(dataDictionaryEx.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionaryEx.getName());
|
|
|
|
- attachmentDTO.setFiles(studentFilesService.findUrlByApplicationIdAndFileType(applicationId, dataDictionaryEx.getId()));
|
|
|
|
- mapEx.put(dataDictionaryEx.getSortNo().toString(), attachmentDTO);
|
|
|
|
-
|
|
|
|
- if(attachmentDTO.getFiles().size() != 0){
|
|
|
|
- map.put("id", dataDictionary.getName());
|
|
|
|
- map.put("value", mapEx);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * shuzhan
|
|
|
|
- * 查找A,B,C类附件
|
|
|
|
- * @param applicationId
|
|
|
|
- * @param catalogName
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- private Map<String,Object> fileMap2(String applicationId,String catalogName){
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
-
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(applicationId);
|
|
|
|
-
|
|
|
|
- List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName(catalogName);
|
|
|
|
- for(DataDictionary dataDictionary : dataDictionaryList){
|
|
|
|
- //A,B,C类证明附件查找,先判断字典类型ID与申请表的保存的类型相同
|
|
|
|
-// if(applicationPrimary.getCategoryId().equals(dataDictionary.getId())){
|
|
|
|
- if(dataDictionary.getDataType().equals("2")) {
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- attachmentDTO.setId(dataDictionary.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionary.getName());
|
|
|
|
- attachmentDTO.setFiles(studentFilesService.findUrlByApplicationIdAndFileType(applicationId, dataDictionary.getId()));
|
|
|
|
- map.put(dataDictionary.getSortNo().toString(), attachmentDTO);
|
|
|
|
- }else{
|
|
|
|
- Map<String,Object> mapEx = new HashMap<>();
|
|
|
|
- List<DataDictionary> dataDictionaryListEx = dataDictionaryService.findByParentId(dataDictionary.getId());
|
|
|
|
- for(DataDictionary dataDictionaryEx : dataDictionaryListEx) {
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- attachmentDTO.setId(dataDictionaryEx.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionaryEx.getName());
|
|
|
|
- attachmentDTO.setFiles(studentFilesService.findUrlByApplicationIdAndFileType(applicationId, dataDictionaryEx.getId()));
|
|
|
|
- mapEx.put(dataDictionaryEx.getSortNo().toString(), attachmentDTO);
|
|
|
|
-
|
|
|
|
- if(attachmentDTO.getFiles().size() != 0){
|
|
|
|
- map.put("id", dataDictionary.getName());
|
|
|
|
- map.put("value", mapEx);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="退回")
|
|
|
|
- @RequestMapping(value = "back",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<ApprovalInfo> back(String id,String remark,String fileUrl,@RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
-
|
|
|
|
- ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
|
- approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- approvalInfo.setApplicationId(id);
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus())+":退回");
|
|
|
|
- approvalInfo.setRemark(remark);
|
|
|
|
- approvalInfo.setFileUrl(fileUrl);
|
|
|
|
- approvalInfo.setDelFlag(false);
|
|
|
|
- approvalInfo.setCreateBy(subject);
|
|
|
|
- approvalInfo.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- applicationPrimary.setStatus("5");
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
-
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String backDate = sdf.format(new Date());
|
|
|
|
-// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
- String backRemark = remark;
|
|
|
|
- PersonInfo pi = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
-
|
|
|
|
- boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- user.getUserName(),"申请入学信息已被退回,请尽快按退回意见修改提交,报名时间到7月12日晚上12点截止",
|
|
|
|
- backRemark,backDate,pi.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(approvalInfo);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="给已退回的群发消息")
|
|
|
|
- @RequestMapping(value = "backMessage",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<ApprovalInfo> backMessage(String id,String name,@RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- try {
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
-
|
|
|
|
- //状态为5
|
|
|
|
- searchParams.put("status",5);
|
|
|
|
- //searchParams.put("name","%舒展%");
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,0,1000,false,sortList);
|
|
|
|
- int messageNum = 0;
|
|
|
|
-
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String backDate = sdf.format(new Date());
|
|
|
|
-
|
|
|
|
- for(ApplicationPrimaryDTO dto : page.getResult()){
|
|
|
|
- Map<String,Object> searchParams2 = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList2 = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",false);
|
|
|
|
- searchParams.put("applicationId",dto.getApplicationId());
|
|
|
|
- searchParams.put("operation","%退回%");
|
|
|
|
-
|
|
|
|
- Page<ApprovalInfo> page2 = approvalInfoService.pageSearch(searchParams,0,100,false,sortList2);
|
|
|
|
-
|
|
|
|
- for(ApprovalInfo approvalInfo2 : page2.getResult()){
|
|
|
|
- if(approvalInfo2 == null){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- //SchoolInfo schoolInfo = schoolInfoService.get(dto.getSchoolId());
|
|
|
|
- String backRemark = approvalInfo2.getRemark();
|
|
|
|
- PersonInfo pi = personInfoService.get(dto.getPersonId());
|
|
|
|
-
|
|
|
|
- boolean messageResult2 = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- user.getUserName(),"申请入学信息已被退回,请尽快按退回意见修改提交,报名时间到7月12日晚上12点截止",
|
|
|
|
- backRemark,backDate,pi.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(),
|
|
|
|
- wechatConfig.getTokenUrl(),
|
|
|
|
- appId,appSecret);
|
|
|
|
-
|
|
|
|
- messageNum ++ ;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- System.out.println(messageNum);
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="前进")
|
|
|
|
- @RequestMapping(value = "fore",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<ApprovalInfo> fore(String id,String remark,String fileUrl,@RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
-
|
|
|
|
- ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
|
- approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- approvalInfo.setApplicationId(id);
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus())+":通过");
|
|
|
|
- approvalInfo.setRemark(remark);
|
|
|
|
- approvalInfo.setFileUrl(fileUrl);
|
|
|
|
- approvalInfo.setDelFlag(false);
|
|
|
|
- approvalInfo.setCreateBy(subject);
|
|
|
|
- approvalInfo.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- if("40".equals(applicationPrimary.getStatus())){
|
|
|
|
- //A类B类直接录取
|
|
|
|
- if("A".equals(applicationPrimary.getType()) || "B".equals(applicationPrimary.getType())){
|
|
|
|
- applicationPrimary.setStatus("70");
|
|
|
|
- applicationPrimary.setOfferId(applicationPrimary.getSchoolId());
|
|
|
|
- }else{
|
|
|
|
- applicationPrimary.setStatus("60");
|
|
|
|
- }
|
|
|
|
- }else if("50".equals(applicationPrimary.getStatus())){
|
|
|
|
- //A类B类直接录取
|
|
|
|
- if("A".equals(applicationPrimary.getType()) || "B".equals(applicationPrimary.getType())){
|
|
|
|
- applicationPrimary.setStatus("70");
|
|
|
|
- applicationPrimary.setOfferId(applicationPrimary.getSchoolId());
|
|
|
|
-
|
|
|
|
-// //获取最大编号
|
|
|
|
-// int serialNum = offerInfoService.findMaxSerialNum(applicationPrimary.getSchoolId(),"1");
|
|
|
|
-// serialNum = serialNum+1;//最大编号加一
|
|
|
|
-// Calendar date = Calendar.getInstance();
|
|
|
|
-// String year = String.valueOf(date.get(Calendar.YEAR));
|
|
|
|
-// SchoolInfo si = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
-// //开发区+年份+学校编号2位+序号4位
|
|
|
|
-// String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
|
|
|
|
-// //保存录取信息表
|
|
|
|
-// OfferInfo off = new OfferInfo();
|
|
|
|
-// off.setId(UUID.randomUUID().toString());
|
|
|
|
-//
|
|
|
|
-// off.setApplicationId(applicationPrimary.getId());
|
|
|
|
-// off.setStudentId(applicationPrimary.getStudentId());
|
|
|
|
-// off.setEnrollmentType("1");//小学
|
|
|
|
-// off.setSchoolId(applicationPrimary.getSchoolId());
|
|
|
|
-// off.setSerialNum(serialNum);
|
|
|
|
-//
|
|
|
|
-// off.setCode(code);
|
|
|
|
-// off.setDelFlag(false);
|
|
|
|
-// off.setCreateBy(subject);
|
|
|
|
-// off.setCreateTime(new Date());
|
|
|
|
-// offerInfoService.insert(off);
|
|
|
|
- }else{
|
|
|
|
- applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(approvalInfo);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="翻页")
|
|
|
|
- @RequestMapping(value = "pageTurn",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> pageTurn(String id,String type,String nameOrIdCard,String status,@RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("create_time","asc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- searchParams.put("type",type);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,1,10000,false,sortList);
|
|
|
|
- for(int i=0;i<page.size();i++){
|
|
|
|
- ApplicationPrimaryDTO applicationPrimaryDTO = page.get(i);
|
|
|
|
- if(applicationPrimaryDTO.getApplicationId().equals(id)){
|
|
|
|
- if(i > 0) {
|
|
|
|
- map.put("pagePrevious",page.get(i - 1).getApplicationId());
|
|
|
|
- }
|
|
|
|
- if(i < page.size()-1) {
|
|
|
|
- map.put("pageNext",page.get(i + 1).getApplicationId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(map);
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="派位页面的报名列表")
|
|
|
|
- @RequestMapping(value = "pageListApportion",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> pageListApportion(
|
|
|
|
- String schoolId,String type,
|
|
|
|
- @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
- @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
-
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- searchParams.put("type",type);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
- for(ApplicationPrimaryDTO applicationPrimaryDTO : page.getResult()){
|
|
|
|
- List<AttachmentDTO> attachmentDTOList = new ArrayList<>();
|
|
|
|
- AttachmentDTO attachmentDTO = new AttachmentDTO();
|
|
|
|
- DataDictionary dataDictionary = dataDictionaryService.findByParentIdAndValue(DataDictionary.STUDENT_RELATED_CERT_ID,"3");
|
|
|
|
- attachmentDTO.setId(dataDictionary.getId());
|
|
|
|
- attachmentDTO.setName(dataDictionary.getName());
|
|
|
|
-
|
|
|
|
- List<String> studentFilesList = studentFilesService.findUrlByApplicationIdAndFileType(applicationPrimaryDTO.getApplicationId(),attachmentDTO.getId());
|
|
|
|
- attachmentDTO.setFiles(studentFilesList);
|
|
|
|
- attachmentDTOList.add(attachmentDTO);
|
|
|
|
-
|
|
|
|
- applicationPrimaryDTO.setStudentCertificationFileList(attachmentDTOList);
|
|
|
|
- applicationPrimaryDTO.setRelationshipName(dataDictionaryService.getName(applicationPrimaryDTO.getRelationship()));
|
|
|
|
- applicationPrimaryDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("报名类型",applicationPrimaryDTO.getType()));
|
|
|
|
- applicationPrimaryDTO.setStatusName(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimaryDTO.getStatus()));
|
|
|
|
- applicationPrimaryDTO.setCardType(dataDictionaryService.findNameByCatalogNameAndValue("证件类型",applicationPrimaryDTO.getCardType()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "导出")
|
|
|
|
- @PostMapping("exportXls")
|
|
|
|
- @ApiImplicitParams({
|
|
|
|
- @ApiImplicitParam(name = "name", value = "姓名", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "idCard", value = "身份证", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "phone", value = "手机号", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "parentId", value = "企业编号", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "subordinate", value = "是否查询下级单位", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "position1", value = "一级位置", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "position2", value = "二级位置", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "position3", value = "三级位置", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "position4", value = "四级位置", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "position5", value = "五级位置", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "faceBound", value = "是否同步", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "isUploadPhoto", value = "是否上传照片", required = false, paramType = "form", dataType = "String"),
|
|
|
|
- @ApiImplicitParam(name = "popedom", value = "用户角色", required = false, paramType = "form", dataType = "String")
|
|
|
|
- })
|
|
|
|
- public MessageResult<String> exportXls(
|
|
|
|
- String tabStatus,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String schoolId,
|
|
|
|
- @RequestParam(value="categoryId",defaultValue="") String categoryId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject) {
|
|
|
|
- MessageResult<String> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
|
- HSSFSheet sheet = workbook.createSheet();
|
|
|
|
- //表头
|
|
|
|
- HSSFRow rowTitle = sheet.createRow(0);
|
|
|
|
- HSSFCell cellTitle1 = rowTitle.createCell(0);
|
|
|
|
- cellTitle1.setCellValue("序号");
|
|
|
|
- HSSFCell cellTitle2 = rowTitle.createCell(1);
|
|
|
|
- cellTitle2.setCellValue("报名类型");
|
|
|
|
- HSSFCell cellTitle3 = rowTitle.createCell(2);
|
|
|
|
- cellTitle3.setCellValue("报名学校");
|
|
|
|
- HSSFCell cellTitle4 = rowTitle.createCell(3);
|
|
|
|
- cellTitle4.setCellValue("学生姓名");
|
|
|
|
- HSSFCell cellTitle5 = rowTitle.createCell(4);
|
|
|
|
- cellTitle5.setCellValue("证件类型");
|
|
|
|
- HSSFCell cellTitle6 = rowTitle.createCell(5);
|
|
|
|
- cellTitle6.setCellValue("证件号码");
|
|
|
|
- HSSFCell cellTitle7 = rowTitle.createCell(6);
|
|
|
|
- cellTitle7.setCellValue("审核状态");
|
|
|
|
- HSSFCell cellTitle8 = rowTitle.createCell(7);
|
|
|
|
- cellTitle8.setCellValue("申请时间");
|
|
|
|
- HSSFCell cellTitle9 = rowTitle.createCell(8);
|
|
|
|
- cellTitle9.setCellValue("登记人关系");
|
|
|
|
- HSSFCell cellTitle10 = rowTitle.createCell(9);
|
|
|
|
- cellTitle10.setCellValue("登记人姓名");
|
|
|
|
- HSSFCell cellTitle11 = rowTitle.createCell(10);
|
|
|
|
- cellTitle11.setCellValue("登记人手机号码");
|
|
|
|
- HSSFCell cellTitle12 = rowTitle.createCell(11);
|
|
|
|
- cellTitle12.setCellValue("学生地址");
|
|
|
|
- HSSFCell cellTitle13 = rowTitle.createCell(12);
|
|
|
|
- cellTitle13.setCellValue("");
|
|
|
|
- HSSFCell cellTitle14 = rowTitle.createCell(13);
|
|
|
|
- cellTitle14.setCellValue("");
|
|
|
|
- HSSFCell cellTitle15 = rowTitle.createCell(14);
|
|
|
|
- cellTitle15.setCellValue("");
|
|
|
|
- HSSFCell cellTitle16 = rowTitle.createCell(15);
|
|
|
|
- cellTitle16.setCellValue("");
|
|
|
|
- HSSFCell cellTitle17 = rowTitle.createCell(16);
|
|
|
|
- cellTitle17.setCellValue("");
|
|
|
|
-
|
|
|
|
-// int maxColumn = sheet.getRow(0).getPhysicalNumberOfCells();
|
|
|
|
-// for(int i = 1; i < maxColumn; i++) {
|
|
|
|
-// //int columnWidth = sheet.getColumnWidth(i) / 256;
|
|
|
|
-// sheet.setColumnWidth(i, 12 * 256);
|
|
|
|
-// }
|
|
|
|
- //学校
|
|
|
|
- sheet.setColumnWidth(2, 20 * 256);
|
|
|
|
- //身份证
|
|
|
|
- sheet.setColumnWidth(5, 24 * 256);
|
|
|
|
- //报名时间
|
|
|
|
- sheet.setColumnWidth(7, 24 * 256);
|
|
|
|
- //登记人手机号
|
|
|
|
- sheet.setColumnWidth(10, 15 * 256);
|
|
|
|
- //地址
|
|
|
|
- sheet.setColumnWidth(11, 50 * 256);
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
|
- searchParams.put("tabStatus",tabStatus);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- searchParams.put("type",type);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //查询范围
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(categoryId)) {
|
|
|
|
- searchParams.put("categoryId",categoryId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,0,100000,true,sortList);
|
|
|
|
- List<DataDictionary> relationshipList = dataDictionaryService.findByCatalogName("学生关系");
|
|
|
|
- List<DataDictionary> typeNameList = dataDictionaryService.findByCatalogName("报名类型");
|
|
|
|
- List<DataDictionary> statusNameList = dataDictionaryService.findByCatalogName("小学招生审核流程");
|
|
|
|
- List<DataDictionary> cardTypeList = dataDictionaryService.findByCatalogName("证件类型");
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < page.size(); i++) {
|
|
|
|
- ApplicationPrimaryDTO apDTO = page.get(i);
|
|
|
|
- String relationship = relationshipList.stream()
|
|
|
|
- .filter(e -> e.getId().equals(apDTO.getRelationship()))
|
|
|
|
- .findFirst().get().getName();
|
|
|
|
- String typeName = typeNameList.stream()
|
|
|
|
- .filter(e -> e.getValue().equals(apDTO.getType()))
|
|
|
|
- .findFirst().get().getName();
|
|
|
|
- String statusName = statusNameList.stream()
|
|
|
|
- .filter(e -> e.getValue().equals(apDTO.getStatus()))
|
|
|
|
- .findFirst().get().getName();
|
|
|
|
- String cardTypeName = cardTypeList.stream()
|
|
|
|
- .filter(e -> e.getValue().equals(apDTO.getCardType()))
|
|
|
|
- .findFirst().get().getName();
|
|
|
|
-
|
|
|
|
- HSSFRow rowContent = sheet.createRow(i + 1);
|
|
|
|
- //"序号"
|
|
|
|
- HSSFCell cellContent1 = rowContent.createCell(0);
|
|
|
|
- cellContent1.setCellValue(i + 1);
|
|
|
|
-// "报名类型"
|
|
|
|
- HSSFCell cellContent2 = rowContent.createCell(1);
|
|
|
|
- cellContent2.setCellValue(typeName);
|
|
|
|
-// "报名学校"
|
|
|
|
- HSSFCell cellContent3 = rowContent.createCell(2);
|
|
|
|
- cellContent3.setCellValue(apDTO.getSchoolName());
|
|
|
|
-// "学生姓名"
|
|
|
|
- HSSFCell cellContent4 = rowContent.createCell(3);
|
|
|
|
- cellContent4.setCellValue(apDTO.getName());
|
|
|
|
-// "证件类型"
|
|
|
|
- HSSFCell cellContent5 = rowContent.createCell(4);
|
|
|
|
- cellContent5.setCellValue(cardTypeName);
|
|
|
|
-// "证件号码"
|
|
|
|
- HSSFCell cellContent6 = rowContent.createCell(5);
|
|
|
|
- cellContent6.setCellValue(apDTO.getIdCard());
|
|
|
|
-// "审核状态"
|
|
|
|
- HSSFCell cellContent7 = rowContent.createCell(6);
|
|
|
|
- cellContent7.setCellValue(statusName);
|
|
|
|
-// "申请时间"
|
|
|
|
- HSSFCell cellContent8 = rowContent.createCell(7);
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
- cellContent8.setCellValue(sdf.format(apDTO.getCreateTime()));
|
|
|
|
- //"登记人关系"
|
|
|
|
- HSSFCell cellContent9 = rowContent.createCell(8);
|
|
|
|
- cellContent9.setCellValue(relationship);
|
|
|
|
- if(StringUtils.isNotEmpty(apDTO.getPersonId())){
|
|
|
|
- //"登记人姓名"
|
|
|
|
- HSSFCell cellContent10 = rowContent.createCell(9);
|
|
|
|
- PersonInfo pi =personInfoService.get(apDTO.getPersonId());
|
|
|
|
- cellContent10.setCellValue(pi.getName());
|
|
|
|
-
|
|
|
|
- //"登记人手机号码"
|
|
|
|
- HSSFCell cellContent11 = rowContent.createCell(10);
|
|
|
|
- cellContent11.setCellValue(pi.getPhone());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //"学生地址"
|
|
|
|
- HSSFCell cellContent12 = rowContent.createCell(11);
|
|
|
|
- cellContent12.setCellValue(apDTO.getAddress());
|
|
|
|
-
|
|
|
|
- List<Sort> sortList2 = new ArrayList<>();
|
|
|
|
- sortList2.add(new Sort("create_time","asc"));
|
|
|
|
- Map<String,Object> searchParams2 = new HashMap<>();
|
|
|
|
- searchParams2.put("applicationId",apDTO.getApplicationId());
|
|
|
|
- List<String> operationList = new ArrayList<String>();
|
|
|
|
- operationList.add("%待网上初审:通过%");
|
|
|
|
- operationList.add("%待现场复审:通过%");
|
|
|
|
- searchParams2.put("operationList",operationList);
|
|
|
|
- searchParams2.put("delFlag",false);
|
|
|
|
- Page<ApprovalInfo> aiPage = approvalInfoService.pageSearch(searchParams2,0,1000,false,sortList2);
|
|
|
|
- List<ApprovalInfo> apList = aiPage.getResult();
|
|
|
|
- for(int b =0;b<apList.size();b++){
|
|
|
|
- HSSFCell cellContent = rowContent.createCell(b+12);
|
|
|
|
- ApprovalInfo ap = apList.get(b);
|
|
|
|
- cellContent.setCellValue(ap.getRemark());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //todo 将wb保存到oss
|
|
|
|
- ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
|
- workbook.write(output);
|
|
|
|
-
|
|
|
|
- byte[] buffer = output.toByteArray();
|
|
|
|
- ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
|
-
|
|
|
|
- String downloadUrl = OSSUtil.upload(ossConfig, "import", "error.xls", input);
|
|
|
|
-
|
|
|
|
- //todo 返回导入失败报表下载链接
|
|
|
|
-
|
|
|
|
- msgResult.setData(downloadUrl);
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
- logger.error(ex.getMessage(), ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="发送微信消息")
|
|
|
|
- @RequestMapping(value = "sendWechatMessage",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Integer> sendWechatMessage(
|
|
|
|
- String idList,
|
|
|
|
- String message,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- try {
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
- String []ids = idList.split(",");
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String sendDate = sdf.format(new Date());
|
|
|
|
- int messageNum = 0;
|
|
|
|
- for(String id: ids){
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
- PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
- boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- user.getUserName(),message,
|
|
|
|
- "",sendDate,personInfo.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(),
|
|
|
|
- wechatConfig.getTokenUrl(),
|
|
|
|
- appId,appSecret);
|
|
|
|
- if(messageResult){
|
|
|
|
- applicationPrimary.setIsSend(true);
|
|
|
|
- applicationPrimary.setSendTime(new Date());
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
- messageNum ++ ;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(messageNum);
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="调剂")
|
|
|
|
- @RequestMapping(value = "tjPrimary",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Integer> tjPrimary(
|
|
|
|
- String id,
|
|
|
|
- String schoolId,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
- int count = 0;
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary ap = applicationPrimaryService.get(id);
|
|
|
|
- ap.setOfferId(schoolId);
|
|
|
|
- ap.setStatus("70");
|
|
|
|
- ap.setUpdateBy(subject);
|
|
|
|
- ap.setUpdateTime(new Date());
|
|
|
|
- count = applicationPrimaryService.update(ap);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(count);
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="修改状态")
|
|
|
|
- @RequestMapping(value = "updateStatus",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<ApprovalInfo> updateStatus(String id,String remark,String status,String typeValue,@RequestAttribute String subject){
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
- MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
- ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
|
- approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- approvalInfo.setApplicationId(id);
|
|
|
|
- if("90".equals(status)) {
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus()));
|
|
|
|
- }else{
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus())+":" + typeValue);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- approvalInfo.setRemark(remark);
|
|
|
|
- approvalInfo.setFileUrl("");
|
|
|
|
- approvalInfo.setDelFlag(false);
|
|
|
|
- approvalInfo.setCreateBy(subject);
|
|
|
|
- approvalInfo.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- applicationPrimary.setStatus(status);
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- if("60".equals(status) && "退回".equals(typeValue)){
|
|
|
|
- applicationPrimary.setOfferId("");
|
|
|
|
- List<ApportionDetail> adList = apportionDetailService.findByStudentId(applicationPrimary.getStudentId());
|
|
|
|
- for(ApportionDetail ad : adList){
|
|
|
|
- ad.setDelFlag(true);
|
|
|
|
- apportionDetailService.update(ad);
|
|
|
|
- }
|
|
|
|
- }else if("90".equals(status)){
|
|
|
|
- //获取最大编号
|
|
|
|
- int serialNum = offerInfoService.findMaxSerialNum(applicationPrimary.getSchoolId(),"1");
|
|
|
|
- serialNum = serialNum+1;//最大编号加一
|
|
|
|
- Calendar date = Calendar.getInstance();
|
|
|
|
- String year = String.valueOf(date.get(Calendar.YEAR));
|
|
|
|
- SchoolInfo si = schoolInfoService.get(applicationPrimary.getOfferId());
|
|
|
|
- //开发区+年份+学校编号2位+序号4位
|
|
|
|
- String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
|
|
|
|
- //保存录取信息表
|
|
|
|
- OfferInfo off = new OfferInfo();
|
|
|
|
- off.setId(UUID.randomUUID().toString());
|
|
|
|
- off.setApplicationId(applicationPrimary.getId());
|
|
|
|
- off.setStudentId(applicationPrimary.getStudentId());
|
|
|
|
- off.setEnrollmentType("1");//小学
|
|
|
|
- off.setSchoolId(applicationPrimary.getOfferId());
|
|
|
|
- off.setSerialNum(serialNum);
|
|
|
|
-
|
|
|
|
- applicationPrimary.setOfferCode(code);
|
|
|
|
- SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getOfferId());
|
|
|
|
- PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
- StudentInfo studentInfo = studentInfoService.get(applicationPrimary.getStudentId());
|
|
|
|
- String bdUrl = toPressText(code,personInfo.getName(),studentInfo.getName(), schoolInfo.getName());
|
|
|
|
- String uploadUrl = uploadImg(bdUrl);
|
|
|
|
- if(StringUtils.isNotEmpty(uploadUrl)){
|
|
|
|
- applicationPrimary.setOfferImg(uploadUrl);
|
|
|
|
- off.setCode(code);
|
|
|
|
- off.setDelFlag(false);
|
|
|
|
- off.setCreateBy(subject);
|
|
|
|
- off.setCreateTime(new Date());
|
|
|
|
- offerInfoService.insert(off);
|
|
|
|
- new Thread(() -> {
|
|
|
|
- try {
|
|
|
|
- String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
- sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
- ex.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }).start();
|
|
|
|
- }else{
|
|
|
|
- applicationPrimary.setStatus("80");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// String uploadPath = Resource.class.getResource("/").getPath() +"uploadImg";
|
|
|
|
-// delAllFile(uploadPath);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(approvalInfo);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="全部通过")
|
|
|
|
- @RequestMapping(value = "allNext",method = RequestMethod.POST)
|
|
|
|
- public MessageResult<Map> allNext(
|
|
|
|
- String tabStatus,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String schoolId,
|
|
|
|
- String offerId,
|
|
|
|
- @RequestParam(value="nextStatus",defaultValue="") String nextStatus,
|
|
|
|
- @RequestParam(value="isSend",defaultValue="") String isSend,
|
|
|
|
- @RequestParam(value="categoryId",defaultValue="") String categoryId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject){
|
|
|
|
-
|
|
|
|
- //当前用户ID
|
|
|
|
- System.out.println(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.create_time", "desc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
|
- searchParams.put("tabStatus", tabStatus);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status", status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard", "%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType", cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag", delFlag);
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(schoolId)) {
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- } else {
|
|
|
|
- if (!userService.hasRole(subject, "SYSADMIN")) {
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(isSend)) {
|
|
|
|
- searchParams.put("isSend", isSend);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(offerId)) {
|
|
|
|
- searchParams.put("offerId", offerId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //查询范围
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus", startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus", endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(categoryId)) {
|
|
|
|
- searchParams.put("categoryId", categoryId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject, "SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject, "XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject, "XFGZRY");
|
|
|
|
-
|
|
|
|
- if (count1 > 0) {
|
|
|
|
- //管理员查全部
|
|
|
|
- } else if (count2 > 0) {
|
|
|
|
- //领导查全部
|
|
|
|
- } else if (count3 > 0) {
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus", statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams, 0, 100000, false, sortList);
|
|
|
|
- for (ApplicationPrimaryDTO applicationPrimaryDTO : page.getResult()) {
|
|
|
|
-
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.get(applicationPrimaryDTO.getApplicationId());
|
|
|
|
-
|
|
|
|
- if ("40".equals(applicationPrimary.getStatus())) {
|
|
|
|
- //A类B类直接录取
|
|
|
|
- if ("A".equals(applicationPrimary.getType()) || "B".equals(applicationPrimary.getType())) {
|
|
|
|
- applicationPrimary.setStatus("70");
|
|
|
|
- applicationPrimary.setOfferId(applicationPrimary.getSchoolId());
|
|
|
|
- } else {
|
|
|
|
- applicationPrimary.setStatus(nextStatus);
|
|
|
|
- }
|
|
|
|
- } else if ("50".equals(applicationPrimary.getStatus())) {
|
|
|
|
- //A类B类直接录取
|
|
|
|
- if ("A".equals(applicationPrimary.getType()) || "B".equals(applicationPrimary.getType())) {
|
|
|
|
- applicationPrimary.setStatus("70");
|
|
|
|
- applicationPrimary.setOfferId(applicationPrimary.getSchoolId());
|
|
|
|
- } else {
|
|
|
|
- applicationPrimary.setStatus(nextStatus);
|
|
|
|
- }
|
|
|
|
- } else if ("70".equals(applicationPrimary.getStatus())) {
|
|
|
|
- //微信消息推送 发送预录取通知
|
|
|
|
- applicationPrimary.setStatus(nextStatus);
|
|
|
|
-
|
|
|
|
-// new Thread(() -> {
|
|
|
|
-//// try {
|
|
|
|
-//// String content = "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。";
|
|
|
|
-//// sendMessage(content,applicationPrimary.getPersonId(),user.getRealName());
|
|
|
|
-//// } catch (Exception ex) {
|
|
|
|
-//// ex.printStackTrace();
|
|
|
|
-//// }
|
|
|
|
-//// }).start();
|
|
|
|
- } else if ("80".equals(applicationPrimary.getStatus())) {
|
|
|
|
- //微信消息推送 发送完成录取通知
|
|
|
|
- applicationPrimary.setStatus(nextStatus);
|
|
|
|
-
|
|
|
|
- int serialNum = offerInfoService.findMaxSerialNum(applicationPrimary.getSchoolId(), "1");
|
|
|
|
- serialNum = serialNum + 1;//最大编号加一
|
|
|
|
- Calendar date = Calendar.getInstance();
|
|
|
|
- String year = String.valueOf(date.get(Calendar.YEAR));
|
|
|
|
- SchoolInfo si = schoolInfoService.get(applicationPrimary.getOfferId());
|
|
|
|
- //开发区+年份+学校编号2位+序号4位
|
|
|
|
- String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
|
|
|
|
- //保存录取信息表
|
|
|
|
- OfferInfo off = new OfferInfo();
|
|
|
|
- off.setId(UUID.randomUUID().toString());
|
|
|
|
-
|
|
|
|
- off.setApplicationId(applicationPrimary.getId());
|
|
|
|
- off.setStudentId(applicationPrimary.getStudentId());
|
|
|
|
- off.setEnrollmentType("1");//小学
|
|
|
|
- off.setSchoolId(applicationPrimary.getSchoolId());
|
|
|
|
- off.setSerialNum(serialNum);
|
|
|
|
- off.setCode(code);
|
|
|
|
- off.setDelFlag(false);
|
|
|
|
- off.setCreateBy(subject);
|
|
|
|
- off.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- applicationPrimary.setOfferCode(code);
|
|
|
|
- SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getOfferId());
|
|
|
|
- PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
- StudentInfo studentInfo = studentInfoService.get(applicationPrimary.getStudentId());
|
|
|
|
- String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName());
|
|
|
|
- String uploadUrl = uploadImg(bdUrl);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(uploadUrl)){
|
|
|
|
- off.setCode(code);
|
|
|
|
- off.setDelFlag(false);
|
|
|
|
- off.setCreateBy(subject);
|
|
|
|
- off.setCreateTime(new Date());
|
|
|
|
- offerInfoService.insert(off);
|
|
|
|
-
|
|
|
|
- applicationPrimary.setOfferImg(uploadUrl);
|
|
|
|
- new Thread(() -> {
|
|
|
|
- try {
|
|
|
|
- String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
- sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
- ex.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }).start();
|
|
|
|
- }else{
|
|
|
|
- applicationPrimary.setStatus("80");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- applicationPrimary.setStatus(nextStatus);
|
|
|
|
- }
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
-
|
|
|
|
- ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
|
- approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- approvalInfo.setApplicationId(applicationPrimary.getId());
|
|
|
|
- if("80".equals(status)) {
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationPrimary.getStatus()));
|
|
|
|
- }else{
|
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程", applicationPrimary.getStatus()) + ":通过审核");
|
|
|
|
- }
|
|
|
|
- approvalInfo.setRemark("通过审核");
|
|
|
|
- approvalInfo.setFileUrl("");
|
|
|
|
- approvalInfo.setDelFlag(false);
|
|
|
|
- approvalInfo.setCreateBy(subject);
|
|
|
|
- approvalInfo.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
|
-
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //完成后删除文件夹
|
|
|
|
-// String uploadPath = Resource.class.getResource("/").getPath() + "uploadImg";
|
|
|
|
-// delAllFile(uploadPath);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- String in = "static/primary_tzs.jpg";
|
|
|
|
- String out = "uploadImg/primary_tzs_" + "11111" + ".jpg";
|
|
|
|
- String inImg = Resource.class.getResource("/").getPath() + in;
|
|
|
|
- String outImg = Resource.class.getResource("/").getPath() + out;
|
|
|
|
- try{
|
|
|
|
- BufferedImage im =ImageIO.read(new FileInputStream(inImg));
|
|
|
|
- int mothh = DateUtil.thisMonth() +1;
|
|
|
|
- Graphics g = im.getGraphics();
|
|
|
|
- g.setColor(new Color(0,0,0));
|
|
|
|
- //g.setColor(Color.BLUE);
|
|
|
|
- Font font = new Font("宋体",Font.PLAIN,40); //设置字体
|
|
|
|
- g.setFont(font);
|
|
|
|
- g.drawString("5555555",1000,400);
|
|
|
|
- g.drawString("舒爸爸",410,600);
|
|
|
|
- g.drawString("舒展",830,680);
|
|
|
|
- g.drawString("8",660,940);
|
|
|
|
- g.drawString("27",730,940);
|
|
|
|
- g.drawString("8",890,940);
|
|
|
|
- g.drawString("27",970,940);
|
|
|
|
- g.drawString("湖北省荆州市沙市区小学",480,1015);
|
|
|
|
- g.drawString(mothh+"",1000,1590);
|
|
|
|
- g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);
|
|
|
|
- g.dispose();
|
|
|
|
- ImageIO.write(im,"jpg",new File(outImg));
|
|
|
|
- }catch (IOException e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="全部通过")
|
|
|
|
- @RequestMapping(value = "toPressText",method = RequestMethod.POST)
|
|
|
|
- public String toPressText(String offerCode,String personName,String userName,String schoolName){
|
|
|
|
- String in = "static/primary_tzs.jpg";
|
|
|
|
- String out = "uploadImg/primary_tzs_" + offerCode + ".jpg";
|
|
|
|
- String inImg = Resource.class.getResource("/").getPath() + in;
|
|
|
|
- String outImg = Resource.class.getResource("/").getPath() + out;
|
|
|
|
-
|
|
|
|
- try{
|
|
|
|
- BufferedImage im =ImageIO.read(new FileInputStream(inImg));
|
|
|
|
- int mothh = DateUtil.thisMonth() +1;
|
|
|
|
- Graphics g = im.getGraphics();
|
|
|
|
- g.setColor(new Color(0,0,0));
|
|
|
|
- Font font = new Font("宋体",Font.BOLD,40); //设置字体
|
|
|
|
- g.setFont(font);
|
|
|
|
- Random ran = new Random(); // 随机位置
|
|
|
|
- g.drawString(offerCode,1000,400);
|
|
|
|
- g.drawString(personName,410,600);
|
|
|
|
- g.drawString(userName,830,680);
|
|
|
|
- g.drawString("8",660,940);
|
|
|
|
- g.drawString("27",730,940);
|
|
|
|
- g.drawString("8",890,940);
|
|
|
|
- g.drawString("27",970,940);
|
|
|
|
- g.drawString(schoolName,480,1015);
|
|
|
|
- g.drawString(mothh+"",1000,1590);
|
|
|
|
- g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);
|
|
|
|
- g.dispose();
|
|
|
|
- ImageIO.write(im,"jpg",new File(outImg));
|
|
|
|
- }catch (IOException e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- return outImg;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void pressText(String pressText, String targetImg,String outImg, String fontName, int fontStyle, Color color, int x, int y){
|
|
|
|
- try{
|
|
|
|
- BufferedImage im =ImageIO.read(new FileInputStream(outImg));
|
|
|
|
- int iw = im.getWidth();
|
|
|
|
- int ih = im.getHeight();
|
|
|
|
- Graphics g = im.getGraphics();
|
|
|
|
- g.setColor(color);
|
|
|
|
- //g.setColor(Color.BLUE);
|
|
|
|
- Font font = new Font("宋体",Font.PLAIN,40); //设置字体
|
|
|
|
- g.setFont(font);
|
|
|
|
- String str = "12345";
|
|
|
|
- //int x = iw/2;
|
|
|
|
- //int y = ih/2;
|
|
|
|
- Random ran = new Random(); // 随机位置
|
|
|
|
- g.drawString(str,x,y);
|
|
|
|
- g.dispose();
|
|
|
|
- ImageIO.write(im,"jpg",new File(outImg));
|
|
|
|
- }catch (IOException e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// try{
|
|
|
|
-// File _file = new File(targetImg);
|
|
|
|
-// Image src = ImageIO.read(_file);
|
|
|
|
-// int weidth = src.getWidth(null);
|
|
|
|
-// int height = src.getHeight(null);
|
|
|
|
-// BufferedImage image = new BufferedImage(weidth,height,BufferedImage.TYPE_INT_RGB);
|
|
|
|
-// Graphics g = image.createGraphics();
|
|
|
|
-// g.drawImage(src,0,0,weidth,height,null);
|
|
|
|
-// g.setColor(color);
|
|
|
|
-// g.setFont(new Font(fontName,fontStyle,fontSize));
|
|
|
|
-// g.drawString(pressText,x,y);
|
|
|
|
-// g.dispose();
|
|
|
|
-// FileOutputStream out = new FileOutputStream(targetImg);
|
|
|
|
-// JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
|
|
|
|
-// encoder.encode(image);
|
|
|
|
-// out.close();
|
|
|
|
-// } catch (java.io.IOException e) {
|
|
|
|
-// e.printStackTrace();
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public String uploadImg(String imgUrl){
|
|
|
|
- String returnUrl = "";
|
|
|
|
- try {
|
|
|
|
- File jpgFile = new File(imgUrl);
|
|
|
|
- InputStream input = new FileInputStream(jpgFile);
|
|
|
|
- returnUrl = OSSUtil.upload(ossConfig, "/tzs", jpgFile.getName(), input);
|
|
|
|
- input.close();
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return returnUrl;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public boolean sendMessage(String content,String personId,String adminName){
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String backDate = sdf.format(new Date());
|
|
|
|
-// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
- String backRemark = "";
|
|
|
|
- PersonInfo pi = personInfoService.get(personId);
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
- boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- adminName,content,
|
|
|
|
- backRemark,backDate,pi.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
|
|
- return messageResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void delAllFile(String path) {
|
|
|
|
- File file = new File(path);
|
|
|
|
- if (!file.exists()) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!file.isDirectory()) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- String[] tempList = file.list();
|
|
|
|
- if (tempList == null) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- File temp;
|
|
|
|
- for (String aTempList : tempList) {
|
|
|
|
- if (path.endsWith(File.separator)) {
|
|
|
|
- temp = new File(path + aTempList);
|
|
|
|
- } else {
|
|
|
|
- temp = new File(path + File.separator + aTempList);
|
|
|
|
- }
|
|
|
|
- if (temp.isFile()) {
|
|
|
|
- temp.delete();
|
|
|
|
- }
|
|
|
|
- if (temp.isDirectory()) {
|
|
|
|
- delAllFile(path + "/" + aTempList);// 先删除文件夹里面的文件
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @ApiOperation(value="修改新类型")
|
|
|
|
- @PostMapping("changeNewType")
|
|
|
|
- public MessageResult<Integer> changeNewType(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- int affectCount = 0;
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("delFlag", false);
|
|
|
|
- Page<ApplicationPrimary> page = applicationPrimaryService.pageSearch(searchParams,0,100000,false,sortList);
|
|
|
|
-
|
|
|
|
- for (ApplicationPrimary ap : page.getResult()) {
|
|
|
|
- List<ApprovalInfo> aiList = approvalInfoService.findByApplicationIdAndOperation(ap.getId(),"%C%");
|
|
|
|
- if(aiList.size() > 0){
|
|
|
|
- ApprovalInfo ai = aiList.get(0);
|
|
|
|
- ap.setNewType(ai.getRemark());
|
|
|
|
- applicationPrimaryService.update(ap);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (affectCount > 0) {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setData(affectCount);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("操作失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch(Exception ex){
|
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "导入其他职工")
|
|
|
|
- @PostMapping("importCheckXls")
|
|
|
|
- @ApiImplicitParams({
|
|
|
|
- @ApiImplicitParam(name = "uploadFile", value = "上传文件", required = true, paramType = "form", dataType = "__file")
|
|
|
|
- })
|
|
|
|
- public MessageResult<String> importOtherXls(
|
|
|
|
- @RequestParam(value = "schoolId", defaultValue = "2a161029-324a-4ef5-8062-4cf63339bcdc") String schoolId,
|
|
|
|
- MultipartFile uploadFile,@RequestAttribute String subject) {
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
- MessageResult<String> msgResult = new MessageResult<>();
|
|
|
|
- try {
|
|
|
|
- POIUtils poiUtils = new POIUtils(uploadFile.getInputStream());
|
|
|
|
- int sheetIndex = 0;
|
|
|
|
- Sheet sheet1 = poiUtils.getSheetAt(sheetIndex);
|
|
|
|
-
|
|
|
|
- int affectCount = 0;
|
|
|
|
- int failCount = 0;
|
|
|
|
- int validateColIndex = 5;
|
|
|
|
-
|
|
|
|
- for (int rowIndex = 1; rowIndex <= sheet1.getLastRowNum(); rowIndex++) {
|
|
|
|
- try {
|
|
|
|
- String name = (String) poiUtils.getCellValue(sheetIndex, rowIndex, 1).toString().replace(" ", "");
|
|
|
|
- String idCard = (String) poiUtils.getCellValue(sheetIndex, rowIndex, 2).toString().replace(" ", "");
|
|
|
|
- String newCate = (String) poiUtils.getCellValue(sheetIndex, rowIndex, 3).toString().replace(" ", "");
|
|
|
|
-
|
|
|
|
- ApplicationPrimary applicationPrimary = applicationPrimaryService.findByStudentNameAndIdCard(name,idCard,schoolId);
|
|
|
|
-
|
|
|
|
- if(applicationPrimary == null){
|
|
|
|
- applicationPrimary = new ApplicationPrimary();
|
|
|
|
- applicationPrimary.setId(idCard);
|
|
|
|
- applicationPrimary.setCreateBy(name);
|
|
|
|
- applicationPrimary.setOfferId(idCard);
|
|
|
|
- applicationPrimary.setNewType(newCate);
|
|
|
|
- applicationPrimaryService.insert(applicationPrimary);
|
|
|
|
- }else {
|
|
|
|
- applicationPrimary.setNewType(newCate);
|
|
|
|
- applicationPrimary.setUpdateBy(subject);
|
|
|
|
- applicationPrimary.setUpdateTime(new Date());
|
|
|
|
- applicationPrimaryService.update(applicationPrimary);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } catch (Exception innerEx) {
|
|
|
|
- failCount++;
|
|
|
|
- sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue(innerEx.getMessage());
|
|
|
|
- logger.error(innerEx.getMessage(), innerEx);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (failCount > 0) {
|
|
|
|
- //有导入失败的记录
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage("数据成功导入" + affectCount + "条,有" + failCount + "条数据未导入成功,错误原因请查看报表。");
|
|
|
|
-
|
|
|
|
- //todo 只保留错误数据的sheet
|
|
|
|
- Workbook wb = poiUtils.exportErrorXls(sheetIndex, validateColIndex, 10000);
|
|
|
|
-
|
|
|
|
- //todo 将wb保存到oss
|
|
|
|
- ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
|
- wb.write(output);
|
|
|
|
-
|
|
|
|
- byte[] buffer = output.toByteArray();
|
|
|
|
- ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
|
-
|
|
|
|
- String downloadUrl = OSSUtil.upload(ossConfig, "import", "error.xls", input);
|
|
|
|
-
|
|
|
|
- //todo 返回导入失败报表下载链接
|
|
|
|
- msgResult.setData(downloadUrl);
|
|
|
|
- } else {
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- msgResult.setMessage("数据成功导入" + affectCount + "条");
|
|
|
|
- }
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
- logger.error(ex.getMessage(), ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "导出录取信息")
|
|
|
|
- @PostMapping("exportOverXls")
|
|
|
|
- public MessageResult<String> exportOverXls(
|
|
|
|
- String tabStatus,
|
|
|
|
- String type,
|
|
|
|
- String nameOrIdCard,
|
|
|
|
- String status,
|
|
|
|
- String cardType,
|
|
|
|
- String schoolId,
|
|
|
|
- String offerId,
|
|
|
|
- @RequestParam(value="isSend",defaultValue="") String isSend,
|
|
|
|
- @RequestParam(value="categoryId",defaultValue="") String categoryId,
|
|
|
|
- @RequestParam(value="startStatus",defaultValue="") String startStatus,
|
|
|
|
- @RequestParam(value="endStatus",defaultValue="") String endStatus,
|
|
|
|
- @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
|
|
|
|
- @RequestAttribute String subject) {
|
|
|
|
- MessageResult<String> msgResult = new MessageResult<>();
|
|
|
|
- User user = userService.get(subject);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
|
- HSSFSheet sheet = workbook.createSheet();
|
|
|
|
- //表头
|
|
|
|
- HSSFRow rowTitle = sheet.createRow(0);
|
|
|
|
- HSSFCell cellTitle1 = rowTitle.createCell(0);
|
|
|
|
- cellTitle1.setCellValue("序号");
|
|
|
|
- HSSFCell cellTitle2 = rowTitle.createCell(1);
|
|
|
|
- cellTitle2.setCellValue("录取学校");
|
|
|
|
- HSSFCell cellTitle3 = rowTitle.createCell(2);
|
|
|
|
- cellTitle3.setCellValue("录取编号");
|
|
|
|
- HSSFCell cellTitle4 = rowTitle.createCell(3);
|
|
|
|
- cellTitle4.setCellValue("报名类型");
|
|
|
|
- HSSFCell cellTitle5 = rowTitle.createCell(4);
|
|
|
|
- cellTitle5.setCellValue("学生姓名");
|
|
|
|
- HSSFCell cellTitle6 = rowTitle.createCell(5);
|
|
|
|
- cellTitle6.setCellValue("证件号码");
|
|
|
|
- HSSFCell cellTitle7 = rowTitle.createCell(6);
|
|
|
|
- cellTitle7.setCellValue("申请时间");
|
|
|
|
- HSSFCell cellTitle8 = rowTitle.createCell(7);
|
|
|
|
- cellTitle8.setCellValue("登记人姓名");
|
|
|
|
- HSSFCell cellTitle9 = rowTitle.createCell(8);
|
|
|
|
- cellTitle9.setCellValue("联系电话");
|
|
|
|
- HSSFCell cellTitle10 = rowTitle.createCell(9);
|
|
|
|
- cellTitle10.setCellValue("学生地址");
|
|
|
|
-
|
|
|
|
-// int maxColumn = sheet.getRow(0).getPhysicalNumberOfCells();
|
|
|
|
-// for(int i = 1; i < maxColumn; i++) {
|
|
|
|
-// //int columnWidth = sheet.getColumnWidth(i) / 256;
|
|
|
|
-// sheet.setColumnWidth(i, 12 * 256);
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
- sheet.setColumnWidth(1, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(2, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(3, 10 * 256);
|
|
|
|
- sheet.setColumnWidth(4, 15 * 256);
|
|
|
|
- sheet.setColumnWidth(5, 25 * 256);
|
|
|
|
- sheet.setColumnWidth(6, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(7, 15 * 256);
|
|
|
|
- sheet.setColumnWidth(8, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(9, 40 * 256);
|
|
|
|
-
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
-
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
|
- sortList.add(new Sort("a.school_id","asc"));
|
|
|
|
- sortList.add(new Sort("a.type_","asc"));
|
|
|
|
- sortList.add(new Sort("a.category_id","desc"));
|
|
|
|
- sortList.add(new Sort("a.offer_code","asc"));
|
|
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
|
- searchParams.put("tabStatus",tabStatus);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
|
- if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
|
|
|
|
- searchParams.put("type", type);
|
|
|
|
- }else{
|
|
|
|
- searchParams.put("type", "C");
|
|
|
|
- searchParams.put("categoryId", type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
|
- searchParams.put("status",status);
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(nameOrIdCard)) {
|
|
|
|
- searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(cardType)) {
|
|
|
|
- searchParams.put("cardType",cardType);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- searchParams.put("delFlag",delFlag);
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(schoolId)){
|
|
|
|
- searchParams.put("code", "%" + schoolId + "%");
|
|
|
|
- }else{
|
|
|
|
- if (!userService.hasRole(subject,"SYSADMIN")) {
|
|
|
|
- searchParams.put("code", "%" + user.getSchoolId() + "%");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(isSend)){
|
|
|
|
- searchParams.put("isSend", isSend);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(offerId)){
|
|
|
|
- searchParams.put("offerId", offerId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //查询范围
|
|
|
|
- //开始
|
|
|
|
- if (StringUtils.isNotEmpty(startStatus)) {
|
|
|
|
- searchParams.put("startStatus",startStatus);
|
|
|
|
- }
|
|
|
|
- //结束
|
|
|
|
- if (StringUtils.isNotEmpty(endStatus)) {
|
|
|
|
- searchParams.put("endStatus",endStatus);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotEmpty(categoryId)) {
|
|
|
|
- searchParams.put("categoryId",categoryId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //根据用户和角色查询
|
|
|
|
- int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
|
|
|
|
- int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
|
|
|
|
- int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
|
|
|
|
-
|
|
|
|
- if(count1 > 0){
|
|
|
|
- //管理员查全部
|
|
|
|
- }else if(count2 > 0){
|
|
|
|
- //领导查全部
|
|
|
|
- }else if(count3 > 0){
|
|
|
|
- //工作人员只能查网上初审10和现场初审20
|
|
|
|
- List statusList = new ArrayList();
|
|
|
|
- statusList.add("10");
|
|
|
|
- statusList.add("20");
|
|
|
|
- searchParams.put("orStatus",statusList);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,0,10000000,false,sortList);
|
|
|
|
- for (int i = 0; i < page.size(); i++) {
|
|
|
|
- ApplicationPrimaryDTO apDTO = page.get(i);
|
|
|
|
- HSSFRow rowContent = sheet.createRow(i + 1);
|
|
|
|
- //"序号"
|
|
|
|
- HSSFCell cellContent1 = rowContent.createCell(0);
|
|
|
|
- cellContent1.setCellValue(i + 1);
|
|
|
|
-// "录取学校"
|
|
|
|
- HSSFCell cellContent2 = rowContent.createCell(1);
|
|
|
|
- cellContent2.setCellValue(apDTO.getOfferName());
|
|
|
|
-// "录取编号"
|
|
|
|
- HSSFCell cellContent3 = rowContent.createCell(2);
|
|
|
|
- cellContent3.setCellValue(apDTO.getOfferCode());
|
|
|
|
-// "报名类型"
|
|
|
|
- HSSFCell cellContent4 = rowContent.createCell(3);
|
|
|
|
- String typeName = "";
|
|
|
|
- if("C".equals(apDTO.getType())){
|
|
|
|
- typeName = apDTO.getType() + dataDictionaryService.getValue(apDTO.getCategoryId());
|
|
|
|
- }else{
|
|
|
|
- typeName = apDTO.getType();
|
|
|
|
- }
|
|
|
|
- cellContent4.setCellValue(typeName);
|
|
|
|
-// "学生姓名"
|
|
|
|
- HSSFCell cellContent5 = rowContent.createCell(4);
|
|
|
|
- cellContent5.setCellValue(apDTO.getName());
|
|
|
|
-// "证件号码"
|
|
|
|
- HSSFCell cellContent6 = rowContent.createCell(5);
|
|
|
|
- cellContent6.setCellValue(apDTO.getIdCard());
|
|
|
|
-// "申请时间"
|
|
|
|
- HSSFCell cellContent7 = rowContent.createCell(6);
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
- cellContent7.setCellValue(sdf.format(apDTO.getCreateTime()));
|
|
|
|
- //"登记人姓名"
|
|
|
|
- HSSFCell cellContent8 = rowContent.createCell(7);
|
|
|
|
- cellContent8.setCellValue(apDTO.getPersonName());
|
|
|
|
- //联系电话
|
|
|
|
- HSSFCell cellContent9 = rowContent.createCell(8);
|
|
|
|
- cellContent9.setCellValue(apDTO.getPersonPhone());
|
|
|
|
- //"学生地址"
|
|
|
|
- HSSFCell cellContent10 = rowContent.createCell(9);
|
|
|
|
- cellContent10.setCellValue(apDTO.getAddress());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //todo 将wb保存到oss
|
|
|
|
- ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
|
- workbook.write(output);
|
|
|
|
-
|
|
|
|
- byte[] buffer = output.toByteArray();
|
|
|
|
- ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
|
-
|
|
|
|
- String downloadUrl = OSSUtil.upload(ossConfig, "import", "error.xls", input);
|
|
|
|
-
|
|
|
|
- //todo 返回导入失败报表下载链接
|
|
|
|
-
|
|
|
|
- msgResult.setData(downloadUrl);
|
|
|
|
- msgResult.setResult(true);
|
|
|
|
- } catch (Exception ex) {
|
|
|
|
- logger.error(ex.getMessage(), ex);
|
|
|
|
-
|
|
|
|
- msgResult.setResult(false);
|
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return msgResult;
|
|
|
|
- }
|
|
|
|
-}
|
|
|