|
@@ -1,29 +1,50 @@
|
|
|
package com.chuanghai.h3c_reporting.controller;
|
|
package com.chuanghai.h3c_reporting.controller;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.chuanghai.h3c_reporting.anno.AdminLoginCheck;
|
|
import com.chuanghai.h3c_reporting.anno.AdminLoginCheck;
|
|
|
import com.chuanghai.h3c_reporting.bo.CloseReporting;
|
|
import com.chuanghai.h3c_reporting.bo.CloseReporting;
|
|
|
import com.chuanghai.h3c_reporting.bo.DeleteReporting;
|
|
import com.chuanghai.h3c_reporting.bo.DeleteReporting;
|
|
|
|
|
+import com.chuanghai.h3c_reporting.bo.ValidReporting;
|
|
|
|
|
+import com.chuanghai.h3c_reporting.common.http.HttpsClient;
|
|
|
import com.chuanghai.h3c_reporting.common.utils.CommonResult;
|
|
import com.chuanghai.h3c_reporting.common.utils.CommonResult;
|
|
|
import com.chuanghai.h3c_reporting.common.utils.PageUtils;
|
|
import com.chuanghai.h3c_reporting.common.utils.PageUtils;
|
|
|
import com.chuanghai.h3c_reporting.controller.request.ReportQueryRequest;
|
|
import com.chuanghai.h3c_reporting.controller.request.ReportQueryRequest;
|
|
|
import com.chuanghai.h3c_reporting.dto.ReportingDownloadDTO;
|
|
import com.chuanghai.h3c_reporting.dto.ReportingDownloadDTO;
|
|
|
import com.chuanghai.h3c_reporting.entity.InformationReporting;
|
|
import com.chuanghai.h3c_reporting.entity.InformationReporting;
|
|
|
|
|
+import com.chuanghai.h3c_reporting.entity.SubscribeMessages;
|
|
|
import com.chuanghai.h3c_reporting.entity.User;
|
|
import com.chuanghai.h3c_reporting.entity.User;
|
|
|
import com.chuanghai.h3c_reporting.service.InformationReportingService;
|
|
import com.chuanghai.h3c_reporting.service.InformationReportingService;
|
|
|
|
|
+import com.chuanghai.h3c_reporting.service.SubscribeMessagesService;
|
|
|
import com.chuanghai.h3c_reporting.vo.InformationReportingVO;
|
|
import com.chuanghai.h3c_reporting.vo.InformationReportingVO;
|
|
|
|
|
+import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.tomcat.util.buf.StringUtils;
|
|
import org.apache.tomcat.util.buf.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
+import java.io.BufferedReader;
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.io.InputStream;
|
|
|
|
|
+import java.io.InputStreamReader;
|
|
|
|
|
+import java.net.HttpURLConnection;
|
|
|
|
|
+import java.net.URL;
|
|
|
|
|
+import java.net.URLConnection;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 报备模块
|
|
* 报备模块
|
|
@@ -41,11 +62,25 @@ public class InformationReportingController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InformationReportingService informationReportingService;
|
|
private InformationReportingService informationReportingService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SubscribeMessagesService subscribeMessagesService;
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${wx.app_id}")
|
|
|
|
|
+ private String appID;
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${wx.secret}")
|
|
|
|
|
+ private String secret;
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${wx.template_id}")
|
|
|
|
|
+ private String template_id;
|
|
|
|
|
+
|
|
|
|
|
+ private String access_token = "";
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 信息上传
|
|
* 信息上传
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
- public CommonResult<String> add(@Valid @RequestBody InformationReportingVO staffEntity) {
|
|
|
|
|
|
|
+ public CommonResult<String> add(@Valid @RequestBody InformationReportingVO staffEntity) throws IOException{
|
|
|
|
|
|
|
|
String product = StringUtils.join(Arrays.asList(staffEntity.getBProduct()), ',');
|
|
String product = StringUtils.join(Arrays.asList(staffEntity.getBProduct()), ',');
|
|
|
staffEntity.setProduct(product);
|
|
staffEntity.setProduct(product);
|
|
@@ -59,8 +94,16 @@ public class InformationReportingController {
|
|
|
BeanUtils.copyProperties(staffEntity, reporting);
|
|
BeanUtils.copyProperties(staffEntity, reporting);
|
|
|
LocalDateTime localDateTime = LocalDateTime.now();
|
|
LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
reporting.setReportingTime(localDateTime);
|
|
reporting.setReportingTime(localDateTime);
|
|
|
- reporting.setStatus(1);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //Astrid Wang更改---1变为2,进行中变为已提交
|
|
|
|
|
+ reporting.setStatus(2);
|
|
|
reporting.setDelStatus(1);
|
|
reporting.setDelStatus(1);
|
|
|
|
|
+
|
|
|
|
|
+ //String openid = getOpenId(staffEntity.getCode());
|
|
|
|
|
+ String openid = getOpenidByCode(staffEntity.getCode());
|
|
|
|
|
+
|
|
|
|
|
+ reporting.setOpenid(openid);
|
|
|
|
|
+
|
|
|
boolean flag = informationReportingService.save(reporting);
|
|
boolean flag = informationReportingService.save(reporting);
|
|
|
if (flag) {
|
|
if (flag) {
|
|
|
log.info("上传信息=========>>> 【{}】【微信绑定手机号:{}】成功上传了编号为【{}】的项目信息", reporting.getName(), reporting.getWxPhone(), reporting.getId());
|
|
log.info("上传信息=========>>> 【{}】【微信绑定手机号:{}】成功上传了编号为【{}】的项目信息", reporting.getName(), reporting.getWxPhone(), reporting.getId());
|
|
@@ -118,6 +161,318 @@ public class InformationReportingController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * @author Astrid Wang
|
|
|
|
|
+ *
|
|
|
|
|
+ * 有效
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ @AdminLoginCheck
|
|
|
|
|
+ @DeleteMapping("/valid")
|
|
|
|
|
+ public CommonResult<String> valid(@RequestHeader("admin_token") String adminToken,
|
|
|
|
|
+ @RequestBody ValidReporting reporting) {
|
|
|
|
|
+
|
|
|
|
|
+ //根据 项目id 查询 openid
|
|
|
|
|
+ InformationReporting in = informationReportingService.getById(reporting.getItemId());
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(in);
|
|
|
|
|
+
|
|
|
|
|
+ String openid = in.getOpenid();
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(openid);
|
|
|
|
|
+
|
|
|
|
|
+ //向方法传入openid、ps、title
|
|
|
|
|
+ String ps = reporting.getPs();
|
|
|
|
|
+ String a = send(openid,ps,"项目有效");
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(ps);
|
|
|
|
|
+ //System.out.println(a);
|
|
|
|
|
+ //System.out.println(a);
|
|
|
|
|
+
|
|
|
|
|
+ //变status状态
|
|
|
|
|
+ InformationReporting reporting1 = new InformationReporting();
|
|
|
|
|
+ reporting1.setId(reporting.getItemId());
|
|
|
|
|
+ //点击‘有效’变为‘进行中’---1
|
|
|
|
|
+ reporting1.setStatus(1);
|
|
|
|
|
+
|
|
|
|
|
+ boolean flag = informationReportingService.updateById(reporting1);
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ log.info("点击<有效>的操作,成功,状态变为进行中=========>>> 管理员【{}】【id:{}】点击<有效>的操作成功,将编号为【{}】的项目状态变为进行中", reporting.getName(), reporting.getId(), reporting.getItemId());
|
|
|
|
|
+ return CommonResult.ok();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.info("点击<有效>的操作,失败=========>>> 管理员【{}】【id:{}】点击<有效>的操作失败,将编号为【{}】的项目状态转换的操作失败", reporting.getName(), reporting.getId(), reporting.getItemId());
|
|
|
|
|
+ return CommonResult.fail();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @author Astrid Wang
|
|
|
|
|
+ *
|
|
|
|
|
+ * 失效
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ @AdminLoginCheck
|
|
|
|
|
+ @DeleteMapping("/invalid")
|
|
|
|
|
+ public CommonResult<String> invalid(@RequestHeader("admin_token") String adminToken,
|
|
|
|
|
+ @RequestBody ValidReporting reporting) {
|
|
|
|
|
+
|
|
|
|
|
+ /*//根据 项目id 查询 openid
|
|
|
|
|
+ QueryWrapper<SubscribeMessages> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq("id",reporting.getItemId());
|
|
|
|
|
+ SubscribeMessages messages = subscribeMessagesService.getOne(queryWrapper);
|
|
|
|
|
+ String openid = messages.getOpenid();
|
|
|
|
|
+ //System.out.println(openid);*/
|
|
|
|
|
+
|
|
|
|
|
+ //根据 项目id 查询 openid
|
|
|
|
|
+ InformationReporting in = informationReportingService.getById(reporting.getItemId());
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(in);
|
|
|
|
|
+
|
|
|
|
|
+ String openid = in.getOpenid();
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(openid);
|
|
|
|
|
+
|
|
|
|
|
+ //向方法传入openid、ps、title
|
|
|
|
|
+ String ps = reporting.getPs();
|
|
|
|
|
+ String a = send(openid,ps,"项目失效");
|
|
|
|
|
+
|
|
|
|
|
+ //System.out.println(ps);
|
|
|
|
|
+ //System.out.println(a);
|
|
|
|
|
+
|
|
|
|
|
+ //变status状态
|
|
|
|
|
+ InformationReporting reporting1 = new InformationReporting();
|
|
|
|
|
+ reporting1.setId(reporting.getItemId());
|
|
|
|
|
+ //点击‘失效’变为‘已失效’---3
|
|
|
|
|
+ reporting1.setStatus(3);
|
|
|
|
|
+
|
|
|
|
|
+ boolean flag = informationReportingService.updateById(reporting1);
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ log.info("点击<失效>的操作,成功,状态变为已失效=========>>> 管理员【{}】【id:{}】点击<失效>的操作成功,将编号为【{}】的项目状态变为已失效", reporting.getName(), reporting.getId(), reporting.getItemId());
|
|
|
|
|
+ return CommonResult.ok();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.info("点击<失效>的操作,失败=========>>> 管理员【{}】【id:{}】点击<失效>的操作失败,将编号为【{}】的项目状态转换的操作失败", reporting.getName(), reporting.getId(), reporting.getItemId());
|
|
|
|
|
+ return CommonResult.fail();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取access_token
|
|
|
|
|
+ //@Scheduled(cron = "0 59 0/1 * * ?") // 每1小时59分,执行一次刷新access_token
|
|
|
|
|
+ public void getAccessToken() {
|
|
|
|
|
+
|
|
|
|
|
+ String url = "https://api.weixin.qq.com/cgi-bin/token?" +
|
|
|
|
|
+ "grant_type=client_credential" +
|
|
|
|
|
+ "&appid=" + appID +
|
|
|
|
|
+ "&secret=" + secret;
|
|
|
|
|
+
|
|
|
|
|
+ RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
+
|
|
|
|
|
+ ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class);
|
|
|
|
|
+ JSONObject objParam = JSON.parseObject(responseEntity.getBody());
|
|
|
|
|
+
|
|
|
|
|
+ for (Map.Entry<String, Object> entry : objParam.entrySet()) {
|
|
|
|
|
+ Object o = entry.getValue();
|
|
|
|
|
+ if (o instanceof String) {
|
|
|
|
|
+ if (entry.getKey().equals("access_token")) {
|
|
|
|
|
+ access_token = (String) entry.getValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 小程序订阅消息
|
|
|
|
|
+ */
|
|
|
|
|
+ public String send(String openid,String ps,String title){
|
|
|
|
|
+
|
|
|
|
|
+ // access_token是存在有效期的,过期就刷新
|
|
|
|
|
+ if (access_token.equals("")) {
|
|
|
|
|
+ getAccessToken();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject message = new JSONObject();
|
|
|
|
|
+ message.put("touser", openid);
|
|
|
|
|
+ message.put("template_id", template_id);
|
|
|
|
|
+ message.put("page", "index");
|
|
|
|
|
+ message.put("miniprogram_state", "formal");
|
|
|
|
|
+ message.put("lang", "zh_CN");
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
|
|
+
|
|
|
|
|
+ // 审核结果
|
|
|
|
|
+ JSONObject thing1 = new JSONObject();
|
|
|
|
|
+ thing1.put("value", title);//变为title
|
|
|
|
|
+ // 备注
|
|
|
|
|
+ JSONObject thing5 = new JSONObject();
|
|
|
|
|
+ thing5.put("value", ps);
|
|
|
|
|
+
|
|
|
|
|
+ // 审核结果
|
|
|
|
|
+ data.put("thing1",thing1);
|
|
|
|
|
+ // 备注
|
|
|
|
|
+ data.put("thing5",thing5);
|
|
|
|
|
+
|
|
|
|
|
+ message.put("data", data);
|
|
|
|
|
+ System.out.println(message);
|
|
|
|
|
+ return HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+access_token, message);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getOpenId(String code) throws IOException {
|
|
|
|
|
+
|
|
|
|
|
+ // access_token是存在有效期的,过期就刷新
|
|
|
|
|
+ if (access_token.equals("")) {
|
|
|
|
|
+ getAccessToken();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 构造请求URL
|
|
|
|
|
+ //String requestUrl = OPENID_URL + "?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
|
|
|
|
|
+ String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
|
|
|
|
|
+
|
|
|
|
|
+ // 发送请求并获取响应
|
|
|
|
|
+ URL url = new URL(requestUrl);
|
|
|
|
|
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
|
|
|
+ connection.setRequestMethod("GET");
|
|
|
|
|
+ connection.setDoOutput(true);
|
|
|
|
|
+ connection.setDoInput(true);
|
|
|
|
|
+ connection.connect();
|
|
|
|
|
+ InputStream inputStream = connection.getInputStream();
|
|
|
|
|
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
|
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
|
+ String line;
|
|
|
|
|
+ while ((line = reader.readLine()) != null) {
|
|
|
|
|
+ stringBuilder.append(line);
|
|
|
|
|
+ }
|
|
|
|
|
+ reader.close();
|
|
|
|
|
+ connection.disconnect();
|
|
|
|
|
+
|
|
|
|
|
+ // 解析响应结果,提取openid
|
|
|
|
|
+ String response = stringBuilder.toString();
|
|
|
|
|
+ String openid = null;
|
|
|
|
|
+ if (response.contains("openid")) {
|
|
|
|
|
+ int beginIndex = response.indexOf("openid") + 9;
|
|
|
|
|
+ int endIndex = response.indexOf("\"", beginIndex);
|
|
|
|
|
+ openid = response.substring(beginIndex, endIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //String openid="1234512345123451234512345123";
|
|
|
|
|
+
|
|
|
|
|
+ return openid;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getOpenidByCode(String code) {
|
|
|
|
|
+ //页面获取openId接口
|
|
|
|
|
+ String getopenid_url = "https://api.weixin.qq.com/sns/jscode2session";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String param = "appid=" + appID + "&secret=" + secret + "&js_code=" + code + "&grant_type=authorization_code";
|
|
|
|
|
+
|
|
|
|
|
+// //向微信服务器发送get请求获取openIdStr
|
|
|
|
|
+ String openIdStr = this.sendGet(getopenid_url, param);
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println("微信返回结果: " + openIdStr);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject json = JSONObject.parseObject(openIdStr);//转成Json格式
|
|
|
|
|
+
|
|
|
|
|
+ String openId = json.getString("openid");//获取openId
|
|
|
|
|
+
|
|
|
|
|
+ return openId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 向指定URL发送GET方法的请求
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param url 发送请求的URL
|
|
|
|
|
+ * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
|
|
|
|
+ * @return URL 所代表远程资源的响应结果
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ public String sendGet(String url, String param) {
|
|
|
|
|
+
|
|
|
|
|
+ String result = "";
|
|
|
|
|
+
|
|
|
|
|
+ BufferedReader in = null;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ String urlNameString = url + "?" + param;
|
|
|
|
|
+
|
|
|
|
|
+// System.out.println(urlNameString);
|
|
|
|
|
+
|
|
|
|
|
+ URL realUrl = new URL(urlNameString);
|
|
|
|
|
+
|
|
|
|
|
+// 打开和URL之间的连接
|
|
|
|
|
+
|
|
|
|
|
+ URLConnection connection = realUrl.openConnection();
|
|
|
|
|
+
|
|
|
|
|
+// 设置通用的请求属性
|
|
|
|
|
+
|
|
|
|
|
+ connection.setRequestProperty("accept", "*/*");
|
|
|
|
|
+
|
|
|
|
|
+ connection.setRequestProperty("connection", "Keep-Alive");
|
|
|
|
|
+
|
|
|
|
|
+ connection.setRequestProperty("user-agent",
|
|
|
|
|
+
|
|
|
|
|
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
|
|
|
|
+
|
|
|
|
|
+// 建立实际的连接
|
|
|
|
|
+
|
|
|
|
|
+ connection.connect();
|
|
|
|
|
+
|
|
|
|
|
+// 获取所有响应头字段
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, List<String>> map = connection.getHeaderFields();
|
|
|
|
|
+
|
|
|
|
|
+// 遍历所有的响应头字段
|
|
|
|
|
+
|
|
|
|
|
+ for (String key : map.keySet()) {
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println(key + "--->" + map.get(key));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// 定义 BufferedReader输入流来读取URL的响应
|
|
|
|
|
+
|
|
|
|
|
+ in = new BufferedReader(new InputStreamReader(
|
|
|
|
|
+
|
|
|
|
|
+ connection.getInputStream()));
|
|
|
|
|
+
|
|
|
|
|
+ String line;
|
|
|
|
|
+
|
|
|
|
|
+ while ((line = in.readLine()) != null) {
|
|
|
|
|
+
|
|
|
|
|
+ result += line;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println("发送GET请求出现异常!" + e);
|
|
|
|
|
+
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// 使用finally块来关闭输入流
|
|
|
|
|
+
|
|
|
|
|
+ finally {
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ if (in != null) {
|
|
|
|
|
+
|
|
|
|
|
+ in.close();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e2) {
|
|
|
|
|
+
|
|
|
|
|
+ e2.printStackTrace();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 项目列表
|
|
* 项目列表
|
|
|
*/
|
|
*/
|
|
|
@AdminLoginCheck
|
|
@AdminLoginCheck
|