Commit fae8b7a3 by 李小惠

1

parent 5bef8e17
......@@ -109,15 +109,7 @@ public class CabinetController {
return ApiRes.success(allCabinetList);
}
@PostMapping("/ShowCabinetList1111")
@ApiOperation("查询单警柜列表(新)")
public ApiRes<List<CabinetDto>> showCabinetList1111(@RequestBody CabinetReq req){
List<CabinetDto> allCabinetList = cabinetService.getAllCabinetList111(req);
if (allCabinetList.size()<=0){
return ApiRes.failure("查询失败,列表为null");
}
return ApiRes.success(allCabinetList);
}
//通过单警柜id查询单个箱门及其箱门信息
@PostMapping("/ShowOneCabinet")
......
......@@ -15,7 +15,7 @@ public interface CabinetMapper extends BaseMapper<Cabinet> {
public int addCabinet(Cabinet cabinet);
public List<Cabinet> getAllCabinet();
public List<CabinetDto> getAllCabinet111();
public List<Cabinet> getAllCabinetList();
Map<String, Object> getOneCabinet(String id);
......
......@@ -54,7 +54,6 @@ public interface CabinetService extends IService<Cabinet> {
List<Cabinet> getAllCabinetList(CabinetReq req);
List<CabinetDto> getAllCabinetList111(CabinetReq req);
/**
* 通过单警柜id进行查询单个单警柜信息及其箱门信息
......
......@@ -536,35 +536,6 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
}
}
/**
* 获取单警柜列表
*通过机构id进行查询
* @param req 单警柜信息
* @param req getIncludeLowerLevel true:查询本级及下级 false:查询本级
* @return
*/
@Override
public List<CabinetDto> getAllCabinetList111(CabinetReq req) {
List<CabinetDto> cabinets = new ArrayList<>();
//如果组织机构时浙江省公安厅
if (req.getOrgId().equals("1369509498032808905") && req.getIncludeLowerLevel().equals("true")) {
cabinets = cabinetMapper.getAllCabinet111();
return cabinets;
}
//分两种情况,如果说是本级及下级(全部)所有的单警柜信息,则incluLowerLevel为true,如果是查询本级的单警柜信息则为false
if (req.getIncludeLowerLevel().equals("true") || req.getIncludeLowerLevel().equals("false")) {
List<String> allOrgId = getAllOrgId(req, req.getIncludeLowerLevel());
if (allOrgId.isEmpty()) {
//抛出组织机构不存在异常
throw new ServiceException(CabinetExceptionEnum.PUBORG_NOT_EXIST);
}
cabinets = getAllCabinetByOrg111(allOrgId);
return cabinets;
} else {
//传递的数据是否正确,不正确抛异常(只接受true、false)
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}
}
/**
* 通过单警柜id查询单个单警柜及其箱门信息
......
......@@ -155,22 +155,6 @@
#{item}
</foreach>
</select>
<select id="getAllCabinet111" resultType="com.junmp.jyzb.Dto.CabinetDto">
select
c.id,
c.cabinet_num as cabinetNum,
c.name,
o.org_id as orgId,
o.org_name as orgName,
c.location,
c.state,
c.update_time as updateTime,
c.sum as sum,
c.in_sum as inSum,
c.out_sum as outSum
from base_cabinet c
left join pub_org o on c.org_id_int =o.org_id
</select>
<select id="getAllCabinetByOrgList111" resultType="com.junmp.jyzb.Dto.CabinetDto">
select
c.id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论