Commit ec783c7c by 陶光胜

门店授权

parent f18cd392
package com.gic.store.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.StoreDTO;
public interface StoreAuthorizationApiService {
......@@ -13,4 +14,6 @@ public interface StoreAuthorizationApiService {
ServiceResponse<Void> authStore(Integer storeResourceId, Integer toEnterpriseId, Integer enterpriseId);
ServiceResponse<Void> authorizationSingleStore(String params);
ServiceResponse<Void> saveStore(StoreDTO storeDTO);
}
......@@ -78,7 +78,19 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
JSONObject json = JSON.parseObject(params);
StoreDTO storeDTO = JSON.toJavaObject(json.getJSONObject("store"), StoreDTO.class);
Integer toEnterpriseId = json.getInteger("toEnterpriseId");
Integer fromEnterpriseId = json.getInteger("enterpriseId");
Integer isEnd = json.getInteger("isEnd");
storeDTO.setEnterpriseId(toEnterpriseId);
storeDTO.setFromEnterpriseId(fromEnterpriseId);
this.saveStore(storeDTO);
if(isEnd == 1){
this.unionEnterpriseApiService.updateStoreAuthorizationStatus(AuthorizationStatusEnum.SUCCESS.getCode(), storeDTO.getEnterpriseId());
}
return null;
}
@Override
public ServiceResponse<Void> saveStore(StoreDTO storeDTO){
String groupId = storeStrategyService.isHitStrategy(storeDTO, StoreGroupConstant.STORE_GROUP_STRATEGY_TYPE);
if (StringUtils.isBlank(groupId)) {
TabStoreGroup group = storeGroupService.selectUnGroupedStore(storeDTO.getEnterpriseId());
......@@ -86,17 +98,10 @@ public class StoreAuthorizationApiServiceImpl implements StoreAuthorizationApiSe
}
storeDTO.setStoreGroupId(Integer.valueOf(groupId));
storeDTO.setIsEditStoreGroup(0);
storeDTO.setEnterpriseId(toEnterpriseId);
storeDTO.setOwnType(StoreOwnTypeEnum.OTHER.getCode());
int i = this.storeService.authAddStore(storeDTO);
log.info("{},门店授权结果:{}", storeDTO.getStoreInfoId(), i);
if(i > 0){
this.storeApiService.addStoreToIndex(toEnterpriseId, storeDTO.getStoreId());
}
if(isEnd == 1){
this.unionEnterpriseApiService.updateStoreAuthorizationStatus(AuthorizationStatusEnum.SUCCESS.getCode(), storeDTO.getEnterpriseId());
}
return null;
return ServiceResponse.success();
}
private void queryStoreByPage(Long count, StoreSearchDTO storeSearchDTO, Integer toEnterpriseId, Integer enterpriseId){
......
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