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