|
|
@@ -29,6 +29,7 @@ import com.ruoyi.system.mapper.InfoUserMapper;
|
|
|
import com.ruoyi.system.mapper.PosOrderMapper;
|
|
|
import com.ruoyi.system.mapper.PosStoreMapper;
|
|
|
import com.ruoyi.system.service.IInfoUserService;
|
|
|
+import com.ruoyi.system.service.IPosOrderService;
|
|
|
import com.ruoyi.system.service.IUserWalletService;
|
|
|
import com.ruoyi.system.service.IVipUserService;
|
|
|
import com.ruoyi.system.utils.Auth;
|
|
|
@@ -48,6 +49,7 @@ import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
@@ -76,6 +78,9 @@ public class InfoUserController extends BaseController {
|
|
|
private IUserWalletService userWalletService;
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
+ @Autowired
|
|
|
+ private IPosOrderService posOrderService;
|
|
|
+
|
|
|
|
|
|
@Anonymous
|
|
|
@PostMapping("/testBathPush")
|
|
|
@@ -206,6 +211,14 @@ public class InfoUserController extends BaseController {
|
|
|
public AjaxResult deleuser(@RequestHeader String token) {
|
|
|
JwtUtil jwtUtil = new JwtUtil();
|
|
|
String id = jwtUtil.getusid(token);
|
|
|
+ LambdaQueryWrapper<PosOrder> query=new LambdaQueryWrapper<>();
|
|
|
+ Long userId=Long.valueOf(id);
|
|
|
+ query.in(PosOrder::getState,0L,1L,2L,3L,4L,9L);
|
|
|
+ query.apply("(user_id="+userId+" or qs_id="+userId+" or sh_id="+userId+")");
|
|
|
+ boolean exist=posOrderService.exists(query);
|
|
|
+ if(exist){
|
|
|
+ throw new ServiceException("抱歉,您還有未完成的訂單,無法刪除帳號");
|
|
|
+ }
|
|
|
return toAjax(infoUserService.deleteInfoUserByUserId(Long.valueOf(id)));
|
|
|
}
|
|
|
|