企业国别查询修复

This commit is contained in:
zhaoqing
2026-05-15 19:29:14 +08:00
parent 64f68657e6
commit f4e1a1b316
3 changed files with 21 additions and 12 deletions
@@ -26,10 +26,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
@Slf4j
@@ -52,7 +49,7 @@ public class ErpCountryApplicationService{
erpCountryDTO.setTopOrganizationId(topOrganizationId);
}
}
PageHelper.startPage(erpCountryDTO.getPageNum(),erpCountryDTO.getPageSize());
List<ErpCountryPO> list = erpCountryMapper.queryList(erpCountryDTO);
Page<ErpCountryPO> page = (Page<ErpCountryPO>) list;
@@ -113,14 +110,21 @@ public class ErpCountryApplicationService{
StringBuilder failMsg = new StringBuilder();
for (ErpCountryDTO dto : dtoList) {
Map<String, String> body = new HashMap<>();
body.put("erpCountryCode", dto.getErpCountryCode());
body.put("erpCountryName", dto.getErpCountryName());
// Map<String, String> body = new HashMap<>();
// body.put("erpCountryCode", dto.getErpCountryCode());
// body.put("erpCountryName", dto.getErpCountryName());
Map<String, String> item = new HashMap<>();
item.put("erpCountryCode", dto.getErpCountryCode());
item.put("erpCountryName", dto.getErpCountryName());
List<Map<String,String>> bodyList = new ArrayList<>();
bodyList.add(item);
GwLog gwLog = new GwLog();
gwLog.setType("企业国别");
gwLog.setBusinessId(dto.getId());
gwLog.setRequestBody(JSONObject.toJSONString(body));
gwLog.setRequestBody(JSONObject.toJSONString(bodyList));
gwLog.setResponseBody("");
gwLog.setStatus(1);
gwLog.setSendTime(new Date());
@@ -136,7 +140,7 @@ public class ErpCountryApplicationService{
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(PUSH_API_URL);
StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8");
StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/json");
httpPost.setHeader("apiName", API_NAME);
@@ -47,6 +47,8 @@ public class BusinessPartnerDTO {
@ApiModelProperty(value = "页码")
private Integer pageNum = 1;
@ApiModelProperty(value = "页码")
private Integer pageNo = 1;
@ApiModelProperty(value = "每页数量")
private Integer pageSize = 10;
@@ -1,6 +1,7 @@
package com.mhd.oms.interfaces.facade.erpCountry;
import com.github.pagehelper.PageHelper;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
@@ -25,8 +26,10 @@ public class ErpCountryApi extends BaseController{
@ApiOperation("查询企业国别列表")
@GetMapping("/list")
public TableDataInfo list(ErpCountryDTO erpCountryDTO){
startPage();
public TableDataInfo list(ErpCountryDTO erpCountryDTO,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize){
PageHelper.startPage(pageNo, pageSize);
return erpCountryApplicationService.queryList(erpCountryDTO);
}