parent
1c20338cbb
commit
ad2aff5d3d
|
|
@ -137,7 +137,7 @@ public interface JcskSyRMapper extends BaseMapper<JcskSyR> {
|
|||
<script>
|
||||
select to_char(t.tm,'YYYY-MM-DD') as tm,t.rz
|
||||
from public.st_rsvr_r t
|
||||
where to_char(t.tm, 'HH24:MI:SS') = '08:00:00' and t.stcd = #{stcd}
|
||||
where to_char(t.tm, 'HH24') = '08:00:00' and t.stcd = #{stcd}
|
||||
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
|
||||
and t.tm <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ISCAIEventPageSo;
|
||||
import com.gunshi.project.hsz.model.ISCAIEvent;
|
||||
import com.gunshi.project.hsz.service.ISCAIEventService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "海康ai事件Controller")
|
||||
@RestController
|
||||
@RequestMapping(value="/iscaiEvent")
|
||||
public class ISCAIEventController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISCAIEventService iscaiEventService;
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ISCAIEvent>> pageInfo(@RequestBody ISCAIEventPageSo dto) {
|
||||
return R.ok(iscaiEventService.pageInfo(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<ISCAIEvent>> list() {
|
||||
return R.ok(iscaiEventService.lambdaQuery().list());
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +60,9 @@ public class ResPlanBController extends AbstractCommonFileController{
|
|||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
if(dto.getFiles() != null && !dto.getFiles().isEmpty()){
|
||||
dto.setModitime(new Date());
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
if (result) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
package com.gunshi.project.hsz.entity.so;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Schema(description = "海康AI事件分页Dto")
|
||||
public class ISCAIEventPageSo {
|
||||
|
||||
@NotNull(message = "分页参数不能为空")
|
||||
@Schema(description = "分页参数")
|
||||
private PageSo pageSo;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
/*
|
||||
事件等级,1-低,2-中,3-高
|
||||
*/
|
||||
@Schema(description = "事件等级 1-低,2-中,3-高")
|
||||
private Integer eventLevel;
|
||||
|
||||
|
||||
/*
|
||||
事件处理状态,0-未处理,1-已处理
|
||||
*/
|
||||
@Schema(description = "事件处理状态 0-未处理,1-已处理")
|
||||
private Integer handleStatus;
|
||||
|
||||
|
||||
/*
|
||||
事件类型名称
|
||||
*/
|
||||
@Schema(description = "事件类型名称")
|
||||
private String eventTypeName;
|
||||
|
||||
/*
|
||||
事件源名称
|
||||
*/
|
||||
@Schema(description = "事件源名称")
|
||||
private String resName;
|
||||
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
|||
<if test="obj.etm != null ">
|
||||
and t.tm <![CDATA[<=]]> to_timestamp(#{obj.etm},'YYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
and TRIM(TO_CHAR(t.tm, 'MI:SS')) = '05:00'
|
||||
and TRIM(TO_CHAR(t.tm, 'SS')) = '00'
|
||||
order by t.tm desc
|
||||
</script>
|
||||
""")
|
||||
|
|
@ -230,7 +230,7 @@ public interface AttResBaseMapper extends BaseMapper<AttResBase> {
|
|||
where t.stcd = #{obj.stcd}
|
||||
and t.tm <![CDATA[>=]]> to_timestamp(#{obj.stm},'YYYY-MM-DD HH24:MI:SS')
|
||||
and t.tm <![CDATA[<=]]> to_timestamp(#{obj.etm},'YYYY-MM-DD HH24:MI:SS')
|
||||
and TRIM(TO_CHAR(t.tm, 'MI:SS')) = '00:00'
|
||||
and TRIM(TO_CHAR(t.tm, 'SS')) = '00'
|
||||
order by t.tm desc
|
||||
</script>
|
||||
""")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.gunshi.project.hsz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.model.ISCAIEvent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface ISCAIEventMapper extends BaseMapper<ISCAIEvent> {
|
||||
}
|
||||
|
|
@ -33,13 +33,13 @@ public interface ProjectEventsMapper extends BaseMapper<ProjectEvents> {
|
|||
@Select("""
|
||||
<script>
|
||||
|
||||
select t.id,t.report_time as eventsDate,t.maintain_content as eventsDesc,3 as type from public.maintain_service t
|
||||
select t.id,t.fill_time as eventsDate,t.mentence_context as eventsDesc,3 as type from public.mentence_farmer_record t
|
||||
<where>
|
||||
<if test="obj.dateSo != null and obj.dateSo.start != null">
|
||||
t.report_time <![CDATA[>=]]> #{obj.dateSo.start}
|
||||
t.fill_time <![CDATA[>=]]> #{obj.dateSo.start}
|
||||
</if>
|
||||
<if test="obj.dateSo != null and obj.dateSo.end != null">
|
||||
and t.report_time <![CDATA[<=]]> #{obj.dateSo.end}
|
||||
and t.fill_time <![CDATA[<=]]> #{obj.dateSo.end}
|
||||
</if>
|
||||
</where>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package com.gunshi.project.hsz.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("isc_ai_event")
|
||||
public class ISCAIEvent {
|
||||
@TableId(value="id", type = IdType.INPUT)
|
||||
private String id;
|
||||
@TableField("json")
|
||||
private String json;
|
||||
|
||||
@TableField("starttime")
|
||||
private LocalDateTime startTime;
|
||||
@TableField("endtime")
|
||||
private LocalDateTime endTime;
|
||||
/*
|
||||
事件等级,1-低,2-中,3-高
|
||||
*/
|
||||
@TableField("eventlevel")
|
||||
private Integer eventLevel;
|
||||
/*
|
||||
事件处理状态,0-未处理,1-已处理
|
||||
*/
|
||||
@TableField("handlestatus")
|
||||
private Integer handleStatus;
|
||||
|
||||
/*
|
||||
事件类型名称
|
||||
*/
|
||||
@TableField("eventtypename")
|
||||
private String eventTypeName;
|
||||
/*
|
||||
事件源名称
|
||||
*/
|
||||
@TableField("resname")
|
||||
private String resName;
|
||||
/*
|
||||
事件源编号
|
||||
*/
|
||||
@TableField("resindexcode")
|
||||
private String resIndexCode;
|
||||
}
|
||||
|
|
@ -53,8 +53,8 @@ public class ForecastDispatchPlanService extends ServiceImpl<ForecastDispatchPla
|
|||
if(!StringUtils.isBlank(pageSo.getPlanName())){
|
||||
queryWrapper.like(ForecastDispatchPlan::getPlanName, pageSo.getPlanName());
|
||||
}
|
||||
Page<ForecastDispatchPlan> forecastDispatchPlanPage = this.baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
queryWrapper.orderByDesc(ForecastDispatchPlan::getCreateTime);
|
||||
Page<ForecastDispatchPlan> forecastDispatchPlanPage = this.baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
for (ForecastDispatchPlan record : forecastDispatchPlanPage.getRecords()) {
|
||||
List<ForecastDispatchCommand> forecastDispatchCommandList = forecastDispatchCommandService.lambdaQuery().eq(ForecastDispatchCommand::getPlanId, record.getId()).list();
|
||||
record.setForecastDispatchCommands(forecastDispatchCommandList);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.gunshi.project.hsz.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.hsz.entity.so.ISCAIEventPageSo;
|
||||
import com.gunshi.project.hsz.mapper.ISCAIEventMapper;
|
||||
import com.gunshi.project.hsz.model.ISCAIEvent;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ISCAIEventService extends ServiceImpl<ISCAIEventMapper, ISCAIEvent> {
|
||||
|
||||
|
||||
public Page<ISCAIEvent> pageInfo(ISCAIEventPageSo dto) {
|
||||
LambdaQueryWrapper<ISCAIEvent> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (dto.getEventLevel() != null) {
|
||||
queryWrapper.eq(ISCAIEvent::getEventLevel, dto.getEventLevel());
|
||||
}
|
||||
|
||||
if(dto.getHandleStatus() != null){
|
||||
queryWrapper.eq(ISCAIEvent::getHandleStatus, dto.getHandleStatus());
|
||||
}
|
||||
|
||||
if(dto.getEventTypeName() != null){
|
||||
queryWrapper.like(ISCAIEvent::getEventTypeName, dto.getEventTypeName());
|
||||
}
|
||||
|
||||
if(dto.getResName() != null){
|
||||
queryWrapper.like(ISCAIEvent::getResName, dto.getResName());
|
||||
}
|
||||
|
||||
if(dto.getStartTime() != null){
|
||||
queryWrapper.ge(ISCAIEvent::getStartTime, dto.getStartTime());
|
||||
}
|
||||
|
||||
if(dto.getEndTime() != null){
|
||||
queryWrapper.le(ISCAIEvent::getEndTime, dto.getEndTime());
|
||||
}
|
||||
queryWrapper.orderByDesc(ISCAIEvent::getStartTime);
|
||||
Page<ISCAIEvent> iscaiEventPage = this.baseMapper.selectPage(dto.getPageSo().toPage(), queryWrapper);
|
||||
return iscaiEventPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.hsz.entity.so.MentenceStPageSo;
|
||||
import com.gunshi.project.hsz.mapper.MentenceFarmerRecordMapper;
|
||||
import com.gunshi.project.hsz.mapper.MentencePlanDetailMapper;
|
||||
import com.gunshi.project.hsz.mapper.MentenceStDetailMapper;
|
||||
import com.gunshi.project.hsz.mapper.MentenceStMapper;
|
||||
import com.gunshi.project.hsz.model.MentenceFarmerRecord;
|
||||
import com.gunshi.project.hsz.model.MentencePlanDetail;
|
||||
import com.gunshi.project.hsz.model.MentenceSt;
|
||||
import com.gunshi.project.hsz.model.MentenceStDetail;
|
||||
|
|
@ -26,6 +28,9 @@ public class MentenceStDetailService extends ServiceImpl<MentenceStDetailMapper,
|
|||
@Autowired
|
||||
private MentencePlanDetailMapper mentencePlanDetailMapper;
|
||||
|
||||
@Autowired
|
||||
private MentenceFarmerRecordMapper mentenceFarmerRecordMapper;
|
||||
|
||||
public boolean deleteById(Serializable id) {
|
||||
LambdaQueryWrapper<MentencePlanDetail> queryWrapperDetail = new LambdaQueryWrapper<>();
|
||||
queryWrapperDetail.eq(MentencePlanDetail::getMentenceStDetailId, id);
|
||||
|
|
@ -56,8 +61,12 @@ public class MentenceStDetailService extends ServiceImpl<MentenceStDetailMapper,
|
|||
for (MentenceStDetail record : mentenceStDetailPage.getRecords()) {
|
||||
LambdaQueryWrapper<MentencePlanDetail> queryWrapperDetail = new LambdaQueryWrapper<>();
|
||||
queryWrapperDetail.eq(MentencePlanDetail::getMentenceStDetailId, record.getId());
|
||||
Long count = mentencePlanDetailMapper.selectCount(queryWrapperDetail);
|
||||
if(count > 0) {
|
||||
Long count1 = mentencePlanDetailMapper.selectCount(queryWrapperDetail);
|
||||
|
||||
LambdaQueryWrapper<MentenceFarmerRecord> queryWrapperFarmerRecord = new LambdaQueryWrapper<>();
|
||||
queryWrapperFarmerRecord.eq(MentenceFarmerRecord::getMentenceStDetailId,record.getId());
|
||||
Long count2 = mentenceFarmerRecordMapper.selectCount(queryWrapperFarmerRecord);
|
||||
if(count1 > 0 || count2 > 0) {
|
||||
record.setHasUse(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.hsz.entity.so.CommonDataPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.ProjectEventsVo;
|
||||
import com.gunshi.project.hsz.mapper.HiddenInfoMapper;
|
||||
import com.gunshi.project.hsz.mapper.ProjectEventsMapper;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.model.HiddenInfo;
|
||||
import com.gunshi.project.hsz.model.ProjectEvents;
|
||||
import com.gunshi.project.hsz.model.TermiteSurvey;
|
||||
import com.gunshi.project.hsz.util.DataHandleUtil;
|
||||
|
|
@ -38,6 +40,9 @@ public class ProjectEventsService extends ServiceImpl<ProjectEventsMapper, Proje
|
|||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Autowired
|
||||
private HiddenInfoMapper hiddenInfoMapper;
|
||||
|
||||
public Page<ProjectEvents> pageQuery(CommonDataPageSo page) {
|
||||
LambdaQueryWrapper<ProjectEvents> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
|
|
@ -220,6 +225,18 @@ public class ProjectEventsService extends ServiceImpl<ProjectEventsMapper, Proje
|
|||
Map<String, List<FileAssociations>> map = files.stream().collect(Collectors.groupingBy(FileAssociations::getBusinessId));
|
||||
for (ProjectEventsVo vo : list){
|
||||
vo.setFiles(map.get(vo.getId().toString()));
|
||||
if(vo.getType() == 3){
|
||||
List<FileAssociations> fileAssociations = vo.getFiles() == null?new ArrayList<>():vo.getFiles();
|
||||
//Java有Integer的缓存-128~127可以直接用==
|
||||
LambdaQueryWrapper<HiddenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HiddenInfo::getMentenceFarmerRecordId,vo.getId());
|
||||
List<HiddenInfo> hiddenInfos = hiddenInfoMapper.selectList(queryWrapper);
|
||||
hiddenInfos.stream().forEach(o ->{
|
||||
List<FileAssociations> add = fileService.getFiles("mentenceFarmerRecord", o.getId().toString());
|
||||
fileAssociations.addAll(add);
|
||||
});
|
||||
vo.setFiles(fileAssociations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,11 +91,16 @@ public class SysUserLoginLogController {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
BigDecimal divisor = BigDecimal.valueOf(1000 * 60 * 60);
|
||||
vo.setWeb3Count(
|
||||
BigDecimal.valueOf(webTimes.stream().mapToLong(o -> o).sum())
|
||||
.divide(BigDecimal.valueOf(webTimes.size()), 2, RoundingMode.HALF_UP)
|
||||
.divide(divisor, 2, RoundingMode.HALF_UP)
|
||||
);
|
||||
if(!webTimes.isEmpty()){
|
||||
vo.setWeb3Count(
|
||||
BigDecimal.valueOf(webTimes.stream().mapToLong(o -> o).sum())
|
||||
.divide(BigDecimal.valueOf(webTimes.size()), 2, RoundingMode.HALF_UP)
|
||||
.divide(divisor, 2, RoundingMode.HALF_UP)
|
||||
);
|
||||
}else{
|
||||
vo.setWeb3Count(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
|
||||
vo.setApp1Count(
|
||||
logs.stream()
|
||||
|
|
@ -104,16 +109,21 @@ public class SysUserLoginLogController {
|
|||
);
|
||||
|
||||
List<Long> appTimes = logs.stream()
|
||||
.filter(o -> "0".equals(o.getLoginType()))
|
||||
.filter(o -> "1".equals(o.getLoginType()))
|
||||
.filter(o -> o.getLogoutTime() != null && o.getLoginTime() != null)
|
||||
.map(o -> o.getLogoutTime().getTime() - o.getLoginTime().getTime())
|
||||
.collect(Collectors.toList());
|
||||
if(!appTimes.isEmpty()){
|
||||
vo.setApp3Count(
|
||||
BigDecimal.valueOf(appTimes.stream().mapToLong(o -> o).sum())
|
||||
.divide(BigDecimal.valueOf(appTimes.size()),2, RoundingMode.HALF_UP)
|
||||
.divide(divisor,2, RoundingMode.HALF_UP)
|
||||
);
|
||||
}else{
|
||||
vo.setApp3Count(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
|
||||
vo.setApp3Count(
|
||||
BigDecimal.valueOf(appTimes.stream().mapToLong(o -> o).sum())
|
||||
.divide(BigDecimal.valueOf(appTimes.size()),2, RoundingMode.HALF_UP)
|
||||
.divide(divisor,2, RoundingMode.HALF_UP)
|
||||
);
|
||||
|
||||
LambdaQueryWrapper<SysVisitMenuLog> wrapperMenuLog = Wrappers.lambdaQuery(SysVisitMenuLog.class)
|
||||
.eq(SysVisitMenuLog::getCreateTime, new Date());
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public class SysUserLogAspect {
|
|||
} catch (ServiceException e) {
|
||||
// log.info("获取登录账号id," + e.getMessage(), e);
|
||||
log.info("获取登录账号id异常,请重新登录");
|
||||
loginUserId = 1l;
|
||||
}
|
||||
if (loginUserId != null) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue