Commit 1c75a00a by ilal

提交

parent 475bd596
......@@ -3003,79 +3003,94 @@ public class ClockInController {
}
ash.setDajl(dkjl);//班次信息中插入打卡打卡 数据
/****/
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary asssum1 = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, str).last("LIMIT 1"));
if(asssum1 != null) {
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if(asssum1.getApprovalType() == 1) {
dkjl.setCalendar_status_type(11);
ash.setCalendar_status_type(11);
}else if(asssum1.getApprovalType() == 2) {
//请假
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId,asssum1.getLeaveTypeId()));
if(rul.getRulesType() == 1) {
dkjl.setCalendar_status_type(1);
ash.setCalendar_status_type(1);
}else if(rul.getRulesType() == 2) {
dkjl.setCalendar_status_type(2);
ash.setCalendar_status_type(2);
}else if(rul.getRulesType() == 3) {
dkjl.setCalendar_status_type(3);
ash.setCalendar_status_type(3);
}else if(rul.getRulesType() == 4) {
dkjl.setCalendar_status_type(4);
ash.setCalendar_status_type(4);
}else if(rul.getRulesType() == 5) {
dkjl.setCalendar_status_type(5);
ash.setCalendar_status_type(5);
}else if(rul.getRulesType() == 6) {
dkjl.setCalendar_status_type(6);
ash.setCalendar_status_type(6);
}else if(rul.getRulesType() == 7) {
dkjl.setCalendar_status_type(7);
ash.setCalendar_status_type(7);
}else if(rul.getRulesType() == 8) {
dkjl.setCalendar_status_type(8);
ash.setCalendar_status_type(8);
}else if(rul.getRulesType() == 9) {
dkjl.setCalendar_status_type(9);
ash.setCalendar_status_type(9);
}else if(rul.getRulesType() == 10) {
dkjl.setCalendar_status_type(10);
ash.setCalendar_status_type(10);
}
}else if(asssum1.getApprovalType() == 3) {
dkjl.setCalendar_status_type(12);
ash.setCalendar_status_type(12);
}else if(asssum1.getApprovalType() == 4) {
dkjl.setCalendar_status_type(13);
ash.setCalendar_status_type(13);
}
}else {
dkjl.setCalendar_status_type(0);
ash.setCalendar_status_type(0);
}
if(asssum1 != null) {
if(asssum1.getApprovalType() != 5) {
String startTime = asssum1.getStartTime();//
String endTime = asssum1.getEndTime();//
if(ash.getDajl().getCardType() != null) {
boolean affair = ClockInTool.hourMinuteBetween(ClockInTool.stampToDate(String.valueOf(ash.getDajl().getDktime())), startTime, endTime,"yyyy-MM-dd HH:mm:ss");
if(affair && ash.getDajl().getStatus() != 9 && ash.getDajl().getStatus() != 10 && ash.getDajl().getStatus() != 11
&& ash.getDajl().getStatus() != 12 && ash.getDajl().getStatus() != 13 && ash.getDajl().getStatus() != 14) {
ash.getDajl().setStatus(1);
}
}
}
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if(asssum1.getApprovalType() == 1) {
dkjl.setCalendar_status_type(11);
ash.setCalendar_status_type(11);
}else if(asssum1.getApprovalType() == 2) {
//请假
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId,asssum1.getLeaveTypeId()));
if(rul.getRulesType() == 1) {
dkjl.setCalendar_status_type(1);
ash.setCalendar_status_type(1);
}else if(rul.getRulesType() == 2) {
dkjl.setCalendar_status_type(2);
ash.setCalendar_status_type(2);
}else if(rul.getRulesType() == 3) {
dkjl.setCalendar_status_type(3);
ash.setCalendar_status_type(3);
}else if(rul.getRulesType() == 4) {
dkjl.setCalendar_status_type(4);
ash.setCalendar_status_type(4);
}else if(rul.getRulesType() == 5) {
dkjl.setCalendar_status_type(5);
ash.setCalendar_status_type(5);
}else if(rul.getRulesType() == 6) {
dkjl.setCalendar_status_type(6);
ash.setCalendar_status_type(6);
}else if(rul.getRulesType() == 7) {
dkjl.setCalendar_status_type(7);
ash.setCalendar_status_type(7);
}else if(rul.getRulesType() == 8) {
dkjl.setCalendar_status_type(8);
ash.setCalendar_status_type(8);
}else if(rul.getRulesType() == 9) {
dkjl.setCalendar_status_type(9);
ash.setCalendar_status_type(9);
}else if(rul.getRulesType() == 10) {
dkjl.setCalendar_status_type(10);
ash.setCalendar_status_type(10);
}
}else if(asssum1.getApprovalType() == 3) {
dkjl.setCalendar_status_type(12);
ash.setCalendar_status_type(12);
}else if(asssum1.getApprovalType() == 4) {
dkjl.setCalendar_status_type(13);
ash.setCalendar_status_type(13);
}
}else {
dkjl.setCalendar_status_type(0);
ash.setCalendar_status_type(0);
}
/****/
ash.setDajl(dkjl);//班次信息中插入打卡打卡 数据
// ash.setDajl(dkjl);//班次信息中插入打卡打卡 数据
}
}
......
......@@ -1887,6 +1887,8 @@ public class TimeCardController {
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(data,"yyyy-MM-dd")).getTime();
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
String punchattdate = new SimpleDateFormat("yyyy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
String minutes = chpunchr.getMinutes();//更改分钟数
KqglAssoBcsz dkbc = kqglassobcszmapper.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, chpunchr.getBcszid()));
......@@ -2025,6 +2027,39 @@ public class TimeCardController {
dkmxid = pcd.getId();
}
double gzsc = 0;
long rest_time = 0;
if(dkbc.getStartTime() != null && dkbc.getEndTime() != null) {
long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(punchattdate + " " +dkbc.getStartTime()+":00"));
long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(punchattdate + " " +dkbc.getEndTime()+":00"));
rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
}
//请假时长
KqglAssoRelationSummary qjsc = kqglassorelationsummarymapper.Businessdayclockin(userBean.getEmpNum(), 2, punchattdate, userBean.getOrgCode());
//计算工作时长
KqglAssoDkmx dkgzsc = KqglAssoDkmx.builder().id(dkmxid).build().selectById();
if(dkgzsc.getYdkcs() == 2 || dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk1() != null && dkgzsc.getXbdk1() != null) {
gzsc = gzsc + (dkgzsc.getXbdk1() - dkgzsc.getSbdk1())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk2() != null && dkgzsc.getXbdk2() != null) {
gzsc = gzsc + (dkgzsc.getXbdk2() - dkgzsc.getSbdk2())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk3() != null && dkgzsc.getXbdk3() != null) {
gzsc = gzsc + (dkgzsc.getXbdk3() - dkgzsc.getSbdk3())/1000/60;
}
}
gzsc = gzsc - rest_time - qjsc.getDuration();
KqglAssoDkmx.builder().id(dkmxid).gzsc(gzsc).build().updateById();
//打卡记录表
clock_time_ = Long.valueOf(ClockInTool.dateToStamp(clock_time));
......
......@@ -32,6 +32,7 @@ import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.kqgl.EmptyUtil;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
import cn.timer.api.dto.kqmk.AttLateLate;
......@@ -289,6 +290,9 @@ public class KqglServiceImpl implements KqglService {
@Autowired
private KqglMainKqzMapper kqglmainkqzmapper;
@Autowired
private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper;
/**
* 考勤补卡审批
*/
......@@ -755,6 +759,41 @@ public class KqglServiceImpl implements KqglService {
//attime 应打卡时间
double gzsc = 0;
long rest_time = 0;
if(shif.getStartTime() != null && shif.getEndTime() != null) {
long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(cardrepltime + " " +shif.getStartTime()+":00"));
long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(cardrepltime + " " +shif.getEndTime()+":00"));
rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
}
//请假时长
KqglAssoRelationSummary qjsc = kqglassorelationsummarymapper.Businessdayclockin(repaappr.getUserid(), 2, cardrepltime, repaappr.getOrgcode());
//计算工作时长
KqglAssoDkmx dkgzsc = KqglAssoDkmx.builder().id(dkmxid).build().selectById();
if(dkgzsc.getYdkcs() == 2 || dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk1() != null && dkgzsc.getXbdk1() != null) {
gzsc = gzsc + (dkgzsc.getXbdk1() - dkgzsc.getSbdk1())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk2() != null && dkgzsc.getXbdk2() != null) {
gzsc = gzsc + (dkgzsc.getXbdk2() - dkgzsc.getSbdk2())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk3() != null && dkgzsc.getXbdk3() != null) {
gzsc = gzsc + (dkgzsc.getXbdk3() - dkgzsc.getSbdk3())/1000/60;
}
}
gzsc = gzsc - rest_time - qjsc.getDuration();
KqglAssoDkmx.builder().id(dkmxid).gzsc(gzsc).build().updateById();
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(repaappr.getCardrepltime()).results(results).userId(repaappr.getUserid()).type(type).status(status).sort(atttype)
.cardType(0).qyid(repaappr.getOrgcode()).attdate(attdate_+" "+ClockInTool.dateToWeek2(cardrepltime)).attime(attime).dkmxid(dkmxid).bcid(shifid).remarks("审批补卡通过打卡").punchmode(0)
.punchequipment("").commentary("成功打卡").build();
......
......@@ -25,4 +25,7 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
KqglAssoRelationSummary selectTabledata(int userid,int approvaltype,String apptime);
KqglAssoRelationSummary leaveinvesti(int userid,int approvaltype,String apptime,int orgcode);
KqglAssoRelationSummary Businessdayclockin(int userid,int approvaltype,String apptime,int orgcode);
}
......@@ -86,6 +86,15 @@
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime}
</select>
<select id="Businessdayclockin" resultMap="BaseResultMap">
select IFNULL(SUM(res.duration),0) as duration
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and res.app_time = #{apptime}
and res.org_code = #{orgcode}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRelationSummary">
......
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