|
@@ -1,5 +1,6 @@
|
|
|
package com.jpsoft.campus.modules.base.controller;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.campus.config.OSSConfig;
|
|
|
import com.jpsoft.campus.config.WechatConfig;
|
|
@@ -18,6 +19,8 @@ import com.jpsoft.campus.modules.sys.entity.User;
|
|
|
import com.jpsoft.campus.modules.sys.service.DataDictionaryService;
|
|
|
import com.jpsoft.campus.modules.sys.service.UserRoleService;
|
|
|
import com.jpsoft.campus.modules.sys.service.UserService;
|
|
|
+import com.sun.image.codec.jpeg.JPEGCodec;
|
|
|
+import com.sun.image.codec.jpeg.JPEGImageEncoder;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -30,14 +33,18 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
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 javax.imageio.ImageIO;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.xml.crypto.Data;
|
|
|
-import java.io.ByteArrayInputStream;
|
|
|
-import java.io.ByteArrayOutputStream;
|
|
|
+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/applicationMiddle")
|
|
@@ -916,7 +923,14 @@ public class ApplicationMiddleController {
|
|
|
int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
|
- if("50".equals(applicationMiddle.getStatus())) {
|
|
|
+ if("40".equals(applicationMiddle.getStatus())) {
|
|
|
+ if("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())){
|
|
|
+ applicationMiddle.setStatus("70");
|
|
|
+ applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
|
|
|
+ }else{
|
|
|
+ applicationMiddle.setStatus("60");
|
|
|
+ }
|
|
|
+ }else if("50".equals(applicationMiddle.getStatus())) {
|
|
|
if("D".equals(applicationMiddle.getType()) || "E".equals(applicationMiddle.getType())){
|
|
|
applicationMiddle.setStatus("70");
|
|
|
applicationMiddle.setOfferId(applicationMiddle.getSchoolId());
|
|
@@ -1145,7 +1159,7 @@ public class ApplicationMiddleController {
|
|
|
Page<ApplicationMiddleDTO> page = applicationMiddleService.pageSearchDTO(searchParams,0,100000,true,sortList);
|
|
|
List<DataDictionary> relationshipList = dataDictionaryService.findByCatalogName("学生关系");
|
|
|
List<DataDictionary> typeNameList = dataDictionaryService.findByCatalogName("报名类型");
|
|
|
- List<DataDictionary> statusNameList = dataDictionaryService.findByCatalogName("小学招生审核流程");
|
|
|
+ List<DataDictionary> statusNameList = dataDictionaryService.findByCatalogName("中学招生审核流程");
|
|
|
List<DataDictionary> cardTypeList = dataDictionaryService.findByCatalogName("证件类型");
|
|
|
for (int i = 0; i < page.size(); i++) {
|
|
|
ApplicationMiddleDTO amDTO = page.get(i);
|
|
@@ -1338,7 +1352,7 @@ public class ApplicationMiddleController {
|
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
approvalInfo.setApplicationId(id);
|
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("小学招生审核流程",applicationMiddle.getStatus())+":" + typeValue);
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":" + typeValue);
|
|
|
approvalInfo.setRemark(remark);
|
|
|
approvalInfo.setFileUrl("");
|
|
|
approvalInfo.setDelFlag(false);
|
|
@@ -1376,7 +1390,7 @@ public class ApplicationMiddleController {
|
|
|
|
|
|
off.setApplicationId(applicationMiddle.getId());
|
|
|
off.setStudentId(applicationMiddle.getStudentId());
|
|
|
- off.setEnrollmentType("1");//小学
|
|
|
+ off.setEnrollmentType("2");//中学
|
|
|
off.setSchoolId(applicationMiddle.getSchoolId());
|
|
|
off.setSerialNum(serialNum);
|
|
|
|
|
@@ -1387,9 +1401,22 @@ public class ApplicationMiddleController {
|
|
|
offerInfoService.insert(off);
|
|
|
|
|
|
applicationMiddle.setOfferCode(code);
|
|
|
+
|
|
|
+ applicationMiddle.setOfferCode(code);
|
|
|
+ SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getSchoolId());
|
|
|
+ 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);
|
|
|
+ applicationMiddle.setOfferImg(uploadUrl);
|
|
|
+ String content = "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。";
|
|
|
+ sendMessage(content,applicationMiddle.getPersonId());
|
|
|
}
|
|
|
applicationMiddleService.update(applicationMiddle);
|
|
|
|
|
|
+ String uploadPath = Resource.class.getResource("/").getPath() +"uploadImg";
|
|
|
+ delAllFile(uploadPath);
|
|
|
+
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(approvalInfo);
|
|
|
} else {
|
|
@@ -1406,4 +1433,326 @@ public class ApplicationMiddleController {
|
|
|
|
|
|
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);
|
|
|
+ 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<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);
|
|
|
+ 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(applicationMiddle.getPersonId());
|
|
|
+ String appId = wechatConfig.getAppId();
|
|
|
+ String appSecret = wechatConfig.getAppSecret();
|
|
|
+
|
|
|
+ boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
+ user.getUserName(),"尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。",
|
|
|
+ backRemark,backDate,pi.getOpenId(),
|
|
|
+ wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
|
+ }else if("80".equals(applicationMiddle.getStatus())){
|
|
|
+ //微信消息推送 发送完成录取通知
|
|
|
+ applicationMiddle.setStatus(nextStatus);
|
|
|
+
|
|
|
+ int serialNum = offerInfoService.findMaxSerialNum(applicationMiddle.getSchoolId(),"1");
|
|
|
+ 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.getSchoolId());
|
|
|
+ off.setSerialNum(serialNum);
|
|
|
+ off.setCode(code);
|
|
|
+ off.setDelFlag(false);
|
|
|
+ off.setCreateBy(subject);
|
|
|
+ off.setCreateTime(new Date());
|
|
|
+ int oicount = offerInfoService.insert(off);
|
|
|
+
|
|
|
+ applicationMiddle.setOfferCode(code);
|
|
|
+
|
|
|
+ if(oicount > 0) {
|
|
|
+ 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(applicationMiddle.getPersonId());
|
|
|
+ String appId = wechatConfig.getAppId();
|
|
|
+ String appSecret = wechatConfig.getAppSecret();
|
|
|
+
|
|
|
+ boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
+ user.getUserName(), "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。",
|
|
|
+ backRemark, backDate, pi.getOpenId(),
|
|
|
+ wechatConfig.getBackNoticeTemplateId(), wechatConfig.getTokenUrl(), appId, appSecret);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ applicationMiddle.setStatus(nextStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ applicationMiddle.setUpdateBy(subject);
|
|
|
+ applicationMiddle.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
|
+ approvalInfo.setId(UUID.randomUUID().toString());
|
|
|
+ approvalInfo.setApplicationId(applicationMiddle.getId());
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":通过审核");
|
|
|
+ approvalInfo.setRemark("通过审核");
|
|
|
+ approvalInfo.setFileUrl("");
|
|
|
+ approvalInfo.setDelFlag(false);
|
|
|
+ approvalInfo.setCreateBy(subject);
|
|
|
+ approvalInfo.setCreateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = approvalInfoService.insert(approvalInfo);
|
|
|
+
|
|
|
+ applicationMiddleService.update(applicationMiddle);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //完成后删除文件夹
|
|
|
+ String uploadPath = Resource.class.getResource("/").getPath() +"uploadImg";
|
|
|
+ delAllFile(uploadPath);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+ {
|
|
|
+ FileInputStream fis = new FileInputStream(inImg);//创建输入流对象
|
|
|
+ FileOutputStream fos = new FileOutputStream(outImg); //创建输出流对象
|
|
|
+ byte datas[] = new byte[1024*8];//创建搬运工具
|
|
|
+ int len = 0;//创建长度
|
|
|
+ while((len = fis.read(datas))!=-1)//循环读取数据
|
|
|
+ {
|
|
|
+ fos.write(datas,0,len);
|
|
|
+ }
|
|
|
+ fis.close();//释放资源
|
|
|
+ fis.close();//释放资源
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ //加水印
|
|
|
+ pressText(offerCode,outImg,"宋体",0,new Color(0,0,0),40,1000,400);
|
|
|
+ pressText(personName,outImg,"宋体",0,new Color(0,0,0),40,410,600);
|
|
|
+ pressText(userName,outImg,"宋体",0,new Color(0,0,0),40,830,680);
|
|
|
+ pressText("8",outImg,"宋体",0,new Color(0,0,0),40,660,940);
|
|
|
+ pressText("25",outImg,"宋体",0,new Color(0,0,0),40,730,940);
|
|
|
+ pressText("8",outImg,"宋体",0,new Color(0,0,0),40,890,940);
|
|
|
+ pressText("25",outImg,"宋体",0,new Color(0,0,0),40,970,940);
|
|
|
+ pressText(schoolName,outImg,"宋体",0,new Color(0,0,0),40,480,1015);
|
|
|
+ pressText(DateUtil.thisMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1000,1590);
|
|
|
+ pressText(DateUtil.thisDayOfMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1060,1590);
|
|
|
+ return outImg;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void pressText(String pressText, String targetImg, String fontName, int fontStyle, Color color, int fontSize, int x, int y){
|
|
|
+ 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, "/forPerson", jpgFile.getName(), input);
|
|
|
+ if (StringUtils.isNotEmpty(returnUrl)) {
|
|
|
+ jpgFile.delete();
|
|
|
+ }
|
|
|
+ input.close();
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return returnUrl;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean sendMessage(String content,String personId){
|
|
|
+ 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 = false;
|
|
|
+// boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
+// user.getUserName(),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);// 先删除文件夹里面的文件
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|