Commit 6142c350 by 陶光胜

配置表

parent 2917f24c
......@@ -2,6 +2,7 @@ package com.gic.enterprise.service.outer.impl;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.ToolUtil;
import com.gic.dsmongo.api.constant.enums.MongoOperTypeEnum;
import com.gic.dsmongo.api.dto.Criteria;
import com.gic.dsmongo.api.dto.MongoQueryDTO;
......@@ -64,13 +65,7 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
if(tableSetting.getRepeateOpt() != null && tableSetting.getRepeateOpt() == 1){
//等于1表示重复更新
Map exitMap = query.getResult().get(0);
map.forEach((k, v) -> {
if(k.equals(PRIMARYKEY)){
exitMap.put("ObjectId(\"" +k + "\")", v);
} else {
exitMap.put(k, v);
}
});
map.forEach((k, v) -> exitMap.put(k, v));
map = exitMap;
} else {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "存在重复记录");
......@@ -91,6 +86,7 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
map.put("update_time", date);
map.put("create_time", date);
MongoSaveDTO mongoSaveDTO = new MongoSaveDTO();
map.put(PRIMARYKEY, ToolUtil.randomUUID());
mongoSaveDTO.setDataBaseAndCollectionName(DATABASENAME, tableName);
mongoSaveDTO.setData(map);
ServiceResponse<String> save = mongoOperApiService.save(mongoSaveDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment