物机管理大屏服务封装
parent
5b5b506f4e
commit
a84942cb55
|
@ -12,6 +12,7 @@ import aiWarning from "./aiWarning";
|
|||
import planSchedule from "./planSchedule";
|
||||
import labor from "./labor";
|
||||
import bim from "./bim"
|
||||
import machMater from './machmater'
|
||||
export default {
|
||||
http: axios,
|
||||
downFile: download,
|
||||
|
@ -28,4 +29,5 @@ export default {
|
|||
planSchedule,
|
||||
labor,
|
||||
bim,
|
||||
machMater
|
||||
};
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
const machGetManageQuota=(projectId)=>{
|
||||
return request({
|
||||
url: '/manage/bgscreen/machMater/machGetManageQuota',
|
||||
method: 'get',
|
||||
params: {
|
||||
projectId: projectId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//时间段内工号申领情况
|
||||
const materGetConcreteMaterialActQuantityBuildingNoInfoService=data=>{
|
||||
return request({
|
||||
url: '/manage/bgscreen/machMater/materGetConcreteMaterialActQuantityBuildingNoInfoService',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export default{
|
||||
machGetManageQuota,
|
||||
materGetConcreteMaterialActQuantityBuildingNoInfoService
|
||||
}
|
|
@ -8,14 +8,9 @@
|
|||
<module-one-1-1 label="设备运行动态" class="labor-base"> </module-one-1-1>
|
||||
</el-col>
|
||||
<el-col :span="12" class="h100">
|
||||
<module-one-2-2 label="项目设备分布总览" class="h77"> </module-one-2-2>
|
||||
|
||||
<module-one-2-2 label="项目设备分布总览" class="h77">
|
||||
|
||||
</module-one-2-2>
|
||||
|
||||
<module-one-2-1 label class="no-title no-border h22">
|
||||
|
||||
</module-one-2-1>
|
||||
<module-one-2-1 label class="no-title no-border h22"> </module-one-2-1>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6" class="h100">
|
||||
|
@ -30,18 +25,16 @@
|
|||
|
||||
<script>
|
||||
import debounce from "lodash.debounce";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dpi: "",
|
||||
selProject: null,
|
||||
apiPath:'//jzgj.crfeb.com.cn'
|
||||
apiPath: "//jzgj.crfeb.com.cn",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//物资:https://wzxh.crfeb.com.cn/
|
||||
//机械:https://jzgj.crfeb.com.cn/
|
||||
this.$store.dispatch("ChangeNav", 801);
|
||||
this.$bus.$on(
|
||||
"projectChange",
|
||||
|
@ -68,19 +61,12 @@ export default {
|
|||
this.chartKey++;
|
||||
},
|
||||
init() {
|
||||
let url='//jzgj.crfeb.com.cn/largeScreen/digitalConstruction/getManageQuota'
|
||||
request({
|
||||
url:url,
|
||||
method:"post",
|
||||
data:{
|
||||
deptId:1,
|
||||
projectId:1,
|
||||
app_key:'',
|
||||
app_secret:''
|
||||
}
|
||||
}).then(d=>{
|
||||
console.log("====>",d)
|
||||
})
|
||||
if (!this.selProject) {
|
||||
return;
|
||||
}
|
||||
this.$api.machMater.machGetManageQuota(this.selProject.id).then((d) => {
|
||||
console.log("====>", d);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -49,18 +49,16 @@ export default {
|
|||
this.chartKey++;
|
||||
},
|
||||
init() {
|
||||
let url='//wzxh.crfeb.com.cn/MklBaseController/getService'
|
||||
request({
|
||||
url,
|
||||
method:"get",
|
||||
params:{
|
||||
userId:'8401',
|
||||
chinaKey:'135f90b1bdafccab494a937eaccdedac',
|
||||
service:'getProjectChaoHaoStatisticsRPTService',
|
||||
projectId:'547d4de15da511ee9ca5506b4b2ac6ae'
|
||||
}
|
||||
}).then(d=>{
|
||||
console.log("---->",d)
|
||||
if (!this.selProject) {
|
||||
return;
|
||||
}
|
||||
let data={
|
||||
projectId:this.selProject.id,
|
||||
startTime:this.$dt("2025-01-01").format("YYYY-MM-DD HH:mm:ss"),
|
||||
endTime:this.$dt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
||||
}
|
||||
this.$api.machMater.materGetConcreteMaterialActQuantityBuildingNoInfoService(data).then(d=>{
|
||||
console.log("====>",d)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
|
@ -7,6 +7,18 @@
|
|||
<artifactId>yanzhu-common</artifactId>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>10</source>
|
||||
<target>10</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yanzhu-common-core</artifactId>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.common.core.utils.http;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.constant.Constants;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -377,4 +378,28 @@ public class HttpUtils
|
|||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 JSON 对象转换为 GET 请求参数
|
||||
* @param json JSON 对象
|
||||
* @return GET 请求参数
|
||||
*/
|
||||
public static String jsonToGetParams(JSONObject json) {
|
||||
if (json == null || json.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder params = new StringBuilder();
|
||||
for (Map.Entry<String, Object> entry : json.entrySet()) {
|
||||
if (params.length() > 0) {
|
||||
params.append("&");
|
||||
}
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue() != null ? entry.getValue().toString() : "";
|
||||
// 对键值进行 URL 编码
|
||||
params.append(URLEncoder.encode(key, StandardCharsets.UTF_8))
|
||||
.append("=")
|
||||
.append(URLEncoder.encode(value, StandardCharsets.UTF_8));
|
||||
}
|
||||
return params.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 考勤配置Mapper接口
|
||||
|
@ -58,4 +59,9 @@ public interface AttendanceCfgMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceCfgByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取物机管理配置
|
||||
*/
|
||||
String getMachMaterCfg(@Param("projectId") Long projectId,@Param("cfgType") String cfgType);
|
||||
}
|
||||
|
|
|
@ -117,4 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getMachMaterCfg" resultType="String">
|
||||
select param_data from pro_machmater_config where project_id=#{projectId} and cfg_type=#{cfgType} LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,293 @@
|
|||
package com.yanzhu.manage.controller.bigscreen;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.utils.http.HttpUtils;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.manage.service.*;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.internal.http2.Http2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/bgscreen/machMater")
|
||||
public class MachMaterController extends BaseController {
|
||||
|
||||
public Map<String, Object> getConfig(Long projectId, String cfgType) throws Exception {
|
||||
String param = attendanceCfgService.getMachMaterCfg(projectId, cfgType);
|
||||
if (StringUtils.isEmpty(param)) {
|
||||
throw new RuntimeException("请在后台进行物机配置");
|
||||
}
|
||||
JSONObject paramJson = JSONObject.parseObject(param);
|
||||
String url = paramJson.getString("url");
|
||||
if (StringUtils.isEmpty(url)) {
|
||||
throw new RuntimeException("请在后台进行物机配置");
|
||||
}
|
||||
paramJson.remove("url");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("url", url);
|
||||
map.put("obj", paramJson);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IAttendanceCfgService attendanceCfgService;
|
||||
|
||||
/**
|
||||
* 机智管家-管理指标
|
||||
*/
|
||||
@GetMapping("/machGetManageQuota")
|
||||
public AjaxResult machGetManageQuota(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getManageQuota";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-设备概况
|
||||
*/
|
||||
@GetMapping("/machGetEquipmentOverview")
|
||||
public AjaxResult machGetEquipmentOverview(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getEquipmentOverview";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 机智管家-操作证情况
|
||||
*/
|
||||
@GetMapping("/machGetCertInfoData")
|
||||
public AjaxResult machGetCertInfoData(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getCertInfoData";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-机械地图数据
|
||||
*/
|
||||
@GetMapping("/machSelectMachineMapData")
|
||||
public AjaxResult machSelectMachineMapData(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/selectMachineMapData";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-获取地图项目列表
|
||||
*/
|
||||
@GetMapping("/machGetMapData")
|
||||
public AjaxResult machGetMapData(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getMapData";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-分类及工时情况
|
||||
*/
|
||||
@GetMapping("/machGetClassifyWorks")
|
||||
public AjaxResult machGetClassifyWorks(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getClassifyWorks";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-监控预警
|
||||
*/
|
||||
@GetMapping("/machGetClockInException")
|
||||
public AjaxResult machGetClockInException(Long projectId, int pageSize) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getClockInException";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
paramJson.put("pageSize", pageSize);
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 机智管家-根据项目获取设备信息
|
||||
*/
|
||||
@GetMapping("/machGetDeviceInfoByProjectId")
|
||||
public AjaxResult machGetDeviceInfoByProjectId(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getDeviceInfoByProjectId";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 机智管家-获取异常预警
|
||||
*/
|
||||
@GetMapping("/machGetExceptionAlert")
|
||||
public AjaxResult machGetExceptionAlert(Long projectId, int size) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mach");
|
||||
String url = map.get("url").toString();
|
||||
url += "/largeScreen/digitalConstruction/getExceptionAlert";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
paramJson.put("size", size);
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String result = httpUtils.sendJSONPost(url, paramJson.toString(), null);
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 材料销号制-获取工号信息
|
||||
*/
|
||||
@GetMapping("/materGetConcreteMaterialActQuantityGhInfoService")
|
||||
public AjaxResult materGetConcreteMaterialActQuantityGhInfoService(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
|
||||
paramJson.put("service", "getConcreteMaterialActQuantityGhInfoService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 材料销号制-时间段内工号申领情况
|
||||
*/
|
||||
@GetMapping("/materGetConcreteMaterialActQuantityBuildingNoInfoService")
|
||||
public AjaxResult materGetConcreteMaterialActQuantityBuildingNoInfoService(Long projectId, String startTime, String endTime) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
if (StringUtils.isNotEmpty(startTime)) {
|
||||
paramJson.put("startTime", startTime);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(endTime)) {
|
||||
paramJson.put("endTime", endTime);
|
||||
}
|
||||
paramJson.put("service", "getConcreteMaterialActQuantityBuildingNoInfoService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 材料销号制-获取用量情况统计服务
|
||||
*/
|
||||
@GetMapping("/materGetProjectChaoHaoStatisticsRPTService")
|
||||
public AjaxResult materGetProjectChaoHaoStatisticsRPTService(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
|
||||
paramJson.put("service", "getProjectChaoHaoStatisticsRPTService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料销号制-获取超耗原因分析(混凝土)
|
||||
*/
|
||||
@GetMapping("/materGetReportConcreteExceedReasonService")
|
||||
public AjaxResult materGetReportConcreteExceedReasonService(Long projectId) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
|
||||
paramJson.put("service", "getReportConcreteExceedReasonService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取超耗率top5材料(混凝土)
|
||||
*/
|
||||
@GetMapping("/materGetReportConcreteExceedMaterielTopService")
|
||||
public AjaxResult materGetReportConcreteExceedMaterielTopService(Long projectId, int top) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
|
||||
paramJson.put("service", "getReportConcreteExceedMaterielTopService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
if (top < 1) {
|
||||
top = 5;
|
||||
}
|
||||
paramJson.put("top", top);
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料销号制-今日申领工单
|
||||
*/
|
||||
@GetMapping("/materGetConcreteOrderDetailsInfoService")
|
||||
public AjaxResult materGetConcreteOrderDetailsInfoService(Long projectId, String startTime, String endTime) throws Exception {
|
||||
Map<String, Object> map = getConfig(projectId, "mater");
|
||||
String url = map.get("url").toString();
|
||||
url += "/MklBaseController/getService";
|
||||
JSONObject paramJson = (JSONObject) map.get("obj");
|
||||
if (StringUtils.isNotEmpty(startTime)) {
|
||||
paramJson.put("startTime", startTime);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(endTime)) {
|
||||
paramJson.put("endTime", endTime);
|
||||
}
|
||||
paramJson.put("service", "getConcreteOrderDetailsInfoService");
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String result = httpUtils.sendGet(url, HttpUtils.jsonToGetParams(paramJson));
|
||||
return AjaxResult.success(JSONObject.parseObject(result));
|
||||
}
|
||||
|
||||
}
|
|
@ -58,4 +58,9 @@ public interface IAttendanceCfgService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceCfgById(Long id);
|
||||
|
||||
/**
|
||||
* 获取物机管理配置
|
||||
*/
|
||||
String getMachMaterCfg(Long projectId, String cfgType);
|
||||
}
|
||||
|
|
|
@ -104,4 +104,12 @@ public class AttendanceCfgServiceImpl implements IAttendanceCfgService
|
|||
{
|
||||
return attendanceCfgMapper.deleteAttendanceCfgById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物机管理配置
|
||||
*/
|
||||
@Override
|
||||
public String getMachMaterCfg(Long projectId, String cfgType) {
|
||||
return attendanceCfgMapper.getMachMaterCfg(projectId,cfgType);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue