Commit b67057c6 by leialin

Merge branch 'lal' into 'develop'

修复考勤BUG

See merge request 8timerv2/8timerapiv200!160
parents 1875acf0 5ef4af05
......@@ -28,9 +28,15 @@ public class ClockInTool {
* @param numtime
* @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;
try {
date = df.parse(timeStr);
......@@ -46,8 +52,10 @@ public class ClockInTool {
cal.add(Calendar.DATE, num);//增加一天
}else if(numtime == 3) {
cal.add(Calendar.DATE, num);//减10天
}else {
}else if(numtime == 4){
cal.add(Calendar.MONTH, num);//增加一个月
}else if(numtime == 5) {
cal.add(Calendar.HOUR, num);
}
return df.format(cal.getTime());
}
......
......@@ -986,7 +986,7 @@ public class TimeCardController {
@ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
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<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1));
......@@ -1005,12 +1005,20 @@ public class TimeCardController {
params.add("userId", user_id);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
try {
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);
//删除考勤组绑定的打卡方式
......
......@@ -19,6 +19,7 @@ public class DailyDetailsDto {
private String dept;// 部门
private String post;// 岗位
private String attname;// 考勤组名称
private Integer attpbfs;// 排班方式(1:固定排班;2:自由排班;3:自由工时)
private String attdate;// 考勤日期
private Integer userid;// 用户ID
private String data;// 日期
......
......@@ -167,6 +167,7 @@
<result column="bcxbdk3" property="bcxbdk3" />
<result column="attname" property="attname" />
<result column="attpbfs" property="attpbfs" />
<result column="attdate" property="attdate" />
<result column="userid" property="userid" />
<result column="data" property="data" />
......@@ -249,7 +250,8 @@
<select id="Dailydetails" resultMap="DailyDetailsMap">
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,
'' remarks,
'' cardtype,
......@@ -296,8 +298,8 @@
sum.working_transfer_overtime as workingtransferovertime,
sum.rest_transfer_overtime as resttransferovertime,
sum.holiday_transfer_overtime as holidaytransferovertime,
mrtj.leaverulesid,
mrtj.duration as balancedays
IFNULL(mrtj.leaverulesid,'') as leaverulesid,
IFNULL(mrtj.duration,'') as balancedays
from kqgl_asso_month_punch_summary sum
LEFT JOIN (
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