查询每个不同工程类别的名称、数量
This commit is contained in:
parent
c944acfd3b
commit
34e0c75617
@ -12,6 +12,7 @@ import com.zhgd.xmgl.modules.water.entity.WaterSupplierRecord;
|
||||
import com.zhgd.xmgl.modules.water.mapper.WaterSupplierRecordMapper;
|
||||
import com.zhgd.xmgl.modules.water.service.IWaterMeterRecordDetailService;
|
||||
import com.zhgd.xmgl.modules.water.service.IWaterMeterService;
|
||||
import com.zhgd.xmgl.util.Base64;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -119,7 +120,7 @@ public class CallBackController {
|
||||
QueryWrapper<WaterMeter> ammeterQueryWrapper = new QueryWrapper<>();
|
||||
ammeterQueryWrapper.lambda().eq(WaterMeter::getDeviceId, jsonObject.getString("deviceId"));
|
||||
WaterMeter one = ammeterService.getOne(ammeterQueryWrapper);
|
||||
if (decodeJson.containsKey("hex")) {
|
||||
for (Map.Entry<String, Object> entry : decodeJson.entrySet()) {
|
||||
WaterSupplierRecord waterSupplierRecord = waterSupplierRecordMapper.selectProjectWaterSupplier(one.getProjectSn());
|
||||
WaterMeter waterMeter = new WaterMeter();
|
||||
waterMeter.setId(one.getId());
|
||||
@ -127,7 +128,7 @@ public class CallBackController {
|
||||
ammeterService.updateById(waterMeter);
|
||||
|
||||
|
||||
String strdata = decodeJson.getString("hex");
|
||||
String strdata = Base64.decodeBase64ByHex(String.valueOf(entry.getValue()));
|
||||
String tonnage = strdata.substring(28, 36) + "." + strdata.substring(36, 38);
|
||||
WaterMeterRecordDetail ammeterRecordDetail = new WaterMeterRecordDetail();
|
||||
ammeterRecordDetail.setAddTime(new Date());
|
||||
@ -136,9 +137,10 @@ public class CallBackController {
|
||||
ammeterRecordDetail.setProjectSn(one.getProjectSn());
|
||||
waterMeterRecordDetailService.save(ammeterRecordDetail);
|
||||
|
||||
String tp = MeterUtils.answerDevice(jsonObject.get("deviceId").toString(), "admin", waterSupplierRecord.getSupplierProductId(),
|
||||
waterSupplierRecord.getMasterKey(), waterSupplierRecord.getAppKey(), waterSupplierRecord.getAppSecret(), null, null);
|
||||
log.info(tp);
|
||||
//不需要阀控,不需要回调
|
||||
//String tp = MeterUtils.answerDevice(jsonObject.get("deviceId").toString(), "admin", waterSupplierRecord.getSupplierProductId(),
|
||||
// waterSupplierRecord.getMasterKey(), waterSupplierRecord.getAppKey(), waterSupplierRecord.getAppSecret(), null, null);
|
||||
//log.info(tp);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,5 +82,9 @@ public class MaterialDetectionReport implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateDate;
|
||||
|
||||
@ApiModelProperty(value = "楼层")
|
||||
private String floor;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -91,5 +91,9 @@ public class MaterialDetectionReportQO implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss 结束时间")
|
||||
private String endUpdateDate;
|
||||
|
||||
@ApiModelProperty(value = "楼层")
|
||||
private String floor;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -59,4 +59,9 @@ public class MeasuredRealQuantityVO implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date surveyingDate;
|
||||
/**
|
||||
* 实测实量楼层
|
||||
*/
|
||||
@ApiModelProperty(value = "实测实量楼层")
|
||||
private String floorName;
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@
|
||||
left join zjsj_material_details zmd on zmt.id = zmd.type_id
|
||||
where zmt.project_sn = #{projectSn}
|
||||
group by zmt.id
|
||||
ORDER BY
|
||||
consume_value DESC
|
||||
</select>
|
||||
|
||||
<select id="passConsumeRatio" resultType="com.zhgd.xmgl.modules.material.entity.dto.MaterialDetailsMonthDTO">
|
||||
|
||||
@ -44,7 +44,8 @@ public class MeasuredRealQuantityServiceImpl extends ServiceImpl<MeasuredRealQua
|
||||
Integer measuredRealQuantityNumber = measuredRealQuantity.getMeasuredRealQuantityNumber();
|
||||
Integer qualifiedNumber = measuredRealQuantity.getQualifiedNumber();
|
||||
float qualifiedRatio = NumberUtil.round(qualifiedNumber * 100F / measuredRealQuantityNumber, 2).floatValue();
|
||||
return new MeasuredRealQuantityVO(title, measuredRealQuantityNumber, qualifiedNumber, qualifiedRatio,measuredRealQuantity.getImageUrl(), measuredRealQuantity.getSurveyingDate());
|
||||
return new MeasuredRealQuantityVO(title, measuredRealQuantityNumber, qualifiedNumber, qualifiedRatio,
|
||||
measuredRealQuantity.getImageUrl(), measuredRealQuantity.getSurveyingDate(), measuredRealQuantity.getFloorName());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.async.AsyncProject;
|
||||
import com.zhgd.xmgl.entity.vo.ZwProjectDataVo;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectType;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
@ -294,4 +295,16 @@ public class ProjectController {
|
||||
public Result<ProjectDurationVO> getProjectDuration(String projectSn) {
|
||||
return Result.success(projectService.getProjectDuration(projectSn));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询每个不同工程类别的名称、数量
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询每个不同工程类别的名称、数量", notes = "查询每个不同工程类别的名称、数量", httpMethod = "GET")
|
||||
@GetMapping(value = "/groupBy/projectType")
|
||||
public Result<List<GroupByProjectType>> groupByProjectType(Map<String, Object> map) {
|
||||
return Result.success(projectService.groupByProjectType(map));
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,4 +233,10 @@ public class Project implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "runde平台token")
|
||||
private java.lang.String rundeToken;
|
||||
/**
|
||||
* 自定义的工程类别
|
||||
*/
|
||||
@ApiModelProperty(value = "自定义的工程类别")
|
||||
private java.lang.String customProjectType;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
package com.zhgd.xmgl.modules.project.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GroupByProjectType {
|
||||
private int count;
|
||||
private String customProjectType;
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectType;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -77,4 +78,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
|
||||
* @return 项目工期
|
||||
*/
|
||||
ProjectDurationVO getProjectDuration(String projectSn);
|
||||
|
||||
List<GroupByProjectType> groupByProjectType(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -647,4 +647,13 @@
|
||||
left join project_extend pe on p.project_sn = pe.project_sn
|
||||
where p.project_sn = #{projectSn}
|
||||
</select>
|
||||
<select id="groupByProjectType" resultType="com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectType">
|
||||
SELECT COUNT(p.project_id) AS count,p.custom_project_type
|
||||
FROM
|
||||
`project` p
|
||||
GROUP BY
|
||||
p.custom_project_type
|
||||
HAVING
|
||||
p.custom_project_type is NOT null
|
||||
</select>
|
||||
</mapper>
|
||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.entity.vo.ZwProjectDataVo;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectType;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -61,4 +62,6 @@ public interface IProjectService extends IService<Project> {
|
||||
* @return 项目工期
|
||||
*/
|
||||
ProjectDurationVO getProjectDuration(String projectSn);
|
||||
|
||||
List<GroupByProjectType> groupByProjectType(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ import com.zhgd.xmgl.modules.environment.service.IEnvironmentDevService;
|
||||
import com.zhgd.xmgl.modules.massrebound.service.IFunctionRoomService;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProjectConfig;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectType;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectConfigMapper;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectEnterpriseMapper;
|
||||
@ -494,4 +495,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
||||
return projectDuration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupByProjectType> groupByProjectType(Map<String, Object> map) {
|
||||
List<GroupByProjectType> groupByProjectTypes = projectMapper.groupByProjectType(map);
|
||||
return groupByProjectTypes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.zhgd.xmgl.util;
|
||||
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
|
||||
public class Base64 {
|
||||
private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray();
|
||||
private static byte[] codes = new byte[256];
|
||||
private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray();
|
||||
private static byte[] codes = new byte[256];
|
||||
|
||||
static {
|
||||
for (int i = 0; i < 256; i++)
|
||||
codes[i] = -1;
|
||||
@ -69,14 +72,24 @@ public class Base64 {
|
||||
throw new Error("miscalculated data length!");
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String argc[]){
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* base64转成16进制
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String decodeBase64ByHex(String base64) {
|
||||
//解码
|
||||
byte[] x = java.util.Base64.getDecoder().decode(base64);
|
||||
return Hex.encodeHexString(x);
|
||||
}
|
||||
|
||||
public static void main(String argc[]) {
|
||||
|
||||
|
||||
// String encode = encodeBase64(KeyConstants.MICRO_ADMIN.getBytes());
|
||||
// log.info(encode);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
73
src/main/resources/application-sjjt-gsx.properties
Normal file
73
src/main/resources/application-sjjt-gsx.properties
Normal file
@ -0,0 +1,73 @@
|
||||
#http.port=30250
|
||||
http.port=18070
|
||||
#spring.datasource.url=jdbc:mysql://124.71.178.44:3306/wisdomsite_lgdc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||
#spring.datasource.url=jdbc:mysql://183.60.227.61:20246/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&serverTimezone=UTC
|
||||
#spring.datasource.url=jdbc:mysql://36.137.53.203:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||
#spring.datasource.url=jdbc:mysql://139.9.66.234:3386/wisdomsite_ty?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||
#spring.datasource.url=jdbc:mysql://182.90.224.237:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
#spring.datasource.url=jdbc:mysql://139.9.66.234:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||
spring.datasource.url=jdbc:mysql://116.169.63.183:33061/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
|
||||
#spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V)
|
||||
spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V)
|
||||
server.port=8070
|
||||
#server.port=30246
|
||||
basePath=C:/jxj/prod/backEnd/itbgpImage/
|
||||
server.tomcat.basedir=C:/jxj/prod/backEnd/tempImage/
|
||||
#arcsoft.dllPath=D:/hz/wisdomSite/src/main/resources/dll
|
||||
#basePath=F:/zhgd/itbgpImage/
|
||||
#server.tomcat.basedir=F:/zhgd/tempImage/
|
||||
#arcsoft.dllPath=F:/zhgd/dll
|
||||
arcsoft.dllPath=C:/jxj/prod/backEnd/dll
|
||||
security.enable=false
|
||||
isGetStandardData=false
|
||||
isGetEnvironmentData=false
|
||||
isGetFaceFeatureDate=false
|
||||
#\u6D77\u5EB7\u89C6\u9891\u62A5\u8B66\u56FE\u7247IP\u7AEF\u53E3\u66FF\u6362
|
||||
video.alarm.newUrl=223.82.100.80:6040
|
||||
wx-appid=
|
||||
wx-AppSecret=
|
||||
mqtt-scope=zjsjTopic
|
||||
serverUrl=http://124.71.67.160:8088/
|
||||
#serverUrl=http://182.90.224.237:7000
|
||||
#serverUrl=http://127.0.0.1:6023
|
||||
#\u89C6\u9891\u5206\u6790url
|
||||
video-analysis-url=
|
||||
server.ssl.enabled=false
|
||||
#\u9ED8\u8BA4\u653F\u52A1\u521B\u5EFA\u9879\u76EE\u6240\u5C5E\u4F01\u4E1A
|
||||
defaultZwComapnySn=
|
||||
#\u6587\u4EF6\u5B58\u50A8\u914D\u7F6E
|
||||
#\u9ED8\u8BA4\u4F7F\u7528\u7684\u5B58\u50A8\u5E73\u53F0
|
||||
spring.file-storage.default-platform=local
|
||||
#".min.jpg" #\u7F29\u7565\u56FE\u540E\u7F00\uFF0C\u4F8B\u5982\u3010.min.jpg\u3011\u3010.png\u3011
|
||||
spring.file-storage.thumbnail-suffix=.jpg
|
||||
# \u672C\u5730\u5B58\u50A8\uFF0C\u4E0D\u4F7F\u7528\u7684\u60C5\u51B5\u4E0B\u53EF\u4EE5\u4E0D\u5199
|
||||
# \u5B58\u50A8\u5E73\u53F0\u6807\u8BC6
|
||||
spring.file-storage.local[0].platform=local
|
||||
#\u542F\u7528\u5B58\u50A8
|
||||
spring.file-storage.local[0].enable-storage=true
|
||||
#\u542F\u7528\u8BBF\u95EE\uFF08\u7EBF\u4E0A\u8BF7\u4F7F\u7528 Nginx \u914D\u7F6E\uFF0C\u6548\u7387\u66F4\u9AD8\uFF09
|
||||
spring.file-storage.local[0].enable-access=false
|
||||
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u4F8B\u5982\uFF1A\u201Chttp://127.0.0.1:6023/image/\u201D\uFF0C\u6CE8\u610F\u540E\u9762\u8981\u548C path-patterns \u4FDD\u6301\u4E00\u81F4\uFF0C\u201C/\u201D\u7ED3\u5C3E\uFF0C\u672C\u5730\u5B58\u50A8\u5EFA\u8BAE\u4F7F\u7528\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u65B9\u4FBF\u540E\u671F\u66F4\u6362\u57DF\u540D
|
||||
spring.file-storage.local[0].domain=
|
||||
# \u5B58\u50A8\u5730\u5740
|
||||
spring.file-storage.local[0].base-path=C:/jxj/prod/backEnd/itbgpImage/
|
||||
# \u8BBF\u95EE\u8DEF\u5F84\uFF0C\u5F00\u542F enable-access \u540E\uFF0C\u901A\u8FC7\u6B64\u8DEF\u5F84\u53EF\u4EE5\u8BBF\u95EE\u5230\u4E0A\u4F20\u7684\u6587\u4EF6
|
||||
spring.file-storage.local[0].path-patterns=
|
||||
spring.file-storage.aliyun-oss[0].platform=aliyun-oss
|
||||
spring.file-storage.aliyun-oss[0].enable-storage=false
|
||||
spring.file-storage.aliyun-oss[0].access-key=
|
||||
spring.file-storage.aliyun-oss[0].secret-key=
|
||||
spring.file-storage.aliyun-oss[0].end-point=
|
||||
spring.file-storage.aliyun-oss[0].bucket-name=
|
||||
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u6CE8\u610F\u201C/\u201D\u7ED3\u5C3E\uFF0C\u4F8B\u5982\uFF1Ahttps://abc.oss-cn-shanghai.aliyuncs.com/
|
||||
spring.file-storage.aliyun-oss[0].domain=
|
||||
spring.file-storage.aliyun-oss[0].base-path=
|
||||
# admin\u4E2D\u5BF9\u5E94\u7684\u5730\u5740\u53CA\u5B9E\u4F8B\u540D
|
||||
spring.boot.admin.client.instance.service-url=http://localhost:18070
|
||||
spring.boot.admin.client.instance.name=zjsj
|
||||
# \u6C34\u7535\u6570\u636E\u63A8\u9001\u5730\u5740
|
||||
double-carbon.water-data-url=http://test.cesms.net
|
||||
double-carbon.ammeter-data-url=http://test.cesms.net
|
||||
license.licensePath=C:/jxj/prod/backEnd/license/license.lic
|
||||
license.publicKeysStorePath=C:/jxj/prod/backEnd/license/publicCerts.keystore
|
||||
Loading…
x
Reference in New Issue
Block a user