|
|
@@ -1,8 +1,11 @@
|
|
|
package com.dk.mdm.service.mst;
|
|
|
|
|
|
+import com.dk.common.exception.BaseBusinessException;
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
|
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
+import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.GoodsBrandConvert;
|
|
|
@@ -97,6 +100,15 @@ public class GoodsSeriesService extends BaseService<GoodsSeries> {
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.SERIES.getName(), true);
|
|
|
goodsSeries.setSeriesId(uniqueNoteCode.get("outId").toString());
|
|
|
goodsSeries.setSeriesCode(uniqueNoteCode.get("outNote").toString());
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 判断是否存在相同名称 如果存在直接抛出异常 不进行下一部操作
|
|
|
+ * 刘尧 2024/5/29
|
|
|
+ * */
|
|
|
+ if(goodsSeriesMapper.checkNameDuplicated(goodsSeries) > 0){
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISEXISTS_CATNAME.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
//新建
|
|
|
goodsSeriesMapper.insert(goodsSeries);
|
|
|
return ResponseResultUtil.success(goodsSeries);
|
|
|
@@ -114,6 +126,15 @@ public class GoodsSeriesService extends BaseService<GoodsSeries> {
|
|
|
)
|
|
|
public ResponseResultVO<?> update(GoodsSeriesVO goodsSeriesVO) {
|
|
|
GoodsSeries goodsSeries = goodsSeriesConvert.convertToPo(goodsSeriesVO);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 判断是否存在相同名称 如果存在直接抛出异常 不进行下一部操作
|
|
|
+ * 刘尧 2024/5/29
|
|
|
+ * */
|
|
|
+ if(goodsSeriesMapper.checkNameDuplicated(goodsSeries) > 0){
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISEXISTS_CATNAME.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
super.updateByUuid(goodsSeries);
|
|
|
return ResponseResultUtil.success();
|
|
|
}
|