Commit 5c4aaae4 by 陶光胜

修改门店分组上级刷新es

parent 3496e06d
......@@ -48,6 +48,7 @@ public class StoreDTO extends StoreInfoDTO implements Serializable {
private String remark;
private Integer operatorId;
private String operatorName;
private Integer license = Integer.MAX_VALUE;
/**
* 小程序默认图片
*/
......@@ -188,4 +189,12 @@ public class StoreDTO extends StoreInfoDTO implements Serializable {
public StorePhotoDTO getDefaultPhoto() {
return defaultPhoto;
}
public Integer getLicense() {
return license;
}
public void setLicense(Integer license) {
this.license = license;
}
}
\ No newline at end of file
......@@ -60,9 +60,13 @@ public class StoreServiceImpl implements StoreService {
tabStoreInfo.setLongitude(copy.getLongitude());
tabStoreInfo.setLatitude(copy.getLatitude());
tabStoreInfo.setCompleteStatus(copy.getCompleteStatus());
// TODO 这里要判断一下总量
tabStoreInfo.setOverflowStatus(0);
// 这里要判断一下总量
Integer count = this.countByStoreName(copy.getEnterpriseId(), "", null);
if(count >= copy.getLicense()){
tabStoreInfo.setOverflowStatus(1);
}else {
tabStoreInfo.setOverflowStatus(0);
}
tabStoreInfo.setStatus(copy.getStatus());
tabStoreInfo.setErpStatus(copy.getErpStatus());
tabStoreInfo.setStoreType(copy.getStoreType());
......
......@@ -8,6 +8,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.*;
import com.gic.enterprise.dto.CustomStoreDTO;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.EnterpriseLicenseDTO;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.CustomStoreApiService;
......@@ -147,6 +148,12 @@ public class StoreApiServiceImpl implements StoreApiService {
getStatus(storeDTO);
if (storeDTO.getStoreId() == null) {
ServiceResponse<List<EnterpriseLicenseDTO>> listEnterpriseLicense = this.enterpriseApiService.listEnterpriseLicense(storeDTO.getEnterpriseId());
if(listEnterpriseLicense.isSuccess() && CollectionUtils.isNotEmpty(listEnterpriseLicense.getResult())){
if(listEnterpriseLicense.getResult().size()== 4){
storeDTO.setLicense(listEnterpriseLicense.getResult().get(3).getUpperLimit());
}
}
Integer id = storeService.save(storeDTO);
storeDTO.setStoreId(id);
// 记录门店日志
......@@ -1192,8 +1199,8 @@ public class StoreApiServiceImpl implements StoreApiService {
private DynamicDocDTO buildStoreDocDto(Integer enterpriseId, Integer storeId) {
refreshCache(enterpriseId, storeId);
ServiceResponse<StoreDTO> response = this.getStoreById(enterpriseId, storeId);
if (response.isSuccess()) {
StoreDTO dto = response.getResult();
StoreDTO dto = response.getResult();
if (response.isSuccess() && dto != null && dto.getOverflowStatus() == 1) {
StoreEsDTO esDTO = new StoreEsDTO();
esDTO.setAreaIds(Arrays.asList(dto.getProvinceId(), dto.getCityId(), dto.getAreaId()));
esDTO.setCityId(dto.getCityId());
......
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