|
|
@@ -2,17 +2,21 @@ package com.goafanti.demandCollection.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
import com.goafanti.common.model.DemandCollection;
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.demandCollection.bo.InputDemandCollection;
|
|
|
import com.goafanti.demandCollection.service.DemandCollectionService;
|
|
|
|
|
|
@@ -28,6 +32,8 @@ public class DemandCollectionApiController extends CertifyApiController {
|
|
|
@Value(value = "${skjt.password}")
|
|
|
private String password = null;
|
|
|
|
|
|
+ private String SID = UUID.randomUUID().toString();
|
|
|
+
|
|
|
/**
|
|
|
* 新增需求收集
|
|
|
* @param d
|
|
|
@@ -52,6 +58,11 @@ public class DemandCollectionApiController extends CertifyApiController {
|
|
|
@RequestMapping(value="/open/demandCollectionList",method = RequestMethod.GET)
|
|
|
public Result demandCollectionList(InputDemandCollection i){
|
|
|
Result res =new Result();
|
|
|
+ if (TokenManager.getVal2Session("skjtid")==null||!SID.equals(TokenManager.getVal2Session("skjtid"))) {
|
|
|
+ res.getError().add(buildError("权限异常","权限异常"));
|
|
|
+ return res ;
|
|
|
+
|
|
|
+ }
|
|
|
res.data(demandCollectionService.demandCollectionList(i));
|
|
|
return res;
|
|
|
|
|
|
@@ -62,13 +73,14 @@ public class DemandCollectionApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value="/open/login",method = RequestMethod.POST)
|
|
|
- public Result demandCollectionList(String userName ,String password){
|
|
|
+ public Result demandCollectionList(String userName ,String password,Model model){
|
|
|
Result res =new Result();
|
|
|
//模拟登陆
|
|
|
if (username==null||password==null||!userName.equals(this.username)||!password.equals(this.password)) {
|
|
|
res.getError().add(buildError("账号密码不匹配!","账号密码不匹配!"));
|
|
|
return res ;
|
|
|
}
|
|
|
+ TokenManager.setVal2Session("skjtid", SID);
|
|
|
res.data("jdasjdoisahoi-@djsaldjslajdasklsjdoiusername=12312387password='312321321312kdpsa'912739lasjdsaljd198e@dkasjdlsasldjlsa");
|
|
|
return res;
|
|
|
|
|
|
@@ -83,6 +95,11 @@ public class DemandCollectionApiController extends CertifyApiController {
|
|
|
@RequestMapping(value = "/open/exportDemandCollectionList" , method = RequestMethod.GET)
|
|
|
public Result exportDemandCollectionList(HttpServletResponse response,InputDemandCollection i) {
|
|
|
Result res=new Result();
|
|
|
+ if (TokenManager.getVal2Session("skjtid")==null||!SID.equals(TokenManager.getVal2Session("skjtid"))) {
|
|
|
+ res.getError().add(buildError("权限异常","权限异常"));
|
|
|
+ return res ;
|
|
|
+
|
|
|
+ }
|
|
|
try {
|
|
|
demandCollectionService.exportDemandCollectionList( response, i);
|
|
|
} catch (Exception e) {
|