|
|
@@ -84,7 +84,10 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
List<TechProjectManageListBo> l = (List<TechProjectManageListBo>) t.getList();
|
|
|
for (TechProjectManageListBo w : l) {
|
|
|
if (!StringUtils.isBlank(w.getPassword())) {
|
|
|
- w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
|
|
|
+ try {
|
|
|
+ w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
t.setList(l);
|
|
|
@@ -174,7 +177,8 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
|
|
|
- public Result updateTechProject(@Valid InputTechProject techProject, @Valid InputTechProjectLog log, BindingResult bindingResult, String recordTimeFormattedDate) {
|
|
|
+ public Result updateTechProject(@Valid InputTechProject techProject, @Valid InputTechProjectLog log,
|
|
|
+ BindingResult bindingResult, String recordTimeFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
@@ -184,18 +188,18 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isBlank(techProject.getId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技申报项目", "科技项目申报ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TechProject t = techProjectService.selectByPrimaryKey(techProject.getId());
|
|
|
- if (null == t){
|
|
|
+ if (null == t) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到申报项目", "科技项目申报"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Date recordTime = null;
|
|
|
if (!StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
try {
|
|
|
@@ -203,7 +207,7 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TechProject tp = new TechProject();
|
|
|
TechProjectLog tpl = new TechProjectLog();
|
|
|
tp.setId(techProject.getId());
|
|
|
@@ -277,8 +281,11 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
List<TechWebsiteListBo> l = (List<TechWebsiteListBo>) t.getList();
|
|
|
for (TechWebsiteListBo w : l) {
|
|
|
if (!StringUtils.isBlank(w.getPassword())) {
|
|
|
+ try {
|
|
|
w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
|
|
|
- //w.setPassword(Base64Utils.decodeData(w.getPassword()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ // w.setPassword(Base64Utils.decodeData(w.getPassword()));
|
|
|
}
|
|
|
}
|
|
|
t.setList(l);
|
|
|
@@ -294,7 +301,7 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/techWebsiteDetail", method = RequestMethod.POST)
|
|
|
- public Result techWebsiteDetail(String id) {
|
|
|
+ public Result techWebsiteDetail(String id) {
|
|
|
Result res = new Result();
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
@@ -304,13 +311,17 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
} else {
|
|
|
TechWebsiteDetailBo w = techWebsiteService.selectTechWebsiteDetail(id);
|
|
|
if (null != w && !StringUtils.isBlank(w.getPassword())) {
|
|
|
+ try {
|
|
|
w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- /*if (null != w && !StringUtils.isBlank(w.getPassword())) {
|
|
|
- w.setPassword(Base64Utils.decodeData(w.getPassword()));
|
|
|
- }*/
|
|
|
- res.setData(w);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * if (null != w && !StringUtils.isBlank(w.getPassword())) {
|
|
|
+ * w.setPassword(Base64Utils.decodeData(w.getPassword())); }
|
|
|
+ */
|
|
|
+ res.setData(w);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -322,7 +333,7 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeTechWebsite", method = RequestMethod.POST)
|
|
|
- public Result disposeTechWebsite(@Valid InputTechWebsite w, BindingResult bindingResult) {
|
|
|
+ public Result disposeTechWebsite(@Valid InputTechWebsite w, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
@@ -332,34 +343,39 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isBlank(w.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
User curUser = userService.selectByPrimaryKey(w.getUid());
|
|
|
if (!checkCertify(res, curUser)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- /*if (null != w && null != (w.getPassword())) {
|
|
|
- w.setPassword(Base64Utils.encodeData(w.getPassword().trim()));
|
|
|
- }*/
|
|
|
-
|
|
|
+
|
|
|
+ /*
|
|
|
+ * if (null != w && null != (w.getPassword())) {
|
|
|
+ * w.setPassword(Base64Utils.encodeData(w.getPassword().trim())); }
|
|
|
+ */
|
|
|
+
|
|
|
if (null != w && null != (w.getPassword())) {
|
|
|
+ try {
|
|
|
w.setPassword(AesUtils.encrypt(w.getPassword().trim(), aesSecretKey));
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TechWebsite tw = new TechWebsite();
|
|
|
BeanUtils.copyProperties(w, tw);
|
|
|
-
|
|
|
+
|
|
|
res.setData(techWebsiteService.saveWebsite(tw));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 科技项目申报材料上传
|
|
|
+ *
|
|
|
* @param req
|
|
|
* @param uid
|
|
|
* @return
|
|
|
@@ -374,14 +390,15 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
if (!checkCertify(res, curUser)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
String sign = "tech_project";
|
|
|
res.setData(handleFiles(res, "/techProject/", true, req, sign, uid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 下载科技项目材料
|
|
|
+ *
|
|
|
* @param response
|
|
|
* @param fileName
|
|
|
* @param path
|
|
|
@@ -389,23 +406,23 @@ public class AdminTechProjectController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/download", method = RequestMethod.GET)
|
|
|
- public Result download(HttpServletResponse response, String id){
|
|
|
+ public Result download(HttpServletResponse response, String id) {
|
|
|
Result res = new Result();
|
|
|
if (!checkUserLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isEmpty(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TechProject t = techProjectService.selectByPrimaryKey(id);
|
|
|
- if (null == t){
|
|
|
+ if (null == t) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
downloadFile(response, t.getApprovalDownloadFileName(), t.getApprovalUrl());
|
|
|
return res;
|
|
|
}
|