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,6 +370,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
370 * 修改容器和库位状态 370 * 修改容器和库位状态
371 */ 371 */
372 @Override 372 @Override
  373 + @Transactional
373 public void updateContainerCodeAndStatus(String locationCode, String containerCode, String status) { 374 public void updateContainerCodeAndStatus(String locationCode, String containerCode, String status) {
374 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) { 375 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) {
375 LambdaUpdateWrapper<Location> updateWrapper = Wrappers.lambdaUpdate(); 376 LambdaUpdateWrapper<Location> updateWrapper = Wrappers.lambdaUpdate();
@@ -378,11 +379,14 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i @@ -378,11 +379,14 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
378 .eq(Location::getWarehouseCode, "CS0001") 379 .eq(Location::getWarehouseCode, "CS0001")
379 .eq(Location::getCode, locationCode) 380 .eq(Location::getCode, locationCode)
380 .ne(Location::getStatus,status); 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 @Override 388 @Override
  389 + @Transactional
386 public void updateContainerCodeAndStatus(String locationCode, String containerCode, 390 public void updateContainerCodeAndStatus(String locationCode, String containerCode,
387 String status, String warehouseCode) { 391 String status, String warehouseCode) {
388 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) { 392 if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) {
@@ -392,9 +396,13 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i @@ -392,9 +396,13 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
392 .eq(Location::getWarehouseCode, warehouseCode) 396 .eq(Location::getWarehouseCode, warehouseCode)
393 .eq(Location::getCode, locationCode) 397 .eq(Location::getCode, locationCode)
394 .ne(Location::getStatus,status); 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 if (StringUtils.isNotEmpty(type)) { 406 if (StringUtils.isNotEmpty(type)) {
399 Location location = locationMapper.getAllLocation(ShiroUtils.getWarehouseCode(), type); 407 Location location = locationMapper.getAllLocation(ShiroUtils.getWarehouseCode(), type);
400 LocationInfo locationInfo = new LocationInfo(); 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,7 +358,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
358 * WMS完成任务 358 * WMS完成任务
359 */ 359 */
360 @Override 360 @Override
361 - @Transactional(rollbackFor = Exception.class) 361 + @Transactional
362 public AjaxResult completeTaskByWMS(Integer[] taskIds, String[] weightConvert) { 362 public AjaxResult completeTaskByWMS(Integer[] taskIds, String[] weightConvert) {
363 AjaxResult ajaxResult = null; 363 AjaxResult ajaxResult = null;
364 for (int i = 0; i < taskIds.length; i++) { 364 for (int i = 0; i < taskIds.length; i++) {