Commit c7f6ab98 authored by tianbo's avatar tianbo

隐患列表添加权限过滤

parent 1ff823de
......@@ -240,6 +240,8 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception {
ReginParams reginParams = getSelectedOrgInfo();
pageParam.put("orgCode", reginParams.getCompany().getOrgCode());
IPage<LatentDanger> result = iLatentDangerService.pageListDanger(pageParam);
return ResponseHelper.buildResponse(result);
}
......@@ -294,6 +296,8 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/list/all")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<List<LatentDanger>> listAllDanger(@RequestBody LatentDangerListParam searchParam) {
ReginParams reginParams = getSelectedOrgInfo();
searchParam.setOrgCode(reginParams.getCompany().getOrgCode());
return ResponseHelper.buildResponse(iLatentDangerService.listAllDanger(searchParam));
}
......@@ -336,6 +340,8 @@ public class LatentDangerController extends BaseController {
@PostMapping(value = "/supervision/page/reviewList")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel reviewListDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) throws Exception {
ReginParams reginParams = getSelectedOrgInfo();
pageParam.put("orgCode", reginParams.getCompany().getOrgCode());
IPage<LatentDanger> result = iLatentDangerService.reviewListDanger(pageParam);
return ResponseHelper.buildResponse(result);
}
......
......@@ -39,4 +39,6 @@ public class LatentDangerListParam extends CommonPageable {
private String userId;
private String dangerIds;
private String orgCode;
}
......@@ -106,11 +106,22 @@ public class PageParam<K, V> extends HashMap<K, V> implements Pageable {
return false;
}
public int getParamCurrent() {
if (!ValidationUtil.isEmpty(this.get("current"))) {
public int getParamPageCurrent() {
if (ValidationUtil.isEmpty(this.get("current"))) {
return current;
}
if (this.get("current") instanceof String && this.get("size") instanceof String) {
if (this.get("current") instanceof String) {
return Integer.parseInt((String) this.get("current"));
} else {
return (Integer)(this.get("current"));
}
}
public int getParamPageSize() {
if (ValidationUtil.isEmpty(this.get("size"))) {
return size;
}
if (this.get("size") instanceof String) {
return Integer.parseInt((String) this.get("current"));
} else {
return (Integer)(this.get("current"));
......
......@@ -49,7 +49,20 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo;
import com.yeejoin.amos.latentdanger.common.enums.*;
import com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerBizTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerOvertimeStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerProcessStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.OwerEnum;
import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWebSocketServer;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWorkFlowService;
......@@ -81,9 +94,17 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
......@@ -107,6 +128,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Autowired
SupervisionFeignClient supervisionFeignClient;
@Autowired
JcsFeignClient jcsFeignClient;
@Autowired
private RemoteWorkFlowService remoteWorkFlowService;
@Autowired
private RemoteSecurityService remoteSecurityService;
......@@ -120,7 +143,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private RemoteSpcService remoteSpcService;
@Autowired
private AsyncTask asyncTask;
// @Autowired
// private Business business;
@Autowired
......@@ -145,14 +167,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private WorkflowExcuteServiceImpl workflowExecuteService;
@Autowired
private WorkflowFeignService workflowFeignService;
// 有启动后执行现场确认的角色名称
@Value("${onSite.confirm.roleName}")
private String onSiteConfirmRole;
@Autowired
JcsFeignClient jcsFeignClient;
@Transactional(rollbackFor = Exception.class)
@Override
public CommonResponse saveNormal(LatentDangerDto latentDangerDto, String userId, String userRealName,
......@@ -1813,18 +1831,17 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!ValidationUtil.isEmpty(dangerIdList)) {
pageParam.put("dangerIds", dangerIdList);
}
Page page = new Page();
initPage(pageParam, page);
if (ValidationUtil.isEmpty(pageParam.get("order"))) {
pageParam.put("order", "1");
}
Page page = new Page(pageParam.getParamPageCurrent(), pageParam.getParamPageSize());
IPage<LatentDanger> iPage = this.baseMapper.selectPageByParam(page, (Map<String, Object>) pageParam);
if (iPage.getCurrent() != pageParam.getParamCurrent()) {
if (iPage.getCurrent() != pageParam.getParamPageCurrent()) {
iPage.setRecords(Lists.newArrayList());
iPage.setTotal(0);
iPage.setCurrent(pageParam.getParamCurrent());
iPage.setCurrent(pageParam.getParamPageCurrent());
return iPage;
}
Map<String, Object> buildingAbsolutePositionMap = new HashMap<>();
......@@ -1865,18 +1882,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return iPage;
}
public void initPage(PageParam pageParam, Page page) {
if (pageParam.get("current") instanceof String && pageParam.get("size") instanceof String) {
int current = Integer.valueOf((String) pageParam.get("current"));
int size = Integer.valueOf((String) pageParam.get("size"));
page.setCurrent(current);
page.setSize(size);
} else {
page.setCurrent((Integer)(pageParam.get("current")));
page.setSize((Integer)(pageParam.get("size")));
}
}
private List<Map<String, Object>> getAllNodes(List<Map<String, Object>> buildingTree) {
List<Map<String, Object>> res = new LinkedList<>();
if (buildingTree != null && !buildingTree.isEmpty()) {
......@@ -1983,6 +1988,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!ValidationUtil.isEmpty(searchParam.getDangerIds())) {
lambdaQueryWrapper.in(LatentDanger::getId, Lists.newArrayList(searchParam.getDangerIds().split(",")));
}
lambdaQueryWrapper.and(o ->
o.likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "*")
.or().likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "-")
.or().eq(LatentDanger::getOrgCode, searchParam.getOrgCode()));
List<LatentDanger> latentDangers = this.baseMapper.selectList(lambdaQueryWrapper);
return latentDangers;
......
......@@ -963,6 +963,10 @@
<where>
deleted = 0
<foreach collection="paramMap" index="key" item="value">
<if test="key == 'orgCode' and value != null and value != ''">
and (a.org_code like concat(#{value}, "*%") or a.org_code like concat(#{value}, "-%") or
a.org_code = #{value})
</if>
<if test="key == 'bizType' and value != null and value != ''">
and a.biz_type = #{value}
</if>
......
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