Commit 016e3a04 authored by 陈明豪's avatar 陈明豪

Merge remote-tracking branch 'origin/dev' into dev

parents 0b808fe7 54b85235
......@@ -2,6 +2,9 @@ package org.rcisoft.integration.jieLink.dto;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 邀访记录主表
*/
......@@ -57,4 +60,11 @@ public class VisitDataInviteDto {
*/
private String content;
/**
* <pre>
* 设备区域列表
* </pre>
*/
private List<Map<String,String>> deviceApList;
}
......@@ -15,13 +15,16 @@ import org.rcisoft.integration.jieLink.dto.*;
import org.rcisoft.integration.jieLink.service.IJieLinkService;
import org.rcisoft.sys.devices.entity.Devices;
import org.rcisoft.sys.devices.service.DevicesService;
import org.rcisoft.sys.sysuser.dao.SysDictDataRepositorys;
import org.rcisoft.sys.sysuser.entity.DoorRecord;
import org.rcisoft.sys.sysuser.entity.SysDictData;
import org.rcisoft.sys.sysuser.entity.SysUser;
import org.rcisoft.sys.sysuser.service.DoorRecordService;
import org.rcisoft.sys.sysuser.service.SysUserService;
import org.rcisoft.sys.visit.entity.VisitInfoMation;
import org.rcisoft.sys.visit.entity.VisitUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -42,16 +45,19 @@ public class JieLinkServiceImpl implements IJieLinkService {
/**
* 捷顺服务地址
*/
@Value("${jieLink.apiUrl}")
private String jieLinkUri;
/**
* 接口用户
*/
@Value("${jieLink.account}")
private String jieLinkUser;
/**
* 接口密码
*/
@Value("${jieLink.pwd}")
private String jieLinkPwd;
......@@ -67,6 +73,9 @@ public class JieLinkServiceImpl implements IJieLinkService {
@Autowired
private DevicesService devicesService;
@Autowired
private SysDictDataRepositorys dictDataRepositorys;
/**
* 获取签名所需相关参数
......@@ -87,6 +96,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
try{
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("getAppKeyInfo接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<List<AppInfoDto>> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
List<AppInfoDto> appInfoDtoList = resultData.getData();
......@@ -108,6 +118,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//请求失败啦
log.error("getAppKeyInfo接口返回错误信息:{0}",responseEntity.getBody());
return null;
}
}catch (Exception ex){
......@@ -133,6 +144,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("pushAddUserData接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<JieLinkPersonDto> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
JieLinkPersonDto persion = resultData.getData();
......@@ -159,6 +171,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//请求失败啦
log.error("pushAddUserData接口返回错误信息:{0}",responseEntity.getBody());
return false;
}
}catch (Exception ex){
......@@ -167,6 +180,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//认证信息获取失败
log.error("pushAddUserData接口获取认证参数失败");
return false;
}
}
......@@ -179,36 +193,44 @@ public class JieLinkServiceImpl implements IJieLinkService {
*/
@Override
public boolean pushModifyUserData(SysUser userData) {
String apiUri = "/api/base/updateperson";
HttpHeaders headers = this.loadHeaderHandle();
if(headers!=null){
JieLinkPersonDto pushData = this.convertUserBean(userData);
pushData.setPersonId("");//TODO 此处缺失关联捷顺系统的ID
HttpEntity<JieLinkPersonDto> httpEntity = new HttpEntity<>(pushData,headers);
StringBuffer uriAddr = new StringBuffer();
uriAddr.append(jieLinkUri).append(apiUri);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
JieLinkResultDto<JieLinkPersonDto> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
return true;
if(userData!=null && StringUtils.isNotBlank(userData.getPersonId())){
String apiUri = "/api/base/updateperson";
HttpHeaders headers = this.loadHeaderHandle();
if(headers!=null){
JieLinkPersonDto pushData = this.convertUserBean(userData);
pushData.setPersonId(userData.getPersonId());
HttpEntity<JieLinkPersonDto> httpEntity = new HttpEntity<>(pushData,headers);
StringBuffer uriAddr = new StringBuffer();
uriAddr.append(jieLinkUri).append(apiUri);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("pushModifyUserData接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<JieLinkPersonDto> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
return true;
}else{
log.error("pushAddUserData接口返回错误信息:"+resultData.getMsg());
//请求返回结果错误啦
return false;
}
}else{
log.error("pushAddUserData接口返回错误信息:"+resultData.getMsg());
//请求返回结果错误啦
//请求失败啦
log.error("pushAddUserData接口返回错误信息:{0}",responseEntity.getBody());
return false;
}
}else{
//请求失败啦
}catch (Exception ex){
log.error(ex.getMessage(),ex);
return false;
}
}catch (Exception ex){
log.error(ex.getMessage(),ex);
}else{
//认证信息获取失败
log.error("pushAddUserData接口获取认证参数失败");
return false;
}
}else{
//认证信息获取失败
return false;
log.error("当前用户没有捷顺系统的ID,无法更新");
return true;
}
}
......@@ -264,6 +286,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
//后续处理逻辑
log.debug("pushVisitorData接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<JSONObject> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
return true;
......@@ -274,6 +297,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//请求失败啦
log.error("pushVisitorData接口返回错误信息:{0}",responseEntity.getBody());
return false;
}
}catch (Exception ex){
......@@ -282,6 +306,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//认证信息获取失败
log.error("pushVisitorData接口获取认证参数失败");
return false;
}
}
......@@ -314,6 +339,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("cancelVisitorData接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
return true;
......@@ -324,6 +350,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//请求失败啦
log.error("cancelVisitorData接口返回错误信息:{0}",responseEntity.getBody());
return false;
}
}catch (Exception ex){
......@@ -332,10 +359,34 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//认证信息获取失败
log.error("cancelVisitorData接口获取认证参数失败");
return false;
}
}
/**
* 所有设备ID
*/
public static List<Map<String,String>> deviceGuidAllArray = new ArrayList<>();
/**
* 门口设备集合
*/
public static List<Map<String,String>> deviceGuidInArray = new ArrayList<>();
static{
deviceGuidAllArray.add(new HashMap(){{ put("deviceApGuid","1");}});
deviceGuidAllArray.add(new HashMap(){{ put("deviceApGuid","2");}});
deviceGuidAllArray.add(new HashMap(){{ put("deviceApGuid","3");}});
deviceGuidAllArray.add(new HashMap(){{ put("deviceApGuid","4");}});
deviceGuidAllArray.add(new HashMap(){{ put("deviceApGuid","5");}});
deviceGuidInArray.add(new HashMap(){{ put("deviceApGuid","1");}});
}
/**
* 邀访记录转换
* @param infoMation
......@@ -344,11 +395,30 @@ public class JieLinkServiceImpl implements IJieLinkService {
private JSONObject convertVisitorData(VisitInfoMation infoMation){
JSONObject result = new JSONObject();
VisitDataInviteDto manData = new VisitDataInviteDto();
//TODO 此处需要沟通下才行
manData.setPersonId(sysUserService.getPersionIdByUserId(infoMation.getUserId()));//转换ID
manData.setItemId(infoMation.getItemId());//邀访记录
//生成邀访时间格式的JSON字符串
manData.setTimeDesc("");//邀访时间格式 需要根据两个字段以及数据字典中对应的类型进行计算得到开始和结束时间
//TODO 生成邀访时间格式的JSON字符串
Date visitRealTime = infoMation.getVisitRealTime();
SysDictData queryDicData = new SysDictData();
queryDicData.setDictType("timeThreshold");
queryDicData.setFlag("1");
queryDicData.setFlag("1");
List<SysDictData> dictDataList = dictDataRepositorys.querySysDictDatas(queryDicData);
JSONObject timeObj = new JSONObject();
for(SysDictData dicData: dictDataList){
String dictValue = dicData.getDictValue();
//此处可能会有类型转换报错的BUG
int factor = Integer.parseInt(dictValue);
String dictLabel = dicData.getDictLabel();
if(StringUtils.equals("advance",dictLabel)){
Date startTime = new Date(visitRealTime.getTime()-(factor*60*1000));
timeObj.put("sd",DateUtil.format(startTime,"yyyy-MM-dd HH:mm:ss"));
}else if(StringUtils.equals("late",dictLabel)){
Date startTime = new Date(visitRealTime.getTime()+(factor*60*1000));
timeObj.put("ed",DateUtil.format(startTime,"yyyy-MM-dd HH:mm:ss"));
}
}
manData.setTimeDesc(timeObj.toJSONString());//邀访时间格式 需要根据两个字段以及数据字典中对应的类型进行计算得到开始和结束时间
manData.setVisitorType("3");//访客类型
//到访事由 两个字段做或判断
if(StringUtils.isNotBlank(infoMation.getVisitReason())){
......@@ -356,7 +426,24 @@ public class JieLinkServiceImpl implements IJieLinkService {
}else{
manData.setContent(infoMation.getVisitReasonOther());
}
//访问区域设置
if(StringUtils.isNotBlank(infoMation.getVisitRegionCode())){
String[] codeArray = infoMation.getVisitRegionCode().split(",");
if(codeArray.length==1){
//判断设备是办公楼 则认为是全部设备,相反则只有门口的设备
if(StringUtils.equals("0",codeArray[0])){
manData.setDeviceApList(deviceGuidAllArray);
}else{
manData.setDeviceApList(deviceGuidInArray);
}
}else if(codeArray.length ==2){
//两个都选了,则认为是所有设备全部开启
manData.setDeviceApList(deviceGuidAllArray);
}
}else{
//默认只给门口设备的权限
manData.setDeviceApList(deviceGuidInArray);
}
List<VisitDataSubItemDto> userList = new ArrayList<>();
if(infoMation.getUserList()!=null && !infoMation.getUserList().isEmpty()){
List<VisitUser> userDataList = infoMation.getUserList();
......@@ -402,6 +489,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("pullVisitUserQrCode接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<JSONObject> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
JSONObject data = resultData.getData();
......@@ -411,12 +499,13 @@ public class JieLinkServiceImpl implements IJieLinkService {
return null;
}
}else{
log.error("cancelVisitorData接口返回错误信息:"+resultData.getMsg());
log.error("pullVisitUserQrCode接口返回错误信息:"+resultData.getMsg());
//请求返回结果错误啦
return null;
}
}else{
//请求失败啦
log.error("pullVisitUserQrCode接口返回错误信息:{0}",responseEntity.getBody());
return null;
}
}catch (Exception ex){
......@@ -425,6 +514,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}else{
//认证信息获取失败
log.error("pullVisitUserQrCode接口获取认证参数失败");
return null;
}
}
......@@ -552,6 +642,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(uriAddr.toString(), httpEntity, String.class);
try{
if(HttpStatus.OK.value() ==responseEntity.getStatusCode().value()) {
log.debug("syncDeviceInfo接口返回信息:{0}",responseEntity.getBody());
JieLinkResultDto<List<Devices>> resultData = JSONObject.parseObject(responseEntity.getBody(), JieLinkResultDto.class);
if(StringUtils.equals(resultData.getCode(),"0")){
List<Devices> devicesList = resultData.getData();
......@@ -573,12 +664,14 @@ public class JieLinkServiceImpl implements IJieLinkService {
log.error("syncDeviceInfo接口返回错误信息:"+resultData.getMsg());
}
}else{
log.error("syncDeviceInfo接口返回错误信息:{0}",responseEntity.getBody());
}
}catch (Exception ex){
log.error(ex.getMessage(),ex);
}
}else{
//认证信息获取失败
log.error("syncDeviceInfo接口获取认证参数失败");
}
}
......
package org.rcisoft.sys.attendance.schedule;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.rcisoft.sys.attendance.dao.AttendanceSyncRepository;
import org.rcisoft.sys.attendance.entity.Attendance;
import org.rcisoft.sys.attendance.entity.AttendanceSync;
import org.rcisoft.sys.attendance.service.AttendanceService;
import org.rcisoft.sys.sysuser.dao.SysUserRepositorys;
import org.rcisoft.sys.sysuser.entity.SysUser;
import org.rcisoft.sys.visit.entity.VisitInfoMation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
......@@ -31,10 +32,10 @@ public class AttendanceSyncSchedule {
// @Scheduled(cron = "0 0 0,15,16,17 * * ?")
// 每隔5秒执行一次
@Scheduled(cron = "0 */10 * * * ?")
@Scheduled(cron = "0 */1 * * * ?")
public void execute() {
Attendance attendance = new Attendance();
//查询考勤
// 查询昨日所有考勤
List<Attendance> all = attendanceService.findAll(attendance);
AttendanceSync attendanceSync = new AttendanceSync();
for (int i = 0; i < all.size(); i++) {
......@@ -60,7 +61,10 @@ public class AttendanceSyncSchedule {
}
attendanceSync.setCreateDate(new Date());
attendanceSync.setPassageTime(all.get(i).getCrossTime());
attendanceSyncRepository.addAttendanceSync(attendanceSync);
// 判断考勤是否已经存在,已经存在不会添加
//查询条件 查询比当前时间大的第一条记录
if (attendanceSyncRepository.queryAttendanceSyncs(attendanceSync).size() == 0)
attendanceSyncRepository.addAttendanceSync(attendanceSync);
}
}
}
......@@ -45,51 +45,37 @@ public class AttendanceServiceImpl implements AttendanceService {
@Override
public List<Attendance> findAll(Attendance attendance) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date1 = "2022-01-01 00:00:01";
String date2 = "2023-12-31 11:59:59";
try {
attendance.setBeginTime(simpleDateFormat.parse(date1));
attendance.setEndTime(simpleDateFormat.parse(date2));
} catch (ParseException e) {
e.printStackTrace();
}
List<Attendance> attendanceList = new ArrayList<>();
// 根据时间范围筛选所有打卡成功的记录
attendance.setBeginTime(TimeUtils.getDateNotTime(attendance.getBeginTime()));
attendance.setEndTime(TimeUtils.getDateEndDay(attendance.getEndTime()));
// 获取前一天的时间
Date update = TimeUtils.getUpdate();
attendance.setBeginTime(TimeUtils.getDateNotTime(update));
attendance.setEndTime(TimeUtils.getDateEndDay(update));
// 查询时间范围内员工的正常记录集合
List<DoorRecord> doorRecordList = doorRecordRepository.queryAttendance(attendance);
/*if (attendanceList.size() == 0)*/
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//这里可以指定日期的格式
// 根据用户分组(每个员工时间范围内的所有打卡记录)
Map<Integer, List<DoorRecord>> listMap = doorRecordList.stream()
.collect(Collectors.groupingBy(DoorRecord::getUserId));
for (Integer key : listMap.keySet()) {
// 根据考勤日期分组
Map<String, List<DoorRecord>> list = listMap.get(key).stream()
.collect(Collectors.groupingBy(f -> sdf.format(f.getCrossTime())));
for (String l : list.keySet()) {
List<DoorRecord> records = list.get(l);
// 某个员工某日所有通行记录
Attendance att = new Attendance();
att.setPeopleName(records.get(0).getName());
att.setPhoneNumber(records.get(0).getMobile());
att.setDeptName(records.get(0).getDeptName());
att.setPositionName(records.get(0).getPositionName());
att.setNltBz(records.get(0).getNltBz());
att.setKqDate(l);
att.setUserId(records.get(0).getUserId());
att = setValue(records, att);
if (att != null)
attendanceList.add(att);
}
List<DoorRecord> records = listMap.get(key);
// 某个员工某日所有通行记录
Attendance att = new Attendance();
att.setPeopleName(records.get(0).getName());
att.setPhoneNumber(records.get(0).getMobile());
att.setDeptName(records.get(0).getDeptName());
att.setPositionName(records.get(0).getPositionName());
att.setNltBz(records.get(0).getNltBz());
att.setKqDate(sdf.format(update));
att.setUserId(records.get(0).getUserId());
att = setValue(records, att);
if (att != null)
attendanceList.add(att);
}
return attendanceList;
}
// 整合考勤信息
Attendance setValue(List<DoorRecord> records, Attendance attendance) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -106,7 +92,7 @@ public class AttendanceServiceImpl implements AttendanceService {
if (work != null && out != null) {
String begin = time.format(work.getCrossTime());
String end = time.format(out.getCrossTime());
if ((begin.compareTo(end) > 0))
if (begin.compareTo(end) > 0)
return null;
attendance.setWorkShift(sdf.format(work.getCrossTime()));
attendance.setClosingTime(sdf.format(out.getCrossTime()));
......@@ -120,7 +106,7 @@ public class AttendanceServiceImpl implements AttendanceService {
beginTime = records.get(i).getCrossTime();
if (records.get(i).getDeviceType().equals("2"))
endTime = records.get(i).getCrossTime();
if (beginTime != null && endTime != null) {
if (beginTime != null && endTime != null && beginTime.compareTo(endTime) < 0) {
sumTime += TimeUtils.getDatePoor(beginTime, endTime);
beginTime = null;
endTime = null;
......
package org.rcisoft.sys.attendance.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class TimeUtils {
//验证日期格式是否正确
......@@ -50,4 +48,13 @@ public class TimeUtils {
}
public static Date getUpdate() {
Calendar calendar = new GregorianCalendar();
calendar.setTime(new Date());
int i = -1;
calendar.add(Calendar.DATE,i);
return calendar.getTime();
}
}
......@@ -90,3 +90,7 @@ wx:
appId: wx16cfb2d12e4ab57c
secret: 37556072ad536b8d9d6cf5fb638fec88
timeOut: 3600
jieLink:
apiUrl: http://192.168.18.192:8091
account: 9999
pwd: 123456
\ No newline at end of file
......@@ -21,7 +21,7 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="abnormal" jdbcType="VARCHAR" property="abnormal" />
<result column="abnormal" jdbcType="VARCHAR" property="abnormal"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......@@ -34,6 +34,14 @@
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
// todo
<if test="entity.delFlag !=null and entity.delFlag != '' ">
and del_flag = #{entity.delFlag}
</if>
<if test="entity.delFlag !=null and entity.delFlag != '' ">
and del_flag = #{entity.delFlag}
</if>
</select>
<select id="queryAttendanceSyncsPaged" resultMap="BaseResultMap">
......@@ -45,24 +53,24 @@
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
<if test="entity.beginDate != null and entity.beginDate != ''">
and date_of_attendance &gt;= #{entity.beginDate}
</if>
<if test="entity.endDate != null and entity.endDate != ''">
and date_of_attendance &lt;= #{entity.endDate}
</if>
<if test="entity.nltBz != null and entity.nltBz != ''">
and nlt_bz = #{entity.nltBz}
</if>
<if test="entity.sort == '0'.toString()">
order by work_hours
</if>
<if test="entity.sort == '1'.toString()">
order by off_hours
</if>
<if test="entity.sort == '2'.toString()">
order by time_on_job + 0
</if>
<if test="entity.beginDate != null and entity.beginDate != ''">
and date_of_attendance &gt;= #{entity.beginDate}
</if>
<if test="entity.endDate != null and entity.endDate != ''">
and date_of_attendance &lt;= #{entity.endDate}
</if>
<if test="entity.nltBz != null and entity.nltBz != ''">
and nlt_bz = #{entity.nltBz}
</if>
<if test="entity.sort == '0'.toString()">
order by work_hours
</if>
<if test="entity.sort == '1'.toString()">
order by off_hours
</if>
<if test="entity.sort == '2'.toString()">
order by time_on_job + 0
</if>
</select>
<insert id="addAttendanceSync" parameterType="org.rcisoft.sys.attendance.entity.AttendanceSync"
......
......@@ -114,8 +114,6 @@
where dr.del_flag = '0'
and dr.tenement_type = '0'
and dr.record_type = '1'
and dr.cross_time &gt; date_format(date_sub(now(), interval 1 DAY),'%Y-%m-%d')
AND dr.cross_time &lt; date_format(now(),'%Y-%m-%d')
<if test="attendance.beginTime !=null and attendance.endTime != null ">
and dr.cross_time between #{attendance.beginTime} and #{attendance.endTime}
</if>
......
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