Commit ac8ce0d5 authored by tangwei's avatar tangwei

增加排序字段,修改接口

parent 7f2cdafc
......@@ -24,10 +24,6 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@TableName("cb_data_dictionary")
@ApiModel(value="DataDictionary对象", description="数据字典")
public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "code")
private String code;
......@@ -42,5 +38,8 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
//新加排序字段
@ApiModelProperty(value = "排序字段")
private int sortNum;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* 动态表单值
* */
@Data
public class AlertCalledFormVo {
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
@ApiModelProperty(value = "动态表单值")
private List<FormValue> dynamicFormAlert;
public AlertCalledFormVo(AlertCalled alertCalled, List<FormValue> formValue) {
this.alertCalled = alertCalled;
this.dynamicFormAlert = formValue;
}
public AlertCalledFormVo() {
}
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @return
* <PRE>
* author tw
* date 2021/6/21
* </PRE>
* 动态表单值
*/
@Data
public class FormValue {
@ApiModelProperty(value = "key")
private String key;
@ApiModelProperty(value = "label")
private String label;
@ApiModelProperty(value = "type")
private String type;
@ApiModelProperty(value = "value")
private String value;
public FormValue() {
}
public FormValue(String key, String label, String type, String value) {
super();
this.key = key;
this.label = label;
this.type = type;
this.value = value;
}
}
......@@ -2,10 +2,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
......@@ -28,6 +29,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -120,9 +122,14 @@ public class AlertCalledController extends BaseController {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<AlertFormValue> alertFormValue = iAlertFormValueService.list(queryWrapper);
AlertCalledVo alertCalledVo = new AlertCalledVo(alertCalled, alertFormValue);
return CommonResponseUtil.success(alertCalledVo);
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.add(value);
}
AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue);
return CommonResponseUtil.success(alertCalledFormVo);
}
/**
......
......@@ -103,7 +103,7 @@ public class AlertFormController extends BaseController {
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/from/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
@ApiOperation(httpMethod = "GET", value = "根据表态类型code查询表单数据项", notes = "根据表态类型code查询表单数据项")
public ResponseModel selectFormdItem(HttpServletRequest request, @PathVariable String code){
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_type_code", code);
......
......@@ -148,9 +148,11 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel gwmcDataDictionary( @PathVariable String type) throws Exception{
Map<String, Object> columnMap =new HashMap<>();
columnMap.put("type", type);
Collection<DataDictionary> list=iDataDictionaryService.listByMap(columnMap);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list=iDataDictionaryService.list(queryWrapper);
List<Menu> menus =TreeParser.getTree(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
return CommonResponseUtil.success(menus);
}
......
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