rev:二期出库重量修改

This commit is contained in:
2024-07-23 09:23:22 +08:00
parent ab9967fe87
commit f38295279e

View File

@@ -129,16 +129,23 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
whereJson.put("input_optid", input_optid);
whereJson.put("input_optname", input_optname);
StIvtIostorinv mstDao = updataMst(whereJson, null);
this.save(mstDao);
// 插入明细
JSONArray tableData = whereJson.getJSONArray("tableData");
List<JSONObject> rows = tableData.stream()
.map(row -> JSONObject.parseObject(JSON.toJSONString(row)))
.collect(Collectors.toList());
// 插入主表
double total_qty = rows.stream()
.map(row -> row.getBigDecimal("plan_qty"))
.reduce(BigDecimal.ZERO, BigDecimal::add)
.doubleValue();
whereJson.put("total_qty",total_qty);
StIvtIostorinv mstDao = updataMst(whereJson, null);
this.save(mstDao);
// 插入明细
iStIvtIostorinvdtlService.insertOutDtl(rows, mstDao.getIostorinv_id());
return mstDao.getIostorinv_id().toString();