This commit is contained in:
wuchunlei
2023-12-12 14:02:35 +08:00
8 changed files with 80 additions and 122 deletions

View File

@@ -21,7 +21,7 @@ public class TGDZ {
public static final Map<String,String> ftbf_d= new HashMap<String,String>(){{
put("","公孙");
put("","坤传");
put("","申脉");
put("","内关");
put("","照海");
put("","临泣");
@@ -29,7 +29,7 @@ public class TGDZ {
put("","外关");
put("","后溪");
put("","公孙");
put("","坤传");
put("","申脉");
}};
public static final String[] lq = {"厥阴","少阴","太阴","少阳","阳明","太阳"};
@@ -45,7 +45,7 @@ public class TGDZ {
put("己寅",Arrays.asList("小海"));
put("己辰",Arrays.asList("支沟"));
put("己巳",Arrays.asList("隐白"));
put("己午",Arrays.asList("(阳溪)"));
put("己午",Arrays.asList("阳溪"));
put("己未",Arrays.asList("鱼际"));
put("己酉",Arrays.asList("太溪","太白*"));
put("己亥",Arrays.asList("中封"));
@@ -72,7 +72,7 @@ public class TGDZ {
put("辛寅",Arrays.asList("天井"));
put("辛卯",Arrays.asList("少商"));
put("辛巳",Arrays.asList("然谷"));
put("辛午",Arrays.asList("(临泣)"));
put("辛午",Arrays.asList("临泣"));
put("辛未",Arrays.asList("太冲","太渊*"));
put("辛酉",Arrays.asList("灵道"));
put("辛亥",Arrays.asList("阴陵泉"));
@@ -86,7 +86,7 @@ public class TGDZ {
put("壬丑",Arrays.asList("曲泽"));
put("壬寅",Arrays.asList("至阴"));
put("壬辰",Arrays.asList("侠溪"));
put("壬巳",Arrays.asList("(太冲)"));
put("壬巳",Arrays.asList("太冲"));
put("壬午",Arrays.asList("后溪","京骨*","阳池*"));
put("壬申",Arrays.asList("解溪"));
put("壬戍",Arrays.asList("曲池"));

View File

@@ -184,86 +184,6 @@ public class BuyOrderController {
public R buySave(@RequestBody BuyOrder buyOrder) throws IOException {
return R.error("app版本太低请升级后再购买");
// 获取订单详情
// List<BuyOrderDetail> buyOrderDetails = buyOrder.getProducts();
// // 订单总金额
// BigDecimal totalPrice = new BigDecimal(0);
// // 遍历商品总价计算
// for (BuyOrderDetail buyOrderDetail : buyOrderDetails) {
// Integer productId = buyOrderDetail.getProductId();
// int quantity = buyOrderDetail.getQuantity();
// ShopProduct product = shopProductService.getById(productId);
// BigDecimal price = getRealPrice(product);
// if (!handleStock(buyOrderDetail, product)) {
// return R.error(500, "库存不足");
// }
// totalPrice = totalPrice.add(price.multiply(BigDecimal.valueOf(quantity)));
// buyOrderDetail.setProductName(product.getProductName());
// buyOrderDetail.setProductPrice(product.getPrice());
// int originWeight = product.getWeight();
// int originWeightIntValue = originWeight / 100;
// int originWeightDecimalValue = originWeightIntValue % 100;
// buyOrderDetail.setWeight(BigDecimal.valueOf(originWeightIntValue).add(BigDecimal.valueOf(originWeightDecimalValue).divide(new BigDecimal(100),
// MathContext.DECIMAL64)));
// buyOrderDetail.setProductUrl(product.getProductImages());
// buyOrderDetail.setOrderStatus(Constants.ORDER_STATUS_TO_BE_PAID);
// }
//
// totalPrice = totalPrice.subtract(useCouponAmount(buyOrder));
// totalPrice = totalPrice.add(getShoppingAmount(buyOrder));
// String orderSn = IdWorker.getTimeId().substring(0, 32);
// buyOrder.setOrderSn(orderSn);
// buyOrder.setPaymentDate(new Date());
// QueryWrapper<UserAddress> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("id", buyOrder.getAddressId());
// UserAddress userAddress = userAddressService.getOne(queryWrapper);
// UserAddressVo vo = new UserAddressVo();
// vo = userAddressService.getAddressName(vo, userAddress.getRegionCode());
// buyOrder.setProvince(vo.getProvince());
// buyOrder.setCity(vo.getCity());
// buyOrder.setDistrict(vo.getCounty());
// buyOrder.setAddress(vo.getDetailAddress());
// buyOrderService.save(buyOrder);
//
// for (BuyOrderDetail buyOrderDetail : buyOrderDetails) {
// buyOrderDetail.setOrderId(buyOrder.getOrderId());
// buyOrderDetail.setUserId(buyOrder.getUserId());
// if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
// handleBuyCart(buyOrder, buyOrderDetail);
// }
// }
// buyOrderDetailService.saveBatch(buyOrderDetails);
// // 1. 虚拟币支付
// if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
// buyOrder.setOrderStatus(Constants.ORDER_STATUS_TO_BE_SHIPPED);
// MyUserEntity user = this.myUserService.getById(buyOrder.getUserId());
// if (usePeanutCoin(user, totalPrice)) {
// // 更新订单状态
// buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0");
// recordTransaction(buyOrder, user, totalPrice);
// addEbookToUser(buyOrderDetails, buyOrder);
// } else {
// return R.error(500, "花生币余额不足!");
// }
// }
// // 2. 微信支付
// if (Constants.PAYMENT_METHOD_WECHAT_PAY.equals(buyOrder.getPaymentMethod())) {
// rabbitTemplate.convertAndSend(
// DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
// DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
// buyOrder.getOrderId(),
// messagePostProcessor()
// );
// WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
// paymentInfo.setOrderSn(orderSn);
// paymentInfo.setBuyOrderId(buyOrder.getOrderId());
// paymentInfo.setTotalAmount(totalPrice);
// wxpayService.prepay(paymentInfo);
// }
// Map<String, Object> result = new HashMap<>();
// result.put("orderSn", buyOrder.getOrderSn());
// result.put("money", totalPrice);
// return R.ok(result);
}
/**

View File

@@ -7,6 +7,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.peanut.modules.book.vo.response.ConsigneeVo;
import lombok.Data;
/**
@@ -185,4 +186,7 @@ public class BuyOrder implements Serializable {
private List<ExpressOrder> expressList;
private int addressModified;
@TableField(exist = false)
private ConsigneeVo consigneeVo;
}

View File

@@ -53,4 +53,6 @@ public class BuyOrderProduct {
@TableField(exist = false)
private ShopProduct product;
@TableField(exist = false)
private ExpressOrder expressOrder;
}

View File

@@ -365,7 +365,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
wrapper.eq(StringUtils.isNotBlank(requestVo.getOrderStatus()),BuyOrder::getOrderStatus,requestVo.getOrderStatus());
wrapper.gt(requestVo.getStartTime()!=null,BuyOrder::getCreateTime,requestVo.getStartTime());
wrapper.lt(requestVo.getEndTime()!=null,BuyOrder::getCreateTime,requestVo.getEndTime());
wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()));
wrapper.orderByDesc(BuyOrder::getCreateTime);
wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()).or().like(BuyOrder::getShippingUser,requestVo.getSearchKeyWord()).or().like(BuyOrder::getUserPhone,requestVo.getSearchKeyWord()));
if(StringUtils.isNotBlank(requestVo.getProductName())){
MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>();
buyOrderProductMPJLambdaWrapper.selectAll(BuyOrderProduct.class);
@@ -383,36 +384,51 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
ShopProduct byId = shopProductService.getById(b1.getProductId());
byId.setBooks(shopProductBookService.getBookByProductId(byId.getProductId()));
b1.setProduct(byId);
b1.setExpressOrder(expressOrderDao.selectById(b1.getExpressOrderId()));
}
b.setProductList(buyOrderProducts);
//设置快递信息传递给前端
ConsigneeVo consigneeVo = new ConsigneeVo();
consigneeVo.setConsigneeName(b.getShippingUser());
consigneeVo.setConsigneeMobile(b.getUserPhone());
City city = cityService.getOne(new LambdaQueryWrapper<City>().eq(City::getCityName, b.getCity()));
consigneeVo.setCity(city.getCityName());
consigneeVo.setCityCode(city.getRegionCode());
County county = countyService.getOne(new LambdaQueryWrapper<County>().eq(County::getCountyName,b.getDistrict()).eq(County::getCityId,city.getCityId()));
consigneeVo.setCounty(county.getCountyName());
consigneeVo.setCountyCode(county.getRegionCode());
Province province = provinceService.getOne(new LambdaQueryWrapper<Province>().eq(Province::getProvId, city.getProvId()));
consigneeVo.setProvince(province.getProvName());
consigneeVo.setProvinceCode(province.getRegionCode());
b.setConsigneeVo(consigneeVo);
//添加快递包裹信息
LambdaQueryWrapper<BuyOrderProduct> b_wrapper = new LambdaQueryWrapper<>();
b_wrapper.eq(BuyOrderProduct::getOrderId,b.getOrderId());
b_wrapper.gt(BuyOrderProduct::getExpressOrderId,0);
List<Integer> collect = buyOrderProductService.getBaseMapper().selectList(b_wrapper).stream().map(BuyOrderProduct::getExpressOrderId).collect(Collectors.toList());
if(collect.size()>0){
List<ExpressOrder> expressOrders = expressOrderService.getBaseMapper().selectList(new LambdaQueryWrapper<ExpressOrder>().in(ExpressOrder::getId, collect));
for (ExpressOrder e : expressOrders){
MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>();
buyOrderProductMPJLambdaWrapper.selectAll(ShopProduct.class);
buyOrderProductMPJLambdaWrapper.select(BuyOrderProduct::getQuantity);
buyOrderProductMPJLambdaWrapper.select(BuyOrder::getOrderSn);
buyOrderProductMPJLambdaWrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,BuyOrderProduct::getProductId);
buyOrderProductMPJLambdaWrapper.leftJoin(BuyOrder.class,BuyOrder::getOrderId,BuyOrderProduct::getOrderId);
buyOrderProductMPJLambdaWrapper.eq(BuyOrderProduct::getExpressOrderId,e.getId());
List<ShopProduct> shopProducts = buyOrderProductDao.selectJoinList(ShopProduct.class, buyOrderProductMPJLambdaWrapper);
for(ShopProduct s : shopProducts){
MPJLambdaWrapper<ShopProductBookEntity> shopProductBookEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
shopProductBookEntityMPJLambdaWrapper.selectAll(BookEntity.class);
shopProductBookEntityMPJLambdaWrapper.leftJoin(BookEntity.class,BookEntity::getId,ShopProductBookEntity::getBookId);
shopProductBookEntityMPJLambdaWrapper.eq(ShopProductBookEntity::getProductId,s.getProductId());
List<BookEntity> bookEntities = shopProductBookDao.selectJoinList(BookEntity.class, shopProductBookEntityMPJLambdaWrapper);
s.setBooks(bookEntities);
}
e.setProducts(shopProducts);
}
b.setExpressList(expressOrders);
}
// LambdaQueryWrapper<BuyOrderProduct> b_wrapper = new LambdaQueryWrapper<>();
// b_wrapper.eq(BuyOrderProduct::getOrderId,b.getOrderId());
// b_wrapper.gt(BuyOrderProduct::getExpressOrderId,0);
// List<Integer> collect = buyOrderProductService.getBaseMapper().selectList(b_wrapper).stream().map(BuyOrderProduct::getExpressOrderId).collect(Collectors.toList());
// if(collect.size()>0){
// List<ExpressOrder> expressOrders = expressOrderService.getBaseMapper().selectList(new LambdaQueryWrapper<ExpressOrder>().in(ExpressOrder::getId, collect));
// for (ExpressOrder e : expressOrders){
// MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>();
// buyOrderProductMPJLambdaWrapper.selectAll(ShopProduct.class);
// buyOrderProductMPJLambdaWrapper.select(BuyOrderProduct::getQuantity);
// buyOrderProductMPJLambdaWrapper.select(BuyOrder::getOrderSn);
// buyOrderProductMPJLambdaWrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,BuyOrderProduct::getProductId);
// buyOrderProductMPJLambdaWrapper.leftJoin(BuyOrder.class,BuyOrder::getOrderId,BuyOrderProduct::getOrderId);
// buyOrderProductMPJLambdaWrapper.eq(BuyOrderProduct::getExpressOrderId,e.getId());
// List<ShopProduct> shopProducts = buyOrderProductDao.selectJoinList(ShopProduct.class, buyOrderProductMPJLambdaWrapper);
// for(ShopProduct s : shopProducts){
// MPJLambdaWrapper<ShopProductBookEntity> shopProductBookEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
// shopProductBookEntityMPJLambdaWrapper.selectAll(BookEntity.class);
// shopProductBookEntityMPJLambdaWrapper.leftJoin(BookEntity.class,BookEntity::getId,ShopProductBookEntity::getBookId);
// shopProductBookEntityMPJLambdaWrapper.eq(ShopProductBookEntity::getProductId,s.getProductId());
// List<BookEntity> bookEntities = shopProductBookDao.selectJoinList(BookEntity.class, shopProductBookEntityMPJLambdaWrapper);
// s.setBooks(bookEntities);
// }
// e.setProducts(shopProducts);
// }
// b.setExpressList(expressOrders);
// }
}
return buyOrderPage;
}

View File

@@ -162,7 +162,15 @@ public class PointServiceImpl extends ServiceImpl<PointDao, PointEntity> impleme
k="列缺";
} else if (s=="临泣") {
k="外关";
}else{
}else if (s=="内关") {
k="公孙";
}else if (s=="后溪") {
k="申脉";
}else if (s=="列缺") {
k="照海";
}else if (s=="外关") {
k="临泣";
} else{
k="";
}
HashMap<String, Object> flag = new HashMap<>();
@@ -208,7 +216,15 @@ public class PointServiceImpl extends ServiceImpl<PointDao, PointEntity> impleme
k="列缺";
} else if (s=="临泣") {
k="外关";
}else{
}else if (s=="内关") {
k="公孙";
}else if (s=="后溪") {
k="申脉";
}else if (s=="列缺") {
k="照海";
}else if (s=="外关") {
k="临泣";
} else{
k="";
}
HashMap<String, Object> flag = new HashMap<>();

View File

@@ -189,12 +189,8 @@ public class AliPayServiceImpl implements AliPayService {
if ("order".equals(subject)) {
BuyOrder orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrder>().eq("order_sn", oldPayZfbOrderEntity.getRelevanceoid()));
BigDecimal realMoney = orderEntity.getRealMoney();
BigDecimal bigDecimal = new BigDecimal(oldPayZfbOrderEntity.getBuyerPayAmount());
//更新 订单 记录
if (bigDecimal.compareTo(realMoney) == 0) {
buyOrderService.updateOrderStatus(Integer.valueOf(customerid),oldPayZfbOrderEntity.getRelevanceoid(),"0");
}
buyOrderService.updateOrderStatus(Integer.valueOf(customerid),oldPayZfbOrderEntity.getRelevanceoid(),"0");
/* 记录用户购买的书籍 */
// 查询订单的所有 book_id

View File

@@ -67,7 +67,7 @@
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -94,7 +94,7 @@
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -210,6 +210,10 @@
<!-- &lt;!&ndash; 4.2 生产环境:输出到文档&ndash;&gt;-->
<springProfile name="test,prod">
<logger name="com.peanut" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
</logger>
<root level="info">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="ERROR_FILE"/>