用户修改,单据类型修改,往来单位修改,单据管理
parent
a2e2e31e6d
commit
02e236724a
@ -0,0 +1,38 @@
|
||||
package com.glxp.api.controller.inout;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
||||
import com.glxp.api.req.inout.FilterIoCodeRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.inout.IoCodeTempService;
|
||||
import com.glxp.api.util.page.TableDataInfo;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
public class IoCodeTempController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IoCodeTempService codeTempService;
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("admin/warehouse/inout/findErrorByOrderId")
|
||||
public BaseResponse findErrorByOrderId(FilterIoCodeRequest warehouseQueryRequest) {
|
||||
if (StrUtil.isEmpty(warehouseQueryRequest.getOrderId())) {
|
||||
return ResultVOUtils.error(500, "单据号不能为空!");
|
||||
}
|
||||
TableDataInfo<IoCodeTempEntity> tableDataInfo = codeTempService.findByOrderId(warehouseQueryRequest);
|
||||
PageSimpleResponse<IoCodeTempEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(tableDataInfo.getTotal());
|
||||
pageSimpleResponse.setList(tableDataInfo.getList());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.glxp.api.dao.inout;
|
||||
|
||||
import com.glxp.api.dao.BaseMapperPlus;
|
||||
import com.glxp.api.entity.inout.IoCodeEnttity;
|
||||
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
||||
|
||||
public interface IoCodeTempDao extends BaseMapperPlus<IoCodeTempDao, IoCodeTempEntity, IoCodeTempEntity> {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.cpt.common.exception;
|
||||
|
||||
/**
|
||||
* 工具类异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class UtilException extends RuntimeException {
|
||||
private static final long serialVersionUID = 8247610319171014183L;
|
||||
|
||||
public UtilException(Throwable e) {
|
||||
super(e.getMessage(), e);
|
||||
}
|
||||
|
||||
public UtilException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public UtilException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
}
|
@ -1,8 +1,21 @@
|
||||
package com.glxp.api.req.inout;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FilterIoCodeRequest {
|
||||
public class FilterIoCodeRequest extends ListPageRequest {
|
||||
private String corpOrderId;
|
||||
private String code;
|
||||
private String udi;
|
||||
private String batchNo;
|
||||
private String orderId;
|
||||
private String nameCode;
|
||||
private String supId;
|
||||
private String locStorageCode;
|
||||
private String relId;
|
||||
|
||||
List<String> actions;
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.entity.inout.IoCodeEnttity;
|
||||
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
||||
import com.glxp.api.req.inout.FilterIoCodeRequest;
|
||||
import com.glxp.api.util.page.PageQuery;
|
||||
import com.glxp.api.util.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IoCodeTempService {
|
||||
|
||||
|
||||
List<IoCodeTempEntity> findByOrderId(String billNo);
|
||||
|
||||
TableDataInfo<IoCodeTempEntity> findByOrderId(FilterIoCodeRequest filterIoCodeRequest);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.glxp.api.service.inout.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.glxp.api.dao.inout.IoCodeTempDao;
|
||||
import com.glxp.api.entity.auth.SysDictData;
|
||||
import com.glxp.api.entity.inout.IoCodeEnttity;
|
||||
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
||||
import com.glxp.api.req.inout.FilterIoCodeRequest;
|
||||
import com.glxp.api.service.inout.IoCodeTempService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.page.PageQuery;
|
||||
import com.glxp.api.util.page.TableDataInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
@Service
|
||||
public class IoCodeTempServiceImpl implements IoCodeTempService {
|
||||
|
||||
@Resource
|
||||
IoCodeTempDao ioCodeTempDao;
|
||||
|
||||
@Override
|
||||
public List<IoCodeTempEntity> findByOrderId(String billNo) {
|
||||
return ioCodeTempDao.selectList(new QueryWrapper<IoCodeTempEntity>().eq("orderId", billNo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<IoCodeTempEntity> findByOrderId(FilterIoCodeRequest filterIoCodeRequest) {
|
||||
PageQuery pageQuery = new PageQuery();
|
||||
BeanCopyUtils.copy(filterIoCodeRequest, pageQuery);
|
||||
Page<IoCodeTempEntity> page = ioCodeTempDao.selectPage(pageQuery.build(), new QueryWrapper<IoCodeTempEntity>().eq("orderId", filterIoCodeRequest.getOrderId()));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.glxp.api.req;
|
||||
package com.glxp.api.util.page;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.glxp.api.util.page;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 分页查询实体类
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PageQuery implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer limit;
|
||||
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private Integer page;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
private String isAsc;
|
||||
|
||||
/**
|
||||
* 当前记录起始索引 默认值
|
||||
*/
|
||||
public static final int DEFAULT_PAGE_NUM = 1;
|
||||
|
||||
/**
|
||||
* 每页显示记录数 默认值 默认查全部
|
||||
*/
|
||||
public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE;
|
||||
|
||||
public <T> Page<T> build() {
|
||||
Integer pageNum = ObjectUtil.defaultIfNull(getPage(), DEFAULT_PAGE_NUM);
|
||||
Integer pageSize = ObjectUtil.defaultIfNull(getLimit(), DEFAULT_PAGE_SIZE);
|
||||
if (pageNum <= 0) {
|
||||
pageNum = DEFAULT_PAGE_NUM;
|
||||
}
|
||||
Page<T> page = new Page<>(pageNum, pageSize);
|
||||
OrderItem orderItem = buildOrderItem();
|
||||
if (ObjectUtil.isNotNull(orderItem)) {
|
||||
page.addOrder(orderItem);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
private OrderItem buildOrderItem() {
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc)) {
|
||||
isAsc = "asc";
|
||||
} else if ("descending".equals(isAsc)) {
|
||||
isAsc = "desc";
|
||||
}
|
||||
if (StringUtils.isNotBlank(orderByColumn)) {
|
||||
String orderBy = SqlUtil.escapeOrderBySql(orderByColumn);
|
||||
orderBy = StringUtils.toUnderScoreCase(orderBy);
|
||||
if ("asc".equals(isAsc)) {
|
||||
return OrderItem.asc(orderBy);
|
||||
} else if ("desc".equals(isAsc)) {
|
||||
return OrderItem.desc(orderBy);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.glxp.api.util.page;
|
||||
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 表格分页数据对象
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TableDataInfo<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private long total;
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
private List<T> list;
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param list 列表数据
|
||||
* @param total 总记录数
|
||||
*/
|
||||
public TableDataInfo(List<T> list, long total) {
|
||||
this.list = list;
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public static <T> TableDataInfo<T> build(IPage<T> page) {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(HttpStatus.HTTP_OK);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setList(page.getRecords());
|
||||
rspData.setTotal(page.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
public static <T> TableDataInfo<T> build(List<T> list) {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(HttpStatus.HTTP_OK);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setList(list);
|
||||
rspData.setTotal(list.size());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
public static <T> TableDataInfo<T> build() {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(HttpStatus.HTTP_OK);
|
||||
rspData.setMsg("查询成功");
|
||||
return rspData;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue