| | |
| | | import com.mzl.flower.service.flower.FlowerParamService; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | | import com.mzl.flower.service.payment.OrderService; |
| | | import com.mzl.flower.service.statistics.StatisticsService; |
| | | import com.mzl.flower.service.transport.TransportService; |
| | | import com.wechat.pay.java.service.payments.jsapi.model.PrepayResponse; |
| | | import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.ValidationException; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.HashMap; |
| | |
| | | |
| | | @Autowired |
| | | private TransportService transportService; |
| | | @Autowired |
| | | private StatisticsService statisticsService; |
| | | |
| | | @GetMapping("/category/tree") |
| | | @ApiOperation(value = "获取商品分类树") |
| | | public ResponseEntity<ReturnDataDTO<List<FlowerCategoryTreeDTO>>> selectCategoryTree(FlowerCategoryQueryDTO dto){ |
| | | public ResponseEntity<ReturnDataDTO<List<FlowerCategoryTreeDTO>>> selectCategoryTree(FlowerCategoryQueryDTO dto, HttpServletRequest request){ |
| | | statisticsService.addUserAccessRecord(request); |
| | | return returnData(R.SUCCESS.getCode(), categoryService.selectCustomerCategoryTree(dto)); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "id", value = "商品id", required = true, dataType = "Long", paramType = "query"), |
| | | @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"), |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<FlowerShowDTO>> getShowFlowerDetail(Long id, Long partnerId) { |
| | | public ResponseEntity<ReturnDataDTO<FlowerShowDTO>> getShowFlowerDetail(Long id, Long partnerId,HttpServletRequest request) { |
| | | statisticsService.addUserAccessRecord(request); |
| | | return returnData(R.SUCCESS.getCode(), flowerService.getShowFlowerDetail(id, partnerId)); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/order/commit") |
| | | @ApiOperation(value = "提交订单") |
| | | public ResponseEntity<ReturnDataDTO<?>> commitOrder(@RequestBody OrderCommitDTO dto){ |
| | | public ResponseEntity<ReturnDataDTO<?>> commitOrder(@RequestBody OrderCommitDTO dto) throws Exception { |
| | | Map<Long, PriceDTO > priceMap = new HashMap<>(); |
| | | PreOrderDTO p = orderService.processPreOrderInfo(dto.getFlowers(), priceMap); |
| | | Map map; |