This commit is contained in:
ls
2024-12-18 16:39:45 +08:00
parent 8b1677f6d6
commit 4bd78750b6
6 changed files with 39 additions and 8 deletions

View File

@@ -118,11 +118,7 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog);
String[] split = experimentNo.split("-", 4);
ExperimentSequence seq = new ExperimentSequence();
seq.setSequenceYear(split[1]);
seq.setSequenceValue(Integer.parseInt(split[3]));
experimentSequenceService.save(seq);
return Result.OK("添加成功!");
}

View File

@@ -34,11 +34,15 @@ public class ExperimentSequenceServiceImpl extends ServiceImpl<ExperimentSequenc
sequence.setSequenceYear(year + "");
save(sequence);
}
return assembleSequence(sequence);
ExperimentSequence seq = new ExperimentSequence();
seq.setSequenceYear(year + "");
seq.setSequenceValue(sequence.getSequenceValue() + 1);
save(seq);
return assembleSequence(seq);
}
public String assembleSequence(ExperimentSequence experimentSequence) {
return "KC-" + experimentSequence.getSequenceYear() + "-JL-" + StringUtils.leftPad((experimentSequence.getSequenceValue() + 1) + "",
return "KC-" + experimentSequence.getSequenceYear() + "-JL-" + StringUtils.leftPad(experimentSequence.getSequenceValue() + "",
3, "0");
}
}

View File

@@ -96,7 +96,7 @@ public class ExperimentServiceImpl extends ServiceImpl<ExperimentMapper, Experim
@Override
public Experiment copy(Experiment oldExperiment) {
Experiment experiment = new Experiment();
BeanUtil.copyProperties(this, experiment);
BeanUtil.copyProperties(oldExperiment, experiment);
experiment.setId(null);
experiment.setExperimentNo(experimentSequenceService.next());
experiment.setCopyCount(0);

9
scripts/.prettierignore Normal file
View File

@@ -0,0 +1,9 @@
/dist/*
.local
.output.js
/node_modules/**
**/*.svg
**/*.sh
/public/*

1
scripts/.python-version Normal file
View File

@@ -0,0 +1 @@
3.13.1

21
scripts/pyproject.toml Normal file
View File

@@ -0,0 +1,21 @@
[tool.poetry]
name = "physical-web"
version = "0.1.0"
description = ""
authors = ["ls <lslvxy@163.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.13"
requests = "^2.32.3"
beautifulsoup4 = "^4.12.3"
lxml = "^5.3.0"
flask = "^3.1.0"
minio = "^7.2.12"
mysql-connector-python = "^9.1.0"
urllib3 = "^2.2.3"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"