1
This commit is contained in:
parent
3cfd1b63ec
commit
1a6b582301
@ -649,9 +649,13 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
|||||||
try {
|
try {
|
||||||
JSONArray jsonArray = resultJson.getJSONArray("recordresult");
|
JSONArray jsonArray = resultJson.getJSONArray("recordresult");
|
||||||
JSONObject onDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OnDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
|
JSONObject onDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OnDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
|
||||||
|
if(onDutyObject != null){
|
||||||
calculationAddRzOverTime(result, sysStaff, onDutyObject);
|
calculationAddRzOverTime(result, sysStaff, onDutyObject);
|
||||||
|
}
|
||||||
JSONObject offDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OffDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
|
JSONObject offDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OffDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
|
||||||
|
if(offDutyObject != null){
|
||||||
calculationAddRzOverTime(result, sysStaff, offDutyObject);
|
calculationAddRzOverTime(result, sysStaff, offDutyObject);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("重新抓取钉钉考勤结果异常, 异常原因是==>>{}, 打卡结果是=====>>>>> {}", e.getMessage(), result);
|
log.error("重新抓取钉钉考勤结果异常, 异常原因是==>>{}, 打卡结果是=====>>>>> {}", e.getMessage(), result);
|
||||||
@ -665,6 +669,8 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
|||||||
String checkType = ob.getString("checkType");
|
String checkType = ob.getString("checkType");
|
||||||
//考勤组
|
//考勤组
|
||||||
String groupId = ob.getString("groupId");
|
String groupId = ob.getString("groupId");
|
||||||
|
//
|
||||||
|
String shiftId = ob.getString("classId");
|
||||||
//排班时间
|
//排班时间
|
||||||
Long planCheckTime = ob.getLong("planCheckTime");
|
Long planCheckTime = ob.getLong("planCheckTime");
|
||||||
// 格式化:先转Date对象,再格式化
|
// 格式化:先转Date对象,再格式化
|
||||||
@ -686,7 +692,7 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
|||||||
|
|
||||||
Date formatWorkDate = Date.from(Instant.ofEpochMilli(workDate));
|
Date formatWorkDate = Date.from(Instant.ofEpochMilli(workDate));
|
||||||
Date formatUserCheckTime = Date.from(Instant.ofEpochMilli(userCheckTime));
|
Date formatUserCheckTime = Date.from(Instant.ofEpochMilli(userCheckTime));
|
||||||
DingShiftGroup dingsShiftGroup = dingsShiftGroupMapper.selectByGroupIdAndTypeAndCheckTime(groupId, checkType, formatPlanCheckTime);
|
DingShiftGroup dingsShiftGroup = dingsShiftGroupMapper.selectByGroupIdAndTypeAndCheckTime(groupId, shiftId, checkType, formatPlanCheckTime);
|
||||||
addRzOverTime(result, sysStaff, dingsShiftGroup, checkType, formatWorkDate, formatUserCheckTime, timeResult, null, 0d);
|
addRzOverTime(result, sysStaff, dingsShiftGroup, checkType, formatWorkDate, formatUserCheckTime, timeResult, null, 0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface DingShiftGroupMapper extends BaseMapper<DingShiftGroup> {
|
public interface DingShiftGroupMapper extends BaseMapper<DingShiftGroup> {
|
||||||
|
|
||||||
DingShiftGroup selectByGroupIdAndTypeAndCheckTime(@Param("groupId") String groupId, @Param("type") String type, @Param("checkTime") String checkTime);
|
DingShiftGroup selectByGroupIdAndTypeAndCheckTime(@Param("groupId") String groupId, @Param("shiftId")String shiftId, @Param("type") String type, @Param("checkTime") String checkTime);
|
||||||
|
|
||||||
int updateCheckTimeByShiftIdAndType(@Param("shiftId")String shiftId, @Param("type")String type, @Param("checkTime")String checkTime);
|
int updateCheckTimeByShiftIdAndType(@Param("shiftId")String shiftId, @Param("type")String type, @Param("checkTime")String checkTime);
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ public class InstanceChangeRechargeCardExchangeProcessor implements InstanceChan
|
|||||||
if(Integer.valueOf(0).equals(planResult.getInteger("errcode"))){
|
if(Integer.valueOf(0).equals(planResult.getInteger("errcode"))){
|
||||||
JSONObject planResultObject = planResult.getJSONArray("result").getJSONObject(0);
|
JSONObject planResultObject = planResult.getJSONArray("result").getJSONObject(0);
|
||||||
String formatPlanCheckTime = DateUtils.parseDateToStr("HH:mm:ss", new Date(planResultObject.getString("plan_check_time")));
|
String formatPlanCheckTime = DateUtils.parseDateToStr("HH:mm:ss", new Date(planResultObject.getString("plan_check_time")));
|
||||||
dingsShiftGroup = getDingShiftGroupService().selectByGroupIdAndTypeAndCheckTime(planResultObject.getString("group_id"), checkType, formatPlanCheckTime);
|
dingsShiftGroup = getDingShiftGroupService().selectByGroupIdAndTypeAndCheckTime(planResultObject.getString("group_id"), planResultObject.getString("class_id"), checkType, formatPlanCheckTime);
|
||||||
Date date= DateUtils.parseDate(bkTime, "yyyy-MM-dd HH:mm");
|
Date date= DateUtils.parseDate(bkTime, "yyyy-MM-dd HH:mm");
|
||||||
//生成补卡记录信息
|
//生成补卡记录信息
|
||||||
getIRzAttendanceService().addRzOverTime(json.toString(), sysStaff, dingsShiftGroup, checkType, date, date, "/", "钉钉补卡-"+bkYi, ParamUtils.getDebiting());
|
getIRzAttendanceService().addRzOverTime(json.toString(), sysStaff, dingsShiftGroup, checkType, date, date, "/", "钉钉补卡-"+bkYi, ParamUtils.getDebiting());
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface DingShiftGroupService extends IService<DingShiftGroup> {
|
public interface DingShiftGroupService extends IService<DingShiftGroup> {
|
||||||
|
|
||||||
DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String type, String checkTime);
|
DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String shiftId, String type, String checkTime);
|
||||||
|
|
||||||
int updateCheckTimeByShiftIdAndType(String shiftId, String type, String checkTime);
|
int updateCheckTimeByShiftIdAndType(String shiftId, String type, String checkTime);
|
||||||
|
|
||||||
|
|||||||
@ -20,8 +20,8 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class DingShiftGroupServiceImpl extends ServiceImpl<DingShiftGroupMapper, DingShiftGroup> implements DingShiftGroupService {
|
public class DingShiftGroupServiceImpl extends ServiceImpl<DingShiftGroupMapper, DingShiftGroup> implements DingShiftGroupService {
|
||||||
@Override
|
@Override
|
||||||
public DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String type, String checkTime) {
|
public DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String shiftId, String type, String checkTime) {
|
||||||
return getBaseMapper().selectByGroupIdAndTypeAndCheckTime(groupId, type, checkTime);
|
return getBaseMapper().selectByGroupIdAndTypeAndCheckTime(groupId, shiftId, type, checkTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectByGroupIdAndTypeAndCheckTime" resultMap="DingShiftGroupResult">
|
<select id="selectByGroupIdAndTypeAndCheckTime" resultMap="DingShiftGroupResult">
|
||||||
<include refid="selectVo"/>
|
<include refid="selectVo"/>
|
||||||
where group_id =#{groupId} and type = #{type} and check_time = #{checkTime}
|
where group_id =#{groupId} and shift_id = #{shiftId} and type = #{type} and check_time = #{checkTime}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateCheckTimeByShiftIdAndType">
|
<update id="updateCheckTimeByShiftIdAndType">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user