xiaoyong931011
2021-07-07 fced9fc9ee879552238a1c83f884c7fa61ba6c07
gc-shop/src/main/java/com/xzx/gc/shop/service/JhyService.java
@@ -7,8 +7,10 @@
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xzx.gc.common.utils.StringUtils;
import com.xzx.gc.entity.JhyOrder;
import com.xzx.gc.entity.JhyOrderItems;
import com.xzx.gc.entity.ScoreOrderDetails;
import com.xzx.gc.shop.dto.CancelJhyOrderDto;
import com.xzx.gc.shop.dto.QueryJhyOrderListDto;
import com.xzx.gc.shop.mapper.JhyOrderItemsMapper;
import com.xzx.gc.shop.mapper.JhyOrderMapper;
@@ -38,10 +40,18 @@
    public Map<String, Object> queryOrderList(QueryJhyOrderListDto model) {
        PageHelper.startPage(model.getPage(), model.getLimit());
        String accountPhone = model.getAccount();
        String name = StrUtil.isEmpty(model.getAccount())?model.getAccount():StringUtils.encode(model.getAccount());
//        String name = StrUtil.isEmpty(model.getAccount())?model.getAccount():StringUtils.encode(model.getAccount());
        String name = model.getAccount();
        model.setAccount(name);
        model.setAccountPhone(accountPhone);
        List<QueryJhyOrderListVo> maps = jhyOrderMapper.queryOrderList(model);
        if(CollUtil.isNotEmpty(maps)){
            for(QueryJhyOrderListVo queryJhyOrderListVo : maps){
                Long id = queryJhyOrderListVo.getId();
                List<JhyOrderItemsVo> jhyOrderItemsVos = jhyOrderItemsMapper.selectByOrderId(id);
                queryJhyOrderListVo.setJhyOrderItemsVos(jhyOrderItemsVos);
            }
        }
//        if(CollUtil.isNotEmpty(maps)){
//            for(QueryJhyOrderListVo queryJhyOrderListVo : maps){
//                String decode = StringUtils.decode(queryJhyOrderListVo.getName());
@@ -85,4 +95,11 @@
        return viewJhyOrderVo;
    }
    public void cancelJhyOrder(CancelJhyOrderDto model) {
        Long id = model.getId();
        JhyOrder jhyOrder = jhyOrderMapper.selectByPrimaryKey(id);
        jhyOrder.setStatus(JhyOrder.ORDER_STATUS_CANCEL);
        jhyOrderMapper.updateByPrimaryKey(jhyOrder);
    }
}