修复了删除检材时的orderNum没有重新排序的问题
This commit is contained in:
@@ -1095,10 +1095,17 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
|
|||||||
if (this.removeById(id)) {
|
if (this.removeById(id)) {
|
||||||
String entrustId = entrustmentIdentificationMaterial.getEntrustmentId();
|
String entrustId = entrustmentIdentificationMaterial.getEntrustmentId();
|
||||||
Entrustment entrustment = entrustmentService.getById(entrustId);
|
Entrustment entrustment = entrustmentService.getById(entrustId);
|
||||||
List<EntrustmentIdentificationMaterial> materialList = this.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery().eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId));
|
List<EntrustmentIdentificationMaterial> materialList = this.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
|
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId)
|
||||||
|
.orderByAsc(EntrustmentIdentificationMaterial::getOrderNo));
|
||||||
|
|
||||||
if (materialList != null && materialList.size() > 0) {
|
if (materialList != null && materialList.size() > 0) {
|
||||||
entrustment.setEntrustRequirement(entrustmentService.buildEntrustReq(materialList));
|
entrustment.setEntrustRequirement(entrustmentService.buildEntrustReq(materialList));
|
||||||
entrustmentService.updateById(entrustment);
|
entrustmentService.updateById(entrustment);
|
||||||
|
for (int i = 0; i < materialList.size(); i++) {
|
||||||
|
materialList.get(i).setOrderNo(i + 1);
|
||||||
|
}
|
||||||
|
this.updateBatchById(materialList);
|
||||||
}
|
}
|
||||||
return entrustmentIdentificationMaterial;
|
return entrustmentIdentificationMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user