|
@@ -11,13 +11,11 @@ import com.pj.tb_orders.vo.OrderStaticsDTO;
|
|
import com.pj.utils.sg.AjaxJson;
|
|
import com.pj.utils.sg.AjaxJson;
|
|
import com.pj.utils.so.SoMap;
|
|
import com.pj.utils.so.SoMap;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@@ -79,7 +77,7 @@ public class TbOrdersApiController {
|
|
@RequestMapping("purchaserBuyOneLevelOrder")
|
|
@RequestMapping("purchaserBuyOneLevelOrder")
|
|
public AjaxJson purchaserBuyOneLevelOrder() {
|
|
public AjaxJson purchaserBuyOneLevelOrder() {
|
|
List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
|
|
List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
|
|
- List<TbOrders> orders= tbOrdersService.findByLevelOneOrderIds(ids);
|
|
|
|
|
|
+ List<TbOrders> orders = tbOrdersService.findByLevelOneOrderIds(ids);
|
|
String orderIds = orders.stream().map(obj -> obj.getId() + "").collect(Collectors.joining(","));
|
|
String orderIds = orders.stream().map(obj -> obj.getId() + "").collect(Collectors.joining(","));
|
|
// 获取app登录用户
|
|
// 获取app登录用户
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
@@ -98,7 +96,7 @@ public class TbOrdersApiController {
|
|
List<OrderDto> orderDtos = FeignFactory.levelOneServerInterface.getOrderListByMainIds(ids);
|
|
List<OrderDto> orderDtos = FeignFactory.levelOneServerInterface.getOrderListByMainIds(ids);
|
|
List<Long> leveloneOrderIds = orderDtos.stream().map(OrderDto::getId).collect(Collectors.toList());
|
|
List<Long> leveloneOrderIds = orderDtos.stream().map(OrderDto::getId).collect(Collectors.toList());
|
|
List<TbOrders> orders = tbOrdersService.findByLevelOneOrderIds(leveloneOrderIds);
|
|
List<TbOrders> orders = tbOrdersService.findByLevelOneOrderIds(leveloneOrderIds);
|
|
- if (orders.isEmpty()){
|
|
|
|
|
|
+ if (orders.isEmpty()) {
|
|
return AjaxJson.getError("订单不存在");
|
|
return AjaxJson.getError("订单不存在");
|
|
}
|
|
}
|
|
String orderIds = orders.stream().map(obj -> obj.getId() + "").collect(Collectors.joining(","));
|
|
String orderIds = orders.stream().map(obj -> obj.getId() + "").collect(Collectors.joining(","));
|
|
@@ -125,9 +123,10 @@ public class TbOrdersApiController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取在售订单
|
|
* 获取在售订单
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @RequestMapping("getOnSaleList")
|
|
|
|
|
|
+ @RequestMapping("getOnSaleList")
|
|
public AjaxJson getOnSaleList() {
|
|
public AjaxJson getOnSaleList() {
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
List<TbOrders> list = tbOrdersService.getOnSaleList(so.startPage());
|
|
List<TbOrders> list = tbOrdersService.getOnSaleList(so.startPage());
|
|
@@ -159,7 +158,7 @@ public class TbOrdersApiController {
|
|
public AjaxJson getPurchaserStatistics() {
|
|
public AjaxJson getPurchaserStatistics() {
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
- so.put("purchaserId",appLoginInfo.getFk());
|
|
|
|
|
|
+ so.put("purchaserId", appLoginInfo.getFk());
|
|
List<OrderStaticsDTO> list = tbOrdersService.getPurchaserStatistics(so.startPage());
|
|
List<OrderStaticsDTO> list = tbOrdersService.getPurchaserStatistics(so.startPage());
|
|
return AjaxJson.getPageData(so.getDataCount(), list);
|
|
return AjaxJson.getPageData(so.getDataCount(), list);
|
|
}
|
|
}
|
|
@@ -234,6 +233,26 @@ public class TbOrdersApiController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping("deduction")
|
|
|
|
+ public AjaxJson deduction(Long id) {
|
|
|
|
+ if (!StpAPPUserUtil.isLogin()) {
|
|
|
|
+ return AjaxJson.getError("用户未登录");
|
|
|
|
+ }
|
|
|
|
+ TbOrders tbOrders = tbOrdersService.getById(id);
|
|
|
|
+ if (tbOrders == null) {
|
|
|
|
+ return AjaxJson.getError("订单不存在");
|
|
|
|
+ }
|
|
|
|
+ if (tbOrders.getIsPay() != 2) {
|
|
|
|
+ return AjaxJson.getError("订单无法执行补扣");
|
|
|
|
+ }
|
|
|
|
+ Long fkId = StpAPPUserUtil.getAPPLoginInfo().getFk();
|
|
|
|
+ if (!Objects.equals(fkId, tbOrders.getPurchaserId())) {
|
|
|
|
+ return AjaxJson.getError("您无权执行此操作");
|
|
|
|
+ }
|
|
|
|
+ tbOrdersService.deduction(id);
|
|
|
|
+ return AjaxJson.getSuccess();
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查 - 根据一级市场订单id查二级市场的转售金额
|
|
* 查 - 根据一级市场订单id查二级市场的转售金额
|
|
*/
|
|
*/
|
|
@@ -246,6 +265,7 @@ public class TbOrdersApiController {
|
|
return resalePrice;
|
|
return resalePrice;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 采购商支付成功 ——> 边民缴税以及各服务费
|
|
* 采购商支付成功 ——> 边民缴税以及各服务费
|
|
*/
|
|
*/
|