| | |
| | | import com.xzx.gc.order.mapper.*; |
| | | import com.xzx.gc.order.vo.JhyOrderDetailsVo; |
| | | import com.xzx.gc.order.vo.JhyOrderListVo; |
| | | import com.xzx.gc.order.vo.JhyStatusCountVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | JhyOrderDetailsVo detailsVo = new JhyOrderDetailsVo(); |
| | | BeanUtil.copyProperties(order, detailsVo); |
| | | |
| | | detailsVo.setLongitude(order.getLongitude()); |
| | | detailsVo.setLatitude(order.getLatitude()); |
| | | detailsVo.setAddress(order.getArea() + order.getAddress()); |
| | | detailsVo.setTotalPrice(total); |
| | | detailsVo.setItems(items); |
| | |
| | | order.setStatus(JhyOrder.ORDER_STATUS_CANCEL); |
| | | } |
| | | |
| | | order.setJhyId(null); |
| | | jhyOrderMapper.updateByPrimaryKey(order); |
| | | } |
| | | |
| | |
| | | userAccount.setCollectScore(userScore.add(totalScore).setScale( 0, BigDecimal.ROUND_DOWN ).toString()); |
| | | accountMapper.updateByPrimaryKey(userAccount); |
| | | |
| | | distribService.distribRecord(order.getId(), confirmDto.getUserId()); |
| | | distribService.distribRecord(order.getId(), order.getUserId()); |
| | | } |
| | | |
| | | public Map<Integer, Integer> orderStatusCount(Integer type, String userId) { |
| | | List<JhyStatusCountVo> count = jhyOrderMapper.selectOrderStatusCount(type, userId); |
| | | |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | for (int i = 1; i < 6; i++) { |
| | | if (CollUtil.isNotEmpty(count)) { |
| | | boolean flag = false; |
| | | for (JhyStatusCountVo jhyStatusCountVo : count) { |
| | | if (i == jhyStatusCountVo.getStatus()) { |
| | | map.put(i, jhyStatusCountVo.getCnt()); |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (flag) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | map.put(i, 0); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | } |