update code
parent
9f80befa1a
commit
e1e82f7796
|
@ -27,6 +27,8 @@ public interface SurProjectAttendanceDataMapper
|
|||
*/
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataList(SurProjectAttendanceData surProjectAttendanceData);
|
||||
|
||||
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData);
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
|
|
|
@ -28,6 +28,8 @@ public interface ISurProjectAttendanceDataService
|
|||
*/
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataList(SurProjectAttendanceData surProjectAttendanceData);
|
||||
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
|
|
|
@ -45,6 +45,11 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
|||
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataList(surProjectAttendanceData);
|
||||
}
|
||||
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData)
|
||||
{
|
||||
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListEx(surProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
|
@ -132,7 +137,7 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
|||
where.setVendorsCode(sdata.getVendorsCode());
|
||||
where.setCfgid(sdata.getCfgid());
|
||||
where.setServerid(sdata.getServerid());
|
||||
List<SurProjectAttendanceData> list=selectSurProjectAttendanceDataList(where);
|
||||
List<SurProjectAttendanceData> list=selectSurProjectAttendanceDataListEx(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceData(sdata);
|
||||
}else{
|
||||
|
|
|
@ -42,8 +42,9 @@ public class AttendanceHuazhuTask {
|
|||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path))
|
||||
.newBuilder();
|
||||
|
||||
long endTime=DateUtil.current();
|
||||
long startTime=endTime-3600*1000*24*0;
|
||||
|
||||
long startTime=DateUtil.date(DateUtil.parse("2024-03-16")).getTime();
|
||||
long endTime=startTime+3600*1000*24*1;
|
||||
Map<String, String> headerParams=new HashMap<>();
|
||||
headerParams.put("appId","8024283707153666851");
|
||||
headerParams.put("appSecret","2070308b49399d94b401d98adeaa5b342aa81627");
|
||||
|
@ -55,7 +56,7 @@ public class AttendanceHuazhuTask {
|
|||
params.put("size","200");
|
||||
params.put("current","1");
|
||||
params.put("startTime",startTime);
|
||||
//params.put("endTime",startTime);
|
||||
params.put("endTime",endTime);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
|
@ -125,12 +126,18 @@ public class AttendanceHuazhuTask {
|
|||
/**
|
||||
* 同步7天之内的数据
|
||||
*/
|
||||
public void syncLastWeekAttendanceData() {
|
||||
public void syncLast90DayAttendanceData() {
|
||||
long endTime=DateUtil.current();
|
||||
long startTime=endTime-3600*1000*24*90;
|
||||
syncAttendanceData(startTime);
|
||||
}
|
||||
|
||||
public void syncLastWeekAttendanceData() {
|
||||
long endTime=DateUtil.current();
|
||||
long startTime=endTime-3600*1000*24*7;
|
||||
syncAttendanceData(startTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步当天数据
|
||||
*/
|
||||
|
|
|
@ -45,9 +45,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sur_project_attendance_data
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataListEx" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="attendanceType != null and attendanceType != ''"> and attendance_type = #{attendanceType}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and attendance_time = #{attendanceTime}</if>
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="projectType != null "> and projectType = #{projectType}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="workPointId != null and workPointId != ''"> and work_point_id = #{workPointId}</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
|
|
Loading…
Reference in New Issue