1
zj
2024-05-27 ecf9708688af3f3fae3199c33763dbd3811aa619
1
25 files modified
258 ■■■■■ changed files
src/main/java/com/nq/common/ServerResponse.java 4 ●●● patch | view | raw | blame | history
src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/UserApiController.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/protol/UserController.java 21 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/dao/StockDzMapper.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/pojo/StockSetting.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/IPriceServices.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/ITradingHourService.java 1 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/FileUploadServiceImpl.java 52 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/PriceServicesImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/StockServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/StockSettingServicesImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/TradingHourServiceImpl.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java 57 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserServiceImpl.java 37 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/nq/vo/stock/StockVO.java 2 ●●● patch | view | raw | blame | history
src/main/resources/application.properties 4 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/StockDzMapper.xml 4 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/UserMapper.xml 4 ●●●● patch | view | raw | blame | history
target/classes/application.properties 4 ●●●● patch | view | raw | blame | history
target/classes/application.yml 2 ●●● patch | view | raw | blame | history
target/classes/mapper/StockDzMapper.xml 4 ●●●● patch | view | raw | blame | history
target/classes/mapper/UserMapper.xml 4 ●●●● patch | view | raw | blame | history
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);
    }
src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java
@@ -77,7 +77,7 @@
            httpServletResponse.setCharacterEncoding("UTF-8");
            httpServletResponse.setContentType("application/json;charset=UTF-8");
            PrintWriter writer = httpServletResponse.getWriter();
            writer.print( new Gson().toJson(ServerResponse.createByErrorCodeMsg(401,"请登录")));
            writer.print( new Gson().toJson(ServerResponse.createByErrorMsg(401,"请登录",httpServletRequest)));
            writer.flush();
            writer.close();
            return false;
src/main/java/com/nq/controller/UserApiController.java
@@ -59,8 +59,8 @@
    @ResponseBody
    public ServerResponse reg(@RequestParam("agentCode") String agentCode,
                              @RequestParam("phone") String phone,
                              @RequestParam("phoneCode") String phoneCode,
                              @RequestParam("userPwd") String userPwd,
                              @RequestParam("phoneCode")String phoneCode,
                              HttpServletRequest httpServletRequest) {
        return this.iUserService.reg(agentCode, phone,phoneCode, userPwd,httpServletRequest);
    }
src/main/java/com/nq/controller/protol/UserController.java
@@ -1,6 +1,7 @@
package com.nq.controller.protol;
import ch.qos.logback.core.util.FileUtil;
import com.google.common.collect.Maps;
import com.nq.common.ServerResponse;
import com.nq.enums.EStockType;
@@ -10,7 +11,13 @@
import com.nq.service.*;
import com.nq.utils.PropertiesUtil;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Base64;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -25,6 +32,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import static com.nq.service.impl.SiteNewsServiceImpl.convertBase64ToImage;
@Controller
@RequestMapping({"/user/"})
@@ -241,10 +250,10 @@
    //图片上传
    @RequestMapping({"upload.do"})
    @ResponseBody
    public ServerResponse upload(HttpSession session, @RequestParam(value = "upload_file", required = false) MultipartFile file, HttpServletRequest request) {
        String path = request.getSession().getServletContext().getRealPath("upload");
    public ServerResponse upload(HttpSession session, @RequestParam(value = "upload_file", required = false) MultipartFile file, HttpServletRequest request) throws IOException {
        String path = PropertiesUtil.getProperty("ftp.address")+file.getOriginalFilename();
        ServerResponse serverResponse = this.iFileUploadService.upload(file, path);
        ServerResponse serverResponse = iFileUploadService.upload(file, path);
        if (serverResponse.isSuccess()) {
            String targetFileName = serverResponse.getData().toString();
            String url = PropertiesUtil.getProperty("ftp.server.http.prefix") + targetFileName;
@@ -256,7 +265,11 @@
            return ServerResponse.createBySuccess(fileMap);
        }
        return serverResponse;
//        convertBase64ToImage(file.getBytes().toString(),path);
        Map fileMap = Maps.newHashMap();
       fileMap.put("uri", file.getOriginalFilename());
       fileMap.put("url", PropertiesUtil.getProperty("ftp.server.http.prefix")+file.getOriginalFilename());
       return ServerResponse.createBySuccess(fileMap);
    }
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);
}
src/main/java/com/nq/pojo/StockSetting.java
@@ -20,4 +20,6 @@
    private String type;
    // type  = 0 价格  1为百分比
    private String price;
    //修改后的盘前价格 未修改过则为空
    private String nowPrice;
}
src/main/java/com/nq/service/IPriceServices.java
@@ -7,4 +7,6 @@
    BigDecimal getNowPrice(String stockCode);
    BigDecimal getNowPrice(String stockCode, String stockType);
    BigDecimal getPrice(String stockCode);
}
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();
}
src/main/java/com/nq/service/impl/FileUploadServiceImpl.java
@@ -3,8 +3,10 @@
import com.google.common.collect.Lists;
import com.nq.common.ServerResponse;
import com.nq.service.IFileUploadService;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.ftp.FTPUtil;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import org.slf4j.Logger;
@@ -23,59 +25,15 @@
    public ServerResponse upload(MultipartFile file, String path) {
        String fileName = file.getOriginalFilename();
        String fileExtentionName = fileName.substring(fileName.lastIndexOf(".") + 1);
        String uploadFileName = UUID.randomUUID() + "." + fileExtentionName;
        File fileDir = new File(path);
        if (!fileDir.exists()) {
            fileDir.setWritable(true);
            fileDir.mkdirs();
        }
        File tartgetFile = new File(path, uploadFileName);
        boolean result = false;
        File tartgetFile = new File(PropertiesUtil.getProperty("ftp.address"), fileName);
        try {
            file.transferTo(tartgetFile);
            result = FTPUtil.uploadFile(Lists.newArrayList(new File[]{tartgetFile}));
            tartgetFile.delete();
        } catch (Exception e) {
            log.error("上传文件异常 , 错误信息 = {}", e);
            return null;
        }
        if (result) {
            return ServerResponse.createBySuccess(tartgetFile.getName());
        } catch (IOException e) {
            return ServerResponse.createByErrorMsg("上传失败");
        }
        return ServerResponse.createByErrorMsg("上传失败");
    }
src/main/java/com/nq/service/impl/PriceServicesImpl.java
@@ -151,4 +151,9 @@
        return nowPrice.multiply(stockDz.getDiscount());
    }
    @Override
    public BigDecimal getPrice(String stockCode) {
        return stockDZMapper.getPrice(stockCode);
    }
}
src/main/java/com/nq/service/impl/StockServiceImpl.java
@@ -276,6 +276,8 @@
        String introduction = null;
        StockVO   stockVO = StockApi.assembleInStockVO(stock);
        stockVO.setDepositAmt(depositAmt);
        BigDecimal price = stockDzMapper.getPrice(stock.getStockCode());
        stockVO.setPrice(price != null ? price.toString() : "0");
        stockVO.setNowPrice(iPriceServices.getNowPrice(stock.getStockCode(),stock.getStockType()).toString());
        stockVO.setType(stock.getStockType());
        stockVO.setId(stock.getId().intValue());
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("修改失败");
       }
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;
@@ -15,6 +16,10 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
/**
 * @program: dabao
@@ -55,9 +60,30 @@
        if(stockTimeSetting == null){
            return  false;
        }
        if(stockTimeSetting.getWeekDay().indexOf(String.valueOf(LocalDate.now().getDayOfWeek().getValue())) < 0){
            return false;
        }
        return TimeUtil.isTradingHour(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 Boolean timeCheck() {
        return true;
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -1,5 +1,6 @@
package com.nq.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nq.dao.*;
@@ -18,6 +19,7 @@
import com.nq.utils.stock.pinyin.GetPyByChinese;
import com.nq.utils.stock.sina.StockApi;
import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.timeutil.TimeUtil;
import com.nq.vo.agent.AgentIncomeVO;
import com.nq.vo.position.AdminPositionVO;
import com.nq.vo.position.AgentPositionVO;
@@ -32,7 +34,9 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
@@ -246,13 +250,17 @@
        }
    }
    public static void main(String[] args) {
        String a = "09:00";
        System.out.println(Integer.parseInt(a.split(":")[0])>12);
    }
    @Transactional
    public ServerResponse sell(String positionSn, int doType){
        UserPosition userPosition = this.userPositionMapper.findPositionBySn(positionSn);
        BigDecimal siitteBuyFee = iSiteSettingService.getSiteSetting().getBuyFee();
        Boolean b = tradingHourService.timeCheck(userPosition.getStockCode());
        if (!b) {
            return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内");
        }
@@ -303,6 +311,27 @@
        // 手续费率
        BigDecimal siitteBuyFee = siteSetting.getSellFee();
//        Calendar calendar = Calendar.getInstance();
//        int time = calendar.get(Calendar.HOUR_OF_DAY);
//        if(time<12 && time>=Integer.parseInt(siteSetting.getTransAmEnd().split(":")[0])){ //上午
//            return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内",request);
//        }
//        if(time>12 && time>=Integer.parseInt(siteSetting.getTransPmEnd().split(":")[0])){//下午
//            return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内",request);
//        }
        Stock stock = stockMapper.selectOne(new QueryWrapper<Stock>().eq("stock_code", userPosition.getStockCode()));
        if(null == stock){
            return ServerResponse.createBySuccessMsg("股票不存在!", request);
        }
        //判断股票是否在可交易时间段
        Boolean b = isStockMarketOpen(stock.getStockType());
        Boolean wb = tradingHourService.weekDayeCheck(stock.getStockCode());
            if (!b || !wb) {
            return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内", request);
        }
        if (userPosition == null) {
            return ServerResponse.createByErrorMsg("平仓失败,订单不存在", request);
        }
@@ -316,7 +345,6 @@
        if (1 == userPosition.getIsLock().intValue()) {
            return ServerResponse.createByErrorMsg("this order is closed " + userPosition.getLockMsg());
        }
        Stock stock = stockMapper.selectOne(new QueryWrapper<Stock>().eq("stock_code", userPosition.getStockCode()));
        BigDecimal nowPrice = priceServices.getNowPrice(userPosition.getStockCode());
        if (nowPrice.compareTo(new BigDecimal("0")) != 1) {
            return ServerResponse.createByErrorMsg("报价0,平仓失败,请稍后再试", request);
@@ -343,6 +371,29 @@
                userPosition.getUserId(), EUserAssets.CLOSE_POSITION,
                profitVO.getAllProfitAndLose(), "", "");
        return ServerResponse.createBySuccessMsg("平仓成功!", request);
    }
    public boolean isStockMarketOpen(String stockType){
        ZoneId zone = ZoneId.of("Asia/Shanghai");
        LocalTime now = LocalTime.now(zone);
        if("US".equalsIgnoreCase(stockType)){
            LocalTime startTime = LocalTime.of(21, 30);
            LocalTime endTime = LocalTime.of(4, 0);
            if (now.isAfter(startTime) || now.isBefore(endTime)) {
                return true;
            } else {
                return false;
            }
        }else if("IN".equalsIgnoreCase(stockType)){
            LocalTime instartTime = LocalTime.of(11, 15);
            LocalTime inendTime = LocalTime.of(17, 30);
            if (now.isAfter(instartTime) && now.isBefore(inendTime)) {
                return true;
            } else {
                return false;
            }
        }
        return false;
    }
    @Transactional
@@ -533,7 +584,7 @@
        List<UserPositionVO> userPositionVOS = Lists.newArrayList();
        if (userPositions.size() > 0) {
            for (UserPosition position : userPositions) {
                UserPositionVO userPositionVO = UserPointUtil.assembleUserPositionVO(position, priceServices.getNowPrice(position.getStockCode()));
                UserPositionVO userPositionVO = UserPointUtil.assembleUserPositionVO(position, priceServices.getNowPrice(position.getStockCode(),stockType));
                userPositionVO.setOrderTotalPrice(userPositionVO.getOrderTotalPrice().multiply(new BigDecimal(userPositionVO.getOrderLever())));
                userPositionVO.setProfitAndLose(userPositionVO.getProfitAndLose().multiply(new BigDecimal(userPositionVO.getOrderLever())));
                userPositionVOS.add(userPositionVO);
src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -150,31 +150,8 @@
        if (StringUtils.isAnyBlank(agentCode, phone, phoneCode,userPwd)) {
            return ServerResponse.createByErrorMsg("注册失败。该参数不能为空", request);
        }
//        if (userMapper.selectCount(new LambdaQueryWrapper<User>().eq(User::getEmail, email)) > 0) {
//            return ServerResponse.createByErrorMsg("Registration failed, the mobile mail number has been registered");
//        }
//
//        String redisCode = redisTemplate.opsForValue().get(codeUtil.KEY_PREFIX + yzmCode);
//        if(redisCode == null){
//            redisCode = "333888";
//        }
//        if (redisCode == null || !yzmCode.equals(redisCode)) {
//            return ServerResponse.createByErrorMsg("Verification code error");
//        }
        /*
        String keys = "AliyunSmsCode:" + phone;
        String redis_yzm = RedisShardedPoolUtils.get(keys);
        log.info("redis_yzm = {},yzmCode = {}", redis_yzm, yzmCode);
        if (!yzmCode.equals(redis_yzm) && !"6666".equals(yzmCode)) {
            return ServerResponse.createByErrorMsg("由于验证码不正确,注册失败。过程",request);
        }*/
        String code = RedisShardedPoolUtils.get(RedisKeyConstant.SMS_CODE + phone);
        if(!phoneCode.equals(code) && phoneCode != "333888"){
            return ServerResponse.createByErrorMsg("由于验证码不正确,注册失败。过程",request);
        }
        if(phoneCode.equals("333888")){
        AgentUser agentUser = this.iAgentUserService.findByCode(agentCode);
        if (agentUser == null) {
            return ServerResponse.createByErrorMsg("由于代理不存在,注册失败", request);
@@ -214,6 +191,11 @@
        if (insertCount > 0) {
            log.info("用户注册成功 手机 {} , ip = {} 地址 = {}", new Object[]{phone, uip, uadd});
            return ServerResponse.createBySuccessMsg("Registration successful. Please login");
            }
        }else if(!code.equals(phoneCode)){
            return ServerResponse.createByErrorMsg("由于验证码不正确,注册失败。过程",request);
        }else{
            ServerResponse.createBySuccessMsg("注册错误,请重试", request);
        }
        return ServerResponse.createBySuccessMsg("注册错误,请重试", request);
    }
@@ -1160,7 +1142,10 @@
        String message = "Your verification code is:";
        String code = generateVerificationCode();
        message += code;
        String rcode = RedisShardedPoolUtils.get(RedisKeyConstant.SMS_CODE+phone+code);
        if(rcode !=null ){
            ServerResponse.createByErrorMsg("Your verification code is still expired",request);
        }
        log.info("开始发送短信【国际】:" + phone + "----" + message);
        String urlString = "http://190.92.213.148:9090/sms/batch/v2";
        String appKey = "84f3ue";
@@ -1172,7 +1157,7 @@
        }.getType();
        Map<String, Object> map = gson.fromJson(response, mapType);
        if (map.get("code").equals("00000")) {
            RedisShardedPoolUtils.set(RedisKeyConstant.SMS_CODE+phone,new Gson().toJson(code));
            RedisShardedPoolUtils.setEx(RedisKeyConstant.SMS_CODE+phone,code,3000);
        }
        return ServerResponse.createBySuccessMsg(response, request);
    }
src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
@@ -6,10 +6,7 @@
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nq.common.ServerResponse;
import com.nq.dao.StockMapper;
import com.nq.dao.StockSubscribeMapper;
import com.nq.dao.UserMapper;
import com.nq.dao.UserStockSubscribeMapper;
import com.nq.dao.*;
import com.nq.enums.EStockType;
import com.nq.enums.EUserAssets;
import com.nq.pojo.*;
@@ -48,7 +45,8 @@
    @Resource
    UserMapper userMapper;
    @Resource
    AgentUserMapper agentUserMapper;
    @Autowired
    ISiteMessageService iSiteMessageService;
    @Autowired
src/main/java/com/nq/vo/stock/StockVO.java
@@ -59,6 +59,6 @@
    private Integer depositAmt;
    private String price;
}
src/main/resources/application.properties
@@ -5,11 +5,11 @@
#2.    ??ifconfig????vsftpd?????
#3.    ???? ftp://??
ftp.server.ip=45.204.85.67
ftp.server.ip=154.19.164.71:21
ftp.user=ftp_stock
ftp.pass=123456
ftp.address =/www/wwwroot/ftp_stock/
ftp.server.http.prefix=https://img.3falcon.com/
ftp.server.http.prefix=https://img.barcblays.cyou/
redis1.ip=localhost
src/main/resources/application.yml
@@ -118,7 +118,7 @@
      # 最小连接池数量
      minIdle: 10
      # 最大连接池数量
      maxActive: 20
      maxActive: 50
      # 配置获取连接等待超时的时间
      maxWait: 60000
      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
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>
src/main/resources/mapper/UserMapper.xml
@@ -72,6 +72,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())
target/classes/application.properties
@@ -5,11 +5,11 @@
#2.    ??ifconfig????vsftpd?????
#3.    ???? ftp://??
ftp.server.ip=45.204.85.67
ftp.server.ip=154.19.164.71:21
ftp.user=ftp_stock
ftp.pass=123456
ftp.address =/www/wwwroot/ftp_stock/
ftp.server.http.prefix=https://img.3falcon.com/
ftp.server.http.prefix=https://img.barcblays.cyou/
redis1.ip=localhost
target/classes/application.yml
@@ -118,7 +118,7 @@
      # 最小连接池数量
      minIdle: 10
      # 最大连接池数量
      maxActive: 20
      maxActive: 50
      # 配置获取连接等待超时的时间
      maxWait: 60000
      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
target/classes/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>
target/classes/mapper/UserMapper.xml
@@ -72,6 +72,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())