Commit 8691470d by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!316
parents 168c5ed1 dd5d6359
package cn.timer.api.controller.kqgl;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.AttConditions;
import cn.timer.api.bean.kqgl.AttGroupBinPunchMode;
......@@ -63,6 +65,7 @@ import cn.timer.api.dto.kqmk.AttLateLate;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.dto.kqmk.ClockCollectData;
import cn.timer.api.dto.kqmk.KqglAssoMonthPunchSummaryDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.WorkbenchCalendarDto;
import cn.timer.api.utils.DateUtil;
......@@ -2113,6 +2116,10 @@ public class ClockInController {
@ApiOperation(value = "获取考勤打卡数据------APP打卡", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
public Result<Object> getAttClockData(@CurrentUser UserBean userBean,@RequestBody AttConditions attconditions) throws ParseException {
long nowdate = new Date().getTime();
String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String str = null;
if(!("").equals(attconditions.getDate())){
str = attconditions.getDate();
......@@ -2139,9 +2146,57 @@ public class ClockInController {
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode()); //考勤组信息
if(attgro != null) {
//APP获取当前天的考勤信息
//APP获取当前天的考勤信息
AttendanceCardListDto attdate = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),attconditions.getDate());
//打卡记录
// List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// attdate.setAttpr(dajllist);
List<AttSchedule> attsch = attdate.getAttsch();
for(AttSchedule ash : attsch) {
if(attdate.getAttsch().size() == 2) {
//有范围
if(ash.getStarttime() != 0 && ash.getEndtime() != 0) {
boolean ectivedate = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(nowdate), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getStarttime()), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getEndtime()),"yyyy-MM-dd HH:mm");
if(ectivedate) {
ash.setIsdk(0);
}else {
ash.setIsdk(1);
}
}else {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, ash.getId()));
String xbdk1 = (current+" "+shif.getXbdk1()+":00").replaceAll("\r|\n", "");
Timestamp b = Timestamp.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));//
Timestamp a = Timestamp.valueOf(xbdk1);
if (b.after(a)) {// >
ash.setIsdk(1);
}
}
}else {
boolean ectivedate = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(nowdate), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getStarttime()), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(ash.getEndtime()),"yyyy-MM-dd HH:mm");
if(ectivedate) {
ash.setIsdk(0);
}else {
ash.setIsdk(1);
}
}
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
for(KqglAssoDkjl daj : dajllist_) {
if(ash.getId() == daj.getBcid() && ash.getSort() == daj.getSort()) {//班次id和打卡顺序对应
BeanUtil.copyProperties(daj, dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
ash.setIsdk(1);
}
}
ash.setDajl(dkjl);
}
//外勤 true:开 false:关
if(attgro.getIsWq() == 1) {
attdate.setFieldpersonnel(true);
......@@ -2200,10 +2255,6 @@ public class ClockInController {
}
attdate.setMachine(akms);
//打卡记录
List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
attdate.setAttpr(dajllist);
//当天第一次打卡 前一天晚走小时**************************************************
double latetime_ = 0;//前天晚走时长(分钟)
......
......@@ -1315,8 +1315,11 @@ public class TimeCardController {
String[] attser = attass.getAttuserids();
if(attser.length>0){
for(int u=0;u<attser.length;u++){
if(attass.getAtttype() == 2){ KqglAssoPbmx.builder().build().delete(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, Integer.valueOf(attser[u])));}
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, Integer.valueOf(attser[u])));
if(attass.getAtttype() == 2){
KqglAssoPbmx.builder().build().delete(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getUserid, Integer.valueOf(attser[u])));
}
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, Integer.valueOf(attser[u])).eq(KqglAssoYhkqz::getQyid, userBean.getOrgCode()));
KqglAssoYhkqz kquser = KqglAssoYhkqz.builder().kqzid(attid).userid(Integer.valueOf(attser[u])).qyid(userBean.getOrgCode()).build();
yhkqzlist.add(kquser);
......
......@@ -2,6 +2,7 @@ package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -24,4 +25,7 @@ public class AttSchedule implements Serializable{
private Long time;
private Long starttime;
private Long endtime;
private int isdk;//0:当前打卡 1:已过打卡
private KqglAssoDkjl dajl;
}
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