country_card-管理发布-获取适用市场下拉选接口。
分类-处理回显责任人名称。
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
|||||||
|
package com.jero.modules.system.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据字典code枚举类
|
||||||
|
*/
|
||||||
|
public enum DicCodeEnum {
|
||||||
|
REGION("适用地区","0","region"),
|
||||||
|
;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
String value;
|
||||||
|
String code;
|
||||||
|
|
||||||
|
private DicCodeEnum(String name, String value, String code) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTextByValue(String value) {
|
||||||
|
DicCodeEnum[] values = values();
|
||||||
|
for (DicCodeEnum dicCodeEnum : values) {
|
||||||
|
if (dicCodeEnum.value.equals(value)) {
|
||||||
|
return dicCodeEnum.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.common.system.vo.DictModel;
|
||||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -185,4 +186,16 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
|
|||||||
this.countryCardManageReleaseEOService.batchUpdateReleaseStatus(json);
|
this.countryCardManageReleaseEOService.batchUpdateReleaseStatus(json);
|
||||||
return Result.OK("批量更新发布状态成功!");
|
return Result.OK("批量更新发布状态成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理发布查询适用市场下拉选,只获取管理发布中没有的适用市场。
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "问题知识库-country_card-管理发布-获取适用市场下拉选")
|
||||||
|
@ApiOperation(value="问题知识库-country_card-管理发布-获取适用市场下拉选", notes="问题知识库-country_card-管理发布-获取适用市场下拉选")
|
||||||
|
@GetMapping(value = "/getApplyMarketList")
|
||||||
|
public Result<List<DictModel>> getApplyMarketList() {
|
||||||
|
Result<List<DictModel>> result = this.countryCardManageReleaseEOService.getApplyMarketList();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -1,6 +1,8 @@
|
|||||||
package com.jero.modules.problemKnowledgeBase.service;
|
package com.jero.modules.problemKnowledgeBase.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.system.vo.DictModel;
|
||||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -72,4 +74,10 @@ public interface ICountryCardManageReleaseEOService extends IService<CountryCard
|
|||||||
* @param json
|
* @param json
|
||||||
*/
|
*/
|
||||||
void batchUpdateReleaseStatus(JSONObject json);
|
void batchUpdateReleaseStatus(JSONObject json);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取适用市场
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result<List<DictModel>> getApplyMarketList();
|
||||||
}
|
}
|
||||||
|
|||||||
+37
@@ -2,17 +2,22 @@ package com.jero.modules.problemKnowledgeBase.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.system.vo.DictModel;
|
||||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||||
import com.jero.modules.problemKnowledgeBase.enums.ReleaseStatusEnum;
|
import com.jero.modules.problemKnowledgeBase.enums.ReleaseStatusEnum;
|
||||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper;
|
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper;
|
||||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
|
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
|
||||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
||||||
|
import com.jero.modules.system.enums.DicCodeEnum;
|
||||||
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -34,6 +39,8 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICountryCardManageReleaseDetailEOService countryCardManageReleaseDetailEOService;
|
private ICountryCardManageReleaseDetailEOService countryCardManageReleaseDetailEOService;
|
||||||
|
@Autowired
|
||||||
|
private ISysDictService sysDictService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
@@ -159,4 +166,34 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
|||||||
|
|
||||||
this.updateBatchById(countryCardManageReleaseEOList);
|
this.updateBatchById(countryCardManageReleaseEOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<DictModel>> getApplyMarketList() {
|
||||||
|
List<DictModel> result = new ArrayList<>();
|
||||||
|
|
||||||
|
//获取所有的适用地区
|
||||||
|
List<DictModel> dictModelList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||||
|
|
||||||
|
//获取已经创建了country Card的适用地区,该接口只返回,在country Card里面没有的适用地区。
|
||||||
|
List<CountryCardManageReleaseEO> countryCardManageReleaseEOList = this.list();
|
||||||
|
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
|
||||||
|
result = dictModelList;
|
||||||
|
}else {
|
||||||
|
for (DictModel dictModel : dictModelList) {
|
||||||
|
boolean flag = true;
|
||||||
|
for (CountryCardManageReleaseEO countryCardManageReleaseEO : countryCardManageReleaseEOList) {
|
||||||
|
if(StringUtils.equals(dictModel.getValue(),countryCardManageReleaseEO.getApplyMarket())){
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flag){
|
||||||
|
result.add(dictModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-10
@@ -9,6 +9,9 @@ import com.jero.modules.system.util.StringUtils;
|
|||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -102,21 +105,33 @@ public class ProblemKnowledgeBaseClassifyEOServiceImpl extends ServiceImpl<Probl
|
|||||||
@Override
|
@Override
|
||||||
public void disposeData(List<ProblemKnowledgeBaseClassifyEO> datas) {
|
public void disposeData(List<ProblemKnowledgeBaseClassifyEO> datas) {
|
||||||
if (CollectionUtils.isNotEmpty(datas)) {
|
if (CollectionUtils.isNotEmpty(datas)) {
|
||||||
List<String> userIdList = datas.stream().map(ProblemKnowledgeBaseClassifyEO::getChargePersonId).distinct().collect(Collectors.toList());
|
|
||||||
|
StringBuffer userIdSb = new StringBuffer();
|
||||||
|
for (ProblemKnowledgeBaseClassifyEO data : datas) {
|
||||||
|
userIdSb.append(data.getChargePersonId() + ",");
|
||||||
|
}
|
||||||
|
List<String> userIdList = new ArrayList<>();
|
||||||
|
if(StringUtils.isNotEmpty(userIdSb.toString())){
|
||||||
|
userIdList = Arrays.asList(userIdSb.toString().substring(0,userIdSb.length()-1).split(","));
|
||||||
|
}
|
||||||
|
|
||||||
List<SysUser> userList = this.sysUserService.querySysUserListByIdList(userIdList);
|
List<SysUser> userList = this.sysUserService.querySysUserListByIdList(userIdList);
|
||||||
|
|
||||||
datas.forEach(data -> {
|
datas.forEach(data -> {
|
||||||
if(CollectionUtils.isNotEmpty(userList)){
|
if(CollectionUtils.isNotEmpty(userList)){
|
||||||
List<SysUser> sysUsers = userList.stream().filter(user -> {
|
String chargePersonId = data.getChargePersonId();
|
||||||
boolean flag = false;
|
if(StringUtils.isNotEmpty(chargePersonId)){
|
||||||
if (StringUtils.equals(data.getId(), user.getId())) {
|
String[] chargePersonIdArr = chargePersonId.split(",");
|
||||||
flag = true;
|
String chargePersonIdName = userList.stream().filter(user -> {
|
||||||
}
|
boolean flag = false;
|
||||||
return flag;
|
for (String chargePerson : chargePersonIdArr) {
|
||||||
}).collect(Collectors.toList());
|
if(StringUtils.equals(user.getId(),chargePerson)){
|
||||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
flag = true;
|
||||||
data.setChargePersonIdName(sysUsers.get(0).getUsername());
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||||
|
data.setChargePersonIdName(chargePersonIdName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user