From 3417cf014a65765e02696c1d121ce58b2b4a8aed Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 08 四月 2025 15:55:36 +0800 Subject: [PATCH] 修改pom.xml --- src/main/java/com/se/simu/service/SimuService.java | 38 ++++++++++++++++++-------------------- 1 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/se/simu/service/SimuService.java b/src/main/java/com/se/simu/service/SimuService.java index e888c5c..435d1e5 100644 --- a/src/main/java/com/se/simu/service/SimuService.java +++ b/src/main/java/com/se/simu/service/SimuService.java @@ -20,7 +20,6 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.io.File; @@ -30,12 +29,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -/** - * 浠跨湡鏈嶅姟绫� - * - * @author WWW - * @date 2024-09-18 - */ @Slf4j @Service @SuppressWarnings("ALL") @@ -55,9 +48,6 @@ @Resource ResultService resultService; - /** - * 鑾峰彇 - */ public IPage<SimuPo> get(SimuVo vo) { QueryWrapper<SimuPo> wrapper = getPageWrapper(vo); @@ -80,7 +70,7 @@ if (null != vo.getNum()) { wrapper.eq("num", vo.getNum()); } - if (!StringUtils.isEmpty(vo.getName())) { + if (!StringHelper.isEmpty(vo.getName())) { wrapper.like("lower(name)", vo.getName().trim().toLowerCase()); } if (!CollUtil.isEmpty(vo.getStatus())) { @@ -90,9 +80,6 @@ return wrapper; } - /** - * 鍒犻櫎 - */ public int del(List<Integer> ids) { List<SimuPo> list = simuMapper.selectBatchIds(ids); if (null != list && list.size() > 0) { @@ -105,6 +92,7 @@ delDir(config.getInPath() + File.separator + dp.getInPath()); delDir(config.getOutPath() + File.separator + dp.getOutPath()); + FileUtil.del(config.getInPath() + File.separator + dp.getInPath() + ".json"); } catch (Exception ex) { log.error(ex.getMessage(), ex); } @@ -134,6 +122,21 @@ return simuMapper.selectOne(wrapper); } + public SimuPo getSimuById(Integer id) { + return simuMapper.selectById(id); + } + + public SimuPo getSimuByServiceName(String serviceName) { + if (StringHelper.isEmpty(serviceName)) { + return null; + } + + QueryWrapper<SimuPo> wrapper = new QueryWrapper<>(); + wrapper.eq("service_name", serviceName); + wrapper.last("limit 1"); + + return simuMapper.selectOne(wrapper); + } public boolean create(CreateSimuVo vo) { Date now = new Date(); @@ -147,6 +150,7 @@ initPath(data); SimuPo simu = new SimuPo(vo.getNum(), vo.getPid(), vo.getName(), JSONUtil.toJsonStr(data), 0, vo.getBak()); + simu.setServiceName(date); simu.setCreateTime(new Timestamp(now.getTime())); int rows = simuMapper.insert(simu); @@ -182,12 +186,6 @@ executor.shutdown(); } - /** - * 澶勭悊鏁版嵁锛岀姸鎬佹爣璇嗭細 - * 0-鍒涘缓浠跨湡浠诲姟锛�1-杩炴帴GEDB搴擄紝2-涓嬭浇绌洪棿鏁版嵁锛�3-涓嬭浇楂樼▼鏁版嵁锛� - * 4-鐢熸垚闄嶉洦鏂囦欢锛�5-鐢熸垚閰嶇疆鏂囦欢锛�6-妯℃嫙鍐呮稘浠跨湡锛�7-澶勭悊姘翠綅鏂囦欢锛� - * 8-澶勭悊鎺掓按鏂囦欢锛�9-澶勭悊浠跨湡缁撴灉锛�10-瀹屾垚锛�-10-鍑洪敊 - */ private void cope(SimuPo simu) { try { DataPo data = JSONUtil.toBean(simu.getData(), DataPo.class); -- Gitblit v1.9.3