26 changed files with 794 additions and 41 deletions
-
1modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamCountryDictController.java
-
81modules/cbam/src/main/java/com/thing/cbam/dict/controller/CbamFactorDictController.java
-
5modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamCountryDictDTO.java
-
34modules/cbam/src/main/java/com/thing/cbam/dict/dto/CbamFactorDictDTO.java
-
4modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamCountryDictEntity.java
-
43modules/cbam/src/main/java/com/thing/cbam/dict/entity/CbamFactorDictEntity.java
-
9modules/cbam/src/main/java/com/thing/cbam/dict/mapper/CbamFactorDictMapper.java
-
7modules/cbam/src/main/java/com/thing/cbam/dict/service/CbamFactorDictService.java
-
19modules/cbam/src/main/java/com/thing/cbam/dict/service/impl/CbamFactorDictServiceImpl.java
-
45modules/cbam/src/main/java/com/thing/cbam/electricity/controller/CbamElectricityToolController.java
-
28modules/cbam/src/main/java/com/thing/cbam/electricity/dto/CbamElectricityToolDTO.java
-
46modules/cbam/src/main/java/com/thing/cbam/electricity/entity/CbamElectricityToolEntity.java
-
6modules/cbam/src/main/java/com/thing/cbam/electricity/service/CbamElectricityToolService.java
-
35modules/cbam/src/main/java/com/thing/cbam/electricity/service/Impl/CbamElectricityToolServiceImpl.java
-
73modules/cbam/src/main/java/com/thing/cbam/material/controller/CbamMaterialConsumptionController.java
-
76modules/cbam/src/main/java/com/thing/cbam/material/controller/CbamMaterialSpecificController.java
-
42modules/cbam/src/main/java/com/thing/cbam/material/dto/CbamMaterialConsumptionDTO.java
-
50modules/cbam/src/main/java/com/thing/cbam/material/dto/CbamMaterialSpecificDTO.java
-
59modules/cbam/src/main/java/com/thing/cbam/material/entity/CbamMaterialConsumptionEntity.java
-
76modules/cbam/src/main/java/com/thing/cbam/material/entity/CbamMaterialSpecificEntity.java
-
9modules/cbam/src/main/java/com/thing/cbam/material/mapper/CbamMaterialConsumptionMapper.java
-
11modules/cbam/src/main/java/com/thing/cbam/material/mapper/CbamMaterialSpecificMapper.java
-
9modules/cbam/src/main/java/com/thing/cbam/material/service/CbamMaterialConsumptionService.java
-
11modules/cbam/src/main/java/com/thing/cbam/material/service/CbamMaterialSpecificService.java
-
23modules/cbam/src/main/java/com/thing/cbam/material/service/Impl/CbamMaterialConsumptionServiceImpl.java
-
33modules/cbam/src/main/java/com/thing/cbam/material/service/Impl/CbamMaterialSpecificServiceImpl.java
@ -0,0 +1,81 @@ |
|||||
|
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); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
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 String sort; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
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 String sort; |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
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> { |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
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> { |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
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,7 +1,13 @@ |
|||||
package com.thing.cbam.electricity.service; |
package com.thing.cbam.electricity.service; |
||||
|
|
||||
|
|
||||
|
import com.thing.cbam.electricity.dto.CbamElectricityToolDTO; |
||||
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
||||
import com.thing.common.orm.service.IBaseService; |
import com.thing.common.orm.service.IBaseService; |
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
|
|
||||
public interface CbamElectricityToolService extends IBaseService<CbamElectricityToolEntity> { |
public interface CbamElectricityToolService extends IBaseService<CbamElectricityToolEntity> { |
||||
|
|
||||
|
LinkedHashMap<String, Object> validateMsg(CbamElectricityToolDTO cbamElectricityToolDTO); |
||||
} |
} |
||||
@ -1,19 +1,52 @@ |
|||||
package com.thing.cbam.electricity.service.Impl; |
package com.thing.cbam.electricity.service.Impl; |
||||
|
|
||||
import com.mybatisflex.core.query.QueryWrapper; |
import com.mybatisflex.core.query.QueryWrapper; |
||||
|
import com.thing.cbam.electricity.dto.CbamElectricityToolDTO; |
||||
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
import com.thing.cbam.electricity.entity.CbamElectricityToolEntity; |
||||
import com.thing.cbam.electricity.mapper.CbamElectricityToolMapper; |
import com.thing.cbam.electricity.mapper.CbamElectricityToolMapper; |
||||
import com.thing.cbam.electricity.service.CbamElectricityToolService; |
import com.thing.cbam.electricity.service.CbamElectricityToolService; |
||||
import com.thing.common.orm.service.impl.BaseServiceImpl; |
import com.thing.common.orm.service.impl.BaseServiceImpl; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
import java.util.Map; |
import java.util.Map; |
||||
|
|
||||
@Service |
@Service |
||||
public class CbamElectricityToolServiceImpl extends BaseServiceImpl<CbamElectricityToolMapper, CbamElectricityToolEntity>implements CbamElectricityToolService { |
|
||||
|
public class CbamElectricityToolServiceImpl extends BaseServiceImpl<CbamElectricityToolMapper, CbamElectricityToolEntity> implements CbamElectricityToolService { |
||||
|
|
||||
@Override |
@Override |
||||
public QueryWrapper getWrapper(Map<String, Object> params) { |
public QueryWrapper getWrapper(Map<String, Object> params) { |
||||
QueryWrapper wrapper = new QueryWrapper(); |
QueryWrapper wrapper = new QueryWrapper(); |
||||
return wrapper; |
return wrapper; |
||||
} |
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public LinkedHashMap<String, Object> validateMsg(CbamElectricityToolDTO cbamElectricityToolDTO) { |
||||
|
LinkedHashMap<String,Object> resMap = new LinkedHashMap<>(); |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getFuelInput())){ |
||||
|
resMap.put("fuelInput","CHP的燃料投入不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getHeatingOutput())){ |
||||
|
resMap.put("heatingOutput","CHP的发热量产出不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getPowerGener())){ |
||||
|
resMap.put("powerGener","CHP发电量不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getFuelUnit())){ |
||||
|
resMap.put("fuelUnit","来自CHP机组的燃料投入量不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getGasProcess())){ |
||||
|
resMap.put("gasProcess","来自烟气净化过程的燃料投入量不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getHeatProd())){ |
||||
|
resMap.put("heatProd","发热量生产不能为空"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(cbamElectricityToolDTO.getElectProd())){ |
||||
|
resMap.put("electProd","电力生产不能为空"); |
||||
|
} |
||||
|
|
||||
|
return resMap; |
||||
|
} |
||||
} |
} |
||||
@ -0,0 +1,73 @@ |
|||||
|
package com.thing.cbam.material.controller; |
||||
|
|
||||
|
|
||||
|
import com.thing.cbam.material.dto.CbamMaterialConsumptionDTO; |
||||
|
import com.thing.cbam.material.service.CbamMaterialConsumptionService; |
||||
|
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 |
||||
|
@Tag(name = "原材料消耗量") |
||||
|
@RequiredArgsConstructor |
||||
|
public class CbamMaterialConsumptionController { |
||||
|
private final CbamMaterialConsumptionService cbamMaterialConsumptionService; |
||||
|
@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<CbamMaterialConsumptionDTO>> page(@Parameter(hidden = true) @RequestParam Map<String,Object> param) { |
||||
|
PageData<CbamMaterialConsumptionDTO> pageList = cbamMaterialConsumptionService.getPageData(param,CbamMaterialConsumptionDTO.class); |
||||
|
return new Result<PageData<CbamMaterialConsumptionDTO>>().ok(pageList); |
||||
|
} |
||||
|
@GetMapping("{id}") |
||||
|
@Operation(summary = "信息") |
||||
|
public Result<CbamMaterialConsumptionDTO> get(@PathVariable("id") Long id) { |
||||
|
CbamMaterialConsumptionDTO dto = cbamMaterialConsumptionService.getByIdAs(id,CbamMaterialConsumptionDTO.class); |
||||
|
return new Result<CbamMaterialConsumptionDTO>().ok(dto); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
@Operation(summary = "保存") |
||||
|
@LogOperation("保存") |
||||
|
public Result<Void> save(@RequestBody CbamMaterialConsumptionDTO dto) { |
||||
|
cbamMaterialConsumptionService.saveDto(dto); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
@Operation(summary = "修改") |
||||
|
@LogOperation("修改") |
||||
|
public Result<Void> update(@RequestBody CbamMaterialConsumptionDTO dto) { |
||||
|
//效验数据 |
||||
|
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
cbamMaterialConsumptionService.updateDto(dto); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
@Operation(summary = "删除") |
||||
|
@LogOperation("删除") |
||||
|
public Result<Void> delete(@RequestBody Long[] ids) { |
||||
|
//效验数据 |
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
cbamMaterialConsumptionService.batchDelete(ids); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,76 @@ |
|||||
|
package com.thing.cbam.material.controller; |
||||
|
|
||||
|
|
||||
|
import com.thing.cbam.baesInfoExcel.dto.CbamIndustryDTO; |
||||
|
import com.thing.cbam.material.dto.CbamMaterialSpecificDTO; |
||||
|
import com.thing.cbam.material.service.CbamMaterialSpecificService; |
||||
|
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/specific") |
||||
|
@Tag(name = "原材料特定") |
||||
|
@RequiredArgsConstructor |
||||
|
public class CbamMaterialSpecificController { |
||||
|
private final CbamMaterialSpecificService cbamMaterialSpecificService; |
||||
|
|
||||
|
@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<CbamMaterialSpecificDTO>> page(@Parameter(hidden = true) @RequestParam Map<String,Object> param) { |
||||
|
PageData<CbamMaterialSpecificDTO> pageList = cbamMaterialSpecificService.getPageData(param,CbamMaterialSpecificDTO.class); |
||||
|
return new Result<PageData<CbamMaterialSpecificDTO>>().ok(pageList); |
||||
|
} |
||||
|
@GetMapping("{id}") |
||||
|
@Operation(summary = "信息") |
||||
|
public Result<CbamMaterialSpecificDTO> get(@PathVariable("id") Long id) { |
||||
|
CbamMaterialSpecificDTO dto = cbamMaterialSpecificService.getByIdAs(id,CbamMaterialSpecificDTO.class); |
||||
|
return new Result<CbamMaterialSpecificDTO>().ok(dto); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
@Operation(summary = "保存") |
||||
|
@LogOperation("保存") |
||||
|
public Result<Void> save(@RequestBody CbamMaterialSpecificDTO dto) { |
||||
|
cbamMaterialSpecificService.saveDto(dto); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
@Operation(summary = "修改") |
||||
|
@LogOperation("修改") |
||||
|
public Result<Void> update(@RequestBody CbamMaterialSpecificDTO dto) { |
||||
|
//效验数据 |
||||
|
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
cbamMaterialSpecificService.updateDto(dto); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
@Operation(summary = "删除") |
||||
|
@LogOperation("删除") |
||||
|
public Result<Void> delete(@RequestBody Long[] ids) { |
||||
|
//效验数据 |
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
cbamMaterialSpecificService.batchDelete(ids); |
||||
|
return new Result<>(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.thing.cbam.material.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 CbamMaterialConsumptionDTO implements Serializable { |
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
||||
|
private Long id; |
||||
|
@Schema(description = "采购量") |
||||
|
private String purchaseQuantity; |
||||
|
@Schema(description = "消耗量") |
||||
|
private String consumAmount; |
||||
|
@Schema(description = "非欧盟商品消耗量") |
||||
|
private String consumGoods; |
||||
|
@Schema(description = "关联cbam_industry_information的主键id") |
||||
|
private Long industryId; |
||||
|
@Schema(description = "产品名称|生产过程") |
||||
|
private String prodNameProcess; |
||||
|
@Schema(description = "剩余消耗量") |
||||
|
private String remainConsum; |
||||
|
@Schema(description = "关联cbam_process_material的原材料") |
||||
|
private Long materialId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.thing.cbam.material.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 CbamMaterialSpecificDTO implements Serializable { |
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
||||
|
private Long id; |
||||
|
@Schema(description = "SEE(直接) tCO₂e/t") |
||||
|
private String seeDirect; |
||||
|
@Schema(description = "SEE(直接)来源") |
||||
|
private String seeSource; |
||||
|
@Schema(description = "单位耗电量") |
||||
|
private String unitPowerConsum; |
||||
|
@Schema(description = "单位耗电量来源") |
||||
|
private String consumSource; |
||||
|
@Schema(description = "电力排放因子") |
||||
|
private String electEmissionFactor; |
||||
|
@Schema(description = "电力排放因子来源") |
||||
|
private String factorSource; |
||||
|
@Schema(description = "关联cbam_industry_information的主键id") |
||||
|
private Long industryId; |
||||
|
@Schema(description = "生产路线") |
||||
|
private String prodRoute; |
||||
|
@Schema(description = "产品名称|生产过程") |
||||
|
private String prodNameProcess; |
||||
|
@Schema(description = "SEE(间接) tCO₂e/t") |
||||
|
private String seeIndirect; |
||||
|
@Schema(description = "关联cbam_process_material的原材料") |
||||
|
private Long materialId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
package com.thing.cbam.material.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_material_consumption") |
||||
|
public class CbamMaterialConsumptionEntity implements Serializable { |
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
||||
|
private Long id; |
||||
|
/** |
||||
|
* 采购量 |
||||
|
*/ |
||||
|
private String purchaseQuantity; |
||||
|
/** |
||||
|
* 消耗量 |
||||
|
*/ |
||||
|
private String consumAmount; |
||||
|
/** |
||||
|
* 非欧盟商品消耗量 |
||||
|
*/ |
||||
|
private String consumGoods; |
||||
|
/** |
||||
|
* 关联cbam_industry_information的主键id |
||||
|
*/ |
||||
|
private Long industryId; |
||||
|
/** |
||||
|
* 产品名称|生产过程 |
||||
|
*/ |
||||
|
private String prodNameProcess; |
||||
|
/** |
||||
|
* 剩余消耗量 |
||||
|
*/ |
||||
|
private String remainConsum; |
||||
|
/** |
||||
|
* 关联cbam_process_material的原材料 |
||||
|
*/ |
||||
|
private Long materialId; |
||||
|
} |
||||
@ -0,0 +1,76 @@ |
|||||
|
package com.thing.cbam.material.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_material_specific") |
||||
|
public class CbamMaterialSpecificEntity implements Serializable { |
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId) |
||||
|
private Long id; |
||||
|
/** |
||||
|
* SEE(直接) tCO₂e/t |
||||
|
*/ |
||||
|
private String seeDirect; |
||||
|
/** |
||||
|
* SEE(直接)来源 |
||||
|
*/ |
||||
|
private String seeSource; |
||||
|
/** |
||||
|
* 单位耗电量 |
||||
|
*/ |
||||
|
private String unitPowerConsum; |
||||
|
/** |
||||
|
* 单位耗电量来源 |
||||
|
*/ |
||||
|
private String consumSource; |
||||
|
/** |
||||
|
* 电力排放因子 |
||||
|
*/ |
||||
|
private String electEmissionFactor; |
||||
|
/** |
||||
|
* 电力排放因子来源 |
||||
|
*/ |
||||
|
private String factorSource; |
||||
|
/** |
||||
|
* 关联cbam_industry_information的主键id |
||||
|
*/ |
||||
|
private Long industryId; |
||||
|
/** |
||||
|
* 生产路线 |
||||
|
*/ |
||||
|
private String prodRoute; |
||||
|
/** |
||||
|
* 产品名称|生产过程 |
||||
|
*/ |
||||
|
private String prodNameProcess; |
||||
|
/** |
||||
|
* SEE(间接) tCO₂e/t |
||||
|
*/ |
||||
|
private String seeIndirect; |
||||
|
/** |
||||
|
* 关联cbam_process_material的原材料 |
||||
|
*/ |
||||
|
private Long materialId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.thing.cbam.material.mapper; |
||||
|
|
||||
|
import com.thing.cbam.material.entity.CbamMaterialConsumptionEntity; |
||||
|
import com.thing.common.orm.mapper.PowerBaseMapper; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface CbamMaterialConsumptionMapper extends PowerBaseMapper<CbamMaterialConsumptionEntity> { |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.thing.cbam.material.mapper; |
||||
|
|
||||
|
import com.thing.cbam.material.entity.CbamMaterialSpecificEntity; |
||||
|
import com.thing.common.orm.mapper.PowerBaseMapper; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
|
||||
|
@Mapper |
||||
|
public interface CbamMaterialSpecificMapper extends PowerBaseMapper<CbamMaterialSpecificEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.thing.cbam.material.service; |
||||
|
|
||||
|
import com.thing.cbam.material.dto.CbamMaterialConsumptionDTO; |
||||
|
import com.thing.cbam.material.entity.CbamMaterialConsumptionEntity; |
||||
|
import com.thing.common.orm.service.IBaseService; |
||||
|
|
||||
|
public interface CbamMaterialConsumptionService extends IBaseService<CbamMaterialConsumptionEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.thing.cbam.material.service; |
||||
|
|
||||
|
import com.thing.cbam.material.dto.CbamMaterialSpecificDTO; |
||||
|
import com.thing.cbam.material.entity.CbamMaterialSpecificEntity; |
||||
|
import com.thing.common.orm.service.IBaseService; |
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
|
|
||||
|
public interface CbamMaterialSpecificService extends IBaseService<CbamMaterialSpecificEntity> { |
||||
|
LinkedHashMap<String,Object> validateMsg(CbamMaterialSpecificDTO cbamMaterialSpecificDTO); |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.thing.cbam.material.service.Impl; |
||||
|
|
||||
|
import com.mybatisflex.core.query.QueryWrapper; |
||||
|
import com.thing.cbam.material.dto.CbamMaterialConsumptionDTO; |
||||
|
import com.thing.cbam.material.entity.CbamMaterialConsumptionEntity; |
||||
|
import com.thing.cbam.material.entity.CbamMaterialSpecificEntity; |
||||
|
import com.thing.cbam.material.mapper.CbamMaterialConsumptionMapper; |
||||
|
import com.thing.cbam.material.mapper.CbamMaterialSpecificMapper; |
||||
|
import com.thing.cbam.material.service.CbamMaterialConsumptionService; |
||||
|
import com.thing.common.orm.service.impl.BaseServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Service |
||||
|
public class CbamMaterialConsumptionServiceImpl extends BaseServiceImpl<CbamMaterialConsumptionMapper, CbamMaterialConsumptionEntity> implements CbamMaterialConsumptionService { |
||||
|
@Override |
||||
|
public QueryWrapper getWrapper(Map<String, Object> params) { |
||||
|
QueryWrapper wrapper = new QueryWrapper(); |
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.thing.cbam.material.service.Impl; |
||||
|
|
||||
|
import com.mybatisflex.core.query.QueryWrapper; |
||||
|
import com.thing.cbam.electricity.mapper.CbamElectricityToolMapper; |
||||
|
import com.thing.cbam.material.dto.CbamMaterialSpecificDTO; |
||||
|
import com.thing.cbam.material.entity.CbamMaterialSpecificEntity; |
||||
|
import com.thing.cbam.material.mapper.CbamMaterialSpecificMapper; |
||||
|
import com.thing.cbam.material.service.CbamMaterialSpecificService; |
||||
|
import com.thing.common.orm.service.impl.BaseServiceImpl; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Service |
||||
|
public class CbamMaterialSpecificServiceImpl extends BaseServiceImpl<CbamMaterialSpecificMapper, CbamMaterialSpecificEntity> implements CbamMaterialSpecificService { |
||||
|
@Override |
||||
|
public QueryWrapper getWrapper(Map<String, Object> params) { |
||||
|
QueryWrapper wrapper = new QueryWrapper(); |
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public LinkedHashMap<String, Object> validateMsg(CbamMaterialSpecificDTO cbamMaterialSpecificDTO) { |
||||
|
LinkedHashMap<String,Object> resultMap = new LinkedHashMap<>(); |
||||
|
if (StringUtils.isBlank(cbamMaterialSpecificDTO.getSeeDirect())){ |
||||
|
resultMap.put("seeDirect","SEE(直接)不能为空"); |
||||
|
} |
||||
|
|
||||
|
return resultMap; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue