xie.kaifeng 8 bulan lalu
induk
melakukan
52b43643dc

+ 66 - 7
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/impl/TaaccountServiceImpl.java

@@ -380,6 +380,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 +410,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 +434,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 +504,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 +514,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 +537,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 +678,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) {
@@ -641,9 +700,9 @@ public class TaaccountServiceImpl extends ServiceImpl<ITaaccountMapper, Taaccoun
         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 +947,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);

+ 4 - 0
mtp3-century/src/main/resources/mapper/ISystemRunService.xml

@@ -69,6 +69,9 @@
         <result column="taaccounttype" property="taAccountType" />
         <result column="parentaccountid" property="parentAccountId" />
         <result column="tradestatus" property="tradeStatus" />
+        <result column="relateduserid" property="relateduserid" />
+        <result column="userid" property="userid" />
+        <result column="relatedaccountstatus" property="relatedaccountstatus" />
         <association property="accountName" column="USERID"
                      jdbcType="VARCHAR"
                      select="com.muchinfo.mtp3interface.mapper.IUseraccountMapper.selectOrganName"></association>
@@ -136,6 +139,7 @@
             parameterType="com.muchinfo.mtp3pojos.vo.taaccount.TaAccountQueryParam">
         select t.accountid, t.ismain,t.taaccounttype, t.parentaccountid
         ,t.tradestatus,t.userid, t.relateduserid,t.currencyid,t.outthreshold
+        ,t.relateduserid,t.relatedaccountstatus,t.userid,t.relatedaccountstatus
         from
         taaccount t
         <where>

+ 1 - 0
mtp3-century/src/main/resources/message_en.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0}Assigned groups.
 investor_error_code_009=Please remove all investors under this group first.
 investor_error_code_010=Please delete the personalized settings of this group first.
 investor_error_code_011=The ratio value cannot exceed 10000
+investor_error_code_012=Associated users cannot act for themselves
 warehouse_error_code_01=Warehouse code up to 10 digits
 warehouse_error_code_02=Duplicate warehouse code
 warehouse_error_code_03=Duplicate warehouse name

+ 1 - 0
mtp3-century/src/main/resources/message_th.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0}\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E25\u0E3
 investor_error_code_009=\u0E42\u0E1B\u0E23\u0E14\u0E25\u0E1A\u0E19\u0E31\u0E01\u0E25\u0E07\u0E17\u0E38\u0E19\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14\u0E20\u0E32\u0E22\u0E43\u0E15\u0E49\u0E01\u0E25\u0E38\u0E48\u0E21\u0E19\u0E35\u0E49\u0E01\u0E48\u0E2D\u0E19.
 investor_error_code_010=\u0E42\u0E1B\u0E23\u0E14\u0E25\u0E1A\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25\u0E02\u0E2D\u0E07\u0E01\u0E25\u0E38\u0E48\u0E21\u0E19\u0E31\u0E49\u0E19\u0E01\u0E48\u0E2D\u0E19.
 investor_error_code_011=\u0E04\u0E48\u0E32\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 10,000
+investor_error_code_012=\u0E2A\u0E21\u0E32\u0E0A\u0E34\u0E01\u0E1E\u0E31\u0E19\u0E18\u0E21\u0E34\u0E15\u0E23\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E1B\u0E47\u0E19\u0E15\u0E31\u0E27\u0E40\u0E2D\u0E07\u0E44\u0E14\u0E49
 warehouse_error_code_01=\u0E23\u0E2B\u0E31\u0E2A\u0E04\u0E25\u0E31\u0E07\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14 10 \u0E2B\u0E25\u0E31\u0E01
 warehouse_error_code_02=\u0E23\u0E2B\u0E31\u0E2A\u0E04\u0E25\u0E31\u0E07\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E0B\u0E49\u0E33
 warehouse_error_code_03=\u0E0A\u0E37\u0E48\u0E2D\u0E04\u0E25\u0E31\u0E07\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E0B\u0E49\u0E33\u0E01\u0E31\u0E19

+ 1 - 0
mtp3-century/src/main/resources/message_vi.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0} Nh\u00F3m \u0111\u01B0\u1EE3c ph\u00E2n b\u1ED5.
 investor_error_code_009=Vui l\u00F2ng x\u00F3a t\u1EA5t c\u1EA3 c\u00E1c nh\u00E0 \u0111\u1EA7u t\u01B0 trong nh\u00F3m.
 investor_error_code_010=Vui l\u00F2ng x\u00F3a c\u00E1 nh\u00E2n h\u00F3a nh\u00F3m tr\u01B0\u1EDBc.
 investor_error_code_011=Gi\u00E1 tr\u1ECB t\u1EF7 l\u1EC7 kh\u00F4ng \u0111\u01B0\u1EE3c l\u1EDBn h\u01A1n 10.000
+investor_error_code_012=Ng\u01B0\u1EDDi d\u00F9ng li\u00EAn k\u1EBFt kh\u00F4ng th\u1EC3 t\u1EF1
 warehouse_error_code_01=t\u1ED1i \u0111a 10 ch\u1EEF s\u1ED1 trong m\u00E3 kho
 warehouse_error_code_02=tr\u00F9ng l\u1EB7p m\u00E3 kho
 warehouse_error_code_03=tr\u00F9ng l\u1EB7p t\u00EAn kho

+ 1 - 0
mtp3-century/src/main/resources/message_zh-cn.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0}\u5DF2\u5206\u914D\u5206\u7EC4\u3002
 investor_error_code_009=\u8BF7\u5148\u79FB\u9664\u8BE5\u5206\u7EC4\u4E0B\u6240\u6709\u6295\u8D44\u8005\u3002
 investor_error_code_010=\u8BF7\u5148\u5220\u9664\u8BE5\u5206\u7EC4\u7684\u4E2A\u6027\u5316\u8BBE\u7F6E\u3002
 investor_error_code_011=\u6BD4\u7387\u503C\u4E0D\u80FD\u5927\u4E8E10000
+investor_error_code_012=\u5173\u8054\u7528\u6237\u4E0D\u80FD\u4E3A\u81EA\u5DF1
 warehouse_error_code_01=\u4ED3\u5E93\u4EE3\u7801\u6700\u591A10\u4F4D
 warehouse_error_code_02=\u4ED3\u5E93\u4EE3\u7801\u91CD\u590D
 warehouse_error_code_03=\u4ED3\u5E93\u540D\u79F0\u91CD\u590D

+ 1 - 0
mtp3-century/src/main/resources/message_zh-hk.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0}\u5DF2\u5206\u914D\u5206\u7D44\u3002
 investor_error_code_009=\u8ACB\u5148\u79FB\u9664\u8A72\u5206\u7D44\u4E0B\u6240\u6709\u6295\u8CC7\u8005\u3002
 investor_error_code_010=\u8ACB\u5148\u5220\u9664\u8A72\u5206\u7D44\u7684\u500B\u6027\u5316\u8A2D\u5B9A\u3002
 investor_error_code_011=\u6BD4\u7387\u503C\u4E0D\u80FD\u5927\u65BC10000
+investor_error_code_012=\u95DC\u806F\u7528\u6236\u4E0D\u80FD\u70BA\u81EA\u5DF1
 warehouse_error_code_01=\u5009\u5EAB\u7A0B\u5F0F\u78BC\u6700\u591A10\u6BD4\u7279
 warehouse_error_code_02=\u5009\u5EAB\u7A0B\u5F0F\u78BC\u91CD\u8907
 warehouse_error_code_03=\u5009\u5EAB\u540D\u7A31\u91CD\u8907

+ 1 - 0
mtp3-century/src/main/resources/message_zh-tw.properties

@@ -127,6 +127,7 @@ investor_error_code_008={0}\u5DF2\u5206\u914D\u5206\u7D44\u3002
 investor_error_code_009=\u8ACB\u5148\u79FB\u9664\u8A72\u5206\u7D44\u4E0B\u6240\u6709\u6295\u8CC7\u8005\u3002
 investor_error_code_010=\u8ACB\u5148\u5220\u9664\u8A72\u5206\u7D44\u7684\u500B\u6027\u5316\u8A2D\u5B9A\u3002
 investor_error_code_011=\u6BD4\u7387\u503C\u4E0D\u80FD\u5927\u65BC10000
+investor_error_code_012=\u95DC\u806F\u7528\u6236\u4E0D\u80FD\u70BA\u81EA\u5DF1
 warehouse_error_code_01=\u5009\u5EAB\u7A0B\u5F0F\u78BC\u6700\u591A10\u6BD4\u7279
 warehouse_error_code_02=\u5009\u5EAB\u7A0B\u5F0F\u78BC\u91CD\u8907
 warehouse_error_code_03=\u5009\u5EAB\u540D\u7A31\u91CD\u8907

+ 1 - 0
mtp3-common/src/main/java/com/muchinfo/mtp3common/enumtype/MessageType.java

@@ -147,6 +147,7 @@ public enum MessageType {
     INVESTOR_ERROR_CODE_009("investor_error_code_009", "请先移除该分组下所有投资者."),
     INVESTOR_ERROR_CODE_010("investor_error_code_010", "请先删除该分组的个性化设置."),
     INVESTOR_ERROR_CODE_011("investor_error_code_011", "比率值不能大于10000."),
+    INVESTOR_ERROR_CODE_012("investor_error_code_012", "关联用户不能为自己."),
 
     WAREHOUSE_ERROR_CODE_01("warehouse_error_code_01", "仓库代码最多10位."),
     WAREHOUSE_ERROR_CODE_02("warehouse_error_code_02", "仓库代码重复."),

+ 3 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/entity/Taaccount.java

@@ -11,6 +11,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -271,6 +272,8 @@ public class Taaccount extends Model<Taaccount> {
     private BigDecimal floatnetvalue;
     @TableField(select = false)
     private List<Taaccount> children;
+    @TableField(select = false)
+    private Set<Long> set_msg; //记录多个ID,需要发送登录变更通知
 
     @Override
     public Serializable pkVal() {

+ 5 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/taaccount/TaAccountQueryResult.java

@@ -49,4 +49,9 @@ public class TaAccountQueryResult {
     @ApiModelProperty(value = "出金阈值")
     private BigDecimal outThreshold;
 
+    private Long userid;
+
+    private Long relateduserid;
+
+    private Integer relatedaccountstatus;
 }

+ 6 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/taaccount/TaAccountUpdateParam.java

@@ -24,4 +24,10 @@ public class TaAccountUpdateParam {
 
     @ApiModelProperty(value = "市场权限 isSelf == 1展示")
     private List<TaAccountMarketVo> dType;
+
+    private Long relateduserid;
+
+    private Long userid;
+
+    private Integer relatedaccountstatus;
 }