From 2ed572d6b2a4be6b91b3e2a1ed48485abde91553 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Mon, 15 Jul 2024 10:54:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/zyqs-0502' into rb-copy
---
src/main/resources/mapper/UserWithdrawMapper.xml | 25 --
src/main/java/com/nq/pojo/StockSubscribe.java | 5
src/main/resources/mapper/StockDzMapper.xml | 4
src/main/resources/mapper/SitePayMapper.xml | 6
pom.xml | 8
src/main/java/com/nq/utils/timeutil/TimeUtil.java | 14 +
src/main/java/com/nq/utils/redis/RedisKeyConstant.java | 5
src/main/resources/mapper/UserMapper.xml | 7
src/main/java/com/nq/dao/AgentUserMapper.java | 3
src/main/java/com/nq/common/ServerResponse.java | 4
src/main/java/com/nq/pojo/AgentUser.java | 3
src/main/java/com/nq/service/impl/SiteAdminServiceImpl.java | 276 ++++++++++++++++++++++++++
src/main/java/com/nq/controller/UserApiController.java | 39 +++
src/main/java/com/nq/service/ITradingHourService.java | 1
src/main/java/com/nq/pojo/UserWithdraw.java | 10
src/main/java/com/nq/dao/UserWithdrawMapper.java | 6
src/main/java/com/nq/service/ISiteAdminService.java | 4
src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java | 2
src/main/java/com/nq/pojo/SitePay.java | 3
src/main/resources/mapper/UserRechargeMapper.xml | 12 -
src/main/java/com/nq/service/impl/PayServiceImpl.java | 1
src/main/java/com/nq/controller/agent/AgentController.java | 25 ++
src/main/java/com/nq/service/impl/TradingHourServiceImpl.java | 25 ++
src/main/java/com/nq/controller/agent/AgentUserController.java | 4
src/main/java/com/nq/dao/UserMapper.java | 6
src/main/java/com/nq/Text.java | 1
src/main/java/com/nq/pojo/StockSetting.java | 2
src/main/java/com/nq/service/IUserService.java | 10
src/main/java/com/nq/controller/backend/AdminController.java | 37 +++
src/main/java/com/nq/controller/backend/AdminUserController.java | 15 +
src/main/java/com/nq/vo/stock/StockVO.java | 2
src/main/java/com/nq/dao/StockDzMapper.java | 3
src/main/java/com/nq/service/impl/StockSettingServicesImpl.java | 4
src/main/java/com/nq/dao/UserRechargeMapper.java | 2
src/main/java/com/nq/vo/agent/AgentUserListVO.java | 7
src/main/java/com/nq/controller/backend/AdminLogsController.java | 9
36 files changed, 506 insertions(+), 84 deletions(-)
diff --git a/pom.xml b/pom.xml
index 058a9cb..214e33d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,10 +27,10 @@
</dependency>
- <dependency>
- <groupId>org.flywaydb</groupId>
- <artifactId>flyway-core</artifactId>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.flywaydb</groupId>-->
+<!-- <artifactId>flyway-core</artifactId>-->
+<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
diff --git a/src/main/java/com/nq/Text.java b/src/main/java/com/nq/Text.java
index 77be89f..462a7d5 100644
--- a/src/main/java/com/nq/Text.java
+++ b/src/main/java/com/nq/Text.java
@@ -18,6 +18,7 @@
}
+
public ServerResponse rechargMethodTop3(String ordersn, String payAmt){
Map<String,String> map = new HashedMap();
map.put("version","1.0");
diff --git a/src/main/java/com/nq/common/ServerResponse.java b/src/main/java/com/nq/common/ServerResponse.java
index 208c7ac..bba92cd 100644
--- a/src/main/java/com/nq/common/ServerResponse.java
+++ b/src/main/java/com/nq/common/ServerResponse.java
@@ -106,7 +106,9 @@
return new ServerResponse(ResponseCode.ERROR.getCode(), new GoogleTranslateUtil().translate(errormsg,request.getHeader(LANG)));
}
-
+ public static <T> ServerResponse<T> createByErrorMsg(int errorcode,String errormsg, HttpServletRequest request) {
+ return new ServerResponse(errorcode, new GoogleTranslateUtil().translate(errormsg,request.getHeader(LANG)));
+ }
public static <T> ServerResponse<T> createByErrorCodeMsg(int errorcode, String errormsg) {
return new ServerResponse(errorcode, errormsg);
}
diff --git a/src/main/java/com/nq/controller/UserApiController.java b/src/main/java/com/nq/controller/UserApiController.java
index 8c42607..cbfca32 100644
--- a/src/main/java/com/nq/controller/UserApiController.java
+++ b/src/main/java/com/nq/controller/UserApiController.java
@@ -57,10 +57,45 @@
//注册
@RequestMapping(value = {"reg.do"}, method = {RequestMethod.POST})
@ResponseBody
- public ServerResponse reg(@RequestParam("agentCode") String agentCode, @RequestParam("phone") String phone, @RequestParam(value = "yzmCode", defaultValue = "") String yzmCode, @RequestParam("userPwd") String userPwd, HttpServletRequest httpServletRequest) {
- return this.iUserService.reg(yzmCode, agentCode, phone, userPwd, httpServletRequest);
+ public ServerResponse reg(@RequestParam("agentCode") String agentCode,
+ @RequestParam("phone") String phone,
+ @RequestParam("userPwd") String userPwd,
+ @RequestParam("phoneCode")String phoneCode,
+ HttpServletRequest httpServletRequest) {
+ return this.iUserService.reg(agentCode, phone,phoneCode, userPwd,httpServletRequest);
}
+ @RequestMapping(value = {"sendMailCode.do"}, method = {RequestMethod.POST})
+ @ResponseBody
+ public ServerResponse sendMailCode(@RequestParam("email") String email) {
+ try {
+ if (email == null || email.isEmpty()) { // 判断email参数是否为空
+ return ServerResponse.createByErrorMsg("邮箱不能为空");
+ }
+ log.info("-------->发送邮件");
+ return this.iUserService.sendMailCode(email);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return ServerResponse.createByErrorMsg("发送失败,发生异常");
+ }
+ }
+
+ @RequestMapping(value = {"sendSms.do"}, method = {RequestMethod.POST})
+ @ResponseBody
+ public ServerResponse sendSms(@RequestParam("phone") String phone,HttpServletRequest request) {
+ try {
+ if (phone == null || phone.isEmpty()) {
+ return ServerResponse.createByErrorMsg("手机号不能为空",request);
+ }
+ log.info("-------->发送短信");
+ return this.iUserService.sendSms(phone,request);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return ServerResponse.createByErrorMsg("发送失败,发生异常");
+ }
+ }
+
+
//登录
@RequestMapping(value = {"login.do"}, method = {RequestMethod.POST})
@ResponseBody
diff --git a/src/main/java/com/nq/controller/agent/AgentController.java b/src/main/java/com/nq/controller/agent/AgentController.java
index e77a4ce..f39142d 100644
--- a/src/main/java/com/nq/controller/agent/AgentController.java
+++ b/src/main/java/com/nq/controller/agent/AgentController.java
@@ -31,6 +31,8 @@
@Autowired
IAgentAgencyFeeService iAgentAgencyFeeService;
+ @Autowired
+ ISiteUserOptionLogService iSiteUserOptionLogService;
@Autowired
ISiteAdminService iSiteAdminService;
@@ -42,6 +44,12 @@
return this.iAgentUserService.getAgentInfo(request);
}
+ @RequestMapping("optionList.do")
+ @ResponseBody
+ public ServerResponse optionList(@RequestParam(value = "agentId", required = false) Integer agentId,@RequestParam(value = "userId", required = false) Integer userId, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize){
+ return this.iSiteUserOptionLogService.list(agentId,userId,pageNum,pageSize);
+ }
+
//修改代理用户密码
@RequestMapping({"updatePwd.do"})
@ResponseBody
@@ -49,6 +57,19 @@
return this.iAgentUserService.updatePwd(oldPwd, newPwd, request);
}
+ //查询首页充值,提现,注册统计
+ @RequestMapping({"moneyCount.do"})
+ @ResponseBody
+ public ServerResponse moneyCount(@RequestParam(value = "agentId", required = false) String agentId,@RequestParam(value = "startTime", required = false) String startTime,@RequestParam(value = "entTime", required = false) String entTime) {
+ return this.iSiteAdminService.moneyCount(agentId,startTime,entTime);
+ }
+
+ //查询代理总资金
+ @RequestMapping({"totalAgencyFunds.do"})
+ @ResponseBody
+ public ServerResponse totalAgencyFunds(@RequestParam(value = "agentId", required = false) String agentId) {
+ return this.iSiteAdminService.totalAgencyFunds(agentId);
+ }
//查询首页 资金情况、持仓情况、盈亏信息、提现情况、股票信息、代理信息
@RequestMapping({"count.do"})
@@ -82,8 +103,8 @@
//添加用户管理 账户信息
@RequestMapping({"addSimulatedAccount.do"})
@ResponseBody
- public ServerResponse addSimulatedAccount(HttpServletRequest request,@RequestParam("agentId") Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
- return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
+ public ServerResponse addSimulatedAccount(HttpServletRequest request,@RequestParam("agentId") Integer agentId, @RequestParam("phone") String phone, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
+ return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
}
//查询股票统计指定时间内,代理客户(已平仓)的交易盈亏
diff --git a/src/main/java/com/nq/controller/agent/AgentUserController.java b/src/main/java/com/nq/controller/agent/AgentUserController.java
index e3f4d95..f60c674 100644
--- a/src/main/java/com/nq/controller/agent/AgentUserController.java
+++ b/src/main/java/com/nq/controller/agent/AgentUserController.java
@@ -61,8 +61,8 @@
//添加用户列表 用户信息
@RequestMapping({"addSimulatedAccount.do"})
@ResponseBody
- public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
- return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
+ public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone,@RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
+ return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
}
@RequestMapping({"authByAdmin.do"})
diff --git a/src/main/java/com/nq/controller/backend/AdminController.java b/src/main/java/com/nq/controller/backend/AdminController.java
index 47c257a..43119dc 100644
--- a/src/main/java/com/nq/controller/backend/AdminController.java
+++ b/src/main/java/com/nq/controller/backend/AdminController.java
@@ -13,6 +13,7 @@
import com.nq.utils.PropertiesUtil;
+import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -68,6 +69,10 @@
@Autowired
IUserAssetsServices iUserAssetsServices;
+
+ @Autowired
+ IApplyLeverServices iApplyLeverServices;
+
@Autowired
IApplyLeverServices iApplyLeverServices;
@@ -131,6 +136,20 @@
@ResponseBody
public ServerResponse count() {
return this.iSiteAdminService.count();
+ }
+
+ //查询首页充值,提现,注册统计
+ @RequestMapping({"moneyCount.do"})
+ @ResponseBody
+ public ServerResponse moneyCount(@RequestParam(value = "agentId", required = false) String agentId,@RequestParam(value = "startTime", required = false) String startTime,@RequestParam(value = "entTime", required = false) String entTime) {
+ return this.iSiteAdminService.moneyCount(agentId,startTime,entTime);
+ }
+
+ //查询代理总资金
+ @RequestMapping({"totalAgencyFunds.do"})
+ @ResponseBody
+ public ServerResponse totalAgencyFunds(@RequestParam(value = "agentId", required = false) String agentId) {
+ return this.iSiteAdminService.totalAgencyFunds(agentId);
}
//处理图片上传
@@ -379,4 +398,22 @@
return iUserAssetsServices.updateUserAssets(id,amt,type);
}
+ @RequestMapping({"examineApplyLever.do"})
+ @ResponseBody
+ public ServerResponse examineApplyLever(@RequestParam(value = "id", required = true) String id,
+ @RequestParam(value = "state", defaultValue = "1") String state,
+ HttpServletRequest request) {
+ return this.iApplyLeverServices.examineApplyLever(id,state,request);
+ }
+
+
+ @RequestMapping({"queryApplyLever.do"})
+ @ResponseBody
+ public ServerResponse queryApplyLever(@RequestParam(value = "phone", required = false) String adminName,
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+ @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
+ HttpServletRequest request
+ ) {
+ return this.iApplyLeverServices.queryApplyLever(adminName,pageNum,pageSize, request);
+ }
}
diff --git a/src/main/java/com/nq/controller/backend/AdminLogsController.java b/src/main/java/com/nq/controller/backend/AdminLogsController.java
index f0f29b0..50cabe4 100644
--- a/src/main/java/com/nq/controller/backend/AdminLogsController.java
+++ b/src/main/java/com/nq/controller/backend/AdminLogsController.java
@@ -42,6 +42,9 @@
@Autowired
ISiteMessageService iSiteMessageService;
+ @Autowired
+ ISiteUserOptionLogService iSiteUserOptionLogService;
+
//分页查询日志管理 所有定时任务信息及模糊查询
@RequestMapping({"taskList.do"})
@ResponseBody
@@ -56,6 +59,12 @@
return this.iSiteLoginLogService.loginList(userId, pageNum, pageSize);
}
+ @RequestMapping("optionList.do")
+ @ResponseBody
+ public ServerResponse optionList(@RequestParam(value = "userId", required = false) Integer userId, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize){
+ return this.iSiteUserOptionLogService.list(null,userId,pageNum,pageSize);
+ }
+
//分页查询日志管理 所有短信日志信息
@RequestMapping({"smsList.do"})
@ResponseBody
diff --git a/src/main/java/com/nq/controller/backend/AdminUserController.java b/src/main/java/com/nq/controller/backend/AdminUserController.java
index 9e24ecb..cee30db 100644
--- a/src/main/java/com/nq/controller/backend/AdminUserController.java
+++ b/src/main/java/com/nq/controller/backend/AdminUserController.java
@@ -32,8 +32,15 @@
//分页查询所有用户列表信息 及模糊查询用户信息
@RequestMapping({"list.do"})
@ResponseBody
- public ServerResponse list(@RequestParam(value = "realName", required = false) String realName, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam(value = "accountType", required = false) Integer accountType, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize, HttpServletRequest request) {
- return this.iUserService.listByAdmin(realName, phone, agentId, accountType, pageNum, pageSize, request);
+ public ServerResponse list(@RequestParam(value = "realName", required = false) String realName,
+ @RequestParam(value = "phone", required = false) String phone,
+ @RequestParam(value = "agentId", required = false) Integer agentId,
+ @RequestParam(value = "accountType", required = false) Integer accountType,
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+ @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
+ @RequestParam(value = "id", required = false) String id,
+ HttpServletRequest request) {
+ return this.iUserService.listByAdmin(realName, phone, agentId, accountType, pageNum, pageSize,id, request);
}
//查询用户信息是否存在
@@ -74,8 +81,8 @@
//添加用户列表 用户信息
@RequestMapping({"addSimulatedAccount.do"})
@ResponseBody
- public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
- return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
+ public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
+ return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
}
@RequestMapping({"authByAdmin.do"})
diff --git a/src/main/java/com/nq/dao/AgentUserMapper.java b/src/main/java/com/nq/dao/AgentUserMapper.java
index 6825cb9..41dce73 100644
--- a/src/main/java/com/nq/dao/AgentUserMapper.java
+++ b/src/main/java/com/nq/dao/AgentUserMapper.java
@@ -2,11 +2,12 @@
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nq.pojo.AgentUser;
import java.util.List;
import org.apache.ibatis.annotations.Param;
-public interface AgentUserMapper {
+public interface AgentUserMapper extends BaseMapper<AgentUser> {
int deleteByPrimaryKey(Integer paramInteger);
int insert(AgentUser paramAgentUser);
diff --git a/src/main/java/com/nq/dao/StockDzMapper.java b/src/main/java/com/nq/dao/StockDzMapper.java
index da9ed28..63bd8d8 100644
--- a/src/main/java/com/nq/dao/StockDzMapper.java
+++ b/src/main/java/com/nq/dao/StockDzMapper.java
@@ -4,6 +4,7 @@
import com.nq.pojo.StockDz;
import org.apache.ibatis.annotations.Param;
+import java.math.BigDecimal;
import java.util.List;
/**
@@ -15,6 +16,8 @@
public interface StockDzMapper extends BaseMapper<StockDz> {
List<StockDz> findStockListByKeyWords(@Param("keyWords") String paramString1);
+ BigDecimal getPrice(String stockCode);
+
}
diff --git a/src/main/java/com/nq/dao/UserMapper.java b/src/main/java/com/nq/dao/UserMapper.java
index 60f7634..4d89365 100644
--- a/src/main/java/com/nq/dao/UserMapper.java
+++ b/src/main/java/com/nq/dao/UserMapper.java
@@ -16,10 +16,6 @@
int insert(User paramUser);
- int insertSelective(User paramUser);
-
-
-
int updateByPrimaryKey(User paramUser);
User findByPhone(String paramString);
@@ -28,7 +24,7 @@
List listByAgent(@Param("realName") String paramString1, @Param("phone") String paramString2, @Param("searchId") Integer paramInteger1, @Param("accountType") Integer paramInteger2);
- List listByAdmin(@Param("realName") String paramString1, @Param("phone") String paramString2, @Param("searchId") Integer paramInteger1, @Param("accountType") Integer paramInteger2);
+ List listByAdmin(@Param("realName") String paramString1, @Param("phone") String paramString2, @Param("searchId") Integer paramInteger1, @Param("accountType") Integer paramInteger2,@Param("id") String id);
int CountUserSize(Integer paramInteger);
diff --git a/src/main/java/com/nq/dao/UserRechargeMapper.java b/src/main/java/com/nq/dao/UserRechargeMapper.java
index b341a5f..3dfe9ad 100644
--- a/src/main/java/com/nq/dao/UserRechargeMapper.java
+++ b/src/main/java/com/nq/dao/UserRechargeMapper.java
@@ -9,7 +9,7 @@
public interface UserRechargeMapper extends BaseMapper<UserRecharge> {
- int insert(UserRecharge paramUserRecharge);
+// int insert(UserRecharge paramUserRecharge);
int insertSelective(UserRecharge paramUserRecharge);
diff --git a/src/main/java/com/nq/dao/UserWithdrawMapper.java b/src/main/java/com/nq/dao/UserWithdrawMapper.java
index a30197b..b39e7c0 100644
--- a/src/main/java/com/nq/dao/UserWithdrawMapper.java
+++ b/src/main/java/com/nq/dao/UserWithdrawMapper.java
@@ -1,14 +1,14 @@
package com.nq.dao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.nq.pojo.UserRecharge;
import com.nq.pojo.UserWithdraw;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
-public interface UserWithdrawMapper {
+public interface UserWithdrawMapper extends BaseMapper<UserWithdraw> {
int deleteByPrimaryKey(Integer paramInteger);
-
- int insert(UserWithdraw paramUserWithdraw);
int insertSelective(UserWithdraw paramUserWithdraw);
diff --git a/src/main/java/com/nq/pojo/AgentUser.java b/src/main/java/com/nq/pojo/AgentUser.java
index ed5367a..c731a3a 100644
--- a/src/main/java/com/nq/pojo/AgentUser.java
+++ b/src/main/java/com/nq/pojo/AgentUser.java
@@ -1,5 +1,7 @@
package com.nq.pojo;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.math.BigDecimal;
@@ -8,6 +10,7 @@
@Data
public class AgentUser {
+ @TableId(value = "id",type = IdType.AUTO)
private Integer id;
private String agentName;
private String agentPwd;
diff --git a/src/main/java/com/nq/pojo/SitePay.java b/src/main/java/com/nq/pojo/SitePay.java
index 9108930..f05271f 100644
--- a/src/main/java/com/nq/pojo/SitePay.java
+++ b/src/main/java/com/nq/pojo/SitePay.java
@@ -28,6 +28,9 @@
private String assetsType;
+ private String bankNumber;
+
+
}
diff --git a/src/main/java/com/nq/pojo/StockSetting.java b/src/main/java/com/nq/pojo/StockSetting.java
index b916581..50c712a 100644
--- a/src/main/java/com/nq/pojo/StockSetting.java
+++ b/src/main/java/com/nq/pojo/StockSetting.java
@@ -20,4 +20,6 @@
private String type;
// type = 0 价格 1为百分比
private String price;
+ //修改后的盘前价格 未修改过则为空
+ private String nowPrice;
}
diff --git a/src/main/java/com/nq/pojo/StockSubscribe.java b/src/main/java/com/nq/pojo/StockSubscribe.java
index c0af64f..db40aaa 100644
--- a/src/main/java/com/nq/pojo/StockSubscribe.java
+++ b/src/main/java/com/nq/pojo/StockSubscribe.java
@@ -48,6 +48,11 @@
private Long orderNumber;
/**
+ * 最低数量
+ */
+ private Long minOrderNumber;
+
+ /**
* 顯示状态
*/
private Integer zt;
diff --git a/src/main/java/com/nq/pojo/UserWithdraw.java b/src/main/java/com/nq/pojo/UserWithdraw.java
index 0f04103..1941f74 100644
--- a/src/main/java/com/nq/pojo/UserWithdraw.java
+++ b/src/main/java/com/nq/pojo/UserWithdraw.java
@@ -1,15 +1,20 @@
package com.nq.pojo;
import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
-
+@Data
public class UserWithdraw {
+ @TableId(type= IdType.AUTO)
private Integer id;
@Excel(name = "用户id")
private Integer userId;
@@ -41,8 +46,9 @@
@Excel(name = "原因")
private String withMsg;
+ @TableField(exist = false)
private String userPhone;
-
+ private String assetsType;
public UserWithdraw(Integer id, Integer userId, String nickName, Integer agentId, BigDecimal withAmt, Date applyTime, Date transTime, String withName, String bankNo, String bankName, String bankAddress, Integer withStatus, BigDecimal withFee, String withMsg) {
diff --git a/src/main/java/com/nq/service/ISiteAdminService.java b/src/main/java/com/nq/service/ISiteAdminService.java
index 7b185bf..204153f 100644
--- a/src/main/java/com/nq/service/ISiteAdminService.java
+++ b/src/main/java/com/nq/service/ISiteAdminService.java
@@ -27,4 +27,8 @@
ServerResponse count();
ServerResponse deleteAdmin(Integer adminId);
+
+ ServerResponse moneyCount(String agentId,String startTime, String entTime);
+
+ ServerResponse totalAgencyFunds(String agentId);
}
diff --git a/src/main/java/com/nq/service/ITradingHourService.java b/src/main/java/com/nq/service/ITradingHourService.java
index 7359865..4a3d6c1 100644
--- a/src/main/java/com/nq/service/ITradingHourService.java
+++ b/src/main/java/com/nq/service/ITradingHourService.java
@@ -2,6 +2,7 @@
public interface ITradingHourService {
Boolean timeCheck(String stockCode);
+ Boolean weekDayeCheck(String stockCode);
Boolean timeCheck();
}
diff --git a/src/main/java/com/nq/service/IUserService.java b/src/main/java/com/nq/service/IUserService.java
index 0c9fd96..f8f05f2 100644
--- a/src/main/java/com/nq/service/IUserService.java
+++ b/src/main/java/com/nq/service/IUserService.java
@@ -8,7 +8,7 @@
import javax.servlet.http.HttpServletRequest;
public interface IUserService {
- ServerResponse reg(String paramString1, String paramString2, String paramString3, String paramString4, HttpServletRequest paramHttpServletRequest);
+ ServerResponse reg( String paramString2, String paramString3, String paramString4,String phoneCode,HttpServletRequest paramHttpServletRequest);
ServerResponse login(String paramString1, String paramString2, HttpServletRequest paramHttpServletRequest);
@@ -60,9 +60,9 @@
ServerResponse listByAgent(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2, int paramInt1, int paramInt2, HttpServletRequest paramHttpServletRequest);
- ServerResponse addSimulatedAccount(Integer paramInteger1, String paramString1, String paramString2, String paramString3, Integer paramInteger2, HttpServletRequest paramHttpServletRequest);
+ ServerResponse addSimulatedAccount(Integer paramInteger1, String paramString1, String paramString2, Integer paramInteger2, HttpServletRequest paramHttpServletRequest);
- ServerResponse listByAdmin(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2, int paramInt1, int paramInt2, HttpServletRequest paramHttpServletRequest);
+ ServerResponse listByAdmin(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2, int paramInt1, int paramInt2,String id, HttpServletRequest paramHttpServletRequest);
ServerResponse findByUserId(Integer paramInteger);
@@ -90,4 +90,8 @@
ServerResponse queryMyOption(String code, HttpServletRequest request);
ServerResponse getMoenyLog(String type,HttpServletRequest request);
+
+ ServerResponse sendMailCode(String toMail);
+
+ ServerResponse sendSms(String phone,HttpServletRequest request) throws Exception;
}
diff --git a/src/main/java/com/nq/service/impl/PayServiceImpl.java b/src/main/java/com/nq/service/impl/PayServiceImpl.java
index e610557..d314a1b 100644
--- a/src/main/java/com/nq/service/impl/PayServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/PayServiceImpl.java
@@ -240,6 +240,7 @@
userRecharge.setAddTime(new Date());
userRecharge.setPayId(payType);
userRecharge.setImg(currency);
+ userRecharge.setAssetsType(sitePay.getAssetsType());
userRechargeMapper.insert(userRecharge);
return ServerResponse.createBySuccess( ((SiteInfo)siteInfoService.getInfo(request).getData()).getOnlineService());
}
diff --git a/src/main/java/com/nq/service/impl/SiteAdminServiceImpl.java b/src/main/java/com/nq/service/impl/SiteAdminServiceImpl.java
index 4b8abe0..4bc3e93 100644
--- a/src/main/java/com/nq/service/impl/SiteAdminServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SiteAdminServiceImpl.java
@@ -1,19 +1,16 @@
package com.nq.service.impl;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.nq.dao.SiteAdminMapper;
+import com.nq.dao.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nq.common.ServerResponse;
-import com.nq.dao.UserMapper;
-import com.nq.dao.UserRechargeMapper;
-import com.nq.dao.UserWithdrawMapper;
-import com.nq.pojo.SiteAdmin;
-
-import com.nq.pojo.UserRecharge;
+import com.nq.pojo.*;
import com.nq.service.IAgentUserService;
@@ -29,6 +26,7 @@
import com.nq.service.IUserWithdrawService;
+import com.nq.utils.ConverterUtil;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.SymmetricCryptoUtil;
@@ -41,14 +39,17 @@
import java.math.BigDecimal;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
-import java.util.List;
+import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import com.nq.vo.agent.AgentUserNodeVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -58,6 +59,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.xmlunit.util.Convert;
@Service("iSiteAdminServiceImpl")
@@ -103,6 +105,11 @@
@Resource
UserMapper userMapper;
+ @Autowired
+ UserWithdrawMapper userWithdrawMapper;
+
+ @Autowired
+ AgentUserMapper agentUserMapper;
public ServerResponse login(String adminPhone, String adminPwd, String verifyCode, HttpServletRequest request) {
@@ -369,6 +376,257 @@
}
+ @Override
+ public ServerResponse moneyCount(String agentId,String startTime, String entTime) {
+ BigDecimal todayRechargeAmount = BigDecimal.ZERO;//今日充值金额
+ BigDecimal todayWithdrawAmount = BigDecimal.ZERO;//今日提现金额
+ Long todayRegister = 0L;//今日注册
+ Long todayWithdraw = 0L;//今日充值总人数
+ BigDecimal rechargeTotalAmount = BigDecimal.ZERO;//总充值金额
+ BigDecimal withdrawalTotalAmount = BigDecimal.ZERO;//总提现金额
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("todayRechargeAmount", todayRechargeAmount);
+ map.put("todayWithdrawAmount", todayWithdrawAmount);
+ map.put("todayRegister", todayRegister);
+ map.put("todayWithdraw", todayWithdraw);
+ map.put("rechargeTotalAmount", rechargeTotalAmount);
+ map.put("withdrawalTotalAmount", withdrawalTotalAmount);
+
+ //今日开始结束时间
+ LocalDate currentDate = LocalDate.now();
+ LocalDate nextDay = currentDate.plusDays(1);
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ String start = currentDate.format(formatter);
+ String end = nextDay.format(formatter);
+ List<Integer> userIds = null;
+ if(StringUtils.isNotEmpty(agentId)){
+ //当前代理
+ AgentUser agentUser = agentUserMapper.selectById(agentId);
+ if(null == agentUser){
+ return ServerResponse.createBySuccess(map);
+ }
+ List<AgentUser> lowerAgentUsers = agentUserMapper.selectList(new LambdaQueryWrapper<AgentUser>());
+ AgentUserNodeVO userNodeVO = ConverterUtil.convert(agentUser, AgentUserNodeVO.class);
+ List<AgentUserNodeVO> agentUserNodeVOS = ConverterUtil.convertToList(lowerAgentUsers, AgentUserNodeVO.class);
+ List<AgentUserNodeVO> nodeJson = getNodeJson(userNodeVO, agentUserNodeVOS);
+ userNodeVO.setChildList(nodeJson);
+ //当前节点和子节点的id
+ List<Integer> ids = getAllChildrenIds(userNodeVO);
+ //查询代理id下面所有的用户
+ List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getAgentId, ids));
+ userIds = users.stream().map(User::getId).collect(Collectors.toList());
+ }
+ //今日充值
+ List<UserRecharge> todayRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>().eq(UserRecharge::getOrderStatus, 1)
+ .ge(UserRecharge::getPayTime, start)
+ .le(UserRecharge::getPayTime, end)
+ .in(CollectionUtil.isNotEmpty(userIds),UserRecharge::getUserId,userIds));
+
+ //今日提现
+ List<UserWithdraw> todayWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>().eq(UserWithdraw::getWithStatus, 1)
+ .ge(UserWithdraw::getTransTime, start)
+ .le(UserWithdraw::getTransTime, end)
+ .in(CollectionUtil.isNotEmpty(userIds),UserWithdraw::getUserId,userIds));
+
+ //总充值
+ List<UserRecharge> userRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>().eq(UserRecharge::getOrderStatus, 1)
+ .ge(StringUtils.isNotBlank(startTime), UserRecharge::getPayTime, startTime)
+ .le(StringUtils.isNotBlank(entTime), UserRecharge::getPayTime, entTime)
+ .in(CollectionUtil.isNotEmpty(userIds),UserRecharge::getUserId,userIds));
+
+ //总提现
+ List<UserWithdraw> userWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>().eq(UserWithdraw::getWithStatus, 1)
+ .ge(StringUtils.isNotBlank(startTime), UserWithdraw::getTransTime, startTime)
+ .le(StringUtils.isNotBlank(entTime), UserWithdraw::getTransTime, entTime)
+ .in(CollectionUtil.isNotEmpty(userIds),UserWithdraw::getUserId,userIds));
+
+ //今日注册数量
+ todayRegister = userMapper.selectCount(new LambdaQueryWrapper<User>()
+ .ge(User::getRegTime, start)
+ .le(User::getRegTime, end)
+ .in(CollectionUtil.isNotEmpty(userIds),User::getId,userIds));
+
+ for (UserRecharge userRecharge : todayRecharges) {
+ todayRechargeAmount = todayRechargeAmount.add(userRecharge.getPayAmt());
+ }
+
+ for (UserWithdraw userWithdraw : todayWithdraws) {
+ todayWithdrawAmount = todayWithdrawAmount.add(userWithdraw.getWithAmt());
+ }
+
+ for (UserRecharge userRecharge : userRecharges) {
+ rechargeTotalAmount = rechargeTotalAmount.add(userRecharge.getPayAmt());
+ }
+
+ for (UserWithdraw userWithdraw : userWithdraws) {
+ withdrawalTotalAmount = withdrawalTotalAmount.add(userWithdraw.getWithAmt());
+ }
+
+ List<UserRecharge> distinctCustomers = todayRecharges.stream()
+ .collect(Collectors.toMap(UserRecharge::getUserId, c -> c, (c1, c2) -> c1))
+ .values().stream()
+ .collect(Collectors.toList());
+ todayWithdraw = Long.valueOf(distinctCustomers.size());
+
+ map.put("todayRechargeAmount", todayRechargeAmount);
+ map.put("todayWithdrawAmount", todayWithdrawAmount);
+ map.put("todayRegister", todayRegister);
+ map.put("todayWithdraw", todayWithdraw);
+ map.put("rechargeTotalAmount", rechargeTotalAmount);
+ map.put("withdrawalTotalAmount", withdrawalTotalAmount);
+ return ServerResponse.createBySuccess(map);
+ }
+
+ @Override
+ public ServerResponse totalAgencyFunds(String agentId) {
+ BigDecimal inTotalAmount = BigDecimal.ZERO;
+ BigDecimal usTotalAmount = BigDecimal.ZERO;
+
+ BigDecimal inTotalWithdrawAmount = BigDecimal.ZERO;
+ BigDecimal usTotalWithdrawAmount = BigDecimal.ZERO;
+ Map<String, Object> map = new HashMap<>();
+ Long todayRegister = 0L;//今日注册
+ map.put("todayRegister", todayRegister);
+ //入金
+ map.put("inTotalAmount", inTotalAmount);
+ map.put("usTotalAmount", usTotalAmount);
+ //出金
+ map.put("inTotalWithdrawAmount", inTotalWithdrawAmount);
+ map.put("usTotalWithdrawAmount", usTotalWithdrawAmount);
+ //查询所有代理用户(管理员)
+ List<AgentUser> agentUsers = agentUserMapper.selectList(new LambdaQueryWrapper<AgentUser>()
+ .eq(AgentUser::getAgentLevel,0)
+ .eq(StringUtils.isNotBlank(agentId),AgentUser::getId,agentId));
+ List<AgentUser> lowerAgentUsers = agentUserMapper.selectList(new LambdaQueryWrapper<AgentUser>()
+ .ne(AgentUser::getAgentLevel,0));
+ if(CollectionUtil.isEmpty(agentUsers)){
+ return ServerResponse.createBySuccess(map);
+ }
+
+ //今日开始结束时间
+ LocalDate currentDate = LocalDate.now();
+ LocalDate nextDay = currentDate.plusDays(1);
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ String start = currentDate.format(formatter);
+ String end = nextDay.format(formatter);
+
+ for (AgentUser agentUser : agentUsers) {
+ AgentUserNodeVO userNodeVO = ConverterUtil.convert(agentUser, AgentUserNodeVO.class);
+ List<AgentUserNodeVO> agentUserNodeVOS = ConverterUtil.convertToList(lowerAgentUsers, AgentUserNodeVO.class);
+ List<AgentUserNodeVO> nodeJson = getNodeJson(userNodeVO, agentUserNodeVOS);
+ userNodeVO.setChildList(nodeJson);
+ //当前节点和子节点的id
+ List<Integer> ids = getAllChildrenIds(userNodeVO);
+ //查询代理id下面所有的用户
+ List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getAgentId, ids));
+ //查询用户充值
+ List<Integer> userIds = users.stream().map(User::getId).collect(Collectors.toList());
+ if(CollectionUtil.isEmpty(userIds)){
+ continue;
+ }
+
+ //今日注册数量
+ todayRegister = userMapper.selectCount(new LambdaQueryWrapper<User>()
+ .ge(User::getRegTime, start)
+ .le(User::getRegTime, end)
+ .in(CollectionUtil.isNotEmpty(userIds),User::getId,userIds));
+
+ List<UserRecharge> userRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>()
+ .eq(UserRecharge::getOrderStatus, 1)
+ .in(UserRecharge::getUserId,userIds));
+ Map<String, List<UserRecharge>> typeList = userRecharges.stream().collect(Collectors.groupingBy(UserRecharge::getAssetsType));
+ List<UserRecharge> inUserRecharge = typeList.get("IN");
+ List<UserRecharge> usUserRecharge = typeList.get("US");
+ if(CollectionUtil.isNotEmpty(inUserRecharge)){
+ for (UserRecharge userRecharge : inUserRecharge) {
+ inTotalAmount = inTotalAmount.add(userRecharge.getPayAmt());
+ }
+ }
+ if(CollectionUtil.isNotEmpty(usUserRecharge)){
+ for (UserRecharge userRecharge : usUserRecharge) {
+ usTotalAmount = usTotalAmount.add(userRecharge.getPayAmt());
+ }
+ }
+
+ //总提现
+ List<UserWithdraw> userWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>()
+ .eq(UserWithdraw::getWithStatus, 1)
+ .in(CollectionUtil.isNotEmpty(userIds),UserWithdraw::getUserId,userIds));
+ Map<String, List<UserWithdraw>> typeWithdrawsList = userWithdraws.stream().collect(Collectors.groupingBy(UserWithdraw::getAssetsType));
+ List<UserWithdraw> inUserWithdraws = typeWithdrawsList.get("IN");
+ List<UserWithdraw> usUserWithdraws = typeWithdrawsList.get("US");
+ if(CollectionUtil.isNotEmpty(inUserWithdraws)){
+ for (UserWithdraw userWithdraw : inUserWithdraws) {
+ inTotalWithdrawAmount = inTotalWithdrawAmount.add(userWithdraw.getWithAmt());
+ }
+ }
+ if(CollectionUtil.isNotEmpty(usUserWithdraws)){
+ for (UserWithdraw userWithdraw : usUserWithdraws) {
+ usTotalWithdrawAmount = usTotalWithdrawAmount.add(userWithdraw.getWithAmt());
+ }
+ }
+ }
+ map.put("todayRegister", todayRegister);
+ map.put("inTotalAmount", inTotalAmount);
+ map.put("usTotalAmount", usTotalAmount);
+ map.put("inTotalWithdrawAmount", inTotalWithdrawAmount);
+ map.put("usTotalWithdrawAmount", usTotalWithdrawAmount);
+ return ServerResponse.createBySuccess(map);
+ }
+
+ public static List<Integer> getAllChildrenIds(AgentUserNodeVO parent) {
+ List<Integer> allChildrenIds = new ArrayList<>();
+ getAllChildrenIdsHelper(parent, allChildrenIds);
+ return allChildrenIds;
+ }
+
+ private static void getAllChildrenIdsHelper(AgentUserNodeVO node, List<Integer> allChildrenIds) {
+ allChildrenIds.add(node.getId());
+ if(CollectionUtil.isNotEmpty(node.getChildList())){
+ for (AgentUserNodeVO child : node.getChildList()) {
+ getAllChildrenIdsHelper(child, allChildrenIds);
+ }
+ }
+ }
+
+ public List<AgentUserNodeVO> getNodeJson(AgentUserNodeVO agentUser, List<AgentUserNodeVO> nodes){
+
+ //当前层级当前点下的所有子节点
+ List<AgentUserNodeVO> childList = getChildNodes(agentUser.getId(),nodes);
+ List<AgentUserNodeVO> list = new ArrayList<>();
+ childList.forEach(f->{
+ List<AgentUserNodeVO> childs = getNodeJson(f,nodes); //递归调用该方法
+ if(!childs.isEmpty()) {
+ f.setChildList(childs);
+ }
+ list.add(f);
+ });
+ return list;
+ }
+
+ /**
+ * 获取当前节点的所有子节点
+ * @param nodeId
+ * @param nodes
+ * @return
+ */
+ public List<AgentUserNodeVO> getChildNodes(Integer nodeId, List<AgentUserNodeVO> nodes){
+ List<AgentUserNodeVO> list = new ArrayList<>();
+ nodes.forEach(f->{
+ if(f.getParentId().equals(nodeId)){
+ list.add(f);
+ }
+ });
+ return list;
+ }
+
+
+ public String getDate(){
+ LocalDate currentDate = LocalDate.now();
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ return currentDate.format(formatter);
+ }
public SiteAdmin findAdminByName(String name) {
return this.siteAdminMapper.findAdminByName(name);
diff --git a/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java b/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
index 5929c13..66078a5 100644
--- a/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
@@ -102,7 +102,7 @@
AgentUser agentUser = agentUserMapper.findAgentByAgentId(user.getAgentId());
if(agentUser != null){
siteInfo.setAgentCode(agentUser.getAgentCode());
- if(!agentUser.getOnLineServices().isEmpty()){
+ if(null != agentUser.getOnLineServices() && !agentUser.getOnLineServices().isEmpty()){
siteInfo.setOnlineService(agentUser.getOnLineServices());
}
diff --git a/src/main/java/com/nq/service/impl/StockSettingServicesImpl.java b/src/main/java/com/nq/service/impl/StockSettingServicesImpl.java
index 32c3f72..0f0488d 100644
--- a/src/main/java/com/nq/service/impl/StockSettingServicesImpl.java
+++ b/src/main/java/com/nq/service/impl/StockSettingServicesImpl.java
@@ -26,7 +26,11 @@
@Override
public ServerResponse updateStockSetting(StockSetting stockSetting) {
+ if(stockSetting.getPrice()!=null){
+ stockSetting.setNowPrice(stockSetting.getPrice());
+ }
int ref = stockSettingMapper.updateById(stockSetting);
+
if(ref == 0){
return ServerResponse.createByErrorMsg("修改失败");
}
diff --git a/src/main/java/com/nq/service/impl/TradingHourServiceImpl.java b/src/main/java/com/nq/service/impl/TradingHourServiceImpl.java
index 30b1cbb..197d22b 100644
--- a/src/main/java/com/nq/service/impl/TradingHourServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/TradingHourServiceImpl.java
@@ -6,6 +6,7 @@
import com.nq.dao.StockSettingMapper;
import com.nq.dao.StockTimeSettingMapper;
import com.nq.dao.TradingHourMapper;
+import com.nq.enums.EStockType;
import com.nq.pojo.Stock;
import com.nq.pojo.StockSetting;
import com.nq.pojo.StockTimeSetting;
@@ -16,6 +17,10 @@
import javax.annotation.Resource;
import java.time.LocalDate;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.time.ZoneId;
/**
* @program: dabao
@@ -59,7 +64,25 @@
if(!stockTimeSetting.getWeekDay().contains(String.valueOf(LocalDate.now().getDayOfWeek().getValue()))){
return false;
}
- return TimeUtil.isTradingHour(stockTimeSetting.getAmStartTime(),stockTimeSetting.getAmEndTime(),stockTimeSetting.getPmStartTime(),stockTimeSetting.getPmEndTime());
+
+ return TimeUtil.isTradingHour(stock.getStockType(),stockTimeSetting.getAmStartTime(),stockTimeSetting.getAmEndTime(),stockTimeSetting.getPmStartTime(),stockTimeSetting.getPmEndTime());
+ }
+
+ /**
+ * 判断股票代码是否在可交易时间段
+ * @return
+ */
+ @Override
+ public Boolean weekDayeCheck(String stockCode) {
+
+ Stock stock = stockMapper.selectOne(new QueryWrapper<Stock>().eq("stock_code",stockCode));
+ StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type",stock.getStockType()));
+ if(stockTimeSetting.getAccetsType().equals(EStockType.US.getCode())){
+ ZoneId usEastern = ZoneId.of("America/New_York");
+ LocalDate date = LocalDate.now(usEastern);
+ return stockTimeSetting.getWeekDay().indexOf(String.valueOf(date.getDayOfWeek().getValue())) >= 0;
+ }
+ return stockTimeSetting.getWeekDay().indexOf(String.valueOf(LocalDate.now().getDayOfWeek().getValue())) >= 0;
}
@Override
diff --git a/src/main/java/com/nq/utils/redis/RedisKeyConstant.java b/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
index 4fe11e6..631638e 100644
--- a/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
+++ b/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
@@ -25,5 +25,8 @@
* */
public static final String RK_COMPANY_INFO = "rk_company_info";
-
+ /**
+ * 短信验证码
+ * */
+ public static final String SMS_CODE = "SMS_CODE_";
}
diff --git a/src/main/java/com/nq/utils/timeutil/TimeUtil.java b/src/main/java/com/nq/utils/timeutil/TimeUtil.java
index b87dc8b..a113319 100644
--- a/src/main/java/com/nq/utils/timeutil/TimeUtil.java
+++ b/src/main/java/com/nq/utils/timeutil/TimeUtil.java
@@ -4,7 +4,7 @@
public class TimeUtil {
- public static boolean isTradingHour(String amStartTime,String amEndTime,String pmStartTime,String pmEndTime){
+ public static boolean isTradingHour(String stockType,String amStartTime,String amEndTime,String pmStartTime,String pmEndTime){
LocalTime now = LocalTime.now();
LocalTime amTime = LocalTime.parse(amStartTime);
LocalTime amTime1 = LocalTime.parse(amEndTime);
@@ -15,10 +15,16 @@
return true;
}
-
- if(now.isAfter(pmTime) && now.isBefore(pmTime1)){
- return true;
+ if(stockType.equalsIgnoreCase("US")){
+ if(now.isAfter(pmTime) || now.isBefore(pmTime1)){
+ return true;
+ }
+ }else{
+ if(now.isAfter(pmTime) && now.isBefore(pmTime1)){
+ return true;
+ }
}
+
return false;
}
diff --git a/src/main/java/com/nq/vo/agent/AgentUserListVO.java b/src/main/java/com/nq/vo/agent/AgentUserListVO.java
index 383733e..6a2f2aa 100644
--- a/src/main/java/com/nq/vo/agent/AgentUserListVO.java
+++ b/src/main/java/com/nq/vo/agent/AgentUserListVO.java
@@ -1,8 +1,10 @@
package com.nq.vo.agent;
-import java.math.BigDecimal;
+import lombok.Data;
+import java.math.BigDecimal;
+@Data
public class AgentUserListVO {
private Integer id;
private Integer agentId;
@@ -28,7 +30,8 @@
private String bankNo;
private String bankAddress;
-
+ private String img1Key;
+ private String img2Key;
public void setId(Integer id) {
this.id = id;
diff --git a/src/main/java/com/nq/vo/stock/StockVO.java b/src/main/java/com/nq/vo/stock/StockVO.java
index d92ea0b..1b99917 100644
--- a/src/main/java/com/nq/vo/stock/StockVO.java
+++ b/src/main/java/com/nq/vo/stock/StockVO.java
@@ -59,6 +59,6 @@
private Integer depositAmt;
-
+ private String price;
}
diff --git a/src/main/resources/mapper/SitePayMapper.xml b/src/main/resources/mapper/SitePayMapper.xml
index 40d6c7b..ec85606 100644
--- a/src/main/resources/mapper/SitePayMapper.xml
+++ b/src/main/resources/mapper/SitePayMapper.xml
@@ -18,7 +18,7 @@
<result column="is_lock" property="isLock"/>
<result column="total_price" property="totalPrice"/>
<result column="assets_type" property="assetsType"/>
-
+ <result column="bank_number" property="bankNumber"/>
</resultMap>
@@ -219,7 +219,7 @@
<select id="listByAdmin" parameterType="string" resultMap="BaseResultMap">
SELECT
- <include refid="Base_Column_List"/>
+ *
FROM site_pay
<where>
<if test="channelType != null and channelType != '' ">
@@ -232,7 +232,7 @@
<select id="getPayInfo" resultMap="BaseResultMap">
SELECT
- <include refid="Base_Column_List"/>
+ *
FROM site_pay WHERE is_show = 0
</select>
diff --git a/src/main/resources/mapper/StockDzMapper.xml b/src/main/resources/mapper/StockDzMapper.xml
index 9433454..353599a 100644
--- a/src/main/resources/mapper/StockDzMapper.xml
+++ b/src/main/resources/mapper/StockDzMapper.xml
@@ -42,4 +42,8 @@
</where>
ORDER BY id ASC
</select>
+
+ <select id="getPrice" parameterType="string" resultType="decimal">
+ select price from stock_setting where stock_code=#{stockCode}
+ </select>
</mapper>
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index 25e3a6a..994e939 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -77,6 +77,10 @@
select count(*) from user where TO_DAYS(reg_time) = TO_DAYS(NOW()) and agent_id = #{id}
</select>
+ <select id="findByPhone" parameterType="string" resultType="com.nq.pojo.User">
+ select * from user where phone= #{phone}
+ </select>
+
<select id="queryAgintSumTodayRegCount" parameterType="integer" resultType="int">
select count(*) from user where agent_id =#{id} TO_DAYS(reg_time) = TO_DAYS(NOW())
@@ -87,6 +91,9 @@
<include refid="Base_Column_List"/>
FROM user
<where>
+ <if test="id != null and id != '' ">
+ and id = #{id}
+ </if>
<if test="searchId != null ">
and agent_id = #{searchId}
</if>
diff --git a/src/main/resources/mapper/UserRechargeMapper.xml b/src/main/resources/mapper/UserRechargeMapper.xml
index 2f36d6c..3e4767c 100644
--- a/src/main/resources/mapper/UserRechargeMapper.xml
+++ b/src/main/resources/mapper/UserRechargeMapper.xml
@@ -22,18 +22,6 @@
id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status,
order_desc, add_time, pay_time, pay_id,img
</sql>
- <insert id="insert" parameterType="com.nq.pojo.UserRecharge" >
- insert into user_recharge (id, user_id, nick_name,
- agent_id, order_sn, pay_sn,
- pay_channel, pay_amt, order_status,
- order_desc, add_time, pay_time,pay_id,img
- )
- values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR},
- #{agentId,jdbcType=INTEGER}, #{orderSn,jdbcType=VARCHAR}, #{paySn,jdbcType=VARCHAR},
- #{payChannel,jdbcType=VARCHAR}, #{payAmt,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER},
- #{orderDesc,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, #{payId,jdbcType=INTEGER}, #{img,jdbcType=VARCHAR}
- )
- </insert>
<insert id="insertSelective" parameterType="com.nq.pojo.UserRecharge" >
insert into user_recharge
<trim prefix="(" suffix=")" suffixOverrides="," >
diff --git a/src/main/resources/mapper/UserWithdrawMapper.xml b/src/main/resources/mapper/UserWithdrawMapper.xml
index 6311b02..735bb74 100644
--- a/src/main/resources/mapper/UserWithdrawMapper.xml
+++ b/src/main/resources/mapper/UserWithdrawMapper.xml
@@ -17,13 +17,9 @@
<result column="with_fee" property="withFee"/>
<result column="with_msg" property="withMsg"/>
</resultMap>
- <sql id="Base_Column_List" >
- id, user_id, nick_name, agent_id, with_amt, apply_time, trans_time, with_name, bank_no,
- bank_name, bank_address, with_status, with_fee, with_msg
- </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
- <include refid="Base_Column_List" />
+ *
from user_withdraw
where id = #{id,jdbcType=INTEGER}
</select>
@@ -31,18 +27,7 @@
delete from user_withdraw
where id = #{id,jdbcType=INTEGER}
</delete>
- <insert id="insert" parameterType="com.nq.pojo.UserWithdraw" >
- insert into user_withdraw (id, user_id, nick_name,
- agent_id, with_amt, apply_time,
- trans_time, with_name, bank_no,
- bank_name, bank_address, with_status,
- with_fee, with_msg)
- values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR},
- #{agentId,jdbcType=INTEGER}, #{withAmt,jdbcType=DECIMAL}, #{applyTime,jdbcType=TIMESTAMP},
- #{transTime,jdbcType=TIMESTAMP}, #{withName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR},
- #{bankName,jdbcType=VARCHAR}, #{bankAddress,jdbcType=VARCHAR}, #{withStatus,jdbcType=INTEGER},
- #{withFee,jdbcType=DECIMAL}, #{withMsg,jdbcType=VARCHAR})
- </insert>
+
<insert id="insertSelective" parameterType="com.nq.pojo.UserWithdraw" >
insert into user_withdraw
<trim prefix="(" suffix=")" suffixOverrides="," >
@@ -201,7 +186,7 @@
<select id="findUserWithList" parameterType="map" resultMap="BaseResultMap">
SELECT
- <include refid="Base_Column_List"/>
+*
FROM user_withdraw
<where>
user_id = #{uid}
@@ -217,7 +202,7 @@
<select id="listByAgent" resultMap="BaseResultMap" parameterType="map">
SELECT
- <include refid="Base_Column_List"/>
+ *
FROM user_withdraw
<where>
agent_id = #{searchId}
@@ -233,7 +218,7 @@
<select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
SELECT
- <include refid="Base_Column_List"/>
+ *
FROM user_withdraw
where agent_id != 1
<if test="agentId != null">
--
Gitblit v1.9.3