package cn.autoform.web.controller.formevent;
|
|
import java.util.List;
|
|
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.db.entity.CodeMasterEntity;
|
import cn.autoform.db.entity.FormEventEntity;
|
import cn.autoform.db.entity.FormFieldEntity;
|
import cn.autoform.fw.exception.RestResult;
|
import cn.autoform.fw.utility.RestResultGenerator;
|
import cn.autoform.web.service.formevent.FormEventService;
|
|
@RestController
|
public class FormEventController<T> {
|
|
@Autowired
|
private FormEventService formEventService= null;
|
|
/**
|
* 获取表单事件
|
* @param tenantID
|
* @param formID
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent01}", method = RequestMethod.GET)
|
public RestResult<List<FormEventEntity>> getFormEventListService(String tenantID,String formID) {
|
List<FormEventEntity> rsList = formEventService.getFormEventList(tenantID, formID);
|
return RestResultGenerator.genSuccessResult(rsList);
|
}
|
|
/**
|
* 获取表单可以添加事件的
|
* @param tenantID
|
* @param formID
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent02}", method = RequestMethod.GET)
|
public RestResult<List<FormFieldEntity>> getFieldListwithTypeService(String tenantID,String formID) {
|
List<FormFieldEntity> rsList = formEventService.getFieldListwithType(tenantID, formID);
|
return RestResultGenerator.genSuccessResult(rsList);
|
}
|
|
/**
|
*
|
* @param formID
|
* @param fieldName
|
* @param tenantID
|
* @param event
|
* @param fieldType
|
* @param eventmethod
|
* @param createUser
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent03}", method = RequestMethod.POST)
|
public RestResult<String> createFormEventService(@RequestBody FormEventEntity formEventEntity) {
|
int nRs = formEventService.createFormEvent(formEventEntity);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
/**
|
*
|
* @param formID
|
* @param fieldName
|
* @param tenantID
|
* @param event
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent04}", method = RequestMethod.GET)
|
public RestResult<String> deleteFormEventService(String formID,String fieldName, String tenantID, String event) {
|
int nRs = formEventService.deleteFormEvent(formID, fieldName, tenantID, event);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
/**
|
*
|
* @param tenantID
|
* @param formID
|
* @param columnOrderNum
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent05}", method = RequestMethod.GET)
|
public RestResult<List<CodeMasterEntity>> getFieldEventService(String tenantID,String formID,String columnOrderNum) {
|
List<CodeMasterEntity> rsList = formEventService.getFieldEventList(tenantID, formID, columnOrderNum);
|
return RestResultGenerator.genSuccessResult(rsList);
|
}
|
|
/**
|
* 获取字段事件列表
|
* @param tenantID
|
* @param formID
|
* @param fieldName
|
* @return
|
*/
|
@RequestMapping(value = "${requset.formevent06}", method = RequestMethod.GET)
|
public RestResult<List<FormEventEntity>> getEventListService(String tenantID,String formID, String fieldName) {
|
List<FormEventEntity> rsList = formEventService.getEventList(tenantID, formID, fieldName);
|
return RestResultGenerator.genSuccessResult(rsList);
|
}
|
}
|