Commit ac0b0a6f authored by 曹盼盼's avatar 曹盼盼

修改显隐规则

parent 388affa8
...@@ -196,7 +196,7 @@ public class ESAlertCalledService { ...@@ -196,7 +196,7 @@ public class ESAlertCalledService {
tempQb.must(tempQb1); tempQb.must(tempQb1);
boolMust.should(tempQb); boolMust.should(tempQb);
} }
// 使用单位名称一致;&& ②警情类别一致;&& ③报警时间:距离当前时间不超过两小时的 // 使用单位名称一致;&& ②警情类别一致;&& ③完成状态:未完成
if (!ValidationUtil.isEmpty(alertCalled.getUseUnit()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) ) { if (!ValidationUtil.isEmpty(alertCalled.getUseUnit()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) ) {
flag = false; flag = false;
BoolQueryBuilder qb0 = QueryBuilders.boolQuery(); BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
......
package com.yeejoin.amos.boot.module.ugp.api.dto; package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company; import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
...@@ -126,4 +127,7 @@ public class ProjectDto extends BaseDto { ...@@ -126,4 +127,7 @@ public class ProjectDto extends BaseDto {
*/ */
@TableField("latitude") @TableField("latitude")
private String latitude; private String latitude;
private String userId;
private String context;
} }
...@@ -19,33 +19,39 @@ ...@@ -19,33 +19,39 @@
</select> </select>
<select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto"> <select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto">
select * from tz_ugp_project select
pt.*,
pg.context AS context
from tz_ugp_project pt
left join
tz_ugp_project_initiation_log pg
on pt.instance_id=pg.instance_id
<where> <where>
<if test="roleName == '建设单位'"> <if test="roleName == '建设单位'">
and construction_unit_id = #{companyId} and pt.construction_unit_id = #{companyId}
</if> </if>
<if test="roleName == '安装单位'"> <if test="roleName == '安装单位'">
and installation_unit_id = #{companyId} and pt.installation_unit_id = #{companyId}
</if> </if>
<if test="roleName == '设计单位'"> <if test="roleName == '设计单位'">
and design_unit_id = #{companyId} and pt.design_unit_id = #{companyId}
</if> </if>
<if test="codes != null and codes.size > 0"> <if test="codes != null and codes.size > 0">
<if test="roleName == '监察部门' or roleName == '监检机构'"> <if test="roleName == '监察部门' or roleName == '监检机构'">
and install_region_code in and pt.install_region_code in
<foreach collection="codes" item = "item" index="index" open="(" separator="," close=")"> <foreach collection="codes" item = "item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</if> </if>
<if test="project.name != '' and project.name != null"> <if test="project.name != '' and project.name != null">
and `name` like concat('%',#{project.name},'%') and pt.`name` like concat('%',#{project.name},'%')
</if> </if>
<if test="project.constructionUnit != '' and project.constructionUnit != null"> <if test="project.constructionUnit != '' and project.constructionUnit != null">
and `construction_Unit` like concat('%',#{project.constructionUnit},'%') and pt.`construction_Unit` like concat('%',#{project.constructionUnit},'%')
</if> </if>
</where> </where>
order by rec_date desc order by pt.rec_date desc
</select> </select>
<select id="projectScheduleSuperviseName" resultType="String"> <select id="projectScheduleSuperviseName" resultType="String">
......
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant; import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
...@@ -19,6 +20,9 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper; ...@@ -19,6 +20,9 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectService; import com.yeejoin.amos.boot.module.ugp.api.service.IProjectService;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -351,11 +355,50 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -351,11 +355,50 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
List<ProjectDto> projects = page.getRecords(); List<ProjectDto> projects = page.getRecords();
for(ProjectDto projectDto:projects){ for(ProjectDto projectDto:projects){
getProjectState(projectDto); getProjectState(projectDto);
} }
List<ProjectDto> projectDtoList = getPage(projects);
page.setRecords(projectDtoList);
return page; return page;
} }
public List<ProjectDto> getPage(List<ProjectDto> projects){
ArrayList<ProjectDto> list = Lists.newArrayList();
for(ProjectDto projectDto:projects){
if (ProjectInitiationEnum.监检员分配.getName().equals(projectDto.getStatus())) {
if (!ValidationUtil.isEmpty(projectDto.getContext()) && JSONObject.parseObject(projectDto.getContext()).containsKey("insDepId")) {
String insDepId = JSONObject.parseObject(projectDto.getContext()).getString("insDepId");
if (!ValidationUtil.isEmpty(insDepId)) {
Map map = orgService.getdetialInfo(insDepId);
String fieldValue = (String)map.get("charge");
OrgUsr orgUsr = orgService.getOrgUsrById(fieldValue);
FeignClientResult<List<AgencyUserModel>> listFeignClientResult = Privilege.agencyUserClient.queryByRealName(orgUsr.getBizOrgName());
List<AgencyUserModel> resultList = listFeignClientResult.getResult();
for (AgencyUserModel agencyUserModel : resultList) {
String userId=agencyUserModel.getUserId();
projectDto.setUserId(userId);
}
}
}
list.add(projectDto);
}else if (!ValidationUtil.isEmpty(projectDto.getContext()) && ProjectInitiationEnum.监检员审核.getName().equals(projectDto.getStatus())) {
if (JSONObject.parseObject(projectDto.getContext()).containsKey("insPerson")) {
String insPerson = JSONObject.parseObject(projectDto.getContext()).getString("insPerson");
if (!ValidationUtil.isEmpty(insPerson)) {
FeignClientResult<List<AgencyUserModel>> listFeignClientResult = Privilege.agencyUserClient.queryByRealName(insPerson);
List<AgencyUserModel> resultList = listFeignClientResult.getResult();
for (AgencyUserModel agencyUserModel : resultList) {
String userId=agencyUserModel.getUserId();
projectDto.setUserId(userId);
}
}
}
list.add(projectDto);
} else {
list.add(projectDto);
}
}
return list;
}
@BusinessIdentify @BusinessIdentify
public List<Map<String, String>> projectSchedule() { public List<Map<String, String>> projectSchedule() {
List<Project> projectList = projectResourceService.getProjectList(); List<Project> projectList = projectResourceService.getProjectList();
......
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