|
@@ -1,11 +1,22 @@
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
|
+import com.yh.saas.common.support.util.IdGenerator;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.SearchRecordsInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.SearchRecordsInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.SearchRecordsInfoMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.SearchRecordsInfoMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ISearchRecordsInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ISearchRecordsInfoService;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
+import org.springframework.data.mongodb.core.aggregation.ArrayOperators;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 搜索记录 服务实现类
|
|
* 搜索记录 服务实现类
|
|
@@ -17,4 +28,33 @@ import org.springframework.stereotype.Service;
|
|
@Service
|
|
@Service
|
|
public class SearchRecordsInfoServiceImpl extends ServiceImpl<SearchRecordsInfoMapper, SearchRecordsInfo> implements ISearchRecordsInfoService {
|
|
public class SearchRecordsInfoServiceImpl extends ServiceImpl<SearchRecordsInfoMapper, SearchRecordsInfo> implements ISearchRecordsInfoService {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 新增搜索记录
|
|
|
|
+ *
|
|
|
|
+ * @param searchRecordsInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String addInfo(SearchRecordsInfo searchRecordsInfo) {
|
|
|
|
+ //判断记录是否存在
|
|
|
|
+ SearchRecordsInfo searchRecordsInfo1 =
|
|
|
|
+ this.selectOne(new EntityWrapper<SearchRecordsInfo>()
|
|
|
|
+ .eq(SearchRecordsInfo.QueryFiles.COMP_ID, AuthSecurityUtils.getCurrentUserInfo().getCompId())
|
|
|
|
+ .eq("search_content", searchRecordsInfo.getSearchContent())
|
|
|
|
+ .eq(ContractManagementInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
|
|
|
|
+ //已存在,次数加1
|
|
|
|
+ if (searchRecordsInfo1!=null) {
|
|
|
|
+ Long count=searchRecordsInfo.getSearchCount()+1;
|
|
|
|
+ searchRecordsInfo.setSearchCount(count);
|
|
|
|
+ this.updateById(searchRecordsInfo);
|
|
|
|
+ }
|
|
|
|
+ //新增
|
|
|
|
+ else{
|
|
|
|
+ //新增主键id
|
|
|
|
+ searchRecordsInfo.setId(IdGenerator.generateUUID());
|
|
|
|
+ // 操作主表数据
|
|
|
|
+ this.insert(searchRecordsInfo);
|
|
|
|
+ }
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
}
|
|
}
|