Commit 01ccd142 by yelq

Merge all from rop-merchant v4.50.0_20250311

1 parent 9a0f03dc
......@@ -15,7 +15,7 @@
<dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>4.49.0-SNAPSHOT</version>
<version>4.50.0-SNAPSHOT</version>
</dependency>
<!--引用GSON,用于打印-->
<dependency>
......
......@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
/**
* @author zhouhaibao
......@@ -80,4 +81,16 @@ public class MerchantCommonController {
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.merchantCommon.getCarSeriesAndPowerTypeMap", needInSession = NeedInSessionType.NO)
@ApiOperation("查询全部车系与动力类型关联关系")
public RopResponse<Map<Integer, String>> getCarSeriesAndPowerTypeMap(AbstractRopRequest request){
try {
return RopResponse.success(merchantCommonService.getCarSeriesAndPowerTypeMap());
} catch (RpcServiceException e) {
log.info("=======MerchantCommonController__invoke__getCarSeriesAndPowerTypeMap__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
}
......@@ -58,6 +58,18 @@ public class MerchantController {
}
}
@ServiceMethod(method = "merchants.api.merchant.saveMerchant.permissions", needInSession = NeedInSessionType.NO)
@ApiOperation("保存商户基础信息(自动创建权限)")
public RopResponse<Integer> saveMerchantWithPermissions(MerchantSaveRequest merchantSaveRequest) {
try {
Integer merchant = merchantService.saveMerchantWithPermissions(merchantSaveRequest);
return RopResponse.success(merchant);
} catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__saveMerchantWithPermissions__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.merchant.saveMerchantAuto", needInSession = NeedInSessionType.NO)
@ApiOperation("保存商户基础信息脚本测试")
public RopResponse<Integer> saveMerchantAuto(BuildMenuParam merchantSaveRequest) {
......
......@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -100,4 +101,13 @@ public class MerchantCommonService {
if (CollectionUtils.isEmpty(carTypeIdList)) return new ArrayList<>();
return cartypeService.getCarTypeInfoById(carTypeIdList);
}
/**
* 查询全部车系与动力类型关联关系
*
* @return
*/
public Map<Integer, String> getCarSeriesAndPowerTypeMap() {
return cartypeService.getCarSeriesAndPowerTypeMap();
}
}
......@@ -53,6 +53,13 @@ public class MerchantService {
}
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
public Integer saveMerchantWithPermissions(MerchantSaveRequest merchantSaveRequest) {
RpcResponse<Integer> booleanRpcResponse = merchantRemote.saveMerchantWithPermissions(converMerchant(merchantSaveRequest));
if (booleanRpcResponse.isSuccess()) {
return booleanRpcResponse.getResult();
}
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
private MerchantRequest converMerchant(MerchantSaveRequest merchantSaveRequest) {
MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantSaveRequest, new MerchantRequest());
......
......@@ -30,4 +30,31 @@ public class OpenControllerTest extends BaseControllerTest{
System.out.println(post(params));
}
@Test
public void saveServiceMerchantPermissionTest() throws Exception{
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
params.add("accounttypeId", "2");
params.add("merchantAccountLevel", "4");
params.add("parentId", "49253");
params.add("channelId","");
params.add("merchantModel","");
params.add("merchantName", "lyj第九个鸿蒙4S店");
params.add("merchantLegalPersonPhone", "15946461232");
params.add("merchantAddress", "深圳市宝安区宝安大道深圳新锦安海纳公馆");
params.add("merchantLoginAccount", "lyjtest01");
params.add("merchantLoginPassword", "a123456");
params.add("provinceName", "广东省");
params.add("cityName", "深圳市");
params.add("lat", "22.5603");
params.add("lng", "113.9020");
params.add("merchantBrandListJson", "[{\"cars\":2125,\"merchantBrandId\":[2126]},{\"cars\":2129,\"merchantBrandId\":[2130]}]");
params.add("status", "2");
params.add("isloginName", "0");
params.add("method", "merchants.api.merchant.saveMerchant.permissions");
params.add("v", "1.0.0");
System.out.println(post(params));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!