f4d0b938 康伟

kangwei : 隐患排查统计接口

1 个父辈 2b1b530a
......@@ -13,6 +13,7 @@ import com.skua.modules.safe.service.IDangerInspectionItemService;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
import com.skua.modules.safe.vo.DangerInspectionRecordVO;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -67,6 +68,15 @@ public class APPDangerInspectionRecordController {
if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){
queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){
queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
}
// queryWrapper.eq("report_user", BaseContextHandler.getUserId());
IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
result.setSuccess(true);
......@@ -98,6 +108,18 @@ public class APPDangerInspectionRecordController {
}
return result;
}
//Statistics
@AutoLog(value = "隐患排查记录:根据风险点统计记录")
@ApiOperation(value="隐患排查记录:根据风险点统计记录", notes="隐患排查记录:根据风险点统计记录")
@GetMapping(value = "/statistics")
public Result<InspectionRecordStatisticsVO> statistics(@RequestParam(name="dangerId") String dangerId) {
Result<InspectionRecordStatisticsVO> result = new Result<InspectionRecordStatisticsVO>();
InspectionRecordStatisticsVO statisticsVO = inspectionRecordService.queryByStatistics(dangerId);
result.setResult(statisticsVO);
result.setSuccess(true);
return result;
}
}
\ No newline at end of file
......
......@@ -3,6 +3,7 @@ package com.skua.modules.safe.mapper;
import java.util.List;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.safe.entity.DangerInspectionRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -24,4 +25,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio
* @return
*/
public DangerLevelManageVO queryDangerLevelAndInspectionRecord(@Param("inspectionRecordId") String inspectionRecordId);
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(@Param("dangerId") String dangerId);
}
......
......@@ -12,4 +12,13 @@
where ir.id = #{inspectionRecordId}
</select>
<!-- 根据风险点统计记录 -->
<select id="queryByStatistics" resultType="com.skua.modules.safe.vo.InspectionRecordStatisticsVO">
select
(select count(1) from danger_inspection_record t1 where t1.danger_id =#{dangerId}) as 'total_num',
(select count(1) from danger_inspection_record t2 where t2.status = 1 and t2.danger_id =#{dangerId}) as 'un_complete_num',
(select count(1) from danger_inspection_record t3 where t3.status = 2 and t3.danger_id =#{dangerId}) as 'complete_num'
from dual
</select>
</mapper>
\ No newline at end of file
......
......@@ -5,6 +5,7 @@ import com.skua.modules.safe.entity.DangerInspectionRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import java.util.List;
......@@ -53,4 +54,11 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
* @return
*/
public DangerLevelManageVO queryListByRecordId(String inspectionRecordId);
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(String dangerId);
}
......
......@@ -7,6 +7,7 @@ import com.skua.modules.safe.entity.*;
import com.skua.modules.safe.mapper.*;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -259,5 +260,12 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
return dangerLevelManageVO;
}
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(String dangerId){
return this.baseMapper.queryByStatistics(dangerId);
}
}
......
......@@ -27,9 +27,18 @@ public class DangerInspectionRecordVO {
@ApiModelProperty(value = "风险等级编号")
private String dangerId;
@ApiModelProperty(value = "巡检记录编号")
private String inspectionRecord;
@Excel(name = "风险等级名称", width = 15)
@ApiModelProperty(value = "风险等级名称")
private String dangerName;
@ApiModelProperty(value = "巡检状态(1:开始,2:结束)")
private String status;
@TableField(exist=false)
@ApiModelProperty(value = "条件:开始时间")
private String startTime;
......
package com.skua.modules.safe.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @auther kangwei
* @create 2024-09-25-18:03
*/
@Data
@ApiModel(value="InspectionRecord 隐患排查统计对象", description="隐患排查统计对象")
public class InspectionRecordStatisticsVO {
@ApiModelProperty(value = "全部数据")
private Integer totalNum;
@ApiModelProperty(value = "未完成数量")
private Integer unCompleteNum;//未处理数量
@ApiModelProperty(value = "完成数量")
private Integer completeNum;//已经处理数据
}
......@@ -91,7 +91,6 @@ public class EquipmentSparepartSuppliesController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料信息表-分页列表查询")
@ApiOperation(value = "物料信息表-分页列表查询", notes = "物料信息表-分页列表查询")
@GetMapping(value = "/list")
......@@ -214,11 +213,9 @@ public class EquipmentSparepartSuppliesController {
}
supplies.setStorageNum(BigDecimal.valueOf(totalSum));
}
}
return equipmentSparepartSuppliesVOS;
}
/**
* <pre>
* 添加
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!