Commit 21a047d752bd116901d7883ab38468c33e4cd0d2

Authored by jiangjiazhi
1 parent 5f1a8152fc

增加基础项配置是否启用字段

Showing 5 changed files with 69 additions and 13 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/BasicConfig.java View file @ 21a047d
... ... @@ -20,8 +20,17 @@
20 20 private String code;
21 21  
22 22 private String name;
23   -
24   -
  23 +
  24 + private int enable;
  25 +
  26 + public int getEnable() {
  27 + return enable;
  28 + }
  29 +
  30 + public void setEnable(int enable) {
  31 + this.enable = enable;
  32 + }
  33 +
25 34 public String getName() {
26 35 return name;
27 36 }
platform-dal/src/main/java/com/lyms/platform/query/BasicConfigQuery.java View file @ 21a047d
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.enums.YnEnums;
8 9  
9 10 public class BasicConfigQuery extends BaseQuery implements IConvertToNativeQuery {
10 11  
11 12  
... ... @@ -18,9 +19,10 @@
18 19  
19 20 private String keyword;
20 21  
  22 +
21 23 public MongoQuery convertToQuery() {
22 24 // MongoCondition condition = MongoCondition.newInstance("1","1",MongoOper.IS);
23   - MongoCondition condition = MongoCondition.newInstance();
  25 + MongoCondition condition = MongoCondition.newInstance("yn", YnEnums.YES.getId(),MongoOper.IS);
24 26 if (null != id) {
25 27 condition = condition.and("id", id, MongoOper.IS);
26 28 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java View file @ 21a047d
... ... @@ -3,6 +3,8 @@
3 3 import java.util.ArrayList;
4 4 import java.util.List;
5 5  
  6 +import com.lyms.platform.operate.web.result.BasicConfigResult;
  7 +import org.apache.commons.collections.CollectionUtils;
6 8 import org.springframework.beans.factory.annotation.Autowired;
7 9 import org.springframework.stereotype.Component;
8 10  
... ... @@ -39,8 +41,15 @@
39 41 basicConfigQuery.setYn(YnEnums.YES.getId());
40 42 basicConfigQuery.setKeyword(basicConfigQueryRequest.getKeywords());
41 43 List<BasicConfig> data = basicConfigService.queryBasicConfig(basicConfigQuery);
42   -
43   - return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  44 + List<BasicConfigResult> dataList =new ArrayList<>();
  45 + if(CollectionUtils.isNotEmpty(data)){
  46 + for(BasicConfig basicConfig:data){
  47 + BasicConfigResult basicConfigResult = new BasicConfigResult();
  48 + basicConfigResult.convertToResult(basicConfig);
  49 + dataList.add(basicConfigResult);
  50 + }
  51 + }
  52 + return new BaseListResponse().setData(dataList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
44 53 }
45 54  
46 55 /**
... ... @@ -55,6 +64,7 @@
55 64 obj.setCode(basicConfigUpdateRequest.getCode());
56 65 obj.setName(basicConfigUpdateRequest.getName());
57 66 obj.setId(basicConfigUpdateRequest.getId());
  67 + obj.setEnable(basicConfigUpdateRequest.getEnable());
58 68 basicConfigService.updateBasicConfig(obj);
59 69 return new BaseResponse("成功", ErrorCodeConstants.SUCCESS);
60 70 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BasicConfigUpdateRequest.java View file @ 21a047d
... ... @@ -16,6 +16,16 @@
16 16 @FormParam
17 17 @NotEmpty(message = "code不能为空.")
18 18 private String code;
  19 + @FormParam
  20 + private int enable;
  21 +
  22 + public int getEnable() {
  23 + return enable;
  24 + }
  25 +
  26 + public void setEnable(int enable) {
  27 + this.enable = enable;
  28 + }
19 29  
20 30 public String getId() {
21 31 return id;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BasicConfigResult.java View file @ 21a047d
1 1 package com.lyms.platform.operate.web.result;
2 2  
3   -public class BasicConfigResult {
  3 +import com.lyms.platform.common.base.IBasicResultConvert;
  4 +import com.lyms.platform.pojo.BasicConfig;
  5 +import com.lyms.platform.pojo.PuerperaModel;
  6 +
  7 +public class BasicConfigResult implements IBasicResultConvert<BasicConfigResult,BasicConfig> {
4 8 private String id;
5 9 private String code;
6   - private int yn;
  10 + private int enable;
7 11 private String parentId;
  12 + private String name;
  13 +
  14 + public String getName() {
  15 + return name;
  16 + }
  17 +
  18 + public void setName(String name) {
  19 + this.name = name;
  20 + }
  21 +
8 22 public String getId() {
9 23 return id;
10 24 }
11 25  
... ... @@ -17,17 +31,28 @@
17 31 public void setCode(String code) {
18 32 this.code = code;
19 33 }
20   - public int getYn() {
21   - return yn;
22   - }
23   - public void setYn(int yn) {
24   - this.yn = yn;
25   - }
26 34 public String getParentId() {
27 35 return parentId;
28 36 }
29 37 public void setParentId(String parentId) {
30 38 this.parentId = parentId;
  39 + }
  40 +
  41 + public int getEnable() {
  42 + return enable;
  43 + }
  44 +
  45 + public void setEnable(int enable) {
  46 + this.enable = enable;
  47 + }
  48 + @Override
  49 + public BasicConfigResult convertToResult(BasicConfig destModel) {
  50 + setCode(destModel.getCode());
  51 + setId(destModel.getId());
  52 + setEnable(destModel.getEnable());
  53 + setName(destModel.getName());
  54 + setParentId(destModel.getParentId());
  55 + return this;
31 56 }
32 57 }