package cn.autoform.web.controller.formset;
|
|
import cn.autoform.bean.page.PageResult;
|
import cn.autoform.db.entity.FormSetInfoEntity;
|
import cn.autoform.db.exten.FormSetPage;
|
import cn.autoform.fw.exception.RestResult;
|
import cn.autoform.fw.utility.RestResultGenerator;
|
import cn.autoform.web.service.page.PageService;
|
import net.sf.json.JSONObject;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
public class FormSetController {
|
|
@Autowired
|
PageService pageService;
|
|
@Value("${tempTenantId:100000023}")
|
private String tempTenantId;
|
|
@RequestMapping(value = "${requset.formsetpage}", method = RequestMethod.POST)
|
public RestResult<PageResult<FormSetInfoEntity>> queryFormSetAndPaging(@RequestBody FormSetPage formSetPage){
|
// JSONObject jsonObj = JSONObject.fromObject(jsonStr);
|
// String tenantID = jsonObj.getString("tenantID");
|
// String businessSystem = jsonObj.getString("flag");
|
// String formName = jsonObj.getString("formName");
|
// FormSetPage formSetPage = new FormSetPage();
|
// formSetPage.setTenantID(tenantID);
|
// formSetPage.setBusinessSystem(businessSystem);
|
// formSetPage.setFormName(formName);
|
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage));
|
}
|
|
@RequestMapping(value = "search/formset/temp", method = RequestMethod.POST)
|
public RestResult<PageResult<FormSetInfoEntity>> queryFormSetTemp(@RequestBody FormSetPage formSetPage){
|
// JSONObject jsonObj = JSONObject.fromObject(jsonStr);
|
// String businessSystem = jsonObj.getString("flag");
|
// String formName = jsonObj.getString("formName");
|
// FormSetPage formSetPage = new FormSetPage();
|
formSetPage.setTenantID(tempTenantId);
|
// formSetPage.setBusinessSystem(businessSystem);
|
// formSetPage.setFormName("%" + formName + "%");
|
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage));
|
}
|
|
|
|
//暂时不使用
|
@RequestMapping(value = "${requset.formsetabis}", method = RequestMethod.POST)
|
public RestResult<String> queryFormSetBussinesssystem(@RequestBody String jsonStr) {
|
JSONObject jsonObj = JSONObject.fromObject(jsonStr);
|
String formSetID = jsonObj.getString("formSetID");
|
String tenantID = jsonObj.getString("tenantID");
|
return RestResultGenerator.genSuccessResult(this.pageService.queryFormSetBussinesssystem(formSetID, tenantID));
|
}
|
|
@RequestMapping(value = "${request.formnamepage}", method = RequestMethod.POST)
|
public RestResult<PageResult<FormSetInfoEntity>> queryFormNameAndPaging(String jsonStr) {
|
JSONObject jsonObj = JSONObject.fromObject(jsonStr);
|
Integer pageNum =jsonObj.getInt("pageNum");
|
Integer pageSize = jsonObj.getInt("pageSize");
|
String tenantID = jsonObj.getString("tenantID");
|
String businessSystem = jsonObj.getString("flag");
|
String formName = jsonObj.getString("formName");
|
FormSetPage formSetPage = new FormSetPage();
|
formSetPage.setPageNum(pageNum);
|
formSetPage.setPageSize(pageSize);
|
formSetPage.setTenantID(tenantID);
|
formSetPage.setBusinessSystem(businessSystem);
|
formSetPage.setFormName("%" + formName + "%");
|
return RestResultGenerator.genSuccessPageResult(this.pageService.queryPage(formSetPage));
|
}
|
|
|
|
}
|