Example #1
0
 public void changeAccountStatus(int id, int accountStatus) {
   Seller seller = sellerMapper.getSellerById(id);
   seller.setAccountStatus(accountStatus);
   sellerMapper.updateSeller(seller);
   if (accountStatus == AccountStatus.SUSPEND) { // 冻结账号,停售所有产品
     productService.changeProductsOfSeller(id, ProductStatus.Unsellable);
   } else if (accountStatus == AccountStatus.OK) {
     productService.changeProductsOfSeller(id, ProductStatus.Sellable);
   }
   emailService.sendEmailWhenAdminChangeAccountStatus(seller.getEmail());
 }
Example #2
0
 public boolean insertSeller(Seller seller) {
   seller.setCreatedAt(new Date());
   boolean flag = seller.selfCheck();
   if (flag) {
     sellerMapper.insertSeller(seller);
     return true;
   } else {
     return false;
   }
 }
Example #3
0
 public List<Seller> getSellerListByPage(Page page) {
   return sellerMapper.getSellerListByPage(page);
 }
Example #4
0
 public void updateSeller(Seller seller) {
   sellerMapper.updateSeller(seller);
 }
Example #5
0
 public Seller getSellerByEmailAndPassword(String email, String password) {
   return sellerMapper.getSellerByEmailAndPassword(email, password);
 }
Example #6
0
 public Seller getSellerByEmail(String email) {
   return sellerMapper.getSellerByEmail(email);
 }
Example #7
0
 public Seller getSellerById(int id) {
   return sellerMapper.getSellerById(id);
 }