|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package org.jeecg.modules.demo.base.service.impl; |
|
|
|
|
|
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.modules.demo.base.entity.ZyClothsType; |
|
|
|
|
import org.jeecg.modules.demo.base.mapper.ZyClothsTypeMapper; |
|
|
|
|
import org.jeecg.modules.demo.base.service.IZyClothsTypeService; |
|
|
|
@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
@ -93,7 +95,10 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC |
|
|
|
|
* @return 返回一个long类型的digits位数最大值 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Long getListMax(@NotNull List<String> stringList, int digits) { |
|
|
|
|
public Long getListMax(List<String> stringList, int digits) { |
|
|
|
|
if (ObjectUtils.isEmpty(stringList)){ |
|
|
|
|
return 1L; |
|
|
|
|
} |
|
|
|
|
List<Long> longList = new ArrayList<>(); |
|
|
|
|
String REGEX = "[^0-9]"; |
|
|
|
|
for (String nums : stringList) { |
|
|
|
@ -116,4 +121,20 @@ public class ZyClothsTypeServiceImpl extends ServiceImpl<ZyClothsTypeMapper, ZyC |
|
|
|
|
return max; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<?> handleEmpty(ZyClothsType zyClothsType) { |
|
|
|
|
if (ObjectUtils.isEmpty(zyClothsType)){ |
|
|
|
|
return Result.error("服装类型数据 不能为空"); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isEmpty(zyClothsType.getNums())) { |
|
|
|
|
return Result.error("服装类型编号 不能为空"); |
|
|
|
|
} |
|
|
|
|
//type_name,类型名称,varchar,50,非空,同类型下不重复
|
|
|
|
|
if (!StringUtils.hasText(zyClothsType.getTypeName())) { |
|
|
|
|
return Result.error("类型名称 不能为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Result.error("true"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|