Commit 0df197b5 by zhiwj

门店对外api修改

parent 24f9955a
......@@ -22,6 +22,7 @@ import com.gic.store.dto.open.ClerkDTO;
import com.gic.store.dto.open.ClerkDetailDTO;
import com.gic.store.dto.open.StoreOpenDTO;
import com.gic.store.entity.TabClerk;
import com.gic.store.entity.TabStore;
import com.gic.store.entity.TabStoreBrand;
import com.gic.store.entity.TabStoreGroup;
import com.gic.store.service.*;
......@@ -128,7 +129,7 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
if (storeOpenDTO.getRegionId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店域不能为空");
}
if (StringUtils.isNotBlank(storeOpenDTO.getBrand())) {
if (StringUtils.isBlank(storeOpenDTO.getBrand())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "店招品牌不能为空");
}
......@@ -299,14 +300,22 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
@Override
@GatewayParams(query = {"enterpriseId"}, body = {"storeOpenDTO"})
public ServiceResponse<String> editStore(Integer enterpriseId, StoreOpenDTO storeOpenDTO) {
if (storeOpenDTO.getStoreId() == null) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店id不能为空");
ServiceResponse<EnterpriseDTO> enterpriseResult = enterpriseApiService.getEnterpriseById(enterpriseId);
if (!enterpriseResult.isSuccess()) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID错误,无此商户");
}
if (StringUtils.isBlank(storeOpenDTO.getStoreCode())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店code不能为空");
}
StoreDTO storeDTO = storeApiService.getStoreById(enterpriseId, storeOpenDTO.getStoreId()).getResult();
if (storeDTO == null) {
if (storeOpenDTO.getRegionId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店域不能为空");
}
TabStore oldStore = this.storeService.getByStoreCodeAndRegionId(storeOpenDTO.getEnterpriseId(), storeOpenDTO.getRegionId(), storeOpenDTO.getStoreCode());
if (oldStore != null) {
storeOpenDTO.setStoreId(oldStore.getStoreId());
} else {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店不存在");
}
return this.addStore(enterpriseId, storeOpenDTO);
}
......
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