diff --git a/src/main/java/com/peanut/modules/book/controller/PointController.java b/src/main/java/com/peanut/modules/book/controller/PointController.java index f6bbb70c..1bd1287e 100644 --- a/src/main/java/com/peanut/modules/book/controller/PointController.java +++ b/src/main/java/com/peanut/modules/book/controller/PointController.java @@ -75,6 +75,19 @@ public class PointController { return R.ok().put("page",pointList); } + /** + * 获取脉穴文章详情 + * @return + */ + @RequestMapping("/getPointDetail") + public R getPointDetail(@RequestBody Map map){ + Integer integer = Integer.valueOf(map.get("pointId").toString()); + PointEntity byId = pointService.getById(integer); + List strings = JSON.parseArray(byId.getImages(), String.class); + byId.setImageList(strings); + return R.ok().put("point",byId); + } + /** * 添加脉穴文章 * @return @@ -111,4 +124,41 @@ public class PointController { pointService.updateById(pointEntity); return R.ok(); } + + /** + * 获取脉穴分类列表通过父级id + * @param map + * @return + */ + @RequestMapping("/getPointCategoryByPid") + public R getPointCategoryByPid(@RequestBody Map map){ + Integer pointCategoryId = Integer.valueOf(map.get("id").toString()); + List categoryListByPid = pointCategoryService.getCategoryListByPid(pointCategoryId); + return R.ok().put("category",categoryListByPid); + } + + /** + * 获取脉穴文章标题列表通过分类id + * @param map + * @return + */ + @RequestMapping("/getPointsByCategoryId") + public R getPointsByCategoryId(@RequestBody Map map){ + Integer pointCategoryId = Integer.valueOf(map.get("pointCategoryId").toString()); + List points = pointService.getPoints(pointCategoryId); + return R.ok().put("points",points); + } + + /** + * 搜索脉穴标题列表 + * @param map + * @return + */ + @RequestMapping("/searchPointList") + public R searchPointList(@RequestBody Map map){ + String keywords = map.get("keywords").toString(); + List pointEntities = pointService.searchPoint(keywords); + return R.ok().put("points",pointEntities); + } + } diff --git a/src/main/java/com/peanut/modules/book/service/PointCategoryService.java b/src/main/java/com/peanut/modules/book/service/PointCategoryService.java index 1931db9e..598f79df 100644 --- a/src/main/java/com/peanut/modules/book/service/PointCategoryService.java +++ b/src/main/java/com/peanut/modules/book/service/PointCategoryService.java @@ -11,4 +11,6 @@ public interface PointCategoryService extends IService { List getCategoryList(); + List getCategoryListByPid(Integer id); + } diff --git a/src/main/java/com/peanut/modules/book/service/PointService.java b/src/main/java/com/peanut/modules/book/service/PointService.java index f1c43e4c..620d054a 100644 --- a/src/main/java/com/peanut/modules/book/service/PointService.java +++ b/src/main/java/com/peanut/modules/book/service/PointService.java @@ -11,4 +11,8 @@ public interface PointService extends IService { Page getPointList(Map map); + + List getPoints(Integer pointCategoryId); + + List searchPoint(String keywords); } diff --git a/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java index 9bf5ad5f..51cfe19d 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java @@ -410,6 +410,8 @@ public class BuyOrderServiceImpl extends ServiceImpl impl BigDecimal totalWeight = new BigDecimal(0); List commodityList = new ArrayList<>(); List buyOrderIdList = new ArrayList<>(); + Integer ln = 0; + String remark =""; for (BuyOrderProduct buyOrderProduct : buyOrderProductList) { buyOrderIdList.add(buyOrderProduct.getOrderId()); int productId = buyOrderProduct.getProductId(); @@ -422,10 +424,15 @@ public class BuyOrderServiceImpl extends ServiceImpl impl totalWeight = totalWeight.add( BigDecimal.valueOf(product.getWeight().doubleValue()).multiply(new BigDecimal(buyOrderProduct.getQuantity())).divide(BigDecimal.valueOf(1000),2,RoundingMode.HALF_UP) ); -// totalWeight = totalWeight.setScale(0, RoundingMode.UP);//对数值做增量舍,单位是g + if(ln>0){ + remark += commodity.getGoodsName(); + } commodityList.add(commodity); + ln++; } + + // 获取用户地址 Integer orderId = buyOrderProductList.get(0).getOrderId(); @@ -459,6 +466,7 @@ public class BuyOrderServiceImpl extends ServiceImpl impl expressOrder.setCity(buyOrder.getCity()); expressOrder.setCounty(buyOrder.getDistrict()); expressOrder.setAddress(buyOrder.getAddress()); + expressOrder.setRemark(remark); // 生成快递面单 ExpressOrderResponseVo response = expressOrderService.placeExpressOrder(expressOrder); String expressOrderSn = response.getOrder().getLogisticCode(); diff --git a/src/main/java/com/peanut/modules/book/service/impl/ExpressOrderServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/ExpressOrderServiceImpl.java index c2669f93..a4c0c938 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/ExpressOrderServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/ExpressOrderServiceImpl.java @@ -77,7 +77,7 @@ public class ExpressOrderServiceImpl extends ServiceImpl params = new HashMap<>(); diff --git a/src/main/java/com/peanut/modules/book/service/impl/PointCategoryServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/PointCategoryServiceImpl.java index 2a781fb3..1996b104 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/PointCategoryServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/PointCategoryServiceImpl.java @@ -32,4 +32,13 @@ public class PointCategoryServiceImpl extends ServiceImpl getCategoryListByPid(Integer id) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PointCategoryEntity::getPid,id); + wrapper.orderByDesc(PointCategoryEntity::getSort); + List list = list(wrapper); + return list; + } } diff --git a/src/main/java/com/peanut/modules/book/service/impl/PointServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/PointServiceImpl.java index e46e8ee7..0bc1374b 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/PointServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/PointServiceImpl.java @@ -43,11 +43,27 @@ public class PointServiceImpl extends ServiceImpl impleme return pointEntityPage; } + @Override + public List getPoints(Integer pointCategoryId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PointEntity::getPointCategoryId,pointCategoryId); + List list = list(wrapper); + return list; + } + @Override + public List searchPoint(String keywords) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.like(PointEntity::getTitle,keywords); + wrapper.orderByDesc(PointEntity::getSort); + List list = list(wrapper); + return list; + } - private void createIds(Integer id,List list){ + private void createIds(Integer id, List list){ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(PointCategoryEntity::getPid,id); + wrapper.orderByDesc(PointCategoryEntity::getSort); List pointCategoryEntities = pointCategoryDao.selectList(wrapper); for (PointCategoryEntity p :pointCategoryEntities){ createIds(p.getId(),list); diff --git a/src/main/resources/weChatConfig.properties b/src/main/resources/weChatConfig.properties index 4b45ba81..c95caf68 100644 --- a/src/main/resources/weChatConfig.properties +++ b/src/main/resources/weChatConfig.properties @@ -9,18 +9,18 @@ wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify # ?? url wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify # key pem -wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem +#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem #wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem -#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem +wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem # ??? wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3 # API v3 key wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF # ???? -wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem +#wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem #wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem -# wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem + wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem # ?? url -wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem +#wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem #wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem -#wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem \ No newline at end of file +wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem \ No newline at end of file