Commit 5652ae77 by 邓实川
parents 49b3823e f9f43c02
package cn.timer.api.config.Initialization;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
......@@ -13,6 +14,7 @@ import org.springframework.stereotype.Component;
@Order(3)//根据order的值的大小决定启动顺序
public class InitializeSetting implements ApplicationRunner {
// @Value("${PROJECT_NAME}")
// private String PROJECT_NAME;
......@@ -20,7 +22,8 @@ public class InitializeSetting implements ApplicationRunner {
public void run(ApplicationArguments args) throws Exception {
// StaticVariable.mac_command = "http://120.24.24.239:8095";//考勤机执行命令
StaticVariable.mac_command = "http://172.20.10.2:8088";//考勤机执行命令
// StaticVariable.mac_command = "http://192.168.4.95:8088";//考勤机执行命令
// StaticVariable.mac_command = "http://test-8timer-fk.youlingrc.com/";//考勤机执行命令
}
}
......@@ -15,6 +15,7 @@ import java.util.Locale;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
......@@ -111,6 +112,9 @@ import io.swagger.annotations.ApiParam;
@RequestMapping(value = "/kqz", produces = { "application/json", "multipart/form-data" })
public class AttController {
@Value("${config-8timer.machine8timerUrl}")
public String mac_command; // 回调地址
//班次
@Autowired
private ShiftManagementMapper shiftmanagementservice;
......@@ -1516,7 +1520,7 @@ public class AttController {
}
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = StaticVariable.mac_command+"/addUserName";
String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
......@@ -5004,7 +5008,7 @@ public class AttController {
// vResultJson.put("user_privilege", "USER");
// String sFinal = vResultJson.toString();
//
// String url = StaticVariable.mac_command;
// String url = mac_command;
// HttpHeaders headers = new HttpHeaders();
// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
// params.add("cmd", "SET_USER_INFO");
......
......@@ -18,7 +18,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
......@@ -517,15 +516,15 @@ public class ClockInController {
if(shiftm.getSxbcs() == 1 || shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//1次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(1).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk1(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks1(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs1(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(1).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks1()) || shiftm.getSbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs1()) || shiftm.getSbqjjs1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs1()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk1(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks1(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs1(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}
}
......@@ -534,14 +533,14 @@ public class ClockInController {
if(shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//2次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk2(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks2(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs2(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk2(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks2(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs2(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}
}
......@@ -550,14 +549,14 @@ public class ClockInController {
if(shiftm.getSxbcs() == 3){//3次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk3(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks3(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs3(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk3(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks3(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs3(),2)+":00"))).build();
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", "")))).build();
atts.add(as);
}
}
......
......@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
......@@ -22,6 +23,29 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/**
* @param timeStr
* @param addnumber
* @return 通过java Calendar 实现时间+ 分钟
*/
public static String addtime(String timeStr, String addnumber) {
String str = null;
try {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = df.parse(timeStr);
// 时间累计
Calendar gc = new GregorianCalendar();
gc.setTime(date);
gc.add(GregorianCalendar.MINUTE, Integer.parseInt(addnumber));
str = df.format(gc.getTime());
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
return str;
}
/**
* 获取指定年月的第一天
*
* @param year
......
......@@ -11,6 +11,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
......@@ -63,9 +64,9 @@ import cn.timer.api.bean.kqmk.KqglAssoYhsb;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.Initialization.StaticVariable;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.UserAttendanceRelMapper;
......@@ -74,6 +75,7 @@ import cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper;
import cn.timer.api.dao.kqmk.KqglAssoBcszMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkdzMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkwxMapper;
import cn.timer.api.dao.kqmk.KqglAssoKqjMapper;
import cn.timer.api.dao.kqmk.KqglAssoKqzdkfsMapper;
......@@ -94,6 +96,7 @@ import cn.timer.api.dto.kqmk.AttSchedulingDto;
import cn.timer.api.dto.kqmk.AttendanceAssistantDto;
import cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.ChangePunchResultsDto;
import cn.timer.api.dto.kqmk.CompensateDto;
import cn.timer.api.dto.kqmk.DailyDetailsDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
......@@ -125,6 +128,10 @@ import io.swagger.annotations.ApiOperation;
@Transactional
@RequestMapping(value = "/kqmk", produces = { "application/json", "multipart/form-data" })
public class TimeCardController {
@Value("${config-8timer.machine8timerUrl}")
public String mac_command; // 回调地址
@Autowired
private KqglAssoBcszMapper kqglassobcszmapper;
@Autowired
......@@ -489,7 +496,7 @@ public class TimeCardController {
@ApiOperation(value = "考勤机一键同步", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> SynchronizationTime(@CurrentUser UserBean userBean,@PathVariable("code") String code) {
String url = StaticVariable.mac_command+"/setTime";
String url = mac_command+"/setTime";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", code);
......@@ -516,7 +523,7 @@ public class TimeCardController {
KqglAssoKqj kqj = KqglAssoKqj.builder().id(kqjid).build().selectById();//查询考勤机“序列号”
for(int a=0;a<xgyh.length;a++){
String url = StaticVariable.mac_command+"/addUserPrivilege";
String url = mac_command+"/addUserPrivilege";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
......@@ -547,7 +554,7 @@ public class TimeCardController {
for(int a=0;a<xgyh.length;a++){
String url = StaticVariable.mac_command+"/addUserPrivilege";
String url = mac_command+"/addUserPrivilege";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
......@@ -585,10 +592,12 @@ public class TimeCardController {
kqglassokqj.setLusjTime(new Date().getTime());
kqglassokqj.setQyid(userBean.getOrgCode());
KqglAssoKqj kqj = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, kqglassokqj.getCode()));
if(kqj == null) {
if(!kqglassokqj.insert())
return ResultUtil.error("操作失败--新增考勤机");
String url = StaticVariable.mac_command+"/addDev";
String url = mac_command+"/addDev";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("orgCode", kqglassokqj.getType());
......@@ -603,7 +612,12 @@ public class TimeCardController {
return ResultUtil.success("失败");
}
return ResultUtil.success("操作成功!");
return ResultUtil.data(kqglassokqj,"操作成功!");
}else {
return ResultUtil.error("考勤机已存在或已被使用");
}
}
/**
......@@ -956,7 +970,7 @@ public class TimeCardController {
for(UserAttendanceRel user:attusers) {
String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
String url = StaticVariable.mac_command+"/deleteUser";
String url = mac_command+"/deleteUser";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", DevId);
......@@ -1081,7 +1095,7 @@ public class TimeCardController {
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = StaticVariable.mac_command+"/addUserName";
String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", kqj.getCode());
......@@ -1192,7 +1206,7 @@ public class TimeCardController {
//考勤组新增员工
String[] addmember = attsetuser.getAddMember();
String urladd = StaticVariable.mac_command+"/addUserName";
String urladd = mac_command+"/addUserName";
for(int a=0;a<addmember.length;a++){
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
......@@ -1215,7 +1229,7 @@ public class TimeCardController {
//考勤组减少员工
String[] removemember = attsetuser.getRemoveMember();
String urlre = StaticVariable.mac_command+"/deleteUser";
String urlre = mac_command+"/deleteUser";
for(int r=0;r<removemember.length;r++){
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
......@@ -2067,6 +2081,110 @@ public class TimeCardController {
}
@Autowired
private KqglAssoDkmxMapper kqglassodkmxmapper;
/**
* 更改打卡结果
* @throws ParseException
*/
@PostMapping(value = "/change_punch_results")
@ApiOperation(value = "更改打卡结果", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> ChangePunchResults(@CurrentUser UserBean userBean,@RequestBody ChangePunchResultsDto chpunchr) throws ParseException {
String data = chpunchr.getData();//应更改时间yyyy-MMM-dd
String minutes = chpunchr.getMinutes();//更改分钟数
KqglAssoBcsz dkbc = kqglassobcszmapper.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, chpunchr.getBcszid()));
String clock_time = null;//应打卡时间
long clock_time_ = 0l;
long changed_time = 0l;//改过的最终时间
int results = 0;//打卡结果
if(dkbc != null){
if(chpunchr.getClocktype() == 1) {
clock_time = (data+" "+dkbc.getSbdk1()+":00").replaceAll("\r|\n", "");
}else if(chpunchr.getClocktype() == 2) {
clock_time = (data+" "+dkbc.getXbdk1()+":00").replaceAll("\r|\n", "");
}else if(chpunchr.getClocktype() == 3) {
clock_time = (data+" "+dkbc.getSbdk2()+":00").replaceAll("\r|\n", "");
}else if(chpunchr.getClocktype() == 4) {
clock_time = (data+" "+dkbc.getXbdk2()+":00").replaceAll("\r|\n", "");
}else if(chpunchr.getClocktype() == 5) {
clock_time = (data+" "+dkbc.getSbdk3()+":00").replaceAll("\r|\n", "");
}else {
clock_time = (data+" "+dkbc.getXbdk3()+":00").replaceAll("\r|\n", "");
}
if(chpunchr.getAtttype() == 1) {//正常
changed_time = Long.valueOf(ClockInTool.dateToStamp(clock_time));
}else if(chpunchr.getAtttype() == 2) {//迟到
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_time, minutes)));
results = Integer.valueOf(minutes);
}else {//早退
changed_time = Long.valueOf(ClockInTool.dateToStamp(ClockInTool.addtime(clock_time, "-"+minutes)));
results = Integer.valueOf(minutes);
}
long sbdk1 = 0,xbdk1 = 0,sbdk2 = 0,xbdk2 = 0,sbdk3 = 0,xbdk3 = 0;
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()));
if(dkmx != null) {
if(chpunchr.getClocktype() == 1) {
sbdk1 = changed_time;
sbdk1jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).sbdk1(sbdk1).sbdk1jg(sbdk1jg).build().updateById();
}else if(chpunchr.getClocktype() == 2) {
xbdk1 = changed_time;
xbdk1jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).xbdk1(xbdk1).xbdk1jg(xbdk1jg).build().updateById();
}else if(chpunchr.getClocktype() == 3) {
sbdk2 = changed_time;
sbdk2jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).sbdk2(sbdk2).sbdk2jg(sbdk2jg).build().updateById();
}else if(chpunchr.getClocktype() == 4) {
xbdk2 = changed_time;
xbdk2jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).xbdk2(xbdk2).xbdk2jg(xbdk2jg).build().updateById();
}else if(chpunchr.getClocktype() == 5) {
sbdk3 = changed_time;
sbdk3jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).sbdk3(sbdk3).sbdk3jg(sbdk3jg).build().updateById();
}else {
xbdk3 = changed_time;
xbdk3jg = results;
KqglAssoDkmx.builder().id(dkmx.getId()).xbdk3(xbdk3).xbdk3jg(xbdk3jg).build().updateById();
}
}
//打卡记录表
clock_time_ = Long.valueOf(ClockInTool.dateToStamp(clock_time));
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(data,"yyyy-MM-dd")).getTime();
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(changed_time).results(results).userId(chpunchr.getNum()).type(chpunchr.getClocktype()).status(9).sort(chpunchr.getClocktype())
.cardType(3).qyid(userBean.getOrgCode()).attdate(attdate_+" "+ClockInTool.dateToWeek2(data)).attime(clock_time_).dkmxid(dkmx.getId()).bcid(chpunchr.getBcszid()).remarks("管理员改为正常").punchmode(0)
.punchequipment("").build();
if (!pre.insert()) {
throw new CustomException("打卡记录-新增异常");
}
return ResultUtil.success("操作成功!");
}else {
return ResultUtil.error("操作失败,检查班次是否存在");
}
}
// @GetMapping(value = "/summary_report")
// @ApiOperation(value = "考勤汇总报表(暂时不用)", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> attendance_summary_report() {
......
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChangePunchResultsDto {
private Integer atttype;// 类型:1:正常;2:迟到;3:早退
private Integer bcszid;// 班次ID
private String minutes;// 更改分钟数
private Integer num;// 员工id
private Integer clocktype;// 打卡类型 1:上班1 2:下班1 3:上班2 4:下班2...
private String data;//当天应打卡时间
}
......@@ -22,6 +22,22 @@ public class DailyDetailsDto {
private String attdate;// 考勤日期
private Integer userid;// 用户ID
private String data;// 日期
private String address;// 打卡地址
private String remarks;// 打卡备注
private Integer cardtype;// 打卡类型(1:GPS,2:WIFI,3:考勤机)
private String macaddress;// WIFI打卡地址
private String macname;// WIFI打卡名称
private Integer bcszid;
private String bcname;
private String bcsbdk1;
private String bcxbdk1;
private String bcsbdk2;
private String bcxbdk2;
private String bcsbdk3;
private String bcxbdk3;
private String sbdk1;// 上班1打卡时间
private Integer sbdk1jg;// 上班1打卡结果
private String xbdk1;// 下班1打卡时间
......
......@@ -171,6 +171,7 @@ logging:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
config-8timer:
machine8timerUrl: 'http://test-8timer-fk.youlingrc.com'
register-free-time: 90 #系统赠送时间
register-company-max-num: 100 #默认最大公司数量
register-childAccount-max-num: 10 #默认最大子账号数量
......
......@@ -146,6 +146,7 @@ logging:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
config-8timer:
machine8timerUrl: 'http://test-8timer-fk.youlingrc.com'
register-free-time: 90 #系统赠送时间
register-company-max-num: 100
register-childAccount-max-num: 10
......
......@@ -145,6 +145,7 @@ logging:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
config-8timer:
machine8timerUrl: 'http://test-8timer-fk.youlingrc.com'
register-free-time: 90 #系统赠送时间
register-company-max-num: 100
register-childAccount-max-num: 10
......
......@@ -54,7 +54,7 @@
<if test="param.text != null and param.text != ''" >
and (info.`name` like CONCAT('%',#{param.text},'%') or info.emp_num = #{param.text})
</if>
ORDER BY dkjl.id ASC
ORDER BY dkjl.id DESC
</select>
......
......@@ -150,6 +150,22 @@
<result column="num" property="num" />
<result column="dept" property="dept" />
<result column="post" property="post" />
<result column="address" property="address" />
<result column="remarks" property="remarks" />
<result column="cardtype" property="cardtype" />
<result column="macaddress" property="macaddress" />
<result column="macname" property="macname" />
<result column="bcszid" property="bcszid" />
<result column="bcname" property="bcname" />
<result column="bcsbdk1" property="bcsbdk1" />
<result column="bcxbdk1" property="bcxbdk1" />
<result column="bcsbdk2" property="bcsbdk2" />
<result column="bcxbdk2" property="bcxbdk2" />
<result column="bcsbdk3" property="bcsbdk3" />
<result column="bcxbdk3" property="bcxbdk3" />
<result column="attname" property="attname" />
<result column="attdate" property="attdate" />
<result column="userid" property="userid" />
......@@ -234,6 +250,19 @@
<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,
'' address,
'' remarks,
'' cardtype,
'' macaddress,
'' macname,
IFNULL(rtj.bcszid, '') bcszid,
IFNULL(rtj.bcname, '') bcname,
IFNULL(rtj.bcsbdk1, '') bcsbdk1,
IFNULL(rtj.bcxbdk1, '') bcxbdk1,
IFNULL(rtj.bcsbdk2, '') bcsbdk2,
IFNULL(rtj.bcxbdk2, '') bcxbdk2,
IFNULL(rtj.bcsbdk3, '') bcsbdk3,
IFNULL(rtj.bcxbdk3, '') bcxbdk3,
IFNULL(rtj.attdate, '') attdate,
IFNULL(rtj.userid,'') userid,
IFNULL(rtj.data,'') data,
......@@ -272,7 +301,7 @@
from kqgl_asso_month_punch_summary sum
LEFT JOIN (
select DISTINCT info.`name` as username ,
dkjl.attdate,
dkjl.attdate,bcsz.id as bcszid,
bcsz.`name` as bcname,bcsz.sbdk1 as bcsbdk1,bcsz.xbdk1 as bcxbdk1,bcsz.sbdk2 as bcsbdk2,bcsz.xbdk2 as bcxbdk2,bcsz.sbdk3 as bcsbdk3,bcsz.xbdk3 as bcxbdk3,
dkmx.`userid`,dkmx.`data` ,dkmx.`sbdk1`,dkmx.`sbdk1jg`,dkmx.`xbdk1` ,dkmx.`xbdk1jg`,dkmx.`sbdk2` ,dkmx.`sbdk2jg` ,dkmx.`xbdk2` ,
dkmx.`xbdk2jg`,dkmx.`sbdk3` ,dkmx.`sbdk3jg` ,dkmx.`xbdk3`,dkmx.`xbdk3jg` ,dkmx.`ydkcs` ,dkmx.`gzsc` ,dkmx.`qyid`,dkmx.`dksj` ,
......
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