考勤查询接口修改,电子围栏自定义新增、修改,查询一个点是否在电子围栏内接口新增
| | |
| | | private Integer clockType; |
| | | |
| | | /** |
| | | * 考勤类型 1:正常 2:迟到 3:早退 4:外勤 |
| | | * 考勤类型 1:正常 2:迟到 3:早退 |
| | | */ |
| | | private Integer attendanceType; |
| | | |
| | |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 是否为外勤打卡 |
| | | */ |
| | | private Integer legwork; |
| | | |
| | | } |
| | |
| | | <if test="attendance.clockType!=null"> |
| | | and sa.clock_type = #{attendance.clockType} |
| | | </if> |
| | | <if test="attendance.legwork!=null"> |
| | | and sa.legwork = #{attendance.legwork} |
| | | </if> |
| | | <if test="attendance.beginTime!=null and attendance.beginTime!=''"> |
| | | and date_format(sa.clock_time,'%Y-%m-%d')>=#{attendance.beginTime} |
| | | </if> |
| | |
| | | case when sa.attendance_type=1 then '正常' |
| | | when sa.attendance_type=2 then '迟到' |
| | | when sa.attendance_type=3 then '早退' |
| | | when sa.attendance_type=4 then '外勤' |
| | | else '无效打卡' end as attendanceType |
| | | from sys_attendance sa |
| | | left join blade_user bu on bu.id = sa.user_id |
| | |
| | | number = #{number} |
| | | and |
| | | to_days(now())=to_days(clock_time) |
| | | and |
| | | is_deleted=0 |
| | | </select> |
| | | |
| | | <!--查询当前时间之前最新的一条数据--> |
| | |
| | | //设置时间 |
| | | electronRail.setCreateTime(new Date()); |
| | | electronRail.setUpdateTime(new Date()); |
| | | //返回 |
| | | return R.data(electronRailService.save(electronRail)); |
| | | if (null!=electronRail.getCoordinate() && !electronRail.getCoordinate().equals("")) { |
| | | //替换逗号为空格 |
| | | String sNull = electronRail.getCoordinate().replaceAll(",", " "); |
| | | //替换分号为逗号 |
| | | String replaceAll = sNull.replaceAll(";", ","); |
| | | electronRail.setCoordinate("'POLYGON((" + replaceAll + "))'"); |
| | | } |
| | | //自定义新增 |
| | | return R.data(electronRailService.saveElectRailInfo(electronRail)); |
| | | } |
| | | |
| | | |
| | |
| | | public R update(@RequestBody ElectronRail electronRail) { |
| | | //设置更新时间 |
| | | electronRail.setUpdateTime(new Date()); |
| | | //修改并返回 |
| | | return R.data(electronRailService.updateById(electronRail)); |
| | | if (null!=electronRail.getCoordinate() && !electronRail.getCoordinate().equals("")) { |
| | | //替换逗号为空格 |
| | | String sNull = electronRail.getCoordinate().replaceAll(",", " "); |
| | | //替换分号为逗号 |
| | | String replaceAll = sNull.replaceAll(";", ","); |
| | | electronRail.setCoordinate("'POLYGON((" + replaceAll + "))'"); |
| | | } |
| | | //自定义修改并返回 |
| | | return R.data(electronRailService.updateElectronRailInfo(electronRail)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.status(electronRailService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 判断一个点是否在区域内 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | @GetMapping("/isOnArea") |
| | | public R isOnArea(ElectronRailVO electronRail){ |
| | | return R.data(electronRailService.isOnArea(electronRail)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ElectronRailVO> selectElectronRailPage(IPage<ElectronRailVO> page, @Param("electronRail") ElectronRailVO electronRail); |
| | | |
| | | /** |
| | | * 自定义新增电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | boolean saveElectRailInfo(@Param("electronRail") ElectronRail electronRail); |
| | | |
| | | /** |
| | | * 自定义修改电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | boolean updateElectronRailInfo(@Param("electronRail") ElectronRail electronRail); |
| | | |
| | | /** |
| | | * 判断一个点是否在区域内 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | int isOnArea(@Param("electronRail") ElectronRailVO electronRail); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--自定义新增电子围栏数据--> |
| | | <insert id="saveElectRailInfo"> |
| | | insert into sys_electron_rail |
| | | (name,type,company_id, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | coordinate, |
| | | </if> |
| | | create_time,update_time) |
| | | values |
| | | (#{electronRail.name},#{electronRail.type},#{electronRail.companyId}, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | ST_GeomFromText(${electronRail.coordinate}), |
| | | </if> |
| | | #{electronRail.createTime},#{electronRail.updateTime}) |
| | | </insert> |
| | | |
| | | <!--自定义修改电子围栏数据--> |
| | | <update id="updateElectronRailInfo"> |
| | | update sys_electron_rail set name = #{electronRail.name}, |
| | | type = #{electronRail.type}, |
| | | company_id = #{electronRail.companyId}, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | coordinate = ST_GeomFromText(${electronRail.coordinate}), |
| | | </if> |
| | | update_time = #{electronRail.updateTime} |
| | | where id = #{electronRail.id} |
| | | </update> |
| | | |
| | | <!--判断一个点是否在区域内--> |
| | | <select id="isOnArea" resultType="java.lang.Integer"> |
| | | select ifnull(count(*),0) count from sys_electron_rail |
| | | where |
| | | MBRWithin(ST_GeomFromText('POINT(${electronRail.jd} ${electronRail.wd})'),coordinate) |
| | | and id = #{electronRail.id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | IPage<ElectronRailVO> selectElectronRailPage(IPage<ElectronRailVO> page,ElectronRailVO electronRailVO); |
| | | |
| | | /** |
| | | * 自定义新增电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | boolean saveElectRailInfo(ElectronRail electronRail); |
| | | |
| | | /** |
| | | * 自定义修改电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | boolean updateElectronRailInfo(ElectronRail electronRail); |
| | | |
| | | /** |
| | | * 判断一个点是否在区域内 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | boolean isOnArea(ElectronRailVO electronRail); |
| | | } |
| | |
| | | } |
| | | return page.setRecords(railVOS); |
| | | } |
| | | |
| | | /** |
| | | * 自定义新增电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveElectRailInfo(ElectronRail electronRail) { |
| | | return baseMapper.saveElectRailInfo(electronRail); |
| | | } |
| | | |
| | | /** |
| | | * 自定义修改电子围栏信息 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateElectronRailInfo(ElectronRail electronRail) { |
| | | return baseMapper.updateElectronRailInfo(electronRail); |
| | | } |
| | | |
| | | /** |
| | | * 判断一个点是否在区域内 |
| | | * @param electronRail |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean isOnArea(ElectronRailVO electronRail) { |
| | | int i = baseMapper.isOnArea(electronRail); |
| | | if (i>0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | * 单位名称 |
| | | */ |
| | | private String companyName; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String jd; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String wd; |
| | | } |
| | |
| | | - /examSubjectChoices/getSubjectResultInfoBySimulate |
| | | - /blade-user/getNotUpdatePwdInfo |
| | | - /attendance/AppSave |
| | | - /electronRail/** |
| | | |
| | | #授权认证配置 |
| | | auth: |