Commit 75dddfea by lal Committed by chenzg

提交

parent 67cb9cdf
package cn.timer.api.controller.kqgl; package cn.timer.api.controller.kqgl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -21,18 +27,18 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; ...@@ -21,18 +27,18 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.AttConditions; import cn.timer.api.bean.kqgl.AttConditions;
import cn.timer.api.bean.kqgl.AttGroupBinPunchMode; import cn.timer.api.bean.kqgl.AttGroupBinPunchMode;
import cn.timer.api.bean.kqgl.AttendanceGroup;
import cn.timer.api.bean.kqgl.AttendanceMachine; import cn.timer.api.bean.kqgl.AttendanceMachine;
import cn.timer.api.bean.kqgl.AttendanceWeeklySch;
import cn.timer.api.bean.kqgl.PunchCardAddress; import cn.timer.api.bean.kqgl.PunchCardAddress;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchCardWiFi; import cn.timer.api.bean.kqgl.PunchCardWiFi;
import cn.timer.api.dto.kqmk.PunchRecord; import cn.timer.api.bean.kqgl.Schedule;
import cn.timer.api.bean.kqgl.ShiftManagement;
import cn.timer.api.bean.kqmk.KqglAssoBcsz; import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkjl; import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx; import cn.timer.api.bean.kqmk.KqglAssoDkmx;
import cn.timer.api.bean.kqmk.KqglAssoKqj; import cn.timer.api.bean.kqmk.KqglAssoKqj;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs; import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
import cn.timer.api.bean.kqmk.KqglAssoPbmx;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu; import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban; import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz; import cn.timer.api.bean.kqmk.KqglMainKqz;
...@@ -41,17 +47,16 @@ import cn.timer.api.config.annotation.CurrentUser; ...@@ -41,17 +47,16 @@ import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.exception.CustomException; import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqgl.AttGroupBinPunchModeMapper; import cn.timer.api.dao.kqgl.AttGroupBinPunchModeMapper;
import cn.timer.api.dao.kqgl.AttendanceGroupMapper;
import cn.timer.api.dao.kqgl.AttendanceMachineMapper; import cn.timer.api.dao.kqgl.AttendanceMachineMapper;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardAddressMapper; import cn.timer.api.dao.kqgl.PunchCardAddressMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchCardWiFiMapper; import cn.timer.api.dao.kqgl.PunchCardWiFiMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper; import cn.timer.api.dao.kqgl.ScheduleMapper;
import cn.timer.api.dao.kqgl.ShiftManagementMapper;
import cn.timer.api.dao.kqmk.KqglAssoBcszMapper; import cn.timer.api.dao.kqmk.KqglAssoBcszMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper; import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper; import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper; import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoTeshuMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper; import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqmk.AttClockMethod; import cn.timer.api.dto.kqmk.AttClockMethod;
import cn.timer.api.dto.kqmk.AttLateLate; import cn.timer.api.dto.kqmk.AttLateLate;
...@@ -59,6 +64,7 @@ import cn.timer.api.dto.kqmk.AttSchedule; ...@@ -59,6 +64,7 @@ import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttendanceCardListDto; import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.dto.kqmk.ClockCollectData; import cn.timer.api.dto.kqmk.ClockCollectData;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto; import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.WorkbenchCalendarDto;
import cn.timer.api.utils.DateUtil; import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -1277,436 +1283,813 @@ public class ClockInController { ...@@ -1277,436 +1283,813 @@ public class ClockInController {
/************************************************************************** APP打卡 *************************************************************************************************************/ /************************************************************************** APP打卡 *************************************************************************************************************/
/************************************************************************************************************************************************************************************************/ /************************************************************************************************************************************************************************************************/
//考勤组
@Autowired
private AttendanceGroupMapper attendancegroupmapper;
//班次
@Autowired
private ShiftManagementMapper shiftmanagementmapper;
//打卡明细表
@Autowired
private PunchCardDetailsMapper punchcarddetailsmapper;
//打卡记录
@Autowired
private PunchRecordMapper punchrecordmapper;
/** /**
* 考勤打卡------APP打卡 * 考勤打卡------APP打卡
* @throws ParseException
*/ */
@PostMapping(value = "/AttendanceCard") @PostMapping(value = "/AttendanceCard")
@ApiOperation(value = "考勤打卡------APP打卡", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "考勤打卡------APP打卡", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public Result<Void> AttendanceCard(@CurrentUser UserBean userBean,@RequestBody ClockCollectData clock) { public Result<Object> AttendanceCard(@CurrentUser UserBean userBean,@RequestBody ClockCollectData clock) throws ParseException {
int qyid = userBean.getOrgCode();//坏小孩【企业id】 //当前时间
int userid = userBean.getEmpNum();//用户id String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
AttendanceGroup attgro = attendancegroupmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息 //当前用户打卡时间
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时 String sStdIoTime = clock.getPunchtime();
String putime = new SimpleDateFormat("yyyy-MM-dd").format(Double.valueOf(clock.getPunchtime()));//转换打卡时间格式 //基于当前的前一天时间 和当天开始与结束时间戳
Long startDate = 0l;//打卡当天开始时间 String yesterday = ClockInTool.requires_extra_times(current,-1,3,1);
Long endDate = 0l;//打卡当天结束时间 Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
try { Long endDateyesterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
} catch (ParseException e) {
e.printStackTrace();
}
ShiftManagement shif = null; Long attendance_date = 0l;//考勤日期
if(clock.getShifid() > 0){//有无班次 String toweek = "";
shif = shiftmanagementmapper.selectByPrimaryKey(clock.getShifid());
}
int dkmx = 0; String msg = "未知错误,请联系管理员";
PunchCardDetails dkmc = punchcarddetailsmapper.SingleAttendanceDays(userid,startDate,endDate);//查询打卡当天是否有记录 int sbyf = 1;//0:失败;1:成功
if(dkmc != null){//有记录就修改之前的 YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, clock.getUserid()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
//修改 if(user != null) {
dkmx = dkmc.getId(); int qyid = user.getOrgCode();
PunchCardDetails pcd = new PunchCardDetails(); int userid = user.getEmpNum();
if(clock.getType() == 1){
if(clock.getDiffer() == 1){//打卡
if(!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null){
return ResultUtil.error("重复打卡");
}
}else{//更新打卡
pcd.setId(dkmc.getId());
pcd.setSbdk1(Long.valueOf(clock.getPunchtime()));//上班1打卡时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60;
if(time > 0){
pcd.setSbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果
}else{
pcd.setSbdk1jg(0);// 打卡结果
}
}
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}
}else if(clock.getType() == 2){ // AttendanceGroup attgro = attendancegroupmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
if(("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null){ KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
pcd.setXbdk1(Long.valueOf(clock.getPunchtime()));//下班1打卡时间 // pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时]
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; long time_ = DateUtil.getStringTime(clock.getPunchtime(), "yyyy-MM-dd HH:mm:ss");//打卡时间戳
if(time > 0){ String putime = new SimpleDateFormat("yyyy-MM-dd").format(Double.valueOf(clock.getPunchtime()));//转换打卡时间格式
pcd.setXbdk1jg(0);// 打卡结果
}else{ Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();//打卡当天开始时间
pcd.setXbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果 Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();//打卡当天结束时间
}
} int dkmx = 0;//打卡明细id
}else{ int atttype = 0;//打卡顺序
int shifid = 0;//班次id
if(clock.getDiffer() == 1){//打卡 boolean isRange = true;//是否在打卡时间范围内
return ResultUtil.error("重复打卡"); int execution_status = 0;//执行状态
}else{//更新打卡 boolean kskd = true;//识别是否更新最后一次打卡 针对于最后一次下班卡
pcd.setId(dkmc.getId()); boolean sbdkkd = false;//针对于上班 未超过上班卡打卡 视为无效打卡
pcd.setXbdk1(Long.valueOf(clock.getPunchtime()));//下班1打卡时间 long punchcardtime = 0,punchstart = 0,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时]
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; ClockCollectData clockt = new ClockCollectData();
if(time > 0){ // putime: 根据日期 得到打卡所需的详细信息
pcd.setXbdk1jg(0);// 打卡结果 AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
}else{ if(attgro != null) {//判断考勤组是否存在
pcd.setXbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果
} if(attdate.getAttgrouptype() != 3) {
//查询打卡当天是否有记录**********************************
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build();
String dakariqi = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDateyesterday))+" "+ClockInTool.dateToWeek2(yesterday);
//检查昨日的班次是否存在次日打卡
KqglAssoDkjl balan = kqglassodkjlmapper.selectOne(new QueryWrapper<KqglAssoDkjl>().lambda().eq(KqglAssoDkjl::getUserId, userid).eq(KqglAssoDkjl::getAttdate, dakariqi).ne(KqglAssoDkjl::getBcid, 0).orderByDesc(KqglAssoDkjl :: getSort).last("LIMIT 1"));
boolean dnck = false;
boolean crdk = false;//当次打卡是否存在次日打卡
if(balan != null) {//前一天是否打过卡 去班次id查询是否存在次日打卡
//班次信息
KqglAssoBcsz shif = kqglassobcszmapper.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, balan.getBcid()));
int dkcs = shif.getSxbcs()*2;
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
if(ashss.size() > 0) {
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(ashss.get(0).getTime())));//当天应打的首次上班卡时间
Date sd2=df1.parse(current_time);//当前时间
if(sd1.after(sd2)) {
dnck = true;
}
} }
//班次为2次时,计算工作时长 int isXbdk1Cr = shif.getIsXbdk1Cr();//下班1是否次日(0:否;1:是)
if(dkmc.getSbdk1() != null){ int isSbdk2Cr = shif.getIsSbdk2Cr();//上班2是否次日(0:否;1:是)
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk1())/1000/60; int isXbdk2Cr = shif.getIsXbdk2Cr();//下班2是否次日(0:否;1:是)
pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长 int isSbdk3Cr = shif.getIsSbdk3Cr();//上班3是否次日(0:否;1:是)
int isXbdk3Cr = shif.getIsXbdk3Cr();//下班3是否次日(0:否;1:是)
if(balan.getSort() < dkcs) {
if(balan.getSort()+1 == 2 && dkcs == 2) {
//次日
if(isXbdk1Cr > 0) { crdk = true; }
}
if(balan.getSort()+1 == 3 && dkcs == 4) {
if(isSbdk2Cr > 0) {crdk = true; }
}
if(balan.getSort()+1 == 4 && dkcs == 4) {
if(isXbdk2Cr > 0) { crdk = true; }
}
if(balan.getSort()+1 == 5 && dkcs == 6) {
if(isSbdk3Cr > 0) { crdk = true; }
}
if(balan.getSort()+1 == 6 && dkcs == 6) {
if(isXbdk3Cr > 0) { crdk = true; }
}
} }
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 }else {
//无记录的话就找昨天的数据
// AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
} }
} if(crdk && dnck) {
//班次为2次时,计算工作时长 dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
if(dkmc.getSbdk1() != null){ .ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk1())/1000/60; attdate = MethodCall(qyid,userid,yesterday);
pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长 attendance_date = startDateyesterday;
} toweek = yesterday;
}else if(clock.getType() == 3){ }else {
if(("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null){ dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
pcd.setSbdk2(Long.valueOf(clock.getPunchtime()));//上班2打卡时间 .ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时] attendance_date = startDate;
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; toweek = putime;
if(time > 0){ }
pcd.setSbdk2jg(Math.abs(Integer.valueOf(time.toString())));//上班2打卡结果
}else{ if(EmptyUtil.isEmpty(attdate.getAttsch())) {
pcd.setSbdk2jg(0);// 打卡结果 msg = "当前未排班";
} sbyf = 0;
} }else {
}else{
if(clock.getDiffer() == 1){//打卡 long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
return ResultUtil.error("重复打卡"); endtime3 = 0,endtime3ks = 0,endtime3js = 0;
}else{ if(attdate.getAttsch().size() > 0) {
pcd.setId(dkmc.getId()); List<AttSchedule> ash = attdate.getAttsch();
pcd.setSbdk2(Long.valueOf(clock.getPunchtime()));//上班2打卡时间 int y = 0;
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时] clockt.setShifid(ash.get(y).getId());
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; shifid = ash.get(y).getId();//班次id
if(time > 0){ if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
pcd.setSbdk2jg(Math.abs(Integer.valueOf(time.toString())));//上班2打卡结果 starttime1 = ash.get(0).getTime();starttime1ks = ash.get(0).getStarttime();starttime1js = ash.get(0).getEndtime();
}else{ endtime1 = ash.get(1).getTime();endtime1ks = ash.get(1).getStarttime();endtime1js = ash.get(1).getEndtime();
pcd.setSbdk2jg(0);// 打卡结果
} }
} if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 starttime2 = ash.get(2).getTime();starttime2ks = ash.get(2).getStarttime();starttime2js = ash.get(2).getEndtime();
} endtime2 = ash.get(3).getTime();endtime2ks = ash.get(3).getStarttime();endtime2js = ash.get(3).getEndtime();
} }
}else if(clock.getType() == 4){ if(attdate.getAttsch().size() == 6) {
if(("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null){ starttime3 = ash.get(4).getTime();starttime3ks = ash.get(4).getStarttime();starttime3js = ash.get(4).getEndtime();
pcd.setXbdk2(Long.valueOf(clock.getPunchtime()));//下班2打卡时间 endtime3 = ash.get(5).getTime();endtime3ks = ash.get(5).getStarttime();endtime3js = ash.get(5).getEndtime();
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时]
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60;
if(time > 0){
pcd.setXbdk2jg(0);// 打卡结果
}else{
pcd.setXbdk2jg(Math.abs(Integer.valueOf(time.toString())));//下班2打卡结果
}
}
}else{
if(clock.getDiffer() == 1){//打卡
return ResultUtil.error("重复打卡");
}else{
pcd.setId(dkmc.getId());
pcd.setXbdk2(Long.valueOf(clock.getPunchtime()));//下班2打卡时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时]
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60;
if(time > 0){
pcd.setXbdk2jg(0);// 打卡结果
}else{
pcd.setXbdk2jg(Math.abs(Integer.valueOf(time.toString())));//下班2打卡结果
} }
if(dkmc == null) {
kskd = false;
if(attdate.getAttsch().size() == 2) {//一套上下班 上班1
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(starttime1)));//应打卡时间
Date sd2=df1.parse(sStdIoTime);//打卡时间
Date sd3=df1.parse(ClockInTool.stampToDate(String.valueOf(endtime1)));//应打卡时间
if(sd2.before(sd3)) {
atttype = 1;
}
if(sd2.after(sd1) && sd2.after(sd3)) {
atttype = 2;
}
}else {
boolean getinto = true;
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
//punchstart 应打卡开始时间 punchend:应打卡结束时间 time_:打卡时间
if(clock.getType() == 1) {
boolean effectiveDate1 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate1) {//在范围内就打卡
atttype = clock.getType();
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}else if(clock.getType() == 2){
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡
atttype = clock.getType();
isRange = true;//在范围
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}else if(clock.getType() == 3) {
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡
atttype = clock.getType();
isRange = true;//在范围
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}else if(clock.getType() == 4) {
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡
atttype = clock.getType();
isRange = true;//在范围
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}
}
if(attdate.getAttsch().size() == 6) {
if(clock.getType() == 5) {
boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate5) {//在范围内就打卡
atttype = clock.getType();
isRange = true;//在范围
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}else if(clock.getType() == 6) {
boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate6) {//在范围内就打卡
atttype = clock.getType();
isRange = true;//在范围
getinto = false;
}else {
if(getinto) {
isRange = false;
}
}
}
}
}
execution_status = 1;
}else {
execution_status = 2;
if(attdate.getAttsch().size() == 2) { //下班1
if(clock.getType() == 1) {
if(clock.getDiffer() == 2) {//更新打卡
//如果第二次后打卡,未超过上班时间 即为打卡失效
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(starttime1)));//应打卡时间
Date sd2=df1.parse(sStdIoTime);//打卡时间
if(sd1.after(sd2)) {
sbdkkd = true;//打卡无效
atttype = 1;
}
}
}else if(clock.getType() == 2){
if(dkmc.getSbdk1() != null && dkmc.getXbdk1() == null){
kskd = false;
}else {
//最后一次卡的时候 再继续打视为更新最后一次打卡
kskd = true;
}
atttype = clock.getType();
}
}
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
if(clock.getType() == 1) {
boolean effectiveDate1 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate1) {//在范围内就打卡
if(dkmc.getSbdk1() != null) {
sbdkkd = true;//打卡无效
}
atttype = clock.getType();
}else {
isRange = false;
}
}else if(clock.getType() == 2) {
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡
if(dkmc.getXbdk1() != null) {
kskd = true;
}else {
kskd = false;
atttype = clock.getType();
}
}else {
isRange = false;
}
}else if(clock.getType() == 3) {
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡
if(dkmc.getSbdk2() != null) {
sbdkkd = true;//
}
atttype = clock.getType();
}else {
isRange = false;
}
}else if(clock.getType() == 4) {
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡
if(dkmc.getXbdk2() != null) {
kskd = true;
}else {
kskd = false;
atttype = clock.getType();
}
}else {
isRange = false;
}
}
}
if(attdate.getAttsch().size() == 6) {
if(clock.getType() == 5) {
boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate5) {//在范围内就打卡
if(dkmc.getSbdk2() != null) {
sbdkkd = true;//
}
atttype = clock.getType();
}else { isRange = false; }
}else if(clock.getType() == 6) {
boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate6) {//在范围内就打卡
if(dkmc.getXbdk2() != null) {
kskd = true;
}else {
kskd = false;
atttype = clock.getType();
}
}else { isRange = false; }
}
}
}
} }
//班次为4次时,计算工作时长 if(atttype == 1) {
if(dkmc.getSbdk2() != null){ punchcardtime = starttime1; punchstart = starttime1ks; punchend = starttime1js;
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk2())/1000/60; }else if(atttype == 2) {
BigDecimal om = new BigDecimal(dkmc.getGzsc()); punchcardtime = endtime1; punchstart = endtime1ks; punchend = endtime1js;
BigDecimal on = new BigDecimal(time); }else if(atttype == 3) {
double worktime = Math.abs(om.add(on).doubleValue()); punchcardtime = starttime2; punchstart = starttime2ks; punchend = starttime2js;
pcd.setGzsc(worktime); }else if(atttype == 4) {
} punchcardtime = endtime2; punchstart = endtime2ks; punchend = endtime2js;
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 }else if(atttype == 5) {
} punchcardtime = starttime3; punchstart = starttime3ks; punchend = starttime3js;
} }else if(atttype == 6) {
//班次为4次时,计算工作时长 punchcardtime = endtime3; punchstart = endtime3ks; punchend = endtime3js;
if(dkmc.getSbdk2() != null){ }
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc()); if(clockt.getShifid() != 0) {
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue()); KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
pcd.setGzsc(worktime); if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次
} shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid()));
}else if(clock.getType() == 5){ }
if(("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null){ //打卡记录录入 -- 打卡是否有时间范围限制
pcd.setSbdk3(Long.valueOf(clock.getPunchtime()));//上班3打卡时间 if(attdate.getAttsch().size() == 2) {
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时] if(punchstart>0 && punchend>0) {
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; String staputime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(punchstart);//应打卡开始时间
if(time > 0){ String entputime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(punchend);//应打卡结束时间
pcd.setSbdk3jg(Math.abs(Integer.valueOf(time.toString())));//上班3打卡结果 String DKputime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_);//打卡时间
}else{ boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime,"yyyy-MM-dd HH:mm");
pcd.setSbdk3jg(0);// 打卡结果 if (!effectiveDate) {
} System.out.println("当前打卡时间不在范围内");
} isRange = false;
}else{ }
if(clock.getDiffer() == 1){//打卡 }
return ResultUtil.error("重复打卡");
}else{
pcd.setId(dkmc.getId());
pcd.setSbdk3(Long.valueOf(clock.getPunchtime()));//上班3打卡时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时]
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60;
if(time > 0){
pcd.setSbdk3jg(Math.abs(Integer.valueOf(time.toString())));//上班3打卡结果
}else{
pcd.setSbdk3jg(0);// 打卡结果
} }
} if(isRange) {
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 int yzcd = shif.getYzcdfzs();//严重迟到分钟数
} int kgcdfzs = shif.getKgcdfzs();//旷工迟到分钟数
}
}else if(clock.getType() == 6){ //班次的休息时间
if(("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null){ long rest_time = 0;
pcd.setXbdk3(Long.valueOf(clock.getPunchtime()));//下班3打卡时间 if(shif.getStartTime() != null && shif.getEndTime() != null) {
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时] long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(putime + " " +shif.getStartTime()+":00"));
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(putime + " " +shif.getEndTime()+":00"));
if(time > 0){ rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
pcd.setXbdk3jg(0);// 打卡结果 }
}else{
pcd.setXbdk3jg(Math.abs(Integer.valueOf(time.toString())));//下班3打卡结果 if(execution_status == 1) {//上班1 ****新增
} KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).qyid(qyid).dksj(startDate).build();
} int sbdkjg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
}else{ if(punchcardtime != 0){//有应打卡时间时
if(clock.getDiffer() == 1){//打卡 Long time = (time_ - punchcardtime)/1000/60;
return ResultUtil.error("重复打卡"); if((atttype)%2 > 0){//上班
}else{ if(time > 0){
pcd.setId(dkmc.getId()); sbdkjg = Integer.valueOf(time.toString());
pcd.setXbdk3(Long.valueOf(clock.getPunchtime()));//下班3打卡时间 }// 打卡结果
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时[有班次时] }else{//下班
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; if(time > 0){}else{
if(time > 0){ sbdkjg = Math.abs(Integer.valueOf(time.toString()));
pcd.setXbdk3jg(0);// 打卡结果 }// 打卡结果
}else{ }
pcd.setXbdk3jg(Math.abs(Integer.valueOf(time.toString())));//下班3打卡结果 }
if(atttype == 1) {
pcd.setSbdk1(time_); pcd.setSbdk1jg(sbdkjg);
}else if(atttype == 2) {
pcd.setXbdk1(time_); pcd.setXbdk1jg(sbdkjg);
}else if(atttype == 3) {
pcd.setSbdk2(time_); pcd.setSbdk2jg(sbdkjg);
}else if(atttype == 4) {
pcd.setXbdk2(time_); pcd.setXbdk2jg(sbdkjg);
}else if(atttype == 5) {
pcd.setSbdk3(time_); pcd.setSbdk3jg(sbdkjg);
}else if(atttype == 6) {
pcd.setXbdk3(time_); pcd.setXbdk3jg(sbdkjg);
}
int ydkcs = 0;
if(shif != null){ydkcs = shif.getSxbcs()*2;}//应打卡次数
if(sbdkjg > yzcd && yzcd>0) {
yzcdcs++;
yzcdsc = sbdkjg - yzcd;
}
if(sbdkjg > kgcdfzs && kgcdfzs>0) {kgcdcs++;}
pcd.setYdkcs(ydkcs);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
}else if(execution_status == 2){
dkmx = dkmc.getId();
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
if(atttype == 2){//下班1
pcd.setId(dkmc.getId());
pcd.setXbdk1(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){
pcd.setXbdk1jg(0);// 打卡结果
}else{
pcd.setXbdk1jg(Math.abs(Integer.valueOf(time.toString())));
}
}
if(dkmc.getSbdk1() != null){
Long time = (time_ - dkmc.getSbdk1())/1000/60 - rest_time;
pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if(atttype == 3){//上班2
int sbdk2jg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk2jg = Math.abs(Integer.valueOf(time.toString()));}
}
if(sbdk2jg > yzcd&& yzcd>0) {
yzcdcs = dkmc.getYzcdcs()+1;
yzcdsc = sbdk2jg - yzcd;
}
if(sbdk2jg > kgcdfzs&& kgcdfzs>0) {kgcdcs++;}
pcd.setId(dkmc.getId());
pcd.setSbdk2(time_);//上班1打卡时间
pcd.setSbdk2jg(sbdk2jg);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if(atttype == 4){//下班2
pcd.setId(dkmc.getId());
pcd.setXbdk2(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){
pcd.setXbdk2jg(0);// 打卡结果
}else{
pcd.setXbdk2jg(Math.abs(Integer.valueOf(time.toString())));
}
}
//班次为4次时,计算工作时长
if(dkmc.getSbdk2() != null){
Long time = (time_ - dkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
BigDecimal worktime_ = new BigDecimal(Math.abs(om.add(on).doubleValue()));
BigDecimal xx = new BigDecimal(rest_time);
double worktime = Math.abs(worktime_.subtract(xx).doubleValue());
pcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if(atttype == 5){//上班3
int sbdk3jg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk3jg = Math.abs(Integer.valueOf(time.toString()));}
}
if(sbdk3jg > yzcd&& yzcd>0) {
yzcdcs = dkmc.getYzcdcs()+1;
yzcdsc = sbdk3jg - yzcd;
}
if(sbdk3jg > kgcdfzs&& kgcdfzs>0) {kgcdcs++;}
pcd.setId(dkmc.getId());
pcd.setSbdk3(time_);//上班1打卡时间
pcd.setSbdk3jg(sbdk3jg);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if(atttype == 6){//下班3
pcd.setId(dkmc.getId());
pcd.setXbdk3(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){
pcd.setXbdk3jg(0);// 打卡结果
}else{
pcd.setXbdk3jg(Math.abs(Integer.valueOf(time.toString())));
}
}
//班次为6次时,计算工作时长
if(dkmc.getSbdk3() != null){
Long time = (time_ - dkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
BigDecimal worktime_ = new BigDecimal(Math.abs(om.add(on).doubleValue()));
BigDecimal xx = new BigDecimal(rest_time);
double worktime = Math.abs(worktime_.subtract(xx).doubleValue());
pcd.setGzsc(worktime);
}
}
pcd.setId(dkmc.getId());
if(atttype <= 6 && atttype > 0 && !sbdkkd){
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}
}
}else {
msg = "当前打卡时间不在范围内";
sbyf = 0;
} }
}else {
msg = "当前是休息时间";
sbyf = 0;
}
}
}else {
//需要再次调整********************
//自由工时打卡
Long stapclotime = attdate.getStapclotime();// 今天考勤 自由排班开始时间
int canpunchworkdate = Integer.valueOf(String.valueOf(attdate.getCanpunchworkdate()).replaceAll("(\\d+)(?:(\\.\\d*[^0])|\\.)0*", "$1$2"));// 上班打卡后多久大下班卡
KqglAssoDkmx zydkmc = KqglAssoDkmx.builder().build();
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(stapclotime)));//应打卡时间 2020-06-10 18:30:00
Date sd2=df1.parse(current_time);//当前时间 2020-06-10 16:06:58
if(sd1.after(sd2)) {//为true时 打的是昨天的卡
zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attendance_date = startDateyesterday;
toweek = yesterday;
}else {
zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
attendance_date = startDate;
toweek = putime;
}
if(zydkmc == null) {//新增
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
if(sd1.after(sd2)) {
pcd = KqglAssoDkmx.builder().userid(userid).data(yesterday).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDateyesterday).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
}else {
pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
}
// KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
} }
//班次为6次时,计算工作时长 dkmx = pcd.getId();
if(dkmc.getSbdk3() != null){ atttype = 1;
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk3())/1000/60; }else {//修改
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次 dkmx = zydkmc.getId();
BigDecimal on = new BigDecimal(time); KqglAssoDkmx zypcd = KqglAssoDkmx.builder().build();
double worktime = Math.abs(om.add(on).doubleValue()); if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() == null)){//下班1
pcd.setGzsc(worktime); String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk1())),canpunchworkdate,5,2);
} Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
punchcarddetailsmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 Date zysd2=df1.parse(current_time);//当前时间
} if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
} msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
//班次为6次时,计算工作时长 sbyf = 0;
if(dkmc.getSbdk3() != null){ }else {
Long time = (Long.valueOf(clock.getPunchtime()) - dkmc.getSbdk3())/1000/60; zypcd.setId(zydkmc.getId());
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次 zypcd.setXbdk1(time_);//下班1打卡时间
BigDecimal on = new BigDecimal(time); if(zydkmc.getSbdk1() != null){
double worktime = Math.abs(om.add(on).doubleValue()); Long time = (time_ - zydkmc.getSbdk1())/1000/60;
pcd.setGzsc(worktime); zypcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
} }
} kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
pcd.setId(dkmc.getId()); }
if(clock.getType() <= 6){ atttype = 2;
int update = punchcarddetailsmapper.updateByPrimaryKeySelective(pcd); }else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
} && (("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() == null)){//上班2
zypcd.setId(zydkmc.getId());
}else{//没有数据就新增一条数据 zypcd.setSbdk2(time_);//上班1打卡时间
//新增 kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
if(clock.getDiffer() == 1){//打卡 atttype = 3;
PunchCardDetails pcd = new PunchCardDetails(); }else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
pcd.setUserid(userid); && (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() == null)){//下班2
pcd.setData(putime);//打卡日期(yyyy-MM-dd) String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk2())),canpunchworkdate,5,2);
if(clock.getType() == 1){ Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
pcd.setSbdk1(Long.valueOf(clock.getPunchtime()));//上班1打卡时间 Date zysd2=df1.parse(current_time);//当前时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
if(time > 0){ sbyf = 0;
pcd.setSbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果 }else {
}else{ zypcd.setId(zydkmc.getId());
pcd.setSbdk1jg(0);// 打卡结果 zypcd.setXbdk2(time_);//下班1打卡时间
} //班次为4次时,计算工作时长
} if(zydkmc.getSbdk2() != null){
}else if(clock.getType() == 2){ Long time = (time_ - zydkmc.getSbdk2())/1000/60;
pcd.setXbdk1(Long.valueOf(clock.getPunchtime()));//下班1打卡时间 BigDecimal om = new BigDecimal(zydkmc.getGzsc());
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 BigDecimal on = new BigDecimal(time);
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; double worktime = Math.abs(om.add(on).doubleValue());
if(time > 0){ zypcd.setGzsc(worktime);
pcd.setXbdk1jg(0);// 打卡结果 }
}else{ kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
pcd.setXbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果 }
} atttype = 4;
} }else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
}else if(clock.getType() == 3){ && (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
pcd.setSbdk2(Long.valueOf(clock.getPunchtime()));//上班1打卡时间 && (("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() == null)){//上班3
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 zypcd.setId(zydkmc.getId());
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; zypcd.setSbdk3(time_);//上班1打卡时间
if(time > 0){ kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
pcd.setSbdk2jg(Math.abs(Integer.valueOf(time.toString()))); atttype = 5;
}else{ }else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
pcd.setSbdk2jg(0);// 打卡结果 && (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
} && (!("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() != null) && (("").equals(zydkmc.getXbdk3()) || zydkmc.getXbdk3() == null)){//下班3
} String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk3())),canpunchworkdate,5,2);
}else if(clock.getType() == 4){ Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
pcd.setXbdk2(Long.valueOf(clock.getPunchtime()));//下班1打卡时间 Date zysd2=df1.parse(current_time);//当前时间
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
if(time > 0){ sbyf = 0;
pcd.setXbdk2jg(0);// 打卡结果 }else {
}else{ zypcd.setId(zydkmc.getId());
pcd.setXbdk2jg(Math.abs(Integer.valueOf(time.toString()))); zypcd.setXbdk3(time_);//下班1打卡时间
} //班次为6次时,计算工作时长
} if(zydkmc.getSbdk3() != null){
}else if(clock.getType() == 5){ Long time = (time_ - zydkmc.getSbdk3())/1000/60;
pcd.setSbdk3(Long.valueOf(clock.getPunchtime()));//上班1打卡时间 BigDecimal om = new BigDecimal(zydkmc.getGzsc());//第二次
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 BigDecimal on = new BigDecimal(time);
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; double worktime = Math.abs(om.add(on).doubleValue());
if(time > 0){ zypcd.setGzsc(worktime);
pcd.setSbdk3jg(Math.abs(Integer.valueOf(time.toString()))); }
}else{ kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
pcd.setSbdk3jg(0);// 打卡结果 }
}
} atttype = 6;
}else if(clock.getType() == 6){ }else {
pcd.setXbdk3(Long.valueOf(clock.getPunchtime()));//下班1打卡时间 atttype = 7;
if(!("0").equals(clock.getPunchcardtime())){//有应打卡时间时 }
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; }
if(time > 0){
pcd.setXbdk3jg(0);// 打卡结果
}else{
pcd.setXbdk3jg(Math.abs(Integer.valueOf(time.toString())));
}
}
}
if(shif != null){
pcd.setYdkcs(shif.getSxbcs()*2);//应打卡次数
} }
pcd.setQyid(qyid);//企业id
pcd.setDksj(startDate);//打卡时间
punchcarddetailsmapper.insertSelective(pcd); /*****************************************************************************************************************************************************************************************************/
/*******************************************************************APP 原始打卡记录数据录入**************************************************************************************************************/
/*****************************************************************************************************************************************************************************************************/
dkmx = pcd.getId(); String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(attendance_date));//转换打卡时间格式
}
} //true:确认为最后一次打卡更新打卡时 之前打卡的一条数据变为“打卡更新数据”
if(kskd && (atttype == 2 || atttype == 4 || atttype == 6)) {
KqglAssoDkjl dkjj = KqglAssoDkjl.builder().build().selectOne(new QueryWrapper<KqglAssoDkjl>().lambda().eq(KqglAssoDkjl::getUserId, userid).eq(KqglAssoDkjl::getType, 2)
.eq(KqglAssoDkjl::getSort, atttype).eq(KqglAssoDkjl::getQyid, qyid).eq(KqglAssoDkjl::getAttdate, attdate_+" "+ClockInTool.dateToWeek2(toweek)));
// //打卡记录
// if(clock.getDiffer() == 2){//更新打卡 KqglAssoDkjl.builder().id(dkjj.getId()).status(0).sort(0).build().updateById();
// PunchRecord punch = punchrecordmapper.selectPunchResults(startDate,endDate,userid,clock.getType()); }
// if(punch != null){
// PunchRecord pr = new PunchRecord(); int results = 0;
// pr.setId(punch.getId()); Long time = (time_ - punchcardtime)/1000/60;
// pr.setStatus(0);//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:补卡 4:请假) if(punchcardtime != 0){
// pr.setSort(0);//序号(0:打卡无效:此记录已被更新) if(isRange) {
// punchrecordmapper.updateByPrimaryKeySelective(pr); if((atttype)%2 > 0){//上班
// }else{ if(time > 0){
// return ResultUtil.error("打卡失败"); results = Integer.valueOf(time.toString());
// } }// 打卡结果
// } }else{//下班
if(time > 0){}else{
PunchRecord pre = new PunchRecord(); results = Math.abs(Integer.valueOf(time.toString()));
pre.setDktime(Long.valueOf(clock.getPunchtime()));// 打卡时间 }// 打卡结果
if(clock.getPunchcardtype() == 1){ }
pre.setLon(Double.valueOf(clock.getLon()));// 经度 }
pre.setLat(Double.valueOf(clock.getLat()));// 纬度 }
pre.setAddress(clock.getAddress());// 定位地址 int type,status = 0;
} if((atttype)%2 > 0){
type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
Long time = (Long.valueOf(clock.getPunchtime()) - Long.valueOf(clock.getPunchcardtime()))/1000/60; if(attdate.getAttgrouptype() != 3) {
if(("0").equals(clock.getPunchcardtime())){ if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {
pre.setResults(0);// 打卡结果 if(punchcardtime == 0 && clockt.getShifid() != 0){
}else{ status = 1;
if((clock.getType())%2 > 0){//上班 }if(punchcardtime == 0 && clockt.getShifid() == 0) {
if(time > 0){ status = 2;
pre.setResults(Integer.valueOf(time.toString()));// 打卡结果 }else{
if(isRange) {// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
if(time > 0){
status = 3;
}else if(results == 0){
status = 1;
}
}else {
status = 2;
}
}
}else if(EmptyUtil.isEmpty(attdate.getAttsch())) {
status = 2;
}
}else {
if(sbyf == 1) {
status = 1;
}else {
status = 2;
}
}
}else{ }else{
pre.setResults(0);// 打卡结果 type = 2;// 类型(类型 0:无排班打卡 1:上班 2:下班)
if(attdate.getAttgrouptype() != 3) {
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
status = 1;
}if(punchcardtime == 0 && clockt.getShifid() == 0) {
status = 2;
}else{
if(isRange) {
if(time < 0){
status = 4;
}else if(results == 0){
status = 1;
}
}else {
status = 2;
}
}
}else if(EmptyUtil.isEmpty(attdate.getAttsch())) {
status = 2;
}
}else {
if(sbyf == 1) {
status = 1;
}else {
status = 2;
}
}
} }
}else{//下班
if(time > 0){ //第二次未超过应上班打卡时间 打卡为无效
pre.setResults(0);// 打卡结果 if(sbdkkd) {
status = 2;
atttype = 0;
msg = "已有最优的打卡记录存在";
}
long attime;
if(punchcardtime == 0){// 考勤时间(应打卡时间)
attime = new Date().getTime();
}else{ }else{
pre.setResults(Math.abs(Integer.valueOf(time.toString())));// 打卡结果 attime = punchcardtime;
} }
}
} String remarks = "";//考勤备注
String punchequipment = "";//打卡设备
pre.setUserId(userid);// 用户id
if((clock.getType())%2 > 0){ String commentary = "未知";
pre.setType(1);// 类型(类型 0:无排班打卡 1:上班 2:下班) if(sbyf == 1) {
commentary = "打卡成功";
if(("0").equals(clock.getPunchcardtime())){//无班次打卡 }else {
pre.setStatus(1); commentary = msg;
}else{
//打卡
if(time > 0){
pre.setStatus(3);// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
}else if(pre.getResults() == 0){
pre.setStatus(1);// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
} }
}
}else{
pre.setType(2);// 类型(类型 0:无排班打卡 1:上班 2:下班) KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(time_).results(results).userId(userid).type(type).status(status).sort(atttype)
if(("0").equals(clock.getPunchcardtime())){//无班次打卡 .qyid(qyid).attdate(attdate_+" "+ClockInTool.dateToWeek2(toweek)).attime(attime).dkmxid(dkmx).bcid(shifid).remarks(remarks)
pre.setStatus(1); .punchequipment(punchequipment).commentary(commentary).build();
}else{ //cardtype--1:GPS,2:WIFI,3:考勤机,4:外勤
//打卡 int cardtype = 0;
if(time < 0){ if(clock.getPunchcardtype() == 1 || clock.getPunchcardtype() == 4) {
pre.setStatus(4);// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休) pre.setAddress(clock.getAddress());
}else if(pre.getResults() == 0){ pre.setLat(Double.valueOf(clock.getLat()));
pre.setStatus(1);// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休) pre.setLon(Double.valueOf(clock.getLon()));
}else if(clock.getPunchcardtype() == 2) {
pre.setMacname(clock.getMacname());
pre.setMac(clock.getMac());
} }
} pre.setCardType(cardtype);
}
pre.setSort(clock.getType());// 序号 if (!pre.insert()) {
pre.setCardType(clock.getPunchcardtype());// 打卡类型(1:GPS,2:WIFI,3:考勤机) throw new CustomException("打卡记录-新增异常-2");
if(clock.getPunchcardtype() == 2){ }
pre.setMac(clock.getMac());// mac地址
pre.setMacname(clock.getMacname());// WIFI名称 }else {
} msg="打卡失败!,未加入考勤组!";
pre.setQyid(qyid);// 企业id sbyf = 0;
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式 }
pre.setAttdate(attdate_+" "+ClockInTool.dateToWeek2(putime));// 考勤日期 }else {
return ResultUtil.error("打卡失败!,用户不存在!");
long date = new Date().getTime(); }
if(("0").equals(clock.getPunchcardtime())){ if(sbyf == 1) {
pre.setAttime(date);// 考勤时间(应打卡时间) return ResultUtil.data(null, "打卡成功");
}else{ }else {
pre.setAttime(Long.valueOf(clock.getPunchcardtime()));// 考勤时间(应打卡时间) return ResultUtil.data(msg, "打卡失败");
} }
pre.setDkmxid(dkmx);// 打卡明细id
pre.setBcid(clock.getShifid());// 班次id
// punchrecordmapper.insertSelective(pre);//新增打卡记录
return ResultUtil.data(null,"打卡成功");
} }
...@@ -1829,76 +2212,77 @@ public class ClockInController { ...@@ -1829,76 +2212,77 @@ public class ClockInController {
List<AttSchedule> ash = attdate.getAttsch(); List<AttSchedule> ash = attdate.getAttsch();
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId())); KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.get(0).getId()));
int dkcs_ = shif.getSxbcs();//上下班打卡次数 if(shif != null) {
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是) int dkcs_ = shif.getSxbcs();//上下班打卡次数
int iswzwd = shif.getIsWzwd();//是否开启晚走晚到(0:否;1:是)
//统一分钟数
double xbwz1 = 0,xbwz2=0,xbwz3=0;
int sbwd1=0,sbwd2=0,sbwd3=0;
int arrive_late = 0;//晚到时间
String clock_date = "";//应打卡时间
Long latetime = 0l;//前天晚走时长(分钟)
KqglAssoDkmx yesterdaymx = KqglAssoDkmx.builder().build();
AttendanceCardListDto attdateyesterday;
long yesendtime1=0,yesendtime2=0,yesendtime3=0;
//存在晚走玩到
if(iswzwd > 0) {
//统一分钟数 //统一分钟数
xbwz1 = Double.valueOf(shif.getXbwz1()) * 60;//下班晚走1 double xbwz1 = 0,xbwz2=0,xbwz3=0;
sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1 int sbwd1=0,sbwd2=0,sbwd3=0;
xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2 int arrive_late = 0;//晚到时间
xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3 String clock_date = "";//应打卡时间
sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3 Long latetime = 0l;//前天晚走时长(分钟)
//获取前一天最后下班的时间 KqglAssoDkmx yesterdaymx = KqglAssoDkmx.builder().build();
yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()) AttendanceCardListDto attdateyesterday;
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday)); long yesendtime1=0,yesendtime2=0,yesendtime3=0;
attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday); //存在晚走玩到
if(iswzwd > 0) {
List<AttSchedule> ashyes = attdateyesterday.getAttsch(); //统一分钟数
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) { xbwz1 = Double.valueOf(shif.getXbwz1()) * 60;//下班晚走1
yesendtime1 = ashyes.get(1).getTime(); sbwd1 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd1()) * 60));//上班晚到1
} xbwz2 = Double.valueOf(shif.getXbwz2()) * 60;//下班晚走2
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) { sbwd2 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd2()) * 60));//上班晚到2
yesendtime2 = ashyes.get(3).getTime(); xbwz3 = Double.valueOf(shif.getXbwz3()) * 60;//下班晚走3
} sbwd3 = Integer.valueOf(String.valueOf(Double.valueOf(shif.getSbwd3()) * 60));//上班晚到3
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ashyes.get(5).getTime(); //获取前一天最后下班的时间
} yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
if(dkcs_ == 1) { attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
if(yesterdaymx.getXbdk1() != null && yesterdaymx.getXbdk1jg() == 0) {
latetime = (yesterdaymx.getXbdk1() - yesendtime1)/1000/60; List<AttSchedule> ashyes = attdateyesterday.getAttsch();
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime1 = ashyes.get(1).getTime();
} }
}else if(dkcs_ == 2){ if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
if(yesterdaymx.getXbdk2() != null && yesterdaymx.getXbdk2jg() == 0) { yesendtime2 = ashyes.get(3).getTime();
latetime = (yesterdaymx.getXbdk2() - yesendtime2)/1000/60;
} }
}else { if(attdateyesterday.getAttsch().size() == 6) {
if(yesterdaymx.getXbdk3() != null && yesterdaymx.getXbdk3jg() == 0) { yesendtime3 = ashyes.get(5).getTime();
latetime = (yesterdaymx.getXbdk3() - yesendtime3)/1000/60; }
if(dkcs_ == 1) {
if(yesterdaymx.getXbdk1() != null && yesterdaymx.getXbdk1jg() == 0) {
latetime = (yesterdaymx.getXbdk1() - yesendtime1)/1000/60;
}
}else if(dkcs_ == 2){
if(yesterdaymx.getXbdk2() != null && yesterdaymx.getXbdk2jg() == 0) {
latetime = (yesterdaymx.getXbdk2() - yesendtime2)/1000/60;
}
}else {
if(yesterdaymx.getXbdk3() != null && yesterdaymx.getXbdk3jg() == 0) {
latetime = (yesterdaymx.getXbdk3() - yesendtime3)/1000/60;
}
} }
} if(latetime != 0) {
if(latetime != 0) { latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟)
latetime_ = Double.valueOf(String.valueOf(latetime));//前天晚走时长(分钟) if(latetime_ > xbwz1 && latetime_ < xbwz2) {
if(latetime_ > xbwz1 && latetime_ < xbwz2) { arrive_late = sbwd1;
arrive_late = sbwd1; }else if(latetime_ > xbwz2 && latetime_ < xbwz3) {
}else if(latetime_ > xbwz2 && latetime_ < xbwz3) { arrive_late = sbwd2;
arrive_late = sbwd2; }else if(latetime_ > xbwz3) {
}else if(latetime_ > xbwz3) { arrive_late = sbwd3;
arrive_late = sbwd3; }
//ash.get(0).getTime():当天第一次应打卡时间
clock_date = ClockInTool.stampToDate(String.valueOf(ash.get(0).getTime()));
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_date, "+"+arrive_late)));//晚到后应打卡时间
} }
//ash.get(0).getTime():当天第一次应打卡时间
clock_date = ClockInTool.stampToDate(String.valueOf(ash.get(0).getTime()));
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_date, "+"+arrive_late)));//晚到后应打卡时间
} }
} attdate.setLatetime(latetime_);
attdate.setLatetime(latetime_); attdate.setChanged_time(changed_time);
attdate.setChanged_time(changed_time); }
return ResultUtil.data(attdate); return ResultUtil.data(attdate);
}else { }else {
...@@ -1907,5 +2291,276 @@ public class ClockInController { ...@@ -1907,5 +2291,276 @@ public class ClockInController {
return ResultUtil.data(attdate_,"未加入考勤组"); return ResultUtil.data(attdate_,"未加入考勤组");
} }
} }
private SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd");
@Autowired
private KqglAssoTeshuMapper kqglassoteshumapper;
@Autowired
private AttendanceWeeklySchMapper attendanceweeklyschmapper;
@Autowired
private ScheduleMapper schedulemapper;
/**
* APP 手机日历数据
* @param userBean
* @return
* @throws ParseException
*/
@GetMapping(value = "/workbench_calendar/{date}")
@ApiOperation(value = "手机日历数据", httpMethod = "GET", notes = "查询数据")
public Result<Object> Workbench_calendar(@CurrentUser UserBean userBean,@PathVariable("date") String date) throws ParseException {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String yue = new SimpleDateFormat("yyyy-MM").format(new Date());
SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM");
Date date_;
try {
date_ = df1.parse(date);
}catch (ParseException e){
e.printStackTrace();
date_=new Date();
}
int dateOne= ClockInTool.getYearMonth(date_);
int dangqian = ClockInTool.getYearMonth(new Date());//当前
List<WorkbenchCalendarDto> workcal = new ArrayList<WorkbenchCalendarDto>();
if(dateOne<=dangqian){
Long startMonth = 0l;
Long endMonth = 0l;
if(date == null || ("").equals(date)) {
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);//设置为1号,当前日期既为本月第一天
String first = mat.format(c.getTime());
startMonth = DateUtil.getStartTime(0,DateUtil.getStringTime(first,"yyyy-MM-dd")).getTime();
endMonth = new Date().getTime();
}else {
String time = date+"-01";
String sdaet = ClockInTool.getMinMonthDate(time);
startMonth = ClockInTool.getStartTime(0,ClockInTool.getStringTime(sdaet,"yyyy-MM-dd")).getTime();
String edate = ClockInTool.getMaxMonthDate(time);
endMonth = ClockInTool.getnowEndTime(23,ClockInTool.getStringTime(edate,"yyyy-MM-dd")).getTime();
if(date.equals(yue)) {
endMonth = new Date().getTime();
}
}
String[] rangeArray=ClockInTool.listToString(ClockInTool.getDays(df.format(startMonth),df.format(endMonth))).split(";");//目前为止所有日期
String[] range=rangeArray[0].split(",");
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息
for(String num : range) {
Long start_time = DateUtil.getStartTime(0,DateUtil.getStringTime(num,"yyyy-MM-dd")).getTime();
Long end_time = DateUtil.getnowEndTime(23,DateUtil.getStringTime(num,"yyyy-MM-dd")).getTime();
WorkbenchCalendarDto wocal = WorkbenchCalendarDto.builder().build();
wocal.setDate(num);
if(attgro != null) {//有无考勤组
AttendanceCardListDto attdate = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),num);//获取当天所打卡班次
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {//班次不为空
if(ashss.get(0).getId() != 0) {
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode())
.ge(KqglAssoDkmx::getDksj, start_time).le(KqglAssoDkmx::getDksj, end_time));
if(dkmc != null) {
if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
if(dkmc.getSbdk1() != null && dkmc.getSbdk1jg() == 0 && dkmc.getXbdk1() != null && dkmc.getXbdk1jg() == 0) {
wocal.setCalendar_status(1);//打卡正常
}else {
wocal.setCalendar_status(3);//打卡异常
}
}
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
if(dkmc.getSbdk2() != null && dkmc.getSbdk2jg() == 0 && dkmc.getXbdk2() != null && dkmc.getXbdk2jg() == 0) {
wocal.setCalendar_status(1);//打卡正常
}else {
wocal.setCalendar_status(3);//打卡异常
}
}
if(attdate.getAttsch().size() == 6) {
if(dkmc.getSbdk3() != null && dkmc.getSbdk3jg() == 0 && dkmc.getXbdk3() != null && dkmc.getXbdk3jg() == 0) {
wocal.setCalendar_status(1);//打卡正常
}else {
wocal.setCalendar_status(3);//打卡异常
}
}
KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
if(asssum != null) {
wocal.setCalendar_status(2);//事务(请假,加班,调休,出差)
}
}else {
wocal.setCalendar_status(3);//打卡异常
}
}else {
wocal.setCalendar_status(4);//休息
}
}else {
wocal.setCalendar_status(0);//无排班
}
}else {
wocal.setCalendar_status(0);//无排班
}
workcal.add(wocal);
}
//当月后续补贴数据
if(date == null || ("").equals(date) || date.equals(yue)) {
String next_day = ClockInTool.requires_extra_times(current,1,2,1);
Calendar ca = Calendar.getInstance();
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
String last = mat.format(ca.getTime());
Long endMonth_ = DateUtil.getnowEndTime(23,DateUtil.getStringTime(last,"yyyy-MM-dd")).getTime();
String[] nextrangeArray=ClockInTool.listToString(ClockInTool.getDays(next_day,sdf1.format(endMonth_))).split(";");//目前为止所有日期
String[] nextrange=nextrangeArray[0].split(",");
String ttstr = date;//
String[] ycqts = new String[31];//应上班的具体天数(yyyy-MM-dd)
String[] xxts = new String[31];//休息的具体天数(yyyy-MM-dd)
if(attgro != null){//该员工是否加入到考勤组 排班方式 1:固定排班;2:自由排班;3:自由工时 计算出应出勤,实际出勤,休息天数
if(attgro.getPbfs() == 1){ //固定排班
List<KqglAssoTeshu> bxdklist = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), ttstr,1);//当前月 必须打卡日期
int bxdk = bxdklist.size();
String[] bxdkss = new String[bxdk];////特殊-必须打卡天数(工作日)
int b = 0;
for(KqglAssoTeshu bxd : bxdklist) {
bxdkss[b] = bxd.getTsrq();
b++;
}
List<KqglAssoTeshu> wxdk = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), ttstr,2);//当前月 无需打卡日期
String[] appmaps= new String[wxdk.size()];//特殊-无需打卡天数(休息日)
int d1 = 0;
for(KqglAssoTeshu spe:wxdk){
appmaps[d1] = spe.getTsrq();
d1++;
}
//应打卡周期时间
List<AttendanceWeeklySch> atwek = attendanceweeklyschmapper.selectAttendanceMadeByUserid(userBean.getEmpNum(),userBean.getOrgCode());
String[] week= new String[atwek.size()];
String[] needfig = new String[atwek.size()];//应打卡周期时间
int e = 0;
for(AttendanceWeeklySch awek : atwek){
week[e] = awek.getWekmc();
needfig[e] = String.valueOf(awek.getType());//获取设置的应打卡周几
e++;
}
//目前为止应出勤天数
int w = 0,x=0;
int zj = 6;
for(String num : nextrange) {
if(Arrays.binarySearch(needfig, String.valueOf(ClockInTool.dateToWeek(num))) >= 0) {//对比排班应打卡时间
String[] ycqtst = new String[ycqts.length + zj];
System.arraycopy(ycqts, 0, ycqtst, 0, ycqts.length);
ycqtst[w] = num;
ycqts = ycqtst;
w++;
}else {
String[] xxtst = new String[xxts.length + zj];
System.arraycopy(xxts, 0, xxtst, 0, xxts.length);
xxtst[x] = num;
xxts = xxtst;
x++;
}
if(Arrays.binarySearch(bxdkss, num) >= 0) {//检查是否存在 必须打卡名单中
String[] ycqtst = new String[ycqts.length + zj];
System.arraycopy(ycqts, 0, ycqtst, 0, ycqts.length);
ycqtst[w] = num;
ycqts = ycqtst;
w++;
xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除
}
if(Arrays.binarySearch(appmaps, num) >= 0) {//检查是否存在 无需打卡名单中
ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
String[] xxtst = new String[xxts.length + zj];
System.arraycopy(xxts, 0, xxtst, 0, xxts.length);
xxtst[x] = num;
xxts = xxtst;
x++;
}
}
}else if(attgro.getPbfs() == 2){ //自由排班
DateFormat df11 = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
List<Schedule> ycqs = schedulemapper.getAttendanceShouldList(userBean.getEmpNum(),startMonth,endMonth);
int z=0;
String[] ziyoupb = new String[ycqs.size()];
for(Schedule sc : ycqs){
String data = new SimpleDateFormat("yyyy-MM-dd").format(df11.parse(String.valueOf(sc.getData())));// 获得格式化后的日期字符串
ziyoupb[z] = data;
z++;
}
//目前为止应出勤天数
int y = 0,x=0;
for(String num : nextrange) {
if(Arrays.binarySearch(ziyoupb, num) >= 0) {
KqglAssoPbmx pbx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, userBean.getEmpNum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
if(pbx!=null && pbx.getBcid()!=0) {
ycqts[y] = num;
y++;
}else {
xxts[x] = num;
x++;
}
}
}
}else{
List<AttendanceWeeklySch> atwek = attendanceweeklyschmapper.selectAttendanceMadeByUserid(userBean.getEmpNum(),userBean.getOrgCode());
String[] week= new String[atwek.size()];
int e = 0;
String[] ziyoupb = new String[atwek.size()];
for(AttendanceWeeklySch awek : atwek){
week[e] = awek.getWekmc();
ziyoupb[e] = String.valueOf(awek.getType());
e++;
}
//目前为止应出勤天数
int g = 0,x=0;
for(String num : nextrange) {
if(Arrays.binarySearch(ziyoupb, String.valueOf(ClockInTool.dateToWeek(num))) >= 0) {//对比排班应打卡时间
ycqts[g] = num;
g++;
}else {
xxts[x] = num;
x++;
}
}
}
}
for(String nus : nextrange) {
WorkbenchCalendarDto wocal = WorkbenchCalendarDto.builder().build();
wocal.setDate(nus);
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),nus)) {
wocal.setCalendar_status(1);//打卡异常
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),nus)) {
wocal.setCalendar_status(4);//打卡异常
}
workcal.add(wocal);
}
}
}
return ResultUtil.data(workcal, "操作成功!");
}
} }
...@@ -2758,16 +2758,10 @@ public class TimeCardController { ...@@ -2758,16 +2758,10 @@ public class TimeCardController {
@GetMapping(value = "/worktable_attendance_from/{date}") @GetMapping(value = "/worktable_attendance_from/{date}")
@ApiOperation(value = "999:工作台考勤表格", httpMethod = "GET", notes = "查询数据") @ApiOperation(value = "999:工作台考勤表格", httpMethod = "GET", notes = "查询数据")
public Result<Object> worktable_attendance_from(@CurrentUser UserBean userBean,@PathVariable("date") String date) throws ParseException { public Result<Object> worktable_attendance_from(@CurrentUser UserBean userBean,@PathVariable("date") String date) throws ParseException {
CalendarTableDataDto tabl = CalendarTableDataDto.builder().build(); CalendarTableDataDto tabl = CalendarTableDataDto.builder().build();
String belongyear = null; String belongyear = null;
String belongmonth = null; String belongmonth = null;
String ttstr = null;// String ttstr = null;//
if(date == null || ("").equals(date)) { if(date == null || ("").equals(date)) {
belongyear = new SimpleDateFormat("yyyy").format(new Date()); belongyear = new SimpleDateFormat("yyyy").format(new Date());
belongmonth = new SimpleDateFormat("MM").format(new Date()); belongmonth = new SimpleDateFormat("MM").format(new Date());
...@@ -2777,16 +2771,11 @@ public class TimeCardController { ...@@ -2777,16 +2771,11 @@ public class TimeCardController {
belongmonth = date.substring(5, 7); belongmonth = date.substring(5, 7);
ttstr = date; ttstr = date;
} }
//1:加班 2:请假 3:出差 4:外出 5:补卡 //1:加班 2:请假 3:出差 4:外出 5:补卡
KqglAssoRelationSummary sums = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 1, ttstr); KqglAssoRelationSummary sums = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 1, ttstr);
KqglAssoRelationSummary qjj = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 2, ttstr); KqglAssoRelationSummary qjj = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 2, ttstr);
KqglAssoRelationSummary cxx = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 3, ttstr); KqglAssoRelationSummary cxx = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 3, ttstr);
KqglAssoMonthPunchSummary punsum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getNum, userBean.getEmpNum()) KqglAssoMonthPunchSummary punsum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getNum, userBean.getEmpNum())
.eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode()).eq(KqglAssoMonthPunchSummary::getBelongYear, belongyear).eq(KqglAssoMonthPunchSummary::getBelongMonth, belongmonth)); .eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode()).eq(KqglAssoMonthPunchSummary::getBelongYear, belongyear).eq(KqglAssoMonthPunchSummary::getBelongMonth, belongmonth));
Double compensatoryleave = 0d; Double compensatoryleave = 0d;
...@@ -2794,7 +2783,6 @@ public class TimeCardController { ...@@ -2794,7 +2783,6 @@ public class TimeCardController {
compensatoryleave = punsum.getWorkingTurnCompenLeave() + punsum.getRestTurnCompenLeave() + punsum.getHolidayTurnCompenLeave(); compensatoryleave = punsum.getWorkingTurnCompenLeave() + punsum.getRestTurnCompenLeave() + punsum.getHolidayTurnCompenLeave();
} }
tabl.setAttendance(punsum == null ? "" : String.valueOf(punsum.getDaysOnDuty()));// 应出勤 tabl.setAttendance(punsum == null ? "" : String.valueOf(punsum.getDaysOnDuty()));// 应出勤
tabl.setAttended(punsum == null ? "" : String.valueOf(punsum.getActualAttDays()));// 已出勤 tabl.setAttended(punsum == null ? "" : String.valueOf(punsum.getActualAttDays()));// 已出勤
tabl.setLeave(qjj == null ? "" : String.valueOf(qjj.getDuration()));// 请假 tabl.setLeave(qjj == null ? "" : String.valueOf(qjj.getDuration()));// 请假
......
...@@ -52,8 +52,8 @@ public class ClockCollectData implements Serializable { ...@@ -52,8 +52,8 @@ public class ClockCollectData implements Serializable {
@ApiModelProperty(value = "班次id", example = "无排班时 为“0”") @ApiModelProperty(value = "班次id", example = "无排班时 为“0”")
private Integer shifid; private Integer shifid;
@ApiModelProperty(value = "打卡状态", example = "状态,1:正常 2:异常 3:补卡 4:请假") // @ApiModelProperty(value = "打卡状态", example = "状态,1:正常 2:异常 3:补卡 4:请假")
private Integer status; // private Integer status;
@ApiModelProperty(value = "手机唯一ID", example = "字段说明") @ApiModelProperty(value = "手机唯一ID", example = "字段说明")
private String registrationid; private String registrationid;
......
...@@ -44,9 +44,9 @@ public class EvectionBusiness extends SpmkAssoBusiness { ...@@ -44,9 +44,9 @@ public class EvectionBusiness extends SpmkAssoBusiness {
// 时长 // 时长
String longTime = ObjectUtil.isNull(jsonObj.get("__longTime",FromData.class)) ? null : jsonObj.get("__longTime",FromData.class).getValue(); String longTime = ObjectUtil.isNull(jsonObj.get("__longTime",FromData.class)) ? null : jsonObj.get("__longTime",FromData.class).getValue();
// 出差事由 // 出差事由
String businessTrip = ObjectUtil.isNull(jsonObj.get("__businessTrip",FromData.class)) ? null : jsonObj.get("__businessTrip",FromData.class).getValue(); // String businessTrip = ObjectUtil.isNull(jsonObj.get("__businessTrip",FromData.class)) ? null : jsonObj.get("__businessTrip",FromData.class).getValue();
// 上传文件 // 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); // String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
System.out.println(approveId); System.out.println(approveId);
AttEvectionApprovalDto eaD = AttEvectionApprovalDto AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder() .builder()
......
...@@ -40,9 +40,9 @@ public class GoOutBusiness extends SpmkAssoBusiness { ...@@ -40,9 +40,9 @@ public class GoOutBusiness extends SpmkAssoBusiness {
// 时长 // 时长
String longTime = jsonObj.get("__longTime",FromData.class).getValue(); String longTime = jsonObj.get("__longTime",FromData.class).getValue();
// 出差事由 // 出差事由
String businessTrip = jsonObj.get("__businessTrip",FromData.class).getValue(); // String businessTrip = jsonObj.get("__businessTrip",FromData.class).getValue();
// 上传文件 // 上传文件
String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); // String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
AttEvectionApprovalDto eaD = AttEvectionApprovalDto AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder() .builder()
......
...@@ -44,7 +44,7 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness { ...@@ -44,7 +44,7 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
// 加班补偿方式 -前端传中文 // 加班补偿方式 -前端传中文
String compensate = ObjectUtil.isNull(jsonObj.get("__compensate",FromData.class)) ? null : jsonObj.get("__compensate",FromData.class).getValue(); String compensate = ObjectUtil.isNull(jsonObj.get("__compensate",FromData.class)) ? null : jsonObj.get("__compensate",FromData.class).getValue();
// 加班原因 // 加班原因
String OvertimeReason = ObjectUtil.isNull(jsonObj.get("__OvertimeReason",FromData.class)) ? null : jsonObj.get("__OvertimeReason",FromData.class).getValue(); // String OvertimeReason = ObjectUtil.isNull(jsonObj.get("__OvertimeReason",FromData.class)) ? null : jsonObj.get("__OvertimeReason",FromData.class).getValue();
// 加班类型-前端未给 // 加班类型-前端未给
String workOvertimeType = ObjectUtil.isNull(jsonObj.get("__workOvertimeType",FromData.class)) ? null : jsonObj.get("__workOvertimeType",FromData.class).getValue(); String workOvertimeType = ObjectUtil.isNull(jsonObj.get("__workOvertimeType",FromData.class)) ? null : jsonObj.get("__workOvertimeType",FromData.class).getValue();
// 上传文件 // 上传文件
......
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