| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocAreaServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.MatnrServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | |
| | | private LocService locService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | @Autowired |
| | | private WarehouseService warehouseService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 30, rollbackFor = Exception.class) |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncLocs(List<SyncLocsParams> locs) { |
| | | List<Loc> syncLocs = new ArrayList<>(); |
| | | locs.forEach(loc -> { |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 30, rollbackFor = Exception.class) |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncMatGroups(List<SyncMatGroupsParams> matGroupsParams) { |
| | | List<MatnrGroup> syncMatGroups = new ArrayList<>(); |
| | | matGroupsParams.forEach(matGroupsParam -> { |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/18 |
| | | * @description: 库区信息同步 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncWarehouseAreas(List<LocAreasParams> areasParams) { |
| | | areasParams.forEach(param -> { |
| | | WarehouseAreas locArea = new WarehouseAreas(); |
| | | BeanUtils.copyProperties(param, locArea); |
| | | WarehouseAreas warehouseAreas = warehouseAreasService |
| | | .getOne(new LambdaQueryWrapper<WarehouseAreas>() |
| | | .eq(WarehouseAreas::getName, param.getName())); |
| | | if (!Objects.isNull(warehouseAreas)) { |
| | | locArea.setWarehouseId(warehouseAreas.getId()); |
| | | } |
| | | locArea.setName(param.getName()) |
| | | .setCode(param.getCode()) |
| | | .setId(null); |
| | | if (!warehouseAreasService.save(locArea)) { |
| | | throw new CoolException("库区保存失败!!"); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/18 |
| | | * @description: 仓库同步 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | public R syncWarehouse(List<WarehouseParams> warehouses) { |
| | | warehouses.forEach(warehouse -> { |
| | | Warehouse ware = new Warehouse(); |
| | | BeanUtils.copyProperties(warehouse, ware); |
| | | ware.setId(null); |
| | | if (!warehouseService.save(ware)) { |
| | | throw new CoolException("仓库同步保存失败!!"); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |