|
@@ -11,10 +11,7 @@ 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.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import java.util.HashMap;
|
|
@@ -43,36 +40,25 @@ public class ContentBmAppController {
|
|
|
|
|
|
@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
|
|
|
- ) {
|
|
|
+ public Map<String, Object> contentBmApp(@RequestBody TCmsSignOn signOn) {
|
|
|
|
|
|
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);
|
|
|
+ map.put("study_name", signOn.getStudy_name());
|
|
|
+ map.put("study_ph", signOn.getStudy_ph());
|
|
|
+ map.put("study_sfz", signOn.getStudy_sfz());
|
|
|
+ map.put("study_eb", signOn.getStudy_eb());
|
|
|
// 保存数据
|
|
|
int rows = contentService.contentBmApp(map);
|
|
|
boolean isDataSaved = rows > 0;
|
|
|
|
|
|
if (isDataSaved) {
|
|
|
result.put("success", true);
|
|
|
- result.put("message", "数据保存成功!");
|
|
|
+ result.put("message", "报名成功!");
|
|
|
} else {
|
|
|
result.put("success", false);
|
|
|
- result.put("message", "数据保存失败!");
|
|
|
- }
|
|
|
-
|
|
|
- TCmsSite site = new TCmsSite();
|
|
|
- if (siteId!= null) {
|
|
|
- site.setSiteId(Integer.parseInt(siteId));
|
|
|
+ result.put("message", "报名失败!");
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|