Commit 214aab91 by lal Committed by chenzg

修复考勤BUG

parent e38a8e2b
...@@ -28,9 +28,15 @@ public class ClockInTool { ...@@ -28,9 +28,15 @@ public class ClockInTool {
* @param numtime * @param numtime
* @return 1:增加一年、2:增加一天、3:减10天、4:增加一个月 * @return 1:增加一年、2:增加一天、3:减10天、4:增加一个月
*/ */
public static String requires_extra_times(String timeStr, int num,int numtime) { public static String requires_extra_times(String timeStr, int num,int numtime,int daft) {
DateFormat df;
if(daft == 1) {
df = new SimpleDateFormat("yyyy-MM-dd");
}else {
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = null; Date date = null;
try { try {
date = df.parse(timeStr); date = df.parse(timeStr);
...@@ -46,8 +52,10 @@ public class ClockInTool { ...@@ -46,8 +52,10 @@ public class ClockInTool {
cal.add(Calendar.DATE, num);//增加一天 cal.add(Calendar.DATE, num);//增加一天
}else if(numtime == 3) { }else if(numtime == 3) {
cal.add(Calendar.DATE, num);//减10天 cal.add(Calendar.DATE, num);//减10天
}else { }else if(numtime == 4){
cal.add(Calendar.MONTH, num);//增加一个月 cal.add(Calendar.MONTH, num);//增加一个月
}else if(numtime == 5) {
cal.add(Calendar.HOUR, num);
} }
return df.format(cal.getTime()); return df.format(cal.getTime());
} }
......
...@@ -986,7 +986,7 @@ public class TimeCardController { ...@@ -986,7 +986,7 @@ public class TimeCardController {
@ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明") @ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 39) @ApiOperationSupport(order = 39)
public Result<Integer> DelAttendanceGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) { public Result<Integer> DelAttendanceGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
if(KqglMainKqz.builder().id(id).build().deleteById()) {
List<UserAttendanceRel> attusers = userattendancerelmapper.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数 List<UserAttendanceRel> attusers = userattendancerelmapper.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数
//该考勤组所绑定的考勤机 //该考勤组所绑定的考勤机
List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1)); List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1));
...@@ -1005,12 +1005,20 @@ public class TimeCardController { ...@@ -1005,12 +1005,20 @@ public class TimeCardController {
params.add("userId", user_id); params.add("userId", user_id);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers); HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class); try {
System.err.print(request.getBody()); ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.error("删除失败:提示:考勤机服务出错");
}
} }
} }
} }
if(KqglMainKqz.builder().id(id).build().deleteById()) {
userequirelationmapper.deleteBykqzid(id); userequirelationmapper.deleteBykqzid(id);
//删除考勤组绑定的打卡方式 //删除考勤组绑定的打卡方式
......
...@@ -19,6 +19,7 @@ public class DailyDetailsDto { ...@@ -19,6 +19,7 @@ public class DailyDetailsDto {
private String dept;// 部门 private String dept;// 部门
private String post;// 岗位 private String post;// 岗位
private String attname;// 考勤组名称 private String attname;// 考勤组名称
private Integer attpbfs;// 排班方式(1:固定排班;2:自由排班;3:自由工时)
private String attdate;// 考勤日期 private String attdate;// 考勤日期
private Integer userid;// 用户ID private Integer userid;// 用户ID
private String data;// 日期 private String data;// 日期
......
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
<result column="bcxbdk3" property="bcxbdk3" /> <result column="bcxbdk3" property="bcxbdk3" />
<result column="attname" property="attname" /> <result column="attname" property="attname" />
<result column="attpbfs" property="attpbfs" />
<result column="attdate" property="attdate" /> <result column="attdate" property="attdate" />
<result column="userid" property="userid" /> <result column="userid" property="userid" />
<result column="data" property="data" /> <result column="data" property="data" />
...@@ -249,7 +250,8 @@ ...@@ -249,7 +250,8 @@
<select id="Dailydetails" resultMap="DailyDetailsMap"> <select id="Dailydetails" resultMap="DailyDetailsMap">
select sum.`name`,sum.num,sum.dept,sum.post, select sum.`name`,sum.num,sum.dept,sum.post,
(select kqz.name from kqgl_main_kqz kqz where kqz.id = sum.att_group) as attname, IFNULL((select kqz.name from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attname,
IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attpbfs,
'' address, '' address,
'' remarks, '' remarks,
'' cardtype, '' cardtype,
...@@ -296,8 +298,8 @@ ...@@ -296,8 +298,8 @@
sum.working_transfer_overtime as workingtransferovertime, sum.working_transfer_overtime as workingtransferovertime,
sum.rest_transfer_overtime as resttransferovertime, sum.rest_transfer_overtime as resttransferovertime,
sum.holiday_transfer_overtime as holidaytransferovertime, sum.holiday_transfer_overtime as holidaytransferovertime,
mrtj.leaverulesid, IFNULL(mrtj.leaverulesid,'') as leaverulesid,
mrtj.duration as balancedays IFNULL(mrtj.duration,'') as balancedays
from kqgl_asso_month_punch_summary sum from kqgl_asso_month_punch_summary sum
LEFT JOIN ( LEFT JOIN (
select DISTINCT info.`name` as username , select DISTINCT info.`name` as username ,
......
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