Commit 566ebf8d by lal Committed by chenzg

提交

parent 73634d33
......@@ -66,4 +66,6 @@ public class KqglAssoRelationSummary extends Model<KqglAssoRelationSummary> {
@ApiModelProperty(value = "结束时间 ", example = "结束时间")
private String endTime;
@ApiModelProperty(value = "企业组织代码 ", example = "企业组织代码")
private Integer orgCode;
}
\ No newline at end of file
......@@ -273,7 +273,17 @@ public class ClockInController {
kskd = false;
if(attdate.getAttsch().size() == 2) {//一套上下班 上班1
atttype = 1;
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(starttime1)));//应打卡时间
Date sd2=df1.parse(sStdIoTime);//打卡时间
Date sd3=df1.parse(ClockInTool.stampToDate(String.valueOf(endtime1)));//应打卡时间
if(sd2.before(sd3)) {
atttype = 1;
}
if(sd2.after(sd1) && sd2.after(sd3)) {
atttype = 2;
}
}else {
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
......
package cn.timer.api.controller.kqgl;
import java.text.DateFormat;
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -22,6 +23,96 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/**
* 将String时间转换为时间戳
*
* @param time
* @return
* @throws ParseException
*/
public static long getStringTime(String time, String format)
throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
Date date = simpleDateFormat.parse(time);
return date.getTime();
}
/**
* 根据时间戳获取23点
*
* @return
*/
public static Date getnowEndTime(int day, long time) {
Calendar todayEnd = Calendar.getInstance();
todayEnd.setTimeInMillis(time);
todayEnd.set(Calendar.HOUR_OF_DAY, day);
todayEnd.set(Calendar.MINUTE, 59);
todayEnd.set(Calendar.SECOND, 59);
todayEnd.set(Calendar.MILLISECOND, 999);
return todayEnd.getTime();
}
/**
* 根据时间戳获取0点
*
* @return
*/
public static Date getStartTime(int day, long time) {
Calendar todayStart = Calendar.getInstance();
todayStart.setTimeInMillis(time);
todayStart.set(Calendar.HOUR_OF_DAY, day);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(Calendar.MILLISECOND, 0);
return todayStart.getTime();
}
// 根据传入的日期获取所在月份所有日期
public static List<String> getAllDaysMonthByDate(Date d){
List<String> lst = new ArrayList<String>();
Date date = getMonthStart(d);
Date monthEnd = getMonthEnd(d);
while (!date.after(monthEnd)) {
lst.add(famt.format(date));
date = getNext(date);
}
return lst;
}
private static Date getMonthStart(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int index = calendar.get(Calendar.DAY_OF_MONTH);
calendar.add(Calendar.DATE, (1 - index));
return calendar.getTime();
}
private static Date getMonthEnd(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, 1);
int index = calendar.get(Calendar.DAY_OF_MONTH);
calendar.add(Calendar.DATE, (-index));
return calendar.getTime();
}
private static Date getNext(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DATE, 1);
return calendar.getTime();
}
// 将字符串转化为日期
public static Date paraseStringToDate(String timestr){
Date date = null;
Format f = new SimpleDateFormat("yyyy-MM-dd");
try {
date = (Date) f.parseObject(timestr);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
/***
* 去除String数组中的空值
......@@ -505,6 +596,30 @@ public class ClockInTool {
res = simpleDateFormat.format(date);
return res;
}
/**
* 时间戳转换时间
*/
public static String stampToDate2(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
/**
* 时间戳转换时间
*/
public static String stampToDate3(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
}
......@@ -41,7 +41,7 @@ public class KqglServiceImpl implements KqglService {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(leaveappr.getUserid()).appTime(num).approvalId(leaveappr.getLeaveid()).approvalType(2).duration(leaveappr.getDuration())
.leaveTypeId(leaveappr.getLeavetype()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).build().insert();
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).orgCode(leaveappr.getOrgcode()).build().insert();
}
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()));
......@@ -69,7 +69,7 @@ public class KqglServiceImpl implements KqglService {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(overappr.getUserid()).appTime(num).approvalId(overappr.getOvertimeid()).approvalType(1).duration(overappr.getDuration())
.overtimeTypeId(overappr.getOvertimetype()).compensateId(overappr.getCompensate()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).build().insert();
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).orgCode(overappr.getOrgcode()).build().insert();
}
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, overappr.getUserid()).eq(YgglMainEmp::getOrgCode, overappr.getOrgcode()));
......@@ -105,7 +105,8 @@ public class KqglServiceImpl implements KqglService {
for(String num : days) {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3)
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())).build().insert();
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert();
}
}else { //外出
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime());
......@@ -114,7 +115,8 @@ public class KqglServiceImpl implements KqglService {
for(String num : days) {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4)
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())).build().insert();
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert();
}
}
return true;
......@@ -127,7 +129,12 @@ public class KqglServiceImpl implements KqglService {
public boolean attrepairapproval(AttRepairApprovalDto repaappr) {
String cardrepltime = new SimpleDateFormat("yyyy-MM-dd").format(repaappr.getCardrepltime());//补卡时间
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(repaappr.getUserid()).appTime(cardrepltime).approvalId(repaappr.getRepairid()).approvalType(5).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(repaappr.getCardrepltime())).build().insert();
KqglAssoRelationSummary.builder().userId(repaappr.getUserid()).appTime(cardrepltime).approvalId(repaappr.getRepairid()).approvalType(5).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(repaappr.getCardrepltime())).orgCode(repaappr.getOrgcode()).build().insert();
return true;
}
......
......@@ -24,7 +24,7 @@ public class AttOvertimeApprovalDto {
@ApiModelProperty(value = "公司id", example = "")
private int orgcode;
@ApiModelProperty(value = "加班类型", example = "具体传ID")
@ApiModelProperty(value = "加班类型", example = "1:工作日加班;2:休息日加班;3:节假日加班")
private int overtimetype;
@ApiModelProperty(value = "开始时间", example = "时间戳")
......
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CalendarDetailsDto {
private String content;//内容
private String duration;//时长
private String start_time;
private String end_time;
private Integer affair_type;//审批类型 1:加班 2:请假 3:出差 4:外出 5:补卡
}
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CalendarPunchDetailsDto {
@ApiModelProperty(value = "字段说明", example = "0")
private Integer clock_num;// 打卡次数
@ApiModelProperty(value = "字段说明", example = " ")
private String date;
@ApiModelProperty(value = "字段说明", example = " ")
private String bcsbdk1;//班次打卡时间
@ApiModelProperty(value = "字段说明", example = " ")
private String bcxbdk1;
@ApiModelProperty(value = "字段说明", example = " ")
private String bcsbdk2;
@ApiModelProperty(value = "字段说明", example = " ")
private String bcxbdk2;
@ApiModelProperty(value = "字段说明", example = " ")
private String bcsbdk3;
@ApiModelProperty(value = "字段说明", example = " ")
private String bcxbdk3;
private String sbdksj1;//用户打卡时间
private Integer sbdksj1jg;//用户打卡结果
private String xbdksj1;
private Integer xbdksj1jg;
private String sbdksj2;
private Integer sbdksj2jg;
private String xbdksj2;
private Integer xbdksj2jg;
private String sbdksj3;
private Integer sbdksj3jg;
private String xbdksj3;
private Integer xbdksj3jg;
}
package cn.timer.api.dto.kqmk;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DetailsofbusinessDto {
List<CalendarPunchDetailsDto> caldet;
List<CalendarDetailsDto> calils;
}
package cn.timer.api.dto.kqmk;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WorkbenchCalendarDto {
private String date;
private Integer calendar_status;//日历状态 0:无; 1:正常;2:事务(请假,加班,调休,出差);3:异常 4:休息
private List<CalendarPunchDetailsDto> detailed;
}
......@@ -15,6 +15,7 @@
<result column="compensate_id" property="compensateId" />
<result column="start_time" property="startTime" />
<result column="end_time" property="endTime" />
<result column="org_code" property="orgCode" />
</resultMap>
<sql id="Base_Column_List">
......@@ -28,22 +29,10 @@
overtime_type_id,
compensate_id,
start_time,
end_time
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoRelationSummary_id,
user_id KqglAssoRelationSummary_user_id,
app_time KqglAssoRelationSummary_app_time,
approval_id KqglAssoRelationSummary_approval_id,
approval_type KqglAssoRelationSummary_approval_type,
duration KqglAssoRelationSummary_duration,
leave_type_id KqglAssoRelationSummary_leave_type_id,
overtime_type_id KqglAssoRelationSummary_overtime_type_id,
compensate_id KqglAssoRelationSummary_compensate_id,
start_time KqglAssoRelationSummary_start_time,
end_time KqglAssoRelationSummary_end_time
end_time,
org_code
</sql>
<select id="SecondaryValue" resultMap="BaseResultMap">
select a.user_id,
......
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