diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java index 067f7035..0d578df5 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/MaWholeSetController.java @@ -4,6 +4,7 @@ import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.material.config.PageResultVo; +import com.bonus.sgzb.material.domain.LeaseApplyDetails; import com.bonus.sgzb.material.domain.MaWholeSetDto; import com.bonus.sgzb.material.domain.MaWholeTreeVo; import com.bonus.sgzb.material.domain.MaWholeVo; @@ -96,4 +97,18 @@ public class MaWholeSetController extends BaseController { log.info("根据id删除整套抱杆:{}", dto); return maWholeSetService.deleteById(dto); } + + + /** + * 查询整套抱杆明细 + * @param wholeTypeName + * @return + */ + @ApiOperation("领料申请查询成套抱杆设备") + @GetMapping("/selectListByWholeTypeName") + public AjaxResult selectListByWholeTypeName(String wholeTypeName) { + List list = maWholeSetService.selectListByWholeTypeName(wholeTypeName); + return AjaxResult.success(list); + } + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseApplyDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseApplyDetails.java index be73efdb..a8f52404 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseApplyDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseApplyDetails.java @@ -42,6 +42,11 @@ public class LeaseApplyDetails implements Serializable { */ @ApiModelProperty(value = "机具Id") private Integer maId; + /** + * 配件数量 + */ + @ApiModelProperty(value = "配件数量") + private Integer partNum; /** * 类型名称 diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java index 9bda1734..41ec8d81 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/MaWholeSetMapper.java @@ -1,10 +1,7 @@ package com.bonus.sgzb.material.mapper; import com.bonus.sgzb.base.api.domain.MaType; -import com.bonus.sgzb.material.domain.MaWhole; -import com.bonus.sgzb.material.domain.MaWholeSetDto; -import com.bonus.sgzb.material.domain.MaWholeVo; -import com.bonus.sgzb.material.domain.TreeSelectId; +import com.bonus.sgzb.material.domain.*; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -24,11 +21,11 @@ public interface MaWholeSetMapper { int insert(@Param("wholeList") List wholeList); /** - * 根据parentId查询,去重 + * 根据selectByWholeTypeName查询 * @param wholeTypeName * @return */ - int selectByParentId(String wholeTypeName); + int selectByWholeTypeName(String wholeTypeName); /** * 查询整套抱杆管理 @@ -78,4 +75,6 @@ public interface MaWholeSetMapper { * @return */ List selectId(@Param("typeId") List typeId); + + List selectListByWholeTypeName(String wholeTypeName); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java index 390eb7bc..6fb8ecf1 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/MaWholeSetService.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.material.service; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.config.PageResultVo; +import com.bonus.sgzb.material.domain.LeaseApplyDetails; import com.bonus.sgzb.material.domain.MaWholeSetDto; import com.bonus.sgzb.material.domain.MaWholeTreeVo; import com.bonus.sgzb.material.domain.MaWholeVo; @@ -56,4 +57,6 @@ public interface MaWholeSetService { * @return */ MaWholeTreeVo selectListTree(Integer id); + + List selectListByWholeTypeName(String wholeTypeName); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java index 8da52fc2..bb9f25c8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/MaWholeSetServiceImpl.java @@ -42,7 +42,8 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { return AjaxResult.error("参数不能为空!!!"); } - if (selectByParentId(dto.getWholeTypeName()) > 0) { + //先查询是否有重复的配套名称 + if (selectByWholeTypeName(dto.getWholeTypeName()) > 0) { return AjaxResult.error("成套名称已存在"); } @@ -156,7 +157,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { log.error("insertMaWholeSet方法插入异常"); throw new RuntimeException("insertMaWholeSet方法插入异常"); } - /* int count = selectByParentId(dto.getWholeTypeName()); + /* int count = selectByWholeTypeName(dto.getWholeTypeName()); if (count > 1) { throw new RuntimeException("配套名称已重复,请重新输入"); }*/ @@ -192,6 +193,11 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { return treeVo; } + @Override + public List selectListByWholeTypeName(String wholeTypeName) { + return mapper.selectListByWholeTypeName(wholeTypeName); + } + /** * 方法提取,新增ma_whole_set表 * @@ -203,12 +209,12 @@ public class MaWholeSetServiceImpl implements MaWholeSetService { } /** - * 根据parentId查询,去重 + * 根据WholeTypeName查询 * * @param wholeTypeName * @return */ - private int selectByParentId(String wholeTypeName) { - return mapper.selectByParentId(wholeTypeName); + private int selectByWholeTypeName(String wholeTypeName) { + return mapper.selectByWholeTypeName(wholeTypeName); } } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml index 4cfc0869..74fe9e22 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml @@ -50,7 +50,7 @@ where parent_id = #{id} and whole_type_name = #{wholeTypeName} - select COUNT(*) from ma_whole_set where whole_type_name = #{wholeTypeName} @@ -72,6 +72,7 @@ WHERE mt.`status` = '0' AND mt.del_flag = '0' + AND mws.company_id = #{companyId} and mws.whole_type_name like concat('%', #{wholeTypeName}, '%') @@ -162,5 +163,28 @@ #{item} - + \ No newline at end of file