Commit b24f2982 by yuquan.zhu

Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into develop_zyq

parents e6b19807 c947f2e3
......@@ -1079,4 +1079,19 @@ public class LoginController {
}
@GetMapping(value = "/record_breaking")
@ApiOperation(value = "刷新纪录", httpMethod = "GET", notes = "是否有账号")
public Result<QyzxEmpLogin> RecordBreaking(@CurrentUser UserBean userBean,HttpServletRequest request) {
QyzxEmpLogin qyzxEmpLogin1 = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(QyzxEmpLogin::getPhone, userBean.getQyzxEmpLogin().getPhone()).eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()).one();
if (qyzxEmpLogin1 != null) {
return loginhan(qyzxEmpLogin1, request);
}else {
return ResultUtil.error("刷新失败!!");
}
}
}
......@@ -2581,6 +2581,8 @@ public class ClockInController {
}else {
ash.setIsdk(1);
}
}else if(ash.getSort() == daj.getSort()){
BeanUtil.copyProperties(daj, dkjl,"attdate","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
}
}
......@@ -2972,8 +2974,22 @@ public class ClockInController {
e.printStackTrace();
date_=new Date();
}
int dateOne= ClockInTool.getYearMonth(date_);
int dangqian = ClockInTool.getYearMonth(new Date());//当前
// int dateOne= ClockInTool.getYearMonth(date_);
// 准备第一个模板,从字符串中提取出日期数字
String pat1 = "yyyy-MM" ;
String pat = "yyyyMM";
SimpleDateFormat sdfi = new SimpleDateFormat(pat1) ; // 实例化模板对象
SimpleDateFormat sdf = new SimpleDateFormat(pat) ; // 实例化模板对象
Date d = null ;
try{
d = sdfi.parse(date) ; // 将给定的字符串中的日期提取出来
}catch(Exception e){ // 如果提供的字符串格式有错误,则进行异常处理
e.printStackTrace() ; // 打印异常信息
}
int dateOne = Integer.valueOf(sdf.format(d));
int dangqian = Integer.valueOf(new SimpleDateFormat("yyyyMM").format(new Date()));//当前
List<WorkbenchCalendarDto> workcal = new ArrayList<WorkbenchCalendarDto>();
......@@ -3105,7 +3121,6 @@ public class ClockInController {
wocal.setCalendar_status(2);//事务(请假,加班,调休,出差)
}
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if(asssum.getApprovalType() == 1) {
wocal.setCalendar_status_type(11);
......@@ -3306,6 +3321,103 @@ public class ClockInController {
}
}
}else {
String time = date+"-01";
String sdaet = ClockInTool.getMinMonthDate(time);
Long startMonth = ClockInTool.getStartTime(0,ClockInTool.getStringTime(sdaet,"yyyy-MM-dd")).getTime();
String edate = ClockInTool.getMaxMonthDate(time);
Long endMonth = ClockInTool.getnowEndTime(23,ClockInTool.getStringTime(edate,"yyyy-MM-dd")).getTime();
//固定排班
String[] rangeArray=ClockInTool.listToString(ClockInTool.getDays(df.format(startMonth),df.format(endMonth))).split(";");//目前为止所有日期
String[] range=rangeArray[0].split(",");
/******************/
String[] ycqts = new String[31];//应上班的具体天数(yyyy-MM-dd)
String[] xxts = new String[31];//休息的具体天数(yyyy-MM-dd)
//考勤组信息
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userBean.getEmpNum(),userBean.getOrgCode());
//固定排班
if(attgro.getPbfs() == 1) {
List<KqglAssoTeshu> bxdklist = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), date,1);//当前月 必须打卡日期
int bxdk = bxdklist.size();
String[] bxdkss = new String[bxdk];////特殊-必须打卡天数(工作日)
int b = 0;
for(KqglAssoTeshu bxd : bxdklist) {
bxdkss[b] = bxd.getTsrq();
b++;
}
List<KqglAssoTeshu> wxdk = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), date,2);//当前月 无需打卡日期
String[] appmaps= new String[wxdk.size()];//特殊-无需打卡天数(休息日)
int d1 = 0;
for(KqglAssoTeshu spe:wxdk){
appmaps[d1] = spe.getTsrq();
d1++;
}
//应打卡周期时间
List<AttendanceWeeklySch> atwek = attendanceweeklyschmapper.selectAttendanceMadeByUserid(userBean.getEmpNum(),userBean.getOrgCode());
String[] week= new String[atwek.size()];
String[] needfig = new String[atwek.size()];//应打卡周期时间
int e = 0;
for(AttendanceWeeklySch awek : atwek){
week[e] = awek.getWekmc();
needfig[e] = String.valueOf(awek.getType());//获取设置的应打卡周几
e++;
}
//目前为止应出勤天数
int w = 0,x=0;
int zj = 6;
for(String num : range) {
if(ClockInTool.useArrayUtils(needfig, String.valueOf(ClockInTool.dateToWeek(num)))) {//对比排班应打卡时间
String[] ycqtst = new String[ycqts.length + zj];
System.arraycopy(ycqts, 0, ycqtst, 0, ycqts.length);
ycqtst[w] = num;
ycqts = ycqtst;
w++;
}else {
String[] xxtst = new String[xxts.length + zj];
System.arraycopy(xxts, 0, xxtst, 0, xxts.length);
xxtst[x] = num;
xxts = xxtst;
x++;
}
if(ClockInTool.useArrayUtils(bxdkss, num)) {//检查是否存在 必须打卡名单中
String[] ycqtst = new String[ycqts.length + zj];
System.arraycopy(ycqts, 0, ycqtst, 0, ycqts.length);
ycqtst[w] = num;
ycqts = ycqtst;
w++;
xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除
}
if(ClockInTool.useArrayUtils(appmaps, num)) {//检查是否存在 无需打卡名单中
ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
String[] xxtst = new String[xxts.length + zj];
System.arraycopy(xxts, 0, xxtst, 0, xxts.length);
xxtst[x] = num;
xxts = xxtst;
x++;
}
}
/******************/
for(String num : range) {
WorkbenchCalendarDto wocal = WorkbenchCalendarDto.builder().build();
wocal.setDate(num);
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num)) {
wocal.setCalendar_status(1);//
}
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {
wocal.setCalendar_status(4);//
}
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(ycqts), num) && !ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)) {
wocal.setCalendar_status(0);//
}
workcal.add(wocal);
}
}
}
return ResultUtil.data(workcal, "操作成功!");
......
......@@ -26,12 +26,13 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
public static boolean useArrayUtils(String[] arr, String targetValue) {
return ArrayUtils.contains(arr,targetValue);
}
// 获得上个月月份年份
public static String getYearMonth() {
public static String getLastYearMonth() {
Calendar now = Calendar.getInstance();
int month = now.get(Calendar.MONTH);
String m;
......
......@@ -96,7 +96,7 @@ public class AttendanceTaskTiming{
//typeid:1-员工 2-考勤组
// @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 50 8 * * ?")
// @Scheduled(cron = "0 16 17 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
public void AttendanceTask() throws ParseException {
......@@ -494,7 +494,9 @@ public class AttendanceTaskTiming{
//遍历目前为止所有日期 结合该用户发起的审批进行结合
//1:加班 2:请假 3:出差 4:外出 5:补卡
int u = 0;
int p = 1;
for(String num : range) {
String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
rowData.add("休息并打卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)){
......@@ -543,24 +545,30 @@ public class AttendanceTaskTiming{
else { company = "小时"; }
}
}
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company);
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3));
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天");
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天");
chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4));
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天");
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天");
waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5));
rowData.remove(u);
rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16));
// rowData.remove(u);
// rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16));
buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
......@@ -581,8 +589,9 @@ public class AttendanceTaskTiming{
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]");
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]");
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
//防止多运算
if(lea.getOrdernum() == lea.getTotals()) {
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
......@@ -621,6 +630,18 @@ public class AttendanceTaskTiming{
}
}
if(rowData.size() == p) {
sjs = "";
if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) {
sjs = rowData.get(u);
}else {
sjs = rowData.get(u)+";";
}
}
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban);
/****/
////////
......@@ -680,6 +701,7 @@ public class AttendanceTaskTiming{
u++;
p++;
}
}else {
for (String num2 : range) {
......
......@@ -88,8 +88,8 @@ public class LastMonthtimingExport {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// @Scheduled(cron = "0 44 8 * * ?")
// @Scheduled(cron = "0 10 17 * * ?")
@Scheduled(cron = "0 0 4,20 * * ?")//每天上午4点,下午20点 执行
public void LastMonthtimingAttendanceTask() throws ParseException {
//获取前月的最后一天
......@@ -97,7 +97,7 @@ public class LastMonthtimingExport {
cale.set(Calendar.DAY_OF_MONTH,0);//设置为1号,当前日期既为本月第一天
lastDay = format.format(cale.getTime());
String lastmonth = ClockInTool.getYearMonth();//2020-07
String lastmonth = ClockInTool.getLastYearMonth();//2020-07
int year = Integer.valueOf(lastmonth.substring(0,4));//获取前一个年份
int month=Integer.valueOf(lastmonth.substring(5,7));//获取前一个月份
......@@ -483,8 +483,9 @@ public class LastMonthtimingExport {
// List<String> rowData = new ArrayList<String>();
//遍历目前为止所有日期 结合该用户发起的审批进行结合
//1:加班 2:请假 3:出差 4:外出 5:补卡
int u = 0;
int u = 0,p=1;
for(String num : range) {
String sjs = "",qinjia = "",chuaca = "",waichu = "",buka = "",jiaban = "";
if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num) && ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(dkjtts),num)) {
rowData.add("休息并打卡");
}else if(ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(xxts), num)){
......@@ -533,24 +534,32 @@ public class LastMonthtimingExport {
else { company = "小时"; }
}
}
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company);
qinjia = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company;
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"请"+leavetype+lea.getDuration()+company);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(travels),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 3));
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天");
chuaca = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天";
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"出差"+lea.getDuration()+"天");
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(goouts),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 4));
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天");
waichu = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天";
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"外出"+lea.getDuration()+"天");
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(cards),num)) {
KqglAssoRelationSummary lea = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, user.getEmpnum()).eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getApprovalType, 5));
rowData.remove(u);
rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16));
// rowData.remove(u);
// rowData.add(u,"已补卡:"+(lea.getStartTime()).substring(5, 16));
buka = "#"+"已补卡:"+(lea.getStartTime()).substring(5, 16);
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(overtimes),num)) {
......@@ -571,8 +580,10 @@ public class LastMonthtimingExport {
else if(lea.getCompensateId() == 2) { method="转加班费"; }
else {method="转调休或加班费";}
rowData.remove(u);
rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]");
jiaban = "#"+(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]";
// rowData.remove(u);
// rowData.add(u,(lea.getStartTime()).substring(5, 16) +"到"+ (lea.getEndTime()).substring(5, 16)+"加班"+lea.getDuration()+company+"["+method+"]");
//防止多运算
if(lea.getOrdernum() == lea.getTotals()) {
//加班补偿方式 1:转调休;2:转加班费;3:转调休或加班费
......@@ -611,6 +622,19 @@ public class LastMonthtimingExport {
}
}
if(rowData.size() == p) {
sjs = "";
if(("").equals(qinjia) && ("").equals(chuaca) && ("").equals(waichu) && ("").equals(buka) && ("").equals(jiaban)) {
sjs = rowData.get(u);
}else {
sjs = rowData.get(u)+";";
}
}
rowData.remove(u);
rowData.add(u,sjs + qinjia+chuaca+waichu+buka+jiaban);
/****/
////////
......@@ -670,6 +694,7 @@ public class LastMonthtimingExport {
u++;
p++;
}
}else {
for (String num2 : range) {
......
......@@ -554,7 +554,21 @@ public class YgglController {
// 存放 插入失败的 数据
insertErrors.add(yme);
}
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
for(KqglAssoLeaveRules r : rul) {
if(r.getLeaveBalance() == 0) {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}else {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
}
JSONObject obj = JSONUtil.createObj();
......@@ -1379,6 +1393,7 @@ public class YgglController {
QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
}
QyzxEmpLogin.builder().build().delete(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()).eq(QyzxEmpLogin::getId, empNum));
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, empNum).eq(KqglAssoYhkqz::getQyid, userBean.getOrgCode()));
......
......@@ -386,6 +386,8 @@
where dkjl.attime &gt;= #{start}
and dkjl.attime &lt;= #{end}
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.`status` != 0
and dkjl.sort != 0
ORDER BY dkjl.id ASC
</select>
......
......@@ -133,7 +133,7 @@
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
where emp.org_code = #{orgcode}
<!-- and emp.emp_num = 12 -->
<!-- and emp.emp_num = 100083 -->
<!-- and emp.job_status != 3 -->
</select>
......
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