|
@@ -186,22 +186,26 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
|
throw new BusinessException("已出库的不可以删除,出库单id:" + form.getId());
|
|
|
}
|
|
|
// 刪除出库单
|
|
|
- int result = mapper.deleteByPrimaryKey(id);
|
|
|
+// int result = mapper.deleteByPrimaryKey(id);
|
|
|
+ OutStoreForm outStoreForm = new OutStoreForm();
|
|
|
+ outStoreForm.setId(id);
|
|
|
+ outStoreForm.setStatus(OutStoreStatusEnum.DELETE.getValue());
|
|
|
+ mapper.updateByPrimaryKeySelective(outStoreForm);
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
|
|
|
// 刪除详情,更新详情涉及的库存
|
|
|
- if (result == 1) {
|
|
|
- Weekend<OutStoreDetail> detailWeekend = new Weekend<>(OutStoreDetail.class);
|
|
|
- detailWeekend.weekendCriteria().andEqualTo(OutStoreDetail::getOutId, id);
|
|
|
- List<OutStoreDetail> detailList = detailMapper.selectByExample(detailWeekend);
|
|
|
-
|
|
|
- // 批量删除出库详情
|
|
|
- List<String> ids = detailList.stream().map(OutStoreDetail::getId).collect(Collectors.toList());
|
|
|
- Weekend<OutStoreDetail> weekend = new Weekend<>(OutStoreDetail.class);
|
|
|
- WeekendCriteria<OutStoreDetail, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
- weekendCriteria.andIn(OutStoreDetail::getId, ids);
|
|
|
- int deleteNum = detailMapper.deleteByExample(weekend);
|
|
|
- }
|
|
|
+// if (result == 1) {
|
|
|
+// Weekend<OutStoreDetail> detailWeekend = new Weekend<>(OutStoreDetail.class);
|
|
|
+// detailWeekend.weekendCriteria().andEqualTo(OutStoreDetail::getOutId, id);
|
|
|
+// List<OutStoreDetail> detailList = detailMapper.selectByExample(detailWeekend);
|
|
|
+//
|
|
|
+// // 批量删除出库详情
|
|
|
+// List<String> ids = detailList.stream().map(OutStoreDetail::getId).collect(Collectors.toList());
|
|
|
+// Weekend<OutStoreDetail> weekend = new Weekend<>(OutStoreDetail.class);
|
|
|
+// WeekendCriteria<OutStoreDetail, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
+// weekendCriteria.andIn(OutStoreDetail::getId, ids);
|
|
|
+// int deleteNum = detailMapper.deleteByExample(weekend);
|
|
|
+// }
|
|
|
return true;
|
|
|
}
|
|
|
|