Commit 3ddc7fe7 authored by 王琮's avatar 王琮

新增代码和考勤业务修改

parent 4f5d17c3
......@@ -102,10 +102,10 @@ public class AttendanceServiceImpl implements AttendanceService {
attendance.setOfficeDeviceName(out.getDeviceName());
} else
return null;
Date beginTime = null;
Date endTime = null;
Date beginTime = work.getCrossTime();
Date endTime = out.getCrossTime();
long sumTime = 0l;
for (int i = 0; i < records.size(); i++) {
/* for (int i = 0; i < records.size(); i++) {
if (records.get(i).getDeviceType().equals("1"))
beginTime = records.get(i).getCrossTime();
if (records.get(i).getDeviceType().equals("2"))
......@@ -115,7 +115,8 @@ public class AttendanceServiceImpl implements AttendanceService {
beginTime = null;
endTime = null;
}
}
}*/
sumTime = TimeUtils.getDatePoor(beginTime, endTime);
if (sumTime > 0) {
BigDecimal totalFee = new BigDecimal(sumTime);
BigDecimal d100 = new BigDecimal(60 * 60 * 1000);
......
......@@ -51,9 +51,7 @@ public class TimeUtils {
public static Date getUpdate() {
Calendar calendar = new GregorianCalendar();
calendar.setTime(new Date());
//todo 测试临时更改
// int i = -1;
int i = -2;
int i = -1;
calendar.add(Calendar.DATE,i);
return calendar.getTime();
}
......
package org.rcisoft.sys.doorvideodevice.controller;
/*固定导入*/
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.rcisoft.sys.doorvideodevice.entity.DoorVideoDevice;
import org.rcisoft.sys.doorvideodevice.service.DoorVideoDeviceService;
import java.util.List;
/**
* Created by cy on 2023年1月3日 上午10:29:41.
*/
@RestController
@RequestMapping("/doorvideodevice")
public class DoorVideoDeviceController extends CyPaginationController<DoorVideoDevice> {
@Autowired
private DoorVideoDeviceService doorVideoDeviceServiceImpl;
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:add')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-新增视频监控设备信息", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="添加视频监控设备信息", notes="添加视频监控设备信息")
@PostMapping(value = "/add")
public CyResult add(@Valid DoorVideoDevice doorVideoDevice, BindingResult bindingResult) {
CyPersistModel data = doorVideoDeviceServiceImpl.persist(doorVideoDevice);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorVideoDevice);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:delete')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-删除视频监控设备信息", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="删除视频监控设备信息", notes="删除视频监控设备信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId,DoorVideoDevice doorVideoDevice) {
doorVideoDevice.setBusinessId(businessId);
CyPersistModel data = doorVideoDeviceServiceImpl.remove(doorVideoDevice);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:update')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-修改视频监控设备信息", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改视频监控设备信息", notes="修改视频监控设备信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable int businessId, @Valid DoorVideoDevice doorVideoDevice, BindingResult bindingResult) {
doorVideoDevice.setBusinessId(businessId);
CyPersistModel data = doorVideoDeviceServiceImpl.merge(doorVideoDevice);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorVideoDevice);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:query')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-查询视频监控设备信息", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询单一视频监控设备信息", notes="查询单一视频监控设备信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorVideoDeviceServiceImpl.findById(businessId));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:list')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-查询视频监控设备信息", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询视频监控设备信息集合", notes="查询视频监控设备信息集合")
@GetMapping(value = "/queryDoorVideoDevices")
public CyResult queryDoorVideoDevices(DoorVideoDevice doorVideoDevice) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorVideoDeviceServiceImpl.findAll(doorVideoDevice));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:rVideoDevice:list')")
@CyOpeLogAnno(title = "system-视频监控设备信息管理-查询视频监控设备信息", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="分页查询视频监控设备信息集合", notes="分页查询视频监控设备信息集合")
@GetMapping(value = "/queryDoorVideoDeviceByPagination")
public CyGridModel listByPagination(DoorVideoDevice doorVideoDevice) {
doorVideoDeviceServiceImpl.findAllByPagination(getPaginationUtility(), doorVideoDevice);
return getGridModelResponse();
}
@CyOpeLogAnno(title = "system-视频监控设备信息管理-查询视频监控设备信息", businessType = CyLogTypeEnum.EXPORT)
@ApiOperation(value = "导出视频监控设备信息信息", notes = "导出视频监控设备信息信息")
@GetMapping(value = "/export")
public CyResult outDoorVideoDevice(HttpServletResponse response,DoorVideoDevice doorVideoDevice,@PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName="";
switch(excelId){
case "0": excelName="视频监控设备信息信息.xls";break;
case "1": excelName="视频监控设备信息信息.xlsx";break;
case "2": excelName="视频监控设备信息信息.csv";break;
}
List<DoorVideoDevice> doorVideoDeviceList = doorVideoDeviceServiceImpl.export(doorVideoDevice);
CyEpExcelUtil.exportExcel(doorVideoDeviceList, "视频监控设备信息信息", "视频监控设备信息信息", DoorVideoDevice.class, excelName, response);
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
doorVideoDeviceList);
}
}
package org.rcisoft.sys.doorvideodevice.dao;
import org.rcisoft.core.mapper.CyBaseMapper;
import org.rcisoft.sys.doorvideodevice.entity.DoorVideoDevice;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.rcisoft.core.model.CyPageInfo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* Created with cy on 2023年1月3日 上午10:29:41.
*/
public interface DoorVideoDeviceRepository extends CyBaseMapper<DoorVideoDevice> {
List<DoorVideoDevice> queryDoorVideoDevices(@Param("entity") DoorVideoDevice doorVideoDevice);
/**
* 分页查询 doorVideoDevice
*
*/
IPage<DoorVideoDevice> queryDoorVideoDevicesPaged(CyPageInfo cyPageInfo,@Param("entity") DoorVideoDevice doorVideoDevice);
}
package org.rcisoft.sys.doorvideodevice.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity;
import java.math.BigInteger;
/**
* Created with cy on 2023年1月3日 上午10:29:41.
*/
@Data
@TableName("door_video_device")
public class DoorVideoDevice extends CyIdIncreEntity<DoorVideoDevice> {
/**
* @desc 主键
* @column id
* @default
*/
@Excel(name = "主键", orderNum = "0", width = 20)
private Long id;
/**
* @desc 视频监控设备名称
* @column device_name
* @default
*/
@Excel(name = "视频监控设备名称", orderNum = "1", width = 20)
private String deviceName;
/**
* @desc 设备ip
* @column device_ip
* @default
*/
@Excel(name = "设备ip", orderNum = "2", width = 20)
private String deviceIp;
/**
* @desc 设备端口号
* @column device_port
* @default
*/
@Excel(name = "设备端口号", orderNum = "3", width = 20)
private String devicePort;
/**
* @desc 设备账号
* @column device_account
* @default
*/
@Excel(name = "设备账号", orderNum = "4", width = 20)
private String deviceAccount;
/**
* @desc 设备密码
* @column device_sign
* @default
*/
@Excel(name = "设备密码", orderNum = "5", width = 20)
private String deviceSign;
/**
* @desc 关联门磁设备id
* @column link_door_device_id
* @default
*/
@Excel(name = "关联门磁设备id", orderNum = "6", width = 20)
private BigInteger linkDoorDeviceId;
/**
* @desc 关联门磁设备imei
* @column link_door_device_imei
* @default
*/
@Excel(name = "关联门磁设备imei", orderNum = "7", width = 20)
private String linkDoorDeviceImei;
}
package org.rcisoft.sys.doorvideodevice.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.rcisoft.sys.doorvideodevice.entity.DoorVideoDevice;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.aop.CyPageUtilAsp;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
/**
* Created by cy on 2023年1月3日 上午10:29:41.
*/
public interface DoorVideoDeviceService {
/**
* 保存 视频监控设备信息
* @param doorVideoDevice
* @return
*/
CyPersistModel persist(DoorVideoDevice doorVideoDevice);
/**
* 删除 视频监控设备信息
* @param doorVideoDevice
* @return
*/
CyPersistModel remove(DoorVideoDevice doorVideoDevice);
/**
* 修改 视频监控设备信息
* @param doorVideoDevice
* @return
*/
CyPersistModel merge(DoorVideoDevice doorVideoDevice);
/**
* 根据id查询 视频监控设备信息
* @param id
* @return
*/
DoorVideoDevice findById(int id);
/**
* 分页查询 视频监控设备信息
* @param doorVideoDevice
* @return
*/
IPage<DoorVideoDevice> findAllByPagination(CyPageInfo<DoorVideoDevice> paginationUtility,
DoorVideoDevice doorVideoDevice);
/**
* 查询list 视频监控设备信息
* @param doorVideoDevice
* @return
*/
List<DoorVideoDevice> findAll(DoorVideoDevice doorVideoDevice);
/**
* 导出视频监控设备信息
* @return
*/
List<DoorVideoDevice> export(DoorVideoDevice doorVideoDevice);
}
package org.rcisoft.sys.doorvideodevice.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.aop.CyPageUtilAsp;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.sys.doorvideodevice.dao.DoorVideoDeviceRepository;
import org.rcisoft.sys.doorvideodevice.entity.DoorVideoDevice;
import org.rcisoft.sys.doorvideodevice.service.DoorVideoDeviceService;
import org.rcisoft.core.service.CyBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* Created by cy on 2023年1月3日 上午10:29:41.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class DoorVideoDeviceServiceImpl extends ServiceImpl<DoorVideoDeviceRepository,DoorVideoDevice> implements DoorVideoDeviceService {
/**
* 保存 视频监控设备信息
* @param doorVideoDevice
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(DoorVideoDevice doorVideoDevice){
//增加操作
int line = baseMapper.insert(doorVideoDevice);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
doorVideoDevice.getBusinessId()+"的视频监控设备信息信息");
return new CyPersistModel(line);
}
/**
* 删除 视频监控设备信息
* @param doorVideoDevice
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(DoorVideoDevice doorVideoDevice){
int line = baseMapper.realDelete(doorVideoDevice);
log.debug(CyUserUtil.getAuthenUsername()+"删除了ID为"+
doorVideoDevice.getBusinessId()+"的视频监控设备信息信息");
return new CyPersistModel(line);
}
/**
* 修改 视频监控设备信息
* @param doorVideoDevice
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(DoorVideoDevice doorVideoDevice){
int line = baseMapper.updateById(doorVideoDevice);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ doorVideoDevice.getBusinessId()+"的视频监控设备信息信息");
return new CyPersistModel(line);
}
/**
* 根据id查询 视频监控设备信息
* @param id
* @return
*/
@Override
public DoorVideoDevice findById(int id){
return baseMapper.selectById(id);
}
/**
* 分页查询 视频监控设备信息
* @param doorVideoDevice
* @return
*/
@Override
public IPage<DoorVideoDevice> findAllByPagination(CyPageInfo<DoorVideoDevice> paginationUtility,
DoorVideoDevice doorVideoDevice){
return baseMapper.queryDoorVideoDevicesPaged(paginationUtility,doorVideoDevice);
}
/**
* 查询list 视频监控设备信息
* @param doorVideoDevice
* @return
*/
@Override
public List<DoorVideoDevice> findAll(DoorVideoDevice doorVideoDevice){
return baseMapper.queryDoorVideoDevices(doorVideoDevice);
}
/**
* 导出视频监控设备信息
* @return
*/
@Override
public List<DoorVideoDevice> export(DoorVideoDevice doorVideoDevice) {
List<DoorVideoDevice> doorVideoDeviceList = baseMapper.queryDoorVideoDevices(doorVideoDevice);
return doorVideoDeviceList;
}
}
......@@ -10,9 +10,9 @@
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<!--<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>-->
</layout>
<!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>-->
</filter>
</appender>
......
......@@ -246,9 +246,10 @@
</select>
<update id="updateDoorRecordById" parameterType="org.rcisoft.sys.sysuser.entity.DoorRecord">
UPDATE door_record_2022
UPDATE door_record
SET abnormal = #{abnormal}
WHERE record_id = #{recordId}
WHERE record_id = #{recordId} and cross_time = #{crossTime}
</update>
<select id="queryAttendance2" resultMap="BaseResultMap">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.sys.doorvideodevice.dao.DoorVideoDeviceRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.sys.doorvideodevice.entity.DoorVideoDevice">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
<result column="device_ip" jdbcType="VARCHAR" property="deviceIp"/>
<result column="device_port" jdbcType="VARCHAR" property="devicePort"/>
<result column="device_account" jdbcType="VARCHAR" property="deviceAccount"/>
<result column="device_sign" jdbcType="VARCHAR" property="deviceSign"/>
<result column="link_door_device_id" jdbcType="BIGINT" property="linkDoorDeviceId"/>
<result column="link_door_device_imei" jdbcType="VARCHAR" property="linkDoorDeviceImei"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryDoorVideoDevices" resultMap="BaseResultMap">
select * from door_video_device
where 1=1
</select>
<select id="queryDoorVideoDevicesPaged" resultMap="BaseResultMap">
select * from door_video_device
where 1=1
</select>
</mapper>
\ No newline at end of file
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