1.物料管理列表新增物料大类查询条件及列展示,并调整物料类型列位置;

2.物料新增表单增加物料大类必填校验;
3.优化物料大类编码最大流水号更新逻辑,支持根据传入编码自动比对更新。
This commit is contained in:
zxy 2026-03-20 16:57:19 +08:00
parent 70557ee3df
commit 3bdd9ff957
5 changed files with 30 additions and 7 deletions

View File

@ -31,7 +31,12 @@ public interface MatCodeService {
void updateMatCode(@Valid MatCodeSaveReqVO updateReqVO);
void updateCurMaxSeq(String matTypeCode);
/**
* 更新当前最大流水号
* @param matTypeCode 物料大类编码
* @param code 物料编码
*/
void updateCurMaxSeq(String matTypeCode,String code);
/**
* 删除物料大类编码维护

View File

@ -73,13 +73,23 @@ public class MatCodeServiceImpl implements MatCodeService {
@Override
public void updateCurMaxSeq(String matTypeCode) {
public void updateCurMaxSeq(String matTypeCode, String code) {
MatCodeDO matCode = getByMatCatCode(matTypeCode);
String string = getString(matCode.getCurMaxSeq());
matCode.setCurMaxSeq(string);
int typeNum = matCode.getMatTypeCode().length();
// 截取 最大流水号
String maxSeq = code.substring(typeNum);
String seq;
// 判断输入的流水号是否大于当前流水号
if (Integer.parseInt(maxSeq) >= Integer.parseInt(matCode.getCurMaxSeq())) {
seq= maxSeq;
}else {
seq = matCode.getCurMaxSeq();
}
matCode.setCurMaxSeq(seq);
matCodeMapper.updateById(matCode);
}
/**
* 校验物料大类编码唯一性
*

View File

@ -146,7 +146,7 @@ public class MaterialServiceImpl implements MaterialService {
validateMaterialRepeat(updateObj.getCode(), updateReqVO.getId());
materialMapper.updateById(updateObj);
// 更新物料大类最大流水
matCodeService.updateCurMaxSeq(updateObj.getMatCate());
matCodeService.updateCurMaxSeq(updateObj.getMatCate(),updateObj.getCode());
}
@Override

View File

@ -169,6 +169,7 @@ const formRules = reactive({
status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }],
materialType: [{ required: true, message: '物料类型不能为空', trigger: 'change' }],
unit: [{ required: true, message: '系统单位不能为空', trigger: 'change' }],
matCate: [{ required: true, message: '物料大类不能为空', trigger: 'change' }],
})
const formRef = ref() // Ref

View File

@ -90,11 +90,12 @@
<el-table-column fixed label="序号" type="index" width="100" align="center" />
<el-table-column fixed label="物料编码" align="center" prop="code" min-width="120" />
<el-table-column label="物料名称" align="center" prop="name" min-width="120"/>
<el-table-column label="物料" align="center" prop="materialType" min-width="120">
<el-table-column label="物料类" align="center" prop="matCate" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" />
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_CODE" :value="scope.row.matCate" />
</template>
</el-table-column>
<el-table-column label="系统单位" align="center" prop="unit" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
@ -103,6 +104,11 @@
<el-table-column label="物料简称" align="center" prop="shortName" min-width="120"/>
<el-table-column label="规格/型号" align="center" prop="spec" min-width="120"/>
<el-table-column label="品牌" align="center" prop="brand" min-width="120"/>
<el-table-column label="物料类型" align="center" prop="materialType" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" />
</template>
</el-table-column>
<el-table-column label="主要来源" align="center" prop="mainFrom" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_ORIGINAL" :value="scope.row.mainFrom" />
@ -180,6 +186,7 @@ const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: undefined,
matCate: undefined,
name: undefined,
brand: undefined,
spec: undefined,