|
|
@@ -1,9 +1,6 @@
|
|
|
package org.jeecg.modules.hlgcompany.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.io.IOException;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
@@ -44,6 +41,9 @@ import org.jeecg.modules.hlgcpmanager.service.IHlgCpAccountDetailService;
|
|
|
import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
|
|
|
import org.jeecg.modules.hlgplatform.entity.HlgPlatform;
|
|
|
import org.jeecg.modules.hlgplatform.mapper.HlgPlatformMapper;
|
|
|
+import org.jeecg.modules.hlgsubcontractor.entity.HlgSubcontractor;
|
|
|
+import org.jeecg.modules.hlguser.entity.HlgUser;
|
|
|
+import org.jeecg.modules.hlguser.service.IHlgUserSubcontractService;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
@@ -73,6 +73,8 @@ public class HlgCompanyController {
|
|
|
private IHlgCompanySubcontractorService hlgCompanySubcontractorService;
|
|
|
@Resource
|
|
|
private HlgCpAccountDetailMapper hlgCpAccountDetailMapper;
|
|
|
+ @Autowired
|
|
|
+ private IHlgUserSubcontractService hlgUserSubcontractService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -330,10 +332,10 @@ public class HlgCompanyController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/userSubcontractorList")
|
|
|
- public Result<?> userSubcontractorList(HlgCompany hlgCompany, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- Result<IPage<HlgCompanySubcontractor>> result = new Result<IPage<HlgCompanySubcontractor>>();
|
|
|
+ public Result<?> userSubcontractorList(HlgUser hlgUser, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<IPage<HlgSubcontractor>> result = new Result<IPage<HlgSubcontractor>>();
|
|
|
String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
String requestUrl = OauthApi.applicationSubcontractorList;
|
|
|
Map<String, Object> parameters = new HashMap<>();
|
|
|
@@ -346,9 +348,20 @@ public class HlgCompanyController {
|
|
|
if (jsonObject.getBoolean("success")) {
|
|
|
log.info("用户服务商列表===={}", jsonObject);
|
|
|
JSONObject jsonObject1=jsonObject.getJSONObject("result");
|
|
|
- List<HlgCompanySubcontractor> list= (List<HlgCompanySubcontractor>) jsonObject1.get("records");
|
|
|
- Page<HlgCompanySubcontractor> pageList=new Page<HlgCompanySubcontractor>();
|
|
|
- pageList.setRecords(list);
|
|
|
+ List<Map<String,Object>> list= (List<Map<String,Object>>) jsonObject1.get("records");
|
|
|
+ List<HlgSubcontractor> list1=new ArrayList<HlgSubcontractor>();
|
|
|
+ if(list.size()>0){
|
|
|
+ for (int i = 0; i <list.size() ; i++) {
|
|
|
+ HlgSubcontractor hlgSubcontractor=new HlgSubcontractor();
|
|
|
+ hlgSubcontractor.setId((Integer)list.get(i).get("id"));
|
|
|
+ hlgSubcontractor.setName((String) list.get(i).get("name"));
|
|
|
+ String subcontract=hlgUserSubcontractService.getByUserIdAndSubId(hlgUser.getId(),(Integer)list.get(i).get("id"));
|
|
|
+ hlgSubcontractor.setSubcontract(subcontract);
|
|
|
+ list1.add(hlgSubcontractor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Page<HlgSubcontractor> pageList=new Page<HlgSubcontractor>();
|
|
|
+ pageList.setRecords(list1);
|
|
|
pageList.setTotal(jsonObject1.getInteger("total"));
|
|
|
pageList.setCurrent(jsonObject1.getInteger("current"));
|
|
|
pageList.setSize(jsonObject1.getInteger("size"));
|