|
|
@@ -9,7 +9,9 @@ import com.tsf.demo.provider.service.MpMsCardApplicationService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author LiuZhenJi
|
|
|
@@ -24,22 +26,13 @@ public class MpMsCardApplicationImpl implements MpMsCardApplicationService {
|
|
|
|
|
|
@Override
|
|
|
public R queryUserCard(Long userId) {
|
|
|
- //用户领卡集合
|
|
|
- List<MpMsCardApplicationLog> mpMsCardApplicationLogs = mpMsCardApplicationDao.queryUserCard(userId);
|
|
|
- //用户代领课集合
|
|
|
- List<MpBehalf> mpBehalves = behalfDao.queryUserBehalfCard(userId);
|
|
|
- int flag = -1;
|
|
|
- for (MpMsCardApplicationLog mpMsCardApplicationLog : mpMsCardApplicationLogs) {
|
|
|
- for (MpBehalf mpBehalf : mpBehalves) {
|
|
|
- flag++;
|
|
|
- if (mpMsCardApplicationLog.getBehalfId().equals(mpBehalf.getId())) {
|
|
|
- mpMsCardApplicationLog.setMpBehalf(mpBehalf);
|
|
|
- mpBehalves.remove(flag);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- flag=-1;
|
|
|
- }
|
|
|
- return R.data(mpMsCardApplicationLogs);
|
|
|
+ //用户本人领卡集合
|
|
|
+ List<MpMsCardApplicationLog> selfMpMsCardApplicationLogList = mpMsCardApplicationDao.queryUserCard(userId);
|
|
|
+ //用户代领卡集合
|
|
|
+ List<MpMsCardApplicationLog> otherMpMsCardApplicationLogList = mpMsCardApplicationDao.queryUserBehalfCard(userId);
|
|
|
+ Map<String, List<MpMsCardApplicationLog>> map = new HashMap<>();
|
|
|
+ map.put("self",selfMpMsCardApplicationLogList);
|
|
|
+ map.put("other",otherMpMsCardApplicationLogList);
|
|
|
+ return R.data(map);
|
|
|
}
|
|
|
}
|