This commit is contained in:
2026-03-03 15:03:31 +08:00
parent b54e1e314a
commit b37300ef8c
7 changed files with 43 additions and 24 deletions

View File

@@ -26,15 +26,15 @@ public class CardLoginHandler extends AbstractLoginHandler<CardLoginReq> {
return LoginResp.builder().token(token).build(); return LoginResp.builder().token(token).build();
} }
@Override // @Override
public void preLogin(PhoneLoginReq req, ClientResp client, HttpServletRequest request) { // public void preLogin(PhoneLoginReq req, ClientResp client, HttpServletRequest request) {
String phone = req.getPhone(); // String phone = req.getPhone();
String captchaKey = CacheConstants.CAPTCHA_KEY_PREFIX + phone; // String captchaKey = CacheConstants.CAPTCHA_KEY_PREFIX + phone;
String captcha = RedisUtils.get(captchaKey); // String captcha = RedisUtils.get(captchaKey);
ValidationUtils.throwIfBlank(captcha, CAPTCHA_EXPIRED); // ValidationUtils.throwIfBlank(captcha, CAPTCHA_EXPIRED);
ValidationUtils.throwIfNotEqualIgnoreCase(req.getCaptcha(), captcha, CAPTCHA_ERROR); // ValidationUtils.throwIfNotEqualIgnoreCase(req.getCaptcha(), captcha, CAPTCHA_ERROR);
RedisUtils.delete(captchaKey); // RedisUtils.delete(captchaKey);
} // }
@Override @Override
public AuthTypeEnum getAuthType() { public AuthTypeEnum getAuthType() {

View File

@@ -37,10 +37,10 @@ public class MaterialInfoDO extends BaseDO {
*/ */
private BigDecimal unitWeight; private BigDecimal unitWeight;
/** /*
* 物料单次可称量最大重量(kg) 物料规格
*/ */
private BigDecimal maxWeight; private String materialSpec;
/** /**
* 物料照片地址 * 物料照片地址

View File

@@ -46,11 +46,11 @@ public class MaterialInfoReq implements Serializable {
@Schema(description = "物料单位重量(g)") @Schema(description = "物料单位重量(g)")
private Double unitWeight; private Double unitWeight;
/** /*
* 物料单次可称量最大重量(kg) * 物料规格
*/ * */
@Schema(description = "物料单次可称量最大重量(kg)") @Schema(description = "物料规格")
private Double maxWeight; private String materialSpec;
/** /**
* 物料照片地址 * 物料照片地址

View File

@@ -45,11 +45,11 @@ public class MaterialInfoResp extends BaseDetailResp {
private Double unitWeight; private Double unitWeight;
/** /**
* 物料单次可称量最大重量(kg) * 物料规格
*/ */
@Schema(description = "物料单次可称量最大重量(kg)") @Schema(description = "物料规格")
@ExcelProperty(value = "物料单次可称量最大重量(kg)") @ExcelProperty(value = "物料规格")
private Double maxWeight; private Double materialSpec;
/** /**
* 物料照片地址 * 物料照片地址

View File

@@ -1,6 +1,7 @@
package top.wms.admin.material.service; package top.wms.admin.material.service;
import top.continew.starter.extension.crud.service.BaseService; 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.query.MaterialInfoQuery;
import top.wms.admin.material.model.req.MaterialInfoReq; import top.wms.admin.material.model.req.MaterialInfoReq;
import top.wms.admin.material.model.resp.MaterialInfoResp; 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 * @since 2026/02/27 14:19
*/ */
public interface MaterialInfoService extends BaseService<MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> { public interface MaterialInfoService extends BaseService<MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> {
public MaterialInfoDO getMaterialInfoByCode(String code);
} }

View File

@@ -1,5 +1,9 @@
package top.wms.admin.material.service.impl; 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 lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -22,4 +26,12 @@ import top.wms.admin.material.service.MaterialInfoService;
@RequiredArgsConstructor @RequiredArgsConstructor
public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper, MaterialInfoDO, MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> implements MaterialInfoService { 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;
}
}
} }

View File

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping; import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.wms.admin.common.controller.BaseController; import top.wms.admin.common.controller.BaseController;
import top.wms.admin.material.model.entity.MaterialInfoDO;
import top.wms.admin.material.model.query.MaterialInfoQuery; import top.wms.admin.material.model.query.MaterialInfoQuery;
import top.wms.admin.material.model.req.MaterialInfoReq; import top.wms.admin.material.model.req.MaterialInfoReq;
import top.wms.admin.material.model.resp.MaterialInfoResp; import top.wms.admin.material.model.resp.MaterialInfoResp;
@@ -23,8 +24,13 @@ import top.wms.admin.material.service.MaterialInfoService;
@Tag(name = "物料信息管理 API") @Tag(name = "物料信息管理 API")
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@CrudRequestMapping(value = "/admin/meterialInfo", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, @CrudRequestMapping(value = "/admin/materialInfo", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE,
Api.EXPORT}) Api.EXPORT})
public class MaterialInfoController extends BaseController<MaterialInfoService, MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> { public class MaterialInfoController extends BaseController<MaterialInfoService, MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> {
@GetMapping("/code/{code}")
public MaterialInfoDO getMaterialInfoByCode(@PathVariable String code) {
return baseService.getMaterialInfoByCode(code);
}
} }