Commit f9c614de authored by jiaorz's avatar jiaorz

Merge branch 'master-modify-cutAmount' into dev

parents ec7ac5e2 d2147ba3
......@@ -17,8 +17,12 @@ import com.xxfc.platform.im.model.Comment;
import com.xxfc.platform.im.model.Msg;
import com.xxfc.platform.im.model.Praise;
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.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,8 +34,12 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
import static com.xxfc.platform.universal.constant.DictionaryKey.IM_TYPE;
@Service
@Slf4j
public class MsgBiz {
......@@ -44,6 +52,9 @@ public class MsgBiz {
@Autowired
ImQuestionBiz imQuestionBiz;
@Autowired
ThirdFeign thirdFeign;
/**
* 获取消息列表
*
......@@ -100,7 +111,7 @@ public class MsgBiz {
List<Integer> ids = new ArrayList<>();
ids.add(2);
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();
query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
......@@ -304,4 +315,16 @@ public class MsgBiz {
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;
}
}
......@@ -144,15 +144,6 @@ public class OrderCancelBiz {
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
//获取出发时间 到现在 距离时间
......@@ -205,9 +196,6 @@ public class OrderCancelBiz {
}else {
// //没到出车时间
// //判断是否使用免费天数,并且进行扣款
// if(freeDays > 0) {
// freeDayAmount = orderItem.getUnitPrice().multiply(new BigDecimal(orvd.getFreeDays()+ ""));
// }
//违约金封顶 租车身份价 * 2天
BigDecimal topAmount = orderItem.getUnitPrice().multiply(new BigDecimal(2+ ""));
......
......@@ -217,7 +217,6 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
BigDecimal vehicleAmount = BigDecimal.ZERO;
BigDecimal driverAmount = BigDecimal.ZERO;
BigDecimal damageSafeAmount = BigDecimal.ZERO;
// BigDecimal modelAmount = BigDecimal.ZERO;
BigDecimal couponAmount = BigDecimal.ZERO;
String couponDesc = "";
Integer vehicleDayNum = 0;
......
......@@ -7,6 +7,15 @@ public class DictionaryKey {
*/
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";
/**
* 支付
*/
......
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