forked from qiurunze123/miaosha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdae627
commit 1a8973c
Showing
10 changed files
with
102 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
.../miaosha-admin-service/src/main/java/com/geekq/admin/service/impl/AccountServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.geekq.admin.service.impl; | ||
|
||
import com.geekq.admin.entity.Account; | ||
import com.geekq.admin.mapper.AccountMapper; | ||
import com.geekq.admin.service.IAccountService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
@Service("accountServiceImpl") | ||
public class AccountServiceImpl implements IAccountService { | ||
|
||
@Autowired | ||
private AccountMapper accountMapper; | ||
|
||
@Override | ||
public void update(Account account) { | ||
int ret = accountMapper.updateByPrimaryKey(account); | ||
// if (ret <= 0) { | ||
// throw new RuntimeException("Account对象:" + account.getId() | ||
// + " 乐观锁失败!"); | ||
// } | ||
} | ||
|
||
@Override | ||
public Account get(Long id) { | ||
Account account = accountMapper.selectByPrimaryKey(id); | ||
if (!account.checkAbstractInfo()) { | ||
throw new RuntimeException("账户信息被篡改:" + id); | ||
} | ||
return account; | ||
} | ||
|
||
/** | ||
* 重建account表的摘要信息 | ||
*/ | ||
@Override | ||
public void recreateAbstractInfo() { | ||
List<Account> accounts = this.accountMapper.selectAll(); | ||
for (Account account : accounts) { | ||
this.accountMapper.updateByPrimaryKey(account); | ||
} | ||
} | ||
|
||
@Override | ||
public List<Account> listAll() { | ||
return this.accountMapper.selectAll(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...iaosha-admin-service/src/main/java/com/geekq/admin/service/impl/SystemDictionaryUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.geekq.admin.service.impl; | ||
|
||
import com.geekq.admin.entity.SystemDictionaryItem; | ||
import com.geekq.admin.service.ISystemDictionaryService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 数据字典工具类 | ||
* @author Administrator | ||
* | ||
*/ | ||
@Component | ||
public class SystemDictionaryUtil { | ||
|
||
@Autowired | ||
private ISystemDictionaryService systemDictionaryService; | ||
|
||
public List<SystemDictionaryItem> list(String sn) { | ||
return systemDictionaryService.queryBySn(sn); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters