e0657dc7 康伟

kangwei:优化、补充、完善接口

1 个父辈 209fcc15
......@@ -106,6 +106,9 @@ public class DangerInspectionRecordController {
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerLevel())){
queryWrapper.eq("danger_level", dangerInspectionRecord.getDangerLevel() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerPlace())){
queryWrapper.eq("danger_place", dangerInspectionRecord.getDangerPlace() ) ;
}
queryWrapper.orderByAsc("depart_id");
queryWrapper.orderByAsc("equipInfoId");
IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
......@@ -125,6 +128,7 @@ public class DangerInspectionRecordController {
if(dangerLevelManage != null ){
dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() );
dangerInspectionRecord.setDangerLevel(dangerLevelManage.getDangerLevel() ) ;
dangerInspectionRecord.setDangerPlace(dangerLevelManage.getDangerPlace());
}
dangerInspectionRecordService.save(dangerInspectionRecord);
result.success("添加成功!");
......@@ -157,6 +161,7 @@ public class DangerInspectionRecordController {
if(dangerLevelManage != null ){
dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() );
dangerInspectionRecord.setDangerLevel(dangerLevelManage.getDangerLevel() ) ;
dangerInspectionRecord.setDangerPlace(dangerLevelManage.getDangerPlace());
}
boolean ok = dangerInspectionRecordService.updateById(dangerInspectionRecord);
//TODO 返回false说明什么?
......
......@@ -81,6 +81,9 @@ public class APPDangerInspectionRecordController {
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerLevel())){
queryWrapper.eq("danger_level", dangerInspectionRecord.getDangerLevel() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerPlace())){
queryWrapper.eq("danger_place", dangerInspectionRecord.getDangerPlace() ) ;
}
queryWrapper.orderByDesc("report_date");
// queryWrapper.eq("report_user", BaseContextHandler.getUserId());
IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
......
......@@ -118,4 +118,10 @@ public class DangerInspectionRecord {
@Dict(dicCode = "dangerLevel")
private String dangerLevel;
@ApiModelProperty(value = "风险区域名称")
@Dict(dicCode = "id",dicText = "struct_name",dictTable = "sys_struct_dict")
private String dangerPlace;
}
......
......@@ -49,6 +49,9 @@ public class DangerInspectionRecordVO {
@ApiModelProperty(value = "风险等级")
private String dangerLevel;
@ApiModelProperty(value = "风险区域名称")
private String dangerPlace;
@ApiModelProperty(value = "巡检状态(1:开始,2:结束)")
private String status;
......
......@@ -116,7 +116,7 @@ public class EquipmentCenterController {
Result<IPage<EquipmentNewMaintenancePlanVO>> result = new Result<IPage<EquipmentNewMaintenancePlanVO>>();
Page<EquipmentNewMaintenancePlanVO> pageList = new Page<EquipmentNewMaintenancePlanVO>(pageNo, pageSize);
setDepartIds(reportStatisticsDTO);
pageList = iProductionEquipmentService.getEquipmentStateDetails(pageList, reportStatisticsDTO);
pageList = iProductionEquipmentService.getEquipmentStateDetailsNew(pageList, reportStatisticsDTO);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -69,6 +69,8 @@ public interface ProductionEquipmentMapper {
//分公司获取生产设备总台数详情
List<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetailsBranchOffice(ReportStatisticsDTO reportStatisticsDTO);
public Page<EquipmentNewMaintenancePlanVO> getEquipmentStateDetailsNew(Page<EquipmentNewMaintenancePlanVO> page,@Param("param") ReportStatisticsDTO reportStatisticsDTO);
//厂获取生产设备总台数详情
List<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetailsFactory(ReportStatisticsDTO reportStatisticsDTO);
//厂获取生产设备总台数详情(新)
......
......@@ -153,6 +153,28 @@
order by ccc.category_value1 desc
</select>
<select id="getEquipmentStateDetailsNew" resultType="com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO">
select d.depart_name 'companyName', aaa.* from (
select t.depart_id , ifnull( SUM( CASE WHEN t.finish_flag ='djx' THEN 1 ELSE 0 END ),0) as 'waiting',
ifnull( SUM( CASE WHEN t.finish_flag in ('sbzx','wwwx') THEN 1 ELSE 0 END ),0) as 'repairing'
from equipment_repair t
where t.del_flag = 1
<if test="param.startTime != null ">
and t.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and t.create_time &lt;= #{param.endTime}
</if>
<if test="param.departIds != null ">
and t.depart_id in(${param.departIds})
</if>
group by t.depart_id
)aaa
left join sys_depart d on d.id = aaa.depart_id
order by aaa.waiting desc
</select>
<select id="getLevelByTime" resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO"
......
......@@ -37,7 +37,8 @@ public interface IProductionEquipmentService {
//获取设备状态详情
Page<EquipmentNewMaintenancePlanVO> getEquipmentStateDetails(Page<EquipmentNewMaintenancePlanVO> pageList, ReportStatisticsDTO reportStatisticsDTO);
//获取设备状态详情New
Page<EquipmentNewMaintenancePlanVO> getEquipmentStateDetailsNew(Page<EquipmentNewMaintenancePlanVO> page, ReportStatisticsDTO reportStatisticsDTO) ;
//设备完好率
List<ContrastVO> getEquipmentIntactRate(ReportStatisticsDTO reportStatisticsDTO);
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DoubleOperaUtils;
import com.skua.modules.common.mapper.CommonSqlMapper;
import com.skua.modules.common.service.ICommonSqlService;
import com.skua.modules.equipment.dto.ReportStatisticsDTO;
import com.skua.modules.equipment.mapper.ProductionEquipmentMapper;
......@@ -481,6 +482,9 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
return list;
}
public Page<EquipmentNewMaintenancePlanVO> getEquipmentStateDetailsNew(Page<EquipmentNewMaintenancePlanVO> page, ReportStatisticsDTO reportStatisticsDTO) {
return productionEquipmentMapper.getEquipmentStateDetailsNew(page,reportStatisticsDTO);
}
@Override
public Page<EquipmentNewMaintenancePlanVO> getEquipmentStateDetails(Page<EquipmentNewMaintenancePlanVO> pageList, ReportStatisticsDTO reportStatisticsDTO) {
int n = 0;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!