48 changed files with 1566 additions and 455 deletions
-
18modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamIndustryController.java
-
69modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamMaterialController.java
-
112modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamProcessMaterialController.java
-
43modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/controller/CbamProdRouteRelationController.java
-
17modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamIndustryDTO.java
-
30modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamMaterialDTO.java
-
60modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamProcessMaterialDTO.java
-
34modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamProdRouteRelationDTO.java
-
38modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/dto/CbamProductInfoDTO.java
-
61modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamIndustryEntity.java
-
41modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamMaterialEntity.java
-
88modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamProcessMaterialEntity.java
-
51modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamProdRouteRelationEntity.java
-
55modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/entity/CbamProductInfoEntity.java
-
10modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/mapper/CbamMaterialMapper.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
-
17modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/mapper/CbamProductInfoMapper.java
-
6modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamIndustryService.java
-
13modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamMaterialService.java
-
44modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamProcessMaterialService.java
-
19modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamProdRouteRelationService.java
-
22modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/CbamProductInfoService.java
-
124modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamIndustryServiceImpl.java
-
27modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamMaterialServiceImpl.java
-
95modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamProcessMaterialServiceImpl.java
-
39modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamProdRouteRelationServiceImpl.java
-
36modules/cbam/src/main/java/com/thing/cbam/baesInfoExcel/service/impl/CbamProductInfoServiceImpl.java
-
112modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamFuelDictController.java
-
37modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamFuelDictDTO.java
-
54modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamFuelDictEntity.java
-
16modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamFuelDictMapper.java
-
15modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamFuelDictService.java
-
35modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamFuelDictServiceImpl.java
-
44modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamCarbonBurnController.java
-
114modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamCarbonDirectController.java
-
2modules/cbam/src/main/java/com/thing/cbam/directCarbon/controller/CbamCarbonProgressController.java
-
6modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamCarbonBurnDTO.java
-
84modules/cbam/src/main/java/com/thing/cbam/directCarbon/dto/CbamCarbonDirectDTO.java
-
10modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamCarbonBurnEntity.java
-
146modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamCarbonDirectEntity.java
-
2modules/cbam/src/main/java/com/thing/cbam/directCarbon/entity/CbamCarbonProgressEntity.java
-
16modules/cbam/src/main/java/com/thing/cbam/directCarbon/mapper/CbamCarbonDirectMapper.java
-
11modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamCarbonBurnService.java
-
19modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamCarbonDirectService.java
-
1modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/CbamCarbonProgressService.java
-
58modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/impl/CbamCarbonBurnServiceImpl.java
-
38modules/cbam/src/main/java/com/thing/cbam/directCarbon/service/impl/CbamCarbonDirectServiceImpl.java
@ -1,69 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.controller; |
|
||||
|
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.dto.CbamMaterialDTO; |
|
||||
import com.thing.cbam.baesInfoExcel.service.CbamMaterialService; |
|
||||
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/material") |
|
||||
@Tag(name = "原材料") |
|
||||
@RequiredArgsConstructor |
|
||||
public class CbamMaterialController { |
|
||||
private final CbamMaterialService cbamMaterialService; |
|
||||
@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<CbamMaterialDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params) { |
|
||||
PageData<CbamMaterialDTO> page = cbamMaterialService.getPageData(params, CbamMaterialDTO.class); |
|
||||
return new Result<PageData<CbamMaterialDTO>>().ok(page); |
|
||||
} |
|
||||
@GetMapping("{id}") |
|
||||
@Operation(summary = "信息") |
|
||||
public Result<CbamMaterialDTO> get(@PathVariable("id") Long id) { |
|
||||
CbamMaterialDTO data = cbamMaterialService.getByIdAs(id, CbamMaterialDTO.class); |
|
||||
return new Result<CbamMaterialDTO>().ok(data); |
|
||||
} |
|
||||
@PostMapping |
|
||||
@Operation(summary = "保存") |
|
||||
@LogOperation("保存") |
|
||||
public Result<Void> save(@RequestBody CbamMaterialDTO dto) { |
|
||||
cbamMaterialService.saveDto(dto); |
|
||||
return new Result<>(); |
|
||||
} |
|
||||
@PutMapping |
|
||||
@Operation(summary = "修改") |
|
||||
@LogOperation("修改") |
|
||||
public Result<Void> update(@RequestBody CbamMaterialDTO dto) { |
|
||||
//效验数据 |
|
||||
cbamMaterialService.updateDto(dto); |
|
||||
return new Result<>(); |
|
||||
} |
|
||||
@DeleteMapping |
|
||||
@Operation(summary = "删除") |
|
||||
@LogOperation("删除") |
|
||||
public Result<Void> delete(@RequestBody Long[] ids) { |
|
||||
//效验数据 |
|
||||
AssertUtils.isArrayEmpty(ids, "id"); |
|
||||
cbamMaterialService.batchDelete(ids); |
|
||||
return new Result<>(); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,112 @@ |
|||||
|
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/processmaterial") |
||||
|
@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> save(@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,30 +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-11-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
@Schema(description = "原材料") |
|
||||
public class CbamMaterialDTO implements Serializable { |
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
private Long id; |
|
||||
@Schema(description = "原材料名称") |
|
||||
private String rawMaterialName; |
|
||||
@Schema(description = "原材料的综合商品类别") |
|
||||
private String materialCategories; |
|
||||
@Schema(description = "关联cbam_industry_information的主键id") |
|
||||
private Long industryId; |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,60 @@ |
|||||
|
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 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 = "产品生产过程") |
||||
|
private Long productionProcess; |
||||
|
@Schema(description = "类型1.生产过程 2.原材料") |
||||
|
private Integer type; |
||||
|
@Schema(description = "生产工艺相关信息--由关联表得到") |
||||
|
List<CbamProdRouteRelationDTO> routeRelationList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
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,38 +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-11-26 |
|
||||
*/ |
|
||||
@Data |
|
||||
@Schema(description = "综合商品类别和相关生产过程") |
|
||||
public class CbamProductInfoDTO implements Serializable { |
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
private Long id; |
|
||||
@Schema(description = "产品名称") |
|
||||
private String productName; |
|
||||
@Schema(description = "总产量") |
|
||||
private String totalOutput; |
|
||||
@Schema(description = "HS代码") |
|
||||
private String hsCode; |
|
||||
@Schema(description = "产品生产过程") |
|
||||
private String productionProcess; |
|
||||
@Schema(description = "综合商品类别") |
|
||||
private String comprehensiveProductCategories; |
|
||||
@Schema(description = "工艺路线") |
|
||||
private String processRoute; |
|
||||
@Schema(description = "关联cbam_industry_information的主键id") |
|
||||
private Long industryId; |
|
||||
|
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.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-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
@Accessors(chain = true) |
|
||||
@EqualsAndHashCode(callSuper=false) |
|
||||
@Table("cbam_industry_material") |
|
||||
public class CbamMaterialEntity implements Serializable { |
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L;//数据序列化 |
|
||||
|
|
||||
@Id |
|
||||
private Long id; |
|
||||
/** |
|
||||
* 原材料名称 |
|
||||
*/ |
|
||||
private String rawMaterialName; |
|
||||
/** |
|
||||
* 原材料的综合商品类别 |
|
||||
*/ |
|
||||
private String materialCategories; |
|
||||
/** |
|
||||
* 关联cbam_industry_information的主键id |
|
||||
*/ |
|
||||
private Long industryId; |
|
||||
} |
|
||||
@ -0,0 +1,88 @@ |
|||||
|
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 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; |
||||
|
/** |
||||
|
* 产品生产过程 |
||||
|
*/ |
||||
|
private Long productionProcess; |
||||
|
/** |
||||
|
* 类型1.生产过程 2.原材料 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
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,55 +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; |
|
||||
|
|
||||
import java.io.Serial; |
|
||||
import java.io.Serializable; |
|
||||
|
|
||||
/** |
|
||||
* 综合商品类别和相关生产过程 |
|
||||
* |
|
||||
* @author xc |
|
||||
* @since 3.0 2024-11-26 |
|
||||
*/ |
|
||||
@Data |
|
||||
@Accessors(chain = true) |
|
||||
@EqualsAndHashCode(callSuper=false) |
|
||||
@Table("cbam_product_info") |
|
||||
public class CbamProductInfoEntity extends BaseInfoEntity implements Serializable { |
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* 产品名称 |
|
||||
*/ |
|
||||
private String productName; |
|
||||
/** |
|
||||
* 总产量 |
|
||||
*/ |
|
||||
private String totalOutput; |
|
||||
/** |
|
||||
* HS代码 |
|
||||
*/ |
|
||||
private String hsCode; |
|
||||
/** |
|
||||
* 产品生产过程 |
|
||||
*/ |
|
||||
private String productionProcess; |
|
||||
/** |
|
||||
* 综合商品类别 |
|
||||
*/ |
|
||||
private String comprehensiveProductCategories; |
|
||||
/** |
|
||||
* 工艺路线 |
|
||||
*/ |
|
||||
private String processRoute; |
|
||||
/** |
|
||||
* 关联cbam_industry_information的主键id |
|
||||
*/ |
|
||||
private Long industryId; |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.mapper; |
|
||||
|
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamMaterialEntity; |
|
||||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
|
||||
|
|
||||
@Mapper |
|
||||
public interface CbamMaterialMapper extends PowerBaseMapper<CbamMaterialEntity> { |
|
||||
} |
|
||||
@ -0,0 +1,16 @@ |
|||||
|
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> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
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,17 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.mapper; |
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamProductInfoEntity; |
|
||||
import com.thing.common.orm.mapper.PowerBaseMapper; |
|
||||
|
|
||||
import org.apache.ibatis.annotations.Mapper; |
|
||||
|
|
||||
/** |
|
||||
* 综合商品类别和相关生产过程 |
|
||||
* |
|
||||
* @author xc |
|
||||
* @since 3.0 2024-11-27 |
|
||||
*/ |
|
||||
@Mapper |
|
||||
public interface CbamProductInfoMapper extends PowerBaseMapper<CbamProductInfoEntity> { |
|
||||
|
|
||||
} |
|
||||
@ -1,13 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.service; |
|
||||
|
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.dto.CbamMaterialDTO; |
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamMaterialEntity; |
|
||||
import com.thing.common.orm.service.IBaseService; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public interface CbamMaterialService extends IBaseService<CbamMaterialEntity> { |
|
||||
List<CbamMaterialDTO> findListByIndustryId(Long industryId); |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,44 @@ |
|||||
|
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> { |
||||
|
|
||||
|
/** |
||||
|
* 根据行业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); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
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); |
||||
|
|
||||
|
} |
||||
@ -1,22 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.service; |
|
||||
|
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.dto.CbamProductInfoDTO; |
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamProductInfoEntity; |
|
||||
import com.thing.common.orm.service.IBaseService; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 综合商品类别和相关生产过程 |
|
||||
* |
|
||||
* @author xc |
|
||||
* @since 3.0 2024-11-26 |
|
||||
*/ |
|
||||
public interface CbamProductInfoService extends IBaseService<CbamProductInfoEntity> { |
|
||||
|
|
||||
|
|
||||
List<CbamProductInfoDTO> findListByIndustryId(Long industryId); |
|
||||
|
|
||||
} |
|
||||
@ -1,27 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.service.impl; |
|
||||
|
|
||||
import com.mybatisflex.core.query.QueryWrapper; |
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.dto.CbamMaterialDTO; |
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamMaterialEntity; |
|
||||
import com.thing.cbam.baesInfoExcel.mapper.CbamMaterialMapper; |
|
||||
import com.thing.cbam.baesInfoExcel.service.CbamMaterialService; |
|
||||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
@Service |
|
||||
public class CbamMaterialServiceImpl extends BaseServiceImpl<CbamMaterialMapper, CbamMaterialEntity> implements CbamMaterialService { |
|
||||
@Override |
|
||||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|
||||
QueryWrapper wrapper = new QueryWrapper(); |
|
||||
return wrapper; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<CbamMaterialDTO> findListByIndustryId(Long industryId) { |
|
||||
return mapper.selectListByQueryAs(QueryWrapper.create().eq(CbamMaterialEntity::getIndustryId,industryId), CbamMaterialDTO.class); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,95 @@ |
|||||
|
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.exception.SysException; |
||||
|
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.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
/** |
||||
|
* 综合商品类别和相关生产过程 和 购买的原材料 表 |
||||
|
* |
||||
|
* @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)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@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); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
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.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); |
||||
|
} |
||||
|
} |
||||
@ -1,36 +0,0 @@ |
|||||
package com.thing.cbam.baesInfoExcel.service.impl; |
|
||||
|
|
||||
import com.mybatisflex.core.query.QueryWrapper; |
|
||||
|
|
||||
import com.thing.cbam.baesInfoExcel.dto.CbamProductInfoDTO; |
|
||||
import com.thing.cbam.baesInfoExcel.entity.CbamProductInfoEntity; |
|
||||
import com.thing.cbam.baesInfoExcel.mapper.CbamProductInfoMapper; |
|
||||
import com.thing.cbam.baesInfoExcel.service.CbamProductInfoService; |
|
||||
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-11-26 |
|
||||
*/ |
|
||||
@Service |
|
||||
public class CbamProductInfoServiceImpl extends BaseServiceImpl<CbamProductInfoMapper, CbamProductInfoEntity> implements CbamProductInfoService { |
|
||||
|
|
||||
@Override |
|
||||
public QueryWrapper getWrapper(Map<String, Object> params){ |
|
||||
QueryWrapper wrapper = new QueryWrapper(); |
|
||||
return wrapper; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public List<CbamProductInfoDTO> findListByIndustryId(Long industryId){ |
|
||||
return mapper.selectListByQueryAs(QueryWrapper.create().eq(CbamProductInfoEntity::getIndustryId,industryId), CbamProductInfoDTO.class); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,112 @@ |
|||||
|
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); |
||||
|
*} |
||||
|
*/ |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
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; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
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; |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
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> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
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> { |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
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; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,114 @@ |
|||||
|
package com.thing.cbam.directCarbon.controller; |
||||
|
|
||||
|
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/carbonDirect") |
||||
|
@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="保存") |
||||
|
@LogOperation("保存") |
||||
|
public Result<Void> save(@RequestBody CbamCarbonDirectDTO dto){ |
||||
|
//效验数据 |
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
cbamCarbonDirectService.saveDto(dto); |
||||
|
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); |
||||
|
*} |
||||
|
*/ |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,84 @@ |
|||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 直接排放量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_information的主键id") |
||||
|
private Long industryId; |
||||
|
@Schema(description = "类型:\n" + |
||||
|
"1.是否涉及燃烧排放\n" + |
||||
|
"2.是否涉及过程排放\n" + |
||||
|
"3.是否涉及物料平衡\n" + |
||||
|
"4.是否有连续排放测量系统(CEMS)") |
||||
|
private Integer type; |
||||
|
private Long sort; |
||||
|
} |
||||
@ -0,0 +1,146 @@ |
|||||
|
package com.thing.cbam.directCarbon.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; |
||||
|
|
||||
|
/** |
||||
|
* 直接排放量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 |
||||
|
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; |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
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> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.thing.cbam.directCarbon.service; |
||||
|
|
||||
|
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
||||
|
import com.thing.cbam.directCarbon.entity.CbamCarbonDirectEntity; |
||||
|
import com.thing.common.orm.service.IBaseService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 直接排放量B-Excel |
||||
|
* |
||||
|
* @author xc |
||||
|
* @since 3.0 2024-12-02 |
||||
|
*/ |
||||
|
public interface CbamCarbonDirectService extends IBaseService<CbamCarbonDirectEntity> { |
||||
|
|
||||
|
List<CbamCarbonDirectDTO> listByIndustryId(Long industryId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
package com.thing.cbam.directCarbon.service.impl; |
||||
|
|
||||
|
import com.mybatisflex.core.query.QueryWrapper; |
||||
|
import com.thing.cbam.directCarbon.dto.CbamCarbonDirectDTO; |
||||
|
import com.thing.cbam.directCarbon.entity.CbamCarbonDirectEntity; |
||||
|
import com.thing.cbam.directCarbon.mapper.CbamCarbonDirectMapper; |
||||
|
import com.thing.cbam.directCarbon.service.CbamCarbonDirectService; |
||||
|
import com.thing.common.orm.service.impl.BaseServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 直接排放量B-Excel |
||||
|
* |
||||
|
* @author xc |
||||
|
* @since 3.0 2024-12-02 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class CbamCarbonDirectServiceImpl extends BaseServiceImpl<CbamCarbonDirectMapper, CbamCarbonDirectEntity> implements CbamCarbonDirectService { |
||||
|
|
||||
|
@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); |
||||
|
List<CbamCarbonDirectDTO> cbamCarbonDirectDTOS = mapper.selectListByQueryAs(queryWrapper, CbamCarbonDirectDTO.class); |
||||
|
return cbamCarbonDirectDTOS; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue