Commit 914f75fe authored by chenzhao's avatar chenzhao

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

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