xiao547607 il y a 3 ans
Parent
commit
386a7c24b3

+ 5 - 0
common/src/main/resources/mapper/base/ApplicationMiddle.xml

@@ -312,6 +312,11 @@
             <if test="searchParams.offerId != null">
                 and a.offer_id = #{searchParams.offerId}
             </if>
+            <if test="searchParams.idsList != null">
+                <foreach item="aId" collection="searchParams.idsList" open="and a.id_ in (" separator="," close=")">
+                    #{aId}
+                </foreach>
+            </if>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">
             ${sort.name} ${sort.order}

+ 5 - 0
common/src/main/resources/mapper/base/ApplicationPrimary.xml

@@ -317,6 +317,11 @@
             <if test="searchParams.offerId != null">
                 and a.offer_id = #{searchParams.offerId}
             </if>
+            <if test="searchParams.idsList != null">
+                <foreach item="aId" collection="searchParams.idsList" open="and a.id_ in (" separator="," close=")">
+                    #{aId}
+                </foreach>
+            </if>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">
             ${sort.name} ${sort.order}

+ 172 - 151
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationMiddleController.java

@@ -1556,6 +1556,8 @@ public class ApplicationMiddleController {
             @RequestParam(value="startStatus",defaultValue="") String startStatus,
             @RequestParam(value="endStatus",defaultValue="") String endStatus,
             @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
+            @RequestParam(value="idList",defaultValue="") String idList,
+            @RequestParam(value="isSelect",defaultValue="0") String isSelect,
             @RequestAttribute String subject){
 
         //当前用户ID
@@ -1563,101 +1565,115 @@ public class ApplicationMiddleController {
 
         MessageResult<Map> msgResult = new MessageResult<>();
 
-        Map<String,Object> searchParams = new HashMap<>();
-        User user = userService.get(subject);
-        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.offer_code","asc"));
-        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 + "%");
-        }
+        try {
 
-        if (StringUtils.isNotEmpty(cardType)) {
-            searchParams.put("cardType",cardType);
-        }
 
-        searchParams.put("delFlag",delFlag);
+            Map<String, Object> searchParams = new HashMap<>();
+            User user = userService.get(subject);
+            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.offer_code", "asc"));
+            sortList.add(new Sort("a.create_time", "desc"));
 
-        if(StringUtils.isNotEmpty(schoolId)){
-            searchParams.put("code", "%" + schoolId + "%");
-        }else{
-            if (!userService.hasRole(subject,"SYSADMIN")) {
+            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 + "%");
+            }
 
-                searchParams.put("code", "%" + user.getSchoolId() + "%");
+            if (StringUtils.isNotEmpty(cardType)) {
+                searchParams.put("cardType", cardType);
             }
-        }
 
-        if(StringUtils.isNotEmpty(isSend)){
-            searchParams.put("isSend", isSend);
-        }
+            searchParams.put("delFlag", delFlag);
 
-        if(StringUtils.isNotEmpty(offerId)){
-            searchParams.put("offerId", offerId);
-        }
+            if (StringUtils.isNotEmpty(schoolId)) {
+                searchParams.put("code", "%" + schoolId + "%");
+            } else {
+                if (!userService.hasRole(subject, "SYSADMIN")) {
 
-        //查询范围
-        //开始
-        if (StringUtils.isNotEmpty(startStatus)) {
-            searchParams.put("startStatus",startStatus);
-        }
-        //结束
-        if (StringUtils.isNotEmpty(endStatus)) {
-            searchParams.put("endStatus",endStatus);
-        }
+                    searchParams.put("code", "%" + user.getSchoolId() + "%");
+                }
+            }
 
-        if (StringUtils.isNotEmpty(categoryId)) {
-            searchParams.put("categoryId",categoryId);
-        }
+            if (StringUtils.isNotEmpty(isSend)) {
+                searchParams.put("isSend", isSend);
+            }
 
-        //根据用户和角色查询
-        int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
-        int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
-        int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
+            if (StringUtils.isNotEmpty(offerId)) {
+                searchParams.put("offerId", offerId);
+            }
 
-        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);
-        }
+            //查询范围
+            //开始
+            if (StringUtils.isNotEmpty(startStatus)) {
+                searchParams.put("startStatus", startStatus);
+            }
+            //结束
+            if (StringUtils.isNotEmpty(endStatus)) {
+                searchParams.put("endStatus", endStatus);
+            }
 
-        Page<ApplicationMiddleDTO> page = applicationMiddleService.pageSearchDTO(searchParams,0,100000,false,sortList);
-        for(ApplicationMiddleDTO applicationMiddleDTO : page.getResult()){
-            ApplicationMiddle applicationMiddle = applicationMiddleService.get(applicationMiddleDTO.getApplicationId());
-            if("40".equals(applicationMiddle.getStatus())) {
-                if("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())){
-                    applicationMiddle.setStatus("70");
-                    applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
-                }else{
-                    applicationMiddle.setStatus(nextStatus);
+            if (StringUtils.isNotEmpty(categoryId)) {
+                searchParams.put("categoryId", categoryId);
+            }
+
+            List<String> idsList = new ArrayList<>();
+            if("1".equals(isSelect)) {
+                if (StringUtils.isNotEmpty(idList)) {
+                    String[] ids = idList.split(",");
+                    idsList = Arrays.asList(ids);
+                    searchParams.put("idsList", idsList);
+                } else {
+                    throw new Exception("未选择审核的学生");
                 }
-            }else if("50".equals(applicationMiddle.getStatus())) {
-                if("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())){
-                    applicationMiddle.setStatus("70");
-                    applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
-                }else{
+            }
+
+            //根据用户和角色查询
+            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<ApplicationMiddleDTO> page = applicationMiddleService.pageSearchDTO(searchParams, 0, 100000, false, sortList);
+            for (ApplicationMiddleDTO applicationMiddleDTO : page.getResult()) {
+                ApplicationMiddle applicationMiddle = applicationMiddleService.get(applicationMiddleDTO.getApplicationId());
+                if ("40".equals(applicationMiddle.getStatus())) {
+                    if ("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())) {
+                        applicationMiddle.setStatus("70");
+                        applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
+                    } else {
+                        applicationMiddle.setStatus(nextStatus);
+                    }
+                } else if ("50".equals(applicationMiddle.getStatus())) {
+                    if ("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())) {
+                        applicationMiddle.setStatus("70");
+                        applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
+                    } else {
+                        applicationMiddle.setStatus(nextStatus);
+                    }
+                } else if ("70".equals(applicationMiddle.getStatus())) {
+                    //微信消息推送 发送预录取通知
                     applicationMiddle.setStatus(nextStatus);
-                }
-            }else if("70".equals(applicationMiddle.getStatus())){
-                //微信消息推送 发送预录取通知
-                applicationMiddle.setStatus(nextStatus);
 //                new Thread(() -> {
 //                        try {
 //                            String content =  "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。";
@@ -1666,84 +1682,89 @@ public class ApplicationMiddleController {
 //                            ex.printStackTrace();
 //                        }
 //                    }).start();
-            }else if("80".equals(applicationMiddle.getStatus())){
-                //微信消息推送 发送完成录取通知
-                applicationMiddle.setStatus(nextStatus);
-
-                int serialNum = offerInfoService.findMaxSerialNum(applicationMiddle.getSchoolId(),"2");
-                serialNum = serialNum+1;//最大编号加一
-                Calendar date = Calendar.getInstance();
-                String year = String.valueOf(date.get(Calendar.YEAR));
-                SchoolInfo si = schoolInfoService.get(applicationMiddle.getSchoolId());
-                //开发区+年份+学校编号2位+序号4位
-                String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
-                //保存录取信息表
-                OfferInfo off = new OfferInfo();
-                off.setId(UUID.randomUUID().toString());
-
-                off.setApplicationId(applicationMiddle.getId());
-                off.setStudentId(applicationMiddle.getStudentId());
-                off.setEnrollmentType("2");//小学
-                off.setSchoolId(applicationMiddle.getOfferId());
-                off.setSerialNum(serialNum);
-                off.setCode(code);
-                applicationMiddle.setOfferCode(code);
-
-                SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getOfferId());
-                PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
-                StudentInfo studentInfo = studentInfoService.get(applicationMiddle.getStudentId());
-                String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName());
-                String uploadUrl = uploadImg(bdUrl);
-                if(StringUtils.isNotEmpty(uploadUrl)){
-                    off.setDelFlag(false);
-                    off.setCreateBy(subject);
-                    off.setCreateTime(new Date());
-                    offerInfoService.insert(off);
-                    applicationMiddle.setOfferImg(uploadUrl);
-                    new Thread(() -> {
-                        try {
-                            String content =  "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
-                            sendMessage(content,applicationMiddle.getPersonId(),user.getRealName());
-                        } catch (Exception ex) {
-                            ex.printStackTrace();
-                        }
-                    }).start();
-                }else{
-                    applicationMiddle.setStatus("80");
+                } else if ("80".equals(applicationMiddle.getStatus())) {
+                    //微信消息推送 发送完成录取通知
+                    applicationMiddle.setStatus(nextStatus);
+
+                    int serialNum = offerInfoService.findMaxSerialNum(applicationMiddle.getSchoolId(), "2");
+                    serialNum = serialNum + 1;//最大编号加一
+                    Calendar date = Calendar.getInstance();
+                    String year = String.valueOf(date.get(Calendar.YEAR));
+                    SchoolInfo si = schoolInfoService.get(applicationMiddle.getSchoolId());
+                    //开发区+年份+学校编号2位+序号4位
+                    String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
+                    //保存录取信息表
+                    OfferInfo off = new OfferInfo();
+                    off.setId(UUID.randomUUID().toString());
+
+                    off.setApplicationId(applicationMiddle.getId());
+                    off.setStudentId(applicationMiddle.getStudentId());
+                    off.setEnrollmentType("2");//小学
+                    off.setSchoolId(applicationMiddle.getOfferId());
+                    off.setSerialNum(serialNum);
+                    off.setCode(code);
+                    applicationMiddle.setOfferCode(code);
+
+                    SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getOfferId());
+                    PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
+                    StudentInfo studentInfo = studentInfoService.get(applicationMiddle.getStudentId());
+                    String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName());
+                    String uploadUrl = uploadImg(bdUrl);
+                    if (StringUtils.isNotEmpty(uploadUrl)) {
+                        off.setDelFlag(false);
+                        off.setCreateBy(subject);
+                        off.setCreateTime(new Date());
+                        offerInfoService.insert(off);
+                        applicationMiddle.setOfferImg(uploadUrl);
+                        new Thread(() -> {
+                            try {
+                                String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
+                                sendMessage(content, applicationMiddle.getPersonId(), user.getRealName());
+                            } catch (Exception ex) {
+                                ex.printStackTrace();
+                            }
+                        }).start();
+                    } else {
+                        applicationMiddle.setStatus("80");
+                    }
+                } else {
+                    applicationMiddle.setStatus(nextStatus);
                 }
-            }else{
-                applicationMiddle.setStatus(nextStatus);
-            }
 
-            applicationMiddle.setUpdateBy(subject);
-            applicationMiddle.setUpdateTime(new Date());
+                applicationMiddle.setUpdateBy(subject);
+                applicationMiddle.setUpdateTime(new Date());
 
-            ApprovalInfo approvalInfo = new ApprovalInfo();
-            approvalInfo.setId(UUID.randomUUID().toString());
-            approvalInfo.setApplicationId(applicationMiddle.getId());
-            if("80".equals(status)) {
-                approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",status));
-            }else{
-                approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",status)+":通过审核");
-            }
-            approvalInfo.setRemark("通过审核");
-            approvalInfo.setFileUrl("");
-            approvalInfo.setDelFlag(false);
-            approvalInfo.setCreateBy(subject);
-            approvalInfo.setCreateTime(new Date());
+                ApprovalInfo approvalInfo = new ApprovalInfo();
+                approvalInfo.setId(UUID.randomUUID().toString());
+                approvalInfo.setApplicationId(applicationMiddle.getId());
+                if ("80".equals(status)) {
+                    approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程", status));
+                } else {
+                    approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程", status) + ":通过审核");
+                }
+                approvalInfo.setRemark("通过审核");
+                approvalInfo.setFileUrl("");
+                approvalInfo.setDelFlag(false);
+                approvalInfo.setCreateBy(subject);
+                approvalInfo.setCreateTime(new Date());
 
-            int affectCount = approvalInfoService.insert(approvalInfo);
+                int affectCount = approvalInfoService.insert(approvalInfo);
 
-            applicationMiddleService.update(applicationMiddle);
-        }
+                applicationMiddleService.update(applicationMiddle);
+            }
 
 
-        //完成后删除文件夹
-        String uploadPath = Resource.class.getResource("/").getPath() +"uploadImg";
-        delAllFile(uploadPath);
+            //完成后删除文件夹
+            String uploadPath = Resource.class.getResource("/").getPath() + "uploadImg";
+            delAllFile(uploadPath);
 
-        msgResult.setResult(true);
-        msgResult.setData(PojoUtils.pageWrapper(page));
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(page));
+        }catch (Exception e){
+            e.printStackTrace();
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+        }
 
         return msgResult;
     }

+ 25 - 7
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationPrimaryController.java

@@ -423,7 +423,7 @@ public class ApplicationPrimaryController {
             sortList.add(new Sort("id_","asc"));
 
             if (StringUtils.isNotEmpty(type)) {
-                if("A".equals(type) || "B".equals(type) ||"C".equals(type)) {
+                if("A".equals(type) || "B".equals(type) ||"C".equals(type) || "Y".equals(type) || "Z".equals(type)) {
                     searchParams.put("type", type);
                 }else{
                     searchParams.put("type", "C");
@@ -1676,6 +1676,8 @@ public class ApplicationPrimaryController {
             @RequestParam(value="startStatus",defaultValue="") String startStatus,
             @RequestParam(value="endStatus",defaultValue="") String endStatus,
             @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
+            @RequestParam(value="idList",defaultValue="") String idList,
+            @RequestParam(value="isSelect",defaultValue="0") String isSelect,
             @RequestAttribute String subject){
 
         //当前用户ID
@@ -1757,6 +1759,17 @@ public class ApplicationPrimaryController {
                 searchParams.put("orStatus", statusList);
             }
 
+            List<String> idsList = new ArrayList<>();
+            if("1".equals(isSelect)) {
+                if (StringUtils.isNotEmpty(idList)) {
+                    String[] ids = idList.split(",");
+                    idsList = Arrays.asList(ids);
+                    searchParams.put("idsList", idsList);
+                } else {
+                    throw new Exception("未选择审核的学生");
+                }
+            }
+
             Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams, 0, 100000, false, sortList);
             for (ApplicationPrimaryDTO applicationPrimaryDTO : page.getResult()) {
 
@@ -1875,6 +1888,8 @@ public class ApplicationPrimaryController {
             msgResult.setData(PojoUtils.pageWrapper(page));
         }catch (Exception e){
             e.printStackTrace();
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
         }
 
         return msgResult;
@@ -1967,9 +1982,9 @@ public class ApplicationPrimaryController {
             g.drawString("舒爸爸",410,600);
             g.drawString("舒展",830,680);
             g.drawString("8",660,940);
-            g.drawString("27",730,940);
+            g.drawString("24",730,940);
             g.drawString("8",890,940);
-            g.drawString("27",970,940);
+            g.drawString("25",970,940);
             g.drawString("湖北省荆州市沙市区小学",480,1015);
             g.drawString(mothh+"",1000,1590);
             g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);
@@ -1987,6 +2002,9 @@ public class ApplicationPrimaryController {
         String out = "uploadImg/primary_tzs_" + offerCode + ".jpg";
         String inImg = Resource.class.getResource("/").getPath() + in;
         String outImg = Resource.class.getResource("/").getPath() + out;
+        String seM = "8";
+        String startD = "24";
+        String endD = "25";
 
         try{
             BufferedImage im =ImageIO.read(new FileInputStream(inImg));
@@ -1999,10 +2017,10 @@ public class ApplicationPrimaryController {
             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(seM,660,940);
+            g.drawString(startD,730,940);
+            g.drawString(seM,890,940);
+            g.drawString(endD,970,940);
             g.drawString(schoolName,480,1015);
             g.drawString(mothh+"",1000,1590);
             g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);