Commit 14fc1a75 authored by tangwei's avatar tangwei

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

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