优化
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
package top.wms.admin.material.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 top.continew.starter.data.mp.base.BaseMapper;
|
||||
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,4 +23,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfoDO> {
|
||||
public int updateByName(List<MaterialInfoDO> list);
|
||||
|
||||
public int updateByCode(List<MaterialInfoDO> list);
|
||||
|
||||
IPage<MaterialInfoResp> selectMaterialInfoPage(@Param("page") Page<Object> objectPage, @Param(Constants.WRAPPER) QueryWrapper<MaterialInfoDO> queryWrapper);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,14 @@ public class MaterialInfoDO extends BaseDO {
|
||||
* 物料照片地址
|
||||
*/
|
||||
private String photoUrl;
|
||||
|
||||
/**
|
||||
* 物料类型ID
|
||||
*/
|
||||
private Long materialTypeId;
|
||||
|
||||
/**
|
||||
* 流程ID
|
||||
*/
|
||||
private Long materialProcessId;
|
||||
}
|
||||
|
||||
@@ -58,4 +58,18 @@ public class MaterialInfoReq implements Serializable {
|
||||
@Schema(description = "物料照片地址")
|
||||
@Length(max = 255, message = "物料照片地址长度不能超过 {max} 个字符")
|
||||
private String photoUrl;
|
||||
|
||||
/**
|
||||
* 物料类型ID
|
||||
*/
|
||||
@Schema(description = "物料类型ID")
|
||||
@NotNull(message = "物料类型ID不能为空")
|
||||
private Long materialTypeId;
|
||||
|
||||
/**
|
||||
* 流程ID
|
||||
*/
|
||||
@Schema(description = "流程ID")
|
||||
@NotNull(message = "流程ID不能为空")
|
||||
private Long materialProcessId;
|
||||
}
|
||||
|
||||
@@ -57,4 +57,18 @@ public class MaterialInfoResp extends BaseDetailResp {
|
||||
@Schema(description = "物料照片地址")
|
||||
@ExcelIgnore
|
||||
private String photoUrl;
|
||||
|
||||
/**
|
||||
* 物料类型名称
|
||||
*/
|
||||
@Schema(description = "物料类型名称")
|
||||
@ExcelIgnore
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@Schema(description = "流程名称")
|
||||
@ExcelIgnore
|
||||
private String processName;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,11 @@ import cn.hutool.extra.validation.ValidationUtil;
|
||||
import cn.hutool.http.ContentType;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -27,6 +30,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.starter.cache.redisson.util.RedisUtils;
|
||||
import top.continew.starter.core.exception.BusinessException;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.continew.starter.web.util.FileUploadUtils;
|
||||
import top.wms.admin.common.constant.CacheConstants;
|
||||
@@ -43,6 +48,9 @@ import top.wms.admin.material.model.resp.MaterialInfoImportResp;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoResp;
|
||||
import top.wms.admin.material.service.MaterialInfoService;
|
||||
import top.wms.admin.system.service.FileService;
|
||||
import top.wms.admin.weighManage.model.entity.WorkOrderDO;
|
||||
import top.wms.admin.weighManage.model.query.WorkOrderQuery;
|
||||
import top.wms.admin.weighManage.model.resp.WorkOrderResp;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -74,6 +82,20 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
|
||||
|
||||
private final FileService fileService;
|
||||
|
||||
@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());
|
||||
this.sort(queryWrapper, pageQuery);
|
||||
|
||||
IPage<MaterialInfoResp> page = baseMapper.selectMaterialInfoPage(new Page<>(pageQuery.getPage(), pageQuery
|
||||
.getSize()), queryWrapper);
|
||||
|
||||
return PageResp.build(page);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MaterialInfoDO getMaterialInfoByCode(String code) {
|
||||
if (StrUtil.isNotBlank(code)) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package top.wms.admin.materialProcess.mapper;
|
||||
|
||||
import top.continew.starter.data.mp.base.BaseMapper;
|
||||
import top.wms.admin.materialProcess.model.entity.MaterialProcessDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 海康物料流程 Mapper
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Repository
|
||||
public interface MaterialProcessMapper extends BaseMapper<MaterialProcessDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package top.wms.admin.materialProcess.mapstruct;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.wms.admin.materialProcess.model.entity.MaterialProcessDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MaterialProcessConvert {
|
||||
|
||||
@Mapping(source = "id", target = "value")
|
||||
@Mapping(source = "processName", target = "label")
|
||||
LabelValueResp labelValue(MaterialProcessDO materialProcessDO);
|
||||
|
||||
List<LabelValueResp> labelValueList(List<MaterialProcessDO> materialProcessDOList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package top.wms.admin.materialProcess.model.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.wms.admin.common.model.entity.BaseDO;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 海康物料流程实体
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_material_process")
|
||||
public class MaterialProcessDO extends BaseDO {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程编码
|
||||
*/
|
||||
private String processCode;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package top.wms.admin.materialProcess.model.query;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.continew.starter.data.core.annotation.Query;
|
||||
import top.continew.starter.data.core.enums.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.*;
|
||||
|
||||
/**
|
||||
* 海康物料流程查询条件
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "海康物料流程查询条件")
|
||||
public class MaterialProcessQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@Schema(description = "流程名称")
|
||||
@Query(type = QueryType.EQ)
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程编码
|
||||
*/
|
||||
@Schema(description = "流程编码")
|
||||
@Query(type = QueryType.EQ)
|
||||
private String processCode;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package top.wms.admin.materialProcess.model.req;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.*;
|
||||
|
||||
/**
|
||||
* 创建或修改海康物料流程参数
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改海康物料流程参数")
|
||||
public class MaterialProcessReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@Schema(description = "流程名称")
|
||||
@NotBlank(message = "流程名称不能为空")
|
||||
@Length(max = 255, message = "流程名称长度不能超过 {max} 个字符")
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程编码
|
||||
*/
|
||||
@Schema(description = "流程编码")
|
||||
@NotBlank(message = "流程编码不能为空")
|
||||
@Length(max = 255, message = "流程编码长度不能超过 {max} 个字符")
|
||||
private String processCode;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package top.wms.admin.materialProcess.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.wms.admin.common.model.resp.BaseDetailResp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.*;
|
||||
|
||||
/**
|
||||
* 海康物料流程详情信息
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "海康物料流程详情信息")
|
||||
public class MaterialProcessDetailResp extends BaseDetailResp {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@Schema(description = "流程名称")
|
||||
@ExcelProperty(value = "流程名称")
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程编码
|
||||
*/
|
||||
@Schema(description = "流程编码")
|
||||
@ExcelProperty(value = "流程编码")
|
||||
private String processCode;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package top.wms.admin.materialProcess.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.wms.admin.common.model.resp.BaseDetailResp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.*;
|
||||
|
||||
/**
|
||||
* 海康物料流程信息
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "海康物料流程信息")
|
||||
public class MaterialProcessResp extends BaseDetailResp {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@Schema(description = "流程名称")
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 流程编码
|
||||
*/
|
||||
@Schema(description = "流程编码")
|
||||
private String processCode;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package top.wms.admin.materialProcess.service;
|
||||
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseService;
|
||||
import top.wms.admin.materialProcess.model.query.MaterialProcessQuery;
|
||||
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessDetailResp;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海康物料流程业务接口
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
public interface MaterialProcessService extends BaseService<MaterialProcessResp, MaterialProcessResp, MaterialProcessQuery, MaterialProcessReq> {
|
||||
|
||||
List<LabelValueResp> getSelectList();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package top.wms.admin.materialProcess.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.wms.admin.materialProcess.mapper.MaterialProcessMapper;
|
||||
import top.wms.admin.materialProcess.mapstruct.MaterialProcessConvert;
|
||||
import top.wms.admin.materialProcess.model.entity.MaterialProcessDO;
|
||||
import top.wms.admin.materialProcess.model.query.MaterialProcessQuery;
|
||||
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
|
||||
import top.wms.admin.materialProcess.service.MaterialProcessService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海康物料流程业务实现
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MaterialProcessServiceImpl extends BaseServiceImpl<MaterialProcessMapper, MaterialProcessDO, MaterialProcessResp, MaterialProcessResp, MaterialProcessQuery, MaterialProcessReq> implements MaterialProcessService {
|
||||
|
||||
private final MaterialProcessConvert materialProcessConvert;
|
||||
|
||||
@Override
|
||||
public List<LabelValueResp> getSelectList() {
|
||||
List<MaterialProcessDO> materialProcessDOS = baseMapper.selectList(new QueryWrapper<>());
|
||||
return materialProcessConvert.labelValueList(materialProcessDOS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package top.wms.admin.materialType.mapper;
|
||||
|
||||
import top.continew.starter.data.mp.base.BaseMapper;
|
||||
import top.wms.admin.materialType.model.entity.MaterialTypeDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 物料品类 Mapper
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Repository
|
||||
public interface MaterialTypeMapper extends BaseMapper<MaterialTypeDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package top.wms.admin.materialType.mapstruct;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.wms.admin.materialType.model.entity.MaterialTypeDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MaterialTypeConvert {
|
||||
|
||||
@Mapping(source = "id", target = "value")
|
||||
@Mapping(source = "typeName", target = "label")
|
||||
LabelValueResp labelValue(MaterialTypeDO materialTypeDO);
|
||||
|
||||
List<LabelValueResp> labelValueList(List<MaterialTypeDO> materialTypeDOList);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package top.wms.admin.materialType.model.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import top.wms.admin.common.model.entity.BaseDO;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物料品类实体
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_material_type")
|
||||
public class MaterialTypeDO extends BaseDO {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 品类浮动比
|
||||
*/
|
||||
private BigDecimal floatRatio;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package top.wms.admin.materialType.model.query;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.continew.starter.data.core.annotation.Query;
|
||||
import top.continew.starter.data.core.enums.QueryType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物料品类查询条件
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "物料品类查询条件")
|
||||
public class MaterialTypeQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
@Schema(description = "品类名称")
|
||||
@Query(type = QueryType.EQ)
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 品类浮动比
|
||||
*/
|
||||
@Schema(description = "品类浮动比")
|
||||
@Query(type = QueryType.EQ)
|
||||
private BigDecimal floatRatio;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package top.wms.admin.materialType.model.req;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 创建或修改物料品类参数
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改物料品类参数")
|
||||
public class MaterialTypeReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
@Schema(description = "品类名称")
|
||||
@NotBlank(message = "品类名称不能为空")
|
||||
@Length(max = 255, message = "品类名称长度不能超过 {max} 个字符")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 品类浮动比
|
||||
*/
|
||||
@Schema(description = "品类浮动比")
|
||||
@NotNull(message = "品类浮动比不能为空")
|
||||
private BigDecimal floatRatio;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package top.wms.admin.materialType.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import top.wms.admin.common.model.resp.BaseDetailResp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物料品类详情信息
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "物料品类详情信息")
|
||||
public class MaterialTypeDetailResp extends BaseDetailResp {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
@Schema(description = "品类名称")
|
||||
@ExcelProperty(value = "品类名称")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 品类浮动比
|
||||
*/
|
||||
@Schema(description = "品类浮动比")
|
||||
@ExcelProperty(value = "品类浮动比")
|
||||
private BigDecimal floatRatio;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package top.wms.admin.materialType.model.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import top.wms.admin.common.model.resp.BaseDetailResp;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物料品类信息
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "物料品类信息")
|
||||
public class MaterialTypeResp extends BaseDetailResp {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
@Schema(description = "品类名称")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 品类浮动比
|
||||
*/
|
||||
@Schema(description = "品类浮动比")
|
||||
private BigDecimal floatRatio;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package top.wms.admin.materialType.service;
|
||||
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseService;
|
||||
import top.wms.admin.materialType.model.query.MaterialTypeQuery;
|
||||
import top.wms.admin.materialType.model.req.MaterialTypeReq;
|
||||
import top.wms.admin.materialType.model.resp.MaterialTypeDetailResp;
|
||||
import top.wms.admin.materialType.model.resp.MaterialTypeResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料品类业务接口
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
public interface MaterialTypeService extends BaseService<MaterialTypeResp, MaterialTypeResp, MaterialTypeQuery, MaterialTypeReq> {
|
||||
|
||||
List<LabelValueResp> getSelectList();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package top.wms.admin.materialType.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.wms.admin.materialType.mapper.MaterialTypeMapper;
|
||||
import top.wms.admin.materialType.mapstruct.MaterialTypeConvert;
|
||||
import top.wms.admin.materialType.model.entity.MaterialTypeDO;
|
||||
import top.wms.admin.materialType.model.query.MaterialTypeQuery;
|
||||
import top.wms.admin.materialType.model.req.MaterialTypeReq;
|
||||
import top.wms.admin.materialType.model.resp.MaterialTypeDetailResp;
|
||||
import top.wms.admin.materialType.model.resp.MaterialTypeResp;
|
||||
import top.wms.admin.materialType.service.MaterialTypeService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料品类业务实现
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MaterialTypeServiceImpl extends BaseServiceImpl<MaterialTypeMapper, MaterialTypeDO, MaterialTypeResp, MaterialTypeResp, MaterialTypeQuery, MaterialTypeReq> implements MaterialTypeService {
|
||||
|
||||
private final MaterialTypeConvert materialTypeConvert;
|
||||
|
||||
|
||||
@Override
|
||||
public List<LabelValueResp> getSelectList() {
|
||||
List<MaterialTypeDO> materialTypeDOS = baseMapper.selectList(new QueryWrapper<>());
|
||||
return materialTypeConvert.labelValueList(materialTypeDOS);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package top.wms.admin.weighManage.model.entity;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -38,10 +39,15 @@ public class WorkOrderDO extends BaseDO {
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 总重量
|
||||
* 实际总重量
|
||||
*/
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
/**
|
||||
* 标准总重量(标重)
|
||||
*/
|
||||
private BigDecimal totalCalculatedWeight;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WorkOrderInfoDO extends BaseDO {
|
||||
/**
|
||||
* 物料数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 称重重量
|
||||
|
||||
@@ -30,13 +30,6 @@ public class WorkOrderReq implements Serializable {
|
||||
@NotNull(message = "物料主键id不能为空")
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@Schema(description = "物料名称")
|
||||
@NotBlank(message = "物料名称不能为空")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 称重列表
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,7 @@ public class WorkOrderInfoResp {
|
||||
* 物料数量
|
||||
*/
|
||||
@Schema(description = "物料数量")
|
||||
private BigDecimal quantity;
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 称重重量
|
||||
|
||||
@@ -73,16 +73,6 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
|
||||
workOrderResp.setEncoding(materialInfoDO.getEncoding());
|
||||
}
|
||||
|
||||
List<WorkOrderInfoDO> workOrderInfos = workOrderInfoMapper.selectList(new QueryWrapper<WorkOrderInfoDO>()
|
||||
.eq("work_order_id", id));
|
||||
if (CollUtil.isNotEmpty(workOrderInfos)) {
|
||||
BigDecimal bigDecimal = new BigDecimal("0");
|
||||
for (WorkOrderInfoDO workOrderInfoDO : workOrderInfos) {
|
||||
bigDecimal = bigDecimal.add(workOrderInfoDO.getCalculatedWeight());
|
||||
}
|
||||
workOrderResp.setTotalCalculatedWeight(bigDecimal);
|
||||
}
|
||||
|
||||
return workOrderResp;
|
||||
}
|
||||
|
||||
@@ -109,17 +99,20 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
|
||||
totalCount += workOrderInfoReq.getQuantity();
|
||||
}
|
||||
|
||||
MaterialInfoDO materialInfoDO = materialInfoMapper.selectById(req.getMaterialId());
|
||||
|
||||
WorkOrderDO workOrder = new WorkOrderDO();
|
||||
// 生成纯数字订单号:年月日时分秒 + 6位随机数
|
||||
String timestamp = DateUtil.format(new Date(), "yyyyMMddHHmmss");
|
||||
String randomNum = String.format("%06d", (int)(Math.random() * 1000000));
|
||||
workOrder.setOrderNo(timestamp + randomNum);
|
||||
String title = DateUtil.format(new Date(), DatePattern.CHINESE_DATE_PATTERN) + "-" + UserContextHolder
|
||||
.getUsername() + "-" + req.getMaterialName();
|
||||
.getUsername() + "-" + materialInfoDO.getMaterialName();
|
||||
workOrder.setTitle(title);
|
||||
workOrder.setMaterialId(req.getMaterialId());
|
||||
workOrder.setTotalWeight(totalWeight);
|
||||
workOrder.setTotalCount(totalCount);
|
||||
workOrder.setTotalCalculatedWeight(materialInfoDO.getUnitWeight().multiply(BigDecimal.valueOf(totalCount)));
|
||||
baseMapper.insert(workOrder);
|
||||
|
||||
//新增工单详情列表信息
|
||||
|
||||
@@ -49,4 +49,16 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectMaterialInfoPage" resultType="top.wms.admin.material.model.resp.MaterialInfoResp">
|
||||
SELECT
|
||||
mi.*,
|
||||
mt.type_name typeName,
|
||||
mp.process_name processName
|
||||
FROM
|
||||
sys_material_info mi
|
||||
left join sys_material_type mt on mi.material_type_id = mt.id
|
||||
left join sys_material_process mp on mi.material_process_id = mp.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package top.wms.admin.controller.materialProcess;
|
||||
|
||||
import top.continew.starter.extension.crud.enums.Api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.log.annotation.Log;
|
||||
import top.wms.admin.common.controller.BaseController;
|
||||
import top.wms.admin.materialProcess.model.query.MaterialProcessQuery;
|
||||
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
|
||||
import top.wms.admin.materialProcess.service.MaterialProcessService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海康物料流程管理 API
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 17:22
|
||||
*/
|
||||
@Tag(name = "海康物料流程管理 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@CrudRequestMapping(value = "/materialProcess/materialProcess", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||
public class MaterialProcessController extends BaseController<MaterialProcessService, MaterialProcessResp, MaterialProcessResp, MaterialProcessQuery, MaterialProcessReq> {
|
||||
|
||||
|
||||
@Log(ignore = true)
|
||||
@GetMapping("/selectList")
|
||||
public List<LabelValueResp> getSelectList() {
|
||||
return baseService.getSelectList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package top.wms.admin.controller.materialType;
|
||||
|
||||
import top.continew.starter.extension.crud.enums.Api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.log.annotation.Log;
|
||||
import top.wms.admin.common.controller.BaseController;
|
||||
import top.wms.admin.materialType.model.query.MaterialTypeQuery;
|
||||
import top.wms.admin.materialType.model.req.MaterialTypeReq;
|
||||
import top.wms.admin.materialType.model.resp.MaterialTypeResp;
|
||||
import top.wms.admin.materialType.service.MaterialTypeService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料品类管理 API
|
||||
*
|
||||
* @author zc
|
||||
* @since 2026/03/16 11:18
|
||||
*/
|
||||
@Tag(name = "物料品类管理 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@CrudRequestMapping(value = "/materialType/materialType", api = {Api.PAGE, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||
public class MaterialTypeController extends BaseController<MaterialTypeService, MaterialTypeResp, MaterialTypeResp, MaterialTypeQuery, MaterialTypeReq> {
|
||||
|
||||
|
||||
@Log(ignore = true)
|
||||
@GetMapping("/selectList")
|
||||
public List<LabelValueResp> getSelectList() {
|
||||
return baseService.getSelectList();
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class CommandService {
|
||||
@Autowired
|
||||
private ChannelManager channelManager;
|
||||
|
||||
@Scheduled(cron = "*/1 * * * * ?")
|
||||
// @Scheduled(cron = "*/1 * * * * ?")
|
||||
public void sendAndWait() {
|
||||
// 1. 检查连接
|
||||
log.info("查询时间========");
|
||||
|
||||
@@ -41,6 +41,12 @@ public class WorkOrderController extends BaseController<WorkOrderService, WorkOr
|
||||
return baseService.getWorkOrderInfos(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打印标签时调用得接口
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Log(ignore = true)
|
||||
@SaCheckPermission("workOrder:record:detail")
|
||||
@GetMapping(value = "/{id}")
|
||||
|
||||
@@ -49,7 +49,7 @@ public class AHDZCConnect {
|
||||
|
||||
private ScheduledExecutorService executorService;
|
||||
|
||||
@PostConstruct
|
||||
// @PostConstruct
|
||||
public void init() {
|
||||
// 项目启动时初始化并启动服务
|
||||
ScaleService();
|
||||
@@ -57,7 +57,7 @@ public class AHDZCConnect {
|
||||
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
// @PreDestroy
|
||||
public void destroy() {
|
||||
// 项目关闭时停止服务
|
||||
stop();
|
||||
|
||||
Reference in New Issue
Block a user