Commit c5425d26 authored by 梁光意's avatar 梁光意

Merge remote-tracking branch 'remotes/origin/develop' into develop-fix

# Conflicts: # src/main/resources/application-dev.yml # src/main/resources/application-local.yml
parents 05c8e84e b0407853
...@@ -39,7 +39,7 @@ public class BusinessConfigController extends BaseRestController{ ...@@ -39,7 +39,7 @@ public class BusinessConfigController extends BaseRestController{
@GetMapping("{/{id}") @GetMapping("{/{id}")
@ApiOperation("数据表查询") @ApiOperation("根据id进行数据表查询")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "appId", value = "租户id",dataTypeClass = String.class), @ApiImplicitParam(name = "appId", value = "租户id",dataTypeClass = String.class),
@ApiImplicitParam(name = "id", value = "主键id",dataTypeClass = String.class) @ApiImplicitParam(name = "id", value = "主键id",dataTypeClass = String.class)
...@@ -49,9 +49,9 @@ public class BusinessConfigController extends BaseRestController{ ...@@ -49,9 +49,9 @@ public class BusinessConfigController extends BaseRestController{
} }
@PostMapping("/filed") @PostMapping("/filed")
@ApiOperation("根据配置字段获取字段数据") @ApiOperation("根据配置字段获取业务数据")
@ApiImplicitParam(name = "appId", value = "租户id", required = true,dataTypeClass = String.class) @ApiImplicitParam(name = "appId", value = "租户id", required = true,dataTypeClass = String.class)
public R<Map<String, Object>> getBusinessData(HttpServletRequest request, @PathVariable String appId,@RequestBody BusinessDTO dto) { public R<List<Map<String, Object>>> getBusinessData(HttpServletRequest request, @PathVariable String appId,@RequestBody BusinessDTO dto) {
return call(()->{ return call(()->{
CurrentUser currentUser = getCurrentUser(request); CurrentUser currentUser = getCurrentUser(request);
return businessConfigService.getBusinessData(dto,dcClientHost+businessFiledData,currentUser); return businessConfigService.getBusinessData(dto,dcClientHost+businessFiledData,currentUser);
......
...@@ -22,6 +22,8 @@ public class BusinessDTO { ...@@ -22,6 +22,8 @@ public class BusinessDTO {
private String y; private String y;
@ApiModelProperty(value = "横轴纬度", required = true) @ApiModelProperty(value = "横轴纬度", required = true)
private String x; private String x;
@ApiModelProperty(value = "横轴格式")
private String format;
@ApiModelProperty(value = "查询配置(如果为空不要调用后台)", required = true) @ApiModelProperty(value = "查询配置(如果为空不要调用后台)", required = true)
List<Map<String,List<BusinessConditionDTO>>> where; List<Map<String,List<BusinessConditionDTO>>> where;
@ApiModelProperty(value = "统计类型(平均值 avg ,合计值 sum, 最大值 max ,最小值 min,中位数 middle ,原值 original)", required = true) @ApiModelProperty(value = "统计类型(平均值 avg ,合计值 sum, 最大值 max ,最小值 min,中位数 middle ,原值 original)", required = true)
......
...@@ -36,5 +36,5 @@ public interface BusinessConfigService extends IService<BusinessConfig> { ...@@ -36,5 +36,5 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
* @param user * @param user
* @return * @return
*/ */
Map<String, Object> getBusinessData(BusinessDTO dto,String uri, CurrentUser user); List<Map<String, Object>> getBusinessData(BusinessDTO dto,String uri, CurrentUser user);
} }
...@@ -75,7 +75,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper, ...@@ -75,7 +75,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Map<String, Object> getBusinessData(BusinessDTO dto,String uri, CurrentUser user) { public List<Map<String, Object>> getBusinessData(BusinessDTO dto,String uri, CurrentUser user) {
if(StringUtils.isBlank(dto.getTable())){ if(StringUtils.isBlank(dto.getTable())){
throw new SysException("请传入对应的表名"); throw new SysException("请传入对应的表名");
} }
...@@ -97,7 +97,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper, ...@@ -97,7 +97,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
} }
x.forEach((k,v)->{ x.forEach((k,v)->{
if(v.stream().anyMatch(y -> StringUtils.isBlank(y.getKey())) if(v.stream().anyMatch(y -> StringUtils.isBlank(y.getKey()))
|| v.stream().anyMatch(y -> ObjectUtils.isNotEmpty(y.getValue())) || v.stream().anyMatch(y -> ObjectUtils.isEmpty(y.getValue()))
|| v.stream().anyMatch(y -> StringUtils.isBlank(y.getQueryType()))) { || v.stream().anyMatch(y -> StringUtils.isBlank(y.getQueryType()))) {
throw new SysException("where 条件不能key value queryType 都不能为空"); throw new SysException("where 条件不能key value queryType 都不能为空");
} }
...@@ -107,7 +107,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper, ...@@ -107,7 +107,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
heads.put("X-Token", user.getToken()); heads.put("X-Token", user.getToken());
Map<String, String> uriVariables = Maps.newHashMap(); Map<String, String> uriVariables = Maps.newHashMap();
uriVariables.put("appId", user.getAppId()); uriVariables.put("appId", user.getAppId());
R<Map<String, Object>> result = RestTemplateUtils.post(uri, heads,dto, new TypeToken<R<Map<String, Object>>>() {}.getType(), uriVariables); R<List<Map<String, Object>>> result = RestTemplateUtils.post(uri, heads,dto, new TypeToken<R<List<Map<String, Object>>>>() {}.getType(), uriVariables);
return result.detach(); return result.detach();
} }
} }
...@@ -4,12 +4,4 @@ spring: ...@@ -4,12 +4,4 @@ spring:
password: Test123! password: Test123!
url: jdbc:mysql://${MYSQL_HOST:116.63.67.122}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true url: jdbc:mysql://${MYSQL_HOST:116.63.67.122}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
dc_client: dc_client:
host: http://apidev.sycdev.com/dc host: http://139.9.194.252:2400/dc # http://192.168.0.3:2400/dc # http://apidev.sycdev.com/dc
interfaces: \ No newline at end of file
positionListUrl: /{appId}/positions?positionName={positionName}
deptListUrl: /{appId}/departments?deptName={deptName}
userTree: /{appId}/users/list?userName={userName}
variableList: /{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}&current={current}&size={size}
deviceList: /{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles: /{appId}/users/depts-roles
businessFiledData: /{appId}/business/filed
\ No newline at end of file
spring: spring:
datasource: datasource:
username: root username: root
password: 123456 password: root
url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
dc_client: dc_client:
host: http://apidev.sycdev.com/dc host: http://localhost:2400/dc
interfaces: \ No newline at end of file
positionListUrl: /{appId}/positions?positionName={positionName}
deptListUrl: /{appId}/departments?deptName={deptName}
userTree : /{appId}/users/list?userName={userName}
variableList : /{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}&current={current}&size={size}
deviceList : /{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles : /{appId}/users/depts-roles
businessFiledData : /{appId}/business/filed
variableHistoryDataList: /{appId}/variables/history?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&statisticsType={statisticsType}&variableCode={variableCode}&variableId={variableId}&x={x}&format={format}
variableRealTimeDataList: /{appId}/variables/real-time?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
\ No newline at end of file
...@@ -47,4 +47,16 @@ server: ...@@ -47,4 +47,16 @@ server:
port: 2022 port: 2022
logging: logging:
level: level:
com.syc.slm.slmbi.mapper: debug com.syc.slm.slmbi.mapper: debug
\ No newline at end of file
dc_client:
interfaces:
positionListUrl: /{appId}/positions?positionName={positionName}
deptListUrl: /{appId}/departments?deptName={deptName}
userTree : /{appId}/users/list?userName={userName}
variableList : /{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}&current={current}&size={size}
deviceList : /{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles : /{appId}/users/depts-roles
businessFiledData : /{appId}/business/filed
variableHistoryDataList: /{appId}/variables/history?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&statisticsType={statisticsType}&variableCode={variableCode}&variableId={variableId}&x={x}&format={format}
variableRealTimeDataList: /{appId}/variables/real-time?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
\ No newline at end of file
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