录入判定
This commit is contained in:
		| @ -76,14 +76,12 @@ public class AppDiningPlatesController { | |||||||
|     @GetMapping("/checkBindAndUnBind") |     @GetMapping("/checkBindAndUnBind") | ||||||
|     @Operation(summary = "餐盘解绑") |     @Operation(summary = "餐盘解绑") | ||||||
|     public CommonResult<String> checkBindAndUnBind(String diningPlatesNum,Long storeId) { |     public CommonResult<String> checkBindAndUnBind(String diningPlatesNum,Long storeId) { | ||||||
|         Boolean b = diningPlatesService.checkBindAndUnBind(diningPlatesNum, storeId); |         String b = diningPlatesService.checkBindAndUnBind(diningPlatesNum, storeId); | ||||||
|         CommonResult<String> result = new CommonResult<>(); |         CommonResult<String> result = new CommonResult<>(); | ||||||
|         result.setCode(200); |         result.setCode(200); | ||||||
|         if (b) { |         result.setData(b); | ||||||
|  |         if ("bind".equals(b)) { | ||||||
|             result.setMsg("餐盘已解绑"); |             result.setMsg("餐盘已解绑"); | ||||||
|             result.setData("bind"); |  | ||||||
|         }else { |  | ||||||
|             result.setData("unbind"); |  | ||||||
|         } |         } | ||||||
|         return result; |         return result; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -104,5 +104,5 @@ public interface DiningPlatesService { | |||||||
|      */ |      */ | ||||||
|     List<String> getBindDiningPlatesList(); |     List<String> getBindDiningPlatesList(); | ||||||
|  |  | ||||||
|     Boolean checkBindAndUnBind(String diningPlatesNum,Long storeId); |     String checkBindAndUnBind(String diningPlatesNum,Long storeId); | ||||||
| } | } | ||||||
| @ -444,15 +444,17 @@ public class DiningPlatesServiceImpl implements DiningPlatesService { | |||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     @Transactional(rollbackFor = Exception.class) |     @Transactional(rollbackFor = Exception.class) | ||||||
|     public Boolean checkBindAndUnBind(String diningPlatesNum,Long storeId) { |     public String checkBindAndUnBind(String diningPlatesNum,Long storeId) { | ||||||
|         DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(Wrappers.<DiningPlatesDO>lambdaQuery() |         DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(Wrappers.<DiningPlatesDO>lambdaQuery() | ||||||
|                 .eq(DiningPlatesDO::getDiningPlatesNum, diningPlatesNum) |                 .eq(DiningPlatesDO::getDiningPlatesNum, diningPlatesNum) | ||||||
|                 .eq(DiningPlatesDO::getStoreId, storeId)); |                 .eq(DiningPlatesDO::getStoreId, storeId)); | ||||||
|         if(diningPlatesDO == null || diningPlatesDO.getUserId() == null){ |         if(diningPlatesDO == null ) { | ||||||
|             return false; |             return "absent"; | ||||||
|  |         }else if (diningPlatesDO.getUserId() == null){ | ||||||
|  |             return "unbind"; | ||||||
|         }else { |         }else { | ||||||
|             unbind(diningPlatesNum,storeId); |             unbind(diningPlatesNum,storeId); | ||||||
|             return true; |             return "bind"; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Reference in New Issue
	
	Block a user
	 seesaw
					seesaw