|
|
@ -2,12 +2,12 @@ package cn.estsh.i3plus.core.apiservice.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.icloud.form.sdk.IFormDynamicFormCloud;
|
|
|
|
import cn.estsh.i3plus.icloud.form.sdk.IFormDynamicFormCloud;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.dynamic.DynamicEntity;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.BlockFormEnumUtil;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataObject;
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataObject;
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataObjectProperty;
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataObjectProperty;
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataSource;
|
|
|
|
import cn.estsh.i3plus.pojo.form.bean.BfDataSource;
|
|
|
|
import cn.estsh.i3plus.pojo.model.form.CloudFormModel;
|
|
|
|
import cn.estsh.i3plus.pojo.model.form.CloudFormModel;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
@ -17,10 +17,8 @@ import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import sun.swing.BakedArrayList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
@ -41,6 +39,13 @@ public class DemoDynamicFormController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IFormDynamicFormCloud formDynamicFormCloud;
|
|
|
|
private IFormDynamicFormCloud formDynamicFormCloud;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static CloudFormModel model = null;
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
|
|
|
model = new CloudFormModel();
|
|
|
|
|
|
|
|
model.setSourceCode("form_test");
|
|
|
|
|
|
|
|
model.setDataObjectCode("sys_config");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 测试数据源信息
|
|
|
|
* 测试数据源信息
|
|
|
|
* ip:192.168.1.55
|
|
|
|
* ip:192.168.1.55
|
|
|
@ -71,224 +76,217 @@ public class DemoDynamicFormController {
|
|
|
|
return ResultBean.success("查询成功").setResultObject(baseResultBean.getResultObject()).setResultList(dataObjectList.getResultList());
|
|
|
|
return ResultBean.success("查询成功").setResultObject(baseResultBean.getResultObject()).setResultList(dataObjectList.getResultList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/dynamic-entity/insert")
|
|
|
|
|
|
|
|
@ApiOperation(value = "新增数据",notes = "插入单条数据")
|
|
|
|
|
|
|
|
public BaseResultBean insert(){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Map<String,Object> insert = new HashedMap();
|
|
|
|
|
|
|
|
insert.put("sid",111);
|
|
|
|
|
|
|
|
insert.put("configType",111);
|
|
|
|
|
|
|
|
insert.put("configValue",111);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.setInsert(insert);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return formDynamicFormCloud.insert(model);
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据条件查询动态数据
|
|
|
|
* 插入单条数据
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/find-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/insert-batch")
|
|
|
|
@ApiOperation("根据条件查询动态数据")
|
|
|
|
@ApiOperation(value = "新增数据",notes = "插入单条数据")
|
|
|
|
public ResultBean findDynamicEntity(){
|
|
|
|
public BaseResultBean insertBatch(){
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
try {
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
List<Map<String,Object>> insertList = new ArrayList<>();
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
Map<String,Object> insert1 = new HashedMap();
|
|
|
|
|
|
|
|
insert1.put("sid",222);
|
|
|
|
// 查询条件(暂只支持=)
|
|
|
|
insert1.put("configType",222);
|
|
|
|
List<BfDataObjectProperty> dataObjectPropertyList = new ArrayList<>();
|
|
|
|
insert1.put("configValue",222);
|
|
|
|
BfDataObjectProperty dataObjectProperty = new BfDataObjectProperty();
|
|
|
|
|
|
|
|
// 条件列
|
|
|
|
|
|
|
|
dataObjectProperty.setPropertyCode("configValue");
|
|
|
|
Map<String,Object> insert2 = new HashedMap();
|
|
|
|
// 条件参数
|
|
|
|
insert2.put("sid",333);
|
|
|
|
dataObjectProperty.setPropertyFormValue("impp.dev@estsh.com");
|
|
|
|
insert2.put("configType",333);
|
|
|
|
dataObjectPropertyList.add(dataObjectProperty);
|
|
|
|
insert2.put("configValue",333);
|
|
|
|
|
|
|
|
|
|
|
|
cloudFormModel.setSelectList(dataObjectPropertyList);
|
|
|
|
insertList.add(insert1);
|
|
|
|
|
|
|
|
insertList.add(insert2);
|
|
|
|
// 查询
|
|
|
|
model.setInsertList(insertList);
|
|
|
|
BaseResultBean dynamicEntityBaseResultBean = formDynamicFormCloud.findDynamicEntity(cloudFormModel);
|
|
|
|
|
|
|
|
LOGGER.info("==========findDynamicEntity====== {}",JSON.toJSONString(dynamicEntityBaseResultBean));
|
|
|
|
return formDynamicFormCloud.insertBatch(model);
|
|
|
|
if(!dynamicEntityBaseResultBean.isSuccess()){
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
return ResultBean.fail(dynamicEntityBaseResultBean.errorMsg);
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("查询成功").setResultList(dynamicEntityBaseResultBean.getResultList());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据id查询动态数据
|
|
|
|
* 根据ID删除指定数据
|
|
|
|
* @param idStr
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/get-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/delete")
|
|
|
|
@ApiOperation("根据id查询动态数据")
|
|
|
|
@ApiOperation(value = "删除数据",notes = "根据ID删除指定数据")
|
|
|
|
public ResultBean getDynamicEntity(String idStr){
|
|
|
|
public BaseResultBean delete(){
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
try {
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
Map<String,Object> delete = new HashedMap();
|
|
|
|
cloudFormModel.setSelect(Long.parseLong(idStr));
|
|
|
|
delete.put("sid",111);
|
|
|
|
|
|
|
|
model.setDelete(delete);
|
|
|
|
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
return formDynamicFormCloud.delete(model);
|
|
|
|
BaseResultBean dynamicEntityBaseResultBean = formDynamicFormCloud.getDynamicEntity(cloudFormModel);
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
LOGGER.info("==========getDynamicEntity====== {}",JSON.toJSONString(dynamicEntityBaseResultBean));
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
if(!dynamicEntityBaseResultBean.isSuccess()){
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ResultBean.fail(dynamicEntityBaseResultBean.errorMsg);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("查询成功").setResultObject(dynamicEntityBaseResultBean.getResultObject());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据新增动态数据
|
|
|
|
* 批量删除数据
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/insert-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/delete-batch")
|
|
|
|
@ApiOperation("根据id查询动态数据")
|
|
|
|
@ApiOperation(value = "批量删除数据",notes = "批量删除数据")
|
|
|
|
public ResultBean insertDynamicEntity(){
|
|
|
|
public BaseResultBean deleteBatch(){
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
try {
|
|
|
|
params.put("configCode","配置代码");
|
|
|
|
List<Map<String,Object>> deleteList = new ArrayList<>();
|
|
|
|
params.put("name","配置名称");
|
|
|
|
Map<String,Object> delete1 = new HashedMap();
|
|
|
|
params.put("configType",1);
|
|
|
|
delete1.put("sid",222);
|
|
|
|
|
|
|
|
delete1.put("configType",222);
|
|
|
|
|
|
|
|
delete1.put("configValue",222);
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
Map<String,Object> delete2 = new HashedMap();
|
|
|
|
cloudFormModel.setInsert(params);
|
|
|
|
delete2.put("sid",333);
|
|
|
|
|
|
|
|
delete2.put("configType",333);
|
|
|
|
// 新增
|
|
|
|
delete2.put("configValue",333);
|
|
|
|
BaseResultBean dynamicEntityBaseResultBean = formDynamicFormCloud.insert(cloudFormModel);
|
|
|
|
|
|
|
|
LOGGER.info("==========getDynamicEntity====== {}",JSON.toJSONString(dynamicEntityBaseResultBean));
|
|
|
|
deleteList.add(delete1);
|
|
|
|
if(!dynamicEntityBaseResultBean.isSuccess()){
|
|
|
|
deleteList.add(delete2);
|
|
|
|
return ResultBean.fail(dynamicEntityBaseResultBean.errorMsg);
|
|
|
|
model.setDeleteList(deleteList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return formDynamicFormCloud.deleteBatch(model);
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("新增成功").setResultObject(dynamicEntityBaseResultBean.getResultObject());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据修改动态数据
|
|
|
|
* 修改单条数据
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PutMapping("/update-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/update")
|
|
|
|
@ApiOperation("根据id查询动态数据")
|
|
|
|
@ApiOperation(value = "修改数据",notes = "修改单条数据")
|
|
|
|
public BaseResultBean updateDynamicEntity(){
|
|
|
|
public BaseResultBean update(){
|
|
|
|
// 修改必须传递id
|
|
|
|
try {
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
Map<String,Object> update = new HashedMap();
|
|
|
|
params.put("id",1);
|
|
|
|
update.put("sid",111);
|
|
|
|
params.put("configCode","配置代码");
|
|
|
|
update.put("configType",000);
|
|
|
|
params.put("configDescription","10086 - > 配置代码");
|
|
|
|
update.put("configValue",000);
|
|
|
|
params.put("configType",10086);
|
|
|
|
|
|
|
|
|
|
|
|
model.setUpdate(update);
|
|
|
|
|
|
|
|
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
return formDynamicFormCloud.update(model);
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
cloudFormModel.setUpdate(params);
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
// 新增
|
|
|
|
}
|
|
|
|
return formDynamicFormCloud.update(cloudFormModel);
|
|
|
|
|
|
|
|
// LOGGER.info("==========getDynamicEntity====== {}",JSON.toJSONString(dynamicEntityBaseResultBean));
|
|
|
|
|
|
|
|
// if(!dynamicEntityBaseResultBean.isSuccess()){
|
|
|
|
|
|
|
|
// return ResultBean.fail(dynamicEntityBaseResultBean.errorMsg);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// return ResultBean.success("修改成功").setResultObject(dynamicEntityBaseResultBean.getResultObject());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据删除动态数据
|
|
|
|
* 修改多条数据
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@DeleteMapping("/delete-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/update-batch")
|
|
|
|
@ApiOperation("根据id删除动态数据")
|
|
|
|
@ApiOperation(value = "批量修改数据",notes = "批量修改数据")
|
|
|
|
public ResultBean deleteDynamicEntity(String idStr){
|
|
|
|
public BaseResultBean updateBatch(){
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
try {
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
List<Map<String,Object>> updateList = new ArrayList<>();
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
Map<String,Object> update1 = new HashedMap();
|
|
|
|
cloudFormModel.setDelete(Long.parseLong(idStr));
|
|
|
|
update1.put("sid",222);
|
|
|
|
|
|
|
|
update1.put("configType",000);
|
|
|
|
// 新增
|
|
|
|
update1.put("configValue",000);
|
|
|
|
BaseResultBean dynamicEntityBaseResultBean =
|
|
|
|
|
|
|
|
formDynamicFormCloud.delete(cloudFormModel);
|
|
|
|
|
|
|
|
LOGGER.info("==========getDynamicEntity====== {}",JSON.toJSONString(dynamicEntityBaseResultBean));
|
|
|
|
Map<String,Object> update2 = new HashedMap();
|
|
|
|
if(!dynamicEntityBaseResultBean.isSuccess()){
|
|
|
|
update2.put("sid",333);
|
|
|
|
return ResultBean.fail(dynamicEntityBaseResultBean.errorMsg);
|
|
|
|
update2.put("configType",999);
|
|
|
|
|
|
|
|
update2.put("configValue",999);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateList.add(update1);
|
|
|
|
|
|
|
|
updateList.add(update2);
|
|
|
|
|
|
|
|
model.setUpdateList(updateList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return formDynamicFormCloud.updateBatch(model);
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("删除成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据条件修改动态数据
|
|
|
|
* 根据ID查询单条数据
|
|
|
|
* @return
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PutMapping("/batch-update-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/get-primary")
|
|
|
|
@ApiOperation("根据条件修改动态数据")
|
|
|
|
@ApiOperation(value = "查询数据",notes = "根据ID查询单条数据")
|
|
|
|
public BaseResultBean batchUpdateDynamicEntity(){
|
|
|
|
public BaseResultBean getDynamicEntity(){
|
|
|
|
// 修改必须传递id
|
|
|
|
try {
|
|
|
|
// 修改参数
|
|
|
|
BfDataObjectProperty property = new BfDataObjectProperty();
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
property.setPropertyCode("sid");
|
|
|
|
params.put("configCode","配置代码");
|
|
|
|
property.setPropertyFormValue("111");
|
|
|
|
params.put("configDescription","配置代码6");
|
|
|
|
|
|
|
|
params.put("configType",10088);
|
|
|
|
model.setSelectList(new ArrayList<BfDataObjectProperty>(){{
|
|
|
|
// 修改条件
|
|
|
|
add(property);
|
|
|
|
List<BfDataObjectProperty> dataObjectPropertyList = new ArrayList<>();
|
|
|
|
}});
|
|
|
|
BfDataObjectProperty dataObjectProperty = new BfDataObjectProperty();
|
|
|
|
|
|
|
|
// 条件列
|
|
|
|
return formDynamicFormCloud.getDynamicEntityByPrimary(model);
|
|
|
|
dataObjectProperty.setPropertyCode("id");
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
// 条件参数
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
List<Object> objectList = new ArrayList<>();
|
|
|
|
} catch (Exception e) {
|
|
|
|
objectList.add(1136674711043313664L);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
objectList.add(1136674929583329280L);
|
|
|
|
}
|
|
|
|
objectList.add(1136675310530990080L);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 单参数 传PropertyFormValue属性
|
|
|
|
|
|
|
|
dataObjectProperty.setPropertyFormValue("y");
|
|
|
|
|
|
|
|
// 如果条件表达式使用in 则传递 PropertyFormValueList 属性
|
|
|
|
|
|
|
|
dataObjectProperty.setPropertyFormValueList(objectList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 条件表达式
|
|
|
|
|
|
|
|
dataObjectProperty.setObjectColumnCustomWhere(BlockFormEnumUtil.CONDITIONAL_OPERATOR.IN.getValue());
|
|
|
|
|
|
|
|
dataObjectPropertyList.add(dataObjectProperty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
|
|
|
|
cloudFormModel.setUpdate(params);
|
|
|
|
|
|
|
|
cloudFormModel.setUpdateConditionList(dataObjectPropertyList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增
|
|
|
|
|
|
|
|
return formDynamicFormCloud.updateBatch(cloudFormModel);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据条件删除动态数据
|
|
|
|
* 根据条件查询所有
|
|
|
|
* @return
|
|
|
|
* @return 处理结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PutMapping("/batch-delete-dynamic-entity")
|
|
|
|
@PostMapping("/dynamic-entity/find")
|
|
|
|
@ApiOperation("根据条件删除动态数据")
|
|
|
|
@ApiOperation(value = "查询数据",notes = "根据条件查询所有")
|
|
|
|
public BaseResultBean batchDeleteDynamicEntity(){
|
|
|
|
public BaseResultBean findDynamicEntity(){
|
|
|
|
List<BfDataObjectProperty> dataObjectPropertyList = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
BfDataObjectProperty dataObjectProperty = new BfDataObjectProperty();
|
|
|
|
BfDataObjectProperty property = new BfDataObjectProperty();
|
|
|
|
// 条件列
|
|
|
|
property.setPropertyCode("configType");
|
|
|
|
dataObjectProperty.setPropertyCode("id");
|
|
|
|
property.setPropertyFormValue("22");
|
|
|
|
// 条件参数
|
|
|
|
|
|
|
|
List<Object> objectList = new ArrayList<>();
|
|
|
|
BfDataObjectProperty property2 = new BfDataObjectProperty();
|
|
|
|
objectList.add(1136677206129905664L);
|
|
|
|
property2.setPropertyCode("configValue");
|
|
|
|
objectList.add(1136677273360404480L);
|
|
|
|
property2.setPropertyFormValue("22");
|
|
|
|
// objectList.add(1136675310530990080L);
|
|
|
|
|
|
|
|
|
|
|
|
model.setSelectList(new ArrayList<BfDataObjectProperty>(){{
|
|
|
|
// 单参数 传PropertyFormValue属性
|
|
|
|
add(property);
|
|
|
|
dataObjectProperty.setPropertyFormValue(1136677426431528960L);
|
|
|
|
add(property2);
|
|
|
|
// 如果条件表达式使用in 则传递 PropertyFormValueList 属性
|
|
|
|
}});
|
|
|
|
dataObjectProperty.setPropertyFormValueList(objectList);
|
|
|
|
|
|
|
|
|
|
|
|
return formDynamicFormCloud.findDynamicEntity(model);
|
|
|
|
// 条件表达式
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
dataObjectProperty.setObjectColumnCustomWhere(BlockFormEnumUtil.CONDITIONAL_OPERATOR.EQUAL.getValue());
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
dataObjectPropertyList.add(dataObjectProperty);
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CloudFormModel cloudFormModel = new CloudFormModel();
|
|
|
|
|
|
|
|
cloudFormModel.setSourceCode("form_test");
|
|
|
|
|
|
|
|
cloudFormModel.setDataObjectCode("sys_config");
|
|
|
|
|
|
|
|
cloudFormModel.setDeleteConditionList(dataObjectPropertyList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增
|
|
|
|
|
|
|
|
return formDynamicFormCloud.deleteBatch(cloudFormModel);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|