finish order detail and goods detail
| | |
| | | }) |
| | | @GetMapping(value = "/findOrderDetail/{orderId}") |
| | | public AjaxResult findOrderDetail(@PathVariable("orderId") Long orderId) { |
| | | return null; |
| | | OrderDetailVo orderDetail = sysOrderService.findApiOrderDetailByOrderId(orderId); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); |
| | | ajaxResult.putInMap("orderDetail", orderDetail); |
| | | return ajaxResult; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModel(value = "OrderDetailItemVo", description = "订单详情明细表") |
| | | public class OrderDetailItemVo { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | |
| | | @ApiModelProperty(value = "储值卡支付") |
| | | private BigDecimal cardPay; |
| | | |
| | | @ApiModelProperty(value = "欠款") |
| | | private BigDecimal arrears; |
| | | |
| | | @ApiModelProperty(value = "原价") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "折扣价格") |
| | | private BigDecimal zkPrice; |
| | | |
| | | @ApiModelProperty(value = "支付状态") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "订单业绩") |
| | | private List<OrderDetailAchieveItemVo> achieves; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public List<OrderDetailAchieveItemVo> getAchieves() { |
| | | return achieves; |
| | |
| | | public void setZkPrice(BigDecimal zkPrice) { |
| | | this.zkPrice = zkPrice; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public BigDecimal getArrears() { |
| | | return arrears; |
| | | } |
| | | |
| | | public void setArrears(BigDecimal arrears) { |
| | | this.arrears = arrears; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.app.vo; |
| | | |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | } |
| | | |
| | | public void setIsPresent(String isPresent) { |
| | | this.isPresent = isPresent; |
| | | if ("是".equals(isPresent)) { |
| | | this.isPresent = "1"; |
| | | } else { |
| | | this.isPresent = "0"; |
| | | } |
| | | } |
| | | |
| | | public String getUnit() { |
| | |
| | | import java.util.Map; |
| | | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.app.vo.OrderDetailAchieveItemVo; |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | int selectVipConsumeStatisticsTotal(@Param("record") AchieveNew achieveNew); |
| | | |
| | | UserAchieveVo selectUserAchieveByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("userId") Long userId); |
| | | |
| | | |
| | | List<OrderDetailAchieveItemVo> selectApiOrderItemAchieve(@Param("itemId") Long itemId); |
| | | } |
| | |
| | | List<OrderDetailVo> selectApiOrderListInPage(@Param("record") OrderListDto orderListDto, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | int selectApiOrderListTotal(@Param("record") OrderListDto orderListDto); |
| | | |
| | | OrderDetailVo selectApiOrderDetailById(@Param("orderId") Long orderId); |
| | | } |
| | |
| | | package com.matrix.system.hive.dao; |
| | | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.app.vo.OrderDetailItemVo; |
| | | import com.matrix.system.hive.bean.SysOrderItem; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | |
| | | public int deleteByOrderId(Long id); |
| | | |
| | | List<OrderDetailItemVo> selectApiOrderDetailItemsByOrderId(@Param("orderId") Long orderId); |
| | | } |
| | |
| | | List<OrderDetailVo> findApiOrderListInPage(OrderListDto orderListDto, PaginationVO pageVo); |
| | | |
| | | int findApiOrderListTotal(OrderListDto orderListDto); |
| | | |
| | | OrderDetailVo findApiOrderDetailByOrderId(Long orderId); |
| | | } |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.OrderListDto; |
| | | import com.matrix.system.app.vo.OrderDetailAchieveItemVo; |
| | | import com.matrix.system.app.vo.OrderDetailItemVo; |
| | | import com.matrix.system.app.vo.OrderDetailVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | |
| | | |
| | | @Autowired |
| | | private AchieveNewService achieveNewService; |
| | | |
| | | @Autowired |
| | | private AchieveNewDao achieveNewDao; |
| | | |
| | | @Autowired |
| | | private WarehouseDao warehouseDao; |
| | |
| | | public int findApiOrderListTotal(OrderListDto orderListDto) { |
| | | return sysOrderDao.selectApiOrderListTotal(orderListDto); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetailVo findApiOrderDetailByOrderId(Long orderId) { |
| | | OrderDetailVo orderDetail = sysOrderDao.selectApiOrderDetailById(orderId); |
| | | |
| | | if (orderDetail == null) { |
| | | throw new GlobleException("该订单不存在"); |
| | | } |
| | | |
| | | List<OrderDetailItemVo> items = orderItemDao.selectApiOrderDetailItemsByOrderId(orderId); |
| | | if (CollectionUtils.isNotEmpty(items)) { |
| | | for (OrderDetailItemVo item : items) { |
| | | List<OrderDetailAchieveItemVo> achieveItems = achieveNewDao.selectApiOrderItemAchieve(item.getId()); |
| | | item.setAchieves(achieveItems); |
| | | } |
| | | } |
| | | |
| | | orderDetail.setItems(items); |
| | | return orderDetail; |
| | | } |
| | | } |
| | |
| | | where sale_id=#{userId} |
| | | and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) |
| | | </select> |
| | | |
| | | <select id="selectApiOrderItemAchieve" resultType="com.matrix.system.app.vo.OrderDetailAchieveItemVo"> |
| | | select |
| | | b.su_name name, |
| | | IFNULL(a.card_cash, 0) + IFNULL(a.proj_cash, 0) + IFNULL(a.goods_cash, 0) achieve |
| | | from achieve_new a |
| | | inner join sys_users b on a.beault_id=b.su_id |
| | | where a.order_item_id=#{itemId} |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApiOrderDetailById" resultType="com.matrix.system.app.vo.OrderDetailVo"> |
| | | select |
| | | a.id orderId, |
| | | b.VIP_NAME vipName, |
| | | b.PHONE phone, |
| | | a.ORDER_NO orderNo, |
| | | c.su_name staffName, |
| | | a.cash_Pay cashPay, |
| | | a.card_Pay cardPay, |
| | | a.ZK_TOTAL needPay, |
| | | a.card_Pay + a.card_Pay realPay, |
| | | a.arrears arrears, |
| | | a.TOTAL - a.ZK_TOTAL discount, |
| | | a.STATU orderStatus |
| | | from sys_order a |
| | | inner join sys_vip_info b on a.VIP_ID=b.ID |
| | | left join sys_users c on a.STAFF_ID=c.su_id |
| | | where a.id=#{orderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | group by c.id ,f.id) t |
| | | </select> |
| | | |
| | | <select id="selectApiOrderDetailItemsByOrderId" resultType="com.matrix.system.app.vo.OrderDetailItemVo"> |
| | | select |
| | | a.id id, |
| | | b.name goodsName, |
| | | a.COUNT count, |
| | | a.cash_Pay cashPay, |
| | | a.card_Pay cardPay, |
| | | a.PRICE price, |
| | | a.ZK_PRICE zkPrice, |
| | | a.status status |
| | | from sys_order_item a |
| | | inner join shopping_goods b on a.goods_id=b.id |
| | | where a.ORDER_ID=#{orderId}; |
| | | </select> |
| | | |
| | | </mapper> |