下拉接口优化
This commit is contained in:
parent
720f2699ff
commit
92a114ca26
|
|
@ -41,6 +41,13 @@ public class BmAgreementInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "往来单位id")
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 往来单位
|
||||
*/
|
||||
@Excel(name = "往来单位")
|
||||
@ApiModelProperty(value = "往来单位")
|
||||
private String unitName;
|
||||
|
||||
/** 工程标段ID */
|
||||
@Excel(name = "工程标段ID")
|
||||
@ApiModelProperty(value = "工程标段ID")
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package com.bonus.material.common.controller;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
import com.bonus.material.common.service.SelectService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
|
|
@ -24,15 +24,15 @@ public class SelectController {
|
|||
private SelectService service;
|
||||
|
||||
@ApiOperation(value = "往来单位下拉选")
|
||||
@PostMapping("getUnitCbx")
|
||||
public AjaxResult getUnitData(@RequestBody SelectDto dto) {
|
||||
return service.getUnitData(dto);
|
||||
@PostMapping("getUnitList")
|
||||
public AjaxResult getUnitList(@RequestBody BmUnit bmUnit) {
|
||||
return service.getUnitList(bmUnit);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "工程下拉选")
|
||||
@PostMapping("getSectionEngineeringCbx")
|
||||
public AjaxResult getProData(@RequestBody SelectDto dto) {
|
||||
return service.getProData(dto);
|
||||
@PostMapping("getProjectList")
|
||||
public AjaxResult getProjectList(@RequestBody BmProject bmProject) {
|
||||
return service.getProjectList(bmProject);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "机具类型下拉选")
|
||||
|
|
@ -41,35 +41,35 @@ public class SelectController {
|
|||
return service.getMaTypeData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "数据字典下拉选")
|
||||
@PostMapping("getDictByPidCbx")
|
||||
public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){
|
||||
return service.getDictByPidCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单位树/归属部门/所属上级")
|
||||
@PostMapping("getDeptTree")
|
||||
public AjaxResult getDeptTree(@RequestBody SelectDto dto){
|
||||
return service.getDeptTree(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "岗位下拉选")
|
||||
@PostMapping("getPostCbx")
|
||||
public AjaxResult getPostCbx(@RequestBody SelectDto dto){
|
||||
return service.getPostCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色下拉选")
|
||||
@PostMapping("getRoleCbx")
|
||||
public AjaxResult getRoleCbx(@RequestBody SelectDto dto){
|
||||
return service.getRoleCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单位类型下拉选")
|
||||
@PostMapping("getUnitTypeCbx")
|
||||
public AjaxResult getUnitTypeCbx(@RequestBody SelectDto dto){
|
||||
return service.getUnitTypeCbx(dto);
|
||||
}
|
||||
// @ApiOperation(value = "数据字典下拉选")
|
||||
// @PostMapping("getDictByPidCbx")
|
||||
// public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){
|
||||
// return service.getDictByPidCbx(dto);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "单位树/归属部门/所属上级")
|
||||
// @PostMapping("getDeptTree")
|
||||
// public AjaxResult getDeptTree(@RequestBody SelectDto dto){
|
||||
// return service.getDeptTree(dto);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "岗位下拉选")
|
||||
// @PostMapping("getPostCbx")
|
||||
// public AjaxResult getPostCbx(@RequestBody SelectDto dto){
|
||||
// return service.getPostCbx(dto);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色下拉选")
|
||||
// @PostMapping("getRoleCbx")
|
||||
// public AjaxResult getRoleCbx(@RequestBody SelectDto dto){
|
||||
// return service.getRoleCbx(dto);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "单位类型下拉选")
|
||||
// @PostMapping("getUnitTypeCbx")
|
||||
// public AjaxResult getUnitTypeCbx(@RequestBody SelectDto dto){
|
||||
// return service.getUnitTypeCbx(dto);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "设备类型树")
|
||||
@PostMapping("getDeviceTypeTree")
|
||||
|
|
@ -89,11 +89,11 @@ public class SelectController {
|
|||
return service.getDeviceFactoryCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "工程项目")
|
||||
@PostMapping("getProCbx")
|
||||
public AjaxResult getProCbx(@RequestBody SelectDto dto){
|
||||
return service.getProCbx(dto);
|
||||
}
|
||||
// @ApiOperation(value = "工程项目")
|
||||
// @PostMapping("getProCbx")
|
||||
// public AjaxResult getProCbx(@RequestBody SelectDto dto){
|
||||
// return service.getProCbx(dto);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "配件所属上级树")
|
||||
@PostMapping("getAccessoryTree")
|
||||
|
|
@ -113,11 +113,11 @@ public class SelectController {
|
|||
return service.getGoodsShelvesCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户/维修员/库管员/采购员")
|
||||
@PostMapping("getUserByRoleIdCbx")
|
||||
public AjaxResult getUserByRoleIdCbx(@RequestBody SelectDto dto){
|
||||
return service.getUserByRoleIdCbx(dto);
|
||||
}
|
||||
// @ApiOperation(value = "用户/维修员/库管员/采购员")
|
||||
// @PostMapping("getUserByRoleIdCbx")
|
||||
// public AjaxResult getUserByRoleIdCbx(@RequestBody SelectDto dto){
|
||||
// return service.getUserByRoleIdCbx(dto);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "往来单位id和标段工程id获取协议信息")
|
||||
@PostMapping("getAgreementInfoById")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.common.mapper;
|
||||
|
||||
import com.bonus.common.biz.domain.TreeNode;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||
import com.bonus.material.common.domain.vo.SelectVo;
|
||||
|
|
@ -15,23 +17,23 @@ import java.util.List;
|
|||
public interface SelectMapper {
|
||||
/**
|
||||
* 往来单位下拉选
|
||||
* @param dto
|
||||
* @param bmUnit
|
||||
* @return List<SelectVo>
|
||||
* @description 往来单位
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 14:23
|
||||
*/
|
||||
List<SelectVo> getUnitData(SelectDto dto);
|
||||
List<BmUnit> getUnitList(BmUnit bmUnit);
|
||||
|
||||
/**
|
||||
* 工程下拉选
|
||||
* @param dto
|
||||
* @param bmProject
|
||||
* @return List<SelectVo>
|
||||
* @description 工程
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 15:05
|
||||
*/
|
||||
List<SelectVo> getProData(SelectDto dto);
|
||||
List<BmProject> getProjectList(BmProject bmProject);
|
||||
|
||||
/**
|
||||
* 机具类型下拉选
|
||||
|
|
@ -43,55 +45,6 @@ public interface SelectMapper {
|
|||
*/
|
||||
List<SelectVo> getMaTypeData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 数据字典下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 数据字典下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:23
|
||||
*/
|
||||
List<SelectVo> getDictByPidCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 单位树/归属部门/所属上级
|
||||
* @param dto
|
||||
* @return List<TreeVo>
|
||||
* @description 单位树/归属部门/所属上级
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:10
|
||||
*/
|
||||
List<TreeNode> getDeptTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 岗位下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 岗位下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:50
|
||||
*/
|
||||
List<SelectVo> getPostCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 角色下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 角色下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:56
|
||||
*/
|
||||
List<SelectVo> getRoleCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 单位类型下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 单位类型下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 18:01
|
||||
*/
|
||||
List<SelectVo> getUnitTypeCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 设备类型树
|
||||
|
|
@ -123,16 +76,6 @@ public interface SelectMapper {
|
|||
*/
|
||||
List<SelectVo> getDeviceFactoryCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 工程项目
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 工程项目
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 20:01
|
||||
*/
|
||||
List<SelectVo> getProCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 配件所属上级树
|
||||
* @param
|
||||
|
|
@ -153,25 +96,6 @@ public interface SelectMapper {
|
|||
*/
|
||||
List<TreeNode> getGoodsShelvesCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 用户/维修员/库管员/采购员-下拉选
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 用户/维修员/库管员/采购员-下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 20:54
|
||||
*/
|
||||
List<SelectVo> getUserByRoleIdCbxSelect(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 用户/维修员/库管员/采购员-树
|
||||
* @param dto
|
||||
* @return List<TreeNode>
|
||||
* @description 用户/维修员/库管员/采购员-树
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 21:02
|
||||
*/
|
||||
List<TreeNode> getUserByRoleIdCbxTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 往来单位id和标段工程id获取协议信息
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.common.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
|
||||
/**
|
||||
|
|
@ -11,23 +13,23 @@ public interface SelectService {
|
|||
|
||||
/**
|
||||
* 往来单位
|
||||
* @param dto
|
||||
* @param bmUnit
|
||||
* @return AjaxResult
|
||||
* @description 往来单位
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 14:20
|
||||
*/
|
||||
AjaxResult getUnitData(SelectDto dto);
|
||||
AjaxResult getUnitList(BmUnit bmUnit);
|
||||
|
||||
/**
|
||||
* 工程
|
||||
* @param dto
|
||||
* @param bmProject
|
||||
* @return AjaxResult
|
||||
* @description 工程
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 15:04
|
||||
*/
|
||||
AjaxResult getProData(SelectDto dto);
|
||||
AjaxResult getProjectList(BmProject bmProject);
|
||||
|
||||
/**
|
||||
* 机具类型
|
||||
|
|
@ -47,7 +49,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 16:22
|
||||
*/
|
||||
AjaxResult getDictByPidCbx(SelectDto dto);
|
||||
// AjaxResult getDictByPidCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 单位树/归属部门/所属上级
|
||||
|
|
@ -57,7 +59,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 16:36
|
||||
*/
|
||||
AjaxResult getDeptTree(SelectDto dto);
|
||||
// AjaxResult getDeptTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 岗位下拉树
|
||||
|
|
@ -67,7 +69,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 17:45
|
||||
*/
|
||||
AjaxResult getPostCbx(SelectDto dto);
|
||||
// AjaxResult getPostCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 角色下拉选
|
||||
|
|
@ -77,7 +79,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 17:56
|
||||
*/
|
||||
AjaxResult getRoleCbx(SelectDto dto);
|
||||
// AjaxResult getRoleCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 单位类型下拉选
|
||||
|
|
@ -87,7 +89,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 18:00
|
||||
*/
|
||||
AjaxResult getUnitTypeCbx(SelectDto dto);
|
||||
// AjaxResult getUnitTypeCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 设备类型树
|
||||
|
|
@ -127,7 +129,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 20:01
|
||||
*/
|
||||
AjaxResult getProCbx(SelectDto dto);
|
||||
// AjaxResult getProCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 配件所属上级树
|
||||
|
|
@ -157,7 +159,7 @@ public interface SelectService {
|
|||
* @author cwchen
|
||||
* @date 2023/12/20 20:48
|
||||
*/
|
||||
AjaxResult getUserByRoleIdCbx(SelectDto dto);
|
||||
// AjaxResult getUserByRoleIdCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 往来单位id和标段工程id获取协议信息
|
||||
|
|
@ -175,4 +177,5 @@ public interface SelectService {
|
|||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult getPartTree(SelectDto dto);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.bonus.common.biz.constant.GlobalConstants;
|
|||
import com.bonus.common.biz.domain.TreeBuild;
|
||||
import com.bonus.common.biz.domain.TreeNode;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||
import com.bonus.material.common.domain.vo.SelectVo;
|
||||
|
|
@ -29,10 +31,10 @@ public class SelectServiceImpl implements SelectService {
|
|||
private SelectMapper mapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult getUnitData(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
public AjaxResult getUnitList(BmUnit bmUnit) {
|
||||
List<BmUnit> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getUnitData(dto);
|
||||
list = mapper.getUnitList(bmUnit);
|
||||
} catch (Exception e) {
|
||||
log.error("往来单位-查询失败", e);
|
||||
}
|
||||
|
|
@ -40,9 +42,9 @@ public class SelectServiceImpl implements SelectService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getProData(SelectDto dto) {
|
||||
public AjaxResult getProjectList(BmProject bmProject) {
|
||||
try {
|
||||
List<SelectVo> list = mapper.getProData(dto);
|
||||
List<BmProject> list = mapper.getProjectList(bmProject);
|
||||
list.removeIf(item -> item == null);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -62,67 +64,67 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDictByPidCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDictByPidCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("数据字典-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDeptTree(SelectDto dto) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
List<TreeNode> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDeptTree(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(list);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("单位树/归属部门/所属上级-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getPostCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getPostCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("岗位下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getRoleCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getRoleCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("角色下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getUnitTypeCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getUnitTypeCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("单位类型下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
// @Override
|
||||
// public AjaxResult getDictByPidCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getDictByPidCbx(dto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("数据字典-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(list);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AjaxResult getDeptTree(SelectDto dto) {
|
||||
// List<TreeNode> groupList = new ArrayList<>();
|
||||
// List<TreeNode> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getDeptTree(dto);
|
||||
// if (CollectionUtils.isNotEmpty(list)) {
|
||||
// // 创建树形结构(数据集合作为参数)
|
||||
// TreeBuild treeBuild = new TreeBuild(list);
|
||||
// // 原查询结果转换树形结构
|
||||
// groupList = treeBuild.buildTree();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("单位树/归属部门/所属上级-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(groupList);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AjaxResult getPostCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getPostCbx(dto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("岗位下拉选-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(list);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AjaxResult getRoleCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getRoleCbx(dto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("角色下拉选-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(list);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AjaxResult getUnitTypeCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getUnitTypeCbx(dto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("单位类型下拉选-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(list);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public AjaxResult getDeviceTypeTree(SelectDto dto) {
|
||||
|
|
@ -164,16 +166,16 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getProCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getProCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工程项目-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
// @Override
|
||||
// public AjaxResult getProCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// try {
|
||||
// list = mapper.getProCbx(dto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("工程项目-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(list);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public AjaxResult getAccessoryTree() {
|
||||
|
|
@ -229,32 +231,32 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getUserByRoleIdCbx(SelectDto dto) {
|
||||
try {
|
||||
if (Objects.equals(GlobalConstants.STRING_1, dto.getType())) {
|
||||
// 用户/维修员/库管员/采购员-下拉选
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
list = mapper.getUserByRoleIdCbxSelect(dto);
|
||||
return AjaxResult.success(list);
|
||||
} else if (Objects.equals(GlobalConstants.STRING_2, dto.getType())) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
List<TreeNode> list = new ArrayList<>();
|
||||
// 用户/维修员/库管员/采购员-树
|
||||
list = mapper.getUserByRoleIdCbxTree(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(list);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
}
|
||||
return AjaxResult.success(groupList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("用户/维修员/库管员/采购员-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(null);
|
||||
}
|
||||
// @Override
|
||||
// public AjaxResult getUserByRoleIdCbx(SelectDto dto) {
|
||||
// try {
|
||||
// if (Objects.equals(GlobalConstants.STRING_1, dto.getType())) {
|
||||
// // 用户/维修员/库管员/采购员-下拉选
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
// list = mapper.getUserByRoleIdCbxSelect(dto);
|
||||
// return AjaxResult.success(list);
|
||||
// } else if (Objects.equals(GlobalConstants.STRING_2, dto.getType())) {
|
||||
// List<TreeNode> groupList = new ArrayList<>();
|
||||
// List<TreeNode> list = new ArrayList<>();
|
||||
// // 用户/维修员/库管员/采购员-树
|
||||
// list = mapper.getUserByRoleIdCbxTree(dto);
|
||||
// if (CollectionUtils.isNotEmpty(list)) {
|
||||
// // 创建树形结构(数据集合作为参数)
|
||||
// TreeBuild treeBuild = new TreeBuild(list);
|
||||
// // 原查询结果转换树形结构
|
||||
// groupList = treeBuild.buildTree();
|
||||
// }
|
||||
// return AjaxResult.success(groupList);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("用户/维修员/库管员/采购员-查询失败", e);
|
||||
// }
|
||||
// return AjaxResult.success(null);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public AjaxResult getAgreementInfoById(SelectDto dto) {
|
||||
|
|
@ -270,5 +272,4 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,40 +3,39 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.common.mapper.SelectMapper">
|
||||
|
||||
<!--往来单位-->
|
||||
<select id="getUnitData" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
<select id="getUnitList" resultType="com.bonus.material.basic.domain.BmUnit">
|
||||
/*根据标段工程id关联协议查询往来单位*/
|
||||
<if test="id != null and id != ''">
|
||||
SELECT DISTINCT bu.unit_id AS id,
|
||||
bu.unit_name AS `name`
|
||||
SELECT DISTINCT bu.unit_id AS unitId,
|
||||
bu.unit_name AS unitName
|
||||
FROM bm_project bpl
|
||||
LEFT JOIN bm_agreement_info bai ON bpl.pro_id = bai.project_id AND bai.`status` = '1'
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id AND bu.del_flag = '0'
|
||||
WHERE bpl.lot_id = #{id} AND bpl.del_flag = '0'
|
||||
WHERE bpl.pro_id = #{id} AND bpl.del_flag = '0'
|
||||
</if>
|
||||
<if test="id == null or id == ''">
|
||||
SELECT unit_id AS id,
|
||||
unit_name AS `name`
|
||||
SELECT unit_id AS unitId,
|
||||
unit_name AS unitName
|
||||
FROM bm_unit
|
||||
WHERE del_flag = '0'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--标段工程-->
|
||||
<select id="getProData" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
<select id="getProjectList" resultType="com.bonus.material.basic.domain.BmProject">
|
||||
/*根据往来单位id关联协议查询工程*/
|
||||
<if test="id != null and id != ''">
|
||||
SELECT DISTINCT bpl.lot_id AS id,
|
||||
bpl.lot_name AS `name`
|
||||
SELECT DISTINCT bp.pro_id AS projectId,
|
||||
bp.lot_name AS projectName
|
||||
FROM bm_unit bu
|
||||
LEFT JOIN bm_agreement_info bai ON bui.unit_id = bai.unit_id AND bai.`status` = '1'
|
||||
LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id AND bpl.del_flag = '0'
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id AND bp.del_flag = '0'
|
||||
WHERE bu.unit_id = #{id} AND bu.del_flag = '0'
|
||||
</if>
|
||||
<if test="id == null or id == ''">
|
||||
SELECT lot_id AS id,
|
||||
lot_name AS `name`
|
||||
SELECT lot_id AS projectId,
|
||||
lot_name AS projectName
|
||||
FROM bm_project
|
||||
WHERE del_flag = '0'
|
||||
</if>
|
||||
|
|
@ -49,45 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM ma_type
|
||||
WHERE `level` = #{type} AND del_flag = '0'
|
||||
</select>
|
||||
<!--数据字典下拉选-->
|
||||
<select id="getDictByPidCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT sd2.id,sd2.`name`
|
||||
FROM sys_dic sd
|
||||
LEFT JOIN sys_dic sd2 ON sd.id = sd2.p_id
|
||||
WHERE sd.`value` = #{parentValue} AND sd.p_id = 0
|
||||
</select>
|
||||
<!--单位树/归属部门/所属上级-->
|
||||
<select id="getDeptTree" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT dept_id AS id,
|
||||
parent_id AS parentId,
|
||||
dept_name AS label
|
||||
FROM sys_dept
|
||||
WHERE del_flag = '0'
|
||||
ORDER BY order_num
|
||||
</select>
|
||||
<!--岗位下拉选-->
|
||||
<select id="getPostCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT post_id AS id,
|
||||
post_name AS `name`
|
||||
FROM sys_post
|
||||
WHERE status = '0'
|
||||
ORDER BY post_sort
|
||||
</select>
|
||||
<!--角色下拉选-->
|
||||
<select id="getRoleCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT role_id AS id,
|
||||
role_name AS `name`
|
||||
FROM sys_role
|
||||
WHERE status = '0'
|
||||
ORDER BY role_sort
|
||||
</select>
|
||||
<!--单位类型下拉选-->
|
||||
<select id="getUnitTypeCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT sd2.id,sd2.`name`
|
||||
FROM sys_dic sd
|
||||
LEFT JOIN sys_dic sd2 ON sd.id = sd2.p_id
|
||||
WHERE sd.`value` = #{parentValue} AND sd.p_id = 0
|
||||
</select>
|
||||
|
||||
<!--设备类型树-->
|
||||
<select id="getDeviceTypeTree" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT mt.type_id AS id,
|
||||
|
|
@ -125,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--资产属性-->
|
||||
<select id="getAssetAttributesCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT prop_id AS id,
|
||||
|
|
@ -133,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE del_flag = '0'
|
||||
ORDER BY create_time
|
||||
</select>
|
||||
|
||||
<!--机具厂家-->
|
||||
<select id="getDeviceFactoryCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT supplier_id AS id,
|
||||
|
|
@ -141,14 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE del_flag = '0'
|
||||
ORDER BY create_time
|
||||
</select>
|
||||
<!--工程项目-->
|
||||
<select id="getProCbx" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT pro_id AS id,
|
||||
pro_name AS `name`
|
||||
FROM bm_project
|
||||
WHERE del_flag = '0' AND status = '0'
|
||||
ORDER BY create_time
|
||||
</select>
|
||||
|
||||
<!--配件所属上级树-->
|
||||
<select id="getAccessoryTree" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT pa_id AS id,
|
||||
|
|
@ -170,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE del_flag = '0' and level != '3'
|
||||
ORDER BY create_time
|
||||
</select>
|
||||
|
||||
<!--货架-->
|
||||
<select id="getGoodsShelvesCbx" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT house_id AS id,
|
||||
|
|
@ -178,31 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM ma_house_info
|
||||
WHERE del_flag = '0' AND status = '0'
|
||||
</select>
|
||||
<!--用户/维修员/库管员/采购员-下拉选-->
|
||||
<select id="getUserByRoleIdCbxSelect" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT su.user_id AS id,
|
||||
su.nick_name AS `name`
|
||||
FROM sys_role sr
|
||||
LEFT JOIN sys_user_role sur ON sr.role_id = sur.role_id
|
||||
LEFT JOIN sys_user su ON sur.user_id = su.user_id AND su.del_flag = '0'
|
||||
WHERE sr.role_key = #{roleKey} AND sr.del_flag = '0'
|
||||
</select>
|
||||
<!--用户/维修员/库管员/采购员-树-->
|
||||
<select id="getUserByRoleIdCbxTree" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT dept_id AS id,
|
||||
parent_id AS parentId,
|
||||
dept_name AS label
|
||||
FROM sys_dept
|
||||
WHERE del_flag = '0'
|
||||
UNION ALL
|
||||
SELECT su.user_id AS id,
|
||||
su.dept_id AS parentId,
|
||||
su.nick_name AS label
|
||||
FROM sys_role sr
|
||||
LEFT JOIN sys_user_role sur ON sr.role_id = sur.role_id
|
||||
LEFT JOIN sys_user su ON sur.user_id = su.user_id AND su.del_flag = '0'
|
||||
WHERE sr.role_key = #{roleKey} AND sr.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!--往来单位id和标段工程id获取协议信息-->
|
||||
<select id="getAgreementInfoById" resultType="com.bonus.material.common.domain.vo.AgreementVo">
|
||||
SELECT agreement_id AS agreementId,
|
||||
|
|
@ -211,5 +144,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM bm_agreement_info
|
||||
WHERE unit_id = #{unitId} AND project_id = #{projectId} AND status = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue