Commit 7afe1200 by 叶立庆

Merge branch 'v5.5.1' into 'master'

v5.5.0发起合并请求到master分支

See merge request !6
2 parents 841bc216 f3b42eff
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>cn.com.glsx.merchants</groupId> <groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId> <artifactId>platform-merchants-api</artifactId>
<version>5.5.0-SNAPSHOT</version> <version>5.5.1-SNAPSHOT</version>
<name>platform-merchants-api</name> <name>platform-merchants-api</name>
<properties> <properties>
<deploy.scanPackage>cn.com.glsx.merchants.remote</deploy.scanPackage> <deploy.scanPackage>cn.com.glsx.merchants.remote</deploy.scanPackage>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId> <groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId> <artifactId>platform-merchants-api</artifactId>
<version>5.5.0-SNAPSHOT</version> <version>5.5.1-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
......
package cn.com.glsx.merchants.dto.merchant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author yelq
* @version 1.0
* @description: 品牌省份查询门店请求类
* @date 2025年1月10日
*/
@Data
public class CarBrandProvinceRequestDTO implements Serializable {
@ApiModelProperty(notes = "一级品牌id")
private List<Integer> firstBrandIdList;
@ApiModelProperty(notes = "省份")
private List<Integer> provinceIds;
@ApiModelProperty(notes = "门店名称")
private String merchantName;
}
package cn.com.glsx.merchants.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
public class MerchantProvinceDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "省份名称")
private String provinceName;
@ApiModelProperty(notes = "省份code")
private Integer provinceCode;
@ApiModelProperty(notes = "商户id")
private Integer merchantId;
@ApiModelProperty(notes = "商户名称")
private String merchantName;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.model.response; package cn.com.glsx.merchants.model.response;
import cn.com.glsx.merchants.dto.MerchantBrandDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@Data @Data
public class MerchantSimpleResponse implements Serializable { public class MerchantSimpleResponse implements Serializable {
...@@ -18,10 +14,14 @@ public class MerchantSimpleResponse implements Serializable { ...@@ -18,10 +14,14 @@ public class MerchantSimpleResponse implements Serializable {
*/ */
private String merchantName; private String merchantName;
/** /**
* 商户号 * 商户号
*/ */
private Integer merchantNo; private Integer merchantNo;
/**
* 省份id
*/
private Integer provinceId;
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.remote; ...@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.remote;
import cn.com.glsx.framework.core.annotation.*; import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO;
import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO; import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO;
import cn.com.glsx.merchants.dto.merchant.CarbrandResponse; import cn.com.glsx.merchants.dto.merchant.CarbrandResponse;
import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO; import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO;
...@@ -541,4 +542,11 @@ public interface MerchantRemote { ...@@ -541,4 +542,11 @@ public interface MerchantRemote {
@ApiParams({@ApiParam(name = "merchantId", notes = "查询品牌", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}) @ApiParams({@ApiParam(name = "merchantId", notes = "查询品牌", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("品牌") @ApiResponse("品牌")
RpcResponse<List<MerchantBrandResponse>> getBrand(Integer merchantId); RpcResponse<List<MerchantBrandResponse>> getBrand(Integer merchantId);
@ApiMethod("根据一级品牌,省份id查询商户号列表")
@ApiParams({@ApiParam(name = "requestDTO", notes = "查询商户列表", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("查询商户列表(对外简化)")
RpcResponse<List<MerchantProvinceDTO>> findMerchantListByBrandIdsProvince(CarBrandProvinceRequestDTO requestDTO);
RpcResponse<List<MerchantProvinceDTO>> findMerchantProvinceListByIds(List<Integer> merchantIds);
} }
...@@ -283,6 +283,14 @@ public interface MerchantStaffRemote { ...@@ -283,6 +283,14 @@ public interface MerchantStaffRemote {
RpcResponse<String> findBeiSenSSOToken(String uuid); RpcResponse<String> findBeiSenSSOToken(String uuid);
/** /**
* 获取北森SSO鉴权
*/
@ApiMethod("获取北森SSO鉴权")
@ApiParams({@ApiParam(name = "phone", notes = "员工phone", dataType = DataTypeEnum.STRING, required = true)})
@ApiResponse("北森鉴权url")
RpcResponse<String> getBeiSenSSOToken(String phone);
/**
* 获取北森代办数量 * 获取北森代办数量
*/ */
@ApiMethod("获取北森代办数量") @ApiMethod("获取北森代办数量")
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId> <groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId> <artifactId>platform-merchants-api</artifactId>
<version>5.5.0-SNAPSHOT</version> <version>5.5.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.glsx</groupId> <groupId>com.glsx</groupId>
......
...@@ -447,7 +447,7 @@ public class BeisenEmployeeInfo implements Serializable { ...@@ -447,7 +447,7 @@ public class BeisenEmployeeInfo implements Serializable {
private Integer stdIsDeleted; private Integer stdIsDeleted;
/** /**
* 在职状态:1.是,0.否 * 在职状态:0.是,1.否
*/ */
@Column(name = "zz_status") @Column(name = "zz_status")
private Integer zzStatus; private Integer zzStatus;
......
package cn.com.glsx.merchants.mapper; package cn.com.glsx.merchants.mapper;
import cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO;
import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO; import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO;
import cn.com.glsx.merchants.dto.merchant.MerchantBasicInfo; import cn.com.glsx.merchants.dto.merchant.MerchantBasicInfo;
import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO; import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO;
import cn.com.glsx.merchants.entity.Merchant; import cn.com.glsx.merchants.entity.Merchant;
import cn.com.glsx.merchants.model.request.*; import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.request.merchant.*; import cn.com.glsx.merchants.model.request.merchant.FindBySupMerchantNoRpcRequest;
import cn.com.glsx.merchants.model.response.merchant.MerchantBasicInfoListResponse; import cn.com.glsx.merchants.model.request.merchant.MerchantBasicInfoRequest;
import cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse; import cn.com.glsx.merchants.model.request.merchant.MerchantListByConditionRpcRequest;
import cn.com.glsx.merchants.model.request.merchant.MerchantNoRpcRequest;
import cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest; import cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest;
import cn.com.glsx.merchants.model.request.serviceCenter.UpdateMerchantRpcRequest; import cn.com.glsx.merchants.model.request.serviceCenter.UpdateMerchantRpcRequest;
import cn.com.glsx.merchants.model.response.*; import cn.com.glsx.merchants.model.response.*;
import cn.com.glsx.merchants.model.response.merchant.MerchantBasicInfoListResponse;
import cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse; import cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse;
import cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse;
import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse; import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper; import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
...@@ -168,4 +172,8 @@ public interface MerchantMapper extends CommonBaseMapper<Merchant> { ...@@ -168,4 +172,8 @@ public interface MerchantMapper extends CommonBaseMapper<Merchant> {
List<String> getStaffPhoneByBrandAndScene(StaffPhoneRequestDTO requestDTO); List<String> getStaffPhoneByBrandAndScene(StaffPhoneRequestDTO requestDTO);
List<MerchantBrandResponse> getBrand(Integer merchantId); List<MerchantBrandResponse> getBrand(Integer merchantId);
List<MerchantProvinceDTO> findMerchantListByBrandIdsProvince(CarBrandProvinceRequestDTO requestDTO);
List<MerchantProvinceDTO> findMerchantProvinceListByIds(@Param("merchantIds") List<Integer> merchantIds);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.remote; package cn.com.glsx.merchants.remote;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert; import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO;
import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO; import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO;
import cn.com.glsx.merchants.dto.merchant.CarbrandResponse; import cn.com.glsx.merchants.dto.merchant.CarbrandResponse;
import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO; import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO;
...@@ -26,7 +26,6 @@ import cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse ...@@ -26,7 +26,6 @@ import cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse
import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse; import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse;
import cn.com.glsx.merchants.service.*; import cn.com.glsx.merchants.service.*;
import cn.com.glsx.merchants.service.serviceCenter.MerchantCenterService; import cn.com.glsx.merchants.service.serviceCenter.MerchantCenterService;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.dubbo.config.annotation.Service; import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.glsx.plat.common.utils.StringUtils; import com.glsx.plat.common.utils.StringUtils;
...@@ -916,4 +915,24 @@ public class MerchantRemoteImpl implements MerchantRemote { ...@@ -916,4 +915,24 @@ public class MerchantRemoteImpl implements MerchantRemote {
return RpcResponse.error(e); return RpcResponse.error(e);
} }
} }
@Override
public RpcResponse<List<MerchantProvinceDTO>> findMerchantListByBrandIdsProvince(CarBrandProvinceRequestDTO requestDTO){
try {
return RpcResponse.success(merchantService.findMerchantListByBrandIdsProvince(requestDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantProvinceDTO>> findMerchantProvinceListByIds(List<Integer> merchantIds){
try {
return RpcResponse.success(merchantService.findMerchantProvinceListByIds(merchantIds));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
} }
...@@ -180,6 +180,15 @@ public class MerchantStaffRemoteImpl implements MerchantStaffRemote { ...@@ -180,6 +180,15 @@ public class MerchantStaffRemoteImpl implements MerchantStaffRemote {
} }
@Override @Override
public RpcResponse<String> getBeiSenSSOToken(String phone) {
try {
return RpcResponse.success(beisenEmployeeMappingService.getBeiSenSSOToken(phone));
} catch (RpcServiceException e) {
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Integer> getUnreadCount(String uuid) { public RpcResponse<Integer> getUnreadCount(String uuid) {
try { try {
return RpcResponse.success(beisenEmployeeMappingService.getUnreadCount(uuid)); return RpcResponse.success(beisenEmployeeMappingService.getUnreadCount(uuid));
......
...@@ -12,24 +12,27 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -12,24 +12,27 @@ 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.contants.Constants; import cn.com.glsx.merchants.contants.Constants;
import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeMapperDTO; import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeMapperDTO;
import cn.com.glsx.merchants.entity.BeisenEmployeeInfo;
import cn.com.glsx.merchants.entity.BeisenEmployeeMapping; import cn.com.glsx.merchants.entity.BeisenEmployeeMapping;
import cn.com.glsx.merchants.mapper.BeisenEmployeeInfoMapper;
import cn.com.glsx.merchants.mapper.BeisenEmployeeMappingMapper; import cn.com.glsx.merchants.mapper.BeisenEmployeeMappingMapper;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.model.response.merchant.EmploymentRecordResponse; import cn.com.glsx.merchants.model.response.merchant.EmploymentRecordResponse;
import cn.com.glsx.merchants.service.beisen.BeiSenEmployeeDTO; import cn.com.glsx.merchants.service.beisen.BeiSenEmployeeDTO;
import cn.com.glsx.merchants.service.beisen.EmployeeRole; import cn.com.glsx.merchants.service.beisen.EmployeeRole;
import cn.com.glsx.merchants.service.beisen.EmployeeRoleService; import cn.com.glsx.merchants.service.beisen.EmployeeRoleService;
import com.glsx.cloudframework.core.util.BeanUtils; import com.glsx.cloudframework.core.util.BeanUtils;
import java.util.ArrayList; import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zhouhb * @author zhouhb
* @version V1.0 * @version V1.0
...@@ -38,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -38,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
* @date 2025/5/8 16:52 * @date 2025/5/8 16:52
* @Company:didihu.com.cn * @Company:didihu.com.cn
*/ */
@Slf4j
@Service @Service
public class BeisenEmployeeMappingService { public class BeisenEmployeeMappingService {
...@@ -59,6 +63,9 @@ public class BeisenEmployeeMappingService { ...@@ -59,6 +63,9 @@ public class BeisenEmployeeMappingService {
@Autowired @Autowired
private EmployeeRoleService employeeRoleService; private EmployeeRoleService employeeRoleService;
@Autowired
private BeisenEmployeeInfoMapper beisenEmployeeInfoMapper;
public List<BeisenEmployeeMapping> findByUserId(Integer userId) { public List<BeisenEmployeeMapping> findByUserId(Integer userId) {
return beisenEmployeeMappingMapper.findByUserId(userId); return beisenEmployeeMappingMapper.findByUserId(userId);
} }
...@@ -91,20 +98,20 @@ public class BeisenEmployeeMappingService { ...@@ -91,20 +98,20 @@ public class BeisenEmployeeMappingService {
@Transactional @Transactional
public void dismissStaff(BeiSenEmployeeDTO beiSenEmployeeDTO) { public void dismissStaff(BeiSenEmployeeDTO beiSenEmployeeDTO) {
// 1.失效员工状态 2.删掉员工关系 // 1.失效员工状态 2.删掉员工关系
List<BeisenEmployeeMapping> beisenEmployeeMappingList=findByUserId(beiSenEmployeeDTO.getUserId()); List<BeisenEmployeeMapping> beisenEmployeeMappingList = findByUserId(beiSenEmployeeDTO.getUserId());
if(CollectionUtils.isNotEmpty(beisenEmployeeMappingList)){ if (CollectionUtils.isNotEmpty(beisenEmployeeMappingList)) {
delete(beisenEmployeeMappingList); delete(beisenEmployeeMappingList);
List<String> collect = beisenEmployeeMappingList.stream() List<String> collect = beisenEmployeeMappingList.stream()
.map(BeisenEmployeeMapping::getCurrentsystememployeeuuid).collect( .map(BeisenEmployeeMapping::getCurrentsystememployeeuuid).collect(
Collectors.toList()); Collectors.toList());
merchantStaffService.dismissStaff(collect,beiSenEmployeeDTO.getUserId()); merchantStaffService.dismissStaff(collect, beiSenEmployeeDTO.getUserId());
EmployeeRole employeeRole = employeeRoleService.fromBusType( EmployeeRole employeeRole = employeeRoleService.fromBusType(
beiSenEmployeeDTO.getOIdJobPostText()); beiSenEmployeeDTO.getOIdJobPostText());
if (employeeRole != null && ("zhunDianEmployeeMappingService").equals(employeeRole.getHanderImp())) { if (employeeRole != null && ("zhunDianEmployeeMappingService").equals(employeeRole.getHanderImp())) {
RpcResponse<BeiSenBaseResponseDTO> beiSenBaseResponseDTORpcResponse = beisenParkstoreMappingService.updateBaiSenStaffTag( RpcResponse<BeiSenBaseResponseDTO> beiSenBaseResponseDTORpcResponse = beisenParkstoreMappingService.updateBaiSenStaffTag(
null, beiSenEmployeeDTO); null, beiSenEmployeeDTO);
if (!beiSenBaseResponseDTORpcResponse.isSuccess()) { if (!beiSenBaseResponseDTORpcResponse.isSuccess()) {
throw new RpcServiceException(beiSenBaseResponseDTORpcResponse.getError()); throw new RpcServiceException(beiSenBaseResponseDTORpcResponse.getError());
} }
...@@ -121,12 +128,12 @@ public class BeisenEmployeeMappingService { ...@@ -121,12 +128,12 @@ public class BeisenEmployeeMappingService {
@Transactional @Transactional
public void deleteStaff(BeiSenEmployeeDTO beiSenEmployeeDTO) { public void deleteStaff(BeiSenEmployeeDTO beiSenEmployeeDTO) {
// 1.删除员工关联 2.删掉员工关系 // 1.删除员工关联 2.删掉员工关系
List<BeisenEmployeeMapping> beisenEmployeeMappingList=findByUserId(beiSenEmployeeDTO.getUserId()); List<BeisenEmployeeMapping> beisenEmployeeMappingList = findByUserId(beiSenEmployeeDTO.getUserId());
if(CollectionUtils.isNotEmpty(beisenEmployeeMappingList)) { if (CollectionUtils.isNotEmpty(beisenEmployeeMappingList)) {
delete(beisenEmployeeMappingList); delete(beisenEmployeeMappingList);
List<String> collect = beisenEmployeeMappingList.stream() List<String> collect = beisenEmployeeMappingList.stream()
.map(BeisenEmployeeMapping::getCurrentsystememployeeuuid).collect( .map(BeisenEmployeeMapping::getCurrentsystememployeeuuid).collect(
Collectors.toList()); Collectors.toList());
merchantStaffService.delete(collect, beiSenEmployeeDTO.getUserId()); merchantStaffService.delete(collect, beiSenEmployeeDTO.getUserId());
} }
} }
...@@ -139,14 +146,42 @@ public class BeisenEmployeeMappingService { ...@@ -139,14 +146,42 @@ public class BeisenEmployeeMappingService {
*/ */
public String findBeiSenSSOToken(String phone) { public String findBeiSenSSOToken(String phone) {
List<BeisenEmployeeMapping> beisenEmployeeMappingList=beisenEmployeeMappingMapper.findByPhone(phone); List<BeisenEmployeeMapping> beisenEmployeeMappingList = beisenEmployeeMappingMapper.findByPhone(phone);
if(CollectionUtils.isEmpty(beisenEmployeeMappingList)){ if (CollectionUtils.isEmpty(beisenEmployeeMappingList)) {
throw new RpcServiceException("北森用户未找到"); throw new RpcServiceException("北森用户未找到");
}
GetSSOTokenRequestDTO requestDTO = new GetSSOTokenRequestDTO();
requestDTO.setQueryUserID(beisenEmployeeMappingList.get(0).getUserid() + "");
RpcResponse<String> ssoToken = beiSenStaffRemote.getSSOToken(requestDTO);
if (ssoToken.isFailed()) {
throw new RpcServiceException("北森SSOtoken获取失败");
}
return ssoToken.getResult();
}
/**
* 获取北森SSO鉴权(所有人)
*
* @param phone 手机号
* @return
*/
public String getBeiSenSSOToken(String phone) {
BeisenEmployeeInfo query = new BeisenEmployeeInfo();
query.setMobilePhone(phone);
query.setStdIsDeleted(0);
query.setZzStatus(0);
List<BeisenEmployeeInfo> beisenEmployeeInfoList = beisenEmployeeInfoMapper.select(query);
if (CollectionUtils.isEmpty(beisenEmployeeInfoList)) {
throw new RpcServiceException("北森用户未找到");
}
GetSSOTokenRequestDTO requestDTO = new GetSSOTokenRequestDTO();
if (beisenEmployeeInfoList.get(0).getUserID() == null) {
throw new RpcServiceException("北森用户userID未找到");
} }
GetSSOTokenRequestDTO requestDTO=new GetSSOTokenRequestDTO(); requestDTO.setQueryUserID(beisenEmployeeInfoList.get(0).getUserID() + "");
requestDTO.setQueryUserID(beisenEmployeeMappingList.get(0).getUserid()+"");
RpcResponse<String> ssoToken = beiSenStaffRemote.getSSOToken(requestDTO); RpcResponse<String> ssoToken = beiSenStaffRemote.getSSOToken(requestDTO);
if(ssoToken.isFailed()){ if (ssoToken.isFailed()) {
log.error("北森SSOtoken获取失败:{}", ssoToken);
throw new RpcServiceException("北森SSOtoken获取失败"); throw new RpcServiceException("北森SSOtoken获取失败");
} }
return ssoToken.getResult(); return ssoToken.getResult();
...@@ -159,19 +194,19 @@ public class BeisenEmployeeMappingService { ...@@ -159,19 +194,19 @@ public class BeisenEmployeeMappingService {
* @return * @return
*/ */
public Integer getUnreadCount(String uuid) { public Integer getUnreadCount(String uuid) {
List<BeisenEmployeeMapping> beisenEmployeeMappingList=beisenEmployeeMappingMapper.findByUUId(uuid); List<BeisenEmployeeMapping> beisenEmployeeMappingList = beisenEmployeeMappingMapper.findByUUId(uuid);
if(CollectionUtils.isEmpty(beisenEmployeeMappingList)){ if (CollectionUtils.isEmpty(beisenEmployeeMappingList)) {
throw new RpcServiceException("北森用户未找到"); throw new RpcServiceException("北森用户未找到");
} }
GetUnreadCountRequestDTO requestDTO=new GetUnreadCountRequestDTO(); GetUnreadCountRequestDTO requestDTO = new GetUnreadCountRequestDTO();
requestDTO.setQueryUserID(beisenEmployeeMappingList.get(0).getUserid()); requestDTO.setQueryUserID(beisenEmployeeMappingList.get(0).getUserid());
RpcResponse<GetUnreadCountResponseDTO> unreadCount = beiSenStaffRemote.getUnreadCount( RpcResponse<GetUnreadCountResponseDTO> unreadCount = beiSenStaffRemote.getUnreadCount(
requestDTO); requestDTO);
if(unreadCount.isFailed()){ if (unreadCount.isFailed()) {
throw new RpcServiceException("获取北森代办数量服务异常"); throw new RpcServiceException("获取北森代办数量服务异常");
} }
GetUnreadCountResponseDTO result = unreadCount.getResult(); GetUnreadCountResponseDTO result = unreadCount.getResult();
if(result.isSuccess()){ if (result.isSuccess()) {
return result.getData().getTodoCount(); return result.getData().getTodoCount();
} }
throw new RpcServiceException("获取北森代办数量获取失败"); throw new RpcServiceException("获取北森代办数量获取失败");
...@@ -187,7 +222,7 @@ public class BeisenEmployeeMappingService { ...@@ -187,7 +222,7 @@ public class BeisenEmployeeMappingService {
public List<BeisenEmployeeMapping> findByMerchantNo(Integer merchantNo) { public List<BeisenEmployeeMapping> findByMerchantNo(Integer merchantNo) {
String property = environment.getProperty("merchant.yqd.accountType"); String property = environment.getProperty("merchant.yqd.accountType");
return beisenEmployeeMappingMapper.findByMerchantNo(merchantNo,Integer.parseInt(property)); return beisenEmployeeMappingMapper.findByMerchantNo(merchantNo, Integer.parseInt(property));
} }
public List<BeiSenEmployeeMapperDTO> findByUserIds(List<Integer> userIds) { public List<BeiSenEmployeeMapperDTO> findByUserIds(List<Integer> userIds) {
...@@ -207,7 +242,7 @@ public class BeisenEmployeeMappingService { ...@@ -207,7 +242,7 @@ public class BeisenEmployeeMappingService {
employeeQueryRequestDTO.setIsWithDeleted(false); employeeQueryRequestDTO.setIsWithDeleted(false);
employeeQueryRequestDTO.setEnableTranslate(true); employeeQueryRequestDTO.setEnableTranslate(true);
RpcResponse<EmployeeQueryDetailResponseDTO> serviceInfoByIds = beiSenStaffRemote.getServiceInfoByIds( RpcResponse<EmployeeQueryDetailResponseDTO> serviceInfoByIds = beiSenStaffRemote.getServiceInfoByIds(
employeeQueryRequestDTO); employeeQueryRequestDTO);
if (!serviceInfoByIds.isSuccess()) { if (!serviceInfoByIds.isSuccess()) {
return null; return null;
} }
......
...@@ -14,10 +14,7 @@ import cn.com.glsx.merchants.config.SystemProperty; ...@@ -14,10 +14,7 @@ import cn.com.glsx.merchants.config.SystemProperty;
import cn.com.glsx.merchants.contants.Constants; import cn.com.glsx.merchants.contants.Constants;
import cn.com.glsx.merchants.dto.MerchantBrandDTO; import cn.com.glsx.merchants.dto.MerchantBrandDTO;
import cn.com.glsx.merchants.dto.MerchantFirstBrandDTO; import cn.com.glsx.merchants.dto.MerchantFirstBrandDTO;
import cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO; import cn.com.glsx.merchants.dto.merchant.*;
import cn.com.glsx.merchants.dto.merchant.CarbrandResponse;
import cn.com.glsx.merchants.dto.merchant.MerchantBasicInfo;
import cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO;
import cn.com.glsx.merchants.entity.*; import cn.com.glsx.merchants.entity.*;
import cn.com.glsx.merchants.enums.*; import cn.com.glsx.merchants.enums.*;
import cn.com.glsx.merchants.enums.beisen.AccountEventSyncBeiSenEnum; import cn.com.glsx.merchants.enums.beisen.AccountEventSyncBeiSenEnum;
...@@ -26,9 +23,10 @@ import cn.com.glsx.merchants.listener.ImportMerchantListener; ...@@ -26,9 +23,10 @@ import cn.com.glsx.merchants.listener.ImportMerchantListener;
import cn.com.glsx.merchants.mapper.MerchantMapper; import cn.com.glsx.merchants.mapper.MerchantMapper;
import cn.com.glsx.merchants.mapper.MerchantStaffMapper; import cn.com.glsx.merchants.mapper.MerchantStaffMapper;
import cn.com.glsx.merchants.model.*; import cn.com.glsx.merchants.model.*;
import cn.com.glsx.merchants.model.MerchantImportModel;
import cn.com.glsx.merchants.model.request.*; import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.request.merchant.*;
import cn.com.glsx.merchants.model.request.brand.MerchantBrandRpcRequest; import cn.com.glsx.merchants.model.request.brand.MerchantBrandRpcRequest;
import cn.com.glsx.merchants.model.request.merchant.*;
import cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest; import cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest;
import cn.com.glsx.merchants.model.response.*; import cn.com.glsx.merchants.model.response.*;
import cn.com.glsx.merchants.model.response.merchant.MerchantBasicInfoListResponse; import cn.com.glsx.merchants.model.response.merchant.MerchantBasicInfoListResponse;
...@@ -37,7 +35,6 @@ import cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse; ...@@ -37,7 +35,6 @@ import cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse;
import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse; import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse;
import cn.com.glsx.merchants.util.*; import cn.com.glsx.merchants.util.*;
import cn.com.glsx.merchants.util.validation.BeanValidationUtils; import cn.com.glsx.merchants.util.validation.BeanValidationUtils;
import cn.com.glsx.merchants.util.validation.ValidationResult;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.extra.pinyin.PinyinUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
...@@ -64,7 +61,6 @@ import org.springframework.http.*; ...@@ -64,7 +61,6 @@ import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import tk.mybatis.mapper.entity.Example;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -2789,4 +2785,12 @@ public class MerchantService { ...@@ -2789,4 +2785,12 @@ public class MerchantService {
} }
return merchantStaffMapper.qryPhoneInStaffList(phones); return merchantStaffMapper.qryPhoneInStaffList(phones);
} }
public List<MerchantProvinceDTO> findMerchantListByBrandIdsProvince(CarBrandProvinceRequestDTO requestDTO) {
return merchantMapper.findMerchantListByBrandIdsProvince(requestDTO);
}
public List<MerchantProvinceDTO> findMerchantProvinceListByIds(List<Integer> merchantIds) {
return merchantMapper.findMerchantProvinceListByIds(merchantIds);
}
} }
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
and t1.id = #{id} and t1.id = #{id}
</select> </select>
<select id="findAllMerchant" resultMap="resultMap"> <select id="findAllMerchant" resultMap="resultMap">
select id,merchant_name from platform_merchant where 1=1 and status in (2) select id,merchant_name,merchantNo from platform_merchant where 1=1 and status in (2)
<if test="merchantRequest.dataPermission !=null and merchantRequest.dataPermission.size>0"> <if test="merchantRequest.dataPermission !=null and merchantRequest.dataPermission.size>0">
and id in and id in
<foreach collection="merchantRequest.dataPermission" item="item" index="index" open="(" close=")" <foreach collection="merchantRequest.dataPermission" item="item" index="index" open="(" close=")"
...@@ -1215,4 +1215,47 @@ ...@@ -1215,4 +1215,47 @@
select first_brand_id firstId, sec_brand_id secondId select first_brand_id firstId, sec_brand_id secondId
from platform_merchant_brand where merchant_id =#{merchantId} and del_flag = 0 from platform_merchant_brand where merchant_id =#{merchantId} and del_flag = 0
</select> </select>
<select id="findMerchantListByBrandIdsProvince" resultType="cn.com.glsx.merchants.model.response.MerchantProvinceDTO">
SELECT DISTINCT pm.merchantNo as merchantId,
pm.merchant_name as merchantName,
pm.province_code as provinceCode
FROM platform_merchant pm
LEFT JOIN platform_merchant_brand pmb
ON pm.merchantNo = pmb.merchant_id and pmb.del_flag = 0
WHERE pm.del_flag = 0
<if test="provinceIds != null and provinceIds.size() > 0">
AND pm.province_code IN
<foreach collection="provinceIds" item="item" separator="," index="index" open="(" close=")">
#{item}
</foreach>
</if>
<if test="firstBrandIdList != null and firstBrandIdList.size() > 0">
AND pmb.first_brand_id IN
<foreach collection="firstBrandIdList" item="item" separator="," index="index" open="(" close=")">
#{item}
</foreach>
</if>
<if test="merchantName != null and merchantName != '' ">
AND pm.merchant_name LIKE CONCAT('%',#{merchantName},'%')
</if>
AND pmb.del_flag = 0
ORDER BY pm.id;
</select>
<select id="findMerchantProvinceListByIds" resultType="cn.com.glsx.merchants.model.response.MerchantProvinceDTO">
SELECT distinct merchantNo merchantId,
province_code provinceCode,
province_name provinceName,
merchant_name merchantName
FROM platform_merchant
WHERE del_flag = 0
<if test="merchantIds != null and merchantIds.size() > 0">
AND merchantNo IN
<foreach collection="merchantIds" item="item" separator="," index="index" open="(" close=")">
#{item}
</foreach>
</if>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!