|
@@ -156,22 +156,19 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
|
|
int month = calendar.get(calendar.MONTH) + 1;//月份
|
|
int month = calendar.get(calendar.MONTH) + 1;//月份
|
|
int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);//获取前端传过来的时间获取月份的总天数
|
|
int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);//获取前端传过来的时间获取月份的总天数
|
|
if (type.equals("2")) {
|
|
if (type.equals("2")) {
|
|
- for (int i = 1; i <= actualMaximum; i++) {
|
|
|
|
for (Map user : users.getRecords()) {
|
|
for (Map user : users.getRecords()) {
|
|
if (!user.get("type").equals("1") && !user.get("type").equals("3")) {
|
|
if (!user.get("type").equals("1") && !user.get("type").equals("3")) {
|
|
- String shiftname = "";
|
|
|
|
- List<Map<String, Object>> id = userShiftMapper.getOneUserShift(user.get("id").toString(), year + "-" + month + "-" + i, "");
|
|
|
|
- if (id.size() > 0&&id!=null) {
|
|
|
|
- if (id.get(0).get("id").equals("0") || id.get(0).get("id") == "0") {
|
|
|
|
- shiftname = "休息";
|
|
|
|
- } else {
|
|
|
|
- if (oConvertUtils.isNotEmpty(id.get(0).get("name"))){
|
|
|
|
- shiftname = id.get(0).get("name").toString();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- user.put("a" + i, shiftname);
|
|
|
|
|
|
+ List<Map<String, Object>> id = userShiftMapper.getMothsUserShift(user.get("id").toString(), date);
|
|
|
|
+ for (int i = 1; i <= actualMaximum; i++) {
|
|
|
|
+ user.put("a" + i, null);
|
|
|
|
+ user.put("shiftid"+i,null);
|
|
}
|
|
}
|
|
|
|
+ if (oConvertUtils.isNotEmpty(id)){
|
|
|
|
+ id.forEach(i->{
|
|
|
|
+ user.put("a"+i.get("shiftDate"),i.get("name"));
|
|
|
|
+ user.put("shiftid"+i.get("shiftDate"),i.get("id"));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if (type.equals("4")){
|
|
}else if (type.equals("4")){
|
|
@@ -215,12 +212,25 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
if (userByids!=null){
|
|
if (userByids!=null){
|
|
- for (int i = 1; i <= actualMaximum; i++) {
|
|
|
|
|
|
+ userByids.forEach(st->{
|
|
|
|
+ for (int i = 1; i <= actualMaximum; i++) {
|
|
|
|
+ st.put("a" + i, null);
|
|
|
|
+ st.put("shiftid"+i,null);
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> id = userShiftMapper.getMothsUserShift(st.get("id").toString(), date);
|
|
|
|
+ if (oConvertUtils.isNotEmpty(id)){
|
|
|
|
+ id.forEach(i->{
|
|
|
|
+ st.put("a"+i.get("shiftDate"),i.get("name"));
|
|
|
|
+ st.put("shiftid"+i.get("shiftDate"),i.get("id"));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ /*for (int i = 1; i <= actualMaximum; i++) {
|
|
int ts=i;
|
|
int ts=i;
|
|
userByids.forEach(st->{
|
|
userByids.forEach(st->{
|
|
String shiftname = "";
|
|
String shiftname = "";
|
|
String sid = "";
|
|
String sid = "";
|
|
- List<Map<String, Object>> id = userShiftMapper.getOneUserShift(st.get("id").toString(), year + "-" + month + "-" + ts, "");
|
|
|
|
|
|
+ List<Map<String, Object>> id = userShiftMapper.getMothsUserShift(st.get("id").toString(), year + "-" + month);
|
|
if (id.size() > 0) {
|
|
if (id.size() > 0) {
|
|
if (id.get(0).get("id").equals("0") || id.get(0).get("id") == "0") {
|
|
if (id.get(0).get("id").equals("0") || id.get(0).get("id") == "0") {
|
|
shiftname = "休息";
|
|
shiftname = "休息";
|
|
@@ -233,7 +243,7 @@ public class UserShiftServiceImpl extends ServiceImpl<UserShiftMapper, UserShift
|
|
st.put("a" + ts, shiftname);
|
|
st.put("a" + ts, shiftname);
|
|
st.put("shiftid"+ts,sid);
|
|
st.put("shiftid"+ts,sid);
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|