Merge remote-tracking branch 'origin/zyqs-0502' into rb-copy
# Conflicts:
# .gitignore
# .idea/inspectionProfiles/Project_Default.xml
# src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java
# src/main/java/com/nq/controller/backend/AdminController.java
# src/main/java/com/nq/controller/protol/UserController.java
# src/main/java/com/nq/dao/ApplyLeverMapper.java
# src/main/java/com/nq/enums/EStockType.java
# src/main/java/com/nq/pojo/User.java
# src/main/java/com/nq/pojo/reponse/RUserAssets.java
# src/main/java/com/nq/service/IPriceServices.java
# src/main/java/com/nq/service/impl/ApplyLeverServicesimpl.java
# src/main/java/com/nq/service/impl/FileUploadServiceImpl.java
# src/main/java/com/nq/service/impl/PriceServicesImpl.java
# src/main/java/com/nq/service/impl/RateServicesImpl.java
# src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java
# src/main/java/com/nq/service/impl/StockServiceImpl.java
# src/main/java/com/nq/service/impl/TradingHourServiceImpl.java
# src/main/java/com/nq/service/impl/UserAssetsServices.java
# src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
# src/main/java/com/nq/service/impl/UserServiceImpl.java
# src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
# src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
# src/main/java/com/nq/utils/task/stock/StockTask.java
# src/main/java/com/nq/ws/HKWebsocketRunClient.java
# src/main/java/com/nq/ws/WebSocketClientBeanConfig.java
# src/main/java/com/nq/ws/WebsocketRunClient.java
# src/main/resources/application.properties
# src/main/resources/application.yml
# target/classes/application.properties
# target/classes/application.yml
# target/classes/mapper/SitePayMapper.xml
# target/classes/mapper/StockDzMapper.xml
# target/classes/mapper/UserMapper.xml
# target/classes/mapper/UserRechargeMapper.xml
# target/classes/mapper/UserWithdrawMapper.xml
| | |
| | | </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>--> |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public ServerResponse rechargMethodTop3(String ordersn, String payAmt){ |
| | | Map<String,String> map = new HashedMap(); |
| | | map.put("version","1.0"); |
| | |
| | | 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); |
| | | } |
| | |
| | | //注册 |
| | | @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 |
| | |
| | | @Autowired |
| | | IAgentAgencyFeeService iAgentAgencyFeeService; |
| | | |
| | | @Autowired |
| | | ISiteUserOptionLogService iSiteUserOptionLogService; |
| | | |
| | | @Autowired |
| | | ISiteAdminService iSiteAdminService; |
| | |
| | | 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 |
| | |
| | | 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"}) |
| | |
| | | //添加用户管理 账户信息 |
| | | @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); |
| | | } |
| | | |
| | | //查询股票统计指定时间内,代理客户(已平仓)的交易盈亏 |
| | |
| | | //添加用户列表 用户信息 |
| | | @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"}) |
| | |
| | | |
| | | import com.nq.utils.PropertiesUtil; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @Autowired |
| | | IUserAssetsServices iUserAssetsServices; |
| | | |
| | | @Autowired |
| | | IApplyLeverServices iApplyLeverServices; |
| | | |
| | | |
| | | @Autowired |
| | | IApplyLeverServices iApplyLeverServices; |
| | |
| | | @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); |
| | | } |
| | | |
| | | //处理图片上传 |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | ISiteMessageService iSiteMessageService; |
| | | |
| | | @Autowired |
| | | ISiteUserOptionLogService iSiteUserOptionLogService; |
| | | |
| | | //分页查询日志管理 所有定时任务信息及模糊查询 |
| | | @RequestMapping({"taskList.do"}) |
| | | @ResponseBody |
| | |
| | | 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 |
| | |
| | | //分页查询所有用户列表信息 及模糊查询用户信息 |
| | | @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); |
| | | } |
| | | |
| | | //查询用户信息是否存在 |
| | |
| | | //添加用户列表 用户信息 |
| | | @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"}) |
| | |
| | | |
| | | |
| | | |
| | | 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); |
| | |
| | | import com.nq.pojo.StockDz; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public interface StockDzMapper extends BaseMapper<StockDz> { |
| | | List<StockDz> findStockListByKeyWords(@Param("keyWords") String paramString1); |
| | | |
| | | BigDecimal getPrice(String stockCode); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | int insert(User paramUser); |
| | | |
| | | int insertSelective(User paramUser); |
| | | |
| | | |
| | | |
| | | int updateByPrimaryKey(User paramUser); |
| | | |
| | | User findByPhone(String paramString); |
| | |
| | | |
| | | 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); |
| | | |
| | |
| | | |
| | | public interface UserRechargeMapper extends BaseMapper<UserRecharge> { |
| | | |
| | | int insert(UserRecharge paramUserRecharge); |
| | | // int insert(UserRecharge paramUserRecharge); |
| | | |
| | | int insertSelective(UserRecharge paramUserRecharge); |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | package com.nq.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Data |
| | | public class AgentUser { |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Integer id; |
| | | private String agentName; |
| | | private String agentPwd; |
| | |
| | | |
| | | private String assetsType; |
| | | |
| | | private String bankNumber; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | private String type; |
| | | // type = 0 价格 1为百分比 |
| | | private String price; |
| | | //修改后的盘前价格 未修改过则为空 |
| | | private String nowPrice; |
| | | } |
| | |
| | | private Long orderNumber; |
| | | |
| | | /** |
| | | * 最低数量 |
| | | */ |
| | | private Long minOrderNumber; |
| | | |
| | | /** |
| | | * 顯示状态 |
| | | */ |
| | | private Integer zt; |
| | |
| | | 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; |
| | |
| | | @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) { |
| | | |
| | |
| | | ServerResponse count(); |
| | | |
| | | ServerResponse deleteAdmin(Integer adminId); |
| | | |
| | | ServerResponse moneyCount(String agentId,String startTime, String entTime); |
| | | |
| | | ServerResponse totalAgencyFunds(String agentId); |
| | | } |
| | |
| | | |
| | | public interface ITradingHourService { |
| | | Boolean timeCheck(String stockCode); |
| | | Boolean weekDayeCheck(String stockCode); |
| | | |
| | | Boolean timeCheck(); |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | |
| | | 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); |
| | | |
| | |
| | | ServerResponse queryMyOption(String code, HttpServletRequest request); |
| | | |
| | | ServerResponse getMoenyLog(String type,HttpServletRequest request); |
| | | |
| | | ServerResponse sendMailCode(String toMail); |
| | | |
| | | ServerResponse sendSms(String phone,HttpServletRequest request) throws Exception; |
| | | } |
| | |
| | | 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()); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | import com.nq.service.IUserWithdrawService; |
| | | |
| | | import com.nq.utils.ConverterUtil; |
| | | import com.nq.utils.PropertiesUtil; |
| | | |
| | | import com.nq.utils.SymmetricCryptoUtil; |
| | |
| | | |
| | | 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; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.xmlunit.util.Convert; |
| | | |
| | | |
| | | @Service("iSiteAdminServiceImpl") |
| | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | UserWithdrawMapper userWithdrawMapper; |
| | | |
| | | @Autowired |
| | | AgentUserMapper agentUserMapper; |
| | | |
| | | public ServerResponse login(String adminPhone, String adminPwd, String verifyCode, HttpServletRequest request) { |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @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); |
| | |
| | | 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()); |
| | | } |
| | | |
| | |
| | | |
| | | @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("修改失败"); |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | * */ |
| | | public static final String RK_COMPANY_INFO = "rk_company_info"; |
| | | |
| | | |
| | | /** |
| | | * 短信验证码 |
| | | * */ |
| | | public static final String SMS_CODE = "SMS_CODE_"; |
| | | } |
| | |
| | | |
| | | 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); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | |
| | | 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; |
| | |
| | | private String bankNo; |
| | | |
| | | private String bankAddress; |
| | | |
| | | private String img1Key; |
| | | private String img2Key; |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | |
| | | |
| | | private Integer depositAmt; |
| | | |
| | | |
| | | private String price; |
| | | } |
| | | |
| | |
| | | <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> |
| | | |
| | |
| | | |
| | | <select id="listByAdmin" parameterType="string" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | * |
| | | FROM site_pay |
| | | <where> |
| | | <if test="channelType != null and channelType != '' "> |
| | |
| | | |
| | | <select id="getPayInfo" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | * |
| | | FROM site_pay WHERE is_show = 0 |
| | | </select> |
| | | |
| | |
| | | </where> |
| | | ORDER BY id ASC |
| | | </select> |
| | | |
| | | <select id="getPrice" parameterType="string" resultType="decimal"> |
| | | select price from stock_setting where stock_code=#{stockCode} |
| | | </select> |
| | | </mapper> |
| | |
| | | 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()) |
| | |
| | | <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> |
| | |
| | | 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="," > |
| | |
| | | <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> |
| | |
| | | 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="," > |
| | |
| | | |
| | | <select id="findUserWithList" parameterType="map" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | * |
| | | FROM user_withdraw |
| | | <where> |
| | | user_id = #{uid} |
| | |
| | | |
| | | <select id="listByAgent" resultMap="BaseResultMap" parameterType="map"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | * |
| | | FROM user_withdraw |
| | | <where> |
| | | agent_id = #{searchId} |
| | |
| | | |
| | | <select id="listByAdmin" resultMap="BaseResultMap" parameterType="map"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | * |
| | | FROM user_withdraw |
| | | where agent_id != 1 |
| | | <if test="agentId != null"> |