Commit 807e7907 authored by libin's avatar libin

Merge remote-tracking branch 'origin/dev' into dev

parents c8806793 f9c614de
...@@ -17,8 +17,12 @@ import com.xxfc.platform.im.model.Comment; ...@@ -17,8 +17,12 @@ import com.xxfc.platform.im.model.Comment;
import com.xxfc.platform.im.model.Msg; import com.xxfc.platform.im.model.Msg;
import com.xxfc.platform.im.model.Praise; import com.xxfc.platform.im.model.Praise;
import com.xxfc.platform.im.vo.MsgVo; import com.xxfc.platform.im.vo.MsgVo;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.constant.ResCode; import com.xxfc.platform.universal.constant.ResCode;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -30,8 +34,12 @@ import org.springframework.data.mongodb.core.query.Criteria; ...@@ -30,8 +34,12 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
import static com.xxfc.platform.universal.constant.DictionaryKey.IM_TYPE;
@Service @Service
@Slf4j @Slf4j
public class MsgBiz { public class MsgBiz {
...@@ -44,6 +52,9 @@ public class MsgBiz { ...@@ -44,6 +52,9 @@ public class MsgBiz {
@Autowired @Autowired
ImQuestionBiz imQuestionBiz; ImQuestionBiz imQuestionBiz;
@Autowired
ThirdFeign thirdFeign;
/** /**
* 获取消息列表 * 获取消息列表
* *
...@@ -100,7 +111,7 @@ public class MsgBiz { ...@@ -100,7 +111,7 @@ public class MsgBiz {
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
ids.add(2); ids.add(2);
ids.add(4); ids.add(4);
Query query = new Query(Criteria.where("body.type").in(ids).and("count.praise").gt(1000)); Query query = new Query(Criteria.where("body.type").in(ids).and("count.praise").gt(getNumber()));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable); query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "count.praise")); query.with(new Sort(Sort.Direction.DESC, "count.praise"));
...@@ -304,4 +315,16 @@ public class MsgBiz { ...@@ -304,4 +315,16 @@ public class MsgBiz {
return commentVoList; return commentVoList;
} }
public Integer getNumber() {
Integer number = 0;
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
if(MapUtils.isNotEmpty(dictionaryMap)) {
Dictionary dictionary = dictionaryMap.get(IM_TYPE + "_" + DictionaryKey.MSG_LIMIT_NUMBER);
if (dictionary != null && StringUtils.isNotBlank(dictionary.getDetail())) {
number = Integer.parseInt(dictionary.getDetail());
}
}
return number;
}
} }
...@@ -193,7 +193,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -193,7 +193,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
} }
if (vehicle.getMileageLastUpdate() != null) { if (vehicle.getMileageLastUpdate() != null) {
//判断车辆公里数 //判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() <= vehicle.getMileageLastUpdate()) { if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() < vehicle.getMileageLastUpdate()) {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode(), ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc()); return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode(), ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc());
} }
} }
......
...@@ -144,15 +144,6 @@ public class OrderCancelBiz { ...@@ -144,15 +144,6 @@ public class OrderCancelBiz {
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
}}); }});
// List<OrderItem> otherOrderItems = orderItemBiz.selectByExample(new Example.Builder(OrderItem.class)
// .where(WeekendSqls.<OrderItem>custom().andNotEqualTo(OrderItem::getType, ItemTypeEnum.VEHICLE_MODEL.getCode())).build()
// );
//原退还押金
Integer freeDays = (null == orderItem.getCutNum())?0 :orderItem.getCutNum();
// BigDecimal freeDayAmount = BigDecimal.ZERO;
//如果超过出发时间,不能取消订单 //如果超过出发时间,不能取消订单
//根据时间处理goodsAmount //根据时间处理goodsAmount
//获取出发时间 到现在 距离时间 //获取出发时间 到现在 距离时间
...@@ -205,9 +196,6 @@ public class OrderCancelBiz { ...@@ -205,9 +196,6 @@ public class OrderCancelBiz {
}else { }else {
// //没到出车时间 // //没到出车时间
// //判断是否使用免费天数,并且进行扣款 // //判断是否使用免费天数,并且进行扣款
// if(freeDays > 0) {
// freeDayAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
// }
//违约金封顶 租车身份价 * 2天 //违约金封顶 租车身份价 * 2天
BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal(2+ "")); BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal(2+ ""));
......
...@@ -217,7 +217,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -217,7 +217,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
BigDecimal vehicleAmount = BigDecimal.ZERO; BigDecimal vehicleAmount = BigDecimal.ZERO;
BigDecimal driverAmount = BigDecimal.ZERO; BigDecimal driverAmount = BigDecimal.ZERO;
BigDecimal damageSafeAmount = BigDecimal.ZERO; BigDecimal damageSafeAmount = BigDecimal.ZERO;
// BigDecimal modelAmount = BigDecimal.ZERO;
BigDecimal couponAmount = BigDecimal.ZERO; BigDecimal couponAmount = BigDecimal.ZERO;
String couponDesc = ""; String couponDesc = "";
Integer vehicleDayNum = 0; Integer vehicleDayNum = 0;
......
...@@ -7,6 +7,15 @@ public class DictionaryKey { ...@@ -7,6 +7,15 @@ public class DictionaryKey {
*/ */
public static final String APP_ORDER ="APP_ORDER"; public static final String APP_ORDER ="APP_ORDER";
/**
* IM类型
*/
public static final String IM_TYPE ="IM_TYPE";
/**
* IM限制条数
*/
public static final String MSG_LIMIT_NUMBER ="MSG_LIMIT_NUMBER";
/** /**
* 支付 * 支付
*/ */
......
...@@ -55,7 +55,6 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> { ...@@ -55,7 +55,6 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
try { try {
PageDataVO<VehicleModelVo> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(), PageDataVO<VehicleModelVo> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(),
vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc)); vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc));
return ObjectRestResponse.succ(mPageDataVO); return ObjectRestResponse.succ(mPageDataVO);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment