物资类型优化
This commit is contained in:
parent
c58e9be3dd
commit
3cbe0af7d3
|
|
@ -16,6 +16,7 @@ import com.bonus.material.ma.domain.vo.MaTypeSelectVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
|
@ -68,12 +69,15 @@ public class TypeController extends BaseController {
|
||||||
@GetMapping("/getListByMaType")
|
@GetMapping("/getListByMaType")
|
||||||
public AjaxResult getListByMaType(MaTypeVo maTypeVo) {
|
public AjaxResult getListByMaType(MaTypeVo maTypeVo) {
|
||||||
List<Integer> parentIds = typeService.selectParentId(maTypeVo);
|
List<Integer> parentIds = typeService.selectParentId(maTypeVo);
|
||||||
|
if (CollectionUtils.isEmpty(parentIds)) {
|
||||||
|
return AjaxResult.success(new ArrayList<>());
|
||||||
|
}
|
||||||
List<MaTypeVo> maTypeVos = new ArrayList<>();
|
List<MaTypeVo> maTypeVos = new ArrayList<>();
|
||||||
|
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||||
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||||
for (Integer parentId : parentIds) {
|
for (Integer parentId : parentIds) {
|
||||||
maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo));
|
maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo));
|
||||||
}
|
}
|
||||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
|
||||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
|
||||||
if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) {
|
if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) {
|
||||||
List<MaTypeVo> newMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos);
|
List<MaTypeVo> newMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos);
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, newMaTypeVos));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, newMaTypeVos));
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
|
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
|
||||||
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
|
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
|
||||||
|
LEFT JOIN wh_house_set mhs on mt4.type_id = mhs.type_id
|
||||||
<where>
|
<where>
|
||||||
<if test="level == 1">
|
<if test="level == 1">
|
||||||
and mt4.type_id = #{typeId}
|
and mt4.type_id = #{typeId}
|
||||||
|
|
@ -152,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and mt.level = 4
|
and mt.level = 4
|
||||||
</if>
|
</if>
|
||||||
and mt2.type_id is not null
|
and mt2.type_id is not null
|
||||||
|
and mhs.house_id = #{houseId} and mhs.del_flag = 0
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue