|
@@ -8,7 +8,6 @@ import cn.hutool.core.lang.tree.TreeUtil;
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.text.CharSequenceUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -729,20 +728,46 @@ public class SysImplementPlanManager {
|
|
|
String consignee = res.getConsignee();
|
|
|
|
|
|
// 校验空值
|
|
|
- if (StrUtil.hasBlank(skuName, planType, planScore, year, quarter, planName, consignee)) {
|
|
|
+ if (StrUtil.hasBlank(skuName, planType, planScore, year, planName, consignee)) {
|
|
|
errorMsg.append("服务计划信息不全,存在未填写的内容;");
|
|
|
}
|
|
|
|
|
|
+ // 校验类型
|
|
|
+ if (!StrUtil.equalsAny(planType, "年度", "季度")){
|
|
|
+ errorMsg.append("计划类型不正确;");
|
|
|
+ }
|
|
|
+
|
|
|
+ if ("季度".equals(planType) && StrUtil.isBlank(quarter)){
|
|
|
+ errorMsg.append("季度服务计划所属季度缺失;");
|
|
|
+ }
|
|
|
+
|
|
|
// 校验积分
|
|
|
- if (!NumberUtil.isLong(planScore)) {
|
|
|
+ try {
|
|
|
+ if (Long.parseLong(planScore) <= 0){
|
|
|
+ errorMsg.append("计划值小于0;");
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException e){
|
|
|
errorMsg.append("计划值不是整数;");
|
|
|
}
|
|
|
|
|
|
// 校验年度和季度
|
|
|
- if (!NumberUtil.isInteger(year) || !NumberUtil.isInteger(quarter)) {
|
|
|
- errorMsg.append("年度或季度非数字;");
|
|
|
+ try {
|
|
|
+ if (Integer.parseInt(year) <= 0){
|
|
|
+ errorMsg.append("年度小于0;");
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException e){
|
|
|
+ errorMsg.append("年度非数字;");
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (Integer.parseInt(quarter) <= 0){
|
|
|
+ errorMsg.append("季度小于0;");
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException e){
|
|
|
+ errorMsg.append("季度非数字;");
|
|
|
}
|
|
|
|
|
|
+ // 校验商品
|
|
|
if (CollUtil.isEmpty(drugs)) {
|
|
|
errorMsg.append("产品不存在;");
|
|
|
} else {
|