|
|
@@ -0,0 +1,142 @@
|
|
|
+package com.goafanti.admin.controller;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+
|
|
|
+import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.controller.BaseApiController;
|
|
|
+import com.goafanti.common.model.TechProject;
|
|
|
+import com.goafanti.common.model.TechProjectLog;
|
|
|
+import com.goafanti.common.model.TechWebsite;
|
|
|
+import com.goafanti.common.utils.DateUtils;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.techproject.service.TechProjectLogService;
|
|
|
+import com.goafanti.techproject.service.TechProjectService;
|
|
|
+import com.goafanti.techproject.service.TechWebsiteService;
|
|
|
+import com.goafanti.user.service.UserService;
|
|
|
+
|
|
|
+@Controller
|
|
|
+@RequestMapping(value = "/api/admintechproject")
|
|
|
+public class AdminTechProjectController extends BaseApiController{
|
|
|
+ @Resource
|
|
|
+ private TechProjectService techProjectService;
|
|
|
+ @Resource
|
|
|
+ private TechWebsiteService techWebsiteService;
|
|
|
+ @Resource
|
|
|
+ private TechProjectLogService techProjectLogService;
|
|
|
+ @Resource
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技项目申报列表
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/listTechProject", method = RequestMethod.POST)
|
|
|
+ public Result listClientTechProject(String province, String uid, String pageNo, String pageSize){
|
|
|
+ Result res = new Result();
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(techProjectService.listManageTechProject(province, uid, pNo, pSize));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技项目申报
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/applyTechProject", method = RequestMethod.POST)
|
|
|
+ public Result applyTechProject(TechProject techProject, String uid){
|
|
|
+ Result res = new Result();
|
|
|
+ String aid = userService.selectByPrimaryKey(uid).getAid();
|
|
|
+ techProjectService.applyTechProject(techProject, uid, aid);
|
|
|
+ return res;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技项目申报详情
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/techProjectDetial", method = RequestMethod.POST)
|
|
|
+ public Result techProjectDetial(String pid){
|
|
|
+ Result res = new Result();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技项目状态流转
|
|
|
+ * @param pid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/techProjectLog", method = RequestMethod.POST)
|
|
|
+ public Result techProjectLog(String pid){
|
|
|
+ Result res = new Result();
|
|
|
+ res.setData(techProjectLogService.selectTechProjectLogByPid(pid));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * update科技项目
|
|
|
+ * @param t
|
|
|
+ * @param l
|
|
|
+ * @param recordTimeFormattedDate
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
|
|
|
+ public Result updateTechProject(TechProject t, TechProjectLog l, String recordTimeFormattedDate) throws ParseException{
|
|
|
+ Result res = new Result();
|
|
|
+ Date recordTime =null;
|
|
|
+ if (!StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
+ recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ res.setData(techProjectService.updateTechProject(t, l, recordTime));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技单位网址管理list
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/listTechWebsite", method = RequestMethod.POST)
|
|
|
+ public Result listTechWebsite(String province, String uid, String pageNo, String pageSize){
|
|
|
+ Result res = new Result();
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(techWebsiteService.listTechWebsite(province, uid, pNo, pSize));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技单位网址add+update
|
|
|
+ * @param t
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/disposeTechWebsite", method = RequestMethod.POST)
|
|
|
+ public Result disposeTechWebsite(TechWebsite t){
|
|
|
+ Result res = new Result();
|
|
|
+ res.setData(techWebsiteService.disposeTechWebsite(t));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+}
|