Commit ab3e9db947b59d4fdab49a5d8cd90b7f7e4b4098

Authored by xumiao
1 parent 87fc18e2

update判断

src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java
... ... @@ -370,6 +370,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
370 370 * 修改容器和库位状态
371 371 */
372 372 @Override
  373 + @Transactional
373 374 public void updateContainerCodeAndStatus(String locationCode, String containerCode, String status) {
374 375 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) {
375 376 LambdaUpdateWrapper<Location> updateWrapper = Wrappers.lambdaUpdate();
... ... @@ -378,11 +379,14 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
378 379 .eq(Location::getWarehouseCode, "CS0001")
379 380 .eq(Location::getCode, locationCode)
380 381 .ne(Location::getStatus,status);
381   - locationService.update(updateWrapper);
  382 + if (!locationService.update(updateWrapper)) {
  383 + throw new ServiceException("更新库位状态失败");
  384 + }
382 385 }
383 386 }
384 387  
385 388 @Override
  389 + @Transactional
386 390 public void updateContainerCodeAndStatus(String locationCode, String containerCode,
387 391 String status, String warehouseCode) {
388 392 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) {
... ... @@ -392,9 +396,13 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
392 396 .eq(Location::getWarehouseCode, warehouseCode)
393 397 .eq(Location::getCode, locationCode)
394 398 .ne(Location::getStatus,status);
395   - locationService.update(updateWrapper);
  399 + if (!locationService.update(updateWrapper)) {
  400 + throw new ServiceException("更新库位状态失败");
  401 + }
396 402 }
397   - } public LocationInfo getAllLocation(String type) {
  403 + }
  404 +
  405 + public LocationInfo getAllLocation(String type) {
398 406 if (StringUtils.isNotEmpty(type)) {
399 407 Location location = locationMapper.getAllLocation(ShiroUtils.getWarehouseCode(), type);
400 408 LocationInfo locationInfo = new LocationInfo();
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -358,7 +358,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
358 358 * WMS完成任务
359 359 */
360 360 @Override
361   - @Transactional(rollbackFor = Exception.class)
  361 + @Transactional
362 362 public AjaxResult completeTaskByWMS(Integer[] taskIds, String[] weightConvert) {
363 363 AjaxResult ajaxResult = null;
364 364 for (int i = 0; i < taskIds.length; i++) {
... ...