| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "小程序用户导入模板下载") |
| | | @GetMapping("/import-template_user") |
| | | public void importTemplate() { |
| | |
| | | tAppUser.setUserType(userType); |
| | | tAppUser.setPromotionStatus(promotionType); |
| | | |
| | | if (appUserImport.getReferrerCode() != null) { |
| | | TAppUser referrerUser = appUserService.getOne(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getCode, appUserImport.getReferrerCode()).ne(TAppUser::getStatus, 3).last("LIMIT 1")); |
| | | if (referrerUser != null) { |
| | | tAppUser.setReferrerUserId(referrerUser.getId()); |
| | | tAppUser.setReferrerStatus(1); |
| | | tAppUser.setReferrerTime(LocalDateTime.now()); |
| | | } |
| | | } |
| | | |
| | | if (appUserImport.getDealerCode() != null) { |
| | | } |
| | | TCompany one = companyService.getOne(new LambdaQueryWrapper<TCompany>().eq(TCompany::getCode, appUserImport.getDealerCode()).ne(TCompany::getStatus, 3).last("LIMIT 1")); |
| | | if (one != null) { |
| | | tAppUser.setCompanyId(one.getId()); |
| | | } |
| | | } |
| | | appUserService.save(tAppUser); |
| | | i++; |
| | | } |
| | | |
| | | |
| | | for (AppUserImport appUserImport : imports) { |
| | | |
| | | TAppUser one = appUserService.getOne(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getPhone, appUserImport.getPhone()).ne(TAppUser::getStatus, 3).last("LIMIT 1")); |
| | | if (appUserImport.getReferrerCode() != null) { |
| | | TAppUser referrerUser = appUserService.getOne(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getCode, appUserImport.getReferrerCode()).ne(TAppUser::getStatus, 3).last("LIMIT 1")); |
| | | if (referrerUser != null) { |
| | | one.setReferrerUserId(referrerUser.getId()); |
| | | one.setReferrerStatus(1); |
| | | one.setReferrerTime(LocalDateTime.now()); |
| | | } |
| | | } |
| | | appUserService.updateById(one); |
| | | } |
| | | |
| | | if (!result.isEmpty()) { |
| | | return R.fail(result.toString()); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "用户- 推广记录") |