|
@@ -1,5 +1,6 @@
|
|
|
package cn.ezhizao.project.business.controller;
|
|
|
|
|
|
+import cn.ezhizao.framework.logGing.SomeService;
|
|
|
import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
import cn.ezhizao.project.business.domain.*;
|
|
@@ -124,20 +125,27 @@ public class BizInboundOrderController extends BaseController {
|
|
|
});
|
|
|
bizInboundOrderService .updateBatchById(list);
|
|
|
|
|
|
- //查找当天是否有盘点数据
|
|
|
- List<BizTakeStockPeriod> periods = bizTakeStockPeriodService.query().eq("start_time", DateTime.now().toString("yyyy-MM-dd")).orderByDesc("create_time").list();
|
|
|
- //如果当天有盘点数据,根据details入库单明细的批次id,将periods当天最新创建的盘点数据中的入库字段设为1,表示该批次已入库
|
|
|
- if (!periods.isEmpty()) {
|
|
|
- //拿到入库单明细的批次id进行去重
|
|
|
- List<Long> uniqueLotIdList = details.stream().map(BizInboundOrderDetail::getLotId).distinct().collect(Collectors.toList());
|
|
|
+ //添加异常处理,如果出现异常,则创建异常日志并正常返回
|
|
|
+ try {
|
|
|
+ //查找当天是否有盘点数据
|
|
|
+ List<BizTakeStockPeriod> periods = bizTakeStockPeriodService.query().eq("start_time", DateTime.now().toString("yyyy-MM-dd")).orderByDesc("create_time").list();
|
|
|
+ //如果当天有盘点数据,根据details入库单明细的批次id,将periods当天最新创建的盘点数据中的入库字段设为1,表示该批次已入库
|
|
|
+ if (!periods.isEmpty()) {
|
|
|
+ //拿到入库单明细的批次id进行去重
|
|
|
+ List<Long> uniqueLotIdList = details.stream().map(BizInboundOrderDetail::getLotId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
- BizTaksStockLot taksStockLot = new BizTaksStockLot();
|
|
|
- taksStockLot.setTakeStockPeriodId(periods.get(0).getId());
|
|
|
- taksStockLot.setLotIdsForInbound(uniqueLotIdList);
|
|
|
+ BizTaksStockLot taksStockLot = new BizTaksStockLot();
|
|
|
+ taksStockLot.setTakeStockPeriodId(periods.get(0).getId());
|
|
|
+ taksStockLot.setLotIdsForInbound(uniqueLotIdList);
|
|
|
|
|
|
- //根据盘点id和批次id修改盘点明细中批次的入库状态
|
|
|
- bizTaksStockLotService.updateBatchByIdsForInbound(taksStockLot);
|
|
|
+ //根据盘点id和批次id修改盘点明细中批次的入库状态
|
|
|
+ bizTaksStockLotService.updateBatchByIdsForInbound(taksStockLot);
|
|
|
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ SomeService service=new SomeService();
|
|
|
+ service.someMethod("上架修改盘点数据异常:"+e.getMessage()+"。 入库数据:"+details);
|
|
|
+ service.onDestroy();
|
|
|
}
|
|
|
|
|
|
return success("更新成功");
|