commit | author | age
|
a18bfa
|
1 |
package cn.autoform.web.controller.formset; |
Z |
2 |
|
|
3 |
import cn.autoform.bean.page.PageResult; |
|
4 |
import cn.autoform.db.entity.FormSetInfoEntity; |
|
5 |
import cn.autoform.db.exten.FormSetPage; |
|
6 |
import cn.autoform.fw.exception.RestResult; |
|
7 |
import cn.autoform.fw.utility.RestResultGenerator; |
|
8 |
import cn.autoform.web.service.page.PageService; |
|
9 |
import net.sf.json.JSONObject; |
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
|
11 |
import org.springframework.beans.factory.annotation.Value; |
|
12 |
import org.springframework.web.bind.annotation.RequestBody; |
|
13 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
14 |
import org.springframework.web.bind.annotation.RequestMethod; |
|
15 |
import org.springframework.web.bind.annotation.RestController; |
|
16 |
|
|
17 |
@RestController |
|
18 |
public class FormSetController { |
|
19 |
|
|
20 |
@Autowired |
|
21 |
PageService pageService; |
|
22 |
|
|
23 |
@Value("${tempTenantId:100000023}") |
|
24 |
private String tempTenantId; |
|
25 |
|
|
26 |
@RequestMapping(value = "${requset.formsetpage}", method = RequestMethod.POST) |
|
27 |
public RestResult<PageResult<FormSetInfoEntity>> queryFormSetAndPaging(@RequestBody FormSetPage formSetPage){ |
|
28 |
// JSONObject jsonObj = JSONObject.fromObject(jsonStr); |
|
29 |
// String tenantID = jsonObj.getString("tenantID"); |
|
30 |
// String businessSystem = jsonObj.getString("flag"); |
|
31 |
// String formName = jsonObj.getString("formName"); |
|
32 |
// FormSetPage formSetPage = new FormSetPage(); |
|
33 |
// formSetPage.setTenantID(tenantID); |
|
34 |
// formSetPage.setBusinessSystem(businessSystem); |
|
35 |
// formSetPage.setFormName(formName); |
|
36 |
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage)); |
|
37 |
} |
|
38 |
|
|
39 |
@RequestMapping(value = "search/formset/temp", method = RequestMethod.POST) |
|
40 |
public RestResult<PageResult<FormSetInfoEntity>> queryFormSetTemp(@RequestBody FormSetPage formSetPage){ |
|
41 |
// JSONObject jsonObj = JSONObject.fromObject(jsonStr); |
|
42 |
// String businessSystem = jsonObj.getString("flag"); |
|
43 |
// String formName = jsonObj.getString("formName"); |
|
44 |
// FormSetPage formSetPage = new FormSetPage(); |
|
45 |
formSetPage.setTenantID(tempTenantId); |
|
46 |
// formSetPage.setBusinessSystem(businessSystem); |
|
47 |
// formSetPage.setFormName("%" + formName + "%"); |
|
48 |
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage)); |
|
49 |
} |
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
//暂时不使用 |
|
54 |
@RequestMapping(value = "${requset.formsetabis}", method = RequestMethod.POST) |
|
55 |
public RestResult<String> queryFormSetBussinesssystem(@RequestBody String jsonStr) { |
|
56 |
JSONObject jsonObj = JSONObject.fromObject(jsonStr); |
|
57 |
String formSetID = jsonObj.getString("formSetID"); |
|
58 |
String tenantID = jsonObj.getString("tenantID"); |
|
59 |
return RestResultGenerator.genSuccessResult(this.pageService.queryFormSetBussinesssystem(formSetID, tenantID)); |
|
60 |
} |
|
61 |
|
|
62 |
@RequestMapping(value = "${request.formnamepage}", method = RequestMethod.POST) |
|
63 |
public RestResult<PageResult<FormSetInfoEntity>> queryFormNameAndPaging(String jsonStr) { |
|
64 |
JSONObject jsonObj = JSONObject.fromObject(jsonStr); |
|
65 |
Integer pageNum =jsonObj.getInt("pageNum"); |
|
66 |
Integer pageSize = jsonObj.getInt("pageSize"); |
|
67 |
String tenantID = jsonObj.getString("tenantID"); |
|
68 |
String businessSystem = jsonObj.getString("flag"); |
|
69 |
String formName = jsonObj.getString("formName"); |
|
70 |
FormSetPage formSetPage = new FormSetPage(); |
|
71 |
formSetPage.setPageNum(pageNum); |
|
72 |
formSetPage.setPageSize(pageSize); |
|
73 |
formSetPage.setTenantID(tenantID); |
|
74 |
formSetPage.setBusinessSystem(businessSystem); |
|
75 |
formSetPage.setFormName("%" + formName + "%"); |
|
76 |
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage)); |
|
77 |
} |
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
} |