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 308dc78..7d8f2a1 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 @@ -166,4 +166,10 @@ public class ProductFeaturesController { return productFeaturesService.list(); } + @PostMapping("getProductFeaturesByType") + @ApiOperation("根据特性类型 获取特性列表 计量型1 计数型2") + public List getProductFeaturesByType(Integer type){ + return productFeaturesService.getProductFeaturesByType(type); + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureController.java index 1bc8961..ad729d9 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureController.java @@ -3,6 +3,8 @@ package com.cnbm.basic.controller; import com.cnbm.admin.annotation.LogOperation; import com.cnbm.admin.params.IdParam; import com.cnbm.basic.dto.UnitDTO; +import com.cnbm.basic.dto.WorkingProcedureTypeDTO; +import com.cnbm.basic.entity.WorkingProcedure; import com.cnbm.common.constant.Constant; import com.cnbm.common.page.PageData; import com.cnbm.common.utils.ExcelUtils; @@ -141,4 +143,15 @@ public class WorkingProcedureController { return workingProcedureService.list(); } + @PostMapping(value = "listByType/{typeId}") + @ApiOperation(value = "根据工序类型 获取工序列表") + public List listByType(@PathVariable("typeId") Long typeId) { + return workingProcedureService.listByType(typeId); + } + + @PostMapping(value = "listWithType") + @ApiOperation(value = "工序类型及对应工序列表") + public List listWithType () { + return workingProcedureService.listWithType(); + } } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/dto/WorkingProcedureTypeDTO.java b/ym-baisc/src/main/java/com/cnbm/basic/dto/WorkingProcedureTypeDTO.java index 243313a..2c82c9e 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/dto/WorkingProcedureTypeDTO.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/dto/WorkingProcedureTypeDTO.java @@ -1,11 +1,13 @@ package com.cnbm.basic.dto; +import com.cnbm.basic.entity.WorkingProcedure; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.List; /** * 工序类型表 表 @@ -59,4 +61,7 @@ public class WorkingProcedureTypeDTO implements Serializable { @ApiModelProperty(value = "版本号") private Integer version; + @ApiModelProperty(value = "工序列表") + private List workingProcedureList; + } \ No newline at end of file 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 975bbc2..9a462df 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 @@ -27,4 +27,6 @@ public interface ProductFeaturesMapper extends BaseDao { String getControlGraphNameById(Long id); List list(); + + List getProductFeaturesByType(Integer type); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/mapper/WorkingProcedureTypeMapper.java b/ym-baisc/src/main/java/com/cnbm/basic/mapper/WorkingProcedureTypeMapper.java index ccb9f63..ea2aa58 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/mapper/WorkingProcedureTypeMapper.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/mapper/WorkingProcedureTypeMapper.java @@ -1,9 +1,13 @@ package com.cnbm.basic.mapper; +import com.cnbm.basic.dto.WorkingProcedureDTO; +import com.cnbm.basic.dto.WorkingProcedureTypeDTO; import com.cnbm.common.dao.BaseDao; import com.cnbm.basic.entity.WorkingProcedureType; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 工序类型表 表 * @@ -12,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface WorkingProcedureTypeMapper extends BaseDao { - + + List list(); } \ 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 4cdeaea..956dbe2 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 @@ -36,5 +36,7 @@ public interface IProductFeaturesService extends CrudService getFeaturesList(Map params); - List list();; + List list(); + + List getProductFeaturesByType(Integer type); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IWorkingProcedureService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IWorkingProcedureService.java index 794dd35..a714ba1 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IWorkingProcedureService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IWorkingProcedureService.java @@ -1,5 +1,6 @@ package com.cnbm.basic.service; +import com.cnbm.basic.dto.WorkingProcedureTypeDTO; import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; import com.cnbm.basic.dto.WorkingProcedureDTO; @@ -30,4 +31,8 @@ public interface IWorkingProcedureService extends CrudService getWorkingProcedureByProductId(Long productId); List list(); + + List listByType(Long typeId); + + List listWithType(); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFeaturesServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFeaturesServiceImpl.java index 491d5dc..8e71884 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFeaturesServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFeaturesServiceImpl.java @@ -163,4 +163,11 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl getProductFeaturesByType(Integer type) { + List listByType = mapper.getProductFeaturesByType(type); + return listByType; + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java index 63b5d78..07008f9 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java @@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.cnbm.basic.dto.UnitDTO; +import com.cnbm.basic.dto.WorkingProcedureTypeDTO; import com.cnbm.basic.entity.Machine; import com.cnbm.basic.entity.ProductWorkingprocedureRelation; import com.cnbm.basic.entity.WorkingProcedureType; import com.cnbm.basic.mapper.ProductWorkingprocedureRelationMapper; import com.cnbm.basic.mapper.UnitMapper; +import com.cnbm.basic.mapper.WorkingProcedureTypeMapper; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.basic.dto.WorkingProcedureDTO; @@ -153,11 +155,36 @@ public class WorkingProcedureServiceImpl extends CrudServiceImpl list() { List list = workingProcedureMapper.list(); + return list; } + @Override + @Transactional(rollbackFor = Exception.class) + public List listByType(Long typeId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(ObjectUtils.isNotNull(typeId), "working_procedure_type_id", typeId); + List listOfType = workingProcedureMapper.selectList(wrapper); + + return listOfType; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public List listWithType () { + List workingProcedureTypeDTOList = workingProcedureTypeMapper.list(); + for(WorkingProcedureTypeDTO workingProcedureTypeDTO: workingProcedureTypeDTOList){ + List workingProcedureList = listByType(workingProcedureTypeDTO.getId()); + if(workingProcedureList!=null & workingProcedureList.size() > 0) + workingProcedureTypeDTO.setWorkingProcedureList(workingProcedureList); + } + return workingProcedureTypeDTOList; + } } \ 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 023a079..92836f7 100644 --- a/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml +++ b/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml @@ -79,4 +79,12 @@ order by id asc + + diff --git a/ym-baisc/src/main/resources/mapper/WorkingProcedureMapper.xml b/ym-baisc/src/main/resources/mapper/WorkingProcedureMapper.xml index 306b194..162e2c8 100644 --- a/ym-baisc/src/main/resources/mapper/WorkingProcedureMapper.xml +++ b/ym-baisc/src/main/resources/mapper/WorkingProcedureMapper.xml @@ -3,8 +3,9 @@ diff --git a/ym-baisc/src/main/resources/mapper/WorkingProcedureTypeMapper.xml b/ym-baisc/src/main/resources/mapper/WorkingProcedureTypeMapper.xml new file mode 100644 index 0000000..b7489ac --- /dev/null +++ b/ym-baisc/src/main/resources/mapper/WorkingProcedureTypeMapper.xml @@ -0,0 +1,10 @@ + + + + + + +