diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java index b555553..1f902ac 100644 --- a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ContractServiceImpl.java @@ -11,6 +11,7 @@ import jnpf.base.UserInfo; import jnpf.base.model.ColumnDataModel; import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.entity.ContractEntity; +import jnpf.entity.ParkEntity; import jnpf.entity.SpacecontractEntity; import jnpf.mapper.ContractMapper; import jnpf.model.QueryModel; @@ -30,10 +31,12 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.lang.reflect.Field; +import java.math.BigDecimal; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -540,12 +543,24 @@ public class ContractServiceImpl extends ServiceImpl list = parkService.list(); + Map map = list.stream().collect(Collectors.toMap(ParkEntity::getId, Function.identity())); List tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class); int i = 1; for (SpacecontractEntity entitys : tableField130) { + if (entitys.getSpaceId().contains(",")) { + String spaceId; + spaceId = entitys.getSpaceId().substring(1, entitys.getSpaceId().length() - 1).replaceAll("\"", ""); + String[] numbers = spaceId.split(","); + entitys.setSpaceId(numbers[numbers.length - 1].trim()); + } entitys.setId(RandomUtil.uuId()); entitys.setContractNumber(entity.getContractNumber()); entitys.setContractLineNumber(String.valueOf(i)); + entitys.setSpaceArea(map.get(entitys.getSpaceId()).getSpaceArea()); + entitys.setSpaceName(map.get(entitys.getSpaceId()).getName()); + entitys.setCreateBy(userProvider.get().getUserId()); + entitys.setCreationTime(DateUtil.getNowDate()); if (isSave) { } else { } @@ -555,6 +570,14 @@ public class ContractServiceImpl extends ServiceImpl