11 changed files with 20 additions and 218 deletions
-
73modules/cbam/src/main/java/com/thing/cbam/material/controller/CbamMaterialConsumptionController.java
-
1modules/cbam/src/main/java/com/thing/cbam/material/controller/CbamMaterialSpecificController.java
-
42modules/cbam/src/main/java/com/thing/cbam/material/dto/CbamMaterialConsumptionDTO.java
-
59modules/cbam/src/main/java/com/thing/cbam/material/entity/CbamMaterialConsumptionEntity.java
-
9modules/cbam/src/main/java/com/thing/cbam/material/mapper/CbamMaterialConsumptionMapper.java
-
9modules/cbam/src/main/java/com/thing/cbam/material/service/CbamMaterialConsumptionService.java
-
5modules/cbam/src/main/java/com/thing/cbam/material/service/CbamMaterialSpecificService.java
-
23modules/cbam/src/main/java/com/thing/cbam/material/service/Impl/CbamMaterialConsumptionServiceImpl.java
-
13modules/cbam/src/main/java/com/thing/cbam/material/service/Impl/CbamMaterialSpecificServiceImpl.java
-
2modules/cbam/src/main/java/com/thing/cbam/production/dto/CbamProductAllocationDTO.java
-
2modules/cbam/src/main/java/com/thing/cbam/production/entity/CbamProductAllocationEntity.java
@ -1,73 +0,0 @@ |
|||||
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("v2/cbam/material/consume") |
|
||||
@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<>(); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,42 +0,0 @@ |
|||||
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; |
|
||||
|
|
||||
} |
|
||||
@ -1,59 +0,0 @@ |
|||||
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; |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
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> { |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
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> { |
|
||||
|
|
||||
} |
|
||||
@ -1,23 +0,0 @@ |
|||||
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; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue