package cn.autoform.web.controller.forminformation;
|
|
import java.util.List;
|
import java.util.concurrent.TimeoutException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
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;
|
|
import cn.autoform.bean.page.PageResult;
|
import cn.autoform.db.entity.FormBaseEntity;
|
import cn.autoform.db.entity.FormSetEntity;
|
import cn.autoform.db.entity.FormSetInfoEntity;
|
import cn.autoform.db.entity.FormVersionEntity;
|
import cn.autoform.db.entity.TenantEntity;
|
import cn.autoform.fw.exception.FormClientException;
|
import cn.autoform.fw.exception.RestResult;
|
import cn.autoform.fw.utility.RestResultGenerator;
|
import cn.autoform.web.formula.info.Form;
|
import cn.autoform.web.request.FormBaseCopyRequestForm;
|
import cn.autoform.web.request.FormBaseUpdateRequestForm;
|
import cn.autoform.web.service.formtending.FormTendingService;
|
|
/**
|
*
|
* @author huaixun.zhang
|
*
|
*/
|
@RestController
|
public class FormInformationController {
|
|
@Autowired
|
private FormTendingService formTendingService = null;
|
|
/**
|
* 获取表单基本
|
* @param tenantID
|
* @param formID
|
* @return 表单基本
|
*/
|
@RequestMapping(value = "${requset.forminfomation01}", method = RequestMethod.POST)
|
public RestResult<FormBaseEntity> getFormBaseInfoService(@RequestBody FormBaseEntity formBaseEntity) {
|
FormBaseEntity entity = formTendingService.receiveFormBaseInfo(
|
formBaseEntity.getTenantID(), formBaseEntity.getFormID());
|
return RestResultGenerator.genSuccessResult(entity);
|
}
|
|
/**
|
* 表单集合属性管理取出数据
|
* @param tenantID
|
* @param formSetid
|
* @return 表单集合属性管理
|
*/
|
@RequestMapping(value = "${requset.forminfomation02}", method = RequestMethod.POST)
|
public RestResult<FormSetEntity> getFormSetInfoService(@RequestBody FormSetEntity formbaseEntity) {
|
FormSetEntity entity = formTendingService.receiveFormSetInfo(
|
formbaseEntity.getTenantID(), formbaseEntity.getFormSetID());
|
return RestResultGenerator.genSuccessResult(entity);
|
}
|
|
/**
|
* 表单集合取出数据
|
* @param tenantID
|
* @return 表单集合
|
*/
|
@RequestMapping(value = "${requset.forminfomation03}", method = RequestMethod.POST)
|
public RestResult<PageResult<FormSetInfoEntity>> getFormSetListService(@RequestBody TenantEntity tenant) {
|
PageResult<FormSetInfoEntity> listEntity = formTendingService.receiveFormSetListInfo(tenant.getTenantID(),
|
tenant.getPageNum(),tenant.getPageSize(),tenant.getSelectName());
|
// public RestResult<List<PageResult<FormSetInfoEntity>>> getFormSetListService(@RequestBody TenantEntity tenant) {
|
// System.out.println(tenant);
|
// List<PageResult<FormSetInfoEntity>> listEntity = formTendingService.receiveFormSetListInfo(tenant.getTenantID(),tenant.getPageNum(),tenant.getPageSize());
|
return RestResultGenerator.genSuccessResult(listEntity);
|
}
|
|
/**
|
* 表单基本修正
|
* @param entity
|
* @return
|
* @throws Exception
|
*/
|
@RequestMapping(value = "/forminfomation/modifyFormBaseService1", method = RequestMethod.POST)
|
public RestResult<Object> modifyFormBaseService1(@RequestBody FormBaseUpdateRequestForm entity) throws Exception {
|
System.out.println("进入--------------------------------");
|
formTendingService.updateFormBaseInfo(entity);
|
return RestResultGenerator.genSuccessResult(null);
|
}
|
|
|
/**
|
* 表单基本修正
|
* @param entity
|
* @return
|
* @throws Exception
|
*/
|
@RequestMapping(value = "${requset.forminfomation04}", method = RequestMethod.POST)
|
public RestResult<Object> modifyFormBaseService(@RequestBody FormBaseUpdateRequestForm entity) throws Exception{
|
System.out.println("进入--------------------------------");
|
formTendingService.updateFormBaseInfo1(entity);
|
return RestResultGenerator.genSuccessResult(null);
|
}
|
|
/**
|
* 表单集合修正
|
* @param entity
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminfomation05}", method = RequestMethod.POST)
|
public RestResult<String> modifyFormSetService(@RequestBody FormSetEntity entity) {
|
int nRs = formTendingService.updateFormSetInfo(entity);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
/**
|
* 表单基本复制
|
* @param entity
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminfomation06}", method = RequestMethod.POST)
|
public RestResult<String> copyFormBaseInfoService(@RequestBody FormBaseCopyRequestForm entity) {
|
int nRs = formTendingService.copyFormBaseInfo(entity);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
@RequestMapping(value = "${requset.forminfomation07}", method = RequestMethod.POST)
|
public RestResult<FormVersionEntity> getFormVersionInfoService(@RequestBody FormVersionEntity entity) {
|
return RestResultGenerator.genSuccessResult(formTendingService.getFormVersionInfo(entity));
|
}
|
|
/**
|
* 删除表单
|
* @param entity
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminfomation08}", method = RequestMethod.POST)
|
public RestResult<String> deleteFormSetService(@RequestBody FormSetEntity entity) {
|
int nRs = formTendingService.deleteFormSet(entity);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
}
|