|
|
@@ -21,6 +21,7 @@ import platform.common.base.controller.BaseController;
|
|
|
import platform.common.base.model.DictionaryItem;
|
|
|
import platform.common.base.service.DictionaryItemService;
|
|
|
import platform.common.exception.BaseException;
|
|
|
+import platform.common.util.CommonUtils;
|
|
|
import platform.common.util.ShiroUtils;
|
|
|
import platform.modules.build.entity.Company;
|
|
|
import platform.modules.build.entity.CompanyContact;
|
|
|
@@ -42,18 +43,18 @@ import platform.modules.sys.web.ResponseMessage;
|
|
|
|
|
|
/**
|
|
|
* 企业 项目申报controler
|
|
|
- * @author yl
|
|
|
*
|
|
|
+ * @author yl
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("/projectApplication")
|
|
|
-public class ProjectApplicationController extends BaseController{
|
|
|
+public class ProjectApplicationController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private CompanyService companyService;
|
|
|
+ @Autowired
|
|
|
+ private CompanyService companyService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ProjectApplicationService projectApplicationService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectApplicationService projectApplicationService;
|
|
|
|
|
|
@Autowired
|
|
|
private ProjectDeclarationService projectDeclarationService;
|
|
|
@@ -62,72 +63,73 @@ public class ProjectApplicationController extends BaseController{
|
|
|
private NoticesAcceptService noticesAcceptService;
|
|
|
|
|
|
@Autowired
|
|
|
- private DictionaryItemService dictionaryItemService;
|
|
|
+ private DictionaryItemService dictionaryItemService;
|
|
|
|
|
|
@Autowired
|
|
|
private CompanyContactService companyContactService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ProjectApplicationCompanyInfoService projectApplicationCompanyInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectApplicationCompanyInfoService projectApplicationCompanyInfoService;
|
|
|
|
|
|
|
|
|
- @OperationLog(value="查看项目申报推送列表")
|
|
|
- @GetMapping(value = "/declaration/list")
|
|
|
- public String declarationList(ModelMap modelMap, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, String projectName,
|
|
|
- String startTime1, String startTime2, String endTime1, String endTime2){
|
|
|
+ @OperationLog(value = "查看项目申报推送列表")
|
|
|
+ @GetMapping(value = "/declaration/list")
|
|
|
+ public String declarationList(ModelMap modelMap, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, String projectName,
|
|
|
+ String startTime1, String startTime2, String endTime1, String endTime2) {
|
|
|
|
|
|
- PageInfo<ProjectDeclaration> pageInfo = projectDeclarationService.findByCompany(projectName,pageNum,PAGESIZE,startTime1,startTime2,endTime1,endTime2);
|
|
|
+ PageInfo<ProjectDeclaration> pageInfo = projectDeclarationService.findByCompany(projectName, pageNum, PAGESIZE, startTime1, startTime2, endTime1, endTime2);
|
|
|
|
|
|
|
|
|
- modelMap.put("pageInfo",pageInfo);
|
|
|
- modelMap.put("projectName",projectName);
|
|
|
- modelMap.put("startTime1",startTime1);
|
|
|
- modelMap.put("startTime2",startTime2);
|
|
|
- modelMap.put("endTime1",endTime1);
|
|
|
- modelMap.put("endTime2",endTime2);
|
|
|
- return BASE_COMPANY_PATH + "projectApplication/declaration_list";
|
|
|
+ modelMap.put("pageInfo", pageInfo);
|
|
|
+ modelMap.put("projectName", projectName);
|
|
|
+ modelMap.put("startTime1", startTime1);
|
|
|
+ modelMap.put("startTime2", startTime2);
|
|
|
+ modelMap.put("endTime1", endTime1);
|
|
|
+ modelMap.put("endTime2", endTime2);
|
|
|
+ return BASE_COMPANY_PATH + "projectApplication/declaration_list";
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- @OperationLog(value="查看可申报项目列表")
|
|
|
- @GetMapping(value = "/declaration/list/active")
|
|
|
- public String declarationListActive(ModelMap modelMap, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, String projectName,
|
|
|
- String startTime1, String startTime2, String endTime1, String endTime2){
|
|
|
+ @OperationLog(value = "查看可申报项目列表")
|
|
|
+ @GetMapping(value = "/declaration/list/active")
|
|
|
+ public String declarationListActive(ModelMap modelMap, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, String projectName,
|
|
|
+ String startTime1, String startTime2, String endTime1, String endTime2) {
|
|
|
|
|
|
- PageInfo<ProjectDeclaration> pageInfo = projectDeclarationService.findActive(projectName,pageNum,PAGESIZE,startTime1,startTime2,endTime1,endTime2);
|
|
|
+ PageInfo<ProjectDeclaration> pageInfo = projectDeclarationService.findActive(projectName, pageNum, PAGESIZE, startTime1, startTime2, endTime1, endTime2);
|
|
|
|
|
|
|
|
|
- modelMap.put("pageInfo",pageInfo);
|
|
|
- modelMap.put("projectName",projectName);
|
|
|
- modelMap.put("startTime1",startTime1);
|
|
|
- modelMap.put("startTime2",startTime2);
|
|
|
- modelMap.put("endTime1",endTime1);
|
|
|
- modelMap.put("endTime2",endTime2);
|
|
|
- return BASE_COMPANY_PATH + "projectApplication/declaration_list";
|
|
|
+ modelMap.put("pageInfo", pageInfo);
|
|
|
+ modelMap.put("projectName", projectName);
|
|
|
+ modelMap.put("startTime1", startTime1);
|
|
|
+ modelMap.put("startTime2", startTime2);
|
|
|
+ modelMap.put("endTime1", endTime1);
|
|
|
+ modelMap.put("endTime2", endTime2);
|
|
|
+ return BASE_COMPANY_PATH + "projectApplication/declaration_list";
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 项目申报申请列表
|
|
|
- * @param pageNum
|
|
|
- * @param keyword
|
|
|
- * @param modelMap
|
|
|
- * @return
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- @OperationLog(value="查看项目申报列表")
|
|
|
- @GetMapping(value = "/list")
|
|
|
+ /**
|
|
|
+ * 项目申报申请列表
|
|
|
+ *
|
|
|
+ * @param pageNum
|
|
|
+ * @param keyword
|
|
|
+ * @param modelMap
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @OperationLog(value = "查看项目申报列表")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
public String list(
|
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
String keyword, ModelMap modelMap, ProjectApplicationSearchCondition searchCondition) throws Exception {
|
|
|
try {
|
|
|
log.debug("分页查询内容列表参数! pageNum = {}, contentname = {}", pageNum, keyword);
|
|
|
- PageInfo<ProjectApplication> pageInfo = projectApplicationService.findPage(pageNum, PAGESIZE, keyword,searchCondition);
|
|
|
+ PageInfo<ProjectApplication> pageInfo = projectApplicationService.findPage(pageNum, PAGESIZE, keyword, searchCondition);
|
|
|
log.info("分页查询内容列表结果! pageInfo = {}", pageInfo);
|
|
|
modelMap.put("pageInfo", pageInfo);
|
|
|
modelMap.put("keyword", keyword);
|
|
|
modelMap.put("user_type", ShiroUtils.getUserType());
|
|
|
- modelMap.put("searchCondition", searchCondition==null ? new ProjectApplication():searchCondition);
|
|
|
+ modelMap.put("searchCondition", searchCondition == null ? new ProjectApplication() : searchCondition);
|
|
|
modelMap.put("project_year", searchCondition.getProject_year());
|
|
|
projectApplicationService.getDictInfo(modelMap);
|
|
|
} catch (Exception e) {
|
|
|
@@ -136,207 +138,241 @@ public class ProjectApplicationController extends BaseController{
|
|
|
return BASE_COMPANY_PATH + "projectApplication/apply_list";
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 跳转到项目申报新增页面
|
|
|
- * @param modelMap
|
|
|
- * @param companyId
|
|
|
- * @param companyName
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/add/{declarationId}")
|
|
|
- public String add(ModelMap modelMap,@PathVariable("declarationId") Integer declarationId,
|
|
|
- @RequestParam(value = "companyId", required = false) Integer companyId,@RequestParam(value = "companyName", required = false) String companyName){
|
|
|
- log.info("跳转到项目申报申请新增页面!");
|
|
|
-
|
|
|
- if(ShiroUtils.getUserType().equals(Constant.UserType.COMPANY)) {
|
|
|
- companyId = ShiroUtils.getCompanyId();
|
|
|
- noticesAcceptService.updateReadStatus(declarationId);
|
|
|
- }
|
|
|
-
|
|
|
- modelMap.put("companyId", companyId);
|
|
|
- Company company = companyService.findCompanyInfo(companyId);
|
|
|
- List<CompanyContact> list = new ArrayList<CompanyContact>();
|
|
|
- if(null != companyContactService.findSendSMSContactByCompanyId(companyId)) {
|
|
|
- list.add(companyContactService.findSendSMSContactByCompanyId(companyId));
|
|
|
- }else {
|
|
|
- list.add(new CompanyContact());
|
|
|
+ /**
|
|
|
+ * 跳转到项目申报新增页面
|
|
|
+ *
|
|
|
+ * @param modelMap
|
|
|
+ * @param companyId
|
|
|
+ * @param companyName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/add/{declarationId}")
|
|
|
+ public String add(ModelMap modelMap, @PathVariable("declarationId") Integer declarationId,
|
|
|
+ @RequestParam(value = "companyId", required = false) Integer companyId, @RequestParam(value = "companyName", required = false) String companyName) {
|
|
|
+ log.info("跳转到项目申报申请新增页面!");
|
|
|
+
|
|
|
+ if (ShiroUtils.getUserType().equals(Constant.UserType.COMPANY)) {
|
|
|
+ companyId = ShiroUtils.getCompanyId();
|
|
|
+ noticesAcceptService.updateReadStatus(declarationId);
|
|
|
}
|
|
|
- company.setCompanyContacts(list);
|
|
|
|
|
|
- ProjectApplicationCompanyInfo companyInfo = projectApplicationCompanyInfoService.getCompanyInfoByCompanyId(companyId);
|
|
|
- modelMap.put("companyInfo", companyInfo);
|
|
|
- modelMap.put("declaration_id", declarationId);
|
|
|
- modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
- modelMap.put("fileUrl", setFileUrl());
|
|
|
- modelMap.put("instructionUrl", setFileUrl()+"/docs/annex_template/项目类别说明.xlsx");
|
|
|
+ modelMap.put("companyId", companyId);
|
|
|
+ Company company = companyService.findCompanyInfo(companyId);
|
|
|
+ List<CompanyContact> list = new ArrayList<CompanyContact>();
|
|
|
+ if (null != companyContactService.findSendSMSContactByCompanyId(companyId)) {
|
|
|
+ list.add(companyContactService.findSendSMSContactByCompanyId(companyId));
|
|
|
+ } else {
|
|
|
+ list.add(new CompanyContact());
|
|
|
+ }
|
|
|
+ company.setCompanyContacts(list);
|
|
|
+
|
|
|
+ ProjectApplicationCompanyInfo companyInfo = projectApplicationCompanyInfoService.getCompanyInfoByCompanyId(companyId);
|
|
|
+ modelMap.put("companyInfo", companyInfo);
|
|
|
+ modelMap.put("declaration_id", declarationId);
|
|
|
+ modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
+ modelMap.put("fileUrl", setFileUrl());
|
|
|
+ modelMap.put("instructionUrl", setFileUrl() + "/docs/annex_template/项目类别说明.xlsx");
|
|
|
|
|
|
- //经营数据年份
|
|
|
- modelMap.put("operationsInfo", projectApplicationService.getOperationsInfo(companyId,null));
|
|
|
+ //经营数据年份
|
|
|
+ modelMap.put("operationsInfo", projectApplicationService.getOperationsInfo(companyId, null));
|
|
|
|
|
|
projectApplicationService.getDictInfo(modelMap);
|
|
|
- //查询行业类型
|
|
|
- List<DictionaryItem> industryTypeList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRY_TYPE);
|
|
|
- modelMap.put("industryTypeList", industryTypeList);
|
|
|
- return BASE_COMPANY_PATH + "projectApplication/apply_add";
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 跳转到项目申报新增页面
|
|
|
- * @param modelMap
|
|
|
- * @param apply_id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/edit/{id}")
|
|
|
- public String edit(ModelMap modelMap,@PathVariable("id") Integer apply_id){
|
|
|
- log.info("跳转到项目申报编辑页面!");
|
|
|
-
|
|
|
- projectApplicationService.getApplyInfo(apply_id,modelMap);
|
|
|
-
|
|
|
- projectApplicationService.getDictInfo(modelMap);
|
|
|
-
|
|
|
- modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
- modelMap.put("fileUrl", setFileUrl());
|
|
|
- modelMap.put("instructionUrl", setFileUrl()+"/docs/annex_template/项目类别说明.xlsx");
|
|
|
- //查询行业类型
|
|
|
- List<DictionaryItem> industryTypeList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRY_TYPE);
|
|
|
- modelMap.put("industryTypeList", industryTypeList);
|
|
|
- return BASE_COMPANY_PATH + "projectApplication/apply_edit";
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 跳转到项目申报查看页面
|
|
|
- * @param modelMap
|
|
|
- * @param apply_id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @OperationLog(value="查看项目申报详情")
|
|
|
- @GetMapping(value = "/check/{id}")
|
|
|
- public String check(ModelMap modelMap,@PathVariable("id") Integer apply_id){
|
|
|
- log.info("跳转到项目申报编辑页面!");
|
|
|
-
|
|
|
- projectApplicationService.getApplyInfo(apply_id,modelMap);
|
|
|
+ //查询行业类型
|
|
|
+ List<DictionaryItem> industryTypeList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRY_TYPE);
|
|
|
+ modelMap.put("industryTypeList", industryTypeList);
|
|
|
+ return BASE_COMPANY_PATH + "projectApplication/apply_add";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转到项目申报新增页面
|
|
|
+ *
|
|
|
+ * @param modelMap
|
|
|
+ * @param apply_id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/edit/{id}")
|
|
|
+ public String edit(ModelMap modelMap, @PathVariable("id") Integer apply_id) {
|
|
|
+ log.info("跳转到项目申报编辑页面!");
|
|
|
+
|
|
|
+ projectApplicationService.getApplyInfo(apply_id, modelMap);
|
|
|
|
|
|
projectApplicationService.getDictInfo(modelMap);
|
|
|
|
|
|
- modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
- modelMap.put("fileUrl", setFileUrl());
|
|
|
- return BASE_COMPANY_PATH + "projectApplication/apply_check";
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 保存申请
|
|
|
- * @return
|
|
|
- */
|
|
|
- @OperationLog(value="新增项目申报")
|
|
|
- @PostMapping(value = "/save")
|
|
|
- @ResponseBody
|
|
|
- public ResponseMessage applySave(ModelMap modelMap,ProjectApplication apply){
|
|
|
- log.info("申请保存!");
|
|
|
- try {
|
|
|
- Boolean flag = false;
|
|
|
- if(null == apply.getProject_id() ){
|
|
|
- return ResponseMessage.error("请选择项目!");
|
|
|
- }
|
|
|
- if (apply.getId() == null) {
|
|
|
- if(!projectApplicationService.canApplyProject(apply)) {
|
|
|
- return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
- }
|
|
|
- flag = projectApplicationService.saveProjectApply(apply);
|
|
|
- } else {
|
|
|
- if(!projectApplicationService.canApplyProject(apply)) {
|
|
|
- return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
- }
|
|
|
- flag = projectApplicationService.updateProjectApply(apply);
|
|
|
- }
|
|
|
- if (flag) {
|
|
|
- return ResponseMessage.success("保存成功! 请到 企业后台--政务服务--项目申报--区级工业经济扶持 查看");
|
|
|
- }
|
|
|
- }catch(BaseException e) {
|
|
|
- return ResponseMessage.error(e.getMessage());
|
|
|
- }catch(Exception e) {
|
|
|
- e.getStackTrace();
|
|
|
- }
|
|
|
- return ResponseMessage.error("保存失败!");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 是否可以申请
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping(value = "/canApply")
|
|
|
- @ResponseBody
|
|
|
- public Boolean canApply(ModelMap modelMap,Integer project_id){
|
|
|
- log.info("是否可以申请!");
|
|
|
- try {
|
|
|
- ProjectApplication apply = new ProjectApplication();
|
|
|
- apply.setProject_id(project_id);
|
|
|
- if(!projectApplicationService.canApplyProject(apply)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }catch(Exception e) {
|
|
|
- e.getStackTrace();
|
|
|
- }
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除申请
|
|
|
- * @return
|
|
|
- */
|
|
|
- @OperationLog(value="删除项目申报")
|
|
|
- @DeleteMapping(value = "/delete/{id}")
|
|
|
- @ResponseBody
|
|
|
- public ResponseMessage deleteApply(ModelMap modelMap,@PathVariable("id") Integer id){
|
|
|
- log.info("项目申报删除!");
|
|
|
- try {
|
|
|
- ProjectApplication apply = projectApplicationService.findById(id);
|
|
|
- if (null != apply) {
|
|
|
- apply.setDel_flag(true);
|
|
|
- projectApplicationService.updateSelective(apply);
|
|
|
- return ResponseMessage.success("操作成功!");
|
|
|
- }
|
|
|
- }catch(BaseException e) {
|
|
|
- return ResponseMessage.error(e.getMessage());
|
|
|
- }catch(Exception e) {
|
|
|
- e.getStackTrace();
|
|
|
- }
|
|
|
- return ResponseMessage.error("操作失败!");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 保存申请
|
|
|
- * @return
|
|
|
- */
|
|
|
- @OperationLog(value="生成企业项目申报附件1、3、4")
|
|
|
- @PostMapping(value = "/createFile")
|
|
|
- @ResponseBody
|
|
|
- public ResponseMessage createFile(ProjectApplication apply){
|
|
|
- log.info("生成附件!");
|
|
|
- try {
|
|
|
- if(null == apply.getProject_id() ){
|
|
|
- return ResponseMessage.error("请选择项目!");
|
|
|
- }
|
|
|
- if(!projectApplicationService.canApplyProject(apply)) {
|
|
|
- return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
- }
|
|
|
- //开始生产附件
|
|
|
- List<FileDown> fileDowns = projectApplicationService.createFile(apply);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
+ modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
+ modelMap.put("fileUrl", setFileUrl());
|
|
|
+ modelMap.put("instructionUrl", setFileUrl() + "/docs/annex_template/项目类别说明.xlsx");
|
|
|
+ //查询行业类型
|
|
|
+ List<DictionaryItem> industryTypeList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRY_TYPE);
|
|
|
+ modelMap.put("industryTypeList", industryTypeList);
|
|
|
+ return BASE_COMPANY_PATH + "projectApplication/apply_edit";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转到项目申报查看页面
|
|
|
+ *
|
|
|
+ * @param modelMap
|
|
|
+ * @param apply_id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "查看项目申报详情")
|
|
|
+ @GetMapping(value = "/check/{id}")
|
|
|
+ public String check(ModelMap modelMap, @PathVariable("id") Integer apply_id) {
|
|
|
+ log.info("跳转到项目申报编辑页面!");
|
|
|
+
|
|
|
+ projectApplicationService.getApplyInfo(apply_id, modelMap);
|
|
|
+
|
|
|
+ projectApplicationService.getDictInfo(modelMap);
|
|
|
+
|
|
|
+ modelMap.put("userType", ShiroUtils.getUserType());
|
|
|
+ modelMap.put("fileUrl", setFileUrl());
|
|
|
+ return BASE_COMPANY_PATH + "projectApplication/apply_check";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存申请
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "新增项目申报")
|
|
|
+ @PostMapping(value = "/save")
|
|
|
+ @ResponseBody
|
|
|
+ public ResponseMessage applySave(ModelMap modelMap, ProjectApplication apply) {
|
|
|
+ log.info("申请保存!");
|
|
|
+ try {
|
|
|
+ Boolean flag = false;
|
|
|
+ if (null == apply.getProject_id()) {
|
|
|
+ return ResponseMessage.error("请选择项目!");
|
|
|
+ }
|
|
|
+ if (apply.getId() == null) {
|
|
|
+ if (!projectApplicationService.canApplyProject(apply)) {
|
|
|
+ return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
+ }
|
|
|
+ flag = projectApplicationService.saveProjectApply(apply);
|
|
|
+ } else {
|
|
|
+ if (!projectApplicationService.canApplyProject(apply)) {
|
|
|
+ return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
+ }
|
|
|
+ flag = projectApplicationService.updateProjectApply(apply);
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ return ResponseMessage.success("保存成功! 请到 企业后台--政务服务--项目申报--区级工业经济扶持 查看");
|
|
|
+ }
|
|
|
+ } catch (BaseException e) {
|
|
|
+ return ResponseMessage.error(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getStackTrace();
|
|
|
+ }
|
|
|
+ return ResponseMessage.error("保存失败!");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否可以申请
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/canApply")
|
|
|
+ @ResponseBody
|
|
|
+ public Boolean canApply(ModelMap modelMap, Integer project_id) {
|
|
|
+ log.info("是否可以申请!");
|
|
|
+ try {
|
|
|
+ ProjectApplication apply = new ProjectApplication();
|
|
|
+ apply.setProject_id(project_id);
|
|
|
+ if (!projectApplicationService.canApplyProject(apply)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getStackTrace();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除申请
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "删除项目申报")
|
|
|
+ @DeleteMapping(value = "/delete/{id}")
|
|
|
+ @ResponseBody
|
|
|
+ public ResponseMessage deleteApply(ModelMap modelMap, @PathVariable("id") Integer id) {
|
|
|
+ log.info("项目申报删除!");
|
|
|
+ try {
|
|
|
+ ProjectApplication apply = projectApplicationService.findById(id);
|
|
|
+ if (null != apply) {
|
|
|
+ apply.setDel_flag(true);
|
|
|
+ projectApplicationService.updateSelective(apply);
|
|
|
+ return ResponseMessage.success("操作成功!");
|
|
|
+ }
|
|
|
+ } catch (BaseException e) {
|
|
|
+ return ResponseMessage.error(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getStackTrace();
|
|
|
+ }
|
|
|
+ return ResponseMessage.error("操作失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否有草稿
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "是否有草稿")
|
|
|
+ @GetMapping(value = "/hasDraft")
|
|
|
+ @ResponseBody
|
|
|
+ public ResponseMessage hasDraft() {
|
|
|
+ log.info("是否有草稿!");
|
|
|
+ try {
|
|
|
+ ProjectApplication projectApplication = new ProjectApplication();
|
|
|
+ projectApplication.setDel_flag(false);
|
|
|
+ projectApplication.setApply_status("0");
|
|
|
+ projectApplication.setCompany_id(ShiroUtils.getCompanyId());
|
|
|
+ List<ProjectApplication> apply = projectApplicationService.findListByWhere(projectApplication);
|
|
|
+ if (CommonUtils.isNotNull(apply)) {
|
|
|
+ return ResponseMessage.success("操作成功!");
|
|
|
+ }
|
|
|
+ } catch (BaseException e) {
|
|
|
+ return ResponseMessage.error(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getStackTrace();
|
|
|
+ }
|
|
|
+ return ResponseMessage.error("操作失败!");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存申请
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "生成企业项目申报附件1、3、4")
|
|
|
+ @PostMapping(value = "/createFile")
|
|
|
+ @ResponseBody
|
|
|
+ public ResponseMessage createFile(ProjectApplication apply) {
|
|
|
+ log.info("生成附件!");
|
|
|
+ try {
|
|
|
+ if (null == apply.getProject_id()) {
|
|
|
+ return ResponseMessage.error("请选择项目!");
|
|
|
+ }
|
|
|
+ if (!projectApplicationService.canApplyProject(apply)) {
|
|
|
+ return ResponseMessage.error("您已经申请过该项目或互斥的项目,请勿重复提交!");
|
|
|
+ }
|
|
|
+ //开始生产附件
|
|
|
+ List<FileDown> fileDowns = projectApplicationService.createFile(apply);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
// map.put("draftId", draftId);
|
|
|
- map.put("file_url", setFileUrl());
|
|
|
- map.put("fileDowns", fileDowns);
|
|
|
- return ResponseMessage.success("success", map);
|
|
|
- }catch(BaseException e) {
|
|
|
- return ResponseMessage.error(e.getMessage());
|
|
|
- }catch(Exception e) {
|
|
|
- e.getStackTrace();
|
|
|
- }
|
|
|
- return ResponseMessage.error("保存失败!");
|
|
|
-
|
|
|
- }
|
|
|
+ map.put("file_url", setFileUrl());
|
|
|
+ map.put("fileDowns", fileDowns);
|
|
|
+ return ResponseMessage.success("success", map);
|
|
|
+ } catch (BaseException e) {
|
|
|
+ return ResponseMessage.error(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getStackTrace();
|
|
|
+ }
|
|
|
+ return ResponseMessage.error("保存失败!");
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|