Commit 914f75fe authored by chenzhao's avatar chenzhao

部门关联本单位下建筑需求

parent 4cd1546f
......@@ -150,7 +150,7 @@ public interface JcsFeign {
/**
* 获取机场人员
* 查询指定部门的上级单位
*
* @return
*/
......@@ -193,5 +193,4 @@ public interface JcsFeign {
*/
@GetMapping(value = "/org-person/getUser/{id}")
FeignClientResult selectById(@PathVariable String id);
}
......@@ -20,6 +20,9 @@ public interface IWarehouseStructureService extends IService<WarehouseStructure>
List<WarehouseStructure> gettree(Long warehouseId, String bizOrgCode, String buildingId);
//如果是部门向上查询本单位下建筑
List<WarehouseStructure> gettreeToPrent(Long warehouseId, String bizOrgCode);
WarehouseStructure updateOneById(WarehouseStructure warehouseStructure);
boolean removeOneById(Long id) throws Exception;
......
......@@ -7,7 +7,9 @@ import java.util.List;
import java.util.Map;
import com.google.common.base.Joiner;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.FormInstance;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.FormInstanceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -22,6 +24,7 @@ import com.yeejoin.equipmanage.service.IStockDetailService;
import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* 货架结构 服务实现类
......@@ -43,6 +46,9 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
FormInstanceMapper formInstanceMapper;
@Autowired
JcsFeign jcsFeign;
@Autowired
private WarehouseStructureMapper warehouseStructureMapper;
@Override
......@@ -73,10 +79,9 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
@Override
public List<WarehouseStructure> gettree(Long warehouseId, String bizOrgCode, String buildingId) {
List<WarehouseStructure> list = new ArrayList<>();
if (!StringUtils.isEmpty(buildingId)){
if (!StringUtils.isEmpty(buildingId)){ //buildId如果不为空,则为巡检点业务所调用入口
Map<String, String> map = formInstanceMapper.getChildListdate(Long.parseLong(buildingId));
List<String> strings = new ArrayList<>();
if(map.get("ids")!=null && !map.get("ids").equals("")){
String ids = map.get("ids");
QueryWrapper<WarehouseStructure> one = new QueryWrapper<>();
......@@ -98,8 +103,6 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
one1.eq("warehouse_id", warehouseId);
one1.eq("id", buildingId);
list.addAll( warehouseStructureMapper.selectList(one1));
}else {
QueryWrapper<WarehouseStructure> one = new QueryWrapper<>();
one.eq("warehouse_id", warehouseId);
......@@ -111,6 +114,26 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
return list;
}
//如果是部门向上查询本单位下建筑
@Override
public List<WarehouseStructure> gettreeToPrent(Long warehouseId, String bizOrgCode) {
ResponseModel<OrgUsrDto> orgusr = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
if (orgusr != null ){
bizOrgCode = orgusr.getResult().getBizOrgCode();
}
List<WarehouseStructure> list = new ArrayList<>();
QueryWrapper<WarehouseStructure> one = new QueryWrapper<>();
one.eq("warehouse_id", warehouseId);
one.likeRight("biz_org_code", bizOrgCode);
list = warehouseStructureMapper.selectList(one);
list = buildByRecursive(list, warehouseId);
return list;
}
/**
* 生成code
*
......
......@@ -100,9 +100,8 @@ public class MsgController extends AbstractBaseController {
try {
ReginParams reginParams = getSelectedOrgInfo();
param.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
if (commonPageable != null) {
param.setPageNumber(commonPageable.getPageNumber());
if (commonPageable != null && commonPageable.getPageNumber() >=1) {
param.setPageNumber(commonPageable.getPageNumber()-1);
param.setPageSize(commonPageable.getPageSize());
}
Page<MsgVo> dataList = iMsgService.queryMsgInfoList(param);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment