haungxing 1 year ago
parent
commit
f2fc28219f
  1. 4
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java
  2. 2
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/QuestionClientFallback.java
  3. 6
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpQuestionController.java
  4. 6
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java
  5. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpQuestionService.java
  6. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java
  7. 13
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
  8. 13
      hzims-service/operational/src/main/resources/db/1.0.1.sql

4
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IQuestionClient.java

@ -28,7 +28,9 @@ public interface IQuestionClient {
* @return
*/
@GetMapping(SUBMIT_STATION_INFO)
R<Boolean> submitStationInfo(@RequestParam("stationCode") String stationCode, @RequestParam(value = "stationDesc",required = false) String stationDesc);
R<Boolean> submitStationInfo(@RequestParam("fdp站点类型") Integer fdpStationType,
@RequestParam("站点编码") String stationCode,
@RequestParam(value = "站点描述",required = false) String stationDesc);
@DeleteMapping(DELETE_STATION_INFO)
R<Boolean> deleteStationInfo(@RequestParam String stationId);

2
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/QuestionClientFallback.java

@ -14,7 +14,7 @@ public class QuestionClientFallback implements IQuestionClient {
@Override
public R<Boolean> submitStationInfo(String stationCode, String stationDesc) {
public R<Boolean> submitStationInfo(Integer stationType,String stationCode, String stationDesc) {
return R.fail("智能诊断提交站点失败!");
}

6
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpQuestionController.java

@ -32,8 +32,10 @@ public class FdpQuestionController extends BladeController {
@GetMapping("/submitStationInfo")
@ApiOperation("提交站点信息")
@ApiOperationSupport(order = 1)
public R<Boolean> submitStationInfo(@RequestParam @ApiParam(value = "站点编码",required = true) String stationCode, @RequestParam(required = false) @ApiParam(value = "描述") String stationDesc) {
return R.status(fdpQuestionService.submitStationInfo(stationCode,stationDesc));
public R<Boolean> submitStationInfo(@RequestParam @ApiParam(value = "fdp站点类型",required = true) Integer fdpStationType,
@RequestParam @ApiParam(value = "站点编码",required = true) String stationCode,
@RequestParam(required = false) @ApiParam(value = "描述") String stationDesc) {
return R.status(fdpQuestionService.submitStationInfo(fdpStationType,stationCode,stationDesc));
}
@DeleteMapping("/deleteStationInfo/{stationCode}")

6
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/QuestionClient.java

@ -21,8 +21,10 @@ public class QuestionClient implements IQuestionClient {
@GetMapping(SUBMIT_STATION_INFO)
@Override
public R<Boolean> submitStationInfo(@RequestParam String stationCode,@RequestParam(required = false) String stationDesc) {
return R.status(fdpQuestionService.submitStationInfo(stationCode,stationDesc));
public R<Boolean> submitStationInfo(@RequestParam("fdp站点类型") Integer fdpStationType,
@RequestParam("站点编码") String stationCode,
@RequestParam(value = "站点描述",required = false) String stationDesc) {
return R.status(fdpQuestionService.submitStationInfo(fdpStationType,stationCode,stationDesc));
}

2
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpQuestionService.java

@ -28,7 +28,7 @@ public interface IFdpQuestionService {
* @param stationDesc 站点描述
* @return
*/
boolean submitStationInfo(String stationCode,String stationDesc);
boolean submitStationInfo(Integer fdpStationType,String stationCode,String stationDesc);
/**
* 删除站点信息

7
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java

@ -48,20 +48,18 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
private final BladeLogger logger;
@Override
public boolean submitStationInfo(String stationCode, String stationDesc) {
public boolean submitStationInfo(Integer fdpStationType,String stationCode, String stationDesc) {
R<StationEntity> stationResult = stationClient.getStationByCode(stationCode);
if(stationResult.isSuccess()) {
StationEntity stationEntity = stationResult.getData();
log.info("请求体为:{}",AuthUtil.getTenantId());
StationInfoReq infoReq = StationInfoReq.builder()
.stationId(stationCode)
.stationName(stationEntity.getName())
.type(this.getStationType(stationEntity.getType()))
.type(fdpStationType)
.stationDesc(Optional.ofNullable(stationDesc).orElse(""))
.tenantId("200000")
.build();
if(Func.isNotEmpty(infoReq.getType())) {
log.info("请求体为:{}",JSON.toJSONString(infoReq));
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getSubmitStationInfo())
.body(JSON.toJSONString(infoReq))
.execute();
@ -70,6 +68,7 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
return true;
}
else {
log.error("Fdp信息站点信息失败,推送信息为:{}",JSON.toJSONString(infoReq));
throw new ServiceException("Fdp信息站点信息失败!");
}
}

13
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java

@ -28,7 +28,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import com.hnac.hzims.common.utils.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
@ -115,9 +115,14 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl<MessagePushRec
* @return QueryWrapper
*/
private LambdaQueryWrapper<MessagePushRecordEntity> getQueryWrapper(MessagePushRecordEntity request) {
LambdaQueryWrapper<MessagePushRecordEntity> lambda = Condition.getQueryWrapper(request).lambda();
lambda.ge(Func.isNotEmpty(request.getStartTime()),MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getStartTime(), LocalTime.MIN));
lambda.le(Func.isNotEmpty(request.getEndTime()),MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getEndTime(), LocalTime.MAX));
LambdaQueryWrapper<MessagePushRecordEntity> lambda = Condition.getQueryWrapper(MessagePushRecordEntity.class,request);
if(Func.isNotEmpty(request.getStartTime())) {
lambda.ge(MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getStartTime(), LocalTime.MIN));
}
if(Func.isNotEmpty(request.getEndTime())) {
lambda.le(MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getEndTime(), LocalTime.MAX));
}
lambda.eq(Func.isNotEmpty(request.getStatus()),MessagePushRecordEntity::getStatus,request.getStatus());
lambda.orderByDesc(MessagePushRecordEntity::getPushTime);
return lambda;
}

13
hzims-service/operational/src/main/resources/db/1.0.1.sql

@ -17,3 +17,16 @@ CREATE TABLE IF NOT EXISTS `hzims_station_push_configuration` (
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic comment='站点类型推送FDP配置表';
SET FOREIGN_KEY_CHECKS = 1;
-- 新增FDP站点类型
alter table `hzims_station_push_configuration` add COLUMN `fdp_station_type` TINYINT comment 'FDP站点类型';
-- 站点类型配置导入
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1676388588253700097, 0, '水电站', 1, '200000', '2023-07-05 08:32:40', '2023-07-05 08:32:40', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, 1);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458050905264129, 1, '风电场', 0, '200000', '2023-07-13 19:49:37', '2023-07-13 19:49:37', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458136703946754, 2, '水利', 0, '200000', '2023-07-13 19:49:57', '2023-07-13 19:49:57', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458400022351873, 3, '储能站', 0, '200000', '2023-07-13 19:51:00', '2023-07-13 19:51:00', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458474366390273, 4, '配网', 0, '200000', '2023-07-13 19:51:18', '2023-07-13 19:51:18', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458557384249346, 5, '光伏站', 0, '200000', '2023-07-13 19:51:38', '2023-07-13 19:51:38', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458617685757954, 6, '水务', 0, '200000', '2023-07-13 19:51:52', '2023-07-13 19:51:52', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458692029796354, 7, '充电站', 0, '200000', '2023-07-13 19:52:10', '2023-07-13 19:52:10', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458773470597121, 8, '泵站', 0, '200000', '2023-07-13 19:52:29', '2023-07-13 19:52:29', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);
INSERT INTO `hzims_station_push_configuration` (`ID`, `station_type`, `station_type_name`, `is_push`, `TENANT_ID`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`, `CREATE_DEPT`, `fdp_station_type`) VALUES (1679458845390327809, 9, '闸门', 0, '200000', '2023-07-13 19:52:46', '2023-07-13 19:52:46', 1434782836098891778, 1434782836098891778, 0, 1, 20000001, NULL);

Loading…
Cancel
Save