顶顶推送相关数据获取

This commit is contained in:
andy 2026-04-20 09:22:49 +08:00
parent 3cfd1b63ec
commit a055d211ff
6 changed files with 15 additions and 9 deletions

View File

@ -649,9 +649,13 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
try {
JSONArray jsonArray = resultJson.getJSONArray("recordresult");
JSONObject onDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OnDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
calculationAddRzOverTime(result, sysStaff, onDutyObject);
if(onDutyObject != null){
calculationAddRzOverTime(result, sysStaff, onDutyObject);
}
JSONObject offDutyObject = (JSONObject) jsonArray.stream().filter(data -> "OffDuty".equals(((JSONObject)data).getString("checkType"))).findFirst().orElse(null);
calculationAddRzOverTime(result, sysStaff, offDutyObject);
if(offDutyObject != null){
calculationAddRzOverTime(result, sysStaff, offDutyObject);
}
} catch (Exception e) {
e.printStackTrace();
log.error("重新抓取钉钉考勤结果异常, 异常原因是==>>{}, 打卡结果是=====>>>>> {}", e.getMessage(), result);
@ -665,6 +669,8 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
String checkType = ob.getString("checkType");
//考勤组
String groupId = ob.getString("groupId");
//
String shiftId = ob.getString("classId");
//排班时间
Long planCheckTime = ob.getLong("planCheckTime");
// 格式化先转Date对象再格式化
@ -686,7 +692,7 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
Date formatWorkDate = Date.from(Instant.ofEpochMilli(workDate));
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);
}

View File

@ -16,7 +16,7 @@ import java.util.List;
*/
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);

View File

@ -60,7 +60,7 @@ public class InstanceChangeRechargeCardExchangeProcessor implements InstanceChan
if(Integer.valueOf(0).equals(planResult.getInteger("errcode"))){
JSONObject planResultObject = planResult.getJSONArray("result").getJSONObject(0);
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");
//生成补卡记录信息
getIRzAttendanceService().addRzOverTime(json.toString(), sysStaff, dingsShiftGroup, checkType, date, date, "/", "钉钉补卡-"+bkYi, ParamUtils.getDebiting());

View File

@ -16,7 +16,7 @@ import java.util.List;
*/
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);

View File

@ -20,8 +20,8 @@ import java.util.List;
@Service
public class DingShiftGroupServiceImpl extends ServiceImpl<DingShiftGroupMapper, DingShiftGroup> implements DingShiftGroupService {
@Override
public DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String type, String checkTime) {
return getBaseMapper().selectByGroupIdAndTypeAndCheckTime(groupId, type, checkTime);
public DingShiftGroup selectByGroupIdAndTypeAndCheckTime(String groupId, String shiftId, String type, String checkTime) {
return getBaseMapper().selectByGroupIdAndTypeAndCheckTime(groupId, shiftId, type, checkTime);
}
@Override

View File

@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByGroupIdAndTypeAndCheckTime" resultMap="DingShiftGroupResult">
<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>
<update id="updateCheckTimeByShiftIdAndType">