Commit 57debb35 by lal Committed by chenzg

提价BUG

parent 214aab91
......@@ -147,13 +147,15 @@ public class ClockInController {
//检查昨日的班次是否存在次日打卡
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();//获取今天应打卡时间
boolean dnck = false;
// boolean dnck = false;
if(ashss.size() > 0) {
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(ashss.get(0).getTime())));//当天应打的首次上班卡时间
Date sd2=df1.parse(current_time);//当前时间
......@@ -167,7 +169,7 @@ public class ClockInController {
int isXbdk2Cr = shif.getIsXbdk2Cr();//下班2是否次日(0:否;1:是)
int isSbdk3Cr = shif.getIsSbdk3Cr();//上班3是否次日(0:否;1:是)
int isXbdk3Cr = shif.getIsXbdk3Cr();//下班3是否次日(0:否;1:是)
boolean crdk = false;//当次打卡是否存在次日打卡
// boolean crdk = false;//当次打卡是否存在次日打卡
if(balan.getSort() < dkcs) {
if(balan.getSort()+1 == 2 && dkcs == 2) {
if(isXbdk1Cr > 0) {//次日
......@@ -195,6 +197,13 @@ public class ClockInController {
}
}
}
}else {
//无记录的话就找昨天的数据
// AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
}
if(crdk && dnck) {
dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
......@@ -208,15 +217,16 @@ public class ClockInController {
attendance_date = startDate;
toweek = putime;
}
}else {
//无记录的话就找昨天的数据
AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
}
//putime: 根据日期 得到打卡所需的详细信息
// AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
// ClockCollectData clockt = new ClockCollectData();
if(EmptyUtil.isEmpty(attdate.getAttsch())) {
msg = "当前未排班";
sbyf = 0;
}else {
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,
endtime3 = 0,endtime3ks = 0,endtime3js = 0;
if(attdate.getAttsch().size() > 0) {
......@@ -454,6 +464,8 @@ public class ClockInController {
msg = "当前是休息时间";
sbyf = 0;
}
}
}else {
//自由工时打卡
......@@ -610,6 +622,7 @@ public class ClockInController {
if((atttype)%2 > 0){
type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
if(attdate.getAttgrouptype() != 3) {
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
status = 1;
}if(punchcardtime == 0 && clockt.getShifid() == 0) {
......@@ -625,6 +638,9 @@ public class ClockInController {
status = 2;
}
}
}else if(EmptyUtil.isEmpty(attdate.getAttsch())) {
status = 2;
}
}else {
if(sbyf == 1) {
status = 1;
......@@ -632,10 +648,10 @@ public class ClockInController {
status = 2;
}
}
}else{
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) {
......@@ -651,6 +667,9 @@ public class ClockInController {
status = 2;
}
}
}else if(EmptyUtil.isEmpty(attdate.getAttsch())) {
status = 2;
}
}else {
if(sbyf == 1) {
status = 1;
......
package cn.timer.api.controller.kqgl;
import java.util.List;
public class EmptyUtil {
/**
* 判断对象为空
*
* @param obj 对象名
* @return 是否为空
*/
// @SuppressWarnings("rawtypes")
public static boolean isEmpty(Object obj) {
if (obj == null) {
return true;
}
if ((obj instanceof List)) {
return ((List) obj).size() == 0;
}
if ((obj instanceof String)) {
return ((String) obj).trim().equals("");
}
return false;
}
/**
* 判断对象不为空
*
* @param obj 对象名
* @return 是否不为空
*/
public static boolean isNotEmpty(Object obj) {
return !isEmpty(obj);
}
}
......@@ -302,15 +302,23 @@ public class TimeCardController {
}else if(launchs != null && launchs.length>0){
for(int p=0;p<launchs.length;p++){
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, id));
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getAttgroupId, Integer.valueOf(launchs[p])));
KqglAssoOvertimeRange vice = KqglAssoOvertimeRange.builder().build();
vice.setOvertimeRulesId(id);
vice.setAttgroupId(Integer.valueOf(launchs[p]));
overatts.add(vice);
//应用范围应用到相对应的考勤组************
KqglMainKqz.builder().id(Integer.valueOf(launchs[p])).overtimeRulesId(id).build().updateById();
}
}
if(overatts.size() > 0) {
kqglassoovertimerangemapper.insertovertimerangelist(overatts);
}
List<KqglAssOvertimeVice> overtimes=new ArrayList<KqglAssOvertimeVice>();
StartTimeRestDto[] rest = overrules.getStarttime();
if(rest != null && rest.length>0){
......@@ -364,6 +372,13 @@ public class TimeCardController {
if(!KqglAssoOvertimeRules.builder().id(id).build().deleteById()) {
throw new Exception();
}else {
List<KqglAssoOvertimeRange> rans = kqglassoovertimerangemapper.selectList(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, id));
for(KqglAssoOvertimeRange ran:rans) {
KqglMainKqz.builder().id(ran.getAttgroupId()).overtimeRulesId(0).build().updateById();
}
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, id));
KqglAssOvertimeVice.builder().build().delete(new QueryWrapper<KqglAssOvertimeVice>().lambda().eq(KqglAssOvertimeVice::getOvertimeRulesId, id));
return ResultUtil.success("删除成功!");
}
......
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