From 9d3cb26ac4446019623c96bded9aabe65546f8b2 Mon Sep 17 00:00:00 2001 From: bobol Date: Wed, 13 Dec 2023 08:58:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=88=E6=8C=87=E6=A0=87=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lzbi/framework/config/SecurityConfig.java | 2 +- .../draft/controller/ReportController.java | 31 ++++ .../dto/TargetDraftMonthReportValueDTO.java | 22 +++ .../entity/req/TargetDraftMonthReportReq.java | 42 +++++ .../entity/vo/TargetDraftMonthReportVO.java | 144 ++++++++++++++++++ .../mapper/DcBusiTargetDraftMonthMapper.java | 7 + .../com/lzbi/draft/service/ReportService.java | 71 +++++++++ .../draft/DcBusiTargetDraftMonthMapper.xml | 37 ++++- 8 files changed, 354 insertions(+), 2 deletions(-) create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/entity/dto/TargetDraftMonthReportValueDTO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/entity/req/TargetDraftMonthReportReq.java create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/entity/vo/TargetDraftMonthReportVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java diff --git a/lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java b/lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java index 5aafb00..24b46b8 100644 --- a/lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java +++ b/lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage","/assetData/**","/magic/api/**").permitAll() + .antMatchers("/login", "/register", "/captchaImage","/assetData/**","/magic/api/**", "/report/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers( "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java new file mode 100644 index 0000000..a663cec --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java @@ -0,0 +1,31 @@ +package com.lzbi.draft.controller; + +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; +import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; +import com.lzbi.draft.service.ReportService; +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.util.List; + +/** + * 报表Controller + * + * @author lienbo + * @date 2023-12-12 + */ +@RestController +@RequestMapping("/report") +public class ReportController { + + @Autowired + private ReportService reportService; + + @GetMapping("/targetDraftMonthReport") + public List targetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) { + return reportService.getTargetDraftMonthReport(targetDraftMonthReportReq); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/entity/dto/TargetDraftMonthReportValueDTO.java b/lzbi-module/src/main/java/com/lzbi/draft/entity/dto/TargetDraftMonthReportValueDTO.java new file mode 100644 index 0000000..e9e5ecc --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/entity/dto/TargetDraftMonthReportValueDTO.java @@ -0,0 +1,22 @@ +package com.lzbi.draft.entity.dto; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 月指标报表查询dto + */ +@Data +public class TargetDraftMonthReportValueDTO { + + /** + * 统计单元编码 + */ + private String assetCode; + + /** + * 值 + */ + private BigDecimal value; +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/entity/req/TargetDraftMonthReportReq.java b/lzbi-module/src/main/java/com/lzbi/draft/entity/req/TargetDraftMonthReportReq.java new file mode 100644 index 0000000..520958c --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/entity/req/TargetDraftMonthReportReq.java @@ -0,0 +1,42 @@ +package com.lzbi.draft.entity.req; + +import lombok.Data; + +@Data +public class TargetDraftMonthReportReq { + + /** + * 指标模型编码数组 + */ + public static final String[] TARGET_MODEL_CODE_ARR = new String[]{"MJ01","SSLL01","SSRL01","LJRL01","GW01","HW01","GY01","HY01","GW02","HW02","GY02","HY02","FMGD01","FMFK01","SXSW01","YCGJ01","CNFS01","KGM201","JGM201","YC01","WC01","JW01","WC02","EJW01","YC02"}; + + /** + * 公司id + */ + private Long companyId; + + /** + * 组织id + */ + private Long orgId; + + /** + * 专业编码 + */ + private String fieldCode; + + /** + * 年 + */ + private String year; + + /** + * 月 + */ + private String month; + + /** + * 指标模型编码 + */ + private String targetModelCode; +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/entity/vo/TargetDraftMonthReportVO.java b/lzbi-module/src/main/java/com/lzbi/draft/entity/vo/TargetDraftMonthReportVO.java new file mode 100644 index 0000000..04a4a88 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/entity/vo/TargetDraftMonthReportVO.java @@ -0,0 +1,144 @@ +package com.lzbi.draft.entity.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class TargetDraftMonthReportVO { + + /** + * 统计单元编码 + */ + private String assetCode; + + /** + * 统计单元名称 + */ + private String assetName; + + /** + * 面积 + */ + private BigDecimal MJ01; + + /** + * 瞬时流量 + */ + private BigDecimal SSLL01; + + /** + * 瞬时热量 + */ + private BigDecimal SSRL01; + + /** + * 累计热量 + */ + private BigDecimal LJRL01; + + /** + * 供温 + */ + private BigDecimal GW01; + + /** + * 回温 + */ + private BigDecimal HW01; + + /** + * 供压 + */ + private BigDecimal GY01; + + /** + * 回压 + */ + private BigDecimal HY01; + + /** + * 供温 + */ + private BigDecimal GW02; + + /** + * 回温 + */ + private BigDecimal HW02; + + /** + * 供压 + */ + private BigDecimal GY02; + + /** + * 回压 + */ + private BigDecimal HY02; + + /** + * 阀门给定 + */ + private BigDecimal FMGD01; + + /** + * 阀门反馈 + */ + private BigDecimal FMFK01; + + /** + * 水箱水位 + */ + private BigDecimal SXSW01; + + /** + * 一次管径 + */ + private BigDecimal YCGJ01; + + /** + * 采暖方式 + */ + private BigDecimal CNFS01; + + /** + * KG/㎡ + */ + private BigDecimal KGM201; + + /** + * JG/㎡ + */ + private BigDecimal JGM201; + + /** + * 压差 + */ + private BigDecimal YC01; + + /** + * 温差 + */ + private BigDecimal WC01; + + /** + * 均温 + */ + private BigDecimal JW01; + + /** + * 温差 + */ + private BigDecimal WC02; + + /** + * 二均温 + */ + private BigDecimal EJW01; + + /** + * 压差 + */ + private BigDecimal YC02; +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java index 4fe52a9..6badb8c 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java @@ -3,6 +3,9 @@ package com.lzbi.draft.mapper; import java.util.List; import com.lzbi.draft.domain.DcBusiTargetDraftMonth; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; +import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; +import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; /** * 指标数据底稿(月)Mapper接口 @@ -60,4 +63,8 @@ public interface DcBusiTargetDraftMonthMapper extends BaseMapper selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq); + + List selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java b/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java new file mode 100644 index 0000000..b067adb --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java @@ -0,0 +1,71 @@ +package com.lzbi.draft.service; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; +import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; +import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; +import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.lang.reflect.Field; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; + +@Slf4j +@Service +public class ReportService { + + @Resource + private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; + + @Autowired + private ThreadPoolTaskExecutor threadPoolTaskExecutor; + + public List getTargetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) { + Class targetDraftMonthReportVOClass = TargetDraftMonthReportVO.class; + List list = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportVO(targetDraftMonthReportReq); + CountDownLatch countDownLatch = new CountDownLatch(TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR.length); + for (String targetModelCode : TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR) { + threadPoolTaskExecutor.execute(() -> { + TargetDraftMonthReportReq req = JSONObject.parseObject(JSONObject.toJSONString(targetDraftMonthReportReq), TargetDraftMonthReportReq.class); + req.setTargetModelCode(targetModelCode); + List targetDraftMonthReportValueDTOS = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportValue(req); + log.info("{} 执行完成,结果是 {}", targetModelCode, JSONArray.toJSONString(targetDraftMonthReportValueDTOS)); + for (int i = 0, len = list.size(); i < len; i++) { + TargetDraftMonthReportVO targetDraftMonthReportVO = list.get(i); + for (int j = targetDraftMonthReportValueDTOS.size() - 1; j >= 0; j--) { + TargetDraftMonthReportValueDTO targetDraftMonthReportValueDTO = targetDraftMonthReportValueDTOS.get(j); + if (targetDraftMonthReportVO.getAssetCode().equals(targetDraftMonthReportValueDTO.getAssetCode())) { + try { + Field declaredField = targetDraftMonthReportVOClass.getDeclaredField(targetModelCode); + if (!declaredField.isAccessible()) { + declaredField.setAccessible(true); + } + declaredField.set(targetDraftMonthReportVO, targetDraftMonthReportValueDTO.getValue()); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + targetDraftMonthReportValueDTOS.remove(j); + break; + } + } + } + countDownLatch.countDown(); + }); + } + try { + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("门闩异常", e); + } + return list; + } +} diff --git a/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml b/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml index 763400c..f96d6ae 100644 --- a/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml +++ b/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml @@ -88,7 +88,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + + + + insert into dc_busi_target_draft_month From 2446689dea168647180641c3bd935a4ca38e3a4c Mon Sep 17 00:00:00 2001 From: bobol Date: Wed, 13 Dec 2023 15:38:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9C=88=E6=8C=87=E6=A0=87=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lzbi/draft/service/ReportService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java b/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java index b067adb..ae4c1fd 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java @@ -14,7 +14,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.lang.reflect.Field; import java.util.List; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; @Slf4j @@ -36,7 +35,7 @@ public class ReportService { TargetDraftMonthReportReq req = JSONObject.parseObject(JSONObject.toJSONString(targetDraftMonthReportReq), TargetDraftMonthReportReq.class); req.setTargetModelCode(targetModelCode); List targetDraftMonthReportValueDTOS = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportValue(req); - log.info("{} 执行完成,结果是 {}", targetModelCode, JSONArray.toJSONString(targetDraftMonthReportValueDTOS)); + log.info("{} 执行完成,结果是 {}", targetModelCode, targetDraftMonthReportValueDTOS); for (int i = 0, len = list.size(); i < len; i++) { TargetDraftMonthReportVO targetDraftMonthReportVO = list.get(i); for (int j = targetDraftMonthReportValueDTOS.size() - 1; j >= 0; j--) { @@ -48,9 +47,7 @@ public class ReportService { declaredField.setAccessible(true); } declaredField.set(targetDraftMonthReportVO, targetDraftMonthReportValueDTO.getValue()); - } catch (NoSuchFieldException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { + } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } targetDraftMonthReportValueDTOS.remove(j); From 95a1f639a28cd0c81486de061870c55f6619d2b4 Mon Sep 17 00:00:00 2001 From: bobol Date: Fri, 15 Dec 2023 15:12:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E6=9C=88=E5=BA=95=E7=A8=BF?= =?UTF-8?q?=E8=A1=A8=E4=BA=92=E6=8D=A2=E8=A1=A8=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 3 + .../lzbi/common/config/TargetModelConfig.java | 19 ++ .../DcBusiDataScreenNewController.java | 96 +++++++++ .../lzbi/bi/domain/BoilerStatisticsVO.java | 20 ++ .../com/lzbi/bi/domain/CalorificValueVO.java | 28 +++ .../lzbi/bi/domain/ConsumesStatisticsVO.java | 31 +++ .../lzbi/bi/domain/CorporateStatisticsVO.java | 37 ++++ .../lzbi/bi/domain/DcBusDataScreenNewReq.java | 41 ++++ .../com/lzbi/bi/domain/HeatSuppliedVO.java | 17 ++ ...ovideAnswerWaterAverageTemperatureDTO.java | 15 ++ ...rovideAnswerWaterAverageTemperatureVO.java | 37 ++++ .../com/lzbi/bi/domain/UserIOverViewVO.java | 31 +++ .../bi/mapper/DcBusiDataScreenNewMapper.java | 4 + .../service/DcBusiDataScreenNewService.java | 154 ++++++++++++++ .../DcBusiTargetDraftMonthController.java | 18 +- .../draft/domain/DcBusiTargetDraftDay.java | 191 +++++++++++++++--- .../draft/domain/DcBusiTargetDraftMonth.java | 190 +++-------------- .../mapper/DcBusiTargetDraftDayMapper.java | 43 ++-- .../mapper/DcBusiTargetDraftMonthMapper.java | 40 ++-- .../DcBusiTargetAdjustDayMasterService.java | 56 ++--- .../service/DcBusiTargetDraftDayService.java | 37 ++-- .../DcBusiTargetDraftMonthService.java | 39 ++-- .../com/lzbi/draft/service/ReportService.java | 9 +- ...r.xml => DcBusiTargetDraftMonthMapper.xml} | 22 +- .../draft/DcBusiTargetDraftMonthMapper.xml | 125 ++++++++++-- 25 files changed, 964 insertions(+), 339 deletions(-) create mode 100644 lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java rename lzbi-module/src/main/resources/mapper/asset/{DcBusiTargetDraftDayMapper.xml => DcBusiTargetDraftMonthMapper.xml} (89%) diff --git a/lzbi-admin/src/main/resources/application-dev.yml b/lzbi-admin/src/main/resources/application-dev.yml index 6ca3aa1..ba0b3a5 100644 --- a/lzbi-admin/src/main/resources/application-dev.yml +++ b/lzbi-admin/src/main/resources/application-dev.yml @@ -106,3 +106,6 @@ logging: level: com.lzbi: debug org.springframework: warn +# 指标模板 +target-model: + user: TM00051 diff --git a/lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java b/lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java new file mode 100644 index 0000000..7051558 --- /dev/null +++ b/lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java @@ -0,0 +1,19 @@ +package com.lzbi.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 指标模板 + */ +@Data +@Component +@ConfigurationProperties(prefix = "target-model") +public class TargetModelConfig { + + /** + * 用户 + */ + private String user; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java new file mode 100644 index 0000000..b06cec1 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java @@ -0,0 +1,96 @@ +package com.lzbi.bi.controller; + +import com.lzbi.bi.domain.DcBusDataScreenNewReq; +import com.lzbi.bi.service.DcBusiDataScreenNewService; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 大屏控制器 + * @author : lienbo + * @date : 2023-12-14 + */ +@RestController +@RequestMapping("/assetData/dataScreenNew") +public class DcBusiDataScreenNewController extends BaseController { + + @Autowired + private DcBusiDataScreenNewService dcBusiDataScreenNewService; + + /** + * 用户总览 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/userOverview") + public AjaxResult userOverview (@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getUserOverview(dcBusDataScreenNewReq)); + } + + + /** + * 供/回水均温 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/provideAnswerWaterAverageTemperature") + public AjaxResult provideAnswerWaterAverageTemperature(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getProvideAnswerWaterAverageTemperature(dcBusDataScreenNewReq)); + } + + /** + * 锅炉统计 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/boilerStatistics") + public AjaxResult boilerStatistics(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getBoilerStatistics(dcBusDataScreenNewReq)); + } + + /** + * 消耗 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/consumeStatistics") + public AjaxResult consumeStatistics(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getConsumesStatistics(dcBusDataScreenNewReq)); + } + + /** + * 发热量 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/calorificValue") + public AjaxResult calorificValue(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getCalorificValue(dcBusDataScreenNewReq)); + } + + /** + * 供热量 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/heatSupplied") + public AjaxResult heatSupplied(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getHeatSupplied(dcBusDataScreenNewReq)); + } + + + /** + * 公司统计 + * @param dcBusDataScreenNewReq + * @return + */ + @GetMapping("/corporateStatistics") + public AjaxResult corporateStatistics(@Validated DcBusDataScreenNewReq dcBusDataScreenNewReq) { + return success(dcBusiDataScreenNewService.getCorporateStatistics(dcBusDataScreenNewReq)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java new file mode 100644 index 0000000..761fb78 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java @@ -0,0 +1,20 @@ +package com.lzbi.bi.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 锅炉统计结果 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BoilerStatisticsVO { + + private String label; + + private BigDecimal value; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java new file mode 100644 index 0000000..4cd5004 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java @@ -0,0 +1,28 @@ +package com.lzbi.bi.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 发热量 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CalorificValueVO { + + private String label; + + /** + * 值 + */ + private BigDecimal value; + + /** + * 百分比 + */ + private double percentage; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java new file mode 100644 index 0000000..fca419d --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java @@ -0,0 +1,31 @@ +package com.lzbi.bi.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 消耗统计结果 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ConsumesStatisticsVO { + + private String label; + + /** + * 水耗 + */ + private BigDecimal water; + /** + * 电耗 + */ + private BigDecimal electricity; + /** + * 煤耗 + */ + private BigDecimal coal; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java new file mode 100644 index 0000000..da5aaf3 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java @@ -0,0 +1,37 @@ +package com.lzbi.bi.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 公司统计 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CorporateStatisticsVO { + + /** + * 面积 + */ + private BigDecimal acreage; + + /** + * 发电量 + */ + private BigDecimal outputOfPlant; + + /** + * 产热量 + */ + private BigDecimal calorificValue; + + /** + * 供热量 + */ + private BigDecimal heatSupplied; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java new file mode 100644 index 0000000..7ad1286 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java @@ -0,0 +1,41 @@ +package com.lzbi.bi.domain; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 大屏请求参数 + */ +@Data +public class DcBusDataScreenNewReq { + + /** + * 公司id + */ + @NotNull(message = "请选择公司") + private Long companyId; + + /** + * 组织id + */ + private Long orgId; + + /** + * 指标编码 + */ + private String targetCode; + + /** + * 年月日(yyyy-MM-dd) + */ + @NotBlank(message = "请选择年月日") + private String yearMonthDay; + + private String year; + + private String month; + + private String day; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java new file mode 100644 index 0000000..531b241 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java @@ -0,0 +1,17 @@ +package com.lzbi.bi.domain; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 供热量 + */ +@Data +public class HeatSuppliedVO { + + private List labelArr; + + private List valueArr; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java new file mode 100644 index 0000000..bbec3c5 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java @@ -0,0 +1,15 @@ +package com.lzbi.bi.domain; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class ProvideAnswerWaterAverageTemperatureDTO { + + private String title; + + private BigDecimal provideWaterAverageTemperature; + + private BigDecimal answerWaterAverageTemperature; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java new file mode 100644 index 0000000..2b5459b --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java @@ -0,0 +1,37 @@ +package com.lzbi.bi.domain; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 供、回水均温结果 + */ +@Data +public class ProvideAnswerWaterAverageTemperatureVO { + + /** + * x轴 + */ + private List xArr; + + /** + * 供水均温 + */ + private List yArr1; + + /** + * 回水均温 + */ + private List yArr2; + + @Override + public String toString() { + return "ProvideAnswerWaterAverageTemperatureVO{" + + "xArr=" + xArr + + ", yArr1=" + yArr1 + + ", yArr2=" + yArr2 + + '}'; + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java b/lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java new file mode 100644 index 0000000..a1174ae --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java @@ -0,0 +1,31 @@ +package com.lzbi.bi.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 用户总览结果 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class UserIOverViewVO { + + /** + * 标题 + */ + private String title; + + /** + * 总值 + */ + private BigDecimal total; + + /** + * 实际值 + */ + private BigDecimal real; +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java b/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java new file mode 100644 index 0000000..a4edbf7 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java @@ -0,0 +1,4 @@ +package com.lzbi.bi.mapper; + +public interface DcBusiDataScreenNewMapper { +} diff --git a/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java b/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java new file mode 100644 index 0000000..450992f --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java @@ -0,0 +1,154 @@ +package com.lzbi.bi.service; + +import com.lzbi.bi.domain.*; +import com.lzbi.common.config.TargetModelConfig; +import com.lzbi.common.utils.bean.BeanUtils; +import com.lzbi.draft.domain.DcBusiTargetDraftDay; +import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 大屏业务 + * @author : lienbo + * @date : 2023-12-14 + */ +@Service +public class DcBusiDataScreenNewService { + + @Autowired + private TargetModelConfig targetModelConfig; + + @Resource + private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper; + + public List getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + List list = new ArrayList<>(); +// list.add(new UserIOverViewVO("热源1", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000))); +// list.add(new UserIOverViewVO("热源2", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000))); +// list.add(new UserIOverViewVO("热源3", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000))); +// list.add(new UserIOverViewVO("热源4", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000))); + DcBusiTargetDraftDay params = new DcBusiTargetDraftDay(); + BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq); + String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); + String[] yearMonthDayArr = yearMonthDay.split("-"); + params.setCountYear(yearMonthDayArr[0]); + params.setCountMonth(yearMonthDayArr[1]); + params.setTargetCode(targetModelConfig.getUser()); + List dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params); + if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) { + Map> map; + if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { + map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId)); + } else { + map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode)); + } + Class dcBusiTargetDraftMonthClass = DcBusiTargetDraftDay.class; + map.forEach((key, value) -> { + UserIOverViewVO userIOverViewVO = new UserIOverViewVO(); + if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { + userIOverViewVO.setTitle(value.get(0).getOrgName()); + } else { + userIOverViewVO.setTitle(value.get(0).getAssetName()); + } + BigDecimal plan = new BigDecimal(0); + BigDecimal sum = new BigDecimal(0); + for (int i = 0, len = value.size(); i < len; i++) { + plan = plan.add(value.get(i).getValPlan()); + sum = sum.add(value.get(i).getValSum()); + } + userIOverViewVO.setTotal(plan); + userIOverViewVO.setReal(sum); + list.add(userIOverViewVO); + }); + } + return list; + } + + public ProvideAnswerWaterAverageTemperatureVO getProvideAnswerWaterAverageTemperature(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + ProvideAnswerWaterAverageTemperatureVO provideAnswerWaterAverageTemperatureVO = new ProvideAnswerWaterAverageTemperatureVO(); + String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); + String[] yearMonthDayArr = yearMonthDay.split("-"); + dcBusDataScreenNewReq.setYear(yearMonthDayArr[0]); + dcBusDataScreenNewReq.setMonth(yearMonthDayArr[1]); + List provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(dcBusDataScreenNewReq); + if (CollectionUtils.isNotEmpty(provideAnswerWaterAverageTemperatureDTOS)) { + List xArr = new ArrayList<>(); + List yArr1 = new ArrayList<>(); + List yArr2 = new ArrayList<>(); + provideAnswerWaterAverageTemperatureDTOS.forEach(value -> { + xArr.add(value.getTitle()); + yArr1.add(value.getProvideWaterAverageTemperature()); + yArr2.add(value.getAnswerWaterAverageTemperature()); + }); + provideAnswerWaterAverageTemperatureVO.setXArr(xArr); + provideAnswerWaterAverageTemperatureVO.setYArr1(yArr1); + provideAnswerWaterAverageTemperatureVO.setYArr2(yArr2); + } + return provideAnswerWaterAverageTemperatureVO; + } + + public List getBoilerStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + List list = new ArrayList<>(); + list.add(new BoilerStatisticsVO("热源1", BigDecimal.valueOf(248776))); + list.add(new BoilerStatisticsVO("热源2", BigDecimal.valueOf(248776))); + list.add(new BoilerStatisticsVO("热源3", BigDecimal.valueOf(248776))); + return list; + } + + public List getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + List list = new ArrayList<>(); + list.add(new ConsumesStatisticsVO("热源1", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); + list.add(new ConsumesStatisticsVO("热源2", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); + list.add(new ConsumesStatisticsVO("热源3", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); + list.add(new ConsumesStatisticsVO("热源4", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); + list.add(new ConsumesStatisticsVO("热源5", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); + return list; + } + + public List getCalorificValue(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + List list = new ArrayList<>(); + list.add(new CalorificValueVO("热源1", BigDecimal.valueOf(7897), 17)); + list.add(new CalorificValueVO("热源2", BigDecimal.valueOf(9766), 21)); + list.add(new CalorificValueVO("热源3", BigDecimal.valueOf(5571), 12)); + list.add(new CalorificValueVO("热源4", BigDecimal.valueOf(7897), 17)); + list.add(new CalorificValueVO("热源5", BigDecimal.valueOf(9766), 21)); + list.add(new CalorificValueVO("热源6", BigDecimal.valueOf(5571), 12)); + return list; + } + + public HeatSuppliedVO getHeatSupplied(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + HeatSuppliedVO heatSuppliedVO = new HeatSuppliedVO(); + List labelArr = new ArrayList<>(); + List valueArr = new ArrayList<>(); + labelArr.add("热源1"); + labelArr.add("热源2"); + labelArr.add("热源3"); + labelArr.add("热源4"); + labelArr.add("热源5"); + labelArr.add("热源6"); + valueArr.add(BigDecimal.valueOf(300)); + valueArr.add(BigDecimal.valueOf(500)); + valueArr.add(BigDecimal.valueOf(300)); + valueArr.add(BigDecimal.valueOf(100)); + valueArr.add(BigDecimal.valueOf(500)); + valueArr.add(BigDecimal.valueOf(100)); + heatSuppliedVO.setLabelArr(labelArr); + heatSuppliedVO.setValueArr(valueArr); + return heatSuppliedVO; + } + + public CorporateStatisticsVO getCorporateStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { + CorporateStatisticsVO corporateStatisticsVO = new CorporateStatisticsVO(); + return new CorporateStatisticsVO(BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java index 6f39409..f8489a9 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java @@ -3,6 +3,7 @@ package com.lzbi.draft.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.lzbi.draft.domain.DcBusiTargetDraftMonth; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -20,7 +21,6 @@ import com.lzbi.common.annotation.Log; import com.lzbi.common.core.controller.BaseController; import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.enums.BusinessType; -import com.lzbi.draft.domain. DcBusiTargetDraftMonth; import com.lzbi.draft.service.DcBusiTargetDraftMonthService; import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.core.page.TableDataInfo; @@ -36,7 +36,7 @@ import com.lzbi.common.core.page.TableDataInfo; public class DcBusiTargetDraftMonthController extends BaseController { @Autowired - private DcBusiTargetDraftMonthService dcBusiTargetDraftMonthService; + private DcBusiTargetDraftMonthService dcBusiTargetDraftDayService; /** * 查询指标数据底稿(月)列表 @@ -50,7 +50,7 @@ public class DcBusiTargetDraftMonthController extends BaseController public TableDataInfo list(DcBusiTargetDraftMonth DcBusiTargetDraftMonth) { startPage(); - List< DcBusiTargetDraftMonth> list = dcBusiTargetDraftMonthService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); + List list = dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); return getDataTable(list); } @@ -66,8 +66,8 @@ public class DcBusiTargetDraftMonthController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, DcBusiTargetDraftMonth DcBusiTargetDraftMonth) { - List< DcBusiTargetDraftMonth> list = dcBusiTargetDraftMonthService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); - ExcelUtil< DcBusiTargetDraftMonth> util = new ExcelUtil(DcBusiTargetDraftMonth.class); + List list = dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); + ExcelUtil util = new ExcelUtil(DcBusiTargetDraftMonth.class); util.exportExcel(response, list, "指标数据底稿(月)数据"); } @@ -82,7 +82,7 @@ public class DcBusiTargetDraftMonthController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(dcBusiTargetDraftMonthService.selectDcBusiTargetDraftMonthById(id)); + return success(dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthById(id)); } /** @@ -97,7 +97,7 @@ public class DcBusiTargetDraftMonthController extends BaseController @PostMapping public AjaxResult add(@RequestBody DcBusiTargetDraftMonth DcBusiTargetDraftMonth) { - return toAjax(dcBusiTargetDraftMonthService.insertDcBusiTargetDraftMonth(DcBusiTargetDraftMonth)); + return toAjax(dcBusiTargetDraftDayService.insertDcBusiTargetDraftMonth(DcBusiTargetDraftMonth)); } /** @@ -113,7 +113,7 @@ public class DcBusiTargetDraftMonthController extends BaseController @PutMapping public AjaxResult edit(@RequestBody DcBusiTargetDraftMonth DcBusiTargetDraftMonth) { - return toAjax(dcBusiTargetDraftMonthService.updateDcBusiTargetDraftMonth(DcBusiTargetDraftMonth)); + return toAjax(dcBusiTargetDraftDayService.updateDcBusiTargetDraftMonth(DcBusiTargetDraftMonth)); } /** @@ -128,6 +128,6 @@ public class DcBusiTargetDraftMonthController extends BaseController @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(dcBusiTargetDraftMonthService.deleteDcBusiTargetDraftMonthByIds(ids)); + return toAjax(dcBusiTargetDraftDayService.deleteDcBusiTargetDraftMonthByIds(ids)); } } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java index 4e5f7bd..7f33196 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java @@ -1,18 +1,18 @@ package com.lzbi.draft.domain; import java.math.BigDecimal; +import java.util.Date; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; import lombok.experimental.Accessors; /** - * 指标数据底稿(日)对象 dc_busi_target_draft_day + * 指标数据底稿(月)对象 dc_busi_target_draft_month * - * @author win - * @date 2023-11-28 + * @author zhousq + * @date 2023-12-06 */ @Data @Accessors(chain = true) @@ -27,12 +27,10 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity @Excel(name = "公司名称") private String companyName; - /** 公司编码 */ - @Excel(name = "公司编码") + /** 公司ID */ private Long companyId; - /** 组织机构代码 */ - @Excel(name = "组织机构代码") + /** 组织机构ID */ private Long orgId; /** 组织机构名称 */ @@ -47,15 +45,18 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity @Excel(name = "统计单元名称") private String assetName; + /** 所属专业编码 */ @Excel(name = "所属专业编码") - private String fieldCode ; + private String fieldCode; + /** 所属专业名称 */ @Excel(name = "所属专业名称") - private String fieldName ; - /** 指标别名 */ + private String fieldName; + /** 指标别名 */ @Excel(name = "指标别名") - private String targetNameAlias ; + private String targetNameAlias; + /** 指标名称 */ @Excel(name = "指标名称") private String targetName; @@ -68,24 +69,164 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity @Excel(name = "指标单位") private String targetUint; - /** 年月日【yyyy-mm-dd】 */ - @Excel(name = "年月日【yyyy-mm-dd】") - private String countDate; + /** 年 */ + @Excel(name = "年") + private String countYear; + + /** 月 */ + @Excel(name = "月") + private String countMonth; - /** 原值 */ - @Excel(name = "原值") - private BigDecimal valOriginal; + /** 和值 */ + @Excel(name = "和值") + private BigDecimal valSum; - /** 调整值 */ - @Excel(name = "调整值") - private BigDecimal valAdjust; + /** 均值 */ + @Excel(name = "均值") + private BigDecimal valAvgAll; - /** 结果值 */ - @Excel(name = "结果值") - private BigDecimal valResult; + /** 非空均值 */ + @Excel(name = "非空均值") + private BigDecimal valAvgNull; /** 计划值 */ @Excel(name = "计划值") - private String valPlan; + private BigDecimal valPlan; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + private Date updatedTime; + + /** 1日 */ + @Excel(name = "1日") + private BigDecimal valP1; + + /** 2日 */ + @Excel(name = "2日") + private BigDecimal valP2; + + /** 3日 */ + @Excel(name = "3日") + private BigDecimal valP3; + + /** 4日 */ + @Excel(name = "4日") + private BigDecimal valP4; + + /** 5日 */ + @Excel(name = "5日") + private BigDecimal valP5; + + /** 6日 */ + @Excel(name = "6日") + private BigDecimal valP6; + + /** 7日 */ + @Excel(name = "7日") + private BigDecimal valP7; + + /** 8日 */ + @Excel(name = "8日") + private BigDecimal valP8; + + /** 9日 */ + @Excel(name = "9日") + private BigDecimal valP9; + + /** 10日 */ + @Excel(name = "10日") + private BigDecimal valP10; + + /** 11日 */ + @Excel(name = "11日") + private BigDecimal valP11; + + /** 12日 */ + @Excel(name = "12日") + private BigDecimal valP12; + + /** 13日 */ + @Excel(name = "13日") + private BigDecimal valP13; + + /** 14日 */ + @Excel(name = "14日") + private BigDecimal valP14; + + /** 15日 */ + @Excel(name = "15日") + private BigDecimal valP15; + + /** 16日 */ + @Excel(name = "16日") + private BigDecimal valP16; + + /** 17日 */ + @Excel(name = "17日") + private BigDecimal valP17; + + /** 18日 */ + @Excel(name = "18日") + private BigDecimal valP18; + + /** 19日 */ + @Excel(name = "19日") + private BigDecimal valP19; + + /** 20日 */ + @Excel(name = "20日") + private BigDecimal valP20; + + /** 21日 */ + @Excel(name = "21日") + private BigDecimal valP21; + + /** 22日 */ + @Excel(name = "22日") + private BigDecimal valP22; + + /** 23日 */ + @Excel(name = "23日") + private BigDecimal valP23; + + /** 24日 */ + @Excel(name = "24日") + private BigDecimal valP24; + + /** 25日 */ + @Excel(name = "25日") + private BigDecimal valP25; + + /** 26日 */ + @Excel(name = "26日") + private BigDecimal valP26; + + /** 27日 */ + @Excel(name = "27日") + private BigDecimal valP27; + + /** 28日 */ + @Excel(name = "28日") + private BigDecimal valP28; + + /** 29日 */ + @Excel(name = "29日") + private BigDecimal valP29; + + /** 30日 */ + @Excel(name = "30日") + private BigDecimal valP30; + + /** 31日 */ + @Excel(name = "31日") + private BigDecimal valP31; } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java index 954e627..ddd779a 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java @@ -1,7 +1,6 @@ package com.lzbi.draft.domain; import java.math.BigDecimal; -import java.util.Date; import lombok.Data; import com.lzbi.common.annotation.Excel; @@ -9,10 +8,10 @@ import com.lzbi.module.base.BaseModuleEntity; import lombok.experimental.Accessors; /** - * 指标数据底稿(月)对象 dc_busi_target_draft_month + * 指标数据底稿(日)对象 dc_busi_target_draft_day * - * @author zhousq - * @date 2023-12-06 + * @author win + * @date 2023-11-28 */ @Data @Accessors(chain = true) @@ -27,10 +26,12 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity @Excel(name = "公司名称") private String companyName; - /** 公司ID */ + /** 公司编码 */ + @Excel(name = "公司编码") private Long companyId; - /** 组织机构ID */ + /** 组织机构代码 */ + @Excel(name = "组织机构代码") private Long orgId; /** 组织机构名称 */ @@ -45,18 +46,15 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity @Excel(name = "统计单元名称") private String assetName; - /** 所属专业编码 */ @Excel(name = "所属专业编码") - private String fieldCode; - + private String fieldCode ; /** 所属专业名称 */ @Excel(name = "所属专业名称") - private String fieldName; - + private String fieldName ; /** 指标别名 */ - @Excel(name = "指标别名") - private String targetNameAlias; + @Excel(name = "指标别名") + private String targetNameAlias ; /** 指标名称 */ @Excel(name = "指标名称") private String targetName; @@ -69,164 +67,24 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity @Excel(name = "指标单位") private String targetUint; - /** 年 */ - @Excel(name = "年") - private String countYear; - - /** 月 */ - @Excel(name = "月") - private String countMonth; + /** 年月日【yyyy-mm-dd】 */ + @Excel(name = "年月日【yyyy-mm-dd】") + private String countDate; - /** 和值 */ - @Excel(name = "和值") - private BigDecimal valSum; + /** 原值 */ + @Excel(name = "原值") + private BigDecimal valOriginal; - /** 均值 */ - @Excel(name = "均值") - private BigDecimal valAvgAll; + /** 调整值 */ + @Excel(name = "调整值") + private BigDecimal valAdjust; - /** 非空均值 */ - @Excel(name = "非空均值") - private BigDecimal valAvgNull; + /** 结果值 */ + @Excel(name = "结果值") + private BigDecimal valResult; /** 计划值 */ @Excel(name = "计划值") - private BigDecimal valPlan; - - /** 创建人 */ - private String createdBy; - - /** 创建时间 */ - private Date createdTime; - - /** 更新人 */ - private String updatedBy; - - /** 更新时间 */ - private Date updatedTime; - - /** 1日 */ - @Excel(name = "1日") - private BigDecimal valP1; - - /** 2日 */ - @Excel(name = "2日") - private BigDecimal valP2; - - /** 3日 */ - @Excel(name = "3日") - private BigDecimal valP3; - - /** 4日 */ - @Excel(name = "4日") - private BigDecimal valP4; - - /** 5日 */ - @Excel(name = "5日") - private BigDecimal valP5; - - /** 6日 */ - @Excel(name = "6日") - private BigDecimal valP6; - - /** 7日 */ - @Excel(name = "7日") - private BigDecimal valP7; - - /** 8日 */ - @Excel(name = "8日") - private BigDecimal valP8; - - /** 9日 */ - @Excel(name = "9日") - private BigDecimal valP9; - - /** 10日 */ - @Excel(name = "10日") - private BigDecimal valP10; - - /** 11日 */ - @Excel(name = "11日") - private BigDecimal valP11; - - /** 12日 */ - @Excel(name = "12日") - private BigDecimal valP12; - - /** 13日 */ - @Excel(name = "13日") - private BigDecimal valP13; - - /** 14日 */ - @Excel(name = "14日") - private BigDecimal valP14; - - /** 15日 */ - @Excel(name = "15日") - private BigDecimal valP15; - - /** 16日 */ - @Excel(name = "16日") - private BigDecimal valP16; - - /** 17日 */ - @Excel(name = "17日") - private BigDecimal valP17; - - /** 18日 */ - @Excel(name = "18日") - private BigDecimal valP18; - - /** 19日 */ - @Excel(name = "19日") - private BigDecimal valP19; - - /** 20日 */ - @Excel(name = "20日") - private BigDecimal valP20; - - /** 21日 */ - @Excel(name = "21日") - private BigDecimal valP21; - - /** 22日 */ - @Excel(name = "22日") - private BigDecimal valP22; - - /** 23日 */ - @Excel(name = "23日") - private BigDecimal valP23; - - /** 24日 */ - @Excel(name = "24日") - private BigDecimal valP24; - - /** 25日 */ - @Excel(name = "25日") - private BigDecimal valP25; - - /** 26日 */ - @Excel(name = "26日") - private BigDecimal valP26; - - /** 27日 */ - @Excel(name = "27日") - private BigDecimal valP27; - - /** 28日 */ - @Excel(name = "28日") - private BigDecimal valP28; - - /** 29日 */ - @Excel(name = "29日") - private BigDecimal valP29; - - /** 30日 */ - @Excel(name = "30日") - private BigDecimal valP30; - - /** 31日 */ - @Excel(name = "31日") - private BigDecimal valP31; + private String valPlan; } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java index 6d0269a..9accaa7 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java @@ -2,63 +2,74 @@ package com.lzbi.draft.mapper; import java.util.List; +import com.lzbi.bi.domain.DcBusDataScreenNewReq; +import com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO; import com.lzbi.draft.domain.DcBusiTargetDraftDay; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; +import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; +import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; /** - * 指标数据底稿(日)Mapper接口 + * 指标数据底稿(月)Mapper接口 * - * @author win - * @date 2023-11-28 + * @author zhousq + * @date 2023-12-06 */ public interface DcBusiTargetDraftDayMapper extends BaseMapper { /** - * 查询指标数据底稿(日) + * 查询指标数据底稿(月) * - * @param id 指标数据底稿(日)主键 - * @return 指标数据底稿(日) + * @param id 指标数据底稿(月)主键 + * @return 指标数据底稿(月) */ public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id); /** - * 查询指标数据底稿(日)列表 + * 查询指标数据底稿(月)列表 * - * @param dcBusiTargetDraftDay 指标数据底稿(日) - * @return 指标数据底稿(日)集合 + * @param dcBusiTargetDraftDay 指标数据底稿(月) + * @return 指标数据底稿(月)集合 */ public List selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay); + List selectProvideAnswerWaterAverageTemperatureList(DcBusDataScreenNewReq dcBusDataScreenNewReq); + /** - * 新增指标数据底稿(日) + * 新增指标数据底稿(月) * - * @param dcBusiTargetDraftDay 指标数据底稿(日) + * @param dcBusiTargetDraftDay 指标数据底稿(月) * @return 结果 */ public int insertDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay); /** - * 修改指标数据底稿(日) + * 修改指标数据底稿(月) * - * @param dcBusiTargetDraftDay 指标数据底稿(日) + * @param dcBusiTargetDraftDay 指标数据底稿(月) * @return 结果 */ public int updateDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay); /** - * 删除指标数据底稿(日) + * 删除指标数据底稿(月) * - * @param id 指标数据底稿(日)主键 + * @param id 指标数据底稿(月)主键 * @return 结果 */ public int deleteDcBusiTargetDraftDayById(Long id); /** - * 批量删除指标数据底稿(日) + * 批量删除指标数据底稿(月) * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteDcBusiTargetDraftDayByIds(Long[] ids); + + List selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq); + + List selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java index 6badb8c..8b76131 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java @@ -1,70 +1,64 @@ package com.lzbi.draft.mapper; import java.util.List; + import com.lzbi.draft.domain.DcBusiTargetDraftMonth; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; -import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; -import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; /** - * 指标数据底稿(月)Mapper接口 + * 指标数据底稿(日)Mapper接口 * - * @author zhousq - * @date 2023-12-06 + * @author win + * @date 2023-11-28 */ public interface DcBusiTargetDraftMonthMapper extends BaseMapper { /** - * 查询指标数据底稿(月) + * 查询指标数据底稿(日) * - * @param id 指标数据底稿(月)主键 - * @return 指标数据底稿(月) + * @param id 指标数据底稿(日)主键 + * @return 指标数据底稿(日) */ public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id); /** - * 查询指标数据底稿(月)列表 + * 查询指标数据底稿(日)列表 * - * @param dcBusiTargetDraftMonth 指标数据底稿(月) - * @return 指标数据底稿(月)集合 + * @param dcBusiTargetDraftMonth 指标数据底稿(日) + * @return 指标数据底稿(日)集合 */ public List selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); /** - * 新增指标数据底稿(月) + * 新增指标数据底稿(日) * - * @param dcBusiTargetDraftMonth 指标数据底稿(月) + * @param dcBusiTargetDraftMonth 指标数据底稿(日) * @return 结果 */ public int insertDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); /** - * 修改指标数据底稿(月) + * 修改指标数据底稿(日) * - * @param dcBusiTargetDraftMonth 指标数据底稿(月) + * @param dcBusiTargetDraftMonth 指标数据底稿(日) * @return 结果 */ public int updateDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); /** - * 删除指标数据底稿(月) + * 删除指标数据底稿(日) * - * @param id 指标数据底稿(月)主键 + * @param id 指标数据底稿(日)主键 * @return 结果 */ public int deleteDcBusiTargetDraftMonthById(Long id); /** - * 批量删除指标数据底稿(月) + * 批量删除指标数据底稿(日) * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteDcBusiTargetDraftMonthByIds(Long[] ids); - - List selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq); - - List selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java b/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java index 9190353..abe053d 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java @@ -8,10 +8,10 @@ import com.lzbi.common.core.domain.entity.SysDept; import com.lzbi.common.utils.DateUtils; import com.lzbi.draft.domain.DcBusiTargetAdjustDayMasterDao; import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao; -import com.lzbi.draft.domain.DcBusiTargetDraftDay; +import com.lzbi.draft.domain.DcBusiTargetDraftMonth; import com.lzbi.draft.mapper.DcBusiTargetAdjustDayMasterMapper; import com.lzbi.draft.mapper.DcBusiTargetAdjustDaySubMapper; -import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; +import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; import com.lzbi.special.domain.DcBaseWorkSpecial; import com.lzbi.special.mapper.DcBaseWorkSpecialMapper; import com.lzbi.system.service.impl.SysDeptServiceImpl; @@ -54,7 +54,7 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl dcBusiTargetAdjustDaySubDaoList = dcBusiTargetAdjustDaySubMapper.selectDcBusiTargetAdjustDaySubDaoList(params); // 遍历子表集合,向指标数据底稿表(日)中同步数据 for (DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao : dcBusiTargetAdjustDaySubDaoList) { - DcBusiTargetDraftDay dcBusiTargetDraftDay = new DcBusiTargetDraftDay(); - dcBusiTargetDraftDay.setCompanyId(dcBusiTargetAdjustDayMasterDao.getCompanyId()); - dcBusiTargetDraftDay.setOrgId(dcBusiTargetAdjustDayMasterDao.getOragnizeId()); - dcBusiTargetDraftDay.setAssetCode(dcBusiTargetAdjustDayMasterDao.getAssetCode()); - dcBusiTargetDraftDay.setFieldCode(dcBusiTargetAdjustDayMasterDao.getFieldCode()); - dcBusiTargetDraftDay.setTargetCode(dcBusiTargetAdjustDaySubDao.getTargetCode()); - List dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(dcBusiTargetDraftDay); + DcBusiTargetDraftMonth dcBusiTargetDraftMonth = new DcBusiTargetDraftMonth(); + dcBusiTargetDraftMonth.setCompanyId(dcBusiTargetAdjustDayMasterDao.getCompanyId()); + dcBusiTargetDraftMonth.setOrgId(dcBusiTargetAdjustDayMasterDao.getOragnizeId()); + dcBusiTargetDraftMonth.setAssetCode(dcBusiTargetAdjustDayMasterDao.getAssetCode()); + dcBusiTargetDraftMonth.setFieldCode(dcBusiTargetAdjustDayMasterDao.getFieldCode()); + dcBusiTargetDraftMonth.setTargetCode(dcBusiTargetAdjustDaySubDao.getTargetCode()); + List dcBusiTargetDraftMonthList = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMonthList(dcBusiTargetDraftMonth); // 如果未查询出来指标数据底稿数据,就新增,否则修改 - if (CollectionUtils.isEmpty(dcBusiTargetDraftDayList)) { - dcBusiTargetDraftDay.setCompanyName(dcBusiTargetAdjustDayMasterDao.getCompanyName()); - dcBusiTargetDraftDay.setOrgName(dcBusiTargetAdjustDayMasterDao.getOrganizeName()); - dcBusiTargetDraftDay.setAssetName(dcBusiTargetAdjustDayMasterDao.getAssetName()); - dcBusiTargetDraftDay.setFieldName(dcBusiTargetAdjustDayMasterDao.getFieldName()); - dcBusiTargetDraftDay.setTargetName(dcBusiTargetAdjustDaySubDao.getTargetName()); - dcBusiTargetDraftDay.setTargetUint(dcBusiTargetAdjustDaySubDao.getTagetUnit()); - dcBusiTargetDraftDay.setCountDate(dcBusiTargetAdjustDayMasterDao.getDateAdjust()); - dcBusiTargetDraftDay.setValOriginal(dcBusiTargetAdjustDaySubDao.getValOrigin()); - dcBusiTargetDraftDay.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); - dcBusiTargetDraftDay.setValResult(dcBusiTargetAdjustDaySubDao.getValResult()); - dcBusiTargetDraftDayMapper.insertDcBusiTargetDraftDay(dcBusiTargetDraftDay); + if (CollectionUtils.isEmpty(dcBusiTargetDraftMonthList)) { + dcBusiTargetDraftMonth.setCompanyName(dcBusiTargetAdjustDayMasterDao.getCompanyName()); + dcBusiTargetDraftMonth.setOrgName(dcBusiTargetAdjustDayMasterDao.getOrganizeName()); + dcBusiTargetDraftMonth.setAssetName(dcBusiTargetAdjustDayMasterDao.getAssetName()); + dcBusiTargetDraftMonth.setFieldName(dcBusiTargetAdjustDayMasterDao.getFieldName()); + dcBusiTargetDraftMonth.setTargetName(dcBusiTargetAdjustDaySubDao.getTargetName()); + dcBusiTargetDraftMonth.setTargetUint(dcBusiTargetAdjustDaySubDao.getTagetUnit()); + dcBusiTargetDraftMonth.setCountDate(dcBusiTargetAdjustDayMasterDao.getDateAdjust()); + dcBusiTargetDraftMonth.setValOriginal(dcBusiTargetAdjustDaySubDao.getValOrigin()); + dcBusiTargetDraftMonth.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); + dcBusiTargetDraftMonth.setValResult(dcBusiTargetAdjustDaySubDao.getValResult()); + dcBusiTargetDraftMonthMapper.insertDcBusiTargetDraftMonth(dcBusiTargetDraftMonth); } else { - dcBusiTargetDraftDay = dcBusiTargetDraftDayList.get(0); - BigDecimal valResult = dcBusiTargetDraftDay.getValResult().add(new BigDecimal(0)); - dcBusiTargetDraftDay.setValOriginal(valResult); - dcBusiTargetDraftDay.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); - dcBusiTargetDraftDay.setValResult(valResult.add(dcBusiTargetAdjustDaySubDao.getValAdjust())); - dcBusiTargetDraftDayMapper.updateDcBusiTargetDraftDay(dcBusiTargetDraftDay); + dcBusiTargetDraftMonth = dcBusiTargetDraftMonthList.get(0); + BigDecimal valResult = dcBusiTargetDraftMonth.getValResult().add(new BigDecimal(0)); + dcBusiTargetDraftMonth.setValOriginal(valResult); + dcBusiTargetDraftMonth.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); + dcBusiTargetDraftMonth.setValResult(valResult.add(dcBusiTargetAdjustDaySubDao.getValAdjust())); + dcBusiTargetDraftMonthMapper.updateDcBusiTargetDraftMonth(dcBusiTargetDraftMonth); } } // 修改审核状态为已处理 diff --git a/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java b/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java index 1d7c9b5..7aeb132 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java @@ -1,28 +1,27 @@ package com.lzbi.draft.service; import java.util.List; - -import com.lzbi.draft.domain.DcBusiTargetDraftDay; import com.lzbi.common.utils.DateUtils; +import com.lzbi.draft.domain.DcBusiTargetDraftDay; import org.springframework.stereotype.Service; import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** - * 指标数据底稿(日)Service业务层处理 + * 指标数据底稿(月)Service业务层处理 * - * @author win - * @date 2023-11-28 + * @author zhousq + * @date 2023-12-06 */ @Service public class DcBusiTargetDraftDayService extends ServiceImpl implements IService { /** - * 查询指标数据底稿(日) + * 查询指标数据底稿(月) * - * @param id 指标数据底稿(日)主键 - * @return 指标数据底稿(日) + * @param id 指标数据底稿(月)主键 + * @return 指标数据底稿(月) */ public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id) { @@ -30,10 +29,10 @@ public class DcBusiTargetDraftDayService extends ServiceImpl selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay) { @@ -41,9 +40,9 @@ public class DcBusiTargetDraftDayService extends ServiceImpl implements IService { /** - * 查询指标数据底稿(月) + * 查询指标数据底稿(日) * - * @param id 指标数据底稿(月)主键 - * @return 指标数据底稿(月) + * @param id 指标数据底稿(日)主键 + * @return 指标数据底稿(日) */ public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id) { @@ -29,10 +30,10 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth dcBusiTargetDraftMonth) { @@ -40,9 +41,9 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl getTargetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) { Class targetDraftMonthReportVOClass = TargetDraftMonthReportVO.class; - List list = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportVO(targetDraftMonthReportReq); + List list = dcBusiTargetDraftDayMapper.selectTargetDraftMonthReportVO(targetDraftMonthReportReq); CountDownLatch countDownLatch = new CountDownLatch(TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR.length); for (String targetModelCode : TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR) { threadPoolTaskExecutor.execute(() -> { TargetDraftMonthReportReq req = JSONObject.parseObject(JSONObject.toJSONString(targetDraftMonthReportReq), TargetDraftMonthReportReq.class); req.setTargetModelCode(targetModelCode); - List targetDraftMonthReportValueDTOS = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportValue(req); + List targetDraftMonthReportValueDTOS = dcBusiTargetDraftDayMapper.selectTargetDraftMonthReportValue(req); log.info("{} 执行完成,结果是 {}", targetModelCode, targetDraftMonthReportValueDTOS); for (int i = 0, len = list.size(); i < len; i++) { TargetDraftMonthReportVO targetDraftMonthReportVO = list.get(i); diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDayMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml similarity index 89% rename from lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDayMapper.xml rename to lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml index afe55e1..e022859 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDayMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_date, val_original, val_adjust, val_result, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_draft_day - + and company_id = #{companyId} and org_id = #{orgId} @@ -49,12 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + where id = #{id} - + insert into dc_busi_target_draft_day company_name, @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update dc_busi_target_draft_day company_name = #{companyName}, @@ -141,11 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + delete from dc_busi_target_draft_day where id = #{id} - + delete from dc_busi_target_draft_day where id in #{id} diff --git a/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml b/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml index f96d6ae..f4a7873 100644 --- a/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml +++ b/lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -65,12 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_year, count_month, val_sum, val_avg_all, val_avg_null, val_plan, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, val_p1, val_p2, val_p3, val_p4, val_p5, val_p6, val_p7, val_p8, val_p9, val_p10, val_p11, val_p12, val_p13, val_p14, val_p15, val_p16, val_p17, val_p18, val_p19, val_p20, val_p21, val_p22, val_p23, val_p24, val_p25, val_p26, val_p27, val_p28, val_p29, val_p30, val_p31 from dc_busi_target_draft_month + + select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_year, count_month, val_sum, val_avg_all, val_avg_null, val_plan, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, val_p1, val_p2, val_p3, val_p4, val_p5, val_p6, val_p7, val_p8, val_p9, val_p10, val_p11, val_p12, val_p13, val_p14, val_p15, val_p16, val_p17, val_p18, val_p19, val_p20, val_p21, val_p22, val_p23, val_p24, val_p25, val_p26, val_p27, val_p28, val_p29, val_p30, val_p31 from dc_busi_target_draft_day - + and company_id = #{companyId} and org_id = #{orgId} @@ -83,9 +83,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and val_p1 = #{valP1} + + - + where id = #{id} @@ -96,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.asset_code AS "assetCode", sum( t1.val_avg_all ) AS "value" FROM - dc_busi_target_draft_month t1 + dc_busi_target_draft_day t1 INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code AND t1.asset_code = t2.asset_code WHERE @@ -113,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parameterType="com.lzbi.draft.entity.req.TargetDraftMonthReportReq" resultType="com.lzbi.draft.entity.vo.TargetDraftMonthReportVO"> SELECT t1.asset_code AS "assetCode", max(t1.asset_name) AS "assetName" - FROM `dc_busi_target_draft_month` t1 + FROM `dc_busi_target_draft_day` t1 WHERE t1.company_id = #{companyId} AND t1.org_id = #{orgId} @@ -124,8 +213,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.asset_code - - insert into dc_busi_target_draft_month + + insert into dc_busi_target_draft_day company_name, company_id, @@ -246,8 +335,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - update dc_busi_target_draft_month + + update dc_busi_target_draft_day company_name = #{companyName}, company_id = #{companyId}, @@ -310,12 +399,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - - delete from dc_busi_target_draft_month where id = #{id} + + delete from dc_busi_target_draft_day where id = #{id} - - delete from dc_busi_target_draft_month where id in + + delete from dc_busi_target_draft_day where id in #{id}