|
@@ -2,7 +2,9 @@ package com.dk.mdm.service.mst;
|
|
|
|
|
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
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.model.pojo.PageList;
|
|
|
|
|
+import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.SaleChannelConvert;
|
|
import com.dk.mdm.infrastructure.convert.mst.SaleChannelConvert;
|
|
@@ -11,6 +13,7 @@ import com.dk.mdm.mapper.mst.SaleChannelMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
import com.dk.common.service.BaseService;
|
|
|
import com.dk.common.mapper.BaseMapper;
|
|
import com.dk.common.mapper.BaseMapper;
|
|
|
import com.dk.mdm.model.query.mst.SaleChannelQuery;
|
|
import com.dk.mdm.model.query.mst.SaleChannelQuery;
|
|
|
|
|
+import com.dk.mdm.model.response.mst.SaleChannelResponse;
|
|
|
import com.dk.mdm.model.response.mst.WarehouseResponse;
|
|
import com.dk.mdm.model.response.mst.WarehouseResponse;
|
|
|
import com.dk.mdm.model.vo.mst.SaleChannelVO;
|
|
import com.dk.mdm.model.vo.mst.SaleChannelVO;
|
|
|
import com.dk.mdm.model.vo.mst.WarehouseVO;
|
|
import com.dk.mdm.model.vo.mst.WarehouseVO;
|
|
@@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -81,8 +85,18 @@ public class SaleChannelService extends BaseService<SaleChannel> {
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.SALECHANNEL.getName(), true);
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.SALECHANNEL.getName(), true);
|
|
|
saleChannel.setChannelId(uniqueNoteCode.get("outId").toString());
|
|
saleChannel.setChannelId(uniqueNoteCode.get("outId").toString());
|
|
|
saleChannel.setChannelCode(uniqueNoteCode.get("outNote").toString());
|
|
saleChannel.setChannelCode(uniqueNoteCode.get("outNote").toString());
|
|
|
- //新建
|
|
|
|
|
- saleChannelMapper.insert(saleChannel);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //查重
|
|
|
|
|
+ List<SaleChannelResponse> saleChannelResponses = saleChannelMapper.selectByCond(new SaleChannelQuery().setChannelName(saleChannel.getChannelName()));
|
|
|
|
|
+ if(saleChannelResponses.size() > 0){
|
|
|
|
|
+ return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SALECHANNEL_NAME_NOT.getMessage());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //新建
|
|
|
|
|
+ saleChannelMapper.insert(saleChannel);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
return ResponseResultUtil.success();
|
|
return ResponseResultUtil.success();
|
|
|
}
|
|
}
|