1. 添加案件编号不能为空校验

topo_dev
xueqingkun 6 months ago
parent 2d52ae9924
commit d07435eccb

@ -23,7 +23,7 @@ OLLAMA_MODEL=llama3-chinese:8b
LANGCHAIN_CHAT_URL=http://113.128.242.110:7861
THREAD_POOL_TRIPLE_CORE=1
THREAD_POOL_TYPE_CORE=1
XXl_JOB_PASSWORD=sT7SSTiX8&&s
XXl_JOB_PASSWORD=sT7SSTiX8s
OCR_PORT_HTTP=8866
OCR_MINIO_ENDPOINT_URL=http://fu-hsi-minio:9000

@ -1,5 +1,6 @@
package com.supervision.police.dto;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.supervision.police.domain.ModelCase;
import io.swagger.v3.oas.annotations.media.Schema;
@ -58,7 +59,7 @@ public class ModelCaseBase {
modelCase.setRegisterTime(this.registerTime);
modelCase.setAcceptTime(this.acceptTime);
modelCase.setIndexNum(this.indexNum);
modelCase.setCaseNo(this.caseNo);
modelCase.setCaseNo(StrUtil.trim(this.caseNo));
return modelCase;
}

@ -162,6 +162,10 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
}
i = modelCaseMapper.updateById(modelCase);
} else {
Long count = super.lambdaQuery().eq(ModelCase::getCaseNo, modelCase.getCaseNo()).count();
Assert.isTrue(count == 0, "案件编号已存在,请更换案件编号!");
Long num = modelCaseMapper.selectCount(null);
modelCase.setIndexNum(Integer.parseInt(num.toString()) + 1);
i = modelCaseMapper.insert(modelCase);

Loading…
Cancel
Save