From 642cfc5c8c04a148af871d10fa71297e271f3494 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Thu, 14 May 2026 09:51:17 +0800 Subject: [PATCH] =?UTF-8?q?gwlog=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gwLog/GwLogApplicationService.java | 19 ++++++++++++++++++- .../gwLog/repository/mapper/GwLogMapper.java | 5 +++++ .../domain/gwLog/repository/po/GwLogPO.java | 3 +++ .../oms/interfaces/dto/gwLog/GwLogDTO.java | 6 ++++++ .../oms/interfaces/facade/gwLog/GwLogApi.java | 17 +++++++++++++---- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java index 1575df9b8..a029f9a7a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java @@ -1,8 +1,13 @@ package com.mhd.oms.application.service.gwLog; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; @@ -31,11 +36,23 @@ public class GwLogApplicationService { gwLogDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); } } + PageHelper.startPage(gwLogDTO.getPageNum(),gwLogDTO.getPageSize()); List list = gwLogMapper.queryList(gwLogDTO); + Page page = (Page) list; TableDataInfo tableDataInfo = new TableDataInfo(); tableDataInfo.setData(list); - tableDataInfo.setTotal(list.size()); + tableDataInfo.setTotal(page.getTotal()); tableDataInfo.setCode(200); return tableDataInfo; } + + public GwLogPO selectByTypeAndId(GwLogDTO gwLogDTO) { + GwLog gwLog =new GwLog(); + BeanUtils.copyProperties(gwLog,gwLogDTO); + GwLogPO po = gwLogMapper.selectByTypeAndId(gwLog); + GwLogPO po1 = gwLogMapper.selectByTypeAndId(gwLog); + // GwLogPO po2 = gwLogMapper.selectByTypeAndId(gwLogDTO); + // GwLogPO po3 = gwLogMapper.selectByTypeAndId(gwLogDTO); + return po; + } } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java index 2ae8cdc6d..8007d0446 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java @@ -6,6 +6,8 @@ import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -18,4 +20,7 @@ public interface GwLogMapper extends BaseMapper { * @return */ List queryList(GwLogDTO gwLogDTO); + + @Select("select * from gw_log where business_id = #{businessId} and type = #{type}") + GwLogPO selectByTypeAndId(@RequestBody GwLog gwLog); } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java index 0b40de423..1272af6f8 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java @@ -52,6 +52,9 @@ public class GwLogPO { @ApiModelProperty("创建人") private Long createBy; + @ApiModelProperty("创建人姓名") + private String pushByName; + @ApiModelProperty("创建时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java index 4b46e8df9..3d01e57f9 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java @@ -36,4 +36,10 @@ public class GwLogDTO { @ApiModelProperty("一级组织id") private Long topOrganizationId ; + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java index 5e0c5f0ff..99f03999d 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java @@ -2,17 +2,16 @@ package com.mhd.oms.interfaces.facade.gwLog; import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.oms.application.service.gwLog.GwLogApplicationService; import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -34,6 +33,16 @@ public class GwLogApi extends BaseController { } + @ApiOperation("查询GW日志") + @PostMapping("/selectByTypeAndId") + public AjaxResult selectByTypeAndId(@RequestBody GwLogDTO gwLogDTO){ + GwLogPO po = gwLogApplicationService.selectByTypeAndId(gwLogDTO); + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult.put("code",200); + ajaxResult.put("data",po); + return ajaxResult; + + } }