| | |
| | | package com.qianwen.smartman.modules.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.tool.api.R; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.modules.coproduction.vo.InsertFieldQuery; |
| | | import com.qianwen.smartman.modules.system.convert.CustomTemplateFieldRelationConvert; |
| | | import com.qianwen.smartman.modules.system.entity.CustomTemplate; |
| | |
| | | import com.qianwen.smartman.modules.system.vo.CustomImportFieldsVO; |
| | | import com.qianwen.smartman.modules.system.vo.CustomTemplateFieldRelationSubmitVO; |
| | | import com.qianwen.smartman.modules.system.vo.CustomTemplateFieldRelationVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/CustomTemplateFieldRelationServiceImpl.class */ |
| | | public class CustomTemplateFieldRelationServiceImpl extends BaseServiceImpl<CustomTemplateFieldRelationMapper, CustomTemplateFieldRelation> implements ICustomTemplateFieldRelationService { |
| | | private final CustomTemplateFieldRelationMapper customTemplateFieldRelationMapper; |
| | | private final CustomTemplateMapper customTemplateMapper; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 533777810: |
| | | if (implMethodName.equals("getConfigType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 669298107: |
| | | if (implMethodName.equals("getMustField")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 805307167: |
| | | if (implMethodName.equals("getImportField")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 953775504: |
| | | if (implMethodName.equals("getBusinessType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1006262059: |
| | | if (implMethodName.equals("getTemplateId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 1827486425: |
| | | if (implMethodName.equals("getImportSort")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTemplateId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTemplateId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTemplateId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTemplateId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTemplateId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getConfigType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getConfigType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getConfigType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getConfigType(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getImportSort(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplate") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getBusinessType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplate") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getBusinessType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplate") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getBusinessType(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getImportField(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/system/entity/CustomTemplateFieldRelation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getMustField(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public CustomTemplateFieldRelationServiceImpl(final CustomTemplateFieldRelationMapper customTemplateFieldRelationMapper, final CustomTemplateMapper customTemplateMapper) { |
| | | this.customTemplateFieldRelationMapper = customTemplateFieldRelationMapper; |
| | |
| | | if (Func.isEmpty(templateIds)) { |
| | | return R.status(false); |
| | | } |
| | | |
| | | return R.status(remove(Wrappers.<CustomTemplateFieldRelation>lambdaQuery().in(CustomTemplateFieldRelation::getTemplateId, templateIds))); |
| | | /* |
| | | return R.status(remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getTemplateId(); |
| | | }, templateIds))); |
| | | }, templateIds)));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.system.service.ICustomTemplateFieldRelationService |
| | |
| | | public Boolean saveRelation(CustomTemplateFieldRelationSubmitVO customTemplateFieldRelationSubmitVO) { |
| | | CustomTemplateFieldRelation customTemplateFieldRelation; |
| | | FieldCodeCache.getInstance().clear(customTemplateFieldRelationSubmitVO.getTemplateId(), customTemplateFieldRelationSubmitVO.getConfigType()); |
| | | |
| | | List<CustomTemplateFieldRelation> list = list(Wrappers.<CustomTemplateFieldRelation>lambdaQuery().eq(CustomTemplateFieldRelation::getTemplateId, customTemplateFieldRelationSubmitVO.getTemplateId()) |
| | | .eq(CustomTemplateFieldRelation::getConfigType, customTemplateFieldRelationSubmitVO.getConfigType())); |
| | | /* |
| | | List<CustomTemplateFieldRelation> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getTemplateId(); |
| | | }, customTemplateFieldRelationSubmitVO.getTemplateId())).eq((v0) -> { |
| | | return v0.getConfigType(); |
| | | }, customTemplateFieldRelationSubmitVO.getConfigType())); |
| | | Map<Long, CustomTemplateFieldRelation> relationMap = (Map) list.stream().collect(Collectors.toMap((v0) -> { |
| | | }, customTemplateFieldRelationSubmitVO.getConfigType()));*/ |
| | | Map<Long, CustomTemplateFieldRelation> relationMap = list.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getFieldId(); |
| | | }, item -> { |
| | | return item; |
| | | })); |
| | | remove(Wrappers.<CustomTemplateFieldRelation>lambdaQuery().eq(CustomTemplateFieldRelation::getTemplateId, customTemplateFieldRelationSubmitVO.getTemplateId()) |
| | | .eq(CustomTemplateFieldRelation::getConfigType, customTemplateFieldRelationSubmitVO.getConfigType())); |
| | | /* |
| | | remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getTemplateId(); |
| | | }, customTemplateFieldRelationSubmitVO.getTemplateId())).eq((v0) -> { |
| | | return v0.getConfigType(); |
| | | }, customTemplateFieldRelationSubmitVO.getConfigType())); |
| | | }, customTemplateFieldRelationSubmitVO.getConfigType()));*/ |
| | | Long templateId = customTemplateFieldRelationSubmitVO.getTemplateId(); |
| | | Integer configType = customTemplateFieldRelationSubmitVO.getConfigType(); |
| | | List<CustomImportFieldInfoVO> oldstRelation = ((CustomTemplateFieldRelationMapper) this.baseMapper).getOldstRelation(templateId, configType); |
| | | Map<Long, List<CustomImportFieldInfoVO>> fieldRelationMap = (Map) oldstRelation.stream().collect(Collectors.groupingBy((v0) -> { |
| | | List<CustomImportFieldInfoVO> oldstRelation = this.baseMapper.getOldstRelation(templateId, configType); |
| | | Map<Long, List<CustomImportFieldInfoVO>> fieldRelationMap = oldstRelation.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getFieldId(); |
| | | })); |
| | | if (Func.isNotEmpty(customTemplateFieldRelationSubmitVO.getFieldList())) { |
| | |
| | | public CustomConditionFieldsVO getConditionFields(Long templateId) { |
| | | Integer businessType = BusinessTypeEnums.PLAN_ORDER.getCode(); |
| | | if (Func.isEmpty(templateId)) { |
| | | CustomTemplate customTemplate = this.customTemplateMapper.selectOne(Wrappers.<CustomTemplate>lambdaQuery() |
| | | .select( CustomTemplate::getId).eq(CustomTemplate::getBusinessType, BusinessTypeEnums.PRODUCT.getCode())); |
| | | /* |
| | | CustomTemplate customTemplate = (CustomTemplate) this.customTemplateMapper.selectOne((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }}).eq((v0) -> { |
| | | return v0.getBusinessType(); |
| | | }, BusinessTypeEnums.PRODUCT.getCode())); |
| | | }, BusinessTypeEnums.PRODUCT.getCode()));*/ |
| | | templateId = customTemplate.getId(); |
| | | businessType = BusinessTypeEnums.PRODUCT.getCode(); |
| | | } |
| | | CustomConditionFieldsVO customConditionFieldsVO = new CustomConditionFieldsVO(); |
| | | List<CustomConditionFieldInfoVO> fields = this.customTemplateFieldRelationMapper.getConditionFields(templateId, businessType); |
| | | if (Func.isNotEmpty(fields)) { |
| | | Map<Integer, List<CustomConditionFieldInfoVO>> groupResult = (Map) fields.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Integer, List<CustomConditionFieldInfoVO>> groupResult = fields.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getSystemField(); |
| | | })); |
| | | customConditionFieldsVO.setCustomFieldList(groupResult.get(0)); |
| | |
| | | public Boolean submitConditionFields(CustomConditionFieldsSubmitVO customConditionFieldsSubmitVO) { |
| | | FieldCodeCache.getInstance().clear(customConditionFieldsSubmitVO.getTemplateId()); |
| | | if (Func.isEmpty(customConditionFieldsSubmitVO.getTemplateId())) { |
| | | CustomTemplate customTemplate = this.customTemplateMapper.selectOne(Wrappers.<CustomTemplate>lambdaQuery() |
| | | .select( CustomTemplate::getId ).eq(CustomTemplate::getBusinessType, BusinessTypeEnums.PRODUCT.getCode())); |
| | | /* |
| | | CustomTemplate customTemplate = (CustomTemplate) this.customTemplateMapper.selectOne((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }}).eq((v0) -> { |
| | | return v0.getBusinessType(); |
| | | }, BusinessTypeEnums.PRODUCT.getCode())); |
| | | }, BusinessTypeEnums.PRODUCT.getCode()));*/ |
| | | customConditionFieldsSubmitVO.setTemplateId(customTemplate.getId()); |
| | | } |
| | | remove(Wrappers.<CustomTemplateFieldRelation>lambdaQuery().eq(CustomTemplateFieldRelation::getConfigType, ConfigTypeEnum.QUERY_CONDITION.getCode()) |
| | | .eq(CustomTemplateFieldRelation::getTemplateId, customConditionFieldsSubmitVO.getTemplateId())); |
| | | /* |
| | | remove((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getConfigType(); |
| | | }, ConfigTypeEnum.QUERY_CONDITION.getCode())).eq((v0) -> { |
| | | return v0.getTemplateId(); |
| | | }, customConditionFieldsSubmitVO.getTemplateId())); |
| | | }, customConditionFieldsSubmitVO.getTemplateId()));*/ |
| | | List<Long> ids = customConditionFieldsSubmitVO.getIds(); |
| | | List<CustomTemplateFieldRelation> insertList = new ArrayList<>(); |
| | | for (int i = 0; i < ids.size(); i++) { |
| | |
| | | })); |
| | | CustomImportFieldsVO customImportFieldsVO = new CustomImportFieldsVO(); |
| | | if (Func.isNotEmpty(fields)) { |
| | | Map<Integer, List<CustomImportFieldInfoVO>> groupResult = (Map) fields.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Integer, List<CustomImportFieldInfoVO>> groupResult = fields.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getSystemField(); |
| | | })); |
| | | customImportFieldsVO.setCustomFieldList(groupResult.get(0)); |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean submitImportFields(CustomConditionFieldsSubmitVO customConditionFieldsSubmitVO) { |
| | | if (Func.isEmpty(customConditionFieldsSubmitVO.getTemplateId())) { |
| | | CustomTemplate customTemplate = this.customTemplateMapper.selectOne(Wrappers.<CustomTemplate>lambdaQuery() |
| | | .select(CustomTemplate::getId).eq(CustomTemplate::getBusinessType, BusinessTypeEnums.PRODUCT.getCode())); |
| | | /* |
| | | CustomTemplate customTemplate = (CustomTemplate) this.customTemplateMapper.selectOne((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }}).eq((v0) -> { |
| | | return v0.getBusinessType(); |
| | | }, BusinessTypeEnums.PRODUCT.getCode())); |
| | | }, BusinessTypeEnums.PRODUCT.getCode()));*/ |
| | | customConditionFieldsSubmitVO.setTemplateId(customTemplate.getId()); |
| | | } |
| | | |
| | | update(Wrappers.<CustomTemplateFieldRelation>lambdaUpdate().set(CustomTemplateFieldRelation::getImportSort, null) |
| | | .set(CustomTemplateFieldRelation::getImportField, CommonConstant.DISABLE) |
| | | .eq(CustomTemplateFieldRelation::getTemplateId, customConditionFieldsSubmitVO.getTemplateId()) |
| | | .eq(CustomTemplateFieldRelation::getConfigType, ConfigTypeEnum.NEW_PAGE.getCode()) |
| | | .ne(CustomTemplateFieldRelation::getMustField, CommonConstant.ENABLE)); |
| | | /* |
| | | update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> { |
| | | return v0.getImportSort(); |
| | | }, (Object) null)).set((v0) -> { |
| | |
| | | return v0.getConfigType(); |
| | | }, ConfigTypeEnum.NEW_PAGE.getCode())).ne((v0) -> { |
| | | return v0.getMustField(); |
| | | }, CommonConstant.ENABLE)); |
| | | }, CommonConstant.ENABLE));*/ |
| | | List<Long> ids = customConditionFieldsSubmitVO.getIds(); |
| | | List<CustomTemplateFieldRelation> updateList = new ArrayList<>(); |
| | | for (int i = 0; i < ids.size(); i++) { |