Commit ba7ac7d0 by wanghao

Merge all from merchant_1.0.3_0330

1 parent 3ff0a872
...@@ -44,7 +44,7 @@ public class MerchantCommonController { ...@@ -44,7 +44,7 @@ public class MerchantCommonController {
@ApiOperation("获取车辆品牌树") @ApiOperation("获取车辆品牌树")
public RopResponse<List<CarbrandResponse>> getCarbrandTree(DefaultRequest defaultRequest) { public RopResponse<List<CarbrandResponse>> getCarbrandTree(DefaultRequest defaultRequest) {
try { try {
return RopResponse.success(merchantCommonService.getCarbrandTree()); return RopResponse.success(merchantCommonService.getCarbrandTreeNew());
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("=======MerchantCommonController__invoke__getCarbrandTree__exception:{}", e.getMessage()); log.info("=======MerchantCommonController__invoke__getCarbrandTree__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage()); return RopResponse.error(e.getErrId(),e.getMessage());
......
...@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.controller; ...@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.controller;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse; import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest; import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.menu.BuildMenuParam;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.role.RoleSearchRequest; import cn.com.glsx.merchants.request.role.RoleSearchRequest;
import cn.com.glsx.merchants.response.*; import cn.com.glsx.merchants.response.*;
...@@ -14,10 +15,14 @@ import com.rop.annotation.ServiceMethodBean; ...@@ -14,10 +15,14 @@ import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -52,6 +57,176 @@ public class MerchantController { ...@@ -52,6 +57,176 @@ public class MerchantController {
} }
} }
@ServiceMethod(method = "merchants.api.merchant.saveMerchantAuto", needInSession = NeedInSessionType.NO)
@ApiOperation("保存商户基础信息脚本测试")
public RopResponse<Integer> saveMerchantAuto(BuildMenuParam merchantSaveRequest) {
/**
* timestamp: 1648198769743
* appKey: 48e5e13229b82c1b4e6e8c96151f0637
* v: 1.0.0
* source: glsx
* format: json
* isloginName: 0
* bussinessBegintime:
* bussinessEndtime:
* merchantName: 性能测试1
* merchantAbbreviation:
* merchantType:
* merchantOrgcode:
* merchantLegalPerson:
* merchantLegalPersonPhone: 12245457878
* residentContact:
* residentPhone:
* merchantLoginAccount: pp211
* merchantLoginPassword: a123456
* merchantAccountLevel: 1
* effectiveTime:
* merchantModel: 2
* channelId: 1
* businessType: 1,2,3,4,5,6
* accounttypeId: 2
* merchantBrandListJson: []
* method: merchants.api.merchant.saveMerchant
* status: 1
* sign: 2198C1C6567D159D46B177F167AF9426DCF1CE0
*/
String param = merchantSaveRequest.getParam();
//父商户
MerchantSaveRequest parent = new MerchantSaveRequest();
parent.setMerchantName(merchantSaveRequest.getParam() + "p");
String tel = getTel();
parent.setIsloginName((byte)0);
parent.setMerchantLegalPersonPhone(tel);
parent.setMerchantLoginAccount(tel);
parent.setMerchantLoginPassword("a" + tel);
parent.setMerchantAccountLevel(1);
parent.setMerchantModel(2);
parent.setChannelId(1);
parent.setBusinessType("1,2,3,4,5,6");
parent.setAccounttypeId(Arrays.asList(2));
parent.setStatus((byte)1);
Integer parentId = merchantService.saveMerchant(parent);
//查询商户详情
MerchantDetailRequest merchantDetailRequest = new MerchantDetailRequest();
merchantDetailRequest.setId(parentId);
MerchantRopResponse merchantDetail = merchantService.findMerchantDetail(merchantDetailRequest);
/**
* 修改权限
* timestamp: 1648198807437
* appKey: 48e5e13229b82c1b4e6e8c96151f0637
* v: 1.0.0
* source: glsx
* format: json
* merchantId: 42722
* accountTypes: [{"accountTypeId":"2","products":[{"productId":81,"functionIds":[],"menuIds":[]}]}]
* method: merchants.api.merchant.updatePermissions
* status: 2
* sign: BB37CFB3B39B18560BBE199B68813D35EA2FCB61
*/
MerchantTreeRopRequest merchantParent = new MerchantTreeRopRequest();
//merchantParent
merchantParent.setMerchantId(parentId);
merchantParent.setAccountTypes("[{\"accountTypeId\":\"2\",\"products\":[{\"productId\":81,\"functionIds\":[],\"menuIds\":[]}]}]");
merchantParent.setStatus(2);
merchantService.updatePermissions(merchantParent);
/**
* timestamp: 1648199002154
* appKey: 48e5e13229b82c1b4e6e8c96151f0637
* v: 1.0.0
* source: glsx
* format: json
* isloginName: 0
* bussinessBegintime:
* bussinessEndtime:
* merchantName: qqqqa
* merchantAbbreviation:
* merchantType:
* merchantOrgcode:
* merchantLegalPerson:
* merchantLegalPersonPhone: 12256569847
* residentContact:
* residentPhone:
* merchantLoginAccount: tyu
* merchantLoginPassword: a123456
* merchantAccountLevel: 4
* effectiveStarttime: Fri Mar 25 2022 08:00:00 GMT+0800 (中国标准时间)
* expireDate: Sat Mar 26 2022 08:00:00 GMT+0800 (中国标准时间)
* channelId: 1
* businessType: 1,2,3,4,5,6
* accounttypeId: 2
* merchantBrandListJson: []
* parentId: 42722
* merchantModel: 2
* method: merchants.api.merchant.saveMerchant
* status: 1
* sign: DFEB4B114F74673616599BA981F9B928C806A287
*/
//子商户
List<MerchantSaveRequest> list = new ArrayList<>();
for (int i = 0; i < 50; i++) {
MerchantSaveRequest saveRequest = new MerchantSaveRequest();
saveRequest.setIsloginName((byte)0);
saveRequest.setMerchantName(param + i);
saveRequest.setMerchantLegalPersonPhone(getTel());
saveRequest.setMerchantLoginAccount(param+i);
saveRequest.setMerchantLoginPassword("a123456");
saveRequest.setMerchantAccountLevel(4);
saveRequest.setEffectiveStarttime(new Date());
saveRequest.setExpireDate(DateUtils.addHours(new Date(), 30));
saveRequest.setChannelId(1);
saveRequest.setBusinessType("1,2,3,4,5,6");
saveRequest.setAccounttypeId(Arrays.asList(2));
saveRequest.setParentId(parentId);
saveRequest.setMerchantModel(2);
saveRequest.setStatus((byte)1);
Integer subMerchantId = merchantService.saveMerchant(saveRequest);
MerchantTreeRopRequest merchantTreeRequest = new MerchantTreeRopRequest();
/**
* timestamp: 1648199086038
* appKey: 48e5e13229b82c1b4e6e8c96151f0637
* v: 1.0.0
* source: glsx
* format: json
* merchantId: 42724
* accountTypes: [{"accountTypeId":"2","products":[{"productId":81,"functionIdList":[],"menuIdList":[]}]}]
* method: merchants.api.merchant.updatePermissions
* status: 2
* sign: CAF709032C69AF6F76993640100D7871A6945EB3
*/
merchantTreeRequest.setMerchantId(subMerchantId);
merchantTreeRequest.setAccountTypes("[{\"accountTypeId\":\"2\",\"products\":[{\"productId\":81,\"functionIdList\":[],\"menuIdList\":[]}]}]");
merchantTreeRequest.setStatus(2);
merchantService.updatePermissions(merchantTreeRequest);
}
return null;
}
public static void main(String[] args) {
Date date = DateUtils.addDays(new Date(), 30);
System.out.println(date);
}
private static String[] telFirst="134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153".split(",");
private static String getTel() {
int index=getNum(0,telFirst.length-1);
String first=telFirst[index];
String second=String.valueOf(getNum(1,888)+10000).substring(1);
String third=String.valueOf(getNum(1,9100)+10000).substring(1);
return first+second+third;
}
public static int getNum(int start,int end) {
return (int)(Math.random()*(end-start+1)+start);
}
/** /**
* 更新商户基础信息 * 更新商户基础信息
* *
...@@ -327,4 +502,21 @@ public class MerchantController { ...@@ -327,4 +502,21 @@ public class MerchantController {
} }
} }
/**
* 查询商户信息(滴加企微管家)
*
* @return
*/
@ServiceMethod(method = "merchants.api.merchant.findMerchantInfoToDj", needInSession = NeedInSessionType.NO)
@ApiOperation("滴加企微管家查询商户基本信息")
public RopResponse<MerchantInfoDjRopResponse> findMerchantInfoToDj(MerchantBaseInfoRequest merchantBaseInfoRequest) {
try {
MerchantInfoDjRopResponse merchantInfoDjRopResponse = merchantService.findMerchantInfoToDj(merchantBaseInfoRequest);
return RopResponse.success(merchantInfoDjRopResponse);
} catch (RpcServiceException e) {
log.info("findMerchantInfoToDj_exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
} }
...@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller; ...@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse; import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.enums.BusinessExceptionEnum;
import cn.com.glsx.merchants.request.menu.*; import cn.com.glsx.merchants.request.menu.*;
import cn.com.glsx.merchants.response.MenuResponse; import cn.com.glsx.merchants.response.MenuResponse;
import cn.com.glsx.merchants.service.MerchantMenuService; import cn.com.glsx.merchants.service.MerchantMenuService;
...@@ -67,6 +68,22 @@ public class MerchantMenuController { ...@@ -67,6 +68,22 @@ public class MerchantMenuController {
} }
} }
@ServiceMethod(method = "merchants.api.menu.buildMenuAndFunction", needInSession = NeedInSessionType.NO)
@ApiOperation("构建版本菜单")
public RopResponse<Boolean> buildMenuAndFunction(BuildMenuParam param){
try {
if(!"Thomas".equals(param.getParam())){
throw new RpcServiceException("FBI警告", "不要乱搞");
}
merchantMenuService.buildMenuAndFunction(param);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__buildMenuAndFunction__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
/** /**
* 查询菜单列表 * 查询菜单列表
* *
......
package cn.com.glsx.merchants.request.menu;
import cn.com.glsx.merchants.request.DefaultRequest;
import lombok.Data;
@Data
public class BuildMenuParam extends DefaultRequest {
private String param;
}
package cn.com.glsx.merchants.request.merchant; package cn.com.glsx.merchants.request.merchant;
import cn.com.glsx.merchants.model.request.MerchantBrandRequest;
import cn.com.glsx.merchants.request.DefaultRequest; import cn.com.glsx.merchants.request.DefaultRequest;
import cn.com.glsx.merchants.request.file.FileSaveRequest; import cn.com.glsx.merchants.request.file.FileSaveRequest;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -191,4 +192,13 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable ...@@ -191,4 +192,13 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
@ApiModelProperty(notes = "sapCode") @ApiModelProperty(notes = "sapCode")
private String sapCode; private String sapCode;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessType;
@ApiModelProperty(notes = "主营品牌Obj, json")
private String merchantBrandListJson;
/* @ApiModelProperty(notes = "主营品牌Obj", hidden = true)
private List<MerchantBrandRequest> merchantBrandList;*/
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.request.merchant; package cn.com.glsx.merchants.request.merchant;
import cn.com.glsx.merchants.model.request.MerchantBrandRequest;
import cn.com.glsx.merchants.request.DefaultRequest; import cn.com.glsx.merchants.request.DefaultRequest;
import cn.com.glsx.merchants.request.file.FileSaveRequest;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -193,4 +193,14 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl ...@@ -193,4 +193,14 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
@ApiModelProperty(notes = "sapCode") @ApiModelProperty(notes = "sapCode")
private String sapCode; private String sapCode;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessType;
@ApiModelProperty(notes = "主营品牌Obj, json串")
private String merchantBrandListJson;
/*@ApiModelProperty(notes = "主营品牌Obj", hidden = true)
private List<MerchantBrandRequest> merchantBrandList;*/
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.response; package cn.com.glsx.merchants.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -14,6 +15,8 @@ import java.util.List; ...@@ -14,6 +15,8 @@ import java.util.List;
@Data @Data
public class MerchantBaseInfoRopResponse { public class MerchantBaseInfoRopResponse {
private Integer id;
@ApiModelProperty(notes = "商户号") @ApiModelProperty(notes = "商户号")
private String merchantName; private String merchantName;
...@@ -45,4 +48,33 @@ public class MerchantBaseInfoRopResponse { ...@@ -45,4 +48,33 @@ public class MerchantBaseInfoRopResponse {
@ApiModelProperty(value = "渠道id") @ApiModelProperty(value = "渠道id")
private Integer channelId; private Integer channelId;
@ApiModelProperty(notes = "主营品牌, 同一车系','分割, 不同车系';'分割")
private String merchantBrandMain;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessType;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessTypeName;
@ApiModelProperty(notes = "营业开始时间")
private String bussinessBegintime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(notes = "营业结束时间")
private String bussinessEndtime;
@ApiModelProperty(notes = "商户地址")
private String merchantAddress;
@ApiModelProperty(notes = "商户地址全部")
private String merchantFullAddress;
@ApiModelProperty(notes = "经度")
private Float lng;
@ApiModelProperty(notes = "维度")
private Float lat;
} }
package cn.com.glsx.merchants.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MerchantInfoDjRopResponse {
@ApiModelProperty(name = "id", notes = "商户id", dataType = "Integer", required = true, example = "1", value = "商户id")
private Integer id;
/**
* 商户号
*/
@ApiModelProperty(name = "merchantNo", notes = "商户号", dataType = "Integer", required = true, example = "1")
private Integer merchantNo;
/**
* 商户名称
*/
@ApiModelProperty(notes = "商户名称")
private String merchantName;
/**
* 品牌
*/
@ApiModelProperty(name = "merchantBrand", notes = "品牌", dataType = "String", required = true, example = "1")
private String merchantBrand;
/**
* 营业开始时间
*/
@ApiModelProperty(name = "businessBeginTime", notes = "营业开始时间", dataType = "Date", required = true, example = "1")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String businessBeginTime;
/**
* 营业结束时间
*/
@ApiModelProperty(name = "businessEndTime", notes = "营业结束时间", dataType = "Date", required = true, example = "1")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String businessEndTime;
@ApiModelProperty(name = "businessType", notes = "经营业务类型',(英文)'分割: 1.整车/新车,2.保养,3,维修,4,汽车金融,5,零配件/精品,6,车险,7,二手车,8,改装")
private String businessType;
}
...@@ -351,4 +351,13 @@ public class MerchantRopResponse { ...@@ -351,4 +351,13 @@ public class MerchantRopResponse {
@ApiModelProperty(notes = "是否可编辑[接入模式], true, false") @ApiModelProperty(notes = "是否可编辑[接入模式], true, false")
private Boolean hasAccessMode; private Boolean hasAccessMode;
@ApiModelProperty(notes = "主营品牌, 同一车系','分割, 不同车系';'分割")
private String merchantBrandMain;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessType;
@ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessTypeName;
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,11 +8,13 @@ import cn.com.glsx.merchants.remote.MerchantRemote; ...@@ -8,11 +8,13 @@ import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.response.CarbrandResponse; import cn.com.glsx.merchants.response.CarbrandResponse;
import cn.com.glsx.merchants.response.ChannelResponse; import cn.com.glsx.merchants.response.ChannelResponse;
import cn.com.glsx.merchants.response.MerchantTreeRopResponse; import cn.com.glsx.merchants.response.MerchantTreeRopResponse;
import com.glsx.biz.common.base.entity.CarBrandSelected;
import com.glsx.biz.common.base.entity.Carbrand; import com.glsx.biz.common.base.entity.Carbrand;
import com.glsx.biz.common.base.service.CarbrandService; import com.glsx.biz.common.base.service.CarbrandService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -50,6 +52,37 @@ public class MerchantCommonService { ...@@ -50,6 +52,37 @@ public class MerchantCommonService {
return collect; return collect;
} }
public List<CarbrandResponse> getCarbrandTreeNew() {
List<CarBrandSelected> carInfoCompleteForSelected = carbrandService.getCarInfoCompleteForSelected();
List<CarbrandResponse> list = new ArrayList<>(carInfoCompleteForSelected.size());
carInfoCompleteForSelected.forEach(v-> {
CarbrandResponse response = new CarbrandResponse();
response.setId(v.getId());
response.setLabel(v.getName());
if(v.getChilds() != null){
v.getChilds().forEach(v1 -> {
if(v1.getChilds() != null){
List<CarbrandResponse> collect = v1.getChilds().stream().map(x -> {
CarbrandResponse sub = new CarbrandResponse();
sub.setId(x.getId());
sub.setLabel(x.getName());
return sub;
}).collect(Collectors.toList());
if(collect.size() > 0){
response.setChildren(collect);
}
}else {
System.out.println(v1.getId());
}
});
}
list.add(response);
});
return list;
}
public List<ChannelResponse> findAllChannel() { public List<ChannelResponse> findAllChannel() {
RpcResponse<List<MerchantChannelResponse>> allChannel = merchantRemote.findAllChannel(); RpcResponse<List<MerchantChannelResponse>> allChannel = merchantRemote.findAllChannel();
if (allChannel.isSuccess()) { if (allChannel.isSuccess()) {
......
...@@ -44,6 +44,13 @@ public class MerchantFunctionService { ...@@ -44,6 +44,13 @@ public class MerchantFunctionService {
} }
} }
public static void main(String[] args) {
FunctionSaveRequest functionSaveRequest = new FunctionSaveRequest();
functionSaveRequest.setProductId(123);
MerchantProductFunctionRequest merchantProductFunctionRequest = ConvertRequest.convertRequest(functionSaveRequest, new MerchantProductFunctionRequest());
System.out.println(merchantProductFunctionRequest);
}
@SysLog(value = "修改功能", action = OperateType.EDIT, module = "功能模块") @SysLog(value = "修改功能", action = OperateType.EDIT, module = "功能模块")
public void updateMerchantFunction(FunctionUpdateRequest functionUpdateRequest) { public void updateMerchantFunction(FunctionUpdateRequest functionUpdateRequest) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.updateMerchantProductFunctionRemote(ConvertRequest.convertRequest(functionUpdateRequest, new MerchantProductFunctionRequest())); RpcResponse<Boolean> booleanRpcResponse = merchantProductFunctionRemote.updateMerchantProductFunctionRemote(ConvertRequest.convertRequest(functionUpdateRequest, new MerchantProductFunctionRequest()));
......
...@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.merchants.convert.ConvertRequest; import cn.com.glsx.merchants.convert.ConvertRequest;
import cn.com.glsx.merchants.convert.ConvertResponse; import cn.com.glsx.merchants.convert.ConvertResponse;
import cn.com.glsx.merchants.model.request.BuildMenuRpcParam;
import cn.com.glsx.merchants.model.request.MerchantProductMenuRequest; import cn.com.glsx.merchants.model.request.MerchantProductMenuRequest;
import cn.com.glsx.merchants.model.response.MerchantProductMenuResponse; import cn.com.glsx.merchants.model.response.MerchantProductMenuResponse;
import cn.com.glsx.merchants.remote.MerchantProductMenuRemote; import cn.com.glsx.merchants.remote.MerchantProductMenuRemote;
...@@ -72,4 +73,11 @@ public class MerchantMenuService { ...@@ -72,4 +73,11 @@ public class MerchantMenuService {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage()); throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
} }
} }
public void buildMenuAndFunction(BuildMenuParam param) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.buildMenuAndFunction(ConvertRequest.convertRequest(param, new BuildMenuRpcParam()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
} }
...@@ -62,6 +62,9 @@ public class MerchantService { ...@@ -62,6 +62,9 @@ public class MerchantService {
private MerchantRequest converMerchant(MerchantSaveRequest merchantSaveRequest) { private MerchantRequest converMerchant(MerchantSaveRequest merchantSaveRequest) {
MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantSaveRequest, new MerchantRequest()); MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantSaveRequest, new MerchantRequest());
String merchantFiles = merchantSaveRequest.getMerchantFiles(); String merchantFiles = merchantSaveRequest.getMerchantFiles();
String merchantBrandListJson = merchantSaveRequest.getMerchantBrandListJson();
if(StringUtils.isNotEmpty(merchantBrandListJson))
merchantRequest.setMerchantBrandList(JSONObject.parseArray(merchantBrandListJson, MerchantBrandRequest.class));
if (StringUtils.isNotEmpty(merchantFiles)) { if (StringUtils.isNotEmpty(merchantFiles)) {
merchantRequest.setMerchantFiles(JSONObject.parseArray(merchantFiles, MerchantFileRequest.class)); merchantRequest.setMerchantFiles(JSONObject.parseArray(merchantFiles, MerchantFileRequest.class));
} }
...@@ -71,6 +74,9 @@ public class MerchantService { ...@@ -71,6 +74,9 @@ public class MerchantService {
private MerchantRequest converUpdateMerchant(MerchantUpdateRequest merchantUpdateRequest) { private MerchantRequest converUpdateMerchant(MerchantUpdateRequest merchantUpdateRequest) {
MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantUpdateRequest, new MerchantRequest()); MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantUpdateRequest, new MerchantRequest());
String merchantFiles = merchantUpdateRequest.getMerchantFiles(); String merchantFiles = merchantUpdateRequest.getMerchantFiles();
String merchantBrandListJson = merchantUpdateRequest.getMerchantBrandListJson();
if(StringUtils.isNotEmpty(merchantBrandListJson))
merchantRequest.setMerchantBrandList(JSONObject.parseArray(merchantBrandListJson, MerchantBrandRequest.class));
if (StringUtils.isNotEmpty(merchantFiles)) { if (StringUtils.isNotEmpty(merchantFiles)) {
merchantRequest.setMerchantFiles(JSONObject.parseArray(merchantFiles, MerchantFileRequest.class)); merchantRequest.setMerchantFiles(JSONObject.parseArray(merchantFiles, MerchantFileRequest.class));
} }
...@@ -290,4 +296,12 @@ public class MerchantService { ...@@ -290,4 +296,12 @@ public class MerchantService {
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage()); throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
} }
} }
public MerchantInfoDjRopResponse findMerchantInfoToDj(MerchantBaseInfoRequest merchantBaseInfoRequest) {
RpcResponse<MerchantInfoApiDjRopResponse> rpcResponse = merchantRemote.findMerchantInfoToDj(merchantBaseInfoRequest.getMerchantId());
if (rpcResponse.isSuccess()) {
return ConvertResponse.convertObject(rpcResponse.getResult(), MerchantInfoDjRopResponse.class);
}
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
} }
package cn.com.glsx.merchants.util;
import cn.com.glsx.merchants.dto.ProductDTO;
import com.alibaba.fastjson.JSON;
import java.util.*;
public class LocalTest {
public static void main(String[] args) {
//1: 商户,2:门店
List<String> list = Arrays.asList("嘀加企微管家SCRM-门店版", "嘀加企微管家SCRM-集团版");
//营销素材功能Map
Map<String, String> yxMap = new HashMap<>();
yxMap.put("新增营销素材", "/material/addMaterial");
yxMap.put("详情", "/material/materialDetail");
yxMap.put("修改", null);
yxMap.put("置顶", null);
yxMap.put("删除", null);
yxMap.put("编辑", "/material/addMaterial");
yxMap.put("禁用", null);
yxMap.put("删除营销素材", null);
//朋友圈营销Map
/*Map<String, String> pyqMap = new HashMap<>();
pyqMap.put("编辑朋友圈", "/friendGroup/friendGroupAdd");
pyqMap.put("详情", "/friendGroup/friendGroupDetail");*/
//SOP Map
Map<String, String> sopMap = new HashMap<>();
sopMap.put("创建SOP", "/sop/editSop");
sopMap.put("管理SOP", "/sop/sopList");
sopMap.put("分析SOP", "/sop/sopAnalysisList");
sopMap.put("结束SOP", null);
sopMap.put("编辑SOP", "/sop/editSop");
//人群 Map
/*Map<String, String> rqMap = new HashMap<>();
rqMap.put("查看详情", "/crowdManage/crowdDetail/:id");
rqMap.put("新建人群", "/crowdManage/crowdAdd");
rqMap.put("客户列表", "/clientDataOverview/group/:id/:crowdType");*/
//审批配置 Map
/*Map<String, String> spMap = new HashMap<>();
spMap.put("审批模板创建指引", "/approvalConfig/createGuide");*/
//基本信息
Map<String, String> jbMap = new HashMap<>();
jbMap.put("修改企业信息", "/baseInfo/editInfo");
List<ProductDTO> dtos = new ArrayList<>();
for (String s : list) {
List<ProductDTO.FunctionDTO> functionDTOList = new ArrayList<>();
ProductDTO dto = new ProductDTO();
dto.setProductName(s);
List<ProductDTO.MenuDTO> menuDTOS = new ArrayList<>();
dto.setMenuDTOS(menuDTOS);
ProductDTO.MenuDTO oriMenu = new ProductDTO.MenuDTO();
oriMenu.setMenuName("营销转化");
oriMenu.setType("Y");
/*ProductDTO.MenuDTO oriMenu1 = new ProductDTO.MenuDTO();
oriMenu1.setMenuName("客户管理");
oriMenu1.setType("Y");*/
/*ProductDTO.MenuDTO oriMenu2 = new ProductDTO.MenuDTO();
oriMenu2.setMenuName("系统设置");
oriMenu2.setType("Y");*/
ProductDTO.MenuDTO oriMenu3 = new ProductDTO.MenuDTO();
oriMenu3.setMenuName("基本信息");
oriMenu3.setType("Y");
//营销素材 菜单
ProductDTO.MenuDTO addYxMenu = new ProductDTO.MenuDTO();
addYxMenu.setMenuName("营销素材");
addYxMenu.setType("N");
addYxMenu.setParentName(oriMenu.getMenuName());
addYxMenu.setIsSpecial((byte)1);
addYxMenu.setMenuUrl("/material/index");
addYxMenu.setOwnedCusgroupType(4);
addYxMenu.setOwnedCusgroupValue("2");
//营销素材 功能
yxMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f1 = new ProductDTO.FunctionDTO();
f1.setMenuName(addYxMenu.getMenuName());
f1.setFunctionName(k);
f1.setFunctionAttributeName(v);
f1.setFunctionType(3);
f1.setOwnedCusgroupType(4);
f1.setOwnedCusgroupValue("2");
functionDTOList.add(f1);
});
//朋友圈营销 菜单
/*ProductDTO.MenuDTO addPYQYXMenu = new ProductDTO.MenuDTO();
addPYQYXMenu.setMenuName("朋友圈营销-脚本");
addPYQYXMenu.setType("N");
addPYQYXMenu.setParentName(oriMenu.getMenuName());
addPYQYXMenu.setIsSpecial((byte)1);
addPYQYXMenu.setMenuUrl("/friendGroup/index");
addPYQYXMenu.setOwnedCusgroupType(4);
addPYQYXMenu.setOwnedCusgroupValue("2");*/
//朋友圈营销 功能
/*pyqMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f = new ProductDTO.FunctionDTO();
f.setMenuName(addPYQYXMenu.getMenuName());
f.setFunctionName(k);
f.setFunctionAttributeName(v);
f.setFunctionType(3);
f.setOwnedCusgroupType(4);
f.setOwnedCusgroupValue("2");
functionDTOList.add(f);
});*/
//营销SOP 菜单
ProductDTO.MenuDTO addSOPMenu = new ProductDTO.MenuDTO();
addSOPMenu.setMenuName("营销SOP");
addSOPMenu.setType("N");
addSOPMenu.setParentName(oriMenu.getMenuName());
addSOPMenu.setIsSpecial((byte)1);
addSOPMenu.setMenuUrl("/sop/index");
addSOPMenu.setOwnedCusgroupType(4);
addSOPMenu.setOwnedCusgroupValue("2");
//营销SOP 功能
sopMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f = new ProductDTO.FunctionDTO();
f.setMenuName(addSOPMenu.getMenuName());
f.setFunctionName(k);
f.setFunctionAttributeName(v);
f.setFunctionType(3);
f.setOwnedCusgroupType(4);
f.setOwnedCusgroupValue("2");
functionDTOList.add(f);
});
//人群管理 菜单
/*ProductDTO.MenuDTO addRQMenu = new ProductDTO.MenuDTO();
addRQMenu.setMenuName("人群管理");
addRQMenu.setType("N");
addRQMenu.setParentName(oriMenu1.getMenuName());
addRQMenu.setIsSpecial((byte)1);
addRQMenu.setMenuUrl("/crowdManage/index");
addRQMenu.setOwnedCusgroupType(4);
addRQMenu.setOwnedCusgroupValue("2");
//人群管理 功能
rqMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f = new ProductDTO.FunctionDTO();
f.setMenuName(addRQMenu.getMenuName());
f.setFunctionName(k);
f.setFunctionAttributeName(v);
f.setFunctionType(3);
f.setOwnedCusgroupType(4);
f.setOwnedCusgroupValue("2");
functionDTOList.add(f);
});*/
//审批配置 菜单
/*ProductDTO.MenuDTO addSPMenu = new ProductDTO.MenuDTO();
addSPMenu.setMenuName("审批配置");
addSPMenu.setType("N");
addSPMenu.setParentName(oriMenu2.getMenuName());
addSPMenu.setIsSpecial((byte)1);
addSPMenu.setMenuUrl("/approvalConfig/index");
addSPMenu.setOwnedCusgroupType(4);
addSPMenu.setOwnedCusgroupValue("2");*/
//审批配置 功能
/*spMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f = new ProductDTO.FunctionDTO();
f.setMenuName(addSPMenu.getMenuName());
f.setFunctionName(k);
f.setFunctionAttributeName(v);
f.setFunctionType(3);
f.setOwnedCusgroupType(4);
f.setOwnedCusgroupValue("2");
functionDTOList.add(f);
});*/
//基本信息 功能
jbMap.forEach((k, v) -> {
ProductDTO.FunctionDTO f = new ProductDTO.FunctionDTO();
f.setMenuName(oriMenu3.getMenuName());
f.setFunctionName(k);
f.setFunctionAttributeName(v);
f.setFunctionType(3);
f.setOwnedCusgroupType(4);
f.setOwnedCusgroupValue("1,2");
functionDTOList.add(f);
});
dto.setFunctionDTOList(functionDTOList);
menuDTOS.add(oriMenu);
//menuDTOS.add(oriMenu1);
//menuDTOS.add(oriMenu2);
menuDTOS.add(oriMenu3);
menuDTOS.add(addYxMenu);
//menuDTOS.add(addPYQYXMenu);
menuDTOS.add(addSOPMenu);
//menuDTOS.add(addRQMenu);
//menuDTOS.add(addSPMenu);
dtos.add(dto);
}
System.out.println(JSON.toJSONString(dtos));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!