|
@@ -0,0 +1,116 @@
|
|
|
+package com.sooka.module.web.cms;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import com.sooka.module.web.cms.service.ContentService;
|
|
|
+import com.sooka.module.web.cms.service.SignOnService;
|
|
|
+import com.sooka.mybatis.model.*;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Controller
|
|
|
+@RequestMapping("/system/cms/signUp")
|
|
|
+public class ContentBmAppController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ContentService contentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SignOnService signOnService;
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping
|
|
|
+ public String index(@RequestParam(value = "pageCurrent",defaultValue = "1") Integer pageNumber,
|
|
|
+ @RequestParam(value = "pageSize",defaultValue = "50") Integer pageSize,
|
|
|
+ TCmsSignOn pojo, Model model) {
|
|
|
+ PageInfo page = signOnService.page(pageNumber,pageSize,pojo);
|
|
|
+ model.addAttribute("model",page);
|
|
|
+ model.addAttribute("pojo",pojo);
|
|
|
+ return "cms/signup_list";
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/BmApp")
|
|
|
+ @ResponseBody
|
|
|
+ public Map<String, Object> contentBmApp(
|
|
|
+ @RequestParam(value = "study_name", required = false) String study_name,
|
|
|
+ @RequestParam(value = "study_ph", required = false) String study_ph,
|
|
|
+ @RequestParam(value = "study_sfz", required = false) String study_sfz,
|
|
|
+ @RequestParam(value = "study_eb", required = false) String study_eb,
|
|
|
+ @RequestParam(value = "siteId", required = false) String siteId
|
|
|
+ ) {
|
|
|
+
|
|
|
+ System.out.println("study_name==="+study_name);
|
|
|
+ System.out.println("study_ph==="+study_ph);
|
|
|
+ System.out.println("study_sfz==="+study_sfz);
|
|
|
+ System.out.println("study_eb==="+study_eb);
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ try {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("study_name", study_name);
|
|
|
+ map.put("study_ph", study_ph);
|
|
|
+ map.put("study_sfz", study_sfz);
|
|
|
+ map.put("study_eb", study_eb);
|
|
|
+ // 保存数据
|
|
|
+ int rows = contentService.contentBmApp(map);
|
|
|
+ boolean isDataSaved = rows > 0;
|
|
|
+
|
|
|
+ if (isDataSaved) {
|
|
|
+ result.put("success", true);
|
|
|
+ result.put("message", "数据保存成功!");
|
|
|
+ } else {
|
|
|
+ result.put("success", false);
|
|
|
+ result.put("message", "数据保存失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ TCmsSite site = new TCmsSite();
|
|
|
+ if (siteId!= null) {
|
|
|
+ site.setSiteId(Integer.parseInt(siteId));
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ result.put("success", false);
|
|
|
+ result.put("message", "发生错误:" + e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping("/studyBmList")
|
|
|
+ public ModelAndView studyBmList(
|
|
|
+ @RequestParam(value = "study_name", required = false) String study_name,
|
|
|
+ @RequestParam(value = "study_ph", required = false) String study_ph,
|
|
|
+ @RequestParam(value = "study_sfz", required = false) String study_sfz,
|
|
|
+ @RequestParam(value = "study_eb", required = false) String study_eb,
|
|
|
+ @RequestParam(value = "siteId", required = false) String siteId,
|
|
|
+ @RequestParam(value = "number", defaultValue = "1") Integer pageNumber) {
|
|
|
+ ModelAndView modelAndView = new ModelAndView("www/tuiyijunren/list-zslb");
|
|
|
+ try {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("study_name", study_name);
|
|
|
+ map.put("study_ph", study_ph);
|
|
|
+ map.put("study_sfz", study_sfz);
|
|
|
+ map.put("study_eb", study_eb);
|
|
|
+ map.put("siteId", siteId);
|
|
|
+ PageInfo<TCmsContent> tCmsContentPageInfo = contentService.studyBmList(pageNumber, map);
|
|
|
+ modelAndView.addObject("pageInfo", tCmsContentPageInfo);
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return modelAndView;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|