Commit 92bfdd29 by xiongzs

Merge all from rop-merchant 从0427合并到主干

1 parent 33ce0250
Showing 24 changed files with 391 additions and 40 deletions
...@@ -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.model.response.MerchantSearchEntMicroResponse;
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.menu.BuildMenuParam;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
...@@ -519,4 +520,22 @@ public class MerchantController { ...@@ -519,4 +520,22 @@ public class MerchantController {
return RopResponse.error(e.getErrId(), e.getMessage()); return RopResponse.error(e.getErrId(), e.getMessage());
} }
} }
/**
* 查询企微关联-商户列表
*
* @return
*/
@ServiceMethod(method = "merchants.api.merchant.findEntMicroMerchantsByPage", needInSession = NeedInSessionType.NO)
@ApiOperation("查询企微关联-商户列表")
public RopResponse<Pagination<MerchantSearchEntMicroResponse>> findEntMicroMerchantsByPage(MerchantSearchEntMicroRequest merchantSearchEntMicroRequest) {
try {
Pagination<MerchantSearchEntMicroResponse> response = merchantService.findEntMicroMerchantsByPage(merchantSearchEntMicroRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("findEntMicroMerchantsByPage_exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
} }
...@@ -138,4 +138,68 @@ public class MerchantMenuController { ...@@ -138,4 +138,68 @@ public class MerchantMenuController {
} }
} }
@ServiceMethod(method = "merchants.api.menu.rebuildVersionMenu", needInSession = NeedInSessionType.NO)
@ApiOperation("构建版本菜单--根据生产json重构菜单和功能")
public RopResponse<Boolean> rebuildVersionMenu(BuildMenuParam param){
try {
if(!"Thomas".equals(param.getParam())){
throw new RpcServiceException("FBI警告", "不要乱搞");
}
merchantMenuService.rebuildVersionMenu(param);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__rebuildVersionMenu__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.menu.buildVersionMenuFunctionNew", needInSession = NeedInSessionType.NO)
@ApiOperation("构建版本菜单---全新版本")
public RopResponse<Boolean> buildVersionMenuFunctionNew(BuildMenuParam param){
try {
if(!"Thomas".equals(param.getParam())){
throw new RpcServiceException("FBI警告", "不要乱搞");
}
merchantMenuService.buildVersionMenuFunctionNew(param);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__buildVersionMenuFunctionNew__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.menu.updateVersionMenuAndFunction", needInSession = NeedInSessionType.NO)
@ApiOperation("构建版本菜单-根据json更新菜单及功能")
public RopResponse<Boolean> updateVersionMenuAndFunction(BuildMenuParam param){
try {
if(!"Thomas".equals(param.getParam())){
throw new RpcServiceException("FBI警告", "不要乱搞");
}
merchantMenuService.updateVersionMenuAndFunction(param);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__updateVersionMenuAndFunction__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
@ServiceMethod(method = "merchants.api.menu.deleteVersionMenuAndFunction", needInSession = NeedInSessionType.NO)
@ApiOperation("构建版本菜单-根据json删除菜单及功能")
public RopResponse<Boolean> deleteVersionMenuAndFunction(BuildMenuParam param){
try {
if(!"Thomas".equals(param.getParam())){
throw new RpcServiceException("FBI警告", "不要乱搞");
}
merchantMenuService.deleteVersionMenuAndFunction(param);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__deleteVersionMenuAndFunction__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.model.response.MerchantSubListResponse;
import cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest; import cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest;
import cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest; import cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest;
import cn.com.glsx.merchants.request.open.*; import cn.com.glsx.merchants.request.open.*;
...@@ -30,6 +31,7 @@ import java.util.List; ...@@ -30,6 +31,7 @@ import java.util.List;
@Api("对外开发接口") @Api("对外开发接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class OpenController { public class OpenController {
@Autowired @Autowired
private OpenService openService; private OpenService openService;
...@@ -427,4 +429,18 @@ public class OpenController { ...@@ -427,4 +429,18 @@ public class OpenController {
return RopResponse.error(e.getErrId(), e.getMessage()); return RopResponse.error(e.getErrId(), e.getMessage());
} }
} }
@ServiceMethod(method = "merchants.api.open.findSubMerchantbySupMerchantNo", needInSession = NeedInSessionType.NO)
@ApiOperation("根据商户号查询商户下一级列表")
public RopResponse<List<MerchantSubListResponse>> findSubMerchantbySupMerchantNo(OpenMerchantDetailRequest openMerchantDetailRequest){
try {
List<MerchantSubListResponse> responses = openService.findSubMerchantbySupMerchantNo(openMerchantDetailRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======OpenController__invoke__findSubMerchantbySupMerchantNo__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -83,6 +83,42 @@ public class StaffController { ...@@ -83,6 +83,42 @@ public class StaffController {
} }
/** /**
* 批量更新员工状态
*
* @param staffUpdateStatusBatchRequest 入参
* @return
*/
@ServiceMethod(method = "merchants.api.staff.updateStatusBatch", needInSession = NeedInSessionType.NO)
@ApiOperation("批量更新员工状态")
public RopResponse<Boolean> updateStatusBatch(StaffUpdateStatusBatchRequest staffUpdateStatusBatchRequest) {
try {
staffService.updateStatusBatch(staffUpdateStatusBatchRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======StaffController__invoke__updateStatusBatch__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 批量分配员工角色
*
* @param staffRoleInsertBatchRequest 入参
* @return
*/
@ServiceMethod(method = "merchants.api.staff.addStaffRoleBatch", needInSession = NeedInSessionType.NO)
@ApiOperation("批量分配员工角色")
public RopResponse<Boolean> addStaffRoleBatch(StaffRoleInsertBatchRequest staffRoleInsertBatchRequest) {
try {
staffService.addRoleBatch(staffRoleInsertBatchRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======StaffController__invoke__addStaffRoleBatch__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除员工 * 删除员工
* *
* @param staffDeleteRequest 入参 * @param staffDeleteRequest 入参
......
...@@ -58,7 +58,7 @@ public class MenuSaveRequest extends DefaultRequest { ...@@ -58,7 +58,7 @@ public class MenuSaveRequest extends DefaultRequest {
private Integer menuPosition; private Integer menuPosition;
/** /**
* 所属客户群 1.账户类型 2.商户层级 3.商户id 4.账户角色 * 所属客户群 1.账户类型 2.商户层级 3.商户id 4.账户角色(1.工厂 2.省代 3.市代(商户), 4: 门店)
*/ */
@ApiModelProperty(notes = "所属客户群") @ApiModelProperty(notes = "所属客户群")
private Integer ownedCusgroupType; private Integer ownedCusgroupType;
......
...@@ -6,6 +6,7 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest; ...@@ -6,6 +6,7 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -199,6 +200,15 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable ...@@ -199,6 +200,15 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
@ApiModelProperty(notes = "主营品牌Obj, json") @ApiModelProperty(notes = "主营品牌Obj, json")
private String merchantBrandListJson; private String merchantBrandListJson;
/* @ApiModelProperty(notes = "主营品牌Obj", hidden = true) @ApiModelProperty(notes = "省编码")
private List<MerchantBrandRequest> merchantBrandList;*/ private String provinceCode;
@ApiModelProperty(notes = "省名称")
private String provinceName;
@ApiModelProperty(notes = "市编码")
private String cityCode;
@ApiModelProperty(notes = "市名称")
private String cityName;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.request.merchant;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 商户关联企微-商户查询
*/
@Data
public class MerchantSearchEntMicroRequest extends DefaultRequest {
@ApiModelProperty(notes = "父商户号", required = true)
private Integer parentMerchantNo;
/**
* 商户名字
*/
@ApiModelProperty(notes = "商户名字")
private String merchantName;
@NotNull
@ApiModelProperty(notes = "分页数", required = true)
private Integer pageSize;
@NotNull
@ApiModelProperty(notes = "当前页", required = true)
private Integer pageNum;
}
...@@ -24,7 +24,7 @@ public class MerchantSearchResquest extends DefaultRequest { ...@@ -24,7 +24,7 @@ public class MerchantSearchResquest extends DefaultRequest {
@ApiModelProperty(notes = "账户层级") @ApiModelProperty(notes = "账户层级")
private Integer merchantAccountLevel; private Integer merchantAccountLevel;
@ApiModelProperty(notes = "账户状态") @ApiModelProperty(notes = "账户状态 2:已发布")
private Byte status; private Byte status;
@ApiModelProperty(notes = "渠道id") @ApiModelProperty(notes = "渠道id")
...@@ -54,7 +54,7 @@ public class MerchantSearchResquest extends DefaultRequest { ...@@ -54,7 +54,7 @@ public class MerchantSearchResquest extends DefaultRequest {
/** /**
* 是否关联企微 * 是否关联企微
*/ */
@ApiModelProperty(notes = "是否关联企微") @ApiModelProperty(notes = "是否关联企微 1:已关联 2:未关联")
private Integer isRelevance; private Integer isRelevance;
@NotNull @NotNull
......
...@@ -200,7 +200,16 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl ...@@ -200,7 +200,16 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
@ApiModelProperty(notes = "主营品牌Obj, json串") @ApiModelProperty(notes = "主营品牌Obj, json串")
private String merchantBrandListJson; private String merchantBrandListJson;
/*@ApiModelProperty(notes = "主营品牌Obj", hidden = true) @ApiModelProperty(notes = "省编码")
private List<MerchantBrandRequest> merchantBrandList;*/ private String provinceCode;
@ApiModelProperty(notes = "省名称")
private String provinceName;
@ApiModelProperty(notes = "市编码")
private String cityCode;
@ApiModelProperty(notes = "市名称")
private String cityName;
} }
\ No newline at end of file \ No newline at end of file
...@@ -19,6 +19,6 @@ public class OpenCheckPhoneRequest extends DefaultRequest { ...@@ -19,6 +19,6 @@ public class OpenCheckPhoneRequest extends DefaultRequest {
@ApiModelProperty(notes = "手机号") @ApiModelProperty(notes = "手机号")
private String phone; private String phone;
@ApiModelProperty(notes = "产品code") // @ApiModelProperty(notes = "产品code")
private String productCode; private String productCode;
} }
...@@ -16,7 +16,13 @@ public class OpenMerchantDetailRequest extends DefaultRequest { ...@@ -16,7 +16,13 @@ public class OpenMerchantDetailRequest extends DefaultRequest {
/** /**
* 商户号 * 商户号
*/ */
@ApiModelProperty(notes = "商户号") @ApiModelProperty(notes = "商户号",required = true)
private Integer merchantId; private Integer merchantId;
/**
* 商户列表层级
*/
@ApiModelProperty(notes = "商户下拉列表层级",required = true)
private Integer depth;
} }
package cn.com.glsx.merchants.request.staff;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StaffRoleInsertBatchRequest extends DefaultRequest {
@ApiModelProperty(notes = "员工ids")
private List<Integer> staffIds;
@ApiModelProperty(notes = "角色id")
private Integer roleId;
}
package cn.com.glsx.merchants.request.staff;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StaffUpdateStatusBatchRequest extends DefaultRequest {
@ApiModelProperty(notes = "staffId:员工id,status: 0启用 2禁用")
private List<MerchantStatus> list;
@Data
public static class MerchantStatus{
/**
* 员工id
*/
private Integer staffId;
/**
* 状态 0.启用 2.禁用
*/
private Integer status;
}
}
...@@ -22,6 +22,6 @@ public class StaffUpdateStatusRequest extends DefaultRequest { ...@@ -22,6 +22,6 @@ public class StaffUpdateStatusRequest extends DefaultRequest {
/** /**
* 状态 * 状态
*/ */
@ApiModelProperty(notes = "状态 1.启用 2.禁用", required = true) @ApiModelProperty(notes = "状态 0.启用 2.禁用", required = true)
private Integer status; private Integer status;
} }
...@@ -15,6 +15,6 @@ public class CarbrandResponse { ...@@ -15,6 +15,6 @@ public class CarbrandResponse {
private Integer id; private Integer id;
private String label; private String label;
private String logoUrl;
private List<CarbrandResponse> children; private List<CarbrandResponse> children;
} }
...@@ -50,5 +50,4 @@ public class LoginResponse { ...@@ -50,5 +50,4 @@ public class LoginResponse {
@ApiModelProperty(name = "status", notes = "商户状态", dataType = "string", required = true, example = "asdfasdf23423432432") @ApiModelProperty(name = "status", notes = "商户状态", dataType = "string", required = true, example = "asdfasdf23423432432")
private Integer status; private Integer status;
} }
...@@ -77,4 +77,30 @@ public class MerchantBaseInfoRopResponse { ...@@ -77,4 +77,30 @@ public class MerchantBaseInfoRopResponse {
@ApiModelProperty(notes = "维度") @ApiModelProperty(notes = "维度")
private Float lat; private Float lat;
@ApiModelProperty(notes = "省编码")
private String provinceCode;
@ApiModelProperty(notes = "省名称")
private String provinceName;
@ApiModelProperty(notes = "市编码")
private String cityCode;
@ApiModelProperty(notes = "市名称")
private String cityName;
/**
* 驻点联系人
*/
@ApiModelProperty(notes = "驻点联系人")
private String residentContact;
/**
* 驻点联系电话
*/
@ApiModelProperty(notes = "驻点联系电话")
private String residentPhone;
@ApiModelProperty(name = "merchantBrandName", notes = "品牌", dataType = "String", required = true, example = "1")
private String merchantBrandName;
} }
package cn.com.glsx.merchants.response; package cn.com.glsx.merchants.response;
import cn.com.glsx.merchants.dto.MerchantBrandDTO;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -360,4 +361,20 @@ public class MerchantRopResponse { ...@@ -360,4 +361,20 @@ public class MerchantRopResponse {
@ApiModelProperty(notes = "经营业务类型, 多个时','分割") @ApiModelProperty(notes = "经营业务类型, 多个时','分割")
private String businessTypeName; private String businessTypeName;
@ApiModelProperty(notes = "省编码")
private String provinceCode;
@ApiModelProperty(notes = "省名称")
private String provinceName;
@ApiModelProperty(notes = "市编码")
private String cityCode;
@ApiModelProperty(notes = "市名称")
private String cityName;
@ApiModelProperty(notes = "车品牌树状Obj")
private List<MerchantBrandDTO> brandTreeList;
} }
\ No newline at end of file \ No newline at end of file
...@@ -103,6 +103,9 @@ public class OpenUserResponse { ...@@ -103,6 +103,9 @@ public class OpenUserResponse {
@ApiModelProperty(notes = "是否是关联员") @ApiModelProperty(notes = "是否是关联员")
private Boolean isAdmin; private Boolean isAdmin;
@ApiModelProperty(notes = "员工角色是否是超级管理员")
private Boolean isMerchantStaffAdmin;
@ApiModelProperty(notes = "商户模式 1.集团版 2.门店版") @ApiModelProperty(notes = "商户模式 1.集团版 2.门店版")
private Integer merchantModel; private Integer merchantModel;
......
...@@ -60,23 +60,20 @@ public class MerchantCommonService { ...@@ -60,23 +60,20 @@ public class MerchantCommonService {
CarbrandResponse response = new CarbrandResponse(); CarbrandResponse response = new CarbrandResponse();
response.setId(v.getId()); response.setId(v.getId());
response.setLabel(v.getName()); response.setLabel(v.getName());
response.setLogoUrl(v.getLogoUrl());
if(v.getChilds() != null){ if(v.getChilds() != null){
v.getChilds().forEach(v1 -> { // 改为获取一二级品牌
if(v1.getChilds() != null){ List<CarbrandResponse> collect = v.getChilds().stream().map(x -> {
List<CarbrandResponse> collect = v1.getChilds().stream().map(x -> { CarbrandResponse sub = new CarbrandResponse();
CarbrandResponse sub = new CarbrandResponse(); sub.setId(x.getId());
sub.setId(x.getId()); sub.setLabel(x.getName());
sub.setLabel(x.getName()); return sub;
return sub; }).collect(Collectors.toList());
}).collect(Collectors.toList()); if (collect.size() > 0){
if(collect.size() > 0){ response.setChildren(collect);
response.setChildren(collect); }else {
} System.out.println(v.getId());
}else { }
System.out.println(v1.getId());
}
});
} }
list.add(response); list.add(response);
}); });
......
...@@ -80,4 +80,32 @@ public class MerchantMenuService { ...@@ -80,4 +80,32 @@ public class MerchantMenuService {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage()); throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
} }
} }
public void rebuildVersionMenu(BuildMenuParam param) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.rebuildVersionMenu(ConvertRequest.convertRequest(param, new BuildMenuRpcParam()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
public void buildVersionMenuFunctionNew(BuildMenuParam param) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.buildVersionMenuFunctionNew(ConvertRequest.convertRequest(param, new BuildMenuRpcParam()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
public void updateVersionMenuAndFunction(BuildMenuParam param) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.updateVersionMenuAndFunction(ConvertRequest.convertRequest(param, new BuildMenuRpcParam()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
public void deleteVersionMenuAndFunction(BuildMenuParam param) {
RpcResponse<Boolean> booleanRpcResponse = merchantProductMenuRemote.deleteVersionMenuAndFunction(ConvertRequest.convertRequest(param, new BuildMenuRpcParam()));
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(),booleanRpcResponse.getMessage());
}
}
} }
...@@ -5,30 +5,21 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -5,30 +5,21 @@ 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.enums.BusinessExceptionEnum;
import cn.com.glsx.merchants.model.request.*; import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.request.MerchantBrandRequest; import cn.com.glsx.merchants.model.request.MerchantBrandRequest;
import cn.com.glsx.merchants.model.response.*; import cn.com.glsx.merchants.model.response.*;
import cn.com.glsx.merchants.remote.MerchantRemote; import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.request.DefaultRequest;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest; import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.file.FileSaveRequest;
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.*;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
import cn.hutool.log.Log;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.common.enums.OperateType;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.dubbo.rpc.RpcException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
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.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -305,4 +296,14 @@ public class MerchantService { ...@@ -305,4 +296,14 @@ public class MerchantService {
} }
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage()); throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
} }
public Pagination<MerchantSearchEntMicroResponse> findEntMicroMerchantsByPage(MerchantSearchEntMicroRequest merchantSearchEntMicroRequest) {
RpcPagination<MerchantEntMicroPageRequest> remoteRequest = ConvertRequest.convertPage(merchantSearchEntMicroRequest, new MerchantEntMicroPageRequest());
RpcResponse<RpcPagination<MerchantSearchEntMicroResponse>> response = merchantRemote.findEntMicroMerchantsByPage(remoteRequest);
if (response.isSuccess()) {
return ConvertResponse.convertPage(response.getResult(), MerchantSearchEntMicroResponse.class);
}
throw new RpcServiceException(response.getException().getErrId(), response.getMessage());
}
} }
...@@ -339,4 +339,11 @@ public class OpenService { ...@@ -339,4 +339,11 @@ public class OpenService {
return rpcResponse.getResult(); return rpcResponse.getResult();
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage()); throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
} }
public List<MerchantSubListResponse> findSubMerchantbySupMerchantNo(OpenMerchantDetailRequest openMerchantDetailRequest) {
RpcResponse<List<MerchantSubListResponse>> rpcResponse = merchantRemote.findSubMerchantbySupMerchant(openMerchantDetailRequest.getMerchantId(),openMerchantDetailRequest.getDepth());
if (rpcResponse.isSuccess())
return rpcResponse.getResult();
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
} }
...@@ -6,6 +6,7 @@ import cn.com.glsx.framework.core.exception.RpcServiceException; ...@@ -6,6 +6,7 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.merchants.config.SystemProperty; import cn.com.glsx.merchants.config.SystemProperty;
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.StaffBatchRequest;
import cn.com.glsx.merchants.model.request.MerchantFileRequest; import cn.com.glsx.merchants.model.request.MerchantFileRequest;
import cn.com.glsx.merchants.model.request.MerchantStaffRequest; import cn.com.glsx.merchants.model.request.MerchantStaffRequest;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse; import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
...@@ -19,14 +20,12 @@ import cn.com.glsx.merchants.util.FileUploadUtil; ...@@ -19,14 +20,12 @@ import cn.com.glsx.merchants.util.FileUploadUtil;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.cloudframework.core.util.StringUtil; import com.glsx.cloudframework.core.util.StringUtil;
import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.common.enums.OperateType;
import com.glsx.plat.common.utils.DateUtils; import com.glsx.plat.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
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.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -193,4 +192,34 @@ public class StaffService { ...@@ -193,4 +192,34 @@ public class StaffService {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage()); throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
} }
} }
/**
* 批量分配员工角色
* @param staffRoleInsertBatchRequest 入参
*/
public void addRoleBatch(StaffRoleInsertBatchRequest staffRoleInsertBatchRequest) {
StaffBatchRequest remoteRequest = ConvertRequest.convertRequest(staffRoleInsertBatchRequest, new StaffBatchRequest());
RpcResponse<Boolean> booleanRpcResponse = merchantStaffRemote.addStaffRoleIdsBatch(remoteRequest);
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
}
/**
* 批量更新员工状态
* @param staffUpdateStatusBatchRequest 入参
*/
public void updateStatusBatch(StaffUpdateStatusBatchRequest staffUpdateStatusBatchRequest) {
List<StaffUpdateStatusBatchRequest.MerchantStatus> list = staffUpdateStatusBatchRequest.getList();
ArrayList<Integer> staffids = new ArrayList<>();
Integer status = list.stream().findFirst().get().getStatus();
list.forEach(x -> staffids.add(x.getStaffId()));
StaffBatchRequest remoteRequest = new StaffBatchRequest();
remoteRequest.setStatus(status);
remoteRequest.setStaffIds(staffids);
RpcResponse<Boolean> booleanRpcResponse = merchantStaffRemote.updateStaffStatusBatch(remoteRequest);
if (booleanRpcResponse.isFailed()) {
throw new RpcServiceException(booleanRpcResponse.getException().getErrId(), booleanRpcResponse.getMessage());
}
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!