| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.List; |
| | | |
| | |
| | | @GetMapping(value = "/detail/{id}") |
| | | public R<TPhysicalGoodsOrder> detail(@PathVariable("id") Long id) { |
| | | TPhysicalGoodsOrder order = tPhysicalGoodsOrderService.getById(id); |
| | | TPhysicalGoods goods = tPhysicalGoodsService.getById(order.getPhysicalGoodsId()); |
| | | order.setPhysicalGoodsName(goods.getName()); |
| | | order.setPhysicalGoodsCover(goods.getCoverImage()); |
| | | order.setPhysicalGoodsPrice(goods.getTotalPrice()); |
| | | order.setPhysicalGoodsIntro(goods.getIntroduction()); |
| | | String physicalGoods = order.getPhysicalGoods(); |
| | | JSONObject jsonObject = JSONObject.parseObject(physicalGoods); |
| | | // TPhysicalGoods goods = tPhysicalGoodsService.getById(order.getPhysicalGoodsId()); |
| | | order.setPhysicalGoodsName(jsonObject.getString("name")); |
| | | order.setPhysicalGoodsCover(jsonObject.getString("coverImage")); |
| | | order.setPhysicalGoodsPrice(new BigDecimal(jsonObject.getString("totalPrice")).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | order.setPhysicalGoodsIntro(jsonObject.getString("introduction")); |
| | | return R.ok(order); |
| | | } |
| | | |