Commit 45d89e3e by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!163
parents 5cbb7c39 00462547
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