|
@@ -1,5 +1,6 @@
|
|
|
package org.jeecg.modules.geke.userShift.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.modules.geke.userShift.entity.UserDept;
|
|
@@ -98,19 +99,21 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, Object>> mothUserShift(String date) throws ParseException {
|
|
|
+ public IPage<Map<String, Object>> mothUserShift(String date,Integer pageNo,Integer pageSize) throws ParseException {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- List<Map<String, Object>> users = userShiftMapper.getUsers();
|
|
|
+ Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageNo, pageSize);
|
|
|
+ IPage<Map<String, Object>> users = getUsers(page);
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(sdf.parse(date));
|
|
|
+
|
|
|
int year = calendar.get(Calendar.YEAR);//年份
|
|
|
int month = calendar.get(calendar.MONTH) + 1;//月份
|
|
|
int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);//获取前端传过来的时间获取月份的总天数
|
|
|
|
|
|
for(int i=1;i<=actualMaximum;i++){
|
|
|
- for (Map user:users){
|
|
|
+ for (Map user:users.getRecords()){
|
|
|
String shiftid="";
|
|
|
- String shiftname="暂无";
|
|
|
+ String shiftname="";
|
|
|
List<Map<String, Object>> id = userShiftMapper.getOneUserShift(user.get("id").toString(), year +"-"+ month+"-" + i, "");
|
|
|
if (id.size()>0) {
|
|
|
shiftname=id.get(0).get("name").toString();
|
|
@@ -118,10 +121,14 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
|
|
|
}
|
|
|
user.put("a" + i, shiftname);
|
|
|
user.put("shfitid",shiftid);
|
|
|
- user.put("date" + i, sdf.format(year + month + i));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return users;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<Map<String, Object>> getUsers(Page<Map<String, Object>> page) {
|
|
|
+ return page.setRecords(userShiftMapper.getUsers(page));
|
|
|
+ }
|
|
|
}
|