关联八项作业修改

cmt1.0
zhaoyu 2023-12-06 13:43:53 +08:00
parent 81450f048a
commit 2817e16fe5
6 changed files with 209 additions and 2 deletions

View File

@ -74,5 +74,21 @@ public class CorpFgsController extends BaseController {
return "?showCount=" +page.getShowCount() + "&currentPage=" + page.getUrlCurrentPage();
}
/**
* --corpInfoId
* @return
* @throws Exception
*/
@RequestMapping(value="/listTreeByFgsId")
@ResponseBody
public Object listTreeByFgsId() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
Map result = HttpClientService.doPost(xgfUrl + "/openApi//corpFgs/listTreeByFgsId", pd);
return result;
}
}

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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() + "&currentPage=" + page.getUrlCurrentPage();
}
/**
* --corpInfoId
* @return
* @throws Exception
*/
@RequestMapping(value="/listTreeByFgsId")
@ResponseBody
public Object listTreeByFgsId() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
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<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
Map result = HttpClientService.doPost(xgfUrl + "/openApi//corpUserFgs/findUserByDepartmentId", pd);
return result;
}
}

View File

@ -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);
}

View File

@ -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<String,Object> result = HttpClientService.doPost(xgfUrl + "/openApi/user/findUserById", pd);
Map<String,Object> pageData = (Map<String, Object>) result.get("pd");
if(Tools.isEmpty(pageData)){
return workUser;
}else {
return pageData.get("NAME").toString();
}
}
}

View File

@ -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;
}
/**

View File

@ -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;
}
/**