整箱优化
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
package top.wms.admin.fullWorkOrder.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import top.continew.starter.data.mp.base.BaseMapper;
|
||||
import top.wms.admin.fullWorkOrder.model.entity.FullWorkOrderDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import top.wms.admin.fullWorkOrder.model.resp.FullWorkOrderResp;
|
||||
|
||||
/**
|
||||
* 整箱领取记录 Mapper
|
||||
@@ -13,4 +19,6 @@ import org.springframework.stereotype.Repository;
|
||||
@Repository
|
||||
public interface FullWorkOrderMapper extends BaseMapper<FullWorkOrderDO> {
|
||||
|
||||
IPage<FullWorkOrderResp> selectFullWorkOrderPage(@Param("page") Page<Object> objectPage,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<FullWorkOrderDO> queryWrapper);
|
||||
}
|
||||
@@ -40,4 +40,19 @@ public class FullWorkOrderDO extends BaseDO {
|
||||
* 图片地址
|
||||
*/
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 标记号
|
||||
*/
|
||||
private String mark;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer count;
|
||||
}
|
||||
@@ -31,21 +31,30 @@ public class FullWorkOrderQuery implements Serializable {
|
||||
* 任务工单号
|
||||
*/
|
||||
@Schema(description = "任务工单号")
|
||||
@Query(type = QueryType.EQ)
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@Schema(description = "物料编码")
|
||||
@Query(type = QueryType.LIKE)
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@Schema(description = "批次号")
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@Query(type = QueryType.EQ)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
@@ -53,6 +62,5 @@ public class FullWorkOrderQuery implements Serializable {
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
@Query(type = QueryType.BETWEEN)
|
||||
private List<Date> createTime;
|
||||
}
|
||||
@@ -53,4 +53,26 @@ public class FullWorkOrderReq implements Serializable {
|
||||
@Length(max = 255, message = "图片地址长度不能超过 {max} 个字符")
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@Schema(description = "批次号")
|
||||
@NotBlank(message = "批次号不能为空")
|
||||
private String batch;
|
||||
|
||||
|
||||
/**
|
||||
* 标记号
|
||||
*/
|
||||
@Schema(description = "标记号")
|
||||
@NotBlank(message = "标记号不能为空")
|
||||
private String mark;
|
||||
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description = "数量")
|
||||
@NotNull(message = "数量不能为空")
|
||||
private Integer count;
|
||||
}
|
||||
@@ -41,14 +41,42 @@ public class FullWorkOrderResp extends BaseDetailResp {
|
||||
* 物料编码
|
||||
*/
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty(value = "物料编码", order = 3)
|
||||
@ExcelProperty(value = "物料编码", order = 4)
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Schema(description = "物料名称")
|
||||
@ExcelProperty(value = "物料名称", order = 3)
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@Schema(description = "图片地址")
|
||||
@ExcelProperty(value = "图片地址", order = 4)
|
||||
@ExcelProperty(value = "图片地址", order = 5)
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@Schema(description = "批次号")
|
||||
@ExcelProperty(value = "批次号", order = 6)
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 标记号
|
||||
*/
|
||||
@Schema(description = "标记号")
|
||||
@ExcelProperty(value = "标记号", order = 7)
|
||||
private String mark;
|
||||
|
||||
/**
|
||||
* 标记号
|
||||
*/
|
||||
@Schema(description = "标记号")
|
||||
@ExcelProperty(value = "数量", order = 8)
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
@@ -1,13 +1,19 @@
|
||||
package top.wms.admin.fullWorkOrder.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||
import top.continew.starter.extension.crud.model.query.SortQuery;
|
||||
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.continew.starter.file.excel.util.ExcelUtils;
|
||||
import top.wms.admin.common.context.UserContextHolder;
|
||||
@@ -36,6 +42,24 @@ public class FullWorkOrderServiceImpl extends BaseServiceImpl<FullWorkOrderMappe
|
||||
|
||||
private final FullWorkOrderInfoMapper fullWorkOrderInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public PageResp<FullWorkOrderResp> page(FullWorkOrderQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<FullWorkOrderDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(query.getMaterialCode()), "f.material_code", query.getMaterialCode());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(query.getOrderNo()), "f.order_no", query.getOrderNo());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(query.getBatch()), "f.batch", query.getBatch());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(query.getMaterialName()), "m.material_name", query.getMaterialName());
|
||||
queryWrapper.between(CollUtil.isNotEmpty(query.getCreateTime()), "f.create_time", CollUtil.getFirst(query.getCreateTime()), CollUtil.getLast(query.getCreateTime()));
|
||||
this.sort(queryWrapper, pageQuery);
|
||||
|
||||
IPage<FullWorkOrderResp> page = baseMapper.selectFullWorkOrderPage(new Page<>(pageQuery.getPage(), pageQuery
|
||||
.getSize()), queryWrapper);
|
||||
|
||||
return PageResp.build(page);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void beforeAdd(FullWorkOrderReq req) {
|
||||
String timestamp = DateUtil.format(new Date(), "yyyyMMddHHmmss");
|
||||
|
||||
@@ -84,11 +84,25 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
|
||||
|
||||
private final MaterialTypeMapper materialTypeMapper;
|
||||
|
||||
@Override
|
||||
public void beforeAdd(MaterialInfoReq materialInfoReq) {
|
||||
MaterialInfoDO materialInfoDO = baseMapper.selectOne(new LambdaQueryWrapper<MaterialInfoDO>().eq(MaterialInfoDO::getEncoding, materialInfoReq.getEncoding()));
|
||||
CheckUtils.throwIf(materialInfoDO != null, "物料编码已存在");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeUpdate(MaterialInfoReq materialInfoReq, Long id) {
|
||||
MaterialInfoDO materialInfoDO = baseMapper.selectOne(new LambdaQueryWrapper<MaterialInfoDO>().eq(MaterialInfoDO::getEncoding, materialInfoReq.getEncoding()).ne(MaterialInfoDO::getId, id));
|
||||
CheckUtils.throwIf(materialInfoDO != null, "物料编码已存在");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResp<MaterialInfoResp> page(MaterialInfoQuery query, PageQuery pageQuery) {
|
||||
QueryWrapper<MaterialInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(query.getMaterialName()), "mi.material_name", query.getMaterialName());
|
||||
queryWrapper.likeLeft(StrUtil.isNotBlank(query.getEncoding()), "mi.encoding", query.getEncoding());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(query.getBatch()), "mi.batch", query.getBatch());
|
||||
this.sort(queryWrapper, pageQuery);
|
||||
|
||||
IPage<MaterialInfoResp> page = baseMapper.selectMaterialInfoPage(new Page<>(pageQuery.getPage(), pageQuery
|
||||
@@ -103,6 +117,7 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
|
||||
QueryWrapper<MaterialInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(query.getMaterialName()), "mi.material_name", query.getMaterialName());
|
||||
queryWrapper.likeLeft(StrUtil.isNotBlank(query.getEncoding()), "mi.encoding", query.getEncoding());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(query.getBatch()), "mi.batch", query.getBatch());
|
||||
this.sort(queryWrapper, sortQuery);
|
||||
|
||||
List<MaterialInfoResp> list = baseMapper.selectMaterialInfoExport(queryWrapper);
|
||||
|
||||
@@ -1,4 +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="top.wms.admin.fullWorkOrder.mapper.FullWorkOrderMapper">
|
||||
<select id="selectFullWorkOrderPage" resultType="top.wms.admin.fullWorkOrder.model.resp.FullWorkOrderResp">
|
||||
select
|
||||
f.*,
|
||||
m.material_name materialName,
|
||||
u.username createUserString
|
||||
from
|
||||
sys_full_work_order f
|
||||
left join sys_material_info m on f.material_code = m.encoding
|
||||
left join sys_user u on f.create_user = u.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +1,6 @@
|
||||
package top.wms.admin.controller.fullWorkOrder;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import top.continew.starter.extension.crud.enums.Api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -16,6 +17,7 @@ import top.wms.admin.fullWorkOrder.model.req.FullWorkOrderInfoReq;
|
||||
import top.wms.admin.fullWorkOrder.model.req.FullWorkOrderReq;
|
||||
import top.wms.admin.fullWorkOrder.model.resp.FullWorkOrderResp;
|
||||
import top.wms.admin.fullWorkOrder.service.FullWorkOrderService;
|
||||
import top.wms.admin.weighManage.model.resp.WorkOrderResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ import java.util.regex.Pattern;
|
||||
public class AHDZCConnect {
|
||||
|
||||
//老设备(只能跑jar包的)
|
||||
// private static final String PORT_NAME = "COM12";
|
||||
private static final String PORT_NAME = "COM12";
|
||||
//新设备(环境齐全的)
|
||||
private static final String PORT_NAME = "COM13";
|
||||
// private static final String PORT_NAME = "COM13";
|
||||
private static final int BAUD_RATE = 9600;
|
||||
private static final int DATA_BITS = 8;
|
||||
private static final int STOP_BITS = 1;
|
||||
|
||||
Reference in New Issue
Block a user