yang_shj
1 week ago
16 changed files with 439 additions and 11 deletions
@ -0,0 +1,30 @@
|
||||
package com.hnac.hzinfo.inspect.ai.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "巡检打卡分页请求参数", description = "巡检打卡分页请求参数") |
||||
public class ClockInRequestDTO implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 8445346022067680992L; |
||||
|
||||
@ApiModelProperty(value = "打卡人") |
||||
private Long clockPerson; |
||||
|
||||
@ApiModelProperty(value = "打卡状态: 0-未打卡 1-打卡完成") |
||||
private Integer status; |
||||
|
||||
@ApiModelProperty(value = "打卡开始时间 : yyyy-MM-dd HH:mm:ss") |
||||
private String startTime; |
||||
|
||||
@ApiModelProperty(value = "打卡结束时间 : yyyy-MM-dd HH:mm:ss") |
||||
private String endTime; |
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.hnac.hzinfo.inspect.ai.vo; |
||||
|
||||
import com.hnac.hzinfo.inspect.task.entity.ClockInEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "巡检打卡分页查询响应对象", description = "巡检打卡分页查询响应对象") |
||||
public class ClockInResponseDTO extends ClockInEntity { |
||||
|
||||
private static final long serialVersionUID = 8445346022067680992L; |
||||
|
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.hnac.hzinfo.inspect.task.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
@TableName("hz_st_ex_clock_in") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "巡检打卡对象") |
||||
public class ClockInEntity extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ApiModelProperty(value = "巡检任务ID") |
||||
private Long taskId; |
||||
|
||||
@ApiModelProperty(value = "巡检对象Id") |
||||
private Long objectId; |
||||
|
||||
@ApiModelProperty(value = "计划打卡开始时间") |
||||
@DateTimeFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
@JsonFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
private LocalDateTime planStartTime; |
||||
|
||||
@ApiModelProperty(value = "计划打卡结束时间") |
||||
@DateTimeFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
@JsonFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
private LocalDateTime planEndTime; |
||||
|
||||
@ApiModelProperty(value = "打卡人") |
||||
private Long clockPerson; |
||||
|
||||
@ApiModelProperty(value = "打卡时间") |
||||
@DateTimeFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
@JsonFormat( |
||||
pattern = "yyyy-MM-dd HH:mm:ss" |
||||
) |
||||
private LocalDateTime clockTime; |
||||
} |
@ -0,0 +1,44 @@
|
||||
package com.hnac.hzinfo.inspect.task.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
||||
import com.hnac.hzims.common.logs.enums.BusinessType; |
||||
import com.hnac.hzims.common.logs.enums.OperatorType; |
||||
import com.hnac.hzinfo.inspect.Constants; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInRequestDTO; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInResponseDTO; |
||||
import com.hnac.hzinfo.inspect.task.service.IClockInService; |
||||
import com.hnac.hzinfo.log.annotation.Business; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/clockIn") |
||||
@Api(value = "巡检打卡", tags = "巡检打卡") |
||||
@Business(module = Constants.APP_NAME,value = "巡检任务管理") |
||||
public class ClockInController extends BladeController { |
||||
|
||||
private final IClockInService clockInService; |
||||
|
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 4) |
||||
@OperationAnnotation(moduleName = "巡检打卡", |
||||
title = "打卡记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, |
||||
action = "分页查询打卡记录") |
||||
@ApiOperation(value = "分页") |
||||
public R<IPage<ClockInResponseDTO>> list(ClockInRequestDTO param, Query query) { |
||||
return R.data(clockInService.pageCondition(param, query)); |
||||
} |
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.hnac.hzinfo.inspect.task.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzinfo.inspect.task.entity.ClockInEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Mapper |
||||
public interface ClockInMapper extends BaseMapper<ClockInEntity> { |
||||
|
||||
} |
@ -0,0 +1,5 @@
|
||||
<?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="com.hnac.hzinfo.inspect.task.mapper.ClockInMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,22 @@
|
||||
package com.hnac.hzinfo.inspect.task.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInRequestDTO; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInResponseDTO; |
||||
import com.hnac.hzinfo.inspect.task.entity.ClockInEntity; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskObjectEntity; |
||||
import org.springblade.core.mp.support.Query; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public interface IClockInService extends IService<ClockInEntity> { |
||||
|
||||
IPage<ClockInResponseDTO> pageCondition(ClockInRequestDTO param, Query query); |
||||
|
||||
List<TaskObjectEntity> pendingObjects(Long taskId); |
||||
} |
@ -0,0 +1,76 @@
|
||||
package com.hnac.hzinfo.inspect.task.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.hnac.hzims.common.logs.utils.StringUtils; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInRequestDTO; |
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInResponseDTO; |
||||
import com.hnac.hzinfo.inspect.task.entity.ClockInEntity; |
||||
import com.hnac.hzinfo.inspect.task.entity.TaskObjectEntity; |
||||
import com.hnac.hzinfo.inspect.task.mapper.ClockInMapper; |
||||
import com.hnac.hzinfo.inspect.task.service.IClockInService; |
||||
import com.hnac.hzinfo.inspect.task.service.ITaskObjectService; |
||||
import com.hnac.hzinfo.inspect.task.wrapper.ClockInWrapper; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
@RequiredArgsConstructor |
||||
public class ClockInServiceImpl extends ServiceImpl<ClockInMapper, ClockInEntity> implements IClockInService { |
||||
|
||||
private final ITaskObjectService objectService; |
||||
|
||||
/** |
||||
* 分页查看打卡记录 |
||||
* @param param |
||||
* @param query |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public IPage<ClockInResponseDTO> pageCondition(ClockInRequestDTO param, Query query) { |
||||
QueryWrapper<ClockInEntity> queryWrapper = new QueryWrapper<ClockInEntity>() {{ |
||||
if(ObjectUtil.isNotEmpty(param.getClockPerson())){ |
||||
eq("CLOCK_PERSON",param.getClockPerson()); |
||||
} |
||||
if(ObjectUtil.isNotEmpty(param.getStatus())){ |
||||
eq("STATUS",param.getStatus()); |
||||
} |
||||
if(StringUtils.isNotEmpty(param.getStartTime())){ |
||||
ge("PLAN_START_TIME",param.getStartTime()); |
||||
} |
||||
if(StringUtils.isNotEmpty(param.getEndTime())){ |
||||
le("PLAN_END_TIME",param.getEndTime()); |
||||
} |
||||
}}; |
||||
IPage pages = super.page(Condition.getPage(query), queryWrapper); |
||||
List list = ClockInWrapper.build().listVO(pages.getRecords()); |
||||
return pages.setRecords(list); |
||||
} |
||||
|
||||
/** |
||||
* 待生成打卡记录巡检对象 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<TaskObjectEntity> pendingObjects(Long taskId) { |
||||
if(ObjectUtil.isEmpty(taskId)){ |
||||
return new ArrayList<>(); |
||||
} |
||||
return objectService.list(Wrappers.<TaskObjectEntity>lambdaQuery() |
||||
.eq(TaskObjectEntity::getTaskId,taskId)); |
||||
} |
||||
} |
@ -0,0 +1,26 @@
|
||||
/** |
||||
* |
||||
*/ |
||||
package com.hnac.hzinfo.inspect.task.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@ApiModel |
||||
@Getter |
||||
@Setter |
||||
public class ClockInEventVO implements Serializable{ |
||||
|
||||
private static final long serialVersionUID = -904847315218750903L; |
||||
|
||||
@ApiModelProperty(value = "巡检巡检集合") |
||||
private List<EventAddVO> events; |
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzinfo.inspect.task.wrapper; |
||||
|
||||
import com.hnac.hzinfo.inspect.ai.vo.ClockInResponseDTO; |
||||
import com.hnac.hzinfo.inspect.task.entity.ClockInEntity; |
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
|
||||
|
||||
public class ClockInWrapper extends BaseEntityWrapper<ClockInEntity, ClockInResponseDTO> { |
||||
|
||||
public static ClockInWrapper build() { |
||||
return new ClockInWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public ClockInResponseDTO entityVO(ClockInEntity entity) { |
||||
|
||||
return BeanUtil.copy(entity, ClockInResponseDTO.class); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue