切换分支备份

dev_20240306
anthonywj 1 year ago
parent a0b6eb4b27
commit c30ba149f9

@ -38,7 +38,6 @@ import java.util.stream.Collectors;
/**
*
*
*/
@Validated
@RequiredArgsConstructor
@ -128,7 +127,7 @@ public class SysCustomConfigController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("/getConfigs")
@Log(title = "界面配置管理")
public BaseResponse getConfigs(@RequestBody SysCustomConfigRequest request,BindingResult bindingResult) {
public BaseResponse getConfigs(@RequestBody SysCustomConfigRequest request, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -143,40 +142,40 @@ public class SysCustomConfigController extends BaseController {
detailRequest.setIsShow("1");
// detailRequest.setType(request.getType());
List<SysCustomConfigDetailEntity> detailList = sysCustomConfigDetailService.filterSysCustomConfigDetail(detailRequest);
Map<String,List<SysCustomConfigDetailEntity>> map = detailList.stream().collect(
Map<String, List<SysCustomConfigDetailEntity>> map = detailList.stream().collect(
Collectors.groupingBy(SysCustomConfigDetailEntity::getType));
List<SysCustomConfigDetailEntity> tableList = map.get("1") == null? Lists.newArrayList():map.get("1");
List<SysCustomConfigDetailEntity> queryList = map.get("2") == null? Lists.newArrayList():map.get("2");
List<SysCustomConfigDetailEntity> fromList = map.get("3") == null? Lists.newArrayList():map.get("3");
List<SysCustomConfigDetailEntity> tableList = map.get("1") == null ? Lists.newArrayList() : map.get("1");
List<SysCustomConfigDetailEntity> queryList = map.get("2") == null ? Lists.newArrayList() : map.get("2");
List<SysCustomConfigDetailEntity> fromList = map.get("3") == null ? Lists.newArrayList() : map.get("3");
List<SysCustomConfigDetailEntity> fromSortList = fromList.stream().sorted(Comparator.comparing(SysCustomConfigDetailEntity::getLineNumber)).collect(Collectors.toList());
Map<Integer,List<SysCustomConfigDetailEntity>> fromMap = fromSortList.stream().collect(
Collectors.groupingBy(SysCustomConfigDetailEntity::getLineNumber,LinkedHashMap::new,Collectors.toList()));
Map<Integer, List<SysCustomConfigDetailEntity>> fromMap = fromSortList.stream().collect(
Collectors.groupingBy(SysCustomConfigDetailEntity::getLineNumber, LinkedHashMap::new, Collectors.toList()));
List<SysCustomConfigFromDetailResponse> fromDetailList = Lists.newArrayList();
for (Map.Entry<Integer, List<SysCustomConfigDetailEntity>> entry : fromMap.entrySet()) {
SysCustomConfigFromDetailResponse sysCustomConfigFromDetailResponse = new SysCustomConfigFromDetailResponse();
sysCustomConfigFromDetailResponse.setNumber(entry.getKey());
List<SysCustomConfigDetailEntity> entities = entry.getValue();
entities.stream().forEach(s->{
if(StringUtils.isNotEmpty(s.getCheckRules())){
entities.stream().forEach(s -> {
if (StringUtils.isNotEmpty(s.getCheckRules())) {
String replacedJsonString = s.getCheckRules().replaceAll("(\\w+)(\\s*:\\s*)", "\"$1\"$2");
JSONArray object = JSONArray.parseArray(replacedJsonString);
s.setCheckRulesObj(object);
}
if(StringUtils.isNotEmpty(s.getLableRule())){
if (StringUtils.isNotEmpty(s.getLableRule())) {
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
List<Map> mapList = Lists.newArrayList();
Iterator<String> it = objectLaber.keySet().iterator();
String inputType = s.getInputType();
while(it.hasNext()) {
Map<String,Object> mapTemp = Maps.newHashMap();
while (it.hasNext()) {
Map<String, Object> mapTemp = Maps.newHashMap();
String key = (String) it.next();
String value = objectLaber.getString(key);
mapTemp.put("label", value);
if("number".equals(inputType)){
if ("number".equals(inputType)) {
mapTemp.put("value", Integer.parseInt(key));
}else{
} else {
mapTemp.put("value", key);
}
mapList.add(mapTemp);
@ -188,23 +187,23 @@ public class SysCustomConfigController extends BaseController {
fromDetailList.add(sysCustomConfigFromDetailResponse);
}
tableList.stream().forEach(s->{
if(StringUtils.isNotEmpty(s.getLableRule())) {
tableList.stream().forEach(s -> {
if (StringUtils.isNotEmpty(s.getLableRule())) {
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
s.setLableRuleObj(objectLaber);
}
if(StringUtils.isNotEmpty(s.getButtonRule())){
if (StringUtils.isNotEmpty(s.getButtonRule())) {
JSONArray objectButton = JSONArray.parseArray(s.getButtonRule());
s.setButtonRulObj(objectButton);
}
});
queryList.stream().forEach(s->{
if(StringUtils.isNotEmpty(s.getLableRule())){
queryList.stream().forEach(s -> {
if (StringUtils.isNotEmpty(s.getLableRule())) {
JSONObject objectLaber = JSONObject.parseObject(s.getLableRule());
List<Map> mapList = Lists.newArrayList();
Iterator<String> it = objectLaber.keySet().iterator();
while(it.hasNext()) {
Map<String,String> mapTemp = Maps.newHashMap();
while (it.hasNext()) {
Map<String, String> mapTemp = Maps.newHashMap();
String key = (String) it.next();
String value = objectLaber.getString(key);
mapTemp.put("label", value);

Loading…
Cancel
Save