|
|
@@ -89,6 +89,10 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
private IDraftUseraccountNewMapper iDraftUseraccountNewMapper;
|
|
|
@Resource
|
|
|
private IDraftUserinfoMapper iDraftUserinfoMapper;
|
|
|
+ @Resource
|
|
|
+ private IMarketMapper iMarketMapper;
|
|
|
+ @Resource
|
|
|
+ private IMsExtendroleMapper iMsExtendroleMapper;
|
|
|
|
|
|
@Override
|
|
|
public PageResult<TaAccountQueryResult> queryUserMsg(HttpServletRequest request, TaAccountQueryParam taAccountQueryParam) {
|
|
|
@@ -380,6 +384,26 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM003.getCode(), request.getHeader("Accept-Language"));
|
|
|
}
|
|
|
}
|
|
|
+ if (ta.getIsmain() == 0 && param.getRelateduserid() != null &&
|
|
|
+ param.getRelateduserid().compareTo(ta.getUserid()) == 0) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.INVESTOR_ERROR_CODE_012.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ //原来的状态
|
|
|
+ Integer oldtradestatus = ta.getTradestatus();
|
|
|
+ if (param.getRelateduserid() != null) {
|
|
|
+ ta.setRelateduserid(param.getRelateduserid());
|
|
|
+ }
|
|
|
+ ta.setRelatedaccountstatus(param.getRelatedaccountstatus());
|
|
|
+ iTaaccountMapper.update(ta, new QueryWrapper<Taaccount>().eq("accountid", ta.getAccountid()));
|
|
|
+
|
|
|
+ List<Logintaaccount> logintaaccounts = iLogintaaccountMapper.selectList(new QueryWrapper<Logintaaccount>().eq("accountid", param.getAccountId()));
|
|
|
+ List<Long> list = logintaaccounts.stream().map(Logintaaccount::getAccountid).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Set<Long> set = new HashSet<>();
|
|
|
+ Set<Long> set_msg = new HashSet<>();
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ set.addAll(list);
|
|
|
+ }
|
|
|
//处理当前登录账户资金权限
|
|
|
if (CollectionUtils.isNotEmpty(param.getLoginIds())) {
|
|
|
iLogintaaccountMapper.delete(new QueryWrapper<Logintaaccount>().eq("ACCOUNTID", param.getAccountId()));
|
|
|
@@ -390,8 +414,17 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
lt.setModifytime(new Date());
|
|
|
lt.setModifierid(systemmanager.getAutoid());
|
|
|
iLogintaaccountMapper.insert(lt);
|
|
|
+
|
|
|
+ if (!set.contains(id)) {
|
|
|
+ set_msg.add(id);
|
|
|
+ } else {
|
|
|
+ set.remove(id);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ set_msg.addAll(set);
|
|
|
+ ta.setSet_msg(set_msg);
|
|
|
+
|
|
|
//处理市场权限
|
|
|
if (systemmanager.getAreauserid().compareTo(ta.getUserid()) == 0) {
|
|
|
iTaaccountmarketMapper.delete(new QueryWrapper<Taaccountmarket>().eq("ACCOUNTID", param.getAccountId()));
|
|
|
@@ -405,6 +438,26 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
}
|
|
|
//记录操作日志
|
|
|
writeOperateLog(param, ta, systemmanager);
|
|
|
+
|
|
|
+ try {
|
|
|
+ //发送登录服务消息
|
|
|
+ if (ta.getSet_msg() != null && !ta.getSet_msg().isEmpty()) {
|
|
|
+ iSendMsgService.sendLoginMsg(ta.getSet_msg(), 4, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送用户变更通知
|
|
|
+ if (Objects.equals(oldtradestatus, SysEnums.TradeStatusEnum.CANCELED.getType())) {
|
|
|
+ iSendMsgService.sendUserChangeMsg(ta.getAccountid(), ta.getUserid(),
|
|
|
+ SysEnums.UserOperateTypeEnum.ADD.getType(),
|
|
|
+ SysEnums.NotifyModeEnum.UNICAST.getType());
|
|
|
+ } else {
|
|
|
+ iSendMsgService.sendUserChangeMsg(ta.getAccountid(), ta.getUserid(),
|
|
|
+ SysEnums.UserOperateTypeEnum.UPDATE.getType(),
|
|
|
+ SysEnums.NotifyModeEnum.UNICAST.getType());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("资金账户-->修改 发送用户信息修改失败,code=" + FunCodeConstants.FunCode_Trade_UserChangeNtf + ",请检查!,失败原因:" + e);
|
|
|
+ }
|
|
|
return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
}
|
|
|
|
|
|
@@ -455,7 +508,7 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
}
|
|
|
}
|
|
|
//原来的状态
|
|
|
- Integer oldtradestatus = updateParam.getTradestatus();
|
|
|
+ Integer oldtradestatus = old.getTradestatus();
|
|
|
if (updateParam.getOutthreshold() != null) {
|
|
|
old.setOutthreshold(updateParam.getOutthreshold());
|
|
|
}
|
|
|
@@ -465,6 +518,10 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
}
|
|
|
iTaaccountMapper.update(old, new QueryWrapper<Taaccount>().eq("accountid", old.getAccountid()));
|
|
|
|
|
|
+ List<Logintaaccount> logintaaccounts = iLogintaaccountMapper.selectList(new QueryWrapper<Logintaaccount>().eq("accountid", updateParam.getAccountid()));
|
|
|
+ Set<Long> set_msg = logintaaccounts.stream().map(Logintaaccount::getAccountid).collect(Collectors.toSet());
|
|
|
+ old.setSet_msg(set_msg);
|
|
|
+
|
|
|
Systemmanagerlog syslog = new Systemmanagerlog();
|
|
|
syslog.setUserid(systemmanager.getAutoid());
|
|
|
syslog.setReletype(systemmanager.getReletype());
|
|
|
@@ -484,15 +541,21 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
+ "\"outthreshold\":" + old.getOutthreshold() + "\"}");
|
|
|
|
|
|
try {
|
|
|
+ //发送登录服务消息
|
|
|
+ if (old.getSet_msg() != null && !old.getSet_msg().isEmpty()) {
|
|
|
+ iSendMsgService.sendLoginMsg(old.getSet_msg(), 4, 0);
|
|
|
+ }
|
|
|
+
|
|
|
//发送用户变更通知
|
|
|
- if (Objects.equals(oldtradestatus, SysEnums.TradeStatusEnum.CANCELED.getType()))
|
|
|
+ if (Objects.equals(oldtradestatus, SysEnums.TradeStatusEnum.CANCELED.getType())) {
|
|
|
iSendMsgService.sendUserChangeMsg(old.getAccountid(), old.getUserid(),
|
|
|
SysEnums.UserOperateTypeEnum.ADD.getType(),
|
|
|
SysEnums.NotifyModeEnum.UNICAST.getType());
|
|
|
- else
|
|
|
+ } else {
|
|
|
iSendMsgService.sendUserChangeMsg(old.getAccountid(), old.getUserid(),
|
|
|
SysEnums.UserOperateTypeEnum.UPDATE.getType(),
|
|
|
SysEnums.NotifyModeEnum.UNICAST.getType());
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
log.error("资金账户-->修改 发送用户信息修改失败,code=" + FunCodeConstants.FunCode_Trade_UserChangeNtf + ",请检查!,失败原因:" + e);
|
|
|
}
|
|
|
@@ -619,7 +682,7 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
//错误 #58783
|
|
|
organ.setModifystatus(1);
|
|
|
// #6607 【交易中心-管理端】将实名认证的申请直接撤回会导致实名状态一直为审核中
|
|
|
- organ.setHasauth( (oldVo == null || oldVo.getHasauth() == null) ? 0: oldVo.getHasauth());
|
|
|
+ organ.setHasauth((oldVo == null || oldVo.getHasauth() == null) ? 0 : oldVo.getHasauth());
|
|
|
iUseraccountMapper.update(organ, new QueryWrapper<Useraccount>().eq("userid", organ.getUserid()));
|
|
|
|
|
|
if (organ.getUsertype() == 3 || organ.getUsertype() == 4) {
|
|
|
@@ -635,15 +698,122 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult<TaAccountInitResultDetail> updateTaAccountInit(HttpServletRequest request, Long accountId,String orgztypes) {
|
|
|
+ TaAccountInitResultDetail initResultDetail = new TaAccountInitResultDetail();
|
|
|
+ Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
+ Taaccount taaccount = iTaaccountMapper.selectOne(new QueryWrapper<Taaccount>().eq("ACCOUNTID", accountId));
|
|
|
+ //是否显示期权市场
|
|
|
+
|
|
|
+ String sp1 = iCommonService.getSysparmById(SysConstants.SYSPAMA_CODE_ACCOUNT_MARKET);
|
|
|
+ if (systemmanager.getReletype() != 1 && !iCommonService.checkIsAreaSon2(systemmanager.getAreauserid(), taaccount.getUserid())) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM003.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] roletyes = orgztypes.split(",");
|
|
|
+ for (String role : roletyes) {
|
|
|
+ if (Integer.parseInt(role) == SysEnums.OrganRole.selfsupport.getCode()) {
|
|
|
+ //如果有自营会员角色
|
|
|
+ initResultDetail.setSelfFlag(1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String sp = iCommonService.getSysparmById(SysConstants.SYSPARAM_SETTING_SHOW_RU);
|
|
|
+ if (sp != null) {
|
|
|
+ initResultDetail.setIsshowrelationuser(sp);
|
|
|
+ } else {
|
|
|
+ initResultDetail.setIsshowrelationuser("1");
|
|
|
+ }
|
|
|
+ //自营市场
|
|
|
+ List<Integer> roletype = new ArrayList<Integer>();
|
|
|
+ roletype.add(SysEnums.OrganRole.selfsupport.getCode());
|
|
|
+ int isqq = 0;
|
|
|
+ if (StringUtils.isNotBlank(sp1) && !"1".equals(sp1)) {
|
|
|
+ isqq = 1;
|
|
|
+ }
|
|
|
+ List<Market> Markets = iMarketMapper.getMarketsNameByUseridAndrole(systemmanager.getAreauserid(),roletype,isqq);
|
|
|
+ initResultDetail.setMarkets(Markets);
|
|
|
+ //登录账户
|
|
|
+ QueryWrapper<Loginaccount> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.select("loginid");
|
|
|
+ queryWrapper.eq("userid", systemmanager.getAreauserid()) // 替换 userId 为实际的参数值
|
|
|
+ .eq("loginstatus", 1);
|
|
|
+ queryWrapper.exists("SELECT * FROM logintaaccount l WHERE l.loginid = loginaccount.loginid");
|
|
|
+ List<BigDecimal> loginIds = iLoginaccountMapper.selectObjs(queryWrapper);
|
|
|
+ initResultDetail.setLoginaccount(loginIds);
|
|
|
+ List<Long> defaultLogin = iLoginaccountMapper.getLoginNotExistsLt(systemmanager.getAreauserid());
|
|
|
+ initResultDetail.setDefaultloginaccount(defaultLogin);
|
|
|
+
|
|
|
+ //获取市场权限
|
|
|
+ Map<Long, TaAccountMarketVo> lmap = new HashMap<>();
|
|
|
+ List<TaAccountMarketVo> dty = iTaaccountmarketMapper.selectByAccountId(taaccount.getAccountid());
|
|
|
+ for (TaAccountMarketVo taAccountMarketVo : dty) {
|
|
|
+ taAccountMarketVo.setChecked(1);
|
|
|
+ lmap.put(taAccountMarketVo.getMarketId(), taAccountMarketVo);
|
|
|
+ }
|
|
|
+ for (Market market : Markets) {
|
|
|
+ if (!lmap.containsKey(market.getMarketid())) {
|
|
|
+ TaAccountMarketVo te = new TaAccountMarketVo();
|
|
|
+ te.setChecked(0);
|
|
|
+ te.setMarketId(market.getMarketid());
|
|
|
+ te.setMarketName(market.getMarketname());
|
|
|
+ te.setSpotRightType(market.getSpotrighttype());
|
|
|
+ te.setDType(market.getBuyspotrighttype());
|
|
|
+ te.setTradeMode(market.getTrademode());
|
|
|
+ te.setTradeProperty(market.getTradeproperty());
|
|
|
+ lmap.put(market.getMarketid(), te);
|
|
|
+ } else {
|
|
|
+ lmap.get(market.getMarketid()).setFSpotRightType(market.getSpotrighttype());
|
|
|
+ lmap.get(market.getMarketid()).setFdType(market.getBuyspotrighttype());
|
|
|
+ lmap.get(market.getMarketid()).setTradeMode(market.getTrademode());
|
|
|
+ lmap.get(market.getMarketid()).setTradeProperty(market.getTradeproperty());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ initResultDetail.setClildmarkets(lmap);
|
|
|
+
|
|
|
+ StringBuffer oldLogin = new StringBuffer();
|
|
|
+ //获取当前登录账户资金权限
|
|
|
+ List<Logintaaccount> logintaaccounts = iLogintaaccountMapper.selectList(new QueryWrapper<Logintaaccount>().eq("ACCOUNTID", taaccount.getAccountid()));
|
|
|
+ logintaaccounts.forEach(p -> oldLogin.append(p).append(";"));
|
|
|
+
|
|
|
+ if (taaccount.getRelateduserid() != null) {
|
|
|
+ Useraccount ua = iUseraccountMapper.selectOne(new QueryWrapper<Useraccount>().eq("userid",taaccount.getRelateduserid()));
|
|
|
+ initResultDetail.setRelatedU(ua);
|
|
|
+ }
|
|
|
+ if (taaccount.getUserid().compareTo(systemmanager.getAreauserid()) != 0) {
|
|
|
+ initResultDetail.setCannotEdit( 1);
|
|
|
+ }
|
|
|
+ initResultDetail.setOldLogin(oldLogin.toString());
|
|
|
+ initResultDetail.setTaa(taaccount);
|
|
|
+
|
|
|
+ MsExtendrole entity = iMsExtendroleMapper.selectOne(new QueryWrapper<MsExtendrole>()
|
|
|
+ .eq("roletypeid", 5L)
|
|
|
+ .eq("areauserid", taaccount.getUserid()));
|
|
|
+ if (entity != null) {
|
|
|
+ initResultDetail.setCannotEdit(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ //交易类型
|
|
|
+ Map<String, Object> map = redisServiceUtil.getCacheMap(Constants.REDIS_HEADER_DICT + "marketbstype");
|
|
|
+ Map<Integer, String> map_ = new TreeMap<>();
|
|
|
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
|
|
|
+ map_.put(Integer.valueOf(entry.getKey()), entry.getValue().toString());
|
|
|
+ }
|
|
|
+ initResultDetail.setMarketbstype(map_);
|
|
|
+
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"),initResultDetail);
|
|
|
+ }
|
|
|
+
|
|
|
private AjaxResult refUserAccount(Long areaid, Systemmanager systemmanager, HttpServletRequest request) {
|
|
|
Useraccount org = iUseraccountMapper.selectOne(new QueryWrapper<Useraccount>().eq("userid", areaid)); //areaid就是userid
|
|
|
Userinfo ui = iUserinfoMapper.selectOne(new QueryWrapper<Userinfo>().eq("userid", areaid));
|
|
|
List<Userinfo> uiList = iUserinfoMapper.selectList(new QueryWrapper<Userinfo>()
|
|
|
.eq("userstatus", 1)
|
|
|
.ne("userid", ui.getUserid())
|
|
|
- .and(a -> a.eq(StringUtils.isNotBlank(ui.getCardnum()),"cardnum", ui.getCardnum())
|
|
|
+ .and(a -> a.eq(StringUtils.isNotBlank(ui.getCardnum()), "cardnum", ui.getCardnum())
|
|
|
.or()
|
|
|
- .eq(StringUtils.isNotBlank(ui.getMobile()),"mobile", ui.getMobile()))
|
|
|
+ .eq(StringUtils.isNotBlank(ui.getMobile()), "mobile", ui.getMobile()))
|
|
|
);
|
|
|
if (CollectionUtils.isNotEmpty(uiList)) {
|
|
|
for (Userinfo userinfo : uiList) {
|
|
|
@@ -888,7 +1058,7 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
|
|
|
//注销状态
|
|
|
ta.setTradestatus(SysEnums.TradeStatusEnum.CANCELED.getType());
|
|
|
ta.setTradestatuschangetime(new Date());
|
|
|
- iTaaccountMapper.update(ta,new QueryWrapper<Taaccount>().eq("accountid",ta.getAccountid()));
|
|
|
+ iTaaccountMapper.update(ta, new QueryWrapper<Taaccount>().eq("accountid", ta.getAccountid()));
|
|
|
|
|
|
Userinfo info = iUserinfoMapper.selectOne(new QueryWrapper<Userinfo>().eq("userid", userid));
|
|
|
info.setUserstatus(2);
|