132 changed files with 0 additions and 6860 deletions
-
4application/pom.xml
-
39modules/cbam/pom.xml
-
84modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamIndustryController.java
-
112modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamProcessMaterialController.java
-
107modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamProdRouteRelationController.java
-
101modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamIndustryDTO.java
-
62modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamProcessMaterialDTO.java
-
34modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamProdRouteRelationDTO.java
-
97modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamIndustryEntity.java
-
93modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamProcessMaterialEntity.java
-
51modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamProdRouteRelationEntity.java
-
11modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/mapper/CbamIndustryMapper.java
-
16modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/mapper/CbamProcessMaterialMapper.java
-
16modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/mapper/CbamProdRouteRelationMapper.java
-
24modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamIndustryService.java
-
51modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamProcessMaterialService.java
-
21modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamProdRouteRelationService.java
-
180modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamIndustryServiceImpl.java
-
129modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamProcessMaterialServiceImpl.java
-
54modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamProdRouteRelationServiceImpl.java
-
85modules/cbam/src/main/java/com/thing/cbam/carbonPrice/controller/CbamCarbonPriceToolController.java
-
56modules/cbam/src/main/java/com/thing/cbam/carbonPrice/dto/CbamCarbonPriceToolDTO.java
-
92modules/cbam/src/main/java/com/thing/cbam/carbonPrice/entity/CbamCarbonPriceToolEntity.java
-
9modules/cbam/src/main/java/com/thing/cbam/carbonPrice/mapper/CbamCarbonPriceToolMapper.java
-
13modules/cbam/src/main/java/com/thing/cbam/carbonPrice/service/CbamCarbonPriceToolService.java
-
60modules/cbam/src/main/java/com/thing/cbam/carbonPrice/service/Impl/CbamCarbonPriceToolServiceImpl.java
-
57modules/cbam/src/main/java/com/thing/cbam/context/ContextExcelDTO.java
-
94modules/cbam/src/main/java/com/thing/cbam/context/ExcelContextManage.java
-
8modules/cbam/src/main/java/com/thing/cbam/context/ExcelTypeDTO.java
-
110modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamCarbonPriceCurrencyDictController.java
-
85modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamCountryDictController.java
-
81modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamFactorDictController.java
-
112modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamFuelDictController.java
-
111modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamHsDictController.java
-
114modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamIndustryDictController.java
-
127modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamProdProcessDictController.java
-
34modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamCarbonPriceCurrencyDictDTO.java
-
36modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamCountryDictDTO.java
-
34modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamFactorDictDTO.java
-
37modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamFuelDictDTO.java
-
42modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamHsDictDTO.java
-
31modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamIndustryDictDTO.java
-
40modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamProdProcessDictDTO.java
-
43modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamCarbonPriceCurrencyDictEntity.java
-
50modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamCountryDictEntity.java
-
43modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamFactorDictEntity.java
-
54modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamFuelDictEntity.java
-
56modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamHsDictEntity.java
-
44modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamIndustryDictEntity.java
-
56modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamProdProcessDictEntity.java
-
17modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamCarbonPriceCurrencyDictMapper.java
-
9modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamCountryDictMapper.java
-
9modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamFactorDictMapper.java
-
16modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamFuelDictMapper.java
-
17modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamHsDictMapper.java
-
17modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamIndustryDictMapper.java
-
17modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamProdProcessDictMapper.java
-
15modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamCarbonPriceCurrencyDictService.java
-
10modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamCountryDictService.java
-
7modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamFactorDictService.java
-
15modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamFuelDictService.java
-
20modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamHsDictService.java
-
15modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamIndustryDictService.java
-
27modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamProdProcessDictService.java
-
29modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamCarbonPriceCurrencyDictServiceImpl.java
-
22modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamCountryDictServiceImpl.java
-
19modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamFactorDictServiceImpl.java
-
35modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamFuelDictServiceImpl.java
-
57modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamHsDictServiceImpl.java
-
29modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamIndustryDictServiceImpl.java
-
65modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamProdProcessDictServiceImpl.java
-
140modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamCarbonDirectController.java
-
109modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamPerfluorinatedCarbonController.java
-
98modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamProcessAllocationController.java
-
60modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamCarbonDirectContextDTO.java
-
94modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamCarbonDirectDTO.java
-
38modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamCarbonProgressDTO.java
-
65modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamPerfluorinatedCarbonDTO.java
-
37modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamProcessAllocationDTO.java
-
148modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamCarbonDirectEntity.java
-
51modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamCarbonProgressEntity.java
-
111modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamPerfluorinatedCarbonEntity.java
-
63modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamProcessAllocationEntity.java
-
16modules/cbam/src/main/java/com/thing/cbam/directCarbon/mapper/CbamCarbonDirectMapper.java
-
16modules/cbam/src/main/java/com/thing/cbam/directCarbon/mapper/CbamPerfluorinatedCarbonMapper.java
-
16modules/cbam/src/main/java/com/thing/cbam/directCarbon/mapper/CbamProcessAllocationMapper.java
-
30modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamCarbonDirectService.java
-
19modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamPerfluorinatedCarbonService.java
-
19modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamProcessAllocationService.java
-
133modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/impl/CbamCarbonDirectServiceImpl.java
-
91modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/impl/CbamPerfluorinatedCarbonServiceImpl.java
-
45modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/impl/CbamProcessAllocationServiceImpl.java
-
85modules/cbam/src/main/java/com/thing/cbam/directCarbon/util/BurningDischargeUtil.java
-
55modules/cbam/src/main/java/com/thing/cbam/directCarbon/util/MaterialBalanceUtil.java
-
61modules/cbam/src/main/java/com/thing/cbam/directCarbon/util/ProcessDischargeUtil.java
-
66modules/cbam/src/main/java/com/thing/cbam/electricity/controller/CbamElectricityToolController.java
-
62modules/cbam/src/main/java/com/thing/cbam/electricity/dto/CbamElectricityToolDTO.java
-
99modules/cbam/src/main/java/com/thing/cbam/electricity/entity/CbamElectricityToolEntity.java
-
9modules/cbam/src/main/java/com/thing/cbam/electricity/mapper/CbamElectricityToolMapper.java
-
13modules/cbam/src/main/java/com/thing/cbam/electricity/service/CbamElectricityToolService.java
@ -1,39 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>com.thing</groupId> |
|||
<artifactId>modules</artifactId> |
|||
<version>5.1</version> |
|||
</parent> |
|||
|
|||
<groupId>com.thing.modules</groupId> |
|||
<artifactId>cbam</artifactId> |
|||
<packaging>jar</packaging> |
|||
<name>ThingBI Server Modules cbam</name> |
|||
|
|||
|
|||
<properties> |
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|||
</properties> |
|||
|
|||
|
|||
<dependencies> |
|||
|
|||
<dependency> |
|||
<groupId>org.projectlombok</groupId> |
|||
<artifactId>lombok</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.thing.modules</groupId> |
|||
<artifactId>thing</artifactId> |
|||
</dependency> |
|||
|
|||
|
|||
</dependencies> |
|||
|
|||
|
|||
</project> |
|||
@ -1,84 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.controller; |
|||
|
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamIndustryDTO; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamIndustryService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/cbam/industry") |
|||
@Tag(name = "基础信息A表") |
|||
@RequiredArgsConstructor |
|||
public class CbamIndustryController { |
|||
|
|||
private final CbamIndustryService service; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary = "分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true), |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true), |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"), |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamIndustryDTO>> page(@Parameter(hidden = true) @RequestParam Map<String,Object> param) { |
|||
PageData<CbamIndustryDTO> pageList = service.getPageData(param,CbamIndustryDTO.class); |
|||
return new Result<PageData<CbamIndustryDTO>>().ok(pageList); |
|||
} |
|||
|
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary = "信息") |
|||
public Result<CbamIndustryDTO> get(@PathVariable("id") Long id) { |
|||
CbamIndustryDTO dto = service.findById(id); |
|||
return new Result<CbamIndustryDTO>().ok(dto); |
|||
} |
|||
|
|||
@PostMapping("saveOrUpdate") |
|||
@Operation(summary = "新增或者修改") |
|||
@LogOperation("新增或者修改") |
|||
public Result<CbamIndustryDTO> saveOrUpdate(@RequestBody CbamIndustryDTO dto) { |
|||
return new Result<CbamIndustryDTO>().ok(service.saveOrUpdate(dto)); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary = "修改-废弃") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamIndustryDTO dto) { |
|||
//效验数据 |
|||
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
service.updateIndustryInfo(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary = "删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids) { |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
service.batchDeleteByIds(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
// @PostMapping("export") |
|||
// @Operation(summary = "导出") |
|||
// @LogOperation("导出") |
|||
// public void export(@RequestBody Long[] ids, @RequestParam Map<String, Object> params, HttpServletResponse response) { |
|||
// ExcelUtils.exportExcel(service.export(ids, params), "物模型列表", "物模型", IotThingModelExcel.class, "物模型列表.xls", response); |
|||
// } |
|||
|
|||
|
|||
} |
|||
@ -1,112 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.controller; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProcessMaterialService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/process/material") |
|||
@Tag(name="综合商品类别和相关生产过程 和 购买的原材料 表") |
|||
@RequiredArgsConstructor |
|||
public class CbamProcessMaterialController { |
|||
|
|||
private final CbamProcessMaterialService cbamProcessMaterialService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamProcessMaterialDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamProcessMaterialDTO> page = cbamProcessMaterialService.getPageData(params, CbamProcessMaterialDTO.class); |
|||
return new Result<PageData<CbamProcessMaterialDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamProcessMaterialDTO> get(@PathVariable("id") Long id){ |
|||
CbamProcessMaterialDTO data = cbamProcessMaterialService.getByIdAs(id, CbamProcessMaterialDTO.class); |
|||
return new Result<CbamProcessMaterialDTO>().ok(data); |
|||
} |
|||
|
|||
@GetMapping("industryIdAndType") |
|||
@Operation(summary="根据AExcel的基本信息id,查询原材料信息或者生产过程") |
|||
public Result<List<CbamProcessMaterialDTO>> getByIndustryIdAndType(Long industryId,Integer type){ |
|||
List<CbamProcessMaterialDTO> processMaterialDTOList = cbamProcessMaterialService.getByIndustryIdAndType(industryId,type); |
|||
return new Result<List<CbamProcessMaterialDTO>>().ok(processMaterialDTOList); |
|||
} |
|||
|
|||
@GetMapping("industryId") |
|||
@Operation(summary="根据AExcel的基本信息id,查询原材料信息和生产过程列表") |
|||
public Result<List<CbamProcessMaterialDTO>> getByIndustryId(Long industryId){ |
|||
List<CbamProcessMaterialDTO> processMaterialDTOList = cbamProcessMaterialService.getByIndustryId(industryId); |
|||
return new Result<List<CbamProcessMaterialDTO>>().ok(processMaterialDTOList); |
|||
} |
|||
|
|||
// @PostMapping |
|||
// @Operation(summary="保存或者更新") |
|||
// @LogOperation("保存或者更新") |
|||
// public Result<Void> saveOrUpdate(@RequestBody CbamProcessMaterialDTO dto){ |
|||
// //效验数据 |
|||
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
// cbamProcessMaterialService.saveDto(dto); |
|||
// return new Result<>(); |
|||
// } |
|||
|
|||
// @PutMapping |
|||
// @Operation(summary="修改") |
|||
// @LogOperation("修改") |
|||
// public Result<Void> update(@RequestBody CbamProcessMaterialDTO dto){ |
|||
// //效验数据 |
|||
// ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
// cbamProcessMaterialService.updateDto(dto); |
|||
// return new Result<>(); |
|||
// } |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamProcessMaterialService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamProcessMaterialDTO> list = cbamProcessMaterialService.listAs(params, CbamProcessMaterialDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "综合商品类别和相关生产过程 和 购买的原材料 表", list, CbamProcessMaterialExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,107 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.controller; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProdRouteRelationDTO; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProdRouteRelationService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/routerelation") |
|||
@Tag(name="生产过程和原料 与 工艺路线关联表") |
|||
@RequiredArgsConstructor |
|||
public class CbamProdRouteRelationController { |
|||
|
|||
private final CbamProdRouteRelationService cbamProdRouteRelationService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamProdRouteRelationDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamProdRouteRelationDTO> page = cbamProdRouteRelationService.getPageData(params, CbamProdRouteRelationDTO.class); |
|||
return new Result<PageData<CbamProdRouteRelationDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamProdRouteRelationDTO> get(@PathVariable("id") Long id){ |
|||
CbamProdRouteRelationDTO data = cbamProdRouteRelationService.getByIdAs(id, CbamProdRouteRelationDTO.class); |
|||
return new Result<CbamProdRouteRelationDTO>().ok(data); |
|||
} |
|||
|
|||
/* @PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamProdRouteRelationDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamProdRouteRelationService.saveDto(dto); |
|||
return new Result<>(); |
|||
}*/ |
|||
|
|||
@PostMapping |
|||
@Operation(summary="批量保存或者更新") |
|||
@LogOperation("保存") |
|||
public Result<Void> batchSaveOrUpdate(@RequestBody List<CbamProdRouteRelationDTO> list){ |
|||
//效验数据 |
|||
cbamProdRouteRelationService.batchSaveOrUpdate(list); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamProdRouteRelationDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamProdRouteRelationService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamProdRouteRelationService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamProdRouteRelationDTO> list = cbamProdRouteRelationService.listAs(params, CbamProdRouteRelationDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "生产过程和原料 与 工艺路线关联表", list, CbamProdRouteRelationExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,101 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@Schema(description = "基础信息表") |
|||
public class CbamIndustryDTO implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
@Schema(description = "主键id") |
|||
private Long id; |
|||
@Schema(description = "所属行业字典id") |
|||
private Long industryDictId; |
|||
@Schema(description = "所属行业") |
|||
private String industryDict; |
|||
@Schema(description = "开始日期:11位数") |
|||
private Long startDate; |
|||
@Schema(description = "结束日期:11位数") |
|||
private Long endDate; |
|||
@Schema(description = "报告周期说明:默认情况是一整个日历年,这个是固定的,要是前段传过来就要") |
|||
private String cycleDesc; |
|||
@Schema(description = "生产工厂名称") |
|||
private String factoryName; |
|||
@Schema(description = "生产工厂名称(英文名)") |
|||
private String factoryEname; |
|||
@Schema(description = "街道编号") |
|||
private String streetNum; |
|||
@Schema(description = "在欧盟进行的主要经济活动") |
|||
private String economicActivities; |
|||
@Schema(description = "邮政编码") |
|||
private String postalCode; |
|||
@Schema(description = "邮政信箱") |
|||
private String postBox; |
|||
@Schema(description = "城市") |
|||
private String city; |
|||
@Schema(description = "国家") |
|||
private String country; |
|||
@Schema(description = "国际港口代码") |
|||
private String internationalCode; |
|||
@Schema(description = "生产坐标经度") |
|||
private String factoryLongitude; |
|||
@Schema(description = "生产坐标纬度") |
|||
private String factoryLatitude; |
|||
@Schema(description = "授权代表姓名") |
|||
private String authorizedName; |
|||
@Schema(description = "电子邮件") |
|||
private String email; |
|||
@Schema(description = "电话") |
|||
private String telephone; |
|||
@Schema(description = "生产过程:返给前端的生产过程信息") |
|||
private List<CbamProcessMaterialDTO> cbamProductList; |
|||
@Schema(description = "原料信息:返给前端的生产过程信息") |
|||
private List<CbamProcessMaterialDTO> cbamMaterialList; |
|||
|
|||
/*------------------------租户信息--------------------------------*/ |
|||
|
|||
/** |
|||
* 租户编码 |
|||
*/ |
|||
private Long tenantCode; |
|||
|
|||
/** |
|||
* 公司id |
|||
*/ |
|||
private Long companyId; |
|||
|
|||
/** |
|||
* 部门id |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/*------------------------修改记录信息--------------------------------*/ |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Long createDate; |
|||
|
|||
/** |
|||
* 修改人 |
|||
*/ |
|||
private Long updater; |
|||
/** |
|||
* 修改时间 |
|||
*/ |
|||
private Long updateDate; |
|||
|
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "综合商品类别和相关生产过程 和 购买的原材料 表") |
|||
public class CbamProcessMaterialDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "产品名称") |
|||
private String name; |
|||
@Schema(description = "总产量") |
|||
private String totalOutput; |
|||
@Schema(description = "HS代码") |
|||
private String hsCode; |
|||
@Schema(description = "产品生产过程字典id") |
|||
private Long productionProcessId; |
|||
@Schema(description = "产品生产过程") |
|||
private String productionProcess; |
|||
@Schema(description = "综合商品类别") |
|||
private String productCategories; |
|||
@Schema(description = "关联cbam_industry_information的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "租户编码") |
|||
private Long tenantCode; |
|||
@Schema(description = "部门ID") |
|||
private Long deptId; |
|||
private Long companyId; |
|||
@Schema(description = "创建者") |
|||
private Long creator; |
|||
@Schema(description = "创建时间") |
|||
private Long createDate; |
|||
@Schema(description = "更新者") |
|||
private Long updater; |
|||
@Schema(description = "更新时间") |
|||
private Long updateDate; |
|||
@Schema(description = "类型1.生产过程 2.原材料") |
|||
private Integer type; |
|||
@Schema(description = "生产过程分配量") |
|||
private String processAllocation; |
|||
@Schema(description = "生产工艺相关信息--由关联表得到") |
|||
private List<CbamProdRouteRelationDTO> routeRelationList; |
|||
|
|||
} |
|||
@ -1,34 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "生产过程和原料 与 工艺路线关联表") |
|||
public class CbamProdRouteRelationDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
@Schema(description = "工艺路线字典id") |
|||
private Long routeId; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
@Schema(description = "工艺路线名称") |
|||
private String routeName; |
|||
@Schema(description = "生产过程或原材料的id") |
|||
private Long prodMaterialId; |
|||
@Schema(description = "类型:1.生产过程 2.原料") |
|||
private Integer type; |
|||
|
|||
} |
|||
@ -1,97 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.entity; |
|||
|
|||
import com.mybatisflex.annotation.Table; |
|||
import com.thing.common.orm.entity.BaseInfoEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@Table("cbam_industry_info") |
|||
public class CbamIndustryEntity extends BaseInfoEntity { |
|||
|
|||
/** |
|||
* 所属行业字典id |
|||
*/ |
|||
private Long industryDictId; |
|||
/** |
|||
* 所属行业 |
|||
*/ |
|||
private String industryDict; |
|||
/** |
|||
* 开始日期 |
|||
*/ |
|||
private Long startDate; |
|||
/** |
|||
* 结束日期 |
|||
*/ |
|||
private Long endDate; |
|||
/** |
|||
* 报告周期说明:默认情况是一整个日历年 |
|||
*/ |
|||
private String cycleDesc; |
|||
/** |
|||
* 生产工厂名称 |
|||
*/ |
|||
private String factoryName; |
|||
|
|||
/** |
|||
* 生产工厂名称(英文名) |
|||
*/ |
|||
private String factoryEname; |
|||
/** |
|||
* 街道编号 |
|||
*/ |
|||
private String streetNum; |
|||
/** |
|||
* 在欧盟进行的主要经济活动 |
|||
*/ |
|||
private String economicActivities; |
|||
/** |
|||
* 邮政编码 |
|||
*/ |
|||
private String postalCode; |
|||
/** |
|||
* 邮政信箱 |
|||
*/ |
|||
private String postBox; |
|||
/** |
|||
* 城市 |
|||
*/ |
|||
private String city; |
|||
/** |
|||
* 国家 |
|||
*/ |
|||
private String country; |
|||
/** |
|||
* 国际港口代码 |
|||
*/ |
|||
private String internationalCode; |
|||
/** |
|||
* 生产工厂坐标(经度) |
|||
*/ |
|||
private String factoryLongitude; |
|||
/** |
|||
* 生产工厂坐标(纬度) |
|||
*/ |
|||
private String factoryLatitude; |
|||
/** |
|||
* 授权代表姓名 |
|||
*/ |
|||
private String authorizedName; |
|||
/** |
|||
* 电子邮件 |
|||
*/ |
|||
private String email; |
|||
/** |
|||
* 电话 |
|||
*/ |
|||
private String telephone; |
|||
/** |
|||
* 是否涉及原料:0否1是 |
|||
*/ |
|||
private Integer materialMark; |
|||
|
|||
} |
|||
@ -1,93 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_process_material") |
|||
public class CbamProcessMaterialEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 总产量 |
|||
*/ |
|||
private String totalOutput; |
|||
/** |
|||
* HS代码 |
|||
*/ |
|||
private String hsCode; |
|||
/** |
|||
* 产品生产过程字典id |
|||
*/ |
|||
private Long productionProcessId; |
|||
/** |
|||
* 产品生产过程 |
|||
*/ |
|||
private String productionProcess; |
|||
/** |
|||
* 综合商品类别 |
|||
*/ |
|||
private String productCategories; |
|||
/** |
|||
* 关联cbam_industry_information的主键id |
|||
*/ |
|||
private Long industryId; |
|||
/** |
|||
* 租户编码 |
|||
*/ |
|||
private Long tenantCode; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
private Long companyId; |
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long creator; |
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Long createDate; |
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private Long updater; |
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Long updateDate; |
|||
|
|||
/** |
|||
* 类型1.生产过程 2.原材料 |
|||
*/ |
|||
private Integer type; |
|||
/** |
|||
* 生产过程分配量 |
|||
*/ |
|||
private String processAllocation; |
|||
} |
|||
@ -1,51 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_prod_route_relation") |
|||
public class CbamProdRouteRelationEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 工艺路线字典id |
|||
*/ |
|||
private Long routeId; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
/** |
|||
* 工艺路线名称 |
|||
*/ |
|||
private String routeName; |
|||
/** |
|||
* 生产过程或原材料的id |
|||
*/ |
|||
private Long prodMaterialId; |
|||
/** |
|||
* 类型:1.生产过程 2.原料 |
|||
*/ |
|||
private Integer type; |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.mapper; |
|||
|
|||
|
|||
import com.thing.cbam.baesInfoExcel.entity.CbamIndustryEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CbamIndustryMapper extends PowerBaseMapper<CbamIndustryEntity> { |
|||
|
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.mapper; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProcessMaterialEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamProcessMaterialMapper extends PowerBaseMapper<CbamProcessMaterialEntity> { |
|||
|
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.mapper; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProdRouteRelationEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamProdRouteRelationMapper extends PowerBaseMapper<CbamProdRouteRelationEntity> { |
|||
|
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service; |
|||
|
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamIndustryDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamIndustryEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
|
|||
|
|||
public interface CbamIndustryService extends IBaseService<CbamIndustryEntity> { |
|||
|
|||
CbamIndustryDTO saveOrUpdate(CbamIndustryDTO dto); |
|||
|
|||
CbamIndustryDTO findById(Long id); |
|||
|
|||
void updateIndustryInfo(CbamIndustryDTO dto); |
|||
|
|||
void batchDeleteByIds( Long[] ids); |
|||
|
|||
LinkedHashMap<String, Object> validateMsg(Long hyId,Long startTime,Long endTime); |
|||
|
|||
|
|||
} |
|||
@ -1,51 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProcessMaterialEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
public interface CbamProcessMaterialService extends IBaseService<CbamProcessMaterialEntity> { |
|||
|
|||
|
|||
|
|||
|
|||
List<CbamProcessMaterialDTO> batchSaveOrUpdate(List<CbamProcessMaterialDTO> list); |
|||
|
|||
|
|||
/** |
|||
* 根据行业id和类型查询 |
|||
* @param industryId |
|||
* @param type |
|||
* @return |
|||
*/ |
|||
List<CbamProcessMaterialDTO> getByIndustryIdAndType(Long industryId,Integer type); |
|||
|
|||
/** |
|||
* 根据行业id查询 |
|||
* @param industryId |
|||
* @return |
|||
*/ |
|||
List<CbamProcessMaterialDTO> getByIndustryId(Long industryId); |
|||
|
|||
/** |
|||
* 批量保存 |
|||
* @param list |
|||
*/ |
|||
void batchSaveList(List<CbamProcessMaterialDTO> list,Integer type); |
|||
|
|||
|
|||
/** |
|||
* 批量更新 |
|||
* @param list |
|||
*/ |
|||
void batchDeleteAndSaveList(List<CbamProcessMaterialDTO> list,Long industryId,Integer type); |
|||
|
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProdRouteRelationDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProdRouteRelationEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
public interface CbamProdRouteRelationService extends IBaseService<CbamProdRouteRelationEntity> { |
|||
|
|||
List<CbamProdRouteRelationDTO> getByProdMaterialIdAndType(Long prodMaterialId, Integer type); |
|||
|
|||
List<CbamProdRouteRelationDTO> batchSaveOrUpdate(List<CbamProdRouteRelationDTO> list); |
|||
|
|||
} |
|||
@ -1,180 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service.impl; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamIndustryDTO; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProdRouteRelationDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamIndustryEntity; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProcessMaterialEntity; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProdRouteRelationEntity; |
|||
import com.thing.cbam.baesInfoExcel.mapper.CbamIndustryMapper; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamIndustryService; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProcessMaterialService; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProdRouteRelationService; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.exception.SysException; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import com.thing.common.orm.utils.IdGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.jetbrains.annotations.NotNull; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
|
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class CbamIndustryServiceImpl extends BaseServiceImpl<CbamIndustryMapper, CbamIndustryEntity> implements CbamIndustryService { |
|||
|
|||
// private final CbamProductInfoService cbamProductInfoService; |
|||
// |
|||
// private final CbamMaterialService cbamMaterialService; |
|||
// |
|||
// private final CbamProdRouteRelationService cbamProdRouteRelationService; |
|||
private final CbamProcessMaterialService cbamProcessMaterialService; |
|||
private final CbamProdRouteRelationService cbamProdRouteRelationService; |
|||
|
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params) { |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
//String code = (String) params.get("code"); |
|||
|
|||
Long startTime = (Long) params.get("startTime"); |
|||
Long endTime = (Long) params.get("endTime"); |
|||
String orderField = (String) params.get("orderField"); |
|||
String order = (String) params.get("order"); |
|||
wrapper.between(CbamIndustryEntity::getCreateDate, |
|||
startTime, |
|||
endTime, |
|||
!Objects.isNull(startTime) && !Objects.isNull(endTime)) |
|||
.orderBy(StringUtils.isNotBlank(orderField) ? orderField : "create_date", StringUtils.equals(order, Constant.ASC)) |
|||
; |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public CbamIndustryDTO findById(Long id) { |
|||
//1.查询CBAM基础信息,包括 cbam行业,报告周期,企业信息 |
|||
CbamIndustryDTO cbamIndustryDTO = mapper.selectObjectByQueryAs(QueryWrapper.create().eq(CbamIndustryEntity::getId, id), CbamIndustryDTO.class); |
|||
if (Objects.isNull(cbamIndustryDTO)) { |
|||
throw new SysException("CBAM行业,企业信息为空"); |
|||
} |
|||
//2.查询综合商品类别和相关生产过程和相关工艺路线 |
|||
List<CbamProcessMaterialDTO> processDTOList = cbamProcessMaterialService.getByIndustryIdAndType(cbamIndustryDTO.getId(),1); |
|||
//2.1查询综合商品类别相关工艺路线 |
|||
if(CollectionUtil.isNotEmpty(processDTOList)){ |
|||
for (CbamProcessMaterialDTO cbamProcessDTO : processDTOList) { |
|||
//查询工艺路线 |
|||
List<CbamProdRouteRelationDTO> routeRelationDTOS = cbamProdRouteRelationService.getByProdMaterialIdAndType(cbamProcessDTO.getId(), cbamProcessDTO.getType()); |
|||
if(CollectionUtil.isNotEmpty(routeRelationDTOS)){ |
|||
//将工艺路线设置到综合商品类别中 |
|||
cbamProcessDTO.setRouteRelationList(routeRelationDTOS); |
|||
} |
|||
} |
|||
cbamIndustryDTO.setCbamProductList(processDTOList); |
|||
} |
|||
//3.查询购买的原材料和相关工艺路线 |
|||
List<CbamProcessMaterialDTO> cbamMaterialDTOList = cbamProcessMaterialService.getByIndustryIdAndType(cbamIndustryDTO.getId(),2); |
|||
//3.1查询购买的原材料的相关工艺路线 |
|||
if(CollectionUtil.isNotEmpty(cbamMaterialDTOList)){ |
|||
for (CbamProcessMaterialDTO cbamProcessMaterialDTO : cbamMaterialDTOList) { |
|||
//查询工艺路线 |
|||
List<CbamProdRouteRelationDTO> routeRelationDTOS = cbamProdRouteRelationService.getByProdMaterialIdAndType(cbamProcessMaterialDTO.getId(), cbamProcessMaterialDTO.getType()); |
|||
if(CollectionUtil.isNotEmpty(routeRelationDTOS)){ |
|||
//将工艺路线设置到原料类别中 |
|||
cbamProcessMaterialDTO.setRouteRelationList(routeRelationDTOS); |
|||
} |
|||
} |
|||
cbamIndustryDTO.setCbamMaterialList(cbamMaterialDTOList); |
|||
} |
|||
return cbamIndustryDTO; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public CbamIndustryDTO saveOrUpdate(CbamIndustryDTO dto) { |
|||
Long id = dto.getId(); |
|||
//若是存在id,则更新相关操作,否则插入相关操作 |
|||
CbamIndustryEntity cbamIndustryEntity = ConvertUtils.sourceToTarget(dto, CbamIndustryEntity.class); |
|||
if(Objects.isNull(id)){ |
|||
id = IdGenerator.nextId(); |
|||
dto.setId(id); |
|||
//1.插入相关行业企业等基本信息 |
|||
mapper.insert(cbamIndustryEntity); |
|||
}else{ |
|||
//3.更新相关行业企业等基本信息 |
|||
mapper.updateByQuery(cbamIndustryEntity,QueryWrapper.create().eq(CbamIndustryEntity::getId, dto.getId())); |
|||
} |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void updateIndustryInfo(CbamIndustryDTO dto) { |
|||
updateIndustry(dto); |
|||
} |
|||
|
|||
|
|||
@NotNull |
|||
private CbamIndustryDTO saveIndustry(CbamIndustryDTO dto) { |
|||
CbamIndustryEntity cbamIndustryEntity = ConvertUtils.sourceToTarget(dto, CbamIndustryEntity.class); |
|||
//1.插入相关行业企业等基本信息 |
|||
mapper.insert(cbamIndustryEntity); |
|||
//2.获取生产过程和相关工艺路线 |
|||
List<CbamProcessMaterialDTO> cbamProductList = dto.getCbamProductList(); |
|||
if (CollectionUtil.isNotEmpty(cbamProductList)) { |
|||
cbamProcessMaterialService.batchSaveList(cbamProductList,1); |
|||
} |
|||
//3.获取购买的原材料和相关工艺路线 |
|||
List<CbamProcessMaterialDTO> cbamMaterialList = dto.getCbamMaterialList(); |
|||
if (CollectionUtil.isNotEmpty(cbamMaterialList)) { |
|||
cbamProcessMaterialService.batchSaveList(cbamMaterialList,2); |
|||
} |
|||
dto.setId(cbamIndustryEntity.getId()); |
|||
return dto; |
|||
} |
|||
|
|||
private void updateIndustry(CbamIndustryDTO dto) { |
|||
//1.根据id查询相关行业企业等基本信息 |
|||
CbamIndustryEntity cbamIndustryEntity = mapper.selectOneById(dto.getId()); |
|||
if(Objects.isNull(cbamIndustryEntity)){ |
|||
throw new SysException("查询相关行业企业等基本信息不存在"); |
|||
} |
|||
//2.将修改的值赋值给 industryEntity 对象 |
|||
CbamIndustryEntity industryEntity = ConvertUtils.sourceToTarget(dto, CbamIndustryEntity.class); |
|||
//3.更新相关行业企业等基本信息 |
|||
mapper.updateByQuery(industryEntity,QueryWrapper.create().eq(CbamIndustryEntity::getId, dto.getId())); |
|||
//4.获取生产过程和相关工艺路线,并进行更新 |
|||
List<CbamProcessMaterialDTO> cbamProductList = dto.getCbamProductList(); |
|||
cbamProcessMaterialService.batchDeleteAndSaveList(cbamProductList,industryEntity.getId(),1); |
|||
//5.获取购买的原材料和相关工艺路线,并进行更新 |
|||
List<CbamProcessMaterialDTO> cbamaterialList = dto.getCbamMaterialList(); |
|||
cbamProcessMaterialService.batchDeleteAndSaveList(cbamaterialList,industryEntity.getId(),2); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void batchDeleteByIds(Long[] ids) { |
|||
//1.删行业基本信息 |
|||
mapper.deleteBatchByIds(Arrays.asList(ids)); |
|||
//2.删除生产过程和原料信息 |
|||
cbamProcessMaterialService.getMapper().deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProcessMaterialEntity::getIndustryId,Arrays.asList(ids))); |
|||
//3.首选删除生产过程和原料信息相关联的工艺路线 |
|||
cbamProdRouteRelationService.getMapper().deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProdRouteRelationEntity::getProdMaterialId,Arrays.asList(ids))); |
|||
} |
|||
|
|||
@Override |
|||
public LinkedHashMap<String, Object> validateMsg(Long hyId,Long startTime,Long endTime) { |
|||
LinkedHashMap<String, Object> resMap = new LinkedHashMap<>(); |
|||
//1.所属行业不能为空,并且是行业字典的值 |
|||
return null; |
|||
} |
|||
} |
|||
@ -1,129 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service.impl; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProdRouteRelationDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProcessMaterialEntity; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProdRouteRelationEntity; |
|||
import com.thing.cbam.baesInfoExcel.mapper.CbamProcessMaterialMapper; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProcessMaterialService; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProdRouteRelationService; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class CbamProcessMaterialServiceImpl extends BaseServiceImpl<CbamProcessMaterialMapper, CbamProcessMaterialEntity> implements CbamProcessMaterialService { |
|||
|
|||
|
|||
private final CbamProdRouteRelationService cbamProdRouteRelationService; |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamProcessMaterialDTO> getByIndustryIdAndType(Long industryId, Integer type) { |
|||
QueryWrapper queryWrapper = QueryWrapper.create() |
|||
.eq(CbamProcessMaterialEntity::getIndustryId, industryId) |
|||
.eq(CbamProcessMaterialEntity::getType, type); |
|||
return mapper.selectListByQueryAs(queryWrapper, CbamProcessMaterialDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProcessMaterialDTO> getByIndustryId(Long industryId) { |
|||
QueryWrapper queryWrapper = QueryWrapper.create().eq(CbamProcessMaterialEntity::getIndustryId, industryId); |
|||
return mapper.selectListByQueryAs(queryWrapper, CbamProcessMaterialDTO.class); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void batchSaveList(List<CbamProcessMaterialDTO> list,Integer type) { |
|||
//遍历相关生产产品或者原料列表 |
|||
for (CbamProcessMaterialDTO cbamProcessMaterialDTO : list) { |
|||
cbamProcessMaterialDTO.setType(type); |
|||
CbamProcessMaterialEntity cbamProcessMaterialEntity = ConvertUtils.sourceToTarget(cbamProcessMaterialDTO, CbamProcessMaterialEntity.class); |
|||
//1.保存产品或者原料信息 |
|||
mapper.insert(cbamProcessMaterialEntity); |
|||
//2.保存产品或者原料的生产工艺信息 |
|||
List<CbamProdRouteRelationDTO> routeRelationList = cbamProcessMaterialDTO.getRouteRelationList(); |
|||
if(CollectionUtil.isNotEmpty(routeRelationList)){ |
|||
for (CbamProdRouteRelationDTO cbamProdRouteRelationDTO : routeRelationList) { |
|||
cbamProdRouteRelationDTO.setProdMaterialId(cbamProcessMaterialEntity.getId()); |
|||
cbamProdRouteRelationDTO.setType(type); |
|||
} |
|||
//将工艺信息保存到数据库 |
|||
cbamProdRouteRelationService.saveBatch(ConvertUtils.sourceToTarget(routeRelationList, CbamProdRouteRelationEntity.class)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProcessMaterialDTO> batchSaveOrUpdate(List<CbamProcessMaterialDTO> list) { |
|||
if(CollectionUtils.isEmpty(list)){ |
|||
return list; |
|||
} |
|||
//除了id,不管有没有值,都根据 industryId 和类型(自定义1.代表 生产过程 2.代表原料) 先删除,再插入 |
|||
List<Long> industryIds = list.stream().map(CbamProcessMaterialDTO::getIndustryId).distinct().toList(); |
|||
List<Integer> typeList = list.stream().map(CbamProcessMaterialDTO::getType).distinct().toList(); |
|||
mapper.deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProcessMaterialEntity::getIndustryId,industryIds) |
|||
.in(CbamProcessMaterialEntity::getType,typeList)); |
|||
//再进行插入操作 |
|||
List<CbamProcessMaterialDTO> resList = new ArrayList<>(); |
|||
for (CbamProcessMaterialDTO cbamProcessMaterialDTO : list) { |
|||
CbamProcessMaterialEntity cbamProcessMaterialEntity = ConvertUtils.sourceToTarget(cbamProcessMaterialDTO, CbamProcessMaterialEntity.class); |
|||
//1.保存产品或者原料信息 |
|||
mapper.insert(cbamProcessMaterialEntity); |
|||
//2.保存产品或者原料的生产工艺信息 |
|||
List<CbamProdRouteRelationDTO> routeRelationList = cbamProcessMaterialDTO.getRouteRelationList(); |
|||
if(CollectionUtil.isNotEmpty(routeRelationList)){ |
|||
for (CbamProdRouteRelationDTO cbamProdRouteRelationDTO : routeRelationList) { |
|||
cbamProdRouteRelationDTO.setProdMaterialId(cbamProcessMaterialEntity.getId()); |
|||
cbamProdRouteRelationDTO.setType(cbamProcessMaterialEntity.getType()); |
|||
} |
|||
//将工艺信息保存到数据库 |
|||
List<CbamProdRouteRelationDTO> routeRelationDTOS = cbamProdRouteRelationService.batchSaveOrUpdate(routeRelationList); |
|||
CbamProcessMaterialDTO processMaterialDTO = ConvertUtils.sourceToTarget(cbamProcessMaterialEntity, CbamProcessMaterialDTO.class); |
|||
processMaterialDTO.setRouteRelationList(routeRelationDTOS); |
|||
resList.add(processMaterialDTO); |
|||
} |
|||
} |
|||
return resList; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void batchDeleteAndSaveList(List<CbamProcessMaterialDTO> list,Long industryId,Integer type){ |
|||
//1.先删除相关的产品或者原料信息 |
|||
mapper.deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProcessMaterialEntity::getIndustryId,list.stream().map(CbamProcessMaterialDTO::getIndustryId).toList()) |
|||
.eq(CbamProcessMaterialEntity::getType,type) |
|||
); |
|||
//2.先删除相关的产品或者原料信息 关联的 生产工艺信息 |
|||
cbamProdRouteRelationService.getMapper().deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProdRouteRelationEntity::getProdMaterialId,list.stream().map(CbamProcessMaterialDTO::getId).toList()) |
|||
.eq(CbamProdRouteRelationEntity::getType,type) |
|||
); |
|||
//3.重写保存相关的产品或者原料信息和相关联的工艺信息 |
|||
batchSaveList( list,type); |
|||
} |
|||
} |
|||
@ -1,54 +0,0 @@ |
|||
package com.thing.cbam.baesInfoExcel.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProdRouteRelationDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProdRouteRelationEntity; |
|||
import com.thing.cbam.baesInfoExcel.mapper.CbamProdRouteRelationMapper; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProdRouteRelationService; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 生产过程和原料 与 工艺路线关联表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Service |
|||
public class CbamProdRouteRelationServiceImpl extends BaseServiceImpl<CbamProdRouteRelationMapper, CbamProdRouteRelationEntity> implements CbamProdRouteRelationService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamProdRouteRelationDTO> getByProdMaterialIdAndType(Long prodMaterialId, Integer type) { |
|||
QueryWrapper queryWrapper = QueryWrapper.create() |
|||
.eq(CbamProdRouteRelationEntity::getProdMaterialId, prodMaterialId) |
|||
.eq(CbamProdRouteRelationEntity::getType, type) |
|||
.orderBy(CbamProdRouteRelationEntity::getSort,true); |
|||
return mapper.selectListByQueryAs(queryWrapper, CbamProdRouteRelationDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProdRouteRelationDTO> batchSaveOrUpdate(List<CbamProdRouteRelationDTO> list) { |
|||
//除了id,不管有没有值,都根据(生产过程或者原料id) 和类型(自定义1.代表 生产过程 2.代表原料) 先删除,再插入 |
|||
List<Integer> typeList = list.stream().map(CbamProdRouteRelationDTO::getType).toList(); |
|||
List<Long> prodMaterialIdList = list.stream().map(CbamProdRouteRelationDTO::getProdMaterialId).toList(); |
|||
mapper.deleteByQuery(QueryWrapper.create() |
|||
.in(CbamProdRouteRelationEntity::getProdMaterialId, prodMaterialIdList) |
|||
.in(CbamProdRouteRelationEntity::getType, typeList)); |
|||
//插入工艺路线 |
|||
List<CbamProdRouteRelationEntity> cbamProdRouteRelationEntities = ConvertUtils.sourceToTarget(list, CbamProdRouteRelationEntity.class); |
|||
mapper.insertBatch(cbamProdRouteRelationEntities); |
|||
return ConvertUtils.sourceToTarget(cbamProdRouteRelationEntities, CbamProdRouteRelationDTO.class); |
|||
} |
|||
} |
|||
@ -1,85 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.controller; |
|||
|
|||
import com.thing.cbam.carbonPrice.dto.CbamCarbonPriceToolDTO; |
|||
import com.thing.cbam.carbonPrice.service.CbamCarbonPriceToolService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/price/tool") |
|||
@Tag(name = "碳价工具") |
|||
@RequiredArgsConstructor |
|||
public class CbamCarbonPriceToolController { |
|||
|
|||
@Resource |
|||
private CbamCarbonPriceToolService cbamCarbonPriceToolService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary = "分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true), |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true), |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"), |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamCarbonPriceToolDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> param) { |
|||
PageData<CbamCarbonPriceToolDTO> pageList = cbamCarbonPriceToolService.getPageData(param, CbamCarbonPriceToolDTO.class); |
|||
return new Result<PageData<CbamCarbonPriceToolDTO>>().ok(pageList); |
|||
} |
|||
@GetMapping("{id}") |
|||
@Operation(summary = "信息") |
|||
public Result<CbamCarbonPriceToolDTO> info(@PathVariable("id") String id) { |
|||
CbamCarbonPriceToolDTO dto = cbamCarbonPriceToolService.getByIdAs(id, CbamCarbonPriceToolDTO.class); |
|||
return new Result<CbamCarbonPriceToolDTO>().ok(dto); |
|||
} |
|||
@PostMapping |
|||
@Operation(summary = "保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamCarbonPriceToolDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamCarbonPriceToolService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@PutMapping |
|||
@Operation(summary = "修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamCarbonPriceToolDTO dto) { |
|||
//实验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamCarbonPriceToolService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@DeleteMapping |
|||
@Operation(summary = "删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids) { |
|||
AssertUtils.isArrayEmpty(ids,"id"); |
|||
cbamCarbonPriceToolService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamCarbonBurnDTO> list = cbamCarbonBurnService.listAs(params, CbamCarbonBurnDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "直接排放量", list, CbamCarbonBurnExcel.class); |
|||
*} |
|||
*/ |
|||
} |
|||
@ -1,56 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 碳价工具 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-28 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "碳价工具") |
|||
public class CbamCarbonPriceToolDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
@Schema(description = "碳价工具") |
|||
private String priceTool; |
|||
@Schema(description = "其他附加说明") |
|||
private String otherInfo; |
|||
@Schema(description = "货币") |
|||
private String currency; |
|||
@Schema(description = "配额缺口占总配额的比例") |
|||
private String gapProportion; |
|||
@Schema(description = "国内碳价") |
|||
private String carbonPrice; |
|||
@Schema(description = "抵扣金额") |
|||
private String deductionAmount; |
|||
@Schema(description = "关联cbam_industry_information的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "生产过程") |
|||
private String productionProcess; |
|||
@Schema(description = "综合商品类别") |
|||
private String productCategories; |
|||
@Schema(description = "SE涵盖范围") |
|||
private String seCoverage; |
|||
@Schema(description = "抵扣金额(CNY/t)") |
|||
private String deductionAmountCny; |
|||
@Schema(description = "预期碳价(CNY/t)") |
|||
private String expectedPrice; |
|||
@Schema(description = "结果:有效的预期碳价") |
|||
private String effectivePrice; |
|||
@Schema(description = "关联cbam_process_material的生产过程") |
|||
private String process_id; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,92 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 碳价工具 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-28 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_carbon_price_tool") |
|||
public class CbamCarbonPriceToolEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 碳价工具 |
|||
*/ |
|||
private String priceTool; |
|||
/** |
|||
* 其他附加说明 |
|||
*/ |
|||
private String otherInfo; |
|||
/** |
|||
* 货币 |
|||
*/ |
|||
private String currency; |
|||
/** |
|||
* 配额缺口占总配额的比例 |
|||
*/ |
|||
private String gapProportion; |
|||
/** |
|||
* 国内碳价 |
|||
*/ |
|||
private String carbonPrice; |
|||
/** |
|||
* 抵扣金额 |
|||
*/ |
|||
private String deductionAmount; |
|||
/** |
|||
* 关联cbam_industry_information的主键id |
|||
*/ |
|||
private Long industryId; |
|||
/** |
|||
* 生产过程 |
|||
*/ |
|||
private String productionProcess; |
|||
/** |
|||
* 综合商品类别 |
|||
*/ |
|||
private String productCategories; |
|||
/** |
|||
* SE涵盖范围 |
|||
*/ |
|||
private String seCoverage; |
|||
/** |
|||
* 抵扣金额(CNY/t) |
|||
*/ |
|||
private String deductionAmountCny; |
|||
/** |
|||
* 预期碳价(CNY/t) |
|||
*/ |
|||
private String expectedPrice; |
|||
/** |
|||
* 结果:有效的预期碳价 |
|||
*/ |
|||
private String effectivePrice; |
|||
/** |
|||
* 关联cbam_process_material的生产过程 |
|||
*/ |
|||
private String process_id; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
|
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.mapper; |
|||
|
|||
import com.thing.cbam.carbonPrice.entity.CbamCarbonPriceToolEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CbamCarbonPriceToolMapper extends PowerBaseMapper<CbamCarbonPriceToolEntity> { |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.service; |
|||
|
|||
import com.thing.cbam.carbonPrice.dto.CbamCarbonPriceToolDTO; |
|||
import com.thing.cbam.carbonPrice.entity.CbamCarbonPriceToolEntity; |
|||
import com.thing.cbam.dict.dto.CbamCarbonPriceCurrencyDictDTO; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
import java.util.List; |
|||
|
|||
public interface CbamCarbonPriceToolService extends IBaseService<CbamCarbonPriceToolEntity> { |
|||
LinkedHashMap<String,Object> valiteMsg(CbamCarbonPriceToolDTO cbamCarbonPriceToolDTO); |
|||
} |
|||
@ -1,60 +0,0 @@ |
|||
package com.thing.cbam.carbonPrice.service.Impl; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.clickhouse.client.internal.google.common.collect.Maps; |
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamProcessMaterialEntity; |
|||
import com.thing.cbam.carbonPrice.dto.CbamCarbonPriceToolDTO; |
|||
import com.thing.cbam.carbonPrice.entity.CbamCarbonPriceToolEntity; |
|||
import com.thing.cbam.carbonPrice.mapper.CbamCarbonPriceToolMapper; |
|||
import com.thing.cbam.carbonPrice.service.CbamCarbonPriceToolService; |
|||
import com.thing.cbam.dict.dto.CbamCarbonPriceCurrencyDictDTO; |
|||
import com.thing.cbam.dict.service.CbamCarbonPriceCurrencyDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.LinkedHashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class CbamCarbonPriceToolServiceImpl extends BaseServiceImpl<CbamCarbonPriceToolMapper, CbamCarbonPriceToolEntity> implements CbamCarbonPriceToolService { |
|||
private final CbamCarbonPriceCurrencyDictService cbamCarbonPriceCurrencyDictService; |
|||
|
|||
public CbamCarbonPriceToolServiceImpl(CbamCarbonPriceCurrencyDictService cbamCarbonPriceCurrencyDictService) { |
|||
super(); |
|||
this.cbamCarbonPriceCurrencyDictService = cbamCarbonPriceCurrencyDictService; |
|||
} |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params) { |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public LinkedHashMap<String, Object> valiteMsg(CbamCarbonPriceToolDTO cbamCarbonPriceToolDTO) { |
|||
LinkedHashMap<String, Object> resMap = new LinkedHashMap<>(); |
|||
if (StringUtils.isBlank(cbamCarbonPriceToolDTO.getPriceTool())) { |
|||
resMap.put("priceTool", "碳价工具不能为空"); |
|||
} |
|||
if (StringUtils.isBlank(cbamCarbonPriceToolDTO.getOtherInfo())){ |
|||
resMap.put("otherInfo","其他附加信息不能为空"); |
|||
} |
|||
List<CbamCarbonPriceCurrencyDictDTO> cbamCarbonPriceCurrencyDictDTOS = cbamCarbonPriceCurrencyDictService.listAs(Maps.newHashMap(), CbamCarbonPriceCurrencyDictDTO.class); |
|||
if (CollectionUtil.isEmpty(cbamCarbonPriceCurrencyDictDTOS)) { |
|||
resMap.put("currency","货币不能为空"); |
|||
} |
|||
if (StringUtils.isBlank(cbamCarbonPriceToolDTO.getCarbonPrice())){ |
|||
resMap.put("carbonPrice","国内碳价不能为空"); |
|||
} |
|||
if (StringUtils.isBlank(cbamCarbonPriceToolDTO.getDeductionAmount())){ |
|||
resMap.put("deductionAmount","抵扣金额(当地货币)不能为空"); |
|||
} |
|||
return resMap; |
|||
} |
|||
|
|||
} |
|||
@ -1,57 +0,0 @@ |
|||
package com.thing.cbam.context; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.dto.CbamIndustryDTO; |
|||
import com.thing.cbam.baesInfoExcel.dto.CbamProcessMaterialDTO; |
|||
import com.thing.cbam.carbonPrice.dto.CbamCarbonPriceToolDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamPerfluorinatedCarbonDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamProcessAllocationDTO; |
|||
import com.thing.cbam.electricity.dto.CbamElectricityToolDTO; |
|||
import com.thing.cbam.indirectCarbon.dto.CbamCarbonIndirectEmissionsDTO; |
|||
import com.thing.cbam.indirectCarbon.dto.CbamCarbonPowerProgressAllocationDTO; |
|||
import com.thing.cbam.indirectCarbon.dto.CbamPowerSummaryFuelDTO; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@Schema(description = "Excel所有的请求参数") |
|||
public class ContextExcelDTO { |
|||
|
|||
@Schema(description = "CBAM的行业,报告周期,企业信息") |
|||
private CbamIndustryDTO industry; |
|||
|
|||
@Schema(description = "综合商品类别和相关生产过程集合") |
|||
private List<CbamProcessMaterialDTO> processList; |
|||
|
|||
@Schema(description = "购买的原材料集合") |
|||
private List<CbamProcessMaterialDTO> materialList; |
|||
|
|||
@Schema(description = "是否涉及燃烧排放 和 是否涉及过程排放 和 是否涉及物料平衡 和 是否有连续排放测量系统(CEMS)") |
|||
private List<CbamCarbonDirectDTO> carbonDirectList; |
|||
|
|||
@Schema(description = "全氟化碳PFC排放: 是否涉及斜率法 和 是否涉及过电压法") |
|||
private List<CbamPerfluorinatedCarbonDTO> perfluorinatedCarbonList; |
|||
|
|||
@Schema(description = "各生产过程中原材料/燃料的分配") |
|||
private List<CbamProcessAllocationDTO> processAllocationList; |
|||
|
|||
@Schema(description = "间接排放量") |
|||
private List<CbamCarbonIndirectEmissionsDTO> carbonIndirectEmissionsList; |
|||
|
|||
@Schema(description = "各生产过程中耗电量的分配") |
|||
private List<CbamCarbonPowerProgressAllocationDTO> carbonPowerProgressAllocationList; |
|||
|
|||
@Schema(description = "排放量汇总与数据质量信息 和 燃料平衡 ") |
|||
private CbamPowerSummaryFuelDTO powerSummaryFuel; |
|||
|
|||
@Schema(description = "热电联产工具 ") |
|||
private CbamElectricityToolDTO electricityTool; |
|||
|
|||
@Schema(description = "碳价工具 ") |
|||
private CbamCarbonPriceToolDTO dto; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,94 +0,0 @@ |
|||
package com.thing.cbam.context; |
|||
|
|||
import com.thing.cbam.baesInfoExcel.service.CbamIndustryService; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProcessMaterialService; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamProdRouteRelationService; |
|||
import com.thing.cbam.carbonPrice.service.CbamCarbonPriceToolService; |
|||
import com.thing.cbam.directCarbon.service.CbamCarbonDirectService; |
|||
import com.thing.cbam.directCarbon.service.CbamPerfluorinatedCarbonService; |
|||
import com.thing.cbam.directCarbon.service.CbamProcessAllocationService; |
|||
import com.thing.cbam.electricity.service.CbamElectricityToolService; |
|||
import com.thing.cbam.indirectCarbon.service.CbamCarbonIndirectEmissionsService; |
|||
import com.thing.cbam.indirectCarbon.service.CbamCarbonPowerProgressAllocationService; |
|||
import com.thing.cbam.indirectCarbon.service.CbamPowerSummaryFuelService; |
|||
import com.thing.cbam.material.service.CbamMaterialSpecificService; |
|||
import com.thing.cbam.production.service.CbamProductAllocationService; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/cbam/context") |
|||
@Tag(name = "excel的上下文管理") |
|||
@RequiredArgsConstructor |
|||
public class ExcelContextManage { |
|||
|
|||
/** |
|||
* A表企业基础信息 |
|||
*/ |
|||
private final CbamIndustryService cbamIndustryService; |
|||
|
|||
/** |
|||
* A表企综合商品类别和相关生产过程 |
|||
*/ |
|||
private final CbamProcessMaterialService cbamProcessMaterialService; |
|||
|
|||
/** |
|||
* A表购买的原材料 |
|||
*/ |
|||
private final CbamProdRouteRelationService cbamProdRouteRelationService; |
|||
|
|||
/** |
|||
* B表 是否涉及燃烧排放 和 是否涉及过程排放 和 是否涉及物料平衡 和 是否有连续排放测量系统(CEMS) |
|||
*/ |
|||
private final CbamCarbonDirectService cbamCarbonDirectService; |
|||
|
|||
/** |
|||
* B表 全氟化碳PFC排放: 是否涉及斜率法 和 是否涉及过电压法 |
|||
*/ |
|||
private final CbamPerfluorinatedCarbonService cbamPerfluorinatedCarbonService; |
|||
|
|||
/** |
|||
* B表--各生产过程中原材料/燃料的分配 |
|||
*/ |
|||
private final CbamProcessAllocationService cbamProcessAllocationService; |
|||
|
|||
|
|||
/** |
|||
* c表--间接排放量 |
|||
*/ |
|||
private final CbamCarbonIndirectEmissionsService cbamCarbonIndirectEmissionsService; |
|||
|
|||
|
|||
/** |
|||
* c表-- 各生产过程中耗电量的分配 |
|||
*/ |
|||
private final CbamCarbonPowerProgressAllocationService cbamCarbonPowerProgressAllocationService; |
|||
|
|||
/** |
|||
* c表-- 排放量汇总与数据质量信息 和 燃料平衡 |
|||
*/ |
|||
private final CbamPowerSummaryFuelService cbamPowerSummaryFuelService; |
|||
|
|||
/** |
|||
* d表-- 各生产过程中产品的分配 / 可测量的发热量排放量 / 废气排放量 /生产过程输出的电力 |
|||
*/ |
|||
private final CbamProductAllocationService cbamProductAllocationService; |
|||
|
|||
/** |
|||
* E表-- 原材料特定隐含排放SEE /各生产过程中原材料的消耗量 |
|||
*/ |
|||
private final CbamMaterialSpecificService cbamMaterialSpecificService; |
|||
|
|||
/** |
|||
* F表-- 热电联产(CHP)计算工具 以下所有 |
|||
*/ |
|||
private final CbamElectricityToolService cbamElectricityToolService; |
|||
|
|||
/** |
|||
* F表-- 计算碳价格工具 |
|||
*/ |
|||
private CbamCarbonPriceToolService carbonPriceToolServicevice; |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
package com.thing.cbam.context; |
|||
|
|||
public class ExcelTypeDTO { |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,110 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamCarbonPriceCurrencyDictDTO; |
|||
import com.thing.cbam.dict.service.CbamCarbonPriceCurrencyDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbamcarbonpricecurrencydict") |
|||
@Tag(name="计算碳价的工具货币字典表") |
|||
@RequiredArgsConstructor |
|||
public class CbamCarbonPriceCurrencyDictController { |
|||
|
|||
private final CbamCarbonPriceCurrencyDictService cbamCarbonPriceCurrencyDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamCarbonPriceCurrencyDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamCarbonPriceCurrencyDictDTO> page = cbamCarbonPriceCurrencyDictService.getPageData(params, CbamCarbonPriceCurrencyDictDTO.class); |
|||
return new Result<PageData<CbamCarbonPriceCurrencyDictDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamCarbonPriceCurrencyDictDTO> get(@PathVariable("id") Long id){ |
|||
CbamCarbonPriceCurrencyDictDTO data = cbamCarbonPriceCurrencyDictService.getByIdAs(id, CbamCarbonPriceCurrencyDictDTO.class); |
|||
return new Result<CbamCarbonPriceCurrencyDictDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamCarbonPriceCurrencyDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamCarbonPriceCurrencyDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamCarbonPriceCurrencyDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamCarbonPriceCurrencyDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamCarbonPriceCurrencyDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
@GetMapping("list") |
|||
@Operation(summary = "货币字典表") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamCarbonPriceCurrencyDictDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
List<CbamCarbonPriceCurrencyDictDTO> list = cbamCarbonPriceCurrencyDictService.listAs(params, CbamCarbonPriceCurrencyDictDTO.class); |
|||
return new Result<List<CbamCarbonPriceCurrencyDictDTO>>().ok(list); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamCarbonPriceCurrencyDictDTO> list = cbamCarbonPriceCurrencyDictService.listAs(params, CbamCarbonPriceCurrencyDictDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "计算碳价的工具货币字典表", list, CbamCarbonPriceCurrencyDictExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,85 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamCountryDictDTO; |
|||
import com.thing.cbam.dict.service.CbamCountryDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/cbam/country/dict") |
|||
@Tag(name = "国家字典表") |
|||
@RequiredArgsConstructor |
|||
public class CbamCountryDictController { |
|||
private final CbamCountryDictService cbamCountryDictService; |
|||
@GetMapping("page") |
|||
@Operation(summary = "分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true), |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true), |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"), |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamCountryDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String,Object> param) { |
|||
PageData<CbamCountryDictDTO> pageList = cbamCountryDictService.getPageData(param,CbamCountryDictDTO.class); |
|||
return new Result<PageData<CbamCountryDictDTO>>().ok(pageList); |
|||
} |
|||
|
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary = "信息") |
|||
public Result<CbamCountryDictDTO> get(@PathVariable("id") Long id) { |
|||
CbamCountryDictDTO dto = cbamCountryDictService.getByIdAs(id,CbamCountryDictDTO.class); |
|||
return new Result<CbamCountryDictDTO>().ok(dto); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary = "保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamCountryDictDTO dto) { |
|||
cbamCountryDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary = "修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamCountryDictDTO dto) { |
|||
//效验数据 |
|||
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamCountryDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary = "删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids) { |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamCountryDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
@GetMapping("list") |
|||
@Operation(summary = "查询国家列表") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamCountryDictDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
List<CbamCountryDictDTO> list = cbamCountryDictService.listAs(params, CbamCountryDictDTO.class); |
|||
return new Result<List<CbamCountryDictDTO>>().ok(list); |
|||
} |
|||
|
|||
} |
|||
@ -1,81 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamFactorDictDTO; |
|||
import com.thing.cbam.dict.service.CbamFactorDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/cbam/factor/dict") |
|||
@Tag(name = "电力排放因子来源") |
|||
@RequiredArgsConstructor |
|||
public class CbamFactorDictController { |
|||
private final CbamFactorDictService cbamFactorDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary = "分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true), |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true), |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"), |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamFactorDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> param) { |
|||
PageData<CbamFactorDictDTO> pageList = cbamFactorDictService.getPageData(param, CbamFactorDictDTO.class); |
|||
return new Result<PageData<CbamFactorDictDTO>>().ok(pageList); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary = "信息") |
|||
public Result<CbamFactorDictDTO> get(@PathVariable("id") Long id) { |
|||
CbamFactorDictDTO dto = cbamFactorDictService.getByIdAs(id, CbamFactorDictDTO.class); |
|||
return new Result<CbamFactorDictDTO>().ok(dto); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary = "save") |
|||
@LogOperation("保存") |
|||
public Result<CbamFactorDictDTO> save(@RequestBody CbamFactorDictDTO dto) { |
|||
cbamFactorDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@PutMapping |
|||
@Operation(summary = "update") |
|||
@LogOperation("修改") |
|||
public Result<CbamFactorDictDTO> update(@RequestBody CbamFactorDictDTO dto) { |
|||
cbamFactorDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@DeleteMapping |
|||
@Operation(summary = "delete") |
|||
@LogOperation("删除") |
|||
public Result<CbamFactorDictDTO> update(@RequestBody Long[] ids) { |
|||
AssertUtils.isArrayEmpty(ids,"id"); |
|||
cbamFactorDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
|
|||
@GetMapping("list") |
|||
@Operation(summary = "电力排放因子来源") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamFactorDictDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
List<CbamFactorDictDTO> list = cbamFactorDictService.listAs(params, CbamFactorDictDTO.class); |
|||
return new Result<List<CbamFactorDictDTO>>().ok(list); |
|||
} |
|||
} |
|||
@ -1,112 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamFuelDictDTO; |
|||
import com.thing.cbam.dict.service.CbamFuelDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/fuel") |
|||
@Tag(name="燃料参数字典表") |
|||
@RequiredArgsConstructor |
|||
public class CbamFuelDictController { |
|||
|
|||
private final CbamFuelDictService cbamFuelDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamFuelDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamFuelDictDTO> page = cbamFuelDictService.getPageData(params, CbamFuelDictDTO.class); |
|||
return new Result<PageData<CbamFuelDictDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("list") |
|||
@Operation(summary="列表") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamFuelDictDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
List<CbamFuelDictDTO> list = cbamFuelDictService.listAs(params, CbamFuelDictDTO.class); |
|||
return new Result<List<CbamFuelDictDTO>>().ok(list); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamFuelDictDTO> get(@PathVariable("id") Long id){ |
|||
CbamFuelDictDTO data = cbamFuelDictService.getByIdAs(id, CbamFuelDictDTO.class); |
|||
return new Result<CbamFuelDictDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamFuelDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamFuelDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamFuelDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamFuelDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamFuelDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamFuelDictDTO> list = cbamFuelDictService.listAs(params, CbamFuelDictDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "燃料参数字典表", list, CbamFuelDictExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,111 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamHsDictDTO; |
|||
import com.thing.cbam.dict.dto.CbamProdProcessDictDTO; |
|||
import com.thing.cbam.dict.service.CbamHsDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/hs") |
|||
@Tag(name="hs字典表") |
|||
@RequiredArgsConstructor |
|||
public class CbamHsDictController { |
|||
|
|||
private final CbamHsDictService cbamHsDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamHsDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamHsDictDTO> page = cbamHsDictService.getPageData(params, CbamHsDictDTO.class); |
|||
return new Result<PageData<CbamHsDictDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamHsDictDTO> get(@PathVariable("id") Long id){ |
|||
CbamHsDictDTO data = cbamHsDictService.getByIdAs(id, CbamHsDictDTO.class); |
|||
return new Result<CbamHsDictDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamHsDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamHsDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamHsDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamHsDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamHsDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
|
|||
|
|||
@GetMapping("process/{code}") |
|||
@Operation(summary="信息") |
|||
public Result<List<CbamHsDictDTO>> getByHsCode(@PathVariable("code") String code){ |
|||
List<CbamHsDictDTO> cbamHsDictDTOS = cbamHsDictService.getByHsCode(code); |
|||
return new Result<List<CbamHsDictDTO>>().ok(cbamHsDictDTOS); |
|||
} |
|||
|
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamHsDictDTO> list = cbamHsDictService.listAs(params, CbamHsDictDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "hs字典表", list, CbamHsDictExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,114 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamIndustryDictDTO; |
|||
import com.thing.cbam.dict.service.CbamIndustryDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/industry/dict") |
|||
@Tag(name="所属行业字典") |
|||
@RequiredArgsConstructor |
|||
public class CbamIndustryDictController { |
|||
|
|||
private final CbamIndustryDictService cbamIndustryDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamIndustryDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamIndustryDictDTO> page = cbamIndustryDictService.getPageData(params, CbamIndustryDictDTO.class); |
|||
return new Result<PageData<CbamIndustryDictDTO>>().ok(page); |
|||
} |
|||
|
|||
|
|||
@GetMapping("list") |
|||
@Operation(summary="行业字典列表") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamIndustryDictDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
List<CbamIndustryDictDTO> list = cbamIndustryDictService.listAs(params, CbamIndustryDictDTO.class); |
|||
return new Result<List<CbamIndustryDictDTO>>().ok(list); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamIndustryDictDTO> get(@PathVariable("id") Long id){ |
|||
CbamIndustryDictDTO data = cbamIndustryDictService.getByIdAs(id, CbamIndustryDictDTO.class); |
|||
return new Result<CbamIndustryDictDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamIndustryDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamIndustryDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamIndustryDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamIndustryDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamIndustryDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamIndustryDictDTO> list = cbamIndustryDictService.listAs(params, CbamIndustryDictDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "所属行业字典", list, CbamIndustryDictExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,127 +0,0 @@ |
|||
package com.thing.cbam.dict.controller; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamProdProcessDictDTO; |
|||
import com.thing.cbam.dict.service.CbamProdProcessDictService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/prodprocess") |
|||
@Tag(name="原料(生产过程)---工艺路线映射字典表") |
|||
@RequiredArgsConstructor |
|||
public class CbamProdProcessDictController { |
|||
|
|||
private final CbamProdProcessDictService cbamProdProcessDictService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamProdProcessDictDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamProdProcessDictDTO> page = cbamProdProcessDictService.getPageData(params, CbamProdProcessDictDTO.class); |
|||
return new Result<PageData<CbamProdProcessDictDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamProdProcessDictDTO> get(@PathVariable("id") Long id){ |
|||
CbamProdProcessDictDTO data = cbamProdProcessDictService.getByIdAs(id, CbamProdProcessDictDTO.class); |
|||
return new Result<CbamProdProcessDictDTO>().ok(data); |
|||
} |
|||
|
|||
|
|||
@GetMapping("prod/{industryId}") |
|||
@Operation(summary="根据行业查询原料") |
|||
public Result<List<CbamProdProcessDictDTO>> getByIndustryId(@PathVariable("industryId") Long industryId){ |
|||
List<CbamProdProcessDictDTO> cbamProdProcessDictDTOS = cbamProdProcessDictService.getByIndustryId(industryId); |
|||
return new Result<List<CbamProdProcessDictDTO>>().ok(cbamProdProcessDictDTOS); |
|||
} |
|||
|
|||
|
|||
|
|||
@GetMapping("route/{prodId}") |
|||
@Operation(summary="根据原料查询工艺路线") |
|||
public Result<List<CbamProdProcessDictDTO>> getByProdId(@PathVariable("prodId") Long prodId){ |
|||
List<CbamProdProcessDictDTO> cbamProdProcessDictDTOS = cbamProdProcessDictService.getByProdId(prodId); |
|||
return new Result<List<CbamProdProcessDictDTO>>().ok(cbamProdProcessDictDTOS); |
|||
} |
|||
|
|||
|
|||
|
|||
@PostMapping("route/list") |
|||
@Operation(summary="工艺路线的集合") |
|||
public Result<List<CbamProdProcessDictDTO>> getByProdIds(@RequestBody List<Long> prodIds){ |
|||
List<CbamProdProcessDictDTO> cbamProdProcessDictDTOS = cbamProdProcessDictService.getByProdIds(prodIds); |
|||
return new Result<List<CbamProdProcessDictDTO>>().ok(cbamProdProcessDictDTOS); |
|||
} |
|||
|
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamProdProcessDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamProdProcessDictService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamProdProcessDictDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamProdProcessDictService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamProdProcessDictService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamProdProcessDictDTO> list = cbamProdProcessDictService.listAs(params, CbamProdProcessDictDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "原料(生产过程)---工艺路线映射表", list, CbamProdProcessDictExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,34 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "计算碳价的工具货币字典表") |
|||
public class CbamCarbonPriceCurrencyDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "货币中文名称") |
|||
private String name; |
|||
@Schema(description = "货币英文名称") |
|||
private String ename; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
|
|||
} |
|||
@ -1,36 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 国家字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-04 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "国家字典表") |
|||
public class CbamCountryDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "国家名称") |
|||
private String name; |
|||
@Schema(description = "国家英文名称") |
|||
private String ename; |
|||
@Schema(description = "是否默认:0.默认 1.不默认") |
|||
private Integer isDefault; |
|||
@Schema(description = "排序") |
|||
private String sort; |
|||
|
|||
} |
|||
@ -1,34 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 电力排放因子来源字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "电力排放因子来源字典表") |
|||
public class CbamFactorDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "名称") |
|||
private String name; |
|||
@Schema(description = "说明") |
|||
private String description; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
|
|||
} |
|||
@ -1,37 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "燃料参数字典表") |
|||
public class CbamFuelDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "中文名") |
|||
private String name; |
|||
@Schema(description = "英文名") |
|||
private String ename; |
|||
@Schema(description = "低位发热量") |
|||
private String lowHeatAmount; |
|||
@Schema(description = "单位") |
|||
private String unit; |
|||
@Schema(description = "碳氧化率") |
|||
private String carbonOxdRate; |
|||
@Schema(description = "排放因子") |
|||
private String emissionFactor; |
|||
|
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "hs字典表") |
|||
public class CbamHsDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "预留字段,可以关联") |
|||
private String name; |
|||
@Schema(description = "hs编码") |
|||
private String code; |
|||
@Schema(description = "排序") |
|||
private String sort; |
|||
@Schema(description = "类型预留字段") |
|||
private String type; |
|||
@Schema(description = "英文名称预留字段") |
|||
private String ename; |
|||
@Schema(description = "关联cbam_prod_process_dict的id") |
|||
private Long prodProcessId; |
|||
// @Schema(description = "产品字典列表") |
|||
// private List<CbamProdProcessDictDTO> prodProcessList; |
|||
@Schema(description = "生产过程/产品字典") |
|||
private CbamProdProcessDictDTO prodProcess; |
|||
|
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "所属行业字典") |
|||
public class CbamIndustryDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "中文名称") |
|||
private String name; |
|||
@Schema(description = "英文名称") |
|||
private String ename; |
|||
@Schema(description = "排序") |
|||
private Integer sort; |
|||
|
|||
} |
|||
@ -1,40 +0,0 @@ |
|||
package com.thing.cbam.dict.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "原料(生产过程)---工艺路线映射表") |
|||
public class CbamProdProcessDictDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "中文名称") |
|||
private String name; |
|||
@Schema(description = "英文名称") |
|||
private String ename; |
|||
@Schema(description = "类型") |
|||
private String type; |
|||
@Schema(description = "排序") |
|||
private Integer sort; |
|||
@Schema(description = "是否表黄:0否 1是") |
|||
private Integer tagging; |
|||
@Schema(description = "关联:当type=yl 关联 cbam_industry_dict 主键id,否则关联本表的id") |
|||
private Long pidId; |
|||
@Schema(description = "生产工艺字典列表") |
|||
private List<CbamProdProcessDictDTO> prodRouteList; |
|||
|
|||
} |
|||
@ -1,43 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_carbon_price_currency_dict") |
|||
public class CbamCarbonPriceCurrencyDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 货币中文名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 货币英文名称 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
} |
|||
@ -1,50 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 国家字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-04 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_country_dict") |
|||
public class CbamCountryDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 国家名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 国家英文名称 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 是否默认:0.默认 1.不默认 |
|||
*/ |
|||
private Integer isDefault; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private String sort; |
|||
} |
|||
@ -1,43 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 电力排放因子来源字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_factor_dict") |
|||
public class CbamFactorDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 说明 |
|||
*/ |
|||
private String description; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
} |
|||
@ -1,54 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_fuel_dict") |
|||
public class CbamFuelDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private Long id; |
|||
/** |
|||
* 中文名 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 英文名 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 低位发热量 |
|||
*/ |
|||
private String lowHeatAmount; |
|||
/** |
|||
* 单位 |
|||
*/ |
|||
private String unit; |
|||
/** |
|||
* 碳氧化率(氧化因子) |
|||
*/ |
|||
private String carbonOxdRate; |
|||
/** |
|||
* 排放因子 |
|||
*/ |
|||
private String emissionFactor; |
|||
} |
|||
@ -1,56 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_hs_dict") |
|||
public class CbamHsDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id |
|||
private Long id; |
|||
/** |
|||
* 预留字段,可以关联 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* hs编码 |
|||
*/ |
|||
private String code; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private String sort; |
|||
/** |
|||
* 类型预留字段 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 英文名称预留字段 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 关联cbam_prod_process_dict的id |
|||
*/ |
|||
private Long prodProcessId; |
|||
} |
|||
@ -1,44 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_industry_dict") |
|||
public class CbamIndustryDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id |
|||
private Long id; |
|||
/** |
|||
* 中文名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 英文名称 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
} |
|||
@ -1,56 +0,0 @@ |
|||
package com.thing.cbam.dict.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_prod_process_dict") |
|||
public class CbamProdProcessDictEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id |
|||
private Long id; |
|||
/** |
|||
* 中文名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 英文名称 |
|||
*/ |
|||
private String ename; |
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
/** |
|||
* 是否表黄:0否 1是 |
|||
*/ |
|||
private Integer tagging; |
|||
/** |
|||
* 关联:当type=yl 关联 cbam_industry_dict 主键id,否则关联本表的id |
|||
*/ |
|||
private Long pidId; |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamCarbonPriceCurrencyDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamCarbonPriceCurrencyDictMapper extends PowerBaseMapper<CbamCarbonPriceCurrencyDictEntity> { |
|||
|
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamCountryDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CbamCountryDictMapper extends PowerBaseMapper<CbamCountryDictEntity> { |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamFactorDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CbamFactorDictMapper extends PowerBaseMapper<CbamFactorDictEntity> { |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamFuelDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamFuelDictMapper extends PowerBaseMapper<CbamFuelDictEntity> { |
|||
|
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamHsDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamHsDictMapper extends PowerBaseMapper<CbamHsDictEntity> { |
|||
|
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamIndustryDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamIndustryDictMapper extends PowerBaseMapper<CbamIndustryDictEntity> { |
|||
|
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
package com.thing.cbam.dict.mapper; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamProdProcessDictEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamProdProcessDictMapper extends PowerBaseMapper<CbamProdProcessDictEntity> { |
|||
|
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamCarbonPriceCurrencyDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
public interface CbamCarbonPriceCurrencyDictService extends IBaseService<CbamCarbonPriceCurrencyDictEntity> { |
|||
|
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
|
|||
import com.thing.cbam.dict.entity.CbamCountryDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
|
|||
public interface CbamCountryDictService extends IBaseService<CbamCountryDictEntity> { |
|||
|
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamFactorDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
public interface CbamFactorDictService extends IBaseService<CbamFactorDictEntity> { |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamFuelDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
public interface CbamFuelDictService extends IBaseService<CbamFuelDictEntity> { |
|||
|
|||
|
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamHsDictDTO; |
|||
import com.thing.cbam.dict.entity.CbamHsDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
public interface CbamHsDictService extends IBaseService<CbamHsDictEntity> { |
|||
|
|||
List<CbamHsDictDTO> getByHsCode(String code); |
|||
|
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.entity.CbamIndustryDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
public interface CbamIndustryDictService extends IBaseService<CbamIndustryDictEntity> { |
|||
|
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
package com.thing.cbam.dict.service; |
|||
|
|||
import com.thing.cbam.dict.dto.CbamProdProcessDictDTO; |
|||
import com.thing.cbam.dict.entity.CbamProdProcessDictEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
public interface CbamProdProcessDictService extends IBaseService<CbamProdProcessDictEntity> { |
|||
|
|||
|
|||
List<CbamProdProcessDictDTO> getByIndustryId(Long industryId); |
|||
|
|||
List<CbamProdProcessDictDTO> getByProdId(Long prodId); |
|||
|
|||
List<CbamProdProcessDictDTO> getByProdIds(List<Long> prodIds); |
|||
|
|||
|
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.entity.CbamCarbonPriceCurrencyDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamCarbonPriceCurrencyDictMapper; |
|||
import com.thing.cbam.dict.service.CbamCarbonPriceCurrencyDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 计算碳价的工具货币字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-05 |
|||
*/ |
|||
@Service |
|||
public class CbamCarbonPriceCurrencyDictServiceImpl extends BaseServiceImpl<CbamCarbonPriceCurrencyDictMapper, CbamCarbonPriceCurrencyDictEntity> implements CbamCarbonPriceCurrencyDictService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.dto.CbamCountryDictDTO; |
|||
import com.thing.cbam.dict.entity.CbamCountryDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamCountryDictMapper; |
|||
import com.thing.cbam.dict.service.CbamCountryDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class CbamCountryDictServiceImpl extends BaseServiceImpl<CbamCountryDictMapper, CbamCountryDictEntity> implements CbamCountryDictService { |
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params) { |
|||
QueryWrapper queryWrapper = new QueryWrapper(); |
|||
return queryWrapper; |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.entity.CbamFactorDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamFactorDictMapper; |
|||
import com.thing.cbam.dict.service.CbamFactorDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class CbamFactorDictServiceImpl extends BaseServiceImpl<CbamFactorDictMapper, CbamFactorDictEntity> implements CbamFactorDictService { |
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params) { |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import cn.hutool.core.map.MapUtil; |
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.entity.CbamFuelDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamFuelDictMapper; |
|||
import com.thing.cbam.dict.service.CbamFuelDictService; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 燃料参数字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Service |
|||
public class CbamFuelDictServiceImpl extends BaseServiceImpl<CbamFuelDictMapper, CbamFuelDictEntity> implements CbamFuelDictService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
|
|||
String orderField = MapUtil.getStr(params, Constant.ORDER_FIELD, "sort"); |
|||
String order = MapUtil.getStr(params, Constant.ORDER, Constant.ASC); |
|||
|
|||
wrapper.orderBy(orderField, Constant.ASC.equals(order)); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -1,57 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.dto.CbamHsDictDTO; |
|||
import com.thing.cbam.dict.dto.CbamProdProcessDictDTO; |
|||
import com.thing.cbam.dict.entity.CbamHsDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamHsDictMapper; |
|||
import com.thing.cbam.dict.service.CbamHsDictService; |
|||
import com.thing.cbam.dict.service.CbamProdProcessDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* hs字典表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class CbamHsDictServiceImpl extends BaseServiceImpl<CbamHsDictMapper, CbamHsDictEntity> implements CbamHsDictService { |
|||
|
|||
|
|||
private final CbamProdProcessDictService cbamProdProcessDictService; |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamHsDictDTO> getByHsCode(String code) { |
|||
//1.获取hscode代码 |
|||
List<CbamHsDictDTO> cbamHsDictDTOS = mapper.selectListByQueryAs( |
|||
new QueryWrapper() |
|||
.eq(CbamHsDictEntity::getCode, code) |
|||
.orderBy(CbamHsDictEntity::getSort, true) |
|||
, CbamHsDictDTO.class); |
|||
|
|||
for (CbamHsDictDTO cbamHsDictDTO : cbamHsDictDTOS) { |
|||
//查询原料或者生产过程 |
|||
CbamProdProcessDictDTO prodDict = cbamProdProcessDictService.getByIdAs(cbamHsDictDTO.getProdProcessId(),CbamProdProcessDictDTO.class); |
|||
//查询生产工艺 |
|||
List<CbamProdProcessDictDTO> ruteList = cbamProdProcessDictService.getByProdId(prodDict.getId()); |
|||
prodDict.setProdRouteList(ruteList); |
|||
cbamHsDictDTO.setProdProcess(prodDict); |
|||
} |
|||
return cbamHsDictDTOS; |
|||
} |
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.entity.CbamIndustryDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamIndustryDictMapper; |
|||
import com.thing.cbam.dict.service.CbamIndustryDictService; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 所属行业字典 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Service |
|||
public class CbamIndustryDictServiceImpl extends BaseServiceImpl<CbamIndustryDictMapper, CbamIndustryDictEntity> implements CbamIndustryDictService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -1,65 +0,0 @@ |
|||
package com.thing.cbam.dict.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.dto.CbamProdProcessDictDTO; |
|||
import com.thing.cbam.dict.entity.CbamProdProcessDictEntity; |
|||
import com.thing.cbam.dict.mapper.CbamProdProcessDictMapper; |
|||
import com.thing.cbam.dict.service.CbamProdProcessDictService; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
|
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* 原料(生产过程)---工艺路线映射表 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-29 |
|||
*/ |
|||
@Service |
|||
public class CbamProdProcessDictServiceImpl extends BaseServiceImpl<CbamProdProcessDictMapper, CbamProdProcessDictEntity> implements CbamProdProcessDictService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params) { |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamProdProcessDictDTO> getByIndustryId(Long industryId) { |
|||
return getByPidIdAndType(industryId, null,"yl", Constant.ASC); |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProdProcessDictDTO> getByProdId(Long prodId) { |
|||
return getByPidIdAndType(prodId, null,"gylx", Constant.ASC); |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProdProcessDictDTO> getByProdIds(List<Long> prodIds) { |
|||
return getByPidIdAndType(null, prodIds,"gylx", Constant.ASC); |
|||
} |
|||
|
|||
|
|||
public List<CbamProdProcessDictDTO> getByPidIdAndType(Long pidId, List<Long> pidIds, String type, String order) { |
|||
boolean asc = true; |
|||
if (StringUtils.equalsIgnoreCase(Constant.DESC, order)) { |
|||
asc = false; |
|||
} |
|||
QueryWrapper queryWrapper = QueryWrapper.create() |
|||
.eq(CbamProdProcessDictEntity::getPidId, pidId, Objects::nonNull) |
|||
.eq(CbamProdProcessDictEntity::getPidId, pidIds, CollectionUtils::isNotEmpty) |
|||
.eq(CbamProdProcessDictEntity::getType, type) |
|||
.orderBy(CbamProdProcessDictEntity::getSort, asc); |
|||
return mapper.selectListByQueryAs(queryWrapper, CbamProdProcessDictDTO.class); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -1,140 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.controller; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectContextDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
|||
import com.thing.cbam.directCarbon.service.CbamCarbonDirectService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/carbon/direct") |
|||
@Tag(name="直接排放量B-Excel") |
|||
@RequiredArgsConstructor |
|||
public class CbamCarbonDirectController { |
|||
|
|||
private final CbamCarbonDirectService cbamCarbonDirectService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamCarbonDirectDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamCarbonDirectDTO> page = cbamCarbonDirectService.getPageData(params, CbamCarbonDirectDTO.class); |
|||
return new Result<PageData<CbamCarbonDirectDTO>>().ok(page); |
|||
} |
|||
|
|||
|
|||
@GetMapping("listByIndustryId") |
|||
@Operation(summary="列表") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<List<CbamCarbonDirectDTO>> listByIndustryId(@RequestParam Long industryId){ |
|||
List<CbamCarbonDirectDTO> cbamCarbonDirectDTOS = cbamCarbonDirectService.listByIndustryId(industryId); |
|||
return new Result<List<CbamCarbonDirectDTO>>().ok(cbamCarbonDirectDTOS); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamCarbonDirectDTO> get(@PathVariable("id") Long id){ |
|||
CbamCarbonDirectDTO data = cbamCarbonDirectService.getByIdAs(id, CbamCarbonDirectDTO.class); |
|||
return new Result<CbamCarbonDirectDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存单个的tab信息-对于当前项目不建议使用") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamCarbonDirectDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamCarbonDirectService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PostMapping("batchSaveOrUpdate") |
|||
@Operation(summary="批量保存或者更新") |
|||
@LogOperation("批量保存或者更新") |
|||
public Result<Void> batchSaveOrUpdate(@RequestBody List<CbamCarbonDirectDTO> carbonDirectDTOList){ |
|||
//效验数据 |
|||
cbamCarbonDirectService.batchSaveOrUpdate(carbonDirectDTOList); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PostMapping("batchSaveOrUpdateCarbonDirect") |
|||
@Operation(summary="批量保存或者更新整个B-excel") |
|||
@LogOperation("批量保存或者更新") |
|||
public Result<CbamCarbonDirectContextDTO> batchSaveOrUpdateCarbonDirect(@RequestBody CbamCarbonDirectContextDTO directContextDTO){ |
|||
return new Result<CbamCarbonDirectContextDTO>().ok(cbamCarbonDirectService.batchSaveOrUpdateCarbonDirect(directContextDTO)); |
|||
} |
|||
|
|||
@PostMapping("batchUpdate") |
|||
@Operation(summary="批量更新") |
|||
@LogOperation("批量更新") |
|||
public Result<Void> batchUpdateList(@RequestBody List<CbamCarbonDirectDTO> carbonDirectDTOList){ |
|||
//效验数据 |
|||
cbamCarbonDirectService.batchSaveOrUpdate(carbonDirectDTOList); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamCarbonDirectDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamCarbonDirectService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamCarbonDirectService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamCarbonDirectDTO> list = cbamCarbonDirectService.listAs(params, CbamCarbonDirectDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "直接排放量B-Excel", list, CbamCarbonDirectExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,109 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.controller; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamPerfluorinatedCarbonDTO; |
|||
import com.thing.cbam.directCarbon.service.CbamPerfluorinatedCarbonService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/perfluorinated") |
|||
@Tag(name="全氟化碳PFC排放") |
|||
@RequiredArgsConstructor |
|||
public class CbamPerfluorinatedCarbonController { |
|||
|
|||
private final CbamPerfluorinatedCarbonService cbamPerfluorinatedCarbonService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamPerfluorinatedCarbonDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamPerfluorinatedCarbonDTO> page = cbamPerfluorinatedCarbonService.getPageData(params, CbamPerfluorinatedCarbonDTO.class); |
|||
return new Result<PageData<CbamPerfluorinatedCarbonDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamPerfluorinatedCarbonDTO> get(@PathVariable("id") Long id){ |
|||
CbamPerfluorinatedCarbonDTO data = cbamPerfluorinatedCarbonService.getByIdAs(id, CbamPerfluorinatedCarbonDTO.class); |
|||
return new Result<CbamPerfluorinatedCarbonDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamPerfluorinatedCarbonDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamPerfluorinatedCarbonService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
|
|||
@PostMapping("batchSaveOrUpdate") |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> batchSaveOrUpdate(@RequestBody List<CbamPerfluorinatedCarbonDTO> list){ |
|||
//效验数据 |
|||
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamPerfluorinatedCarbonService.batchSaveOrUpdate(list); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamPerfluorinatedCarbonDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamPerfluorinatedCarbonService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamPerfluorinatedCarbonService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamPerfluorinatedCarbonDTO> list = cbamPerfluorinatedCarbonService.listAs(params, CbamPerfluorinatedCarbonDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "全氟化碳PFC排放", list, CbamPerfluorinatedCarbonExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,98 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.controller; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamProcessAllocationDTO; |
|||
import com.thing.cbam.directCarbon.service.CbamProcessAllocationService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.validator.ValidatorUtils; |
|||
import com.thing.common.core.validator.group.AddGroup; |
|||
import com.thing.common.core.validator.group.DefaultGroup; |
|||
import com.thing.common.core.validator.group.UpdateGroup; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("v2/cbam/allocation") |
|||
@Tag(name="生产过程分配量") |
|||
@RequiredArgsConstructor |
|||
public class CbamProcessAllocationController { |
|||
|
|||
private final CbamProcessAllocationService cbamProcessAllocationService; |
|||
|
|||
@GetMapping("page") |
|||
@Operation(summary="分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamProcessAllocationDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){ |
|||
PageData<CbamProcessAllocationDTO> page = cbamProcessAllocationService.getPageData(params, CbamProcessAllocationDTO.class); |
|||
return new Result<PageData<CbamProcessAllocationDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary="信息") |
|||
public Result<CbamProcessAllocationDTO> get(@PathVariable("id") Long id){ |
|||
CbamProcessAllocationDTO data = cbamProcessAllocationService.getByIdAs(id, CbamProcessAllocationDTO.class); |
|||
return new Result<CbamProcessAllocationDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Operation(summary="保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamProcessAllocationDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
cbamProcessAllocationService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Operation(summary="修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamProcessAllocationDTO dto){ |
|||
//效验数据 |
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
cbamProcessAllocationService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
@Operation(summary="删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids){ |
|||
//效验数据 |
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
cbamProcessAllocationService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
|
|||
/** |
|||
*@GetMapping("export") |
|||
*@Operation(summary="导出") |
|||
*@LogOperation("导出") |
|||
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
* List<CbamProcessAllocationDTO> list = cbamProcessAllocationService.listAs(params, CbamProcessAllocationDTO.class); |
|||
* //ExcelUtils.exportExcelToTarget(response, null, "生产过程分配量", list, CbamProcessAllocationExcel.class); |
|||
*} |
|||
*/ |
|||
|
|||
} |
|||
@ -1,60 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "直接排放量B-Excel") |
|||
public class CbamCarbonDirectContextDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "类型:\n" + |
|||
"1.是否涉及燃烧排放\n" + |
|||
"2.是否涉及过程排放\n" + |
|||
"3.是否涉及物料平衡\n" + |
|||
// "4.是否涉及斜率法\n" + |
|||
// "5.是否涉及过电压法\n" + |
|||
"6.是否有连续排放测量系统(CEMS)\n" + |
|||
"7.各生产过程中原材料/燃料的分配") |
|||
private List<CbamCarbonDirectDTO> carbonDirectList; |
|||
|
|||
|
|||
|
|||
@Schema(description = "类型:\n" + |
|||
// "1.是否涉及燃烧排放\n" + |
|||
// "2.是否涉及过程排放\n" + |
|||
// "3.是否涉及物料平衡\n" + |
|||
"4.是否涉及斜率法\n" + |
|||
"5.是否涉及过电压法\n" |
|||
// "6.是否有连续排放测量系统(CEMS)\n" + |
|||
// "7.各生产过程中原材料/燃料的分配" |
|||
) |
|||
private List<CbamPerfluorinatedCarbonDTO> perfluorinatedCarbonList; |
|||
|
|||
|
|||
@Schema(description = "类型:\n" + |
|||
// "1.是否涉及燃烧排放\n" + |
|||
// "2.是否涉及过程排放\n" + |
|||
// "3.是否涉及物料平衡\n" + |
|||
// "4.是否涉及斜率法\n" + |
|||
// "5.是否涉及过电压法\n" |
|||
// "6.是否有连续排放测量系统(CEMS)\n" + |
|||
"7.各生产过程中原材料/燃料的分配" |
|||
) |
|||
private List<CbamProcessAllocationDTO> processAllocationList; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,94 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.dto; |
|||
|
|||
import com.thing.cbam.directCarbon.entity.CbamPerfluorinatedCarbonEntity; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "直接排放量B-Excel") |
|||
public class CbamCarbonDirectDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private Long id; |
|||
@Schema(description = "燃料名称/过程排放名称/物料平衡名称") |
|||
private String name; |
|||
@Schema(description = "消耗量/产量:输入") |
|||
private String consumeAmount; |
|||
@Schema(description = "消耗量单位:t 或者 1000Nm2") |
|||
private String consumeUnit; |
|||
@Schema(description = "低位发热量:燃料字典表值") |
|||
private String lowHeatVal; |
|||
@Schema(description = "低位发热量单位:燃料字典表值") |
|||
private String lowHeatUnit; |
|||
@Schema(description = "排放因子:燃料字典表值") |
|||
private String emissionFactors; |
|||
@Schema(description = "排放因子单位:燃料字典表值") |
|||
private String emissionFactorsUnit; |
|||
@Schema(description = "氧化因子/转化因子:燃料字典表值") |
|||
private String oxidationFactor; |
|||
@Schema(description = "生物量含量/生物质组分:输入") |
|||
private String biomassContent; |
|||
@Schema(description = "直接碳排量:计算") |
|||
private String directCarbonNum; |
|||
@Schema(description = "生物质燃料排放量:计算") |
|||
private String biomassFuelNum; |
|||
@Schema(description = "能量含量(化石燃料),TJ:计算") |
|||
private String energyFossilNum; |
|||
@Schema(description = "能量含量(生物燃料),TJ:计算") |
|||
private String energyBiologyNum; |
|||
@Schema(description = "碳含量(tC/t)") |
|||
private String carbonNum; |
|||
@Schema(description = "气体类型:CO2/N2O") |
|||
private String gasType; |
|||
@Schema(description = "生物质组分单位") |
|||
private String biomassUnit; |
|||
@Schema(description = "每小时平均温室气体浓度") |
|||
private String hourAvgGasDensity; |
|||
@Schema(description = "每小时平均温室气体浓度.单位") |
|||
private String hourAvgGasDensityUnit; |
|||
@Schema(description = "运行小时数") |
|||
private String runHours; |
|||
@Schema(description = "烟气") |
|||
private String smokeAvg; |
|||
@Schema(description = "烟气.单位") |
|||
private String smokeAvgUnit; |
|||
@Schema(description = "温室气体年排放量") |
|||
private String gasAnnualEmissions; |
|||
@Schema(description = "温室气体年排放量单位") |
|||
private String gasAnnualEmissionsUnit; |
|||
@Schema(description = "化石燃料碳排放量") |
|||
private String fossilFuelCarbon; |
|||
@Schema(description = "全球变暖潜势id") |
|||
private String globalWarmingId; |
|||
@Schema(description = "全球变暖潜势") |
|||
private String globalWarming; |
|||
@Schema(description = "关联cbam_industry_info的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "类型:\n" + |
|||
"1.是否涉及燃烧排放\n" + |
|||
"2.是否涉及过程排放\n" + |
|||
"3.是否涉及物料平衡\n" + |
|||
// "4.是否涉及斜率法\n" + |
|||
// "5.是否涉及过电压法\n" + |
|||
"6.是否有连续排放测量系统(CEMS)\n" + |
|||
"7.各生产过程中原材料/燃料的分配") |
|||
private Integer type; |
|||
private Long sort; |
|||
@Schema(description = "生产过程分配量") |
|||
private String processAllocation; |
|||
@Schema(description = "铝制品:6:倾斜法 7电压法 集合") |
|||
private List<CbamPerfluorinatedCarbonDTO> perfluorinatedCarbonDTOList; |
|||
|
|||
|
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 原料过程排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-27 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "原料过程排放") |
|||
public class CbamCarbonProgressDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "名称") |
|||
private String name; |
|||
@Schema(description = "消耗量") |
|||
private String consumAmount; |
|||
@Schema(description = "排放因子") |
|||
private String emissionFactors; |
|||
@Schema(description = "排放源名称") |
|||
private String emissionName; |
|||
@Schema(description = "关联cbam_industry_information的主键id") |
|||
private Long industryId; |
|||
|
|||
} |
|||
@ -1,65 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "全氟化碳PFC排放-铝制品") |
|||
public class CbamPerfluorinatedCarbonDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "阳极类型字典id") |
|||
private Long anodeTypeId; |
|||
@Schema(description = "阳极类型") |
|||
private String anodeType; |
|||
@Schema(description = "消耗量/产量:输入") |
|||
private String consumeAmount; |
|||
@Schema(description = "化石燃料碳排放量") |
|||
private String energyFossilNum; |
|||
@Schema(description = "消耗量/产量 单位") |
|||
private String consumeAmountUnit; |
|||
@Schema(description = "化石燃料碳排放量单位") |
|||
private String energyFossilUnit; |
|||
@Schema(description = "阳极类型(其他)") |
|||
private String anodeOtherType; |
|||
@Schema(description = "A: 频率") |
|||
private String rate; |
|||
@Schema(description = "A: 持续时间") |
|||
private String duration; |
|||
@Schema(description = "A:SEF(四氟化碳,CF)") |
|||
private String sfht; |
|||
@Schema(description = "F(六氟乙烷,CzFe)") |
|||
private String sfyw; |
|||
@Schema(description = "全球变暖潜势(A:SEF(四氟化碳,CF))") |
|||
private String globalWarmingSfht; |
|||
@Schema(description = "全球变暖潜势(F(六氟乙烷,CzFe))") |
|||
private String globalWarmingSfyw; |
|||
@Schema(description = "收集评率") |
|||
private String collectRate; |
|||
@Schema(description = "关联cbam_industry_info的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "类型:4:倾斜法 5 电压法") |
|||
private Integer type; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
@Schema(description = "B: AEO") |
|||
private String aeo; |
|||
@Schema(description = "B: OVC") |
|||
private String ovc; |
|||
@Schema(description = "B:CE") |
|||
private String ce; |
|||
|
|||
} |
|||
@ -1,37 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "生产过程分配量") |
|||
public class CbamProcessAllocationDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "主键") |
|||
private Long id; |
|||
@Schema(description = "排放源名称") |
|||
private String name; |
|||
@Schema(description = "关联cbam_industry_info的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "关联cbam_process_material的id") |
|||
private Long prodId; |
|||
@Schema(description = "关联cbam_carbon_direct的id") |
|||
private Long directId; |
|||
@Schema(description = "生产过程分配量") |
|||
private String processAllocation; |
|||
@Schema(description = "排序") |
|||
private Long sort; |
|||
|
|||
} |
|||
@ -1,148 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_carbon_direct") |
|||
public class CbamCarbonDirectEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 燃料名称/过程排放名称/物料平衡名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 消耗量/产量:输入 |
|||
*/ |
|||
private String consumeAmount; |
|||
/** |
|||
* 消耗量单位:t 或者 1000Nm2 |
|||
*/ |
|||
private String consumeUnit; |
|||
/** |
|||
* 低位发热量:燃料字典表值 |
|||
*/ |
|||
private String lowHeatVal; |
|||
/** |
|||
* 低位发热量单位:燃料字典表值 |
|||
*/ |
|||
private String lowHeatUnit; |
|||
/** |
|||
* 排放因子:燃料字典表值 |
|||
*/ |
|||
private String emissionFactors; |
|||
/** |
|||
* 排放因子单位:燃料字典表值 |
|||
*/ |
|||
private String emissionFactorsUnit; |
|||
/** |
|||
* 氧化因子/转化因子:燃料字典表值 |
|||
*/ |
|||
private String oxidationFactor; |
|||
/** |
|||
* 生物量含量/生物质组分:输入 |
|||
*/ |
|||
private String biomassContent; |
|||
/** |
|||
* 直接碳排量:计算 |
|||
*/ |
|||
private String directCarbonNum; |
|||
/** |
|||
* 生物质燃料排放量:计算 |
|||
*/ |
|||
private String biomassFuelNum; |
|||
/** |
|||
* 能量含量(化石燃料),TJ:计算 |
|||
*/ |
|||
private String energyFossilNum; |
|||
/** |
|||
* 能量含量(生物燃料),TJ:计算 |
|||
*/ |
|||
private String energyBiologyNum; |
|||
/** |
|||
* 碳含量(tC/t) |
|||
*/ |
|||
private String carbonNum; |
|||
/** |
|||
* 气体类型:CO2/N2O |
|||
*/ |
|||
private String gasType; |
|||
/** |
|||
* 生物质组分单位 |
|||
*/ |
|||
private String biomassUnit; |
|||
/** |
|||
* 每小时平均温室气体浓度 |
|||
*/ |
|||
private String hourAvgGasDensity; |
|||
/** |
|||
* 每小时平均温室气体浓度.单位 |
|||
*/ |
|||
private String hourAvgGasDensityUnit; |
|||
/** |
|||
* 运行小时数 |
|||
*/ |
|||
private String runHours; |
|||
/** |
|||
* 烟气 |
|||
*/ |
|||
private String smokeAvg; |
|||
/** |
|||
* 烟气.单位 |
|||
*/ |
|||
private String smokeAvgUnit; |
|||
/** |
|||
* 温室气体年排放量 |
|||
*/ |
|||
private String gasAnnualEmissions; |
|||
/** |
|||
* 温室气体年排放量单位 |
|||
*/ |
|||
private String gasAnnualEmissionsUnit; |
|||
/** |
|||
* 化石燃料碳排放量 |
|||
*/ |
|||
private String fossilFuelCarbon; |
|||
/** |
|||
* 全球变暖潜势id |
|||
*/ |
|||
private String globalWarmingId; |
|||
/** |
|||
* 全球变暖潜势 |
|||
*/ |
|||
private String globalWarming; |
|||
/** |
|||
* 关联cbam_industry_information的主键id |
|||
*/ |
|||
private Long industryId; |
|||
|
|||
/** |
|||
* 类型: |
|||
* 1.是否涉及燃烧排放 |
|||
* 2.是否涉及过程排放 |
|||
* 3.是否涉及物料平衡 |
|||
* 4.是否有连续排放测量系统(CEMS) |
|||
*/ |
|||
private Integer type; |
|||
private Long sort; |
|||
} |
|||
@ -1,51 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 原料过程排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-11-27 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_carbon_progress") |
|||
public class CbamCarbonProgressEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String fuelName; |
|||
/** |
|||
* 消耗量 |
|||
*/ |
|||
private String consumAmount; |
|||
/** |
|||
* 排放因子 |
|||
*/ |
|||
private String emissionFactors; |
|||
/** |
|||
* 排放源名称 |
|||
*/ |
|||
private String emissionName; |
|||
/** |
|||
* 关联cbam_industry_information的主键id |
|||
*/ |
|||
private Long industryId; |
|||
} |
|||
@ -1,111 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_perfluorinated_carbon") |
|||
public class CbamPerfluorinatedCarbonEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 阳极类型字典id |
|||
*/ |
|||
private Long anodeTypeId; |
|||
/** |
|||
* 阳极类型 |
|||
*/ |
|||
private String anodeType; |
|||
/** |
|||
* 消耗量/产量:输入 |
|||
*/ |
|||
private String consumeAmount; |
|||
/** |
|||
* 化石燃料碳排放量 |
|||
*/ |
|||
private String energyFossilNum; |
|||
/** |
|||
* 消耗量/产量 单位 |
|||
*/ |
|||
private String consumeAmountUnit; |
|||
/** |
|||
* 化石燃料碳排放量单位 |
|||
*/ |
|||
private String energyFossilUnit; |
|||
/** |
|||
* 阳极类型(其他) |
|||
*/ |
|||
private String anodeOtherType; |
|||
/** |
|||
* A: 频率 |
|||
*/ |
|||
private String rate; |
|||
/** |
|||
* A: 持续时间 |
|||
*/ |
|||
private String duration; |
|||
/** |
|||
* A:SEF(四氟化碳,CF) |
|||
*/ |
|||
private String sfht; |
|||
/** |
|||
* F(六氟乙烷,CzFe) |
|||
*/ |
|||
private String sfyw; |
|||
/** |
|||
* 全球变暖潜势(A:SEF(四氟化碳,CF)) |
|||
*/ |
|||
private String globalWarmingSfht; |
|||
/** |
|||
* 全球变暖潜势(F(六氟乙烷,CzFe)) |
|||
*/ |
|||
private String globalWarmingSfyw; |
|||
private String collectRate; |
|||
/** |
|||
* 关联cbam_industry_info的主键id |
|||
*/ |
|||
private Long industryId; |
|||
/** |
|||
* 类型:6:倾斜法 7电压法 |
|||
*/ |
|||
private Integer type; |
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
/** |
|||
* B: AEO |
|||
*/ |
|||
private String aeo; |
|||
/** |
|||
* B: OVC |
|||
*/ |
|||
private String ovc; |
|||
/** |
|||
* B:CE |
|||
*/ |
|||
private String ce; |
|||
} |
|||
@ -1,63 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_process_allocation") |
|||
public class CbamProcessAllocationEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* 排放源名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 关联cbam_industry_info的主键id |
|||
*/ |
|||
private Long industryId; |
|||
|
|||
/** |
|||
* 关联cbam_process_material的id |
|||
*/ |
|||
private Long prodId; |
|||
|
|||
/** |
|||
* 关联cbam_carbon_direct的id |
|||
*/ |
|||
private Long directId; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
*/ |
|||
private String processAllocation; |
|||
|
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Long sort; |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.mapper; |
|||
|
|||
import com.thing.cbam.directCarbon.entity.CbamCarbonDirectEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamCarbonDirectMapper extends PowerBaseMapper<CbamCarbonDirectEntity> { |
|||
|
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.mapper; |
|||
|
|||
import com.thing.cbam.directCarbon.entity.CbamPerfluorinatedCarbonEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamPerfluorinatedCarbonMapper extends PowerBaseMapper<CbamPerfluorinatedCarbonEntity> { |
|||
|
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.mapper; |
|||
|
|||
import com.thing.cbam.directCarbon.entity.CbamProcessAllocationEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Mapper |
|||
public interface CbamProcessAllocationMapper extends PowerBaseMapper<CbamProcessAllocationEntity> { |
|||
|
|||
} |
|||
@ -1,30 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectContextDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamCarbonDirectEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
public interface CbamCarbonDirectService extends IBaseService<CbamCarbonDirectEntity> { |
|||
|
|||
List<CbamCarbonDirectDTO> batchSaveOrUpdate(List<CbamCarbonDirectDTO> carbonDirectDTOList); |
|||
|
|||
CbamCarbonDirectContextDTO batchSaveOrUpdateCarbonDirect(CbamCarbonDirectContextDTO cbamCarbonDirectContextDTO); |
|||
|
|||
List<CbamCarbonDirectDTO> listByIndustryId(Long industryId); |
|||
|
|||
void batchUpdateList(List<CbamCarbonDirectDTO> carbonDirectDTOList); |
|||
|
|||
Map<String, BigDecimal> calculate(Long fuelId, String consumeAmount, String biomassContent); |
|||
|
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamPerfluorinatedCarbonDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamPerfluorinatedCarbonEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
public interface CbamPerfluorinatedCarbonService extends IBaseService<CbamPerfluorinatedCarbonEntity> { |
|||
|
|||
List<CbamPerfluorinatedCarbonDTO> batchSaveOrUpdate(List<CbamPerfluorinatedCarbonDTO> list); |
|||
|
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service; |
|||
|
|||
import com.thing.cbam.directCarbon.dto.CbamProcessAllocationDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamProcessAllocationEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
public interface CbamProcessAllocationService extends IBaseService<CbamProcessAllocationEntity> { |
|||
|
|||
List<CbamProcessAllocationDTO> batchSaveOrUpdate(List<CbamProcessAllocationDTO> list); |
|||
|
|||
} |
|||
@ -1,133 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.dict.entity.CbamFuelDictEntity; |
|||
import com.thing.cbam.dict.service.CbamFuelDictService; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectContextDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamPerfluorinatedCarbonDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamProcessAllocationDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamCarbonDirectEntity; |
|||
import com.thing.cbam.directCarbon.entity.CbamProcessAllocationEntity; |
|||
import com.thing.cbam.directCarbon.mapper.CbamCarbonDirectMapper; |
|||
import com.thing.cbam.directCarbon.service.CbamCarbonDirectService; |
|||
import com.thing.cbam.directCarbon.service.CbamPerfluorinatedCarbonService; |
|||
import com.thing.cbam.directCarbon.service.CbamProcessAllocationService; |
|||
import com.thing.cbam.directCarbon.util.BurningDischargeUtil; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 直接排放量B-Excel |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class CbamCarbonDirectServiceImpl extends BaseServiceImpl<CbamCarbonDirectMapper, CbamCarbonDirectEntity> implements CbamCarbonDirectService { |
|||
|
|||
|
|||
private final CbamFuelDictService cbamFuelDictService; |
|||
private final CbamPerfluorinatedCarbonService cbamPerfluorinatedCarbonService; |
|||
private final CbamProcessAllocationService cbamProcessAllocationService; |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamCarbonDirectDTO> listByIndustryId(Long industryId) { |
|||
QueryWrapper queryWrapper = QueryWrapper.create().eq(CbamCarbonDirectEntity::getIndustryId, industryId) |
|||
.orderBy(CbamCarbonDirectEntity::getType, true) |
|||
.orderBy(CbamCarbonDirectEntity::getSort, true); |
|||
return mapper.selectListByQueryAs(queryWrapper, CbamCarbonDirectDTO.class); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public List<CbamCarbonDirectDTO> batchSaveOrUpdate(List<CbamCarbonDirectDTO> carbonDirectDTOList) { |
|||
List<CbamCarbonDirectDTO> resList = new ArrayList<>(); |
|||
//根据type分组 |
|||
Map<Integer, List<CbamCarbonDirectDTO>> carbonDirectMapList = carbonDirectDTOList.stream().collect(Collectors.groupingBy(CbamCarbonDirectDTO::getType)); |
|||
for (Map.Entry<Integer, List<CbamCarbonDirectDTO>> entries : carbonDirectMapList.entrySet()) { |
|||
Integer key = entries.getKey(); |
|||
if(Objects.equals(key,1) || Objects.equals(key,2) || Objects.equals(key,3)|| Objects.equals(key,6)|| Objects.equals(key,7)){ |
|||
List<CbamCarbonDirectDTO> values = entries.getValue(); |
|||
List<Long> industryIds = values.stream().map(CbamCarbonDirectDTO::getIndustryId).toList(); |
|||
//先删除 |
|||
mapper.deleteByQuery(QueryWrapper.create() |
|||
.in(CbamCarbonDirectEntity::getIndustryId, industryIds) |
|||
.eq(CbamCarbonDirectEntity::getType, key)); |
|||
List<CbamCarbonDirectEntity> cbamCarbonDirectEntities = ConvertUtils.sourceToTarget(values, CbamCarbonDirectEntity.class); |
|||
mapper.insertBatch(cbamCarbonDirectEntities); |
|||
resList.addAll(ConvertUtils.sourceToTarget(cbamCarbonDirectEntities, CbamCarbonDirectDTO.class)); |
|||
} |
|||
} |
|||
return resList; |
|||
} |
|||
|
|||
@Override |
|||
public CbamCarbonDirectContextDTO batchSaveOrUpdateCarbonDirect(CbamCarbonDirectContextDTO cbamCarbonDirectContextDTO) { |
|||
CbamCarbonDirectContextDTO resDTO = new CbamCarbonDirectContextDTO(); |
|||
//处理直接碳排数据,类型是1、2、3、6 |
|||
List<CbamCarbonDirectDTO> cbamCarbonDirectDTOS = batchSaveOrUpdate(cbamCarbonDirectContextDTO.getCarbonDirectList()); |
|||
resDTO.setCarbonDirectList(cbamCarbonDirectDTOS); |
|||
//处理直接碳排数据,类型是4、5 |
|||
List<CbamPerfluorinatedCarbonDTO> cbamPerfluorinatedCarbonDTOS = cbamPerfluorinatedCarbonService.batchSaveOrUpdate(cbamCarbonDirectContextDTO.getPerfluorinatedCarbonList()); |
|||
resDTO.setPerfluorinatedCarbonList(cbamPerfluorinatedCarbonDTOS); |
|||
//处理直接碳排数据,类型是7 |
|||
List<CbamProcessAllocationDTO> cbamProcessAllocationDTOS = cbamProcessAllocationService.batchSaveOrUpdate(cbamCarbonDirectContextDTO.getProcessAllocationList()); |
|||
resDTO.setProcessAllocationList(cbamProcessAllocationDTOS); |
|||
return resDTO; |
|||
} |
|||
|
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void batchUpdateList(List<CbamCarbonDirectDTO> carbonDirectDTOList) { |
|||
//1.删除直接碳排相关的数据 |
|||
mapper.deleteByQuery(QueryWrapper.create().eq(CbamCarbonDirectEntity::getIndustryId,carbonDirectDTOList.get(0).getIndustryId())); |
|||
//2.删除各生产过程中原材料/燃料的分配 |
|||
cbamProcessAllocationService.getMapper() |
|||
.deleteByQuery(QueryWrapper.create().eq(CbamProcessAllocationEntity::getIndustryId,carbonDirectDTOList.get(0).getIndustryId())); |
|||
//重新添加相关信息 |
|||
batchSaveOrUpdate(carbonDirectDTOList); |
|||
} |
|||
|
|||
@Override |
|||
public Map<String, BigDecimal> calculate(Long fuelId, String consumeAmount, String biomassContent) { |
|||
Map<String, BigDecimal> resMap = new HashMap<>(); |
|||
//获取燃料系数字典信息 |
|||
CbamFuelDictEntity cbamFuelDict = cbamFuelDictService.getById(fuelId); |
|||
if(Objects.isNull(cbamFuelDict)){ |
|||
throw new RuntimeException("燃料系数字典信息不存在"); |
|||
} |
|||
//公用计算:消耗量*低位发热量 |
|||
String lowHeatAmount = cbamFuelDict.getLowHeatAmount(); |
|||
//1.首先先计算(第四个)----能量含量(生物质燃料),工J =消耗量*低位发热量*生物量含量/100/1000 |
|||
BigDecimal energyBiologyNum = |
|||
BurningDischargeUtil.energyBiologyNumCalculate(consumeAmount, lowHeatAmount, biomassContent); |
|||
resMap.put("energyBiologyNum",energyBiologyNum); |
|||
//2.其次计算第三个:能量含量(化石燃料),TJ =消耗量*低位发热量/1000-能量含量(生物质燃料) |
|||
BigDecimal energyFossilNum = BurningDischargeUtil.energyHsNumCalculate(consumeAmount, lowHeatAmount, energyBiologyNum.toPlainString()); |
|||
resMap.put("energyFossilNum",energyFossilNum); |
|||
//3.生物质燃料排放量 =消耗量*低位发热量*生物量含量*排放因子/100/1000 |
|||
BigDecimal biomassFuelNum = BurningDischargeUtil.biomassFuelNumCalculate(consumeAmount, lowHeatAmount, biomassContent, cbamFuelDict.getEmissionFactor()); |
|||
resMap.put("biomassFuelNum",biomassFuelNum); |
|||
//4.直接碳排放量 =消耗量*低位发热量*氧化因子*排放因子/100/1000-生物质燃料排放量 |
|||
BigDecimal directCarbonNum = BurningDischargeUtil.directCarbonCalculate(consumeAmount, lowHeatAmount, biomassContent, cbamFuelDict.getEmissionFactor(), cbamFuelDict.getCarbonOxdRate()); |
|||
resMap.put("directCarbonNum",directCarbonNum); |
|||
return resMap; |
|||
} |
|||
} |
|||
@ -1,91 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.baesInfoExcel.entity.CbamIndustryEntity; |
|||
import com.thing.cbam.baesInfoExcel.service.CbamIndustryService; |
|||
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
|||
import com.thing.cbam.directCarbon.dto.CbamPerfluorinatedCarbonDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamPerfluorinatedCarbonEntity; |
|||
import com.thing.cbam.directCarbon.mapper.CbamPerfluorinatedCarbonMapper; |
|||
import com.thing.cbam.directCarbon.service.CbamPerfluorinatedCarbonService; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* 全氟化碳PFC排放 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class CbamPerfluorinatedCarbonServiceImpl extends BaseServiceImpl<CbamPerfluorinatedCarbonMapper, CbamPerfluorinatedCarbonEntity> implements CbamPerfluorinatedCarbonService { |
|||
|
|||
private final CbamIndustryService cbamIndustryService; |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<CbamPerfluorinatedCarbonDTO> batchSaveOrUpdate(List<CbamPerfluorinatedCarbonDTO> list) { |
|||
//只有铝制品行业有以下处理 |
|||
// type=4,5 的类型 单独 更新生产过程中的分配量 |
|||
List<Long> industryIds = list.stream().map(CbamPerfluorinatedCarbonDTO::getIndustryId).distinct().toList(); |
|||
//先删除 |
|||
mapper.deleteByQuery(QueryWrapper.create().in(CbamPerfluorinatedCarbonEntity::getIndustryId, industryIds)); |
|||
//再新增 |
|||
List<CbamPerfluorinatedCarbonEntity> perfluorinatedCarbonEntities = ConvertUtils.sourceToTarget(list, CbamPerfluorinatedCarbonEntity.class); |
|||
mapper.insertBatch(perfluorinatedCarbonEntities); |
|||
return ConvertUtils.sourceToTarget(perfluorinatedCarbonEntities, CbamPerfluorinatedCarbonDTO.class); |
|||
// if(CollectionUtils.isEmpty(list)){ |
|||
// throw new RuntimeException("铝制品行业相关《倾斜法,电压法》没有相关数据"); |
|||
// } |
|||
// //1.获取相关industryId |
|||
// Long industryId = list.get(0).getIndustryId(); |
|||
// CbamIndustryEntity cbamIndustryEntity = cbamIndustryService.getById(industryId); |
|||
// if(!StringUtils.equals(cbamIndustryEntity.getIndustryDict(), "铝行业") && !Objects.equals(cbamIndustryEntity.getIndustryDictId(), 11002L)){ |
|||
// throw new RuntimeException("非铝制品行业相关《倾斜法,电压法》行业,无需添加"); |
|||
// } |
|||
// //1.1获取id没有值的参数,即新增数据 |
|||
// List<CbamPerfluorinatedCarbonDTO> newList = list.stream().filter(carbonDirectDTO -> Objects.isNull(carbonDirectDTO.getId())).toList(); |
|||
// if(CollectionUtils.isNotEmpty(newList)){ |
|||
// mapper.insertBatch(ConvertUtils.sourceToTarget(newList, CbamPerfluorinatedCarbonEntity.class)); |
|||
// } |
|||
// //1.2 获取id有值的参数,即更新数据 |
|||
// List<CbamPerfluorinatedCarbonDTO> existList = list.stream().filter(carbonDirectDTO -> Objects.isNull(carbonDirectDTO.getId())).toList(); |
|||
// if(CollectionUtils.isEmpty(existList)){ |
|||
// return; |
|||
// } |
|||
// //2.根据industryId查询所有数据 |
|||
// List<CbamPerfluorinatedCarbonEntity> perfluorinatedCarbonEntities = |
|||
// mapper.selectListByQuery(QueryWrapper.create().eq(CbamPerfluorinatedCarbonEntity::getIndustryId, industryId)); |
|||
// //3.获取参数中需要更新的id |
|||
// List<Long> updateIds = existList.stream().map(CbamPerfluorinatedCarbonDTO::getId).toList(); |
|||
// //4.排除不需要更新的id集合,并且删除相关信息 |
|||
// if(CollectionUtils.isNotEmpty(perfluorinatedCarbonEntities)){ |
|||
// //获取不在数据库的id集合 |
|||
// List<CbamPerfluorinatedCarbonEntity> unUpdatePerfluorinatedEntities |
|||
// = perfluorinatedCarbonEntities.stream().filter(carbonDirectEntity -> !updateIds.contains(carbonDirectEntity.getId())).toList(); |
|||
// if(CollectionUtils.isNotEmpty(unUpdatePerfluorinatedEntities)){ |
|||
// mapper.deleteBatchByIds(unUpdatePerfluorinatedEntities.stream().map(CbamPerfluorinatedCarbonEntity::getId).toList()); |
|||
// } |
|||
// //获取在数据库的记录,并进行更新 |
|||
// List<CbamPerfluorinatedCarbonDTO> existPerfluorinatedCarbons = existList.stream().filter(s -> updateIds.contains(s.getId())).toList(); |
|||
// if(CollectionUtils.isNotEmpty(existPerfluorinatedCarbons)){ |
|||
// existPerfluorinatedCarbons.forEach(carbonDirectDTO -> mapper.update(ConvertUtils.sourceToTarget(carbonDirectDTO, CbamPerfluorinatedCarbonEntity.class))); |
|||
// } |
|||
// } |
|||
} |
|||
} |
|||
@ -1,45 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.service.impl; |
|||
|
|||
import com.mybatisflex.core.query.QueryWrapper; |
|||
import com.thing.cbam.directCarbon.dto.CbamProcessAllocationDTO; |
|||
import com.thing.cbam.directCarbon.entity.CbamProcessAllocationEntity; |
|||
import com.thing.cbam.directCarbon.mapper.CbamProcessAllocationMapper; |
|||
import com.thing.cbam.directCarbon.service.CbamProcessAllocationService; |
|||
import com.thing.common.core.utils.ConvertUtils; |
|||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 生产过程分配量 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-02 |
|||
*/ |
|||
@Service |
|||
public class CbamProcessAllocationServiceImpl extends BaseServiceImpl<CbamProcessAllocationMapper, CbamProcessAllocationEntity> implements CbamProcessAllocationService { |
|||
|
|||
@Override |
|||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|||
QueryWrapper wrapper = new QueryWrapper(); |
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public List<CbamProcessAllocationDTO> batchSaveOrUpdate(List<CbamProcessAllocationDTO> list) { |
|||
//先删除 |
|||
List<Long> industryIds = list.stream().map(CbamProcessAllocationDTO::getIndustryId).toList(); |
|||
List<Long> prodIds = list.stream().map(CbamProcessAllocationDTO::getProdId).toList(); |
|||
List<Long> directId = list.stream().map(CbamProcessAllocationDTO::getDirectId).toList(); |
|||
mapper.deleteByQuery(new QueryWrapper() |
|||
.in(CbamProcessAllocationEntity::getIndustryId, industryIds) |
|||
.in(CbamProcessAllocationEntity::getProdId, prodIds) |
|||
.in(CbamProcessAllocationEntity::getDirectId, directId)); |
|||
//再新增 |
|||
List<CbamProcessAllocationEntity> cbamProcessAllocationEntities = ConvertUtils.sourceToTarget(list, CbamProcessAllocationEntity.class); |
|||
mapper.insertBatch(cbamProcessAllocationEntities); |
|||
return ConvertUtils.sourceToTarget(cbamProcessAllocationEntities, CbamProcessAllocationDTO.class); |
|||
} |
|||
} |
|||
@ -1,85 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.util; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
|
|||
/** |
|||
* 燃烧排放的计算工具类 |
|||
*/ |
|||
public class BurningDischargeUtil { |
|||
|
|||
/** |
|||
* 公用计算:消耗量*低位发热量 |
|||
* @param consumeAmount 消耗量 |
|||
* @param lowHeatAmount 低位发热量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal commonCalculate(String consumeAmount,String lowHeatAmount) { |
|||
return new BigDecimal(consumeAmount).multiply(new BigDecimal(lowHeatAmount)); |
|||
} |
|||
|
|||
/** |
|||
* 能量含量(生物质燃料),工J =消耗量*低位发热量*生物量含量/100/1000 |
|||
* @param consumeAmount 消耗量 |
|||
* @param lowHeatAmount 低位发热量 |
|||
* @param biomassContent 生物量含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal energyBiologyNumCalculate(String consumeAmount, String lowHeatAmount, String biomassContent) { |
|||
return commonCalculate(consumeAmount,lowHeatAmount) |
|||
.multiply(new BigDecimal(biomassContent)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP) |
|||
.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP); |
|||
} |
|||
|
|||
/** |
|||
* 能量含量(化石燃料),TJ =消耗量*低位发热量/1000-能量含量(生物质燃料) |
|||
* @param consumeAmount 消耗量 |
|||
* @param lowHeatAmount 低位发热量 |
|||
* @param energyBiologyNum 能量含量(生物质燃料) |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal energyHsNumCalculate(String consumeAmount,String lowHeatAmount,String energyBiologyNum) { |
|||
return commonCalculate(consumeAmount,lowHeatAmount) |
|||
.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP) |
|||
.subtract(energyBiologyNumCalculate(consumeAmount,lowHeatAmount,energyBiologyNum)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 生物质燃料排放量 =消耗量*低位发热量*生物量含量*排放因子/100/1000 |
|||
* @param consumeAmount 消耗量 |
|||
* @param lowHeatAmount 低位发热量 |
|||
* @param biomassContent 生物量含量 |
|||
* @param emissionFactor 排放因子 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal biomassFuelNumCalculate(String consumeAmount,String lowHeatAmount,String biomassContent,String emissionFactor) { |
|||
return commonCalculate(consumeAmount,lowHeatAmount) |
|||
.multiply(new BigDecimal(biomassContent)) |
|||
.multiply(new BigDecimal(emissionFactor)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP) |
|||
.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 直接碳排放量 =消耗量*低位发热量*氧化因子*排放因子/100/1000-生物质燃料排放量 |
|||
* @param consumeAmount 消耗量 |
|||
* @param lowHeatAmount 低位发热量 |
|||
* @param biomassContent 生物量含量 |
|||
* @param emissionFactor 排放因子 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal directCarbonCalculate(String consumeAmount,String lowHeatAmount,String biomassContent,String emissionFactor,String carbonOxdRate) { |
|||
return commonCalculate(consumeAmount,lowHeatAmount) |
|||
.multiply(new BigDecimal(carbonOxdRate)) |
|||
.multiply(new BigDecimal(emissionFactor)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP) |
|||
.divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP) |
|||
.subtract(biomassFuelNumCalculate(consumeAmount,lowHeatAmount,biomassContent,emissionFactor)); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,55 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.util; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
|
|||
/** |
|||
* 物料平衡计算工具类 |
|||
*/ |
|||
public class MaterialBalanceUtil { |
|||
|
|||
|
|||
/** |
|||
* 公用计算:消耗量*含碳量*44/12 |
|||
* @param consumeAmount 消耗量 |
|||
* @param carbonContent 碳含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal commonCalculate(String consumeAmount,String carbonContent) { |
|||
return new BigDecimal(consumeAmount) |
|||
.multiply(new BigDecimal(carbonContent)) |
|||
.multiply(new BigDecimal(44)) |
|||
.divide(new BigDecimal(12), 2, RoundingMode.HALF_UP) |
|||
; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 生物质燃料排放量 =消耗量*含碳量*44/12*生物量含量/100 |
|||
* @param consumeAmount 消耗量 |
|||
* @param carbonContent 碳含量 |
|||
* @param biomassContent 生物量含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal biomassFuelNumCalculate(String consumeAmount,String carbonContent, String biomassContent) { |
|||
return commonCalculate(consumeAmount, carbonContent) |
|||
.multiply(new BigDecimal(biomassContent)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 直接碳排放量 ==消耗量*含碳量*44/12-生物质燃料排放量 |
|||
* @param consumeAmount 消耗量 |
|||
* @param carbonContent 碳含量 |
|||
* @param biomassContent 生物量含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal directCarbonCalculate(String consumeAmount,String carbonContent, String biomassContent) { |
|||
return commonCalculate(consumeAmount, carbonContent) |
|||
.subtract(biomassFuelNumCalculate(consumeAmount,carbonContent,biomassContent)); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,61 +0,0 @@ |
|||
package com.thing.cbam.directCarbon.util; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
|
|||
/** |
|||
* 过程排放的计算工具类 |
|||
*/ |
|||
public class ProcessDischargeUtil { |
|||
|
|||
|
|||
/** |
|||
* 公用计算:消耗量*排放因子*转化因子/100 |
|||
* @param consumeAmount 消耗量 |
|||
* @param emissionFactor 排放因子 |
|||
* @param conversionFactor 转换因子 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal commonCalculate(String consumeAmount,String emissionFactor,String conversionFactor) { |
|||
return new BigDecimal(consumeAmount) |
|||
.multiply(new BigDecimal(emissionFactor)) |
|||
.multiply(new BigDecimal(conversionFactor)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP) |
|||
; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 生物质燃料排放量 ==消耗量*排放因子*转化因子/100*生物量含量/100 |
|||
* @param consumeAmount 消耗量 |
|||
* @param emissionFactor 排放因子 |
|||
* @param conversionFactor 转换因子 |
|||
* @param biomassContent 生物量含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal biomassFuelNumCalculate(String consumeAmount,String emissionFactor,String conversionFactor, String biomassContent) { |
|||
return commonCalculate( consumeAmount, emissionFactor,conversionFactor) |
|||
.multiply(new BigDecimal(biomassContent)) |
|||
.multiply(new BigDecimal(emissionFactor)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP) |
|||
.multiply(new BigDecimal(biomassContent)) |
|||
.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 直接碳排放量 ==消耗量"排放因子*转化因子/100-生物质燃料排成量 |
|||
* @param consumeAmount 消耗量 |
|||
* @param emissionFactor 排放因子 |
|||
* @param conversionFactor 转换因子 |
|||
* @param biomassContent 生物量含量 |
|||
* @return 公用计算结果 |
|||
*/ |
|||
public static BigDecimal directCarbonCalculate(String consumeAmount,String emissionFactor,String conversionFactor, String biomassContent) { |
|||
return commonCalculate( consumeAmount, emissionFactor,conversionFactor) |
|||
.subtract(biomassFuelNumCalculate(consumeAmount,emissionFactor,conversionFactor,biomassContent)); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,66 +0,0 @@ |
|||
package com.thing.cbam.electricity.controller; |
|||
|
|||
import com.thing.cbam.electricity.dto.CbamElectricityToolDTO; |
|||
import com.thing.cbam.electricity.service.CbamElectricityToolService; |
|||
import com.thing.common.core.annotation.LogOperation; |
|||
import com.thing.common.core.constants.Constant; |
|||
import com.thing.common.core.validator.AssertUtils; |
|||
import com.thing.common.core.web.response.PageData; |
|||
import com.thing.common.core.web.response.Result; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("v2/cbam/electricity/tool") |
|||
@Tag(name="热电联产工具") |
|||
@RequiredArgsConstructor |
|||
public class CbamElectricityToolController { |
|||
private final CbamElectricityToolService cbamElectricityToolService; |
|||
@GetMapping("page") |
|||
@Operation(summary = "分页") |
|||
@Parameters({ |
|||
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true), |
|||
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true), |
|||
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"), |
|||
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") |
|||
}) |
|||
public Result<PageData<CbamElectricityToolDTO>> page(@Parameter(hidden = true) @RequestParam Map<String,Object> param) { |
|||
PageData<CbamElectricityToolDTO> pageList = cbamElectricityToolService.getPageData(param,CbamElectricityToolDTO.class); |
|||
return new Result<PageData<CbamElectricityToolDTO>>().ok(pageList); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
@Operation(summary = "信息") |
|||
public Result<CbamElectricityToolDTO> info(@PathVariable("id") Long id) { |
|||
CbamElectricityToolDTO dto = cbamElectricityToolService.getByIdAs(id,CbamElectricityToolDTO.class); |
|||
return new Result<CbamElectricityToolDTO>().ok(dto); |
|||
} |
|||
@PostMapping |
|||
@Operation(summary = "保存") |
|||
@LogOperation("保存") |
|||
public Result<Void> save(@RequestBody CbamElectricityToolDTO dto) { |
|||
cbamElectricityToolService.saveDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@PutMapping |
|||
@Operation(summary = "修改") |
|||
@LogOperation("修改") |
|||
public Result<Void> update(@RequestBody CbamElectricityToolDTO dto) { |
|||
cbamElectricityToolService.updateDto(dto); |
|||
return new Result<>(); |
|||
} |
|||
@DeleteMapping |
|||
@Operation(summary = "删除") |
|||
@LogOperation("删除") |
|||
public Result<Void> delete(@RequestBody Long[] ids) { |
|||
AssertUtils.isArrayEmpty(ids,"id"); |
|||
cbamElectricityToolService.batchDelete(ids); |
|||
return new Result<>(); |
|||
} |
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
package com.thing.cbam.electricity.dto; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 热电联产工具 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "热电联产工具") |
|||
public class CbamElectricityToolDTO implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
@Schema(description = "CHP的燃料投入") |
|||
private String fuelInput; |
|||
@Schema(description = "CHP的发热量产出") |
|||
private String heatingOutput; |
|||
@Schema(description = "CHP发电量") |
|||
private String powerGener; |
|||
@Schema(description = "来自CHP机组的燃料投入量") |
|||
private String fuelUnit; |
|||
@Schema(description = "来自烟气净化过程的燃料投入量") |
|||
private String gasProcess; |
|||
@Schema(description = "发热量生产") |
|||
private String heatProd; |
|||
@Schema(description = "电力生产") |
|||
private String electProd; |
|||
@Schema(description = "关联cbam_industry_information的主键id") |
|||
private Long industryId; |
|||
@Schema(description = "CHP发电量计算值") |
|||
private String calcuPower; |
|||
@Schema(description = "排放总量") |
|||
private String totalEmiss; |
|||
@Schema(description = "发热量电力合计") |
|||
private String totalSum; |
|||
@Schema(description = "发热量产出引起的排放量") |
|||
private String emissHeat; |
|||
@Schema(description = "排放因子,发热量") |
|||
private String factorHeat; |
|||
@Schema(description = "电力排放") |
|||
private String electEmiss; |
|||
@Schema(description = "排放因子,电力") |
|||
private String factorElect; |
|||
@Schema(description = "发热量的燃料投入") |
|||
private String inputHeat; |
|||
@Schema(description = "电力的燃料投入") |
|||
private String inputElect; |
|||
|
|||
} |
|||
@ -1,99 +0,0 @@ |
|||
package com.thing.cbam.electricity.entity; |
|||
|
|||
import com.mybatisflex.annotation.Id; |
|||
import com.mybatisflex.annotation.KeyType; |
|||
import com.mybatisflex.annotation.Table; |
|||
|
|||
import com.mybatisflex.core.keygen.KeyGenerators; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 热电联产工具 |
|||
* |
|||
* @author xc |
|||
* @since 3.0 2024-12-03 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@Table("cbam_electricity_tool") |
|||
public class CbamElectricityToolEntity implements Serializable { |
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
|||
private Long id; |
|||
/** |
|||
* CHP的燃料投入 |
|||
*/ |
|||
private String fuelInput; |
|||
/** |
|||
* CHP的发热量产出 |
|||
*/ |
|||
private String heatingOutput; |
|||
/** |
|||
* CHP发电量 |
|||
*/ |
|||
private String powerGener; |
|||
/** |
|||
* 来自CHP机组的燃料投入量 |
|||
*/ |
|||
private String fuelUnit; |
|||
/** |
|||
* 来自烟气净化过程的燃料投入量 |
|||
*/ |
|||
private String gasProcess; |
|||
/** |
|||
* 发热量生产 |
|||
*/ |
|||
private String heatProd; |
|||
/** |
|||
* 电力生产 |
|||
*/ |
|||
private String electProd; |
|||
/** |
|||
* 关联cbam_industry_information的主键id |
|||
*/ |
|||
private Long industryId; |
|||
/** |
|||
* CHP发电量计算值 |
|||
*/ |
|||
private String calcuPower; |
|||
/** |
|||
* 排放总量 |
|||
*/ |
|||
private String totalEmiss; |
|||
/** |
|||
* 发热量电力合计 |
|||
*/ |
|||
private String totalSum; |
|||
/** |
|||
* 发热量产出引起的排放量 |
|||
*/ |
|||
private String emissHeat; |
|||
/** |
|||
* 排放因子,发热量 |
|||
*/ |
|||
private String factorHeat; |
|||
/** |
|||
* 电力排放 |
|||
*/ |
|||
private String electEmiss; |
|||
/** |
|||
* 排放因子,电力 |
|||
*/ |
|||
private String factorElect; |
|||
/** |
|||
* 发热量的燃料投入 |
|||
*/ |
|||
private String inputHeat; |
|||
/** |
|||
* 电力的燃料投入 |
|||
*/ |
|||
private String inputElect; |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package com.thing.cbam.electricity.mapper; |
|||
|
|||
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
|||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface CbamElectricityToolMapper extends PowerBaseMapper<CbamElectricityToolEntity> { |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
package com.thing.cbam.electricity.service; |
|||
|
|||
|
|||
import com.thing.cbam.electricity.dto.CbamElectricityToolDTO; |
|||
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
|||
import com.thing.common.orm.service.IBaseService; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
|
|||
public interface CbamElectricityToolService extends IBaseService<CbamElectricityToolEntity> { |
|||
|
|||
LinkedHashMap<String, Object> validateMsg(CbamElectricityToolDTO cbamElectricityToolDTO); |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue