Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
public enum ReceivingBankEnum {
|
||||
|
||||
XFSG_RECEIVING_BANK("鲜丰水果股份有限公司","33050161642700001117","中国建设银行浙江省分行文晖支行"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
private String accountName;
|
||||
private String accountNum;
|
||||
private String bank;
|
||||
|
||||
ReceivingBankEnum(String accountName, String accountNum, String bank) {
|
||||
this.accountName = accountName;
|
||||
this.accountNum = accountNum;
|
||||
this.bank = bank;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
public String getAccountNum() {
|
||||
return accountNum;
|
||||
}
|
||||
|
||||
public void setAccountNum(String accountNum) {
|
||||
this.accountNum = accountNum;
|
||||
}
|
||||
|
||||
public String getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
public void setBank(String bank) {
|
||||
this.bank = bank;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public interface SysRoleMapper {
|
||||
List<EnterpriseUserRole> selectUserRoleBySourceAndUserId(@Param("source") String source ,
|
||||
@Param("userIdList") List<String> userIdList);
|
||||
|
||||
List<String> getUserIdListByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
|
||||
List<EnterpriseUserRole> getUserIdListByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
|
||||
/**
|
||||
* 获取用户岗位信息
|
||||
* @param userIdList
|
||||
|
||||
@@ -113,7 +113,10 @@
|
||||
update_user_id,
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
deleted
|
||||
deleted,
|
||||
</if>
|
||||
<if test="param.partnerNum != null">
|
||||
partner_num,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@@ -198,6 +201,9 @@
|
||||
<if test="param.deleted != null">
|
||||
#{param.deleted}
|
||||
</if>
|
||||
<if test="param.partnerNum != null">
|
||||
#{param.partnerNum}
|
||||
</if>
|
||||
</trim>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
<trim suffixOverrides=",">
|
||||
@@ -279,6 +285,9 @@
|
||||
<if test="param.deleted != null">
|
||||
deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.partnerNum != null">
|
||||
partner_num = #{param.partnerNum}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="toExperiencing">
|
||||
|
||||
@@ -89,9 +89,10 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getUserIdListByRoleIdList" resultType="java.lang.String">
|
||||
<select id="getUserIdListByRoleIdList" resultType="com.cool.store.entity.EnterpriseUserRole">
|
||||
select
|
||||
distinct a.user_id
|
||||
b.role_id as roleId,
|
||||
b.user_id as userId
|
||||
from enterprise_user_${enterpriseId} a
|
||||
left join enterprise_user_role_${enterpriseId} b on a.user_id=b.user_id
|
||||
<where>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FranchiseeDO {
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bank;
|
||||
/**
|
||||
* 开户行支行
|
||||
*/
|
||||
private String bankSub;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private String birthday;
|
||||
/**
|
||||
* 城市代码
|
||||
*/
|
||||
private String cityCode;
|
||||
/**
|
||||
* 加盟商手机号码
|
||||
*/
|
||||
private String frMobile;
|
||||
/**
|
||||
* 加盟商姓名
|
||||
*/
|
||||
private String frName;
|
||||
/**
|
||||
* 个人身份证号/企业统一社会信用代码
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 身份证地址/公司地址
|
||||
*/
|
||||
private String idCardAddress;
|
||||
/**
|
||||
* 身份证原件国徽面/食品经营许可证上传
|
||||
*/
|
||||
private String idCardBackUrl;
|
||||
/**
|
||||
* 身份证原件正面地址/营业执照拍照上传
|
||||
*/
|
||||
private String idCardFrontUrl;
|
||||
/**
|
||||
* 操作人工号
|
||||
*/
|
||||
private String operator;
|
||||
/**
|
||||
* 缴款时间
|
||||
*/
|
||||
private String payDateStr;
|
||||
/**
|
||||
* 省份代码
|
||||
*/
|
||||
private String provinceCode;
|
||||
/**
|
||||
* 收款账户
|
||||
*/
|
||||
private String retAccount;
|
||||
/**
|
||||
* 性别:0-女,1-男
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 签约类型:0-个人签约;1-企业签约
|
||||
*/
|
||||
private long signType;
|
||||
|
||||
}
|
||||
@@ -163,7 +163,9 @@ public class LineInfoDO {
|
||||
* 是否删除:0.否 1.是
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 加盟商编码
|
||||
*/
|
||||
private String partnerNum;
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class LinePayDO implements Serializable {
|
||||
@ApiModelProperty("line_info.id")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("支付状态 0:待付款 1:已付款")
|
||||
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty("支付方式 1微信 2银行转账")
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.entity.FranchiseeDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FranchiseeSaveRequest {
|
||||
|
||||
private String partnerId;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("加盟商姓名")
|
||||
private String frName;
|
||||
|
||||
@ApiModelProperty("加盟商手机号码")
|
||||
private String frMobile;
|
||||
|
||||
@ApiModelProperty("个人身份证号/企业统一社会信用代码")
|
||||
private String idCard;
|
||||
|
||||
@ApiModelProperty("身份证地址/公司地址")
|
||||
private String idCardAddress;
|
||||
|
||||
@ApiModelProperty("性别:0-女,1-男")
|
||||
private Integer sex;
|
||||
|
||||
@ApiModelProperty("身份证原件正面地址/营业执照拍照上传")
|
||||
private String idCardFrontUrl;
|
||||
@ApiModelProperty("身份证原件国徽面/食品经营许可证上传")
|
||||
private String idCardBackUrl;
|
||||
|
||||
@ApiModelProperty("0-个人签约;1-企业签约")
|
||||
private Integer signType;
|
||||
|
||||
@ApiModelProperty("生日,企业不用传")
|
||||
private String birthday;
|
||||
|
||||
|
||||
public FranchiseeDO toFranchiseeDO() {
|
||||
FranchiseeDO franchiseeDO = new FranchiseeDO();
|
||||
franchiseeDO.setBirthday(this.birthday);
|
||||
franchiseeDO.setFrMobile(this.frMobile);
|
||||
franchiseeDO.setFrName(this.frName);
|
||||
franchiseeDO.setIdCard(this.idCard);
|
||||
franchiseeDO.setIdCardAddress(this.idCardAddress);
|
||||
franchiseeDO.setIdCardBackUrl(this.idCardBackUrl);
|
||||
franchiseeDO.setIdCardFrontUrl(this.idCardFrontUrl);
|
||||
franchiseeDO.setSex(this.sex);
|
||||
franchiseeDO.setSignType(this.signType);
|
||||
return franchiseeDO;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class LinePaySubmitRequest {
|
||||
@NotNull(message = "线索id不能为空")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("支付状态 0:待付款 1:已付款")
|
||||
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty("支付方式 1微信 2银行转账")
|
||||
|
||||
@@ -19,10 +19,19 @@ public class LinePayVO {
|
||||
@ApiModelProperty("xfsg_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("加盟商姓名")
|
||||
private String partnerName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("line_info.id")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("支付状态 0:待付款 1:已付款")
|
||||
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
|
||||
private Byte payStatus;
|
||||
|
||||
@ApiModelProperty("支付方式 1微信 2银行转账")
|
||||
|
||||
@@ -31,4 +31,8 @@ public class LoginUserInfo {
|
||||
// private SysRoleDO sysRole;
|
||||
|
||||
private Integer onlineStatus;
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
private String jobNumber;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.FranchiseeSaveRequest;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.response.InitiatingResponse;
|
||||
@@ -22,4 +23,6 @@ public interface IntentAgreementService {
|
||||
SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId);
|
||||
|
||||
InitiatingResponse initiating(InitiatingRequest request);
|
||||
|
||||
InitiatingResponse save(FranchiseeSaveRequest request);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,13 @@ public interface RegionService {
|
||||
|
||||
RegionPathNameVO getAllRegionName(Long regionId);
|
||||
|
||||
/**
|
||||
* 获取所属战区
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
String getBelongWarRegionName(Long regionId);
|
||||
|
||||
/**
|
||||
* 根据意向区域找大区id
|
||||
* @param wantShopAreaId
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ReceivingBankEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.JoinIntentionMapper;
|
||||
import com.cool.store.mapper.LineAuditInfoMapper;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.mapper.*;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.FranchiseeSaveRequest;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.response.InitiatingResponse;
|
||||
@@ -28,11 +28,11 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.PARAMS_VALIDATE_ERROR;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -60,6 +60,12 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
@Resource
|
||||
LineAuditInfoMapper lineAuditInfoMapper;
|
||||
|
||||
@Resource
|
||||
LinePayMapper linePayMapper;
|
||||
|
||||
@Resource
|
||||
HyOpenAreaInfoMapper openAreaInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -88,7 +94,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
@Override
|
||||
public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) {
|
||||
if (StringUtil.isBlank(partnerId) && lineId == null) {
|
||||
throw new ServiceException(PARAMS_VALIDATE_ERROR);
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId);
|
||||
if (Objects.isNull(signingBaseInfoDO)) {
|
||||
@@ -98,9 +104,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
|
||||
MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId);
|
||||
response.setType(byLineId.getJoinType());
|
||||
if (Objects.nonNull(signingBaseInfoDO.getAuditId())){
|
||||
if (Objects.nonNull(signingBaseInfoDO.getAuditId())) {
|
||||
LineAuditInfoDO lineAuditInfoDO = lineAuditInfoMapper.selectByPrimaryKey(signingBaseInfoDO.getAuditId());
|
||||
if (Objects.isNull(lineAuditInfoDO)){
|
||||
if (Objects.isNull(lineAuditInfoDO)) {
|
||||
response.setRejectPublicReason(null);
|
||||
}
|
||||
response.setRejectPublicReason(lineAuditInfoDO.getRejectPublicReason());
|
||||
@@ -187,6 +193,46 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public InitiatingResponse save(FranchiseeSaveRequest request) {
|
||||
log.info("save request:{}", JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = xfsgUrl + Constants.FRANCHISEE_STORE_NUM + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
FranchiseeDO franchiseeDO = request.toFranchiseeDO();
|
||||
//查银行信息
|
||||
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(request.getLineId());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String dateString = sdf.format(linePayDO.getPayTime());
|
||||
franchiseeDO.setPayDateStr(dateString);
|
||||
franchiseeDO.setRetAccount(ReceivingBankEnum.XFSG_RECEIVING_BANK.getAccountNum());
|
||||
franchiseeDO.setBank(linePayDO.getBankCode());
|
||||
franchiseeDO.setBankSub(linePayDO.getBranchBankCode());
|
||||
//查城市信息
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
|
||||
franchiseeDO.setProvinceCode(String.valueOf(openAreaInfoDO.getParentId()));
|
||||
franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId()));
|
||||
//操作人工号 暂时写死
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
franchiseeDO.setOperator("22090043");
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
|
||||
//更新线索(进入蓄水池并回填加盟商编码)
|
||||
if (initiatingResponse.getCode() == 0){
|
||||
LineInfoDO lineInfoParam = new LineInfoDO();
|
||||
lineInfoParam.setId(request.getLineId());
|
||||
//蓄水池
|
||||
lineInfoParam.setJoinStatus(1);
|
||||
lineInfoParam.setPartnerNum(initiatingResponse.getData());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoParam);
|
||||
}
|
||||
|
||||
return initiatingResponse;
|
||||
}
|
||||
|
||||
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
String signature = SecureUtil.getSignature(timestamp);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.LinePayDAO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.LinePayDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
@@ -32,6 +34,9 @@ public class LinePayServiceImpl implements LinePayService {
|
||||
@Resource
|
||||
private LinePayDAO linePayDAO;
|
||||
|
||||
@Resource
|
||||
private HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
|
||||
@@ -45,6 +50,9 @@ public class LinePayServiceImpl implements LinePayService {
|
||||
if (linePayDO != null){
|
||||
result = new LinePayVO();
|
||||
BeanUtil.copyProperties(linePayDO,result);
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
result.setPartnerName(lineInfo != null ? lineInfo.getUsername() : "");
|
||||
result.setMobile(lineInfo != null ? lineInfo.getMobile() : "");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -84,8 +92,7 @@ public class LinePayServiceImpl implements LinePayService {
|
||||
linePayDO.setPayPic(request.getPayPic());
|
||||
linePayDO.setPromisePic(request.getPromisePic());
|
||||
if(isAdd){
|
||||
linePayDO.setPartnerId("123");
|
||||
// linePayDO.setPartnerId(partnerUser.getPartnerId());
|
||||
linePayDO.setPartnerId(partnerUser.getPartnerId());
|
||||
linePayDO.setLineId(request.getLineId());
|
||||
linePayDO.setCreateTime(new Date());
|
||||
linePayDO.setCreateUserId(partnerUser.getPartnerId());
|
||||
|
||||
@@ -90,6 +90,16 @@ public class RegionServiceImpl implements RegionService {
|
||||
return regionPathNameVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBelongWarRegionName(Long regionId) {
|
||||
RegionPathNameVO regionPathNameVO = this.getAllRegionName(regionId);
|
||||
if(regionPathNameVO != null && StringUtils.isNotBlank(regionPathNameVO.getAllRegionName())){
|
||||
String allRegionName = regionPathNameVO.getAllRegionName();
|
||||
return allRegionName.substring(allRegionName.indexOf(Constants.M_LINE) + 1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据意向区域找大区id
|
||||
* @param wantShopAreaId
|
||||
|
||||
@@ -84,6 +84,12 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
return userDO;
|
||||
}
|
||||
}
|
||||
Long warRegionId = regionAreaConfigDao.getByWantShopAreaId(wantShopAreaId);
|
||||
// 查找有战区权限的人
|
||||
List<String> authWarRegionUserIdList = authWarRegionUser(warRegionId);
|
||||
if(CollectionUtils.isEmpty(authWarRegionUserIdList)){
|
||||
return null;
|
||||
}
|
||||
SysRoleDO sysRoleDO = sysRoleMapper.getRolesByNameAndSource(roleName, RoleSourceEnum.CREATE.getCode());
|
||||
Long roleId = sysRoleDO.getId();
|
||||
List<String> hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
|
||||
@@ -93,9 +99,6 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
roleId = sysRoleDO.getId();
|
||||
hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
|
||||
}
|
||||
Long warRegionId = regionAreaConfigDao.getByWantShopAreaId(wantShopAreaId);
|
||||
// 查找有战区权限的人
|
||||
List<String> authWarRegionUserIdList = authWarRegionUser(warRegionId);
|
||||
authWarRegionUserIdList.retainAll(hasRoleUserIdList);
|
||||
if(UserRoleEnum.INVESTMENT_MANAGER.getDesc().equals(roleName)){
|
||||
// 按工号排序后放入redis
|
||||
@@ -113,7 +116,20 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
if(CollectionUtils.isEmpty(roleIds) || Objects.isNull(regionId)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return null;
|
||||
RegionDO regionDO = regionMapper.getByRegionId(regionId);
|
||||
if(regionDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
}
|
||||
// 查找有区域权限的人
|
||||
List<String> authRegionUserIdList = authWarRegionUser(regionId);
|
||||
if(CollectionUtils.isEmpty(authRegionUserIdList)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<Long> roleIdList = roleIds.stream().map(a -> Long.valueOf(a)).collect(Collectors.toList());
|
||||
List<EnterpriseUserRole> enterpriseUserRoleList = sysRoleMapper.getUserIdListByRoleIdList(roleIdList);
|
||||
enterpriseUserRoleList = enterpriseUserRoleList.stream().filter(o -> authRegionUserIdList.contains(o.getUserId())).collect(Collectors.toList());
|
||||
Map<String, List<String>> enterpriseUserRoleMap = ListUtils.emptyIfNull(enterpriseUserRoleList).stream().collect(Collectors.groupingBy(EnterpriseUserRole::getRoleId, Collectors.mapping(k->k.getUserId(), Collectors.toList())));
|
||||
return enterpriseUserRoleMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -170,6 +170,11 @@ public class Constants
|
||||
public static final String INTENTION_CONTRACT_URL = "/api/coolstore/start-flow/intention-contract";
|
||||
|
||||
|
||||
public static final String FRANCHISEE_STORE_NUM = "/api/kdz/franchisee/save";
|
||||
|
||||
public static final Integer ZERO_INTEGER = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import javax.annotation.Resource;
|
||||
@Slf4j
|
||||
public class KdzApiController {
|
||||
|
||||
String allowEnterpriseId = "45f92210375346858b6b6694967f44de,e17cd2dc350541df8a8b0af9bd27f77d";
|
||||
String allowEnterpriseId = "45f92210375346858b6b6694967f44de,e17cd2dc350541df8a8b0af9bd27f77d,28c20a7b42b94171acb1ab3f631d69e1,9ee7b8b48e2447f9a2075b5a46e94d08";
|
||||
|
||||
@Resource
|
||||
KdzApiService kdzApiService;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.FranchiseeSaveRequest;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.response.InitiatingResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
@@ -36,5 +37,13 @@ public class PCIntentAgreementController {
|
||||
return ResponseResult.success(intentAgreementService.initiating(request));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/franchisee/save")
|
||||
@ApiOperation("kdz -> xfsg 加盟商新增")
|
||||
public ResponseResult<InitiatingResponse> save(@RequestBody FranchiseeSaveRequest request) {
|
||||
return ResponseResult.success(intentAgreementService.save(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,5 +40,10 @@ public class RegionController {
|
||||
return ResponseResult.success(regionService.listByThirdRegionType(parentId, thirdRegionType));
|
||||
}
|
||||
|
||||
@ApiOperation("获取所属战区")
|
||||
@GetMapping("/getBelongWarRegionName")
|
||||
public ResponseResult<String> getBelongWarRegionName(@RequestParam(value = "regionId", required = true) Long regionId) {
|
||||
return ResponseResult.success(regionService.getBelongWarRegionName(regionId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName UserAuthMappingController
|
||||
@@ -41,4 +42,11 @@ public class UserAuthMappingController {
|
||||
return ResponseResult.success(userAuthMappingService.listWantShopAreaIdByUserId(userId));
|
||||
}
|
||||
|
||||
@ApiOperation("找角色下的人")
|
||||
@GetMapping("/getUserIdByRoleIdAndRegionId")
|
||||
public ResponseResult<Map<String, List<String>>> getUserIdByRoleIdAndRegionId(@RequestParam(value = "roleIds", required = true) List<String> roleIds,
|
||||
@RequestParam(value = "regionId", required = true) Long regionId) {
|
||||
return ResponseResult.success(userAuthMappingService.getUserIdByRoleIdAndRegionId(roleIds, regionId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user