57874 countryCard获取适用市场逻辑修改。
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
package com.jero.modules.problemKnowledgeBase.enums;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 问题知识库-查询标识枚举类
|
||||
*/
|
||||
public enum QueryFlagEnum {
|
||||
|
||||
GET_ALL_APPLY_MARKET("获取所有的适用市场","","0"),
|
||||
GET_NOT_CREATE_APPLY_MARKET("获取还没有创建过countryCard的适用市场","","1"),
|
||||
GET_RELEASED_APPLY_MARKET("获取已发布的countryCard的适用市场","","2"),
|
||||
GET_CREATE_APPLY_MARKET("获取所有已创建的countryCard的适用市场","","3"),
|
||||
;
|
||||
|
||||
String cnName;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private QueryFlagEnum(String cnName, String enName, String value) {
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value,String cut) {
|
||||
QueryFlagEnum[] values = values();
|
||||
for (QueryFlagEnum queryFlagEnum : values) {
|
||||
if (queryFlagEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return queryFlagEnum.cnName;
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
return queryFlagEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+23
-4
@@ -9,6 +9,7 @@ import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO;
|
||||
import com.jero.modules.problemKnowledgeBase.enums.QueryFlagEnum;
|
||||
import com.jero.modules.problemKnowledgeBase.enums.ReleaseStatusEnum;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
|
||||
@@ -216,9 +217,9 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
//获取已经创建了country Card的适用地区,该接口只返回,在country Card里面没有的适用地区。
|
||||
List<CountryCardManageReleaseEO> countryCardManageReleaseEOList = this.list();
|
||||
|
||||
//如果查询标识是空,则是在countryCard管理发布页面新增数据时使用:管理发布页新增查询的是,所有未创建countryCard的适用市场。
|
||||
//如果查询标识不是空,则是在CountryCard的首页使用:首页查询的是 所有已创建了countryCard的适用市场。
|
||||
if (StringUtils.isEmpty(queryFlag)) {
|
||||
if (StringUtils.equals(queryFlag, QueryFlagEnum.GET_ALL_APPLY_MARKET.getValue())) {
|
||||
result = dictModelList;
|
||||
}else if (StringUtils.equals(queryFlag,QueryFlagEnum.GET_NOT_CREATE_APPLY_MARKET.getValue())) {
|
||||
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
|
||||
result = dictModelList;
|
||||
}else {
|
||||
@@ -236,7 +237,7 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
}else if(StringUtils.equals(queryFlag,QueryFlagEnum.GET_RELEASED_APPLY_MARKET.getValue())){
|
||||
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
|
||||
result = null;
|
||||
}else {
|
||||
@@ -250,6 +251,24 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
}
|
||||
}
|
||||
|
||||
if(flag){
|
||||
result.add(dictModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(StringUtils.equals(queryFlag,QueryFlagEnum.GET_CREATE_APPLY_MARKET.getValue())){
|
||||
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
|
||||
result = null;
|
||||
}else {
|
||||
for (DictModel dictModel : dictModelList) {
|
||||
boolean flag = false;
|
||||
for (CountryCardManageReleaseEO countryCardManageReleaseEO : countryCardManageReleaseEOList) {
|
||||
if(StringUtils.equals(dictModel.getValue(),countryCardManageReleaseEO.getApplyMarket())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(flag){
|
||||
result.add(dictModel);
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@
|
||||
},
|
||||
methods: {
|
||||
getApplyMarketList() {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: 'countryCard' }).then((res) => {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: '2' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.applyMarketList = res.result || []
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
getApplyMarketList() {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: '1' }).then((res) => {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: '3' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.applyMarketList = res.result || []
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@
|
||||
this.editReplacePage(row)
|
||||
},
|
||||
getApplyMarketList() {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', {}).then((res) => {
|
||||
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: '1' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.applyMarketList = res.result || []
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user