Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

zangbin 2 rokov pred
rodič
commit
e1ac87b560
32 zmenil súbory, kde vykonal 501 pridanie a 260 odobranie
  1. 104 34
      tour-api/src/main/java/com/tour/api/controller/AgentCenterApi.java
  2. 2 2
      tour-api/src/main/java/com/tour/api/controller/HomeApi.java
  3. 7 4
      tour-api/src/main/java/com/tour/api/controller/MemberCenterApi.java
  4. 18 17
      tour-api/src/main/java/com/tour/api/controller/OrderApi.java
  5. 6 2
      tour-api/src/main/java/com/tour/api/service/ApiAgentCenterService.java
  6. 87 16
      tour-api/src/main/java/com/tour/api/service/impl/ApiAgentCenterServiceImpl.java
  7. 15 3
      tour-api/src/main/java/com/tour/api/service/impl/ApiMemberServiceImpl.java
  8. 61 0
      tour-api/src/main/java/com/tour/api/vo/AgentVo.java
  9. 2 1
      tour-api/src/main/resources/application.yml
  10. 2 0
      tour-core/src/main/java/com/tour/system/mapper/SysUserMapper.java
  11. 2 0
      tour-core/src/main/java/com/tour/system/service/ISysUserService.java
  12. 5 0
      tour-core/src/main/java/com/tour/system/service/impl/SysUserServiceImpl.java
  13. 4 0
      tour-core/src/main/resources/mapper/system/SysUserMapper.xml
  14. 4 0
      tour-module/src/main/java/com/tour/module/domain/Agent.java
  15. 1 0
      tour-module/src/main/java/com/tour/module/domain/AgentWithdrawal.java
  16. 3 1
      tour-module/src/main/java/com/tour/module/domain/Contacts.java
  17. 3 0
      tour-module/src/main/java/com/tour/module/domain/Order.java
  18. 7 4
      tour-module/src/main/java/com/tour/module/domain/dto/OmsOrderDto.java
  19. 4 55
      tour-module/src/main/java/com/tour/module/service/IAgentService.java
  20. 2 0
      tour-module/src/main/java/com/tour/module/service/IOrderService.java
  21. 11 70
      tour-module/src/main/java/com/tour/module/service/impl/AgentServiceImpl.java
  22. 35 0
      tour-module/src/main/java/com/tour/module/service/impl/OrderServiceImpl.java
  23. 54 0
      tour-module/src/main/java/com/tour/module/vo/CardListVo.java
  24. 11 3
      tour-module/src/main/java/com/tour/module/vo/CardVo.java
  25. 2 0
      tour-module/src/main/java/com/tour/module/vo/OrderCommissonVo.java
  26. 9 8
      tour-module/src/main/java/com/tour/module/vo/OrderDetailVo.java
  27. 1 1
      tour-module/src/main/resources/mapper/module/OrderCommissonMapper.xml
  28. 1 1
      tour-module/src/main/resources/mapper/module/OrderMapper.xml
  29. 3 3
      tour-oms/src/main/java/com/tour/web/controller/AgentCommissonController.java
  30. 30 30
      tour-oms/src/main/java/com/tour/web/controller/AgentController.java
  31. 3 3
      tour-oms/src/main/java/com/tour/web/controller/AgentWithdrawalController.java
  32. 2 2
      tour-oms/src/main/resources/application.yml

+ 104 - 34
tour-api/src/main/java/com/tour/api/controller/AgentCenterApi.java

@@ -1,23 +1,30 @@
 package com.tour.api.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.tour.api.service.ApiAgentCenterService;
+import com.tour.api.vo.AgentVo;
 import com.tour.common.annotation.AccessToken;
 import com.tour.common.core.controller.BaseController;
 import com.tour.common.core.domain.BaseResult;
 import com.tour.module.domain.*;
+import com.tour.module.domain.dto.OmsOrderDto;
+import com.tour.module.domain.dto.SystemOrderDto;
+import com.tour.module.service.IAgentService;
 import com.tour.module.service.IContactsService;
 import com.tour.module.service.IOrderService;
+import com.tour.module.vo.CardListVo;
 import com.tour.module.vo.CardVo;
 import com.tour.module.vo.OrderCommissonVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -30,57 +37,75 @@ public class AgentCenterApi extends BaseController {
 
     private final IOrderService orderService;
     private final ApiAgentCenterService apiAgentCenterService;
-
+    private final IAgentService agentService;
 
     @ApiOperation("订单列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待出行 1出行中 2 已完成 -1取消")
+            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待出行 1出行中 3 已完成 -1取消"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
     })
-    @PostMapping(value = "/list")
-    @AccessToken
-    public BaseResult getList(@RequestParam ("status") Integer status) {
-        Order order = new Order();
+    @GetMapping(value = "/list")
+//    @AccessToken
+    public BaseResult<List<OmsOrderDto>> getList(@RequestParam("status") Integer status, @RequestParam("id") Long id) {
+        SystemOrderDto order = new SystemOrderDto();
         order.setStatus(status);
-        order.setAgentId(getLoginId());
-        order.setKeyWord(order.getKeyWord());
-        return BaseResult.success(orderService.queryList(order));
+        List<Long> agentIds = agentService.getIds(id);
+        order.setAgentIds(agentIds);
+        return BaseResult.success(orderService.queryOrderList(order));
     }
 
+    @ApiOperation("代理商订单状态数量")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
+    })
+    @GetMapping(value = "/getOrderStatus")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "waitNum 待出行数量,hasTravel 出行中数量  finishNum 完成数量  cancelNum 取消数量")
+    })
+    @AccessToken
+    public BaseResult getOrderStatus(@RequestParam("id") Long agentId) {
+        return BaseResult.success(orderService.getAgentOrderStatusNum(agentId));
+    }
 
     @ApiOperation("激活和未激活卡数量")
     @GetMapping(value = "/cardNum")
-    @AccessToken
-    public BaseResult cardNum() {
-        Map map = apiAgentCenterService.getUseCard(getLoginId());
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "noUseNum 未激活数量,useNum 已激活数量  totalNum 全部数量")
+    })
+//    @AccessToken
+    public BaseResult cardNum(@RequestParam("id") Long agentId) {
+        Map map = apiAgentCenterService.getUseCard(agentId);
         return BaseResult.success(map);
     }
 
 
     @ApiOperation("旅游卡列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待激活 1 激活 10全部")
+            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待激活 1 激活 10全部"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
     })
     @GetMapping(value = "/cardList")
-    @AccessToken
-    public BaseResult cardList(@RequestParam("status") String status) {
-        List<Card> list = apiAgentCenterService.cardList(getLoginId(), status);
+//    @AccessToken
+    public BaseResult<List<CardListVo>> cardList(@RequestParam("status") String status, @RequestParam("id") Long agentId) {
+        List<CardListVo> list = apiAgentCenterService.cardList(agentId, status);
         return BaseResult.success(list);
     }
 
     @ApiOperation("激活详情")
     @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "cardKey", value = "卡密")
+            @ApiImplicitParam(required = true, paramType = "query", name = "cardKey", value = "卡密"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
     })
     @PostMapping(value = "/getCardOrder")
-    @AccessToken
-    public BaseResult getCardOrder(@RequestParam("cardKey") String cardKey) {
+    // @AccessToken
+    public BaseResult<CardVo> getCardOrder(String cardKey, Long id) {
         CardVo vo = apiAgentCenterService.getCardOrder(cardKey);
         return BaseResult.success(vo);
     }
 
     @ApiOperation("提现申请")
     @PostMapping(value = "/withDrawal")
-    @AccessToken
+    // @AccessToken
     public BaseResult withDrawal(@RequestBody AgentWithdrawal agentWithdrawal) {
         Boolean result = apiAgentCenterService.withDrawal(agentWithdrawal);
         return result ? BaseResult.success() : BaseResult.error("提现申请失败");
@@ -89,29 +114,74 @@ public class AgentCenterApi extends BaseController {
 
     @ApiOperation("提现记录")
     @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0审核中 1审核通过 2 拒绝 10全部")
+            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0审核中 1审核通过 2 拒绝 10全部"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
     })
     @GetMapping(value = "/withDrawalList")
-    @AccessToken
-    public BaseResult withDrawalList(@RequestParam("status") Integer status) {
-        List<AgentWithdrawal> list =apiAgentCenterService.withDrawalList(getLoginId(),status);
-        return  BaseResult.success(list) ;
+//    @AccessToken
+    public BaseResult withDrawalList(@RequestParam("status") Integer status, @RequestParam("id") Long agentId) {
+        List<AgentWithdrawal> list = apiAgentCenterService.withDrawalList(agentId, status);
+        return BaseResult.success(list);
     }
 
 
     @ApiOperation("佣金记录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
+    })
     @GetMapping(value = "/commissonList")
-    @AccessToken
-    public BaseResult commissonList() {
-        List<OrderCommissonVo> list =apiAgentCenterService.commissonList(getLoginId());
+//    @AccessToken
+    public BaseResult commissonList(@RequestParam("id") Long agentId) {
+        List<OrderCommissonVo> list = apiAgentCenterService.commissonList(agentId);
         return BaseResult.success(list);
     }
 
     @ApiOperation("团队成员")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
+    })
     @GetMapping(value = "/getGroupUser")
     @AccessToken
-    public BaseResult getGroupUser() {
-        List<Agent> list =apiAgentCenterService.getGroupUser(getLoginId());
+    public BaseResult<List<AgentVo>> getGroupUser(@RequestParam("id") Long agentId) {
+        List<AgentVo> list = apiAgentCenterService.getGroupUser(agentId);
         return BaseResult.success(list);
     }
+
+    @ApiOperation("获取代理商信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id")
+    })
+    @GetMapping(value = "/getInfo")
+//    @AccessToken
+    public BaseResult getInfo(@RequestParam("id") Long agentId) {
+        Agent agent = agentService.getById(agentId);
+        BigDecimal totalAmount = agent.getAmount().add(agent.getWithdrawalAmount());
+        agent.setTotalAmount(totalAmount);
+        List<Agent> subAgents = agentService.list(new QueryWrapper<Agent>().eq("pid", agentId));
+        if (!CollectionUtils.isEmpty(subAgents)) {
+            agent.setHasSub(true);
+        } else {
+            agent.setHasSub(false);
+        }
+        return BaseResult.success(agent);
+    }
+
+    @ApiOperation("修改密码")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, paramType = "query", name = "id", value = " 代理id"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "oldPassword", value = "旧密码"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "password", value = "新密码")
+    })
+    @PostMapping(value = "/updatePass")
+//    @AccessToken
+    public BaseResult updatePass(@RequestBody String body) {
+        JSONObject json = JSON.parseObject(body);
+        Long agentId = json.getLongValue("id");
+        String oldPassword = json.getString("oldPassword");
+        String password = json.getString("password");
+        int result = apiAgentCenterService.updateAgentPass(agentId, oldPassword, password);
+        return result > 0 ? BaseResult.success() : BaseResult.error("修改失败");
+    }
+
+
 }

+ 2 - 2
tour-api/src/main/java/com/tour/api/controller/HomeApi.java

@@ -28,8 +28,8 @@ public class HomeApi extends BaseController {
 
     @ApiOperation("线路列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "code",value = " 1热门 2品质 3 经典"),
-            @ApiImplicitParam(required = true, paramType = "query", name = "city",value = " 热门地点")
+            @ApiImplicitParam(required = true, paramType = "query", name = "type",value = " 1热门 2品质 3 经典"),
+            @ApiImplicitParam(required = true, paramType = "query", name = "cityName",value = " 热门地点")
     })
     @PostMapping(value = "/list")
     public BaseResult getList(@RequestBody LineVo vo) {

+ 7 - 4
tour-api/src/main/java/com/tour/api/controller/MemberCenterApi.java

@@ -5,6 +5,7 @@ import com.tour.common.core.controller.BaseController;
 import com.tour.common.core.domain.BaseResult;
 import com.tour.module.domain.Contacts;
 import com.tour.module.domain.Order;
+import com.tour.module.domain.dto.OmsOrderDto;
 import com.tour.module.domain.dto.SystemOrderDto;
 import com.tour.module.service.IContactsService;
 import com.tour.module.service.IOrderService;
@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @Api(value = "个人中心接口", tags = {"个人中心接口"})
 @RestController
 @RequestMapping("/app/member")
@@ -32,8 +35,8 @@ public class MemberCenterApi extends BaseController {
     })
     @GetMapping(value = "/list")
     @AccessToken
-    public BaseResult getList(@RequestParam ("status") Integer status,
-                              @RequestParam (value = "keyWord",required = false) String keyWord) {
+    public BaseResult<List<OmsOrderDto>> getList(@RequestParam ("status") Integer status,
+                                                 @RequestParam (value = "keyWord",required = false) String keyWord) {
         SystemOrderDto order = new SystemOrderDto();
         order.setStatus(status);
         order.setMemberId(getLoginId());
@@ -45,7 +48,7 @@ public class MemberCenterApi extends BaseController {
     @ApiOperation("常用联系人列表")
     @PostMapping(value = "/contactList")
     @AccessToken
-    public BaseResult contactList() {
+    public BaseResult<List<Contacts>> contactList() {
         Contacts contact = new Contacts();
         contact.setMemberId(getLoginId());
         return BaseResult.success(contactsService.queryList(contact));
@@ -84,7 +87,7 @@ public class MemberCenterApi extends BaseController {
     @ApiOperation("联系人详情")
     @GetMapping(value = "/getContactInfoById")
     @AccessToken
-    public BaseResult getContactInfoById(@RequestParam("id") Long id) {
+    public BaseResult<Contacts> getContactInfoById(@RequestParam("id") Long id) {
         Contacts contact = new Contacts();
         contact.setMemberId(getLoginId());
         return BaseResult.success(contactsService.getById(id));

+ 18 - 17
tour-api/src/main/java/com/tour/api/controller/OrderApi.java

@@ -17,6 +17,8 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
+
 @Api(value = "订单接口", tags = {"订单接口"})
 @RestController
 @RequestMapping("/app/order")
@@ -27,25 +29,24 @@ public class OrderApi extends BaseController {
     private final IOrderService orderService;
     private final ServerConfig serverConfig;
 
-    @ApiOperation("订单列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待出行 1出行中 10 已完成/取消")
-    })
-    @PostMapping(value = "/list")
-    @AccessToken
-    public BaseResult getList(@RequestBody Order order) {
-        order.setMemberId(getLoginId());
-        return BaseResult.success(orderService.queryList(order));
-    }
+//    @ApiOperation("订单列表")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(required = true, paramType = "query", name = "status", value = " 0 待出行 1出行中 10 已完成/取消")
+//    })
+//    @PostMapping(value = "/list")
+//    @AccessToken
+//    public BaseResult getList(@RequestBody Order order) {
+//        order.setMemberId(getLoginId());
+//        return BaseResult.success(orderService.queryList(order));
+//    }
 
 
     @ApiOperation("订单详情")
     @ApiImplicitParams({
             @ApiImplicitParam(required = true, paramType = "query", name = "orderId", value = " 订单号")
     })
-
     @GetMapping(value = "/detail")
-    @AccessToken
+//    @AccessToken
     public BaseResult<OrderDetailVo> detail(@RequestParam("orderId") Long orderId) {
 
         return BaseResult.success(orderService.getOrderDetail(orderId));
@@ -99,7 +100,7 @@ public class OrderApi extends BaseController {
     @AccessToken
     public BaseResult getQrCode(@RequestParam("orderId") Long orderId) {
         try {
-            return BaseResult.success(orderService.getQrCode(orderId));
+            return BaseResult.success("ok",orderService.getQrCode(orderId));
         } catch (Exception e) {
             return BaseResult.error(e.getMessage());
         }
@@ -110,11 +111,11 @@ public class OrderApi extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(required = true, paramType = "query", name = "file", value = "图片"),
     })
-    @GetMapping(value = "/uploadTrip")
+    @PostMapping(value = "/uploadTrip")
     @AccessToken
-    public BaseResult uploadTrip(MultipartFile file) {
+    public BaseResult uploadTrip(@RequestParam("file")MultipartFile file, HttpServletRequest request) {
         try {
-            String filePath = "/upload/image/trip/";
+            String filePath = "/upload";
             String fileName = FileUploadUtils.upload(filePath, file);
             String url = serverConfig.getUrl() + fileName;
             JSONObject ajax = new JSONObject();
@@ -132,7 +133,7 @@ public class OrderApi extends BaseController {
             @ApiImplicitParam(required = true, paramType = "query", name = "orderId", value = " 订单id"),
             @ApiImplicitParam(required = true, paramType = "query", name = "travelDetail", value = " 行程车票,多张车票图片逗号隔开")
     })
-    @GetMapping(value = "/subTrip")
+    @PostMapping(value = "/subTrip")
     @AccessToken
     public BaseResult subTrip(@RequestBody OrderTravelVo order) {
         try {

+ 6 - 2
tour-api/src/main/java/com/tour/api/service/ApiAgentCenterService.java

@@ -1,8 +1,10 @@
 package com.tour.api.service;
 
+import com.tour.api.vo.AgentVo;
 import com.tour.module.domain.Agent;
 import com.tour.module.domain.AgentWithdrawal;
 import com.tour.module.domain.Card;
+import com.tour.module.vo.CardListVo;
 import com.tour.module.vo.CardVo;
 import com.tour.module.vo.OrderCommissonVo;
 
@@ -17,7 +19,7 @@ public interface ApiAgentCenterService {
 
     Map getUseCard(Long agentId);
 
-    List<Card> cardList(Long agentId,String status);
+    List<CardListVo> cardList(Long agentId, String status);
 
     CardVo getCardOrder(String cardKey);
 
@@ -36,5 +38,7 @@ public interface ApiAgentCenterService {
      */
     List<OrderCommissonVo>  commissonList(Long agentId);
 
-    List<Agent> getGroupUser(Long agentId);
+    List<AgentVo> getGroupUser(Long agentId);
+
+    int updateAgentPass(Long agentId,String oldPassword,String password);
 }

+ 87 - 16
tour-api/src/main/java/com/tour/api/service/impl/ApiAgentCenterServiceImpl.java

@@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.tour.api.service.ApiAgentCenterService;
 import com.tour.api.service.ApiMemberService;
+import com.tour.api.vo.AgentVo;
 import com.tour.api.vo.LoginVo;
 import com.tour.common.core.domain.entity.SysUser;
 import com.tour.common.core.domain.model.LoginBody;
@@ -16,6 +17,7 @@ import com.tour.common.utils.sign.Md5Utils;
 import com.tour.framework.web.service.TokenService;
 import com.tour.module.domain.*;
 import com.tour.module.service.*;
+import com.tour.module.vo.CardListVo;
 import com.tour.module.vo.CardVo;
 import com.tour.module.vo.OrderCommissonVo;
 import com.tour.system.service.ISysUserService;
@@ -28,6 +30,8 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -54,27 +58,51 @@ public class ApiAgentCenterServiceImpl implements ApiAgentCenterService {
     private final IAgentService agentService;
     private final IOrderCommissonService orderCommissonService;
 
+    private final  ISysUserService userService;
 
     @Override
     public Map getUseCard(Long agentId) {
-        List<Card> list = iCardService.list(new QueryWrapper<Card>().eq("agent_id", agentId));
-        List<Card> noUse = list.stream().filter(item -> item.getStatus().equals(0)).collect(Collectors.toList());
-        List<Card> use = list.stream().filter(item -> item.getStatus().equals(1)).collect(Collectors.toList());
         Map map = new HashMap<>();
-        map.put("noUseNum", noUse.size());
-        map.put("useNum", use.size());
+        List<Card> list = iCardService.list(new QueryWrapper<Card>().eq("agent_id", agentId));
+        if (!CollectionUtils.isEmpty(list)) {
+            List<Card> noUse = list.stream().filter(item -> item.getStatus().equals(0)).collect(Collectors.toList());
+            List<Card> use = list.stream().filter(item -> item.getStatus().equals(1)).collect(Collectors.toList());
+            map.put("noUseNum", noUse.size());
+            map.put("useNum", use.size());
+            map.put("totalNum", list.size());
+        } else {
+            map.put("noUseNum", 0);
+            map.put("useNum", 0);
+            map.put("totalNum", 0);
+        }
+
         return map;
     }
 
     @Override
-    public List<Card> cardList(Long agentId, String status) {
+    public List<CardListVo> cardList(Long agentId, String status) {
         Card card = new Card();
         card.setAgentId(agentId);
         if (!"10".equals(status)) {
             card.setStatus(status);
         }
+        List<CardListVo> res = new ArrayList<>();
         List<Card> list = iCardService.queryList(card);
-        return list;
+        if (!CollectionUtils.isEmpty(list)) {
+            list.forEach(i -> {
+                CardListVo vo = new CardListVo();
+                BeanUtils.copyProperties(i, vo);
+                Order order = new Order();
+                order.setCardKey(i.getCardKey());
+                List<Order> orders = iOrderService.queryList(order);
+                if (!CollectionUtils.isEmpty(orders)) {
+                    vo.setCreateTime(orders.get(0).getCreateTime());
+                }
+                res.add(vo);
+            });
+        }
+
+        return res;
     }
 
     @Override
@@ -92,6 +120,8 @@ public class ApiAgentCenterServiceImpl implements ApiAgentCenterService {
         order.setCardKey(cardKey);
         List<Order> list = iOrderService.queryList(order);
         if (!CollectionUtils.isEmpty(list)) {
+            vo.setCreateTime(list.get(0).getCreateTime());
+            vo.setTravelDetail(list.get(0).getTravelDetail());
             String contactIds = list.get(0).getTravelerIds();
             List<String> ids = Arrays.asList(contactIds.split(","));
             List<Contacts> contactsList = iContactsService.list(new QueryWrapper<Contacts>().in("id", ids));
@@ -122,20 +152,61 @@ public class ApiAgentCenterServiceImpl implements ApiAgentCenterService {
     }
 
     @Override
-    public List<OrderCommissonVo>  commissonList(Long agentId) {
-       return orderCommissonService.queryListByAgentId(agentId);
+    public List<OrderCommissonVo> commissonList(Long agentId) {
+        return orderCommissonService.queryListByAgentId(agentId);
     }
 
     @Override
-    public  List<Agent> getGroupUser(Long agentId) {
-        List<Agent> list = new ArrayList<>();
+    public List<AgentVo> getGroupUser(Long agentId) {
+        AgentVo vo = new AgentVo();
+        List<AgentVo> list = new ArrayList<>();
         Agent agent = agentService.getById(agentId);
-        list.add(agent);
-        //一级代理
-        if(agent.getPid()==null){
-            List<Agent> subAgents = agentService.list(new QueryWrapper<Agent>().eq("pid",agentId));
-            list.addAll(subAgents);
+        BeanUtils.copyProperties(agent, vo);
+        vo.setTotalAmount(agent.getAmount().add(agent.getWithdrawalAmount()));
+
+
+        List<Agent> subAgents = agentService.list(new QueryWrapper<Agent>().eq("pid", agentId));
+        if (!CollectionUtils.isEmpty(subAgents)) {
+            BigDecimal subAmount = subAgents.stream().map(i -> {
+                return i.getAmount().add(i.getWithdrawalAmount());
+            }).reduce(BigDecimal.ZERO, BigDecimal::add);
+            vo.setSubAmount(subAmount);
+            list.add(vo);
+            subAgents.forEach(i -> {
+                AgentVo vo1 = new AgentVo();
+                BeanUtils.copyProperties(i, vo1);
+                vo1.setTotalAmount(i.getAmount().add(i.getWithdrawalAmount()));
+                List<Agent> sAgents = agentService.list(new QueryWrapper<Agent>().eq("pid", i.getId()));
+                if (!CollectionUtils.isEmpty(sAgents)) {
+                    BigDecimal sAmount = sAgents.stream().map(item -> {
+                        return item.getAmount().add(item.getWithdrawalAmount());
+                    }).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    vo1.setSubAmount(sAmount);
+                    list.add(vo1);
+                }
+            });
+
+        } else {
+            Agent agent1 = agentService.getById(agent.getPid());
+            if (agent1 != null) {
+                vo.setPAgentName(agent1.getPAgentName());
+            }
+
         }
+
         return list;
     }
+
+    @Override
+    public int updateAgentPass(Long agentId, String oldPassword, String password) {
+       SysUser user =  userService.queryByAgentId(agentId);
+        if (user==null) {
+            throw new CustomException("用户不存在");
+        }
+        else if(!SecurityUtils.matchesPassword(oldPassword,user.getPassword())){
+            throw new CustomException("对不起,原密码错误");
+        }
+        user.setPassword(SecurityUtils.encryptPassword(password));
+        return userService.resetPwd(user);
+    }
 }

+ 15 - 3
tour-api/src/main/java/com/tour/api/service/impl/ApiMemberServiceImpl.java

@@ -2,6 +2,7 @@ package com.tour.api.service.impl;
 
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.tour.api.service.ApiMemberService;
 import com.tour.api.vo.LoginVo;
 import com.tour.common.core.domain.entity.SysUser;
@@ -24,8 +25,11 @@ import me.chanjar.weixin.common.error.WxErrorException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -99,10 +103,18 @@ public class ApiMemberServiceImpl implements ApiMemberService {
         {
             log.info("登录用户:{} 已被停用.", username);
             throw new CustomException("对不起,您的账号:" + username + " 已停用");
-        }else if(!SecurityUtils.encryptPassword(loginBody.getPassword()).equals(user.getPassword())){
+        }else if(!SecurityUtils.matchesPassword(loginBody.getPassword(),user.getPassword())){
             throw new CustomException("对不起,密码错误");
         }
         Agent agent = agentService.getById(user.getAgentId());
+        BigDecimal totalAmount = agent.getAmount().add(agent.getWithdrawalAmount());
+        agent.setTotalAmount(totalAmount);
+        List<Agent> subAgents = agentService.list(new QueryWrapper<Agent>().eq("pid", agent.getId()));
+        if(!CollectionUtils.isEmpty(subAgents)){
+            agent.setHasSub(true);
+        }else{
+            agent.setHasSub(false);
+        }
         return agentLoginSuccess(agent);
     }
     /**
@@ -130,8 +142,8 @@ public class ApiMemberServiceImpl implements ApiMemberService {
         tokenService.setMemberToken(token, agent.getId());
 
         LoginVo loginVo = new LoginVo();
-        loginVo.setToken(token);
-        loginVo.setAgent(agent.setId(null));
+    //    loginVo.setToken(token);
+        loginVo.setAgent(agent);
         return loginVo;
     }
 

+ 61 - 0
tour-api/src/main/java/com/tour/api/vo/AgentVo.java

@@ -0,0 +1,61 @@
+package com.tour.api.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.tour.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 代理商信息对象 tour_agent
+ * 
+ * @author zoe
+ * @date 2023-05-23
+ */
+@Data
+@ApiModel
+@NoArgsConstructor
+@Accessors(chain = true)
+public class AgentVo implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+
+    /** 代理商名称 */
+    @ApiModelProperty(value = "代理商名称")
+    private String agentName;
+
+
+    @ApiModelProperty(value = "1无效 0有效")
+    private String status;
+
+
+    /** $column.columnComment */
+    @ApiModelProperty(value = "本级金额")
+    private BigDecimal totalAmount;
+
+
+    /** 上级累计金额 */
+    @ApiModelProperty(value = "下级累计金额")
+    private BigDecimal subAmount;
+
+    @ApiModelProperty(value = "上级代理商名称")
+    private String pAgentName;
+
+}

+ 2 - 1
tour-api/src/main/resources/application.yml

@@ -9,7 +9,8 @@ project:
   # 实例演示开关
   demoEnabled: true
   # 文件路径,使用jvm系统变量,兼容windows和linux
-  profile: ${user.dir}/upload/uploadPath
+#  profile: /home/uploadPath
+  profile: D:\file
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证

+ 2 - 0
tour-core/src/main/java/com/tour/system/mapper/SysUserMapper.java

@@ -111,4 +111,6 @@ public interface SysUserMapper
      * @return 结果
      */
     public SysUser checkEmailUnique(String email);
+
+    SysUser queryByAgentId(Long agentId);
 }

+ 2 - 0
tour-core/src/main/java/com/tour/system/service/ISysUserService.java

@@ -168,4 +168,6 @@ public interface ISysUserService
      * @return 结果
      */
     public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
+
+    SysUser queryByAgentId(Long agentId);
 }

+ 5 - 0
tour-core/src/main/java/com/tour/system/service/impl/SysUserServiceImpl.java

@@ -469,4 +469,9 @@ public class SysUserServiceImpl implements ISysUserService
         }
         return successMsg.toString();
     }
+
+    @Override
+    public SysUser queryByAgentId(Long agentId) {
+        return userMapper.queryByAgentId(agentId);
+    }
 }

+ 4 - 0
tour-core/src/main/resources/mapper/system/SysUserMapper.xml

@@ -203,5 +203,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			#{userId}
         </foreach>
  	</delete>
+	<select id="queryByAgentId" parameterType="String" resultMap="SysUserResult">
+		<include refid="selectUserVo"/>
+		where u.agent_id = #{agentId} and status=0 and del_flag=0
+	</select>
 
 </mapper>

+ 4 - 0
tour-module/src/main/java/com/tour/module/domain/Agent.java

@@ -163,4 +163,8 @@ private static final long serialVersionUID=1L;
 
     @TableField(exist = false)
     private String pAgentName;
+    @TableField(exist = false)
+    private BigDecimal totalAmount;
+    @TableField(exist = false)
+    private boolean hasSub;
 }

+ 1 - 0
tour-module/src/main/java/com/tour/module/domain/AgentWithdrawal.java

@@ -40,6 +40,7 @@ private static final long serialVersionUID=1L;
     private Long id;
 
     /** $column.columnComment */
+    @ApiModelProperty(value = "代理商id")
     private Long agentId;
 
     /** 提现金额 */

+ 3 - 1
tour-module/src/main/java/com/tour/module/domain/Contacts.java

@@ -81,18 +81,20 @@ public class Contacts implements Serializable {
     /**
      * 创建者
      */
+    @ApiModelProperty(value = "创建者")
     private String createBy;
 
     /**
      * 更新者
      */
+    @ApiModelProperty(value = "不要管")
     private String updateBy;
 
     /**
      * 创建时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
     /**

+ 3 - 0
tour-module/src/main/java/com/tour/module/domain/Order.java

@@ -16,6 +16,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -104,4 +105,6 @@ private static final long serialVersionUID=1L;
     private String keyWord;
     @TableField(exist = false)
     private Map<String, Object> params = new HashMap<>();
+    @TableField(exist = false)
+    private List<Long> agentIds;
 }

+ 7 - 4
tour-module/src/main/java/com/tour/module/domain/dto/OmsOrderDto.java

@@ -62,6 +62,7 @@ public class OmsOrderDto implements Serializable {
     private Integer hasReach;
 
     /** 行程车票,多张车票图片逗号隔开 */
+    @ApiModelProperty(value = "用户上次的行程车票,多张车票图片逗号隔开 ")
     private String travelDetail;
 
     /** 创建者 */
@@ -79,11 +80,11 @@ public class OmsOrderDto implements Serializable {
 
     /** 删除标识位: 0正常 1删除 */
     private Integer deleted;
-
+    @ApiModelProperty(value = "线路名称")
     private String lineTitle;
-
+    @ApiModelProperty(value = "线路图片")
     private String limeImage;
-
+    @ApiModelProperty(value = "线路类型")
     private Integer lineType;
 
     /** 省 */
@@ -93,12 +94,14 @@ public class OmsOrderDto implements Serializable {
     private String cityName;
 
     /** 原价 */
+    @ApiModelProperty(value = "线路原价")
     private BigDecimal originalPrice;
 
     /** 会员价 */
-
+    @ApiModelProperty(value = "线路会员价")
     private BigDecimal memberPrice;
 
     private String agentName;
+    @ApiModelProperty(value = "线路子标题")
     private String subTitle;
 }

+ 4 - 55
tour-module/src/main/java/com/tour/module/service/IAgentService.java

@@ -17,6 +17,7 @@ public interface IAgentService extends IService<Agent> {
 
     /**
      * 查询列表
+     *
      * @param agent 实体
      * @return 列表
      */
@@ -26,27 +27,16 @@ public interface IAgentService extends IService<Agent> {
 
     /**
      * 查询所有的代理商
+     *
      * @return
      */
     List<Agent> getAgentAll(SysUser user);
 
-    Agent getInfoById(Long id);
 
     Agent getInfo(Long id, SysUser user);
 
     Boolean createAgent(Agent agent, SysUser user) throws Exception;
 
-    BigDecimal getMaxRete(SysUser user);
-
-    List<Agent> selectAgentListByStatus(Integer status);
-
-    List<Agent> selectByPid(Integer id);
-
-    Integer getSAgentNum(List<Long> agentIds, String todayStartDate);
-
-    void updateAgentListAmount(List<Agent> list);
-
-    List<Integer> getAgentIdsByPid(Integer id);
 
     List<Long> listAgent(Long id);
 
@@ -56,54 +46,13 @@ public interface IAgentService extends IService<Agent> {
      * @param id
      * @return
      */
-    List<Integer> getIds(Integer id);
+    List<Long> getIds(Long id);
 
-    /**
-     * 根据渠道商查找代理商的id
-     *
-     * @param dspId
-     * @return
-     */
-    List<Integer> getAgentIdsByDspId(Integer dspId);
 
     Boolean updateAgent(Agent agent);
 
-    /**
-     * 按区域查询代理商(一级代理商)
-     *
-     * @param cityName     市
-     * @param districtName 区
-     * @return
-     */
-    Agent findByArea(String cityName, String districtName);
-
-    /**
-     * 根据pid查找一级代理商
-     *
-     * @param pid
-     * @return
-     */
-    Agent getByPid(Long pid);
-
-    /**
-     * 查询代理商的下级代理商
-     * @param pid
-     * @return
-     */
-    List<Long> selectByPid(Long pid);
-
-    void updateAgentStatus(Integer id);
-
-
-    BigDecimal getMinBindFee(String cityId);
 
+    Agent getInfo(SysUser user);
 
 
-    /**
-     * 获取一级代理商
-     * @return 代理商列表
-     */
-    List<Agent> queryFirstLevelList();
-//    Long getAgentDeliveryPackageId(Long agentId);
-    Agent getInfo(SysUser user);
 }

+ 2 - 0
tour-module/src/main/java/com/tour/module/service/IOrderService.java

@@ -38,4 +38,6 @@ public interface IOrderService extends IService<Order> {
 
     Map getOrderStatusNum(Long memberId);
      List<OmsOrderDto> queryOrderList(SystemOrderDto order);
+
+    Map getAgentOrderStatusNum(Long agentId);
 }

+ 11 - 70
tour-module/src/main/java/com/tour/module/service/impl/AgentServiceImpl.java

@@ -26,6 +26,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 代理商信息Service业务层处理
@@ -172,10 +173,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         return null;
     }
 
-    @Override
-    public Agent getInfoById(Long id) {
-        return null;
-    }
 
     @Override
     public Agent getInfo(Long id, SysUser user) {
@@ -213,7 +210,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         Agent parentAgent = this.getById(user.getAgentId());
         if (parentAgent != null) {
             agent.setPid(parentAgent.getId());
-        }else{
+        } else {
             agent.setPid(1L);
         }
 
@@ -240,88 +237,32 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         return true;
     }
 
-    @Override
-    public BigDecimal getMaxRete(SysUser user) {
-        return null;
-    }
-
-    @Override
-    public List<Agent> selectAgentListByStatus(Integer status) {
-        return null;
-    }
 
-    @Override
-    public List<Agent> selectByPid(Integer id) {
-        return null;
-    }
-
-    @Override
-    public Integer getSAgentNum(List<Long> agentIds, String todayStartDate) {
-        return null;
-    }
-
-    @Override
-    public void updateAgentListAmount(List<Agent> list) {
-
-    }
-
-    @Override
-    public List<Integer> getAgentIdsByPid(Integer id) {
-        return null;
-    }
 
     @Override
     public List<Long> listAgent(Long id) {
-        return null;
+        List<Agent> list = baseMapper.getAgentAll(id);
+        List<Long> ids = list.stream().map(Agent::getId).collect(Collectors.toList());
+        return ids;
     }
 
     @Override
-    public List<Integer> getIds(Integer id) {
-        return null;
+    public List<Long> getIds(Long id) {
+        List<Agent> list = baseMapper.getAgentAll(id);
+        List<Long> ids = list.stream().map(Agent::getId).collect(Collectors.toList());
+        return ids;
     }
 
-    @Override
-    public List<Integer> getAgentIdsByDspId(Integer dspId) {
-        return null;
-    }
 
     @Override
     public Boolean updateAgent(Agent agent) {
-        return null;
-    }
-
-    @Override
-    public Agent findByArea(String cityName, String districtName) {
-        return null;
+        return baseMapper.updateById(agent) > 0 ? true : false;
     }
 
-    @Override
-    public Agent getByPid(Long pid) {
-        return null;
-    }
 
-    @Override
-    public List<Long> selectByPid(Long pid) {
-        return null;
-    }
-
-    @Override
-    public void updateAgentStatus(Integer id) {
-
-    }
-
-    @Override
-    public BigDecimal getMinBindFee(String cityId) {
-        return null;
-    }
-
-    @Override
-    public List<Agent> queryFirstLevelList() {
-        return null;
-    }
 
     @Override
-    public Agent getInfo( SysUser user) {
+    public Agent getInfo(SysUser user) {
         Agent agent = this.getById(user.getAgentId());
         return agent;
     }

+ 35 - 0
tour-module/src/main/java/com/tour/module/service/impl/OrderServiceImpl.java

@@ -67,6 +67,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (order.getStatus() != null && order.getStatus() != 10) {
             lqw.eq(Order::getStatus, order.getStatus());
         }
+        if (order.getAgentIds() != null) {
+            lqw.in(Order::getAgentId, order.getAgentIds());
+        }
         if (order.getStatus() != null && order.getStatus() == 10) {//完成和取消
             List<Integer> list = new ArrayList<>();
             list.add(3);
@@ -235,4 +238,36 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         List<OmsOrderDto> orderList = baseMapper.queryPageList(order);
         return orderList;
     }
+
+    @Override
+    public Map getAgentOrderStatusNum(Long agentId) {
+        List<Long> agentIds = agentService.getIds(agentId);
+        Order order = new Order();
+        order.setAgentIds(agentIds);
+        List<Order> list = queryList(order);
+        int waitNum=0;
+        int hasTravel=0;
+        int finishNum=0;
+        int cancelNum=0;
+        Map map = new HashMap();
+        if (!CollectionUtils.isEmpty(list)) {
+            List<Order> wait = list.stream().filter(item -> item.getStatus() == 0).collect(Collectors.toList());
+            List<Order> has = list.stream().filter(item -> item.getStatus() == 1).collect(Collectors.toList());
+            List<Order> finish = list.stream().filter(item -> item.getStatus() == 3).collect(Collectors.toList());
+            List<Order> cancel = list.stream().filter(item -> item.getStatus() == -1).collect(Collectors.toList());
+            //待出行数量
+            waitNum = wait.size();
+            //出行中数量
+            hasTravel = has.size();
+            //完成和取消数量
+            finishNum = finish.size();
+            cancelNum = cancel.size();
+        }
+        map.put("waitNum",waitNum);
+        map.put("hasTravel",hasTravel);
+        map.put("finishNum",finishNum);
+        map.put("cancelNum",cancelNum);
+
+        return map;
+    }
 }

+ 54 - 0
tour-module/src/main/java/com/tour/module/vo/CardListVo.java

@@ -0,0 +1,54 @@
+package com.tour.module.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.tour.module.domain.Contacts;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 卡对象 tour_card
+ * 
+ * @author zoe
+ * @date 2023-05-23
+ */
+@Data
+@ApiModel
+@NoArgsConstructor
+@Accessors(chain = true)
+public class CardListVo implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+    private Long id;
+
+    @ApiModelProperty(value = "卡号")
+    private String cardNo;
+
+    @ApiModelProperty(value = "卡密")
+    private String cardKey;
+
+    /** 1会员卡 2旅游卡 */
+    @ApiModelProperty(value = "卡类型 1会员卡 2旅游卡")
+    private Integer type;
+
+    /** 0 待激活 1 激活 -1失效 */
+    @ApiModelProperty(value = "卡状态  0 待激活 1 激活 -1失效 ")
+    private String status;
+
+
+
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "卡激活时间 ")
+    private Date createTime;
+
+}

+ 11 - 3
tour-module/src/main/java/com/tour/module/vo/CardVo.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.tour.common.annotation.Excel;
 import com.tour.module.domain.Contacts;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -24,6 +26,7 @@ import java.util.Map;
  * @date 2023-05-23
  */
 @Data
+@ApiModel
 @NoArgsConstructor
 @Accessors(chain = true)
 public class CardVo implements Serializable {
@@ -33,16 +36,18 @@ private static final long serialVersionUID=1L;
 
     private Long id;
 
-
+    @ApiModelProperty(value = "卡号")
     private String cardNo;
 
-
+    @ApiModelProperty(value = "卡密")
     private String cardKey;
 
     /** 1会员卡 2旅游卡 */
+    @ApiModelProperty(value = "卡类型 1会员卡 2旅游卡")
     private Integer type;
 
     /** 0 待激活 1 激活 -1失效 */
+    @ApiModelProperty(value = "卡状态  0 待激活 1 激活 -1失效 ")
     private String status;
 
 
@@ -57,8 +62,11 @@ private static final long serialVersionUID=1L;
 
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "卡激活时间 ")
     private Date createTime;
-
+    @ApiModelProperty(value = "出行人")
     private List<Contacts> contactsList;
+    @ApiModelProperty(value = "出行人行程单信息 -附件")
+    private String travelDetail;
 
 }

+ 2 - 0
tour-module/src/main/java/com/tour/module/vo/OrderCommissonVo.java

@@ -2,6 +2,7 @@ package com.tour.module.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.tour.module.domain.Contacts;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -46,6 +47,7 @@ public class OrderCommissonVo implements Serializable {
 
     private BigDecimal commissonRate;
     //返佣类型
+    @ApiModelProperty(value = "1 出行补贴")
     private String commissonType;
     private Integer type;
     private String status;

+ 9 - 8
tour-module/src/main/java/com/tour/module/vo/OrderDetailVo.java

@@ -11,15 +11,15 @@ import java.util.Date;
 import java.util.List;
 
 
-@EqualsAndHashCode(callSuper = true)
+
 @Data
-@ApiModel("下单返回vo类")
-public class OrderDetailVo extends BaseVo {
+@ApiModel("详情返回vo类")
+public class OrderDetailVo {
     @ApiModelProperty(value = "订单id")
     private Long orderId;
-
+    @ApiModelProperty(value = "订单编号")
     private String orderNo;
-
+    @ApiModelProperty(value = "下单人id")
     private Long memberId;
 
     /** $column.columnComment */
@@ -38,7 +38,7 @@ public class OrderDetailVo extends BaseVo {
     private Date travelEndTime;
 
     /** 0 待出行 1出行中 3 已完成 -1 取消 */
-    @ApiModelProperty(value = "卡密")
+    @ApiModelProperty(value = " 0 待出行 1出行中 3 已完成 -1 取消 ")
     private Integer status;
 
     /** 0未到达待联系地接 1已到达,地接已接到 */
@@ -51,9 +51,10 @@ public class OrderDetailVo extends BaseVo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "下单时间")
     private Date createTime;
-
+    @ApiModelProperty(value = "详情用不到")
    private String travelerIds;
     @ApiModelProperty(name = "线路标题")
    private String title;
-
+    @ApiModelProperty(name = "线路子标题")
+    private String subTitle;
 }

+ 1 - 1
tour-module/src/main/resources/mapper/module/OrderCommissonMapper.xml

@@ -16,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="queryListByAgentId" resultType="com.tour.module.vo.OrderCommissonVo">
-        SELECT a.agent_name,o.card_key,t.create_time,t.commisson from tour_order_commisson t join tour_agent a on t.agent_id = a.id join tour_order o on t.order_id= o.order_id
+        SELECT a.agent_name,o.card_key,t.create_time,t.commisson,1 commissonType from tour_order_commisson t join tour_agent a on t.agent_id = a.id join tour_order o on t.order_id= o.order_id
         where t.agent_id=#{agentId} order by t.create_time desc
     </select>
 

+ 1 - 1
tour-module/src/main/resources/mapper/module/OrderMapper.xml

@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="getOrderDetail" resultType="com.tour.module.vo.OrderDetailVo">
-        SELECT l.title,o.create_time,o.travel_start_time,o.travel_end_time,o.card_key,o.traveler_ids,o.order_id,l.sub_title
+        SELECT l.title,o.create_time,o.*
         from tour_order o join tour_line l on o.line_id = l.id where o.order_id=#{orderId}
     </select>
 

+ 3 - 3
tour-oms/src/main/java/com/tour/web/controller/AgentCommissonController.java

@@ -47,10 +47,10 @@ public class AgentCommissonController extends BaseController {
         if(UserTypeEnums.AGENT.getCode().equals(user.getType())){
             List<Long> ids = new ArrayList();
             ids.add(user.getAgentId());
-            List<Integer> agentIds = iAgentService.getAgentIdsByPid(user.getAgentId().intValue());
+            List<Long> agentIds = iAgentService.getIds(user.getAgentId());
             if (CollectionUtils.isNotEmpty(agentIds)) {
-                for (Integer item : agentIds) {
-                    ids.add(Long.parseLong(String.valueOf(item)));
+                for (Long item : agentIds) {
+                    ids.add(item);
                 }
             }
             orderCommissonVo.setAgentIds(ids);

+ 30 - 30
tour-oms/src/main/java/com/tour/web/controller/AgentController.java

@@ -55,10 +55,10 @@ public TableDataInfo list(Agent agent) {
     // 允许查看的代理商数据
     if(UserTypeEnums.AGENT.getCode().equals(user.getType())){
         ids.add(user.getAgentId());
-        List<Integer> agentIds = iAgentService.getAgentIdsByPid(user.getAgentId().intValue());
+        List<Long> agentIds = iAgentService.getIds(user.getAgentId());
         if (CollectionUtils.isNotEmpty(agentIds)) {
-            for (Integer item : agentIds) {
-                ids.add(Long.parseLong(String.valueOf(item)));
+            for (Long item : agentIds) {
+                ids.add(item);
             }
         }
         user.setAgentIds(ids);
@@ -136,27 +136,27 @@ public TableDataInfo list(Agent agent) {
     /**
      * 获取登录用户创建代理时,允许的最大抽佣比率
      */
-    @GetMapping(value = "/getMaxRete")
-    public Result getMaxRete(){
-        Map map = new HashMap();
-        SysUser user = getSysUser();
-        map.put("maxRate",iAgentService.getMaxRete(user));
-        map.put("qishouMax",new BigDecimal(iSysConfigService.selectConfigByKey("QISHOU_MAX")));
-
-        BigDecimal huolalaMax = BigDecimal.ZERO;
-        BigDecimal bindingThirdMax = BigDecimal.ZERO;
-        if (user.getType().equals(UserTypeEnums.AGENT.getCode())) {
-            Agent agent = iAgentService.getById(user.getAgentId());
-
-        }else {
-            huolalaMax = new BigDecimal(iSysConfigService.selectConfigByKey("HUOLALA_MAX"));
-            // bindingThirdMax = new BigDecimal(iSysConfigService.selectConfigByKey("BINDING_THIRD_FEE"));
-        }
-        map.put("huolalaMax",huolalaMax);
-        map.put("bindingThirdMax",bindingThirdMax);
-
-        return Result.success(map);
-    }
+//    @GetMapping(value = "/getMaxRete")
+//    public Result getMaxRete(){
+//        Map map = new HashMap();
+//        SysUser user = getSysUser();
+//        map.put("maxRate",iAgentService.getMaxRete(user));
+//        map.put("qishouMax",new BigDecimal(iSysConfigService.selectConfigByKey("QISHOU_MAX")));
+//
+//        BigDecimal huolalaMax = BigDecimal.ZERO;
+//        BigDecimal bindingThirdMax = BigDecimal.ZERO;
+//        if (user.getType().equals(UserTypeEnums.AGENT.getCode())) {
+//            Agent agent = iAgentService.getById(user.getAgentId());
+//
+//        }else {
+//            huolalaMax = new BigDecimal(iSysConfigService.selectConfigByKey("HUOLALA_MAX"));
+//            // bindingThirdMax = new BigDecimal(iSysConfigService.selectConfigByKey("BINDING_THIRD_FEE"));
+//        }
+//        map.put("huolalaMax",huolalaMax);
+//        map.put("bindingThirdMax",bindingThirdMax);
+//
+//        return Result.success(map);
+//    }
 
     /**
      * 新增代理商
@@ -187,12 +187,12 @@ public TableDataInfo list(Agent agent) {
         return toAjax(iAgentService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
     }
 
-    @GetMapping("/updateAgentStatus")
-    @Log(title = "变更代理商状态" , businessType = BusinessType.UPDATE)
-    public Result updateAgentStatus(Integer id){
-        iAgentService.updateAgentStatus(id);
-        return Result.success();
-    }
+//    @GetMapping("/updateAgentStatus")
+//    @Log(title = "变更代理商状态" , businessType = BusinessType.UPDATE)
+//    public Result updateAgentStatus(Integer id){
+//        iAgentService.updateAgentStatus(id);
+//        return Result.success();
+//    }
 
     /**
      * 一级代理商列表(不分页)

+ 3 - 3
tour-oms/src/main/java/com/tour/web/controller/AgentWithdrawalController.java

@@ -68,10 +68,10 @@ public class AgentWithdrawalController extends BaseController {
            // agentWithdrawal.setAgentId(user.getAgentId());
             List<Long> ids = new ArrayList();
             ids.add(user.getAgentId());
-            List<Integer> agentIds = iAgentService.getAgentIdsByPid(user.getAgentId().intValue());
+            List<Long> agentIds = iAgentService.getIds(user.getAgentId());
             if (CollectionUtils.isNotEmpty(agentIds)) {
-                for (Integer item : agentIds) {
-                    ids.add(Long.parseLong(String.valueOf(item)));
+                for (Long item : agentIds) {
+                    ids.add(item);
                 }
             }
             agentWithdrawal.setAgentIds(ids);

+ 2 - 2
tour-oms/src/main/resources/application.yml

@@ -9,8 +9,8 @@ project:
   # 实例演示开关
   demoEnabled: true
   # 文件路径,使用jvm系统变量,兼容windows和linux
-  profile: D:/uploadPath
-#  profile: /home/uploadPath
+#  profile: D:/uploadPath
+  profile: /home/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证