diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFeaturesController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFeaturesController.java index 0015a34..1d28829 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFeaturesController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFeaturesController.java @@ -1,6 +1,9 @@ package com.cnbm.basic.controller; import com.cnbm.admin.annotation.LogOperation; +import com.cnbm.admin.params.IdParam; +import com.cnbm.basic.dto.WorkingProcedureDTO; +import com.cnbm.basic.entity.ProductFeatures; import com.cnbm.common.constant.Constant; import com.cnbm.common.page.PageData; import com.cnbm.common.utils.ExcelUtils; @@ -114,4 +117,11 @@ public class ProductFeaturesController { ExcelUtils.exportExcelToTarget(response, null, list, ProductFeaturesExcel.class); } + @PostMapping("getProductFeaturesByProductId") + @ApiOperation("查询产品特性 依据产品id") + public Result> getProductFeaturesByProductId(@RequestBody IdParam id){ + List list = productFeaturesService.getProductFeaturesByProductId(id.getId()); + return new Result>().ok(list); + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductFeaturesDTO.java b/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductFeaturesDTO.java index a85e456..d72ef32 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductFeaturesDTO.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductFeaturesDTO.java @@ -29,9 +29,15 @@ public class ProductFeaturesDTO implements Serializable { @ApiModelProperty(value = "量具id,关联measure_tool表") private Long measureToolId; + @ApiModelProperty(value = "量具名称,关联measure_tool表") + private String measureToolName; + @ApiModelProperty(value = "单位 id,关联unit表") private Long unitId; + @ApiModelProperty(value = "单位名称,关联unit表") + private String unitName; + @ApiModelProperty(value = "产品特性 名") private String name; @@ -59,9 +65,18 @@ public class ProductFeaturesDTO implements Serializable { @ApiModelProperty(value = "工序id,关联 working_procedure 表id") private Long workingProcedureId; + @ApiModelProperty(value = "工序编码,关联 working_procedure 表id") + private String workingProcedureCode; + + @ApiModelProperty(value = "工序名称,关联 working_procedure 表id") + private String workingProcedureName; + @ApiModelProperty(value = "分析图形,关联control_graph表id") private Long controlGraphId; + @ApiModelProperty(value = "分析图形名,关联control_graph表id") + private String controlGraphName; + @ApiModelProperty(value = "是否需要spc分析,1 yes;0 no") private Integer isSpc; diff --git a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java index 294627c..0c9a642 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java @@ -1,9 +1,12 @@ package com.cnbm.basic.mapper; +import com.cnbm.basic.dto.ProductFeaturesDTO; import com.cnbm.common.dao.BaseDao; import com.cnbm.basic.entity.ProductFeatures; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 产品特性 表 * @@ -12,5 +15,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ProductFeaturesMapper extends BaseDao { - + List getProductFeaturesByProductId(Long id); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFeaturesService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFeaturesService.java index c2b8f50..b1a94f6 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFeaturesService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFeaturesService.java @@ -5,6 +5,7 @@ import com.cnbm.common.service.CrudService; import com.cnbm.basic.dto.ProductFeaturesDTO; import com.cnbm.basic.entity.ProductFeatures; +import java.util.List; import java.util.Map; /** @@ -23,4 +24,6 @@ public interface IProductFeaturesService extends CrudService getProductFeaturesByProductId(Long id); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductService.java index 9713513..771f4db 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductService.java @@ -22,6 +22,8 @@ public interface IProductService extends CrudService { void update(ProductDTO dto); + void delete(Long[] ids); + boolean changeStatus(Long id); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IUnitService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IUnitService.java index f761eee..7393605 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IUnitService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IUnitService.java @@ -26,5 +26,7 @@ public interface IUnitService extends CrudService { List list(); + void delete(Long[] ids); + boolean changeStatus(Long id); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/MeasureToolServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/MeasureToolServiceImpl.java index 733168d..7ab6096 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/MeasureToolServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/MeasureToolServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.util.Arrays; import java.util.Map; /** @@ -78,4 +79,11 @@ public class MeasureToolServiceImpl extends CrudServiceImpl getProductFeaturesByProductId(Long id){ + List list = mapper.getProductFeaturesByProductId(id); + return list; + /* + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(ObjectUtils.isNotNull(productId), "product_id", productId); + List productFeaturesList = mapper.selectList(wrapper); + + List productFeaturesDTOList = ConvertUtils.sourceToTarget(productFeaturesList,ProductFeaturesDTO.class); + for(ProductFeaturesDTO dto:productFeaturesDTOList) { + WorkingProcedure workingProcedure = workingProcedureServiceImpl.selectById(dto.getWorkingProcedureId()); + if (workingProcedure != null) { + String workingProcedureCode = workingProcedure.getCode(); + String workingProcedureName = workingProcedure.getName(); + dto.setWorkingProcedureCode(workingProcedureCode); + dto.setWorkingProcedureName(workingProcedureName); + } + + } + return productFeaturesDTOList; + */ + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductServiceImpl.java index b574734..4e1275c 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductServiceImpl.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.util.Arrays; import java.util.Map; /** @@ -104,4 +105,11 @@ public class ProductServiceImpl extends CrudServiceImpl return list; } + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml b/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml index ed55706..9a99d8d 100644 --- a/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml +++ b/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml @@ -2,4 +2,17 @@ + +