| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | if(1 < appUser.getVipId() && appUser.getVipId() < 4){ |
| | | appUserClient.vipDemotion(appUser.getId()); |
| | | } |
| | | //回退优惠券状态 |
| | |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | if(1 < appUser.getVipId() && appUser.getVipId() < 4){ |
| | | appUserClient.vipDemotion(appUser.getId()); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 会员降级检测 |
| | | */ |
| | | public boolean vipDemotion(Integer shopPoint, Integer vipId){ |
| | | if(vipId == 1 || vipId > 3){ |
| | | return false; |
| | | } |
| | | VipSetting vipSetting = vipSettingClient.getVipSetting(vipId).getData(); |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | return 1 == vipLevelUpShopRole && shopPoint < vipLevelUpShop; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void importExpress(MultipartFile file) { |
| | | try (InputStream inputStream = file.getInputStream()) { |
| | | Workbook workbook = WorkbookFactory.create(inputStream); |
| | | Sheet sheet = workbook.getSheetAt(0); // 获取第一个Sheet |
| | | |
| | | for (Row row : sheet) { |
| | | // cell.getStringCellValue() |
| | | System.out.println(); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |