|
@@ -2,7 +2,7 @@ package org.jeecg.modules.adweb.userCountry.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import kotlin.jvm.internal.Lambda;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
@@ -331,11 +332,11 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
|
|
|
List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
|
|
|
|
|
|
List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(param.getSiteId());
|
|
|
- UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
|
|
|
- enquiryUpdateWrapper.in("country_code", countryCodes);
|
|
|
- enquiryUpdateWrapper.in("site_id", siteIds);
|
|
|
- enquiryUpdateWrapper.ne("principal_type", 1);
|
|
|
- enquiryUpdateWrapper.set("principal_uid", param.getUid());
|
|
|
+ LambdaUpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ enquiryUpdateWrapper.in(AdwebEnquiry::getCountryCode, countryCodes);
|
|
|
+ enquiryUpdateWrapper.in(AdwebEnquiry::getSiteId, siteIds);
|
|
|
+ enquiryUpdateWrapper.ne(AdwebEnquiry::getPrincipalType, 1);
|
|
|
+ enquiryUpdateWrapper.set(AdwebEnquiry::getPrincipalUid, param.getUid());
|
|
|
adwebEnquiryService.update(enquiryUpdateWrapper);
|
|
|
|
|
|
return Result.OK();
|
|
@@ -364,28 +365,28 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
|
|
|
Collections.addAll(countryIdList, countryIds.split(","));
|
|
|
}
|
|
|
countryIdList.removeIf(this::notNum);
|
|
|
- UpdateWrapper<AdwebUserCountry> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("uid", uid);
|
|
|
- updateWrapper.eq("site_id", param.getSiteId());
|
|
|
+ LambdaUpdateWrapper<AdwebUserCountry> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(AdwebUserCountry::getUid, uid);
|
|
|
+ updateWrapper.eq(AdwebUserCountry::getSiteId, param.getSiteId());
|
|
|
if (CollectionUtils.isNotEmpty(countryIdList)) {
|
|
|
- updateWrapper.notIn("country_id", countryIdList);
|
|
|
+ updateWrapper.notIn(AdwebUserCountry::getCountryId, countryIdList);
|
|
|
}
|
|
|
- updateWrapper.set("status", 0);
|
|
|
+ updateWrapper.set(AdwebUserCountry::getStatus, 0);
|
|
|
adwebUserCountryService.update(updateWrapper);
|
|
|
|
|
|
// 更改相关询盘的负责人
|
|
|
List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(param.getSiteId());
|
|
|
- UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ LambdaUpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
if (CollectionUtils.isNotEmpty(countryIdList)) {
|
|
|
- QueryWrapper<AdwebCountry> countryQueryWrapper = new QueryWrapper<>();
|
|
|
- countryQueryWrapper.in("geoname_id", countryIdList);
|
|
|
+ LambdaQueryWrapper<AdwebCountry> countryQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ countryQueryWrapper.in(AdwebCountry::getGeonameId, countryIdList);
|
|
|
List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
|
|
|
List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
|
|
|
- enquiryUpdateWrapper.notIn("country_code", countryCodes);
|
|
|
+ enquiryUpdateWrapper.notIn(AdwebEnquiry::getCountryCode, countryCodes);
|
|
|
}
|
|
|
- enquiryUpdateWrapper.in("site_id", siteIds);
|
|
|
- enquiryUpdateWrapper.eq("principal_uid", param.getUid());
|
|
|
- enquiryUpdateWrapper.ne("principal_type", 1);
|
|
|
+ enquiryUpdateWrapper.in(AdwebEnquiry::getSiteId, siteIds);
|
|
|
+ enquiryUpdateWrapper.eq(AdwebEnquiry::getPrincipalUid, param.getUid());
|
|
|
+ enquiryUpdateWrapper.ne(AdwebEnquiry::getPrincipalType, 1);
|
|
|
enquiryUpdateWrapper.setSql("principal_uid = uid");
|
|
|
adwebEnquiryService.update(enquiryUpdateWrapper);
|
|
|
return Result.OK();
|
|
@@ -401,21 +402,21 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
|
|
|
// if(sysUser.isPerform()){
|
|
|
// return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
|
|
|
// }
|
|
|
- UpdateWrapper<AdwebSite> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("id", siteId);
|
|
|
- updateWrapper.set("enquiry_distribute_type", distributeType);
|
|
|
+ LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(AdwebSite::getId, siteId);
|
|
|
+ updateWrapper.set(AdwebSite::getEnquiryDistributeType, distributeType);
|
|
|
adwebSiteService.update(updateWrapper);
|
|
|
|
|
|
// 修改询盘的跟进人
|
|
|
if (EnquiryDistributeTypeConstant.MASTER.equals(distributeType)) {
|
|
|
- UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
|
|
|
- enquiryUpdateWrapper.ne("principal_type", 1);
|
|
|
+ LambdaUpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ enquiryUpdateWrapper.ne(AdwebEnquiry::getPrincipalType, 1);
|
|
|
enquiryUpdateWrapper.setSql("principal_uid = uid");
|
|
|
adwebEnquiryService.update(enquiryUpdateWrapper);
|
|
|
} else if (EnquiryDistributeTypeConstant.ALL.equals(distributeType)) {
|
|
|
- UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
|
|
|
- enquiryUpdateWrapper.ne("principal_type", 1);
|
|
|
- enquiryUpdateWrapper.set("principal_uid", "ALL");
|
|
|
+ LambdaUpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ enquiryUpdateWrapper.ne(AdwebEnquiry::getPrincipalType, 1);
|
|
|
+ enquiryUpdateWrapper.set(AdwebEnquiry::getPrincipalUid, "ALL");
|
|
|
adwebEnquiryService.update(enquiryUpdateWrapper);
|
|
|
} else if (EnquiryDistributeTypeConstant.REGION.equals(distributeType)) {
|
|
|
adwebEnquiryService.updatePrincipalUidByRegion(siteId);
|
|
@@ -433,9 +434,9 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
|
|
|
// if(sysUser.isPerform()){
|
|
|
// return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
|
|
|
// }
|
|
|
- UpdateWrapper<AdwebSite> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("id", siteId);
|
|
|
- updateWrapper.set("enquiry_send_email_type", sendEmailType);
|
|
|
+ LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(AdwebSite::getId, siteId);
|
|
|
+ updateWrapper.set(AdwebSite::getEnquirySendEmailType, sendEmailType);
|
|
|
adwebSiteService.update(updateWrapper);
|
|
|
|
|
|
return Result.OK();
|