成套设备配置代码提交
This commit is contained in:
parent
c04a3b4738
commit
2b20d72d13
|
|
@ -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.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.sgzb.material.config.PageResultVo;
|
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.MaWholeSetDto;
|
||||||
import com.bonus.sgzb.material.domain.MaWholeTreeVo;
|
import com.bonus.sgzb.material.domain.MaWholeTreeVo;
|
||||||
import com.bonus.sgzb.material.domain.MaWholeVo;
|
import com.bonus.sgzb.material.domain.MaWholeVo;
|
||||||
|
|
@ -96,4 +97,18 @@ public class MaWholeSetController extends BaseController {
|
||||||
log.info("根据id删除整套抱杆:{}", dto);
|
log.info("根据id删除整套抱杆:{}", dto);
|
||||||
return maWholeSetService.deleteById(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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,11 @@ public class LeaseApplyDetails implements Serializable {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "机具Id")
|
@ApiModelProperty(value = "机具Id")
|
||||||
private Integer maId;
|
private Integer maId;
|
||||||
|
/**
|
||||||
|
* 配件数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "配件数量")
|
||||||
|
private Integer partNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型名称
|
* 类型名称
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
package com.bonus.sgzb.material.mapper;
|
package com.bonus.sgzb.material.mapper;
|
||||||
|
|
||||||
import com.bonus.sgzb.base.api.domain.MaType;
|
import com.bonus.sgzb.base.api.domain.MaType;
|
||||||
import com.bonus.sgzb.material.domain.MaWhole;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.domain.MaWholeSetDto;
|
|
||||||
import com.bonus.sgzb.material.domain.MaWholeVo;
|
|
||||||
import com.bonus.sgzb.material.domain.TreeSelectId;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -24,11 +21,11 @@ public interface MaWholeSetMapper {
|
||||||
int insert(@Param("wholeList") List<MaWhole> wholeList);
|
int insert(@Param("wholeList") List<MaWhole> wholeList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据parentId查询,去重
|
* 根据selectByWholeTypeName查询
|
||||||
* @param wholeTypeName
|
* @param wholeTypeName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int selectByParentId(String wholeTypeName);
|
int selectByWholeTypeName(String wholeTypeName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询整套抱杆管理
|
* 查询整套抱杆管理
|
||||||
|
|
@ -78,4 +75,6 @@ public interface MaWholeSetMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<TreeSelectId> selectId(@Param("typeId") List<Integer> typeId);
|
List<TreeSelectId> selectId(@Param("typeId") List<Integer> typeId);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> selectListByWholeTypeName(String wholeTypeName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.material.config.PageResultVo;
|
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.MaWholeSetDto;
|
||||||
import com.bonus.sgzb.material.domain.MaWholeTreeVo;
|
import com.bonus.sgzb.material.domain.MaWholeTreeVo;
|
||||||
import com.bonus.sgzb.material.domain.MaWholeVo;
|
import com.bonus.sgzb.material.domain.MaWholeVo;
|
||||||
|
|
@ -56,4 +57,6 @@ public interface MaWholeSetService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
MaWholeTreeVo selectListTree(Integer id);
|
MaWholeTreeVo selectListTree(Integer id);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> selectListByWholeTypeName(String wholeTypeName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
||||||
return AjaxResult.error("参数不能为空!!!");
|
return AjaxResult.error("参数不能为空!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectByParentId(dto.getWholeTypeName()) > 0) {
|
//先查询是否有重复的配套名称
|
||||||
|
if (selectByWholeTypeName(dto.getWholeTypeName()) > 0) {
|
||||||
return AjaxResult.error("成套名称已存在");
|
return AjaxResult.error("成套名称已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +157,7 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
||||||
log.error("insertMaWholeSet方法插入异常");
|
log.error("insertMaWholeSet方法插入异常");
|
||||||
throw new RuntimeException("insertMaWholeSet方法插入异常");
|
throw new RuntimeException("insertMaWholeSet方法插入异常");
|
||||||
}
|
}
|
||||||
/* int count = selectByParentId(dto.getWholeTypeName());
|
/* int count = selectByWholeTypeName(dto.getWholeTypeName());
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
throw new RuntimeException("配套名称已重复,请重新输入");
|
throw new RuntimeException("配套名称已重复,请重新输入");
|
||||||
}*/
|
}*/
|
||||||
|
|
@ -192,6 +193,11 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
||||||
return treeVo;
|
return treeVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaseApplyDetails> selectListByWholeTypeName(String wholeTypeName) {
|
||||||
|
return mapper.selectListByWholeTypeName(wholeTypeName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 方法提取,新增ma_whole_set表
|
* 方法提取,新增ma_whole_set表
|
||||||
*
|
*
|
||||||
|
|
@ -203,12 +209,12 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据parentId查询,去重
|
* 根据WholeTypeName查询
|
||||||
*
|
*
|
||||||
* @param wholeTypeName
|
* @param wholeTypeName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int selectByParentId(String wholeTypeName) {
|
private int selectByWholeTypeName(String wholeTypeName) {
|
||||||
return mapper.selectByParentId(wholeTypeName);
|
return mapper.selectByWholeTypeName(wholeTypeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
where parent_id = #{id} and whole_type_name = #{wholeTypeName}
|
where parent_id = #{id} and whole_type_name = #{wholeTypeName}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectByParentId" resultType="java.lang.Integer">
|
<select id="selectByWholeTypeName" resultType="java.lang.Integer">
|
||||||
select COUNT(*) from ma_whole_set
|
select COUNT(*) from ma_whole_set
|
||||||
where whole_type_name = #{wholeTypeName}
|
where whole_type_name = #{wholeTypeName}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
WHERE
|
WHERE
|
||||||
mt.`status` = '0'
|
mt.`status` = '0'
|
||||||
AND mt.del_flag = '0'
|
AND mt.del_flag = '0'
|
||||||
|
AND mws.company_id = #{companyId}
|
||||||
<if test="wholeTypeName != null and wholeTypeName != ''">
|
<if test="wholeTypeName != null and wholeTypeName != ''">
|
||||||
and mws.whole_type_name like concat('%', #{wholeTypeName}, '%')
|
and mws.whole_type_name like concat('%', #{wholeTypeName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -162,5 +163,28 @@
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
Loading…
Reference in New Issue