Commit 50f29381 by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!517
parents 2433204c 9c28d085
...@@ -54,4 +54,6 @@ public class AttendanceAssistant implements Serializable{ ...@@ -54,4 +54,6 @@ public class AttendanceAssistant implements Serializable{
int fieldpersonnel;//外勤 int fieldpersonnel;//外勤
int restdayclock;//休息日打卡 int restdayclock;//休息日打卡
String PagetransferDate;//页面传输修改日期
} }
...@@ -340,8 +340,13 @@ public class AttController { ...@@ -340,8 +340,13 @@ public class AttController {
//记录排班(排班制) //记录排班(排班制)
List<Schedule> schlist=new ArrayList<Schedule>(); List<Schedule> schlist=new ArrayList<Schedule>();
Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期 Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期
String date_scmx = null;
if(schedules.length>0 && attass.getAtttype() == 2){ if(schedules.length>0 && attass.getAtttype() == 2){
date_scmx = ClockInTool.SunNovCSTYM(schedules[0].getData());
String date = String.valueOf(schedules[0].getData()); String date = String.valueOf(schedules[0].getData());
Date dt=new Date(date); Date dt=new Date(date);
SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM");
...@@ -1135,7 +1140,10 @@ public class AttController { ...@@ -1135,7 +1140,10 @@ public class AttController {
} }
if(schlist.size()>0 && xiugai){ if(schlist.size()>0 && xiugai){
//删除排班明细表(自由排班) //删除排班明细表(自由排班)
scheduleservice.deleteByPrimaryBykqzid(id); // scheduleservice.deleteByPrimaryBykqzid(id);
scheduleservice.deleteByPrimaryBykqzid(id,date_scmx);
scheduleservice.insertKqglAssoPbmxList(schlist); scheduleservice.insertKqglAssoPbmxList(schlist);
return ResultUtil.data(schlist,"修改考勤组排班成功"); return ResultUtil.data(schlist,"修改考勤组排班成功");
} }
...@@ -1458,7 +1466,13 @@ public class AttController { ...@@ -1458,7 +1466,13 @@ public class AttController {
for(int u=0;u<attser.length;u++){ for(int u=0;u<attser.length;u++){
if(attass.getAtttype() == 2){//排班制 考勤组与用户、用户排班 if(attass.getAtttype() == 2){//排班制 考勤组与用户、用户排班
scheduleservice.deleteByPrimaryByUserid(Integer.valueOf(attser[u])); Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期
if(schedules.length>0) {
String date = ClockInTool.SunNovCSTYM(schedules[0].getData());
scheduleservice.deleteByPrimaryByUserid(Integer.valueOf(attser[u]),attgrpid,date);
}
// scheduleservice.deleteByPrimaryByUserid(Integer.valueOf(attser[u]));
} }
userattendancerelservice.deleteByPrimaryByUserid(Integer.valueOf(attser[u]),qyid); userattendancerelservice.deleteByPrimaryByUserid(Integer.valueOf(attser[u]),qyid);
...@@ -1581,12 +1595,17 @@ public class AttController { ...@@ -1581,12 +1595,17 @@ public class AttController {
} }
/**********/ /**********/
scheduleservice.deleteByPrimaryBykqzid(attgrpid); // scheduleservice.deleteByPrimaryBykqzid(attgrpid);
/***********/ /***********/
//记录排班(排班制) //记录排班(排班制)
List<Schedule> schlist=new ArrayList<Schedule>(); List<Schedule> schlist=new ArrayList<Schedule>();
Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期 Schedule[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期
if(schedules.length>0 && attass.getAtttype() == 2){ if(schedules.length>0 && attass.getAtttype() == 2){
String date = ClockInTool.SunNovCSTYM(schedules[0].getData());
scheduleservice.deleteByPrimaryBykqzid(attgrpid,date);
for(int p=0;p<schedules.length;p++){ for(int p=0;p<schedules.length;p++){
Schedule sch = new Schedule(); Schedule sch = new Schedule();
sch.setUserid(schedules[p].getUserid()); sch.setUserid(schedules[p].getUserid());
......
...@@ -363,10 +363,12 @@ public class ClockInTool { ...@@ -363,10 +363,12 @@ public class ClockInTool {
Iterator<String> it = arrList.iterator(); Iterator<String> it = arrList.iterator();
while (it.hasNext()) { while (it.hasNext()) {
String x = it.next(); String x = it.next();
if(x != null) {
if (x.indexOf(target) != -1) { if (x.indexOf(target) != -1) {
it.remove(); it.remove();
} }
} }
}
res = new String[arrList.size()]; res = new String[arrList.size()];
arrList.toArray(res); arrList.toArray(res);
} }
...@@ -729,4 +731,26 @@ public class ClockInTool { ...@@ -729,4 +731,26 @@ public class ClockInTool {
return sdf.format(date2); return sdf.format(date2);
} }
/**
* Sun Nov 01 00:00:00 CST 2020
*/
public static String SunNovCST(String s){
String cst;
Date date = new Date(s);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
cst = simpleDateFormat.format(date);
return cst;
}
/**
* Sun Nov 01 00:00:00 CST 2020
*/
public static String SunNovCSTYM(Date date2){
String cst;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
cst = simpleDateFormat.format(date2);
return cst;
}
} }
...@@ -98,7 +98,7 @@ public class AttendanceTaskTiming{ ...@@ -98,7 +98,7 @@ public class AttendanceTaskTiming{
//typeid:1-员工 2-考勤组 //typeid:1-员工 2-考勤组
// @Scheduled(cron = "0 */5 * * * ?") // @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 42 14 * * ?") // @Scheduled(cron = "0 0 11 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行 @Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
public void AttendanceTask() throws ParseException { public void AttendanceTask() throws ParseException {
...@@ -133,7 +133,7 @@ public class AttendanceTaskTiming{ ...@@ -133,7 +133,7 @@ public class AttendanceTaskTiming{
List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司 List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>().lambda().eq(QyzxEntInfoM::getId, 3)); // List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>().lambda().eq(QyzxEntInfoM::getId, 6));
for(int t = 0;t<orgcodelist.size();t++){ for(int t = 0;t<orgcodelist.size();t++){
int org_code = orgcodelist.get(t).getId();//企业组织代码 int org_code = orgcodelist.get(t).getId();//企业组织代码
...@@ -298,7 +298,7 @@ public class AttendanceTaskTiming{ ...@@ -298,7 +298,7 @@ public class AttendanceTaskTiming{
y = y-1; y = y-1;
} }
if(attgro.getIsFdjjr().equals(1)) { if(attgro.getIsFdjjr().equals(1111)) {
if(Arrays.asList(holidays).contains(String.valueOf(sdf1.format(date1)))){ if(Arrays.asList(holidays).contains(String.valueOf(sdf1.format(date1)))){
y = y-1; y = y-1;
jj ++; jj ++;
...@@ -350,7 +350,11 @@ public class AttendanceTaskTiming{ ...@@ -350,7 +350,11 @@ public class AttendanceTaskTiming{
xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除 xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除
} }
if(ClockInTool.useArrayUtils(appmaps, num)) {//检查是否存在 无需打卡名单中 if(ClockInTool.useArrayUtils(appmaps, num)) {//检查是否存在 无需打卡名单中
ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
ycqts = ClockInTool.doChinFilters(ycqts, num);//为必须休息的话从上班日期中去除
// ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
zjgzts = zjgzts - 1; zjgzts = zjgzts - 1;
String[] xxtst = new String[xxts.length + zj]; String[] xxtst = new String[xxts.length + zj];
...@@ -364,7 +368,7 @@ public class AttendanceTaskTiming{ ...@@ -364,7 +368,7 @@ public class AttendanceTaskTiming{
//当前考勤组开启法定节假日休息开关 //当前考勤组开启法定节假日休息开关
if(attgro.getIsFdjjr().equals(1)) { if(attgro.getIsFdjjr().equals(11111)) {
//法定节假日 //法定节假日
if(ClockInTool.useArrayUtils(holidays, num)) {//法定节假日沦为休息日计算 if(ClockInTool.useArrayUtils(holidays, num)) {//法定节假日沦为休息日计算
// ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除 // ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
......
...@@ -90,7 +90,7 @@ public class LastMonthtimingExport { ...@@ -90,7 +90,7 @@ public class LastMonthtimingExport {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// @Scheduled(cron = "0 7 15 * * ?") // @Scheduled(cron = "0 5 11 * * ?")
@Scheduled(cron = "0 0 4,20 * * ?")//每天上午4点,下午20点 执行 @Scheduled(cron = "0 0 4,20 * * ?")//每天上午4点,下午20点 执行
public void LastMonthtimingAttendanceTask() throws ParseException { public void LastMonthtimingAttendanceTask() throws ParseException {
...@@ -286,7 +286,7 @@ public class LastMonthtimingExport { ...@@ -286,7 +286,7 @@ public class LastMonthtimingExport {
y = y-1; y = y-1;
} }
if(attgro.getIsFdjjr().equals(1)) { if(attgro.getIsFdjjr().equals(111)) {
if(Arrays.asList(holidays).contains(String.valueOf(sdf1.format(date1)))){ if(Arrays.asList(holidays).contains(String.valueOf(sdf1.format(date1)))){
y = y-1; y = y-1;
jj ++; jj ++;
...@@ -336,7 +336,8 @@ public class LastMonthtimingExport { ...@@ -336,7 +336,8 @@ public class LastMonthtimingExport {
xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除 xxts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(xxts), num);//为必须上班的话从休息日期中去除
} }
if(ClockInTool.useArrayUtils(appmaps, num)) {//检查是否存在 无需打卡名单中 if(ClockInTool.useArrayUtils(appmaps, num)) {//检查是否存在 无需打卡名单中
ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除 ycqts = ClockInTool.doChinFilters(ycqts, num);//为必须休息的话从上班日期中去除
// ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
zjgzts = zjgzts - 1; zjgzts = zjgzts - 1;
String[] xxtst = new String[xxts.length + zj]; String[] xxtst = new String[xxts.length + zj];
...@@ -349,7 +350,7 @@ public class LastMonthtimingExport { ...@@ -349,7 +350,7 @@ public class LastMonthtimingExport {
} }
//当前考勤组开启法定节假日休息开关 //当前考勤组开启法定节假日休息开关
if(attgro.getIsFdjjr().equals(1)) { if(attgro.getIsFdjjr().equals(11111)) {
//法定节假日 //法定节假日
if(ClockInTool.useArrayUtils(holidays, num)) {//法定节假日沦为休息日计算 if(ClockInTool.useArrayUtils(holidays, num)) {//法定节假日沦为休息日计算
// ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除 // ycqts = ClockInTool.doChinFilters(ClockInTool.deleteArrayNull(ycqts), num);//为必须休息的话从上班日期中去除
......
...@@ -23,11 +23,11 @@ public interface ScheduleMapper { ...@@ -23,11 +23,11 @@ public interface ScheduleMapper {
int insertKqglAssoPbmxList(List<Schedule> schedule); int insertKqglAssoPbmxList(List<Schedule> schedule);
int deleteByPrimaryBykqzid(Integer kqzid); int deleteByPrimaryBykqzid(Integer kqzid,String date);
List<Schedule> selectAttGroupScheduling(AttScheduling attscheduling); List<Schedule> selectAttGroupScheduling(AttScheduling attscheduling);
int deleteByPrimaryByUserid(Integer userid); int deleteByPrimaryByUserid(Integer userid,Integer kqzid,String date);
List<Schedule> getAttendanceShouldList(Integer userid,Long start,Long end); List<Schedule> getAttendanceShouldList(Integer userid,Long start,Long end);
......
...@@ -147,9 +147,10 @@ ...@@ -147,9 +147,10 @@
</foreach> </foreach>
</insert> </insert>
<delete id="deleteByPrimaryBykqzid" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryBykqzid" >
delete from kqgl_asso_pbmx delete from kqgl_asso_pbmx
where kqzid = #{kqzid,jdbcType=INTEGER} where kqzid = #{kqzid,jdbcType=INTEGER}
and SUBSTR(data,1,7) = #{date,jdbcType=VARCHAR}
</delete> </delete>
<select id="selectAttGroupScheduling" resultMap="BaseResultMap"> <select id="selectAttGroupScheduling" resultMap="BaseResultMap">
...@@ -168,9 +169,11 @@ ...@@ -168,9 +169,11 @@
and pbmx.kqzid = #{kqzid,jdbcType=INTEGER} and pbmx.kqzid = #{kqzid,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryByUserid" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryByUserid">
delete from kqgl_asso_pbmx delete from kqgl_asso_pbmx
where userid = #{userid,jdbcType=INTEGER} where userid = #{userid,jdbcType=INTEGER}
and SUBSTR(data,1,7) = #{date,jdbcType=VARCHAR}
and kqzid = #{kqzid,jdbcType=INTEGER}
</delete> </delete>
<select id="getAttendanceShouldList" resultMap="BaseResultMap"> <select id="getAttendanceShouldList" resultMap="BaseResultMap">
......
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