|
|
@@ -24,12 +24,16 @@ import com.github.wxpay.sdk.WXPay;
|
|
|
import com.sqx.common.constant.RedisKey;
|
|
|
import com.sqx.common.exception.SqxException;
|
|
|
import com.sqx.common.sms.SmsSendResult;
|
|
|
-import com.sqx.common.utils.*;
|
|
|
+import com.sqx.common.utils.Constant;
|
|
|
+import com.sqx.common.utils.DateUtils;
|
|
|
+import com.sqx.common.utils.DistanceUtil;
|
|
|
+import com.sqx.common.utils.MyGlobalThreadPool;
|
|
|
+import com.sqx.common.utils.PageUtils;
|
|
|
+import com.sqx.common.utils.Result;
|
|
|
import com.sqx.modules.activity.entity.ActivityPartRecord;
|
|
|
import com.sqx.modules.activity.service.ActivityPartRecordService;
|
|
|
import com.sqx.modules.activity.service.ActivityService;
|
|
|
import com.sqx.modules.activity.vo.OrderSuitActivityVO;
|
|
|
-import com.sqx.modules.address.dao.AddressDao;
|
|
|
import com.sqx.modules.address.entity.Address;
|
|
|
import com.sqx.modules.address.service.AddressService;
|
|
|
import com.sqx.modules.app.dao.UserBrowseDao;
|
|
|
@@ -105,11 +109,6 @@ import com.sqx.modules.utils.excel.ExcelData;
|
|
|
import com.sqx.modules.utils.fieYun.FeiYunUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
-import org.apache.http.client.methods.HttpPost;
|
|
|
-import org.apache.http.entity.StringEntity;
|
|
|
-import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
-import org.apache.http.impl.client.HttpClients;
|
|
|
-import org.apache.http.util.EntityUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
@@ -130,7 +129,6 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
@@ -1361,49 +1359,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
return Result.success().put("data", orderGoodsList);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /*public Result insertOrder1(Long userId, Long shopId, Long goodsId, Integer num, Long skuId, String skuMessage, Integer orderType) {
|
|
|
- //判断该用户在该商店有没有订单,没有的话创建订单,有的话加入订单
|
|
|
- List<TbOrder> tbOrder1 = appOrderDao.selectList(new QueryWrapper<TbOrder>()
|
|
|
- .eq("user_id", userId).eq("shop_id", shopId).eq("status", 1));
|
|
|
-
|
|
|
- if(tbOrder1==null) {
|
|
|
- Goods goods = goodsDao.selectById(goodsId);
|
|
|
- UserEntity userEntity = userDao.selectById(userId);
|
|
|
- net.sf.json.JSONObject goodsJson = net.sf.json.JSONObject.fromObject(goods);
|
|
|
-
|
|
|
- TbOrder order = new TbOrder();
|
|
|
- order.setUserId(userId);
|
|
|
- order.setUserName(userEntity.getUserName());
|
|
|
- order.setPhone(userEntity.getPhone());
|
|
|
- order.setOrderNumber(getGeneralOrder());
|
|
|
- order.setIsPay(0);
|
|
|
- order.setDeleteFlag(0);
|
|
|
- order.setStatus(1);
|
|
|
- // order.setNum(num);
|
|
|
- order.setShopId(shopId);
|
|
|
- //创建订单,订单发起人就是该登录用户
|
|
|
- order.setParentUserId(userId);
|
|
|
- order.setPackMoney(goods.getPackMoney());
|
|
|
- order.setOrderType(orderType);
|
|
|
- order.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
- if (orderType == 2) {
|
|
|
- CommonInfo one = commonInfoService.findOne(121);
|
|
|
- Double value = Double.valueOf(one.getValue());
|
|
|
- order.setErrandMoney(BigDecimal.valueOf(value));
|
|
|
- }
|
|
|
- appOrderDao.insertOrder(order);
|
|
|
- TbOrder tbOrder = new TbOrder();
|
|
|
- tbOrder.setOrderId(order.getOrderId());
|
|
|
- tbOrder.setParentId(order.getOrderId());
|
|
|
- appOrderDao.updateById(tbOrder);
|
|
|
- }
|
|
|
- return Result.success();
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public TbOrder selectOrderByNum(String orderNum) {
|
|
|
TbOrder tbOrder = appOrderDao.selectOne(new QueryWrapper<TbOrder>().eq("order_number", orderNum));
|
|
|
@@ -1438,22 +1393,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
@Override
|
|
|
public Result selectAllOrderAdmin(OrderQueryDto queryDto) {
|
|
|
Page<TbOrder> pages = new Page<>(queryDto.getPage(), queryDto.getLimit());
|
|
|
-// pages.setOptimizeCountSql(false);
|
|
|
-// pages.setSearchCount(false);
|
|
|
-// pages.setTotal()
|
|
|
-
|
|
|
-// if (org.springframework.util.StringUtils.hasText(queryDto.getEndTime())) {
|
|
|
-// queryDto.setEndTime(queryDto.getEndTime() + " 23:59:59");
|
|
|
-// }
|
|
|
-// if (org.springframework.util.StringUtils.hasText(queryDto.getPayEndTime())) {
|
|
|
-// queryDto.setPayEndTime(queryDto.getPayEndTime() + " 23:59:59");
|
|
|
-// }
|
|
|
-// if (org.springframework.util.StringUtils.hasText(queryDto.getStartTime())) {
|
|
|
-// queryDto.setStartTime(queryDto.getStartTime() + " 00:00:00");
|
|
|
-// }
|
|
|
-// if (org.springframework.util.StringUtils.hasText(queryDto.getPayStartTime())) {
|
|
|
-// queryDto.setPayStartTime(queryDto.getPayStartTime() + " 00:00:00");
|
|
|
-// }
|
|
|
IPage<TbOrder> tbOrderIPage = appOrderDao.selectAllOrderAdmin(pages, queryDto);
|
|
|
for (int i = 0; i < tbOrderIPage.getRecords().size(); i++) {
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>()
|
|
|
@@ -1469,21 +1408,11 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
if (org.springframework.util.StringUtils.hasText(queryDto.getEndTime())) {
|
|
|
queryDto.setEndTime(queryDto.getEndTime() + " 23:59:59");
|
|
|
}
|
|
|
- // if (org.springframework.util.StringUtils.hasText(queryDto.getPayEndTime())) {
|
|
|
- // queryDto.setPayEndTime(queryDto.getPayEndTime() + " 23:59:59");
|
|
|
- // }
|
|
|
if (org.springframework.util.StringUtils.hasText(queryDto.getStartTime())) {
|
|
|
queryDto.setStartTime(queryDto.getStartTime() + " 00:00:00");
|
|
|
}
|
|
|
- // if (org.springframework.util.StringUtils.hasText(queryDto.getPayStartTime())) {
|
|
|
- // queryDto.setPayStartTime(queryDto.getPayStartTime() + " 00:00:00");
|
|
|
- // }
|
|
|
+
|
|
|
List<TbOrder> tbOrderIPage = appOrderDao.excelAllOrderAdmin(queryDto);
|
|
|
-// for (int i = 0; i < tbOrderIPage.size(); i++) {
|
|
|
-// List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>()
|
|
|
-// .eq("order_id", tbOrderIPage.get(i).getOrderId()));
|
|
|
-// tbOrderIPage.get(i).setOrderGoodsList(orderGoodsList);
|
|
|
-// }
|
|
|
ExcelData data = new ExcelData();
|
|
|
data.setName("订单列表");
|
|
|
List<String> titles = new ArrayList();
|
|
|
@@ -1556,17 +1485,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
row.add(order.getRiderPhone());
|
|
|
row.add(order.getReceivingTime());
|
|
|
row.add(order.getOrderNumber());
|
|
|
-// stringBuffer=new StringBuffer();
|
|
|
-// BigDecimal sumGoodsPrice=BigDecimal.ZERO;
|
|
|
-// List<OrderGoods> orderGoodsList = order.getOrderGoodsList();
|
|
|
-// for(int i=0;i<orderGoodsList.size();i++){
|
|
|
-// OrderGoods orderGoods = orderGoodsList.get(i);
|
|
|
-// stringBuffer.append(i + 1).append(". 商品名:").append(orderGoods.getGoodsName()).append(",数量:").append(orderGoods.getGoodsNum()).append(",规格:").append(orderGoods.getSkuMessage());
|
|
|
-// if(orderGoods.getGoodsPrice()!=null && orderGoods.getGoodsNum()!=null){
|
|
|
-// BigDecimal goodsPrice = orderGoods.getGoodsPrice().multiply(BigDecimal.valueOf(orderGoods.getGoodsNum()));
|
|
|
-// sumGoodsPrice=sumGoodsPrice.add(goodsPrice);
|
|
|
-// }
|
|
|
-// }
|
|
|
row.add(order.getDetail());
|
|
|
row.add(order.getSumPrice());
|
|
|
row.add(order.getCouponMoney());
|
|
|
@@ -1697,9 +1615,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
tbOrder.setShopName(goodsShop.getShopName());
|
|
|
tbOrder.setShopPhone(goodsShop.getPhone());
|
|
|
}
|
|
|
-// if (tbOrder.getOrderTypeExtra() == 2 && "2".equals(tbOrder.getIndentState())) {
|
|
|
-// tbOrder.setStatus(13);
|
|
|
-// }
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>().eq("order_id", tbOrder.getOrderId()));
|
|
|
tbOrder.setOrderGoodsList(orderGoodsList);
|
|
|
TbIndent tbIndent = tbIndentService.getOne(new QueryWrapper<TbIndent>().eq("order_id", tbOrder.getOrderId()));
|
|
|
@@ -1834,7 +1749,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
// 生成跑腿订单
|
|
|
tbIndentService.insertIndent(tbOrder);
|
|
|
|
|
|
-
|
|
|
//设置小程序消息推送
|
|
|
CommonInfo one = commonInfoService.findOne(269);
|
|
|
List<String> msgList = new ArrayList<>();
|
|
|
@@ -2552,7 +2466,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
|
|
|
@Override
|
|
|
public Result selectBuyGoods(Long userId, Long orderId) {
|
|
|
- // TbOrder tbOrder = appOrderDao.selectOne(new QueryWrapper<TbOrder>().eq("order_id", orderId).eq("user_id", userId));
|
|
|
TbOrder tbOrder = appOrderDao.selectBuyGoods(orderId, userId);
|
|
|
List<OrderGoods> orderGoodsList = orderGoodsDao.selectList(new QueryWrapper<OrderGoods>().eq("order_id", tbOrder.getOrderId()));
|
|
|
tbOrder.setOrderGoodsList(orderGoodsList);
|
|
|
@@ -3009,6 +2922,4 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
lock.unlock();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|