Commit ee811d77 by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!571
parents 08faa887 7b5ff63e
...@@ -164,6 +164,9 @@ public class CrmClientData extends Model<CrmClientData> { ...@@ -164,6 +164,9 @@ public class CrmClientData extends Model<CrmClientData> {
@ApiModelProperty(value = "跟进记录") @ApiModelProperty(value = "跟进记录")
private String followuprecord; private String followuprecord;
@ApiModelProperty(value = "隐藏客户(0:已隐藏;1:未隐藏)")
private Integer hidingcustomers;
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
......
...@@ -704,6 +704,7 @@ public class CrmController { ...@@ -704,6 +704,7 @@ public class CrmController {
List<CrmClientData> list = CrmClientData.builder().build() List<CrmClientData> list = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode) .selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode)
.eq(CrmClientData::getBelongUser, 0) .eq(CrmClientData::getBelongUser, 0)
.eq(CrmClientData::getHidingcustomers, 1)
.eq(type != null && type >= 0, CrmClientData::getClientType, type) .eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId) .eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status) .eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
...@@ -731,6 +732,7 @@ public class CrmController { ...@@ -731,6 +732,7 @@ public class CrmController {
List<CrmClientData> datas = CrmClientData.builder().build() List<CrmClientData> datas = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongGroup, gid) .selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongGroup, gid)
.eq(CrmClientData::getBelongUser, 0) .eq(CrmClientData::getBelongUser, 0)
.eq(CrmClientData::getHidingcustomers, 1)
.eq(type != null && type >= 0, CrmClientData::getClientType, type) .eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId) .eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status) .eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
...@@ -1146,6 +1148,30 @@ public class CrmController { ...@@ -1146,6 +1148,30 @@ public class CrmController {
return ResultUtil.success("转移失败"); return ResultUtil.success("转移失败");
} }
@GetMapping("hidingcustomers")
@ApiOperation(value = "隐藏客户", httpMethod = "GET", notes = "接口发布说明")
public Result<Void> HidingCustomers(@CurrentUser UserBean userBean,@RequestParam Integer yid) {
CrmClientData crda = CrmClientData.builder().id(yid).build().selectById();
if(crda != null) {
// 当前操作人是否管理员
CrmBusinessGroupMember nowManager = CrmBusinessGroupMember.builder().build()
.selectOne(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, crda.getBelongGroup())
.eq(CrmBusinessGroupMember::getEmpNum, getEmpNum(userBean))
.eq(CrmBusinessGroupMember::getType, 1));
if (nowManager == null)
return ResultUtil.error("没有操作权限,请联系组管理员进行操作");
CrmClientData.builder().id(yid).hidingcustomers(0).build().updateById();
}
return ResultUtil.success("成功");
}
/** /**
* *
...@@ -1519,15 +1545,24 @@ public class CrmController { ...@@ -1519,15 +1545,24 @@ public class CrmController {
.eq(CrmBusinessGroup::getName, belongGroupName).select(CrmBusinessGroup::getId)); .eq(CrmBusinessGroup::getName, belongGroupName).select(CrmBusinessGroup::getId));
if (crmBusinessGroup == null) if (crmBusinessGroup == null)
return ResultUtil.error("没有匹配的业务组名称"); return ResultUtil.error("没有匹配的业务组名称");
int industryid = 0;
if (StrUtil.isNotBlank(industryName)) { if (StrUtil.isNotBlank(industryName)) {
// 行业字典 // 行业字典
IndustryClass industryClass = IndustryClass.builder().build() IndustryClass industryClass = IndustryClass.builder().build()
.selectOne(new LambdaQueryWrapper<IndustryClass>().eq(IndustryClass::getName, industryName) .selectOne(new LambdaQueryWrapper<IndustryClass>().eq(IndustryClass::getName, industryName)
.select(IndustryClass::getId)); .select(IndustryClass::getId));
if (industryClass == null) if (industryClass == null) {
return ResultUtil.error("没有匹配的行业名称");
crmClientData.setIndustry(industryClass.getId()); IndustryClass incls = IndustryClass.builder().build();
incls.setName(industryName);
incls.insert();
industryid = incls.getId();
// return ResultUtil.error("没有匹配的行业名称");
}else {
industryid = industryClass.getId();
}
crmClientData.setIndustry(industryid);
} }
if (StrUtil.isNotBlank(clientTypeName)) { if (StrUtil.isNotBlank(clientTypeName)) {
......
...@@ -101,7 +101,7 @@ public class AttendanceTaskTiming{ ...@@ -101,7 +101,7 @@ public class AttendanceTaskTiming{
//typeid:1-员工 2-考勤组 //typeid:1-员工 2-考勤组
// @Scheduled(cron = "0 */5 * * * ?") // @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 23 14 * * ?") // @Scheduled(cron = "0 55 15 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行 @Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
public void AttendanceTask() throws ParseException { public void AttendanceTask() throws ParseException {
...@@ -583,237 +583,246 @@ public class AttendanceTaskTiming{ ...@@ -583,237 +583,246 @@ public class AttendanceTaskTiming{
//1:加班 2:请假 3:出差 4:外出 5:补卡 //1:加班 2:请假 3:出差 4:外出 5:补卡
int u = 0; int u = 0;
int p = 1; int p = 1;
for(String num : range) { for(String num : range) {
String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
rowData.add("休息并打卡"); try {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
rowData.add("休息"); if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ rowData.add("休息并打卡");
rowData.add("法定节假日休息"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
}else { rowData.add("休息");
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
rowData.add("旷工"); rowData.add("法定节假日休息");
}else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("未排班");
}else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else { }else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) { if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) {
rowData.add("上班缺卡"); rowData.add("旷工");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("上班缺卡,下班早退"); rowData.add("未排班");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) { }else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) {
rowData.add("上班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
rowData.add("上班缺卡,下班早退");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) {
// rowData.add("上班迟到"); // rowData.add("上班迟到");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk1jg() > 0) { if(dkm.getSbdk1jg() > 0) {
rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟"); rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟");
} }
} }
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk2jg() > 0) { if(dkm.getSbdk2jg() > 0) {
rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟"); rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getSbdk3jg() > 0) {
if(dkm.getSbdk3jg() > 0) { rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟");
rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟"); }
} }
} }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) { rowData.add("上班迟到,下班缺卡");
rowData.add("上班迟到,下班缺卡"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { rowData.add("上班迟到,下班早退");
rowData.add("上班迟到,下班早退");
// }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) { // }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) {
rowData.add("下班缺卡"); rowData.add("下班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
// rowData.add("下班早退"); // rowData.add("下班早退");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getXbdk1jg() > 0) { if(dkm.getXbdk1jg() > 0) {
rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟"); rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getXbdk2jg() > 0) {
if(dkm.getXbdk2jg() > 0) { rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟");
rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟"); }
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getXbdk3jg() > 0) {
if(dkm.getXbdk3jg() > 0) { rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟");
rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟"); }
} }
}else {
rowData.add("正常");
} }
}else {
rowData.add("正常");
} }
} }
}
/******/
/******/ if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) { KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code));
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code)); String leavetype = "未知";//请假类型
String leavetype = "未知";//请假类型 String company = "未知";//请假单位
String company = "未知";//请假单位 if(lea != null) {
if(lea != null) { KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId()));
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId())); if(rul != null) {
if(rul != null) { leavetype = rul.getName();
leavetype = rul.getName(); //1:按天请假;2:按半天;3:按小时
//1:按天请假;2:按半天;3:按小时 if(rul.getCompany() == 1) { company = "天"; }
if(rul.getCompany() == 1) { company = "天"; } else if(rul.getCompany() == 2) { company = "半天"; }
else if(rul.getCompany() == 2) { company = "半天"; } else { company = "小时"; }
else { company = "小时"; } }
} }
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
} }
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company; if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
} KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code));
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code));
chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code));
waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code));
buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
String company = "未知",method = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
for(KqglAssoRelationSummary lea : leas) {
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班 chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code)); }
if(basics.getMinimumUnit() == 1) { company = "分钟"; } if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
else if(basics.getMinimumUnit() == 2) { company = "半小时";} KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code));
else if(basics.getMinimumUnit() == 3) { company = "小时";}
else if(basics.getMinimumUnit() == 4) { company = "半天";} waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
else if(basics.getMinimumUnit() == 5) { company = "天";} }
//1:转调休;2:转加班费;3:转调休或加班费 if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
if(lea.getCompensateId() == 1) { method="转调休"; } KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code));
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";} buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
String company = "未知",method = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
for(KqglAssoRelationSummary lea : leas) {
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]"; //最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
//防止多运算 KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(lea.getOrdernum() == lea.getTotals()) { if(basics.getMinimumUnit() == 1) { company = "分钟"; }
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费 else if(basics.getMinimumUnit() == 2) { company = "半小时";}
//工作日 else if(basics.getMinimumUnit() == 3) { company = "小时";}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) { else if(basics.getMinimumUnit() == 4) { company = "半天";}
if(lea.getOvertimeTypeId() == 1) { else if(basics.getMinimumUnit() == 5) { company = "天";}
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { //1:转调休;2:转加班费;3:转调休或加班费
workingturncompenleave = workingturncompenleave + lea.getDuration(); if(lea.getCompensateId() == 1) { method="转调休"; }
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { else if(lea.getCompensateId() == 2) { method="转加班费"; }
workingtransferovertime = workingtransferovertime + + lea.getDuration(); else {method="转调休或加班费";}
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
//防止多运算
if(lea.getOrdernum() == lea.getTotals()) {
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) {
if(lea.getOvertimeTypeId() == 1) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
workingturncompenleave = workingturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
workingtransferovertime = workingtransferovertime + + lea.getDuration();
}
} }
} }
} //休息日
//休息日 if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 2) {
if(lea.getOvertimeTypeId() == 2) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { restturncompenleave = restturncompenleave + lea.getDuration();
restturncompenleave = restturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { resttransferovertime = resttransferovertime + lea.getDuration();
resttransferovertime = resttransferovertime + lea.getDuration(); }
} }
} }
} if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 3) {
if(lea.getOvertimeTypeId() == 3) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { holidayturncompenleave = holidayturncompenleave + lea.getDuration();
holidayturncompenleave = holidayturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { holidaytransferovertime = holidaytransferovertime + lea.getDuration();
holidaytransferovertime = holidaytransferovertime + lea.getDuration(); }
} }
} }
} }
} }
} }
}
if(rowData.size() == p) {
if(rowData.size() == p) { sjs = "";
sjs = ""; if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) {
if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) { sjs = rowData.get(u);
sjs = rowData.get(u); }else {
}else { sjs = rowData.get(u)+";";
sjs = rowData.get(u)+";"; }
} }
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban);
} /****/
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban); ////////
/****/ KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
//////// if(attgro.getPbfs() == 1){
int several = Integer.valueOf(ClockInTool.dateToWeek(num));//
KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num));
if(tesu == null) {
if(attgro.getPbfs() == 1){ //获取该员工最新班次
int several = Integer.valueOf(ClockInTool.dateToWeek(num));// KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num)); .eq(KqglAssoZhoupaiban::getType, several));
if(tesu == null) { if(gudingpb!=null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
}
}else {
if(tesu.getBcid() > 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid()));
}
}
//获取该员工最新班次 //获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId()) KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several)); .eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb!=null) { if(gudingpb != null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid())); shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
} }
}else { }else if(attgro.getPbfs() == 2){
if(tesu.getBcid() > 0) { KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid())); if(pbmxx != null && pbmxx.getBcid() != 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid()));
} }
}
//获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb != null) {
shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
} }
}else if(attgro.getPbfs() == 2){
KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId())); if(shif != null && shif.getSxbcs() != null) {
if(pbmxx != null && pbmxx.getBcid() != 0) { System.out.println(shif.getSxbcs());
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid())); answer = shif.getSxbcs();//1=2次 2=4次 3=6次
} //未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数
} //最后一次应打卡时间
String latimeclock = "";
if(shif != null && shif.getSxbcs() != null) { if(answer == 1) {
System.out.println(shif.getSxbcs()); latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3);
answer = shif.getSxbcs();//1=2次 2=4次 3=6次 }else if(answer == 2) {
//未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数 latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3);
//最后一次应打卡时间 }else {
String latimeclock = ""; latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3);
if(answer == 1) { }
latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3); for(KqglAssoRelationSummary learel:leainv) {
}else if(answer == 2) { boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm");
latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3); if(adopt) {
}else { xbqkcs = xbqkcs-1;
latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3); }
}
for(KqglAssoRelationSummary learel:leainv) {
boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm");
if(adopt) {
xbqkcs = xbqkcs-1;
} }
} }
u++;
p++;
} catch (Exception e) {
System.err.println("出错");
} }
u++;
p++;
} }
}else { }else {
for (String num2 : range) { for (String num2 : range) {
......
...@@ -569,252 +569,257 @@ public class LastMonthtimingExport { ...@@ -569,252 +569,257 @@ public class LastMonthtimingExport {
//1:加班 2:请假 3:出差 4:外出 5:补卡 //1:加班 2:请假 3:出差 4:外出 5:补卡
int u = 0,p=1; int u = 0,p=1;
for(String num : range) { for(String num : range) {
String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) { try {
rowData.add("休息并打卡"); String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
rowData.add("休息"); rowData.add("休息并打卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
rowData.add("法定节假日休息"); rowData.add("休息");
}else { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) { rowData.add("法定节假日休息");
rowData.add("旷工");
}else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("未排班");
}else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else { }else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) { if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) {
rowData.add("上班缺卡"); rowData.add("旷工");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("上班缺卡,下班早退"); rowData.add("未排班");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) { }else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) {
rowData.add("上班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
rowData.add("上班缺卡,下班早退");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) {
// rowData.add("上班迟到"); // rowData.add("上班迟到");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk1jg() > 0) { if(dkm.getSbdk1jg() > 0) {
rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟"); rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟");
} }
} }
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk2jg() > 0) { if(dkm.getSbdk2jg() > 0) {
rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟"); rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getSbdk3jg() > 0) {
if(dkm.getSbdk3jg() > 0) { rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟");
rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟"); }
} }
} }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) { rowData.add("上班迟到,下班缺卡");
rowData.add("上班迟到,下班缺卡"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { rowData.add("上班迟到,下班早退");
rowData.add("上班迟到,下班早退");
// }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) { // }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) {
rowData.add("下班缺卡"); rowData.add("下班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
// rowData.add("下班早退"); // rowData.add("下班早退");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getXbdk1jg() > 0) { if(dkm.getXbdk1jg() > 0) {
rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟"); rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getXbdk2jg() > 0) {
if(dkm.getXbdk2jg() > 0) { rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟");
rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟"); }
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getXbdk3jg() > 0) {
if(dkm.getXbdk3jg() > 0) { rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟");
rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟"); }
} }
}else {
rowData.add("正常");
} }
}else {
rowData.add("正常");
} }
} }
}
/******/
/******/ if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) { KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code));
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code)); String leavetype = "未知";//请假类型
String leavetype = "未知";//请假类型 String company = "未知";//请假单位
String company = "未知";//请假单位 if(lea != null) {
if(lea != null) { KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId()));
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId())); if(rul != null) {
if(rul != null) { leavetype = rul.getName();
leavetype = rul.getName(); //1:按天请假;2:按半天;3:按小时
//1:按天请假;2:按半天;3:按小时 if(rul.getCompany() == 1) { company = "天"; }
if(rul.getCompany() == 1) { company = "天"; } else if(rul.getCompany() == 2) { company = "半天"; }
else if(rul.getCompany() == 2) { company = "半天"; } else { company = "小时"; }
else { company = "小时"; } }
} }
} qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
// rowData.remove(u); // rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company); // rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company);
} }
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) { if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code));
chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天"; chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
// rowData.remove(u); // rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天"); // rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天");
} }
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) { if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code));
waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天"; waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
// rowData.remove(u); // rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天"); // rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天");
} }
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) { if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code)); KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code));
// rowData.remove(u); // rowData.remove(u);
// rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16)); // rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16));
buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
String company = "未知",method = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
for(KqglAssoRelationSummary lea : leas) {
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班 buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code)); }
if(basics.getMinimumUnit() == 1) { company = "分钟"; } if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
else if(basics.getMinimumUnit() == 2) { company = "半小时";}
else if(basics.getMinimumUnit() == 3) { company = "小时";} String company = "未知",method = "无";//加班单位、加班补偿方式
else if(basics.getMinimumUnit() == 4) { company = "半天";}
else if(basics.getMinimumUnit() == 5) { company = "天";} List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
//1:转调休;2:转加班费;3:转调休或加班费 for(KqglAssoRelationSummary lea : leas) {
if(lea.getCompensateId() == 1) { method="转调休"; }
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(basics.getMinimumUnit() == 1) { company = "分钟"; }
else if(basics.getMinimumUnit() == 2) { company = "半小时";}
else if(basics.getMinimumUnit() == 3) { company = "小时";}
else if(basics.getMinimumUnit() == 4) { company = "半天";}
else if(basics.getMinimumUnit() == 5) { company = "天";}
//1:转调休;2:转加班费;3:转调休或加班费
if(lea.getCompensateId() == 1) { method="转调休"; }
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
// rowData.remove(u); // rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]"); // rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]");
//防止多运算 //防止多运算
if(lea.getOrdernum() == lea.getTotals()) { if(lea.getOrdernum() == lea.getTotals()) {
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费 //加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日 //工作日
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) { if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) {
if(lea.getOvertimeTypeId() == 1) { if(lea.getOvertimeTypeId() == 1) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
workingturncompenleave = workingturncompenleave + lea.getDuration(); workingturncompenleave = workingturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
workingtransferovertime = workingtransferovertime + + lea.getDuration(); workingtransferovertime = workingtransferovertime + + lea.getDuration();
}
} }
} }
} //休息日
//休息日 if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 2) {
if(lea.getOvertimeTypeId() == 2) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { restturncompenleave = restturncompenleave + lea.getDuration();
restturncompenleave = restturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { resttransferovertime = resttransferovertime + lea.getDuration();
resttransferovertime = resttransferovertime + lea.getDuration(); }
} }
} }
} if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 3) {
if(lea.getOvertimeTypeId() == 3) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { // holidayturncompenleave++;
// holidayturncompenleave++; holidayturncompenleave = holidayturncompenleave + lea.getDuration();
holidayturncompenleave = holidayturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { // holidaytransferovertime++;
// holidaytransferovertime++; holidaytransferovertime = holidaytransferovertime + lea.getDuration();
holidaytransferovertime = holidaytransferovertime + lea.getDuration(); }
} }
} }
} }
} }
} }
}
if(rowData.size() == p) {
if(rowData.size() == p) { sjs = "";
sjs = ""; if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) {
if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) { sjs = rowData.get(u);
sjs = rowData.get(u); }else {
}else { sjs = rowData.get(u)+";";
sjs = rowData.get(u)+";"; }
} }
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban);
} /****/
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban); ////////
/****/ KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
//////// if(attgro.getPbfs() == 1){
int several = Integer.valueOf(ClockInTool.dateToWeek(num));//
KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num));
if(tesu == null) {
if(attgro.getPbfs() == 1){ //获取该员工最新班次
int several = Integer.valueOf(ClockInTool.dateToWeek(num));// KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num)); .eq(KqglAssoZhoupaiban::getType, several));
if(tesu == null) { if(gudingpb!=null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
}
}else {
if(tesu.getBcid() > 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid()));
}
}
//获取该员工最新班次 //获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId()) KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several)); .eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb!=null) { if(gudingpb != null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid())); shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
} }
}else { }else if(attgro.getPbfs() == 2){
if(tesu.getBcid() > 0) { KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid())); if(pbmxx != null && pbmxx.getBcid() != 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid()));
} }
}
//获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb != null) {
shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
} }
}else if(attgro.getPbfs() == 2){
KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId())); if(shif != null && shif.getSxbcs() != null) {
if(pbmxx != null && pbmxx.getBcid() != 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid()));
}
}
if(shif != null && shif.getSxbcs() != null) {
// System.out.println(shif.getSxbcs()); // System.out.println(shif.getSxbcs());
answer = shif.getSxbcs();//1=2次 2=4次 3=6次 answer = shif.getSxbcs();//1=2次 2=4次 3=6次
//未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数 //未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数
//最后一次应打卡时间 //最后一次应打卡时间
String latimeclock = ""; String latimeclock = "";
if(answer == 1) { if(answer == 1) {
latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3); latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3);
}else if(answer == 2) { }else if(answer == 2) {
latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3); latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3);
}else { }else {
latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3); latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3);
} }
for(KqglAssoRelationSummary learel:leainv) { for(KqglAssoRelationSummary learel:leainv) {
boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm"); boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm");
if(adopt) { if(adopt) {
xbqkcs = xbqkcs-1; xbqkcs = xbqkcs-1;
}
} }
} }
u++;
p++;
} catch (Exception e) {
System.err.println("出错");
} }
u++;
p++;
} }
}else { }else {
for (String num2 : range) { for (String num2 : range) {
......
...@@ -560,235 +560,239 @@ public class RealTimeUpdate{ ...@@ -560,235 +560,239 @@ public class RealTimeUpdate{
int p = 1; int p = 1;
for(String num : range) { for(String num : range) {
String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = ""; try {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) { String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
rowData.add("休息并打卡"); if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ rowData.add("休息并打卡");
rowData.add("休息"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){ rowData.add("休息");
rowData.add("法定节假日休息"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(fdxx), num)){
}else { rowData.add("法定节假日休息");
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) {
rowData.add("旷工");
}else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("未排班");
}else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else { }else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) { if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(leaves), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(travels), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(goouts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cards), num)) {
rowData.add("上班缺卡"); rowData.add("旷工");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {//日期不在上班也不在休息里面即为未排班
rowData.add("上班缺卡,下班早退"); rowData.add("未排班");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) { }else if(sdf1.parse(beginTime).getTime() < sdf1.parse(num).getTime()) {
rowData.add("未到班期");
}else {
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num)) {
rowData.add("上班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(sblacks), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
rowData.add("上班缺卡,下班早退");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num)) {
// rowData.add("上班迟到"); // rowData.add("上班迟到");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk1jg() > 0) { if(dkm.getSbdk1jg() > 0) {
rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟"); rowData.add("上班1迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk1()))+",迟到"+dkm.getSbdk1jg()+"分钟");
} }
} }
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getSbdk2jg() > 0) { if(dkm.getSbdk2jg() > 0) {
rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟"); rowData.add("上班2迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk2()))+",迟到"+dkm.getSbdk2jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getSbdk3jg() > 0) {
if(dkm.getSbdk3jg() > 0) { rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟");
rowData.add("上班3迟到,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getSbdk3()))+",迟到"+dkm.getSbdk3jg()+"分钟"); }
} }
} }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks), num)) { rowData.add("上班迟到,下班缺卡");
rowData.add("上班迟到,下班缺卡"); }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(cdts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { rowData.add("上班迟到,下班早退");
rowData.add("上班迟到,下班早退");
// }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) { // }else if(Arrays.binarySearch(ClockInTool.deleteArrayNull(xblacks), num) >= 0) {
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xblacks),num)) {
rowData.add("下班缺卡"); rowData.add("下班缺卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) { }else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ztts), num)) {
// rowData.add("下班早退"); // rowData.add("下班早退");
KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum()) KqglAssoDkmx dkm = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, user.getEmpnum())
.eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num)); .eq(KqglAssoDkmx::getQyid, org_code).eq(KqglAssoDkmx::getData, num));
if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getYdkcs() == 2 || dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getXbdk1jg() > 0) { if(dkm.getXbdk1jg() > 0) {
rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟"); rowData.add("下班1早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk1()))+",早退"+dkm.getXbdk1jg()+"分钟");
}
} }
} if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 4 || dkm.getYdkcs() == 6) { if(dkm.getXbdk2jg() > 0) {
if(dkm.getXbdk2jg() > 0) { rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟");
rowData.add("下班2早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk2()))+",早退"+dkm.getXbdk2jg()+"分钟"); }
} }
} if(dkm.getYdkcs() == 6) {
if(dkm.getYdkcs() == 6) { if(dkm.getXbdk3jg() > 0) {
if(dkm.getXbdk3jg() > 0) { rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟");
rowData.add("下班3早退,打卡时间:"+ClockInTool.stampToDate3(String.valueOf(dkm.getXbdk3()))+",早退"+dkm.getXbdk3jg()+"分钟"); }
} }
}else {
rowData.add("正常");
} }
}else {
rowData.add("正常");
} }
} }
}
/******/
/******/ if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(leaves),num)) { KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code));
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 2).eq(KqglAssoRelationSummary::getOrgCode, org_code)); String leavetype = "未知";//请假类型
String leavetype = "未知";//请假类型 String company = "未知";//请假单位
String company = "未知";//请假单位 if(lea != null) {
if(lea != null) { KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId()));
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId, lea.getLeaveTypeId())); if(rul != null) {
if(rul != null) { leavetype = rul.getName();
leavetype = rul.getName(); //1:按天请假;2:按半天;3:按小时
//1:按天请假;2:按半天;3:按小时 if(rul.getCompany() == 1) { company = "天"; }
if(rul.getCompany() == 1) { company = "天"; } else if(rul.getCompany() == 2) { company = "半天"; }
else if(rul.getCompany() == 2) { company = "半天"; } else { company = "小时"; }
else { company = "小时"; } }
} }
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
} }
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company; if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
} KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code));
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3).eq(KqglAssoRelationSummary::getOrgCode, org_code)); chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
}
chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天"; if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
} KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code));
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4).eq(KqglAssoRelationSummary::getOrgCode, org_code)); waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
}
waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天"; if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
} KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code));
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5).eq(KqglAssoRelationSummary::getOrgCode, org_code)); buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16); if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
String company = "未知",method = "无";//加班单位、加班补偿方式
List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
for(KqglAssoRelationSummary lea : leas) {
//最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班 String company = "未知",method = "无";//加班单位、加班补偿方式
KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(basics.getMinimumUnit() == 1) { company = "分钟"; } List<KqglAssoRelationSummary> leas = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 1).eq(KqglAssoRelationSummary::getOrgCode, org_code));
else if(basics.getMinimumUnit() == 2) { company = "半小时";} for(KqglAssoRelationSummary lea : leas) {
else if(basics.getMinimumUnit() == 3) { company = "小时";}
else if(basics.getMinimumUnit() == 4) { company = "半天";}
else if(basics.getMinimumUnit() == 5) { company = "天";}
//1:转调休;2:转加班费;3:转调休或加班费
if(lea.getCompensateId() == 1) { method="转调休"; }
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]"; //最小加班单位 1:按分钟加班、2:按半小时加班、3:按小时加班、4:按半天加班、5:按天加班
//防止多运算 KqglAssoOvertimeBasics basics = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, org_code));
if(lea.getOrdernum() == lea.getTotals()) { if(basics.getMinimumUnit() == 1) { company = "分钟"; }
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费 else if(basics.getMinimumUnit() == 2) { company = "半小时";}
//工作日 else if(basics.getMinimumUnit() == 3) { company = "小时";}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) { else if(basics.getMinimumUnit() == 4) { company = "半天";}
if(lea.getOvertimeTypeId() == 1) { else if(basics.getMinimumUnit() == 5) { company = "天";}
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { //1:转调休;2:转加班费;3:转调休或加班费
workingturncompenleave = workingturncompenleave + lea.getDuration(); if(lea.getCompensateId() == 1) { method="转调休"; }
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { else if(lea.getCompensateId() == 2) { method="转加班费"; }
workingtransferovertime = workingtransferovertime + + lea.getDuration(); else {method="转调休或加班费";}
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
//防止多运算
if(lea.getOrdernum() == lea.getTotals()) {
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
//工作日
if(ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num)) {
if(lea.getOvertimeTypeId() == 1) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
workingturncompenleave = workingturncompenleave + lea.getDuration();
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
workingtransferovertime = workingtransferovertime + + lea.getDuration();
}
} }
} }
} //休息日
//休息日 if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 2) {
if(lea.getOvertimeTypeId() == 2) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { restturncompenleave = restturncompenleave + lea.getDuration();
restturncompenleave = restturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { resttransferovertime = resttransferovertime + lea.getDuration();
resttransferovertime = resttransferovertime + lea.getDuration(); }
} }
} }
} if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) {
if(!ClockInTool.contains(ClockInTool.deleteArrayNull(ycqts),num) && !ClockInTool.contains(ClockInTool.deleteArrayNull(xxts),num)) { if(lea.getOvertimeTypeId() == 3) {
if(lea.getOvertimeTypeId() == 3) { if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) {
if(lea.getCompensateId() == 1 || lea.getCompensateId() == 3) { holidayturncompenleave = holidayturncompenleave + lea.getDuration();
holidayturncompenleave = holidayturncompenleave + lea.getDuration(); }else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) {
}else if(lea.getCompensateId() == 2 || lea.getCompensateId() == 4) { holidaytransferovertime = holidaytransferovertime + lea.getDuration();
holidaytransferovertime = holidaytransferovertime + lea.getDuration(); }
} }
} }
} }
} }
} }
}
if(rowData.size() == p) {
if(rowData.size() == p) { sjs = "";
sjs = ""; if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) {
if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) { sjs = rowData.get(u);
sjs = rowData.get(u); }else {
}else { sjs = rowData.get(u)+";";
sjs = rowData.get(u)+";"; }
} }
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban);
} /****/
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban); ////////
/****/ KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
//////// if(attgro.getPbfs() == 1){
int several = Integer.valueOf(ClockInTool.dateToWeek(num));//
KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num));
if(tesu == null) {
if(attgro.getPbfs() == 1){ //获取该员工最新班次
int several = Integer.valueOf(ClockInTool.dateToWeek(num));// KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num)); .eq(KqglAssoZhoupaiban::getType, several));
if(tesu == null) { if(gudingpb!=null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
}
}else {
if(tesu.getBcid() > 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid()));
}
}
//获取该员工最新班次 //获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId()) KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several)); .eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb!=null) { if(gudingpb != null) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid())); shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
} }
}else { }else if(attgro.getPbfs() == 2){
if(tesu.getBcid() > 0) { KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tesu.getBcid())); if(pbmxx != null && pbmxx.getBcid() != 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid()));
} }
}
//获取该员工最新班次
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb != null) {
shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
}
}else if(attgro.getPbfs() == 2){
KqglAssoPbmx pbmxx = KqglAssoPbmx.builder().build().selectOne(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, user.getEmpnum()).eq(KqglAssoPbmx::getData, num).eq(KqglAssoPbmx::getKqzid, attgro.getId()));
if(pbmxx != null && pbmxx.getBcid() != 0) {
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, pbmxx.getBcid()));
}
}
if(shif != null && shif.getSxbcs() != null) {
System.out.println(shif.getSxbcs());
answer = shif.getSxbcs();//1=2次 2=4次 3=6次
//未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数
//最后一次应打卡时间
String latimeclock = "";
if(answer == 1) {
latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3);
}else if(answer == 2) {
latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3);
}else {
latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3);
} }
for(KqglAssoRelationSummary learel:leainv) {
boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm"); if(shif != null && shif.getSxbcs() != null) {
if(adopt) { System.out.println(shif.getSxbcs());
xbqkcs = xbqkcs-1; answer = shif.getSxbcs();//1=2次 2=4次 3=6次
//未打最后一次卡的时候 判断最后一次打卡时间是否在请假范围内 相对应减少下班缺卡次数
//最后一次应打卡时间
String latimeclock = "";
if(answer == 1) {
latimeclock = num +" "+ shif.getXbdk1();//ClockInTool.dealDateFormat(shif.getXbdk1(),3);
}else if(answer == 2) {
latimeclock = num +" "+ shif.getXbdk2();//ClockInTool.dealDateFormat(shif.getXbdk2(),3);
}else {
latimeclock = num +" "+ shif.getXbdk3();//ClockInTool.dealDateFormat(shif.getXbdk3(),3);
}
for(KqglAssoRelationSummary learel:leainv) {
boolean adopt = ClockInTool.hourMinuteBetween(latimeclock, learel.getStartTime().substring(0, 16), learel.getEndTime().substring(0, 16),"yyyy-MM-dd HH:mm");
if(adopt) {
xbqkcs = xbqkcs-1;
}
} }
} }
u++;
p++;
} catch (Exception e) {
System.err.println("出错");
} }
u++;
p++;
} }
}else { }else {
for (String num2 : range) { for (String num2 : range) {
......
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