7 changed files with 261 additions and 8 deletions
@ -0,0 +1,91 @@ |
|||||
|
package com.qs.serve.modules.visit.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.AuthContextUtils; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.visit.entity.VisitCheckLog; |
||||
|
import com.qs.serve.modules.visit.service.VisitCheckLogService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 系统 门卫核对日志 |
||||
|
* @author YenHex |
||||
|
* @since 2024-11-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("visit/checkLog") |
||||
|
public class VisitCheckLogController { |
||||
|
|
||||
|
private VisitCheckLogService visitCheckLogService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页我的 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/pageMy") |
||||
|
public R<PageVo<VisitCheckLog>> getPageMy(VisitCheckLog param){ |
||||
|
LambdaQueryWrapper<VisitCheckLog> lqw = new LambdaQueryWrapper<>(param); |
||||
|
param.setCheckUserId(AuthContextUtils.getSysUserId()); |
||||
|
PageUtil.startPage(); |
||||
|
List<VisitCheckLog> list = visitCheckLogService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<VisitCheckLog>> getPage(VisitCheckLog param){ |
||||
|
LambdaQueryWrapper<VisitCheckLog> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<VisitCheckLog> list = visitCheckLogService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/getById/{id}")
|
||||
|
@PreAuthorize("hasRole('visit:checkLog:query')") |
||||
|
public R<VisitCheckLog> getById(@PathVariable("id") String id){ |
||||
|
VisitCheckLog visitCheckLog = visitCheckLogService.getById(id); |
||||
|
return R.ok(visitCheckLog); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
//@PreAuthorize("hasRole('visit:checkLog:delete')")
|
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
boolean result = visitCheckLogService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,97 @@ |
|||||
|
package com.qs.serve.modules.visit.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 门卫核对日志 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2024-11-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("visit_check_log") |
||||
|
public class VisitCheckLog implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 来访实例id */ |
||||
|
@Length(max = 255,message = "来访实例id长度不能超过255字") |
||||
|
private String mainId; |
||||
|
|
||||
|
/** 门卫id */ |
||||
|
@Length(max = 255,message = "门卫id长度不能超过255字") |
||||
|
private String checkUserId; |
||||
|
|
||||
|
/** 门卫工号 */ |
||||
|
@Length(max = 255,message = "门卫工号长度不能超过255字") |
||||
|
private String checkUserCode; |
||||
|
|
||||
|
/** 门卫名称 */ |
||||
|
@Length(max = 255,message = "门卫名称长度不能超过255字") |
||||
|
private String checkUserName; |
||||
|
|
||||
|
/** 门卫填写的备注 */ |
||||
|
@Length(max = 255,message = "门卫填写的备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
|
||||
|
public static VisitCheckLog toNewObject(VisitCheckLog source){ |
||||
|
VisitCheckLog checkLog = new VisitCheckLog(); |
||||
|
checkLog.setId(source.getId()); |
||||
|
checkLog.setMainId(source.getMainId()); |
||||
|
checkLog.setCheckUserId(source.getCheckUserId()); |
||||
|
checkLog.setCheckUserCode(source.getCheckUserCode()); |
||||
|
checkLog.setCheckUserName(source.getCheckUserName()); |
||||
|
checkLog.setRemark(source.getRemark()); |
||||
|
checkLog.setCreateTime(source.getCreateTime()); |
||||
|
checkLog.setCreateBy(source.getCreateBy()); |
||||
|
checkLog.setUpdateTime(source.getUpdateTime()); |
||||
|
checkLog.setUpdateBy(source.getUpdateBy()); |
||||
|
checkLog.setDelFlag(source.getDelFlag()); |
||||
|
return checkLog; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.visit.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.visit.entity.VisitCheckLog; |
||||
|
|
||||
|
/** |
||||
|
* 门卫核对日志 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2024-11-20 |
||||
|
*/ |
||||
|
public interface VisitCheckLogMapper extends BaseMapper<VisitCheckLog> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.visit.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.visit.entity.VisitCheckLog; |
||||
|
|
||||
|
/** |
||||
|
* 门卫核对日志 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2024-11-20 |
||||
|
*/ |
||||
|
public interface VisitCheckLogService extends IService<VisitCheckLog> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.visit.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.visit.entity.VisitCheckLog; |
||||
|
import com.qs.serve.modules.visit.service.VisitCheckLogService; |
||||
|
import com.qs.serve.modules.visit.mapper.VisitCheckLogMapper; |
||||
|
|
||||
|
/** |
||||
|
* 门卫核对日志 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2024-11-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class VisitCheckLogServiceImpl extends ServiceImpl<VisitCheckLogMapper,VisitCheckLog> implements VisitCheckLogService { |
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue