Commit 4726ae20 by 邓实川
parents eee83665 1fbc9053
......@@ -53,6 +53,7 @@ import cn.timer.api.bean.kqmk.KqglAssoKqj;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRange;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRules;
......@@ -86,6 +87,7 @@ import cn.timer.api.dao.kqmk.KqglAssoMonthPunchSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoOvertimeRangeMapper;
import cn.timer.api.dao.kqmk.KqglAssoOvertimeRulesMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoRulesViceMapper;
import cn.timer.api.dao.kqmk.KqglAssoTeshuMapper;
import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper;
......@@ -102,6 +104,7 @@ import cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.CalendarDetailsDto;
import cn.timer.api.dto.kqmk.CalendarPunchDetailsDto;
import cn.timer.api.dto.kqmk.CalendarTableDataDto;
import cn.timer.api.dto.kqmk.ChangePunchResultsDto;
import cn.timer.api.dto.kqmk.CompensateDto;
import cn.timer.api.dto.kqmk.DailyDetailsDto;
......@@ -2248,7 +2251,7 @@ public class TimeCardController {
int sbdk1jg = 0,xbdk1jg = 0,sbdk2jg = 0,xbdk2jg = 0,sbdk3jg = 0,xbdk3jg = 0;
//kqgl_asso_dkmx 打卡明细是否存在打卡记录
KqglAssoDkmx dkmx = kqglassodkmxmapper.selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getData, chpunchr.getData()).eq(KqglAssoDkmx::getUserid, chpunchr.getNum()));
KqglAssoDkmx dkmx = kqglassodkmxmapper.selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getData, chpunchr.getData()).eq(KqglAssoDkmx::getUserid, chpunchr.getNum()).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode()));
if(dkmx != null) {
if(chpunchr.getClocktype() == 1) {
sbdk1 = changed_time;
......@@ -2393,7 +2396,7 @@ public class TimeCardController {
if(rul != null) {
if(id == 1) {
if(rul.getIsWorkovertime() == 1 && rul.getWorkSwitch() == 1) {
if(rul.getWorkOne() != "0") {
if(!("0").equals(rul.getWorkOne())) {
CompensateDto com = CompensateDto.builder().build();
com.setId(1);
com.setValue("调休");
......@@ -2405,7 +2408,7 @@ public class TimeCardController {
com2.setValue("加班费");
coms.add(com2);
}
if(rul.getWorkThree() != "0") {
if(!("0").equals(rul.getWorkThree())) {
CompensateDto com3 = CompensateDto.builder().build();
com3.setId(3);
com3.setValue("调休/加班费");
......@@ -2414,7 +2417,7 @@ public class TimeCardController {
}
}else if(id == 2) {
if(rul.getIsRestovertime() == 1 && rul.getRestSwitch() == 1) {
if(rul.getRestOne() != "0") {
if(!("0").equals(rul.getRestOne())) {
CompensateDto com = CompensateDto.builder().build();
com.setId(1);
com.setValue("调休");
......@@ -2426,7 +2429,7 @@ public class TimeCardController {
com2.setValue("加班费");
coms.add(com2);
}
if(rul.getRestThree() != "0") {
if(!("0").equals(rul.getRestThree())) {
CompensateDto com3 = CompensateDto.builder().build();
com3.setId(3);
com3.setValue("调休/加班费");
......@@ -2435,7 +2438,7 @@ public class TimeCardController {
}
}else {
if(rul.getIsHolidays() == 1 && rul.getHolidaysSwitch() == 1) {
if(rul.getHolidaysOne() != "0") {
if(!("0").equals(rul.getHolidaysOne())) {
CompensateDto com = CompensateDto.builder().build();
com.setId(1);
com.setValue("调休");
......@@ -2447,7 +2450,7 @@ public class TimeCardController {
com2.setValue("加班费");
coms.add(com2);
}
if(rul.getHolidaysThree() != "0") {
if(!("0").equals(rul.getHolidaysThree())) {
CompensateDto com3 = CompensateDto.builder().build();
com3.setId(3);
com3.setValue("调休/加班费");
......@@ -2785,7 +2788,7 @@ public class TimeCardController {
}
if(ashss.get(0).getId() != 0) {
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode())
.ge(KqglAssoDkmx::getDksj, start_time).le(KqglAssoDkmx::getDksj, end_time));
if(dkmc != null) {
if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
......@@ -2840,7 +2843,7 @@ public class TimeCardController {
Long starttime = DateUtil.getStartTime(0,DateUtil.getStringTime(current,"yyyy-MM-dd")).getTime();
Long endtime = DateUtil.getnowEndTime(23,DateUtil.getStringTime(current,"yyyy-MM-dd")).getTime();
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode())
.ge(KqglAssoDkmx::getDksj, starttime).le(KqglAssoDkmx::getDksj, endtime));
if(dkmc!=null) {
......@@ -2913,7 +2916,7 @@ public class TimeCardController {
dets.setDate(date);
Long starttime = DateUtil.getStartTime(0,DateUtil.getStringTime(date,"yyyy-MM-dd")).getTime();
Long endtime = DateUtil.getnowEndTime(23,DateUtil.getStringTime(date,"yyyy-MM-dd")).getTime();
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum()).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode())
.ge(KqglAssoDkmx::getDksj, starttime).le(KqglAssoDkmx::getDksj, endtime));
if(dkmc!=null) {
dets.setSbdksj1(dkmc.getSbdk1() == null ? "" : ClockInTool.stampToDate3(String.valueOf(dkmc.getSbdk1())));
......@@ -3004,4 +3007,48 @@ public class TimeCardController {
return ResultUtil.data(ils, "操作成功!");
}
@Autowired
private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper;
@GetMapping(value = "/worktable_attendance_from")
@ApiOperation(value = "999:工作台考勤表格", httpMethod = "GET", notes = "查询数据")
public Result<Object> worktable_attendance_from(@CurrentUser UserBean userBean) throws ParseException {
CalendarTableDataDto tabl = CalendarTableDataDto.builder().build();
String belongyear = new SimpleDateFormat("yyyy").format(new Date());
String belongmonth = new SimpleDateFormat("MM").format(new Date());
String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();//
//1:加班 2:请假 3:出差 4:外出 5:补卡
KqglAssoRelationSummary sums = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 1, ttstr);
KqglAssoRelationSummary qjj = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 2, ttstr);
KqglAssoRelationSummary cxx = kqglassorelationsummarymapper.selectTabledata(userBean.getEmpNum(), 3, ttstr);
KqglAssoMonthPunchSummary punsum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getNum, userBean.getEmpNum())
.eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode()).eq(KqglAssoMonthPunchSummary::getBelongYear, belongyear).eq(KqglAssoMonthPunchSummary::getBelongMonth, belongmonth));
Double compensatoryleave = 0d;
if(punsum != null) {
compensatoryleave = punsum.getWorkingTurnCompenLeave() + punsum.getRestTurnCompenLeave() + punsum.getHolidayTurnCompenLeave();
}
tabl.setAttendance(punsum == null ? "" : String.valueOf(punsum.getDaysOnDuty()));// 应出勤
tabl.setAttended(punsum == null ? "" : String.valueOf(punsum.getActualAttDays()));// 已出勤
tabl.setLeave(qjj == null ? "" : String.valueOf(qjj.getDuration()));// 请假
tabl.setLackworkcard(punsum == null ? "" : String.valueOf(punsum.getNumberWorkCardShortage()));// 上班缺卡
tabl.setWorkovertime(sums == null ? "" : String.valueOf(sums.getDuration()));// 加班
tabl.setCompensatoryleave(String.valueOf(compensatoryleave));// 调休
tabl.setEvection(cxx == null ? "" : String.valueOf(cxx.getDuration()));// 出差
tabl.setOffdutycardshortage(punsum == null ? "" : String.valueOf(punsum.getNumberDutyCardShortage()));// 下班缺卡
return ResultUtil.data(tabl, "操作成功!");
}
}
......@@ -21,4 +21,6 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
List<KqglAssoRelationSummary> SpecificLeave(int userid,int approvaltype,String apptime);
List<KqglAssoRelationSummary> LeaveInvestigation(int userid,int approvaltype,String apptime);
KqglAssoRelationSummary selectTabledata(int userid,int approvaltype,String apptime);
}
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CalendarTableDataDto {
private String attendance;// 应出勤
private String attended;// 已出勤
private String leave;// 请假
private String lackworkcard;// 上班缺卡
private String workovertime;// 加班
private String compensatoryleave;// 调休
private String evection;// 出差
private String offdutycardshortage;// 下班缺卡
}
......@@ -64,7 +64,13 @@
GROUP BY res.start_time,res.end_time;
</select>
<select id="selectTabledata" resultMap="BaseResultMap">
select SUM(res.duration) as duration
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime}
</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