商品分组禁用清空起止时间
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.czg.service.product.service.impl;
|
package com.czg.service.product.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -121,8 +122,13 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
if (exists) {
|
if (exists) {
|
||||||
throw new CzgException("商品分组已存在");
|
throw new CzgException("商品分组已存在");
|
||||||
}
|
}
|
||||||
ProdGroup entity = BeanUtil.copyProperties(dto, ProdGroup.class);
|
ProdGroup entity = getById(dto.getId());
|
||||||
super.updateById(entity);
|
BeanUtil.copyProperties(dto, entity, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
if (entity.getStatus() == StatusEnum.DISABLE.value()) {
|
||||||
|
entity.setSaleStartTime(null);
|
||||||
|
entity.setSaleEndTime(null);
|
||||||
|
}
|
||||||
|
super.updateById(entity, false);
|
||||||
if (!isUpdateProduct) {
|
if (!isUpdateProduct) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user