From 2a12d6d43b6f7abc0ef594ee9b992f34ee00b7a1 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 16 八月 2024 10:28:59 +0800 Subject: [PATCH] python接口 --- ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java index a379aa6..6a877dc 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java @@ -36,6 +36,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.Date; import java.util.List; import java.util.Objects; import java.util.function.Consumer; @@ -110,7 +111,6 @@ YwPoint entity = baseMapper.selectById(form.getId()); Assert.notNull(entity, "璁板綍涓嶅瓨鍦�"); BeanUtils.copyProperties(form, entity); - entity.setPointTag(form.getPointTag().stream().collect(Collectors.joining(","))); baseMapper.updateById(entity); return Result.ok("淇敼鎴愬姛"); } @@ -150,11 +150,6 @@ public Result page(YwPointQuery query) { IPage<YwPointVO> page = PageUtil.getPage(query, YwPointVO.class); baseMapper.page(page, query); - page.getRecords().stream().forEach(point -> { - if (StringUtils.hasText(point.getPointTagString())) { - point.setPointTags(point.getPointTagString().split(",")); - } - }); return Result.ok().data(page.getRecords()).total(page.getTotal()); } @@ -168,9 +163,6 @@ YwPoint entity = baseMapper.selectById(id); Assert.notNull(entity, "璁板綍涓嶅瓨鍦�"); YwPointVO vo = YwPointVO.getVoByEntity(entity, null); - if (StringUtils.hasText(entity.getPointTag())) { - vo.setPointTags(entity.getPointTag().split(",")); - } if (Objects.nonNull(entity.getDeptId())) { vo.setDeptIds(sysDeptMapper.selectParents(entity.getDeptId())); } @@ -242,9 +234,9 @@ } @Override - public Result importData(MultipartFile file, Integer unitId) throws IOException { + public Result importData(MultipartFile file, Integer unitId, Date startTime, Date endTime, Boolean provinceTag, Boolean importantTag, Boolean importantCommandImageTag) throws IOException { Consumer<List<PointExport>> consumer = (dataList) -> { - this.updatePoint(dataList, unitId); + this.updatePoint(dataList, unitId, startTime, endTime, provinceTag, importantTag, importantCommandImageTag); }; EasyExcel.read(file.getInputStream(), PointExport.class , new CurrencyDataListener(consumer)).headRowNumber(1).doReadAll(); return Result.ok(); @@ -256,7 +248,7 @@ * @param dataList * @param unitId */ - private void updatePoint(List<PointExport> dataList, Integer unitId) { + private void updatePoint(List<PointExport> dataList, Integer unitId, Date startTime, Date endTime, Boolean provinceTag, Boolean importantTag, Boolean importantCommandImageTag) { if (CollectionUtils.isEmpty(dataList)) { throw new RuntimeException("瀵煎叆鏁版嵁涓嶈兘涓虹┖"); } @@ -264,6 +256,11 @@ new LambdaUpdateChainWrapper<>(baseMapper) .in(YwPoint::getSerialNumber, pointList) .set(YwPoint::getUnitId, unitId) + .set(YwPoint::getStartTime, startTime) + .set(YwPoint::getEndTime, endTime) + .set(YwPoint::getProvinceTag, provinceTag) + .set(YwPoint::getImportantTag, importantTag) + .set(YwPoint::getImportantCommandImageTag, importantCommandImageTag) .update(); } -- Gitblit v1.8.0