成套设备配置代码提交

This commit is contained in:
liang.chao 2024-06-26 14:49:43 +08:00
parent c04a3b4738
commit 2b20d72d13
6 changed files with 65 additions and 13 deletions

View File

@ -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<LeaseApplyDetails> list = maWholeSetService.selectListByWholeTypeName(wholeTypeName);
return AjaxResult.success(list);
}
}

View File

@ -42,6 +42,11 @@ public class LeaseApplyDetails implements Serializable {
*/
@ApiModelProperty(value = "机具Id")
private Integer maId;
/**
* 配件数量
*/
@ApiModelProperty(value = "配件数量")
private Integer partNum;
/**
* 类型名称

View File

@ -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<MaWhole> wholeList);
/**
* 根据parentId查询去重
* 根据selectByWholeTypeName查询
* @param wholeTypeName
* @return
*/
int selectByParentId(String wholeTypeName);
int selectByWholeTypeName(String wholeTypeName);
/**
* 查询整套抱杆管理
@ -78,4 +75,6 @@ public interface MaWholeSetMapper {
* @return
*/
List<TreeSelectId> selectId(@Param("typeId") List<Integer> typeId);
List<LeaseApplyDetails> selectListByWholeTypeName(String wholeTypeName);
}

View File

@ -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<LeaseApplyDetails> selectListByWholeTypeName(String wholeTypeName);
}

View File

@ -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<LeaseApplyDetails> 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);
}
}

View File

@ -50,7 +50,7 @@
where parent_id = #{id} and whole_type_name = #{wholeTypeName}
</delete>
<select id="selectByParentId" resultType="java.lang.Integer">
<select id="selectByWholeTypeName" resultType="java.lang.Integer">
select COUNT(*) from ma_whole_set
where whole_type_name = #{wholeTypeName}
</select>
@ -72,6 +72,7 @@
WHERE
mt.`status` = '0'
AND mt.del_flag = '0'
AND mws.company_id = #{companyId}
<if test="wholeTypeName != null and wholeTypeName != ''">
and mws.whole_type_name like concat('%', #{wholeTypeName}, '%')
</if>
@ -162,5 +163,28 @@
#{item}
</foreach>
</select>
<select id="selectListByWholeTypeName" resultType="com.bonus.sgzb.material.domain.LeaseApplyDetails">
SELECT
mt.unit_name unitName,
mt.type_id typeId,
mt.num,
mt.type_name typeModelName,
mt2.type_name typeName,
mws2.part_num partNum
FROM
ma_type mt
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN ma_whole_set mws2 ON mws2.type_id = mt.type_id
AND mws2.whole_type_name = #{wholeTypeName}
WHERE
mt.type_id IN (
SELECT
mws.type_id
FROM
ma_whole_set mws
WHERE
mws.whole_type_name = #{wholeTypeName})
AND mt.`status` = '0'
AND mt.del_flag = '0'
</select>
</mapper>