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 new file mode 100644 index 000000000..1575df9b8 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java @@ -0,0 +1,41 @@ +package com.mhd.oms.application.service.gwLog; + + +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +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; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +public class GwLogApplicationService { + + + private final GwLogMapper gwLogMapper; + + public GwLogApplicationService(GwLogMapper gwLogMapper) { + this.gwLogMapper = gwLogMapper; + } + + public TableDataInfo queryList(GwLogDTO gwLogDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + gwLogDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + List list = gwLogMapper.queryList(gwLogDTO); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } +} 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 65484ad4b..2ae8cdc6d 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 @@ -2,9 +2,20 @@ package com.mhd.oms.domain.gwLog.repository.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; @Mapper public interface GwLogMapper extends BaseMapper { + /** + * + * @param gwLogDTO + * @return + */ + List queryList(GwLogDTO gwLogDTO); } 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 new file mode 100644 index 000000000..0b40de423 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java @@ -0,0 +1,63 @@ +package com.mhd.oms.domain.gwLog.repository.po; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + + +@Data +public class GwLogPO { + + @ApiModelProperty("日志id") + private Long logId; + + @ApiModelProperty("类型") + private String type; + + @ApiModelProperty("业务ID") + private String businessId; + + @ApiModelProperty("请求报文") + private String requestBody; + + @ApiModelProperty("响应报文") + private String responseBody; + + @ApiModelProperty("状态(1-初始,2-成功,3-失败)") + private Integer status; + + @ApiModelProperty("错误信息") + private String errorMsg; + + @ApiModelProperty("推送时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sendTime; + + @ApiModelProperty("组织ID") + private Long organizationId; + + @ApiModelProperty("一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty("组织名称") + private String organizationName; + + @ApiModelProperty("创建人") + private Long createBy; + + @ApiModelProperty("创建时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty("删除标记:1-正常,0-删除") + private Integer delFlag; + +} 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 new file mode 100644 index 000000000..4b46e8df9 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java @@ -0,0 +1,39 @@ +package com.mhd.oms.interfaces.dto.gwLog; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +@Data +public class GwLogDTO { + + + @ApiModelProperty("日志类型") + private String type; + + @ApiModelProperty("业务Id") + private Long businessId; + + @ApiModelProperty("状态:1-初始 2-成功 3-失败") + private Integer status; + + @ApiModelProperty("组织id") + private Long organizationId ; + + @ApiModelProperty("推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String sendTimeFrom; + + @ApiModelProperty("推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String sendTimeTo; + + @ApiModelProperty("一级组织id") + private Long topOrganizationId ; + +} 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 new file mode 100644 index 000000000..5e0c5f0ff --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java @@ -0,0 +1,39 @@ +package com.mhd.oms.interfaces.facade.gwLog; + + +import com.mhd.common.core.web.controller.BaseController; +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.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 javax.annotation.Resource; + + +@Api(tags = "GW日志管理") +@RestController +@RequestMapping("/gwLogApi") +public class GwLogApi extends BaseController { + + @Resource + private GwLogApplicationService gwLogApplicationService; + + + @ApiOperation("查询GW日志") + @GetMapping("/queryList") + public TableDataInfo queryList(GwLogDTO gwLogDTO){ + startPage(); + return gwLogApplicationService.queryList(gwLogDTO); + + } + + + +} diff --git a/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml b/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml new file mode 100644 index 000000000..adbd43daa --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file