Commit 1e030a53 authored by 麻笑宇's avatar 麻笑宇

1.检验检测右屏八大类设备检验临期/超期统计下钻查询逻辑修改

parent d70c598c
...@@ -32,4 +32,6 @@ public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTrac ...@@ -32,4 +32,6 @@ public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTrac
Long countByTypeListAndOrgCode(@Param("typeList") List<String> typeList, @Param("orgCode") String orgCode, @Param("mainBody") String mainBody); Long countByTypeListAndOrgCode(@Param("typeList") List<String> typeList, @Param("orgCode") String orgCode, @Param("mainBody") String mainBody);
List<Map<String, Object>> countEquOverdue(@Param("typeList") List<String> typeList,@Param("orgCode") String orgCode); List<Map<String, Object>> countEquOverdue(@Param("typeList") List<String> typeList,@Param("orgCode") String orgCode);
List<String> getSourceId(@Param("orgCode") String orgCode, @Param("typeList") List<String> typeList);
} }
...@@ -221,4 +221,23 @@ ...@@ -221,4 +221,23 @@
GROUP BY GROUP BY
equip_list_code equip_list_code
</select> </select>
<select id="getSourceId" resultType="java.lang.String">
SELECT
source_id sourceId
FROM
tzs_safety_problem_tracing
WHERE
is_delete = '0'
<if test="orgCode != null and orgCode != ''">
and governing_body_org_code like CONCAT(#{orgCode}, '%')
</if>
<if test="typeList != null and typeList.size > 0">
and problem_type in
<foreach collection="typeList" item="type" open="(" separator="," close=")">
#{type}
</foreach>
</if>
and source_type_code = '3'
</select>
</mapper> </mapper>
...@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
...@@ -30,6 +31,7 @@ import org.springframework.stereotype.Service; ...@@ -30,6 +31,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -49,6 +51,9 @@ public class EquipmentStaticsServiceImpl { ...@@ -49,6 +51,9 @@ public class EquipmentStaticsServiceImpl {
private static final String EQUSTATE = "EQU_STATE"; private static final String EQUSTATE = "EQU_STATE";
private static final String SUPERVISORYCODE = "SUPERVISORY_CODE"; private static final String SUPERVISORYCODE = "SUPERVISORY_CODE";
@Resource
private SafetyProblemTracingMapper safetyProblemTracingMapper;
public Map<String, Object> normalChart(DPFilterParamForDetailDto dpFilterParamForDetailDto) { public Map<String, Object> normalChart(DPFilterParamForDetailDto dpFilterParamForDetailDto) {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamForDetailDto.getCityCode()); List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamForDetailDto.getCityCode());
List<Map<String,Object>> result = regionModels.parallelStream().map(r -> { List<Map<String,Object>> result = regionModels.parallelStream().map(r -> {
...@@ -321,8 +326,11 @@ public class EquipmentStaticsServiceImpl { ...@@ -321,8 +326,11 @@ public class EquipmentStaticsServiceImpl {
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime)); boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime));
}else{ }else{
// 查询下次检验日期小于当前天的设备,即为超期检验超期设备 // 查询下次检验日期小于当前天的设备,即为超期检验超期设备
long currentDayTime = DateUtil.parse(DateUtil.now(), "yyy-MM-dd").getTime(); List<String> typeList = new ArrayList<>();
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").lt(currentDayTime)); typeList.add("维保超期");
typeList.add("检验超期");
List<String> sourceIds = safetyProblemTracingMapper.getSourceId(orgCode,typeList);
boolMust.must(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword",sourceIds));
} }
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment