Commit 8eb340bf authored by lisong's avatar lisong

企业信息添加设置标签操作

parent c170dd05
...@@ -299,5 +299,6 @@ public class TzBaseEnterpriseInfoDto extends BaseDto { ...@@ -299,5 +299,6 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
private RegUnitInfoDto regUnitInfoDto; private RegUnitInfoDto regUnitInfoDto;
@ApiModelProperty(value = "企业标签信息")
private String regulatoryLabels;
} }
...@@ -181,4 +181,7 @@ public class TzBaseEnterpriseInfo extends BaseEntity { ...@@ -181,4 +181,7 @@ public class TzBaseEnterpriseInfo extends BaseEntity {
@ApiModelProperty(value = "行业主管部门") @ApiModelProperty(value = "行业主管部门")
private String industrySupervisor; private String industrySupervisor;
@ApiModelProperty(value = "企业标签信息")
private String regulatoryLabels;
} }
...@@ -42,4 +42,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI ...@@ -42,4 +42,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI
Map<String,Object> adminInfoUpdate(Map<String, Object> map); Map<String,Object> adminInfoUpdate(Map<String, Object> map);
TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode); TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode);
String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels);
} }
...@@ -46,6 +46,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -46,6 +46,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 企业数据信息 服务实现类 * 企业数据信息 服务实现类
...@@ -475,6 +476,32 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -475,6 +476,32 @@ public class TzBaseEnterpriseInfoServiceImpl
} }
@Override
public String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels) {
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfos = tzBaseEnterpriseInfoMapper.selectBatchIds(enterpriseIds);
for (TzBaseEnterpriseInfo tzBaseEnterpriseInfo : tzBaseEnterpriseInfos) {
// 标签递增逻辑
// if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegulatoryLabels())) {
// String result = checkLabel(enterpriseLabels, tzBaseEnterpriseInfo.getRegulatoryLabels());
// tzBaseEnterpriseInfo.setRegulatoryLabels(result);
// } else {
// String labels = String.join(",", enterpriseLabels);
// tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
// }
String labels = String.join(",", enterpriseLabels);
tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
}
this.updateBatchById(tzBaseEnterpriseInfos);
return "success";
}
private String checkLabel(List<String> enterpriseLabels, String result) {
List<String> strings = Arrays.asList(result.split(","));
ArrayList<String> res = new ArrayList<>(strings);
List<String> collect = enterpriseLabels.stream().filter(item -> !strings.contains(item)).collect(Collectors.toList());
res.addAll(collect);
return String.join(",", res);
}
public Map<String, Object> adminInfoUpdate(Map<String, Object> map) { public Map<String, Object> adminInfoUpdate(Map<String, Object> map) {
//每一个企业只有一个管理员,所以当前登录用户即管理员用户 //每一个企业只有一个管理员,所以当前登录用户即管理员用户
......
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