Commit b1546998 by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!472
parents 479f66b1 6d04d320
...@@ -95,9 +95,11 @@ import cn.timer.api.dao.kqgl.ShiftManagementMapper; ...@@ -95,9 +95,11 @@ import cn.timer.api.dao.kqgl.ShiftManagementMapper;
import cn.timer.api.dao.kqgl.SpecialDateMapper; import cn.timer.api.dao.kqgl.SpecialDateMapper;
import cn.timer.api.dao.kqgl.UserAttendanceRelMapper; import cn.timer.api.dao.kqgl.UserAttendanceRelMapper;
import cn.timer.api.dao.kqgl.UserEquiRelationMapper; import cn.timer.api.dao.kqgl.UserEquiRelationMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper; import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto; import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto; import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.utils.DateUtil; import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
...@@ -314,6 +316,10 @@ public class AttController { ...@@ -314,6 +316,10 @@ public class AttController {
return ResultUtil.data(shifs); return ResultUtil.data(shifs);
} }
@Autowired
private KqglAssoPbmxMapper kqglassopbmxmapper;
/** /**
* 修改考勤组排班(修改排班后,需判断是否有打卡记录,有则匹配当天修改后的班次,无则不需要修改) * 修改考勤组排班(修改排班后,需判断是否有打卡记录,有则匹配当天修改后的班次,无则不需要修改)
*/ */
...@@ -327,12 +333,35 @@ public class AttController { ...@@ -327,12 +333,35 @@ public class AttController {
int qyid = userBean.getOrgCode();//坏小孩【企业id】 int qyid = userBean.getOrgCode();//坏小孩【企业id】
int userid = userBean.getEmpNum();//用户id int userid = userBean.getEmpNum();//用户id
AttendanceGroup qttgrop = attendancegroupservice.selectByPrimaryKey(Integer.valueOf(attass.getAttgroupid())); String dastr = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();//
AttendanceGroup qttgrop = attendancegroupservice.selectByPrimaryKey(Integer.valueOf(attass.getAttgroupid()));
boolean xiugai = true;
//记录排班(排班制) //记录排班(排班制)
List<Schedule> schlist=new ArrayList<Schedule>(); List<Schedule> schlist=new ArrayList<Schedule>();
Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期 Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期
if(schedules.length>0 && attass.getAtttype() == 2){ if(schedules.length>0 && attass.getAtttype() == 2){
String date = String.valueOf(schedules[0].getData());
Date dt=new Date(date);
SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(famt.format(dt));
if(!(famt.format(dt)).equals(dastr)) {
xiugai = false;
for(int p=0;p<schedules.length;p++){
Schedule sch = new Schedule();
sch.setUserid(schedules[p].getUserid());//用户id
sch.setData(schedules[p].getData());//排班日期 格式:yyyy-MM-dd
sch.setBcid(schedules[p].getBcid());//班次id 0为休息
sch.setKqzid(Integer.valueOf(attass.getAttgroupid()));//考勤组id
schlist.add(sch);
}
if(schlist.size()>0){
scheduleservice.insertKqglAssoPbmxList(schlist);
}
}else {
xiugai = true;
for(int p=0;p<schedules.length;p++){ for(int p=0;p<schedules.length;p++){
Schedule sch = new Schedule(); Schedule sch = new Schedule();
sch.setUserid(schedules[p].getUserid());//用户id sch.setUserid(schedules[p].getUserid());//用户id
...@@ -1102,15 +1131,17 @@ public class AttController { ...@@ -1102,15 +1131,17 @@ public class AttController {
/***********************/ /***********************/
} }
}//判断新增或修改
} }
if(schlist.size()>0){ if(schlist.size()>0 && xiugai){
//删除排班明细表(自由排班) //删除排班明细表(自由排班)
scheduleservice.deleteByPrimaryBykqzid(id); scheduleservice.deleteByPrimaryBykqzid(id);
scheduleservice.insertKqglAssoPbmxList(schlist); scheduleservice.insertKqglAssoPbmxList(schlist);
return ResultUtil.data(schlist,"修改考勤组排班成功"); return ResultUtil.data(schlist,"修改考勤组排班成功");
} }
return ResultUtil.error("修改考勤组排班失败"); return ResultUtil.data(schlist,"修改考勤组排班成功");
// return ResultUtil.error("修改考勤组排班失败");
} }
/** /**
......
...@@ -3927,7 +3927,7 @@ public class ClockInController { ...@@ -3927,7 +3927,7 @@ public class ClockInController {
} }
} }
if(!(nextrange[0]).equals("")) {
for(String nus : nextrange) { for(String nus : nextrange) {
WorkbenchCalendarDto wocal = WorkbenchCalendarDto.builder().build(); WorkbenchCalendarDto wocal = WorkbenchCalendarDto.builder().build();
wocal.setDate(nus); wocal.setDate(nus);
...@@ -3947,6 +3947,8 @@ public class ClockInController { ...@@ -3947,6 +3947,8 @@ public class ClockInController {
workcal.add(wocal); workcal.add(wocal);
} }
}
} }
}else { }else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment