Commit f54daa7f by zhangjing

fixed BUG#20489

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@23854 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 0d6f7379
......@@ -4,28 +4,6 @@
*/
package com.glsx.ordercenter.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
......@@ -33,53 +11,34 @@ import com.github.pagehelper.util.StringUtil;
import com.glsx.common.constants.Constants;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.feign.client.UserClient;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page;
import com.glsx.common.utils.PropertiesUtil;
import com.glsx.common.utils.StringUtils;
import com.glsx.common.utils.UserUtils;
import com.glsx.common.utils.*;
import com.glsx.common.utils.wehcat.MiniProgram;
import com.glsx.common.utils.wehcat.TemplateData;
import com.glsx.common.utils.wehcat.WechatTemplate;
import com.glsx.common.utils.wehcat.WechatUtils;
import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.constants.OrderFileTypeEnum;
import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.BiddingOrderResp;
import com.glsx.ordercenter.dto.MachanicInfo;
import com.glsx.ordercenter.dto.MerchantInfo;
import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.dto.ServiceInfo;
import com.glsx.ordercenter.constants.*;
import com.glsx.ordercenter.dto.*;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.mapper.DictionaryDataMapper;
import com.glsx.ordercenter.mapper.SysMerchantMapper;
import com.glsx.ordercenter.mapper.SysOrderBiddingMapper;
import com.glsx.ordercenter.mapper.SysOrderBiddingRecordsMapper;
import com.glsx.ordercenter.mapper.SysOrderFileMapper;
import com.glsx.ordercenter.mapper.SysOrderLabelMapper;
import com.glsx.ordercenter.mapper.SysOrderMapper;
import com.glsx.ordercenter.mapper.SysOrderServiceTypeMapper;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.mapper.*;
import com.glsx.ordercenter.mapper.biddingorder.SysBiddingOrderMapper;
import com.glsx.ordercenter.pojo.SysArea;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderBiddingRecords;
import com.glsx.ordercenter.pojo.SysOrderBiddingRecordsExample;
import com.glsx.ordercenter.pojo.SysOrderFile;
import com.glsx.ordercenter.pojo.SysOrderServiceType;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.VisibleServiceProviderVo;
import com.glsx.ordercenter.pojo.*;
import com.glsx.ordercenter.pojo.user.SysMerchantExample;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.service.IAreaService;
import com.glsx.ordercenter.service.IOrderBiddingService;
import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.utils.OrderUtil;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author Zheng Xiajun
......@@ -193,10 +152,6 @@ public class OrderBiddingServiceImpl implements IOrderBiddingService {
order.setMachanicInfo(machanicInfo);
}
}
//超过竞价截止时间的订单, 无人报价时长置空
if (Objects.isNull(order.getQuoteLastTime()) || order.getQuoteLastTime().before(new Date())) {
order.setNoBidingDuration(mask);
}
//服务类型
List<SysOrderServiceType> orderServiceTypes = orderServiceTypeMapper.selectOrderServiceItems(order.getId());
order.setServiceItems(orderServiceTypes);
......@@ -221,7 +176,6 @@ public class OrderBiddingServiceImpl implements IOrderBiddingService {
order.setSurroundingPicture(StringUtils.join(fileUrls, BizConstants.SEPARATOR));
}
}
orderList.sort(Comparator.comparing(SysOrder::getNoBidingDuration).reversed());
return orderList;
}
......
......@@ -17,7 +17,10 @@
so.shop_id shopId,
so.address address,
so.create_time createTime,
CONCAT(TIMEDIFF(NOW(),so.create_time),'') noBidingDuration,
IF(so.active_status=15,CONCAT(
TIMEDIFF(NOW(), so.create_time),
''
),'0:0:0') noBidingDuration,
so.mechanic_id mechanicId,
so.install_device_type installDeviceType,
so.service_type serviceType,
......@@ -236,7 +239,7 @@
and (sm.name like "%"#{machanicInfo}"%" or sm.phone_number like "%"#{machanicInfo}"%" )
and sm.user_type = 3
</if>
and so.order_type=4 group by so.id order by noBidingDuration desc
and so.order_type=4 group by so.id order by TIME_TO_SEC(noBidingDuration) desc
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!