From d34425f94ae7e832360add218755259c70b7c4a3 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Tue, 29 Aug 2023 11:14:56 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E7=9B=91=E7=9D=A3?= =?UTF-8?q?=E5=9B=BD=E7=BD=91=E4=B8=8A=E9=80=81=EF=BC=8C=E7=BD=91=E5=9D=80?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SupvPushGwServiceImpl.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index 6896e5785..a0987d1ca 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -33,6 +33,7 @@ import com.njcn.web.utils.RestTemplateUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.compress.utils.IOUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.FileSystemResource; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -76,6 +77,10 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { private final UserFeignClient userFeignClient; + @Value("${gw.url}") + private String gwUrl; + + @Override public String pushPlan(List planIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -445,7 +450,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { } } - public static Map send(SendParam param, String url, String serviceName) { + public Map send(SendParam param, String url, String serviceName) { Map map = new LinkedHashMap<>(); ContentBody cb; if (ObjectUtil.isNull(param)) { @@ -484,12 +489,12 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { return map; } - public static String LoginToken() { + public String LoginToken() { String token = null; String clientId = "942a9278671711eda2e10ae0b5517f6c"; String clientSecret = "3Psd2VEhsA3dVsSPHW0ll5r/03kAqlA2P4w2IiWPA8UWSadcX0we2wffjyTUYGsK"; - String userUrl = "http://25.36.214.86:32234/psr-auth/oauth/accessToken?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}"; + String userUrl = "http://"+gwUrl+"/psr-auth/oauth/accessToken?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}"; Map map = new HashMap<>(); map.put("grant_type", "credentials"); map.put("client_id", clientId); @@ -533,7 +538,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { //如果需要传递请求参数 可以拼接到请求URL中,或者设置paramsMap参数由SDK内部进行拼接 HttpParameters.Builder builder = HttpParameters.newBuilder(); - builder.requestURL("http://25.36.214.86:32234/CSB/WMCenter/powerQuality/file/create") // 设置请求的URL,可以拼接URL请求参数 + builder.requestURL(url) // 设置请求的URL,可以拼接URL请求参数 .api("zongbuSync") // 设置服务名 .version("1.0.0") // 设置版本号 .method("post") // 设置调用方式, 必须为 post @@ -638,8 +643,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { * @param type * @return */ - public static String getUrl(Integer type) { - String url = "http://25.36.214.86:32234/CSB"; + public String getUrl(Integer type) { + String url = "http://"+gwUrl+"/CSB"; switch (type) { case 1: From 5335217fc9d7961bad13529583533c1299708d5b Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 29 Aug 2023 14:22:22 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/user/service/impl/UserServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java index 48ef61e17..486a0a7b9 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/UserServiceImpl.java @@ -278,12 +278,17 @@ public class UserServiceImpl extends ServiceImpl implements IU public Page userList(UserParam.UserQueryParam queryParam) { QueryWrapper queryWrapper = new QueryWrapper<>(); Page page = new Page<>(); - Integer type = this.lambdaQuery().eq(User::getId, RequestUtil.getUserIndex()).one().getType(); + User user = this.lambdaQuery().eq(User::getId, RequestUtil.getUserIndex()).one(); + Integer type = user.getType(); if (Objects.equals(UserType.SUPER_ADMINISTRATOR, type)) { type = UserType.ADMINISTRATOR; - } else if (Objects.equals(UserType.ADMINISTRATOR, type)) { + //fixme 存在web用户和App用户,目前先通过管理员的登录名来区分开 + } else if (Objects.equals(UserType.ADMINISTRATOR, type) && !Objects.equals(user.getLoginName(),"njcnyw")) { type = UserType.USER; - } else if (Objects.equals(UserType.USER, type) || Objects.equals(UserType.APP, type)) { + } else if (Objects.equals(UserType.ADMINISTRATOR, type) && Objects.equals(user.getLoginName(),"njcnyw")) { + type = UserType.APP; + } + else if (Objects.equals(UserType.USER, type) || Objects.equals(UserType.APP, type)) { return page; } if (ObjectUtil.isNotNull(queryParam)) { From bc6f5bf63b52162c5540bd054c8af193e36528e3 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 29 Aug 2023 17:12:23 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E8=A7=A3=E6=9E=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/system/api/EleWaveFeignClient.java | 24 ++++++++ .../EleWaveFeignClientFallbackFactory.java | 40 ++++++++++++++ .../njcn/system/pojo/param/CsWaveParam.java | 23 ++++++++ .../njcn/system/pojo/param/EleEvtParam.java | 2 - .../com/njcn/system/pojo/po/CsWaveParm.java | 29 ++++++++++ .../com/njcn/system/pojo/po/EleEvtParm.java | 2 - .../controller/EleWaveParmController.java | 55 +++++++++++++++++++ .../njcn/system/mapper/EleWaveParmMapper.java | 16 ++++++ .../system/service/IEleWaveParmService.java | 19 +++++++ .../service/impl/EleWaveParmServiceImpl.java | 28 ++++++++++ 10 files changed, 234 insertions(+), 4 deletions(-) create mode 100644 pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java create mode 100644 pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java create mode 100644 pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java create mode 100644 pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java create mode 100644 pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java create mode 100644 pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EleWaveParmMapper.java create mode 100644 pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java create mode 100644 pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java new file mode 100644 index 000000000..07f924540 --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java @@ -0,0 +1,24 @@ +package com.njcn.system.api; + +import com.njcn.common.pojo.constant.ServerInfo; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.system.api.fallback.EleWaveFeignClientFallbackFactory; +import com.njcn.system.pojo.param.CsWaveParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author xuyang + * @version 1.0.0 + * @date 2021年05月08日 15:11 + */ +@FeignClient(value = ServerInfo.SYSTEM,path = "/eleWaveParm",fallbackFactory = EleWaveFeignClientFallbackFactory.class,contextId = "eleWaveParm") +public interface EleWaveFeignClient { + + @PostMapping("/add") + @ApiOperation("新增波形拓展数据") + HttpResult add(@RequestBody CsWaveParam waveParam); + +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java new file mode 100644 index 000000000..6ec81d190 --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java @@ -0,0 +1,40 @@ +package com.njcn.system.api.fallback; + +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.system.api.EleWaveFeignClient; +import com.njcn.system.pojo.param.CsWaveParam; +import com.njcn.system.utils.SystemEnumUtil; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 类的介绍: + * + * @author xuyang + * @version 1.0.0 + * @createTime 2023/5/24 18:46 + */ +@Slf4j +@Component +public class EleWaveFeignClientFallbackFactory implements FallbackFactory { + @Override + public EleWaveFeignClient create(Throwable cause) { + //判断抛出异常是否为解码器抛出的业务异常 + Enum exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK; + if(cause.getCause() instanceof BusinessException){ + BusinessException businessException = (BusinessException) cause.getCause(); + exceptionEnum = SystemEnumUtil.getExceptionEnum(businessException.getResult()); + } + Enum finalExceptionEnum = exceptionEnum; + return new EleWaveFeignClient() { + @Override + public HttpResult add(CsWaveParam waveParam) { + log.error("{}异常,降级处理,异常为:{}","新增波形拓展数据",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } + }; + } +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java new file mode 100644 index 000000000..6df9caffa --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java @@ -0,0 +1,23 @@ +package com.njcn.system.pojo.param; + +import lombok.Data; + +/** + * 类的介绍: + * + * @author xuyang + * @version 1.0.0 + * @createTime 2023/8/29 16:10 + */ +@Data +public class CsWaveParam { + + private String pid; + + private String name; + + private String type; + + private String data; + +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java index 83907748f..a80cf0483 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java @@ -22,6 +22,4 @@ public class EleEvtParam { private String data; - private String showName; - } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java new file mode 100644 index 000000000..8c06accb5 --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java @@ -0,0 +1,29 @@ +package com.njcn.system.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 类的介绍: + * + * @author xuyang + * @version 1.0.0 + * @createTime 2023/8/29 16:10 + */ +@Data +@TableName("cs_wave_parm") +public class CsWaveParm { + + private static final long serialVersionUID = 1L; + + private String id; + + private String pid; + + private String name; + + private String type; + + private String data; + +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java index 631c8b47d..0aabea5c3 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java @@ -34,6 +34,4 @@ public class EleEvtParm { private String data; - private String showName; - } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java new file mode 100644 index 000000000..5532daa8b --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java @@ -0,0 +1,55 @@ +package com.njcn.system.controller; + + +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.common.utils.LogUtil; +import com.njcn.system.pojo.param.CsWaveParam; +import com.njcn.system.service.IEleWaveParmService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 事件拓展表 前端控制器 + *

+ * + * @author xuyang + * @since 2023-07-31 + */ +@Slf4j +@RestController +@RequestMapping("/eleWaveParm") +@RequiredArgsConstructor +@Api(tags = "波形字典录入") +@Validated +public class EleWaveParmController extends BaseController { + + private final IEleWaveParmService waveParamService; + + @PostMapping("/add") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("新增波形拓展数据") + @ApiImplicitParam(name = "waveParam", value = "字典数据", required = true) + public HttpResult add(@RequestBody @Validated CsWaveParam waveParam){ + log.info("录入字典数据"); + String methodDescribe = getMethodDescribe("add"); + LogUtil.njcnDebug(log, "{},模板当前解析字典数据为:", methodDescribe); + waveParamService.add(waveParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + +} + diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EleWaveParmMapper.java b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EleWaveParmMapper.java new file mode 100644 index 000000000..ff31791e0 --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EleWaveParmMapper.java @@ -0,0 +1,16 @@ +package com.njcn.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.system.pojo.po.CsWaveParm; + +/** + *

+ * 事件拓展表 Mapper 接口 + *

+ * + * @author xuyang + * @since 2023-07-31 + */ +public interface EleWaveParmMapper extends BaseMapper { + +} diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java new file mode 100644 index 000000000..8ec8169f0 --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java @@ -0,0 +1,19 @@ +package com.njcn.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.system.pojo.param.CsWaveParam; +import com.njcn.system.pojo.po.CsWaveParm; + +/** + *

+ * 事件拓展表 服务类 + *

+ * + * @author xuyang + * @since 2023-07-31 + */ +public interface IEleWaveParmService extends IService { + + void add(CsWaveParam waveParam); + +} diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java new file mode 100644 index 000000000..c5b93c857 --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java @@ -0,0 +1,28 @@ +package com.njcn.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.system.mapper.EleWaveParmMapper; +import com.njcn.system.pojo.param.CsWaveParam; +import com.njcn.system.pojo.po.CsWaveParm; +import com.njcn.system.service.IEleWaveParmService; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 事件拓展表 服务实现类 + *

+ * + * @author xuyang + * @since 2023-07-31 + */ +@Service +public class EleWaveParmServiceImpl extends ServiceImpl implements IEleWaveParmService { + + @Override + public void add(CsWaveParam waveParam) { + CsWaveParm csWaveParm = new CsWaveParm(); + BeanUtils.copyProperties(waveParam,csWaveParm); + this.save(csWaveParm); + } +} From 8aa654249834e4192a56b7ee59b8ed6a7914b90a Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 29 Aug 2023 19:20:24 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/user/service/impl/ComponentServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java index 58492bec4..3861daa1d 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java @@ -1,6 +1,7 @@ package com.njcn.user.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.common.pojo.exception.BusinessException; @@ -127,6 +128,9 @@ public class ComponentServiceImpl extends ServiceImpl componentList = roleComponentService.selectRoleComponent(roleList.stream().map(Role::getId).collect(Collectors.toList())); + if (CollectionUtil.isEmpty(componentList)) { + return result; + } list = componentMapper.getComponentByList(componentList); } list.forEach(item -> { From c236f01501041addcaaa1dca92ffefe529e0d491 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 29 Aug 2023 19:23:27 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/user/service/impl/ComponentServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java index 3861daa1d..5e96c9bb3 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java @@ -133,6 +133,9 @@ public class ComponentServiceImpl extends ServiceImpl { ComponentVO componentVO = new ComponentVO(); BeanUtil.copyProperties(item, componentVO); From d0d33b5b2238794b15a0bc543858daf01e3b1388 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 29 Aug 2023 22:26:09 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/system/api/EleEvtFeignClient.java | 5 ++++- .../njcn/system/api/EleWaveFeignClient.java | 6 +++++- .../EleEvtFeignClientFallbackFactory.java | 6 ++++++ .../EleWaveFeignClientFallbackFactory.java | 6 ++++++ .../njcn/system/pojo/param/CsWaveParam.java | 2 ++ .../njcn/system/pojo/param/EleEvtParam.java | 2 ++ .../com/njcn/system/pojo/po/CsWaveParm.java | 2 ++ .../com/njcn/system/pojo/po/EleEvtParm.java | 2 ++ .../controller/EleEvtParmController.java | 18 ++++++++++++++---- .../controller/EleWaveParmController.java | 17 +++++++++++++---- .../system/service/IEleEvtParmService.java | 2 ++ .../system/service/IEleWaveParmService.java | 2 ++ .../service/impl/EleEvtParmServiceImpl.java | 8 ++++++++ .../service/impl/EleWaveParmServiceImpl.java | 9 +++++++++ 14 files changed, 77 insertions(+), 10 deletions(-) diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/EleEvtFeignClient.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleEvtFeignClient.java index 819fa5fb4..e84614a90 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/EleEvtFeignClient.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleEvtFeignClient.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; /** * @author xuyang @@ -19,7 +20,9 @@ import org.springframework.web.bind.annotation.RequestBody; public interface EleEvtFeignClient { @PostMapping("/add") - @ApiOperation("新增事件拓展数据") HttpResult add(@RequestBody EleEvtParam evtParam); + @PostMapping("/delete") + HttpResult delete(@RequestParam("id") String id); + } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java index 07f924540..b76ddb979 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/EleWaveFeignClient.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; /** * @author xuyang @@ -18,7 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; public interface EleWaveFeignClient { @PostMapping("/add") - @ApiOperation("新增波形拓展数据") HttpResult add(@RequestBody CsWaveParam waveParam); + @PostMapping("/delete") + @ApiOperation("删除波形拓展数据") + HttpResult delete(@RequestParam("id") String id); + } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleEvtFeignClientFallbackFactory.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleEvtFeignClientFallbackFactory.java index 1453761f0..4b68d7621 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleEvtFeignClientFallbackFactory.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleEvtFeignClientFallbackFactory.java @@ -41,6 +41,12 @@ public class EleEvtFeignClientFallbackFactory implements FallbackFactory delete(String id) { + log.error("{}异常,降级处理,异常为:{}","删除事件拓展数据",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } }; } } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java index 6ec81d190..5a2511ff3 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EleWaveFeignClientFallbackFactory.java @@ -35,6 +35,12 @@ public class EleWaveFeignClientFallbackFactory implements FallbackFactory delete(String id) { + log.error("{}异常,降级处理,异常为:{}","删除波形拓展数据",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } }; } } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java index 6df9caffa..62fe4f7ea 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/CsWaveParam.java @@ -20,4 +20,6 @@ public class CsWaveParam { private String data; + private String showName; + } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java index a80cf0483..83907748f 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/EleEvtParam.java @@ -22,4 +22,6 @@ public class EleEvtParam { private String data; + private String showName; + } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java index 8c06accb5..4fe2374b1 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/CsWaveParm.java @@ -26,4 +26,6 @@ public class CsWaveParm { private String data; + private String showName; + } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java index 0aabea5c3..631c8b47d 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/EleEvtParm.java @@ -34,4 +34,6 @@ public class EleEvtParm { private String data; + private String showName; + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEvtParmController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEvtParmController.java index b0f990dc7..be37cc13a 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEvtParmController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEvtParmController.java @@ -17,11 +17,8 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.RestController; import com.njcn.web.controller.BaseController; /** @@ -54,5 +51,18 @@ public class EleEvtParmController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + @PostMapping("/delete") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("删除事件拓展数据") + @ApiImplicitParam(name = "id", value = "id", required = true) + public HttpResult delete(@RequestParam String id){ + String methodDescribe = getMethodDescribe("delete"); + LogUtil.njcnDebug(log, "{},传递的id为:{}", methodDescribe,id); + eleEvtParmService.delete(id); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + + + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java index 5532daa8b..5fe3282a0 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleWaveParmController.java @@ -8,6 +8,7 @@ import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.LogUtil; import com.njcn.system.pojo.param.CsWaveParam; +import com.njcn.system.pojo.po.EleEpdPqd; import com.njcn.system.service.IEleWaveParmService; import com.njcn.web.controller.BaseController; import io.swagger.annotations.Api; @@ -16,10 +17,7 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** *

@@ -51,5 +49,16 @@ public class EleWaveParmController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + @PostMapping("/delete") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("删除波形拓展数据") + @ApiImplicitParam(name = "id", value = "id", required = true) + public HttpResult delete(@RequestParam String id){ + String methodDescribe = getMethodDescribe("delete"); + LogUtil.njcnDebug(log, "{},传递的id为:{}", methodDescribe,id); + waveParamService.delete(id); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + } + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEvtParmService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEvtParmService.java index 2065a12a1..522b865d4 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEvtParmService.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEvtParmService.java @@ -16,4 +16,6 @@ public interface IEleEvtParmService extends IService { void add(EleEvtParam eleEvtParam); + void delete(String id); + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java index 8ec8169f0..1c8e78956 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleWaveParmService.java @@ -16,4 +16,6 @@ public interface IEleWaveParmService extends IService { void add(CsWaveParam waveParam); + void delete(String id); + } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEvtParmServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEvtParmServiceImpl.java index ef2936601..3dbc0757d 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEvtParmServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEvtParmServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.system.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.system.mapper.EleEvtParmMapper; import com.njcn.system.pojo.param.EleEvtParam; @@ -25,4 +26,11 @@ public class EleEvtParmServiceImpl extends ServiceImpl deleteWrapper = new LambdaQueryWrapper<>(); + deleteWrapper.eq(EleEvtParm::getPid,id); + this.baseMapper.delete(deleteWrapper); + } } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java index c5b93c857..39165d80a 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleWaveParmServiceImpl.java @@ -1,9 +1,11 @@ package com.njcn.system.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.system.mapper.EleWaveParmMapper; import com.njcn.system.pojo.param.CsWaveParam; import com.njcn.system.pojo.po.CsWaveParm; +import com.njcn.system.pojo.po.EleEvtParm; import com.njcn.system.service.IEleWaveParmService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -25,4 +27,11 @@ public class EleWaveParmServiceImpl extends ServiceImpl deleteWrapper = new LambdaQueryWrapper<>(); + deleteWrapper.eq(CsWaveParm::getPid,id); + this.baseMapper.delete(deleteWrapper); + } } From 7fa9b9c407e3c2b189c42a6f0afd7ce95573ef5e Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Wed, 30 Aug 2023 08:45:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?1.=E7=9B=91=E6=B5=8B=E7=82=B9=E5=8D=8A?= =?UTF-8?q?=E6=9C=88=E6=8A=A5=202.=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=BF=83bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/pq/pojo/vo/HalfReportVO.java | 84 +++++++++++++++++++ .../device/pq/controller/LineController.java | 14 +++- .../com/njcn/device/pq/mapper/LineMapper.java | 10 +++ .../device/pq/mapper/mapping/LineMapper.xml | 81 ++++++++++++++++++ .../njcn/device/pq/service/LineService.java | 3 + .../pq/service/impl/LineServiceImpl.java | 9 ++ .../system/service/impl/AuditServiceImpl.java | 2 +- .../impl/EventTemplateServiceImpl.java | 25 ++++-- 8 files changed, 214 insertions(+), 14 deletions(-) create mode 100644 pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/HalfReportVO.java diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/HalfReportVO.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/HalfReportVO.java new file mode 100644 index 000000000..cd4f16cb8 --- /dev/null +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/vo/HalfReportVO.java @@ -0,0 +1,84 @@ +package com.njcn.device.pq.pojo.vo; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 半月报返回体 + */ +@Data +public class HalfReportVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("省份") + private String areaName; + + @ApiModelProperty("供电公司") + private String gdName; + + @ApiModelProperty("所属变电站") + private String subName; + + @ApiModelProperty("监测点名称") + private String lineName; + + @ApiModelProperty("重要等级") + private String lineGrade; + + @ApiModelProperty("行业类型") + private String businessType; + + @ApiModelProperty("运行状态") + private String runFlag; + + @ApiModelProperty("监测点通讯状态") + private String comFlag; + + @ApiModelProperty("投运时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime loginTime; + + @ApiModelProperty("数据更新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @ApiModelProperty("在线率(%)") + private BigDecimal onlineRate; + + @ApiModelProperty("完整性(%)") + private BigDecimal integrityData; + + @ApiModelProperty("装置名称") + private String devName; + + @ApiModelProperty("装置系列") + private String devSeries; + + @ApiModelProperty("mac地址") + private String ip; + + @ApiModelProperty("总流量(M)") + private BigDecimal flowMeal; + + @ApiModelProperty("使用流量(M)") + private BigDecimal statisValue; + + // @ApiModelProperty("剩余流量(M)") +// private BigDecimal ; +// @ApiModelProperty("使用率(%)") +// private BigDecimal ; + @ApiModelProperty("ICICD") + private String sim; + + @ApiModelProperty("备注") + private String remark; + + +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LineController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LineController.java index d8f7646d4..77913dfdf 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LineController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/LineController.java @@ -1,5 +1,6 @@ package com.njcn.device.pq.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; @@ -11,9 +12,7 @@ import com.njcn.device.biz.enums.DeviceResponseEnum; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.device.pq.mapper.*; import com.njcn.device.pq.pojo.dto.*; -import com.njcn.device.pq.pojo.param.DeviceInfoParam; -import com.njcn.device.pq.pojo.param.LineBaseQueryParam; -import com.njcn.device.pq.pojo.param.OnlineRateParam; +import com.njcn.device.pq.pojo.param.*; import com.njcn.device.pq.pojo.po.*; import com.njcn.device.pq.pojo.vo.*; import com.njcn.device.pq.service.LineService; @@ -426,5 +425,12 @@ public class LineController extends BaseController { List onIntegrityByIds = integrityDMapper.getOnIntegrityByIdsAndTime (param.getLineIds(),param.getStartTime(),param.getEndTime()); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onIntegrityByIds,methodDescribe); } - + @PostMapping("/getHalfReport") + @ApiOperation("监测点半月报") + @ApiImplicitParam(name = "param", value = "参数实体", required = true) + public HttpResult> getHalfReport(@RequestBody TerminalMainQueryParam param) { + String methodDescribe = getMethodDescribe("getHalfReport"); + Page halfReportVOS = lineService.halfReport(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,halfReportVOS,methodDescribe); + } } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java index 80aba042f..9c2fbe0d6 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineMapper.java @@ -15,6 +15,7 @@ import com.njcn.device.pq.pojo.dto.OverLimitLineDTO; import com.njcn.device.pq.pojo.dto.PollutionLineDTO; import com.njcn.device.pq.pojo.dto.WarningSubstationDTO; import com.njcn.device.pq.pojo.param.DeviceInfoParam; +import com.njcn.device.pq.pojo.param.TerminalMainQueryParam; import com.njcn.device.pq.pojo.po.*; import com.njcn.device.pq.pojo.vo.*; import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO; @@ -495,4 +496,13 @@ public interface LineMapper extends BaseMapper { * @return */ List getDevicesIp(@Param("devIds") List devIds); + + /** + * @Description: 监测点半月报功能 + * @param + * @return: java.util.List + * @Author: wr + * @Date: 2023/8/29 12:50 + */ + Page selectHalfReport(Page page,@Param("param") TerminalMainQueryParam param); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml index 7ddb4b2a1..c8abae46d 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml @@ -1243,5 +1243,86 @@ #{item} + diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java index 4ef339838..1de94f428 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/LineService.java @@ -6,6 +6,7 @@ import com.njcn.device.pq.pojo.dto.PollutionParamDTO; import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO; import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.PqsParam; +import com.njcn.device.pq.pojo.param.TerminalMainQueryParam; import com.njcn.device.pq.pojo.po.Line; import com.njcn.device.biz.pojo.po.Overlimit; import com.njcn.device.pq.pojo.po.TopMsgPO; @@ -178,4 +179,6 @@ public interface LineService { Page dailyDeviceAbnormalStatistics(PqsParam param); List dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam); + + Page halfReport(TerminalMainQueryParam param); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java index bb1bf1fc0..94d068127 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java @@ -24,6 +24,7 @@ import com.njcn.device.pq.pojo.dto.PollutionParamDTO; import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO; import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.PqsParam; +import com.njcn.device.pq.pojo.param.TerminalMainQueryParam; import com.njcn.device.pq.pojo.po.*; import com.njcn.device.pq.pojo.vo.*; import com.njcn.device.pq.mapper.*; @@ -460,6 +461,14 @@ public class LineServiceImpl extends ServiceImpl implements Li return topMsgDetails; } + @Override + public Page halfReport(TerminalMainQueryParam param) { + Page page = new Page<>(param.getPageNum(), param.getPageSize()); + param.setSearchBeginTime(DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString()); + param.setSearchEndTime(DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())).toString()); + return this.baseMapper.selectHalfReport(page,param); + } + @Override public List getOverLimitByList(PollutionParamDTO pollutionParamDTO) { return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList()); diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java index dfccf1434..ba8bd2fca 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java @@ -362,7 +362,7 @@ public class AuditServiceImpl extends ServiceImpl implem vo = BeanUtil.copyProperties(datum, OnlineUsersVO.class); Long integer = time.get(datum.getId()); DateTime date = DateUtil.date(integer * 1000); - vo.setTime(date.toDateStr()); + vo.setTime(date.toString()); info.add(vo); } } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventTemplateServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventTemplateServiceImpl.java index e2070ef16..0c06fc77f 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventTemplateServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventTemplateServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.system.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; @@ -132,15 +133,21 @@ public class EventTemplateServiceImpl extends ServiceImpl list = new ArrayList<>(); - eventTemplateUpdateParam.getIds().forEach(rdId -> { - TemplateRel relevancy = new TemplateRel(); - // 模版id - relevancy.setRtId(id); - relevancy.setRdId(rdId); - list.add(relevancy); - }); - flag = templateRelMapper.batchInsert(list); + if(CollUtil.isNotEmpty(eventTemplateUpdateParam.getIds())){ + List list = new ArrayList<>(); + eventTemplateUpdateParam.getIds().forEach(rdId -> { + TemplateRel relevancy = new TemplateRel(); + // 模版id + relevancy.setRtId(id); + relevancy.setRdId(rdId); + list.add(relevancy); + }); + if(CollUtil.isNotEmpty(list)){ + flag = templateRelMapper.batchInsert(list); + } + } + + return flag; }