diff --git a/src/main/java/com/zcloud/controller/xgf/CorpFgsController.java b/src/main/java/com/zcloud/controller/xgf/CorpFgsController.java index 96b0084b..ab9db99b 100644 --- a/src/main/java/com/zcloud/controller/xgf/CorpFgsController.java +++ b/src/main/java/com/zcloud/controller/xgf/CorpFgsController.java @@ -74,5 +74,21 @@ public class CorpFgsController extends BaseController { return "?showCount=" +page.getShowCount() + "¤tPage=" + page.getUrlCurrentPage(); } + /** + * 相关方单位--根据企业端corpInfoId查询到对应的相关方部门树形结构 + * @return + * @throws Exception + */ + @RequestMapping(value="/listTreeByFgsId") + @ResponseBody + public Object listTreeByFgsId() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi//corpFgs/listTreeByFgsId", pd); + return result; + } + } diff --git a/src/main/java/com/zcloud/controller/xgf/app/AppCorpFgsController.java b/src/main/java/com/zcloud/controller/xgf/app/AppCorpFgsController.java new file mode 100644 index 00000000..fef97c0b --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/app/AppCorpFgsController.java @@ -0,0 +1,110 @@ +package com.zcloud.controller.xgf.app; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.util.HttpClientService; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author fangjiakai + * @date 2023/05/15 11:09 + */ +@Controller +@RequestMapping("/app/corpFgs") +public class AppCorpFgsController extends BaseController { + + @Value("${preventionxgf.api.url}") + private String xgfUrl; + + /** + * 相关方单位列表 + * @param page + * @return + * @throws Exception + */ + @RequestMapping(value="/corpFgsList") + @ResponseBody + public Object batchList(Page page) throws Exception{ + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/corpFgs/corpFgsList" +getPageUrl(page), pd); + return result; + } + + /** + * 相关方单位人员列表 + * @param page + * @return + * @throws Exception + */ + @RequestMapping(value="/corpUserFgsList") + @ResponseBody + public Object batchUserList(Page page) throws Exception{ + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/corpUserFgs/corpUserFgsList" +getPageUrl(page), pd); + return result; + } + + /** + * 相关方单位人员-人员基础信息管理-人员详细信息 + * @return + * @throws Exception + */ + @RequestMapping(value="/getCorpUserDetail") + @ResponseBody + public Object getCorpUserDetail() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/corpUserFgs/corpUserDetailInfoById", pd); + return result; + } + + private String getPageUrl(Page page){ + return "?showCount=" +page.getShowCount() + "¤tPage=" + page.getUrlCurrentPage(); + } + + /** + * 相关方单位--根据企业端corpInfoId查询到对应的相关方部门树形结构 + * @return + * @throws Exception + */ + @RequestMapping(value="/listTreeByFgsId") + @ResponseBody + public Object listTreeByFgsId() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi//corpFgs/listTreeByFgsId", pd); + return result; + } + + /** + * 根据相关方部门id获取部门下所有人员 + * @return + * @throws Exception + */ + @RequestMapping(value="/findUserByDepartmentId") + @ResponseBody + public Object findUserByDepartmentId() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + Map result = HttpClientService.doPost(xgfUrl + "/openApi//corpUserFgs/findUserByDepartmentId", pd); + return result; + } + + +} diff --git a/src/main/java/com/zcloud/service/corpFgs/CorpFgsService.java b/src/main/java/com/zcloud/service/corpFgs/CorpFgsService.java new file mode 100644 index 00000000..bf5fc6e7 --- /dev/null +++ b/src/main/java/com/zcloud/service/corpFgs/CorpFgsService.java @@ -0,0 +1,19 @@ +package com.zcloud.service.corpFgs; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:用电气体检测 + * 作者:luoxiaobao + * 时间:2021-09-08 + * 官网:www.zcloudchina.com + */ +public interface CorpFgsService { + + String getXgfUserName(String workUser); + +} + diff --git a/src/main/java/com/zcloud/service/corpFgs/impl/CorpFgsServiceImpl.java b/src/main/java/com/zcloud/service/corpFgs/impl/CorpFgsServiceImpl.java new file mode 100644 index 00000000..c8a95429 --- /dev/null +++ b/src/main/java/com/zcloud/service/corpFgs/impl/CorpFgsServiceImpl.java @@ -0,0 +1,46 @@ +package com.zcloud.service.corpFgs.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.eightWork.ElectricityYthGasMapper; +import com.zcloud.service.corpFgs.CorpFgsService; +import com.zcloud.service.eightWork.ElectricityYthGasService; +import com.zcloud.util.HttpClientService; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 说明:用电气体检测 + * 作者:luoxiaobao + * 时间:2021-09-08 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class CorpFgsServiceImpl implements CorpFgsService { + + + @Value("${preventionxgf.api.url}") + private String xgfUrl; + + @Override + public String getXgfUserName(String workUser){ + PageData pd = new PageData(); + pd.put("USER_ID",workUser); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/user/findUserById", pd); + Map pageData = (Map) result.get("pd"); + if(Tools.isEmpty(pageData)){ + return workUser; + }else { + return pageData.get("NAME").toString(); + } + + } +} + diff --git a/src/main/java/com/zcloud/service/gf/impl/GFBlindBoardServiceImpl.java b/src/main/java/com/zcloud/service/gf/impl/GFBlindBoardServiceImpl.java index 49bf00e3..991d6f6e 100644 --- a/src/main/java/com/zcloud/service/gf/impl/GFBlindBoardServiceImpl.java +++ b/src/main/java/com/zcloud/service/gf/impl/GFBlindBoardServiceImpl.java @@ -1,8 +1,10 @@ package com.zcloud.service.gf.impl; +import com.zcloud.controller.xgf.app.AppCorpFgsController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.gf.GFBlindBoardMapper; +import com.zcloud.service.corpFgs.CorpFgsService; import com.zcloud.service.gf.GFBlindBoardService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -23,6 +25,9 @@ public class GFBlindBoardServiceImpl implements GFBlindBoardService { @Resource private GFBlindBoardMapper GFblindboardMapper; + @Resource + private CorpFgsService corpFgsService; + /**新增 * @param pd * @throws Exception @@ -76,7 +81,11 @@ public class GFBlindBoardServiceImpl implements GFBlindBoardService { * @throws Exception */ public PageData findById(PageData pd)throws Exception{ - return GFblindboardMapper.findById(pd); + PageData pageData = GFblindboardMapper.findById(pd); + //调用接口 获取用户信息 + String workUser = corpFgsService.getXgfUserName(pageData.getString("WORK_USER")); + pageData.put("WORK_USER",workUser); + return pageData; } /**批量删除 diff --git a/src/main/java/com/zcloud/service/gf/impl/GFHighWorkServiceImpl.java b/src/main/java/com/zcloud/service/gf/impl/GFHighWorkServiceImpl.java index 19dc4e2a..5a86ee6b 100644 --- a/src/main/java/com/zcloud/service/gf/impl/GFHighWorkServiceImpl.java +++ b/src/main/java/com/zcloud/service/gf/impl/GFHighWorkServiceImpl.java @@ -3,6 +3,7 @@ package com.zcloud.service.gf.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.gf.GFHighWorkMapper; +import com.zcloud.service.corpFgs.CorpFgsService; import com.zcloud.service.gf.GFHighWorkService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -22,6 +23,8 @@ public class GFHighWorkServiceImpl implements GFHighWorkService { @Resource private GFHighWorkMapper GFhighworkMapper; + @Resource + private CorpFgsService corpFgsService; /**新增 * @param pd @@ -77,7 +80,11 @@ public class GFHighWorkServiceImpl implements GFHighWorkService { * @throws Exception */ public PageData findById(PageData pd)throws Exception{ - return GFhighworkMapper.findById(pd); + PageData pageData = GFhighworkMapper.findById(pd); + //调用接口 获取用户信息 + String workUser = corpFgsService.getXgfUserName(pageData.getString("PROJECT_MANAGER")); + pageData.put("PROJECT_MANAGER",workUser); + return pageData; } /**批量删除