Browse Source

日月底稿表互换表名

develop
bobol 11 months ago
parent
commit
95a1f639a2
  1. 3
      lzbi-admin/src/main/resources/application-dev.yml
  2. 19
      lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java
  3. 96
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenNewController.java
  4. 20
      lzbi-module/src/main/java/com/lzbi/bi/domain/BoilerStatisticsVO.java
  5. 28
      lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java
  6. 31
      lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsVO.java
  7. 37
      lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsVO.java
  8. 41
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusDataScreenNewReq.java
  9. 17
      lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java
  10. 15
      lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureDTO.java
  11. 37
      lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureVO.java
  12. 31
      lzbi-module/src/main/java/com/lzbi/bi/domain/UserIOverViewVO.java
  13. 4
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiDataScreenNewMapper.java
  14. 154
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java
  15. 18
      lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetDraftMonthController.java
  16. 191
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java
  17. 190
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java
  18. 43
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java
  19. 40
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java
  20. 56
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDayMasterService.java
  21. 37
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java
  22. 39
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftMonthService.java
  23. 9
      lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java
  24. 22
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml
  25. 125
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml

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

@ -106,3 +106,6 @@ logging:
level: level:
com.lzbi: debug com.lzbi: debug
org.springframework: warn 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;
}

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 java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; 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.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType; import com.lzbi.common.enums.BusinessType;
import com.lzbi.draft.domain. DcBusiTargetDraftMonth;
import com.lzbi.draft.service.DcBusiTargetDraftMonthService; import com.lzbi.draft.service.DcBusiTargetDraftMonthService;
import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo; import com.lzbi.common.core.page.TableDataInfo;
@ -36,7 +36,7 @@ import com.lzbi.common.core.page.TableDataInfo;
public class DcBusiTargetDraftMonthController extends BaseController public class DcBusiTargetDraftMonthController extends BaseController
{ {
@Autowired @Autowired
private DcBusiTargetDraftMonthService dcBusiTargetDraftMonthService; private DcBusiTargetDraftMonthService dcBusiTargetDraftDayService;
/** /**
* 查询指标数据底稿()列表 * 查询指标数据底稿()列表
@ -50,7 +50,7 @@ public class DcBusiTargetDraftMonthController extends BaseController
public TableDataInfo list(DcBusiTargetDraftMonth DcBusiTargetDraftMonth) public TableDataInfo list(DcBusiTargetDraftMonth DcBusiTargetDraftMonth)
{ {
startPage(); startPage();
List< DcBusiTargetDraftMonth> list = dcBusiTargetDraftMonthService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); List<DcBusiTargetDraftMonth> list = dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth);
return getDataTable(list); return getDataTable(list);
} }
@ -66,8 +66,8 @@ public class DcBusiTargetDraftMonthController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcBusiTargetDraftMonth DcBusiTargetDraftMonth) public void export(HttpServletResponse response, DcBusiTargetDraftMonth DcBusiTargetDraftMonth)
{ {
List< DcBusiTargetDraftMonth> list = dcBusiTargetDraftMonthService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth); List<DcBusiTargetDraftMonth> list = dcBusiTargetDraftDayService.selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth);
ExcelUtil< DcBusiTargetDraftMonth> util = new ExcelUtil<DcBusiTargetDraftMonth>(DcBusiTargetDraftMonth.class); ExcelUtil<DcBusiTargetDraftMonth> util = new ExcelUtil<DcBusiTargetDraftMonth>(DcBusiTargetDraftMonth.class);
util.exportExcel(response, list, "指标数据底稿(月)数据"); util.exportExcel(response, list, "指标数据底稿(月)数据");
} }
@ -82,7 +82,7 @@ public class DcBusiTargetDraftMonthController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long 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 @PostMapping
public AjaxResult add(@RequestBody DcBusiTargetDraftMonth DcBusiTargetDraftMonth) 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 @PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetDraftMonth DcBusiTargetDraftMonth) 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}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(dcBusiTargetDraftMonthService.deleteDcBusiTargetDraftMonthByIds(ids)); return toAjax(dcBusiTargetDraftDayService.deleteDcBusiTargetDraftMonthByIds(ids));
} }
} }

191
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java

@ -1,18 +1,18 @@
package com.lzbi.draft.domain; package com.lzbi.draft.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import com.lzbi.common.annotation.Excel; import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity; import com.lzbi.module.base.BaseModuleEntity;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
/** /**
* 指标数据底稿()对象 dc_busi_target_draft_day * 指标数据底稿()对象 dc_busi_target_draft_month
* *
* @author win * @author zhousq
* @date 2023-11-28 * @date 2023-12-06
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ -27,12 +27,10 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "公司名称") @Excel(name = "公司名称")
private String companyName; private String companyName;
/** 公司编码 */ /** 公司ID */
@Excel(name = "公司编码")
private Long companyId; private Long companyId;
/** 组织机构代码 */ /** 组织机构ID */
@Excel(name = "组织机构代码")
private Long orgId; private Long orgId;
/** 组织机构名称 */ /** 组织机构名称 */
@ -47,15 +45,18 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "统计单元名称") @Excel(name = "统计单元名称")
private String assetName; private String assetName;
/** 所属专业编码 */
@Excel(name = "所属专业编码") @Excel(name = "所属专业编码")
private String fieldCode ; private String fieldCode;
/** 所属专业名称 */ /** 所属专业名称 */
@Excel(name = "所属专业名称") @Excel(name = "所属专业名称")
private String fieldName ; private String fieldName;
/** 指标别名 */
/** 指标别名 */
@Excel(name = "指标别名") @Excel(name = "指标别名")
private String targetNameAlias ; private String targetNameAlias;
/** 指标名称 */ /** 指标名称 */
@Excel(name = "指标名称") @Excel(name = "指标名称")
private String targetName; private String targetName;
@ -68,24 +69,164 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "指标单位") @Excel(name = "指标单位")
private String targetUint; private String targetUint;
/** 年月日【yyyy-mm-dd】 */ /** 年 */
@Excel(name = "年月日【yyyy-mm-dd】") @Excel(name = "年")
private String countDate; private String countYear;
/** 月 */
@Excel(name = "月")
private String countMonth;
/** 原值 */ /** 值 */
@Excel(name = "原值") @Excel(name = "值")
private BigDecimal valOriginal; private BigDecimal valSum;
/** 调整值 */ /** 值 */
@Excel(name = "调整值") @Excel(name = "值")
private BigDecimal valAdjust; private BigDecimal valAvgAll;
/** 结果值 */ /** 非空均值 */
@Excel(name = "结果值") @Excel(name = "非空均值")
private BigDecimal valResult; private BigDecimal valAvgNull;
/** 计划值 */ /** 计划值 */
@Excel(name = "计划值") @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; package com.lzbi.draft.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import lombok.Data; import lombok.Data;
import com.lzbi.common.annotation.Excel; import com.lzbi.common.annotation.Excel;
@ -9,10 +8,10 @@ import com.lzbi.module.base.BaseModuleEntity;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
/** /**
* 指标数据底稿()对象 dc_busi_target_draft_month * 指标数据底稿()对象 dc_busi_target_draft_day
* *
* @author zhousq * @author win
* @date 2023-12-06 * @date 2023-11-28
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ -27,10 +26,12 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "公司名称") @Excel(name = "公司名称")
private String companyName; private String companyName;
/** 公司ID */ /** 公司编码 */
@Excel(name = "公司编码")
private Long companyId; private Long companyId;
/** 组织机构ID */ /** 组织机构代码 */
@Excel(name = "组织机构代码")
private Long orgId; private Long orgId;
/** 组织机构名称 */ /** 组织机构名称 */
@ -45,18 +46,15 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "统计单元名称") @Excel(name = "统计单元名称")
private String assetName; private String assetName;
/** 所属专业编码 */
@Excel(name = "所属专业编码") @Excel(name = "所属专业编码")
private String fieldCode; private String fieldCode ;
/** 所属专业名称 */ /** 所属专业名称 */
@Excel(name = "所属专业名称") @Excel(name = "所属专业名称")
private String fieldName; private String fieldName ;
/** 指标别名 */ /** 指标别名 */
@Excel(name = "指标别名")
private String targetNameAlias;
@Excel(name = "指标别名")
private String targetNameAlias ;
/** 指标名称 */ /** 指标名称 */
@Excel(name = "指标名称") @Excel(name = "指标名称")
private String targetName; private String targetName;
@ -69,164 +67,24 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "指标单位") @Excel(name = "指标单位")
private String targetUint; private String targetUint;
/** 年 */ /** 年月日【yyyy-mm-dd】 */
@Excel(name = "年") @Excel(name = "年月日【yyyy-mm-dd】")
private String countYear; private String countDate;
/** 月 */
@Excel(name = "月")
private String countMonth;
/** 值 */ /** 原值 */
@Excel(name = "值") @Excel(name = "原值")
private BigDecimal valSum; private BigDecimal valOriginal;
/** 值 */ /** 调整值 */
@Excel(name = "值") @Excel(name = "调整值")
private BigDecimal valAvgAll; private BigDecimal valAdjust;
/** 非空均值 */ /** 结果值 */
@Excel(name = "非空均值") @Excel(name = "结果值")
private BigDecimal valAvgNull; private BigDecimal valResult;
/** 计划值 */ /** 计划值 */
@Excel(name = "计划值") @Excel(name = "计划值")
private BigDecimal valPlan; private String 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;
} }

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 java.util.List;
import com.lzbi.bi.domain.DcBusDataScreenNewReq;
import com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO;
import com.lzbi.draft.domain.DcBusiTargetDraftDay; import com.lzbi.draft.domain.DcBusiTargetDraftDay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 * @author zhousq
* @date 2023-11-28 * @date 2023-12-06
*/ */
public interface DcBusiTargetDraftDayMapper extends BaseMapper<DcBusiTargetDraftDay> public interface DcBusiTargetDraftDayMapper extends BaseMapper<DcBusiTargetDraftDay>
{ {
/** /**
* 查询指标数据底稿() * 查询指标数据底稿()
* *
* @param id 指标数据底稿()主键 * @param id 指标数据底稿()主键
* @return 指标数据底稿() * @return 指标数据底稿()
*/ */
public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id); public DcBusiTargetDraftDay selectDcBusiTargetDraftDayById(Long id);
/** /**
* 查询指标数据底稿()列表 * 查询指标数据底稿()列表
* *
* @param dcBusiTargetDraftDay 指标数据底稿() * @param dcBusiTargetDraftDay 指标数据底稿()
* @return 指标数据底稿()集合 * @return 指标数据底稿()集合
*/ */
public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay); public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay);
List<ProvideAnswerWaterAverageTemperatureDTO> selectProvideAnswerWaterAverageTemperatureList(DcBusDataScreenNewReq dcBusDataScreenNewReq);
/** /**
* 新增指标数据底稿() * 新增指标数据底稿()
* *
* @param dcBusiTargetDraftDay 指标数据底稿() * @param dcBusiTargetDraftDay 指标数据底稿()
* @return 结果 * @return 结果
*/ */
public int insertDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay); public int insertDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay);
/** /**
* 修改指标数据底稿() * 修改指标数据底稿()
* *
* @param dcBusiTargetDraftDay 指标数据底稿() * @param dcBusiTargetDraftDay 指标数据底稿()
* @return 结果 * @return 结果
*/ */
public int updateDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay); public int updateDcBusiTargetDraftDay(DcBusiTargetDraftDay dcBusiTargetDraftDay);
/** /**
* 删除指标数据底稿() * 删除指标数据底稿()
* *
* @param id 指标数据底稿()主键 * @param id 指标数据底稿()主键
* @return 结果 * @return 结果
*/ */
public int deleteDcBusiTargetDraftDayById(Long id); public int deleteDcBusiTargetDraftDayById(Long id);
/** /**
* 批量删除指标数据底稿() * 批量删除指标数据底稿()
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDcBusiTargetDraftDayByIds(Long[] ids); public int deleteDcBusiTargetDraftDayByIds(Long[] ids);
List<TargetDraftMonthReportValueDTO> selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq);
List<TargetDraftMonthReportVO> selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq);
} }

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

@ -1,70 +1,64 @@
package com.lzbi.draft.mapper; package com.lzbi.draft.mapper;
import java.util.List; import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth; import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 * @author win
* @date 2023-12-06 * @date 2023-11-28
*/ */
public interface DcBusiTargetDraftMonthMapper extends BaseMapper<DcBusiTargetDraftMonth> public interface DcBusiTargetDraftMonthMapper extends BaseMapper<DcBusiTargetDraftMonth>
{ {
/** /**
* 查询指标数据底稿() * 查询指标数据底稿()
* *
* @param id 指标数据底稿()主键 * @param id 指标数据底稿()主键
* @return 指标数据底稿() * @return 指标数据底稿()
*/ */
public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id); public DcBusiTargetDraftMonth selectDcBusiTargetDraftMonthById(Long id);
/** /**
* 查询指标数据底稿()列表 * 查询指标数据底稿()列表
* *
* @param dcBusiTargetDraftMonth 指标数据底稿() * @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 指标数据底稿()集合 * @return 指标数据底稿()集合
*/ */
public List<DcBusiTargetDraftMonth> selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); public List<DcBusiTargetDraftMonth> selectDcBusiTargetDraftMonthList(DcBusiTargetDraftMonth dcBusiTargetDraftMonth);
/** /**
* 新增指标数据底稿() * 新增指标数据底稿()
* *
* @param dcBusiTargetDraftMonth 指标数据底稿() * @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 结果 * @return 结果
*/ */
public int insertDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); public int insertDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth);
/** /**
* 修改指标数据底稿() * 修改指标数据底稿()
* *
* @param dcBusiTargetDraftMonth 指标数据底稿() * @param dcBusiTargetDraftMonth 指标数据底稿()
* @return 结果 * @return 结果
*/ */
public int updateDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth); public int updateDcBusiTargetDraftMonth(DcBusiTargetDraftMonth dcBusiTargetDraftMonth);
/** /**
* 删除指标数据底稿() * 删除指标数据底稿()
* *
* @param id 指标数据底稿()主键 * @param id 指标数据底稿()主键
* @return 结果 * @return 结果
*/ */
public int deleteDcBusiTargetDraftMonthById(Long id); public int deleteDcBusiTargetDraftMonthById(Long id);
/** /**
* 批量删除指标数据底稿() * 批量删除指标数据底稿()
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteDcBusiTargetDraftMonthByIds(Long[] ids); public int deleteDcBusiTargetDraftMonthByIds(Long[] ids);
List<TargetDraftMonthReportValueDTO> selectTargetDraftMonthReportValue(TargetDraftMonthReportReq targetDraftMonthReportReq);
List<TargetDraftMonthReportVO> selectTargetDraftMonthReportVO(TargetDraftMonthReportReq targetDraftMonthReportReq);
} }

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.common.utils.DateUtils;
import com.lzbi.draft.domain.DcBusiTargetAdjustDayMasterDao; import com.lzbi.draft.domain.DcBusiTargetAdjustDayMasterDao;
import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao; 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.DcBusiTargetAdjustDayMasterMapper;
import com.lzbi.draft.mapper.DcBusiTargetAdjustDaySubMapper; 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.domain.DcBaseWorkSpecial;
import com.lzbi.special.mapper.DcBaseWorkSpecialMapper; import com.lzbi.special.mapper.DcBaseWorkSpecialMapper;
import com.lzbi.system.service.impl.SysDeptServiceImpl; import com.lzbi.system.service.impl.SysDeptServiceImpl;
@ -54,7 +54,7 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl<DcBusiTarget
private DcBaseWorkSpecialMapper dcBaseWorkSpecialMapper; private DcBaseWorkSpecialMapper dcBaseWorkSpecialMapper;
@Resource @Resource
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper; private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper;
private static final Lock lock = new ReentrantLock(); private static final Lock lock = new ReentrantLock();
@ -229,33 +229,33 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl<DcBusiTarget
List<DcBusiTargetAdjustDaySubDao> dcBusiTargetAdjustDaySubDaoList = dcBusiTargetAdjustDaySubMapper.selectDcBusiTargetAdjustDaySubDaoList(params); List<DcBusiTargetAdjustDaySubDao> dcBusiTargetAdjustDaySubDaoList = dcBusiTargetAdjustDaySubMapper.selectDcBusiTargetAdjustDaySubDaoList(params);
// 遍历子表集合,向指标数据底稿表(日)中同步数据 // 遍历子表集合,向指标数据底稿表(日)中同步数据
for (DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao : dcBusiTargetAdjustDaySubDaoList) { for (DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao : dcBusiTargetAdjustDaySubDaoList) {
DcBusiTargetDraftDay dcBusiTargetDraftDay = new DcBusiTargetDraftDay(); DcBusiTargetDraftMonth dcBusiTargetDraftMonth = new DcBusiTargetDraftMonth();
dcBusiTargetDraftDay.setCompanyId(dcBusiTargetAdjustDayMasterDao.getCompanyId()); dcBusiTargetDraftMonth.setCompanyId(dcBusiTargetAdjustDayMasterDao.getCompanyId());
dcBusiTargetDraftDay.setOrgId(dcBusiTargetAdjustDayMasterDao.getOragnizeId()); dcBusiTargetDraftMonth.setOrgId(dcBusiTargetAdjustDayMasterDao.getOragnizeId());
dcBusiTargetDraftDay.setAssetCode(dcBusiTargetAdjustDayMasterDao.getAssetCode()); dcBusiTargetDraftMonth.setAssetCode(dcBusiTargetAdjustDayMasterDao.getAssetCode());
dcBusiTargetDraftDay.setFieldCode(dcBusiTargetAdjustDayMasterDao.getFieldCode()); dcBusiTargetDraftMonth.setFieldCode(dcBusiTargetAdjustDayMasterDao.getFieldCode());
dcBusiTargetDraftDay.setTargetCode(dcBusiTargetAdjustDaySubDao.getTargetCode()); dcBusiTargetDraftMonth.setTargetCode(dcBusiTargetAdjustDaySubDao.getTargetCode());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(dcBusiTargetDraftDay); List<DcBusiTargetDraftMonth> dcBusiTargetDraftMonthList = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMonthList(dcBusiTargetDraftMonth);
// 如果未查询出来指标数据底稿数据,就新增,否则修改 // 如果未查询出来指标数据底稿数据,就新增,否则修改
if (CollectionUtils.isEmpty(dcBusiTargetDraftDayList)) { if (CollectionUtils.isEmpty(dcBusiTargetDraftMonthList)) {
dcBusiTargetDraftDay.setCompanyName(dcBusiTargetAdjustDayMasterDao.getCompanyName()); dcBusiTargetDraftMonth.setCompanyName(dcBusiTargetAdjustDayMasterDao.getCompanyName());
dcBusiTargetDraftDay.setOrgName(dcBusiTargetAdjustDayMasterDao.getOrganizeName()); dcBusiTargetDraftMonth.setOrgName(dcBusiTargetAdjustDayMasterDao.getOrganizeName());
dcBusiTargetDraftDay.setAssetName(dcBusiTargetAdjustDayMasterDao.getAssetName()); dcBusiTargetDraftMonth.setAssetName(dcBusiTargetAdjustDayMasterDao.getAssetName());
dcBusiTargetDraftDay.setFieldName(dcBusiTargetAdjustDayMasterDao.getFieldName()); dcBusiTargetDraftMonth.setFieldName(dcBusiTargetAdjustDayMasterDao.getFieldName());
dcBusiTargetDraftDay.setTargetName(dcBusiTargetAdjustDaySubDao.getTargetName()); dcBusiTargetDraftMonth.setTargetName(dcBusiTargetAdjustDaySubDao.getTargetName());
dcBusiTargetDraftDay.setTargetUint(dcBusiTargetAdjustDaySubDao.getTagetUnit()); dcBusiTargetDraftMonth.setTargetUint(dcBusiTargetAdjustDaySubDao.getTagetUnit());
dcBusiTargetDraftDay.setCountDate(dcBusiTargetAdjustDayMasterDao.getDateAdjust()); dcBusiTargetDraftMonth.setCountDate(dcBusiTargetAdjustDayMasterDao.getDateAdjust());
dcBusiTargetDraftDay.setValOriginal(dcBusiTargetAdjustDaySubDao.getValOrigin()); dcBusiTargetDraftMonth.setValOriginal(dcBusiTargetAdjustDaySubDao.getValOrigin());
dcBusiTargetDraftDay.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); dcBusiTargetDraftMonth.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust());
dcBusiTargetDraftDay.setValResult(dcBusiTargetAdjustDaySubDao.getValResult()); dcBusiTargetDraftMonth.setValResult(dcBusiTargetAdjustDaySubDao.getValResult());
dcBusiTargetDraftDayMapper.insertDcBusiTargetDraftDay(dcBusiTargetDraftDay); dcBusiTargetDraftMonthMapper.insertDcBusiTargetDraftMonth(dcBusiTargetDraftMonth);
} else { } else {
dcBusiTargetDraftDay = dcBusiTargetDraftDayList.get(0); dcBusiTargetDraftMonth = dcBusiTargetDraftMonthList.get(0);
BigDecimal valResult = dcBusiTargetDraftDay.getValResult().add(new BigDecimal(0)); BigDecimal valResult = dcBusiTargetDraftMonth.getValResult().add(new BigDecimal(0));
dcBusiTargetDraftDay.setValOriginal(valResult); dcBusiTargetDraftMonth.setValOriginal(valResult);
dcBusiTargetDraftDay.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust()); dcBusiTargetDraftMonth.setValAdjust(dcBusiTargetAdjustDaySubDao.getValAdjust());
dcBusiTargetDraftDay.setValResult(valResult.add(dcBusiTargetAdjustDaySubDao.getValAdjust())); dcBusiTargetDraftMonth.setValResult(valResult.add(dcBusiTargetAdjustDaySubDao.getValAdjust()));
dcBusiTargetDraftDayMapper.updateDcBusiTargetDraftDay(dcBusiTargetDraftDay); dcBusiTargetDraftMonthMapper.updateDcBusiTargetDraftMonth(dcBusiTargetDraftMonth);
} }
} }
// 修改审核状态为已处理 // 修改审核状态为已处理

37
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDayService.java

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

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

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

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

@ -1,11 +1,10 @@
package com.lzbi.draft.service; package com.lzbi.draft.service;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO;
import com.lzbi.draft.entity.req.TargetDraftMonthReportReq; import com.lzbi.draft.entity.req.TargetDraftMonthReportReq;
import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO; import com.lzbi.draft.entity.vo.TargetDraftMonthReportVO;
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper; import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@ -21,20 +20,20 @@ import java.util.concurrent.CountDownLatch;
public class ReportService { public class ReportService {
@Resource @Resource
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper; private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper;
@Autowired @Autowired
private ThreadPoolTaskExecutor threadPoolTaskExecutor; private ThreadPoolTaskExecutor threadPoolTaskExecutor;
public List<TargetDraftMonthReportVO> getTargetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) { public List<TargetDraftMonthReportVO> getTargetDraftMonthReport(TargetDraftMonthReportReq targetDraftMonthReportReq) {
Class<TargetDraftMonthReportVO> targetDraftMonthReportVOClass = TargetDraftMonthReportVO.class; Class<TargetDraftMonthReportVO> targetDraftMonthReportVOClass = TargetDraftMonthReportVO.class;
List<TargetDraftMonthReportVO> list = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportVO(targetDraftMonthReportReq); List<TargetDraftMonthReportVO> list = dcBusiTargetDraftDayMapper.selectTargetDraftMonthReportVO(targetDraftMonthReportReq);
CountDownLatch countDownLatch = new CountDownLatch(TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR.length); CountDownLatch countDownLatch = new CountDownLatch(TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR.length);
for (String targetModelCode : TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR) { for (String targetModelCode : TargetDraftMonthReportReq.TARGET_MODEL_CODE_ARR) {
threadPoolTaskExecutor.execute(() -> { threadPoolTaskExecutor.execute(() -> {
TargetDraftMonthReportReq req = JSONObject.parseObject(JSONObject.toJSONString(targetDraftMonthReportReq), TargetDraftMonthReportReq.class); TargetDraftMonthReportReq req = JSONObject.parseObject(JSONObject.toJSONString(targetDraftMonthReportReq), TargetDraftMonthReportReq.class);
req.setTargetModelCode(targetModelCode); req.setTargetModelCode(targetModelCode);
List<TargetDraftMonthReportValueDTO> targetDraftMonthReportValueDTOS = dcBusiTargetDraftMonthMapper.selectTargetDraftMonthReportValue(req); List<TargetDraftMonthReportValueDTO> targetDraftMonthReportValueDTOS = dcBusiTargetDraftDayMapper.selectTargetDraftMonthReportValue(req);
log.info("{} 执行完成,结果是 {}", targetModelCode, targetDraftMonthReportValueDTOS); log.info("{} 执行完成,结果是 {}", targetModelCode, targetDraftMonthReportValueDTOS);
for (int i = 0, len = list.size(); i < len; i++) { for (int i = 0, len = list.size(); i < len; i++) {
TargetDraftMonthReportVO targetDraftMonthReportVO = list.get(i); TargetDraftMonthReportVO targetDraftMonthReportVO = list.get(i);

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

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

@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "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="id" column="id" />
<result property="companyName" column="company_name" /> <result property="companyName" column="company_name" />
<result property="companyId" column="company_id" /> <result property="companyId" column="company_id" />
@ -65,12 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="valP31" column="val_p31" /> <result property="valP31" column="val_p31" />
</resultMap> </resultMap>
<sql id="selectDcBusiTargetDraftMonthVo"> <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_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
</sql> </sql>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult"> <select id="selectDcBusiTargetDraftDayList" parameterType="DcBusiTargetDraftDay" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftMonthVo"/> <include refid="selectDcBusiTargetDraftDayVo"/>
<where> <where>
<if test="companyId != null "> and company_id = #{companyId}</if> <if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if> <if test="orgId != null "> and org_id = #{orgId}</if>
@ -83,9 +83,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="valP1 != null "> and val_p1 = #{valP1}</if> <if test="valP1 != null "> and val_p1 = #{valP1}</if>
</where> </where>
</select> </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"> <select id="selectDcBusiTargetDraftDayById" parameterType="Long" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftMonthVo"/> <include refid="selectDcBusiTargetDraftDayVo"/>
where id = #{id} where id = #{id}
</select> </select>
@ -96,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.asset_code AS "assetCode", t1.asset_code AS "assetCode",
sum( t1.val_avg_all ) AS "value" sum( t1.val_avg_all ) AS "value"
FROM 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 INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code
AND t1.asset_code = t2.asset_code AND t1.asset_code = t2.asset_code
WHERE WHERE
@ -113,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
parameterType="com.lzbi.draft.entity.req.TargetDraftMonthReportReq" parameterType="com.lzbi.draft.entity.req.TargetDraftMonthReportReq"
resultType="com.lzbi.draft.entity.vo.TargetDraftMonthReportVO"> resultType="com.lzbi.draft.entity.vo.TargetDraftMonthReportVO">
SELECT t1.asset_code AS "assetCode", max(t1.asset_name) AS "assetName" 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 WHERE
t1.company_id = #{companyId} t1.company_id = #{companyId}
AND t1.org_id = #{orgId} AND t1.org_id = #{orgId}
@ -124,8 +213,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.asset_code t1.asset_code
</select> </select>
<insert id="insertDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth" useGeneratedKeys="true" keyProperty="id"> <insert id="insertDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_month insert into dc_busi_target_draft_day
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if> <if test="companyName != null">company_name,</if>
<if test="companyId != null">company_id,</if> <if test="companyId != null">company_id,</if>
@ -246,8 +335,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth"> <update id="updateDcBusiTargetDraftDay" parameterType="DcBusiTargetDraftDay">
update dc_busi_target_draft_month update dc_busi_target_draft_day
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if> <if test="companyName != null">company_name = #{companyName},</if>
<if test="companyId != null">company_id = #{companyId},</if> <if test="companyId != null">company_id = #{companyId},</if>
@ -310,12 +399,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteDcBusiTargetDraftMonthById" parameterType="Long"> <delete id="deleteDcBusiTargetDraftDayById" parameterType="Long">
delete from dc_busi_target_draft_month where id = #{id} delete from dc_busi_target_draft_day where id = #{id}
</delete> </delete>
<delete id="deleteDcBusiTargetDraftMonthByIds" parameterType="String"> <delete id="deleteDcBusiTargetDraftDayByIds" parameterType="String">
delete from dc_busi_target_draft_month where id in delete from dc_busi_target_draft_day where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

Loading…
Cancel
Save