commit
e6f9a00b85
7 changed files with 265 additions and 9 deletions
@ -0,0 +1,60 @@ |
||||
package org.springblade.desk.logistics.pojo.entity; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 异常信息实体类 |
||||
* |
||||
* @author liweidong |
||||
* @since 2026-06-25 |
||||
*/ |
||||
@Data |
||||
@TableName("LM_EXCEPTION_INFO") |
||||
@Schema(description = "异常信息对象") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class ExceptionInfo extends BaseEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 箱条码 |
||||
*/ |
||||
@Schema(description = "箱条码") |
||||
private String boxBarcode; |
||||
|
||||
/** |
||||
* 异常信息 |
||||
*/ |
||||
@Schema(description = "异常信息") |
||||
private String exceptionMessage; |
||||
|
||||
/** |
||||
* 来源 |
||||
*/ |
||||
@Schema(description = "来源") |
||||
private String source; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@Schema(description = "备注") |
||||
private String remarks; |
||||
|
||||
/** |
||||
* 状态 1:有效 0:无效 |
||||
*/ |
||||
@Schema(description = "状态 1:有效 0:无效") |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 删除标记 0:未删除 1:已删除 |
||||
*/ |
||||
@Schema(description = "删除标记 0:未删除 1:已删除") |
||||
private Integer isDeleted; |
||||
} |
||||
@ -0,0 +1,51 @@ |
||||
package org.springblade.desk.logistics.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.desk.logistics.pojo.entity.ExceptionInfo; |
||||
import org.springblade.desk.logistics.service.IExceptionInfoService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author liweidong |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/exceptionInfo") |
||||
@Tag(name = "异常信息", description = "站点相关接口") |
||||
public class ExceptionInfoController { |
||||
|
||||
@Autowired |
||||
IExceptionInfoService exceptionInfoService; |
||||
|
||||
/** |
||||
* 获取异常信息列表 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 1) |
||||
@Operation(summary = "分页", description = "获取异常信息列表") |
||||
public R<IPage<ExceptionInfo>> list(@Parameter(hidden = true) ExceptionInfo exceptionInfo, Query query) { |
||||
|
||||
IPage<ExceptionInfo> pages = exceptionInfoService.getExceptionInfoList(Condition.getPage(query), exceptionInfo); |
||||
|
||||
return R.data(pages); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,16 @@ |
||||
package org.springblade.desk.logistics.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springblade.desk.logistics.pojo.entity.ExceptionInfo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author liweidong |
||||
*/ |
||||
public interface ExceptionInfoMapper extends BaseMapper<ExceptionInfo> { |
||||
|
||||
List<ExceptionInfo> selectExceptionInfoList(IPage<ExceptionInfo> page, @Param("exceptionInfo")ExceptionInfo exceptionInfo); |
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace = "org.springblade.desk.logistics.mapper.ExceptionInfoMapper"> |
||||
|
||||
|
||||
<select id="selectExceptionInfoList" resultType="org.springblade.desk.logistics.pojo.entity.ExceptionInfo"> |
||||
select * from LM_EXCEPTION_INFO where IS_DELETED = 0 |
||||
<if test="exceptionInfo.boxBarcode != null and exceptionInfo.boxBarcode !=''"> |
||||
and BOX_BARCODE = #{exceptionInfo.boxBarcode} |
||||
</if> |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,54 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.logistics.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.desk.logistics.pojo.entity.ExceptionInfo; |
||||
|
||||
/** |
||||
* 异常信息 服务类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2025-11-12 |
||||
*/ |
||||
public interface IExceptionInfoService extends BaseService<ExceptionInfo> { |
||||
|
||||
/** |
||||
* 接收异常信息 |
||||
* @param exceptionInfo |
||||
* @return |
||||
*/ |
||||
boolean saveExceptionInfo(ExceptionInfo exceptionInfo); |
||||
|
||||
/** |
||||
* 列表 |
||||
* @param page |
||||
* @param exceptionInfo |
||||
* @return |
||||
*/ |
||||
IPage<ExceptionInfo> getExceptionInfoList(IPage<ExceptionInfo> page, ExceptionInfo exceptionInfo); |
||||
} |
||||
@ -0,0 +1,41 @@ |
||||
package org.springblade.desk.logistics.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.desk.logistics.mapper.ExceptionInfoMapper; |
||||
import org.springblade.desk.logistics.pojo.entity.ExceptionInfo; |
||||
import org.springblade.desk.logistics.pojo.vo.StationVO; |
||||
import org.springblade.desk.logistics.service.IExceptionInfoService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 异常信息 |
||||
* |
||||
* @author qyl |
||||
* @since 2026-01-08 |
||||
*/ |
||||
@Service |
||||
@Slf4j |
||||
public class ExceptionInfoServiceImpl extends BaseServiceImpl<ExceptionInfoMapper, ExceptionInfo> implements IExceptionInfoService { |
||||
|
||||
@Override |
||||
public boolean saveExceptionInfo(ExceptionInfo exceptionInfo) { |
||||
try { |
||||
return this.save(exceptionInfo); |
||||
} catch (Exception e) { |
||||
log.error("保存异常信息失败:{}", e.getMessage(), e); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public IPage<ExceptionInfo> getExceptionInfoList(IPage<ExceptionInfo> page, ExceptionInfo exceptionInfo) { |
||||
|
||||
List<ExceptionInfo> exceptionInfoList = baseMapper.selectExceptionInfoList(page, exceptionInfo); |
||||
|
||||
return page.setRecords(exceptionInfoList); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue