diff --git a/src/main/java/com/glxp/udi/admin/controller/product/StackCodeController.java b/src/main/java/com/glxp/udi/admin/controller/product/StackCodeController.java new file mode 100644 index 0000000..b2c8985 --- /dev/null +++ b/src/main/java/com/glxp/udi/admin/controller/product/StackCodeController.java @@ -0,0 +1,46 @@ +package com.glxp.udi.admin.controller.product; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.glxp.udi.admin.common.enums.ResultEnum; +import com.glxp.udi.admin.common.res.BaseResponse; +import com.glxp.udi.admin.common.util.ResultVOUtils; +import com.glxp.udi.admin.entity.product.StackCode; +import com.glxp.udi.admin.req.product.FilterStackCodeRequest; +import com.glxp.udi.admin.res.PageSimpleResponse; +import com.glxp.udi.admin.service.product.StackCodeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 垛码 - 码表接口 + */ +@Slf4j +@RestController +public class StackCodeController { + + @Resource + private StackCodeService stackCodeService; + + /** + * 查询垛码明细 + * + * @param filterStackCodeRequest + * @return + */ + @GetMapping("/udims/stack/code/filter") + public BaseResponse filterList(FilterStackCodeRequest filterStackCodeRequest) { + if (null == filterStackCodeRequest || StrUtil.isBlank(filterStackCodeRequest.getOrderIdFk())) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + IPage page = stackCodeService.filterList(filterStackCodeRequest); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse(); + pageSimpleResponse.setList(page.getRecords()); + pageSimpleResponse.setTotal(page.getTotal()); + return ResultVOUtils.success(pageSimpleResponse); + } + +} diff --git a/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java b/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java index b6de33e..97f7841 100644 --- a/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java +++ b/src/main/java/com/glxp/udi/admin/entity/product/StackOrder.java @@ -1,5 +1,6 @@ package com.glxp.udi.admin.entity.product; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @@ -16,7 +17,11 @@ public class StackOrder { private String name; private Integer exportStatus; private Integer status; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; private String customerId; } diff --git a/src/main/java/com/glxp/udi/admin/req/product/FilterStackCodeRequest.java b/src/main/java/com/glxp/udi/admin/req/product/FilterStackCodeRequest.java new file mode 100644 index 0000000..8fb858a --- /dev/null +++ b/src/main/java/com/glxp/udi/admin/req/product/FilterStackCodeRequest.java @@ -0,0 +1,17 @@ +package com.glxp.udi.admin.req.product; + +import com.glxp.udi.admin.req.ListPageRequest; +import lombok.Data; + +/** + * 垛码明细查询参数 + */ +@Data +public class FilterStackCodeRequest extends ListPageRequest { + + /** + * 垛号 + */ + private String orderIdFk; + +} diff --git a/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java b/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java index 3dde9cc..b7e0bb7 100644 --- a/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java +++ b/src/main/java/com/glxp/udi/admin/service/product/StackCodeService.java @@ -1,8 +1,12 @@ package com.glxp.udi.admin.service.product; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.glxp.udi.admin.dao.product.StackCodeDao; import com.glxp.udi.admin.entity.product.StackCode; +import com.glxp.udi.admin.req.product.FilterStackCodeRequest; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; @@ -19,7 +23,9 @@ public class StackCodeService { @Resource - SqlSessionFactory sqlSessionFactory; + private SqlSessionFactory sqlSessionFactory; + @Resource + private StackCodeDao stackCodeDao; public void batchInsert(List stackCodeEntityList) { @@ -35,4 +41,15 @@ public class StackCodeService { } + /** + * 根据垛号查询码明细 + * + * @param filterStackCodeRequest + * @return + */ + public IPage filterList(FilterStackCodeRequest filterStackCodeRequest) { + QueryWrapper wrapper = new QueryWrapper().eq("orderIdFk", filterStackCodeRequest.getOrderIdFk()); + IPage page = new Page<>(filterStackCodeRequest.getPage(), filterStackCodeRequest.getLimit()); + return stackCodeDao.selectPage(page, wrapper); + } } diff --git a/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java b/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java index b1eef8c..844b9c5 100644 --- a/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java +++ b/src/main/java/com/glxp/udi/admin/service/product/StackOrderService.java @@ -28,6 +28,7 @@ public class StackOrderService { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(stackOrderFilterRequest.getId() != null, "id", stackOrderFilterRequest.getId()) + .eq(StrUtil.isNotBlank(stackOrderFilterRequest.getCustomerId()), "customerId", stackOrderFilterRequest.getCustomerId()) .eq(StrUtil.isNotBlank(stackOrderFilterRequest.getOrderId()), "orderId", stackOrderFilterRequest.getOrderId()) .eq(stackOrderFilterRequest.getExportStatus() != null, "exportStatus", stackOrderFilterRequest.getExportStatus()) .eq(stackOrderFilterRequest.getStatus() != null, "status", stackOrderFilterRequest.getStatus())