diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java index 7ab2f9017..791d30a6c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java @@ -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 list = erpCountryMapper.queryList(erpCountryDTO); Page page = (Page) list; @@ -113,14 +110,21 @@ public class ErpCountryApplicationService{ StringBuilder failMsg = new StringBuilder(); for (ErpCountryDTO dto : dtoList) { - Map body = new HashMap<>(); - body.put("erpCountryCode", dto.getErpCountryCode()); - body.put("erpCountryName", dto.getErpCountryName()); +// Map body = new HashMap<>(); +// body.put("erpCountryCode", dto.getErpCountryCode()); +// body.put("erpCountryName", dto.getErpCountryName()); + + Map item = new HashMap<>(); + item.put("erpCountryCode", dto.getErpCountryCode()); + item.put("erpCountryName", dto.getErpCountryName()); + List> 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); diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java index 46b79aa2a..3888e3b18 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java @@ -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; diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java index dd5e79990..aa8a9449a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java @@ -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); }