Commit aa29bdd6 by lal Committed by chenzg

提交

parent faa806c3
......@@ -23,6 +23,36 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/**
* @param timeStr 修改的时间
* @param num 修改数字
* @param numtime
* @return 1:增加一年、2:增加一天、3:减10天、4:增加一个月
*/
public static String requires_extra_times(String timeStr, int num,int numtime) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date = df.parse(timeStr);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);// 设置起时间
if(numtime == 1) {
cal.add(Calendar.YEAR, num);// 增加一年
}else if(numtime == 2) {
cal.add(Calendar.DATE, num);//增加一天
}else if(numtime == 3) {
cal.add(Calendar.DATE, num);//减10天
}else {
cal.add(Calendar.MONTH, num);//增加一个月
}
return df.format(cal.getTime());
}
/**
* @param timeStr
* @param addnumber
* @return 通过java Calendar 实现时间+ 分钟
......@@ -432,5 +462,18 @@ public class ClockInTool {
res = String.valueOf(ts);
return res;
}
/**
* 时间戳转换时间
*/
public static String stampToDate(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
}
......@@ -993,20 +993,23 @@ public class TimeCardController {
String DevId = "";
for(KqglAssoKqzdkfs abp:kqjs) {
KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();//查询考勤机“序列号”
DevId = kqj.getCode();
for(UserAttendanceRel user:attusers) {
String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
String url = mac_command+"/deleteUser";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", DevId);
params.add("userId", user_id);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
if(kqj != null) {
DevId = kqj.getCode();
for(UserAttendanceRel user:attusers) {
String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
String url = mac_command+"/deleteUser";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("devId", DevId);
params.add("userId", user_id);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody());
}
}
}
userequirelationmapper.deleteBykqzid(id);
......
......@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -31,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
......@@ -105,7 +105,7 @@ public class AttendanceTaskTiming{
*/
//3.添加定时任务 每天下午七点执行一次
@Scheduled(cron = "0 0 19 * * ?")
@Scheduled(cron = "0 34 10 * * ?")
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
......@@ -142,7 +142,7 @@ public class AttendanceTaskTiming{
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(sdf1.format(ca.getTime()),"yyyy-MM-dd")).getTime();
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
String str = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();//
String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();//
......@@ -154,8 +154,8 @@ public class AttendanceTaskTiming{
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
// for(int t = 0;t<orgcodelist.size();t++){
int org_code = 310;//orgcodelist.get(t).getId();//企业组织代码
for(int t = 0;t<orgcodelist.size();t++){
int org_code = orgcodelist.get(t).getId();//企业组织代码
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code);
for(AdditionalDto user : userlist) {
double traveltotal = 0,egresstotal = 0,overtimetotal = 0;
......@@ -684,7 +684,7 @@ public class AttendanceTaskTiming{
summary.setDay31(noticesArray[30]);
summary.insert();
}
// }
}
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
// return new Exception().getStackTrace()[0].getMethodName();
......
......@@ -20,6 +20,7 @@ public class AttSchedule implements Serializable{
private Integer id;
private Integer sort;// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班
private Integer nextday;//0:否;1:是
private Long time;
private Long starttime;
private Long endtime;
......
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