|
|
@@ -1,6 +1,7 @@
|
|
|
package com.dk.mdm.service.mst;
|
|
|
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
+import com.dk.common.infrastructure.constant.Constant;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
@@ -18,6 +19,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
@@ -74,14 +76,10 @@ public class DictionaryDataService extends BaseService<DictionaryData> {
|
|
|
public ResponseResultVO<?> insert(DictionaryDataVO dictionaryDataVO) {
|
|
|
//实体转换
|
|
|
DictionaryData dictionaryData = dictionaryDataConvert.convertToPo(dictionaryDataVO);
|
|
|
-
|
|
|
- Integer displayNo = dictionaryDataMapper.selectDisplayNo(new DictionaryDataQuery());
|
|
|
- if (displayNo != null) {
|
|
|
- //插入序号
|
|
|
- dictionaryData.setDisplayNo(displayNo);
|
|
|
- } else {
|
|
|
- dictionaryData.setDisplayNo(0);
|
|
|
- }
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("dictCode",dictionaryDataVO.getDictCode());
|
|
|
+ //设置序号
|
|
|
+ dictionaryData.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.DICTIONARYDATA,map));
|
|
|
//设置编码
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(dictionaryDataVO.getDictCode(), true);
|
|
|
dictionaryData.setDataId(uniqueNoteCode.get("outId").toString());
|