Commit 0c325b95 authored by suhuiguang's avatar suhuiguang

1.需求变更-792

维保项-需求变更,增加字段所在建筑及详情位置及约束
parent a1911118
......@@ -43,15 +43,18 @@ public class RoutePointRespone {
private String equipmentName;
public String getAddress() {
return address;
}
/**
* 具体位置:buildName + address
*/
private String position;
public void setAddress(String address) {
this.address = address;
public String getPosition() {
return position;
}
private String address;
public void setPosition(String position) {
this.position = position;
}
private int orderNo;
......
......@@ -105,28 +105,6 @@ public class PointController extends AbstractBaseController {
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增移动巡检点(<font color='blue'>手机app</font>)", notes = "新增移动巡检点(<font color='blue'>手机app</font>)")
@PostMapping(value = "/addMovePoint", produces = "application/json;charset=UTF-8")
public CommonResponse addMovePoint(@RequestBody MovePointParam param) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
//点归属于公司
param.setOrgCode(loginOrgCode);
param.setCreatorId(user.getUserId());
iPointService.addMovePoint(param);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检点新增失败");
}
}
/**
* 删除巡检点
*
......@@ -593,83 +571,6 @@ public class PointController extends AbstractBaseController {
}
/**
* 设置巡检点巡检模式
*
* @param pointId
* @param isOffine
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "设置巡检点巡检模式", notes = "设置巡检点巡检模式")
@PostMapping(value = "/setPatrolMode", produces = "application/json;charset=UTF-8")
public CommonResponse setPatrolMode(@ApiParam(value = "巡检点id", required = true) @RequestParam Long pointId,
@ApiParam(value = "是否开启离线模式", required = true) @RequestParam Boolean isOffine) {
try {
Point point = iPointService.setPatrolMode(pointId, isOffine);
if (ObjectUtils.isEmpty(point)) {
return CommonResponseUtil.failure("该巡检点不存在");
}
return CommonResponseUtil.success(point);
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("绑卡失败");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询用户权限点信息饼图(<font color='blue'>手机app</font>)", notes = "查询用户权限点信息饼图(<font color='blue'>手机app</font>)")
@GetMapping(value = "/queryPointPie", produces = "application/json;charset=UTF-8")
public CommonResponse queryPointPie() {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("orgCode", loginOrgCode);
HashMap<String, Object> response = iPointService.queryPointPie(params);
return CommonResponseUtil.success(response);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询用户权限点信息柱状图(<font color='blue'>手机app</font>)", notes = "查查询用户权限点信息柱状图(<font color='blue'>手机app</font>)")
@GetMapping(value = "/queryPointHistogram", produces = "application/json;charset=UTF-8")
public CommonResponse queryPointHistogram() {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("orgCode", loginOrgCode);
List<HashMap<String, Object>> response = iPointService.queryPointHistogram(params);
//安全处里
if (response != null && response.size() > 0) {
//获取部门名称
String userIds = "";
Set<String> set = new HashSet<>();
response.forEach(s -> {
if (!"其他".equals(s.get("departmentName") + "")) {
set.add(s.get("departmentName").toString());
}
});
List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1);
List<LinkedHashMap> listd = remoteSecurityService.listDepartmentByDeptIds(getToken(), getProduct(), getAppKey(), userIds);
Map<String, String> deptMap = new HashMap<String, String>();
if (listd != null && listd.size() > 0) {
for (int i = 0; i < listd.size(); i++) {
deptMap.put(listd.get(i).get("sequenceNbr").toString(), listd.get(i).get("departmentName").toString());
}
}
//新安全
response.forEach(s -> {
if (!"其他".equals(s.get("departmentName") + "")) {
s.put("departmentName", deptMap.get(s.get("departmentName") + ""));
}
});
}
return CommonResponseUtil.success(response);
}
/**
* 查询巡检点信息
*
* @param point
......@@ -703,55 +604,6 @@ public class PointController extends AbstractBaseController {
}
}
/**
* 离线点信息同步
*
* @param startTime
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询离线点信息", notes = "查询离线点信息")
@GetMapping(value = "/queryLeavelPoint", produces = "application/json;charset=UTF-8")
public CommonResponse queryLeavelPoint(@ApiParam(value = "数据同步开始时间(不传为全部同步)", required = false) @RequestParam(required = false) String startTime) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
if (ObjectUtils.isEmpty(reginParams)) {
return CommonResponseUtil.failure("用户session过期");
}
return CommonResponseUtil.success(iPointService.queryLeavelPoint(getToken(), getProduct(), getAppKey(), loginOrgCode, startTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询点信息json", notes = "查询点信息json")
@GetMapping(value = "/getPointConfigJson", produces = "application/json;charset=UTF-8")
public CommonResponse getPointConfigJson() {
return CommonResponseUtil.success(iPointService.getPointConfigDom());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询点信息xml", notes = "查询点信息xml")
@GetMapping(value = "/getPointConfigDom", produces = MediaType.APPLICATION_XML_VALUE)
public List<PointResponse> getPointConfigDom() {
return iPointService.getPointConfigDom();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出IEC104点位表", notes = "导出IEC104点位表")
@PostMapping(value = "/exportPoint/iec", produces = "application/json;charset=UTF-8")
public CommonResponse exportIecPoint(HttpServletResponse response) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String fileName = "巡检点点位"; //模板名称
List<Map<String, Object>> list = iPointService.queryAllPointConfig(loginOrgCode);
try {
FileHelper.exportExcel(list, fileName, response);
} catch (Exception e) {
CommonResponseUtil.failure(e.getMessage());
}
return CommonResponseUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新*巡检点筛选分页列表", notes = "新*巡检点筛选分页列表")
......
......@@ -26,9 +26,9 @@ public class PointDto {
private String equipmentName;
/**
* 位置
* 具体位置:buildName + address
*/
private String address;
private String position;
/**
......
......@@ -353,6 +353,9 @@ public class PointServiceImpl implements IPointService {
PointVo pointVo = new PointVo();
BeanUtils.copyProperties(point, pointVo);
pointVo.setInputItemNum(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).count());
String buildingName = StringUtil.isNotEmpty(point.getBuildingName()) ? point.getBuildingName() : "";
String address = StringUtil.isNotEmpty(point.getAddress()) ? point.getAddress() : "";
pointVo.setPosition(buildingName + address);
pointVoList.add(pointVo);
}
Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort());
......@@ -1157,6 +1160,9 @@ public class PointServiceImpl implements IPointService {
PointDto pointDto = new PointDto();
BeanUtils.copyProperties(point, pointDto);
pointDto.setPointInputItems(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).collect(Collectors.toList()));
String buildingName = StringUtil.isNotEmpty(point.getBuildingName()) ? point.getBuildingName() : "";
String address = StringUtil.isNotEmpty(point.getAddress()) ? point.getAddress() : "";
pointDto.setPosition(buildingName + address);
pointDtos.add(pointDto);
}
Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort());
......
......@@ -22,7 +22,17 @@ public class PointVo {
private Date createDate;
public Date getCreateDate() {
private String originalId;
public String getOriginalId() {
return originalId;
}
public void setOriginalId(String originalId) {
this.originalId = originalId;
}
public Date getCreateDate() {
return createDate;
}
......@@ -48,10 +58,36 @@ public class PointVo {
private String equipmentName;
/**
* 建筑名称
*/
private String buildingName;
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
/**
* 位置
*/
private String address;
/**
* 具体位置:buildName + address
*/
private String position;
public String getAddress() {
return address;
}
......
......@@ -242,7 +242,7 @@
(SELECT GROUP_CONCAT(name SEPARATOR ';') FROM p_point_classify WHERE point_id = p.id GROUP BY point_id) classifyName,
p.belong_system_name,
p.equipment_name,
p.address,
concat_ws('',ifnull(p.building_name,''),ifnull(p.address,'')) as position,
(select count(1) from p_route_point_item rpi where rpi.route_point_id = rp.id) as routePointItemNum
FROM
p_route_point rp
......
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