Commit ad2105de by lal

提价BUG

parent b67057c6
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 { ...@@ -302,15 +302,23 @@ public class TimeCardController {
}else if(launchs != null && launchs.length>0){ }else if(launchs != null && launchs.length>0){
for(int p=0;p<launchs.length;p++){ 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::getOvertimeRulesId, id));
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getAttgroupId, Integer.valueOf(launchs[p])));
KqglAssoOvertimeRange vice = KqglAssoOvertimeRange.builder().build(); KqglAssoOvertimeRange vice = KqglAssoOvertimeRange.builder().build();
vice.setOvertimeRulesId(id); vice.setOvertimeRulesId(id);
vice.setAttgroupId(Integer.valueOf(launchs[p])); vice.setAttgroupId(Integer.valueOf(launchs[p]));
overatts.add(vice); overatts.add(vice);
//应用范围应用到相对应的考勤组************
KqglMainKqz.builder().id(Integer.valueOf(launchs[p])).overtimeRulesId(id).build().updateById();
} }
} }
if(overatts.size() > 0) { if(overatts.size() > 0) {
kqglassoovertimerangemapper.insertovertimerangelist(overatts); kqglassoovertimerangemapper.insertovertimerangelist(overatts);
} }
List<KqglAssOvertimeVice> overtimes=new ArrayList<KqglAssOvertimeVice>(); List<KqglAssOvertimeVice> overtimes=new ArrayList<KqglAssOvertimeVice>();
StartTimeRestDto[] rest = overrules.getStarttime(); StartTimeRestDto[] rest = overrules.getStarttime();
if(rest != null && rest.length>0){ if(rest != null && rest.length>0){
...@@ -364,6 +372,13 @@ public class TimeCardController { ...@@ -364,6 +372,13 @@ public class TimeCardController {
if(!KqglAssoOvertimeRules.builder().id(id).build().deleteById()) { if(!KqglAssoOvertimeRules.builder().id(id).build().deleteById()) {
throw new Exception(); throw new Exception();
}else { }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)); KqglAssOvertimeVice.builder().build().delete(new QueryWrapper<KqglAssOvertimeVice>().lambda().eq(KqglAssOvertimeVice::getOvertimeRulesId, id));
return ResultUtil.success("删除成功!"); 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