Browse Source

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

develop
zhousq 11 months ago
parent
commit
78e72866f2
  1. 3
      lzbi-admin/src/main/resources/application-dev.yml
  2. 19
      lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java
  3. 2
      lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java
  4. 96
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java
  5. 20
      lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java
  6. 28
      lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java
  7. 31
      lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java
  8. 37
      lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java
  9. 41
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java
  10. 17
      lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java
  11. 15
      lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java
  12. 37
      lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java
  13. 31
      lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java
  14. 4
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java
  15. 154
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java
  16. 18
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java
  17. 31
      lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java
  18. 191
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java
  19. 190
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java
  20. 22
      lzbi-module/src/main/java/com/lzbi/draft/entity/dto/TargetDraftMonthReportValueDTO.java
  21. 42
      lzbi-module/src/main/java/com/lzbi/draft/entity/req/TargetDraftMonthReportReq.java
  22. 144
      lzbi-module/src/main/java/com/lzbi/draft/entity/vo/TargetDraftMonthReportVO.java
  23. 43
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java
  24. 33
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java
  25. 56
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java
  26. 37
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java
  27. 39
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftMonthService.java
  28. 67
      lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java
  29. 22
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml
  30. 158
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml

3
lzbi-admin/src/main/resources/application-dev.yml

@ -106,3 +106,6 @@ logging:
level:
com.lzbi: debug
org.springframework: warn
# 指标模板
target-model:
user: TM00051

19
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;
}

2
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()

96
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));
}
}

20
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;
}

28
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;
}

31
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;
}

37
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;
}

41
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;
}

17
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<String> labelArr;
private List<BigDecimal> valueArr;
}

15
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;
}

37
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<String> xArr;
/**
* 供水均温
*/
private List<BigDecimal> yArr1;
/**
* 回水均温
*/
private List<BigDecimal> yArr2;
@Override
public String toString() {
return "ProvideAnswerWaterAverageTemperatureVO{" +
"xArr=" + xArr +
", yArr1=" + yArr1 +
", yArr2=" + yArr2 +
'}';
}
}

31
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;
}

4
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java

@ -0,0 +1,4 @@
package com.lzbi.bi.mapper;
public interface DcBusiDataScreenNewMapper {
}

154
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<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<UserIOverViewVO> 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<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
Map<Object, List<DcBusiTargetDraftDay>> map;
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId));
} else {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
}
Class<DcBusiTargetDraftDay> 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<ProvideAnswerWaterAverageTemperatureDTO> provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(dcBusDataScreenNewReq);
if (CollectionUtils.isNotEmpty(provideAnswerWaterAverageTemperatureDTOS)) {
List<String> xArr = new ArrayList<>();
List<BigDecimal> yArr1 = new ArrayList<>();
List<BigDecimal> 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<BoilerStatisticsVO> getBoilerStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<BoilerStatisticsVO> 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<ConsumesStatisticsVO> getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<ConsumesStatisticsVO> 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<CalorificValueVO> getCalorificValue(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<CalorificValueVO> 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<String> labelArr = new ArrayList<>();
List<BigDecimal> 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));
}
}

18
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<DcBusiTargetDraftMonth> 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>(DcBusiTargetDraftMonth.class);
List<DcBusiTargetDraftMonth> list = dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth);
ExcelUtil<DcBusiTargetDraftMonth> util = new ExcelUtil<DcBusiTargetDraftMonth>(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));
}
}

31
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<TargetDraftMonthReportVO> targetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) {
return reportService.getTargetDraftMonthReport(targetDraftMonthReportReq);
}
}

191
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;
}

190
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;
}

22
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;
}

42
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;
}

144
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;
}

43
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<DcBusiTargetDraftDay>
{
/**
* 查询指标数据底稿()
* 查询指标数据底稿()
*
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
*/
public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id);
/**
* 查询指标数据底稿()列表
* 查询指标数据底稿()列表
*
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 指标数据底稿()集合
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 指标数据底稿()集合
*/
public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay);
List<ProvideAnswerWaterAverageTemperatureDTO> 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<TargetDraftMonthReportValueDTO> selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq);
List<TargetDraftMonthReportVO> selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq);
}

33
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java

@ -1,60 +1,61 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 指标数据底稿()Mapper接口
* 指标数据底稿()Mapper接口
*
* @author zhousq
* @date 2023-12-06
* @author win
* @date 2023-11-28
*/
public interface DcBusiTargetDraftMonthMapper extends BaseMapper<DcBusiTargetDraftMonth>
{
/**
* 查询指标数据底稿()
* 查询指标数据底稿()
*
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
*/
public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id);
/**
* 查询指标数据底稿()列表
* 查询指标数据底稿()列表
*
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 指标数据底稿()集合
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 指标数据底稿()集合
*/
public List<DcBusiTargetDraftMonth> 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 结果

56
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<DcBusiTarget
private DcBaseWorkSpecialMapper dcBaseWorkSpecialMapper;
@Resource
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper;
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper;
private static final Lock lock = new ReentrantLock();
@ -229,33 +229,33 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl<DcBusiTarget
List<DcBusiTargetAdjustDaySubDao> 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<DcBusiTargetDraftDay> 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<DcBusiTargetDraftMonth> 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);
}
}
// 修改审核状态为已处理

37
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<DcBusiTargetDraftDayMapper, DcBusiTargetDraftDay> implements IService<DcBusiTargetDraftDay>
{
/**
* 查询指标数据底稿()
* 查询指标数据底稿()
*
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
*/
public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id)
{
@ -30,10 +29,10 @@ public class DcBusiTargetDraftDayService extends ServiceImpl<DcBusiTargetDraftDa
}
/**
* 查询指标数据底稿()列表
* 查询指标数据底稿()列表
*
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 指标数据底稿()
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 指标数据底稿()
*/
public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay)
{
@ -41,9 +40,9 @@ public class DcBusiTargetDraftDayService extends ServiceImpl<DcBusiTargetDraftDa
}
/**
* 新增指标数据底稿()
* 新增指标数据底稿()
*
* @param dcBusiTargetDraftDay 指标数据底稿()
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 结果
*/
@ -54,9 +53,9 @@ public class DcBusiTargetDraftDayService extends ServiceImpl<DcBusiTargetDraftDa
}
/**
* 修改指标数据底稿()
* 修改指标数据底稿()
*
* @param dcBusiTargetDraftDay 指标数据底稿()
* @param dcBusiTargetDraftDay 指标数据底稿()
* @return 结果
*/
@ -67,9 +66,9 @@ public class DcBusiTargetDraftDayService extends ServiceImpl<DcBusiTargetDraftDa
}
/**
* 批量删除指标数据底稿()
* 批量删除指标数据底稿()
*
* @param ids 需要删除的指标数据底稿()主键
* @param ids 需要删除的指标数据底稿()主键
* @return 结果
*/
@ -79,9 +78,9 @@ public class DcBusiTargetDraftDayService extends ServiceImpl<DcBusiTargetDraftDa
}
/**
* 删除指标数据底稿()信息
* 删除指标数据底稿()信息
*
* @param id 指标数据底稿()主键
* @param id 指标数据底稿()主键
* @return 结果
*/

39
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftMonthService.java

@ -1,27 +1,28 @@
package com.lzbi.draft.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 指标数据底稿()Service业务层处理
* 指标数据底稿()Service业务层处理
*
* @author zhousq
* @date 2023-12-06
* @author win
* @date 2023-11-28
*/
@Service
public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraftMonthMapper, DcBusiTargetDraftMonth> implements IService<DcBusiTargetDraftMonth>
{
/**
* 查询指标数据底稿()
* 查询指标数据底稿()
*
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
* @param id 指标数据底稿()主键
* @return 指标数据底稿()
*/
public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id)
{
@ -29,10 +30,10 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraft
}
/**
* 查询指标数据底稿()列表
* 查询指标数据底稿()列表
*
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 指标数据底稿()
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 指标数据底稿()
*/
public List<DcBusiTargetDraftMonth> selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth dcBusiTargetDraftMonth)
{
@ -40,9 +41,9 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraft
}
/**
* 新增指标数据底稿()
* 新增指标数据底稿()
*
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 结果
*/
@ -53,9 +54,9 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraft
}
/**
* 修改指标数据底稿()
* 修改指标数据底稿()
*
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 结果
*/
@ -66,9 +67,9 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraft
}
/**
* 批量删除指标数据底稿()
* 批量删除指标数据底稿()
*
* @param ids 需要删除的指标数据底稿()主键
* @param ids 需要删除的指标数据底稿()主键
* @return 结果
*/
@ -78,9 +79,9 @@ public class DcBusiTargetDraftMonthService extends ServiceImpl<DcBusiTargetDraft
}
/**
* 删除指标数据底稿()信息
* 删除指标数据底稿()信息
*
* @param id 指标数据底稿()主键
* @param id 指标数据底稿()主键
* @return 结果
*/

67
lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java

@ -0,0 +1,67 @@
package com.lzbi.draft.service;
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.DcBusiTargetDraftDayMapper;
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.CountDownLatch;
@Slf4j
@Service
public class ReportService {
@Resource
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper;
@Autowired
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
public List<TargetDraftMonthReportVO> getTargetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) {
Class<TargetDraftMonthReportVO> targetDraftMonthReportVOClass = TargetDraftMonthReportVO.class;
List<TargetDraftMonthReportVO> 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<TargetDraftMonthReportValueDTO> targetDraftMonthReportValueDTOS = dcBusiTargetDraftDayMapper.selectTargetDraftMonthReportValue(req);
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--) {
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 | IllegalAccessException e) {
throw new RuntimeException(e);
}
targetDraftMonthReportValueDTOS.remove(j);
break;
}
}
}
countDownLatch.countDown();
});
}
try {
countDownLatch.await();
} catch (InterruptedException e) {
log.error("门闩异常", e);
}
return list;
}
}

22
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDayMapper.xml → lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper">
<mapper namespace="com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetDraftDay" id="DcBusiTargetDraftDayResult">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetDraftMonth" id="DcBusiTargetDraftMonthResult">
<result property="id" column="id" />
<result property="companyName" column="company_name" />
<result property="companyId" column="company_id" />
@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deleteTime" column="delete_time" />
</resultMap>
<sql id="selectDcBusiTargetDraftDayVo">
<sql id="selectDcBusiTargetDraftMonthVo">
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
</sql>
<select id="selectDcBusiTargetDraftDayList" parameterType="DcBusiTargetDraftDay" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftDayVo"/>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult">
<include refid="selectDcBusiTargetDraftMonthVo"/>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
@ -49,12 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectDcBusiTargetDraftDayById" parameterType="Long" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftDayVo"/>
<select id="selectDcBusiTargetDraftMonthById" parameterType="Long" resultMap="DcBusiTargetDraftMonthResult">
<include refid="selectDcBusiTargetDraftMonthVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay" useGeneratedKeys="true" keyProperty="id">
<insert id="insertDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_day
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if>
@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay">
<update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth">
update dc_busi_target_draft_day
<trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if>
@ -141,11 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteDcBusiTargetDraftDayById" parameterType="Long">
<delete id="deleteDcBusiTargetDraftMonthById" parameterType="Long">
delete from dc_busi_target_draft_day where id = #{id}
</delete>
<delete id="deleteDcBusiTargetDraftDayByIds" parameterType="String">
<delete id="deleteDcBusiTargetDraftMonthByIds" parameterType="String">
delete from dc_busi_target_draft_day where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}

158
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper">
<mapper namespace="com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetDraftMonth" id="DcBusiTargetDraftMonthResult">
<resultMap type="com.lzbi.draft.domain.DcBusiTargetDraftDay" id="DcBusiTargetDraftDayResult">
<result property="id" column="id" />
<result property="companyName" column="company_name" />
<result property="companyId" column="company_id" />
@ -65,12 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="valP31" column="val_p31" />
</resultMap>
<sql id="selectDcBusiTargetDraftMonthVo">
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
<sql id="selectDcBusiTargetDraftDayVo">
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
</sql>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult">
<include refid="selectDcBusiTargetDraftMonthVo"/>
<select id="selectDcBusiTargetDraftDayList" parameterType="DcBusiTargetDraftDay" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftDayVo"/>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
@ -83,14 +83,138 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valP1 != null "> and val_p1 = #{valP1}</if>
</where>
</select>
<select id="selectProvideAnswerWaterAverageTemperatureList"
parameterType="com.lzbi.bi.domain.DcBusDataScreenNewReq"
resultType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO">
SELECT
<choose>
<when test="orgId != null">
t1.asset_name AS "title",
</when>
<otherwise>
t1.org_name AS "title",
</otherwise>
</choose>
t1.provideWaterAverageTemperature,
t2.answerWaterAverageTemperature
FROM
(
SELECT
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
<choose>
<when test="day != null and day != ''">
,AVG( t.${day} ) AS "provideWaterAverageTemperature"
</when>
<otherwise>
,AVG( t.val_avg_null ) AS "provideWaterAverageTemperature"
</otherwise>
</choose>
FROM
`dc_busi_target_draft_day` t
WHERE
t.target_code = 'TM00039'
AND t.count_year = #{year}
AND t.count_month = #{month}
GROUP BY
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
) t1
LEFT JOIN (
SELECT
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
<choose>
<when test="day != null and day != ''">
,AVG( t.${day} ) AS "answerWaterAverageTemperature"
</when>
<otherwise>
,AVG( t.val_avg_null ) AS "answerWaterAverageTemperature"
</otherwise>
</choose>
FROM
`dc_busi_target_draft_day` t
WHERE
t.target_code = 'TM00040'
AND t.count_year = #{year}
AND t.count_month = #{month}
GROUP BY
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
) t2 ON t1.company_id = t2.company_id
AND t1.org_id = t2.org_id
<if test="orgId != null">
AND t1.asset_code = t2.asset_code
</if>
</select>
<select id="selectDcBusiTargetDraftMonthById" parameterType="Long" resultMap="DcBusiTargetDraftMonthResult">
<include refid="selectDcBusiTargetDraftMonthVo"/>
<select id="selectDcBusiTargetDraftDayById" parameterType="Long" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftDayVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_month
<select id="selectTargetDraftMonthReportValue"
parameterType="com.lzbi.draft.entity.req.TargetDraftMonthReportReq"
resultType="com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO">
SELECT
t1.asset_code AS "assetCode",
sum( t1.val_avg_all ) AS "value"
FROM
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
t2.target_model_code = #{targetModelCode}
AND t1.company_id = #{companyId}
AND t1.org_id = #{orgId}
AND t1.field_code = #{fieldCode}
AND t1.count_year = #{year}
AND t1.count_month = #{month}
GROUP BY
t1.asset_code
</select>
<select id="selectTargetDraftMonthReportVO"
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_day` t1
WHERE
t1.company_id = #{companyId}
AND t1.org_id = #{orgId}
AND t1.field_code = #{fieldCode}
AND t1.count_year = #{year}
AND t1.count_month = #{month}
GROUP BY
t1.asset_code
</select>
<insert id="insertDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_day
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if>
<if test="companyId != null">company_id,</if>
@ -211,8 +335,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth">
update dc_busi_target_draft_month
<update id="updateDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay">
update dc_busi_target_draft_day
<trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if>
<if test="companyId != null">company_id = #{companyId},</if>
@ -275,12 +399,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteDcBusiTargetDraftMonthById" parameterType="Long">
delete from dc_busi_target_draft_month where id = #{id}
<delete id="deleteDcBusiTargetDraftDayById" parameterType="Long">
delete from dc_busi_target_draft_day where id = #{id}
</delete>
<delete id="deleteDcBusiTargetDraftMonthByIds" parameterType="String">
delete from dc_busi_target_draft_month where id in
<delete id="deleteDcBusiTargetDraftDayByIds" parameterType="String">
delete from dc_busi_target_draft_day where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

Loading…
Cancel
Save