优化
This commit is contained in:
@@ -26,15 +26,15 @@ public class CardLoginHandler extends AbstractLoginHandler<CardLoginReq> {
|
||||
return LoginResp.builder().token(token).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preLogin(PhoneLoginReq req, ClientResp client, HttpServletRequest request) {
|
||||
String phone = req.getPhone();
|
||||
String captchaKey = CacheConstants.CAPTCHA_KEY_PREFIX + phone;
|
||||
String captcha = RedisUtils.get(captchaKey);
|
||||
ValidationUtils.throwIfBlank(captcha, CAPTCHA_EXPIRED);
|
||||
ValidationUtils.throwIfNotEqualIgnoreCase(req.getCaptcha(), captcha, CAPTCHA_ERROR);
|
||||
RedisUtils.delete(captchaKey);
|
||||
}
|
||||
// @Override
|
||||
// public void preLogin(PhoneLoginReq req, ClientResp client, HttpServletRequest request) {
|
||||
// String phone = req.getPhone();
|
||||
// String captchaKey = CacheConstants.CAPTCHA_KEY_PREFIX + phone;
|
||||
// String captcha = RedisUtils.get(captchaKey);
|
||||
// ValidationUtils.throwIfBlank(captcha, CAPTCHA_EXPIRED);
|
||||
// ValidationUtils.throwIfNotEqualIgnoreCase(req.getCaptcha(), captcha, CAPTCHA_ERROR);
|
||||
// RedisUtils.delete(captchaKey);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public AuthTypeEnum getAuthType() {
|
||||
|
||||
@@ -37,10 +37,10 @@ public class MaterialInfoDO extends BaseDO {
|
||||
*/
|
||||
private BigDecimal unitWeight;
|
||||
|
||||
/**
|
||||
* 物料单次可称量最大重量(kg)
|
||||
*/
|
||||
private BigDecimal maxWeight;
|
||||
/*
|
||||
物料规格
|
||||
*/
|
||||
private String materialSpec;
|
||||
|
||||
/**
|
||||
* 物料照片地址
|
||||
|
||||
@@ -46,11 +46,11 @@ public class MaterialInfoReq implements Serializable {
|
||||
@Schema(description = "物料单位重量(g)")
|
||||
private Double unitWeight;
|
||||
|
||||
/**
|
||||
* 物料单次可称量最大重量(kg)
|
||||
*/
|
||||
@Schema(description = "物料单次可称量最大重量(kg)")
|
||||
private Double maxWeight;
|
||||
/*
|
||||
* 物料规格
|
||||
* */
|
||||
@Schema(description = "物料规格")
|
||||
private String materialSpec;
|
||||
|
||||
/**
|
||||
* 物料照片地址
|
||||
|
||||
@@ -45,11 +45,11 @@ public class MaterialInfoResp extends BaseDetailResp {
|
||||
private Double unitWeight;
|
||||
|
||||
/**
|
||||
* 物料单次可称量最大重量(kg)
|
||||
* 物料规格
|
||||
*/
|
||||
@Schema(description = "物料单次可称量最大重量(kg)")
|
||||
@ExcelProperty(value = "物料单次可称量最大重量(kg)")
|
||||
private Double maxWeight;
|
||||
@Schema(description = "物料规格")
|
||||
@ExcelProperty(value = "物料规格")
|
||||
private Double materialSpec;
|
||||
|
||||
/**
|
||||
* 物料照片地址
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package top.wms.admin.material.service;
|
||||
|
||||
import top.continew.starter.extension.crud.service.BaseService;
|
||||
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
||||
import top.wms.admin.material.model.query.MaterialInfoQuery;
|
||||
import top.wms.admin.material.model.req.MaterialInfoReq;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoResp;
|
||||
@@ -12,5 +13,5 @@ import top.wms.admin.material.model.resp.MaterialInfoResp;
|
||||
* @since 2026/02/27 14:19
|
||||
*/
|
||||
public interface MaterialInfoService extends BaseService<MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> {
|
||||
|
||||
public MaterialInfoDO getMaterialInfoByCode(String code);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package top.wms.admin.material.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -22,4 +26,12 @@ import top.wms.admin.material.service.MaterialInfoService;
|
||||
@RequiredArgsConstructor
|
||||
public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper, MaterialInfoDO, MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> implements MaterialInfoService {
|
||||
|
||||
@Override
|
||||
public MaterialInfoDO getMaterialInfoByCode(String code) {
|
||||
if(StrUtil.isNotBlank(code)){
|
||||
return baseMapper.lambdaQuery().eq(MaterialInfoDO::getEncoding, code).one();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user