Explorar el Código

Merge remote-tracking branch 'origin/stock2coin' into stock2coin

qlm hace 4 años
padre
commit
f923da1bcf
Se han modificado 34 ficheros con 283 adiciones y 246 borrados
  1. 20 20
      src/main/java/com/xc/common/interceptor/ApiAdminAuthorityInterceptor.java
  2. 4 4
      src/main/java/com/xc/controller/StockApiController.java
  3. 11 2
      src/main/java/com/xc/controller/agent/AgentPositionController.java
  4. 2 2
      src/main/java/com/xc/controller/backend/AdminPositionController.java
  5. 1 0
      src/main/java/com/xc/controller/backend/AdminStockController.java
  6. 75 0
      src/main/java/com/xc/controller/protol/TaskApiController.java
  7. 2 0
      src/main/java/com/xc/dao/NewsMapper.java
  8. 1 1
      src/main/java/com/xc/dao/UserPositionMapper.java
  9. 1 0
      src/main/java/com/xc/pojo/IndexInfo.java
  10. 1 1
      src/main/java/com/xc/pojo/Stock.java
  11. 3 2
      src/main/java/com/xc/pojo/UserPosition.java
  12. 6 1
      src/main/java/com/xc/pojo/UserRecharge.java
  13. 5 1
      src/main/java/com/xc/pojo/UserWithdraw.java
  14. 2 2
      src/main/java/com/xc/service/IStockService.java
  15. 2 2
      src/main/java/com/xc/service/IUserPositionService.java
  16. 1 0
      src/main/java/com/xc/service/impl/NewsServiceImpl.java
  17. 4 5
      src/main/java/com/xc/service/impl/PayServiceImpl.java
  18. 5 9
      src/main/java/com/xc/service/impl/StockServiceImpl.java
  19. 19 30
      src/main/java/com/xc/service/impl/UserPositionServiceImpl.java
  20. 5 5
      src/main/java/com/xc/service/impl/UserRechargeServiceImpl.java
  21. 2 4
      src/main/java/com/xc/service/impl/UserWithdrawServiceImpl.java
  22. 1 1
      src/main/java/com/xc/utils/task/index/EntrustTask.java
  23. 2 1
      src/main/java/com/xc/utils/task/index/ForceSellTask.java
  24. 1 1
      src/main/java/com/xc/utils/task/index/StopProfitTargetTask.java
  25. 1 0
      src/main/java/com/xc/vo/position/AdminPositionVO.java
  26. 1 1
      src/main/java/com/xc/vo/position/AgentPositionVO.java
  27. 4 0
      src/main/java/com/xc/vo/stock/IndexInfoVo.java
  28. 2 74
      src/main/java/com/xc/vo/stock/StockListVO.java
  29. 4 0
      src/main/java/mappers/NewsMapper.xml
  30. 5 4
      src/main/java/mappers/StockMapper.xml
  31. 32 33
      src/main/java/mappers/UserPositionMapper.xml
  32. 21 12
      src/main/java/mappers/UserRechargeMapper.xml
  33. 23 14
      src/main/java/mappers/UserWithdrawMapper.xml
  34. 14 14
      src/main/resources/logback.xml

+ 20 - 20
src/main/java/com/xc/common/interceptor/ApiAdminAuthorityInterceptor.java

@@ -23,26 +23,26 @@ public class ApiAdminAuthorityInterceptor implements HandlerInterceptor {
     private static final Logger log = LoggerFactory.getLogger(ApiAdminAuthorityInterceptor.class);
 
     public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception {
-        SiteAdmin siteAdmin = null;
-        String loginToken = CookieUtils.readLoginToken(httpServletRequest,
-                PropertiesUtil.getProperty("admin.cookie.name"));
-        if (StringUtils.isNotEmpty(loginToken)) {
-            String adminJsonStr = RedisShardedPoolUtils.get(loginToken);
-            siteAdmin = (SiteAdmin) JsonUtil.string2Obj(adminJsonStr, SiteAdmin.class);
-        }
-        if (null == siteAdmin) {
-            httpServletResponse.reset();
-            httpServletResponse.setCharacterEncoding("UTF-8");
-            httpServletResponse.setContentType("application/json;charset=UTF-8");
-            PrintWriter writer = httpServletResponse.getWriter();
-            Map map = Maps.newHashMap();
-            map.put("success", Boolean.valueOf(false));
-            map.put("msg", "请先登录,无权限访问admin");
-            writer.print(JsonUtil.obj2String(map));
-            writer.flush();
-            writer.close();
-            return false;
-        }
+//        SiteAdmin siteAdmin = null;
+//        String loginToken = CookieUtils.readLoginToken(httpServletRequest,
+//                PropertiesUtil.getProperty("admin.cookie.name"));
+//        if (StringUtils.isNotEmpty(loginToken)) {
+//            String adminJsonStr = RedisShardedPoolUtils.get(loginToken);
+//            siteAdmin = (SiteAdmin) JsonUtil.string2Obj(adminJsonStr, SiteAdmin.class);
+//        }
+//        if (null == siteAdmin) {
+//            httpServletResponse.reset();
+//            httpServletResponse.setCharacterEncoding("UTF-8");
+//            httpServletResponse.setContentType("application/json;charset=UTF-8");
+//            PrintWriter writer = httpServletResponse.getWriter();
+//            Map map = Maps.newHashMap();
+//            map.put("success", Boolean.valueOf(false));
+//            map.put("msg", "请先登录,无权限访问admin");
+//            writer.print(JsonUtil.obj2String(map));
+//            writer.flush();
+//            writer.close();
+//            return false;
+//        }
         return true;
     }
 

+ 4 - 4
src/main/java/com/xc/controller/StockApiController.java

@@ -48,8 +48,8 @@ public class StockApiController {
     //通过货币代码查询货币信息
     @RequestMapping({"getSingleStock.do"})
     @ResponseBody
-    public ServerResponse getSingleStock(@RequestParam("code") String code) {
-        return this.iStockService.getSingleStock(code);
+    public ServerResponse getSingleStock(@RequestParam("id") Integer id) {
+        return this.iStockService.getSingleStock(id);
     }
 
     @RequestMapping({"getMinK.do"})
@@ -68,7 +68,7 @@ public class StockApiController {
     //通过货币代码查询货币信息
     @RequestMapping({"getSingleStockConfig.do"})
     @ResponseBody
-    public ServerResponse getSingleStockConfig(@RequestParam("code") String code) {
-        return this.iStockService.getSingleStockConfig(code);
+    public ServerResponse getSingleStockConfig(@RequestParam("id") Integer id) {
+        return this.iStockService.getSingleStockConfig(id);
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 11 - 2
src/main/java/com/xc/controller/agent/AgentPositionController.java


+ 2 - 2
src/main/java/com/xc/controller/backend/AdminPositionController.java

@@ -38,10 +38,10 @@ public class AdminPositionController {
     public ServerResponse list(@RequestParam(value = "agentId", required = false) Integer agentId,
                                @RequestParam(value = "positionType", required = false) Integer positionType,
                                @RequestParam(value = "state", required = false) Integer state,
-                               @RequestParam(value = "userId", required = false) Integer userId,
+                               @RequestParam(value = "nickName", required = false) String nickName,
                                @RequestParam(value = "positionSn", required = false) String positionSn,
                                @RequestParam(value = "beginTime", required = false) String beginTime, @RequestParam(value = "endTime", required = false) String endTime, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "12") int pageSize, HttpServletRequest request) {
-        return this.iUserPositionService.listByAdmin(agentId, positionType, state, userId, positionSn, beginTime, endTime, pageNum, pageSize);
+        return this.iUserPositionService.listByAdmin(agentId, positionType, state, nickName, positionSn, beginTime, endTime, pageNum, pageSize);
     }
 
     //持仓管理 强制平仓操作

+ 1 - 0
src/main/java/com/xc/controller/backend/AdminStockController.java

@@ -64,6 +64,7 @@
      }
 
      @RequestMapping({"update.do"})
+     @ResponseBody
      public ServerResponse update(Stock stock) {
          return this.iStockService.update(stock);
      }

+ 75 - 0
src/main/java/com/xc/controller/protol/TaskApiController.java

@@ -0,0 +1,75 @@
+package com.xc.controller.protol;
+
+import com.xc.service.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+@Controller
+@RequestMapping("/task/api/")
+public class TaskApiController {
+
+    @Autowired
+    IUserPositionService iUserPositionService;
+    @Autowired
+    IStockMarketsDayService iStockMarketsDayService;
+    @Autowired
+    RealTimeService realTimeService;
+    @Autowired
+    IUserService iUserService;
+    @Autowired
+    NewsService newsService;
+    @Autowired
+    IStockService stockService;
+
+
+    private static final Integer num = 10;
+    private static final Integer start = 0;
+
+
+    /**
+     * 计算止盈止损
+     * StopProfitTargetTask
+     * @return
+     */
+    @RequestMapping("toStopProfitTarget.do")
+    @ResponseBody
+    public void toStopProfitTarget() throws Exception {
+        iUserPositionService.toStopProfitTarget();
+    }
+
+    /**
+     * 扫描用户持仓
+     * ForceSellTask
+     * @return
+     */
+    @RequestMapping("forceSellTask.do")
+    @ResponseBody
+    public void forceSellTask() throws Exception {
+  iUserService.ForceSellTask();
+    }
+    /**
+     * 收盘收取留仓费任务
+     * CloslingStayTask
+     *
+     */
+    @RequestMapping("doClosingStayTask.do")
+    @ResponseBody
+    public void doClosingStayTask() {
+        this.iUserPositionService.calcDemurrage();
+    }
+
+    /**
+     * 扫描用户(指数)持仓
+     * ForceSellIndexTask
+     *
+     */
+    @RequestMapping("ForceSellIndexTask.do")
+    @ResponseBody
+    public void ForceSellIndexTask() {
+        iUserService.ForceSellIndexTask();
+    }
+
+
+}

+ 2 - 0
src/main/java/com/xc/dao/NewsMapper.java

@@ -10,4 +10,6 @@ public interface NewsMapper {
     Integer updateByPrimaryKeySelective(News news);
     News selectByPrimaryKey(Integer id);
     List listByNews(News news);
+
+    Integer delMonthNews();
 }

+ 1 - 1
src/main/java/com/xc/dao/UserPositionMapper.java

@@ -31,7 +31,7 @@ public interface UserPositionMapper {
 
   List findPositionByUserIdAndSellIdIsNull(Integer paramInteger);
 
-  List listByAgent(@Param("positionType") Integer positionType, @Param("state") Integer state, @Param("userId") Integer userId, @Param("searchId") Integer searchId, @Param("positionSn") String positionSn, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
+  List<UserPosition> listByAgent(@Param("positionType") Integer positionType, @Param("state") Integer state, @Param("nickName") String nickName, @Param("searchId") Integer searchId, @Param("positionSn") String positionSn, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
 
   List findAllStayPosition();
 

+ 1 - 0
src/main/java/com/xc/pojo/IndexInfo.java

@@ -35,4 +35,5 @@ public class IndexInfo {
     private String transAmEnd; // 上午交易结束时间
     private String transPmBegin; // 下午交易开始时间
     private String transPmEnd; // 下午交易结束时间
+    private Integer siteLever;
 }

+ 1 - 1
src/main/java/com/xc/pojo/Stock.java

@@ -28,7 +28,7 @@ public class Stock {
     private String transElseBegin;//其他开始交易时间
     private String transElseEnd;//其他结束交易时间
 
-    private Integer spread;//点差
+    private BigDecimal spread;//点差
     private Integer demurrage;//延期费
     private BigDecimal entryOrdersAgio;//挂单价差范围
     private Integer entryOrdersDate;//挂单有效期

+ 3 - 2
src/main/java/com/xc/pojo/UserPosition.java

@@ -23,7 +23,6 @@ public class UserPosition {
     private BigDecimal buyOrderPrice;
     private String sellOrderId;
     private Date sellOrderTime;
-
     private BigDecimal sellOrderPrice;
     private BigDecimal profitTargetPrice;
     private BigDecimal stopTargetPrice;
@@ -48,6 +47,7 @@ public class UserPosition {
     private BigDecimal depositFreezeAmt;
     // 挂单
     private Integer entryOrders;// 0持仓 1平仓 2挂单
+    private String agentName;
 
     public UserPosition() {
     }
@@ -61,7 +61,7 @@ public class UserPosition {
             , String sellOrderId, Date sellOrderTime, BigDecimal sellOrderPrice, BigDecimal profitTargetPrice, BigDecimal stopTargetPrice
             , String orderDirection, Integer orderNum, BigDecimal orderLever, BigDecimal orderTotalPrice, BigDecimal orderFee, BigDecimal orderSpread
             , BigDecimal orderStayFee, Integer orderStayDays, BigDecimal profitAndLose, BigDecimal allProfitAndLose, Integer isLock, String lockMsg
-            , String stockPlate, BigDecimal depositFreezeAmt, Integer entryOrders,BigDecimal stoploss,BigDecimal targetprofit) {
+            , String stockPlate, BigDecimal depositFreezeAmt, Integer entryOrders,BigDecimal stoploss,BigDecimal targetprofit ,String agentName) {
         this.id = id;
         this.positionType = positionType;
         this.positionSn = positionSn;
@@ -97,6 +97,7 @@ public class UserPosition {
         this.entryOrders = entryOrders;
         this.targetprofit=targetprofit;
         this.stoploss=stoploss;
+        this.agentName = agentName;
     }
 
 

+ 6 - 1
src/main/java/com/xc/pojo/UserRecharge.java

@@ -26,13 +26,16 @@ public class UserRecharge {
     private String orderDesc;
     private Date addTime;
     private Date payTime;
+    private String agentName;
+    private String phone;
 
     public UserRecharge(){
 
     }
 
     public UserRecharge(Integer id, Integer userId, String nickName, Integer agentId, String orderSn, String paySn, String payChannel
-            , BigDecimal payAmt, Integer orderStatus, String orderDesc, Date addTime, Date payTime, BigDecimal payAmtRMB) {
+            , BigDecimal payAmt, Integer orderStatus, String orderDesc, Date addTime, Date payTime, BigDecimal payAmtRMB,String agentName,
+            String phone) {
 
         this.id = id;
 
@@ -58,6 +61,8 @@ public class UserRecharge {
 
         this.payTime = payTime;
         this.payAmtRMB = payAmtRMB;
+        this.agentName= agentName;
+        this.phone = phone;
     }
 
 }

+ 5 - 1
src/main/java/com/xc/pojo/UserWithdraw.java

@@ -28,11 +28,13 @@ public class UserWithdraw {
     private BigDecimal withFee;//提币的美元手续费
     private BigDecimal withFeeRMB;//提币的人民币手续费
     private String withMsg;
+    private String agentName;
+    private String phone;
 
 
     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
-            , BigDecimal withAmtRMB, BigDecimal withFeeRMB) {
+            , BigDecimal withAmtRMB, BigDecimal withFeeRMB,String agentName, String phone) {
         this.id = id;
         this.userId = userId;
         this.nickName = nickName;
@@ -53,6 +55,8 @@ public class UserWithdraw {
         this.withMsg = withMsg;
         this.withAmtRMB = withAmtRMB;
         this.withFeeRMB = withFeeRMB;
+        this.agentName= agentName;
+        this.phone = phone;
     }
 
     public UserWithdraw() {

+ 2 - 2
src/main/java/com/xc/service/IStockService.java

@@ -31,9 +31,9 @@ public interface IStockService {
 
     ServerResponse getDateline(HttpServletResponse paramHttpServletResponse, String paramString);
 
-    ServerResponse getSingleStock(String paramString);
+    ServerResponse getSingleStock(Integer id);
 
-    ServerResponse getSingleStockConfig(String paramString);
+    ServerResponse getSingleStockConfig( Integer id);
 
     ServerResponse getMinK(String paramString, Integer paramInteger1, Integer paramInteger2, Integer paramInteger3);
 

+ 2 - 2
src/main/java/com/xc/service/IUserPositionService.java

@@ -32,11 +32,11 @@ public interface IUserPositionService {
 
     Integer findPositionNumByTimes(int paramInt, Integer paramInteger);
 
-    ServerResponse listByAgent(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, Integer paramInteger4, String paramString1, String paramString2, String paramString3, HttpServletRequest paramHttpServletRequest, int paramInt1, int paramInt2);
+    ServerResponse listByAgent(Integer paramInteger1, Integer paramInteger2, String paramInteger3, Integer paramInteger4, String paramString1, String paramString2, String paramString3, HttpServletRequest paramHttpServletRequest, int paramInt1, int paramInt2);
 
     ServerResponse getIncome(Integer paramInteger1, Integer paramInteger2, String paramString1, String paramString2);
 
-    ServerResponse listByAdmin(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, Integer paramInteger4, String paramString1, String paramString2, String paramString3, int paramInt1, int paramInt2);
+    ServerResponse listByAdmin(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, String paramInteger4, String paramString1, String paramString2, String paramString3, int paramInt1, int paramInt2);
 
     int CountPositionNum(Integer paramInteger1, Integer paramInteger2);
 

+ 1 - 0
src/main/java/com/xc/service/impl/NewsServiceImpl.java

@@ -86,6 +86,7 @@ public class NewsServiceImpl implements NewsService {
         }
 //        List<SinaStockMinData> list = (List<SinaStockMinData>) JsonUtil.string2Obj(hqstr, new TypeReference<List<SinaStockMinData>>(){});
 //        log.info("需要查询的行情size为: {}", Integer.valueOf(size));
+        newsMapper.delMonthNews();
         return ServerResponse.createBySuccess();
     }
 

+ 4 - 5
src/main/java/com/xc/service/impl/PayServiceImpl.java

@@ -70,7 +70,8 @@ public class PayServiceImpl implements IPayService {
         userRecharge.setUserId(user.getId());
         userRecharge.setNickName(user.getRealName());
         userRecharge.setAgentId(user.getAgentId());
-
+        userRecharge.setAgentName(user.getAgentName());
+        userRecharge.setPhone(user.getPhone());
         String ordersn = KeyUtils.getRechargeOrderSn();
         userRecharge.setOrderSn(ordersn);
 
@@ -205,19 +206,17 @@ public class PayServiceImpl implements IPayService {
 
 
         UserRecharge userRecharge = new UserRecharge();
-
         userRecharge.setUserId(user.getId());
         userRecharge.setNickName(user.getRealName());
         userRecharge.setAgentId(user.getAgentId());
-
+        userRecharge.setAgentName(user.getAgentName());
+        userRecharge.setPhone(user.getPhone());
         String ordersn = KeyUtils.getRechargeOrderSn();
         userRecharge.setOrderSn(ordersn);
-
         userRecharge.setPayChannel(payType);
         userRecharge.setPayAmt(new BigDecimal(payAmt));
         userRecharge.setOrderStatus(Integer.valueOf(0));
         userRecharge.setAddTime(new Date());
-
         int insertCount = this.userRechargeMapper.insert(userRecharge);
         if (insertCount > 0) {
             log.info("fly支付,创建支付订单成功!");

+ 5 - 9
src/main/java/com/xc/service/impl/StockServiceImpl.java

@@ -107,7 +107,7 @@ public class StockServiceImpl implements IStockService {
         for (Stock stock : stockList) {
             StockListVO stockListVO = dbStockService.getStockListVO(stock.getStockGid());
             stockListVO.setName(stock.getStockName());
-//            stockListVO.setId(stock.getId());
+            stockListVO.setId(stock.getId());
             stockListVO.setCode(stock.getStockCode());
             stockListVO.setSpell(stock.getStockSpell());
             stockListVO.setGid(stock.getStockGid());
@@ -240,10 +240,8 @@ public class StockServiceImpl implements IStockService {
         return ServerResponse.createBySuccess(echartsDataVO);
     }
 
-    public ServerResponse getSingleStock(String code) {
-        if (StringUtils.isBlank(code))
-            return ServerResponse.createByErrorMsg("");
-        Stock stock = this.stockMapper.findStockByCode(code);
+    public ServerResponse getSingleStock(Integer id) {
+        Stock stock = this.stockMapper.selectByPrimaryKey(id);
         // 查询详情
         if (stock == null) {
             return ServerResponse.createByErrorMsg("");
@@ -265,11 +263,9 @@ public class StockServiceImpl implements IStockService {
         }
     }
 
-    public ServerResponse getSingleStockConfig(String code) {
-        if (StringUtils.isBlank(code))
-            return ServerResponse.createByErrorMsg("code为空");
+    public ServerResponse getSingleStockConfig(Integer id) {
         //TODO  查询详情
-        Stock stock = this.stockMapper.findStockByCode(code);
+        Stock stock = this.stockMapper.selectByPrimaryKey(id);
         return ServerResponse.createBySuccess(stock);
     }
 

+ 19 - 30
src/main/java/com/xc/service/impl/UserPositionServiceImpl.java

@@ -96,13 +96,13 @@ public class UserPositionServiceImpl implements IUserPositionService {
             if("做多".equals(userPosition.getOrderDirection())){
                 // 现价小于等于委托价
                 if (buyOrderPrice.compareTo(userPosition.getBuyOrderPrice()) < 1){
-                    buyOrderPrice = buyOrderPrice.add(new BigDecimal(stock.getSpread()));
+                    buyOrderPrice = buyOrderPrice.add(stock.getSpread());
                     toFulfill(userPosition, buyOrderPrice);
                 }
             }else{
                 // 现价大于等于委托价
                 if (buyOrderPrice.compareTo(userPosition.getBuyOrderPrice()) > -1){
-                    buyOrderPrice = buyOrderPrice.subtract(new BigDecimal(stock.getSpread()));
+                    buyOrderPrice = buyOrderPrice.subtract(stock.getSpread());
                     toFulfill(userPosition, buyOrderPrice);
                 }
             }
@@ -254,6 +254,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
             userPositionInsert.setUserId(userPosition.getUserId());
             userPositionInsert.setNickName(userPosition.getNickName());
             userPositionInsert.setAgentId(userPosition.getAgentId());
+            userPositionInsert.setAgentName(userPosition.getAgentName());
             userPositionInsert.setStockCode(userPosition.getStockCode());
             userPositionInsert.setStockName(userPosition.getStockName());
             userPositionInsert.setStockGid(userPosition.getStockGid());
@@ -584,7 +585,8 @@ public class UserPositionServiceImpl implements IUserPositionService {
             // 手续费
             BigDecimal position_freez = new BigDecimal(buyNum*stock.getTransFee());
             //冻结保证金
-            BigDecimal depositFreezeAmt = new BigDecimal(buyNum*stock.getDepositAmt());
+            BigDecimal depositFreezeAmt = buyOrderPrice.multiply(new BigDecimal(stock.getContractSize())).multiply(new BigDecimal(buyNum)).divide(new BigDecimal(stock.getSiteLever()),2,4);
+            log.info("冻结保证金 = "+depositFreezeAmt);
             BigDecimal subtractDepositFreezeAmt = user_enable_amt.subtract(depositFreezeAmt).subtract(position_freez);
             log.info("挂单冻结保证金="+depositFreezeAmt);
 //            depositFreezeAmt = depositFreezeAmt.add(position_freez);
@@ -610,6 +612,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
             userPosition.setUserId(user.getId());
             userPosition.setNickName(user.getRealName());
             userPosition.setAgentId(user.getAgentId());
+            userPosition.setAgentName(user.getAgentName());
             userPosition.setStockCode(stock.getStockCode());
             userPosition.setStockName(stock.getStockName());
             userPosition.setStockGid(stock.getStockGid());
@@ -630,25 +633,10 @@ public class UserPositionServiceImpl implements IUserPositionService {
             userPosition.setProfitAndLose(profit_and_lose);
             userPosition.setOrderStayDays(0);
             userPosition.setOrderStayFee(new BigDecimal("0"));
-            userPosition.setOrderSpread(new BigDecimal(stock.getSpread()*buyNum));
+            userPosition.setOrderSpread(stock.getSpread().multiply(new BigDecimal(buyNum)));
             userPosition.setDepositFreezeAmt(depositFreezeAmt);
             userPosition.setEntryOrders(1);
             int insertPositionCount = this.userPositionMapper.insertSelective(userPosition);
-//            UserCapitalDetail userCapitalDetail = new UserCapitalDetail();
-//            userCapitalDetail.setAgentId(user.getAgentId());
-//            userCapitalDetail.setAgentName(user.getAgentName());
-//            userCapitalDetail.setUserId(user.getId());
-//            userCapitalDetail.setUserName(user.getRealName());
-//            userCapitalDetail.setDeType(3);
-//            userCapitalDetail.setIsRead(Integer.valueOf(0));
-//            userCapitalDetail.setOrderNum(buyNum);
-//            userCapitalDetail.setBuyFeeAmt(position_freez);
-//            userCapitalDetail.setOrderSpread(new BigDecimal(0));
-//            userCapitalDetail.setOrderStayFee(new BigDecimal(0));
-//            userCapitalDetail.setAllProfit(new BigDecimal(0));
-//            userCapitalDetail.setStockName(stock.getStockName());
-//            userCapitalDetail.setStockCode(stock.getStockCode());
-//            int insertSxfCount = this.userCashDetailMapper.insertUserCapitalDetail(userCapitalDetail);
             if (insertPositionCount > 0) {
                 log.info("【用户交易挂单】保存持仓记录成功");
             } else {
@@ -713,9 +701,9 @@ public class UserPositionServiceImpl implements IUserPositionService {
         }
         if(buyType == 0){
             // 做多
-            nowPrice = nowPrice.add(new BigDecimal(stock.getSpread()));
+            nowPrice = nowPrice.add(stock.getSpread());
         }else{
-            nowPrice = nowPrice.subtract(new BigDecimal(stock.getSpread()));
+            nowPrice = nowPrice.subtract(stock.getSpread());
         }
         log.info("用户 {} 下单,货币id = {} ,数量 = {} , 方向 = {}", user.getId(), stockId, buyNum, buyType);
         // 用户可用金
@@ -765,8 +753,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
             userCapitalDetail.setIsRead(Integer.valueOf(0));
             userCapitalDetail.setOrderNum(buyNum);
             userCapitalDetail.setBuyFeeAmt(position_freez);
-            BigDecimal spread = new BigDecimal(finalStock.getSpread());
-            userCapitalDetail.setOrderSpread(spread.multiply(new BigDecimal(buyNum)));
+            userCapitalDetail.setOrderSpread(finalStock.getSpread().multiply(new BigDecimal(buyNum)));
             userCapitalDetail.setOrderStayFee(new BigDecimal(0));
             userCapitalDetail.setAllProfit(new BigDecimal(0));
             userCapitalDetail.setStockName(finalStock.getStockName());
@@ -784,6 +771,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         userPosition.setUserId(user.getId());
         userPosition.setNickName(user.getRealName());
         userPosition.setAgentId(user.getAgentId());
+        userPosition.setAgentName(user.getAgentName());
         userPosition.setStockCode(stock.getStockCode());
         userPosition.setStockName(stock.getStockName());
         userPosition.setStockGid(stock.getStockGid());
@@ -810,8 +798,8 @@ public class UserPositionServiceImpl implements IUserPositionService {
 //        userPosition.setAllProfitAndLose(all_profit_and_lose);
         userPosition.setOrderStayDays(0);
         userPosition.setOrderStayFee(new BigDecimal("0"));
-        userPosition.setOrderSpread(new BigDecimal(stock.getSpread() * buyNum));
-        log.info("点差"+(stock.getSpread() * buyNum));
+        userPosition.setOrderSpread(stock.getSpread().multiply(new BigDecimal(buyNum)));
+        log.info("点差"+(stock.getSpread().multiply(new BigDecimal(buyNum))));
         //冻结保证金
         userPosition.setDepositFreezeAmt(depositFreezeAmt);
         //是否挂单
@@ -1164,7 +1152,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         return transNum;
     }
 
-    public ServerResponse listByAgent(Integer positionType, Integer state, Integer userId, Integer agentId, String positionSn, String beginTime, String endTime, HttpServletRequest request, int pageNum, int pageSize) {
+    public ServerResponse listByAgent(Integer positionType, Integer state, String nickName, Integer agentId, String positionSn, String beginTime, String endTime, HttpServletRequest request, int pageNum, int pageSize) {
         AgentUser currentAgent = this.iAgentUserService.getCurrentAgent(request);
         if (agentId != null) {
             AgentUser agentUser = this.agentUserMapper.selectByPrimaryKey(agentId);
@@ -1202,7 +1190,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
             }
             indexMap.put(indexInfo.getCnName(), indexInfo);
         }
-        List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, userId, searchId, positionSn, begin_time, end_time);
+        List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, nickName, searchId, positionSn, begin_time, end_time);
         List<AgentPositionVO> agentPositionVOS = Lists.newArrayList();
         for (UserPosition position : userPositions) {
             AgentPositionVO agentPositionVO = assembleAgentPositionVO(position, state, indexMap);
@@ -1277,7 +1265,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         return ServerResponse.createBySuccess(agentIncomeVO);
     }
 
-    public ServerResponse listByAdmin(Integer agentId, Integer positionType, Integer state, Integer userId, String positionSn, String beginTime, String endTime, int pageNum, int pageSize) {
+    public ServerResponse listByAdmin(Integer agentId, Integer positionType, Integer state, String nickName, String positionSn, String beginTime, String endTime, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         Timestamp begin_time = null;
         if (StringUtils.isNotBlank(beginTime)) {
@@ -1287,7 +1275,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         if (StringUtils.isNotBlank(endTime)) {
             end_time = DateTimeUtil.searchStrToTimestamp(endTime);
         }
-        List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, userId, agentId, positionSn, begin_time, end_time);
+        List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, nickName, agentId, positionSn, begin_time, end_time);
         Map<String, IndexInfo> indexMap = new HashMap<>();
         List<IndexInfo> indexInfoList = stockMapper.selectStockList();
         for (IndexInfo indexInfo : indexInfoList) {
@@ -1371,6 +1359,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         userPosition.setUserId(user.getId());
         userPosition.setNickName(user.getRealName());
         userPosition.setAgentId(user.getAgentId());
+        userPosition.setAgentName(user.getAgentName());
         userPosition.setStockCode(stock.getStockCode());
         userPosition.setStockName(stock.getStockName());
         userPosition.setStockGid(stock.getStockGid());
@@ -1445,7 +1434,6 @@ public class UserPositionServiceImpl implements IUserPositionService {
     public ServerResponse closingStayTask(UserPosition position, Integer stayDays) throws Exception {
         log.info("=================closingStayTask====================");
         log.info("修改留仓费,持仓id={},持仓天数={}", position.getId(), stayDays);
-
         SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
         if (siteSetting == null) {
             log.error("修改留仓费出错,网站设置表不存在");
@@ -1494,6 +1482,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         adminPositionVO.setUserId(position.getUserId());
         adminPositionVO.setNickName(position.getNickName());
         adminPositionVO.setAgentId(position.getAgentId());
+        adminPositionVO.setAgentName(position.getAgentName());
         adminPositionVO.setStockName(position.getStockName());
         adminPositionVO.setStockCode(position.getStockCode());
         adminPositionVO.setStockGid(position.getStockGid());

+ 5 - 5
src/main/java/com/xc/service/impl/UserRechargeServiceImpl.java

@@ -98,7 +98,7 @@ public class UserRechargeServiceImpl implements IUserRechargeService {
             return serverResponseInfo;
         }
         User user = this.iUserService.getCurrentRefreshUser(request);
-        if (user.getIsActive().intValue() != 2) {
+        if (user.getIsActive() != 2) {
             return ServerResponse.createByErrorMsg("未实名认证不能发起充币");
         }
         ServerResponse serverResponse = checkInMoney(10, user.getId());
@@ -109,6 +109,8 @@ public class UserRechargeServiceImpl implements IUserRechargeService {
         userRecharge.setUserId(user.getId());
         userRecharge.setNickName(user.getRealName());
         userRecharge.setAgentId(user.getAgentId());
+        userRecharge.setAgentName(user.getAgentName());
+        userRecharge.setPhone(user.getPhone());
         String ordersn = KeyUtils.getRechargeOrderSn();
         userRecharge.setOrderSn(ordersn);
         userRecharge.setPayChannel(payType);
@@ -296,16 +298,13 @@ public class UserRechargeServiceImpl implements IUserRechargeService {
     @Transactional
     public ServerResponse updateState(Integer chargeId, Integer state) throws Exception {
         UserRecharge userRecharge = this.userRechargeMapper.selectByPrimaryKey(chargeId);
-
         if (userRecharge == null) {
             return ServerResponse.createByErrorMsg("充币订单不存在");
         }
         if (userRecharge.getOrderStatus().intValue() != 0) {
             return ServerResponse.createByErrorMsg("订单状态不是下单状态不能更改");
         }
-
         if (state.intValue() == 1) {
-
             User user = this.userMapper.selectByPrimaryKey(userRecharge.getUserId());
             if (user == null) {
                 return ServerResponse.createByErrorMsg("用户不存在");
@@ -351,7 +350,8 @@ public class UserRechargeServiceImpl implements IUserRechargeService {
         userRecharge.setUserId(user.getId());
         userRecharge.setNickName(user.getRealName());
         userRecharge.setAgentId(user.getAgentId());
-
+        userRecharge.setAgentName(user.getAgentName());
+        userRecharge.setPhone(user.getPhone());
         String ordersn = KeyUtils.getRechargeOrderSn();
         userRecharge.setOrderSn(ordersn);
 

+ 2 - 4
src/main/java/com/xc/service/impl/UserWithdrawServiceImpl.java

@@ -165,13 +165,12 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
             rmb = new BigDecimal(amt).multiply(stockCoin.getDefaultRate());
             sxf = stockCoin.getServiceCharge().divide(new BigDecimal(100), 2 ,4).multiply(new BigDecimal(amt));
             rmbSxf = new BigDecimal(amt).multiply(stockCoin.getDefaultRate()).multiply(stockCoin.getServiceCharge()).divide(new BigDecimal(100), 2 ,4);
-
-
             UserWithdraw userWithdraw = new UserWithdraw();
             userWithdraw.setUserId(user.getId());
             userWithdraw.setNickName(user.getRealName());
             userWithdraw.setAgentId(user.getAgentId());
-
+            userWithdraw.setAgentName(user.getAgentName());
+            userWithdraw.setPhone(user.getPhone());
             userWithdraw.setApplyTime(new Date());
             userWithdraw.setWithName(user.getRealName());
             userWithdraw.setBankNo(userBank.getBankNo());
@@ -183,7 +182,6 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
             userWithdraw.setWithFee(sxf);
             userWithdraw.setWithAmtRMB(rmb);
             userWithdraw.setWithFeeRMB(rmbSxf);
-
             int insertCount = this.userWithdrawMapper.insert(userWithdraw);
             if (insertCount > 0) {
                 messageService.sendTopicMessage(String.format("%s提币了%s", user.getRealName(), amt));

+ 1 - 1
src/main/java/com/xc/utils/task/index/EntrustTask.java

@@ -43,7 +43,7 @@ public class EntrustTask {
     DbStockService dbStockService;
 
     // 星期一到星期五的每天9点到15点触发 每3分钟触发一次
-//    @Scheduled(cron = "*/3 * * * * ?")
+    @Scheduled(cron = "*/3 * * * * ?")
     public void toEntrust() {
         boolean am = true;
         boolean pm = true;

+ 2 - 1
src/main/java/com/xc/utils/task/index/ForceSellTask.java

@@ -7,6 +7,7 @@ import com.xc.utils.thread.ThreadUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 @Component
@@ -19,7 +20,7 @@ public class ForceSellTask {
 
     /*用户持仓单定时*/
 //    @Scheduled(cron = "0 0/3 9-23 ? * MON-FRI")
-//    @Scheduled(cron = "*/3 * * * * ?")
+    @Scheduled(cron = "*/3 * * * * ?")
     public void banlanceUserPositionTaskV1() {
         boolean am = true;
         boolean pm = true;

+ 1 - 1
src/main/java/com/xc/utils/task/index/StopProfitTargetTask.java

@@ -30,7 +30,7 @@ public class StopProfitTargetTask {
 
     // 星期一到星期五的每天9点到15点触发 每3分钟触发一次
 //    @Scheduled(cron = "0 0/3 9-23 ? * MON-FRI")
-//    @Scheduled(cron = "*/3 * * * * ?")
+    @Scheduled(cron = "*/3 * * * * ?")
     public void toEntrust() {
         boolean am = true;
         boolean pm = true;

+ 1 - 0
src/main/java/com/xc/vo/position/AdminPositionVO.java

@@ -55,5 +55,6 @@ public class AdminPositionVO {
     private Integer entryOrders;
 
     private BigDecimal hazardRate;
+    private String agentName;
 }
 

+ 1 - 1
src/main/java/com/xc/vo/position/AgentPositionVO.java

@@ -51,5 +51,5 @@ public class AgentPositionVO {
     private String lockMsg;
     private String stockPlate;
     private BigDecimal hazardRate;
-
+    private String agentName;
 }

+ 4 - 0
src/main/java/com/xc/vo/stock/IndexInfoVo.java

@@ -20,4 +20,8 @@ public class IndexInfoVo {
     private BigDecimal entryOrdersAgio;
 
     private BigDecimal nowPrice;
+
+    private Integer siteLever;
+
+    private int contractSize; //合约单位
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 74
src/main/java/com/xc/vo/stock/StockListVO.java


+ 4 - 0
src/main/java/mappers/NewsMapper.xml

@@ -83,6 +83,10 @@
         desc
     </select>
 
+    <delete id="delMonthNews" parameterType="java.lang.String">
+        delete from news where publish_time <![CDATA[<]]> date_add(curdate(),INTERVAL -1 month)
+    </delete>
+
 </mapper>
 
 

+ 5 - 4
src/main/java/mappers/StockMapper.xml

@@ -135,7 +135,7 @@
        	  	      	#{transAmEnd,jdbcType=VARCHAR},
        	  	      	#{transPmBegin,jdbcType=VARCHAR},
        	  	      	#{transPmEnd,jdbcType=VARCHAR},
-       	  	      	#{spread,jdbcType=INTEGER},
+       	  	      	#{spread,jdbcType=DECIMAL},
        	  	      	#{demurrage,jdbcType=INTEGER},
        	  	      	#{entryOrdersAgio,jdbcType=DECIMAL},
        	  	      	#{entryOrdersDate,jdbcType=VARCHAR},
@@ -315,7 +315,7 @@
                 #{transPmEnd,jdbcType=VARCHAR},
             </if>
             <if test="spread != null">
-                #{spread,jdbcType=INTEGER},
+                #{spread,jdbcType=DECIMAL},
             </if>
             <if test="demurrage != null">
                 #{demurrage,jdbcType=INTEGER},
@@ -420,7 +420,7 @@
                 transPmEnd = #{transPmEnd,jdbcType=VARCHAR},
             </if>
             <if test="spread != null">
-                spread = #{spread,jdbcType=INTEGER},
+                spread = #{spread,jdbcType=DECIMAL},
             </if>
             <if test="demurrage != null">
                 demurrage = #{demurrage,jdbcType=INTEGER},
@@ -605,7 +605,8 @@
             transAmBegin transAmBegin,
             transAmEnd transAmEnd,
             transPmBegin transPmBegin,
-            transPmEnd transPmEnd
+            transPmEnd transPmEnd,
+            site_lever siteLever
         FROM stock
     </select>
 

+ 32 - 33
src/main/java/mappers/UserPositionMapper.xml

@@ -31,28 +31,27 @@
       <arg column="order_stay_days" jdbcType="INTEGER" javaType="java.lang.Integer" />
       <arg column="profit_and_lose" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
       <arg column="all_profit_and_lose" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
-
       <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer" />
       <arg column="lock_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
-
       <arg column="stock_plate" jdbcType="VARCHAR" javaType="java.lang.String" />
-
       <arg column="depositFreezeAmt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
       <arg column="entryOrders" jdbcType="INTEGER" javaType="java.lang.Integer" />
-
       <arg column="stoploss" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
       <arg column="targetprofit" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
+      <arg column="agentName" jdbcType="VARCHAR" javaType="java.lang.String" />
     </constructor>
   </resultMap>
+
   <sql id="Base_Column_List" >
-    id, position_type, position_sn, user_id, nick_name, agent_id, stock_name, stock_code, 
-    stock_gid, stock_spell, buy_order_id, buy_order_time, buy_order_price, sell_order_id, 
-    sell_order_time, sell_order_price, profit_target_price, stop_target_price, order_direction, 
-    order_num, order_lever, order_total_price, order_fee, order_spread, order_stay_fee, 
-    order_stay_days, profit_and_lose, all_profit_and_lose,is_lock,lock_msg,stock_plate,depositFreezeAmt,entryOrders,stop_loss_price stoploss,target_profit_price targetprofit
+    id, position_type, position_sn, user_id, nick_name, agent_id, stock_name, stock_code,
+    stock_gid, stock_spell, buy_order_id, buy_order_time, buy_order_price, sell_order_id,
+    sell_order_time, sell_order_price, profit_target_price, stop_target_price, order_direction,
+    order_num, order_lever, order_total_price, order_fee, order_spread, order_stay_fee,
+    order_stay_days, profit_and_lose, all_profit_and_lose,is_lock,lock_msg,stock_plate,depositFreezeAmt,
+    entryOrders,stop_loss_price stoploss,target_profit_price targetprofit , agent_name agentName
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-    select 
+    select
     <include refid="Base_Column_List" />
     from user_position
     where id = #{id,jdbcType=INTEGER}
@@ -71,25 +70,25 @@
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.xc.pojo.UserPosition" >
-    insert into user_position (id, position_type, position_sn, 
-      user_id, nick_name, agent_id, 
-      stock_name, stock_code, stock_gid, 
-      stock_spell, buy_order_id, buy_order_time, 
-      buy_order_price, sell_order_id, sell_order_time, 
-      sell_order_price, profit_target_price, stop_target_price, 
-      order_direction, order_num, order_lever, 
-      order_total_price, order_fee, order_spread, 
-      order_stay_fee, order_stay_days, profit_and_lose, 
+    insert into user_position (id, position_type, position_sn,
+      user_id, nick_name, agent_id,
+      stock_name, stock_code, stock_gid,
+      stock_spell, buy_order_id, buy_order_time,
+      buy_order_price, sell_order_id, sell_order_time,
+      sell_order_price, profit_target_price, stop_target_price,
+      order_direction, order_num, order_lever,
+      order_total_price, order_fee, order_spread,
+      order_stay_fee, order_stay_days, profit_and_lose,
       all_profit_and_lose, is_lock, lock_msg,stock_plate,depositFreezeAmt,entryOrders)
-    values (#{id,jdbcType=INTEGER}, #{positionType,jdbcType=INTEGER}, #{positionSn,jdbcType=VARCHAR}, 
-      #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR}, #{agentId,jdbcType=INTEGER}, 
-      #{stockName,jdbcType=VARCHAR}, #{stockCode,jdbcType=VARCHAR}, #{stockGid,jdbcType=VARCHAR}, 
-      #{stockSpell,jdbcType=VARCHAR}, #{buyOrderId,jdbcType=VARCHAR}, #{buyOrderTime,jdbcType=TIMESTAMP}, 
-      #{buyOrderPrice,jdbcType=DECIMAL}, #{sellOrderId,jdbcType=VARCHAR}, #{sellOrderTime,jdbcType=TIMESTAMP}, 
-      #{sellOrderPrice,jdbcType=DECIMAL}, #{profitTargetPrice,jdbcType=DECIMAL}, #{stopTargetPrice,jdbcType=DECIMAL}, 
-      #{orderDirection,jdbcType=VARCHAR}, #{orderNum,jdbcType=INTEGER}, #{orderLever,jdbcType=INTEGER}, 
-      #{orderTotalPrice,jdbcType=DECIMAL}, #{orderFee,jdbcType=DECIMAL}, #{orderSpread,jdbcType=DECIMAL}, 
-      #{orderStayFee,jdbcType=DECIMAL}, #{orderStayDays,jdbcType=INTEGER}, #{profitAndLose,jdbcType=DECIMAL}, 
+    values (#{id,jdbcType=INTEGER}, #{positionType,jdbcType=INTEGER}, #{positionSn,jdbcType=VARCHAR},
+      #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR}, #{agentId,jdbcType=INTEGER},
+      #{stockName,jdbcType=VARCHAR}, #{stockCode,jdbcType=VARCHAR}, #{stockGid,jdbcType=VARCHAR},
+      #{stockSpell,jdbcType=VARCHAR}, #{buyOrderId,jdbcType=VARCHAR}, #{buyOrderTime,jdbcType=TIMESTAMP},
+      #{buyOrderPrice,jdbcType=DECIMAL}, #{sellOrderId,jdbcType=VARCHAR}, #{sellOrderTime,jdbcType=TIMESTAMP},
+      #{sellOrderPrice,jdbcType=DECIMAL}, #{profitTargetPrice,jdbcType=DECIMAL}, #{stopTargetPrice,jdbcType=DECIMAL},
+      #{orderDirection,jdbcType=VARCHAR}, #{orderNum,jdbcType=INTEGER}, #{orderLever,jdbcType=INTEGER},
+      #{orderTotalPrice,jdbcType=DECIMAL}, #{orderFee,jdbcType=DECIMAL}, #{orderSpread,jdbcType=DECIMAL},
+      #{orderStayFee,jdbcType=DECIMAL}, #{orderStayDays,jdbcType=INTEGER}, #{profitAndLose,jdbcType=DECIMAL},
       #{allProfitAndLose,jdbcType=DECIMAL}, #{isLock,jdbcType=INTEGER}, #{lockMsg,jdbcType=VARCHAR},
       #{stockPlate,jdbcType=VARCHAR}, #{depositFreezeAmt,jdbcType=DECIMAL}, #{entryOrders,jdbcType=VARCHAR}
       )
@@ -544,8 +543,8 @@
           and sell_order_id is null and entryOrders = 1
         </if>
       </if>
-      <if test="userId != null and userId != '' ">
-        and user_id = #{userId}
+      <if test="nickName != null and nickName != '' ">
+        and nick_name like CONCAT('%','${nickName}','%')
       </if>
       <if test="positionSn != null and positionSn != '' ">
         and position_sn like CONCAT('%','${positionSn}','%')
@@ -592,9 +591,9 @@
       </if>
     </where>
   </select>
-  
-  
-  
+
+
+
   <select id="CountPositionProfitAndLose" resultType="decimal" parameterType="integer">
     SELECT sum(profit_and_lose) FROM user_position
     WHERE sell_order_id is not null and entryOrders = 0 or entryOrders is null

+ 21 - 12
src/main/java/mappers/UserRechargeMapper.xml

@@ -16,14 +16,16 @@
       <arg column="add_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
       <arg column="pay_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
       <arg column="pay_amt_rMB" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
+      <arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String" />
+      <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
     </constructor>
   </resultMap>
   <sql id="Base_Column_List" >
-    id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status, 
-    order_desc, add_time, pay_time, pay_amt_rMB
+    id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status,
+    order_desc, add_time, pay_time, pay_amt_rMB ,agent_name ,phone
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-    select 
+    select
     <include refid="Base_Column_List" />
     from user_recharge
     where id = #{id,jdbcType=INTEGER}
@@ -33,15 +35,16 @@
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.xc.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_amt_rMB
+    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_amt_rMB ,agent_name, phone
       )
-    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}, #{payAmtRMB,jdbcType=DECIMAL}
+    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},
+      #{payAmtRMB,jdbcType=DECIMAL}, #{agentName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.xc.pojo.UserRecharge" >
@@ -168,6 +171,12 @@
       <if test="payAmtRMB != null" >
         pay_amt_rMB = #{payAmtRMB,jdbcType=DECIMAL},
       </if>
+      <if test="agentName != null" >
+        agent_name = #{agentName,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null" >
+        phone = #{phone,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -286,4 +295,4 @@
 
 
 
-</mapper>
+</mapper>

+ 23 - 14
src/main/java/mappers/UserWithdrawMapper.xml

@@ -19,14 +19,16 @@
       <arg column="with_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
       <arg column="with_amt_rMB" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
       <arg column="with_fee_rMB" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
+      <arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String" />
+      <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
     </constructor>
   </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, with_amt_rMB, with_fee_rMB
+    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, with_amt_rMB, with_fee_rMB,agent_name ,phone
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-    select 
+    select
     <include refid="Base_Column_List" />
     from user_withdraw
     where id = #{id,jdbcType=INTEGER}
@@ -36,16 +38,17 @@
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.xc.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, with_amt_rMB, with_fee_rMB)
-    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}, #{withAmtRMB,jdbcType=DECIMAL}, #{withFeeRMB,jdbcType=DECIMAL})
+    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, with_amt_rMB, with_fee_rMB ,agent_name, phone)
+    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}, #{withAmtRMB,jdbcType=DECIMAL}, #{withFeeRMB,jdbcType=DECIMAL},
+      #{agentName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.xc.pojo.UserWithdraw" >
     insert into user_withdraw
@@ -198,6 +201,12 @@
       <if test="withFeeRMB != null" >
         with_fee_rMB = #{withFeeRMB,jdbcType=DECIMAL},
       </if>
+      <if test="agentName != null" >
+        agent_name = #{agentName,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null" >
+        phone = #{phone,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -302,4 +311,4 @@
   </delete>
 
 
-</mapper>
+</mapper>

+ 14 - 14
src/main/resources/logback.xml

@@ -66,22 +66,22 @@
 
     <!-- geelynote mybatis log 日志 -->
 
-    <logger name="com.xc.dao" level="DEBUG"/>
-    <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" >
-        <appender-ref ref="console"/>
-    </logger>
-    <logger name="java.sql.Connection" level="DEBUG">
-        <appender-ref ref="console"/>
-    </logger>
-    <logger name="java.sql.Statement" level="DEBUG">
-        <appender-ref ref="console"/>
-    </logger>
-    <logger name="java.sql.PreparedStatement" level="DEBUG">
-        <appender-ref ref="console"/>
-    </logger>
+<!--    <logger name="com.xc.dao" level="DEBUG"/>-->
+<!--    <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" >-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </logger>-->
+<!--    <logger name="java.sql.Connection" level="DEBUG">-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </logger>-->
+<!--    <logger name="java.sql.Statement" level="DEBUG">-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </logger>-->
+<!--    <logger name="java.sql.PreparedStatement" level="DEBUG">-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </logger>-->
 
     <!--这里设置成DEBUG显示日志-->
-    <root level="DEBUG">
+    <root level="INFO">
         <appender-ref ref="console"/>
         <appender-ref ref="error"/>
     </root>