Commit 14fc1a75 authored by tangwei's avatar tangwei

动态表单表以及动态表单值表增加是否一行显示字段,

parent 61cf9d14
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
......@@ -25,9 +23,6 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertForm对象", description="警情表单")
public class AlertForm extends BaseEntity {
@ApiModelProperty(value = "警情类型")
private String alertTypeCode;
......@@ -46,4 +41,7 @@ public class AlertForm extends BaseEntity {
@ApiModelProperty(value = "字段值字典code")
private String fieldValueCode;
@ApiModelProperty(value = "是否一行显示")
private boolean isBlock;
}
......@@ -24,10 +24,6 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@TableName("jc_alert_form_value")
@ApiModel(value="AlertFormValue对象", description="")
public class AlertFormValue extends BaseEntity {
@ApiModelProperty(value = "表单id")
private Long alertFormId;
......@@ -52,19 +48,17 @@ public class AlertFormValue extends BaseEntity {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private boolean isBlock;
public AlertFormValue() {
super();
}
public AlertFormValue(Long alertFormId, String fieldName, String fieldCode) {
super();
this.alertFormId = alertFormId;
this.fieldName = fieldName;
this.fieldCode = fieldCode;
}
public AlertFormValue(Long alertFormId, String fieldName, String fieldCode, boolean isBlock) {
this.alertFormId = alertFormId;
this.fieldName = fieldName;
this.fieldCode = fieldCode;
this.isBlock = isBlock;
}
}
......@@ -32,7 +32,7 @@ public class FormList {
for (AlertForm alertFrom : list) {
if(alertFrom.getFieldType().equals("string")||alertFrom.getFieldType().equals("date")||alertFrom.getFieldType().equals("textarea")) {
AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null,
new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode()));
new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.isBlock()));
listfrom.add(vo);
}else {
// 查询数据项
......@@ -40,7 +40,7 @@ public class FormList {
columnMap.put("type", alertFrom.getFieldValueCode());
Collection<DataDictionary> listDataDictionary = iDataDictionaryService.listByMap(columnMap);
AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(),
new Items(getdata(listDataDictionary)), new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode()));
new Items(getdata(listDataDictionary)), new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.isBlock()));
listfrom.add(vo);
}
}
......
......@@ -23,17 +23,19 @@ public class FormValue {
private String type;
@ApiModelProperty(value = "value")
private String value;
@ApiModelProperty(value = "是否一行显示")
private boolean block;
public FormValue() {
}
public FormValue(String key, String label, String type, String value) {
public FormValue(String key, String label, String type, String value,boolean block) {
super();
this.key = key;
this.label = label;
this.type = type;
this.value = value;
this.block = block;
}
}
......@@ -81,6 +81,7 @@ public class AlertCalledController extends BaseController {
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode());
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
......@@ -131,7 +132,7 @@ public class AlertCalledController extends BaseController {
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
List<FormValue> formValue = new ArrayList();
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue());
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.isBlock());
formValue.add(value);
}
AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment