xiaoyong931011
2021-07-02 abf323cc9a96877ead8aa5e5caacff8c75e4d2e7
gc-shop/src/main/java/com/xzx/gc/shop/service/JhyService.java
@@ -3,6 +3,7 @@
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xzx.gc.common.utils.StringUtils;
@@ -36,13 +37,17 @@
    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());
        model.setAccount(name);
        model.setAccountPhone(accountPhone);
        List<QueryJhyOrderListVo> maps = jhyOrderMapper.queryOrderList(model);
        if(CollUtil.isNotEmpty(maps)){
            for(QueryJhyOrderListVo queryJhyOrderListVo : maps){
                String decode = StringUtils.decode(queryJhyOrderListVo.getName());
                queryJhyOrderListVo.setName(decode);
            }
        }
//        if(CollUtil.isNotEmpty(maps)){
//            for(QueryJhyOrderListVo queryJhyOrderListVo : maps){
//                String decode = StringUtils.decode(queryJhyOrderListVo.getName());
//                queryJhyOrderListVo.setName(decode);
//            }
//        }
        PageInfo pageInfo = new PageInfo(maps);
        int count = Convert.toInt(pageInfo.getTotal());
        Map<String, Object> map = new HashMap<>();
@@ -68,11 +73,11 @@
            for(JhyOrderItems jhyOrderItems : jhyOrderItemsList){
                JhyOrderItemsVo jhyOrderItemsVo = BeanUtil.copyProperties(jhyOrderItems, JhyOrderItemsVo.class);
                BigDecimal multiply = jhyOrderItemsVo.getPrice().multiply(new BigDecimal(40));
                BigDecimal multiplyScore = jhyOrderItemsVo.getPrice()
                        .multiply(jhyOrderItemsVo.getWeight()==null?BigDecimal.ZERO :jhyOrderItemsVo.getWeight())
                        .multiply(new BigDecimal(40));
//                BigDecimal multiplyScore = jhyOrderItemsVo.getPrice()
//                        .multiply(jhyOrderItemsVo.getWeight()==null?BigDecimal.ZERO :jhyOrderItemsVo.getWeight())
//                        .multiply(new BigDecimal(40));
                jhyOrderItemsVo.setPrice(multiply);
                jhyOrderItemsVo.setAllPrice(multiplyScore);
                jhyOrderItemsVo.setAllPrice(new BigDecimal(StrUtil.isEmpty(jhyOrderItemsVo.getScore())?"0":jhyOrderItemsVo.getScore()).setScale( 2, BigDecimal.ROUND_DOWN ));
                jhyOrderItemsVolist.add(jhyOrderItemsVo);
            }
        }