gwlog日志

This commit is contained in:
zhaoqing
2026-05-14 09:51:17 +08:00
parent 17bc4b1416
commit 642cfc5c8c
5 changed files with 45 additions and 5 deletions
@@ -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<GwLogPO> list = gwLogMapper.queryList(gwLogDTO);
Page<GwLogPO> page = (Page<GwLogPO>) 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;
}
}
@@ -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<GwLog> {
* @return
*/
List<GwLogPO> queryList(GwLogDTO gwLogDTO);
@Select("select * from gw_log where business_id = #{businessId} and type = #{type}")
GwLogPO selectByTypeAndId(@RequestBody GwLog gwLog);
}
@@ -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")
@@ -36,4 +36,10 @@ public class GwLogDTO {
@ApiModelProperty("一级组织id")
private Long topOrganizationId ;
@ApiModelProperty(value = "页码")
private Integer pageNum = 1;
@ApiModelProperty(value = "每页数量")
private Integer pageSize = 10;
}
@@ -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;
}
}