Compare commits
No commits in common. "b41ec206ac50c4935791c3dad94ccd91cc3e0799" and "63e8bb415644b9af3774a1c2cbcaeb283eb7289e" have entirely different histories.
b41ec206ac
...
63e8bb4156
@ -163,34 +163,29 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
});
|
||||
repairSoiService.saveBatch(repairSoRespVO.getGoodsList());
|
||||
|
||||
// 操作配件表
|
||||
// 前端选择了配件生成采购单的时候,可能会改配件的一些信息,但不知道会改什么,直接拿到全部,重新更新
|
||||
List<RepairWares> waresList = repairSoRespVO.getWaresList();
|
||||
waresService.updateBatchById(waresList);
|
||||
|
||||
// 操作配件库存表---应该是弃用了
|
||||
// 操作配件库存表
|
||||
// 获取所有需要操作的数据----生成采购单的时候,不直接操作库存,放到下面的inWares方法去操作
|
||||
// if (repairSoRespVO.getSoType() != null && !repairSoRespVO.getSoType().equals("01")){
|
||||
// List<DlRepairSoi> goodsList = repairSoRespVO.getGoodsList();
|
||||
// List<String> ids = goodsList.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList());
|
||||
// List<RepairWares> repairWares = waresService.listByIds(ids);
|
||||
// // 更新库存和进价
|
||||
// List<RepairWares> newWares = repairWares.stream().map(item -> {
|
||||
// // 取数据
|
||||
// DlRepairSoi repairSoi = goodsList.stream().filter(i -> i.getGoodsId().equals(item.getId())).collect(Collectors.toList()).get(0);
|
||||
// // 设置新值
|
||||
// // 如果是采购入库,数量+,如果是领料出库,数量-
|
||||
// // 01, 03 是采购 02 是领料
|
||||
// BigDecimal count = new BigDecimal(repairSoi.getGoodsCount());
|
||||
// RepairWares wares = new RepairWares();
|
||||
// wares.setId(item.getId());
|
||||
// wares.setStock("02".equals(repairSoRespVO.getSoType()) ? item.getStock().subtract(count) : item.getStock().add(count));
|
||||
// // 更新进价
|
||||
// wares.setPurPrice(repairSoi.getGoodsPrice());
|
||||
// return wares;
|
||||
// }).collect(Collectors.toList());
|
||||
// waresService.updateBatchById(newWares);
|
||||
// }
|
||||
if (repairSoRespVO.getSoType() != null && !repairSoRespVO.getSoType().equals("01")){
|
||||
List<DlRepairSoi> goodsList = repairSoRespVO.getGoodsList();
|
||||
List<String> ids = goodsList.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList());
|
||||
List<RepairWares> repairWares = waresService.listByIds(ids);
|
||||
// 更新库存和进价
|
||||
List<RepairWares> newWares = repairWares.stream().map(item -> {
|
||||
// 取数据
|
||||
DlRepairSoi repairSoi = goodsList.stream().filter(i -> i.getGoodsId().equals(item.getId())).collect(Collectors.toList()).get(0);
|
||||
// 设置新值
|
||||
// 如果是采购入库,数量+,如果是领料出库,数量-
|
||||
// 01, 03 是采购 02 是领料
|
||||
BigDecimal count = new BigDecimal(repairSoi.getGoodsCount());
|
||||
RepairWares wares = new RepairWares();
|
||||
wares.setId(item.getId());
|
||||
wares.setStock("02".equals(repairSoRespVO.getSoType()) ? item.getStock().subtract(count) : item.getStock().add(count));
|
||||
// 更新进价
|
||||
wares.setPurPrice(repairSoi.getGoodsPrice());
|
||||
return wares;
|
||||
}).collect(Collectors.toList());
|
||||
waresService.updateBatchById(newWares);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,4 @@ public class DlRepairSoRespVO extends DlRepairSo {
|
||||
|
||||
// 商品List
|
||||
private List<DlRepairSoi> goodsList;
|
||||
|
||||
// 配件List
|
||||
private List<RepairWares> waresList;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class DlRepairTicketsController {
|
||||
**/
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查看一个工单的详细信息")
|
||||
public CommonResult<?> getTicketsById(@RequestParam("id") String id,@RequestParam(required = false, value = "ifApp", defaultValue = "false")Boolean ifApp) {
|
||||
public CommonResult<?> getTicketsById(@RequestParam("id") String id,@RequestParam(required = false,value = "ifApp")Boolean ifApp) {
|
||||
return success(dlRepairTicketsService.getTicketsById(id,ifApp));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user