Commit ac8ce0d5 authored by tangwei's avatar tangwei

增加排序字段,修改接口

parent 7f2cdafc
...@@ -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("cb_data_dictionary") @TableName("cb_data_dictionary")
@ApiModel(value="DataDictionary对象", description="数据字典") @ApiModel(value="DataDictionary对象", description="数据字典")
public class DataDictionary extends BaseEntity { public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "code") @ApiModelProperty(value = "code")
private String code; private String code;
...@@ -42,5 +38,8 @@ public class DataDictionary extends BaseEntity { ...@@ -42,5 +38,8 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "操作人名称") @ApiModelProperty(value = "操作人名称")
private String recUserName; 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; ...@@ -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.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; 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.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.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -28,6 +29,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -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.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -120,9 +122,14 @@ public class AlertCalledController extends BaseController { ...@@ -120,9 +122,14 @@ public class AlertCalledController extends BaseController {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id); queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据 // 警情动态表单数据
List<AlertFormValue> alertFormValue = iAlertFormValueService.list(queryWrapper); List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
AlertCalledVo alertCalledVo = new AlertCalledVo(alertCalled, alertFormValue); List<FormValue> formValue =new ArrayList();
return CommonResponseUtil.success(alertCalledVo); 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 { ...@@ -103,7 +103,7 @@ public class AlertFormController extends BaseController {
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/from/{code}", method = RequestMethod.GET) @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){ public ResponseModel selectFormdItem(HttpServletRequest request, @PathVariable String code){
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_type_code", code); queryWrapper.eq("alert_type_code", code);
......
...@@ -148,9 +148,11 @@ public class DataDictionaryController extends BaseController { ...@@ -148,9 +148,11 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET) @RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel gwmcDataDictionary( @PathVariable String type) throws Exception{ public ResponseModel gwmcDataDictionary( @PathVariable String type) throws Exception{
Map<String, Object> columnMap =new HashMap<>();
columnMap.put("type", type); QueryWrapper queryWrapper = new QueryWrapper<>();
Collection<DataDictionary> list=iDataDictionaryService.listByMap(columnMap); 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"); List<Menu> menus =TreeParser.getTree(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
return CommonResponseUtil.success(menus); 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