清理废弃功能代码-后台-补回GoldCoin下属的userService
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.accompany.admin.service.record;
|
||||
|
||||
import com.accompany.admin.mapper.UserMapperExpand;
|
||||
import com.accompany.admin.vo.UsersVo;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class UsersAdminService {
|
||||
|
||||
@Autowired
|
||||
private UserMapperExpand userMapperExpand;
|
||||
/**
|
||||
*
|
||||
* @param erNos
|
||||
* @return
|
||||
*/
|
||||
public List<UsersVo> getUserList(String erNos, Integer page, Integer pageSize) {
|
||||
if (BlankUtil.isBlank(erNos)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
String[] arr = erNos.split("\n");
|
||||
List<Long> erNoList = Lists.newArrayList();
|
||||
for (String erNo : arr) {
|
||||
erNoList.add(Long.valueOf(erNo.trim()));
|
||||
}
|
||||
Map data = Maps.newHashMap();
|
||||
data.put("ids",erNoList);
|
||||
data.put("start",(page-1)*pageSize);
|
||||
data.put("pageSize",pageSize);
|
||||
List<UsersVo> usersVoList = userMapperExpand.selectUserWithGold(data);
|
||||
return usersVoList;
|
||||
}
|
||||
|
||||
public int getUserCount(String erNos){
|
||||
if (BlankUtil.isBlank(erNos)) {
|
||||
return 0;
|
||||
}
|
||||
String[] arr = erNos.split("\n");
|
||||
List<Long> erNoList = Lists.newArrayList();
|
||||
for (String erNo : arr) {
|
||||
erNoList.add(Long.valueOf(erNo.trim()));
|
||||
}
|
||||
return userMapperExpand.getUserWithGoldCount(erNoList);
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@ package com.accompany.admin.controller.record;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.record.OfficialGoldRecordService;
|
||||
import com.accompany.admin.service.record.UsersAdminService;
|
||||
import com.accompany.admin.service.system.AdminLogService;
|
||||
import com.accompany.admin.vo.OfficialGoldAllRecordVo;
|
||||
import com.accompany.admin.vo.OfficialGoldRecordVo;
|
||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
||||
@RequestMapping("/admin/goldcoin")
|
||||
public class GoldCoinController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private UsersAdminService usersAdminService;
|
||||
@Autowired
|
||||
private OfficialGoldRecordService officialGoldRecordService;
|
||||
@Autowired
|
||||
@@ -85,7 +88,12 @@ public class GoldCoinController extends BaseController {
|
||||
@RequestMapping("/userinfo")
|
||||
@ResponseBody
|
||||
public void getUserInfoByErNos(String ernos, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "20") Integer pageSize) {
|
||||
|
||||
List<UsersVo> list = usersAdminService.getUserList(ernos, page, pageSize);
|
||||
int count = usersAdminService.getUserCount(ernos);
|
||||
Map<String, Object> data = Maps.newHashMap();
|
||||
data.put("total", count);
|
||||
data.put("rows", list);
|
||||
writeJson(JSONObject.toJSONString(data));
|
||||
}
|
||||
|
||||
@RequestMapping("/record")
|
||||
|
Reference in New Issue
Block a user