Commit 7b958595 authored by zhangsen's avatar zhangsen

bug修改

parent e92810c8
package com.yeejoin.amos.boot.module.jxiop.api.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(name = "${amos.idx.name:AMOS-IDX}", path = "idx", configuration = {FeignConfiguration.class})
public interface IdxFeign {
/**
* 根据风险来源查询人员红黄绿吗信息
*/
@GetMapping("/jxIopAnalysis/healthIndexData")
FeignClientResult<Map<String, Object>> healthIndexData(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(required = false, value = "stationType") String stationType);
}
...@@ -20,4 +20,10 @@ public interface McbWarningFeign { ...@@ -20,4 +20,10 @@ public interface McbWarningFeign {
FeignClientResult<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode, FeignClientResult<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(value = "warningObjectType") String warningObjectType); @RequestParam(value = "warningObjectType") String warningObjectType);
/**
* 根据风险来源查询人员红黄绿吗信息
*/
@GetMapping("/task/getWarningInfoCountByObjectId")
FeignClientResult<Integer> getWarningInfoCountByObjectId(@RequestParam(value = "code") String code);
} }
...@@ -174,7 +174,8 @@ ...@@ -174,7 +174,8 @@
update update
`station_basic` `station_basic`
set set
`qrcode_color` = #{item.qrcodeColor} `qrcode_color` = #{item.qrcodeColor},
rec_date = now()
where where
project_org_code = #{item.code} project_org_code = #{item.code}
</foreach> </foreach>
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum; import com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.feign.IdxFeign;
import com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign; import com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl;
...@@ -46,6 +50,14 @@ public class PersonQrCodeController extends BaseController { ...@@ -46,6 +50,14 @@ public class PersonQrCodeController extends BaseController {
@Autowired @Autowired
private SjglZsjZsbtzMapper sjglZsjZsbtzMapper; private SjglZsjZsbtzMapper sjglZsjZsbtzMapper;
@Autowired
private IdxFeign idxFeign;
@Autowired
private StationBasicMapper stationBasicMapper;
/** /**
* 评估大屏 - 人员赋码环形图查询 * 评估大屏 - 人员赋码环形图查询
* *
...@@ -209,4 +221,90 @@ public class PersonQrCodeController extends BaseController { ...@@ -209,4 +221,90 @@ public class PersonQrCodeController extends BaseController {
return Math.abs(multiply.doubleValue()); return Math.abs(multiply.doubleValue());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getStationDetailInfo")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站信息查询", notes = "评估大屏 - 场站信息查询")
public ResponseModel<Map<String, Object>> getStationDetailInfo(@RequestParam(required = true, value = "parentCode") String parentCode) {
FeignClientResult<Map<String, Object>> sevenEntity = null;
try {
sevenEntity = idxFeign.healthIndexData(parentCode, null);
} catch (Exception e) {
e.printStackTrace();
}
FeignClientResult<Integer> sevenEntityMcb = null;
try {
sevenEntityMcb = mcbWarningFeign.getWarningInfoCountByObjectId(parentCode);
} catch (Exception e) {
e.printStackTrace();
}
String score = "100";
String gradeColor = "green";
Integer warningCount = 0;
if (sevenEntity != null && 200 == sevenEntity.getStatus()) {
Map<String, Object> result = sevenEntity.getResult();
score = result.get("score").toString();
gradeColor = result.get("gradeColor").toString();
}
if (sevenEntityMcb != null && 200 == sevenEntityMcb.getStatus()) {
warningCount = sevenEntityMcb.getResult();
}
HashMap<String, Object> map = new HashMap<>();
map.put("score", score);
map.put("gradeColor", gradeColor);
map.put("warningCount", warningCount);
LambdaQueryWrapper<StationBasic> stationBasicLambdaQueryWrapper = new LambdaQueryWrapper<>();
stationBasicLambdaQueryWrapper.eq(StationBasic::getProjectOrgCode, parentCode);
stationBasicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(stationBasicLambdaQueryWrapper);
map.put("stationMasterName", stationBasic.getStationMasterName());
map.put("mobilePhone", stationBasic.getMobilePhone());
map.put("recDate", stationBasic.getRecDate());
return ResponseHelper.buildResponse(map);
}
//
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @GetMapping(value = "/getStationDetailInfo")
// @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站信息查询", notes = "评估大屏 - 场站信息查询")
// public ResponseModel<Map<String, Object>> getStationEquipInfo(@RequestParam(required = true, value = "parentCode") String parentCode,
// @RequestParam(required = false, value = "column") String column) {
// FeignClientResult<Map<String, Object>> sevenEntity = null;
// try {
// sevenEntity = idxFeign.healthIndexData(parentCode, null);
// } catch (Exception e) {
// e.printStackTrace();
// }
// FeignClientResult<Integer> sevenEntityMcb = null;
// try {
// sevenEntityMcb = mcbWarningFeign.getWarningInfoCountByObjectId(parentCode);
// } catch (Exception e) {
// e.printStackTrace();
// }
// String score = "100";
// String gradeColor = "green";
// Integer warningCount = 0;
// if (sevenEntity != null && 200 == sevenEntity.getStatus()) {
// Map<String, Object> result = sevenEntity.getResult();
// score = result.get("score").toString();
// gradeColor = result.get("gradeColor").toString();
// }
// if (sevenEntityMcb != null && 200 == sevenEntityMcb.getStatus()) {
// warningCount = sevenEntityMcb.getResult();
// }
// HashMap<String, Object> map = new HashMap<>();
// map.put("score", score);
// map.put("gradeColor", gradeColor);
// map.put("warningCount", warningCount);
// LambdaQueryWrapper<StationBasic> stationBasicLambdaQueryWrapper = new LambdaQueryWrapper<>();
// stationBasicLambdaQueryWrapper.eq(StationBasic::getProjectOrgCode, parentCode);
// stationBasicLambdaQueryWrapper.last("limit 1");
// StationBasic stationBasic = stationBasicMapper.selectOne(stationBasicLambdaQueryWrapper);
// map.put("stationMasterName", stationBasic.getStationMasterName());
// map.put("mobilePhone", stationBasic.getMobilePhone());
// map.put("recDate", stationBasic.getRecDate());
// return ResponseHelper.buildResponse(map);
// }
} }
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where> <where>
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%') b.ORG_CODE like concat(#{parentCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
......
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