Browse Source

前后台传值统一

master
xia 3 years ago
parent
commit
942f668da9
  1. 4
      archives/src/main/java/com/storeroom/modules/dictionary/controller/FieldController.java
  2. 2
      archives/src/main/java/com/storeroom/modules/dictionary/domain/Dictionary.java
  3. 14
      archives/src/main/java/com/storeroom/modules/dictionary/domain/vo/DictionaryVO.java
  4. 18
      archives/src/main/java/com/storeroom/modules/dictionary/domain/vo/FieldVO.java
  5. 6
      archives/src/main/java/com/storeroom/modules/dictionary/repository/DictionaryRepository.java
  6. 24
      archives/src/main/java/com/storeroom/modules/dictionary/service/dto/DictionaryDTO.java
  7. 30
      archives/src/main/java/com/storeroom/modules/dictionary/service/dto/DictionaryQueryCriteria.java
  8. 36
      archives/src/main/java/com/storeroom/modules/dictionary/service/dto/FieldDTO.java
  9. 4
      archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DictionaryServiceImpl.java

4
archives/src/main/java/com/storeroom/modules/dictionary/controller/FieldController.java

@ -38,9 +38,9 @@ public class FieldController {
@GetMapping("/findGroupType")
// @AnonymousGetMapping(value = "/findGroupType")
public ApiResponse<Object> findGroupType(
Integer is_type
Integer isType
){
return ApiResponse.success(fieldService.findGroupType(is_type));
return ApiResponse.success(fieldService.findGroupType(isType));
}
}

2
archives/src/main/java/com/storeroom/modules/dictionary/domain/Dictionary.java

@ -13,7 +13,7 @@ import java.io.Serializable;
@Entity
@Getter
@Setter
@Table(name="sys_dictionary")
@Table(name="archives_dictionary_config")
public class Dictionary extends BaseEntity implements Serializable {
@Id

14
archives/src/main/java/com/storeroom/modules/dictionary/domain/vo/DictionaryVO.java

@ -19,37 +19,37 @@ public class DictionaryVO {
@ApiModelProperty(value = "字典名称")
@JSONField(name="dicName")
@JsonProperty("dic_name")
@JsonProperty("dicName")
private String dicName;
@ApiModelProperty(value = "字典代码")
@JSONField(name="dicCode")
@JsonProperty("dic_code")
@JsonProperty("dicCode")
private String dicCode;
@ApiModelProperty(value = "设备id")
@JSONField(name="dicExplain")
@JsonProperty("dic_explain")
@JsonProperty("dicExplain")
private String dicExplain;
@ApiModelProperty(value = "设备id")
@JSONField(name="dicSequence")
@JsonProperty("dic_sequence")
@JsonProperty("dicSequence")
private String dicSequence;
@ApiModelProperty(value = "设备id")
@JSONField(name="dicType")
@JsonProperty("dic_type")
@JsonProperty("dicType")
private String dicType;
@ApiModelProperty(value = "父id")
@JSONField(name="dicPid")
@JsonProperty("dic_pid")
@JsonProperty("dicPid")
private String dicPid;
@ApiModelProperty(value = "子菜单集合")
@JSONField(name="childMenus")
@JsonProperty("child_menus")
@JsonProperty("childMenus")
private List<DictionaryVO> childMenus;
}

18
archives/src/main/java/com/storeroom/modules/dictionary/domain/vo/FieldVO.java

@ -19,47 +19,47 @@ public class FieldVO {
@ApiModelProperty(value = "字段名称")
@JSONField(name="fieldName")
@JsonProperty("field_name")
@JsonProperty("fieldName")
private String fieldName;
@ApiModelProperty(value = "字段含义")
@JSONField(name="fieldCnName")
@JsonProperty("field_cn_name")
@JsonProperty("fieldCnName")
private String fieldCnName;
@ApiModelProperty(value = "默认值")
@JSONField(name="isDefaultValue")
@JsonProperty("is_default_value")
@JsonProperty("isDefaultValue")
private String isDefaultValue;
@ApiModelProperty(value = "字典id")
@JSONField(name="dictionaryId")
@JsonProperty("dictionary_id")
@JsonProperty("dictionaryId")
private String dictionaryId;
@ApiModelProperty(value = "数据类型")
@JSONField(name="isDataType")
@JsonProperty("is_data_type")
@JsonProperty("isDataType")
private Integer isDataType;
@ApiModelProperty(value = "字段长度")
@JSONField(name="isColumnLength")
@JsonProperty("is_column_length")
@JsonProperty("isColumnLength")
private Integer isColumnLength;
@ApiModelProperty(value = "排序")
@JSONField(name="isSequence")
@JsonProperty("is_sequence")
@JsonProperty("isSequence")
private Integer isSequence;
@ApiModelProperty(value = "功能")
@JSONField(name="isType")
@JsonProperty("is_type")
@JsonProperty("isType")
private Integer isType;
@ApiModelProperty(value = "是否为系统字段")
@JSONField(name="isSystem")
@JsonProperty("is_system")
@JsonProperty("isSystem")
private Boolean isSystem;
}

6
archives/src/main/java/com/storeroom/modules/dictionary/repository/DictionaryRepository.java

@ -22,11 +22,11 @@ public interface DictionaryRepository extends JpaRepository<Dictionary, String>{
@Modifying
@Transactional(rollbackFor = Exception.class)
@Query(nativeQuery = true,value = "delete from sys_dictionary where id in ?1 ")
@Query(nativeQuery = true,value = "delete from archives_dictionary_config where id in ?1 ")
void deleteByIds(List<String> ids);
@Query(nativeQuery = true,
countQuery = "SELECT count(1) FROM sys_dictionary where dic_pid = ?1",
value = "SELECT id,dic_name as dicName,dic_code as dicCode,dic_explain as dicExplain,dic_sequence as dicSequence,dic_type as dicType,dic_pid as dicPid FROM sys_dictionary where dic_pid = ?1")
countQuery = "SELECT count(1) FROM archives_dictionary_config where dic_pid = ?1",
value = "SELECT id,dic_name as dicName,dic_code as dicCode,dic_explain as dicExplain,dic_sequence as dicSequence,dic_type as dicType,dic_pid as dicPid FROM archives_dictionary_config where dic_pid = ?1")
Page<Map<String,Object>> findSubsetById(String id, Pageable page);
}

24
archives/src/main/java/com/storeroom/modules/dictionary/service/dto/DictionaryDTO.java

@ -20,33 +20,33 @@ public class DictionaryDTO implements Serializable {
private String id;
@Query
@JSONField(name="dic_name")
@JsonProperty("dic_name")
@JSONField(name="dicName")
@JsonProperty("dicName")
private String dicName;
@Query
@JSONField(name="dic_code")
@JsonProperty("dic_code")
@JSONField(name="dicCode")
@JsonProperty("dicCode")
private String dicCode;
@Query
@JSONField(name="dic_explain")
@JsonProperty("dic_explain")
@JSONField(name="dicExplain")
@JsonProperty("dicExplain")
private String dicExplain;
@Query
@JSONField(name="dic_sequence")
@JsonProperty("dic_sequence")
@JSONField(name="dicSequence")
@JsonProperty("dicSequence")
private Integer dicSequence;
@Query
@JSONField(name="dic_type")
@JsonProperty("dic_type")
@JSONField(name="dicType")
@JsonProperty("dicType")
private Boolean dicType;
@Query
@JSONField(name="dic_pid")
@JsonProperty("dic_pid")
@JSONField(name="dicPid")
@JsonProperty("dicPid")
private String dicPid;
}

30
archives/src/main/java/com/storeroom/modules/dictionary/service/dto/DictionaryQueryCriteria.java

@ -14,27 +14,27 @@ public class DictionaryQueryCriteria {
private String id;
@Query
@JSONField(name="dic_name")
@JsonProperty("dic_name")
private String dic_name;
@JSONField(name="dicName")
@JsonProperty("dicName")
private String dicName;
@Query
@JSONField(name="dic_code")
@JsonProperty("dic_code")
private String dic_code;
@JSONField(name="dicCode")
@JsonProperty("dicCode")
private String dicCode;
@Query
@JSONField(name="dic_explain")
@JsonProperty("dic_explain")
private String dic_explain;
@JSONField(name="dicExplain")
@JsonProperty("dicExplain")
private String dicExplain;
@Query
@JSONField(name="dic_sequence")
@JsonProperty("dic_sequence")
private Integer dic_sequence;
@JSONField(name="dicSequence")
@JsonProperty("dicSequence")
private Integer dicSequence;
@Query
@JSONField(name="dic_pid")
@JsonProperty("dic_pid")
private Integer dic_pid;
@JSONField(name="dicPid")
@JsonProperty("dicPid")
private Integer dicPid;
}

36
archives/src/main/java/com/storeroom/modules/dictionary/service/dto/FieldDTO.java

@ -18,47 +18,47 @@ public class FieldDTO implements Serializable {
private String id;
@Query
@JSONField(name="field_name")
@JsonProperty("field_name")
@JSONField(name="fieldName")
@JsonProperty("fieldName")
private String fieldName;
@Query
@JSONField(name="field_cn_name")
@JsonProperty("field_cn_name")
@JSONField(name="fieldCnName")
@JsonProperty("fieldCnName")
private String fieldCnName;
@Query
@JSONField(name="is_default_value")
@JsonProperty("is_default_value")
@JSONField(name="isDefaultValue")
@JsonProperty("isDefaultValue")
private String isDefaultValue;
@Query
@JSONField(name="dictionary_id")
@JsonProperty("dictionary_id")
@JSONField(name="dictionaryId")
@JsonProperty("dictionaryId")
private String dictionaryId;
@Query
@JSONField(name="is_data_type")
@JsonProperty("is_data_type")
@JSONField(name="isDataType")
@JsonProperty("isDataType")
private Integer isDataType;
@Query
@JSONField(name="is_column_length")
@JsonProperty("is_column_length")
@JSONField(name="isColumnLength")
@JsonProperty("isColumnLength")
private Integer isColumnLength;
@Query
@JSONField(name="is_sequence")
@JsonProperty("is_sequence")
@JSONField(name="isSequence")
@JsonProperty("isSequence")
private Integer isSequence;
@Query
@JSONField(name="is_type")
@JsonProperty("is_type")
@JSONField(name="isType")
@JsonProperty("isType")
private Integer isType;
@Query
@JSONField(name="is_system")
@JsonProperty("is_system")
@JSONField(name="isSystem")
@JsonProperty("isSystem")
private Boolean isSystem;
}

4
archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DictionaryServiceImpl.java

@ -78,9 +78,9 @@ public class DictionaryServiceImpl implements DictionaryService {
@Override
public Object findSubsetById(String id, Pageable pageable) {
PageRequest page= PageSort.pageRequest(pageable.getPageNumber(), pageable.getPageSize(), "dic_sequence", Sort.Direction.ASC);
// PageRequest page= PageSort.pageRequest(pageable.getPageNumber(), pageable.getPageSize(), "dic_sequence", Sort.Direction.ASC);
//分页查询
Page<Map<String,Object>> pageMap = dictionaryRepository.findSubsetById(id,page);
Page<Map<String,Object>> pageMap = dictionaryRepository.findSubsetById(id,pageable);
//初始化分页返回数据
// List<DictionaryVO> deviceVOList = MapUtil.setList(pageMap.getContent(),DictionaryVO.class);
return PageUtil.toPage(pageMap);

Loading…
Cancel
Save